IMU Explorations - MPU6050 Calibration Drift

Every now and again I think I have rebuilt strength to explore an Inertial Measurement Unit for my robots, and find the topic just too complex.

This time my experiment was with the MPU6050. Usage of this IMU begins by placing the IMU level and motionless for a period while collecting ax,ay,az accelerometer and gx,gy,gz gyroscope readings to collect a mean calibration offset.

So I repeatedly collected 240 readings over one minute calibrations, to discover the values drifting:

Collecting 1 minute of readings for calibration
means: ax: -0.503  ay: 0.581  az: 9.920   gx: -0.489  gy: 1.889  gz: 0.081 temp: 42.5C
Collecting 1 minute of readings for calibration
means: ax: -0.514  ay: 0.596  az: 9.914   gx: -0.426  gy: 1.799  gz: 0.077 temp: 44.7C

I had heard that gyroscopes “progress” over time, so I am not totally surprised by that drift, but a 2% to 3% drift in acceleration makes me think single point calibration is fated from the start.


Does look that way. Although I wonder if you’re looking more at differences if the changes will average out over time?

1 Like

Sort of - it seems like IMU data is known to be quite noisy so they apply kalman filtering and PID modeling to pull out “the reality” from the data. That is why the DI BNO055 IMU with Fusion processor costs so much. I saw several places that say even using the output from that is not sufficient and apply their own “Apollo Moon Flight” algorithm to the raw data from the BNO055 to get better accuracy.

I just never would have thought it would be so hard to have a robot turn good 90 degree turns, (or to actually know what direction it is facing sufficient to actually drive straight forward without wandering a body width left or right after crossing the room).

Adding min and max to the calibration:

Collecting 1 minute of readings for calibration
max:  ax: -0.309  ay:  0.764  az: 10.106   gx: -0.397  gy:  1.916  gz:  0.130 temp:   43.3C
mean: ax: -0.467  ay:  0.651  az:  9.911   gx: -0.465  gy:  1.871  gz:  0.075 temp:   43.3C
min:  ax: -0.613  ay:  0.464  az:  9.701   gx: -0.511  gy:  1.817  gz:  0.008 temp:   43.3C
Collecting 1 minute of readings for calibration
max:  ax: -0.309  ay:  0.759  az: 10.094   gx: -0.397  gy:  1.939  gz:  0.130 temp:   43.1C
mean: ax: -0.468  ay:  0.649  az:  9.908   gx: -0.477  gy:  1.880  gz:  0.072 temp:   43.1C
min:  ax: -0.613  ay:  0.479  az:  9.807   gx: -0.527  gy:  1.824  gz:  0.000 temp:   43.1C

That depends on if you have a budget like DARPA or the DOD.

For us mere mortals, maybe not. :wink:

Actually, the best way might be a cm-accuracy GPS receiver, but they’re not cheap either and I don’t know how well they will work indoors.


the best way might be the camera, but that too is not been pre-packaged for the picam.

The create3 is using a floor facing camera “flow sensor” that seems to cost like the DI IMU, but I don’t know what its accuracy is. The commercial versions seem to be targeted to drones not 1cm away floors.