Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_board.c File Reference
#include "subsystems/sensors/baro.h"
#include "generated/airframe.h"
#include "subsystems/abi.h"
#include "led.h"
+ Include dependency graph for baro_board.c:

Go to the source code of this file.

Macros

#define BOOZ_ANALOG_BARO_THRESHOLD   850
 threshold >0 && <1023 More...
 
#define BOOZ_BARO_SENS   0.759837
 scale factor to convert raw ADC measurement to pressure in Pascal. More...
 

Functions

void baro_init (void)
 
void baro_periodic (void)
 
void baro_board_calibrate (void)
 

Variables

struct BaroBoard baro_board
 

Macro Definition Documentation

#define BOOZ_ANALOG_BARO_THRESHOLD   850

threshold >0 && <1023

Definition at line 37 of file baro_board.c.

Referenced by baro_board_calibrate(), and baro_periodic().

#define BOOZ_BARO_SENS   0.759837

scale factor to convert raw ADC measurement to pressure in Pascal.

Sensor Sensitivity -> SS = 0.045 mv / Pa Sensor Gain -> G = 94.25 Sensitivity -> S = SS*G = 4.24125 mV / Pa 10 bit ADC -> A = 3.3 V / 1024 = 3.223 mV / LSB Total Sensitivity SENS = A / S = 0.759837

For the real pressure you also need to take into account the (variable) offset

supply voltage Vs = 5V real sensor sensitivity Vout = Vs * (0.009 P - 0.095) voltage variable offset Voff(DAC) = Vs / 69.23 + (DAC * 3.3 / 1024) / 21.77 ADC voltage at init Vadc = 3.3*BARO_THRESHOLD/1024 = Vout - Voff

=> Inverting these formulas can give the 'real' pressure

since we don't care that much in this case, we can take a fixed offset of 101325 Pa

Definition at line 60 of file baro_board.c.

Referenced by baro_periodic().

Function Documentation

void baro_board_calibrate ( void  )

Definition at line 94 of file baro_board.c.

References baro_board, BB_RUNNING, BOOZ_ANALOG_BARO_THRESHOLD, DACSet(), LED_ON, LED_TOGGLE, BaroBoard::offset, BaroBoard::status, and BaroBoard::value_filtered.

Referenced by baro_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void baro_init ( void  )

Variable Documentation

struct BaroBoard baro_board

Definition at line 63 of file baro_board.c.

Referenced by baro_board_calibrate(), baro_init(), baro_periodic(), and lisa_l_baro_event().