mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
in autopilot modes, allow up to 85 deg for pos hold
This commit is contained in:
parent
6d99af0d50
commit
811dc0ecb7
1 changed files with 3 additions and 1 deletions
|
@ -570,10 +570,12 @@ STATIC_UNIT_TESTED FAST_CODE_NOINLINE float pidLevel(int axis, const pidProfile_
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_POS_HOLD_MODE
|
#ifdef USE_POS_HOLD_MODE
|
||||||
if (FLIGHT_MODE(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()) {
|
if (isAutopilotActive()) {
|
||||||
|
// sticks are not deflected
|
||||||
angleTarget = autopilotAngle[axis]; // autopilotAngle in degrees
|
angleTarget = autopilotAngle[axis]; // autopilotAngle in degrees
|
||||||
|
angleLimit = 85.0f; // allow autopilot to use whatever angle it needs to stop
|
||||||
}
|
}
|
||||||
angleFeedforward = 0.0f;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue