Merge pull request #11038 from ctzsnooze/include-lpf1_static-in-simplified-tuning
This commit is contained in:
commit
c49f42939c
|
@ -67,6 +67,7 @@ static void calculateNewDTermFilterValues(pidProfile_t *pidProfile)
|
||||||
{
|
{
|
||||||
pidProfile->dterm_lpf1_dyn_min_hz = constrain(DTERM_LPF1_DYN_MIN_HZ_DEFAULT * pidProfile->simplified_dterm_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
pidProfile->dterm_lpf1_dyn_min_hz = constrain(DTERM_LPF1_DYN_MIN_HZ_DEFAULT * pidProfile->simplified_dterm_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
||||||
pidProfile->dterm_lpf1_dyn_max_hz = constrain(DTERM_LPF1_DYN_MAX_HZ_DEFAULT * pidProfile->simplified_dterm_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
pidProfile->dterm_lpf1_dyn_max_hz = constrain(DTERM_LPF1_DYN_MAX_HZ_DEFAULT * pidProfile->simplified_dterm_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
||||||
|
pidProfile->dterm_lpf1_static_hz = constrain(DTERM_LPF1_DYN_MIN_HZ_DEFAULT * pidProfile->simplified_dterm_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
||||||
pidProfile->dterm_lpf2_static_hz = constrain(DTERM_LPF2_HZ_DEFAULT * pidProfile->simplified_dterm_filter_multiplier / 100, 0, LPF_MAX_HZ);
|
pidProfile->dterm_lpf2_static_hz = constrain(DTERM_LPF2_HZ_DEFAULT * pidProfile->simplified_dterm_filter_multiplier / 100, 0, LPF_MAX_HZ);
|
||||||
pidProfile->dterm_lpf1_type = FILTER_PT1;
|
pidProfile->dterm_lpf1_type = FILTER_PT1;
|
||||||
pidProfile->dterm_lpf2_type = FILTER_PT1;
|
pidProfile->dterm_lpf2_type = FILTER_PT1;
|
||||||
|
@ -76,6 +77,7 @@ static void calculateNewGyroFilterValues()
|
||||||
{
|
{
|
||||||
gyroConfigMutable()->gyro_lpf1_dyn_min_hz = constrain(GYRO_LPF1_DYN_MIN_HZ_DEFAULT * gyroConfig()->simplified_gyro_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
gyroConfigMutable()->gyro_lpf1_dyn_min_hz = constrain(GYRO_LPF1_DYN_MIN_HZ_DEFAULT * gyroConfig()->simplified_gyro_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
||||||
gyroConfigMutable()->gyro_lpf1_dyn_max_hz = constrain(GYRO_LPF1_DYN_MAX_HZ_DEFAULT * gyroConfig()->simplified_gyro_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
gyroConfigMutable()->gyro_lpf1_dyn_max_hz = constrain(GYRO_LPF1_DYN_MAX_HZ_DEFAULT * gyroConfig()->simplified_gyro_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
||||||
|
gyroConfigMutable()->gyro_lpf1_static_hz = constrain(GYRO_LPF1_DYN_MIN_HZ_DEFAULT * gyroConfig()->simplified_gyro_filter_multiplier / 100, 0, DYN_LPF_MAX_HZ);
|
||||||
gyroConfigMutable()->gyro_lpf2_static_hz = constrain(GYRO_LPF2_HZ_DEFAULT * gyroConfig()->simplified_gyro_filter_multiplier / 100, 0, LPF_MAX_HZ);
|
gyroConfigMutable()->gyro_lpf2_static_hz = constrain(GYRO_LPF2_HZ_DEFAULT * gyroConfig()->simplified_gyro_filter_multiplier / 100, 0, LPF_MAX_HZ);
|
||||||
gyroConfigMutable()->gyro_lpf1_type = FILTER_PT1;
|
gyroConfigMutable()->gyro_lpf1_type = FILTER_PT1;
|
||||||
gyroConfigMutable()->gyro_lpf2_type = FILTER_PT1;
|
gyroConfigMutable()->gyro_lpf2_type = FILTER_PT1;
|
||||||
|
|
|
@ -173,10 +173,11 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
||||||
.abs_control_error_limit = 20,
|
.abs_control_error_limit = 20,
|
||||||
.abs_control_cutoff = 11,
|
.abs_control_cutoff = 11,
|
||||||
.antiGravityMode = ANTI_GRAVITY_SMOOTH,
|
.antiGravityMode = ANTI_GRAVITY_SMOOTH,
|
||||||
.dterm_lpf1_static_hz = 150, // NOTE: dynamic lpf is enabled by default so this setting is actually
|
.dterm_lpf1_static_hz = DTERM_LPF1_DYN_MIN_HZ_DEFAULT,
|
||||||
// overridden and the static lowpass 1 is disabled. We can't set this
|
// NOTE: dynamic lpf is enabled by default so this setting is actually
|
||||||
// value to 0 otherwise Configurator versions 10.4 and earlier will also
|
// overridden and the static lowpass 1 is disabled. We can't set this
|
||||||
// reset the lowpass filter type to PT1 overriding the desired BIQUAD setting.
|
// value to 0 otherwise Configurator versions 10.4 and earlier will also
|
||||||
|
// reset the lowpass filter type to PT1 overriding the desired BIQUAD setting.
|
||||||
.dterm_lpf2_static_hz = DTERM_LPF2_HZ_DEFAULT, // second Dterm LPF ON by default
|
.dterm_lpf2_static_hz = DTERM_LPF2_HZ_DEFAULT, // second Dterm LPF ON by default
|
||||||
.dterm_lpf1_type = FILTER_PT1,
|
.dterm_lpf1_type = FILTER_PT1,
|
||||||
.dterm_lpf2_type = FILTER_PT1,
|
.dterm_lpf2_type = FILTER_PT1,
|
||||||
|
@ -222,10 +223,12 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
||||||
.simplified_dterm_filter = true,
|
.simplified_dterm_filter = true,
|
||||||
.simplified_dterm_filter_multiplier = SIMPLIFIED_TUNING_DEFAULT,
|
.simplified_dterm_filter_multiplier = SIMPLIFIED_TUNING_DEFAULT,
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifndef USE_D_MIN
|
#ifndef USE_D_MIN
|
||||||
pidProfile->pid[PID_ROLL].D = 30;
|
pidProfile->pid[PID_ROLL].D = 30;
|
||||||
pidProfile->pid[PID_PITCH].D = 32;
|
pidProfile->pid[PID_PITCH].D = 32;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_SIMPLIFIED_TUNING
|
#ifdef USE_SIMPLIFIED_TUNING
|
||||||
applySimplifiedTuning(pidProfile);
|
applySimplifiedTuning(pidProfile);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -110,10 +110,11 @@ void pgResetFn_gyroConfig(gyroConfig_t *gyroConfig)
|
||||||
gyroConfig->gyroMovementCalibrationThreshold = 48;
|
gyroConfig->gyroMovementCalibrationThreshold = 48;
|
||||||
gyroConfig->gyro_hardware_lpf = GYRO_HARDWARE_LPF_NORMAL;
|
gyroConfig->gyro_hardware_lpf = GYRO_HARDWARE_LPF_NORMAL;
|
||||||
gyroConfig->gyro_lpf1_type = FILTER_PT1;
|
gyroConfig->gyro_lpf1_type = FILTER_PT1;
|
||||||
gyroConfig->gyro_lpf1_static_hz = 250; // NOTE: dynamic lpf is enabled by default so this setting is actually
|
gyroConfig->gyro_lpf1_static_hz = GYRO_LPF1_DYN_MIN_HZ_DEFAULT;
|
||||||
// overridden and the static lowpass 1 is disabled. We can't set this
|
// NOTE: dynamic lpf is enabled by default so this setting is actually
|
||||||
// value to 0 otherwise Configurator versions 10.4 and earlier will also
|
// overridden and the static lowpass 1 is disabled. We can't set this
|
||||||
// reset the lowpass filter type to PT1 overriding the desired BIQUAD setting.
|
// value to 0 otherwise Configurator versions 10.4 and earlier will also
|
||||||
|
// reset the lowpass filter type to PT1 overriding the desired BIQUAD setting.
|
||||||
gyroConfig->gyro_lpf2_type = FILTER_PT1;
|
gyroConfig->gyro_lpf2_type = FILTER_PT1;
|
||||||
gyroConfig->gyro_lpf2_static_hz = GYRO_LPF2_HZ_DEFAULT;
|
gyroConfig->gyro_lpf2_static_hz = GYRO_LPF2_HZ_DEFAULT;
|
||||||
gyroConfig->gyro_high_fsr = false;
|
gyroConfig->gyro_high_fsr = false;
|
||||||
|
|
Loading…
Reference in New Issue