Build Your Own MicroDuck: An OpenELAB Guide from Hardware to First Steps

Building a small walking robot is an unusually rewarding way to learn robotics: mechanical design, power electronics, sensing, software, and motion control all have to work together. At OpenELAB, we see MicroDuck as a practical introduction to that whole system—not simply a collection of parts that happens to look like a duck.

In this guide, we unpack AI-FanGe's hands-on MicroDuck video into a practical build workflow: buy the parts, print and assemble the structure, connect the electronics, and deploy the software. We also include useful operating commands from the creator's accompanying repository. Our approach is to establish a reliable baseline first, then move on to customization and learning-based control.

Watch the Build Tutorial

Open the tutorial on YouTube. The accompanying build repository provides the current hardware mapping, software, and release image.

1. Understand What Runs Where

MicroDuck is a compact biped that runs an ONNX walking policy on real Dynamixel actuators. The Raspberry Pi Zero 2 W reads the inertial measurement unit (IMU), receives keyboard or gamepad commands, and runs the deployment software. A ROBOTIS OpenRB-150 bridges USB communication from the Pi to the Dynamixel servo bus.

The repository separates two jobs:

  • microduck/ contains the on-robot deployment software, hardware interfaces, and walking model.
  • mjlab_microduck/ contains the MuJoCo/MjLab reinforcement-learning environment used to train and export the walking policy.

You do not have to train a policy before your first run. The supplied image already includes walk.onnx. From OpenELAB's perspective, using that known starting point is the best way to distinguish a hardware problem from a model-development problem.

The creator explains why this build package matters: simulation-oriented model files did not all translate directly into printable, usable parts, so the team revised the print models and shared them through the Bambu community. They also supplied a walking model matched to their assembly. The video focuses on locomotion; cameras, voice interaction, and conversation are not implemented as part of this build.

This is still a hands-on project with a learning curve. The creator suggests downloading the repository and using an AI assistant to help interpret errors. We would add one practical habit: share the exact error and matching code version, then verify proposed wiring or power changes against the hardware documentation before trying them.

2. Prepare the Hardware and Tools

Component Quantity Purpose
Raspberry Pi Zero 2 W 1 Control program, Wi-Fi, SSH, and Bluetooth input
ROBOTIS OpenRB-150 1 USB-to-Dynamixel communication
Dynamixel XL330-M288-T 14 Ten leg joints and four head/neck joints
BNO080, BNO085, or BNO086 IMU module 1 Orientation sensing over I2C
Ready-made rechargeable battery pack 1 The build README specifies a 6 V pack; verify actual fully charged voltage and hardware limits
Stable 5 V regulator or suitable USB power supply 1 Raspberry Pi power
microSD card 1 reliable new card The README lists 16 GB minimum; the video recommends a larger card around the 32 GB-plus range
3D-printed structural parts 1 matched set Robot structure; PLA is recommended in the build README
Power switch, appropriate screws, shims, and cables As required Mechanical assembly and electrical connections
Optional U2D2 and U2D2 Power Hub Alternative setup kit Listed in the README; the video configures one servo at a time through OpenRB-150

The complete mechanical design shown in the video has 15 servos: five per leg, two in the neck, two controlling head movement, and one opening the mouth. The walking software uses 14; the optional mouth actuator is ID 15. This explains why the physical model and deployment BOM can show different totals.

The XL330 is a significant cost item. The creator describes spending substantial time exploring alternatives and emphasizes the feedback and control accuracy required by a reinforcement-learning walking project. Other compact actuators are mentioned as possibilities, but they were not tested in this build. We therefore do not present cheaper motors as drop-in replacements.

Keep spare Dynamixel cables, terminals, power wires, and fasteners available. The demonstrated Pi-to-controller link uses a Micro-USB-to-USB-C data cable; a charging-only cable will not provide that connection. A multimeter, suitable crimping tool, heat-shrink tubing, and soldering equipment are useful for preparing and checking the wiring.

Keep the Build Version Consistent

The repository includes inherited documentation with a different joint layout and a custom two-cell battery arrangement. Those instructions are not interchangeable with the current 14-servo OpenRB-150 configuration. Use the root README and matching deployment code for this build's IDs, wiring, and image. Before printing a full set or ordering parts, confirm that the mechanical files correspond to the duck configuration you intend to assemble.

For mechanical work, check left/right part orientation, cable clearance, and access to connectors before closing the body. Label configured servos, route cables away from moving joints, and make sure wires cannot be pinched or pulled tight through the intended range of motion. These are OpenELAB build checks, not a substitute for the matching mechanical assembly reference.

MicroDuck printing plates grouped into colored shells, structural parts, shims, and soles
The video groups the print job into shells, structural pieces, small supports, and foot components.

3. Configure Every Servo Before the First Run

A correct ID is how the software knows which physical joint it is commanding. Connect and configure one servo at a time in Dynamixel Wizard, then label it before moving on. Do not install multiple factory-default servos and assume the software can identify their locations automatically.

ID Joint name Location
1 right_ankle Right ankle
2 right_knee Right knee
3 right_hip_pitch Right hip pitch
4 right_hip_roll Right hip roll
5 right_hip_yaw Right hip yaw
6 left_ankle Left ankle
7 left_knee Left knee
8 left_hip_pitch Left hip pitch
9 left_hip_roll Left hip roll
10 left_hip_yaw Left hip yaw
11 head_pitch Head pitch
12 neck_pitch Neck pitch
13 head_yaw Head yaw
14 head_roll Head roll
15 mouth Optional; outside the current walking policy

In the video, connect the OpenRB-150 to the computer by USB and attach just one servo. Open Dynamixel Wizard 2.0 and scan for the actuator. Set its unique ID and a baud rate of 1 Mbps, change Return Delay Time to 0, and save. The build uses Protocol 2.0.

Enable torque while the unassembled actuator is safely clear of obstacles, then use the Center button to return its output to the neutral position. In the control table, locate PWM Slope (address 62), set it to 255, and save. The next demonstrated setting is Shutdown (address 63), discussed below. Repeat the process for every actuator individually; factory-default devices sharing ID 1 cannot be reliably distinguished once connected together. When scanning configured servos again, use the updated 1 Mbps baud rate.

The tutorial also recommends removing the input-voltage-error trigger from the servo's Shutdown setting to prevent stops during voltage dips. This disables a protective shutdown condition; it does not make an out-of-range supply safe. At OpenELAB, we recommend checking the servo manufacturer's electrical limits and solving supply instability before considering that change. Do not disable other protections as a general troubleshooting shortcut.

Mechanical Assembly: Build from the Feet Up

Understand the Fastener and Bearing Trade-Off

The video highlights the design's single-sided servo mounting. It reduces the number of structural pieces and keeps the robot compact, but can allow play or loosening if assembled poorly. Printed rings and supporting surfaces help stabilize the joints. Where the design supports an actuator on both sides, a printed passive horn on the rear provides the second rotating support.

Screw length is a repeated warning: too short and the fastener may loosen or pull out; too long and it can enter far enough to obstruct the servo's rotating mechanism. Tightening a passive-horn screw too much can also create excessive friction. Select the length for each actual joint instead of treating one screw size as suitable everywhere.

The creator lubricates the demonstrated rotating support surfaces. Use only a lubricant compatible with the printed material and keep it away from electrical contacts. After fastening each joint, check that the supports are seated and motion is not mechanically obstructed.

Confirm Neutral Position Before Attaching the Parts

The video initially assumes new actuators are at their factory neutral position. If an output horn has been moved, or its position is uncertain, perform the neutral-position operation in the configuration section before attaching the printed parts. Do not build around an arbitrary horn angle and expect the walking model to compensate.

Assemble Both Legs, Then Set Them Aside

Start with the foot pieces, fit the first actuator into the foot structure, and install the small printed intermediate support. The locating feature engages with the servo body; secure the correct side and lubricate the indicated rotating support. Continue upward with the connecting pieces, printed rings, and the remaining leg joints.

Complete both leg subassemblies before joining them to the central body. This follows the video's practical sequence and leaves more room to reach the fasteners and check the two sides against each other.

Exploded MicroDuck foot assembly showing how the printed foot parts fit around the ankle actuator
Build the foot and leg subassemblies before attaching them to the body.

Build the Central Body Without Blocking Screw Access

With the battery, head, and outer shells temporarily out of the way, assemble the four-actuator central group shown in the video. Fit the locating plate, expose the output faces, add the printed support rings, and install the retaining pieces.

The most easily missed step is installing the four recessed fasteners before the next actuator is placed over them. Once that actuator is fitted, the holes are obstructed. Continue with the front plate and the clamping structure that stabilizes the actuator group; do not leave the assembly supported only by its flexible central piece.

Bring the completed legs back to the body and fasten them at the demonstrated mounting points. Recheck fastener engagement and clearance, then fit the two outer body pieces into their matching slots.

MicroDuck central actuator group showing the printed rings and surrounding support pieces
The central assembly relies on both locating pieces and the outer retaining structure.

Fit the Neck, Head, and Optional Mouth Mechanism

Join the two neck actuators with their small connecting plate to make one subassembly, then attach it to the body at the four demonstrated mounting points. In the head, work with the shell lifted away: fit the supporting bracket and actuator, attach the head support, slide the lower beak structure into position, and install the mouth actuator if you are building the complete mechanism.

Fit the remaining head actuator, the retaining clip and its four fasteners, and the small printed support pieces before closing the head shell. The creator relocates the controller boards toward the rear for easier debugging and does not install the camera or put the IMU in the original illustrated head location.

Exploded MicroDuck head and neck with the beak and head shell separated for assembly
Keep the head open until the actuator supports and optional mouth mechanism are secured.

The larger battery used in the demonstration required a small clearance modification to the printed structure. Check your pack's dimensions before assembling around it. Modify an empty printed part if necessary; never cut or drill with the battery in place, compress the pack to force it into a cavity, or leave sharp edges against it.

4. Wire Power, the Servo Bus, and the IMU

The video introduces three categories of connection: supply, ground, and signal. Match the required voltage for each device, connect the intended grounds, and follow the signal mapping expected by the software. Labels matter: the demonstrated controller connection marked G means ground, while D means data—not another ground connection.

For beginners, the creator also demonstrates tinning a wire and making a solder joint: heat the iron, tin the exposed wire, join it to the intended pad, and let the solder cool before checking the connection. Keep the hot tip in its stand when unused, work with ventilation and eye protection, and disconnect power while soldering. Insulate finished joints so they cannot touch neighboring conductors.

Separate the Power Requirements

The physical wiring demonstrated in the video splits the switched battery-positive line into two branches: one feeds the servo supply directly; the other feeds a buck converter that produces 5 V for the Raspberry Pi. The servo bus ground and data connect to the controller's demonstrated ground and data connections. The creator deliberately avoids routing the full 15-servo supply current through the controller board.

This differs from the simplified power diagram in the accompanying README. Do not combine the two layouts without checking the actual board power-selection instructions. USB provides the Pi-to-OpenRB-150 data link; confirm how the controller is powered in your selected arrangement and avoid unintended back-powering.

In the demonstration, the battery-positive wire goes to the switch first. Keep the switch off during assembly, and preferably disconnect the battery completely while making or changing joints. Connect battery positive and negative to the buck converter's appropriate inputs, verify a 5 V output with a meter, then connect that output and ground to the Pi's intended power inputs. Do not infer a board pinout from wire color alone.

Do not connect the battery directly to the Pi's 5 V input. A battery's nominal voltage is not its maximum charged voltage, so measure and verify the complete supply path before connecting electronics. Use a charger appropriate to the pack chemistry and specification. Insulate all exposed joints and check polarity with a multimeter before power-on.

Video demonstration of the battery branch and buck converter used to supply the Raspberry Pi at 5 volts
The Pi receives regulated 5 V; do not feed its power input directly from the 6 V battery branch.

Build the Three Servo Branches

The XL330 uses a three-pin daisy-chain bus. The tutorial groups the branches as follows:

  • Right leg: 5 → 4 → 3 → 2 → 1
  • Left leg: 10 → 9 → 8 → 7 → 6
  • Head and neck: 12 → 11 → 13 → 14

The cable order can follow the physical layout; the ID-to-joint mapping must remain correct. Preserve the connector pin order when making splitters or shortening cables. A bad crimp, swapped wire, or intermittent ground can look like a software fault.

The video shows joining the separate limb branches by matching supply to supply, ground to ground, and data to data before soldering and insulating. Looking at two connector housings from different orientations can make an incorrect crossing look plausible, so verify each conductor end to end. The final bus supply lead goes to the switched battery branch in the demonstrated layout, not to an arbitrary logic or signal pin.

The software first looks for the OpenRB-150 under /dev/serial/by-id/usb-ROBOTIS_OpenRB-150_*. Its listed fallback ports include /dev/ttyACM0, /dev/serial0, /dev/ttyAMA0, and /dev/ttyS0. If communication fails, verify that the intended USB device is detected instead of assuming a fallback is the correct controller.

Connect and Orient the IMU

BNO08x connection Raspberry Pi connection
Supply input appropriate to the module 3.3 V as specified by the build; confirm module labeling
GND GND
SDA GPIO2 / I2C SDA
SCL GPIO3 / I2C SCL

The software uses I2C bus 1 and probes common BNO08x addresses. Electrical communication alone is not enough: sensor orientation must also agree with the robot's body frame. The configuration uses IMU_MOUNT_QUAT for that relationship. Do not rotate the module during assembly without checking the corresponding software configuration.

The video makes this distinction especially clear: the Pi, controller, and converter can be arranged for convenient packaging, but the IMU must be fixed in the demonstrated position and orientation for the supplied model. Mount it securely, square to the intended body axes, without tilt or wobble. Use its mounting holes or an appropriate bracket, and secure the surrounding cables so they cannot move the sensor.

5. Flash the Prebuilt Raspberry Pi Image

The AI-FanGe release image contains Raspberry Pi OS Lite 64-bit, the user account, hostname microduck, deployment directory ~/microduck, a Python virtual environment, the ONNX walking model, and the headless gamepad service.

  1. Download the build's image release.
  2. Verify the downloaded file against the checksum published for that exact release.
  3. Insert the intended microSD card and open Raspberry Pi Imager.
  4. Select Raspberry Pi Zero 2 W, then Use custom and choose microduck.img.xz.
  5. Carefully select the target card. Writing the image erases that selected storage.
  6. When asked to apply OS customization, choose No for this preconfigured image.
  7. Wait for writing and verification to finish.

On Linux, the checksum command is:

sha256sum microduck.img.xz

You can select the compressed image directly in Raspberry Pi Imager. For a first build, the graphical workflow also makes it easier to double-check the selected storage device.

If writing fails, the creator suggests trying a different USB port. Also check the card reader and card before assuming the image is the problem. Wait until the write and verification finish before inserting the card into the robot.

6. Connect to a 2.4 GHz Wi-Fi Network

The Pi Zero 2 W supports 2.4 GHz Wi-Fi, not a 5 GHz-only network. If using a phone hotspot, enable its 2.4 GHz-compatible mode. The tutorial provides two setup methods.

Option A: Edit the SD Card's Network Configuration

Reinsert the flashed card into your computer, open the bootfs partition, and edit network-config. On Ubuntu the path may be:

sudo nano /media/$USER/bootfs/network-config

Use your actual country code and network credentials, preserving YAML indentation:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true
      dhcp6: true
      optional: true
  wifis:
    wlan0:
      dhcp4: true
      regulatory-domain: "YOUR_COUNTRY_CODE"
      access-points:
        "YOUR_WIFI_NAME":
          password: "YOUR_WIFI_PASSWORD"
      optional: true

Examples of country codes include US, GB, DE, and CN. Add another entry under access-points if you want both a home network and a phone hotspot. Safely eject the card before placing it in the Pi.

Option B: Use a Display, Keyboard, and NetworkManager

Connect a mini-HDMI display and a USB keyboard through a suitable OTG adapter. This is a Lite image, so expect a terminal rather than a desktop. Log in with username user and initial password password, then run:

nmcli device wifi list
sudo nmcli device wifi connect "YOUR_WIFI_NAME" password "YOUR_WIFI_PASSWORD"
sudo nmcli con mod "YOUR_WIFI_NAME" wifi.powersave disable
sudo nmcli con mod "YOUR_WIFI_NAME" connection.autoconnect yes
nmcli -t -f NAME,TYPE,AUTOCONNECT,DEVICE connection show
hostname -I

Confirm that the connection has an IP address and autoconnect is enabled. Enter real credentials only on your own device; never include them in shared screenshots, logs, or a redistributed image.

7. Complete First Boot and SSH Login

Allow roughly one to three minutes for the first boot. The image expands the filesystem, regenerates SSH host keys, initializes networking, and starts the gamepad service. Do not interrupt power during that process.

ping microduck.local
ssh user@microduck.local

Use PowerShell on Windows or a terminal on Linux/macOS. The initial password is password; password characters do not appear as you type. Once connected, change it:

passwd

If microduck.local does not resolve, find the Pi in your router's DHCP client list and connect with ssh user@ROBOT_IP. Your computer must be able to reach the robot on the local network.

Reflashing can legitimately change SSH host keys. If you have confirmed that this is your newly flashed robot, remove the stale entry and reconnect:

ssh-keygen -R microduck.local

Do not dismiss an unexplained host-key warning without checking which device you are reaching.

8. Start the Controller and Take the First Steps

Place the robot on a clear, level floor and support it during the first startup. Keep fingers clear of joints and have a way to stop it immediately. Starting the controller enables torque and moves the robot toward its neutral pose; walking does not have to be enabled for movement to occur.

cd ~/microduck
PYTHONPATH=src .venv/bin/python src/main.py

The controller reads input and loads src/agents/walk.onnx. Check the initial pose before asking it to walk. A mismatched knee offset or incorrect servo placement can cause a fall even when every electronic component is communicating correctly.

The demonstrated workflow is straightforward: connect the computer and robot to the same Wi-Fi, open a terminal (the video uses Windows Run → cmd), SSH into the Pi, enter the deployment folder, and launch the controller. After the robot straightens, place it on the floor with support and press v to enable walking. The final demonstration shows forward movement, slowing or reversing, and left/right turning; adjust commands gradually rather than expecting each keypress to move the robot a fixed distance.

Completed MicroDuck with the head, legs, rear electronics, and connected servo wiring
The assembled robot is ready for software setup and supported first-run checks.

The checked deployment configuration applies a +45° offset to the right knee (ID 2) and −45° to the left knee (ID 7). Those values describe this assembly, not a universal calibration setting. Verify that your physical assembly matches before relying on them.

Key Action
v Toggle walking
Up/down arrows Forward/backward command
Left/right arrows Turn left/right
x Set velocity to zero
i Show or hide IMU information
q Stop the control loop

Start with small commands. Zero velocity, walking disabled, and controller stopped are different states; learn their effects while supporting the robot. If the main terminal is unresponsive but SSH remains available, use a second session:

cd ~/microduck
PYTHONPATH=src .venv/bin/python src/stop.py

9. Beyond the Video: Bluetooth Gamepad Operation

The video demonstrates keyboard control. The following gamepad instructions extend that workflow using the creator's accompanying README.

Put your controller in pairing mode, connect to the Pi by SSH, and open:

bluetoothctl

Inside the Bluetooth prompt, run the following sequence, replacing the placeholder address with your controller's detected MAC address:

power on
agent on
scan on
pair XX:XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
scan off
quit

The image includes microduck-gamepad.service for headless operation. Its documented controls are:

Gamepad action Function
Hold START for 2 seconds Start the control loop
A Toggle walking
Left stick Forward/backward and lateral velocity
Right stick left/right Turning
B Stop the control loop
Hold both triggers for 2 seconds Safe shutdown

One important behavior can otherwise look like a fault: the service disables Wi-Fi when the gamepad connects, to improve Bluetooth stability on the shared 2.4 GHz radio environment. Turn the controller off when you need SSH; Wi-Fi should return automatically.

10. Update Software and the Walking Model

After the preinstalled configuration works, keep a matching local copy of the repository for development. The Makefile uses SSH and rsync, so use a development environment with those tools and GNU Make available, such as Linux, macOS, or a suitably configured Windows WSL environment.

git clone https://github.com/AI-FanGe/Microduck-build-tutorial.git
cd Microduck-build-tutorial/microduck

The Makefile defaults to SSH host alias microduck. Configure that alias in your SSH configuration or explicitly pass the connection target, for example HOST=user@microduck.local. Dependency setup also requires the expected uv environment.

Command Purpose
make sync Sync deployment files to the Pi
make setup Sync and install locked dependencies with uv sync --frozen
make run Sync and start the controller
make stop Stop the controller
make shutdown Shut down the Pi safely
make imu Read IMU/gyro information
make voltage Read servo voltage
make voltage ID=2 Read a specified servo's voltage
make gamepad-headless-enable Install and enable the headless gamepad service
make gamepad-headless-disable Disable the headless gamepad service

Commands such as make run synchronize files before running. Do not accidentally overwrite a working robot with a different local configuration. Preserve the known-good model and configuration before experimenting.

To deploy a model exported from the training environment, place it at microduck/src/agents/walk.onnx in the local repository, then synchronize:

make sync HOST=user@microduck.local

The next controller run loads that model. Match the policy to the hardware, joint order, offsets, and IMU orientation. A file having the right name does not by itself make it compatible. Training in MuJoCo/MjLab and running inference on the Pi are separate stages of the workflow.

11. Troubleshoot in a Useful Order

The Robot Cannot Be Found on the Network

Wait for first boot, confirm 2.4 GHz compatibility, check credentials and YAML indentation, and inspect the router's DHCP list. With a local keyboard attached, use nmcli device wifi list and hostname -I. If a gamepad is connected, turn it off before investigating SSH availability.

Servos Do Not Move or Bus Communication Fails

Check battery condition, regulated Pi power, common ground, connector orientation, cable integrity, unique servo IDs, the 1 Mbps baud rate, and USB enumeration of the OpenRB-150. Work from power and wiring toward software rather than changing several settings at once.

The Robot Falls Immediately

Stop and support the robot. Check for swapped left/right IDs, incorrect mechanical zero positions, incompatible knee offsets, an incorrectly mounted IMU, and a policy from a different hardware version. Also check for mechanical binding and unsecured cabling. Repeatedly restarting a falling robot is not a calibration procedure.

SSH Drops as Soon as the Gamepad Connects

This is expected behavior for the documented headless service, not necessarily a failed Wi-Fi configuration. Turn the gamepad off to restore network access.

12. Shut Down Safely and Preserve a Working Baseline

For routine shutdown, stop motion, support the robot as needed, and run:

sudo shutdown -h now

Alternatively, use make shutdown from the configured development computer or the gamepad shutdown gesture. The tutorial advises waiting 10–15 seconds after shutdown before switching off power. Do not keep testing with a depleted battery, and avoid cutting power during SD-card writes. In an immediate physical hazard, prioritize stopping dangerous motion over preserving the filesystem.

If you later create a reusable SD-card image, first test the real robot, shut down, and clone the card. Clean private information in the cloned image—not your only working system—including Wi-Fi credentials, SSH keys, machine identity, cloud-init state, shell history, and logs. Restore placeholder network settings, verify that the model, virtual environment, and service are included, then shrink/compress and publish a matching checksum.

The OpenELAB Takeaway

MicroDuck makes the relationship between hardware and intelligent control tangible. A walking policy depends on the right physical joints, stable power, meaningful sensor data, and consistent configuration. Treating those dependencies as one system is the most valuable lesson in the build.

Our recommendation is to progress through clear checkpoints: identify the matching hardware version, configure and label every actuator, verify power and communication, boot the supplied image, confirm a supported neutral pose, test short walking commands, and only then move to headless operation or a new model. A reliable first build becomes a much better platform for experimentation—and a much more enjoyable robot to learn with.

Leave a comment

Your email address will not be published. Required fields are marked *

Sidebar

Blog Categories
Latest post

This section doesn’t currently include any content. Add content to this section using the sidebar.

Register for our newsletter

Get the latest information about our products and special offers.

Website Feedback

Help us improve OpenELAB

Found a website issue or have an idea? Tell us what would make your experience better.