1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Merge pull request #6235 from etracer65/throttle_angle_correction

Fix throttle angle correction when smoothing throttle; reduce processing overhead
This commit is contained in:
Michael Keller 2018-06-30 18:46:51 +12:00 committed by GitHub
commit c6c3d0b5af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 25 deletions

View file

@ -126,6 +126,8 @@ float motor_disarmed[MAX_SUPPORTED_MOTORS];
mixerMode_e currentMixerMode;
static motorMixer_t currentMixer[MAX_SUPPORTED_MOTORS];
static FAST_RAM_ZERO_INIT int throttleAngleCorrection;
static const motorMixer_t mixerQuadX[] = {
{ 1.0f, -1.0f, 1.0f, -1.0f }, // REAR_R
@ -607,7 +609,7 @@ static void calculateThrottleAndCurrentMotorEndpoints(timeUs_t currentTimeUs)
pidResetITerm();
}
} else {
throttle = rcCommand[THROTTLE] - rxConfig()->mincheck;
throttle = rcCommand[THROTTLE] - rxConfig()->mincheck + throttleAngleCorrection;
currentThrottleInputRange = rcCommandThrottleRange;
motorRangeMin = motorOutputLow;
motorRangeMax = motorOutputHigh;
@ -897,3 +899,8 @@ uint16_t convertMotorToExternal(float motorValue)
return externalValue;
}
void mixerSetThrottleAngleCorrection(int correctionValue)
{
throttleAngleCorrection = correctionValue;
}