A gyro does a good job of measuring the change of angles if it's "Integrated" in the math.
But by itself, it will drift because it has no point of reference.
Adding a 2-axis accelerometer can give it a reference point (the gravity vector).
But that assumes it's stationary in the 3rd axis (like a clock on the wall).
And it has to be totally stationary often enogh to maintain the reference point to gravity.
With a 3-axis accelerometer you can get a "Tilt Sensor".
http://www.picbasic.co.uk/forum/cont...-axis-g-sensor
But constant rotations would cause it to drift as well.
It would be more accurate, and a lot less hassle, to put an encoder on whatever is turning.
Bookmarks