-
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
sensors: Apply bias computed during gyro zeroing regardless of BiasCorrectGyro setting. #2249
base: next
Are you sure you want to change the base?
Conversation
Thanks a lot for this glowtape |
build artifacts please |
Code looks okay in isolation. I'd like to take some time to read surrounding areas to consider how it interacts. |
Artifacts built, by request of @tracernz |
Our attitude filter does compute the bias. What's curious is that you said that without this patch, but BiasCorrectGyro enabled, it'll snap in place when arming. I wonder if also needs to run when disarmed, so that it can settle during power up already. |
@fxbisto Please see what this change does. |
Sure thing, would you like another vid of results or just a written report? |
I went ahead and did another screengrab video with commentary anyway :P |
I suppose I have to try something else. Probably put the zeroing in sensors.c. |
What's happening to cause perfect |
IDK. I'm gonna set up a fake gyro bias on a test board tonight and see what happens. |
Sussed it!
In this case the new values are applied when we're arming, ready for when we get to ARMED state.
Otherwise the first arm will not be accurate. A power-on arming grace period seems sensible in this case, what do you think? |
What is your thoughts on my arming delay idea? Is this is sensible place to put it? Should I make it a private SYSTEMALARMS case? |
Not a fan of a delay. I'll investigate doing a simple calibration in sensors.c. |
Okay, no issue. 8 Seconds seems plenty long enough by the time an FPV pilot would have plugged in a battery, placed the copter & lowered their goggles, but I can appreciate it could be frustrating for a LOS pilot. |
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.
Issue rectified.
Bias correctly calculated first time, every time; even when you arm before BLHeli tones finish - regardless of ArmTime.
Right on the money :)
Glad to hear. I'm still trying something else. The artificial horizon still takes some time to settle here with fake bias injected, trying to get it to converge faster. Some bits of the code are 6-8 years old, and that stuff isn't my forte. |
I would hazard a guess that's to do with the 7 seconds accelerometer convergence in attitude.c I tried the grace period for. The GUI seems to take accurate accelerometer readings in under 2 seconds, perhaps you could simply speed that portion up? Attitude.c:Ln:597 The artificial horizon isn't something I use personally, but I know a lot of people who do. |
I snuck out and put a few packs into testing this today, reviews-wise it's only good things from me. |
Do you need another tester for this? Looks like it's ready for showtime. |
It still needs a tiny fix and another round of testing from me. Gonna implement it later today and test it tomorrow. |
6ec7c5b
to
e1489da
Compare
The inflight bias correction doesn't seem to gel with acro flight and noisy quads, so it's worthwhile attempting to disable it. There's a few reported instances where a quad gains a permanent bias.
I have the same issue over here on mine. It doesn't do it when hovering, but when doing acro, at the end of a session, there's a considerable bias. Can be handled in rate, but entering leveling, it tilts considerably as result. With BiasCorrectGyro disabled, everything is fine here.
(Betaflight seems to deal with this by disabling the integrator beyond certain angular rates. Might be worthwhile to explore.)
However, turns out that the gyro zeroing stops working with the setting disabled. So if you have a screwy gyro with a permanent offset, you're SOL.
This captures the bias up until the quad goes armed, then applies the last known value, if BiasCorrectGyro is disabled but gyro zeroing desired. Also disables the GyroBias warning (not sure how I feel about this, a gyro shouldn't have say 30°/s offset).