1
0
Fork 0
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:
luggi 2014-05-03 02:25:29 +02:00
parent c1fcdabdc1
commit 495c6b8f73
2 changed files with 23 additions and 18 deletions

View file

@ -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