View Single Post
  #17   Spotlight this post!  
Unread 30-05-2005, 12:33
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Self-Balancing 2 Wheeled Robot

Mike, I have built a balancing robot (years ago) http://www.barello.net/gyrobot

You can't do it with a static linear accelerometer. The acceleration of the body, left, right, will change the observed gravity vector and the algorithms will fail. You need a gyroscope. Gyroscopes are insensitive to linear accelerations, and only sensitive to rotational acceleration. The old FIRST gyro is what I used on my balancing robot. Gyro's drift, so you need to correct them in some way. My original balancer used the wheel drift to compensate by feeding the position error back into the balance equation. It actually worked really well, but the math overflowed after a while.

A lot of other folks use a kalman filter to fuse a tilt sensor (linear accelerometers) and a gyro. The former is used to correct the gyro and the latter is used to handle rapid rotational changes. Microstrain FAS-G is an example of such a beast. I am math challenged, so I implemented my own lame version: I simply took a very small fraction of the difference between the tilt sensor and the integrated Gyro tilt and added that back into the integrated output. It was .01, IIRC. The effect was to essentially ignore short term noise from the accelerometer due to body movement and to cause any long term drift of the gyro to be "pushed" back towards whatever the tilt sensor indicated. I got my tilt sensors as samples from www.analog.com and the gyro from old FIRST kits, so I had a zero cost.

A third option is to use some sort of direct measurement, like a potentiometer with a tail that touches the ground, or optical distance measuring doodads like the sharp GP2D12. That approach makes it easy to balance since you have an absolute measurement of tilt without any drift, but, of course, they have their problems...

A pendulum on the potentiometer will have the same problems as a linear accelerometer: if the body accelerates left or right, the weight will shift and "down" will change and, again, the algorithms will fail.

The old FIRST gyros work really well and are easy to use. They are "too" sensitive for any serious movements as their output limits at 65 deg/sec. For our FIRST robots in 2004 & 5 we used the Analog devices ADXLR150 gyro chips. Get the "EB" (evaluation board) versions for $50 and worth every penny. The 150 will go to +/- 150 deg/sec which is more appropriate.

Good luck!

P.S. You found a vision tetra and capped? Way to go. We spent three weeks beating our heads on that one and gave up. We could find the tetra, pick it up 100% and always hit the center goal, but we couldnt actually get the dang thing on top! The speed needed to do it in 15 seconds made our position errors too large by the time we go to the goal and it never quite made it. We chose to do something simple and 100% reliable: Grab a goal from the auto loader and put it on the corner.