-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Yaw/Altitude estimation sensor fusion #9387
Conversation
9faadff
to
2a85a6a
Compare
add acc vibration to blackbox adjustments in imu cog minor fix on blackbox
@shota3527 I firstly ran some tests with the quad having the magnetometer enabled, using this software... It performed Poshold, RTH and a WP mission as expected.
(Edited : Fixedwing navigation is now improved, as seen below) I can't help wondering if adding the |
I was only thinking about using velocity for altitude, z, control. FW uses heading for xy control which I guess is just xy velocities resolved to a direction in the end. How did you switch the compass off for the multirotor tests, in flight switch or disabled when disarmed ? I assume if you disable it when disarmed you need to fly at speed briefly after arming before using Nav modes ? |
I have tried tuning the
Yep.. It was turn off before the flights.. And once armed, it acted just like a fixedwing. Requiring a min GPS speed before the yaw heading registered. |
@shota3527 You were right.. The Position and Heading controllers were receiving stale data most of the time. The Airplane has a magnetometer installed to take advantage of these software changes. nav_fw_control_smoothness = 6 With these ones being tuned to suit the changes. (for this plane anyway) nav_fw_pos_z_p = 48 |
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.
As I said on discord, AHRS now goes from a "projection in the horizontal plane to get a yaw" to a 3D fusion (Which is the most correct for aerial vehicles).
I'm happy with these improvements occurring, thanks @shota3527 for the PR, and also thanks to @Jetrell for the tests performed...
In my opinion this is ready to be merged!
This PR still separates baro and AHRS. i think it should be better to not use position estimator data in AHRS calculation |
Added a fade out to ignore baro to prevent similar issue in Still need to test if a similar issue happens when posEstimator.gps.epv is near the positionEstimationConfig()->max_eph_epv |
Revert `inav_w_z_baro_p`, `inav_w_z_gps_p`, and `inav_w_z_gps_v` to the defaults from INAV 7.0. Changed in #9387 Altitude estimation is less accurate with the new 9387 settings.
Revert `inav_w_z_baro_p`, `inav_w_z_gps_p`, and `inav_w_z_gps_v` to the defaults from INAV 7.0. Changed in iNavFlight#9387 Altitude estimation is less accurate with the new 9387 settings.
With horizon drift fixed. now the biggest threat is unreliable compass/baro added with some accelerometer/gyro vibration
These two sensor needs some extra caution. And sometimes hard to make them work as intended due to various reasons. Sensor failure can easily lead to flyaway
Barometer can also fail due to temperature/moisture/static electricity. A example of a baro faliure:
https://fb.watch/nTQduITxRo/
I personally have three outdoor hand watches, and the baro failure rate is 50%-100% in my mountaineering activities.
GPS is a preferred data source, our model can not make its way home without it
inav_w_z_gps_p
,inav_w_z_gps_v
from 10% to about 40% of the horizontal gain. should improve skyrocket issue on quad. BTW GPS is about 3 times more accurate horizontally than verticallyaccvib
into black box loginav_w_xyz_acc_p
Tested on bench with a real FC and in SIM
https://youtu.be/5jrwQeegBQ4
Indoor altitude hold hover test with baro is working
Thinking about whether a filter on the compass is needed or not -> not needed in a reasonable compass placement
How to test
GPS is required, please share your experiences with Blackbox log if possiable
yaw part
Calibrate the compass the way you like and have a look at the measured magnetic filed XYZ in the configurator sensor tab in different orientations of the quad/airplane. A li-ion pack can throw the values completely off.
Enable the compass first, it should have some improvements in yaw estimation since GPS data is introduced and dynamic weight adjustment on the compass is introduced.
And try compass-disabled flying. do some cruising to get an estimation first, followed by some acrobatics to try to confuse GPS yaw estimation