Paparazzi UAS
v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
eff_scheduling_plusquad.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2023 Tomaso De Ponti <T.M.L.DePonti@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
#include "generated/airframe.h"
31
32
#ifndef EFF_MAT_ROWS_NB
33
#define EFF_MAT_ROWS_NB 6
34
#endif
35
36
#define RW_aX 0
// X body axis (linear acceleration)
37
#define RW_aY 1
// Y body axis (linear acceleration)
38
#define RW_aZ 2
// Z body axis (linear acceleration)
39
#define RW_aN 0
// North axis (linear acceleration)
40
#define RW_aE 1
// East axis (linear acceleration)
41
#define RW_aD 2
// Down axis (linear acceleration)
42
#define RW_ap 3
// X body axis (angular acceleration)
43
#define RW_aq 4
// Y body axis (angular acceleration)
44
#define RW_ar 5
// Z body axis (angular acceleration)
45
46
#ifndef COMMANDS_NB_VIRTUAL
47
#define COMMANDS_NB_VIRTUAL 0
48
#endif
49
50
#ifndef COMMAND_ROLL
51
#define COMMAND_ROLL COMMANDS_NB+1
52
#endif
53
54
#ifndef COMMAND_PITCH
55
#define COMMAND_PITCH COMMANDS_NB+2
56
#endif
57
58
#ifndef EFF_MAT_COLS_NB
59
#define EFF_MAT_COLS_NB (COMMANDS_NB_REAL + COMMANDS_NB_VIRTUAL)
60
#endif
61
62
#define RW_G_SCALE 1000.0f
63
64
extern
float
EFF_MAT_RW
[
EFF_MAT_ROWS_NB
][
EFF_MAT_COLS_NB
];
65
extern
float
G2_RW
[
EFF_MAT_COLS_NB
] ;
66
extern
float
G1_RW
[
EFF_MAT_ROWS_NB
][
EFF_MAT_COLS_NB
] ;
67
68
struct
rotwing_eff_sched_var_t
{
69
float
Ixx
;
// Total MMOI around roll axis [kgm²]
70
float
Iyy
;
// Total MMOI around pitch axis [kgm²]
71
float
wing_rotation_rad
;
// Wing rotation angle in radians: from ABI message
72
float
wing_rotation_deg
;
// Wing rotation angle in degrees: (clone in degrees)
73
float
cosr
;
// cosine of wing rotation angle
74
float
sinr
;
// sine of wing rotation angle
75
float
cosr2
;
// cosine² of wing rotation angle
76
float
sinr2
;
// sine² of wing rotation angle
77
float
cosr3
;
// cosine³ of wing rotation angle
78
float
sinr3
;
// sine³ of wing rotation angle
79
};
80
81
struct
I
{
82
float
xx
;
83
float
yy
;
84
float
zz
;
85
float
w_xx
;
86
float
w_yy
;
87
float
b_xx
;
88
float
b_yy
;
89
};
90
struct
F_M_Body
{
91
float
dFdu
;
// derivative of the force with respect to the control input (e.g. linear coefficient)
92
float
dMdu
;
// derivative of the reaction trque with respect to the control input (e.g. linear coefficient)
93
float
dMdud
;
// derivative of the reaction torque with respect to the control input time derivative
94
float
l
;
// arm length
95
};
96
97
struct
RW_attitude
{
98
float
phi
;
99
float
theta
;
100
float
psi
;
101
float
sphi
;
102
float
cphi
;
103
float
stheta
;
104
float
ctheta
;
105
float
spsi
;
106
float
cpsi
;
107
};
108
109
struct
RW_Model
{
110
struct
I
I
;
// Inertia matrix
111
float
m
;
// mass [kg]
112
float
T
;
// Thrust [N]
113
float
P
;
// Pusher thrust [N]
114
struct
RW_attitude
att
;
115
struct
F_M_Body
mF
;
116
struct
F_M_Body
mR
;
117
struct
F_M_Body
mB
;
118
struct
F_M_Body
mL
;
119
struct
F_M_Body
mP
;
120
struct
F_M_Body
ele
;
121
struct
F_M_Body
rud
;
122
struct
F_M_Body
ail
;
123
struct
F_M_Body
flp
;
124
};
125
126
extern
bool
manual_roll
;
127
extern
bool
manual_pitch
;
128
extern
bool
manual_yaw
;
129
130
extern
float
roll_mult
;
131
extern
float
pitch_mult
;
132
extern
float
yaw_mult
;
133
extern
float
thrust_mult
;
134
135
extern
int
G2_on
;
136
extern
int
thrust_curve
;
137
extern
float
temp_mQ_k
;
138
139
extern
float
roll_eff
;
140
extern
float
yaw_eff
;
141
extern
float
ele_min
;
142
143
extern
void
eff_scheduling_rotwing_init
(
void
);
144
extern
void
eff_scheduling_rotwing_periodic
(
void
);
145
146
extern
struct
RW_Model
RW
;
147
#endif
// CTRL_EFF_SCHED_ROTWING_H
148
yaw_mult
float yaw_mult
Definition
eff_scheduling_plusquad.c:64
G2_RW
float G2_RW[EFF_MAT_COLS_NB]
Definition
eff_scheduling_plusquad.c:68
thrust_curve
int thrust_curve
Definition
eff_scheduling_plusquad.c:88
G1_RW
float G1_RW[EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB]
Definition
eff_scheduling_plusquad.c:69
ele_min
float ele_min
Definition
eff_scheduling_plusquad.c:84
thrust_mult
float thrust_mult
Definition
eff_scheduling_plusquad.c:65
G2_on
int G2_on
Definition
eff_scheduling_plusquad.c:81
RW
struct RW_Model RW
Definition
eff_scheduling_plusquad.c:86
manual_pitch
bool manual_pitch
Definition
eff_scheduling_plusquad.c:59
roll_eff
float roll_eff
Definition
eff_scheduling_plusquad.c:82
EFF_MAT_COLS_NB
#define EFF_MAT_COLS_NB
Definition
eff_scheduling_plusquad.h:59
EFF_MAT_RW
float EFF_MAT_RW[EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB]
Definition
eff_scheduling_plusquad.c:70
manual_roll
bool manual_roll
Definition
eff_scheduling_plusquad.c:58
pitch_mult
float pitch_mult
Definition
eff_scheduling_plusquad.c:63
yaw_eff
float yaw_eff
Definition
eff_scheduling_plusquad.c:83
eff_scheduling_rotwing_init
void eff_scheduling_rotwing_init(void)
Definition
eff_scheduling_plusquad.c:102
EFF_MAT_ROWS_NB
#define EFF_MAT_ROWS_NB
Definition
eff_scheduling_plusquad.h:33
manual_yaw
bool manual_yaw
Definition
eff_scheduling_plusquad.c:60
eff_scheduling_rotwing_periodic
void eff_scheduling_rotwing_periodic(void)
Definition
eff_scheduling_plusquad.c:236
temp_mQ_k
float temp_mQ_k
Definition
eff_scheduling_plusquad.c:89
roll_mult
float roll_mult
Definition
eff_scheduling_plusquad.c:62
rotwing_eff_sched_var_t::cosr
float cosr
Definition
eff_scheduling_plusquad.h:73
RW_Model::ele
struct F_M_Body ele
Definition
eff_scheduling_plusquad.h:120
RW_Model::mP
struct F_M_Body mP
Definition
eff_scheduling_plusquad.h:119
rotwing_eff_sched_var_t::wing_rotation_deg
float wing_rotation_deg
Definition
eff_scheduling_plusquad.h:72
I::b_yy
float b_yy
Definition
eff_scheduling_plusquad.h:88
RW_attitude::sphi
float sphi
Definition
eff_scheduling_plusquad.h:101
I::yy
float yy
Definition
eff_scheduling_plusquad.h:83
RW_Model::mL
struct F_M_Body mL
Definition
eff_scheduling_plusquad.h:118
I::w_yy
float w_yy
Definition
eff_scheduling_plusquad.h:86
RW_attitude::ctheta
float ctheta
Definition
eff_scheduling_plusquad.h:104
RW_Model::T
float T
Definition
eff_scheduling_plusquad.h:112
rotwing_eff_sched_var_t::sinr
float sinr
Definition
eff_scheduling_plusquad.h:74
I::b_xx
float b_xx
Definition
eff_scheduling_plusquad.h:87
I::xx
float xx
Definition
eff_scheduling_plusquad.h:82
RW_attitude::cpsi
float cpsi
Definition
eff_scheduling_plusquad.h:106
RW_attitude::spsi
float spsi
Definition
eff_scheduling_plusquad.h:105
rotwing_eff_sched_var_t::wing_rotation_rad
float wing_rotation_rad
Definition
eff_scheduling_plusquad.h:71
RW_Model::mR
struct F_M_Body mR
Definition
eff_scheduling_plusquad.h:116
RW_attitude::cphi
float cphi
Definition
eff_scheduling_plusquad.h:102
RW_Model::mF
struct F_M_Body mF
Definition
eff_scheduling_plusquad.h:115
RW_attitude::phi
float phi
Definition
eff_scheduling_plusquad.h:98
rotwing_eff_sched_var_t::sinr2
float sinr2
Definition
eff_scheduling_plusquad.h:76
F_M_Body::dMdu
float dMdu
Definition
eff_scheduling_plusquad.h:92
rotwing_eff_sched_var_t::Ixx
float Ixx
Definition
eff_scheduling_plusquad.h:69
F_M_Body::l
float l
Definition
eff_scheduling_plusquad.h:94
RW_Model::att
struct RW_attitude att
Definition
eff_scheduling_plusquad.h:114
RW_attitude::psi
float psi
Definition
eff_scheduling_plusquad.h:100
RW_attitude::theta
float theta
Definition
eff_scheduling_plusquad.h:99
I::zz
float zz
Definition
eff_scheduling_plusquad.h:84
RW_Model::rud
struct F_M_Body rud
Definition
eff_scheduling_plusquad.h:121
RW_Model::flp
struct F_M_Body flp
Definition
eff_scheduling_plusquad.h:123
RW_attitude::stheta
float stheta
Definition
eff_scheduling_plusquad.h:103
rotwing_eff_sched_var_t::cosr2
float cosr2
Definition
eff_scheduling_plusquad.h:75
rotwing_eff_sched_var_t::cosr3
float cosr3
Definition
eff_scheduling_plusquad.h:77
RW_Model::mB
struct F_M_Body mB
Definition
eff_scheduling_plusquad.h:117
RW_Model::ail
struct F_M_Body ail
Definition
eff_scheduling_plusquad.h:122
I::w_xx
float w_xx
Definition
eff_scheduling_plusquad.h:85
F_M_Body::dFdu
float dFdu
Definition
eff_scheduling_plusquad.h:91
RW_Model::P
float P
Definition
eff_scheduling_plusquad.h:113
RW_Model::m
float m
Definition
eff_scheduling_plusquad.h:111
F_M_Body::dMdud
float dMdud
Definition
eff_scheduling_plusquad.h:93
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
F_M_Body
Definition
eff_scheduling_plusquad.h:90
I
Definition
eff_scheduling_plusquad.h:81
RW_Model
Definition
eff_scheduling_plusquad.h:109
RW_attitude
Definition
eff_scheduling_plusquad.h:97
rotwing_eff_sched_var_t
Definition
eff_scheduling_plusquad.h:68
std.h
sw
airborne
modules
ctrl
eff_scheduling_plusquad.h
Generated on Thu Oct 22 2026 14:02:09 for Paparazzi UAS by
1.9.8