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.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    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.
    Information about this domain - Nidoma
  • Developer
    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

  • 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
This reply was deleted.

Activity