1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00

Merge pull request #7432 from etracer65/zero_throttle_anti_windup_in_pidloop

Move anti-windup iterm reset from rx loop to pid loop
This commit is contained in:
Michael Keller 2019-01-21 11:33:58 +13:00 committed by GitHub
commit f72bc436f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 2 deletions

View file

@ -80,6 +80,7 @@ static FAST_RAM_ZERO_INIT float antiGravityThrottleHpf;
static FAST_RAM_ZERO_INIT uint16_t itermAcceleratorGain;
static FAST_RAM float antiGravityOsdCutoff = 1.0f;
static FAST_RAM_ZERO_INIT bool antiGravityEnabled;
static FAST_RAM_ZERO_INIT bool zeroThrottleItermReset;
PG_REGISTER_WITH_RESET_TEMPLATE(pidConfig_t, pidConfig, PG_PID_CONFIG, 2);
@ -1398,6 +1399,8 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
pidData[axis].Sum = 0;
}
} else if (zeroThrottleItermReset) {
pidResetIterm();
}
}
@ -1450,3 +1453,8 @@ void dynLpfDTermUpdate(float throttle)
}
}
#endif
void pidSetItermReset(bool enabled)
{
zeroThrottleItermReset = enabled;
}