Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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 */
h_ctl_course_pre_bank_correction
float h_ctl_course_pre_bank_correction
Definition: stabilization_adaptive.c:82
h_ctl_roll_max_setpoint
float h_ctl_roll_max_setpoint
Definition: stabilization_adaptive.c:85
h_ctl_course_pgain
float h_ctl_course_pgain
Definition: stabilization_adaptive.c:83
h_ctl_roll_slew
float h_ctl_roll_slew
Definition: stabilization_adaptive.c:165
h_ctl_pitch_pgain
float h_ctl_pitch_pgain
Definition: stabilization_adaptive.c:172
h_ctl_roll_attitude_gain
float h_ctl_roll_attitude_gain
Definition: stabilization_adaptive.c:158
h_ctl_disabled
bool h_ctl_disabled
Definition: stabilization_adaptive.c:88
h_ctl_roll_pgain
float h_ctl_roll_pgain
Definition: stabilization_adaptive.c:167
h_ctl_aileron_of_throttle
float h_ctl_aileron_of_throttle
Definition: stabilization_adaptive.c:195
h_ctl_roll_setpoint
float h_ctl_roll_setpoint
Definition: stabilization_adaptive.c:157
h_ctl_elevator_of_roll
float h_ctl_elevator_of_roll
Definition: stabilization_adaptive.c:196
paparazzi.h
h_ctl_roll_rate_gain
float h_ctl_roll_rate_gain
Definition: stabilization_adaptive.c:159
std.h
pprz_t
int16_t pprz_t
Definition: paparazzi.h:6
h_ctl_course_loop
void h_ctl_course_loop(void)
Definition: stabilization_adaptive.c:374
h_ctl_aileron_setpoint
pprz_t h_ctl_aileron_setpoint
Definition: stabilization_adaptive.c:164
h_ctl_pitch_setpoint
float h_ctl_pitch_setpoint
Definition: stabilization_adaptive.c:170
uint8_t
unsigned char uint8_t
Definition: types.h:14
h_ctl_course_setpoint
float h_ctl_course_setpoint
Definition: stabilization_adaptive.c:80
h_ctl_elevator_setpoint
pprz_t h_ctl_elevator_setpoint
Definition: stabilization_adaptive.c:178
h_ctl_course_pre_bank
float h_ctl_course_pre_bank
Definition: stabilization_adaptive.c:81
h_ctl_attitude_loop
void h_ctl_attitude_loop(void)
Definition: stabilization_adaptive.c:413
h_ctl_pitch_loop_setpoint
float h_ctl_pitch_loop_setpoint
Definition: stabilization_adaptive.c:171
h_ctl_course_dgain
float h_ctl_course_dgain
Definition: stabilization_adaptive.c:84
h_ctl_auto1_rate
bool h_ctl_auto1_rate
Definition: stabilization_adaptive.c:91
h_ctl_pitch_dgain
float h_ctl_pitch_dgain
Definition: stabilization_adaptive.c:173
inttypes.h
h_ctl_init
void h_ctl_init(void)
Definition: stabilization_adaptive.c:298