Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix differential thrust for Tailsitter in FW mode #16537

Merged
merged 1 commit into from
Jan 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/modules/vtol_att_control/tailsitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,6 @@ void Tailsitter::update_fw_state()
{
VtolType::update_fw_state();

// allow fw yawrate control via multirotor roll actuation. this is useful for vehicles
// which don't have a rudder to coordinate turns
if (_params->diff_thrust == 1) {
_mc_roll_weight = 1.0f;
}
}

/**
Expand All @@ -293,6 +288,11 @@ void Tailsitter::fill_actuator_outputs()
if (_vtol_schedule.flight_mode == vtol_mode::FW_MODE) {
mc_out[actuator_controls_s::INDEX_THROTTLE] = fw_in[actuator_controls_s::INDEX_THROTTLE];

/* allow differential thrust if enabled */
if (_params->diff_thrust == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest moving this change to the top to keep it clean (only responsible for determining the throttle)

if (_vtol_schedule.flight_mode == vtol_mode::FW_MODE && _params->diff_thrust == 1)) {
mc_out[actuator_controls_s::INDEX_ROLL] = fw_in[actuator_controls_s::INDEX_YAW] * _params->diff_thrust_scale;
} else {
mc_out[actuator_controls_s::INDEX_ROLL]  = mc_in[actuator_controls_s::INDEX_ROLL]  * _mc_roll_weight;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For tailsitter users, when should I enable this parameter and when should I disable it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion for one or the other way, both work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For tailsitter users, when should I enable this parameter and when should I disable it?

You should enable it when your vehicle has bad passive yaw stability or you want to fly aggressive maneuvers.

mc_out[actuator_controls_s::INDEX_ROLL] = fw_in[actuator_controls_s::INDEX_YAW] * _params->diff_thrust_scale;
}

} else {
mc_out[actuator_controls_s::INDEX_THROTTLE] = mc_in[actuator_controls_s::INDEX_THROTTLE];
}
Expand Down