aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-08-01 13:04:28 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-08-01 13:04:28 +0200
commit8e33278c4cfc979e6ca69994186b3a6144847d6a (patch)
tree24b456ff37659ff0cb018b46f9347268b1b8820f /src/lib
parent1300c9a975193ea9217600f25cc14e04d9f7706b (diff)
downloadpx4-firmware-8e33278c4cfc979e6ca69994186b3a6144847d6a.tar.gz
px4-firmware-8e33278c4cfc979e6ca69994186b3a6144847d6a.tar.bz2
px4-firmware-8e33278c4cfc979e6ca69994186b3a6144847d6a.zip
Move the last throttle demand setting to a better position
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/external_lgpl/tecs/tecs.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/external_lgpl/tecs/tecs.cpp b/src/lib/external_lgpl/tecs/tecs.cpp
index 16c7e5ffa..579fb5d42 100644
--- a/src/lib/external_lgpl/tecs/tecs.cpp
+++ b/src/lib/external_lgpl/tecs/tecs.cpp
@@ -327,9 +327,12 @@ void TECS::_update_throttle(float throttle_cruise, const math::Matrix<3,3> &rotM
_throttle_dem = constrain(_throttle_dem,
_last_throttle_dem - thrRateIncr,
_last_throttle_dem + thrRateIncr);
- _last_throttle_dem = _throttle_dem;
}
+ // Ensure _last_throttle_dem is always initialized properly
+ // Also: The throttle_slewrate limit is only applied to throttle_dem, but does not limit the integrator!!
+ _last_throttle_dem = _throttle_dem;
+
// Calculate integrator state upper and lower limits
// Set to a value thqat will allow 0.1 (10%) throttle saturation to allow for noise on the demand