VTOL backtransition improvements

* vtol_type: only allow positive pitch setpoints during backtransition

* vtol params: set default of VT_B_DEC_FF to 0, as for most frames a FF is not necessary

* Tiltrotor: fix throttle during first part of back transition

* Tiltrotor: only enable all motors in second phase of backtransition (tilting phase)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2021-10-15 09:58:48 +02:00
parent af291e2040
commit 641383cbfb
3 changed files with 13 additions and 10 deletions
+8 -5
View File
@@ -380,8 +380,6 @@ void Tiltrotor::update_transition_state()
_v_att_sp->thrust_body[0] = _thrust_transition;
} else if (_vtol_schedule.flight_mode == vtol_mode::TRANSITION_BACK) {
// turn on all MC motors
set_all_motor_state(motor_state::ENABLED);
// set idle speed for rotary wing mode
if (!_flag_idle_mc) {
@@ -403,13 +401,18 @@ void Tiltrotor::update_transition_state()
_v_att_sp->pitch_body = update_and_get_backtransition_pitch_sp();
}
// while we quickly rotate back the motors keep throttle at idle
if (time_since_trans_start < BACKTRANS_THROTTLE_DOWNRAMP_DUR_S) {
// blend throttle from FW value to 0
_mc_throttle_weight = 1.0f;
const float target_throttle = 0.0f;
blendThrottleDuringBacktransition(time_since_trans_start, target_throttle);
const float progress = time_since_trans_start / BACKTRANS_THROTTLE_DOWNRAMP_DUR_S;
blendThrottleDuringBacktransition(progress, target_throttle);
} else if (time_since_trans_start < timeUntilMotorsAreUp()) {
// while we quickly rotate back the motors keep throttle at idle
// turn on all MC motors
set_all_motor_state(motor_state::ENABLED);
_mc_throttle_weight = 0.0f;
_mc_roll_weight = 0.0f;
_mc_pitch_weight = 0.0f;
@@ -511,7 +514,7 @@ void Tiltrotor::blendThrottleAfterFrontTransition(float scale)
void Tiltrotor::blendThrottleDuringBacktransition(float scale, float target_throttle)
{
_v_att_sp->thrust_body[2] = -(scale * target_throttle + (1.0f - scale) * _last_thr_in_fw_mode);
_thrust_transition = -(scale * target_throttle + (1.0f - scale) * _last_thr_in_fw_mode);
}