# Measuring airspeed without an airspeed sensor

Interesting post from the FlightGear blog via Curtis Olson:

## Motivation

Air France #447

On June 1, 2009 Air France flight #447 disappeared over the Atlantic Ocean.  The subsequent investigation concluded “that the aircraft crashed after temporary inconsistencies between the airspeedmeasurements – likely due to the aircraft’s pitot tubes being obstructed by ice crystals – caused the autopilot to disconnect, after which the crew reacted incorrectly and ultimately caused the aircraft to enter an aerodynamic stall from which it did not recover.”  https://en.wikipedia.org/wiki/Air_France_Flight_447

This incident along with a wide variety of in-flight pitot tube problems across the aviation world have led the industry to be interested in so called “synthetic airspeed” sensors.  In other words, is it possible to estimate the aircraft’s airspeed by using a combination of other sensors and techniques when we are unable to directly measure airspeed with a pitot tube?

## Basic Aerodynamics

Next, I need to say a quick word about basic aerodynamics with much hand waving.  If we fix the elevator position of an aircraft, fix the throttle position, and hold a level (or fixed) bank angle, the aircraft will typically respond with a slowly damped phugoid and eventually settle out at some ‘trimmed’ airspeed.

If the current airspeed is faster than the trimmed airspeed, the aircraft will have a positive pitch up rate which will lead to a reduction in airspeed.  If the airspeed is slower than the trimmed airspeed, the aircraft will have a negative pitch rate which will lead to an acceleration.  https://en.wikipedia.org/wiki/Phugoid

The important point is that these variables are somehow all interrelated.  If you hold everything else fixed, there is a distinct relationship between airspeed and pitch rate, but this relationship is highly dependent on the current position of elevator, possibly throttle, and bank angle.

## Measurement Variables and Sensors

In a small UAS under normal operating conditions, we can measure a variety of variables with fairly good accuracy.  The variables that I wish to consider for this synthetic airspeed experiment are: bank angle, throttle position, elevator position, pitch rate, and indicated airspeed.

We can conduct a flight and record a time history of all these variables.  We presume that they have some fixed relationship based on the physics and flight qualities of the specific aircraft in it’s current configuration.

It would be possible to imagine some well crafted physics based equation that expressed the true relationship between these variables …. but this is a quick afternoon hack and that would require too much time and too much thinking!

## Radial Basis Functions

From a practical perspective, I don’t really need to understand how radial basis functions work.  I can simply write a python script that imports the scipy.interpolate.Rbf module and just use it like a black box.  After that, I might be tempted to write a blog post, reference radial basis functions, link to wikipedia, and try to sound really smart!

## Training the Interpolater

Step one is to dump the time history of these 5 selected variables into the Rbf module so it can do it’s magic.  There is a slight catch, however.  Internally the rbf module creates an x by x matrix where x is the number of samples you provide.   With just a few minutes of data you can quickly blow up all the memory on your PC.  As a work around I split the entire range of all the variables into bins of size n.  In this case I have 4 independent variables (bank angle, throttle position, elevator position, and pitch rate) which leads to an n x n x n x n matrix.  For dimensions in the range of 10-25 this is quite manageable.

Each element of the 4 dimensional matrix becomes a bin that holds he average airspeed for all the measurements that fall within that bin.  This matrix is sparse, so I can extract just the non-zero bins (where we have measurement data) and pass that to the Rbf module.  This accomplishes two nice results: (1) reduces the memory requirements to something that is manageable, and (2) averages out the individual noisy airspeed measurements.

## Testing the Interpolater

Now comes the big moment!  In flight we can still sense bank angle, throttle position, elevator position, and pitch rate.  Can we feed these into the Rbf interpolater and get back out an accurate estimate of the airspeed?

Here is an example of one flight that shows this technique actually can produce some sensible results.  Would this be close enough (with some smoothing) to safely navigate an aircraft through the sky in the event of a pitot tube failure?  Could this be used to detect pitot tube failures?  Would this allow the pitot tube to be completely removed (after the interpolater is trained of course)?

Synthetic airspeed estimate versus measured airspeed.
Zoom on one portion of the flight.
Zoom in on another portion of the flight.

## Source Code

The source code for this experimental afternoon hack can be found here (along with quite a bit of companion code to estimate aircraft attitude and winds via a variety of algorithms.)

## Conclusions

This is the results of a quick afternoon experiment.  Hopefully I have showed that creating a useful synthetic airspeed sensor is possible.  There are many other (probably better) ways a synthetic air speed sensor could be derived and implemented.  Are there other important flight variables that should be considered?  How would you create an equation that models the physical relationship between these sensor variables?  What are your thoughts?

Views: 3420

Comment by Curt Olson on December 16, 2016 at 11:00am

Hi Paul, I'm definitely playing with (mostly fixed wing) drone stuff and using commodity sensors like mpu6000, ublox6 (or 8), eagletree pitot probe, etc.  And you are right that all the aircraft flight logs I've pushed through this process are electric powered.

Developer
Comment by Ryan Beall on December 16, 2016 at 12:29pm

This is essentially MIMO sys ID of airspeed.  Creating a S-domain equivalent would likely be mathematically simpler. Cool idea.  The EKF airspeed  estimator on APM is also an out of the box solution that is working pretty well.  We have used the synthetic airspeed measurement for some time now on a dropped glider that doesn't have room for the sensor.  It might be interesting to do a MIMO model in matlab for airspeed.  If I get time I might try it and see how much cleaner it might be.  Cool part would be that it could be implemented in like 10 lines of code on APM.  Down side is that it's still got to be post processed in matlab for every vehicle.  The EKF estimator does it online real time without having the need for truth data.

Comment by Andrew Rabbitt on December 17, 2016 at 1:44am

Curt said:

If you could condense your suggestion down to a sample formula, maybe I could test it out now that I have the code and infrastructure in place to run this on sample flight data.

Curt, If you could try re-running the RBF training with only three independent variables of vertical acceleration (perpendicular to thrust vector, if possible), pitch rate and elevator position it would be very interesting to see how well that correlates.

As far as the high-speed fidelity, it may be a limitation because the difference in angle of attack becomes very small as speed rises - i.e. your signal will shrink rapidly as a 1/x^2 function.

Comment by Andrew Rabbitt on December 17, 2016 at 3:59am

No Bojan, this has nothing to do with INS.

Moderator
Comment by Gary Mortimer on December 17, 2016 at 6:08am

Great as ever Curt

Comment by Curt Olson on December 17, 2016 at 8:38am

Andrew: when you suggest using vertical acceleration perpendicular to the thrust vector, are you essentially describing the z axis of the accelerometer in the body coordinate frame?  If I do that, not a whole lot changes in practical terms ... the fit remains pretty good at the low end of the speed range, and completely loses all fidelity in the upper part of the speed range.

Bojan: my experiment depends on observing that the aircraft responds differently to control inputs at different airspeeds.  We pick some parameters that include the important control inputs (elevator, throttle) and the response (pitch rate, airspeed), then feed this to some sort of interpolater.  Then in future flights we can hopefully feed these parameters into the interpolator and have it spit back an estimated or synthetic airspeed.  My initial model does use bank angle as one of the input parameters so yes, if I continue to use that as a parameter, then the EKF accuracy is important.  But I did try Andrew's suggestion which removes any EKF/GPS dendency and that also produces fairly plausible results on the slower end of the speed range.

Because of incidents like air france flight #447 and others, the aviation industry is interested in finding accurate ways to measure airspeed without needing to put a pitot tube out in the airstream and potentially have it subject to blockage by ice, water, insect nests, forgetting to take off the remove before flight cover, etc.  There are much smarter people than me working on this.  I'm not claiming any special knowledge, I was just thinking about the problem one afternoon and thought it would be interesting to try a little experiment with flight data I have on hand.  I wrote a little blog entry, Chris picked it up and reproduced it here.  If it gets people interested in the subject, then discussion happens, and maybe better ideas emerge that would work reliably in emergency situations.  That would be great.  And either way, the aviation industry is already pursuing this and probably way ahead of anything we are talking about here.

Comment by Paul Schreiber on December 17, 2016 at 11:55am

Hey Curt,

your observation that the aircraft is responding differently to your control inputs, and than the link with this tragic accident is exactly what got me thinking about this years ago. And no matter if its a model or a full scale airplane, a good pilot has some kind of estimated airspeed controlling the aircraft (And it is the same for a car, boat... the human has to adjust and its control outputs) And the capability of the pilot is in my opinion highly connected to this feeling and understanding of the aircraft.

I also discussed this with other people on a chair of flight dynamics I was an assistent. But the feedback was poor and we agreed its a complicated issue. So my comment "genious" is not without reason.

I guess you have achieved something great.

Comment by Jack Crossfire on December 17, 2016 at 7:10pm

It's basically a flight simulator which uses machine learning instead of aerodynamics & newton's equation.  The reason airliners can't use a flight simulator to double check their instruments is the amount of certification required to upgrade anything.

Comment by Andrew Rabbitt on December 17, 2016 at 10:48pm

Interesting result Curt.  I suspected that high speed may still be an issue.  If you added throttle position/motor power and propeller speed, you may improve the accuracy at the high end by giving it a signal it can work with. Unfortunately, prop speed is less than easy to generate with the current hardware - not impossible though.

I think with the prop speed and power though, you will have to add in an air density variable.  Have a look at the Selig/UIUC maths behind all their propeller test work here

Comment by Paul Schreiber on December 18, 2016 at 3:45am

@Jack C., I fully agree that all the certification issue will slow down the implimentation of such an airspeed tool... and probably will recieve lots of criticism.

@Andrew R. , the air desity is a good point. But this will be more or less importent to compensate any force that is generated aerodynamicly on the aircraft, I guess. But I think it could be estimated well by the altitude sensor. And prop revs are no problem if you use the right brushless ESC, isn´t it?

Comment

Join DIY Drones

1

2

3

4

5

6

7

8

9

10

## Groups

15 members

82 members

24 members

9 members

• ### ESPrtk -High quality RTK…

9 members

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