-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
Phase lag pre-arm check #27068
Phase lag pre-arm check #27068
Conversation
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.
maybe go to 1.0 so it passes with quad multi-src with 1:4 ratio?
669a513
to
0db55a2
Compare
After discussion with @lthall we decided f/sqrt(nsources) was a suitable compromise in terms of pre-arm check. Adjusting attenuation unfortunately is unlikely to make enough of a difference. |
15aaabf
to
69451bd
Compare
I'm surprised about this. At zero attenuation there should be no phase lag. I wrote a little test to check this out and got this: |
c941739
to
984edff
Compare
So Flytrex has pretty conclusively proved for me that 1/nsources is harmful. They flew on an X8 with notch-per-motor and saw oscillation at F/8 on their current tune because the noise was too high. F/6 also showed significant noise, whereas F/4 showed really good attenuation and good control on their existing tune using a single notch. So as a pre-arm check 1/sqrt(nsources) is definitely the way to go. This is also proved by my existing autotest. |
I have a feeling this is a problem because Quicktune is resulting in dangerously small gain margins that are then made unstable by any increase in phase lag. Also true for manual tunes that are too tight but the Quicktune algorithm will make that the "recommended tune". I think it is silly to have prearms to warn people about sensible parameter settings. All these things eat into flash space, support time and developer time. |
Another thought. If we are going to be adding a pattern where we put in parameter pre-arm checks that are triggered by sensible parameter settings and then expect the user to turn off each check with an options bit, maybe we should set up a specific structure for that. This is sort of a new category of "sanity check" where we have changed a parameter so we want to force the pilot to achnolage that they understand the risks of what they have done and have taken appropriate action to mitigate the risk. In this case it is: - You have turned on additional notches so your tune may become unstable. |
This is great testing to show why we don't want this PR. Do we have any real life testing and logs to show that we need this check? |
Flytrex now have a decent tune with F/4 - so I pretty much conclude that we should close this PR. |
Made a separate PR for discussion so as to not hold up #26674
@tridge your original suggestion was
bw > 0.75*freq/nsources
, I assume that was a typo because that will break the configuration of all 14 of my copters that are using this feature very successfully (and for which this feature was originally written) 😄 I have changed that tobw * 0.75 > freq/nsources
which at least does not break many existing configurations but it does not work on octacopters. It is impossible to get the octacopter test to pass with this setting which was my original concern with having any check like this - it simply does not filter enough noise. My suggestion therefore is either to make this a warning or simply clamp the check at f/4. Either way much discussion and testing required!