How is airspeed computed by ArduPilot?

Hello, all! I’m new to this forum, so let me know if I’ve posted this in the wrong place.

I’m working on a project that will integrate a multihole probe into our glider, which uses ArduPilot on a Pixhawk 4. The purpose of the multihole probe, for now, is to help with post-flight analysis of wind gradients. However, to be cost and power efficient, we would like to combine our airspeed sensor with this multihole probe. As such, we will be feeding the Pixhawk 4 a synthesized signal from the probe as a one-dimensional airspeed measurement, as if the original sensor was never replaced. However, in order to do this properly, we need to know how ArduPilot handles the raw pressure differential measurement. For example, we don’t want to factor in the effects of air temperature on air density in our synthesized signal if the ArduPilot was going to do that anyway. I’ve been looking over the source code, and find references to a function get_airspeed(), which in turn references an object called state[], and I haven’t been able to go any further. I also found a section that reads in the raw air pressure from a pitot tube, but nothing so far on how or where that is processed. Thank you in advance!

1 Like

Hi Scott,

excuse me for not being able to help on your code-related question.

Regarding the suggested application, you might reconsider to use a common airspeed-sensor with T-tube connectors (splitting total and static pressure between the airspeed sensor and your MHP-sensors). An advance of such a straightforward approach would be the observability of your sensors and their (spectral) errors. In addition, you might benefit from all the efforts and insights of the community which uses “normal” airspeed sensors (TAS<->EAS, ARSPD_RATIO<->PCORRECT, in progress: AP_Airspeed: switch to PCORRECT factors instead of ratios by tridge · Pull Request #17987 · ArduPilot/ardupilot · GitHub)

BR, Konrad

In 4.1.x the airspeed (EAS) is:
sqrt(ARDPD_RATIO * differential_pressure);
where differential_pressure has only had corrections for tube order. We then calculate TAS using the pressure altitude, see this code:

I do have a pending change to do things more carefully to cope with high altitude flight, but that isn’t in 4.1.x.
A few different groups are looking at incorporating multi-hole probes in order to get AoA or SSA estimates as well as raw airspeed. I’d be happy to restructure AP_Airspeed to cope with this.
Cheers, Tridge