Part 01 / Software & machine learning
01 / 09Write your own arm sim
Model a servo whose firmware you can’t read.
Build a four-joint arm simulator from the manipulator equation up, with a motor, a shared supply and a firmware position loop behind every joint. Check the rigid body and the motor against numbers you can derive by hand before any closed loop runs.
The goal for this build
What you’ll be able to do.
- Write forward kinematics and the manipulator equation for a four-joint arm, and check each term by hand.
- Model each servo as a DC motor behind a 345:1 gearbox, including the rotor inertia the gearbox reflects.
- Model the shared 12 V supply and a firmware position loop whose stiffness comes from BAM, not from Menagerie’s gains.
- Validate the sim with four checks and state what they leave unvalidated.
What to have ready
- Solid Python
- Matrix basics: products, transposes and inverses
- Derivative intuition: rates, slopes and the chain rule
- A laptop. Part 1 needs no hardware, so the kit can wait until Module 6
Free account
Read the lesson, run the lab, pass the gate.
The whole course is free. Create an account to unlock the lesson, the build lab, the task and the gate command for this module, and to download the starter kit.
03 / Prove it
Keep the evidence.
Then run the gate.
What you ship
- sim/ with a pure step() and a Params dataclass holding link lengths, masses, inertias, servo constants, friction and the loop mapping
- Servo, shared-supply and firmware layers, with BAM’s fit scaled to 12 V and a source for every constant
- Plots for the four gate checks, the explicit Euler drift and the BAM-versus-Menagerie sag
- Wave hello plots of amplitude and lag against frequency
- A Module 1 line in PROGRESS.md
- In a stretched horizontal pose, the holding torque at each pitch joint (shoulder, elbow and wrist) equals the summed m·g·r of everything outboard of it within 1%. The base turns about a vertical axis and holds no gravity torque.
- With friction and servos off, a passive swing conserves energy within 0.1% over 10 s.
- The course’s torque-step excitation on each joint tracks MuJoCo within 0.5° over 0.5 s, with friction and servo terms off in both.
- The servo model reproduces the datasheet’s stall torque and no-load speed at 12 V within 5%.
- None of these checks touches the closed position loop, which stays unvalidated until Module 8.
With a free account: the gate command and how to record your evidence.
The story behind the build
Episode companions.
Written companions are available now. Recordings and customer access are forthcoming.
Made it through the lesson?
Save your reading progress here. Record your gate result in your project.