Hello UAV enthusiasts,

I recently created a slide deck on the topic of sensors for attitude estimation (i.e. gyroscopes, accelerometers and magnetometers). In these slides, I review

  1. Installation considerations,
  2. Stochastic models,
  3. Bias characterization,
  4. Sensor calibration, and
  5. Conceptual models.

The methods and concepts contained in these slides have been "battle tested''. That is, these are the methods and concepts I used while developing a lightweight autopilot system for UAVs. I hope you find some of this material useful. These slides were part of a graduate course titled "Control of Marine and Aerial Vehicles".

All the best,

Matthew

silic_uav_sensors.pdf

Views: 502

Comment by robert bouwens on March 23, 2019 at 12:34am

thanks for sharing!

a lot to read ...

Comment by Curt Olson on March 23, 2019 at 6:44am

Hi Matthew,

Nice explanation of the important issues with our UAV sensors.

I work for Prof. Gebre (listed in your references) at the U of MN UAV lab.  For attitude determination we primarily fly a 15-state ekf he published a few years back.  This EKF models accel and gyro biases and does not use a magnetometer (good or bad depending on your use case.) I have been experimenting with some calibration ideas that trust the results of the EKF.

1. We log IMU temp and Accel biases.  Then in post process over the course of multiple flights, we can biuld a temperature calibration fit for each individual IMU.  The fit improves and spans a wider and wider temp range the more we fly.  This is probably not as good as a lab calibration in some respects, but it does yield a helpful improvement over accels that are only calibrated at a single temp.

2. Similarly, we can compare the ideal magnetometer vector (computed from EKF attitude and the NOAA world magnetic model) versus the raw sensed magnetometer vector.  Again we can log those values and later do a fit.  I've found that that the fit is generally pretty tight and linear in each axis.  The advantage of this style mag calibration is you are calibrating at typical flight conditions and throttle settings.

It's extra work to post process the flight data, update the fit, and push that back to the aircraft, but it seems to work pretty well.  At some point I'd like to experiment with building this functionality directly into our in-house autopilot so the system would self calibrate as it flies.  All of this hinges on trust in our 15-state EKF.

Comment by robert bouwens on March 23, 2019 at 8:28am

the 15 state ekf did cause some disappointing results in comparison with the px4 ekf.

if it starts raining again i will redo some of my tests - hopefully with a double precision fpu.

6 axis sensor fusion is ok as the mag do tends to disappear.

Comment by Curt Olson on March 23, 2019 at 9:00am

The UMN 15-state EKF requires changes in velocity (from the perspective of the gps) in order to for the heading to converge without mags.  It really works well for fixed wing flight (higher dynamic motion.)  For quads that spend much of their time hovering or for slow moving surface vehicles, often there isn't enough change in velocity for the EKF heading to converge well during the flight.  I developed a conformal hud overlay system to help evaluate the quality of an EKF and the flight control system.  We don't generally fly pixhawk, but I was given a couple data sets a while back.  My overall impression was that the px4 ekf also performed well.  The px4 datasets had drop out issues due to running with the stock (crappy/slow) sd card.  That seemed to only be a data logging issue that was largely resolved with an sd card upgrade.
We've found that our EKF filter runs identically with 4-byte floats versus 8-byte floats as long as we store position (lon, lat) with double precision floats.

I have a love/hate relationship with mags!  They are subject to so many various sources of interference that will pull the ekf solution away from truth.  Things like throttle changes can't be easily calibrated out on the ground.  So in many ways they help the system to be converged right out of the starting gate, but then over and over I see that they converge to not quite the right answer because the mag calibration is never perfect and always tugging the solution away from the truth.

We have a variant of our UMN EKF that incorporates mags so I've played with that a bit.  For fixed wing flights I ended up preferring the original non-mag version.

The px4 ekf seems to have deweighted the mags quite a bit so in flight they don't have much affect, but after landing, you can see the attitude estimate slowly drift off to align with the mag calibration which again is easy to be 10-20 degrees off.

I've posted this before (so apologies for that) but here is an example of what I'm talking about.  This is the UMN 15-state EKF solution being drawn over the top of action-cam video.  The horizon shows how well the pitch/roll estimate is doing (it's not perfect.)  I also draw sun/moon/shadow markers which can help show the accuracy of the heading estimate against real world objects (truth?)  Also I'm drawing what the flight control system is trying to do which in this case is an auto landing:

https://www.youtube.com/watch?v=Su3sL4JhcQc

I haven't seen anyone do anything similar with the px4 or arudpilot ekf ... might be interesting to see a comparison?

A lot of this boils down to use-case.  I'm not trying to sell our EKF to anyone here, I just find it interesting to talk about and compare and contrast, and wanted to add a comment about some of my experiments with in-flight calibration based on trusting our 15-state EKF.

Comment by robert bouwens on March 23, 2019 at 1:03pm

yes, it doesn't look bad.

i have clue what would be good and in contrast bad.

https://www.youtube.com/watch?v=XqQCbkncVYI

i prefer simpler things.

using a milled cube and turn it fast on a granite table.

that's always interesting to watch and easy to do.

and doing so the 15 state ekf failed as i mentioned.

it took to long to recover.

i am not using paul riseborough's ekf but the older one :-)

Comment by Matthew Silic on March 23, 2019 at 4:40pm

Hey Curt,

The YouTube video you posted looks amazing! I like how the flight trajectory stays up on the HUD. So you use temperature-dependent calibration coefficients? I've never tried to capture the temperature-dependence. I've always assumed the temperature doesn't affect the calibration too much, but I've never verified that assumption. Any idea on how much error the temperature might introduce into your attitude estimate?

I totally get the love/hate relationship with mags! I have yet to rely on a magnetometer during a flight test. Because I work exclusively with fixed-wing vehicles, the course-over-ground (cog) readings from the GPS seems to suffice. However, like you said, that isn't an option for hovering vehicles or sluggish surface vehicles.

Although I haven't used the magnetometer in the air, I've gotten it to work on the ground, while mounted in the vehicle. I can typically get the error in the estimated yaw angle to be under 3 degrees, which is sufficient for my needs. In order to get this accuracy, two key steps are needed.

First, the calibration procedure must correct any misalignment between the magnetometer and the accelerometer.  A lot of calibration procedures simply map the uncalibrated magnetometer readings to a sphere; because these procedures do not correct for mutual misalignment, the estimated yaw angle can be quite inaccurate. The Dot Product Invariance (DPI) method that I mention in the slides does correct for mutual misalignment. As such, the DPI method can be used to calibrate the magnetometer for use in navigation systems.

Second, the DPI method needs to be supplied with many, accurate observations of the reference down direction. Through trial and error, I found a reliable source, namely the downward direction as estimated by the attitude estimator. We estimate our attitude using the Mahony Filter. The Mahony Filter fuses gyroscope and accelerometer readings to maintain an accurate earth-to-body rotation matrix. The last column of this rotation matrix provides me with the reference direction I need for magnetometer calibration.

There are two advantages for using the third column of the rotation matrix. First, because the reference vector is fused from gyroscope and accelerometer readings, the vector is less sensitive to errors in the accelerometer. Second, because the vector is measured using the onboard IMU, I can calibrate the magnetometer by rotating the vehicle by hand. It is especially important to calibrate the magnetometer in its final configuration on the vehicle. I think the gimbal system shown in the YouTube video posted by Robert is great for calibrating an isolated magnetometer. However, once that magnetometer is mounted in the vehicle, I would imagine the calibration would no longer be valid. 

Anyways, this response is getting long. I'll detail my procedure in a future post :) It's great to talk to fellow researchers in my field. Best of luck with your research, Curt!

Comment by robert bouwens on March 24, 2019 at 12:03am

hmm, mostly i use uncalibrated mag data!
the hmc5983 has a build in offset correction.

as the hmc5983 is available in homeopathic dosis i will dig in the dpi method.

i have used mahony in the past and try to avoid this kinda sensorfusion.

the internal pi controller uses a 2nd order correction which is a pain in the back when flying through turbolent zones.

Comment by Curt Olson on March 24, 2019 at 6:12am

Matthew, if this is at all interesting to you I would offer to run one of your flight data sets through my hud rendering system to see what happens.  Essentially what I do is mount an action cam somewhere on the airplane with as much of a clear view as possible, but some prop or airframe in the view usually isn't a problem.  The camera can point just about anywhere as long as it's mostly in the direction of one of the major axes.  Press record on the video camera, go fly (logging GPS and high rate IMU data.)

For the first time, I also need to do a camera calibration which involves taking dozens of pictures (or a minute or two video) of the standard checkerboard pattern used for lens calibration.

Pretty much everything else is automatic after that.  (Some of the extra stuff I draw comes from my particular data file format, so there could need to be some juggling with data file formats.)

The videos don't show anything that's not already in plots from the data logs, but seeing things from a first-person perspective in real time can be enlightening.  Creating videos of my own flights has led to a lot of thinking, investigation, learning, tweaking, and tuning.

Also, hopefully no one thinks I'm trying to pass myself off as an expert here.  I don't have the math background to sit down and derive a kalman filter from scratch.  But I've been flying and working with this same 15-state EKF for more than 10 years now so I've built up quite a trust in what it does or doesn't do.  Anyway, I'm also enjoying the discussion, and if any of the tools or tricks I've developed can help out your efforts, I'm happy to offer them up.  (All our lab code is published with the MIT open-source license.)

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service