From 8a980cad4d73047bd14fc65eb4f062252010476e Mon Sep 17 00:00:00 2001 From: bkleiner Date: Fri, 15 Sep 2023 19:43:40 +0200 Subject: [PATCH] pid: disable iterm windup while we are on ground for all modes --- src/flight/pid.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/flight/pid.c b/src/flight/pid.c index 7bf7ccce7..32486525b 100644 --- a/src/flight/pid.c +++ b/src/flight/pid.c @@ -181,12 +181,8 @@ static inline void pid(uint8_t x) { state.pid_p_term.axis[x] *= v_compensation; // I term - // in level mode or horizon but not racemode and while on the ground... - if ((rx_aux_on(AUX_LEVELMODE)) && (!rx_aux_on(AUX_RACEMODE)) && ((flags.on_ground) || (flags.in_air == 0))) { - // wind down the integral error - ierror[x] *= 0.98f; - } else if (flags.on_ground) { - // in acro mode - only wind down integral when idle up is off and throttle is 0 + if (flags.on_ground || flags.in_air == 0) { + // wind down integral while we are still on ground ierror[x] *= 0.98f; }