1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

in autopilot modes, allow up to 85 deg for pos hold

This commit is contained in:
ctzsnooze 2024-11-07 09:47:59 +11:00
parent 6d99af0d50
commit 811dc0ecb7

View file

@ -570,10 +570,12 @@ STATIC_UNIT_TESTED FAST_CODE_NOINLINE float pidLevel(int axis, const pidProfile_
#endif
#ifdef USE_POS_HOLD_MODE
if (FLIGHT_MODE(POS_HOLD_MODE)) {
angleFeedforward = 0.0f; // otherwise the lag of the PT3 carries recent stick inputs into the hold
if (isAutopilotActive()) {
// sticks are not deflected
angleTarget = autopilotAngle[axis]; // autopilotAngle in degrees
angleLimit = 85.0f; // allow autopilot to use whatever angle it needs to stop
}
angleFeedforward = 0.0f;
}
#endif