From cdf9cfb28b705ac821a9ef0bbaff406756d6d5b6 Mon Sep 17 00:00:00 2001 From: Saibernard <112599512+Saibernard@users.noreply.github.com> Date: Mon, 9 Nov 2026 03:09:31 -0500 Subject: [PATCH] fix(vtol): restart the tiltrotor front transition mid back transition (#29609) * fix(vtol): restart the tiltrotor front transition mid back transition A tiltrotor that got a fixed-wing request while still transitioning back to hover switched straight to fixed-wing mode, which commands full forward tilt in one step and starts the throttle blend from the hover thrust on the front rotors, even with the rotors already part way to vertical and the motors off. In Gazebo that can pitch the aircraft up 50 degrees and stall it. Keep the instant switch while the rotors are still forward of VT_TILT_TRANS and otherwise restart the front transition from the current tilt, as the standard VTOL does. The first front transition phase sets the pitch weight and ramps the throttle weight back up, since the back transition zeroes both while the rotors rotate. Signed-off-by: Saibernard Yogendran --- src/modules/vtol_att_control/tiltrotor.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modules/vtol_att_control/tiltrotor.cpp b/src/modules/vtol_att_control/tiltrotor.cpp index d0832138e43..cb2a39eda22 100644 --- a/src/modules/vtol_att_control/tiltrotor.cpp +++ b/src/modules/vtol_att_control/tiltrotor.cpp @@ -150,8 +150,18 @@ void Tiltrotor::update_vtol_state() break; case vtol_mode::TRANSITION_BACK: - // failsafe into fixed wing mode - _vtol_mode = vtol_mode::FW_MODE; + + // while the rotors are still tilted forward enough for the wing, finish as before + if (_tilt_control >= _param_vt_tilt_trans.get()) { + _vtol_mode = vtol_mode::FW_MODE; + + } else { + // the rotors are already coming back. Restart the front transition from the current tilt + // instead of handing the fixed-wing controller a vehicle with the rotors near vertical + resetTransitionStates(); + _vtol_mode = vtol_mode::TRANSITION_FRONT_P1; + } + break; } } @@ -247,9 +257,12 @@ void Tiltrotor::update_transition_state() _tilt_control = math::max(_tilt_control, ramped_up_tilt); } - // at low speeds give full weight to MC + // at low speeds give full weight to MC. A back transition zeroes the pitch and throttle weights + // while the rotors rotate, so a restarted front transition sets pitch and ramps the throttle back _mc_roll_weight = 1.0f; + _mc_pitch_weight = 1.0f; _mc_yaw_weight = 1.0f; + _mc_throttle_weight = math::min(_mc_throttle_weight + _transition_dt / BACKTRANS_THROTTLE_UPRAMP_DUR_S, 1.0f); const float airspeed_trans_blend_margin = getTransitionAirspeed() - getBlendAirspeed();