Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
eff_scheduling_rotwing.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_ROTWING_H
27 #define CTRL_EFF_SCHED_ROTWING_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 DMdpprz_hover_pitch[2]; // Moment coeficients for pitch motors (Scaled by 10000)
40  float hover_roll_pitch_coef[2]; // Model coefficients to correct pitch effective for roll motors
41  float hover_roll_roll_coef[2]; // Model coefficients to correct roll effectiveness for roll motors
42  float k_elevator[3];
43  float k_rudder[3];
44  float k_aileron;
45  float k_flaperon;
46  float k_pusher[2];
50  float k_lift_wing[2];
52  float k_lift_tail;
53 };
55 
57  float Ixx; // Total MMOI around roll axis [kgm²]
58  float Iyy; // Total MMOI around pitch axis [kgm²]
59  float wing_rotation_rad; // Wing rotation angle in radians: from ABI message
60  float wing_rotation_deg; // Wing rotation angle in degrees: (clone in degrees)
61  float cosr; // cosine of wing rotation angle
62  float sinr; // sine of wing rotation angle
63  float cosr2; // cosine² of wing rotation angle
64  float sinr2; // sine² of wing rotation angle
65  float sinr3; // sine³ of wing rotation angle
66 
67  // Set during initialization
68  float pitch_motor_dMdpprz; // derivative of delta moment with respect to a delta paparazzi command for the pitch motors [Nm/pprz]
69  float roll_motor_dMdpprz; // derivative of delta moment with respect to a delta paparazzi command for the roll motors [Nm/pprz]
70 
71  // commands
72  float cmd_elevator;
73  float cmd_pusher;
76 
77  // airspeed
78  float airspeed;
79  float airspeed2;
80 };
81 
82 extern int32_t rw_flap_offset;
83 
84 extern float rotation_angle_setpoint_deg;
85 extern int16_t rotation_cmd;
86 
87 extern float eff_sched_pusher_time;
88 extern float roll_eff_slider;
89 
90 extern void eff_scheduling_rotwing_init(void);
91 extern void eff_scheduling_rotwing_periodic(void);
92 
93 #endif // CTRL_EFF_SCHED_ROTWING_H
94 
float roll_eff_slider
int32_t rw_flap_offset
float rotation_angle_setpoint_deg
struct rotwing_eff_sched_param_t eff_sched_p
void eff_scheduling_rotwing_init(void)
int16_t rotation_cmd
float eff_sched_pusher_time
void eff_scheduling_rotwing_periodic(void)
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
short int16_t
Typedef defining 16 bit short type.
Definition: vl53l1_types.h:93