Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stabilization_indi_simple.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_SIMPLE_H
35 #define STABILIZATION_INDI_SIMPLE_H
36 
39 
40 extern struct Int32Quat stab_att_sp_quat;
41 extern struct Int32Eulers stab_att_sp_euler;
42 
43 struct ReferenceSystem {
44  float err_p;
45  float err_q;
46  float err_r;
47  float rate_p;
48  float rate_q;
49  float rate_r;
50 };
51 
55  float rate_d[3];
56  float rate_dd[3];
57  float u_d[3];
58  float u_dd[3];
59  struct FloatRates g1;
60  float g2;
61  float mu;
62 };
63 
64 struct IndiVariables {
66  struct FloatRates du;
67  struct FloatRates u_in;
69  float rate_d[3];
70 
73  struct FloatRates g1;
74  float g2;
75 
77 
78  bool adaptive;
79  float max_rate;
82 };
83 
84 
85 extern struct IndiVariables indi;
86 extern void stabilization_indi_init(void);
87 extern void stabilization_indi_enter(void);
89 extern void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy);
91 extern void stabilization_indi_run(bool enable_integrator, bool rate_control);
92 extern void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn);
93 
94 #endif /* STABILIZATION_INDI_SIMPLE_H */
95 
bool adaptive
Enable adataptive estimation.
struct ReferenceSystem reference_acceleration
struct FloatRates du
struct FloatRates g1
void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy)
Set attitude quaternion setpoint from rpy.
struct FloatRates u_in
Simple first order low pass filter with bilinear transform.
float max_rate
Maximum rate in rate control in rad/s.
void stabilization_indi_init(void)
Function that initializes important values upon engaging INDI.
void stabilization_indi_set_earth_cmd_i(struct Int32Vect2 *cmd, int32_t heading)
Set attitude setpoint from command in earth axes.
void stabilization_indi_set_failsafe_setpoint(void)
Function that calculates the failsafe setpoint.
static float heading
Definition: ahrs_infrared.c:45
Butterworth2LowPass rate[3]
Butterworth2LowPass rate[3]
euler angles
struct Int32Quat stab_att_sp_quat
with INT32_QUAT_FRAC
struct IndiEstimation est
Estimation parameters for adaptive INDI.
struct IndiVariables indi
signed long int32_t
Definition: types.h:19
void stabilization_indi_run(bool enable_integrator, bool rate_control)
runs stabilization indi
struct FloatRates angular_accel_ref
Butterworth2LowPass u[3]
void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
This function reads rc commands.
void stabilization_indi_enter(void)
Function that resets important values upon engaging INDI.
Second order low pass filter structure.
struct Int32Eulers stab_att_sp_euler
with INT32_ANGLE_FRAC
float attitude_max_yaw_rate
Maximum yaw rate in atttiude control in rad/s.
Butterworth2LowPass u[3]
Rotorcraft attitude reference generation.
Rotation quaternion.
angular rates
struct FloatRates u_act_dyn
struct FloatRates g1