Skip to content

Commit

Permalink
Revised LPF1+LPF2 filter cutoff bandwidths from STMicro (betaflight#1…
Browse files Browse the repository at this point in the history
…3239)

Revised LPF1+LPF2 filter cutoff bandwidths from STmicro
  • Loading branch information
SteveCEvans authored Dec 23, 2023
1 parent fc7afed commit a39ae3c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main/drivers/accgyro/accgyro_spi_lsm6dsv16x.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,11 @@
#define LSM6DSV_CTRL6_LPF1_G_BW_SHIFT 4

// Gyro LPF1 + LPF2 bandwidth selection when ODR=7.68kHz
#define LSM6DSV_CTRL6_FS_G_BW_281HZ 0
#define LSM6DSV_CTRL6_FS_G_BW_213HZ 1
#define LSM6DSV_CTRL6_FS_G_BW_156HZ 2
#define LSM6DSV_CTRL6_FS_G_BW_407HZ 3
// Note that these figures were advised by STmicro tech support and differ from the datasheet
#define LSM6DSV_CTRL6_FS_G_BW_288HZ 0
#define LSM6DSV_CTRL6_FS_G_BW_215HZ 1
#define LSM6DSV_CTRL6_FS_G_BW_157HZ 2
#define LSM6DSV_CTRL6_FS_G_BW_455HZ 3
#define LSM6DSV_CTRL6_FS_G_BW_102HZ 4
#define LSM6DSV_CTRL6_FS_G_BW_58HZ 5
#define LSM6DSV_CTRL6_FS_G_BW_28_8HZ 6
Expand Down Expand Up @@ -947,11 +948,11 @@ void lsm6dsv16xGyroInit(gyroDev_t *gyro)
const extDevice_t *dev = &gyro->dev;
// Set default LPF1 filter bandwidth to be as close as possible to MPU6000's 250Hz cutoff
uint8_t lsm6dsv16xLPF1BandwidthOptions[GYRO_HARDWARE_LPF_COUNT] = {
[GYRO_HARDWARE_LPF_NORMAL] = LSM6DSV_CTRL6_FS_G_BW_281HZ,
[GYRO_HARDWARE_LPF_OPTION_1] = LSM6DSV_CTRL6_FS_G_BW_156HZ,
[GYRO_HARDWARE_LPF_OPTION_2] = LSM6DSV_CTRL6_FS_G_BW_213HZ,
[GYRO_HARDWARE_LPF_NORMAL] = LSM6DSV_CTRL6_FS_G_BW_288HZ,
[GYRO_HARDWARE_LPF_OPTION_1] = LSM6DSV_CTRL6_FS_G_BW_157HZ,
[GYRO_HARDWARE_LPF_OPTION_2] = LSM6DSV_CTRL6_FS_G_BW_215HZ,
#ifdef USE_GYRO_DLPF_EXPERIMENTAL
[GYRO_HARDWARE_LPF_EXPERIMENTAL] = LSM6DSV_CTRL6_FS_G_BW_407HZ
[GYRO_HARDWARE_LPF_EXPERIMENTAL] = LSM6DSV_CTRL6_FS_G_BW_455HZ
#endif
};

Expand Down

0 comments on commit a39ae3c

Please sign in to comment.