cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling ( turning on / off) calibration in STMicro's MEMS library?

Rstua.1
Senior

I would like to control the magnetometer and accelerometer calibration which occurs in the STMicro's Cube-MEMS middle ware.

1) Specifically I would like to start calibration and stop calibration so as to know when calibration occurs.

2) Test the results of calibration with out added confusion due to continuous calibration during evaluation of the current calibration settings.

3) To control when the Cube-MEMS EEPROM/FLASH-Store-And-Recall calibration value functions are called (used)? It would be good to know when these values are stored and / or accessed.

-thanks

1 REPLY 1
Eleon BORLINI
ST Employee

HI @Rstua.1​ , back to you after long time. I'm trying to answer to your questions here below:

1) Specifically I would like to start calibration and stop calibration so as to know when calibration occurs.

You can manage the accelerometer and magnetometer calibration respectively with the MotionAC accelerometer and MotionMC magnetometer calibration libraries, and specifically calling the functions

/* Accelerometer */
 
/* Accelerometer calibration algorithm update */
MotionAC_Update(&data_in);
/* Get Calibration coeficients */
MotionAC_GetCalParams(&data_out);
/* Accelerometer calibration algorithm update */
MotionAC_Update(&data_in);
/* Get Calibration coeficients */
MotionAC_GetCalParams(&data_out);
 
 
/* Magnetometer */
 
/* Magnetometer calibration API initialization function */
MotionMC_Initialize(SAMPLE_TIME, 1);
/* Get current sample time in [ms] */
data_in.TimeStamp = timestamp * SAMPLE_TIME;
/* Magnetometer calibration algorithm update */
MotionMC_Update(&data_in);
/* Get the magnetometer calibration coefficients */
MotionMC_GetCalParams(&data_out);

2) Test the results of calibration with out added confusion due to continuous calibration during evaluation of the current calibration settings.

A combination of the functions above could be used

3) To control when the Cube-MEMS EEPROM/FLASH-Store-And-Recall calibration value functions are called (used)? It would be good to know when these values are stored and / or accessed.

I added the STM32 topics to get a suggestion on this topic

Regards