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:
parent
e625dcd3ab
commit
cefe9affd3
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue