cancel
Showing results for 
Search instead for 
Did you mean: 

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

JRick.1
Associate

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

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

View solution in original post

2 REPLIES 2
Eleon BORLINI
ST Employee

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

Thanks Eleon:

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

Best Regards,

Jrick.1