
Orbit · Robots & devices · October 2026
Teaching a duck to walk on a Raspberry Pi
XGO-Duck. Building an open-source biped duck with a Raspberry Pi Zero 2W in place of the original controller, porting its real-time loop to Python.

The XGO-Duck is a small open-source robot duck that walks on two legs. It is 3D-printed, it has fifteen servos, and its gait comes from policies trained with reinforcement learning in simulation. I printed the parts. Then, instead of buying the recommended controller board, I decided to use the Raspberry Pi Zero 2W I already had.
That decision changes almost nothing about the brain and almost everything about the plumbing.

On the original board a microcontroller talks to the servos a hundred times a second, while a Linux side runs the walking policy fifty times a second. On the Pi both have to live in Python. So I rewrote the microcontroller's loop behind exactly the same interface, so the upstream code and its trained policies run unchanged on top.
The parts arrived at different times, so everything was first tested against a simulated servo bus and a simulated robot: 34 tests passed before a single real servo moved.

To make the build repeatable I wrote a setup wizard that walks through it step by step: checking the parts, setting servo IDs, scanning the wiring, setting up SSH to the Pi, finding which way the motion sensor's axes point, and calibrating.
The first real servo answered at a millisecond round trip and moved to within a step or two of where it was told. The other fourteen, and the first steps, are next. One lesson already learned the hard way: check the bearings list twice.
Made with Raspberry Pi Zero 2W, Feetech bus servos, ONNX policies, Python.


Comments
Sign in with GitHub to leave a comment or react.