mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
defaults to improve yaw behaviour, ITermWindupPointInv already defined at zero
This commit is contained in:
parent
8207dab3e5
commit
f545637669
1 changed files with 3 additions and 6 deletions
|
@ -117,7 +117,7 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
||||||
.pid = {
|
.pid = {
|
||||||
[PID_ROLL] = { 46, 45, 25, 60 },
|
[PID_ROLL] = { 46, 45, 25, 60 },
|
||||||
[PID_PITCH] = { 50, 50, 27, 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_LEVEL] = { 50, 50, 75, 0 },
|
||||||
[PID_MAG] = { 40, 0, 0, 0 },
|
[PID_MAG] = { 40, 0, 0, 0 },
|
||||||
},
|
},
|
||||||
|
@ -135,7 +135,7 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
||||||
.pidAtMinThrottle = PID_STABILISATION_ON,
|
.pidAtMinThrottle = PID_STABILISATION_ON,
|
||||||
.levelAngleLimit = 55,
|
.levelAngleLimit = 55,
|
||||||
.feedForwardTransition = 0,
|
.feedForwardTransition = 0,
|
||||||
.yawRateAccelLimit = 100,
|
.yawRateAccelLimit = 0,
|
||||||
.rateAccelLimit = 0,
|
.rateAccelLimit = 0,
|
||||||
.itermThrottleThreshold = 250,
|
.itermThrottleThreshold = 250,
|
||||||
.itermAcceleratorGain = 5000,
|
.itermAcceleratorGain = 5000,
|
||||||
|
@ -150,7 +150,7 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
||||||
.horizon_tilt_effect = 75,
|
.horizon_tilt_effect = 75,
|
||||||
.horizon_tilt_expert_mode = false,
|
.horizon_tilt_expert_mode = false,
|
||||||
.crash_limit_yaw = 200,
|
.crash_limit_yaw = 200,
|
||||||
.itermLimit = 150,
|
.itermLimit = 300,
|
||||||
.throttle_boost = 5,
|
.throttle_boost = 5,
|
||||||
.throttle_boost_cutoff = 15,
|
.throttle_boost_cutoff = 15,
|
||||||
.iterm_rotation = true,
|
.iterm_rotation = true,
|
||||||
|
@ -443,12 +443,9 @@ void pidInitConfig(const pidProfile_t *pidProfile)
|
||||||
horizonFactorRatio = (100 - pidProfile->horizon_tilt_effect) * 0.01f;
|
horizonFactorRatio = (100 - pidProfile->horizon_tilt_effect) * 0.01f;
|
||||||
maxVelocity[FD_ROLL] = maxVelocity[FD_PITCH] = pidProfile->rateAccelLimit * 100 * dT;
|
maxVelocity[FD_ROLL] = maxVelocity[FD_PITCH] = pidProfile->rateAccelLimit * 100 * dT;
|
||||||
maxVelocity[FD_YAW] = pidProfile->yawRateAccelLimit * 100 * dT;
|
maxVelocity[FD_YAW] = pidProfile->yawRateAccelLimit * 100 * dT;
|
||||||
ITermWindupPointInv = 0.0f;
|
|
||||||
if (pidProfile->itermWindupPointPercent < 100) {
|
if (pidProfile->itermWindupPointPercent < 100) {
|
||||||
float ITermWindupPoint = (float)pidProfile->itermWindupPointPercent / 100.0f;
|
float ITermWindupPoint = (float)pidProfile->itermWindupPointPercent / 100.0f;
|
||||||
ITermWindupPointInv = 1.0f / (1.0f - ITermWindupPoint);
|
ITermWindupPointInv = 1.0f / (1.0f - ITermWindupPoint);
|
||||||
} else {
|
|
||||||
ITermWindupPointInv = 0.0f;
|
|
||||||
}
|
}
|
||||||
itermAcceleratorGain = pidProfile->itermAcceleratorGain;
|
itermAcceleratorGain = pidProfile->itermAcceleratorGain;
|
||||||
crashTimeLimitUs = pidProfile->crash_time * 1000;
|
crashTimeLimitUs = pidProfile->crash_time * 1000;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue