Self Balancing Bot

/media/uploads/Samer/ece4180blockdiagram.png This project consists of a robot balancing on two wheels. We use the 9-axis IMU LSM9DS0 to give us Accelerometer and Gyroscope data about the current angle and angular velocity of the robot. This data is then filtered using complementary filters and PID control to drive the two motors. The motors are controlled through digital outputs in their direction and their seepd by PWM using an H-bridge

Hardware used:

Micro-controller : Mbed NXP LPC1768. [http://developer.mbed.org/platforms/mbed-LPC1768/]

IMU : LSM9DS0 https://www.sparkfun.com/products/12636

H-Bridge: Polulu md08a https://www.pololu.com/product/713

Spark Fun RedBot Kit: https://www.sparkfun.com/products/retired/12032

Software Used:

LSM9DS0 library : http://developer.mbed.org/cookbook/LMS9DS0-IMU

Mbed API

Code:

Import programbalance2

ECE 4180 Mini Project Balancing Robot Nico van Duijn Samer Mabrouk 3/6/2015 This project consists of a robot balancing on two wheels. We use the 9-axis IMU LSM9DS0 to give us Accelerometer and Gyroscope data about the current angle and angular velocity of the robot. This data is then filtered using complementary filters and PID control to drive the two motors. The motors are controlled through digital outputs in their direction and their seepd by PWM using an H-bridge

This code uses a complimentary filter to reduce the IMU's inaccuracies. For more info check : http://www.pieter-jan.com/node/11

Assembly:

To reduce the center of gravity, the motors and the IMU chip are located as close to the wheels as possible with the IMU centered between the motors for a better balance. IMU to Mbed:

IMU Pinmbed Pin
SCLp10
SDAp9
VddVout
GNDGnd

H Bridge to mbed

H Bridge Pinmbed Pin
GNDGnd
VCCVO
VMOTVsupply
GNDGnd
PWMAp21
AIN2p23
AIN1p24
STBYVout
BIN1p26
BIN2p25
PWMBp22
GNDGnd

H Bridge to Motors : Left motor is to the left of the IMU chip and the right one is to the IMU's right.

H Bridge PinMotor Wires
BO1Left Motor Black
BO2Left Motor Red
AO2Right Motor Black
AO1Left Motor Red

/media/uploads/Samer/img_3250.jpg /media/uploads/Samer/img_3249.jpg

Final Result:

This video shows the Balancing Bot in action.


Please log in to post comments.