diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index 5b0ae97aa0..a35e051e6a 100755 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -836,10 +836,6 @@ void mixTable(void) throttleMax = throttleMax - (rollPitchYawMixRange / 2); } - // adjust feedback to scale PID error inputs to our limitations. - errorLimiter = constrainf(((float)throttleRange / rollPitchYawMixRange), 0.1f, 1.0f); - if (debugMode == DEBUG_AIRMODE) debug[1] = errorLimiter * 100; - // Now add in the desired throttle, but keep in a range that doesn't clip adjusted // roll/pitch/yaw. This could move throttle down, but also up for those low throttle flips. for (i = 0; i < motorCount; i++) { diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index e4702b30d7..0c08f64ce7 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -323,7 +323,7 @@ static void pidInteger(const pidProfile_t *pidProfile, uint16_t max_angle_inclin uint16_t dynamicFactor = (1 << 8) - constrain(((ABS(AngleRateTmp) << 6) / resetRate), 0, 1 << 8); uint16_t dynamicKi = (pidProfile->I8[axis] * dynamicFactor) >> 8; - errorGyroI[axis] = errorGyroI[axis] + ((uint16_t)targetPidLooptime >> 11) * dynamicKi; + errorGyroI[axis] = errorGyroI[axis] + ((RateError * (uint16_t)targetPidLooptime) >> 11) * dynamicKi; // limit maximum integrator value to prevent WindUp - accumulating extreme values when system is saturated. // I coefficient (I8) moved before integration to make limiting independent from PID settings