Skip to main content
Fjarr.1735
Associate
October 14, 2019
Question

Hi I'm working with LIS3DSH accelerator. I'd like to ask if there is method to cancel or delete gravitational acceleration (g). in other words if there is register to cancel "g". Regards

  • October 14, 2019
  • 2 replies
  • 1196 views

..

This topic has been closed for replies.

2 replies

Ozone
Principal
October 14, 2019

No. You need to subtract it out yourself.

And I don't know any other accelerometer sensor doing it for you.

Eleon BORLINI
ST Employee
October 15, 2019

Hi @Fjarr.1735​ , the simplest and most logical way is the one suggested @Ozone​ .

In general, ST sensors allows you to "remove" the DC component (including the "g" gravity contribute, but not only it!) so that you can apply an embedded high-pass filter along the sensor acquisition chain. Sometimes in an easy way, but in the LIS3DSH case it is not so straightforward: you have to set a vector filter as describes in AN3393 p.41:

"The vector filter is a 7th-order anti-symmetric FIR filter The four coefficients can be chosen by using registers 1Bh, 1Ch, 1Dh and 1Eh (vector filter coefficient registers). In this way, different filter configurations can be implemented. For example, a band-pass filter can be obtained by choosing the coefficients: 53, 127, 127, 53. To enable the vector filter, the VFILT bit in the CTRL_REG3 register (23h) must be set to “1�?. "

Fjarr.1735
Associate
October 15, 2019

Hi Eleon BORLINI

Thank you for your interaction. Basically my problem is the existence of gravity "g" when detecting threshold. I want to consider "0 g" in all axes when device is at rest, but this is not the real case, for example when sensor is in horizontal position we have "0" in x and y axes but "1g" in z axes caused by the existence of gravity which have effect on threshold detection. like that any threshold less then 1g is reached even when the sensor is at rest.

I have another question : we can configure the threshold for each axes separated or one threshold is applied for all axes ??

do you think the filter can resolve this issue ?

Best regards

Eleon BORLINI
ST Employee
October 21, 2019

Hi @Fjarr.1735​ , ok, so you can effectively set the vector filter as an high pass filter to remove the DC component of the acceleration, included the gravity component, and getting more or less "0" on the 3 axis.

>> we can configure the threshold for each axes separated or one threshold is applied for all axes ??

You can set maximum 2 thresholds via the embedded Finite state machine. You have to set the threshold THRS1_1 (57h) and THRS2_1 (56h), and set the Axis mask filter described at p.67 of AN3393 to select the axis that will raise the interrupt flag. This way you can for example select x+ axis in MASKA and the THRS1_1 threshold and an interrupt will be raised when the signal will exceed the threshold 1 along positive x-axis. If you want to involve the other axis with different thresholds you could use the FSM2 (in cascade of FSM1) Regards