Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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_t h_ctl_disabled;
52 
53 /* AUTO1 rate mode */
54 extern bool_t 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 loop pre-command */
77 extern float h_ctl_aileron_of_throttle;
78 extern float h_ctl_elevator_of_roll;
79 
80 /* rate loop */
81 
82 #ifdef H_CTL_RATE_LOOP
83 extern float h_ctl_roll_rate_mode;
84 extern float h_ctl_roll_rate_setpoint_pgain;
85 extern float h_ctl_roll_rate_pgain;
86 extern float h_ctl_hi_throttle_roll_rate_pgain;
87 extern float h_ctl_lo_throttle_roll_rate_pgain;
88 extern float h_ctl_roll_rate_igain;
89 extern float h_ctl_roll_rate_dgain;
90 
91 #define stabilization_attitude_SetRollRatePGain(v) { h_ctl_hi_throttle_roll_rate_pgain = v; h_ctl_lo_throttle_roll_rate_pgain = v; }
92 #endif
93 
94 extern void h_ctl_init( void );
95 extern void h_ctl_course_loop ( void );
96 extern void h_ctl_attitude_loop ( void );
97 
98 extern float h_ctl_roll_attitude_gain;
99 extern float h_ctl_roll_rate_gain;
100 
101 #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)
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
bool_t h_ctl_auto1_rate
float h_ctl_pitch_loop_setpoint
float h_ctl_course_dgain
void h_ctl_attitude_loop(void)
bool_t h_ctl_disabled
float h_ctl_roll_max_setpoint