Paparazzi UAS
v4.0.4_stable3gf39211a
Paparazzi is a free software Unmanned Aircraft System.

#include "std.h"
#include "led.h"
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
#include "firmwares/fixedwing/stabilization/stabilization_adaptive.h"
#include "estimator.h"
#include "subsystems/nav.h"
#include "generated/airframe.h"
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "firmwares/fixedwing/autopilot.h"
Go to the source code of this file.
Macros  
#define  H_CTL_REF_W 5. 
#define  H_CTL_REF_XI 0.85 
#define  H_CTL_REF_MAX_P RadOfDeg(150.) 
#define  H_CTL_REF_MAX_P_DOT RadOfDeg(500.) 
#define  H_CTL_REF_MAX_Q RadOfDeg(150.) 
#define  H_CTL_REF_MAX_Q_DOT RadOfDeg(500.) 
#define  AIRSPEED_RATIO_MIN 0.5 
#define  AIRSPEED_RATIO_MAX 2. 
#define  H_CTL_COURSE_PRE_BANK_CORRECTION 1. 
#define  H_CTL_COURSE_DGAIN 0. 
#define  H_CTL_ROLL_RATE_GAIN 0. 
#define  H_CTL_ROLL_IGAIN 0. 
#define  H_CTL_ROLL_KFFA 0. 
#define  H_CTL_ROLL_KFFD 0. 
#define  H_CTL_PITCH_DGAIN 0. 
#define  H_CTL_PITCH_IGAIN 0. 
#define  H_CTL_PITCH_KFFA 0. 
#define  H_CTL_PITCH_KFFD 0. 
#define  H_CTL_REF_DT (1./60.) 
#define  KFFA_UPDATE 0.1 
#define  KFFD_UPDATE 0.05 
Functions  
static void  h_ctl_roll_loop (void) 
static void  h_ctl_pitch_loop (void) 
void  h_ctl_init (void) 
void  h_ctl_course_loop (void) 
void  h_ctl_attitude_loop (void) 
#define AIRSPEED_RATIO_MAX 2. 
Definition at line 100 of file stabilization_adaptive.c.
#define AIRSPEED_RATIO_MIN 0.5 
Definition at line 99 of file stabilization_adaptive.c.
#define H_CTL_COURSE_DGAIN 0. 
Definition at line 114 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_COURSE_PRE_BANK_CORRECTION 1. 
Definition at line 111 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_PITCH_DGAIN 0. 
Definition at line 137 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_PITCH_IGAIN 0. 
Definition at line 140 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_PITCH_KFFA 0. 
Definition at line 143 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_PITCH_KFFD 0. 
Definition at line 146 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_REF_DT (1./60.) 
Definition at line 249 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop(), and h_ctl_roll_loop().
#define H_CTL_REF_MAX_P RadOfDeg(150.) 
Definition at line 63 of file stabilization_adaptive.c.
Referenced by h_ctl_roll_loop().
#define H_CTL_REF_MAX_P_DOT RadOfDeg(500.) 
Definition at line 64 of file stabilization_adaptive.c.
Referenced by h_ctl_roll_loop().
#define H_CTL_REF_MAX_Q RadOfDeg(150.) 
Definition at line 65 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop().
#define H_CTL_REF_MAX_Q_DOT RadOfDeg(500.) 
Definition at line 66 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop().
#define H_CTL_REF_W 5. 
Definition at line 61 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop(), and h_ctl_roll_loop().
#define H_CTL_REF_XI 0.85 
Definition at line 62 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop(), and h_ctl_roll_loop().
#define H_CTL_ROLL_IGAIN 0. 
Definition at line 125 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_ROLL_KFFA 0. 
Definition at line 128 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_ROLL_KFFD 0. 
Definition at line 131 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define H_CTL_ROLL_RATE_GAIN 0. 
Definition at line 122 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
#define KFFA_UPDATE 0.1 
Definition at line 250 of file stabilization_adaptive.c.
Referenced by h_ctl_roll_loop().
#define KFFD_UPDATE 0.05 
Definition at line 251 of file stabilization_adaptive.c.
Referenced by h_ctl_roll_loop().
void h_ctl_attitude_loop  (  void  ) 
Definition at line 239 of file stabilization_adaptive.c.
Referenced by attitude_loop().
void h_ctl_course_loop  (  void  ) 
Definition at line 202 of file stabilization_adaptive.c.
Referenced by navigation_task().
void h_ctl_init  (  void  ) 
Definition at line 149 of file stabilization_adaptive.c.
Referenced by init_ap().

inlinestatic 
Definition at line 351 of file stabilization_adaptive.c.
References airspeed_ratio2, estimator_phi, estimator_q, estimator_theta, h_ctl_elevator_setpoint, h_ctl_pitch_dgain, h_ctl_pitch_igain, h_ctl_pitch_Kffa, h_ctl_pitch_Kffd, h_ctl_pitch_loop_setpoint, h_ctl_pitch_of_roll, h_ctl_pitch_pgain, h_ctl_pitch_setpoint, h_ctl_pitch_sum_err, H_CTL_PITCH_SUM_ERR_MAX, H_CTL_REF_DT, H_CTL_REF_MAX_Q, H_CTL_REF_MAX_Q_DOT, h_ctl_ref_pitch_accel, h_ctl_ref_pitch_angle, h_ctl_ref_pitch_rate, H_CTL_REF_W, H_CTL_REF_XI, launch, pprz_mode, PPRZ_MODE_MANUAL, and TRIM_PPRZ.
Referenced by h_ctl_attitude_loop().

inlinestatic 
Definition at line 253 of file stabilization_adaptive.c.
References airspeed_ratio2, estimator_p, estimator_phi, h_ctl_aileron_of_throttle, h_ctl_aileron_setpoint, H_CTL_REF_DT, H_CTL_REF_MAX_P, H_CTL_REF_MAX_P_DOT, h_ctl_ref_roll_accel, h_ctl_ref_roll_angle, h_ctl_ref_roll_rate, H_CTL_REF_W, H_CTL_REF_XI, h_ctl_roll_attitude_gain, h_ctl_roll_igain, h_ctl_roll_Kffa, h_ctl_roll_Kffd, h_ctl_roll_rate_gain, h_ctl_roll_setpoint, h_ctl_roll_sum_err, H_CTL_ROLL_SUM_ERR_MAX, KFFA_UPDATE, KFFD_UPDATE, launch, Max, pprz_mode, PPRZ_MODE_MANUAL, TRIM_PPRZ, and v_ctl_throttle_setpoint.
Referenced by h_ctl_attitude_loop().
float airspeed_ratio2 
Definition at line 98 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), h_ctl_pitch_loop(), and h_ctl_roll_loop().
float h_ctl_aileron_of_throttle 
Definition at line 93 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_roll_loop().
pprz_t h_ctl_aileron_setpoint 
Definition at line 76 of file stabilization_adaptive.c.
Referenced by attitude_loop(), h_ctl_init(), and h_ctl_roll_loop().
bool_t h_ctl_auto1_rate 
Definition at line 52 of file stabilization_adaptive.c.
Referenced by navigation_task().
float h_ctl_course_dgain 
Definition at line 45 of file stabilization_adaptive.c.
Referenced by h_ctl_course_loop(), and h_ctl_init().
float h_ctl_course_pgain 
Definition at line 44 of file stabilization_adaptive.c.
Referenced by fly_to_xy(), h_ctl_course_loop(), and h_ctl_init().
float h_ctl_course_pre_bank 
Definition at line 42 of file stabilization_adaptive.c.
Referenced by h_ctl_course_loop(), h_ctl_init(), and nav_periodic_task().
float h_ctl_course_pre_bank_correction 
Definition at line 43 of file stabilization_adaptive.c.
Referenced by h_ctl_course_loop(), and h_ctl_init().
float h_ctl_course_setpoint 
fixed wing horizontal adaptive control
fixed wing horizontal control
Definition at line 41 of file stabilization_adaptive.c.
Referenced by fly_to_xy(), h_ctl_course_loop(), and h_ctl_init().
bool_t h_ctl_disabled 
Definition at line 49 of file stabilization_adaptive.c.
Referenced by h_ctl_attitude_loop(), and h_ctl_init().
float h_ctl_elevator_of_roll 
Definition at line 94 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
pprz_t h_ctl_elevator_setpoint 
Definition at line 90 of file stabilization_adaptive.c.
Referenced by attitude_loop(), h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_dgain 
Definition at line 85 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_igain 
Definition at line 86 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_Kffa 
Definition at line 88 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_Kffd 
Definition at line 89 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_loop_setpoint 
Definition at line 83 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_of_roll 
Definition at line 95 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_pgain 
Definition at line 84 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_pitch_setpoint 
Definition at line 82 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), h_ctl_pitch_loop(), navigation_task(), and telecommand_task().
float h_ctl_pitch_sum_err 
Definition at line 87 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_pitch_loop().
float h_ctl_ref_pitch_accel 
Definition at line 60 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop().
float h_ctl_ref_pitch_angle 
Definition at line 58 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop().
float h_ctl_ref_pitch_rate 
Definition at line 59 of file stabilization_adaptive.c.
Referenced by h_ctl_pitch_loop().
float h_ctl_ref_roll_accel 
Definition at line 57 of file stabilization_adaptive.c.
Referenced by h_ctl_roll_loop().
float h_ctl_ref_roll_angle 
Definition at line 55 of file stabilization_adaptive.c.
Referenced by h_ctl_roll_loop().
float h_ctl_ref_roll_rate 
Definition at line 56 of file stabilization_adaptive.c.
Referenced by h_ctl_roll_loop().
float h_ctl_roll_attitude_gain 
Definition at line 70 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_roll_loop().
float h_ctl_roll_igain 
Definition at line 72 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_roll_loop().
float h_ctl_roll_Kffa 
Definition at line 74 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_roll_loop().
float h_ctl_roll_Kffd 
Definition at line 75 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_roll_loop().
float h_ctl_roll_max_setpoint 
Definition at line 46 of file stabilization_adaptive.c.
Referenced by fly_to_xy(), h_ctl_course_loop(), and h_ctl_init().
float h_ctl_roll_pgain 
Definition at line 79 of file stabilization_adaptive.c.
float h_ctl_roll_rate_gain 
Definition at line 71 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_roll_loop().
float h_ctl_roll_setpoint 
Definition at line 69 of file stabilization_adaptive.c.
Referenced by fly_to_xy(), h_ctl_course_loop(), h_ctl_init(), h_ctl_roll_loop(), nav_without_gps(), and telecommand_task().
float h_ctl_roll_slew 
Definition at line 77 of file stabilization_adaptive.c.
float h_ctl_roll_sum_err 
fixed wing horizontal adaptive control
Definition at line 73 of file stabilization_adaptive.c.
Referenced by h_ctl_init(), and h_ctl_roll_loop().
bool_t use_airspeed_ratio 
Definition at line 97 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
float v_ctl_pitch_dash_trim 
Definition at line 103 of file stabilization_adaptive.c.
Referenced by h_ctl_init().
float v_ctl_pitch_loiter_trim 
Definition at line 102 of file stabilization_adaptive.c.
Referenced by h_ctl_init().