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.
This commit is contained in:
Balduin
2026-05-22 15:46:48 +02:00
parent f7fd8bb57a
commit 0ab87e4395

View File

@@ -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)
);
}
}