# Making balancing robot using Gyro only(without accelerometer)

Hi, Is it possible to make two-wheeled balancing robot using only gyro, and not accelerometer? Actualy i have got gyro breakput board from sparkfun(LPY503AL) and i want to make this balancing bot but ,on internet, most balancing robots that i have come across use both gyro+accelerometer. If so, please tell me why? if not, please tell me how?(helpful links on making balancing robot using only gyro!) and what do they mean by "gyro's output drifts with time"?

Because a gyro does not have perfect, frictionless bearings they tend to drift. As they drift the reference point changes. Get a gyro from some aircraft instrument (expensive...) as they are of hight quality. Just need a proper vacuum source and clean air flowing into the instrument.

Exactly this occurs, when i stop rotating gyro reading comes back at its normal value, no matter what angular position gyro is sitting at. Gyro's output come with movement, if motion stops reading is back normal. I was looking forward for a solution with programing to this problem. And please tell me whats different in a gyro obtained from aircraft? does it not drift?

Is this gyro not sufficient for simple balancing robot?

The problem called 'drift' is that the gyro does not give you an absolute reference. In theory you can use the gyro to measure how far you've moved from the starting position; if you move a certain angle in one direction and then move the same angle in the other direction you will always end up back where you started. A compass works like this, for example; it will always point North no matter how many times you move around. A gyro isn't like that. It has a small amount of error in detecting movement, and over time this can accumulate. Eventually, the gyro will tell you that it is pointing 'straight up' when in fact it is pointing off to the side.

If you were sufficiently determined it would be possible to detect and compensate for this drift by looking at the position and acceleration over time and finding the orientation at which the acceleration is minimum. That would be much harder than using sensors that tell you the lean angle directly, though.

One thing about drift is that it happens gradually, so you should be able to ignore it if you only want your bot to balance for a few seconds. That would be a good goal to aim for, anyway.

It is possible to build a balancing robot with no accelerometer. You only need a gyro. I do it all the time. See the attached file.

GyroMyths.pdf (529 KB)