I am trying to implement a Kalman filter combining an accelerometer and the gyroscope in an IMU.
To my knowledge I would expect the gyro to have a constant drift which we will compensate by bringing in the accelerometer.
However, when analyzing the gyroscope independently I do not always observe a constant drift. If we do not have a lot of fast movement/high acceleration, the drift seems correct as seen in the first plot. On the second plot we get the gyro raw values.
At the beginning it can be seen that we offset the gyro by averaging the first 100 readings.
However, when I move the IMU more aggressively, the gyro does no longer have a constant drift. I do not know where this variation of the drift comes from and what would be a state-of-the-art way of solving this issue. I thought of small movements due to a small mounting issue, but if it would be left still, it should keep integrating the degrees at a same rate.
Even zero-mean noise can cause large random walk excursions from anything being constant. Double integration of this noise will cause your compensation to explode. The only good solution may be to use sensor fusion with another independent source of ground truth (optical, magnetic, audio, etc.)