Dual-wheel Auto-stabilizing Robot
ECE 4180 Fall 2019 Final Project
Team members: Solomon Martin, Amarachi Nzeukwu
Georgia Institute of Technology
The following design is for a robot that drives it’s wheels to maintain a “standing” orientation. To do so, it processes the accelerometer and gyroscope data from the imu to obtain heading info. This is what is input to the PID controller, which then controls the motor output.
Parts used
- Mbed microcontroller
- IMU 9DoF
- Dual Hbridge/Motor driver
- Gear motor
- Wheels (Rubber tires)
- Shadow chassis
- 9V battery
Connections
Mbed | Battery | Hbridge | Gear Motor | IMU |
---|---|---|---|---|
Vin | (red wire) | VM | ||
Gnd | (black wire) | Gnd | Gnd | |
Vout (3.3V) | VCC, STBY | VDD | ||
AO1/BO1 | (red wire) A - left motor B - right motor | |||
AO2/BO2 | (black wire) A - left motor B - right motor | |||
p22 | PWMA | |||
p5 | AI1 | |||
p6 | AI2 | |||
p21 | PWMB | |||
p8 | BI1 | |||
p7 | BI2 | |||
p28 | SDA | |||
p27 | SCL |
Mbed API
Import libraryMotor
Control an H-Bridge using a PwmOut (enable) and two DigitalOuts (direction select)
Import programLSM9DS1_Library
LSM9DS1 IMU Library by J Mar - Fixed typo on comment line 315 *.h file causing compile errors
Code
The raw accelerometer and gyroscope values are put into low pass filters and high pass filters respectively. Then the complementary value attained by adding the two results is put through a PID loop. In this iteration, the gyroscope values were found to be very unreliable, and the PID was not complete, so there is only the polynomial element. There is also a SpeedCorrection constant, that attempts to solve the weight distribution problem.
Import programStabilize
Attempt at controlling a specific single-axle robot to balance, by driving motors using filtered IMU data
Demo
The following video is the longest recorded run, with parameters very similar to those found in the code.
Please log in to post comments.