Paparazzi UAS  v6.2_unstable
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 {
61  float cutoff_r;
63  struct FloatRates du;
64  struct FloatRates u_in;
66  float rate_d[3];
67 
70  struct FloatRates g1;
71  float g2;
72 
73  struct Indi_gains gains;
74 
75  bool adaptive;
76  float max_rate;
79 };
80 
81 
82 extern struct IndiVariables indi;
83 extern void stabilization_indi_init(void);
84 extern void stabilization_indi_enter(void);
86 extern void stabilization_indi_set_rpy_setpoint_i(struct Int32Eulers *rpy);
88 extern void stabilization_indi_rate_run(struct FloatRates rates_sp, bool in_flight);
89 extern void stabilization_indi_attitude_run(struct Int32Quat quat_sp, bool in_flight);
90 extern void stabilization_indi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn);
91 extern void stabilization_indi_simple_reset_r_filter_cutoff(float new_cutoff);
92 
93 #endif /* STABILIZATION_INDI_SIMPLE_H */
94 
IndiVariables::u_act_dyn
struct FloatRates u_act_dyn
Definition: stabilization_indi_simple.h:65
stabilization_indi_attitude_run
void stabilization_indi_attitude_run(struct Int32Quat quat_sp, bool in_flight)
runs stabilization indi
Definition: stabilization_indi.c:548
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:592
IndiVariables::rate_d
float rate_d[3]
Definition: stabilization_indi_simple.h:66
IndiEstimation::u_dd
float u_dd[3]
Definition: stabilization_indi_simple.h:54
IndiVariables::u
Butterworth2LowPass u[3]
Definition: stabilization_indi_simple.h:68
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:64
SecondOrderLowPass
Second order low pass filter structure.
Definition: low_pass_filter.h:136
stabilization_indi_init
void stabilization_indi_init(void)
Function that initializes important values upon engaging INDI.
Definition: stabilization_indi.c:226
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:76
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:322
IndiEstimation::rate
Butterworth2LowPass rate[3]
Definition: stabilization_indi_simple.h:50
IndiVariables::adaptive
bool adaptive
Enable adataptive estimation.
Definition: stabilization_indi_simple.h:75
IndiVariables::angular_accel_ref
struct FloatRates angular_accel_ref
Definition: stabilization_indi_simple.h:62
stab_att_sp_euler
struct Int32Eulers stab_att_sp_euler
with INT32_ANGLE_FRAC
Definition: stabilization_attitude_euler_float.c:45
IndiVariables::cutoff_r
float cutoff_r
Definition: stabilization_indi_simple.h:61
Indi_gains::rate
struct FloatRates rate
Definition: stabilization_indi.h:43
IndiVariables::g1
struct FloatRates g1
Definition: stabilization_indi_simple.h:70
IndiVariables::du
struct FloatRates du
Definition: stabilization_indi_simple.h:63
stabilization_indi_rate_run
void stabilization_indi_rate_run(struct FloatRates rates_sp, bool in_flight)
Does the INDI calculations.
Definition: stabilization_indi.c:375
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:78
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:351
int32_t
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
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
IndiVariables::g2
float g2
Definition: stabilization_indi_simple.h:71
IndiVariables::rate
Butterworth2LowPass rate[3]
Definition: stabilization_indi_simple.h:69
IndiVariables::attitude_max_yaw_rate
float attitude_max_yaw_rate
Maximum yaw rate in atttiude control in rad/s.
Definition: stabilization_indi_simple.h:77
IndiVariables::gains
struct Indi_gains gains
Definition: stabilization_indi_simple.h:73
Indi_gains
Definition: stabilization_indi.h:41
IndiEstimation
Definition: stabilization_indi_simple.h:48
stabilization_indi_simple_reset_r_filter_cutoff
void stabilization_indi_simple_reset_r_filter_cutoff(float new_cutoff)
Definition: stabilization_indi_simple.c:216
indi
struct IndiVariables indi
Definition: stabilization_indi_simple.c:104
stabilization_indi_enter
void stabilization_indi_enter(void)
Function that resets important values upon engaging INDI.
Definition: stabilization_indi.c:277
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:337
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