VTOL: Quad-chute: rework loss of altitude condition

Previously the condition was based on hard coded height rate estimate and
setpoint values and an altitude error threshold. That showed to be leading
to false positives when the vehicle doesn't tightly follow the altitdue
ramp given by TECS to achieve a new altitude setpoint, and has become
completely infeasibly with the latest TECS rework that leads to non-ramped
altitude setpoint changes in the tecs_status message.
The new check no longer checks the altitude error but only the height rate
instead. It begins to integrate the height rate error once it detects an
uncommanded descend condition (height rate negative while setpoint is
positive). Integral threshold can be tuned by user (VT_QC_HR_ERROR_I).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2023-01-19 09:36:09 +01:00
parent 36dc75bedf
commit f3cdf70732
4 changed files with 40 additions and 46 deletions
@@ -213,10 +213,10 @@ VtolAttitudeControl::quadchute(QuadchuteReason reason)
"Quad-chute triggered due to minimum altitude breach");
break;
case QuadchuteReason::LossOfAlt:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: loss of altitude\t");
case QuadchuteReason::UncommandedDescent:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: Uncommanded descent detected\t");
events::send(events::ID("vtol_att_ctrl_quadchute_alt_loss"), events::Log::Critical,
"Quad-chute triggered due to loss of altitude");
"Quad-chute triggered due to uncommanded descent detection");
break;
case QuadchuteReason::TransitionAltitudeLoss: