This is WobbleBot, my attempt at a two-wheeled self-balancing robot. Using Pololus' Baby Orangutan-B 328 to control the micro gearmotors. Although the bot is not very stable yet, it uses PID with a Kalman filter to do what it does. The Ultrasonic sensor will be implemented when it is on a stable platform. The code is working properly but the motors just aren't fast enough. The current motors are 120RPM, and the ones I'll be installing are 290RPM, so it should help a lot. I also have some larger wheels I could use if the motors still aren't fast enough. After the surgery, I'll need to recalibrate the PID and hopefully it will be on to the next step. :D
This robot is based on an inverted pendulum design, where the weight of the batteries mounted in it's head actually help it balance better. Think of balancing a broom in your hand, the mass at the top makes it easier for you to move your hand under it to maintain balance. To control the motors it uses data from an accelerometer and a gyro mixed in what is called a Kalman filter, which basically measures a noisy signal over a specific amount of time and estimates what the signal actually should be, to feed a clean signal into a PID algorithm to tell the motors how fast they need to go to make everything balance out. I'm using Pololus' Baby Orangutan-B 328 as a controller because it is small, has a built it motor driver, and I already had one laying around waiting for a project with 2 DC motors. :P The Baby-Os' 20mHz clock speed is a little funky with the standard arduino library and I hope to work around that in the future, but I think as long as all of the equations are using the same time reference it shouldn't be a problem.
Here are some pics of the robot so far, I didn't get any of the inside of the motor/sensor bay, but will when I swap out the motors.
Side showing jaw "bumper" to protect ultrasonic sensor Some of the wiring for the Baby Orangutan board
Top view showing the battery holder The bracket for the ultrasonic sensor mount
These are some great resources if you are interested in a similar project:
Thanks for stopping by, I'll post pics of the motor swap and the sensor bay when I tear it all apart again :P
Video coming soon as well.