From 0ab87e4395d4ccfc7e3c9558ccad796dbf5e9d39 Mon Sep 17 00:00:00 2001 From: Balduin Date: Fri, 22 May 2026 15:46:48 +0200 Subject: [PATCH] fix(fw_latlon_control): compensate TECS min airspeed for load factor TECS was given the load factor but not the minimum airspeed, derived from the performance model. TECS itself does the eas/tas conversion (altitude compensation) but not load factor or weight compensation, which is the responsibility of the performance model. Use set_equivalent_airspeed_min to update the latter, compensated for load factor, whenever attitude updates. Currently it is only called on param change, so TECS has a min airspeed based on outdated load factor and flap setpoint. --- .../FwLateralLongitudinalControl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp b/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp index 9a53ddafc8..a34c103673 100644 --- a/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp +++ b/src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp @@ -608,9 +608,14 @@ void FwLateralLongitudinalControl::updateAttitude() { _long_control_state.pitch_rad = euler_angles.theta(); _yaw = euler_angles.psi(); - // load factor due to banking const float load_factor_from_bank_angle = 1.0f / max(cosf(euler_angles.phi()), FLT_EPSILON); + + // Used to compensate for higher induced drag during banking _tecs.set_load_factor(load_factor_from_bank_angle); + // Used to give underspeed mitigation the correct minimum airspeed + _tecs.set_equivalent_airspeed_min( + _performance_model.getMinimumCalibratedAirspeed(load_factor_from_bank_angle, _flaps_setpoint) + ); } }