Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_attitude_heli_indi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef STABILIZATION_ATTITUDE_HELI_INDI_H
23 #define STABILIZATION_ATTITUDE_HELI_INDI_H
24 
25 #include "math/pprz_algebra_int.h"
26 
27 #include "filters/notch_filter.h"
29 
30 #define __k 1
31 #define INDI_NR_FILTERS 2
32 #define INDI_DOF 4
33 #define INDI_ROLL 0
34 #define INDI_PITCH 1
35 #define INDI_YAW 2
36 #define INDI_THRUST 3
37 #define INDI_YAW_BUFFER_SIZE 9
38 
39 struct HeliIndiGains {
44 };
45 
46 /* All these values are in the struct to make it easier for logging */
60  bool enable_notch;
64  void (*apply_compensator_filters)(int32_t _out[], int32_t _in[]);
65  void (*apply_actuator_models)(int32_t _out[], int32_t _in[]);
68 };
69 
70 //extern struct IndiController_int heli_indi_ctl; // keep private
71 
73 extern struct Int32Quat stab_att_sp_quat;
74 extern struct Int32Eulers stab_att_sp_euler;
75 extern struct HeliIndiGains heli_indi_gains;
76 
80 
81 #endif /* STABILIZATION_ATTITUDE_HELI_INDI_H */
IndiController_int::apply_actuator_filters
void(* apply_actuator_filters[INDI_NR_FILTERS])(int32_t _out[], int32_t _in[])
Definition: stabilization_attitude_heli_indi.h:66
IndiController_int::error
int32_t error[INDI_DOF]
virtual control minus measurement
Definition: stabilization_attitude_heli_indi.h:49
stab_att_sp_quat
struct Int32Quat stab_att_sp_quat
with INT32_QUAT_FRAC
Definition: stabilization_attitude_heli_indi.c:127
stab_att_sp_euler
struct Int32Eulers stab_att_sp_euler
with INT32_ANGLE_FRAC
Definition: stabilization_attitude_euler_float.c:45
stabilization_attitude_heli_indi_set_steadystate_pitch
void stabilization_attitude_heli_indi_set_steadystate_pitch(float pitch)
stabilization_attitude_heli_indi_set_steadystate_pitch
Definition: stabilization_attitude_heli_indi.c:298
notch_filter.h
Second order notch filter.
IndiController_int::pitch_comp_angle
int32_t pitch_comp_angle
Angle to rotate pitch/roll commands with INT32_ANGLE_FRAC.
Definition: stabilization_attitude_heli_indi.h:58
IndiController_int::du
int32_t du[INDI_DOF]
Actuator commanded increment.
Definition: stabilization_attitude_heli_indi.h:51
stabilization_attitude_heli_indi_set_steadystate_roll
void stabilization_attitude_heli_indi_set_steadystate_roll(float roll)
stabilization_attitude_heli_indi_set_steadystate_roll
Definition: stabilization_attitude_heli_indi.c:311
Int32Quat
Rotation quaternion.
Definition: pprz_algebra_int.h:99
delayed_first_order_lowpass_filter_t
Definition: delayed_first_order_lowpass_filter.h:35
heli_indi_gains
struct HeliIndiGains heli_indi_gains
Definition: stabilization_attitude_heli_indi.c:131
IndiController_int::motor_rpm
int16_t motor_rpm
RPM of the main motor.
Definition: stabilization_attitude_heli_indi.h:61
IndiController_int::filtered_measurement
int32_t filtered_measurement[INDI_NR_FILTERS][INDI_DOF]
Filtered measurement.
Definition: stabilization_attitude_heli_indi.h:57
IndiController_int::sp_offset_pitch
float sp_offset_pitch
Neutral pitch angle [deg].
Definition: stabilization_attitude_heli_indi.h:63
pprz_algebra_int.h
Paparazzi fixed point algebra.
IndiController_int::apply_compensator_filters
void(* apply_compensator_filters)(int32_t _out[], int32_t _in[])
Definition: stabilization_attitude_heli_indi.h:64
HeliIndiGains::yaw_p
int32_t yaw_p
Definition: stabilization_attitude_heli_indi.h:42
IndiController_int::reference
int32_t reference[INDI_DOF]
Range -MAX_PPRZ:MAX_PPRZ.
Definition: stabilization_attitude_heli_indi.h:48
IndiController_int::invG
int32_t invG[INDI_DOF][INDI_DOF]
Inverse control effectiveness matrix.
Definition: stabilization_attitude_heli_indi.h:50
IndiController_int::actuator_out
int32_t actuator_out[INDI_DOF]
Actuator position.
Definition: stabilization_attitude_heli_indi.h:53
IndiController_int
Definition: stabilization_attitude_heli_indi.h:47
IndiController_int::command_out
int32_t command_out[2][INDI_DOF]
Command and command from previous measurement.
Definition: stabilization_attitude_heli_indi.h:54
IndiController_int::apply_measurement_filters
void(* apply_measurement_filters[INDI_NR_FILTERS])(int32_t _out[], int32_t _in[])
Definition: stabilization_attitude_heli_indi.h:67
IndiController_int::roll_comp_angle
int32_t roll_comp_angle
Angle to rotate pitch/roll commands with INT32_ANGLE_FRAC.
Definition: stabilization_attitude_heli_indi.h:59
IndiController_int::u_setpoint
int32_t u_setpoint[INDI_DOF]
Actuator setpoint without compensator.
Definition: stabilization_attitude_heli_indi.h:52
int16_t
signed short int16_t
Definition: types.h:17
IndiController_int::filtered_actuator
int32_t filtered_actuator[INDI_NR_FILTERS][INDI_DOF]
Filtered actuator position.
Definition: stabilization_attitude_heli_indi.h:55
Int32Eulers
euler angles
Definition: pprz_algebra_int.h:146
IndiController_int::sp_offset_roll
float sp_offset_roll
Neutral roll angle [deg].
Definition: stabilization_attitude_heli_indi.h:62
IndiController_int::apply_actuator_models
void(* apply_actuator_models)(int32_t _out[], int32_t _in[])
Definition: stabilization_attitude_heli_indi.h:65
IndiController_int::enable_notch
bool enable_notch
Use notch filters.
Definition: stabilization_attitude_heli_indi.h:60
stabilization_attitude_heli_indi_set_steadystate_pitchroll
void stabilization_attitude_heli_indi_set_steadystate_pitchroll(void)
stabilization_attitude_heli_indi_set_steadystate_pitchroll
Definition: stabilization_attitude_heli_indi.c:323
actuator_model
struct delayed_first_order_lowpass_filter_t actuator_model[INDI_DOF]
Definition: stabilization_attitude_heli_indi.c:142
INDI_NR_FILTERS
#define INDI_NR_FILTERS
Definition: stabilization_attitude_heli_indi.h:31
int32_t
signed long int32_t
Definition: types.h:19
HeliIndiGains::roll_p
int32_t roll_p
Definition: stabilization_attitude_heli_indi.h:40
INDI_DOF
#define INDI_DOF
Definition: stabilization_attitude_heli_indi.h:32
HeliIndiGains
Definition: stabilization_attitude_heli_indi.h:39
delayed_first_order_lowpass_filter.h
First order low-pass filter with delay.
HeliIndiGains::yaw_d
int32_t yaw_d
Definition: stabilization_attitude_heli_indi.h:43
IndiController_int::measurement
int32_t measurement[INDI_DOF]
Raw measurement.
Definition: stabilization_attitude_heli_indi.h:56
HeliIndiGains::pitch_p
int32_t pitch_p
Definition: stabilization_attitude_heli_indi.h:41