From 90f689cfa13329615b249d2d25907510e44c8940 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Sun, 8 Dec 2013 10:44:17 +0100 Subject: [PATCH] throttle does not accelerate downwards but upwards - switched sign --- flight/modules/AltitudeHold/altitudehold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/modules/AltitudeHold/altitudehold.c b/flight/modules/AltitudeHold/altitudehold.c index 84abe76f4..ffe5b5cc3 100644 --- a/flight/modules/AltitudeHold/altitudehold.c +++ b/flight/modules/AltitudeHold/altitudehold.c @@ -171,7 +171,7 @@ static void altitudeHoldTask(void) } // acceleration control loop - float throttle = startThrottle + pid_apply_setpoint(&accelpid, 1.0f, rotatedAccelDesired, accelStateDown, 1000 / DESIRED_UPDATE_RATE_MS); + float throttle = startThrottle - pid_apply_setpoint(&accelpid, 1.0f, rotatedAccelDesired, accelStateDown, 1000 / DESIRED_UPDATE_RATE_MS); if (throttle >= 1.0f) { throttle = 1.0f;