aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@qgroundcontrol.org>2014-10-30 09:58:58 +0100
committerLorenz Meier <lm@qgroundcontrol.org>2014-10-30 09:58:58 +0100
commit5500fcdf1276f18c425d109a480fe22fa0289e05 (patch)
treea2b7a73db3258d18bea10227b8d6b1520068e80d
parenta82f4881c7f0dee36860ca69fef1e63b0d863b8c (diff)
parent02e35991d52f280d978c3ddd527269b1f9fd176d (diff)
downloadpx4-firmware-5500fcdf1276f18c425d109a480fe22fa0289e05.tar.gz
px4-firmware-5500fcdf1276f18c425d109a480fe22fa0289e05.tar.bz2
px4-firmware-5500fcdf1276f18c425d109a480fe22fa0289e05.zip
Merge pull request #1413 from philipoe/PR1
TECS: Fix bug (underspeed-condition did not have any effect on throttle)
-rw-r--r--src/lib/external_lgpl/tecs/tecs.cpp8
-rw-r--r--src/lib/external_lgpl/tecs/tecs.h3
2 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/external_lgpl/tecs/tecs.cpp b/src/lib/external_lgpl/tecs/tecs.cpp
index 6a2a61b04..0ed210cf4 100644
--- a/src/lib/external_lgpl/tecs/tecs.cpp
+++ b/src/lib/external_lgpl/tecs/tecs.cpp
@@ -299,7 +299,7 @@ void TECS::_update_throttle(float throttle_cruise, const math::Matrix<3,3> &rotM
// Calculate throttle demand
// If underspeed condition is set, then demand full throttle
if (_underspeed) {
- _throttle_dem_unc = 1.0f;
+ _throttle_dem = 1.0f;
} else {
// Calculate gain scaler from specific energy error to throttle
@@ -363,10 +363,10 @@ void TECS::_update_throttle(float throttle_cruise, const math::Matrix<3,3> &rotM
} else {
_throttle_dem = ff_throttle;
}
- }
- // Constrain throttle demand
- _throttle_dem = constrain(_throttle_dem, _THRminf, _THRmaxf);
+ // Constrain throttle demand
+ _throttle_dem = constrain(_throttle_dem, _THRminf, _THRmaxf);
+ }
}
void TECS::_detect_bad_descent(void)
diff --git a/src/lib/external_lgpl/tecs/tecs.h b/src/lib/external_lgpl/tecs/tecs.h
index 8ac31de6f..eb45237b7 100644
--- a/src/lib/external_lgpl/tecs/tecs.h
+++ b/src/lib/external_lgpl/tecs/tecs.h
@@ -345,9 +345,6 @@ private:
// climbout mode
bool _climbOutDem;
- // throttle demand before limiting
- float _throttle_dem_unc;
-
// pitch demand before limiting
float _pitch_dem_unc;