# Anyone compute actual airspeed with an ardupilot?

I've been looking a bit at the ardupilot firmware and as best as I can tell, no where does the code compute an actual airspeed.

It appears that a pressure reading is taken when the autopilot is engaged, and then the system attempts to maintain that pressure value (without ever knowing what the actual airspeed of the aircraft is.)

Am I reading the code correctly?  Has anyone done any work to come up with a formula to compute indicated airpspeed from the raw ADC value?  Anyone have any tricks for calibrating the airspeed against some other truth source?

I have a couple things I can do, but my ideas so far are kind of unsophisticated.  Maybe someone's already been down this road and has come up with a clever solution or clever observation?  (like 1 kt airspeed == x units of ADC change???)  Is this even a linear relationship?

Thanks,

Curt.

Tags: airspeed, ardupilot, calibration

Views: 139

### Replies to This Discussion

There is a formula for that

q=1/2(pV^2 or V=((2/p)*q)^-2

V = veocity, q=dynamic pressure(pitot), p=air density
No it is nonlinear. And because it is nonlinear, it is real noisy around zero airspeed. The equation isn't hard, however it is still relative to how good the calibration is. You could write an algorithm to use gps and course over ground to back out the correction factor if you were so inclined using the wind triangles. Doug kept it simple beings it sort of doesn't matter anyway as long as you command speeds (aka pressures) that are well above stall.

Oh and another trick, you have to check to see if your pressure is negative before passing it through the squareroot equation or it will lock up the processor!

if (d_press < 0)
{
airspeed = -sqrt(-2*d_press*144/density); //airspeed in fps
}
else
{
airspeed = sqrt(2*d_press*144/density);
}

-Beall

Hi Ryan,

Where does the density value come from? "144" looks like a gain that is specifically tuned to our ADC range, correct? I'm having trouble downloading the data sheet for the MPXV5004DP ... do you have a rough max airspeed that this sensor tops out at?

Is this sensor temperature compensated?

My main goal here is to come up with a formula and calibrate the gains so that my airspeed is in the rough ball park of reality.

But what I'd also like is that whatever formula and gains I use and no matter how well it's dialed in and calibrated to reality, I want the reported stall speed to be the same on any day in any conditions. Can I expect this from this sensor?

In other words (based on my limited understanding of these things) if I fly my airplane at sea level versus 20,000' my true flying airspeed will be *much* different, but my indicated stall speed should be the same. Does that make sense? My primary goal is not so much to compute my "true airspeed", but to compute a consistent indicated airspeed value so my autopilot can ensure I am flying above stall speed (and then as a side benefit, I might as well calibrate the gains so the units are approximately correct on a standard day at sea level ...)

Thanks,

Curt.
Curt,

You are correct in your thinking. Indicated airspeed is really a measure of the dynamic pressure, which is what is important from an aerodynamic point of view.

Tom
The actual airspeed is computed in a couple places but in general we work with the pressure value. For airspeed hold you set the desired airspeed value in the header file by computing the equivalent pressure value. There are notes in the header file giving the equation.

It is simpler and faster to work with the pressure value for airspeed hold control and the only reason we compute actual airspeed anywhere is for turn rate estimation and telemetry.

1

2

3

4

5

6

7

8

9

10

## Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

8 members

182 members

15 members

50 members

247 members