IMU acts weird

Hi,

First of all, please let me know on what forum topic I should post this question if it does not belong here :smiley:

I have an OpenLog Artemis with IMU (DEV-16832). I want to calculate absolute coordinates using that 9 DoF IMU. Now, I tried doing so using trigonometry and Euler angles but that exposes me to gimbal lock and who knows what other problems. So I research this topic further and found that people use Quaternions for such solutions (using Madgwickā€™s Quaternion Update algorithm).

This approach does not work as I want it to since I got pretty much the same problem as before (with Euler angles).

Next, I found out that the DMP can calculate quaternions for me so I tried that out but weird things kept happening. For example, when the IMU is placed stationary on the table, quaternion (Q1, Q2, Q3) values kept increasing or decreasing and then after 15 seconds they would stop, then again when I would move it (for 90%) I would, again, have to wait for about 15s until those values ā€œcalmed downā€.

Also, the 9DoF values (aX, aY, aZ, gX, gY, gZ, mX, mY, mX) are not really stable when the IMU is stationary, but thatā€™s something I can solve using average values of n readings since that is just sensor noise I suppose.

Do I have to calibrate the IMU and if so, how? (I have not found any detailed description on how to calibrate it).

And I know its a long shot, but does anyone have any working solutions that calculate absolute coordinates using ICM-20948?

Thank You for Your help and time!

Best Regards

Filip V

Hi Filip,

You do need to calibrate the DMP, so the readings become stable. You need to rotate the IMU around all three axes. This allows the DMP to measure the ā€˜scaleā€™ and ā€˜offsetā€™ for each sensor channel.

Best wishes,

Paul

Hi Paul,

What does that mean exactly? Something like calibrating phone GPS?

Best Regards,

Filip

Hi Filip,

These instructions are for a different sensor (BNO080), but the procedure is the same:

https://github.com/sparkfun/SparkFun_BN ā€¦ -630152613

Best Wishes,

Paul

Hi Paul,

Thank You very much for the explanation! Now itā€™s much better, but only after some time. It takes some time after powering on to get to starting point I guess

One last question. Di I have to do it every time I power it up?

Best Regards!

Filip

Hi Filip,

Yes, every time, sorry! It should be possible to save and restore the DMP calibration, but - at the moment - we do not know how to do that. You can read a long discussion about it here:

https://github.com/sparkfun/SparkFun_IC ā€¦ /issues/50

Best wishes,

Paul

Hi Paul,

Thank You for Your help and time!

Best Regards!

Filip

Do I have to calibrate the IMU and if so, how? (I have not found any detailed description on how to calibrate it).

Yes, if you are not using the DMP. The gyro and the magnetometer MUST be calibrated for the Mahony or Madgwick filters to work at all. There are plenty of tutorials posted on line, but to summarize:

  1. Calibrate the gyro by collecting a few hundred readings with the sensor held still, average those and store them as offsets. Subtract the offsets from subsequent raw measurements.

  2. Calibrate the magnetometer by following the procedure outlined in this forum post (and read the references linked in that post): https://forum.pololu.com/t/correcting-t ā€¦ eter/14315