TECS: speed (only) -based underspeed detection

- underspeed condition only determined by true airspeed undershoot
- change binary underspeed condition to a continuous percent undersped
- ramp-in max throttle, pitch speed weight, and TAS setpoint reduction during underspeed to avoid jumpy commands at the true airspeed error boundary
- let true airspeed filter reach zero airspeed
This commit is contained in:
Thomas Stastny
2022-07-18 10:49:27 -04:00
committed by Daniel Agar
parent eed073887d
commit 73010cc69b
2 changed files with 119 additions and 104 deletions
+10 -3
View File
@@ -219,8 +219,15 @@ public:
private:
// [m/s] bound on expected (safe) true airspeed tracking errors, including TAS = TAS_min - TAS_ERROR_BOUND
static constexpr float TAS_ERROR_BOUND = 2.0f;
// [m/s] true airspeed soft boundary region below the accepted TAS error region (below TAS_min - TAS_ERROR_BOUND)
// underspeed mitigation measures are ramped in from zero to full within this region
static constexpr float TAS_UNDERSPEED_SOFT_BOUND = 1.5f;
static constexpr float _jerk_max =
1000.0f; // maximum jerk for creating height rate trajectories, we want infinite jerk so set a high value
1000.0f;
enum ECL_TECS_MODE _tecs_mode {ECL_TECS_MODE_NORMAL};
@@ -318,7 +325,7 @@ private:
static constexpr float DT_DEFAULT = 0.02f; ///< default value for _dt (sec)
// controller mode logic
bool _underspeed_detected{false}; ///< true when an underspeed condition has been detected
float _percent_undersped{0.0f}; ///< a continuous representation of how "undersped" the TAS is [0,1]
bool _detect_underspeed_enabled{true}; ///< true when underspeed detection is enabled
bool _uncommanded_descent_recovery{false}; ///< true when a continuous descent caused by an unachievable airspeed demand has been detected
bool _climbout_mode_active{false}; ///< true when in climbout mode
@@ -342,7 +349,7 @@ private:
float alt_amsl);
/**
* Detect if the system is not capable of maintaining airspeed
* Detect how undersped the aircraft is
*/
void _detect_underspeed();