mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 21:09:41 +08:00
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:
@@ -608,9 +608,14 @@ void FwLateralLongitudinalControl::updateAttitude() {
|
|||||||
_long_control_state.pitch_rad = euler_angles.theta();
|
_long_control_state.pitch_rad = euler_angles.theta();
|
||||||
_yaw = euler_angles.psi();
|
_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);
|
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);
|
_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)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user