From f545637669dd50c53f74d25c12eec7e2592c1a7f Mon Sep 17 00:00:00 2001 From: ctzsnooze Date: Wed, 12 Sep 2018 11:54:45 +1000 Subject: [PATCH] defaults to improve yaw behaviour, ITermWindupPointInv already defined at zero --- src/main/flight/pid.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/flight/pid.c b/src/main/flight/pid.c index a6bd62e27..93ad5cdd4 100644 --- a/src/main/flight/pid.c +++ b/src/main/flight/pid.c @@ -117,7 +117,7 @@ void resetPidProfile(pidProfile_t *pidProfile) .pid = { [PID_ROLL] = { 46, 45, 25, 60 }, [PID_PITCH] = { 50, 50, 27, 60 }, - [PID_YAW] = { 65, 45, 0 , 60 }, + [PID_YAW] = { 45, 100, 0, 100 }, [PID_LEVEL] = { 50, 50, 75, 0 }, [PID_MAG] = { 40, 0, 0, 0 }, }, @@ -135,7 +135,7 @@ void resetPidProfile(pidProfile_t *pidProfile) .pidAtMinThrottle = PID_STABILISATION_ON, .levelAngleLimit = 55, .feedForwardTransition = 0, - .yawRateAccelLimit = 100, + .yawRateAccelLimit = 0, .rateAccelLimit = 0, .itermThrottleThreshold = 250, .itermAcceleratorGain = 5000, @@ -150,7 +150,7 @@ void resetPidProfile(pidProfile_t *pidProfile) .horizon_tilt_effect = 75, .horizon_tilt_expert_mode = false, .crash_limit_yaw = 200, - .itermLimit = 150, + .itermLimit = 300, .throttle_boost = 5, .throttle_boost_cutoff = 15, .iterm_rotation = true, @@ -443,12 +443,9 @@ void pidInitConfig(const pidProfile_t *pidProfile) horizonFactorRatio = (100 - pidProfile->horizon_tilt_effect) * 0.01f; maxVelocity[FD_ROLL] = maxVelocity[FD_PITCH] = pidProfile->rateAccelLimit * 100 * dT; maxVelocity[FD_YAW] = pidProfile->yawRateAccelLimit * 100 * dT; - ITermWindupPointInv = 0.0f; if (pidProfile->itermWindupPointPercent < 100) { float ITermWindupPoint = (float)pidProfile->itermWindupPointPercent / 100.0f; ITermWindupPointInv = 1.0f / (1.0f - ITermWindupPoint); - } else { - ITermWindupPointInv = 0.0f; } itermAcceleratorGain = pidProfile->itermAcceleratorGain; crashTimeLimitUs = pidProfile->crash_time * 1000;