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:
commit
c6c3d0b5af
7 changed files with 41 additions and 25 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue