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

Differential thrust for tailsitter #12518

Conversation

bluecat1997
Copy link

@bluecat1997 bluecat1997 commented Jul 19, 2019

Change how differential thrust function works for tailsitter

  • Fixes differential thrust in fw mode for tailsitter.

Fixes issue #12302

In tailsitter VTOL aircraft if set "VT_FW_DIFTHR_EN"to 1 to enable differential thrust in fw mode, the motors not responded to yaw control stick but link to roll control stick. I found the code just use code in fw mode :
if (_params->diff_thrust == 1) { _mc_roll_weight = 1.0f; }
So in fw mode the plane can fix yaw error but can't response yaw stick control in stabilize and manual mode, and when you input roll control in these modes may lead to crash. This code also can't use "VT_FW_DIFTHR_SC" to control the scaling factor for differential thrust.

I rewrite the code to use fw input to control differential thrust and move the code from update_fw_state() to fill_actuator_outputs() :
/* allow differential thrust if enabled */ if (_params->diff_thrust == 1) { _actuators_out_0->control[actuator_controls_s::INDEX_ROLL] = _actuators_fw_in->control[actuator_controls_s::INDEX_YAW] * _params->diff_thrust_scale; }

Test information: I already test it in a transwing quad x tailsitter , it works well . here is my .ulog:
https://logs.px4.io/plot_app?log=0c83dc07-c03e-4f0c-acbc-d5b6e8cac0c2

The "Yaw Angular Rate" can show some useful information .
addition: This plane don't have rudder , the only yaw control device is Differential thrust. And my plane is not a typically aircraft ,yaw control in this craft will lead reverse roll because of aerodynamic issues. Not only for differential thrust but also for rudder. So it's better to test it in a more typically tailsitter if someone have it.

@bkueng bkueng requested a review from RomanBapst July 19, 2019 10:59
@bluecat1997 bluecat1997 marked this pull request as ready for review July 19, 2019 11:16
@bluecat1997
Copy link
Author

I have no idea about SITL Tests abort

@julianoes julianoes added the Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing! label Jul 22, 2019
@julianoes julianoes changed the title Pr differential thrust for tailsitter Differential thrust for tailsitter Jul 22, 2019
@dagar dagar self-requested a review July 25, 2019 14:54
@dagar dagar added this to the Release v1.10.0 milestone Jul 25, 2019
@dagar
Copy link
Member

dagar commented Jul 25, 2019

Can you share the test log? https://logs.px4.io/

@bluecat1997
Copy link
Author

你能分享测试日志吗?https://logs.px4.io/

I will test a Quad tailsitter tomorrow ,and maybe try it. But my plane is not a typically aircraft ,yaw control in this craft will lead reverse roll because of aerodynamic issues. Not only for differential thrust but also for rudder. So it's better to test it in a more typically tailsitter if someone have it.

Anyway I'll try it and upload it later tomorrow. But it won't be a very typically log.

@bluecat1997
Copy link
Author

你能分享测试日志吗?https://logs.px4.io/

here is my flight test:
https://logs.px4.io/plot_app?log=0c83dc07-c03e-4f0c-acbc-d5b6e8cac0c2

The "Yaw Angular Rate" can show some useful information .

addition: This plane don't have rudder , the only yaw control device is Differential thrust

} else {
_actuators_out_0->control[actuator_controls_s::INDEX_THROTTLE] =
_actuators_mc_in->control[actuator_controls_s::INDEX_THROTTLE];

_actuators_out_0->control[actuator_controls_s::INDEX_ROLL] =
_actuators_mc_in->control[actuator_controls_s::INDEX_ROLL] * _mc_roll_weight;
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this duplicating what's already done on line 277?

Copy link
Author

Choose a reason for hiding this comment

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

it just to redefine the relations between actuators_out and actuators_in for roll axis in mc mode to avoid my code on line 290 for fw mode make roll control in mc control unpredictable. I don't know if it is necessary, so I insert this code. If you think it isn't necessary here we can delete it but need to do fly test.

Copy link
Member

@dagar dagar Oct 15, 2019

Choose a reason for hiding this comment

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

It looks like you're repeating work already done on line 277 (_actuators_out_0->control[actuator_controls_s::INDEX_ROLL] ). Please verify and delete if that's the case.

@xdwgood
Copy link
Contributor

xdwgood commented Oct 19, 2019

have tested, work normally 😃

@xdwgood
Copy link
Contributor

xdwgood commented Oct 19, 2019

Hi @bluecat1997 @dagar
Can we continue it?
If I respond to the comments of @dagar , can we merge it? 😃

@bluecat1997
Copy link
Author

Hi @bluecat1997 @dagar
Can we continue it?
If I respond to the comments of @dagar , can we merge it?

Thanks for your test ! I'm also waiting for checking.

@stale
Copy link

stale bot commented Jan 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Jan 30, 2020
@RicardoM17
Copy link
Contributor

Is this issue dropped? @bluecat1997 are you still available to bring this in, or if not @dagar should I make a new PR instead?

@stale stale bot removed the stale label Jan 11, 2021
@dagar
Copy link
Member

dagar commented Jan 11, 2021

Is this issue dropped? @bluecat1997 are you still available to bring this in, or if not @dagar should I make a new PR instead?

If you could do a fresh PR with corresponding testing I think we could get this in asap.

@RicardoM17
Copy link
Contributor

Is this issue dropped? @bluecat1997 are you still available to bring this in, or if not @dagar should I make a new PR instead?

If you could do a fresh PR with corresponding testing I think we could get this in asap.

Done in #16537

@sfuhrer
Copy link
Contributor

sfuhrer commented Jan 18, 2021

Fixed in #16537.

@sfuhrer sfuhrer closed this Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants