mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Second dterm pt1 (#5458)
* Second PT1 on DTerm This PR replaces the default biquad filter with a second PT1 set to 200Hz. Basically allows the user to enable a second, set point configurable, PT1 type first order low-pass filter on DTerm. This is useful because most noise in most logs arises from D, not P. The default is set to on, at twice the normal Dterm setpoint. This provides greater Dterm cut than a single PT1, and twice the steepness of cut above the second setpoint. Modelling shows significant reductions in higher frequency Dterm noise with only minor additional delay. The improvement in noise performance will be less than for biquad, but the delay is considerably less. If with the default settings the overall noise improves a lot, it may be possible bring D both filtering set points to higher numbers (e.g. 140/280), or alternatively remove other filters such as the notch filters, while maintaining an adequate level of control over noise. * Update names, old defaults, fix whitespace Defaults restored to biquad with second PT1 off. ‘lpf’ retained as abbreviation for values, otherwise generally remove ‘Filter’ where redundant, replace ‘FilterLpf’ with ‘Lowpass’, etc, thanks Fujin and DieHertz * Remove underscore in lowpass_2, add hz to setpoint for lowpass Thanks DieHertz * completed replacing lpf with lowpass, added _hz to all lowpass set points in profile Thanks DieHertz * fix whitespace fixed whitespace in settings.c * whitespace attempt #57 * change lpf to lowpass where appropriate elsewhere Note did not change OSD abbreviations, they are still LPF, and did not change gyro_lpf anywhere. * second attempt at a simple PT1 implementation Basically copied from the DtermNotch implementation * Second PT1 on DTerm This PR replaces the default biquad filter with a second PT1 set to 200Hz. Basically allows the user to enable a second, set point configurable, PT1 type first order low-pass filter on DTerm. This is useful because most noise in most logs arises from D, not P. The default is set to on, at twice the normal Dterm setpoint. This provides greater Dterm cut than a single PT1, and twice the steepness of cut above the second setpoint. Modelling shows significant reductions in higher frequency Dterm noise with only minor additional delay. The improvement in noise performance will be less than for biquad, but the delay is considerably less. If with the default settings the overall noise improves a lot, it may be possible bring D both filtering set points to higher numbers (e.g. 140/280), or alternatively remove other filters such as the notch filters, while maintaining an adequate level of control over noise. * Rebase * Remove underscore in lowpass_2, add hz to setpoint for lowpass Thanks DieHertz * completed replacing lpf with lowpass, added _hz to all lowpass set points in profile Thanks DieHertz * fix whitespace fixed whitespace in settings.c * whitespace attempt #57 * change lpf to lowpass where appropriate elsewhere Note did not change OSD abbreviations, they are still LPF, and did not change gyro_lpf anywhere. * second attempt at a simple PT1 implementation Basically copied from the DtermNotch implementation * Whitespace fix - thanks, Ledvinap * Fix PG issue by moving added dterm_lowpass2_hz to bottom of struct * Got rid of redundant indirection * Fixed indentantion shifts
This commit is contained in:
parent
d2bc4e5af5
commit
ab231b7c84
6 changed files with 70 additions and 62 deletions
|
@ -73,8 +73,8 @@ typedef struct pid8_s {
|
|||
typedef struct pidProfile_s {
|
||||
pid8_t pid[PID_ITEM_COUNT];
|
||||
|
||||
uint16_t yaw_lpf_hz; // Additional yaw filter when yaw axis too noisy
|
||||
uint16_t dterm_lpf_hz; // Delta Filter in hz
|
||||
uint16_t yaw_lowpass_hz; // Additional yaw filter when yaw axis too noisy
|
||||
uint16_t dterm_lowpass_hz; // Delta Filter in hz
|
||||
uint16_t dterm_notch_hz; // Biquad dterm notch hz
|
||||
uint16_t dterm_notch_cutoff; // Biquad dterm notch low cutoff
|
||||
uint8_t dterm_filter_type; // Filter selection for dterm
|
||||
|
@ -105,6 +105,7 @@ typedef struct pidProfile_s {
|
|||
pidCrashRecovery_e crash_recovery; // off, on, on and beeps when it is in crash recovery mode
|
||||
uint16_t crash_limit_yaw; // limits yaw errorRate, so crashes don't cause huge throttle increase
|
||||
uint16_t itermLimit;
|
||||
uint16_t dterm_lowpass2_hz; // Extra PT1 Filter on D in hz
|
||||
} pidProfile_t;
|
||||
|
||||
#ifndef USE_OSD_SLAVE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue