From 8320c8ba1452d3ec836711845ce90b1ba286c703 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 21 Dec 2017 16:09:53 -0500 Subject: [PATCH] TECS initialize throttle integrator at cruise if in air --- tecs/tecs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tecs/tecs.cpp b/tecs/tecs.cpp index eb0f57c7a9..f17e8e9a92 100644 --- a/tecs/tecs.cpp +++ b/tecs/tecs.cpp @@ -531,7 +531,7 @@ void TECS::_initialize_states(float pitch, float throttle_cruise, float baro_alt _vert_pos_state = baro_altitude; _tas_rate_state = 0.0f; _tas_state = _EAS * EAS2TAS; - _throttle_integ_state = 0.0f; + _throttle_integ_state = (_in_air ? throttle_cruise : 0.0f); _pitch_integ_state = 0.0f; _last_throttle_setpoint = throttle_cruise; _last_pitch_setpoint = constrain(pitch, _pitch_setpoint_min, _pitch_setpoint_max);