Log 19: All eight motors and the first stand

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

The leg motors arrived, so today all eight went into the body. By the end of the night LocksleyFox stood on four legs for the first time, and even stood up from sitting. Getting there took a new control program, a saw, and a lot of small fixes.

Black RobStride 00 motor boxes stacked on a green rug
The new RS00 motors, still in their boxes

A control panel

Typing commands into a serial monitor was fine for one leg. For eight motors I wanted buttons. The new control panel is a web page that runs in Chrome with no internet. It talks to the Teensy over USB using Web Serial, a browser feature that lets a page open a serial port. Each motor gets a card with its angle, torque, temperature and faults, plus buttons to hold it, jog it and turn it off. A robot section has Stand, Slow walk, Stop walking and Sit buttons, and a wizard for calibrating each leg.

The LocksleyFox Control Panel in Chrome before connecting, with Stand, Slow walk, Stop walking and Sit buttons, a trackpad for steering, a top view of the robot with a ring for each of the ten motor spots, a log box and a list of Teensy programs
The control panel before the Teensy is connected

I tried it first this afternoon on the front-left leg alone. Two things showed up right away. Dragging the angle slider made the leg stutter, so the target now glides smoothly to each new slider position. And a bus went silent once when the Teensy browned out on a weak USB cable. Pulling the knee's cable while both motors held their pose was handled the way it should be. The knee was flagged as lost within about 50 ms, and the hip kept holding.

Getting the hip motors in

Each half of the body has a printed tube that holds the left and right hip motors back to back. The tube has an opening in its top where a motor drops in, then slides out toward its side. That works for the first motor. The second one won't fit. The opening is 54 mm long and a motor is 51 mm. Once the first motor is in place, its back end sticks 18 mm into the opening, which leaves only 36 mm for the second. I had only ever tested one motor in that opening, so I missed it.

Inside one half of the printed body, a black hip motor sits in its tube, and the top opening has been cut longer on one side, with rough edges showing the infill
One hip opening cut longer by hand. The rough edge shows the infill.

I cut the openings longer with a saw and wire cutters and got all four hip motors in. It was quite painful. Then the screws that hold each hip motor to the body wouldn't line up. One would go in and the rest sat a little off. With some wiggling they all went in eventually. The next body gets a longer opening on one side, and I'll test a section with both motors before printing a whole one.

Top view of the whole body with both halves bolted together, a hip motor visible through the cut opening at each end, breadboards and wiring in the middle bay, and a leg on each corner
All four hip motors in, seen from above

Eight motor IDs

Every motor comes from the factory with the same CAN ID, 127. The ID is how the Teensy addresses one motor on a shared bus. With six new motors plugged in, the scan only found three IDs, because all the 127s answer at once and look like one motor. The command that changes an ID is also sent to an ID, so it can't pick out one motor among several 127s. They have to be set one at a time.

Unplugging motor cables in the body is hard, so I worked one leg at a time. Each knee only reaches the bus through its hip, so with the hip-to-knee cable unplugged, only the hip answers. I set the hip, plugged the knee back in, and set the knee. The front-left hip and knee are 1 and 2, and the front right is 3 and 4. The rear left is 5 and 6, and the rear right is 7 and 8. All eight IDs stayed after a power cycle. I also jogged a couple of motors to make sure each number really was the joint I thought.

The front legs ended up on one CAN bus and the rear legs on the other, the opposite of the plan in Log 18. The firmware finds each motor by its ID on either bus, so that's fine.

Calibration and the first stand

Each joint needs two things before the robot can stand. First, its limits, the range it may move, which I mark by moving the leg by hand. Second, the leg calibration, which tells the firmware where the thigh hangs straight down and where the knee sits on its straight stop. The left and right legs came out as mirror images, as they should, since the motors on each side face opposite ways.

The first Stand was refused before any motor turned on. The firmware checks every point of the move first, and it keeps each joint a little inside its limits. I had marked each knee's limit right at its hard stop, so a knee resting on its stop already counted as out of range. Moving that one limit a few degrees past each stop fixed it. The knee can't go past its hard stop anyway.

With the robot on its printed stand and the legs in the air, all eight joints moved to the stand pose and held within about 0.3° of the plan. Both CAN buses ran at 500 Hz with every frame answered and no errors.

The gray printed robot on its printed stand with all four legs bent in the stand pose, paws clear of the mat, and a bench supply reading 46 V in front
The first stand, on the printed stand with the paws in the air

Three legs on the floor

On the floor, the front-left paw hung about an inch above the ground. The robot rested on its other diagonal, with the front-right leg doing most of the work.

Low view of the robot standing on a black mat, seen from the front, with four bent legs and black TPU paws
Standing on the floor for the first time
  • The front-left paw also sat a little behind its hip. I had found "straight down" for that thigh by eye. Redoing it with a string hanging from the center of the hip motor moved it about 7°. That put the paw under the hip, but it only lowered it a little.
  • The front-left knee screws were loose, the same as after the kicks in Log 17. I tightened them and calibrated again. That changed very little.
  • Then I measured each leg from the center of the hip motor to the bottom of the paw, with the knee on its stop. Front right 298 mm, rear left and rear right 292 mm each, front left 286 mm. The legs aren't the same length. The two long legs sit on one diagonal, which explains why the robot rocks onto it.

The firmware assumes all four legs are the same length, so for tonight I faked a length setting by offsetting the calibration of three legs. The front-left gap went from an inch to about half an inch. The real fix is a measured length for each leg in the calibration.

Standing up from sitting

After Sit, the motors ease off and the legs go limp. With the body on the floor, the legs splay and fold past their limits, and then Stand refuses to start. I propped the body on two books so the legs could sit in a Z shape. I also widened a few knee and hip limits to cover where the legs really rest. Then LocksleyFox pushed itself up off the books and stood, twice. The front-left leg was still carrying almost no weight, but the other three shared the load.