ST X-CUBE-MEMS1 User Manual Download Page 17

Step 4.

Click on the 

Fusion 

icon in the vertical toolbar to open the dedicated application window.

To switch between 9-axes and 6-axes sensor fusion click on the appropriate button.
To align the tea pot position point the Nucleo board towards the screen and press 

Reset

 model button.

Figure 7. 

Fusion window

UM2220

Sample application

UM2220

 - 

Rev 7

page 17/24

Summary of Contents for X-CUBE-MEMS1

Page 1: ...M Cortex M0 ARM Cortex M3 ARM Cortex M4 or ARM Cortex M7 architectures It is built on top of STM32Cube software technology to ease portability across different STM32 microcontrollers The software come...

Page 2: ...ronyms Acronym Description API Application programming interface BSP Board support package GUI Graphical user interface HAL Hardware abstraction layer IDE Integrated development environment UM2220 Acr...

Page 3: ...fusion accelerometer gyroscope magnetometer real time 6 axis motion sensor data fusion accelerometer gyroscope computation of rotation quaternions gravity and linear acceleration data gyroscope bias...

Page 4: ...ation experiences low magnetic interference 50 T most of time it is recommended to increase the value LMode represents the gyroscope bias learning mode the library automatically tracks and calibrates...

Page 5: ...The MotionFX_propagate and the MotionFX_update MotionFX_CM0P_update functions provide the sensor fusion output in the MFX_output_t MFX_CM0P_output_t structure rotation_6 9X represents the system orie...

Page 6: ...eter hard iron calibration The magnetometer is affected by the hard iron and soft iron phenomena described below Hard iron distortion Hard iron distortion is normally generated by ferromagnetic materi...

Page 7: ...eturns 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 MA...

Page 8: ...MFX_engine_state_t MotionFX_getStatus_9X void gets the 9 axes library status returns 1 if enabled 0 if disabled void MotionFX_enable_6X MFX_engine_state_t enable enables or disables the 6 axes functio...

Page 9: ...re type MFX_MagCal_output_t are hi_bias is the hard iron offset array T 50 cal_quality is the calibration quality factor MFX_MAGCALUNKNOWN 0 accuracy of the calibration parameters is unknown MFX_MAGCA...

Page 10: ...Status_euler void gets the status of euler angles calculation returns 1 if enabled 0 if disabled MFX_CM0P_engine_state_t MotionFX_CM0P__getStatus_gbias void gets the status of gyroscope calibration re...

Page 11: ...alibration algorithm data_in parameter is a pointer to input data structure the parameters for the structure type MFX_MagCal_CM0P_input_t are mag is uncalibrated magnetometer data T 50 void MotionFX_C...

Page 12: ...Outputs Data Read Interrupt Initialize MagCal_Init getKnobs setKnobs Propagate MagCal_run MagCal_getParams 2 2 9 Demo code The following demonstration code reads data from the accelerometer gyroscope...

Page 13: ...onFX_enable_9X MFX_ENGINE_ENABLE Using Sensor Fusion algorithm Timer_OR_DataRate_Interrupt_Handler MFX_input_t data_in MFX_output_t data_out float dT float q Quaternion pointer to either to Game Rotat...

Page 14: ...ed time s algorithm Cortex M0 STM32L073RZ at 32 MHz Cortex M7 STM32F767ZI at 96 MHz STM32CubeIDE 1 2 0 IAR EWARM 8 32 3 Keil Vision 5 27 STM32CubeIDE 1 2 0 IAR EWARM 8 32 3 Keil Vision 5 27 Min Avg Ma...

Page 15: ...LEO L476RG NUCLEO L152RE To calibrate the magnetometer perform the figure 8 calibration movement Note You can calibrate the magnetometer only when the sensor fusion is activated When user button B1 is...

Page 16: ...it is automatically detected and the appropriate COM port is opened Figure 5 Unicleo main window Step 3 Start and stop data streaming by using the appropriate buttons on the vertical tool bar The data...

Page 17: ...d application window To switch between 9 axes and 6 axes sensor fusion click on the appropriate button To align the tea pot position point the Nucleo board towards the screen and press Reset model but...

Page 18: ...tep 5 Click on the Scatter Plot icon to check the magnetometer calibration quality Figure 8 Magnetometer scatter plot properly calibrated magnetometer UM2220 Sample application UM2220 Rev 7 page 18 24...

Page 19: ...ding button Figure 9 Datalog window 2 4 References All of the following resources are freely available on www st com 1 UM1859 Getting started with the X CUBE MEMS1 motion MEMS and environmental sensor...

Page 20: ...and ARM Cortex M0 01 Oct 2018 5 Removed references to X NUCLEO IKS01A1 throughout document Updated Section 2 2 4 MotionFX library parameters Table 2 Cortex M4 and Cortex M3 elapsed time s algorithm Fi...

Page 21: ...d 9 axis sensor fusion modes 3 2 2 3 MotionFX library operation 4 2 2 4 MotionFX library parameters 4 2 2 5 MotionFX library output data rate 6 2 2 6 Sensor calibration in the MotionFX library 6 2 2 7...

Page 22: ...List of acronyms 2 Table 2 Cortex M4 and Cortex M3 elapsed time s algorithm 14 Table 3 Cortex M0 and Cortex M7 elapsed time s algorithm 14 Table 4 Document revision history 20 UM2220 List of tables U...

Page 23: ...Figure 3 MotionFX API logic sequence 12 Figure 4 STM32 Nucleo LEDs button jumper 15 Figure 5 Unicleo main window 16 Figure 6 User Messages tab 16 Figure 7 Fusion window 17 Figure 8 Magnetometer scatte...

Page 24: ...ts and ST assumes no liability for application assistance or the design of Purchasers products No license express or implied to any intellectual property right is granted by ST herein Resale of ST pro...

Reviews: