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
37
struct
rotwing_eff_sched_param_t
{
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
};
61
extern
struct
rotwing_eff_sched_param_t
eff_sched_p
;
62
63
struct
rotwing_eff_sched_var_t
{
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
;
77
float
cmd_pusher_scaled
;
78
float
cmd_T_mean_scaled
;
79
80
// airspeed
81
float
airspeed
;
82
float
airspeed2
;
83
};
84
85
extern
int32_t
rw_flap_offset
;
86
87
extern
float
rotation_angle_setpoint_deg
;
88
extern
int16_t
rotation_cmd
;
89
90
extern
float
eff_sched_pusher_time
;
91
extern
float
roll_eff_slider
;
92
93
extern
void
eff_scheduling_rotwing_init
(
void
);
94
extern
void
eff_scheduling_rotwing_periodic
(
void
);
95
96
#endif
// CTRL_EFF_SCHED_ROTWING_RPM_CTRL_H
97
roll_eff_slider
float roll_eff_slider
Definition
eff_scheduling_rotwing.c:173
rw_flap_offset
int32_t rw_flap_offset
Definition
eff_scheduling_rotwing.c:151
eff_sched_p
struct rotwing_eff_sched_param_t eff_sched_p
Definition
eff_scheduling_rotwing.c:127
eff_sched_pusher_time
float eff_sched_pusher_time
Definition
eff_scheduling_rotwing.c:172
rotation_angle_setpoint_deg
float rotation_angle_setpoint_deg
rotation_cmd
int16_t rotation_cmd
rotwing_eff_sched_var_t::cosr
float cosr
Definition
eff_scheduling_plusquad.h:73
rotwing_eff_sched_var_t::airspeed2
float airspeed2
Definition
eff_scheduling_rotwing.h:85
rotwing_eff_sched_var_t::wing_rotation_deg
float wing_rotation_deg
Definition
eff_scheduling_plusquad.h:72
rotwing_eff_sched_param_t::hover_max_rpm_squared
float hover_max_rpm_squared
Definition
eff_scheduling_rotwing_rpm_ctrl.h:46
rotwing_eff_sched_param_t::hover_rpm_lim_coef
float hover_rpm_lim_coef[2]
Definition
eff_scheduling_rotwing_rpm_ctrl.h:58
rotwing_eff_sched_param_t::CT_hover
float CT_hover
Definition
eff_scheduling_rotwing_rpm_ctrl.h:44
rotwing_eff_sched_var_t::airspeed
float airspeed
Definition
eff_scheduling_rotwing.h:84
rotwing_eff_sched_param_t::pusher_rpm_lim_coef
float pusher_rpm_lim_coef[2]
Definition
eff_scheduling_rotwing_rpm_ctrl.h:59
rotwing_eff_sched_var_t::cmd_pusher
float cmd_pusher
Definition
eff_scheduling_rotwing.h:79
rotwing_eff_sched_param_t::k_aileron
float k_aileron
Definition
eff_scheduling_rotwing.h:50
rotwing_eff_sched_param_t::Ixx_body
float Ixx_body
Definition
eff_scheduling_rotwing.h:38
rotwing_eff_sched_param_t::k_lift_fuselage
float k_lift_fuselage
Definition
eff_scheduling_rotwing.h:57
rotwing_eff_sched_param_t::Iyy_wing
float Iyy_wing
Definition
eff_scheduling_rotwing.h:42
rotwing_eff_sched_param_t::m
float m
Definition
eff_scheduling_rotwing.h:43
rotwing_eff_sched_param_t::k_elevator_deflection
float k_elevator_deflection[2]
Definition
eff_scheduling_rotwing.h:53
rotwing_eff_sched_var_t::sinr
float sinr
Definition
eff_scheduling_plusquad.h:74
rotwing_eff_sched_var_t::cmd_pusher_scaled
float cmd_pusher_scaled
Definition
eff_scheduling_rotwing.h:80
rotwing_eff_sched_param_t::d_rudder_d_pprz
float d_rudder_d_pprz
Definition
eff_scheduling_rotwing.h:54
rotwing_eff_sched_param_t::k_rudder
float k_rudder[3]
Definition
eff_scheduling_rotwing.h:49
rotwing_eff_sched_param_t::k_lift_wing
float k_lift_wing[2]
Definition
eff_scheduling_rotwing.h:56
rotwing_eff_sched_param_t::Izz
float Izz
Definition
eff_scheduling_rotwing.h:40
rotwing_eff_sched_var_t::wing_rotation_rad
float wing_rotation_rad
Definition
eff_scheduling_plusquad.h:71
rotwing_eff_sched_var_t::sinr2
float sinr2
Definition
eff_scheduling_plusquad.h:76
rotwing_eff_sched_var_t::Ixx
float Ixx
Definition
eff_scheduling_plusquad.h:69
rotwing_eff_sched_param_t::k_lift_tail
float k_lift_tail
Definition
eff_scheduling_rotwing.h:58
rotwing_eff_sched_var_t::cmd_T_mean_scaled
float cmd_T_mean_scaled
Definition
eff_scheduling_rotwing.h:81
rotwing_eff_sched_var_t::cmd_elevator
float cmd_elevator
Definition
eff_scheduling_rotwing.h:78
rotwing_eff_sched_param_t::pusher_max_rpm_squared
float pusher_max_rpm_squared
Definition
eff_scheduling_rotwing_rpm_ctrl.h:47
rotwing_eff_sched_param_t::k_pusher
float k_pusher[2]
Definition
eff_scheduling_rotwing.h:52
rotwing_eff_sched_param_t::k_elevator
float k_elevator[3]
Definition
eff_scheduling_rotwing.h:48
rotwing_eff_sched_param_t::k_flaperon
float k_flaperon
Definition
eff_scheduling_rotwing.h:51
rotwing_eff_sched_var_t::cosr2
float cosr2
Definition
eff_scheduling_plusquad.h:75
rotwing_eff_sched_param_t::Iyy_body
float Iyy_body
Definition
eff_scheduling_rotwing.h:39
rotwing_eff_sched_param_t::CT_pusher
float CT_pusher
Definition
eff_scheduling_rotwing_rpm_ctrl.h:45
rotwing_eff_sched_param_t::Ixx_wing
float Ixx_wing
Definition
eff_scheduling_rotwing.h:41
rotwing_eff_sched_var_t::sinr3
float sinr3
Definition
eff_scheduling_plusquad.h:78
rotwing_eff_sched_var_t::Iyy
float Iyy
Definition
eff_scheduling_plusquad.h:70
rotwing_eff_sched_param_t
Definition
eff_scheduling_rotwing.h:37
rotwing_eff_sched_var_t
Definition
eff_scheduling_plusquad.h:68
eff_scheduling_rotwing_init
void eff_scheduling_rotwing_init(void)
Definition
eff_scheduling_plusquad.c:102
eff_scheduling_rotwing_periodic
void eff_scheduling_rotwing_periodic(void)
Definition
eff_scheduling_plusquad.c:236
int32_t
int int32_t
Typedef defining 32 bit int type.
Definition
vl53l1_types.h:83
int16_t
short int16_t
Typedef defining 16 bit short type.
Definition
vl53l1_types.h:93
sw
airborne
modules
ctrl
eff_scheduling_rotwing_rpm_ctrl.h
Generated on
for Paparazzi UAS by
1.15.0