XL Duck runs its 30 KB walking policy on an ESP32-S3—and doubles as a musical instrument

Robotics, ESP32, RL

This is the read-only HTML version. For the full Visual Space experience, open the app.

Duck robot, quadruped — Video

Credit: Who_Rammy r/robotics

Robot duck, embedded control

Built around leftover Dynamixel servos, this 40 cm robot pairs onboard walking and get-up networks with a phone-controlled singing interface. Its creator reports 2.4 ms walking inference in a 50 Hz loop, and has shared the code, controller board design and a browser simulator.

🔥 1

A box of leftover servos set the size of XL Duck; an ESP32-S3 set an interesting constraint for its walking controller. Reddit user Who_Rammy shared the roughly 40 cm robot on r/robotics after building it for their child's first birthday, adapting MicroDuck because it wasn't yet available. The creator says the enlarged duck was walking around the living room two weeks later and now joins family trips to the playground.

The result is both a walking robot and a playable instrument. Its phone interface handles remote control, but the learned walking policy runs on the duck itself.

A larger duck built around available motors

Who_Rammy scaled the design to fit used Dynamixel RX-28 servos left over from a hexapod. XL Duck has 15 joints, PLA-printed parts and a reported weight of about 2.1 kg. A 4S battery pack assembled from spare 18650 cells supplies power.

The electronics follow the same compact approach. A custom ESP32-S3 controller board combines RS485 and serial servo buses, an IMU, a speaker amplifier and CAN in a Raspberry Pi HAT footprint. That describes the board's form factor—not a requirement for a Raspberry Pi to execute the walking policy. The creator has shared controller board information and says the hardware design is open source alongside the robot software.

The walking network fits inside the microcontroller

The creator trained the walking policy in MuJoCo using MicroDuck's training recipe, adapted for the RX-28 servos, then reduced it to approximately 30 KB using int8 arithmetic. Reported inference time is 2.4 ms within a 50 Hz control loop. Put another way, each loop has a 20 ms interval, with the walking network's calculation occupying only part of it.

A separate get-up network takes over after a fall. Who_Rammy also points to a practical benefit of keeping inference on the ESP32-S3: a short boot time, allowing the robot to begin walking immediately after switching it on, according to the post.

The timing and memory figures make the embedded implementation worth studying, but they don't answer every mechanical question. One useful question from the discussion concerns backlash in the used servos: did the training account for that looseness well enough to transfer from simulation to the real machine? No answer appears in the supplied discussion, so the specific treatment of backlash remains an open detail for builders considering similar hardware.

The beak becomes part of the instrument

For the voice, Who_Rammy used linear predictive coding analysis of a real mallard recording, reducing the quack representation to roughly 300 numbers stored on the board. The creator also reports that the duck can sing Bach, including the Goldberg Quodlibet.

The more interactive feature is the phone page's Sing tab. It provides a two-octave multitouch keyboard with up to four simultaneous voices and slides between notes. Controls adjust attack, vibrato, breath and tone. Every note opens the beak, while higher notes make the duck look upward—giving the musical controls a visible mechanical response as well as an audible one.

Try the policy before assembling the robot

Who_Rammy offers a browser simulator described as running the exact on-robot networks, including the option to push the simulated duck over. An edit adds a simulator with the phone interface, and the XL Duck repository contains the open-source project.

That gives prospective builders a useful starting point: explore the control and recovery behavior before committing to motors and printed parts. The next detail worth examining is how closely the simulated servo behavior matches the reused hardware—the bridge between a small, fast network and a duck that can actually keep its feet.

Written by the Visual Space editorial team.

Source: Yet another duck clone I built "for my one-year-old" - a 40 cm xlduck. The RL policy runs on an ESP32-S3

Robotics

3 Followers

Bring mechanisms, electronics and software together. Share robots and prototypes, compare sensing and control approaches, document experiments, and work through the practical challenges of building machines that act in the world.

Visual Space is built for projects like this—where creators collaborate, organize goals, and grow communities around real work.