AnsweredAssumed Answered

setting of sensor

Question asked by juil kim on Jun 10, 2018
Latest reply on Jun 12, 2018 by Matteo Maravita

Hello. 

 

I read software manual(UM2329) and have a question.

 

In the page 14, there are several setting for accelerometer. 

But I don't understand why sensor should be set like this value.  

What's the impact for drone flight? Please explain line by line in detail. 

 

BSP_ACCELERO_Set_ODR_Value(LSM6DSL_X_0_handle, 1660.0); /* ODR 1.6kHz */
BSP_ACCELERO_Set_FS(LSM6DSL_X_0_handle, FS_MID); /* FS 4g */
LSM6DSL_ACC_GYRO_W_InComposit(LSM6DSL_X_0_handle,
LSM6DSL_ACC_GYRO_IN_ODR_DIV_2); /* ODR/2 low pass filtered sent to composite filte
r */
LSM6DSL_ACC_GYRO_W_LowPassFiltSel_XL(LSM6DSL_X_0_handle,
LSM6DSL_ACC_GYRO_LPF2_XL_ENABLE); /* Enable LPF2 filter in composite filter block
*/
LSM6DSL_ACC_GYRO_W_HPCF_XL(LSM6DSL_X_0_handle,
LSM6DSL_ACC_GYRO_HPCF_XL_DIV100); /* Low pass filter @ ODR/100 */
uint8_t tmp_6axis_reg_value;
BSP_ACCELERO_Read_Reg(LSM6DSL_X_0_handle, 0x10, &tmp_6axis_reg_value);
tmp_6axis_reg_value = tmp_6axis_reg_value & 0xFE /* Set LSB to 0 >> Analog filter
1500Hz*/
BSP_ACCELERO_Write_Reg(LSM6DSL_X_0_handle, 0x10, tmp_6axis_reg_value);

 

//----------------------

 

And, these code were changed like below in the 180223 version.

Why some values like ODR(1.6KHz -> 6.6KHz), HPCF_XL (DIV/100 -> DIV400) were changed? 

 

  /* Initialize settings for 6-axis MEMS Accelerometer */
  /* ODR 6.6kHz */
  /* FS 4g */
  /* Analog Filter Bandwith @ 1500Hz */
  /* ODR/2 low pass filtered sent to composite filter */
  /* Low pass filter enabled @ ODR/400 */
  //BSP_ACCELERO_Set_ODR_Value(LSM6DSL_X_0_handle, 1660.0);       /* ODR 1.6kHz */
  BSP_ACCELERO_Set_ODR_Value(LSM6DSL_X_0_handle, 6660.0);       /* ODR 6.6kHz */
  BSP_ACCELERO_Set_FS(LSM6DSL_X_0_handle, FS_MID);                   /* FS 4g */
  //LSM6DSL_ACC_GYRO_W_InComposit(LSM6DSL_X_0_handle, LSM6DSL_ACC_GYRO_IN_ODR_DIV_4);   /* ODR/4 low pass filtered sent to composite filter */
  LSM6DSL_ACC_GYRO_W_InComposit(LSM6DSL_X_0_handle, LSM6DSL_ACC_GYRO_IN_ODR_DIV_2);   /* ODR/2 low pass filtered sent to composite filter */
  LSM6DSL_ACC_GYRO_W_LowPassFiltSel_XL(LSM6DSL_X_0_handle, LSM6DSL_ACC_GYRO_LPF2_XL_ENABLE); /* Enable LPF2 filter in composite filter block */
  //LSM6DSL_ACC_GYRO_W_HPCF_XL(LSM6DSL_X_0_handle, LSM6DSL_ACC_GYRO_HPCF_XL_DIV4); /* Low pass filter @ ODR/50 */
  //LSM6DSL_ACC_GYRO_W_HPCF_XL(LSM6DSL_X_0_handle, LSM6DSL_ACC_GYRO_HPCF_XL_DIV100); /* Low pass filter @ ODR/100 */
  LSM6DSL_ACC_GYRO_W_HPCF_XL(LSM6DSL_X_0_handle, LSM6DSL_ACC_GYRO_HPCF_XL_DIV400); /* Low pass filter @ ODR/400 */
  uint8_t tmp_6axis_reg_value;
  BSP_ACCELERO_Read_Reg(LSM6DSL_X_0_handle, 0x10, &tmp_6axis_reg_value);
  //tmp_6axis_reg_value = tmp_6axis_reg_value | 0x01;                             /* Set LSB to 1 >> Analog filter 400Hz*/
  tmp_6axis_reg_value = tmp_6axis_reg_value & 0xFE;                             /* Set LSB to 0 >> Analog filter 1500Hz*/
  BSP_ACCELERO_Write_Reg(LSM6DSL_X_0_handle, 0x10, tmp_6axis_reg_value);

 

//------------------------

One more thing. 

In the STEVAL-FCU001V1 board schematic, 

I think SPI1, SPI2 is typo which I fixed with red color in the attachment. Is it right?

Attachments

Outcomes