Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
airspeed_sdp3x module

SDP3X differential pressure sensor for e.g measuring airspeed.

No detailed description...

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="airspeed_sdp3x">
2  <define name="SDP3X_I2C_DEV" value="i2cX" />
3  <define name="SDP3X_I2C_ADDR" value="0x50" />
4  <define name="SDP3X_SYNC_SEND" value="TRUE|FALSE" />
5  <define name="SDP3X_PRESSURE_SCALE" value="1.0" />
6  <define name="SDP3X_PRESSURE_OFFSET" value="0.0" />
7  <define name="SDP3X_AIRSPEED_SCALE" value="1.6327" />
8  <define name="SDP3X_LOWPASS_TAU" value="0.15" />
9  <define name="USE_AIRSPEED_SDP3X" value="TRUE|FALSE" />
10 </module>

Module configuration options

Define Options

  • name: SDP3X_I2C_DEV value: i2cX
    Description: set i2c peripheral (default: i2c2)
  • name: SDP3X_I2C_ADDR value: 0x50
    Description: i2c slave address (default: 0x50)
  • name: SDP3X_SYNC_SEND value: TRUE|FALSE
    Description: flag to enable sending every new measurement via telemetry (default:FALSE)
  • name: SDP3X_PRESSURE_SCALE value: 1.0
    Description: pressure scaling factor to convert raw output to Pa (default: set according to pressure range and output type according to datasheet)
  • name: SDP3X_PRESSURE_OFFSET value: 0.0
    Description: pressure offset in Pa (default: set according to pressure range and output type according to datasheet)
  • name: SDP3X_AIRSPEED_SCALE value: 1.6327
    Description: quadratic scale factor to convert differential pressure to airspeed
  • name: SDP3X_LOWPASS_TAU value: 0.15
    Description: Time constant for second order Butterworth low pass filter, cut-off freq of 1/(2*pi*tau) ~= 1Hz
  • name: USE_AIRSPEED_SDP3X value: TRUE|FALSE
    Description: Set airspeed in state interface for this sensor

Module functions

Init Functions

These initialization functions are called once on startup.

Event Functions

These event functions are called in each cycle of the module event loop.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

  • sdp3x_periodic()
    • Frequency in Hz: 100.
    • Autorun: LOCK
      Periodic function automatically starts after init and can't be stopped.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw airspeed_sdp3x.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="airspeed_sdp3x" dir="sensors">
<doc>
<description>
SDP3X differential pressure sensor for e.g measuring airspeed.
</description>
<define name="SDP3X_I2C_DEV" value="i2cX" description="set i2c peripheral (default: i2c2)"/>
<define name="SDP3X_I2C_ADDR" value="0x50" description="i2c slave address (default: 0x50)"/>
<define name="SDP3X_SYNC_SEND" value="TRUE|FALSE" description="flag to enable sending every new measurement via telemetry (default:FALSE)"/>
<define name="SDP3X_PRESSURE_SCALE" value="1.0" description="pressure scaling factor to convert raw output to Pa (default: set according to pressure range and output type according to datasheet)"/>
<define name="SDP3X_PRESSURE_OFFSET" value="0.0" description="pressure offset in Pa (default: set according to pressure range and output type according to datasheet)"/>
<define name="SDP3X_AIRSPEED_SCALE" value="1.6327" description="quadratic scale factor to convert differential pressure to airspeed"/>
<define name="SDP3X_LOWPASS_TAU" value="0.15" description="Time constant for second order Butterworth low pass filter, cut-off freq of 1/(2*pi*tau) ~= 1Hz"/>
<define name="USE_AIRSPEED_SDP3X" value="TRUE|FALSE" description="Set airspeed in state interface for this sensor"/>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="SDP3X">
<dl_setting min="0" max="1" step="1" values="FALSE|TRUE" var="sdp3x.sync_send" type="bool" shortname="sync_send" module="modules/sensors/airspeed_sdp3x" param="SDP3X_SYNC_SEND" persistent="true"/>
<dl_setting min="0" max="1" step="1" values="FALSE|TRUE" var="sdp3x.autoset_offset" type="bool" shortname="autoset offset"/>
<dl_setting min="1.0" max="300." step="1." var="sdp3x.pressure_scale" type="float" shortname="PressScale" module="modules/sensors/airspeed_sdp3x" param="SDP3X_PRESSURE_SCALE" persistent="true"/>
<dl_setting min="-100." max="100.0" step="0.1" var="sdp3x.pressure_offset" type="float" shortname="PressOffset" module="modules/sensors/airspeed_sdp3x" param="SDP3X_PRESSURE_OFFSET" persistent="true"/>
<dl_setting min="1.0" max="2.0" step="0.01" var="sdp3x.airspeed_scale" type="float" shortname="AirScale" module="modules/sensors/airspeed_sdp3x" param="SDP3X_AIRSPEED_SCALE" persistent="true"/>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="airspeed_sdp3x.h"/>
</header>
<init fun="sdp3x_init()"/>
<periodic fun="sdp3x_periodic()" freq="100."/>
<event fun="sdp3x_event()"/>
<makefile target="ap">
<configure name="SDP3X_I2C_DEV" default="i2c2" case="upper|lower"/>
<define name="USE_$(SDP3X_I2C_DEV_UPPER)"/>
<define name="SDP3X_I2C_DEV" value="$(SDP3X_I2C_DEV_LOWER)"/>
<file name="airspeed_sdp3x.c"/>
</makefile>
</module>