★ PROJECT HEXAPOD ★ INTERNAL
Phase 2 — Code foundations.
GOAL: SERVOBUS + PER-SERVO TRIMS CAPTURED + LEG IK WITH HOST UNIT TESTS. · 2 EVENINGS · DAY 4–5
01 · What you need from Shop
MG996R metal-gear servo
qty 18 · PiShop
R1 942.20
PCA9685 16-ch I²C PWM module
qty 2 · Micro Robotics
R158.70
DC-DC Buck converter, 300 W 20 A
qty 1 · Micro Robotics
R147.20
OnBO 3300 mAh 2S 25C LiPo (XT60)
qty 1 · Rclipo
R572
IMAX B6 balance charger (clone)
qty 1 · Bobshop
R250
Fireproof LiPo safe bag
qty 1 · Africa Drone Kings
R200
XT60 male+female pigtails (pair)
qty 2 · Communica
R60
2S low-voltage alarm buzzer
qty 1 · Communica
R50
Inline 30 A blade fuse + holder
qty 1 · Communica
R53
M3 screw/nut assortment kit (6–25 mm)
qty 1 · Communica
R150
M2.5 servo-horn screws (100 pack)
qty 1 · Communica
R80
M3 heat-set threaded inserts (50 pack)
qty 1 · DIYElectronics
R120
Male-female Dupont jumpers (40 × 20 cm)
qty 2 · Multiple
R80
Silicone wire 18 AWG, 1 m red + 1 m black
qty 1 · Rclipo
R80
Creality PETG filament, black, 1 kg
qty 1 · PiShop
R231.32
Shipping across ~3 suppliers (Jo'burg)
qty 1 · Various
R400
Contingency (solder, heat-shrink, 1 DOA servo, cable ties)
qty 1 · —
R300
02 · Tasks
T9Implement ServoBus class· depends T8
Acceptance:Single-channel sweep works through ServoBus.setAngle(); no other channel twitches.
T10Per-servo trim calibration· depends T9
Acceptance:All 18 servos centre within ±1° of true 90° when commanded via ServoBus.center().
T11Leg IK math + host unit tests· depends T9
Acceptance:`pio test -e native` reports 2/2 tests passing (reachable neutral stance + unreachable point rejection).
Calibration steps
- STEP 1Print a paper protractor for trim calibrationTape a printed protractor flat on the bench. Mount the servo's horn pointed at the 90° tick. Measure how far off true 90° the arm sits — that delta is the trim value, negated, that goes into kServoTrim[].
- STEP 2Direction flips before trim adjustmentsIf a servo moves the wrong way for its mounting orientation, flip kServoDir[] to -1 first. THEN measure trim. Doing it in the other order doubles the work.
Reference docs
- → docs/04_SOFTWARE_PLAN.md
- → docs/06_KINEMATICS_AND_GAITS.md
- → docs/07_CALIBRATION_PROCEDURE.md