From e7e791fb1a9a8b06e33f58661bbf03dab080c622 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 18 Apr 2018 20:46:01 +0200 Subject: [PATCH] tailsitter: use forward transition throttle for climb-rate controlled mode - the mc pos controller will decrease throttle during the transition and thus the vehicle will not pick up enough airspeed to complete the transition Signed-off-by: Roman --- src/modules/vtol_att_control/tailsitter.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/modules/vtol_att_control/tailsitter.cpp b/src/modules/vtol_att_control/tailsitter.cpp index f765c424fb..73fee6f092 100644 --- a/src/modules/vtol_att_control/tailsitter.cpp +++ b/src/modules/vtol_att_control/tailsitter.cpp @@ -198,8 +198,6 @@ void Tailsitter::update_transition_state() _v_att_sp->pitch_body = math::constrain(_v_att_sp->pitch_body, PITCH_TRANSITION_FRONT_P1 - 0.2f, _pitch_transition_start); - _v_att_sp->thrust = _mc_virtual_att_sp->thrust; - // disable mc yaw control once the plane has picked up speed if (_airspeed->indicated_airspeed_m_s > ARSP_YAW_CTRL_DISABLE) { _mc_yaw_weight = 0.0f; @@ -222,9 +220,6 @@ void Tailsitter::update_transition_state() time_since_trans_start / _params->back_trans_duration; _v_att_sp->pitch_body = math::constrain(_v_att_sp->pitch_body, -2.0f, PITCH_TRANSITION_BACK + 0.2f); - - _v_att_sp->thrust = _mc_virtual_att_sp->thrust; - // keep yaw disabled _mc_yaw_weight = 0.0f; @@ -233,6 +228,13 @@ void Tailsitter::update_transition_state() } + if (_v_control_mode->flag_control_climb_rate_enabled) { + _v_att_sp->thrust = _params->front_trans_throttle; + + } else { + _v_att_sp->thrust = _mc_virtual_att_sp->thrust; + } + _mc_roll_weight = math::constrain(_mc_roll_weight, 0.0f, 1.0f); _mc_yaw_weight = math::constrain(_mc_yaw_weight, 0.0f, 1.0f); _mc_pitch_weight = math::constrain(_mc_pitch_weight, 0.0f, 1.0f);