Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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 "modules/datalink/downlink.h"
#include "modules/core/abi.h"
#include "generated/airframe.h"
#include "modules/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.
#define AOA_PWM_OFFSET   1
 Some sensor may need an initial PWM offset (1 usec in the case of an MA3 sensor).
#define AOA_ANGLE_OFFSET   M_PI
 Default offset value (assuming 0 AOA is in the middle of the range).
#define AOA_OFFSET   0.0f
 Default extra offset that can be ajusted from settings.
#define AOA_FILTER   0.0f
 Default filter value.
#define AOA_SENS   ((2.0f*M_PI)/AOA_PWM_PERIOD)
 Default sensitivity (2*pi on a PWM of period AOA_PWM_PERIOD).
#define AOA_SIGN   1
#define SEND_SYNC_AOA   TRUE
#define LOG_AOA   FALSE
#define SSA_OFFSET   0.0f
#define SSA_FILTER   0.0f
#define SSA_SENS   ((2.0f*M_PI)/AOA_PWM_PERIOD)
#define SSA_SIGN   1

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
struct Aoa_Pwm ssa_pwm
enum Aoa_Type aoa_send_type

Detailed Description

Angle of Attack sensor on PWM.

Author
Jean-François Erdelyi

Driver for a PWM based angle of attack sensor A second sensor can be defined for the sideslip angle It is assumed that both sensors are the same, only sensitivity, offset and direction can differ.

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

◆ AOA_ANGLE_OFFSET

#define AOA_ANGLE_OFFSET   M_PI

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

Definition at line 63 of file aoa_pwm.c.

Referenced by aoa_pwm_update(), and aoa_t4_update().

◆ AOA_FILTER

#define AOA_FILTER   0.0f

Default filter value.

Definition at line 71 of file aoa_pwm.c.

◆ AOA_OFFSET

#define AOA_OFFSET   0.0f

Default extra offset that can be ajusted from settings.

Definition at line 67 of file aoa_pwm.c.

◆ AOA_PWM_OFFSET

#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 59 of file aoa_pwm.c.

Referenced by aoa_pwm_update().

◆ AOA_PWM_PERIOD

#define AOA_PWM_PERIOD   4096

Default to a 12 bit PWM sensor.

Definition at line 55 of file aoa_pwm.c.

◆ AOA_SENS

#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 75 of file aoa_pwm.c.

◆ AOA_SIGN

#define AOA_SIGN   1

Definition at line 81 of file aoa_pwm.c.

Referenced by aoa_pwm_update().

◆ LOG_AOA

#define LOG_AOA   FALSE

Definition at line 89 of file aoa_pwm.c.

◆ SEND_SYNC_AOA

#define SEND_SYNC_AOA   TRUE

Definition at line 85 of file aoa_pwm.c.

◆ SSA_FILTER

#define SSA_FILTER   0.0f

Definition at line 107 of file aoa_pwm.c.

Referenced by aoa_pwm_init().

◆ SSA_OFFSET

#define SSA_OFFSET   0.0f

Definition at line 103 of file aoa_pwm.c.

Referenced by aoa_pwm_init().

◆ SSA_SENS

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

Definition at line 111 of file aoa_pwm.c.

Referenced by aoa_pwm_init().

◆ SSA_SIGN

#define SSA_SIGN   1

Definition at line 117 of file aoa_pwm.c.

Referenced by aoa_pwm_update().

Function Documentation

◆ aoa_pwm_init()

void aoa_pwm_init ( void )

Definition at line 145 of file aoa_pwm.c.

References AOA_FILTER, AOA_OFFSET, aoa_pwm, aoa_send_type, AOA_SENS, DefaultPeriodic, log_started, register_periodic_telemetry(), send_aoa(), SEND_TYPE_AOA, SSA_FILTER, SSA_OFFSET, ssa_pwm, and SSA_SENS.

Here is the call graph for this function:

◆ aoa_pwm_update()

void aoa_pwm_update ( void )

◆ send_aoa()

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

Definition at line 128 of file aoa_pwm.c.

References aoa_pwm, aoa_send_type, dev, SEND_TYPE_AOA, SEND_TYPE_SIDESLIP, and ssa_pwm.

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

Here is the caller graph for this function:

Variable Documentation

◆ aoa_pwm

struct Aoa_Pwm aoa_pwm

Definition at line 92 of file aoa_pwm.c.

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

◆ aoa_send_type

enum Aoa_Type aoa_send_type

Definition at line 123 of file aoa_pwm.c.

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

◆ ssa_pwm

struct Aoa_Pwm ssa_pwm

Definition at line 119 of file aoa_pwm.c.

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