Legged Pi: A walking biped Raspberry Pi robot

Ingredients:

  • Pi Bundle:
    • Raspberry Pi Model A
    • USB Wifi dongle
    • 8GB SD Card running Raspbian
  • Servos:
    • Pololu Maestro 6 channel servo controller
    • 6 mid-size servos
  • Power:
    • 7.2V 1300mAh 2S Lipo battery for the servos
    • 5V 1A NiCD power bank for the Pi
    • UBEC voltage down converter
    • Battery wires & connectors
  • Essentials:
    • 4 breadboard wires to connect Pi with Pololu Maestro
    • Metal robot legs
    • Lots of nuts & bolts
  • Oh and… sleepless nights, and countless falls during walk attempts

Software: Raspbian, Python 3, Python Tornado, HTML, JQuery.

Project Overview

This whole exercise is to capture the essence of servo control using Python 3. It took 3 months full time to build and code everything from scratch, including the Pololu Maestro Device driver that wasn’t compatible with Python 3, so we have to come up with our own driver.

The project uses 4 files:

The hardest bit of the project is to keep the balance of the robot during movement. Due to the asymmetric weight issues, the left and right leg movements are not really equivalent, thus this robot at this stage leans a little bit to the left during forward move. Few more adjustments needed to ensure it can walk straight.

Initially it has only 2 buttons: Forward and Stop. Rotate Left and Rotate Right functions were added later when an acceptable balance is achieved. Next on the wish list are the backward function and some distance sensors to prevent it from hitting the walls. We may need to port the whole project to Raspbery Pi Model A+ to accommodate the extra sensors and allow some space.

Update: We have added a distance sensor using HC-SR04 ultrasonic sensor and and open-source Python driver called hcsr04sensor. This will calculate the distance between the robot and an obstacle like wall or other stuff in the house. Once it reaches 30cm or less it will halt the robot automatically and show warning via the web user interface.

Overall it’s been an awesome learning experience to have come this far with the robot!

The next bit to the project is to add a buzzer so it beeps each times the robot approaches an obstacle. And we should add autonomous mode to keep the robot running independently by keep it walking and avoid obstacles with minimal human intervention.

Leave a comment for source code or Python tutorials.

robopi3 robopi2 robopi1

(Visited 2,050 times, 1 visits today)