Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
air_data.h File Reference

Air Data interface. More...

#include "std.h"
+ Include dependency graph for air_data.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  AirData
 Air Data strucute. More...
 

Functions

void air_data_init (void)
 AirData initialization. More...
 
void air_data_periodic (void)
 Check health. More...
 
float air_data_get_amsl (void)
 Return AMSL (altitude AboveSeaLevel). More...
 
float eas_from_dynamic_pressure (float q)
 Calculate equivalent airspeed from dynamic pressure. More...
 
float get_tas_factor (float p, float t)
 Calculate true airspeed (TAS) factor. More...
 
float tas_from_eas (float eas)
 Calculate true airspeed from equivalent airspeed. More...
 
float tas_from_dynamic_pressure (float q)
 Calculate true airspeed from dynamic pressure. More...
 

Variables

struct AirData air_data
 global AirData state More...
 

Detailed Description

Air Data interface.

  • pressures
  • airspeed
  • angle of attack and sideslip
  • wind

Definition in file air_data.h.


Data Structure Documentation

struct AirData

Air Data strucute.

Definition at line 37 of file air_data.h.

Data Fields
float airspeed Equivalent Air Speed (equals to Calibrated Air Speed at low speed/altitude) (in m/s, -1 if unknown.
float amsl_baro altitude above sea level in m from pressure and QNH
bool amsl_baro_valid TRUE if amsl_baro is currently valid.
float aoa angle of attack (rad)
bool calc_airspeed if TRUE, calculate airspeed from differential pressure
bool calc_amsl_baro if TRUE, calculate amsl_baro
bool calc_qnh_once flag to calculate QNH with next pressure measurement
bool calc_tas_factor if TRUE, calculate tas_factor when getting a temp measurement
float differential Differential pressure (total - static pressure) (Pa)
float pressure Static atmospheric pressure (Pa), -1 if unknown.
float qnh Barometric pressure adjusted to sea level in hPa, -1 if unknown.
float sideslip sideslip angle (rad)
float tas True Air Speed (TAS) in m/s, -1 if unknown.
float tas_factor factor to convert equivalent airspeed (EAS) to true airspeed (TAS)
float temperature temperature in degrees Celcius, -1000 if unknown
float wind_dir wind direction (rad, 0 north, >0 clockwise)
float wind_speed wind speed (m/s)

Function Documentation

float air_data_get_amsl ( void  )

Return AMSL (altitude AboveSeaLevel).

If AMSL from baro is valid, return that, otherwise from gps.

Definition at line 235 of file air_data.c.

References air_data, LlaCoor_f::alt, AirData::amsl_baro, AirData::amsl_baro_valid, and stateGetPositionLla_f().

+ Here is the call graph for this function:

void air_data_periodic ( void  )

Check health.

Needs to be called periodically.

Definition at line 245 of file air_data.c.

References air_data, and AirData::amsl_baro_valid.

float eas_from_dynamic_pressure ( float  q)

Calculate equivalent airspeed from dynamic pressure.

Dynamic pressure $q$ (also called impact pressure) is the difference between total(pitot) and static pressure.

Parameters
qdynamic pressure in Pa
Returns
equivalent airspeed in m/s

Dynamic pressure $q$ (also called impact pressure) is the difference between total(pitot) and static pressure.

Airspeed from dynamic pressure:

\[ v = \frac12 \sqrt{\frac{2q}{\rho}} \]

with $\rho$ as air density. Using standard sea level air density $\rho_0$ gives you equivalent airspeed (EAS).

Parameters
qdynamic pressure in Pa
Returns
equivalent airspeed in m/s

Definition at line 269 of file air_data.c.

References Max, and PPRZ_ISA_AIR_DENSITY.

Referenced by pressure_diff_cb(), and tas_from_dynamic_pressure().

+ Here is the caller graph for this function:

float get_tas_factor ( float  p,
float  t 
)

Calculate true airspeed (TAS) factor.

TAS = tas_factor * EAS

Parameters
pcurrent air pressure in Pa
tcurrent air temperature in degrees Celcius
Returns
tas factor

TAS = tas_factor * EAS

True airspeed (TAS) from equivalent airspeed (EAS):

\[\mbox{TAS} = \mbox{EAS} \sqrt{\frac{\rho_0}{\rho}}\]

and $ \frac{\rho_0}{\rho} = \frac{p_0T}{pT_0}$ where

  • $p$ is the air pressure at the flight condition
  • $p_0$ is the air pressure at sea level = 101325 Pa
  • $T$ is the air temperature at the flight condition
  • $T_0$ is the air temperature at sea level = 288.15 K
Parameters
pcurrent air pressure in Pa
tcurrent air temperature in degrees Celcius
Returns
tas factor

Definition at line 297 of file air_data.c.

References PPRZ_ISA_SEA_LEVEL_PRESSURE, and PPRZ_ISA_SEA_LEVEL_TEMP.

Referenced by temperature_cb().

+ Here is the caller graph for this function:

float tas_from_dynamic_pressure ( float  q)

Calculate true airspeed from dynamic pressure.

Dynamic pressure $q$ (also called impact pressure) is the difference between total(pitot) and static pressure.

Parameters
qdynamic pressure in Pa
Returns
true airspeed in m/s

Definition at line 329 of file air_data.c.

References eas_from_dynamic_pressure(), and tas_from_eas().

+ Here is the call graph for this function:

float tas_from_eas ( float  eas)

Calculate true airspeed from equivalent airspeed.

Parameters
easequivalent airspeed (EAS) in m/s
Returns
true airspeed in m/s

True airspeed (TAS) from EAS: TAS = air_data.tas_factor * EAS

Parameters
easequivalent airspeed (EAS) in m/s
Returns
true airspeed in m/s

Definition at line 316 of file air_data.c.

References air_data, and AirData::tas_factor.

Referenced by airspeed_cb(), pressure_diff_cb(), and tas_from_dynamic_pressure().

+ Here is the caller graph for this function:

Variable Documentation