aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Ludwig <frieludwig@hotmail.com>2014-11-11 15:35:25 +0100
committerFriedemann Ludwig <frieludwig@hotmail.com>2014-11-11 15:35:25 +0100
commitfe5322960af89cdd50586b32de19e047379c1f96 (patch)
tree9cd56906121d2ab5361337be093b63529f3a8e5c
parent66bfd9a0bfec46dbce8bffb832fea734fbce125e (diff)
parent1394b02c2e2158b2796a51ca622c17893f78361f (diff)
downloadpx4-firmware-fe5322960af89cdd50586b32de19e047379c1f96.tar.gz
px4-firmware-fe5322960af89cdd50586b32de19e047379c1f96.tar.bz2
px4-firmware-fe5322960af89cdd50586b32de19e047379c1f96.zip
Merge remote-tracking branch 'upstream/master' into no_beep
-rwxr-xr-x[-rw-r--r--]Documentation/versionfilter.sh0
-rwxr-xr-x[-rw-r--r--]Tools/px_generate_xml.sh0
-rwxr-xr-x[-rw-r--r--]Tools/px_update_wiki.sh0
-rw-r--r--src/lib/external_lgpl/tecs/tecs.cpp14
4 files changed, 6 insertions, 8 deletions
diff --git a/Documentation/versionfilter.sh b/Documentation/versionfilter.sh
index a887d8bc4..a887d8bc4 100644..100755
--- a/Documentation/versionfilter.sh
+++ b/Documentation/versionfilter.sh
diff --git a/Tools/px_generate_xml.sh b/Tools/px_generate_xml.sh
index 65f0c95da..65f0c95da 100644..100755
--- a/Tools/px_generate_xml.sh
+++ b/Tools/px_generate_xml.sh
diff --git a/Tools/px_update_wiki.sh b/Tools/px_update_wiki.sh
index d66bb9e10..d66bb9e10 100644..100755
--- a/Tools/px_update_wiki.sh
+++ b/Tools/px_update_wiki.sh
diff --git a/src/lib/external_lgpl/tecs/tecs.cpp b/src/lib/external_lgpl/tecs/tecs.cpp
index 0ed210cf4..cfcc48b62 100644
--- a/src/lib/external_lgpl/tecs/tecs.cpp
+++ b/src/lib/external_lgpl/tecs/tecs.cpp
@@ -321,31 +321,29 @@ void TECS::_update_throttle(float throttle_cruise, const math::Matrix<3,3> &rotM
ff_throttle = nomThr - STEdot_dem / _STEdot_min * nomThr;
}
- // Calculate PD + FF throttle
+ // Calculate PD + FF throttle and constrain to avoid blow-up of the integrator later
_throttle_dem = (_STE_error + STEdot_error * _thrDamp) * K_STE2Thr + ff_throttle;
+ _throttle_dem = constrain(_throttle_dem, _THRminf, _THRmaxf);
// Rate limit PD + FF throttle
// Calculate the throttle increment from the specified slew time
if (fabsf(_throttle_slewrate) > 0.01f) {
float thrRateIncr = _DT * (_THRmaxf - _THRminf) * _throttle_slewrate;
-
_throttle_dem = constrain(_throttle_dem,
- _last_throttle_dem - thrRateIncr,
- _last_throttle_dem + thrRateIncr);
+ _last_throttle_dem - thrRateIncr,
+ _last_throttle_dem + thrRateIncr);
}
// 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
+ // Set to a value that will allow 0.1 (10%) throttle saturation to allow for noise on the demand
float integ_max = (_THRmaxf - _throttle_dem + 0.1f);
float integ_min = (_THRminf - _throttle_dem - 0.1f);
// Calculate integrator state, constraining state
- // Set integrator to a max throttle value dduring climbout
+ // Set integrator to a max throttle value during climbout
_integ6_state = _integ6_state + (_STE_error * _integGain) * _DT * K_STE2Thr;
if (_climbOutDem) {