Skip to content

Commit

Permalink
pid: do not wind down interal when we get stick input
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Sep 17, 2023
1 parent 2c36540 commit 6d42f25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ static inline void pid(uint8_t x) {
state.pid_p_term.axis[x] *= v_compensation;

// I term
if (flags.on_ground || flags.in_air == 0) {
// wind down integral while we are still on ground
if (flags.in_air == 0 && fabsf(state.error.axis[x]) < 0.05f) {
// wind down integral while we are still on ground and we do not get any input from the sticks
ierror[x] *= 0.98f;
}

Expand Down

0 comments on commit 6d42f25

Please sign in to comment.