AnsweredAssumed Answered

Wrong result from MotionFX

Question asked by Sandrine Broutin on Jun 21, 2018

Hello,

 

I'm trying to get run the MotionFX library using STM32L4 and SensiBLE board (which is equivalent to Nucleo-L476RG + X-Nucleo-IDB05A1 + X-Nucleo-IKS01A1 + X-Nucleo-CCA02M1).

The module for the accelerometer and gyroscope is the LSM6DS3 and LIS3MDL for the magnetometer.

 

I was trying to use 6X algorithm instead of 9X because the magnetometer values are disturbed.

The library run but the output values are very weird. The results are Euler angles.

 

When I move the board fast enough, the results are correct. But as soon as I move the board very slowly the measure of yaw is distorted. 

 

The input values are:

  • mag in uT/50
  • acc in g
  • gyro in dps

And seems to be correct.

 

Here is the configuration for the orientation settings:

#define GBIAS_ACC_TH_SC_6X (2.0f*0.000765f)

#define GBIAS_GYRO_TH_SC_6X (2.0f*0.002f)
#define GBIAS_MAG_TH_SC_6X (2.0f*0.001500f)
#define GBIAS_ACC_TH_SC_9X (2.0f*0.000765f)
#define GBIAS_GYRO_TH_SC_9X (2.0f*0.002f)
#define GBIAS_MAG_TH_SC_9X (2.0f*0.001500f)

void MotionFX_manager_init(void)

{
char LibVersion[36];

MotionFX_initialize();
MotionFX_GetLibVersion(LibVersion);


ipKnobs = &iKnobs;

MotionFX_getKnobs(ipKnobs);

ipKnobs->gbias_acc_th_sc_6X = GBIAS_ACC_TH_SC_6X;
ipKnobs->gbias_gyro_th_sc_6X = GBIAS_GYRO_TH_SC_6X;
ipKnobs->gbias_mag_th_sc_6X = GBIAS_MAG_TH_SC_6X;

ipKnobs->gbias_acc_th_sc_9X = GBIAS_ACC_TH_SC_9X;
ipKnobs->gbias_gyro_th_sc_9X = GBIAS_GYRO_TH_SC_9X;
ipKnobs->gbias_mag_th_sc_9X = GBIAS_MAG_TH_SC_9X;

#ifdef STM32_NUCLEO
#ifdef IKS01A1
if(TargetBoardFeatures.HWAdvanceFeatures) {
#endif /* IKS01A1 */
/* LSM6DS3/LSM6DSL */
ipKnobs->acc_orientation[0] ='n';
ipKnobs->acc_orientation[1] ='w';
ipKnobs->acc_orientation[2] ='u';

ipKnobs->gyro_orientation[0] = 'n';
ipKnobs->gyro_orientation[1] = 'w';
ipKnobs->gyro_orientation[2] = 'u';
#ifdef IKS01A1
}
#endif /* IKS01A1 */
#ifdef IKS01A1
ipKnobs->mag_orientation[0] = 's';
ipKnobs->mag_orientation[1] = 'e';
ipKnobs->mag_orientation[2] = 'u';
#endif /* IKS01A1 */

#endif /* STM32_NUCLEO */

 

ipKnobs->output_type = MFX_ENGINE_OUTPUT_ENU;
ipKnobs->LMode = 1;
ipKnobs->modx = 1;

MotionFX_setKnobs(ipKnobs);

MotionFX_enable_6X(MFX_ENGINE_DISABLE);
MotionFX_enable_9X(MFX_ENGINE_DISABLE);

}

Can anybody explain me what is wrong?

 

Kind regards,

Sandrine

Outcomes