Skip to content
Thakorn S.

Robotics from Scratch

Where I learn and build robotics, one project at a time. It starts with two biped robot ducks learning to walk, get up and jump.

TSThakorn Swaengkit·Nov 22, 2026·4 min read
Two small biped robots side by side in simulation, Open Duck Mini v2 and Pollen Robotics' Microduck, each above a live readout of gyro, feet, policy and knee angles.
Fig. 1 · Open Duck Mini v2 and Microduck walking in MuJoCo, with the signals between IMU and motors traced live. Microduck © Pollen Robotics, meshes CC BY-NC-SA 4.0.
14joints on each biped
50 Hzcontrol loop
0.74 kgMicroduck, in simulation
5 cmgap it plans and jumps, 4 of 4
ROLESolo builder
TIMELINENov 2026
LINKS—

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 v2Microduck
OriginOpen-source, 3D-printedPollen Robotics, its successor
Mass in the model2.107 kg0.737 kg
Policy input101 values61 values
Network101 → 512 → 256 → 128 → 2861 → 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.

Microduck in simulation performing one of its published skills, with a panel listing the skill and its readouts.
Fig. 2 · Microduck running one of its 10 published skills. Microduck © Pollen Robotics, meshes CC BY-NC-SA 4.0.

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.

Microduck mid high jump in simulation, beside a panel of live and measured values for the jump.
Fig. 3 · The high jump at 1.75 A, slowed to a quarter speed. Microduck © Pollen Robotics, meshes CC BY-NC-SA 4.0.

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.

BUILT WITH
Python 3.12MuJoComjlabMuJoCo WarpMJX / JAXBraxrsl_rlPyTorchONNXCMA-ESuv
TSThakorn SwaengkitRobotics & AI engineer in Bangkok. I lead software engineering at AltoTech and write about building for the physical world.
Next project · 02Personal OSAll projects