What the course teaches
Seven lessons in three chapters, at /learn/path/build-hexapod-walker on /learn. Every lesson runs on the gallery hexapod's layout: an Arduino Uno, a PCA9685 servo board and twelve servos, a hip and a knee for each leg, with a button on pin 2. The checks read the servos' angles, a meter, the supply and the sketch's serial lines.
- Legs and servos. Pose the legs from the Serial Monitor: why the right side is mirrored, a 68 mm stride from a 20 degree swing on a 100 mm leg, 34 mm of clearance from a 35 degree lift. Map degrees to microseconds to PCA9685 ticks, find the knee from another batch that stands at 87 degrees, and trim it in code. Meter six servos idle (0.06 A) and moving (about 0.7 A), size a supply for 18, and watch an undersized one collapse.
- Gaits. One gait engine, a duty factor and a phase per leg: the tripod (duty 1/2, 228 mm/s, margin 44 mm), the ripple (2/3, 114 mm/s, 70 mm) and the wave (5/6, 46 mm/s, 84 mm). Turn on the spot and in an arc, lift higher for rough ground, and move the center of mass forward until the tripod's margin goes negative and only the wave stays up.
- Project: a walking demo. A scripted demo from one button, extended with a turn back and high steps, and given a stop press.
The circuits and sketches
| Lessons | Circuit | Sketch |
|---|---|---|
| Leg geometry, Servo maps and calibration | The hexapod; in the calibration lesson the right front knee takes 500 to 2500 us | hexlegs |
| The current budget | The hexapod with the left side's six servos on a 5 V bench supply through a meter on DC amps | hexlegs |
| Tripod gait to the project | The hexapod | hexgait |
hexlegs takes stand, leg lf 20 35, stride 20, lift 35,
pulse rf knee 1500, trim rf knee 3 and sweep. hexgait takes tripod,
ripple, wave, walk, back, left, right, stop, lift N and
stride N, and its button runs the demo in DEMO[]. Both are in the Uno's
Examples menu, and the gallery's Hexapod robot walks the tripod
gait on its own sketch.
Gaits at a glance
| Gait | Duty factor | Feet up | Cycle | Speed | Margin |
|---|---|---|---|---|---|
| Tripod | 1/2 | 3 | 600 ms | 228 mm/s | 44 mm |
| Ripple | 2/3 | 2 | 900 ms | 114 mm/s | 70 mm |
| Wave | 5/6 | 1 | 1800 ms | 46 mm/s | 84 mm |
All three use a 300 ms swing and a 20 degree stride. The margin is the distance from the center of mass to the nearest edge of the support polygon at the worst moment of each cycle.
Troubleshooting
- A leg walks backward against the others. Its entry in
SIDE[]has the wrong sign. - One foot sits higher than the rest. That servo's window or horn is off.
Trim it in
TRIM[], and move the horn a tooth if the trim is over about 7 degrees. - The meter reads 0.06 A while walking on a real floor would need amps. The simulated servos carry no body. A loaded servo draws a good part of its stall current even standing still.
- The servos go limp and the voltage drops. The supply's current limit is too low. Below 4 V the servos stop.
- The report after a gait change shows extra feet up. That cycle covers the changeover. Read the next one.
- The demo ignores a second press. That is the sketch as it ships: the last step of the project adds the stop press.
Related
Paths and lessons explains how a course, its checkpoints and its chapter quizzes work.