AP_TECS: Use aircraft stall speed

When stall prevention is enabled we were scaling from the aircraft's
minimum flight speed. However this is normally already picked as being
above the stall speed, and for a variety of reasons we may want to pin
the aircraft at a higher minimum speed. But if the aircraft was
commanded to fly to close to that minimum speed as soon as it banked for
a pattern it would command a increase in speed to keep it away from
stalling. However if your minimum speed is far from stalling this
increase was incorrect. To make it worse what this actually results in
happening is an aircraft diving for more speed (over 10 m/s on some
aircraft) as well as descending to gain that speed resulting in over 200
foot deviations in altitude control.
This commit is contained in:
Michael du Breuil 2024-07-03 10:33:57 -07:00 committed by Andrew Tridgell
parent 80277e6da0
commit edaddc0431

View File

@ -415,7 +415,11 @@ void AP_TECS::_update_speed(float DT)
if (aparm.stall_prevention) { if (aparm.stall_prevention) {
// when stall prevention is active we raise the minimum // when stall prevention is active we raise the minimum
// airspeed based on aerodynamic load factor // airspeed based on aerodynamic load factor
_TASmin *= _load_factor; if (is_positive(aparm.airspeed_stall)) {
_TASmin = MAX(_TASmin, aparm.airspeed_stall*EAS2TAS*_load_factor);
} else {
_TASmin *= _load_factor;
}
} }
if (_TASmax < _TASmin) { if (_TASmax < _TASmin) {