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

Scripting: implement a tilting rudder as a lua script #21148

Merged
merged 4 commits into from Mar 6, 2023

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Jul 8, 2022

For vehicles with rudders on tilting motors, which should be fixed wing rudder in fwd flight and VTOL rudder in hover

@IamPete1
Copy link
Member

IamPete1 commented Jul 8, 2022

New bindings work great in this use case. My concern would be that someone tries to use them in another case. They will be nonsense in fixed wing flight just never updating and they bypass the spool logic. As I say this case is fine, but if someone were to implement a mixer with motors they would probably have a bad time.

We do have the servo output functions for rate output, but they only include feed forward. We could add some that are feed forward and rate I guess. But again If someone were to use them for motors they would probably have a bad time.

You could calculate the yaw output from the motor pwms. But that is a fair bit of extra effort.

I would like to include control surfaces and tilting motors into the/a quadratic programming mixer eventually. Such scailing as this would just fall out of the maths.

@IamPete1
Copy link
Member

Recently used this on a tilt-rotor copter, worked great. There are a couple of things it needs. Firstly I had to grab average throttle to do thrust scaling, as a hack I was able to grab throttle from the boost motor servo output with a scale of 1. So a binding for get_throttle_out and get_throttle would solve that. Also had some issues with ground resonance I think that could be stepped on by abiding spool state with get_spool_state. Harder is the limits to prevent I term wind up, need some way to set the limit flags from scripting asynchronously.

Copy link
Member

@hendjoshsr71 hendjoshsr71 left a comment

Choose a reason for hiding this comment

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

We should consider getting the bindings at least into 4.3 for this.

@IamPete1
Copy link
Member

I think this needs limit flags, throttle and spool state. I have added here: https://github.com/IamPete1/ardupilot/tree/tilt_rudder%2Bthrottle%2Blimits

Throttle, forward and lateral are needed for doing motors. As its spool state: 0faa6c9

Limit flags prevent integrator windup: 64f96a4 cba55c3

@tridge
Copy link
Contributor Author

tridge commented Mar 3, 2023

@IamPete1 I've incorporated your additions in this PR

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

I think this looks good, but then again 3/4 of the commits are mine. ;)

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

Successfully merging this pull request may close these issues.

None yet

5 participants