defaults to improve yaw behaviour, ITermWindupPointInv already defined at zero

This commit is contained in:
ctzsnooze 2018-09-12 11:54:45 +10:00
parent 8207dab3e5
commit f545637669
1 changed files with 3 additions and 6 deletions

View File

@ -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;