Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 10 months ago.
gyroscope angle.
Please how can i convert the output of a 3-axis gyroscope to angle.
2 Answers
10 years, 10 months ago.
The output of a gyro is normally Deg/sec, and is not a reliable way to know the angle, as gyros are well known for drift. It is best to use an accelerometer. Find an IMU program and look through it to give yourself ideas.
Dave.
10 years, 10 months ago.
1,An initial value is given at the time of a program start. (for example pitch=10deg)
2,The value of a gyroscope is acquired periodically. (for example 0.1sec/interval , gyrodata is 5deg/sec)
3,A measurement value is added to an initial value. (10deg + 5deg/sec*0.1sec=10.5deg)
4,The present angle can be obtained by repeating.
test
t=0sec,Angle=10.0deg
t=0.1sec,gyrodate=5deg/sec,Angle=10.0+5*0.1=10.5deg
t=0.2sec,gyrodate=3deg/sec,Angle=10.5+3*0.1=10.8deg
t=0.3sec,gyrodate=10deg/sec,Angle=10.8+10*0.1=11.8deg ,
But .Gyro has the Bias Error, so Angle will shift to wrong angle, if time passes. iPhone or WiiController is using not only Gyro,but also AccSenser Mag compass In order to correct long-term shift.