RoboDuckBuild

Day 48

First steps, and a head too heavy

On Luwu's own software the duck walked for the first time: about 17 seconds on the rug, then a fall, then it got itself back up. Our head is about 100 g heavier than the one Luwu trained for, so now it's learning to walk again on a rented graphics card.

Sunday: walking on the rug with Luwu's walking brain, falling when the head dips, then up again by itself. The video has no sound.

Three weeks have passed since the duck first talked. A mains bench supply set to 8 V now runs it in place of a battery. Luwu's driver board arrived on 16 November, and with it fitted the stack of boards on the duck's back was too tall for the battery lead to reach. Luwu's own wiring doesn't use the Arduino Media Carrier at all, so we dropped it: sound will come from a small USB-C sound adapter instead, under a new, shallower back cover with room for the speaker and amplifier, which Simon has printed. This weekend the duck got Luwu's software, and walked.

Saturday: Luwu's software

Early versions of Luwu's board have the ground and signal pins swapped on all three servo sockets, so before any power went on, Simon checked ours with a meter. It's the fixed version. Then he ran Luwu's installer on the UNO Q: a 458 MB package that loads Luwu's app, programs the board's microcontroller and sets everything to start by itself. It came back up after a restart with Luwu's web page running, the one for calibrating the duck and making it walk.

Two problems turned up straight away. To get the battery out, Simon found, the boards and the body shell have to come off first. So it stays in and charges in place: the round socket on Luwu's board goes straight to the battery, ahead of the power switch, so it charges with the switch off. And the cradle's pin runs right through the battery bay, so it only fitted with no battery in. Two short pins, one each side, are in the print file now. Simon asked if the duck even needed the cradle, and it didn't: Luwu's software leaves every servo limp until it's told to move, so it lay on a towel.

The back of the duck's body: two circuit boards stacked on the battery cage, lit by a blue LED, with leads running up from the top
The battery is in there somewhere, behind both boards and the body shell.

On the first power-up only 13 of the 15 servos answered, because two of them were both called 21. That was the hip servo from Day 23 still waiting to be renamed, and with the right leg unplugged it became 11 through Luwu's page. Simon chose Luwu's settings for every servo, which run them much softer than they come from the factory, with overcurrent protection at 2 A. The TPU soles aren't printed yet, but Luwu's sole is just a flat pad screwed on, so a pair of PLA ones will do on carpet for now. The battery was nearly flat, so it went on Luwu's charger until bedtime.

Sunday: calibration

Luwu's calibration has the duck sitting with its legs folded back under it while the page records where each servo's centre is. On Saturday night Simon had asked "Have I built his legs wrong?!" before he realised they just fold back on themselves. Simon ran the calibration himself on Sunday afternoon, and the first try at the standing pose swung the head about half a turn until servo 31 cut out. Our head doesn't fold down against the neck the way Luwu's does when it sits, so its centre had been recorded half a turn out. It was set again with the head held level.

Next the neck leaned forward where Luwu's leans back, and Simon spotted it against Luwu's photo. On our duck, servos 30 and 31 turn the opposite way to Luwu's. Luwu's firmware has one number per servo for its direction, so those two numbers changed and the firmware was rebuilt on the UNO Q itself. After that, neck and head stood level.

The duck standing on a desk with its neck leaning forward and its head tipped down
Before: the neck leaning forward instead of back.
The duck standing with its neck back and head level, with Simon's hand ready behind it
After: neck and head level, but the whole duck tips back a little.

Walking, nearly

Simon noticed the body leaning back a few degrees where Luwu's stands level, and when he pressed Walk the duck stumbled backwards almost every time. Telling the balance sensor the duck was 4 degrees further back than it was made it lean forward to make up; that helped, but it still slowly tipped back in most stands, so it went up to 7. A leg lead pulled out once, so Simon moved the leads to sockets where they're less likely to catch.

Then it walked: about 17 seconds on the rug before it fell. Each fall started the same way, with the head suddenly dipping forward, and after one of them it got itself back up off the wooden floor and stood. Simon's verdict was "probably heavier head", and he asked whether we could train it virtually for its new head.

Too heavy for its brain

Simon weighed the whole duck at 912 g. Luwu's model of the robot, the one its walking was trained on, comes to 791 g. Most of the difference is our head: about 310 g, against roughly 210 to 250 g for Luwu's, with its weight further forward and higher up. Luwu's training only varies the robot's weight by 5% either way, so a head 100 g heavier is outside anything it practised with. We could have made the neck servos stiffer, but that would stop the real duck matching the simulation, so we left Luwu's settings alone.

Luwu publishes the code they train with, so the duck can learn again with its real head. Simon set up a rented graphics card in the cloud. We built a model of our head from the design files, with every printed part, the screen, the XIAO, the camera, magnets and screws in place, and checked it against Simon's 310 g. Those numbers went into the robot model. Then the training started: 4,096 simulated ducks at once, practising walking for 4,000 rounds while being told to walk, turn, stand still and look around.

A 3D viewer on a screen showing small grey simulated ducks on a grid floor, with a purple arrow marker
A few test ducks running a snapshot of the new brain. They have Luwu's head shape, but carry the weight of ours. The purple marker is the order they're following.

The practice ducks fell 0.71 times a round after 20 minutes, and 0.17 times a round by the halfway point. Getting up and sit/stand get the same treatment overnight and into tomorrow, since every fall ends a session if it can't get up.

Next

Put the new walking brain on the duck, take the 7 degree lean back out, and try the rug again. Then the new get-up and sit/stand brains, the TPU soles, and getting following and talking working on Luwu's board.