Paparazzi UAS  v5.15_devel-99-g2ff7410
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_attitude.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 Pascal Brisset, Antoine Drouin, Michel Gorraz
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
29 #ifndef FW_H_CTL_H
30 #define FW_H_CTL_H
31 
32 #include <inttypes.h>
33 #include "std.h"
34 #include "paparazzi.h"
35 #include "generated/airframe.h"
36 
37 /* outer loop parameters */
38 extern float h_ctl_course_setpoint; /* rad, CW/north */
39 extern float h_ctl_course_pre_bank;
41 extern float h_ctl_course_pgain;
42 extern float h_ctl_course_dgain;
43 extern float h_ctl_roll_max_setpoint;
44 
45 #ifdef LOITER_TRIM
46 extern float v_ctl_auto_throttle_loiter_trim;
47 extern float v_ctl_auto_throttle_dash_trim;
48 #endif
49 
50 /* roll and pitch disabling */
51 extern bool h_ctl_disabled;
52 
53 /* AUTO1 rate mode */
54 extern bool h_ctl_auto1_rate;
55 
56 /* inner roll loop parameters */
57 extern float h_ctl_roll_setpoint;
58 extern float h_ctl_roll_pgain;
60 extern float h_ctl_roll_slew;
61 
62 #ifdef USE_AOA
63 /* Pitch mode */
64 #define H_CTL_PITCH_MODE_THETA 0
65 #define H_CTL_PITCH_MODE_AOA 1
66 extern uint8_t h_ctl_pitch_mode;
67 #endif
68 
69 /* inner pitch loop parameters */
70 extern float h_ctl_pitch_setpoint;
71 extern float h_ctl_pitch_loop_setpoint;
72 extern float h_ctl_pitch_pgain;
73 extern float h_ctl_pitch_dgain;
75 
76 /* inner yaw loop parameters */
77 #if H_CTL_YAW_LOOP
78 extern float h_ctl_yaw_rate_setpoint;
79 extern pprz_t h_ctl_rudder_setpoint;
80 #endif
81 
82 /* inner CL loop parameters */
83 #if H_CTL_CL_LOOP
84 extern pprz_t h_ctl_flaps_setpoint;
85 #endif
86 
87 
88 /* inner loop pre-command */
89 extern float h_ctl_aileron_of_throttle;
90 extern float h_ctl_elevator_of_roll;
91 
92 /* rate loop */
93 
94 #ifdef H_CTL_RATE_LOOP
95 extern float h_ctl_roll_rate_mode;
96 extern float h_ctl_roll_rate_setpoint_pgain;
97 extern float h_ctl_roll_rate_pgain;
98 extern float h_ctl_hi_throttle_roll_rate_pgain;
99 extern float h_ctl_lo_throttle_roll_rate_pgain;
100 extern float h_ctl_roll_rate_igain;
101 extern float h_ctl_roll_rate_dgain;
102 
103 #define stabilization_attitude_SetRollRatePGain(v) { h_ctl_hi_throttle_roll_rate_pgain = v; h_ctl_lo_throttle_roll_rate_pgain = v; }
104 #endif
105 
106 extern void h_ctl_init(void);
107 extern void h_ctl_course_loop(void);
108 extern void h_ctl_attitude_loop(void);
109 
110 extern float h_ctl_roll_attitude_gain;
111 extern float h_ctl_roll_rate_gain;
112 
113 #endif /* FW_H_CTL_H */
float h_ctl_pitch_dgain
float h_ctl_course_pre_bank_correction
float h_ctl_roll_pgain
void h_ctl_init(void)
float h_ctl_aileron_of_throttle
float h_ctl_pitch_pgain
float h_ctl_roll_attitude_gain
int16_t pprz_t
Definition: paparazzi.h:6
float h_ctl_roll_slew
float h_ctl_course_pgain
void h_ctl_course_loop(void)
bool h_ctl_disabled
float h_ctl_pitch_setpoint
float h_ctl_roll_rate_gain
float h_ctl_course_setpoint
float h_ctl_roll_setpoint
float h_ctl_elevator_of_roll
pprz_t h_ctl_elevator_setpoint
pprz_t h_ctl_aileron_setpoint
float h_ctl_course_pre_bank
unsigned char uint8_t
Definition: types.h:14
float h_ctl_pitch_loop_setpoint
float h_ctl_course_dgain
void h_ctl_attitude_loop(void)
bool h_ctl_auto1_rate
float h_ctl_roll_max_setpoint