1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Update D_CUT to D_MIN, add setpoint

Directly and easily set the minimum value for D on pitch and roll.
- Boost back to the primary D setting is generated from gyro or setpoint inputs.
- Setpoint input is stick derived, faster by 10ms approx, and does not respond to propwash.
- Gyro input is motor derived and slower, but responds to propwash
- timing value sets balance between gyro (100) and setpoint (0) boost factors
- gain value sets overall sensitivity
- default D mins are 20 roll 22 pitch
- default D is 35, 38; if undefined then normal 30, 32 values
TUNING
- D value to flip overshoot control
- D_min to noise, lower values mean cooler motors but perhaps more propwash.
- Advance, higher values bring the boost in earlier, and stronger overall, useful for very high flip rates, but dampen stick responsiveness slightly.
- Gain value adjust against logs, checking maximal boost with flips and some rise with propwash, should be edging to get up from the min value in normal flight.
This commit is contained in:
ctzsnooze 2019-02-10 01:41:28 +11:00
parent 4f7fa25b06
commit b70d34f9db
7 changed files with 105 additions and 90 deletions

View file

@ -560,8 +560,10 @@ static uint16_t cmsx_dterm_lowpass_hz;
static uint16_t cmsx_dterm_lowpass2_hz;
static uint16_t cmsx_dterm_notch_hz;
static uint16_t cmsx_dterm_notch_cutoff;
#ifdef USE_D_CUT
static uint8_t cmsx_dterm_cut_percent;
#ifdef USE_D_MIN
static uint8_t cmsx_d_min_roll;
static uint8_t cmsx_d_min_pitch;
static uint8_t cmsx_d_min_yaw;
#endif
static uint16_t cmsx_yaw_lowpass_hz;
@ -573,8 +575,10 @@ static long cmsx_FilterPerProfileRead(void)
cmsx_dterm_lowpass2_hz = pidProfile->dterm_lowpass2_hz;
cmsx_dterm_notch_hz = pidProfile->dterm_notch_hz;
cmsx_dterm_notch_cutoff = pidProfile->dterm_notch_cutoff;
#ifdef USE_D_CUT
cmsx_dterm_cut_percent = pidProfile->dterm_cut_percent;
#ifdef USE_D_MIN
cmsx_d_min_roll = pidProfile->d_min_roll;
cmsx_d_min_pitch = pidProfile->d_min_pitch;
cmsx_d_min_yaw = pidProfile->d_min_yaw;
#endif
cmsx_yaw_lowpass_hz = pidProfile->yaw_lowpass_hz;
@ -591,8 +595,10 @@ static long cmsx_FilterPerProfileWriteback(const OSD_Entry *self)
pidProfile->dterm_lowpass2_hz = cmsx_dterm_lowpass2_hz;
pidProfile->dterm_notch_hz = cmsx_dterm_notch_hz;
pidProfile->dterm_notch_cutoff = cmsx_dterm_notch_cutoff;
#ifdef USE_D_CUT
pidProfile->dterm_cut_percent = cmsx_dterm_cut_percent;
#ifdef USE_D_MIN
pidProfile->d_min_roll = cmsx_d_min_roll;
pidProfile->d_min_pitch = cmsx_d_min_pitch;
pidProfile->d_min_yaw = cmsx_d_min_yaw;
#endif
pidProfile->yaw_lowpass_hz = cmsx_yaw_lowpass_hz;
@ -607,8 +613,10 @@ static OSD_Entry cmsx_menuFilterPerProfileEntries[] =
{ "DTERM LPF2", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_lowpass2_hz, 0, 500, 1 }, 0 },
{ "DTERM NF", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_notch_hz, 0, 500, 1 }, 0 },
{ "DTERM NFCO", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_notch_cutoff, 0, 500, 1 }, 0 },
#ifdef USE_D_CUT
{ "DTERM CUT", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_dterm_cut_percent, 0, 100, 1 }, 0 },
#ifdef USE_D_MIN
{ "D_MIN_ROLL", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_d_min_roll, 0, 100, 1 }, 0 },
{ "D_MIN_PITCH", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_d_min_pitch, 0, 100, 1 }, 0 },
{ "D_MIN_YAW", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_d_min_yaw, 0, 100, 1 }, 0 },
#endif
{ "YAW LPF", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_yaw_lowpass_hz, 0, 500, 1 }, 0 },
{ "BACK", OME_Back, NULL, NULL, 0 },