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

Flight: Add CF Accel Cutoff (Experimental - Not for merge) #2252

Open
wants to merge 4 commits into
base: next
Choose a base branch
from

Conversation

jihlein
Copy link
Collaborator

@jihlein jihlein commented Apr 4, 2019

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.

@tracernz
Copy link
Member

tracernz commented Apr 4, 2019

build artifacts please

@dronin-ci
Copy link
Collaborator

Artifacts built, by request of @tracernz

@glowtape
Copy link
Member

glowtape commented Apr 4, 2019

I need to test some other attitude changes this weekend, I'll slap this on, too.

@fxbisto
Copy link
Contributor

fxbisto commented Apr 4, 2019

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

@glowtape
Copy link
Member

glowtape commented Apr 6, 2019

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.

@glowtape
Copy link
Member

glowtape commented Apr 6, 2019

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.

@jihlein
Copy link
Collaborator Author

jihlein commented Apr 6, 2019

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....

@glowtape
Copy link
Member

glowtape commented Apr 9, 2019

The origin of that idea/code is GPL 3.0, for reference. https://github.com/vedderb/QuadcopterSystem/blob/master/LICENSE

@jihlein
Copy link
Collaborator Author

jihlein commented Apr 10, 2019

Added the accelConfidence factor to the AttitudeActual UAVO for analysis purposes.

@mlyle
Copy link
Member

mlyle commented Jul 3, 2019

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.

@mlyle
Copy link
Member

mlyle commented Jul 9, 2019

jenkins, build artifacts please

@mlyle
Copy link
Member

mlyle commented Jul 9, 2019

jenkins, test this please

@dronin-ci
Copy link
Collaborator

Artifacts built, by request of @mlyle

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

Successfully merging this pull request may close these issues.

6 participants