cancel
Showing results for 
Search instead for 
Did you mean: 

Abnormal posture of nine-axis fusion using motionfx library

1258685418
Visitor

The sensor IMU is LSM6DSL model, the magnetometer is LIS3MDL model, and the motionfx library is used for attitude calculation, and the heading angle is inaccurate.
I checked the value of the geomagnetometer and it is normal, but the heading angle is abnormal: for example, the sensor points to due north, the X axis of the geomagnetometer is 40uT, the Y axis is 0uT, but the heading angle is 300 degrees. After slightly vibrating the sensor to change the values ​​of the accelerometer and the gyroscope, the heading angle stabilizes to 270 degrees. I don’t understand why the magnetic field input is normal but the heading angle output is abnormal?
After consulting the information, I learned that after changing the inclination angle, the fusion algorithm will dynamically adjust the projection of the gravity vector through the accelerometer and gyroscope, forcing the geomagnetic data to re-participate in the calculation, covering the wrong horizontal compensation, and correcting the heading angle. Is this a bug in the motionfx library or is there something wrong with my configuration?
The configuration is as follows: ATime, MTime and FrTime of MFX_knobs_t are the default values, LMode=1, modx=1, output_type=0 and 1 have been tried and the problem is the same. I have tried different configurations for acc_orientation, gyro_orientation, and mag_orientation, but the problem still exists! The magnetometer and IMU have been calibrated.
At the same time, since the sensor data sheet does not clearly state the position of the XYZ positive pole, I don’t know whether the orientation configuration is correct. Can you help me confirm the polarity of the sensor chip? Or tell me how to test it.
Thank you very much!

0 REPLIES 0