1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 00:05:28 +03:00

Do not raise THROTTLE during NAV_CTL_LAND when nose is UP

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-05-28 08:49:51 +02:00
parent 05cee111ff
commit df619eb551
3 changed files with 14 additions and 2 deletions

View file

@ -407,7 +407,16 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
if (isPitchAdjustmentValid && (navStateFlags & NAV_CTL_ALT)) {
pitchCorrection += posControl.rcAdjustment[PITCH];
throttleCorrection += DECIDEGREES_TO_DEGREES(pitchCorrection) * navConfig()->fw.pitch_to_throttle;
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
if (navStateFlags & NAV_CTL_LAND) {
/*
* During LAND we do not allow to raise THROTTLE when nose is up
* to reduce speed
*/
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, 0);
} else {
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
}
}
// Speed controller - only apply in POS mode