Skip to content
forked from daavidee/hexapod

WIP-A Hexapod robot based around Python and the Raspberry Pi

Notifications You must be signed in to change notification settings

hhuaibo/hexapod

 
 

Repository files navigation

Note: This project is a work in progress.

About

This project is based around Python and the Raspberry Pi, a credit-card sized computer with GPIO, USB, 10/100 Ethernet and more. It is a 6-legged (hexapod) robot with 3 degrees of freedom per leg. Currently it can walk linearly with an optimized walking algorithm using memoization techniques, be controlled with a PS3 controller, stream video, talk via the flite TTS engine and an on-board speaker, perform basic object detection with an ultrasonic sensor using hardware interrupts offloaded to an ATmega328P, detect solid-coloured objects with the camera using a predictive object detection algorithm (currently being rewritten) and collect acceleration data from a BMA180 sensor. Additional movements, integration of all features and more are underway.

Hardware

  • 1 x Model B Raspberry Pi
  • 1 x 4GB or bigger SD Card
  • 1 x Low-power USB wifi module used for connection to a home network
  • 1 x Low-power USB bluetooth module used for connection to the PS3 controller
  • 2 x 16-Channel 12-bit PWM Drivers used for control of the servo PWM signals. This is based on the PCA9685 which has its own internal clock. Each driver controls one side of the robot for a total of 9 servos controlled per driver
  • 19 x High Torque analog servos
  • 1 x 2s1p Lipo Battery Pack
  • 1 x 5A SBEC for converting the 8.4V from the Lipo Battery to 5V for the Pi
  • 1 x 20A SBEC for converting the 8.4V from the Lipo Battery to 6V for the servos
  • 2 x (1/8" x 1.5" x 48") aluminum flats bought from Home Depot and cut with a scroll saw for the legs. The frame is made from salvaged aluminum
  • 1 x CSI Camera
  • 1 x Audio amplifier. A VMA2012 amplifier was used
  • 1 x Generic 0.4W 8Ohm Speaker
  • 1 x 12V fuse and holder. A 20A 32V fuse was used
  • 1 x 12V Toggle switch
  • 1 x Lipo low voltage alarm
  • 1 x Solderless breadboard for prototyping purposes
  • 1 x Pi breakout for easy interfacing to a breadboard
  • 2 x Atmega328P
  • 1 x BMA180 Accelerometer module.
  • 1 x HC-SR04 Ultrasonic Module.

Software Requirements

The following modules should be installed using apt-get after installing Raspbian on the Raspberry Pi:
  • Python
  • flite tts engine
  • Picamera
  • Pygame
  • Sixpair for pairing the PS3 controller to the bluetooth module and the sixad driver. This tutorial may be helpful. You may need to modify the sixad sourcecode and recompile as described here in order for the controller to work.

You can then clone the repository.

I've included my sixAxis wrapper library and hcsr04 library to facilitate the addition of a ps3 and ultrasonic sensor to the robot.

The Adafruit_PWM_Servo_Driver library is also included in the source and is used for low-level control of the PCA9685 chip via the I2C bus. The NewPing and RunningMedian libraries were also used in the arduino sketch for interfacing the ultrasonic sensor.

Notes

  • The Atmega328P is currently used to offload the ultrasonic sensing for reliable measurements
  • Most of the parts can be ordered from Adafruit and Hobbyking

Demo

Check out my YouTube channel for videos of the robot in action.

About

WIP-A Hexapod robot based around Python and the Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 85.8%
  • C++ 14.2%