balancing robot question
I am trying to decide if it's worth building a balancing robot. I have read the nuts and volts articles, looked it up, and done some research. The construction looks fairly simple, but what really gets me is the math and theory behind the accelerometer/gyro.
From what I understand, you need a two axis accelerometer, and a single axis gyro minimum. I understand that the gyro is used to determine the angle, and the accelerometer provides a reference based on the deviation from 1g (y axis) and 0g (x axis), to compensate for gyroscope drift. I am just having a hard time with the fact that a gyro is needed at all.
Suppose you were to take a dual axis accelerometer like the ADXL202/203. Holding it so that the y axis points vertically and the x axis points horizontally, you would get -1g and 0g respectively.
Now what if you were to align the accelerometer so that it matched the picture (attached)? both the x and the y axis would have the same value (.707 something) if the robot was perfectly balanced. if the robot began to fall in one direction (left, for the reference of the picture) then the left value would be greater and the right value would be lesser. The robot would simply need to drive left and try to get both the values to match. As long as the values were within .001 (maybe even less) of each other, the robot should remain balanced.
So why isn't this method used? it would certainly make the construction ~$100 cheaper.
I'm sure there is something that prevents this from working, but It would be great to know why if anyone can offer some insight.
Thanks!
From what I understand, you need a two axis accelerometer, and a single axis gyro minimum. I understand that the gyro is used to determine the angle, and the accelerometer provides a reference based on the deviation from 1g (y axis) and 0g (x axis), to compensate for gyroscope drift. I am just having a hard time with the fact that a gyro is needed at all.
Suppose you were to take a dual axis accelerometer like the ADXL202/203. Holding it so that the y axis points vertically and the x axis points horizontally, you would get -1g and 0g respectively.
Now what if you were to align the accelerometer so that it matched the picture (attached)? both the x and the y axis would have the same value (.707 something) if the robot was perfectly balanced. if the robot began to fall in one direction (left, for the reference of the picture) then the left value would be greater and the right value would be lesser. The robot would simply need to drive left and try to get both the values to match. As long as the values were within .001 (maybe even less) of each other, the robot should remain balanced.
So why isn't this method used? it would certainly make the construction ~$100 cheaper.
I'm sure there is something that prevents this from working, but It would be great to know why if anyone can offer some insight.
Thanks!
Comments
Balancing robots are out of my own area of expertise, but the first question that comes to my mind is: What happens if the wheels are not rotating at the same speed? Won't the 'bot wander all over the place? Perhaps that's part of the reason for the gyro?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
About the wheels now... Since each wheel needs its own balancing value you can use an offset value that can be variable to be able to control the steering of the balancing bot.
What I learned trying to code these sensors to my 2wheels BS2 balancing bot is that faster hardware is needed nor to mention fast motors for each wheel.
Rgrds, Thanos
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
·
There are much simpler ways to build balancing robots, if you are willing to accept that they will only work on a level surface. There are many examples of·balancing robots using IR sensors, e.g., to sense distance or angle from the floor. I built a balancing robot that uses the Parallax Ping))) to do this. It works fine on a level surface but will fall over if it encounters a hill.
Might be better to start with something simpler than the fairly sophisticaed approach in the Nuts&Volts article.
/John
http://forums.parallax.com/showthread.php?p=570699
I'm not too into making it only work on level surfaces, so I think I'll avoid the range finder method. I'm surprised though that there isn't a sensor with the sole purpose of finding the angle between it and the force of gravity (j vector).
Anyway, until this gets a bit less complex (or I get better at physics) I'm going to hold off on this project.
Thanks for your input!
I have the MEMSIC and am trying to get this to work with that sensing the incline. I have the board mounted on some erector set stuff and the problem appears to be that the servos are not quick enough. The code is working fine to sense the tilt, but the servos do not appear to move quickly enough to correct it. The device is about 10" tall and purposely top heavy.
I am thinking of larger diameter wheels...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
slashsplat
/* Ira Chandler */
"There's no place like 127.0.0.1"
Post Edited (slashsplat) : 1/1/2007 10:17:06 PM GMT
How much does your robot weigh? The balancing robot I posted on the Completed Projects forum this morning weighs 1.2 lbs. I originally had it at 1.6 lbs and couldn't quite get it to balance. I reduced the weight to 1.2 lbs and it works really well now. The two other things that helped a lot are 3" foam wheels (Du-Bro wheels from Tower Hobbies) and NiCd batteries, which visibly improved the performance of the servos by providing stronger surges when they start up or change direction (pretty much all they do in this application).
I tried really hard to get the Memsic accelerometer to work but couldn't. It's beautifully accurate at rest, but once the motors start trying to balance the robot they indicate more about what the motors are doing than tilt. Did you find any way around this? Are you using any filtering algorithms in your program. If you do get it to work that will be great, and I'll keep trying too.
/John
Then a REAL motor.
UPDATE: I put a fresh 9V on it and the servos livened up. I will readjust the center of gravity and play some more. Thanks for the idea.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
slashsplat
/* Ira Chandler */
"There's no place like 127.0.0.1"
Post Edited (slashsplat) : 1/9/2007 3:33:37 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
(you need to measure the accelleration of the end, not the middle of the robot)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
I don't see any way around a software filter that teases what we want to know from the noise over time, along with a gyro for quicker, if not absolute readings.
/John
Tilt angle can be easily determined from acceleration. Tilt rate can be found by differencing acceleration. The problem with using accelerometers at the only sensor for getting these readings is the relatively slow update rate of the accelerometer. For about $50 a piece, a gyro will have 3x the update rate of an accelerometer.
Gyros give you tilt rate, however, these values are subject to drift over time. So, typically, you use a gyro (because you get results faster and thus can run your control algorithms more times per second) and use the slower accelerometer to correct the drift in the gyro.
However, I'm confident I can make a balancing robot using ONLY an accelerometer. In the summer of 2005, I made one that uses IR distance measuring sensors to detect tilt (relative to a flat surface). These sensors have an update rate of about 25 times per second. The MEMSIC accelerometer I'm getting is reported to have an update rate of about 33 times per second (though the datasheet suggests an upper limit of 45). If I had an additional $50 to spend on this project, I could buy a gyro which has an update rate of 100 readings per second.
Based on my prior experience with the relatively slow IR sensors, I'm pretty confident in using an accelerometer.
Someone mentioned earlier making the robot top heavy. Other wondered why, asking wouldn't it be better to have the center of mass closer to the ground. The issue is the rotational inertia of the robot. With the COM close to the ground (ie close if not on the drive wheel axle), the robot has little rotational inertia. This means it barely resists the tendency to fall and requires less torque to recover from a fall. Unfortunately, this means it falls MUCH faster and your motors need incredibly fast response times and need to be able to generate high speeds in very short times. Also your sensors need to be fast enough to respond. Given that most sensors are not fast enough. . and motors are probably slower, it is better to have the COM higher.
Having a high COM gives a large rotational inertia. The more the robot resists changes in rotational motion (about the axle), the less work you have to do to keep it balanced. The problem is that once the robot tilts beyond a certain point, the higher inertia will probably require more torque than motors can provide.
Another reason why the higher COM works better is that it plays right into the use of PID or other control algorithms which ALL assume linearized motion of the robot. As long as the tilt angle stays small, we can apply small angle approximations (which are linear) and not have to worry about nonlinear sines and cosines.
************************
A little more info about my current robot. I'm building it to enter into the trinity college firefighitng competition. The competition doesn't need a balancing robot, however, I wanted to see if I could improve upon my previous design and use lower cost parts for the motive portion of the robot. I'm currently using the Tamiya Double motor gearbox. The reason I'm building this one with an accelerometer is because IR sensors require the robot be on a flat surface to maintain balance. On an incline, they will fail. One solution could be to use a combination of IR sensors and a tilt sensor. However, most tilt sensors are too slow or don't provide enough resolution. The best cheap tilt sensor is an accelerometer and they have faster update rates than the IR. . .so I didn't see any point in using both to keep balanced.