Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_indi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Ewoud Smeur <ewoud_smeur@msn.com>
3  * MAVLab Delft University of Technology
4  *
5  * This control algorithm is Incremental Nonlinear Dynamic Inversion (INDI)
6  *
7  * This is a simplified implementation of the (soon to be) publication in the
8  * journal of Control Guidance and Dynamics: Adaptive Incremental Nonlinear
9  * Dynamic Inversion for Attitude Control of Micro Aerial Vehicles
10  *
11  * This file is part of paparazzi.
12  *
13  * paparazzi is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2, or (at your option)
16  * any later version.
17  *
18  * paparazzi is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with paparazzi; see the file COPYING. If not, write to
25  * the Free Software Foundation, 59 Temple Place - Suite 330,
26  * Boston, MA 02111-1307, USA.
27  */
28 
34 #ifndef STABILIZATION_INDI_H
35 #define STABILIZATION_INDI_H
36 
38 
39 extern struct Int32Quat stab_att_sp_quat;
40 extern struct Int32Eulers stab_att_sp_euler;
41 
43  float err_p;
44  float err_q;
45  float err_r;
46  float rate_p;
47  float rate_q;
48  float rate_r;
49 };
50 
51 struct IndiFilter {
52  struct FloatRates ddx;
53  struct FloatRates dx;
54  struct FloatRates x;
55 
56  float zeta;
57  float omega;
58  float omega_r;
59  float omega2;
60  float omega2_r;
61 };
62 
64  struct IndiFilter u;
65  struct IndiFilter rate;
66  struct FloatRates g1;
67  float g2;
68  float mu;
69 };
70 
71 struct IndiVariables {
73  struct FloatRates du;
74  struct FloatRates u_in;
76 
77  struct IndiFilter u;
78  struct IndiFilter rate;
79  struct FloatRates g1;
80  float g2;
81 
83 
84  bool adaptive;
85  float max_rate;
88 };
89 
90 
91 extern struct IndiVariables indi;
92 extern void stabilization_indi_init(void);
93 extern void stabilization_indi_enter(void);
95 extern void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy);
97 extern void stabilization_indi_run(bool enable_integrator, bool rate_control);
98 extern void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn);
99 
100 #endif /* STABILIZATION_INDI_H */
101 
struct FloatRates g1
void stabilization_indi_set_earth_cmd_i(struct Int32Vect2 *cmd, int32_t heading)
bool adaptive
Enable adataptive estimation.
struct FloatRates du
struct FloatRates dx
struct Int32Quat stab_att_sp_quat
with INT32_QUAT_FRAC
float attitude_max_yaw_rate
Maximum yaw rate in atttiude control in rad/s.
struct FloatRates u_act_dyn
struct FloatRates ddx
float max_rate
Maximum rate in rate control in rad/s.
struct FloatRates x
struct IndiFilter rate
void stabilization_indi_run(bool enable_integrator, bool rate_control)
static float heading
Definition: ahrs_infrared.c:45
struct IndiFilter rate
void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy)
void stabilization_indi_set_failsafe_setpoint(void)
euler angles
struct IndiFilter u
struct ReferenceSystem reference_acceleration
struct Int32Eulers stab_att_sp_euler
with INT32_ANGLE_FRAC
struct FloatRates g1
struct FloatRates angular_accel_ref
signed long int32_t
Definition: types.h:19
void stabilization_indi_enter(void)
struct IndiVariables indi
void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
struct IndiEstimation est
Estimation parameters for adaptive INDI.
struct FloatRates u_in
Rotorcraft attitude reference generation.
struct IndiFilter u
Rotation quaternion.
angular rates
void stabilization_indi_init(void)