Close

Tripod Gait Working

A project log for Stubby the (Teaching) Hexapod

100% open source robot platform with accessability and affordability in mind: teaching children of all ages about robots & programming

the-big-oneThe Big One 06/26/2014 at 18:020 Comments

Stubby v3 will be controlled similar to a video game: use the left stick for forward / backward / strafe right + left, and use the right stick to turn.  So far, I have the left stick working properly, using a straight tripod gait.

From an implementation POV, each leg knows its "neutral position", i.e. the point which it should be at when at rest.  I then have a lookup table of offsets, which are to be applied to the neutral position for each leg, which moves the leg in a roughly circular motion (with the bottom of the shape being flat, of course).

The main loop keeps track of the step index, which is used to index into the lookup table.  Velocity information is scaled in at this time, and the offset point is returned.

The resulting point is then rotated on the X,Y axis to allow for walking in any direction.


The next major step is to create a similar lookup table for rotation, using the right stick, and then to factor the two points together so that you can rotate and walk at the same time.  I think that doing another offset should be sufficient, although further testing will definitely be needed here.

(And on another note, it appears that I have plenty of CPU cycles left over, even after driving the PWM, doing IK calculations, and gait generation; in fact, I need to include a delay in the gait loop or else the main loop runs too fast for the servos to keep up!  It is amazing what you can squeeze out of a 12MHz AVR!  Of course, the recent changes to the PWM library which reduced the time needed in the most frequently fired ISR by about half didn't hurt either...)

More videos to come when I get a bit more stuff working.

Discussions