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

[Two motor tailsitter]Controlling the servo through the output from the mc controller #13917

Closed
wants to merge 2 commits into from

Conversation

xdwgood
Copy link
Contributor

@xdwgood xdwgood commented Jan 11, 2020

I understand that we use the output value from the FW controller to control the aileron in fixed-wing and transmission mode. But in MC mode, the output from the rotor controller should be used to control the aileron.

Now when tailsitter UAV is flying in the rotor state, the pitch / yaw control is through the output of the fw controller instead of the rotor controller output. This PR fixes this problem.

FYI: @RomanBapst

Allow mc control output to control servo in mc mode
@xdwgood xdwgood changed the title Controlling the servo through the output from the mc controller [Two motor tailsitter]Controlling the servo through the output from the mc controller Jan 11, 2020
@xdwgood
Copy link
Contributor Author

xdwgood commented Jan 14, 2020

@sfuhrer Could you take a look?

@sfuhrer
Copy link
Contributor

sfuhrer commented Jan 14, 2020

@sfuhrer Could you take a look?

Hi @xdwgood , currently the elevons get always controlled via the FW rate controller, correct. Is is so by design, eg this way every actuator has a dedicated rate controller allocated to it, which we don't change. @RomanBapst could give you further insides why it is done this way.
What's the reason for this PR, did you encounter some issue with the current implementation?

@xdwgood
Copy link
Contributor Author

xdwgood commented Jan 15, 2020

@sfuhrer Thank you very much for your reply

What's the reason for this PR, did you encounter some issue with the current implementation?

I follow px4 official guidelines to adjust my tailsitter. (https://docs.px4.io/master/en/config_vtol/vtol_quad_configuration.html) This guide says tuning MC mode using MC controller tuning Follow the the respective tuning guides on how to tune multirotors and fixed wings.

So I started to adjust the control parameters in mc mode. As a result, I found that changing the PID parameters(eg MC_PITCHRATE_P, MC_PITCHRATE_I, MC_PITCHRATE_D) in mc mode had no effect on the attitude control.

I checked the code and found that we changed the control of the aileron after v1.8.2.
#9190 I checked this original PR. Its purpose is to optimize tailsitter control in transmission mode. I don't think we should change the control output logic in mc mode.
One thing is very important: the four-motor tailsitter used to test this pr is different from my two motors tailsitter. The four-motors tailsitter control in rotor mode does not require the ailerons to participate.
For the tailsitter of the two motors: the output of the rotor rate controller must not only be applied to the motor, but also to the ailerons

@xdwgood
Copy link
Contributor Author

xdwgood commented Feb 18, 2020

@sfuhrer @dagar Could you give some advice? thanks

@xdwgood
Copy link
Contributor Author

xdwgood commented Feb 24, 2020

please help

@sfuhrer
Copy link
Contributor

sfuhrer commented Feb 24, 2020

Hi @xdwgood ,
As far as I understand it the quad tailsitter already uses the MC rate controller to control pitch and yaw, no? (At least the motors, from which I would expect more control authority then from the control surfaces in this case).
Did you fly this PR on a duo tailsitter as well? And did you see improvements compared to the current master then?
Agree that we should point it out better that for the duo tailsitter one has to tune the FW pitch/roll rate parameter, and also that that's not very intuitive.

@xdwgood
Copy link
Contributor Author

xdwgood commented Feb 24, 2020

@sfuhrer First, thank you for your reply

Yes, I have used this PR to fly, and the effect is not as good as it is now. I think this is because I did not adjust the pid parameter. Just use the default rotor angular rate control pid parameter.

Even if we use the parameters of fw to adjust the pitch and yaw in the rotor state, I worry that the same parameters are not applicable to the control of pitch and roll in the fixed-wing state.

The control gain in fixed-wing mode may be different from the control gain required in rotor mode, right?

@sfuhrer
Copy link
Contributor

sfuhrer commented Feb 27, 2020

@sfuhrer First, thank you for your reply

Yes, I have used this PR to fly, and the effect is not as good as it is now. I think this is because I did not adjust the pid parameter. Just use the default rotor angular rate control pid parameter.

Even if we use the parameters of fw to adjust the pitch and yaw in the rotor state, I worry that the same parameters are not applicable to the control of pitch and roll in the fixed-wing state.

The control gain in fixed-wing mode may be different from the control gain required in rotor mode, right?

Yeah that is indeed a limitation of the current implementation. Do you have an airspeed sensor on your drone? Because that should help in making the transition smoother, as it will automatically adapt the elevon deflection depending on how much airspeed you have.

@xdwgood
Copy link
Contributor Author

xdwgood commented Feb 27, 2020

Do you have an airspeed sensor on your drone?

yes,I have.....Your suggestion is that I continue to use FW for rotor attitude control, right?

@sfuhrer thanks 😃

@sfuhrer
Copy link
Contributor

sfuhrer commented Feb 27, 2020

Do you have an airspeed sensor on your drone?

yes,I have.....Your suggestion is that I continue to use FW for rotor attitude control, right?

Well yeah if it works with the FW rate controller then I would for now use that.

But I don't want to discourage you from any software changes, it could e.g. be that your proposed change of using the MC rate controller for the control surfaces in hover makes more sense that what there is currently, but to bring in this change in PX4 upstream we would need to be able to compare the flight performance prior/after.

@stale
Copy link

stale bot commented May 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 May 30, 2020
@xdwgood
Copy link
Contributor Author

xdwgood commented May 30, 2020

keep

@stale stale bot removed the stale label May 30, 2020
@dagar
Copy link
Member

dagar commented Aug 18, 2020

Closing because the fork disappeared. @xdwgood can you open a new PR with a valid fork if this is still relevant?

@dagar dagar closed this Aug 18, 2020
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.

3 participants