diff --git a/src/modules/vtol_att_control/tiltrotor.cpp b/src/modules/vtol_att_control/tiltrotor.cpp index 59a5b50aa4f..a361c050fac 100644 --- a/src/modules/vtol_att_control/tiltrotor.cpp +++ b/src/modules/vtol_att_control/tiltrotor.cpp @@ -232,7 +232,7 @@ void Tiltrotor::update_transition_state() } if (_vtol_schedule.flight_mode == vtol_mode::TRANSITION_FRONT_P1) { - // for the first part of the transition the rear rotors are enabled + // for the first part of the transition all rotors are enabled if (_motor_state != motor_state::ENABLED) { _motor_state = set_motor_state(_motor_state, motor_state::ENABLED); } @@ -280,17 +280,18 @@ void Tiltrotor::update_transition_state() _mc_roll_weight = 0.0f; _mc_yaw_weight = 0.0f; - // ramp down rear motors (setting MAX_PWM down scales the given output into the new range) - int rear_value = (1.0f - time_since_trans_start / _params_tiltrotor.front_trans_dur_p2) * - (PWM_DEFAULT_MAX - PWM_DEFAULT_MIN) + PWM_DEFAULT_MIN; + // ramp down motors not used in fixed-wing flight (setting MAX_PWM down scales the given output into the new range) + int ramp_down_value = (1.0f - time_since_trans_start / _params_tiltrotor.front_trans_dur_p2) * + (PWM_DEFAULT_MAX - PWM_DEFAULT_MIN) + PWM_DEFAULT_MIN; - _motor_state = set_motor_state(_motor_state, motor_state::VALUE, rear_value); + _motor_state = set_motor_state(_motor_state, motor_state::VALUE, ramp_down_value); _thrust_transition = -_mc_virtual_att_sp->thrust_body[2]; } else if (_vtol_schedule.flight_mode == vtol_mode::TRANSITION_BACK) { + // turn on all MC motors if (_motor_state != motor_state::ENABLED) { _motor_state = set_motor_state(_motor_state, motor_state::ENABLED); }