1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

adjust Ki to keep total i action the same and reduce abs control default to 5

This commit is contained in:
Thorsten Laux 2019-04-01 10:10:12 +02:00 committed by mikeller
parent c3b83df962
commit f0bf7a2955

View file

@ -176,7 +176,7 @@ void resetPidProfile(pidProfile_t *pidProfile)
.acro_trainer_lookahead_ms = 50,
.acro_trainer_debug_axis = FD_ROLL,
.acro_trainer_gain = 75,
.abs_control_gain = 0,
.abs_control_gain = 5,
.abs_control_limit = 90,
.abs_control_error_limit = 20,
.abs_control_cutoff = 11,
@ -638,6 +638,10 @@ void pidInitConfig(const pidProfile_t *pidProfile)
acLimit = (float)pidProfile->abs_control_limit;
acErrorLimit = (float)pidProfile->abs_control_error_limit;
acCutoff = (float)pidProfile->abs_control_cutoff;
for (int axis = FD_ROLL; axis <= FD_YAW; axis++) {
float iCorrection = -acGain * PTERM_SCALE / ITERM_SCALE * pidCoefficient[axis].Kp;
pidCoefficient[axis].Ki = MAX(0.0f, pidCoefficient[axis].Ki + iCorrection);
}
#endif
#ifdef USE_DYN_LPF