The best-supported way to teach our 1.03 kg, 28 cm biped to walk is the recipe that already made a same-servo robot walk: Open Duck Mini v2’s MuJoCo Playground setup (MJX physics, Brax PPO, 50 Hz position targets, a Disney-BDX-style imitation reward on a scripted reference gait, and STS3215 servo parameters identified with Rhoban’s BAM). We should not copy it verbatim. Its code has four randomization bugs and an accelerometer bug that mean the Duck trained with less randomization than its config claims. Its gait must also be rescaled to our size: about 0.45 s per stride and 2–4 cm steps. Our own reference gait (sim/gait_ref.py) is the weakest link today. A linear-inverted-pendulum check says its 16 mm sway at 0.35 s per step puts the centre of pressure about 21 mm inside the inner edge of the stance foot, which fits the “walks in place, falls with 3 cm steps” replay result. The evidence from Open Duck, BDX, ToddlerBot, MicroDuck and Bolt agrees on one point: on hobby servos, sim-to-real is won or lost on the servo model (gain, friction, armature, rate limit, backlash, delay), not on network size or PPO tricks. Train on the cluster GPU (RTX A6000 or an H200 slice), not on the Mac. A 300M-step run should take roughly 0.5–1.5 h there, against about 30 h with our current CPU SB3 setup.
Open Duck Mini v2 is the closest published precedent. It is a BDX-inspired robot about 42 cm tall and 2.1 kg, uses the same Feetech STS3215 servos, runs on a Raspberry Pi Zero 2 W, and has the same five-joint leg with no ankle roll (Open_Duck_Mini). The working recipe is Open_Duck_Playground, and its training config has not changed since the commit “CHECKPOINT pretty nice walk on the real robot” on 2025-03-24 (Playground commits). The README’s “current win” is the flat_terrain_backlash task at 300M timesteps (Playground README). The earlier Isaac Gym/AWD route and the SB3/BC/GAIL experiments are superseded.
The reference motion comes from Rhoban’s Placo ZMP walk engine. It sweeps a 6×4×10 grid of per-step (dx, dy, dθ), which gives 240 gaits. Each gait has a 0.54 s period (single support 0.18 s, double-support ratio 0.5), CoM height 0.205 m, foot height 0.04 m, feet spacing 0.16 m and trunk pitch −4°. Every gait is recorded at 50 fps and each of its 40 channels (joint positions and velocities, foot contacts, base linear and angular velocity) is fit with a degree-15 polynomial over phase (medium.json, fit_poly.py). During training the gait is picked by nearest-neighbour lookup on the commanded velocity, with no interpolation. The policy sees the phase only as cos/sin of a 27-step clock (poly_reference_motion.py). The last change before the real-robot checkpoint was “trying without ref in obs”, then “imitation phase”: the reference moved out of the actor’s input and into the privileged critic (commits).
Control and observations. The control rate is 50 Hz over 500 Hz physics. The actor sees a 101-dim observation: raw gyro, raw accelerometer, a 7-dim command, joint offsets, joint velocities ×0.05, the last three actions, the current motor targets, two foot-switch booleans and the phase. The output is 14 position offsets, with target = default + 0.25·action, clipped to move at most 5.24 rad/s × 0.02 s per step. The critic is asymmetric: it also gets clean sensors, base velocity, height, actuator forces, contacts, foot velocities and the current reference frame (joystick.py). The obs has no frame stack.
Reward. The reward is deliberately small. Velocity tracking uses weight 2.5 (linear) and 6.0 (yaw) with a tight σ = 0.01. Alive is 20, imitation 1.0, torques −1e-3, action rate −0.5 and stand-still −0.2. The sum is multiplied by dt and clipped to ≥ 0 each step. The imitation term reuses BDX’s kernels: exp(−8·err²) on linear velocity, exp(−2·err²) at weight 0.5 on angular velocity, −15·Σ(q − q_ref)² on the 10 leg joints, −1e-3 on joint velocities, and +1 per matching foot contact. It is switched off when the command is zero. The torso-orientation term is commented out, and the author’s own comment on the term reads “FIXME, this reward is so adhoc” (custom_rewards.py). There is no feet-air-time, base-height or orientation term. Commands are vx ±0.15 m/s, vy ±0.2 m/s and yaw ±1.0 rad/s, with 10% zero commands. Episodes last 20 s and end only if the torso flips past 90°.
PPO. The PPO config is mujoco_playground’s Berkeley Humanoid joystick config, unchanged: 8192 envs, unroll 20, batch 256 × 32 minibatches, 4 epochs, lr 3e-4, γ 0.97, entropy 0.005, clip 0.2, (512, 256, 128) MLPs for both actor and critic, and normalized observations (runner.py, locomotion_params.py @09e5506). Community users trained it on an RTX 3090, an RTX 4060 Laptop and a 12 GB RTX 4070, where it used 11.6 GB at 100% utilization (issue #8, build blog). The only wall-clock figure is a secondhand “several hours” (dev.to).
Randomization is moderate: link mass ×U(0.9, 1.1), Kp ×U(0.9, 1.1), frictionloss ×U(0.9, 1.1), armature ×U(1.0, 1.05), joint zero offsets ±0.03 rad, floor friction U(0.5, 1.0), 0–2 control steps of action and IMU delay, uniform joint noise (hip 0.03, knee 0.05, ankle 0.08 rad), and velocity kicks of 0.1–1.0 m/s every 5–10 s. Each leg joint also has a ±0.5° passive backlash hinge, and the observed angle includes it (randomize.py, backlash XML).
How the authors got there. The commit trail shows what moved the result. Over three weeks, Kp swung between 4.45 and 17.8, action scale went 0.5 → 1.0 → 0.25, and randomization went off, “massive”, then back on. The decisive changes were BAM-identified actuators with a target rate limit, backlash joints, the phase-plus-imitation reward, and action scale 0.25 (commits). On the robot, the policy runs as ONNX on the Pi’s CPU at 50 Hz. Servos are driven at 1 Mbps through rustypot, with the USB latency timer set to 1 ms and the leg firmware gain at P = 30. The IMU is a BNO055, not our BNO085, and the robot has real foot switches (v2_rl_walk_mujoco.py, Runtime README).
Disney’s BDX droid is the design Open Duck copied. Its legs have the same five joints with no ankle roll; the paper instead rounds the soles “to allow for passive ankle roll”. The difference is scale: BDX is 15.4 kg, 0.66 m tall, and uses quasi-direct-drive Unitree actuators (Grandia et al., RSS 2024). BDX trains separate policies for standing (no phase) and walking (cyclic phase). The walking policy is conditioned on a velocity command and on phase features sin/cos(k·2πϕ) for k ∈ {1, 2}; the second harmonic helps with motion at twice the gait frequency. The reference generator also returns a phase rate, so step frequency can change with the command. Reference gaits come from artist task-space keyframes, which an MPC and inverse dynamics turn into dynamically consistent trajectories. These are densely sampled and interpolated during RL (BDX).
The BDX reward is the template Open Duck trimmed. Torso tracking uses exp kernels: position exp(−200·err²), orientation exp(−20·err²), linear velocity exp(−8·err²) and angular velocity exp(−2·err²). Leg joint error is a plain quadratic at weight 15, not an exp kernel. Contact match is +1 per foot, action rate −1.5, action acceleration −0.45, torques −1e-3, and survival +20. Because survival is large and positive, the policy is never pushed to end episodes early while its tracking is still poor (BDX Table I). The actor gets torso pose in the path frame, body-frame velocities, joint states and the last two actions. The critic additionally gets noise-free state and the friction parameter. The 50 Hz policy output goes through linear interpolation and a 37.5 Hz low-pass “identically implemented in the RL and runtime environments”. PPO uses 8192 envs × 24 steps, 5 epochs, γ 0.99, λ 0.95, desired KL 0.01 and 3×512 ELU layers. About 30 minutes (1500 iterations) previews the gait, and full training took about 2 days on one RTX 4090 (BDX).
The BDX ablation is the clearest evidence for imitation over hand-shaped rewards, though it is qualitative (video only, no numbers). Velocity tracking alone produced “a policy that rapidly shuffles the feet”, and the usual clearance and slip penalties “are tedious to tune and the resulting gait remains far from natural”. Phase plus contact rewards fixed the stepping but left “a stiff and upright torso”. Feeding reference poses in place of the phase gave identical motion, so the phase input is enough (BDX). The older imitation literature adds two cautions. First, DeepMimic’s ablation shows reference-state initialization and early termination barely matter for walking: normalized return 0.980 with both, 0.981 with early termination only, and 0.974 with initialization only (DeepMimic). Second, when a reference is physically infeasible, the policy degrades to feet-on-ground shuffling (Peng et al. 2020). That second point is the one that bites us.
Siekmann’s periodic reward composition is the steelman alternative. It uses no reference at all: it penalizes foot force in swing and foot speed in stance, using smoothed phase indicators. It produced walk, run, hop and skip on Cassie, and its authors argue a reference “only captures a small part” of a gait (Siekmann et al. 2021). It is the right fallback if we cannot make a feasible reference. BDX’s own test of this style, however, gave the stiff upright torso, and the only two small hobby-servo walkers we found (Open Duck and ToddlerBot) both used reference imitation (ToddlerBot).
Every small-robot project in the research names the actuator model as the dominant gap. Open Duck’s docs warn that if simulated motors differ from the real ones “the policy won’t work, or at worst, produce chaotic movements” (sim2real.md). Pollen’s MicroDuck has the same 5-per-leg layout, weighs about 800 g and stands about 25 cm, which is almost our size. Its README states that at this scale actuator fidelity is most of the sim-to-real gap. It models XL330 servos with BAM’s M6 friction model, adds a ±1° backlash hinge, and randomizes battery voltage, voltage sag, command delay and friction (microduck_rl). ODRI Bolt reports that without joint-friction modelling the robot “fails to maintain balance and collapses immediately upon deployment” (Bolt). No hobby-servo project we found used an actuator network. All used identified analytic models.
BAM is the tool for our exact servo. It models the firmware voltage control law, back-EMF and extended friction, and fits them from pendulum logs with CMA-ES in under 5 minutes. On Dynamixels it cut tracking error by 1.5–2.9× compared with plain Coulomb-viscous friction (BAM paper). Its STS3215 7.4 V model records two facts our sim must respect. The firmware gain is P = 32 by default, and the firmware rate-limits its internal target to about 5.2 rad/s, so the servo is stateful (bam/feetech/actuator.py). Its current parameters, re-identified in 2026-08, are kt 1.178, R 2.479, armature 0.0261, friction_base 0.0515, viscous friction 0.0599 and command delay 1.05 ms (m1.json). Converting them with BAM’s own to_mujoco formulas gives kp 18.12 at P = 32 (16.98 at P = 30), damping 0.619, frictionloss 0.0515, armature 0.0261 and forcerange ±3.52 N·m. BAM now marks that conversion as deprecated in favour of its MuJoCo controller or mjlab actuator (to_mujoco.py).
Our sim is behind on this. Our sts3215 class (kp 17.8, damping 0.60, frictionloss 0.052, armature 0.028, forcerange 3.35) is exactly the set Open Duck left in a comment as its older values. The Duck’s final class is kp 17.11, damping 0.56, frictionloss 0.068, armature 0.027 and forcerange 3.23 (backlash XML). Its kp sits close to the P = 30 value the Duck’s runtime actually sets. The lesson is to fix one firmware P, set the sim kp from it, and never let the two drift apart. Our sim also has no rate limit and no backlash.
The other repeat failure causes are delay, heat and calibration. Latency randomization of 0–40 ms is standard: Open Duck uses 0–2 steps, Peng 0–40 ms, Booster 0–20 ms against a measured 9–12 ms, and ToddlerBot a fixed 1 step (Booster Gym, Peng 2020). ToddlerBot’s sim-to-real error was about 2× its sim error: 0.133 m against 0.082 m on a square path. Motor heating “gradually pushed it outside the training distribution”, and its printed parts survived about 7 falls before breaking (ToddlerBot). Encoder-offset randomization of ±0.02 rad (BDX) to ±0.05 rad (Siekmann) covers calibration error. On the Duck, a wrong IMU-orientation flag produced “abnormal oscillations during walking” (dev.to). The one publicly reported Open Duck transfer failure is a user policy that “can’t lift its feet” on the real robot. It was redirected to Discord with no public fix (issue #5), which argues for generous foot clearance in the reference.
Compute is not the hard part once the stack is right. MuJoCo Playground trains Berkeley Humanoid flat walking “under 15 minutes” on two RTX 4090s. One A100 runs the full PPO pipeline at 120k env steps/s for Berkeley Humanoid and 199k for OP3 (Playground paper). At those rates the Duck’s 300M steps would take about 25–45 minutes on an A100. MicroDuck reports “~1–2 h for a usable gait at 4096 envs” (microduck_rl). The Mac is not a training option. Apple lists JAX on Metal as not supported, and users report jax-metal failing with JAX 0.5.1+ and 0.8.2 (Apple JAX Metal, forum). Our own standing run did 4M SB3 steps in 24 minutes, about 2,800 steps/s. At that rate a 300M-step walking run would take about 30 hours.
The MJX pitfalls are known and mostly avoided in our model already. MJX-JAX is slow on meshes and many contacts. It does not support cylinder–box pairs. It works best with Newton iterations=1, ls_iterations=5 and eulerdamp disabled, which is exactly the Duck’s setting (MJX docs). Our biped.xml already keeps the meshes visual-only and collides only with boxes and capsules, but it uses default solver iterations. It also gives the feet and the floor friction 1.0. MuJoCo combines two geoms’ friction by taking the maximum, so randomizing only the floor would do nothing; this is the same trap the Duck fell into. The Playground repo itself has moved on: its main branch now uses MuJoCo Warp and RSL-RL, and the original JAX environments live under rss2025/ and stopped publishing to PyPI after playground==0.2.0 (Playground README). Open Duck users have hit the resulting dependency rot. Python 3.10 broke checkpoint saving, TensorFlow ONNX export fails on RTX 50-series cards, and newer Playground versions no longer have a module Open Duck imports (Playground issues). Pin the versions from Open Duck’s lockfile.
The remaining training pitfalls are behavioural. Velocity-only rewards produce shuffling (BDX). Feet-phase rewards keep paying for stepping at zero command unless gated, and Berkeley’s code still carries a TODO about it (Berkeley joystick.py). A 0.5 tracking σ suits ±1 m/s robots but makes tracking nearly free at our speeds; Open Duck’s 0.01 suits small robots. For symmetry, data augmentation beat a mirror loss in Mittal et al., and mirror-loss weights slowed learning. Their symmetric policies also behaved more predictably on hardware (Mittal et al. 2024).
Start from Open_Duck_Playground at commit b9be205, task flat_terrain_backlash. Copy open_duck_mini_v2/ into a biped/ robot folder, as its README’s “adding a new robot” section describes, and pin the library versions from its lockfile. This is the only fully read, hardware-proven STS3215 recipe. Pollen’s microduck_rl (mjlab + RSL-RL, BAM M6 actuators) is the second choice. It is closer to us in size and uses a better actuator model, but the research did not read its rewards or observations, so read its config before switching. Wherever the Duck’s code and this recipe disagree, this recipe fixes a known bug.
All scaling below is our own calculation, not a published number. It uses Froude similarity with our measured CoM height of 0.143 m above the soles at crouch 0.35, against the Duck’s 0.205 m. That gives a length ratio of 0.70 and a time ratio of 0.83. A linear-inverted-pendulum model with ω = √(g/0.143) = 8.3 rad/s gives the CoM sway that keeps the centre of pressure (ZMP) under the stance foot. Our foot spans 50–106 mm from the centreline: feet at ±78 mm, 56 mm wide. Our stance is unusually wide for our height: 156 mm against the Duck’s 160 mm on a robot 1.5× taller. Without ankle roll, all of that width must be covered by sway.
| Time per step | Sway for ZMP at inner foot edge (50 mm) | Sway for ZMP 60 mm out | ZMP with today’s 16 mm sway |
|---|---|---|---|
| 0.20 s | 13 mm | 16 mm | 60 mm (inside foot) |
| 0.225 s (Froude-scaled Duck) | 16 mm | 19 mm | 50 mm (at the edge) |
| 0.25 s | 19 mm | 22 mm | 43 mm (outside) |
| 0.35 s (today) | 28 mm | 33 mm | 29 mm (21 mm outside) |
The table treats torso sway as CoM sway. The legs carry about half the mass, so the real CoM sway is smaller and the true numbers are worse. Recompute with subtree_com in the generator.
| Parameter | Open Duck | Ours (recommended) |
|---|---|---|
| Stride period | 0.54 s | 0.45 s (0.225 s per step: about 0.15 s single support, 0.075 s double support) |
| CoM height | 0.205 m | 0.143 m (crouch 0.35, already measured) |
| Lateral sway | from ZMP planner | 20–24 mm, chosen so the ZMP lands 60–75 mm out, inside the foot |
| Foot lift | 0.04 m | 25 mm (scaled 28 mm; today’s 15 mm risks the “can’t lift its feet” failure) |
| Step dx sweep | −0.04 to +0.06 m | −0.03 to +0.04 m |
| Step dy sweep | ±0.03 m | ±0.02 m |
| Step dθ sweep | ±0.3 rad | ±0.3 rad |
| Trunk pitch | −4° | −4° |
| Command ranges | vx ±0.15, vy ±0.2, yaw ±1.0 | vx ±0.12 m/s, vy ±0.08 m/s, yaw ±1.0 rad/s, kept inside the gait grid |
Build a grid of roughly 6×4×7 periodic gaits from our IK generator. For each gait, store joint positions and velocities, contacts, and base linear and angular velocity. Tabulate at 50 Hz and interpolate rather than fitting degree-15 polynomials. Reject any gait whose knee goes negative, whose ZMP leaves the foot, or whose open-loop replay achieves less than half its labelled speed. That last check is the Duck’s issue #26 lesson (issue #26). Placo with our URDF and the scaled preset above is the alternative if hand IK cannot pass the ZMP check.
The actor observation is 73-dim: gyro (3), projected gravity from the BNO085’s fused orientation (3), command (3), joint position minus default (10), joint velocity ×0.05 (10), last three actions (30), motor targets (10), and phase sin/cos at k = 1 and 2 (4). Foot contacts are dropped because we have no switches. The critic gets all of that plus clean sensors, base linear velocity, height, contacts, foot velocities, air time, the current reference frame, actuator forces and the randomized friction. The Duck fed raw accelerometer instead of gravity. Either works if sim and robot match exactly in units and frame; gravity avoids the accelerometer-offset bug and the impact spikes the Duck runtime left as “TODO filter spikes”.
There are 10 actions: target = default + scale·a, then clipped to the joint limits × 0.95, then rate-limited to 5.2 rad/s (0.104 rad per step), in sim and on the robot alike. Use per-joint scales, not the Duck’s flat 0.25 rad. Our saved reference already swings the knee 17° (0.30 rad) and the ankle 16° from the start pose at only 2 cm steps, so a flat 0.25 rad scale cannot reach it. Use hip yaw and roll 0.25, hip pitch 0.35, knee 0.45 and ankle 0.40 rad, following BDX’s “action 1 maps to the expected range of each joint”. The default pose is the crouch 0.35 pose (hip −0.35, knee 0.70, ankle −0.35 rad).
| Reward term | Form | Weight |
|---|---|---|
| Linear velocity tracking | exp(−[(vx−cx)² + max(|vy−cy|−0.03, 0)²]/0.01) | 2.5 |
| Yaw tracking | exp(−(ωz−cωz)²/0.01) | 6.0 |
| Alive | 1 | 20.0 |
| Imitation (gated off at zero command) | BDX kernels: lin vel exp(−8e²) ×1, ang vel exp(−2e²) ×0.5, joint pos −15·Σe², joint vel −1e-3·Σe², contact match +1 per foot | 1.0 |
| Torques | −Σ τ² | 1e-3 |
| Action rate | −Σ(a − a₋₁)² | 0.5 |
| Action acceleration (BDX) | −Σ(a − 2a₋₁ + a₋₂)² | 0.45 |
| Stand still (zero command only) | −(Σ|q − q₀| + Σ|q̇|) | 0.2 |
The step reward is the sum × dt, clipped at ≥ 0. Add BDX’s torso-orientation term, exp(−20·err²) on roll and pitch only, at weight 1.0 only if the trained torso wobbles. The Duck removed it because the quaternion version misbehaved. Terminate when the torso, a thigh or a shin touches the floor, or when tilt exceeds about 45°. This is stricter than the Duck’s 90° rule and in the spirit of OP3’s (OP3 joystick.py). It cuts wasted samples on a robot that cannot recover from big tilts without ankle roll. Episodes are 1000 steps, commands are resampled every 500 steps, and 10% of commands are zero. Start each episode at a random phase in the reference pose.
Keep the Duck’s Brax PPO settings unchanged: 8192 envs, unroll 20, batch 256, 32 minibatches, 4 epochs, lr 3e-4, γ 0.97, entropy 0.005, clip 0.2, max grad norm 1.0, normalized observations, (512, 256, 128) actor and privileged critic. Train 150M steps for the first look and 300M for the candidate.
Servo class. Set the firmware to P = 30 on all leg servos, as the Duck runtime does. In sim use position kp="17.0" kv="0" forcerange="-3.5 3.5" and joint damping="0.62" frictionloss="0.052" armature="0.026". These are BAM m1 at P = 30, replacing our superseded 17.8/0.60/0.052/0.028/3.35. Add a ±0.5° backlash child hinge on every leg joint (damping 0.01, armature 0.01, frictionloss 0) and observe the joint angle through it. Then log about 100 six-second BAM pendulum runs at P = 30 on one of our servos and replace these numbers with our own fit. kp and forcerange both scale with supply voltage, so re-check them if the pack sags far from 7.4 V.
| Randomization (per episode) | Value | Source |
|---|---|---|
| Floor and foot friction | U(0.4, 1.0) on both geoms, found by name | ToddlerBot range; fixes the Duck’s dead friction randomization |
| Link masses | ×U(0.9, 1.1); torso +U(−0.05, 0.05) kg on the real torso body | Duck, scaled to our mass |
| Torso CoM | ±1 cm (the Duck’s ±5 cm landed on a massless body) | our scaling |
| Kp and forcerange (voltage) | ×U(0.9, 1.1), moved together | Duck, MicroDuck |
| Damping, frictionloss, armature | ×U(0.8, 1.2) | ToddlerBot |
| Joint zero offsets | ±0.03 rad | Duck, BDX, Siekmann |
| Action delay; gyro and gravity delay | 0–2 control steps each (0–40 ms), applied to what the actor sees | Duck intent, bug fixed |
| Joint position noise | hip 0.03, knee 0.05, ankle 0.08 rad, on all 10 joints | Duck, bug fixed |
| Joint velocity, gyro, gravity noise | 2.5 rad/s, 0.1 rad/s, 0.05 | Duck |
| Pushes | 0.1–0.6 m/s base velocity kicks every 5–10 s | Duck, scaled down for size |
Before training, apply the Duck’s MJX settings to biped.xml: iterations="1" ls_iterations="5" and eulerdamp disabled. Add explicit collision pairs (foot–floor, foot–foot, torso/thigh/shin–floor), and give the feet a lower nominal friction so the floor’s random value controls the contact.
Smoke-test on the Mac with JAX on CPU: 128 envs, 1M steps, about 10–15 minutes, under the 18 GB cap. This catches shape, NaN and termination bugs. Then submit to the cluster on an RTX A6000 (48 GB) or an H200 3g.71gb slice. A 300M-step run should take roughly 0.5–1.5 h plus a few minutes of JIT compile. This is our scaling estimate from the A100’s 120k steps/s and has not been measured on this robot. The 11 GB RTX 2080 Ti is too small for 8192 envs at the Duck’s footprint. Use 4096 envs there and expect about 2–3 h. Set XLA_FLAGS=--xla_gpu_triton_gemm_any=true and keep Open Duck’s persistent compilation cache. Before any hardware run, check every checkpoint sim2sim in CPU MuJoCo with the full mesh model.
| Stage | Work | Time | Gate to pass |
|---|---|---|---|
| 1 | Fix the servo class, friction, solver, contact pairs and termination in biped.xml |
about 30 min | Model loads in MJX; standing PD holds the crouch |
| 2 | Rebuild the gait grid: 0.225 s steps, 20–24 mm sway, 25 mm lift; ZMP and replay checks | about 60 min | All kept gaits have ZMP inside the foot; replay achieves ≥ 50% of labelled speed |
| 3 | Port the env (10 joints, 73-dim obs, bug fixes) and run the Mac smoke test | about 60 min | 1M steps with no NaN; episode length rising |
| 4 | First cluster run, 150M steps | 30–60 min wall-clock | Sim2sim: 20 s survival across commands; speed within 30% of command |
| 5 | Full 300M run with full randomization | 0.5–1.5 h | Survives pushes and delays in sim2sim |
| 6 | BAM pendulum identification at P = 30 plus a Pi loop-latency measurement; retrain with our numbers | about 90 min | Fitted sim step response matches the real one |
| 7 | Hardware: tethered, standing policy first, then walking at vx 0.05 m/s | about 30 min per session | No oscillation; feet clear the floor |
| What failed | Where | What it teaches us |
|---|---|---|
| Velocity-only reward gave rapid foot shuffling | BDX | Use imitation of a reference, not clearance/slip hacks |
| Phase plus contact reward gave a stiff, upright torso | BDX | Joint-position imitation carries the style |
| Infeasible reference collapsed into feet-on-ground shuffling | Peng 2020 | ZMP-check our gait first |
| Real Duck policy “can’t lift its feet” | Duck issue #5 | Use 25 mm lift and contact-match reward |
| Unmodelled joint friction: immediate collapse on hardware | Bolt | Use BAM friction and armature |
| Motor heating drifted the policy out of distribution | ToddlerBot | Keep sessions short and let servos cool |
| Printed parts broke after about 7 falls | ToddlerBot | Use a tether for first hardware runs |
| Wrong IMU-orientation flag caused oscillation | dev.to | Verify IMU axes against sim before walking |
| Weeks of Kp (4.45–17.8) and action-scale thrash | Duck commits | Fix firmware P once; match sim kp to it |
| Mirror loss slowed learning | Mittal 2024 | Use symmetry augmentation if we add symmetry |
| jax-metal broken on recent JAX | Apple forum | Train on the cluster |
The Duck’s shipped code has the following known bugs, all confirmed by reading the code at b9be205. Floor-friction randomization hits geom 0, a non-colliding trunk visual, so friction never changes; and since the foot geoms have friction 1.0 and MuJoCo takes the maximum, effective friction is always 1.0. Torso mass and CoM randomization hit body 1, a massless wrapper body, so the ±0.1 kg add can produce negative mass and the 5 cm CoM jitter never touches the 0.70 kg trunk. Joint-position noise indices come from a 10-joint list but are applied to the 14-joint array, so the right hip roll, hip pitch, knee and ankle get no noise. The IMU delay buffer holds gravity, which the actor never sees, so gyro and accelerometer are never delayed (randomize.py, joystick.py). The accelerometer +1.3 offset uses a JAX .at[].set whose result is discarded in training but is applied in mujoco_infer.py, which creates a sim-to-sim mismatch (PR #24). The reference generator produced 39 of 240 gaits with a backward-bent knee, and the shipped file contains two of them (issue #26). Finally, the lateral command range ±0.2 m/s exceeds the gait grid’s ±0.111 m/s, so the reference saturates while the 0.1 m/s tracking dead-band hides the error. The delay config also reads “0–3 steps”, but the exclusive randint makes it 0–2. One research note gives the Duck’s kp as 13.37, but that value is in the non-backlash XML; the winning backlash task uses 17.11.
Three things will decide whether our biped walks, and none of them is the RL algorithm. The first is a reference gait that is physically possible for a wide-stance robot with no ankle roll. On a 28 cm robot that means faster steps (about 0.225 s each) and more sway than our current generator uses. The second is a servo model whose kp is tied to the firmware P we actually set, with the rate limit and backlash the real STS3215 has. The third is randomization that actually reaches the policy. The Duck walked on real hardware despite randomization that was weaker than its config claims. So a corrected version of its recipe should transfer at least as well on a robot with twice its torque-to-weight ratio, though nobody has yet tested that.
The open risks are the ones nobody has published: STS3215 thermal drift during walking, our Pi-plus-bus loop latency, and whether a 156 mm stance without ankle roll needs a narrower stance pose rather than ever more sway. The ZMP table makes the third risk cheap to test before any GPU time is spent. If the sway the table asks for looks absurd in the gait video, narrow the default stance with hip roll first.