This is the Go program which powers my hexapod. It runs on a Raspberry Pi B+, and is controlled by a Sony Sixaxis (PS3) controller. The hexapod itself is 50cm in diameter, and about 2kg. The chassis was 3d-printed with a Printrbot Simple Metal, and bolted to 24 Dynamixel AX-12A servos. Each leg has 4DOF, which makes the gait quite flexible.
Here's it is, as of June 2017:
And here's an old GIF of it in action:
- Printrbot Simple Metal 3d printer
- Dynamixel AX-12A servos
- Raspberry Pi, Model B+ computer
- Sony Sixaxis controller
- USB2AX dynamixel interface
- SparkFun USB MicroB Breakout
- RioRand LM2596 voltage regulator
- Kootek GY-521 gyro/accelerometer
- Tiger 11.1v 2200mAh LiPo battery
- Corsair RM450 power supply
- Edimax EW-7811Un wifi adapter
- Medialink MUA-BA3 bluetooth adapter
- JW Winco 353-20-24-M6-S-55 rubber feet
- Microsoft LifeCam Cinema 720p camera
STL files are available at adammck/hexapod-parts, but should not be considered usable for any purpose. It's more fun to design your own, anyway. Email me if you want the SketchUp files.
Spend countless hours and dollars printing and assembling the hexapod. Be sure to blow up RPi and trap fingers between moving parts for authentic experience.
Provision the RPi using adammck/headless-raspbian and adammck/hexapod-infra. It runs Raspbian Jessie with QtSixa, the control program (this repo), and a few systemd services to glue everything together.
Flip the power switch to boot the hexapod. If you're running tethered with an external PSU, make sure that the power switch is off to isolate the LiPo before plugging it in.
Plug the Sixaxis controller in with a USB cable. You only have to do this once, to pair it with the Bluetooth adaptor. Give it a few seconds (to run sixpair), then unplug it.
Build and deploy:
This requires Go to be installed with cross-compilation support for Linux/ARM. That's outside of the scope of this document, but it's easy.
Press the PS button to pair. The controller should rumble and flash its lights. The control program will now start, and the hexapod will initialize and stand up.
Use the left stick to translate, and L2/R2 to rotate. Various other buttons do other things.
Press Select and Start to shut down the servos and the RPi. Note that this doesn't entirely kill the power, so don't forget to disconnect the LiPo to avoid damaging it.
Shut down remotely by running:
Shutdown will automatically occur (with no warning) when the battery drops below 9.6 volts. This is to protect the LiPo. My 2200mAh battery usually lasts about 15 minutes on a full charge.