Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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 file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 
23 #ifndef STABILIZATION_INDI
24 #define STABILIZATION_INDI
25 
30 
31 // Scaling for the control effectiveness to make it readible
32 #define INDI_G_SCALING 1000.0
33 
34 extern float g1g2[INDI_OUTPUTS][INDI_NUM_ACT];
35 extern float actuator_state_filt_vect[INDI_NUM_ACT];
36 extern bool act_is_servo[INDI_NUM_ACT];
37 
38 extern bool indi_use_adaptive;
39 
40 extern float *Bwls[INDI_OUTPUTS];
41 
42 extern float thrust_bx_eff;
43 extern float thrust_bx_act_dyn;
44 extern float actuator_thrust_bx_pprz;
45 extern float thrust_bx_state_filt;
46 
47 extern float act_pref[INDI_NUM_ACT];
48 
49 struct Indi_gains {
50  struct FloatRates att;
51  struct FloatRates rate;
52 };
53 
55 
56 extern struct Indi_gains indi_gains;
57 extern float stabilization_indi_filter_freq; //for setting handler
58 
59 extern void stabilization_indi_init(void);
60 extern void stabilization_indi_enter(void);
61 extern void stabilization_indi_rate_run(bool in_flight, struct StabilizationSetpoint *rate_sp, struct ThrustSetpoint *thrust, int32_t *cmd);
62 extern void stabilization_indi_attitude_run(bool in_flight, struct StabilizationSetpoint *att_sp, struct ThrustSetpoint *thrust, int32_t *cmd);
63 extern void stabilization_indi_set_wls_settings(void);
64 extern void stabilization_indi_update_filt_freq(float freq); // setting handler
65 
66 #if !STABILIZATION_INDI_ALLOCATION_PSEUDO_INVERSE
67 #include "math/wls/wls_alloc.h"
68 extern struct WLS_t wls_stab_p;
69 #endif
70 #endif /* STABILIZATION_INDI */
71 
angular rates
General attitude stabilization interface for rotorcrafts.
General stabilization interface for rotorcrafts.
Common data structures shared by euler and quaternion int implementations.
Rotorcraft attitude reference generation.
float thrust_bx_state_filt
void stabilization_indi_enter(void)
Function that resets important values upon engaging INDI.
float act_pref[INDI_NUM_ACT]
void stabilization_indi_rate_run(bool in_flight, struct StabilizationSetpoint *rate_sp, struct ThrustSetpoint *thrust, int32_t *cmd)
Does the INDI calculations.
float * Bwls[INDI_OUTPUTS]
struct Indi_gains indi_gains
void stabilization_indi_set_wls_settings(void)
Function that sets the u_min, u_max and u_pref if function not elsewhere defined.
bool act_is_servo[INDI_NUM_ACT]
struct WLS_t wls_stab_p
float g1g2[INDI_OUTPUTS][INDI_NUM_ACT]
float actuator_thrust_bx_pprz
void stabilization_indi_update_filt_freq(float freq)
void stabilization_indi_init(void)
Function that initializes important values upon engaging INDI.
float stablization_indi_yaw_dist_limit
Limit the maximum specific moment that can be compensated (units rad/s^2)
void stabilization_indi_attitude_run(bool in_flight, struct StabilizationSetpoint *att_sp, struct ThrustSetpoint *thrust, int32_t *cmd)
runs stabilization indi
float actuator_state_filt_vect[INDI_NUM_ACT]
bool indi_use_adaptive
float stabilization_indi_filter_freq
float thrust_bx_eff
float thrust_bx_act_dyn
struct FloatRates rate
struct FloatRates att
Stabilization setpoint.
Definition: stabilization.h:53
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
Definition: stabilization.h:82
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83