|
I'm pretty sure that the link you posted describes something that could do what you want.
The difference between an accelerometer and a gyro sensor would be that the gyro measures the angular acceleration (how fast is the rate at which an object rotates changes) and the accelerometer measures how much something is accelerating (not angular) .
You could use the 2 axis accelerometer to determine the direction of gravity on your balancing device. This information would tell you how the device is tilted and therefore you could (as you say) compensate. Although theoretically this can be done with a gyro as well, it would have be to be extremely accurate and undetered by spikes of large vibrations to work at all and would be subject to eventual drifts and your segway would eventually be running all over the place. The accelerometer doesn't have to be as accurate since all of its readings independently can say something about the tilt of the device; in a gyro you would need to deduce the tilt given a past of angular acceleration values.
As for the spikes, the device itself doesn't know if your riding on a bumpy road or if it is tilting, therefore (as you say) its probably a good idea to implement some software that is capable of determining over several past readings if it is riding a bumpy road or is tilting more than it is tilted already.
Also, although your describe your devicse as 1-axis, the 2 axis on the sensor are required here to determine direction, with 1 you would only be able to determine magnitude. If your balancing device could know of only magnitude, it could possibly know if it is tilting (for example the magnitude of acceleration drops if sensor is mounted straight downwards), but would not know if it is tilting forwards or backwards as both of these events would produce the same sensor readings.
Hope this helps; good luck...
Last edited by piotrm : 21-09-2003 at 05:05.
|