Robot localization using an IMU with PID control

Overview

The goal of our project was to design a robot that could determine its position, relative to a starting point, using LSM9DS0 IMU (inertial measurement unit) sensor data and the mbed ARM platform. The position of robot was calculated from accelerometer data obtained from the IMU, and the heading angle was calculated with the IMU magnetometer. Additionally, the robot was controlled by two DC motors though an H bridge breakout board, powered by a 5V DC battery pack and four AA batteries. Because of differences between the two motors, the robot would drift. This was corrected using a PID controller, adapted from the implementation seen here (https://developer.mbed.org/cookbook/PID) courtesy of Aaron Berk, that would compenstate for the drift whenever the heading would deviate from the target.

H-Bridge

/media/uploads/cardenb/page1image8152.png

Wiring Table

MbedH-BridgeRobotBattery
GNDGND-
VOUTVCC
A01L-
A02L+
B01R+
B02R-
VMOT+
p26PWMA
p25AIN2
p24AIN1
VOUT!(STBY)
p23BIN1
p22BIN2
p21PWMB

IMU

/media/uploads/cardenb/3mkk8fenvmkzgqf1d319retjavt0mlovzmgpj2axhymh41lzbxqjctsovsnpbsyquvg0eksfjx7b7dm4jiwulqmxxyjaaggfzqepgm83jv5e28sv72i4sqhdjjcxpoae5us1vshoalcl63ru.png

Wiring Table

MbedIMU
p10SCL
p09SDA
VOUTVDD
GNDGND

Images of Robot

/media/uploads/cardenb/fullsizerender_2.jpg /media/uploads/cardenb/fullsizerender.jpg /media/uploads/cardenb/fullsizerender_3.jpg

Video Demonstration

Our demonstration has our robot traveling in a square half-meter, turning right three times, until it returns to its initial position. Because we are using only IMU data without wheel encoders, there is a lot of drift, which causes the localization to be somewhat inaccurate.

Import programRobot localization using an IMU with PID control

Code used to localize a robot using IMU with PID control


Please log in to post comments.