Skip to content

Commit

Permalink
pid: disable iterm windup while we are on ground for all modes
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Sep 15, 2023
1 parent 4fd2fab commit 2c36540
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2c36540

Please sign in to comment.