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

Conversation

RicardoM17
Copy link
Contributor

Replaces #12518

Closes #12302

Followed the same logic and just updated the PR with a quick test in SITL.

Log: https://logs.px4.io/plot_app?log=fb7ebb3e-53ac-4c8a-baa7-548dc4a8ede0

@sfuhrer If you could have a look, and perhaps @xdwgood can you test this in a tailsitter as well?

@dagar FYI

Signed-off-by: Ricardo Marques <marques.ricardo17@gmail.com>
@xdwgood
Copy link
Contributor

xdwgood commented Jan 13, 2021

I have some concerns. The pr has only been tested on a four-motor taisitter, whether this modification works on a two-motor tailsitter.
At present, for the tailsitter with two motors, the heading change in the fixed-wing mode is done through the elevon. I know this works fine in the lioter state in fw mode. So I have a question: why do we need to introduce the current pr?(At present, the heading control can be completed without the motor differential speed)On the other hand, once the motor differential is used to change the heading, does this affect the pitch and roll control in the fw mode?

@@ -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.

@sfuhrer
Copy link
Contributor

sfuhrer commented Jan 13, 2021

I have some concerns. The pr has only been tested on a four-motor taisitter, whether this modification works on a two-motor tailsitter.

It shouldn't matter if dual or quad tailsitter. Both benefit form having yaw control in FW, and the correct allocation is then done in the corresponding mixer.

At present, for the tailsitter with two motors, the heading change in the fixed-wing mode is done through the elevon. I know this works fine in the lioter state in fw mode. So I have a question: why do we need to introduce the current pr?(At present, the heading control can be completed without the motor differential speed)On the other hand, once the motor differential is used to change the heading, does this affect the pitch and roll control in the fw mode?

Yes you can have directional control of a fixed-wing aircraft without controlling the yaw axis actively on most frames, but for a nicely coordinated turns or aggressive manual maneuvers yaw control is still beneficial.

Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

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

Looks good to me, also tested it quickly in SITL.

@@ -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 don't have a strong opinion for one or the other way, both work.

@@ -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.

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.

@sfuhrer sfuhrer merged commit 78c0527 into PX4:master Jan 18, 2021
@aoberai
Copy link

aoberai commented Jun 1, 2022

Does this allow for controlling a quadrotor tailsitter that does not have elevons like the Swan K1? I heard that PX4 doesn't currently have differential thrust for pitch and roll in cruise.

@sfuhrer
Copy link
Contributor

sfuhrer commented Jun 1, 2022

Does this allow for controlling a quadrotor tailsitter that does not have elevons like the Swan K1? I heard that PX4 doesn't currently have differential thrust for pitch and roll in cruise.

No that is not supported out of the box yet, but would be fairly straight forward to enable with some code changes if you want to play with it. We played around with it recently: https://github.com/PX4/PX4-Autopilot/commits/quad-tailsitter-no-surfaces-testing

@tstastny
Copy link

tstastny commented Jun 1, 2022

We played around with it recently: https://github.com/PX4/PX4-Autopilot/commits/quad-tailsitter-no-surfaces-testing

@aoberai @sfuhrer note in this branch there was a hacked in change of mixer that doesn't play well with the SITL airframe. You would need to revert the last commit there and it should actually transition in SITL. -- next step on that PR would be to implement a scaler for the roll and pitch differential thrust setting, as at the moment it is probably way too aggressive with full authority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Differential thrust in Tailsitter is link to aileron not rudder
5 participants