Paparazzi UAS  v5.18.0_stable-1-g6993852-dirty
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 Indi_gains {
44  struct FloatRates att;
45  struct FloatRates rate;
46 };
47 
51  float rate_d[3];
52  float rate_dd[3];
53  float u_d[3];
54  float u_dd[3];
55  struct FloatRates g1;
56  float g2;
57  float mu;
58 };
59 
60 struct IndiVariables {
62  struct FloatRates du;
63  struct FloatRates u_in;
65  float rate_d[3];
66 
69  struct FloatRates g1;
70  float g2;
71 
72  struct Indi_gains gains;
73 
74  bool adaptive;
75  float max_rate;
78 };
79 
80 
81 extern struct IndiVariables indi;
82 extern void stabilization_indi_init(void);
83 extern void stabilization_indi_enter(void);
85 extern void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy);
87 extern void stabilization_indi_rate_run(struct FloatRates rates_sp, bool in_flight);
88 extern void stabilization_indi_attitude_run(struct Int32Quat quat_sp, bool in_flight);
89 extern void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn);
90 
91 #endif /* STABILIZATION_INDI_SIMPLE_H */
92 
bool adaptive
Enable adataptive estimation.
struct FloatRates att
float heading
Definition: wedgebug.c:258
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.
struct Indi_gains gains
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.
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
struct FloatRates angular_accel_ref
Butterworth2LowPass u[3]
struct FloatRates rate
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]
void stabilization_indi_attitude_run(struct Int32Quat quat_sp, bool in_flight)
runs stabilization indi
void stabilization_indi_rate_run(struct FloatRates rates_sp, bool in_flight)
Does the INDI calculations.
Rotorcraft attitude reference generation.
Rotation quaternion.
angular rates
struct FloatRates u_act_dyn
struct FloatRates g1