cancel
Showing results for 
Search instead for 
Did you mean: 

MotionMC library not immediately reporting good-compass-calibration after loaded with calibrated data.

Rstua.1
Senior

Using the MotionMC and MotionEC libraries to implement a tilt compass. After the Motion libraries report good compass calibration I save the calibration data using the MotionMC_SaveCalInNVM() call back. Then I re-boot the device and load in this calibration data using the MotionMC_LoadCalFromNVM() call back.

But the Motion libraries does not report good-compass-calibration. I still have to spend time rotating the magnetometer and accelerometer before the Motion libraries report good-compass-calibration.

I will concede, I think I only have to spend about 1/2 the time rotating the magnetometer and accelerometer before the Motion libraries report good-compass-calibration. But I had hoped that I would see good-compass-calibration immediately after loading in the calibration values.

-thanks

1 REPLY 1
Martin B
Associate III

MotionMC library does not save calibration data periodically. It saves calibration data using MotionMC_SaveCalInNVM() callback only when Magnetometer Calibration algorithm is disabled. When Magnetometer Calibration alorithm is enabled (usually during application initialization) it loads calibration data using MotionMC_LoadCalFromNVM() callback. It is necessary to use:

MotionMC_manager_init(ReportInterval, 0);

This will disable Magnetometer Calibration algorithm and stores calibration data. Then using:

MotionMC_manager_init(ReportInterval, 1);

(already is part of application initialization) will enable Magnetometer Calibration algorithm and loads calibration data. This way it is possible to toggle enable/disable algorithm and load/save calibration data respectively anytime during application run.