mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
use the defined value in both places
This commit is contained in:
parent
1217893676
commit
acbc041259
1 changed files with 1 additions and 1 deletions
|
@ -920,7 +920,7 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
|
||||||
const bool isDecreasingI = ((ITerm > 0) && (itermErrorRate < 0)) || ((ITerm < 0) && (itermErrorRate > 0));
|
const bool isDecreasingI = ((ITerm > 0) && (itermErrorRate < 0)) || ((ITerm < 0) && (itermErrorRate > 0));
|
||||||
if ((itermRelax >= ITERM_RELAX_RP_INC) && isDecreasingI) {
|
if ((itermRelax >= ITERM_RELAX_RP_INC) && isDecreasingI) {
|
||||||
// Do Nothing, use the precalculed itermErrorRate
|
// Do Nothing, use the precalculed itermErrorRate
|
||||||
} else if (itermRelaxType == ITERM_RELAX_SETPOINT && setpointHpf < 30) {
|
} else if (itermRelaxType == ITERM_RELAX_SETPOINT && setpointHpf < ITERM_RELAX_SETPOINT_THRESHOLD) {
|
||||||
itermErrorRate *= itermRelaxFactor;
|
itermErrorRate *= itermRelaxFactor;
|
||||||
} else if (itermRelaxType == ITERM_RELAX_GYRO ) {
|
} else if (itermRelaxType == ITERM_RELAX_GYRO ) {
|
||||||
itermErrorRate = fapplyDeadband(setpointLpf - gyroRate, setpointHpf);
|
itermErrorRate = fapplyDeadband(setpointLpf - gyroRate, setpointHpf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue