diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-31 16:23:37 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-31 16:23:37 +0200 |
commit | ab022d51338c30207379048c913715a0b8d601c3 (patch) | |
tree | e7dba9008b1c86dae0406c41fb5ff9f75b15b3aa /src/lib/external_lgpl | |
parent | 593df0ae12e0a255c1291dedf914482b4f1da496 (diff) | |
download | px4-firmware-ab022d51338c30207379048c913715a0b8d601c3.tar.gz px4-firmware-ab022d51338c30207379048c913715a0b8d601c3.tar.bz2 px4-firmware-ab022d51338c30207379048c913715a0b8d601c3.zip |
disable underspeed protection when landing also in tecs
Diffstat (limited to 'src/lib/external_lgpl')
-rw-r--r-- | src/lib/external_lgpl/tecs/tecs.cpp | 5 | ||||
-rw-r--r-- | src/lib/external_lgpl/tecs/tecs.h | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/external_lgpl/tecs/tecs.cpp b/src/lib/external_lgpl/tecs/tecs.cpp index a57a0481a..d27bf776f 100644 --- a/src/lib/external_lgpl/tecs/tecs.cpp +++ b/src/lib/external_lgpl/tecs/tecs.cpp @@ -252,6 +252,11 @@ void TECS::_update_height_demand(float demand, float state) void TECS::_detect_underspeed(void) { + if (!_detect_underspeed_enabled) { + _underspeed = false; + return; + } + if (((_integ5_state < _TASmin * 0.9f) && (_throttle_dem >= _THRmaxf * 0.95f)) || ((_integ3_state < _hgt_dem_adj) && _underspeed)) { _underspeed = true; diff --git a/src/lib/external_lgpl/tecs/tecs.h b/src/lib/external_lgpl/tecs/tecs.h index bcc2d90e5..36ae4ecaf 100644 --- a/src/lib/external_lgpl/tecs/tecs.h +++ b/src/lib/external_lgpl/tecs/tecs.h @@ -66,6 +66,9 @@ public: _hgt_dem_prev(0.0f), _TAS_dem_adj(0.0f), _STEdotErrLast(0.0f), + _underspeed(false), + _detect_underspeed_enabled(true), + _badDescent(false), _climbOutDem(false), _SPE_dem(0.0f), _SKE_dem(0.0f), @@ -221,6 +224,10 @@ public: _speedrate_p = speedrate_p; } + void set_detect_underspeed_enabled(bool enabled) { + _detect_underspeed_enabled = enabled; + } + private: struct tecs_state _tecs_state; @@ -323,6 +330,9 @@ private: // Underspeed condition bool _underspeed; + // Underspeed detection enabled + bool _detect_underspeed_enabled; + // Bad descent condition caused by unachievable airspeed demand bool _badDescent; |