From d8f03693f7760eeb20da687b16419eecf3dc869e Mon Sep 17 00:00:00 2001 From: borisbstyle Date: Wed, 22 Mar 2017 23:40:15 +0100 Subject: [PATCH] Disable Airmode fully when airmode not active // Adjust default setpoints / pids --- src/main/flight/mixer.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index 6877866dd7..60067bff93 100755 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -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