From 395cf1b6dd9d2ee68dc879837f872547b42ede9a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 15 Feb 2022 12:29:02 +1100 Subject: [PATCH] Plane: allow for a trans decel margin so if we are behind the velocity curve we are less likely to overshoot landing --- ArduPlane/quadplane.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index 6f174a23b5..45d0114c4b 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -2103,7 +2103,11 @@ void QuadPlane::run_xy_controller(void) if (in_vtol_land_sequence() && (poscontrol.get_state() == QPOS_POSITION1 || poscontrol.get_state() == QPOS_POSITION2)) { - accel_cmss = MAX(accel_cmss, transition_decel*100); + // we allow for a bit higher accel limit than the trans decel, + // so if are less likely to overshoot the landing point + // if at some stage in the POS1 we are under velocity + const float accel_margin = 1.25; + accel_cmss = MAX(accel_cmss, accel_margin*transition_decel*100); } const float speed_cms = wp_nav->get_default_speed_xy(); pos_control->set_max_speed_accel_xy(speed_cms, accel_cmss);