1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Scale down initial throttle when AH is engaged based on roll/pitch angle.

This improves AH behaviour when switching to AH while being in fast
forward flight.
This commit is contained in:
Werner Backes 2013-07-01 10:13:27 +02:00 committed by Alessio Morale
parent 513d509865
commit 23b5b37480

View File

@ -173,6 +173,12 @@ static void altitudeHoldTask(__attribute__((unused)) void *parameters)
// Copy the current throttle as a starting point for integral
StabilizationDesiredThrottleGet(&throttleIntegral);
switchThrottle = throttleIntegral;
throttleIntegral *= Rbe[2][2]; // rotate into earth frame
if (throttleIntegral > 1) {
throttleIntegral = 1;
} else if (throttleIntegral < 0) {
throttleIntegral = 0;
}
error = 0;
velocity = 0;
altitudeHoldDesired.Altitude = altHold.Altitude;