cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong result from MotionFX

Sandrine Broutin
Associate
Posted on June 21, 2018 at 14:18

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:

&sharpdefine GBIAS_ACC_TH_SC_6X (2.0f*0.000765f)

&sharpdefine GBIAS_GYRO_TH_SC_6X (2.0f*0.002f)

&sharpdefine GBIAS_MAG_TH_SC_6X (2.0f*0.001500f)

&sharpdefine GBIAS_ACC_TH_SC_9X (2.0f*0.000765f)

&sharpdefine GBIAS_GYRO_TH_SC_9X (2.0f*0.002f)

&sharpdefine 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;

&sharpifdef STM32_NUCLEO

&sharpifdef IKS01A1

if(TargetBoardFeatures.HWAdvanceFeatures) {

&sharpendif /* 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';

&sharpifdef IKS01A1

}

&sharpendif /* IKS01A1 */

&sharpifdef IKS01A1

ipKnobs->mag_orientation[0] = 's';

ipKnobs->mag_orientation[1] = 'e';

ipKnobs->mag_orientation[2] = 'u';

&sharpendif /* IKS01A1 */

&sharpendif /* 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

#motionfx #lsm6ds3
0 REPLIES 0