2021-07-25 02:23 PM
Hello,
I'm using nucleoF446RE with X-NUCLEO-IKS01A2.
I read data from sensor (LSM6DSL and LSM303AGR) and with MotionFX library I get rotations, but there are some problems.
At beginning, if I don't rotate the board, the z-axis rotation is different from 0;
If I rotate the board along y-axis, I read correct value;
If I rotate along x-axis, I read correct rotation for x-axis, but there is also a rotation along y-axis and z-axis. (I use USART protocol to send and read data)
Also, I can't do the magnetometer calibration.
Can sameone help me?
Thank you.
2021-07-27 12:17 AM
I seems like wrong sensor orientation settings.
I propose to use STM32CubeMX and X-CUBE-MEMS1 package. You can generate example application for MotionFX for NUCLEO-F446RE and X-CUBE-NUCLEO-IKS01A2 in the STM32CubeMX. This application should work properly also with magnetometer calibration.
You can also directly check DatalogFusion application inside X-CUBE-MEMS1 package.
2021-08-01 01:58 PM
I tried to use DataLog application inside X-CUBE-MEMS1 and, using the gui, I see same thing: If I rotate the system along x axis I read rotation also on y axis (about -180), even after the magnetometer calibration.
Moreover, I don’t know why in MotionFX datasheet it is written that the rotation along y axis is between -90 and 90 degrees.
Can you help me?
Thank you
2021-08-02 02:55 AM
I tried to replicate your issue on Nucleo-F401RE and IKS01A2 and don't see your issue. It always rotates in correct axis only. Please send me your project and datalog. You can store the datalog in Unicleo-GUI application for example.
2021-08-04 05:26 AM
2021-08-04 05:27 AM
2021-08-04 07:48 AM
Hello,
I have analyzed your datalog and I see the magnetometer did not reach the calibrated state.
You can check the scatter plot. The points should draw circle with center in [0,0], after calibration you will jump to the calibrated values.
From your datalog I see you didn't cover second half of the sphere (circle) with the movement.
This is example of well calibrated magnetometer.
You can try the magnetometer calibration process using MagnetometerCalibration application in X-CUBE-MEMS1.
2021-08-06 12:20 AM
2021-08-09 02:12 AM
I have a few comments:
The angle ranges are following:
You can use MotionMC to calibrate magnetometer instead of functions MotionFX_MagCal... which are part of the MotionFX library. Basically you need to pass the data to MotionMC library and then use calibrated magnetometer data in sensor fusion (MotionFX).