mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
user configurable sample rate, true peak detection
1. User can set sampling rate to suit expected range of frequencies: - HIGH suits 4" or smaller and 6S 5" - MEDIUM suits classic 5" 4S - LOW is for 6" or greater Limits automatically scaled: HIGH : 133/166 to 1000Hz, MEDIUM : 89/111 to 666Hz, LOW : 67/83 to 500Hz 2. Bandpass entirely eliminated, not needed. 3. True peak detection method, favouring first peak to exceed 80% of maximum bin height; ignore or threshold values not required.
This commit is contained in:
parent
3f001295f7
commit
14c90bf10b
5 changed files with 93 additions and 83 deletions
|
@ -63,6 +63,12 @@ enum {
|
|||
DYN_FFT_AFTER_STATIC_FILTERS
|
||||
} ;
|
||||
|
||||
enum {
|
||||
DYN_FILTER_RANGE_HIGH = 0,
|
||||
DYN_FILTER_RANGE_MEDIUM,
|
||||
DYN_FILTER_RANGE_LOW
|
||||
} ;
|
||||
|
||||
#define GYRO_CONFIG_USE_GYRO_1 0
|
||||
#define GYRO_CONFIG_USE_GYRO_2 1
|
||||
#define GYRO_CONFIG_USE_GYRO_BOTH 2
|
||||
|
@ -101,12 +107,11 @@ typedef struct gyroConfig_s {
|
|||
int16_t yaw_spin_threshold;
|
||||
|
||||
uint16_t gyroCalibrationDuration; // Gyro calibration duration in 1/100 second
|
||||
|
||||
uint8_t dyn_filter_type;
|
||||
uint8_t dyn_filter_width_percent;
|
||||
uint8_t dyn_notch_quality; // bandpass quality factor, 100 for steep sided bandpass
|
||||
uint8_t dyn_fft_location; // before or after static filters
|
||||
uint8_t dyn_filter_threshold; // divided by 10 then difference needed to detect peak
|
||||
uint8_t dyn_filter_ignore; // ignore any FFT bin below this threshold
|
||||
uint8_t dyn_filter_range; // ignore any FFT bin below this threshold
|
||||
} gyroConfig_t;
|
||||
|
||||
PG_DECLARE(gyroConfig_t, gyroConfig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue