Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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 
IndiVariables::u_act_dyn
struct FloatRates u_act_dyn
Definition: stabilization_indi_simple.h:64
stabilization_indi_attitude_run
void stabilization_indi_attitude_run(struct Int32Quat quat_sp, bool in_flight)
runs stabilization indi
Definition: stabilization_indi.c:496
stabilization_indi_read_rc
void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
This function reads rc commands.
Definition: stabilization_indi.c:525
IndiVariables::rate_d
float rate_d[3]
Definition: stabilization_indi_simple.h:65
IndiEstimation::u_dd
float u_dd[3]
Definition: stabilization_indi_simple.h:54
IndiVariables::u
Butterworth2LowPass u[3]
Definition: stabilization_indi_simple.h:67
IndiEstimation::g1
struct FloatRates g1
Definition: stabilization_indi_simple.h:55
Int32Quat
Rotation quaternion.
Definition: pprz_algebra_int.h:99
stab_att_sp_quat
struct Int32Quat stab_att_sp_quat
with INT32_QUAT_FRAC
Definition: stabilization_attitude_heli_indi.c:127
IndiVariables::u_in
struct FloatRates u_in
Definition: stabilization_indi_simple.h:63
SecondOrderLowPass
Second order low pass filter structure.
Definition: low_pass_filter.h:125
stabilization_indi_init
void stabilization_indi_init(void)
Function that initializes important values upon engaging INDI.
Definition: stabilization_indi.c:206
stabilization_attitude_ref_quat_int.h
IndiVariables::max_rate
float max_rate
Maximum rate in rate control in rad/s.
Definition: stabilization_indi_simple.h:75
IndiVariables
Definition: stabilization_indi_simple.h:60
stabilization_indi_set_failsafe_setpoint
void stabilization_indi_set_failsafe_setpoint(void)
Function that calculates the failsafe setpoint.
Definition: stabilization_indi.c:294
IndiEstimation::rate
Butterworth2LowPass rate[3]
Definition: stabilization_indi_simple.h:50
IndiVariables::adaptive
bool adaptive
Enable adataptive estimation.
Definition: stabilization_indi_simple.h:74
IndiVariables::angular_accel_ref
struct FloatRates angular_accel_ref
Definition: stabilization_indi_simple.h:61
stab_att_sp_euler
struct Int32Eulers stab_att_sp_euler
with INT32_ANGLE_FRAC
Definition: stabilization_attitude_euler_float.c:45
Indi_gains::rate
struct FloatRates rate
Definition: stabilization_indi.h:43
IndiVariables::g1
struct FloatRates g1
Definition: stabilization_indi_simple.h:69
IndiVariables::du
struct FloatRates du
Definition: stabilization_indi_simple.h:62
stabilization_indi_rate_run
void stabilization_indi_rate_run(struct FloatRates rates_sp, bool in_flight)
Does the INDI calculations.
Definition: stabilization_indi.c:347
IndiEstimation::mu
float mu
Definition: stabilization_indi_simple.h:57
Int32Vect2
Definition: pprz_algebra_int.h:83
Int32Eulers
euler angles
Definition: pprz_algebra_int.h:146
IndiEstimation::g2
float g2
Definition: stabilization_indi_simple.h:56
IndiVariables::est
struct IndiEstimation est
Estimation parameters for adaptive INDI.
Definition: stabilization_indi_simple.h:77
IndiEstimation::u_d
float u_d[3]
Definition: stabilization_indi_simple.h:53
stabilization_indi_set_earth_cmd_i
void stabilization_indi_set_earth_cmd_i(struct Int32Vect2 *cmd, int32_t heading)
Set attitude setpoint from command in earth axes.
Definition: stabilization_indi.c:323
IndiEstimation::u
Butterworth2LowPass u[3]
Definition: stabilization_indi_simple.h:49
IndiEstimation::rate_d
float rate_d[3]
Definition: stabilization_indi_simple.h:51
IndiEstimation::rate_dd
float rate_dd[3]
Definition: stabilization_indi_simple.h:52
int32_t
signed long int32_t
Definition: types.h:19
IndiVariables::g2
float g2
Definition: stabilization_indi_simple.h:70
IndiVariables::rate
Butterworth2LowPass rate[3]
Definition: stabilization_indi_simple.h:68
IndiVariables::attitude_max_yaw_rate
float attitude_max_yaw_rate
Maximum yaw rate in atttiude control in rad/s.
Definition: stabilization_indi_simple.h:76
IndiVariables::gains
struct Indi_gains gains
Definition: stabilization_indi_simple.h:72
Indi_gains
Definition: stabilization_indi.h:41
IndiEstimation
Definition: stabilization_indi_simple.h:48
indi
struct IndiVariables indi
Definition: stabilization_indi_simple.c:85
stabilization_indi_enter
void stabilization_indi_enter(void)
Function that resets important values upon engaging INDI.
Definition: stabilization_indi.c:256
Indi_gains::att
struct FloatRates att
Definition: stabilization_indi.h:42
stabilization_indi_set_rpy_setpoint_i
void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy)
Set attitude quaternion setpoint from rpy.
Definition: stabilization_indi.c:309
FloatRates
angular rates
Definition: pprz_algebra_float.h:93
low_pass_filter.h
Simple first order low pass filter with bilinear transform.
heading
float heading
Definition: wedgebug.c:258