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.

/media/uploads/Amarachi2000/bot_block_diagram_1.png

Parts used

  1. Mbed microcontroller
  2. IMU 9DoF
  3. Dual Hbridge/Motor driver
  4. Gear motor
  5. Wheels (Rubber tires)
  6. Shadow chassis
  7. 9V battery

Connections

MbedBatteryHbridgeGear MotorIMU
Vin(red wire)VM
Gnd(black wire)GndGnd
Vout (3.3V)VCC, STBYVDD
AO1/BO1(red wire)
A - left motor
B - right motor
AO2/BO2(black wire)
A - left motor
B - right motor
p22PWMA
p5AI1
p6AI2
p21PWMB
p8BI1
p7BI2
p28SDA
p27SCL

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

Import libraryMath

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.