My Balancing Robot using a RaspberryPi ModelB and a buch of Pololu Products.
Parts:
12V NIMH Battery Pack
RaspberryPi B
Pololu 5V StepDown Regulator (forRPi)
MinIMUv2
37D MetalGearMotors 19:1 with encoders + Hubs + MountingBrackets
RoboClaw 15A
Custom Made Aluminum Chassis
State Measurement:
Position - Encoder (RoboClaw Feature)
Velocity - Encoder (RoboClaw Feature)
Angle - IMU (MinIMUv2 Accelerometer&Gyro Fusion)
Angular Velocity IMU (MinIMUv2 Gyro)
Actuation:
MotorController, PWM (RoboClaw Feature)
Setup:
Software is written in C++. RPi runs a control loop at 50 Hz measuring all states, computing the control signal and sending it to the actuators.
The control signal is computed using LQR state-feedback. The resulting value is remapped, avoiding motor-deadzone issues.
Features for driving in a straight line and driving curves were added.
LQR gains were calculated numerically after having modeled the entire system.
Step stones:
-Compensating for the motors deadzone.
-Getting the correct motor parameters (Inductance, Resistance, Load Inertia, BackEmf, friction …).
Chosen strategy:
- Measurement of the motors step responses for different DutyCycles using the encoders.
- Creating a Motor model with initial guesses for the unknown parameters.
- Find Parameters using numerical optimization toolbox (sth. like octave or matlab)
ToDo: Bluetooth Interface to steer the robot via smartphone or pc.