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
Wiring Table
Mbed | H-Bridge | Robot | Battery |
---|---|---|---|
GND | GND | - | |
VOUT | VCC | ||
A01 | L- | ||
A02 | L+ | ||
B01 | R+ | ||
B02 | R- | ||
VMOT | + | ||
p26 | PWMA | ||
p25 | AIN2 | ||
p24 | AIN1 | ||
VOUT | !(STBY) | ||
p23 | BIN1 | ||
p22 | BIN2 | ||
p21 | PWMB |
IMU
Wiring Table
Mbed | IMU |
---|---|
p10 | SCL |
p09 | SDA |
VOUT | VDD |
GND | GND |
Images of Robot
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.