diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index d83ee33a7e..dd0a3a181b 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1072,10 +1072,10 @@ const clivalue_t valueTable[] = { { "dterm_lpf1_dyn_expo", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 10 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf1_dyn_expo) }, #endif { PARAM_NAME_DTERM_LPF1_TYPE, VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_DTERM_LPF_TYPE }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf1_type) }, - { "dterm_lpf1_biquad_q", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 10 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf1_biquad_q) }, + { "dterm_lpf1_biquad_q", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf1_biquad_q) }, { PARAM_NAME_DTERM_LPF1_STATIC_HZ, VAR_INT16 | PROFILE_VALUE, .config.minmax = { 0, LPF_MAX_HZ }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf1_static_hz) }, { PARAM_NAME_DTERM_LPF2_TYPE, VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_DTERM_LPF_TYPE }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf2_type) }, - { "dterm_lpf2_biquad_q", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, 10 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf2_biquad_q) }, + { "dterm_lpf2_biquad_q", VAR_UINT8 | PROFILE_VALUE, .config.minmaxUnsigned = { 1, 100 }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf2_biquad_q) }, { PARAM_NAME_DTERM_LPF2_STATIC_HZ, VAR_INT16 | PROFILE_VALUE, .config.minmax = { 0, LPF_MAX_HZ }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_lpf2_static_hz) }, { PARAM_NAME_DTERM_NOTCH_HZ, VAR_UINT16 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, LPF_MAX_HZ }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_notch_hz) }, { PARAM_NAME_DTERM_NOTCH_CUTOFF, VAR_UINT16 | PROFILE_VALUE, .config.minmaxUnsigned = { 0, LPF_MAX_HZ }, PG_PID_PROFILE, offsetof(pidProfile_t, dterm_notch_cutoff) }, @@ -1702,7 +1702,6 @@ const clivalue_t valueTable[] = { #ifdef USE_RPM_FILTER { PARAM_NAME_RPM_FILTER_HARMONICS, VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 3 }, PG_RPM_FILTER_CONFIG, offsetof(rpmFilterConfig_t, rpm_filter_harmonics) }, { PARAM_NAME_RPM_FILTER_Q, VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 250, 3000 }, PG_RPM_FILTER_CONFIG, offsetof(rpmFilterConfig_t, rpm_filter_q) }, - { PARAM_NAME_RPM_FILTER_Q, VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 1, 255 }, PG_RPM_FILTER_CONFIG, offsetof(rpmFilterConfig_t, noise_limit) }, { PARAM_NAME_RPM_FILTER_MIN_HZ, VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 30, 200 }, PG_RPM_FILTER_CONFIG, offsetof(rpmFilterConfig_t, rpm_filter_min_hz) }, { PARAM_NAME_RPM_FILTER_FADE_RANGE_HZ, VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 1000 }, PG_RPM_FILTER_CONFIG, offsetof(rpmFilterConfig_t, rpm_filter_fade_range_hz) }, { PARAM_NAME_RPM_FILTER_LPF_HZ, VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 100, 500 }, PG_RPM_FILTER_CONFIG, offsetof(rpmFilterConfig_t, rpm_filter_lpf_hz) }, diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index ebd02c8327..3a00ba9463 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -862,7 +862,9 @@ static CMS_Menu cmsx_menuDynFilt = { #endif static uint16_t cmsx_dterm_lpf1_static_hz; +static uint8_t cmsx_dterm_lpf1_q; static uint16_t cmsx_dterm_lpf2_static_hz; +static uint8_t cmsx_dterm_lpf2_q; static uint16_t cmsx_dterm_notch_hz; static uint16_t cmsx_dterm_notch_cutoff; static uint16_t cmsx_yaw_lowpass_hz; @@ -874,7 +876,9 @@ static const void *cmsx_FilterPerProfileRead(displayPort_t *pDisp) const pidProfile_t *pidProfile = pidProfiles(pidProfileIndex); cmsx_dterm_lpf1_static_hz = pidProfile->dterm_lpf1_static_hz; + cmsx_dterm_lpf1_q = pidProfile->dterm_lpf1_biquad_q; cmsx_dterm_lpf2_static_hz = pidProfile->dterm_lpf2_static_hz; + cmsx_dterm_lpf2_q = pidProfile->dterm_lpf2_biquad_q; cmsx_dterm_notch_hz = pidProfile->dterm_notch_hz; cmsx_dterm_notch_cutoff = pidProfile->dterm_notch_cutoff; cmsx_yaw_lowpass_hz = pidProfile->yaw_lowpass_hz; @@ -890,7 +894,9 @@ static const void *cmsx_FilterPerProfileWriteback(displayPort_t *pDisp, const OS pidProfile_t *pidProfile = currentPidProfile; pidProfile->dterm_lpf1_static_hz = cmsx_dterm_lpf1_static_hz; + pidProfile->dterm_lpf1_biquad_q = cmsx_dterm_lpf1_q; pidProfile->dterm_lpf2_static_hz = cmsx_dterm_lpf2_static_hz; + pidProfile->dterm_lpf2_biquad_q = cmsx_dterm_lpf2_q; pidProfile->dterm_notch_hz = cmsx_dterm_notch_hz; pidProfile->dterm_notch_cutoff = cmsx_dterm_notch_cutoff; pidProfile->yaw_lowpass_hz = cmsx_yaw_lowpass_hz; @@ -903,7 +909,9 @@ static const OSD_Entry cmsx_menuFilterPerProfileEntries[] = { "-- FILTER PP --", OME_Label, NULL, NULL }, { "DTERM LPF1", OME_UINT16 | SLIDER_DTERM, NULL, &(OSD_UINT16_t){ &cmsx_dterm_lpf1_static_hz, 0, LPF_MAX_HZ, 1 } }, + { "LPF1 Q", OME_UINT8, NULL, &(OSD_UINT8_t){ &cmsx_dterm_lpf1_q, 0, 100, 1 } }, { "DTERM LPF2", OME_UINT16 | SLIDER_DTERM, NULL, &(OSD_UINT16_t){ &cmsx_dterm_lpf2_static_hz, 0, LPF_MAX_HZ, 1 } }, + { "LPF2 Q", OME_UINT8, NULL, &(OSD_UINT8_t){ &cmsx_dterm_lpf2_q, 0, 100, 1 } }, { "DTERM NF", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_notch_hz, 0, LPF_MAX_HZ, 1 } }, { "DTERM NFCO", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_notch_cutoff, 0, LPF_MAX_HZ, 1 } }, { "YAW LPF", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_yaw_lowpass_hz, 0, 500, 1 } }, diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index f16f8d048c..488db787d0 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -180,9 +180,9 @@ void resetPidProfile(pidProfile_t *pidProfile) // 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_lpf1_type = FILTER_PT1, - .dterm_lpf1_biquad_q = 141, + .dterm_lpf1_biquad_q = 71, .dterm_lpf2_type = FILTER_PT1, - .dterm_lpf2_biquad_q = 141, + .dterm_lpf2_biquad_q = 71, .dterm_lpf1_dyn_min_hz = DTERM_LPF1_DYN_MIN_HZ_DEFAULT, .dterm_lpf1_dyn_max_hz = DTERM_LPF1_DYN_MAX_HZ_DEFAULT, .launchControlMode = LAUNCH_CONTROL_MODE_NORMAL, @@ -1127,7 +1127,7 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, timeUs_t currentTim if (feedforwardGain > 0) { // halve feedforward in Level mode since stick sensitivity is weaker by about half feedforwardGain *= FLIGHT_MODE(ANGLE_MODE) ? 0.5f : 1.0f; - // transition now calculated in feedforward.c when new RC data arrives + // transition now calculated in feedforward.c when new RC data arrives float feedForward = feedforwardGain * pidSetpointDelta * pidRuntime.pidFrequency; #ifdef USE_FEEDFORWARD