I spent some time reading on accelerometers, gyros, sensor fusion, PID, optimized PWM motor control. I tinkered with the components I have for a while and then procrastinated for even longer. Finally, I can say that I have a prototype of a self balancing bot that shows promise.
More fine-tuning is needed, and I plan to add a Bluetooth module to get PID controller data wirelessly, possibly to adjust the PID coefficients in real time and, hopefully to steer the bot remotely someday.
I plan to post a more detailed description with the code and schematics as I make progress. Here is my components list:
- Arduino Uno
- Invensense MPU-6050 IMU (see my article on hooking it up to the Arduinio)
- L298N dual motor driver breakout board
- 200 RPM 6V geared DC motors x 2
- 11.1V 3 cell Li-Po battery
Planned additions:
- Bluetooth module (JY-MCU HC-06 Bluetooth Wireless Serial Port Module)
- Wheel encoder – I think I will probably need this if I want the robot to stay is a fixed position, or to steer it in a controlled manner.
I will likely replace the Li-Po battery with a 6AA battery pack and possibly a voltage booster (if necessary). A couple of reasons:
- I already have these components from my line following project
- The extra weight of the AA batteries at the top should actually help with the balancing
- The Li-Po battery goes back to being a spare for my “Betamax” quadcopter, as originally intended. Now that the weather is better in Vancouver, I plan to get some more flight practice!