Fix mixer throttle calculation

The calculation used to transform the rcCommand[THROTTLE] value to a throttle value used in the mixer was incorrectly applying the `min_check` range a second time. This leads to the mixer throttle value scaling incorrectly and adds an additional deadzone at the low range that basically doubles the `min_check` range.
This commit is contained in:
Bruce Luckcuck 2019-01-25 16:33:28 -05:00
parent a4ce8b5600
commit 8f7cb7184e
1 changed files with 2 additions and 2 deletions

View File

@ -402,7 +402,7 @@ void initEscEndpoints(void)
break; break;
} }
rcCommandThrottleRange = PWM_RANGE_MAX - rxConfig()->mincheck; rcCommandThrottleRange = PWM_RANGE_MAX - PWM_RANGE_MIN;
} }
void mixerInit(mixerMode_e mixerMode) void mixerInit(mixerMode_e mixerMode)
@ -642,7 +642,7 @@ static void calculateThrottleAndCurrentMotorEndpoints(timeUs_t currentTimeUs)
pidResetIterm(); pidResetIterm();
} }
} else { } else {
throttle = rcCommand[THROTTLE] - rxConfig()->mincheck + throttleAngleCorrection; throttle = rcCommand[THROTTLE] - PWM_RANGE_MIN + throttleAngleCorrection;
currentThrottleInputRange = rcCommandThrottleRange; currentThrottleInputRange = rcCommandThrottleRange;
motorRangeMin = motorOutputLow; motorRangeMin = motorOutputLow;
motorRangeMax = motorOutputHigh; motorRangeMax = motorOutputHigh;