Skip to main content
Visitor II
October 23, 2020
Solved

Linear acceleration motionfx slope problem?

  • October 23, 2020
  • 2 replies
  • 1965 views

Hello I am using Lsm6dsox(acc and gyro) and lsm303ah(mag) and sending data to motionfx to calculate the linear acceleration.

My sensors are working in mode2 sync with drdy at 104HZ. So I'm reading every 10ms the data from the sensors and sending it to motionfx to calculate the linear acceleration. I ve set the motionfx setting as described in example, and calibrated the magnetometer.

My problem is the following:

So I shake the board and rotate and the data seems good, but when I put it on table while shaking to rest in a stationary state,it has a slope it takes to long to convergate to zero(about 2s).

How can I achieve to go instantly to zero when in statinary state?

    This topic has been closed for replies.
    Best answer by suads

    Hi @Eleon BORLINI​ actually playing with the Atime and Mtime solved my issue! LMode is set to 2, but know I'm having problem with the quaternions.

    If I hold the device steady in the hand and move in one direction, I expect that the quaternion values are more or less static during the walk but the values vary a lot.

    Edit: I have printed now motiofx data heading_9X so if I rotate it on the table fast seems to be good. But when I take the device in my hand and walk from A to B in one direction data seems good, than i rotate, and stand still for 5s and go back from B to A the data seems also good. But if I rotate faster about 1 second and go back from B to A data is bad. It is like the magnetometer needs some time when I walk and rotate. How can I fix this?

    2 replies

    ST Employee
    October 23, 2020

    Hi @suads​ ,

    do you see these slow data value variations before the motionFX algorithm (I mean, if you acquires the LSM6DSOX acceleration stand alone), or just after the sensor fusion computation? In the first case, for the LSM6DSOX you could enable the High Pass filter HPCF_XL_[2:0] in the CTRL8_XL (17h) and the HP_SLOPE_XL_EN bit of the same register for configuring the Accelerometer slope filter / high-pass filter. See datasheet, p. 63.

    -Eleon

    suadsAuthor
    Visitor II
    October 23, 2020

    Hi @Eleon BORLINI​  I'm using it after motionfx algorithm, I set the MTime to 6 and Atime to 0.5 also I Have calibrated the gbias_acc/gyro/mag_th_sc it is better, but still Is there anyting I can do more to correct this issue?

    Thank you!

    ST Employee
    October 26, 2020

    Hi @suads​ ,

    How did you configured the "LMode" parameter that represents the gyroscope bias learning mode? This should automatically track and calibrate gyro zero-rate bias drift.

    -Eleon

    suadsAuthorAnswer
    Visitor II
    October 27, 2020

    Hi @Eleon BORLINI​ actually playing with the Atime and Mtime solved my issue! LMode is set to 2, but know I'm having problem with the quaternions.

    If I hold the device steady in the hand and move in one direction, I expect that the quaternion values are more or less static during the walk but the values vary a lot.

    Edit: I have printed now motiofx data heading_9X so if I rotate it on the table fast seems to be good. But when I take the device in my hand and walk from A to B in one direction data seems good, than i rotate, and stand still for 5s and go back from B to A the data seems also good. But if I rotate faster about 1 second and go back from B to A data is bad. It is like the magnetometer needs some time when I walk and rotate. How can I fix this?