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

Plane: tiltrotor: add throttle scaling for vectored yaw #22376

Merged
merged 1 commit into from Dec 19, 2022

Conversation

IamPete1
Copy link
Member

This adds throttle scaling to vectored yaw tilt-rotors. It uses the same scaling method as tailsitters. There scale range is hard coded to the same as the default range for tailsitters (where we have parameters for min and max). So will reduce gains to half at high throttle and double at low throttle. At hover throttle they remain 1 so no change in behavior. We may want to change the max scale factor to 1 so gains are never increased at low throttle, thus making oscillation unlikely. Only yaw is scaled, the roll input used at high tilt angles is not changed.

It also now sets the yaw limit flags if either tilt is at its limit, this prevents I wind up.

https://youtu.be/W760-G-N7_I

// Scaling yaw with throttle
const float throttle = motors->get_throttle_out();
const float scale_min = 0.5;
const float scale_max = 2.0;
Copy link
Member Author

Choose a reason for hiding this comment

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

We could change this to 1 for more conservative scaling that would not increase gains at low throttle.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is worth noting that these scaling factors were trailed using a lua script on a vehicle with thrust vectoring for yaw and were found to work well for a range of thottles (climbing and descending yaw manouvers in stabilise) so this scaling range does appear appropriate.

ArduPlane/tiltrotor.cpp Outdated Show resolved Hide resolved
ArduPlane/tiltrotor.cpp Outdated Show resolved Hide resolved
ArduPlane/tiltrotor.cpp Outdated Show resolved Hide resolved
@IamPete1
Copy link
Member Author

Rebased, now using const throttle and requires both tilts to saturate.

@IamPete1 IamPete1 requested a review from tridge December 14, 2022 12:07
@tridge tridge merged commit e5e96eb into ArduPilot:master Dec 19, 2022
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

4 participants