Skip to main content
Visitor II
August 13, 2021
Solved

I am using LSM6DSL and getting values for gyroscope but values are changing very frequently while sensor is kept in rest

  • August 13, 2021
  • 1 reply
  • 1077 views

My register configuration are

(0x10, 0x60)

( 0x16,0x70)

(0x11, 0x60)

(0x12,0x40)

I am getting values like (0, 5, 7, 65534, 65535, 567) for the all the axis , while my sensor are in rest. 

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

    Hi, do 0, 5, 7, 65534, 65535, 567 values refer to (roll, pitch, yaw; roll, pitch, yaw)?

    If you convert them in two's complement, they should all be close to 0 (65534, 65535 are FFFE and FFFF), except the 567 that is a bit high, but since the ZRL ±3 dps and sensitivity is 4.375 mdps/LSB, 567 means 2.48dps, in line with the declared 3dps typ in the datasheet.

    You can find the conversion formula on Github drivers:

    float_t lsm6dsl_from_fs125dps_to_mdps(int16_t lsb)
    {
     return ((float_t)lsb * 4.375f);
    }

    https://www.st.com/resource/en/datasheet/lsm6dsl.pdf

    https://github.com/STMicroelectronics/lsm6dsl/blob/ce42c76176cdbc8f66491113c47ff961095840f3/lsm6dsl_reg.c

    Tom

    1 reply

    TBomb.1Answer
    Visitor II
    August 18, 2021

    Hi, do 0, 5, 7, 65534, 65535, 567 values refer to (roll, pitch, yaw; roll, pitch, yaw)?

    If you convert them in two's complement, they should all be close to 0 (65534, 65535 are FFFE and FFFF), except the 567 that is a bit high, but since the ZRL ±3 dps and sensitivity is 4.375 mdps/LSB, 567 means 2.48dps, in line with the declared 3dps typ in the datasheet.

    You can find the conversion formula on Github drivers:

    float_t lsm6dsl_from_fs125dps_to_mdps(int16_t lsb)
    {
     return ((float_t)lsb * 4.375f);
    }

    https://www.st.com/resource/en/datasheet/lsm6dsl.pdf

    https://github.com/STMicroelectronics/lsm6dsl/blob/ce42c76176cdbc8f66491113c47ff961095840f3/lsm6dsl_reg.c

    Tom