Gyroscope drift on mobile phones

Allen Jee picture Allen Jee · Jan 8, 2013 · Viewed 20.3k times · Source

Lots of posts talk about the gyro drift problem. Some guys say that the gyro reading has drift, however others say the integration has drift.

  1. The raw gyro reading has drift[link].
  2. The integration has drift[link](Answer1).

So, I conduct one experiment. The next two figures are what I got. The following figure shows that gyro reading doesn't drift at all, but has the offset. Because of the offset, the integration is horrible. So it seems that the integration is the drift, is it? enter image description here

The next figure shows that when the offset is reduced the integration doesn't drift at all. enter image description here

In addition, I conducted another experiment. First, I put the mobile phone stationary on the desk for about 10s. Then rotated it to the left then restore to back. Then right and back. The following figure tells the angle quite well. What I used is only reducing the offset then take the integration.

enter image description here

So, my big problem here is that maybe the offset is the essence of the gyro drift(integration drift)? Can complimentary filter or kalman filter be applied to remove the gyro drift in this condition?

Any help is appreciated.

Answer

Ali picture Ali · Jan 8, 2013

If the gyro reading has "drift", it is called bias and not drift.

The drift is due to the integration and it occurs even if the bias is exactly zero. The drift is because you are accumulating the white noise of the reading by integration.

For drift cancellation, I highly recommend the Direction Cosine Matrix IMU: Theory manuscript, I have implemented sensor fusion for Shimmer 2 devices based on it.

(Edit: The document is from the MatrixPilot project, which has since moved to Github, and can be found in the Downloads section of the wiki there.)

If you insist on the Kalman filter then see https://stackoverflow.com/q/5478881/341970.

By why are you implementing your own sensor fusion algorithm?

Both Android (SensorManager under Sensor.TYPE_ROTATION_VECTOR) and iPhone (Core Motion) offers its own.