Robotics from Scratch is where I learn and build robotics: one project at a time, each asking a single question and ending with a demo. The first ones are about small biped robots shaped like ducks.
How each project works
The projects lean towards uncommon physics, problems from everyday life and frontier methods. Each one lives in its own folder, and every one renders through the same demo kit, so all of them share a look and produce the same three things: a short looping GIF, a longer video and a chart.
One rule matters more than the rest. No number goes into a README, a card or a post unless code in the repository measured it. Each project has a report script that prints every number its write-up uses.SIDENOTEThat rule applies to this page too. Every figure here comes from those reports.
Everything so far runs in simulation, in MuJoCo.
01 · What happens between the IMU and the motors
The first project traces a walking robot's brain, 50 times a second, through two 14-joint bipeds:
| Open Duck Mini v2 | Microduck | |
|---|---|---|
| Origin | Open-source, 3D-printed | Pollen Robotics, its successor |
| Mass in the model | 2.107 kg | 0.737 kg |
| Policy input | 101 values | 61 values |
| Network | 101 → 512 → 256 → 128 → 28 | 61 → 512 → 256 → 128 → 14 |
I ported each vendor's inference loop to run headless, and checked that it matched the original bit for bit. Then I broke it on purpose, with sweeps over the control rate, the accelerometer offset and the action history.
Two findings stood out. The official Open Duck simulation script adds an accelerometer offset of +1.3 m/s² that the training code doesn't, and removing it makes the duck walk 15% faster. Zeroing the policy's memory of its own last actions cuts its speed by 85%. And one control step takes 44–47 µs, against a 20 ms budget.
Retraining both ducks
Next I retrained both robots from scratch, with the vendors' own training code:
- Open Duck, on MJX / JAX with Brax PPO: 164M environment steps in 21 minutes
- Microduck walking, on mjlab (MuJoCo Warp) with rsl_rl PPO: 197M steps in about 3 hours
- Microduck walking and getting up: 147M steps in just under 3 hours
Both robots learn to stand before they walk. The get-up policy recovers from all 24 lying starts by iteration 250.

02 · How high can a 0.74 kg duck jump?
The second project teaches Microduck three jumps: straight up, onto one foot, and across a gap. Training starts from the walk-and-get-up policy of project 01.
Before any learning, a search over scripted open-loop jumps finds the ceiling. It ran 140,800 rollouts, and only 18 of about 138,000 candidates landed upright. The best of them rose 0.8 cm.
The learned jump did better. At a 1.0 A servo current, the centre of mass rises 1.73 cm above take-off, with 120 ms in the air, and 63 of 64 episodes land. At 1.75 A it rises 3.21 cm.

The first reward taught it to dive instead. By iteration 1999, none of 64 episodes survived. A second reward term that clawed back credit for diving fixed it.
The one-foot landing didn't work. The duck held the commanded foot for a median of 0.42 s, against a target of 1 s. The write-up says so.
Credit
The robots, their training code and their published policies are other people's work: Open Duck Mini v2 by Antoine Pirrone, and Microduck by Pollen Robotics. My part is the tracing, the parity ports, the retraining and evaluation, the jump tasks, the perception and planner, and the measurement.
What's next
More projects, one question at a time. The repository is private for now and will be public soon.
