diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index 4da8435d3a899..5a8bfa18cfa19 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -296,6 +296,14 @@ const AP_Param::Info Plane::var_info[] = { // @User: Standard ASCALAR(airspeed_max, "AIRSPEED_MAX", AIRSPEED_FBW_MAX), + // @Param: AIRSPEED_STALL + // @DisplayName: Stall airspeed + // @Description: If stall prevention is enabled this speed is used to calculate the minimum airspeed while banking. If this is set to 0 then the stall speed is assumed to be the minimum airspeed speed. Typically set slightly higher then true stall speed. Value is as an indicated (calibrated/apparent) airspeed. + // @Units: m/s + // @Range: 5 75 + // @User: Standard + ASCALAR(airspeed_stall, "AIRSPEED_STALL", 0), + // @Param: FBWB_ELEV_REV // @DisplayName: Fly By Wire elevator reverse // @Description: Reverse sense of elevator in FBWB and CRUISE modes. When set to 0 up elevator (pulling back on the stick) means to lower altitude. When set to 1, up elevator means to raise altitude. diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index ba89c45772811..de514b891532c 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -343,6 +343,7 @@ class Parameters { k_param_mixing_offset, k_param_dspoiler_rud_rate, + k_param_airspeed_stall, k_param_logger = 253, // Logging Group diff --git a/libraries/AP_TECS/AP_TECS.cpp b/libraries/AP_TECS/AP_TECS.cpp index 9307502caaf0b..55fb024043b1d 100644 --- a/libraries/AP_TECS/AP_TECS.cpp +++ b/libraries/AP_TECS/AP_TECS.cpp @@ -415,7 +415,11 @@ void AP_TECS::_update_speed(float DT) if (aparm.stall_prevention) { // when stall prevention is active we raise the minimum // 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) { diff --git a/libraries/AP_Vehicle/AP_FixedWing.h b/libraries/AP_Vehicle/AP_FixedWing.h index 7aee38d5c5b35..df3692a61b655 100644 --- a/libraries/AP_Vehicle/AP_FixedWing.h +++ b/libraries/AP_Vehicle/AP_FixedWing.h @@ -14,6 +14,7 @@ struct AP_FixedWing { AP_Int16 airspeed_min; AP_Int16 airspeed_max; AP_Float airspeed_cruise; + AP_Float airspeed_stall; AP_Float min_groundspeed; AP_Int8 crash_detection_enable; AP_Float roll_limit;