mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
fixed signs in control loop
This commit is contained in:
parent
84af4b7651
commit
95d52c6b08
@ -149,10 +149,10 @@ static void altitudeHoldTask(void)
|
||||
VelocityStateDownGet(&velocityStateDown);
|
||||
|
||||
// altitude control loop
|
||||
altitudeHoldStatus.VelocityDesired = altitudeHoldSettings.AltitudeP * (positionStateDown - altitudeHoldDesired.Altitude) + altitudeHoldDesired.Velocity;
|
||||
altitudeHoldStatus.VelocityDesired = altitudeHoldSettings.AltitudeP * (altitudeHoldDesired.Altitude - positionStateDown) + altitudeHoldDesired.Velocity;
|
||||
|
||||
// velocity control loop
|
||||
altitudeHoldStatus.AccelerationDesired = altitudeHoldSettings.VelocityP * (velocityStateDown - altitudeHoldStatus.VelocityDesired) - 9.81f;
|
||||
altitudeHoldStatus.AccelerationDesired = altitudeHoldSettings.VelocityP * (altitudeHoldStatus.VelocityDesired - velocityStateDown) - 9.81f;
|
||||
|
||||
altitudeHoldStatus.AccelerationFiltered = accelStateDown;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user