sparkfun / SparkFun_ICM-20948_ArduinoLibrary

Arduino support for ICM_20948 w/ portable C backbone
Other
168 stars 72 forks source link

Magnetometer Calibration #141

Closed jasvinder1079 closed 8 months ago

jasvinder1079 commented 8 months ago

Hi, I have been using example 7 i.e. Quat-6_Eulersangles(with dmp enabled) and getting correct values of roll and pitch but there is some issues with yaw values (slightly unstable with roll and pitch yaw also changing).That's why I selected eg 6 Quat-9 with INV_ICM20948_SENSOR_ORIENTATION for better yaw values but in this example with the little change in roll value the yaw values changing from 40 to 160 degree suddenly. I have rotated the imu in all directions when powered up.and whats the difference yaw value in example 6 vs 7 ?which is more accurate? Im using icm-20948 with RPi 4.

PaulZC commented 8 months ago

Hi Jasvinder (@jasvinder1079 ) ,

Please search the open and closed issues. Many of them are relevant to DMP (IMU) calibration.

https://github.com/sparkfun/SparkFun_ICM-20948_ArduinoLibrary/issues?q=is%3Aissue+is%3Aclosed+calibrate+rotate

Example 7 uses the Game Rotation Vector (6-axis, no magnetometer). Example 6 uses Sensor Orientation (9-axis, with magnetometer). I think Sensor Orientation is probably the best choice for your application.

Best wishes, Paul

jasvinder1079 commented 8 months ago

thanks @PaulZC I'm using this imu for surveying purpose (tilt compesation), As suggested i rotated the device in every direction for 10-20 second and hold it for few seconds in each axes ,But my yaw giving wrong . I just want to know how we get to know its calibrated (for how much time we have to do this calibration and how often), as in land survey we need to use device for 3-5 hrs continuously ,do we only need to calibrate it once while powering on ?

PaulZC commented 8 months ago

Hi Jasvinder (@jasvinder1079 ),

I am sorry, I do not know if the 20948 DMP is suitable for this. You will need to test it yourself. The sensors will drift over time and with temperature.

There are IMU chips designed for tilt compensation. Please search "FMI IM19".

I hope this helps, Paul