-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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: fast attitude recovery for quadplanes #29498
base: master
Are you sure you want to change the base?
Conversation
bb03367
to
8674077
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This effectively recovers as it would in Q-Assist in a fixed wing flight. One issue I have seen on a real vehicle is that the fixed wing angle controllers have a bad time unusual attitudes. A vehicle got into a inverted spin and was no able to recover in Q-Assist. The issue was three fold, it was oscillating about roll +-180 and could not decide which way to go. The fixed-wing controllers hard limit angle error so the error was not building the longer it was upside down (as it would in the VTOL controller), so it never tried that hard to recover. The VTOL rate controller I terms are also relaxed in assist so again it was never trying that hard. In that case we were able to switch to a VTOL mode and have it recover quickly (although not quite quick enough to prevent the crash).
One advantage of this method is that we can say that it is not anything that the vehicle would not do in Q-Assist so were not in any more risk of overloading the vehicle that we would be in that case.
One disadvantage is that the user may be trying the VTOL mode because Q-Assist may have failed to recover, in which case it makes sense to try a different approach.
8674077
to
45332e5
Compare
my preference is to apply this method with those limitations and work on improving the fixed wing attitude controller to better cope with these scenarios. |
fa7d655
to
314daa5
Compare
@IamPete1 I've added in the attitude control method as discussed, plus the indecision change for the FW roll controller |
need to do testing on some real quadplanes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see testing on a motor always on tailsitter like the swan H1 in realflight.
need to test the HWing in RealFlight |
I have tested in RealFlight. Flies fine. Inverted mode doesn't work, but also doesn't work in master. I also found a bug where if you disarm in a fwd flight mode in an all motor tailsitter the motors don't stop! That bug is in master |
ensures we can recover from inverted flight quickly
when we start the VTOL motor stabilisation with an attitude beyond normal attitude limits we set a flag to use fixed wing attitude control (slaving VTOL rate control to fixed wing rate control) until we have recovered this avoids an issue with the shaping in the VTOL attitude controller and also fixes an issue with the VTOL controller bringing the nose down, which can cause a lot of height loss in quadplanes
we use input_rate_bf_roll_pitch_yaw_no_shaping to avoid input shaping when slaving the VTOL rate controllers to the fixed wing rate control this allows for much faster recovery in Q-assist
when we are close to a 180 degree error, go with the last direction if we are in a 40 degree angle wedge of 180 degree error
during forward transition of tiltrotors we use the VTOL attitude controller until min airspeed is reached. This fixes the FW rate controllers to be slaved to the VTOL controller for that time
7a569e4
to
c9adcc8
Compare
if we are forcing recovery then don't use yaw control override
c9adcc8
to
7aae436
Compare
@IamPete1 I have been testing recovery using the Griffin model in RealFlight. I'm getting some strange results. One is that when I switch to QLOITER the aircraft doesn't slow down. For example: log here: https://uav.tridgell.net/GriffinTest/00000042.BIN |
@IamPete1 this is another one that worries me: |
We do have the transition pitch limit stuff, it works in all modes but is only likely to be noticeable in Q_LOITER, the key function is It does concern me for 4.6 that this is getting more and more complex. |
I had another thought, we should update |
I looked at that, but it was set to 3000 ms, yet, the pitch was limited to under 2 degrees for more than 25 seconds.
yes, I have that change pending |
This is a rework of #28320 which uses the fixed wing attitude controller for recovery instead of modifying the VTOL controller. This gives much faster attitude recovery and also avoids an issue with the way the quaternion controller may try to pitch down while inverted, leading to a large amount of altitude loss
This approach builds on the way we already use the fixed wing controller during forward transitions, so it is very little code change, and testing shows it produces a very small amount of altitude loss (eg. in the autotest the alt loss is usually around 2m from fully inverted)