Reset ITerm after crash
This commit is contained in:
parent
d031b038eb
commit
3bae1e78e2
|
@ -422,6 +422,9 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an
|
|||
errorRate = currentPidSetpoint - gyroRate;
|
||||
}
|
||||
}
|
||||
// reset ITerm, since accumulated error before crash is now meaningless
|
||||
// and ITerm windup during crash recovery can be extreme, especially on yaw axis
|
||||
axisPID_I[axis] = 0.0f;
|
||||
if (cmpTimeUs(currentTimeUs, crashDetectedAtUs) > crashTimeLimitUs
|
||||
|| (motorMixRange < 1.0f
|
||||
&& ABS(gyro.gyroADCf[FD_ROLL]) < crashRecoveryRate
|
||||
|
|
Loading…
Reference in New Issue