Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_rate.c File Reference

Rate stabilization for rotorcrafts. More...

#include "generated/airframe.h"
#include "firmwares/rotorcraft/stabilization.h"
#include "state.h"
#include "subsystems/imu.h"
#include "subsystems/radio_control.h"
#include "firmwares/rotorcraft/autopilot_rc_helpers.h"
+ Include dependency graph for stabilization_rate.c:

Go to the source code of this file.

Macros

#define F_UPDATE_RES   9
 
#define REF_DOT_FRAC   11
 
#define REF_FRAC   16
 
#define MAX_SUM_ERR   4000000
 
#define STABILIZATION_RATE_DDGAIN_P   0
 
#define STABILIZATION_RATE_DDGAIN_Q   0
 
#define STABILIZATION_RATE_DDGAIN_R   0
 
#define STABILIZATION_RATE_IGAIN_P   0
 
#define STABILIZATION_RATE_IGAIN_Q   0
 
#define STABILIZATION_RATE_IGAIN_R   0
 
#define STABILIZATION_RATE_REF_TAU   4
 
#define OFFSET_AND_ROUND(_a, _b)   (((_a)+(1<<((_b)-1)))>>(_b))
 
#define OFFSET_AND_ROUND2(_a, _b)   (((_a)+(1<<((_b)-1))-((_a)<0?1:0))>>(_b))
 
#define STABILIZATION_RATE_DEADBAND_P   0
 
#define STABILIZATION_RATE_DEADBAND_Q   0
 
#define STABILIZATION_RATE_DEADBAND_R   200
 
#define ROLL_RATE_DEADBAND_EXCEEDED()
 
#define PITCH_RATE_DEADBAND_EXCEEDED()
 
#define YAW_RATE_DEADBAND_EXCEEDED()
 

Functions

void stabilization_rate_init (void)
 
void stabilization_rate_read_rc (void)
 
void stabilization_rate_read_rc_switched_sticks (void)
 
void stabilization_rate_enter (void)
 
void stabilization_rate_run (bool_t in_flight)
 

Variables

struct Int32Rates stabilization_rate_sp
 
struct Int32Rates stabilization_rate_gain
 
struct Int32Rates stabilization_rate_igain
 
struct Int32Rates stabilization_rate_ddgain
 
struct Int32Rates stabilization_rate_ref
 
struct Int32Rates stabilization_rate_refdot
 
struct Int32Rates stabilization_rate_sum_err
 
struct Int32Rates stabilization_rate_fb_cmd
 
struct Int32Rates stabilization_rate_ff_cmd
 

Detailed Description

Rate stabilization for rotorcrafts.

Control loops for angular velocity.

Definition in file stabilization_rate.c.

Macro Definition Documentation

#define F_UPDATE_RES   9

Definition at line 39 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

#define MAX_SUM_ERR   4000000

Definition at line 43 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

#define OFFSET_AND_ROUND (   _a,
  _b 
)    (((_a)+(1<<((_b)-1)))>>(_b))

Definition at line 80 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

#define OFFSET_AND_ROUND2 (   _a,
  _b 
)    (((_a)+(1<<((_b)-1))-((_a)<0?1:0))>>(_b))

Definition at line 81 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

#define PITCH_RATE_DEADBAND_EXCEEDED ( )
Value:
#define RADIO_PITCH
Definition: spektrum_arch.h:45
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:55
struct RadioControl radio_control
Definition: radio_control.c:25
#define STABILIZATION_RATE_DEADBAND_Q

Definition at line 109 of file stabilization_rate.c.

Referenced by stabilization_rate_read_rc(), and stabilization_rate_read_rc_switched_sticks().

#define REF_DOT_FRAC   11

Definition at line 40 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

#define REF_FRAC   16
#define ROLL_RATE_DEADBAND_EXCEEDED ( )
Value:
#define STABILIZATION_RATE_DEADBAND_P
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:55
struct RadioControl radio_control
Definition: radio_control.c:25
#define RADIO_ROLL
Definition: spektrum_arch.h:42

Definition at line 105 of file stabilization_rate.c.

Referenced by stabilization_rate_read_rc(), and stabilization_rate_read_rc_switched_sticks().

#define STABILIZATION_RATE_DDGAIN_P   0

Definition at line 46 of file stabilization_rate.c.

Referenced by stabilization_rate_init().

#define STABILIZATION_RATE_DDGAIN_Q   0

Definition at line 49 of file stabilization_rate.c.

Referenced by stabilization_rate_init().

#define STABILIZATION_RATE_DDGAIN_R   0

Definition at line 52 of file stabilization_rate.c.

Referenced by stabilization_rate_init().

#define STABILIZATION_RATE_DEADBAND_P   0

Definition at line 96 of file stabilization_rate.c.

#define STABILIZATION_RATE_DEADBAND_Q   0

Definition at line 99 of file stabilization_rate.c.

#define STABILIZATION_RATE_DEADBAND_R   200

Definition at line 102 of file stabilization_rate.c.

#define STABILIZATION_RATE_IGAIN_P   0

Definition at line 56 of file stabilization_rate.c.

Referenced by stabilization_rate_init().

#define STABILIZATION_RATE_IGAIN_Q   0

Definition at line 60 of file stabilization_rate.c.

Referenced by stabilization_rate_init().

#define STABILIZATION_RATE_IGAIN_R   0

Definition at line 64 of file stabilization_rate.c.

Referenced by stabilization_rate_init().

#define STABILIZATION_RATE_REF_TAU   4

Definition at line 77 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

#define YAW_RATE_DEADBAND_EXCEEDED ( )
Value:
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:55
struct RadioControl radio_control
Definition: radio_control.c:25
#define RADIO_YAW
Definition: spektrum_arch.h:48
#define STABILIZATION_RATE_DEADBAND_R

Definition at line 113 of file stabilization_rate.c.

Referenced by stabilization_rate_read_rc(), and stabilization_rate_read_rc_switched_sticks().

Function Documentation

void stabilization_rate_enter ( void  )

Definition at line 214 of file stabilization_rate.c.

References INT_RATES_ZERO, RATES_COPY, stabilization_rate_ref, stabilization_rate_sp, and stabilization_rate_sum_err.

Referenced by guidance_h_mode_changed().

+ Here is the caller graph for this function:

void stabilization_rate_read_rc ( void  )
void stabilization_rate_read_rc_switched_sticks ( void  )

Variable Documentation

struct Int32Rates stabilization_rate_ddgain

Definition at line 86 of file stabilization_rate.c.

Referenced by stabilization_rate_init(), and stabilization_rate_run().

struct Int32Rates stabilization_rate_fb_cmd

Definition at line 91 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

struct Int32Rates stabilization_rate_ff_cmd

Definition at line 92 of file stabilization_rate.c.

Referenced by stabilization_rate_run().

struct Int32Rates stabilization_rate_gain

Definition at line 84 of file stabilization_rate.c.

Referenced by stabilization_rate_init(), and stabilization_rate_run().

struct Int32Rates stabilization_rate_igain

Definition at line 85 of file stabilization_rate.c.

Referenced by stabilization_rate_init(), and stabilization_rate_run().

struct Int32Rates stabilization_rate_ref
struct Int32Rates stabilization_rate_refdot

Definition at line 88 of file stabilization_rate.c.

Referenced by stabilization_rate_init(), and stabilization_rate_run().

struct Int32Rates stabilization_rate_sum_err