Let's Make Robots!

Wobble Bot

Tries not to fall over.

    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.

Head Side View    Rear View

         Side showing jaw "bumper" to protect ultrasonic sensor                             Some of the wiring for the Baby Orangutan board



US Mount pic#1    US Mount pic#2

                    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:

PID control

PID without PHD

Kalman vs Complementary Filter


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.





Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Very cool-I didn't realize motor speed would be so important to the system, but I guess reaction time makes sense.  Do you have any pics of the printed parts before assembly?  It's a nice clean looking print.

It is critical. Think about it being 10 degrees off of vertical. With the Kalman filter using the gyro data and the accel data it knows the difference between "10 degrees out and falling" and "10 degrees out and swinging wildly back to center" If it is falling it is going to want to catch itself as hard as it can, but if it is already recovering from a fall it will send much less if any power to the motors. It really is a cool little project. And yes, I had to swap for faster motors so I got some "tore apart" pics to upload shortly.

Very cool looking JerZ - know you've been working on this a bit and I also know it's going to be very cool to watch. Collected and waiting... ;-) -Stephen

Thanks Proto, I've got an addon for later that I'm sure you'll appreciate ;)

Looks very good and very good write up... but has the old adage says: "Video or it didn't happen" ;) yes I know, it's pending the alterations to follow :)

Not much of a writeup compared to your adventures, but it'll have to do. In the mean time just rotate the pic above 90 degrees and pretend the wheels are turning madly in mid-air. Knock on your desk one good time and you'll even have the soundtrack :P