-
Notifications
You must be signed in to change notification settings - Fork 167
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
Flight: Add CF Accel Cutoff (Experimental - Not for merge) #2252
base: next
Are you sure you want to change the base?
Conversation
build artifacts please |
Artifacts built, by request of @tracernz |
I need to test some other attitude changes this weekend, I'll slap this on, too. |
Awesome, I'll get involved too. Now that I've seen how it can fly without the constant gyro biasing it'll be a good comparison. Probably won't be for a couple of days |
Just did a living room hover test. The 0.1 default in this patch is definitely too low. It never gets the chance to debias and I think it even started drifting a bit more. 0.25 works in the living room. |
So I went just flying a pack outside, with fake gyro drift and BiasCorrectOn and 0.25 cutoff. At the end, there was still a bit of unnecessary gyrobias, based on the tilt in leveling, but it was reduced a lot compared to before. So this is worthwhile to explore. |
That’s a great start. I think we need to tune the cutoff for the smallest value that works in hover, then see what happens in fast forward and acrobatic flight. I don’t know if I’ll get to this this weekend or not.... |
The origin of that idea/code is GPL 3.0, for reference. https://github.com/vedderb/QuadcopterSystem/blob/master/LICENSE |
Added the accelConfidence factor to the AttitudeActual UAVO for analysis purposes. |
We played with this exact idea before --- I cannot find the pull request. Consensus was that it didn't work (at least how I tuned/implemented it). Would love for that to be wrong / for gating attitude updates to make sense. |
jenkins, build artifacts please |
jenkins, test this please |
Artifacts built, by request of @mlyle |
This PR adds an accel cutoff to the complementary attitude filter. It's purpose is to prevent the bias calculations from running away when the aircraft is subjected to flight loads above and below 1 G.
There is a new UAVObject, AccCutoff, in the attitude settings that defines how sharp the cutoff is. It defaults to 0.1. An accel confidence factor is calculated from the cutoff and current magnitude of the accel vector. The accel confidence ranges from 0 to 1, and is multiplied against accKi and accKp, effectively freezing the bias terms during dynamic maneuvering.
This has not been flight tested. On the bench it does not do anything strange. Comments and flight test help appreciated. I used this concept on a different project quite a few years back. It seemed to work as desired. But as always, test carefully.