cancel
Showing results for 
Search instead for 
Did you mean: 

Using STM32F446, ISM330DHCX and MotionFX, computed yaw angle is correct after a controlled 90-degree right rotation, but the yaw angle is off by ~3 degrees after each 90-degree left rotation. What could be causing this issue?

SLibe
Associate II

The MotionFX Library is initialized as follows:

MotionFX_getKnobs(&iKnobs);

/* Modify knobs settings */

// Configure knobs with non-default values

iKnobs.output_type = MFX_ENGINE_OUTPUT_ENU;

iKnobs.modx  = 1; // No decimation

iKnobs.ATime = 10; // kalman_settings.static_accel_time_coeff;

iKnobs.FrTime = 10; // kalman_settings.dynamic_accel_time_coeff;

iKnobs.LMode = 1; // Enable gyro bias calculation during static motion

iKnobs.gbias_gyro_th_sc_6X = 0.0036; // Per datasheet, this is empirically determined

  MotionFX_setKnobs(&iKnobs);

When new data arrives, it's processed like this:

MotionFX_propagate(&data_out, &imu, &delta_s);

MotionFX_update(&data_out, &imu, &delta_s, NULL);

Interstingly, if instead I first make the left-hand rotation, it has no significant error, but after making the right-hand rotation, a similar ~3 degree error is detected.

Each time motion occurs in the direction in which the error is present, the error increases, so the error is compounding over time.

It seems that whichever direction the first turn is in, error is not seen when turning in the direction, but turning in the opposite direction has continually-compounding error.

What could account for, immediately after intialization completes, a second rotation in the opposite direction having several degrees of error, but the first rotation in the opposite direction does not exhibit error?

12 REPLIES 12

Hello Scott,

thank you for your detailed explanation of the issue.

I'm glad you made some further progression.

The orientation for both LSM6DSM and ISM330DHCX should be the same...

It's indeed a general good practice to use the MotionAC and the MotionGC accelerometer and gyroscope calibration libraries together with the MotionFX one.

I'm not a broad expert of the MotionFX, so I'll forward this question internally and get back to you in case of positive feedback.

Please keep us updated in case of further progresses from your side.

-Eleon

HI @Eleon BORLINI​ 

We will begin work to use MotionGC, and MotionFX LMode=0 to achieve higher 6-axis yaw accuracy.

However (a) because the existing MotionFX gyro calibration is a "black box" to us, and (b) because we do not understand clearly why MotionFX LMode=1 is insufficient to achieve high yaw angle accuracy, we do not yet have confidence using MotionGC/LMode=0 will resolve the issue.

We have several products in educational robotics based upon STM32F4/ISM330DHCX/MotionFX, so it is important to be as efficient as possible.

Is it possible we can access the gyro calibration portion of the MotionFX library source code, to understand clearly how/why we should implement our custom gyro calibration and integrate it with MotionFX LMode=0?

Hi @SLi.9bert​ ,

I understand your problem.

Unfortunately, these library are not open source... you can however try asking to our Sales and Representatives from the st.com Contact link. They will evaluate your request accordingly.

-Eleon