Simple 12 DOF hexapod
Now available from SparkFun! https://www.sparkfun.com/products/11497
Hexapods are a popular robot design but they tend to be either 3 servo or 18 servo. I decided to try a 12 servo hexapod with 2 DOF legs. Although this does not give the same range of motion as 3 DOF legs I found you could still travel in any direction as well as rotate on the spot.
The assembly was very simple using QuadBot legs. The robot could be easily made with chopsticks and polymorph or paint sticks and hotglue.
The hardest part for me was the math. It's been almost 20 years since I have done any trigonometry and with the legs all at 60° from each other I could not cheat like I did with Chopsticks.
After a bit of messing around I finally got some basic code running. My attached sample code controls the robots movement with 3 variables.
Speed and Angle (with Rotate=0) allows the robot to walk in any direction.
Speed, with Rotate set to plus or minus 1 (Angle is ignored) makes the robot rotate clockwise or counter clockwise.
A 4th variable, Stride changes the size of the steps.
This code was originally written for a Spider controller but since a standard Arduino controller can drive 12 servos using the servo library the code could be easily adapted for something like a Uno with a bit of prototype PCB used to mount the servo headers.
I've been lazy and plugged my IR receiver directly into digital pins 10,11 & 12.This saved me making a proper cable. Arduino I/O pins can easily handle the nominal 3mA current draw required for the receiver. See the attached datasheet. D10 is my input. D11 is set to output low (Gnd) and D12 is set to output high (Vcc).
I have added more comments to the code to make it easier to understand as well as an IR test mode that allows you to see what values your TV or DVD remote is generating. Once you know what values your remote buttons are generating you can substitute those values into the code. I was using a Sony TV remote when I wrote the sample code but the IR library will work with other remotes.
I have also attached an updated version of the IR library that will work with Arduino 1.0 as well as the older versions.
I have attached a draft of the assembly manual (Thanks Frits) and the latest sample code which uses the Stride variable to ramp the leg movements up and down when you start / stop the robot. This reduces the strain on the servos and allows to robot to return to a neutral stance when you stop. Detailed comments on most lines explain how the code works.
Now sold by SparkFun:
Good news for anyone who would like to build this robot. SparkFun are now selling this product. The third video shows it featured in the SparkFun 2012 Halloween "New Product Post" all dressed up in it's own halloween costume starting about 8:36 in the video.