cancel
Showing results for 
Search instead for 
Did you mean: 

LSM9DS1 low pass filters are not workring properly

HSafy.1
Associate II

Hello Everyone,

for the LSM9DS1 )DOF board. I am trying to use the associated low pass filters for the gyroscope and accelerometer and maybe I am doing a wrong confiugration and I want to be sure.

It is not clear for me how to do that specifically for the accelerometer. In page 45 of the Manual ( 7.12 CTRL_REG1_G) it is stated that the frequencies and cutoff frequencies are for LPF1 and LPF2 when both gyroscope and accelerometer are activated. However, the block diagram is only for the gyroscope or should I assume the same block diagram for the acclerometer ? ( Figure 28)

Again , is this only specific for the gyroscope or is it sufficient for both gyroscope and accelerometer ?

My main problem is that I assumed it is not enough and I also edited the accelerometer control registers and then I started getting faulty raw data. To be more specific , I edited CTRL_REG7_XL ( page 52) to operate in HR mode and the FDS to be 1 and this is when I get wrong values for the accelerometer

Also If I want to use LPF1 and LPF2 and ignore HPF , Am I supposed to edit CTRL_REG2_G (page 47) OUT_SEL[1-0] = 10 ?

Thank you,

Hesham

This discussion is locked. Please start a new topic to ask your question.
4 REPLIES 4
HSafy.1
Associate II

Any answer or help ?

Eleon BORLINI
ST Employee

Hi @HSafy.1​ , I believe you are well interpreting the datasheet. The filters configured in the CTRL_REG1_G register refer to the gyro only but are effective when both gyro and axl are enabled. On the other hand, the CTRL_REG7_XL regulates the axl LP filter (try also to not enable the FDS bit). Btw, please consider that the ODR acts as natural LP filter according th the Nyquist theorem.

I suggest you to check the standard C drivers on Github repository for LSM9DS1, especially the lsm9ds1_read_data_polling.c file. In particular, there is a section related to the filter configurations for both accelerometer and gyroscope.

 /* Configure filtering chain - See datasheet for filtering chain details */
  /* Accelerometer filtering chain */
  lsm9ds1_xl_filter_aalias_bandwidth_set(&dev_ctx_imu, LSM9DS1_AUTO);
  lsm9ds1_xl_filter_lp_bandwidth_set(&dev_ctx_imu, LSM9DS1_LP_ODR_DIV_50);
  lsm9ds1_xl_filter_out_path_set(&dev_ctx_imu, LSM9DS1_LP_OUT);
  /* Gyroscope filtering chain */
  lsm9ds1_gy_filter_lp_bandwidth_set(&dev_ctx_imu, LSM9DS1_LP_ULTRA_LIGHT);
  lsm9ds1_gy_filter_hp_bandwidth_set(&dev_ctx_imu, LSM9DS1_HP_MEDIUM);
  lsm9ds1_gy_filter_out_path_set(&dev_ctx_imu, LSM9DS1_LPF1_HPF_LPF2_OUT);

Regards

Hello @Eleon BORLINI​  Thanks for your answer !

Can you please be more illustrative with this sentence " please consider that the ODR acts as natural LP filter according to the Nyquist theorem" ? and if it acts as a natural LP filter, so for example , what would be the associated cutoff frequency for a sampling frequency of 952 Hz ? I am just trying to understand :)

Also why would you recommend me not to change the FDS bit ? what could happen if I activate the accelerometer filters ?

I will check the repositories as well. Thanks !

Best Regards,

Hesham

Hi Hesham, I mean that if you acquire data with an ODR 952Hz, you will be able to reconstruct a (sine) signal of maximum ODR/2, i.e. 476Hz (except from an aliasing effect). About the FDS bit, you should enable it to set the accelerometer LP filter, but I understood you are getting wrong values for the accelerometer, so you could try to disable it and check if the data are well. Regards

Announcement

We’re moving the ST Community to a new platform to give you a better and more reliable community experience.