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

Fix throttle angle correction when smoothing throttle; reduce processing overhead

Change the logic to not modify rcCommand directly and instead apply the additional throttle directly in the mixer.

Also move the logic to the attitude task instead of having it calculate in the PID loop. The logic relies on an angle that's only updated in the attitude task so there was no point in running the calculation every PID loop.
This commit is contained in:
Bruce Luckcuck 2018-06-28 10:39:21 -04:00
parent e260c37be3
commit 5cd886017d
7 changed files with 41 additions and 25 deletions

View file

@ -986,10 +986,6 @@ static FAST_CODE_NOINLINE void subTaskRcCommand(timeUs_t currentTimeUs)
resetYawAxis();
}
if (throttleCorrectionConfig()->throttle_correction_value && (FLIGHT_MODE(ANGLE_MODE) || FLIGHT_MODE(HORIZON_MODE))) {
rcCommand[THROTTLE] += calculateThrottleAngleCorrection(throttleCorrectionConfig()->throttle_correction_value);
}
processRcCommand();
#if defined(USE_GPS_RESCUE)