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
aoa_pwm.c File Reference

Angle of Attack sensor on PWM. More...

#include "modules/sensors/aoa_pwm.h"
#include "mcu_periph/pwm_input.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "generated/airframe.h"
#include "subsystems/datalink/telemetry.h"
+ Include dependency graph for aoa_pwm.c:

Go to the source code of this file.

Macros

#define AOA_PWM_PERIOD   4096
 Default to a 12 bit PWM sensor. More...
 
#define AOA_PWM_OFFSET   1
 Some sensor may need an initial PWM offset (1 usec in the case of an MA3 sensor) More...
 
#define AOA_ANGLE_OFFSET   M_PI
 Default offset value (assuming 0 AOA is in the middle of the range) More...
 
#define AOA_OFFSET   0.0f
 Default extra offset that can be ajusted from settings. More...
 
#define AOA_FILTER   0.0f
 Default filter value. More...
 
#define AOA_SENS   ((2.0f*M_PI)/AOA_PWM_PERIOD)
 Default sensitivity (2*pi on a PWM of period AOA_PWM_PERIOD) More...
 
#define AOA_SIGN   1
 
#define SEND_SYNC_AOA   TRUE
 
#define LOG_AOA   FALSE
 

Functions

static void send_aoa (struct transport_tx *trans, struct link_device *dev)
 
void aoa_pwm_init (void)
 
void aoa_pwm_update (void)
 

Variables

struct Aoa_Pwm aoa_pwm
 

Detailed Description

Angle of Attack sensor on PWM.

Author
Jean-François Erdelyi SENSOR, exemple : US DIGITAL MA3-P12-125-B
See also
http://www.usdigital.com/products/encoders/absolute/rotary/shaft/ma3

Definition in file aoa_pwm.c.

Macro Definition Documentation

#define AOA_ANGLE_OFFSET   M_PI

Default offset value (assuming 0 AOA is in the middle of the range)

Definition at line 55 of file aoa_pwm.c.

Referenced by aoa_pwm_update().

#define AOA_FILTER   0.0f

Default filter value.

Definition at line 63 of file aoa_pwm.c.

Referenced by aoa_pwm_init().

#define AOA_OFFSET   0.0f

Default extra offset that can be ajusted from settings.

Definition at line 59 of file aoa_pwm.c.

Referenced by aoa_pwm_init().

#define AOA_PWM_OFFSET   1

Some sensor may need an initial PWM offset (1 usec in the case of an MA3 sensor)

Definition at line 51 of file aoa_pwm.c.

Referenced by aoa_pwm_update().

#define AOA_PWM_PERIOD   4096

Default to a 12 bit PWM sensor.

Definition at line 47 of file aoa_pwm.c.

#define AOA_SENS   ((2.0f*M_PI)/AOA_PWM_PERIOD)

Default sensitivity (2*pi on a PWM of period AOA_PWM_PERIOD)

Definition at line 67 of file aoa_pwm.c.

Referenced by aoa_pwm_init().

#define AOA_SIGN   1

Definition at line 73 of file aoa_pwm.c.

Referenced by aoa_pwm_update().

#define LOG_AOA   FALSE

Definition at line 81 of file aoa_pwm.c.

#define SEND_SYNC_AOA   TRUE

Definition at line 77 of file aoa_pwm.c.

Function Documentation

void aoa_pwm_init ( void  )
static void send_aoa ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 89 of file aoa_pwm.c.

References Aoa_Pwm::angle, aoa_pwm, and Aoa_Pwm::raw.

Referenced by aoa_pwm_init().

+ Here is the caller graph for this function:

Variable Documentation

struct Aoa_Pwm aoa_pwm

Definition at line 84 of file aoa_pwm.c.

Referenced by aoa_pwm_init(), aoa_pwm_update(), and send_aoa().