mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 22:50:49 +08:00
Underspeed mitigation used to ramp in from tas_min - 0.15*trim and only reached full effect at tas_min - 0.30*trim. On typical airframes this was below stall, so in practice the protection never kicked in. - Start the ramp at tas_min. It reaches full effect at 90% of tas_min, or halfway to tas_stall if that is higher (a step if stall >= min). The stall airspeed comes from FW_AIRSPD_STALL via the performance model and is load-factor and flaps compensated, like the minimum airspeed. Drop the hardcoded tas_error_percentage. - While the underspeed ratio is above 0.5, reset the altitude reference to the current state. This stops altitude error from building up and then commanding a hard pitch-up (and a possible secondary stall) on recovery. - Blend the roll limit from FW_R_LIM down to min(20 deg, FW_R_LIM) as the underspeed ratio rises, ahead of the roll slew-rate limit, to reduce load factor during recovery. - Add TECS unit tests for the ramp, the stall handling and the altitude reference hold. Takeoff and landing turn underspeed protection off, so none of this applies there. --------- Signed-off-by: RomanBapst <bapstroman@gmail.com> Co-authored-by: RomanBapst <bapstroman@gmail.com> Co-authored-by: Silvan Fuhrer <silvan@auterion.com>