EasyManua.ls Logo

ST X-CUBE-MEMS1 - Figure 2. STM32 Nucleo Board Rotation During Calibration

ST X-CUBE-MEMS1
24 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The MotionFX library magnetometer calibration library compensates for hard-iron distortions.
The magnetometer calibration can be performed at a slower frequency than the sensor fusion output data rate
(e.g., 25 Hz).
T
o run the calibration:
1. initialize magnetometer calibration library (MotionFX_MagCal_init or MotionFX_CM0P_MagCal_init)
2. call periodically calibration function (MotionFX_MagCal_run or MotionFX_CM0P_MagCal_run) until the
calibration is successfully performed
3. check if calibration was successful (MotionFX_MagCal_getParams or
MotionFX_CM0P_MagCal_getParams); if the function returns mag_data_out.cal_quality =
MFX_MAGCALGOOD or MFX_CM0P_MAGCALGOOD, the calibration was successfully performed
4. apply calibration results:
− MAG_Calibrated.AXIS_X = MAG_Value.AXIS_X - MAG_Offset.AXIS_X
− MAG_Calibrated.AXIS_Y = MAG_Value.AXIS_Y - MAG_Offset.AXIS_Y
− MAG_Calibrated.AXIS_Z = MAG_Value.AXIS_Z - MAG_Offset.AXIS_Z
After calibration routine initialization, slowly rotate the device in a figure 8 pattern in space. While performing this
movement, keep the device clear of other magnetic objects such as cell phones, computers and other steel
objects.
Figure 2. STM32 Nucleo board rotation during calibration
To check that the calibration was performed correctly, check magnetometer data (after applying calibration
results) using the scatter plot.
UM2220
MotionFX library
UM2220 - Rev 7
page 7/24

Other manuals for ST X-CUBE-MEMS1

Related product manuals