diff options
author | philipoe <philipp.oettershagen@mavt.ethz.ch> | 2014-07-31 15:23:30 +0200 |
---|---|---|
committer | philipoe <philipp.oettershagen@mavt.ethz.ch> | 2014-07-31 15:23:30 +0200 |
commit | fc2e0fad4731ef543be4c3da73de6b670d40d804 (patch) | |
tree | ae0c96163859fd2c2fd5c87143def18e2c172800 /src/lib/external_lgpl | |
parent | 8dc165b50efca2d9e86f23296a33f38f16c241e0 (diff) | |
download | px4-firmware-fc2e0fad4731ef543be4c3da73de6b670d40d804.tar.gz px4-firmware-fc2e0fad4731ef543be4c3da73de6b670d40d804.tar.bz2 px4-firmware-fc2e0fad4731ef543be4c3da73de6b670d40d804.zip |
TECS: Added separate gain / time constant for the throttle loop to allow independent tuning
Diffstat (limited to 'src/lib/external_lgpl')
-rw-r--r-- | src/lib/external_lgpl/tecs/tecs.cpp | 2 | ||||
-rw-r--r-- | src/lib/external_lgpl/tecs/tecs.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/external_lgpl/tecs/tecs.cpp b/src/lib/external_lgpl/tecs/tecs.cpp index 6386e37a0..16c7e5ffa 100644 --- a/src/lib/external_lgpl/tecs/tecs.cpp +++ b/src/lib/external_lgpl/tecs/tecs.cpp @@ -298,7 +298,7 @@ void TECS::_update_throttle(float throttle_cruise, const math::Matrix<3,3> &rotM } else { // Calculate gain scaler from specific energy error to throttle - float K_STE2Thr = 1 / (_timeConst * (_STEdot_max - _STEdot_min)); + float K_STE2Thr = 1 / (_timeConstThrot * (_STEdot_max - _STEdot_min)); // Calculate feed-forward throttle float ff_throttle = 0; diff --git a/src/lib/external_lgpl/tecs/tecs.h b/src/lib/external_lgpl/tecs/tecs.h index 5cafb1c79..10c9e9344 100644 --- a/src/lib/external_lgpl/tecs/tecs.h +++ b/src/lib/external_lgpl/tecs/tecs.h @@ -123,6 +123,10 @@ public: _timeConst = time_const; } + void set_time_const_throt(float time_const_throt) { + _timeConstThrot = time_const_throt; + } + void set_min_sink_rate(float rate) { _minSinkRate = rate; } @@ -204,6 +208,7 @@ private: float _minSinkRate; float _maxSinkRate; float _timeConst; + float _timeConstThrot; float _ptchDamp; float _thrDamp; float _integGain; |