Log 17: Kick speed, voltage limits and a runaway leg

· A build log for LocksleyFox, a home-built robot dog

Yesterday the leg on the front of the printed body was kicking a tennis ball off a box. Today the goal was simple. Make the ball go faster. The first kick this morning sent it off at about 6.0 m/s (13 mph), and the best kick this evening reached 8.6 m/s (19 mph). On the way there, the leg spun all the way around once and ripped a wire, so a good part of the day went into safety code.

The gray robot leg mid-kick, its paw squashing a yellow tennis ball that is just leaving a small Lego stand on a wooden plank, with a bench power supply on the shelf behind it
The paw meeting the ball on the 8.6 m/s kick, from a 240 fps clip

Measuring the ball

Every kick was filmed in 240 fps slow motion. A script finds the yellow ball in each frame and uses its known 67 mm (2.6 in) diameter as the scale. The change in its size shows how fast it moves away from the camera, so the speed counts all three directions. A fit of the ball's fall against gravity confirmed the frame rate. The camera moved a little between some kicks, so I treat differences under about 5% as noise.

The garage lights flicker at 120 Hz, which shows up as a strong pulse at 240 fps. It doesn't change the speed numbers, but every clip I use in a video now goes through a deflicker filter first.

A new kick shape

The kick is a whip kick. The hip swings forward while the knee snaps, and the timing between the two sets where the paw is fastest. With the old timing, the paw peaked well past the ball. I planned a new timing so the peak landed right at the ball.

The first kick with it quietly used the old timing anyway. The Teensy reads "0.20" as a hair under 0.2 and rejected it against its own lower limit, and the script on my computer never showed the reply. The script now checks every reply and refuses to kick if a setting wasn't accepted.

Once it ran, the new timing gave about 5% more ball speed at 6 m/s. At 8.5 m/s it gave none. The knee was still snapping when the paw reached the ball, and the ball pushed it back. Moving the ball forward to meet the paw at its fastest point was worse still. Out there the paw is already curving upward, so it hit the ball at an angle and the ball left at only 5.4 m/s.

The power supply limit

The bench supply had been limited to 4 A since the hop tests. The fastest kicks briefly ask for more than that, so I raised the limit to its maximum of 5.2 A. The same 8 m/s kick then sent the ball 10% faster, 7.2 m/s against 6.5. A 9 m/s kick that had stopped itself at 4 A also finished cleanly.

A bigger wind-up

The limits were originally configured such that the hip could only swing back about 67° from vertical. Holding the leg up by hand showed it goes well past horizontal with nothing in the way, so that limit was far too cautious. A longer wind-up gives the motors more swing to build speed over. The planning model said an 83° wind-up would add about 20% to the paw's speed at the ball for the same motor effort.

The robot leg held back at the top of its wind-up, with the paw raised behind the tennis ball sitting on a small stand on a wooden plank
The leg at the top of the 83° wind-up, just before the kick

It worked. The kicks also tracked their plan better, because the hip had longer to get up to speed. A wind-up level with the hip (100°) gave no more speed, and it led to the problem below.

SetupKick speed askedBall speed
Morning, old setup6.0 m/s6.0 m/s (13 mph)
Supply at 4 A8.0 m/s6.5 m/s (15 mph)
Supply at 5.2 A8.0 m/s7.2 m/s (16 mph)
83° wind-up8.0 m/s7.6 m/s (17 mph)
83° wind-up9.0 m/s8.0 m/s (18 mph)
83° wind-up9.9 m/s8.6 to 8.8 m/s (19 to 20 mph)

A runaway leg

When a motor slows the leg down, it works as a generator and pushes current back into the 48 V line. This is called regenerative braking. A battery can soak that energy up, but my bench supply can't. Instead it piles up in the capacitors on the line and the voltage rises. The motors protect themselves by cutting out above 60 V.

I added voltage logging to the kick, and one kick showed the problem clearly. Braking after the swing pushed the line from 46 V to 59.6 V. On one run I didn't set up the ball in time, so the leg swung up and all the way around. The cables went with it, and one CAN-H wire ripped.

I repaired the wire and changed the firmware in three ways.

  • The firmware itself refuses kicks above 9 m/s or wind-ups past 83°. Those limits keep the braking voltage under the 60 V cut-out. Once a regen clamp is fitted, I can send a command over USB to turn them off. That setting isn't saved, so the limits come back on every reboot.
  • If a motor drops out mid-move, the firmware clears its fault and switches it back on every 3 ms, then damps the leg to a stop. Without the fault clear this didn't work, because an overvoltage cut-out stays latched until it is cleared.
  • Every stop now lowers the leg slowly over about a second before switching the motors off, so a leg caught high doesn't drop and swing.

To test it, I had the firmware switch one motor off on purpose halfway through a slow move. It caught the leg within 50 ms for both the knee and the hip. The firmware can't brake a motor while that motor is still inside its own protection, though. A physical stop on the body and a proper regen clamp are the real fix.

More capacitors

The cheap fix for the voltage swing is more capacitance on the line. I already had two 1000 µF capacitors there and three spares from the same pack. I accidentally put in one of the spares backwards, with the "+" end into the ground. The supply held the voltage at about 9 V while that capacitor hissed and vented smoke, and I switched off. An electrolytic capacitor wired the wrong way acts almost like a short, so the stripe on its side has to face the negative wire every time.

With four capacitors in place, I ran the exact kick that had cut both motors out earlier. The peak dropped from 59.5 V to 51.8 V, and the dip while the motors pushed hardest almost disappeared.

Line chart of bus voltage during an 8 m/s kick. With two capacitors the voltage dips to 34 volts, then climbs to 59.5 volts where both motors cut out. With four capacitors it stays between 45 and 52 volts
Bus voltage during the same 8 m/s kick with two and with four capacitors

A hard plastic paw

I thought the soft TPU paw might be soaking up part of each hit, so I printed the same paw in solid PLA. On the same kicks, the ball left at 5.5 m/s and 5.1 m/s, against 7.6 and 7.4 m/s with TPU. The ball's stand height had to change for the PLA paw, so this isn't a perfectly clean comparison. The knee also felt less push from the ball with PLA, which fits an off-center hit. Either way, the TPU paw went back on.

The robot leg with a gray plastic paw hitting the tennis ball on its stand
The solid PLA paw meeting the ball

Still open

  • On the best kick the line dipped to 28.8 V while the motors pushed hardest. The supply's 5.2 A can't feed that burst, so a battery is the next step for more speed. It will need the regen clamp from the RobStride Power Board I ordered.
  • The CAN-H repair is taped, and it dropped out a few times later in the day. It needs solder, heat shrink and strain relief on both sides of the hip.
  • The knee's screws worked loose during the day. They need threadlocker, or at least a check before every session.
  • The thigh needs a physical stop well short of going over the top.