Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
eff_scheduling_rotwing_rpm_ctrl.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
25
26#ifndef CTRL_EFF_SCHED_ROTWING_RPM_CTRL_H
27#define CTRL_EFF_SCHED_ROTWING_RPM_CTRL_H
28
29#include "std.h"
30
31#define RW_ap 0 // X body axis (angular acceleration)
32#define RW_aq 1 // Y body axis (angular acceleration)
33#define RW_ar 2 // Z body axis (angular acceleration)
34#define RW_aZ 3 // Z body axis (linear acceleration)
35#define RW_aX 4 // X body axis (linear acceleration)
36
38 float Ixx_body; // body MMOI around roll axis [kgm²]
39 float Iyy_body; // body MMOI around pitch axis [kgm²]
40 float Izz; // total MMOI around yaw axis [kgm²]
41 float Ixx_wing; // wing MMOI around the chordwise direction of the wing [kgm²]
42 float Iyy_wing; // wing MMOI around the spanwise direction of the wing [kgm²]
43 float m; // mass [kg]
44 float CT_hover; // Thrust coefficient for hover motors in the form of T = CT * RPM^2!
45 float CT_pusher; // Thrust coefficient for pusher motor in the form of T = CT * RPM^2!
46 float hover_max_rpm_squared; // max RPM limit for hover motors as configured in ESC
47 float pusher_max_rpm_squared; // max RPM limit for pusher motor as configured in ESC
48 float k_elevator[3];
49 float k_rudder[3];
50 float k_aileron;
51 float k_flaperon;
52 float k_pusher[2];
53 float k_elevator_deflection[2];
54 float d_rudder_d_pprz;
55 float k_lift_wing[2];
56 float k_lift_fuselage;
57 float k_lift_tail;
58 float hover_rpm_lim_coef[2]; // Coefficients for limiting max RPM based on voltage level (following a linear relation)
59 float pusher_rpm_lim_coef[2]; // Coefficients for limiting max RPM based on voltage level (following a linear relation)
60};
62
64 float Ixx; // Total MMOI around roll axis [kgm²]
65 float Iyy; // Total MMOI around pitch axis [kgm²]
66 float wing_rotation_rad; // Wing rotation angle in radians: from ABI message
67 float wing_rotation_deg; // Wing rotation angle in degrees: (clone in degrees)
68 float cosr; // cosine of wing rotation angle
69 float sinr; // sine of wing rotation angle
70 float cosr2; // cosine² of wing rotation angle
71 float sinr2; // sine² of wing rotation angle
72 float sinr3; // sine³ of wing rotation angle
73
74 // commands
75 float cmd_elevator;
76 float cmd_pusher;
79
80 // airspeed
81 float airspeed;
82 float airspeed2;
83};
84
86
89
90extern float eff_sched_pusher_time;
91extern float roll_eff_slider;
92
93extern void eff_scheduling_rotwing_init(void);
94extern void eff_scheduling_rotwing_periodic(void);
95
96#endif // CTRL_EFF_SCHED_ROTWING_RPM_CTRL_H
97
float roll_eff_slider
int32_t rw_flap_offset
struct rotwing_eff_sched_param_t eff_sched_p
float eff_sched_pusher_time
float rotation_angle_setpoint_deg
int16_t rotation_cmd
void eff_scheduling_rotwing_init(void)
void eff_scheduling_rotwing_periodic(void)
int int32_t
Typedef defining 32 bit int type.
short int16_t
Typedef defining 16 bit short type.