1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

Fixed sign of angleTrim value

This commit is contained in:
ethomas999 2017-03-04 00:44:33 -05:00
parent e625dcd3ab
commit cefe9affd3

View file

@ -277,7 +277,7 @@ static float pidLevel(int axis, const pidProfile_t *pidProfile, const rollAndPit
errorAngle += GPS_angle[axis]; errorAngle += GPS_angle[axis];
#endif #endif
errorAngle = constrainf(errorAngle, -pidProfile->levelAngleLimit, pidProfile->levelAngleLimit); errorAngle = constrainf(errorAngle, -pidProfile->levelAngleLimit, pidProfile->levelAngleLimit);
errorAngle = (errorAngle - ((attitude.raw[axis] + angleTrim->raw[axis]) / 10.0f)); errorAngle = errorAngle - ((attitude.raw[axis] - angleTrim->raw[axis]) / 10.0f);
if(FLIGHT_MODE(ANGLE_MODE)) { if(FLIGHT_MODE(ANGLE_MODE)) {
// ANGLE mode - control is angle based, so control loop is needed // ANGLE mode - control is angle based, so control loop is needed
currentPidSetpoint = errorAngle * levelGain; currentPidSetpoint = errorAngle * levelGain;