P10000801

Hexapod status update: it walks, and it’s no longer blocky

Reading Time: 3 minutes
My pet 18 servo hexapod <3

In terms of programming, I’m following the tripod gait (3 legs on the ground at any time, legs in the air move forward while legs on the ground move backward). I’m using the Arduino mini as the microcontroller (brains) (with the 2.007 carrier board to make interfacing with the servos easy). I’m controlling 12 channels (which is the max for the ServoWrite function in the Arduino software library), so twelve of the servos are in pairs (using six Y splitter cables). Thus, if  I named each leg:

The servos on AC and DF are linked together, while the servos on B and E are controlled independently. Then I only need 12 channels instead of 18: AC (coxa, femur, tibia). DF (coxa, femur, tibia). B  (coxa, femur, tibia). E  (coxa, femur, tibia).

Anyway, in my code, I took 4 “snapshots” (sets of servo positions) of the tripod gait and I’m looping through them. In other words, I’m following http://www.pololu.com/docs/0J42/4. I’m pretending this is a 12 servo hexapod (since this was my KISS code) in that the tibia segments are kept at one position the whole time.

  1. AC, E legs forward. DF, B legs backward.
  2. AC, E legs down. DF, B legs up.
  3. AC, E legs backward. DF, B legs forward.
  4. AC, E legs up. DF, B legs down.

And the actual code I’m using to get it to walk forward:
(also here: https://docs.google.com/document/pub?id=1N9dLEcLXiCvFRI4JRVfJUyylEhZFk4azP8_gsickQv4)