mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
make flipping the quad safe with althold engaged
this should stop the copter from accelerating downwards, when upside down with althold enabled.
This commit is contained in:
parent
c1fcdabdc1
commit
495c6b8f73
2 changed files with 23 additions and 18 deletions
5
src/mw.c
5
src/mw.c
|
@ -854,7 +854,7 @@ void loop(void)
|
|||
AltHold = EstAlt;
|
||||
isAltHoldChanged = 0;
|
||||
}
|
||||
rcCommand[THROTTLE] = initialThrottleHold + BaroPID;
|
||||
rcCommand[THROTTLE] = constrain(initialThrottleHold + BaroPID, mcfg.minthrottle + 100, mcfg.maxthrottle);
|
||||
}
|
||||
} else {
|
||||
// slow alt changes for apfags
|
||||
|
@ -869,8 +869,7 @@ void loop(void)
|
|||
AltHoldCorr = 0;
|
||||
isAltHoldChanged = 0;
|
||||
}
|
||||
rcCommand[THROTTLE] = initialThrottleHold + BaroPID;
|
||||
rcCommand[THROTTLE] = constrain(rcCommand[THROTTLE], mcfg.minthrottle + 150, mcfg.maxthrottle);
|
||||
rcCommand[THROTTLE] = constrain(initialThrottleHold + BaroPID, mcfg.minthrottle + 100, mcfg.maxthrottle);
|
||||
}
|
||||
} else {
|
||||
// handle fixedwing-related althold. UNTESTED! and probably wrong
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue