diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index 9ebb316b74..b95cc16b04 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -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