Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
eff_scheduling_rot_wing.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Dennis van Wijngaarden <D.C.vanWijngaarden@tudelft.nl>
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, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
26 #ifndef CTRL_EFF_SCHED_ROT_WING_H
27 #define CTRL_EFF_SCHED_ROT_WING_H
28 
29 #include "std.h"
30 
32  float Ixx_body; // body MMOI around roll axis [kgm²]
33  float Iyy_body; // body MMOI around pitch axis [kgm²]
34  float Izz; // total MMOI around yaw axis [kgm²]
35  float Ixx_wing; // wing MMOI around the chordwise direction of the wing [kgm²]
36  float Iyy_wing; // wing MMOI around the spanwise direction of the wing [kgm²]
37  float m; // mass [kg]
38  float DMdpprz_hover_roll[2]; // Moment coeficients for roll motors (Scaled by 10000)
39  float hover_roll_pitch_coef[2]; // Model coefficients to correct pitch effective for roll motors
40  float hover_roll_roll_coef[2]; // Model coefficients to correct roll effectiveness for roll motors
41  float k_elevator[3];
42  float k_rudder[3];
43  float k_aileron;
44  float k_flaperon;
45  float k_pusher[2];
49  float k_lift_wing[2];
51  float k_lift_tail;
52 };
53 
55  float Ixx; // Total MMOI around roll axis [kgm²]
56  float Iyy; // Total MMOI around pitch axis [kgm²]
57  float wing_rotation_rad; // Wing rotation angle in radians: from ABI message
58  float wing_rotation_deg; // Wing rotation angle in degrees: (clone in degrees)
59  float cosr; // cosine of wing rotation angle
60  float sinr; // sine of wing rotation angle
61  float cosr2; // cosine² of wing rotation angle
62  float sinr2; // sine² of wing rotation angle
63  float sinr3; // sine³ of wing rotation angle
64 
65  // Set during initialization
66  float pitch_motor_dMdpprz; // derivative of delta moment with respect to a delta paparazzi command for the pitch motors [Nm/pprz]
67  float roll_motor_dMdpprz; // derivative of delta moment with respect to a delta paparazzi command for the roll motors [Nm/pprz]
68 
69  // commands
70  float cmd_elevator;
71  float cmd_pusher;
74 
75  // airspeed
76  float airspeed;
77  float airspeed2;
78 };
79 
80 extern float rotation_angle_setpoint_deg;
81 extern int16_t rotation_cmd;
82 
83 extern void eff_scheduling_rot_wing_init(void);
84 extern void eff_scheduling_rot_wing_periodic(void);
85 
86 #endif // CTRL_EFF_SCHED_ROT_WING_H
87 
void eff_scheduling_rot_wing_init(void)
void eff_scheduling_rot_wing_periodic(void)
float rotation_angle_setpoint_deg
int16_t rotation_cmd
short int16_t
Typedef defining 16 bit short type.
Definition: vl53l1_types.h:93