MotionMC does not calibrate my Magnometer in real-time.
Hello everyone,
We have successfully setup MotionMC lib in our project in order to calibrate the magnometer embedded in the MPU9250 IMU chip. When the board is turned on, after 15-45 sec (depending on rotating the board), MotionMC calculates the soft&hard iron coefficients. In fact, it calibrates our sensor perfectly.
The problem is that it is done only once after turning the board on while it should always calculate and update the values. My question is how can we force MotionMC to updates its parameter, espacially when devices is moved to new environment when Electromagnetic field is changed hugely in real-time (without reset/turning the board off)
/* Current implementation */
while(true)
{
if(HAL_GetTick() % 50 == 0)
{
// Read Magnometerdata
// MotionMC_Update(&data_in);
// MotionMC_GetCalParams(&data_out);
// MotionMC_manager_compensate(&MagValue, &MagComp);
}
}