Skip to main content
Explorer
March 19, 2025
Solved

lsm6dsv and quaternions and direction of a cube/dice

  • March 19, 2025
  • 2 replies
  • 560 views

Hi 

based on the quaternion/Sensor fusion of LSM6DSV example I developed an application where I display the direction of a cube. Everything works fine, no drift, but: when I take the device move and turn it around, then put it back in the same exact position, the drawing on the PC is not back to the same direction as when I started.

What is going wrong?

Thx

    This topic has been closed for replies.
    Best answer by MK..1

    Hi

    actually I played around with the different parameters and solved it. I didn't need the magnetometer.

    The parameter  I changed was "sm6dsv_gy_full_scale_set(&dev_ctx, LSM6DSV_2000dps);"

    I set it to a lower value.

    2 replies

    Explorer
    April 24, 2025

    It is most likely due to derivation from the imprecision of the gyroscope. This problem can supposedly be solved by adding a magnetometer but so far I haven't been able to get the magnetic data from my sensor hub so I can't guarantee it will work.

    MK..1AuthorAnswer
    Explorer
    April 24, 2025

    Hi

    actually I played around with the different parameters and solved it. I didn't need the magnetometer.

    The parameter  I changed was "sm6dsv_gy_full_scale_set(&dev_ctx, LSM6DSV_2000dps);"

    I set it to a lower value.

    Explorer
    April 24, 2025

    that makes sense less precision means less error derivation

    how did you manage to set the lsm6dsv to give you quaternion information by the way?