IMU 6DOF fusion algorithm, reset yaw angle without re-starting the fusion algorithm

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMU 6DOF fusion algorithm, reset yaw angle without re-starting the fusion algorithm

1,881 Views
DRE
Contributor II

I'm using the NXP fusion library with an 6DOF IMU. Unfortunately there is no reference to calibrate the built in gyro, e.g. with a magnetometer in that application.
I'm doing short measurements (1..10s) using the linear acceleration output of the fusion algo to detect the movement direction. The algo is continuus running also when not detecting movements.
Unfortunately due to the drift of the gyroscope over time the yaw angle changes. Worst case after some time by 180° which results in a sign reversal of the linear acceleration output.
I tried to solve this by resetting the algo using "fInitializeFusion(&sfg);". This works but depending on the acceleration at the time of resetting the algo it can take quite long (some 10 seconds)
until the output of the fusion lib stabilizes.

I'm looking for a way to "zero" the accumulated gyro error without fully resetting the algo.

Thanks!

Dirk

0 Kudos
4 Replies

1,845 Views
DRE
Contributor II

Thanks for your reply.

I found that tweaking the 6DOF_GY will help. I'm now emphasizing the accelerometer readings.

Concerning the gyro calibration I have a question:

>We recommend you to store gyro calibration offset measured during initialization and store in NVM (refer to "SaveGyroCalibrationToNVM" function).

When is the best time to do this? Leaving the unit stand still e.g. on the desk for some time? How long does the fusion algorithm need to calculate a reliable Gyro offset?

Thanks!

Dirk

0 Kudos

1,840 Views
AmitPurohit
NXP Employee
NXP Employee

Hi Dirk,

Glad to see that tweaking 6DOF_GY config macros helping you.

Regarding storing Gyro calibration offset to NVM: The offsets can be measured by first taking some readings while the unit is not moving, then you can save the measured offset values and apply when reading the gyro values in the future. The calibration offset measurement for 6DOF_GY should take no time.

Remember that the sensor calibration is unique to the sensor unit for which it is computed and the calibration values are stored in the MCU flash memory. If you move sensor unit from one MCU board to another you will need to erase previously stored calibrations in MCU flash. You can refer to "EraseGyroCalibrationFromNVM" function).

Regards,

Amit Purohit.

0 Kudos

1,835 Views
DRE
Contributor II

Hi Amit,

sorry for bugging you again

The calibration values can be found in sfg->SV_6DOF_GY_KALMAN.fbPl.

Does the library calculate those values during init or do I have to provide it? From the documentation of the library this is not clear to me.

Thanks!

Dirk

 

0 Kudos

1,865 Views
AmitPurohit
NXP Employee
NXP Employee

Hello Dirk,

Thank you for posting your question. Please share more details on your test setup, hardware used etc. This will help us answer you better.

Based on your question and details provided, please see our response below:

  • The initialize routine sets the gyro offset "variable fbPl" based on current measurement with-in "FMIN_6DOF_GY_BPL" & "FMAX_6DOF_GY_BPL" else set to 0. You can try to configure 6DOF GY constants based on your setup.
  • Sensor fusion algorithm also provides optional way to store calibration offset values to NVM, that helps to retrieve calibration offset and reapply if needed.
  • The run 6DOF GY routine keep checking gyro offset error "variable fbErrPl" against maximum permissible gyro offset change "fMaxGyroOffsetChange" and apply gyro offset "variable fbPl" correction accordingly. You can refer to 6DOF GY constants defined in fusion.h file and tune these values as per your setup.
  • We recommend you to store gyro calibration offset measured during initialization and store in NVM (refer to "SaveGyroCalibrationToNVM" function).
  • Tune 6DOF GY constants defined in fusion.h to adjust algorithm performance for your test setup.

Let us know if this helps.

Amit Purohit.

0 Kudos