[TECS]: If in airspeedless mode, add the throttle integrator term to the throttle setpoint, if the integrator term is positive. This should avoid reducing airspeed when switching to airspeedless mode. (#20987)

This commit is contained in:
KonradRudin
2023-01-25 09:16:11 +01:00
committed by GitHub
parent 20b7a8c9f6
commit d3b7112dd9
+5
View File
@@ -609,8 +609,13 @@ float TECSControl::_calcThrottleControlOutput(const STERateLimit &limit, const C
// Add the integrator feedback during closed loop operation with an airspeed sensor
throttle_setpoint += _throttle_integ_state;
} else {
/* We want to avoid reducing the throttle output when switching from airspeed enabled mode into airspeedless mode.
Thus, if the throttle integrator has a positive value, add it still to the throttle setpoint. */
throttle_setpoint += math::max(0.0f, _throttle_integ_state);
}
// ramp in max throttle setting with underspeediness value
throttle_setpoint = _ratio_undersped * param.throttle_max + (1.0f - _ratio_undersped) * throttle_setpoint;