1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +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,12 +573,16 @@ void mixTable(pidProfile_t *pidProfile)
for (int i = 0; i < motorCount; i++) { for (int i = 0; i < motorCount; i++) {
motorMix[i] /= motorMixRange; motorMix[i] /= motorMixRange;
} }
// Get the maximum correction by setting offset to center // Get the maximum correction by setting offset to center when airmode enabled
if (isAirmodeActive()) {
throttle = 0.5f; throttle = 0.5f;
}
} else { } else {
if (isAirmodeActive()) { // Only automatically adjust throttle during airmode scenario
float throttleLimitOffset = motorMixRange / 2.0f; float throttleLimitOffset = motorMixRange / 2.0f;
throttle = constrainf(throttle, 0.0f + throttleLimitOffset, 1.0f - throttleLimitOffset); 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 // 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. // roll/pitch/yaw. This could move throttle down, but also up for those low throttle flips.