1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Disable Airmode fully when airmode not active // Adjust default setpoints / pids

This commit is contained in:
borisbstyle 2017-03-22 23:40:15 +01:00
parent 42cbbbb681
commit d8f03693f7

View file

@ -573,11 +573,15 @@ void mixTable(pidProfile_t *pidProfile)
for (int i = 0; i < motorCount; i++) {
motorMix[i] /= motorMixRange;
}
// Get the maximum correction by setting offset to center
throttle = 0.5f;
// Get the maximum correction by setting offset to center when airmode enabled
if (isAirmodeActive()) {
throttle = 0.5f;
}
} else {
float throttleLimitOffset = motorMixRange / 2.0f;
throttle = constrainf(throttle, 0.0f + throttleLimitOffset, 1.0f - throttleLimitOffset);
if (isAirmodeActive()) { // Only automatically adjust throttle during airmode scenario
float throttleLimitOffset = motorMixRange / 2.0f;
throttle = constrainf(throttle, 0.0f + throttleLimitOffset, 1.0f - throttleLimitOffset);
}
}
// Now add in the desired throttle, but keep in a range that doesn't clip adjusted