A couple of weeks ago got access to an Intel Galileo GEN2 Board, so I decided to make a self-balancing robot! I've seen many people describe self-balancing robots as the "Coming of Age" project for electronic hobbyists, so it was about time I made one too...
This demonstration uses the concept of an inverse-pendulum system in order to stabilise itself with an accelerometer-gyroscope module and two motors. As the unstable system starts to tip over in one direction, the accelerometer-gyroscope records this change in angle, as well as the angular velocity. In turn a PID (Proportional, Integral, Derivative) controller is used to control the motors, therefore stabilising the system.
- 1 x Intel Galileo Development Board (preferably GEN 2)
- 2 x 12v Power Supply
- 1 x Official Arduino Motor Shield R3
- 1 x MPU-6050 Accelerometer-Gyroscope Breakout Board
- 2 x High Torque Gearbox Motors (~12v, between 100 – 300 RPM)
- 1 x External Power Jack
- 1 x SPST Toggle Switch
- 1 x PTM Button
- Colour-coded wires (~1.5m), preferably single core
I have attached a detailed document of the assembly and use of the self-balancing robot below. I have also included the program sketch that I used. I uploaded the sketch to the Galileo using the Arduino IDE, which worked surprisingly well. The program does require two special libraries: "MPU6050" and "I2Cdev". These libraries are used to obtain the data from the MPU-6050 accel-gyro module and then fuse the data to get an extremely accurate value for the pitch, yaw and roll.
I designed the frame of the robot on the computer using SketchUp, and then got the parts 3D printed. In reality you could make the frame out of any spare parts you have lying around, and it would stabilise just as well. You can view and download my 3D files, as well as all other documents and libraries required for this project from my blog: http://wired.chillibasket.com/self-balancing-robot/
I hope to publish a series of posts on my blog soon that will cover all of the steps required to make a self-balancing robot!
Here is a video of the robot in action: