Skip to main content
Visitor II
November 11, 2020
Solved

I am using the LSM6DSOX for tilt detection. is there a way to limit tilt detection to one axis?

  • November 11, 2020
  • 1 reply
  • 1047 views

I am using the LSM6DSOX built in tilt function. Currently it gives results for tilting along 3 axis. Is there a way to limit it to one axis?

    This topic has been closed for replies.
    Best answer by Eleon BORLINI

    Hi @JRick.1​ ,

    you are right, the tilt embedded function considers the 3-axis vector as a whole (lsm6dsox_tilt.c).

    But if -for example- you mount the device such that the tilt is only along 1 axis every time, there should be no problems... Please not that the tilt is a quasi-static measure, and that is in general important to know along which axis the tilt take places, for an accurate measure.

    By the way, if you are not in the condition of predetermining the axis, you could use other embedded feature that are axis-sensitive to measure the tilt. For example, you could:

    • Use another embedded function, such as the 6D or the wake-up feature. For a description, you can check the application note AN5272, p. 43. For a reference code, you can check the C code here --> lsm6dsox_orientation.c.
    • Use the Finite State Machine function, which allows you to enable a threshold axis by axis. For a description, you can check the application note AN5273. For a reference code, you can check the C code here --> lsm6dsox_fsm.c.

    -Eleon

    1 reply

    ST Employee
    November 11, 2020

    Hi @JRick.1​ ,

    you are right, the tilt embedded function considers the 3-axis vector as a whole (lsm6dsox_tilt.c).

    But if -for example- you mount the device such that the tilt is only along 1 axis every time, there should be no problems... Please not that the tilt is a quasi-static measure, and that is in general important to know along which axis the tilt take places, for an accurate measure.

    By the way, if you are not in the condition of predetermining the axis, you could use other embedded feature that are axis-sensitive to measure the tilt. For example, you could:

    • Use another embedded function, such as the 6D or the wake-up feature. For a description, you can check the application note AN5272, p. 43. For a reference code, you can check the C code here --> lsm6dsox_orientation.c.
    • Use the Finite State Machine function, which allows you to enable a threshold axis by axis. For a description, you can check the application note AN5273. For a reference code, you can check the C code here --> lsm6dsox_fsm.c.

    -Eleon

    JRick.1Author
    Visitor II
    November 20, 2020

    Thanks Eleon:

    I tried your suggestion of using the 6D function and this works well.

    Best Regards,

    Jrick.1