Professional Documents
Culture Documents
Alberto Villarrubia de Juan-Ucak-20210806
Alberto Villarrubia de Juan-Ucak-20210806
METHODS
Alberto Villarrubia
a.villarrubia0@gmail.com
To my family and the people who have always enlightened
my path, specially Manolito and a few others,
Thank you.
Index
Introduction
The model presented in Section 1 is based in the paper [Ref. 1] where a non-linear
system is built for a civil aircraft. This model is selected due to its simplicity for
MATLAB implementation which is carried out at Section 2 and also due to its clearness
when understanding the effect of the parameters presented.
Once the model is implemented in MATLAB/Simulink and the resultant block diagram
looks similar to the one presented in Fig. I, a trimming point is obtained through
numerical optimization of a penalty function, a procedure which is detailed in Section
3.
After this trim point is obtained, Navigation Equations are introduced to the model
along Section 4, these equations, and the implementation of the real parameters of
the fighter aircraft obtained from [Ref. 2] and some modifications of the arbitrary
coefficients of the original model, all of which is carried out during Section 5, conclude
in the creation of a 3D Simulated virtual environment throughout Section 6. Results
obtained are shown in Section 7
1
SECTION 1
MATHEMATICAL DESCRIPTION OF EXISTING MODEL
Throughout this section, the original model presented in [Ref.1] of RCAM (Research
Civil Aircraft Model) is synthetized in order to provide an introductory stage for the
design of the fighter computational model.
2
1.1 Variables and relations
State variables;
𝑥 = [𝑢 𝑣 𝑤 𝑝 𝑞 𝑟 𝜙 𝜃 𝜓 ] !
Control variables
𝑢 = [𝛿" 𝛿# 𝛿$ 𝛿! ]!
𝑢; Speed in X-axis
𝑣; Speed in Y-axis
𝑤; Speed in Z-axis
𝑝; Roll rate (angular speed through X-axis)
𝑞; Pitch rate (angular speed through Y-axis)
𝑟; Yaw rate (angular speed through Z-axis)
𝜙; Roll angle
𝜃; Pitch angle
𝜓; Yaw angle
𝛿" ; Aileron deflection
𝛿# ; Horizontal elevator deflection
𝛿$ ; Rudder deflection
𝛿! ; Throttle setting
Intermediate variables;
𝑣% ; Airspeed
𝛼; Angle of attack
𝛽; Sideslip angle
𝑄; Dynamic pressure
3
1.2 Equations of the model
The steps leading to the obtention of these equations are not presented here in depth
but are developed in [Ref. 1] . A summary of these steps followed in order to obtain
the explicit First Order Differential form of the system is;
The rotations between different frames and dimensionalization of forces and moments
are not performed here as they are redundant and equal than [Ref. 1] but is important
to highlight that they are responsible for trigonometric projections that result in the
final model. In addition, some counter intuitive approaches such as the lift coefficient
not depending, apparently, on the sideslip are justified with the rotation of axis (in this
case, is due to the fact the lift coefficient is modelled in the stability axis and not in the
wind frame).
In Section 1.3 the final version of the First Order Differential form is presented
In bold, the parameters selected for the modelled RCAM aircraft which should and will
be modified in Section 5 to consolidate the F-16 Falcon fighter simulator.
4
a) Aerodynamic Forces
The coefficients shown in bolt are described. Its value is provided for the RCAM model
next to the description. The corresponding modifications have been made in Section 5
for the F-16. Letters have been chosen where the coefficient origin was not specified.
𝑐) = 𝑐) * + 𝑐) +
𝑐) * = 𝒏(𝛼 − 𝜶𝑳-𝟎 )
𝑆+
𝑐) + = 𝑨 ∗ 𝛼+
𝑆
Where;
𝛼+ = 𝛼 − 𝜖 + 𝛿# + 𝐷𝑃𝑅
Where;
𝒅𝝐 𝑙+
𝜖= (𝛼 − 𝜶𝑳-𝟎 ); 𝐷𝑃𝑅 = 𝑩 ∗ 𝑞 ; <
𝒅𝜶 𝑣%
Notation;
𝐴 = 3.1; 𝐵 = 1.3;
Drag coefficient
𝑐3 = 𝒄𝑫𝟎 + 𝒌𝑐)&
Where;
5
Side force coefficient
𝑐5 = 𝑪𝛽 + 𝑫𝛿$
Where;
𝛽; Sideslip angle
𝛿$ ; Rudder deflection
C; Side force stability derivative
D; Side force control derivative
𝐶 = −1.6; 𝐷 = 0.24;
Notes:
- The lift coefficient is just dependent on angle of attack
- This lift coefficient is based on stability frame
- Both lift coefficients are normalized according to the same reference so the
addition of both of them to obtain the total lift coefficient is sensible.
- Some dynamic effects are included (in the form of DPR)
6
b) Aerodynamic Moments
The equations are set in matrix form to ease MATLAB implementation and running.
𝑐8#$
𝛿𝑐6 𝛿𝑐6 fff⃗
7
𝑐6 𝑐
= b 6#$ c = 𝜂⃗ + 𝑤
ff⃗ + 𝑢′
#$
𝑐9#$ 𝛿𝑥 𝛿𝑢
Where
−𝟏. 𝟒𝛽
⎡ ⎤
𝟑. 𝟏𝑆+ 𝑙+
⎢−𝟎. 𝟓𝟗 − (𝛼 − 𝜖) ⎥
𝜂⃗ = ⎢ 𝑆𝑐 ⎥
⎢ 180 ⎥
⎣ (1 − 𝛼) 𝛽 ⎦
𝟏𝟓𝜋
−𝟏𝟏 0 𝟓 −𝟎. 𝟔 0 𝟎. 𝟑
𝛿𝑐: 𝟒𝑆+ 𝑙+& 𝑐 𝛿𝑐: 𝟑. 𝟏𝑆+ 𝑙+
=v 0 − 0 y𝑉 ; =v 0 − 0 y
𝛿𝑥 𝑆𝑐̅ % 𝛿𝑢 𝑆𝑐̅
𝟏. 𝟕 0 𝟏𝟏. 𝟓 0 0 −𝟎. 𝟔𝟑
Vector 𝜂 synthetize the static stability effects, sensible assumptions were made for
this estimation as for instance is clear that the derivative of the longitudinal pitching
moment with respect to the angle of attack is negative and the analyzed aircraft is
hence statically stable
;<
Matrix ;=% is not the full derivative matrix and x in this case only seize angular
components p, q, r. This matrix is introducing dynamic effects on the coupling of
having a non-zero angular velocity vector.
;<
Matrix ;>% captures the first three control surfaces deflection (𝛿" 𝛿# 𝛿$ ) and model
how these deflections provide an effect on the moment coefficients (control
effectiveness). Is noticeable to predict some flaws the model presents; for instance,
element (3,3) of this matrix is static in order to maintain the simplicity of the model
when obviously, rudder’s control derivative changes with its deflection.
ff⃗ = [𝑝 𝑞 𝑟]! ;
𝑤 Rotational speeds along the three body axis
fff⃗ = [𝛿" 𝛿# 𝛿$ ]! ;
𝑢′ Part of the control vector (the propulsive effects are analyzed
separately)
7
c) Propulsion effects
𝛿! ∗ 𝑚𝑔
ffff⃗
𝐹?7 = b 0 c
0
fffffffff⃗
𝑀?7$& = 𝑀 ffffff⃗7 × 𝐹
ffff⃗7
? ?
Where;
𝑋@A − 𝑋%B!
ffffff⃗
7
𝑀? = b 𝑌%B! − 𝑌@A c
𝑍@A − 𝑍%B!
d) Gravity effects
The gravitational forces are defined in the Earth frame and then rotated to the body
frame. Mass considered to be constant is a limitation presented in the model.
0
ffff⃗
D
𝐹C = 𝑚𝑔⃗ = 𝑚 b 0 c
𝑔
𝑔 sin(𝜃 )
ffff⃗
7
𝐹C = 𝑚 … 𝑔 cos(𝜃) sin(𝜓) ˆ
𝑔 cos(𝜃) cos(𝜓)
8
1.3 First Order differential form
𝒙̇ = 𝒇(𝒙, 𝒖)
𝑥Ḟ 𝑝̇
fffffff⃗
b 𝑥Ġ c = b𝑞̇ c = 𝐼7'( Ž𝑀 7 fffff⃗7 fffff⃗7
<C − 𝑤7 × 𝐼7 𝑤7 •
𝑥Ḣ 𝑟̇ D D
1 S(ϕ)T(θ) C(ϕ)T(θ)
𝑥İ 𝜙̇ ⎡
0 C(θ) −S(ϕ)
⎤ 𝑝
b 𝑥J̇ c = … 𝜃̇ ˆ = ⎢ S(ϕ)
⎥ 𝑞
C(ϕ) ⎥ • –
𝑥K̇ ⎢0 𝑟
𝜓̇
⎣ C(θ) C(θ) ⎦
With
ffff⃗
𝐹7 = 𝐹 ffff⃗7 + 𝐹 ffff⃗7 + ffff⃗
𝐹C7
% ?
fffffff⃗
𝑀7 = 𝑀 fffffffff⃗
7
+ fffffffff⃗
𝑀7
<C ?'( %'(
Where;
The sub-indexes;
The vectors
ff⃗ = [𝑝 𝑞 𝑟]! ;
𝑤 Rotational speeds in the body frame
𝑣⃗ = [𝑢 𝑣 𝑤]! ; Translational speeds in the body frame
𝐼7 ; Inertial matrix
ffff⃗7 ;
𝐹 Forces due to aerodynamic components
%
ffff⃗7 ;
𝐹 Forces due to engines
?
ffff⃗
𝐹7 ; Forces due to gravity
C
9
fffffffff⃗
7
𝑀 ?'( ; Moments due to engine
fffffffff⃗
𝑀 7
; Moments due to aerodynamic forces
%'(
10
SECTION 2
IMPLEMENTATION OF THE MODEL IN MATLAB/Simulink
2.1 MATAB implementation
The steps followed in order to compute the function which contains the first order
nonlinear differential form of the equations of motion are described below. These
steps have been followed sequentially and commented in the code of Appendix A
Function 1.1; “FALCON_Model”. This function computes the model differential
response (𝑥̇ ) to a given set of state and control parameters (𝑥, 𝑢) by following the
equations presented in Section 1. The final block of the function will be added after
the inclusion of the Navigation Equations in Section 4.
1. The first step is the definition of nominal vehicle constants and intermediate
variables;
11
Parameter (unit) Code RCAM F-16 Falcon
Notation
Mass (𝑘𝑔) m 120000 9295.41
4808400 0 −251076
&
𝐼L@%: (𝑘𝑔 𝑚 ) = b 0 7680000 0 c;
−251076 0 11990400
12875 0 1331
𝐼N'(H (𝑘𝑔 𝑚& ) = b 0 75674 0 c;
1331 0 85552
In the model, the relevant parameter is the inverse of this inertia matrixes, hence,
pursuing an optimization of the function, the inverse matrix is calculated before the
implementation of the system and remains unchanged, otherwise, every time the
function is called an inverse of the matrix would be calculated penalizing drastically the
model functionality.
0.2082 0 0.0044
'( (𝑘𝑔'( 𝑚'& ) = 10'H b
𝐼L@%: 0 0.1302 0 c;
0.0044 0 0.0835
0.7779 0 −0.01210
'( (𝑘𝑔'(
𝐼N'(H 𝑚'& ) = 10'F b 0 0.1321 0 c;
−0.01210 0 0.1171
12
2. Intermediate variables such as the dynamic pressure, the total airspeed, the
angle of attack, and the sideslip angle were defined already in Section 1 and
are all either constants or functions of the state variables, they are set in the
MATLAB code through simple statements;
13
16 Falcon fighter model. These coefficients are altered in Section 5 of this
study.
5. Engine and gravitational effects were also described in Section 1 and are
implemented in the program.
In this model;
- An initial state, control vector and simulation time is provided to the model
- The disturbances are added to this initial state, in this case, ailerons are
deflected through a step function at desired time and reestablish initial
position with a similar step function in the opposite direction.
- The model address MATLAB function “FALCON_Model” in order to calculate
the differential state by using the actual state and control vectors. This step
occurs inside the Simulink block “Interpreted MATLAB Function”, displayed in
Fig 2.2. This block receives the whole stack of values and detach them inside
the block in state (from 1 to 9) and control (from 10 to 14).
14
- Laplace integrator block is used to calculate the state vector from the
derivative state.
- Both, the control and state vectors are withdrawn to MATLAB’s workspace
-
Plotted parameters are shown in Section 7 once the model is completed as at this
preliminary stage, results are not representative
15
SECTION 3
TRIMMING THE AIRCRAFT
In this section, the optimization problem of trimming the 6 degree of freedom aircraft
to perform unaccelerated (steady state) straight level flight is set and solved (an
equilibrium point is found).
For doing it so, a mathematical modelling of the trimming problem is executed and
justified and the “Penalty function” optimization through MATLAB’s “fminsearch”
command is performed.
Both, the state and control variables are, from a mathematical perspective, of the
same importance and hence, in order to solve the trimming point problem, a number
of equations equivalent to the number of variables is set. This way,
overdetermination problems are avoided as well as underdetermination which could
lead to many different solutions none of which could be proved to be optimum and
their obtention would be dependent on the starting condition which would also add a
further degree of complexity to the problem.
Restrictions;
To achieve a steady flight the derivative of the state vector must be null. This way 9
equations (restrictions 1-9) are imposed. Also, airspeed will be fixed and equal to a set
initial value (restriction 10). As an example, 100 m/s was set.
Additionally, for straight flight; the aircraft should face the direction that is heading for
equilibrium and hence, sideslip velocity should be null (restriction 11).
Finally for a leveled flight; Climb angle 𝛾 = 0 𝑟𝑎𝑑𝑠 (Although the aircraft might be
pitched up) (restriction 12) and wings should be level, therefore, roll angle should be
null (restriction 13).
A fix direction is set; at the moment, by imposing a null yawing angle (restriction 14).
16
As a result, the set of restrictions implemented are;
(1 − 9) 𝑥̇ = 0 = 𝑓(:K ;
(10) 𝑣% − 100 = 0 = 𝑓(/ ;
(11) 𝑣 = 0 = 𝑓(& ;
(12) 𝛾 = 0 = 𝑓(( ;
(13) 𝜙 = 0 = 𝑓(E ;
(14) 𝜓 = 0 = 𝑓(F ;
These equations could be substituted and solved simultaneously, however due to the
strong nonlinear character of them, the result is a complex solution which is not
practical from a computational perspective and will be widely altered if multiple trims
(like for instance different velocities) are desired. This motivates the use of a numerical
optimization method analyzed in the following paragraphs.
Constrained problem;
min 𝑓P ;
𝑆𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜: 𝑓( = 0; 𝑓& = 0; … . 𝑓9 = 0;
In order to transform this problem into an unconstrained one, in first place, the
constraints are assumed to be “soft” which implies that is not mandatory that they
are accomplish although a penalization coefficient is applied when they are not.
As all of the restrictions are equalities, the same implementation in the approximate
function is applied, this is, including the value of the function squared (to avoid
cancelation errors) and multiplied by a penalty parameter (𝛼9 ). Therefore, the
problem is transformed in the following:
Unconstrained problem;
The target is for constraints to be followed and hence the original objective function is
totally irrelevant so in order to simplify the problem it is going to be set to a null value;
𝑓/ = 0
Hence the problem van be expressed as;
17
Also, all the penalty parameters are considered with the same importance and
therefore, take the same value, they would vary if some conditions were more
important than others. A value of 1 is given to every 𝛼9 .
Two MATLAB files are required to perform the optimization. Script 1.3 “Trim_FALCON”
uses “fminsearch” function which calls the second file; Function 1.4; “Cost_FALCON”.
This function builds the approximate objective function in order to minimize it.
To obtain the numerical values, the function “Cost_FALCON” recalls the original model
Function 1.1 “FALCON_Model” in order to obtain the derivative state and try to
minimize it to meet the first set of restrictions.
𝑓( = 𝑋𝑑𝑜𝑡(1) = 0;
𝑓& = 𝑋𝑑𝑜𝑡(2) = 0;
…
𝑓K = 𝑋𝑑𝑜𝑡(9) = 0;
Restrictions 10 and 12 are built defining the airspeed and the approximate climbing
angle for cruise (once the navigation equations are implemented, this angle is defined
more accurately in Section 4);
𝑓(( = 𝑣 = 𝑋(2) = 0
𝑓(E = 𝜙 = 𝑋(7) = 0
The additional direction restriction is defined through imposing a null yawing Euler
angle. This is not directly the course angle which is defined more accurately through
Section 4.
𝑓(F = 𝜓 = 𝑋(9) = 0
Once all these restrictions are implemented on a vector "𝑄", the building of the cost
function is simple, in order to optimize computer’s resources, rather than defining it
explicitly, a matrixial arrange has been used
𝑓¢ = 𝑄! 𝐻𝑄
18
Where 𝑄 is the column vector containing the 𝑛 restrictions and 𝐻 is the identity matrix
of 𝑛+# order; 14 in this case.
In the main trimming script, the results are saved after the first iteration with an
arbitrary initial guess which just consists on setting the initial state 𝑥/ with an initial
6
axial velocity equal to the one set on the cost function, (100 Q in this case) and the
rest of variables null.
19
SECTION 4
NAVIGATION EQUATIONS IMPLEMENTATION
In order to compute the position, the velocity is expressed in the North East Down
frame and not in the body frame where we currently have it expressed with the three
first components of the state vector. The difference between these frames is
schematically shown in Fig. 4.1
In order to convert the velocity from body frame to the NED frame, the Euler angles
are used, the Euler sequence of rotation is usually used to transform from the NED
frame to the body frame and consist in;
20
Fig 4.2 Direction Cosine Matrix for Euler Transformation https://www.programmersought.com/article/86673323097/ (modified
for notation purpose) [REFERENCE]
𝑣S
ffff⃗ '( ffff⃗ ! ffff⃗
𝑣 = 𝐷𝐶𝑀 𝑣 = 𝐷𝐶𝑀 𝑣 = b 𝑣? c
R 7 7
𝑣3
It must be acknowledged that the velocity 𝑣3 is the velocity down so a positive value
would imply a lost on the height of the aircraft or in other words, it is the negative rate
of climb.
Cb2 = [1 0 0;
0 cos(x7) sin(x7);
0 -sin(x7) cos(x7)];
Cbv = Cb2*C21*C1v;
Cvb = Cbv';
positions = Cvb*V_b;
21
- 3 Positions 𝑁𝑜𝑟𝑡ℎ, 𝐸𝑎𝑠𝑡, 𝐷𝑜𝑤𝑛 (In the Earth NED frame)
This way, the 6 degrees of freedom are a closed system defined by 12 states.
After this stage, the trim function should also be modified; an equilibrium point is not
searched anymore; equilibrium implies a steady state: 𝑥̇ = 0 . However, this is not
true with the inclusion of positions in the state vector as their derivatives are not
meant to be null.
Hence, for the rest of the analysis, instead of “equilibrium point” the term “trim point”
is used.
Including the position in the function has a great advantage; the climbing and course
angles can be explicitly defined and not approximated as it was done previously in the
case of 𝛾. This condition opens the door to the obtention of a trim point in a more
general case and not at pure cruise condition.
Fig 4.3 Climb angle accurate definition. NOTE; North axis is heading inside in the plane of the paper
The “yawing angle” which nullity was previously considered a restriction in order for
the aircraft to travel straight (𝜓 = 0) is going to be interchanged for the “course
angle” nullity which impose the direction heading is not only straight but also North.
This detail is important for the simulation purpose studied in Section 6 as once the
aircraft is successfully trimmed with 𝜓 = 0, the aircraft was indistinctively choosing to
travel forward or backwards in the North direction but as a small airport is included in
the virtual environment, it had an important effect on the virtual reality aircraft’s
attitude. The course angle is graphically represented in Fig. 4.4. Another detail also
required for simulation purposes is to add the three positions as restrictions in the cost
function;
𝑓(G = 𝑋(10) = 0
𝑓(H = 𝑋(11) = 0
22
𝑓(I = 𝑋(12) = 0
This does not have an impact in finding the trimming point but it forces the trimming
algorithm to look for the initial position in the origin of coordinates which is the point
where the virtual reality airport is created instead of a random starting position.
Fig. 4.4 Course angle definition. NOTE; North axis is heading inside in the plane of the paper
The position in the NED frame is indirectly needed for both, the climbing and the
course angles (the velocities in this frame and hence the position’s derivatives). These
definitions should be imposed in the trimming cost function (Function 1.3).
The complete set of functions which describe the model are included in Appendix A.
23
SECTION 5
MODEL MODIFICATIONS
The civil aircraft model needs to be modified in order to trace the behavior of the
considered fighter aircraft; F-16 Falcon.
In order to face the entire modification process, some general parameters are
changed, other particular parameters such as all the geometry, weights, aerodynamic
coefficients as well as the stability derivatives have been gathered from experimental
data in the way presented below. Data was obtained from [Ref. 2] and [Ref.4].
Some coefficients origins are not described in [Ref. 1]. These coefficients, were left
unchanged and just readjusted in terms of fitting the geometry of the new aircraft,
these parameters are shown in Section 5.2. These parameters were considered
flexible. A trial-and-error process was executed on the pursuit of readjusting these
parameters to adapt to the fighter aircraft. In the conclusion at Section 7, there is
more information on how these coefficients could have been readjusted.
It must be acknowledged that the huge difference between the original model and the
F-16 Falcon as well as the inclusion of unchanged parameters have led to an inaccurate
model which should be furtherly worked at the attempt of building a more general
model (and hence an accurate flying simulator) which ideally would be able to simulate
the behavior of any 6 degree of freedom aircraft depending only in its stability
derivatives and the geometrical characteristics.
24
Label Description Notation RCAM F-16 FALCON
P-1 Zero lift angle of attack (deg) 𝛼/ -11 1
P-2 Lift curve gradient 𝑛 5.5 2.5
P-3 Stall prediction - YES NO
P-4 Parasite Drag coefficient 𝐶3/ 0.13 0.03
P-5 Polar drag coefficient 𝑘 0.07 0.265
P-6 Lift coefficient at null AOA 𝐶)/ -0.654 -0.05
P-7 Side force/beta slope (rad-1) 𝐶5 T -1.6 -0.477
P-8 Rolling moment/beta slope 𝐶8 T -1.4 -0.048
(rad-1)
P-9 Pitching moment/alpha slope 𝐶6 2 𝑆+ 𝑙+ 𝑆+ 𝑙+
−3.1 −0.469
(rad-1) 𝑆𝑐̅ 𝑆𝑐̅
P-10 Yawing moment/beta slope 𝐶9 T 180𝛼 180𝛼
1− 0.048 −
(rad-1) 15𝜋 346𝜋
G-2: Original cruise speed is insufficient to model F-16 Falcon typical cruise velocity,
the theoretical model in the other hand was inconsistent when exceeding high
velocities. The main difference of this subsonic and supersonic dichotomy is the
aerodynamic center positioning. For a supersonic aircraft, this point is positioned rear
to the center of gravity and for a subsonic aircraft is positioned before. This parameter
has a huge effect in the simulation making it, in principle, non-consistent to try to
simulate a supersonic aircraft in subsonic regime and vice versa.
P-1, P-2, P-3, P-6 From [Ref. 2], Fig. 5.1 was detached. This is the lift coefficient
variance with the angle of attack for different flap configurations, the dark blue line
highlighted is the most relevant and from which the following data was obtained as it
states de non-flap deflection configuration.
25
Fig 5.1; Lift coefficient vs AOA for M=1.6 F-16 Falcon (Flap undeflected configuration selected)
In order to calculate the inverse derivative of the graph, two points of the curve were
selected.
𝜋
𝛼/ = 1 ∗ 𝑟𝑎𝑑; 𝐶)/ = −0.05
180
In the original model, stall phenomena was modelled building a cubic polynomic
function at the point the curve stopped being linear. However, the stall cannot be
predicted from this curve as there is missing information on how the curve progresses
for over 14 degrees angle of attack, hence, stall modelling remains for future
development of the system (APPENDIX C).
P-4, P5: The coefficients that model the polar drag are obtained from Fig. 5.2 also form
[Ref. 2]. To model this coefficient, the classical parabolic model is proposed;
26
Fig 5.2; Drag polar for M=1.6 F-16 Falcon (Flap undeflected configuration selected)
With Fig 5.1, 𝐶)/ was obtained. The parasite drag 𝐶3/ is easily obtained in the point
where 𝐶) = 0;
𝐶3/ = 0.03
Finally, to obtain the constant “k”, the approach taken was adjusting the parabola in
the online graphical tool “www.desmos.com” as shown in Fig.5.3.
27
This way;
𝑘 ≈ 0.265
P-7, P-8 These stability derivatives are also obtained from [Ref. 2] by calculating the
slopes of the corresponding graphs in Fig. 5.4a.
Fig 5.4a and Fig. 5.4b ; Stability coefficients dependent on 𝛽 for F-16 Falcon at M=1.6
𝑑𝐶5 𝑑𝐶8
= 𝐶5 T = −0.477; = 𝐶8 T = −0.048
𝑑𝛽 𝑑𝛽
P-10 The derivative of the yawing moment coefficient with respect to the sideslip
angle has been approach in order to obtain it in the form corresponding to the original
model; as data is presented for different values of the angle of attack, linear
interpolation between the derivatives for two angles of attack was performed in Fig.
5.4.b to obtain the corresponding stability coefficient;
𝑑𝐶9 180𝛼
= ;𝑎 − <
𝑑𝛽 𝑏𝜋
28
Where 𝑎 and 𝑏 are required to be founded;
0@5
For 𝛼 = 0 → 0T
= 0.048 𝑟𝑎𝑑 '(
0@5
For 𝛼 = 10 → 0T
= 0.0191 𝑟𝑎𝑑 '(
𝑑𝐶9 180𝛼
= ;0.048 − <
𝑑𝛽 345.95𝜋
P-9: Finally, to obtain this derivative, the relation below was used
0@6 0@7
Where 0@7
is the slope of Fig.5.5 and 02
was obtained in P-2
Fig 5.5 ; Pitching moment vs lift coefficients for F-16 Falcon at M=1.6
𝑑𝐶6
= −0.154 ∗ 2.5 = −0.384 𝑟𝑎𝑑 '(
𝑑𝛼
To arrange the derivative in the same form that the original model; a simple
transformation needs to be done according to geometric data of F-16 Falcon
𝑑𝐶6 𝑆+ 𝑙+
= −0.384 = −0.469
𝑑𝛼 𝑆𝑐̅
29
5.2 Remaining parameters
For some of the parameters estimated in the model, not enough information was
available in [Ref. 2], also, in the original model it was not specified how this data was
obtained. These parameters are the control derivatives and some additional
derivatives concerning the angular velocities and hence they only have effect on the
moments that the aircraft experiences either when any of the angular rates is different
to 0 or the effect of the control surfaces in the behavior of these moments. The
modification criteria here is less consistent and as a consequence, potentially
inaccurate although it provides a general idea on aircraft attitude towards the
corresponding parameters.
Change in downwash with respect to alpha, dynamic pitch rate and control derivative
were unchanged with respect to the original model due to lack of data that allows its
change.
−0.048𝛽
⎡ ⎤
0.469𝑆+ 𝑙+
⎢−0.59 − (𝛼 − 𝜖) ⎥
𝜂⃗ = ⎢ 𝑆𝑐 ⎥
⎢ 180 ⎥
⎣ (0.469 − 𝛼 ) 𝛽 ⎦
346𝜋
30
SECTION 6
AUTOMATIC AND VIRTUAL REALITY SIMULATION
In this section, the whole simulation process is described. The initial conditions are the
trimmed point obtained in Section 3 with the additional navigation equations in
Section 4 and the coefficients modifications made in Section 5. In order to do this, two
Simulink blocks were set. The first one runs at the maximum computational speed and
is useful in order to simulate the system for a large period at computational time rate.
The second one consists on a real time 3D Virtual Reality simulator.
Computation of data has been addressed previously in this study. The block
responsible for this is shown in Fig.6.1d and consists in a subsystem that calculates the
differential state for a given state as described in Section 1 through MATLAB Function
1.1 “FALCON_Model”, integrates this state and obtain the next state, which is
feedback to the function together with the introduced control data in a continuous
process.
Once every state is calculated, the output of data takes place, in this case through a
Scope. In Fig 6.1e the results for the scope from a trimmed position with any
disturbances is shown. The variations that can be appreciated are insignificant if the
scale is looked closely and is due to the sampling time of Simulink but the aircraft
remains flying in a straight level cruise for the whole period simulated (in this case 300
seconds).
31
Control and state data is also sent to MATLAB in order to be plotted as it is shown in
the results section.
32
Fig 6.1. a) General system
b) Disturbance subsystem
c) Example of disturbance configuration in the ailerons control surface
d) Detail of Computational Section
e) Detail of Scope for a trimmed, undisturbed run
33
Fig.6.2 Simulink Interface of “aeroblk_HL20”
Fig.6.3 Simulink Interface of “Visualization” subsystem of “aeroblk_HL20”. In red, the block that is used in F-16 Falcon model
34
Fig.6.4 Initial position of the flying simulator from two different perspectives
35
one described in Section 6.1 where a series of steps or any kind of disturbances can be
predefined with the advantage that at this stage, the effect on the aircraft’s behavior
can be visualized in real time and not just through graphs interpretation.
The second approach is by introducing the disturbances through a manual joystick
which configuration is described in the following section.
Once these two methods are set, either of them can be simply selected in the MATLAB
script by running either Model 2 or Model 3 as it is described in Section 4
Only the first 3 axis that appear in Fig. 6.6 are selected and the buttons are neglected
as it can be observed in Fig.6.7a, Fig. 6.7b and Fig 6.7c.
The approach is to set the Joystick to its “zero-position” or trimming it. This is essential
as at rest, the Joystick is already feeding non zero values to the system. These values
can be obtained in MATLAB by using the set of commands with the Joystick connected;
joy = vrjoystick(1);
n=1:3;
a= axis(joy,n)
a_aileron=a(1);
a_elev=a(2);
a_rudder=a(3);
TrimJoystick=[a_aileron a_elev a_rudder];
After storing these values, they are canceled by feeding them with the opposite sign to
Simulink as done in Fig.6.7d.
Once the Joystick is trimmed, any deviation of it will add to the aircraft trimmed point
or “uStar” position as seen on Fig.6.7e.
36
Fig 6.6. jWin Joystick Axis display
37
Fig 6.7. a) Input block inside the general system
b) General view of joystick subsystem
c) Detail of Joystick input block
38
d) Detail of Joystick trimming constant
e) Detail of Aircraft trim constant
39
6.2.5 Simulation environment
The Virtual reality environment consist in an airport which is very helpful as it is the
only reference point in the whole environment. The starting position from this airport
is crucial to observe the initial attitude of the aircraft, this reason is why the additional
restrictions were imposed in the cost function to provide the initial positions were
included. The other element of the environment is the 3-dimensional aircraft and the
real time maneuvers that it performs. These maneuvers were synthetized in Fig. 6.9.
40
6.3 Final Simulink model
Only Model 3 is framed in Fig 6.10a and each of the 4 main subsystems are individually
framed in Fig 6.10b, c, d and e respectively. This is the only framed model as it is the
most general (to obtain Model 2 only the disturbance block is modified into a simpler
one and additional, to obtain Model 1, the real time block is deleted).
41
Fig.6.10 a) General view of Model 3 with the 4 subsystems highlighted
b) Subsystem 1 detailed: Real time Simulation block
c) Subsystem 2 detailed: Introduction of control data
42
d) Subsystem 3 detailed; Computation of control and state data
e) i) Subsystem 4 and state scope: VR block which is fed with current Euler angles and positions of the aircraft
e) ii) Subsystem 4 with a larger detailed.
The operating process to use any of these models is described in the User Guide in
APPENDIX B.
If these Simulink models are required, the contact of the authors of this document
can be found in the front cover.
43
SECTION 7
RESULTS AND PLOTS
6 6 6
𝑋/ (1) = 𝑢/ = 526.7 Q
; 𝑋/ (2) = 𝑣/ = 0 Q ; 𝑋/ (3) = 𝑤/ = 37.41 Q ;
𝑟𝑎𝑑 𝑟𝑎𝑑 𝑟𝑎𝑑
𝑋/ (4) = 𝑝/ = 0 ; 𝑋/ (5) = 𝑞/ = 0 ; 𝑋/ (6) = 𝑟/ = 0 ;
𝑠 𝑠 𝑠
𝑋/ (7) = 𝜙/ = 0 𝑟𝑎𝑑; 𝑋/ (8) = 𝜃/ = 0.0709 𝑟𝑎𝑑; 𝑋/ (9) = 𝜓/ = 0 𝑟𝑎𝑑 ;
Where 𝛿!(" and 𝛿!&" are the initial throttle settings, these values should not be
considered for any study as in the model there is not any type of engine mapping and
hence these values are purely arbitrary and not representative.
𝑓/ = 3.345 ∗ 10'&F
We can observe that in order to be trimmed, the aircraft is slightly pitching up (𝜃/ =
0.0709 𝑟𝑎𝑑) this implies that the velocity in the Z body direction is different from 0;
6
6𝑤/ = 37.41 Q 7. At the same time, the elevator is slightly deflected (𝛿#" =
−0.2105 𝑟𝑎𝑑𝑠) being the responsible of the aircraft pitching up.
44
7.2.1 Climb maneuver
45
Fig. 7.2.1.2 Position evolution during the climb maneuver
46
7.2.2 Roll maneuver
This maneuver was performed in two different ways, without and with the inclusion of
some rudder correction.
In first place, no rudder was included. The roll maneuver consisted in a compensated
step function as before with the first step consisting in an aileron deflection of -2º
during 3 seconds and the second one, a counter deflection of 5º during 2.4 seconds.
The aircraft is found in an unstable position after approximately 10.5 seconds of the
maneuver taking place ( as it can be observed in Fig.7.2.2.2a through the oscillation of
the state parameters). In the other hand, when some rudder was introduced to
contrast the yawing effect of the maneuver, the aircraft hold its stability for a longer
time (approximately 14.5 seconds after the maneuver as it can be observed in
Fig.7.2.2.2b). In Fig.7.2.2.3 the positioning effect of the corrected rolling maneuver is
shown with the “East position” parameter increase.
Fig 7.2.2.1 Difference in the disturbances input between the uncorrected and corrected roll maneuver
47
Fig 7.2.2.2a State evolution during the uncorrected roll maneuver
48
Fig 7.2.2.3 North and East Positions evolution during the corrected roll maneuver
NOTES;
- Although the aircraft is trimmed, there is one point where without any
disturbance introduced, the system abandons this condition to higher
velocities, this event happens before (in the case of 528 m/s it exactly occurs
after 80 seconds and in the case of setting 400 m/s as the trimmed velocity,
this event occurs after 148 seconds). The nature of this phenomena remains
unknown and might be due to computational limitations after a certain period
of time.
- The rudder model has some clear flaws as any maneuver related with this
control surface force the system to abandon its trim condition severely. Also, it
can be checked empirically the oversize effect that a deflection of 0.02 degrees
has in the system.
49
7.3 Conclusion
Although these results may not be accurate as some stability derivatives were not
obtained, some interesting ideas were gathered as explained in the previous
paragraph , with the Joystick simulations, it was verified that elevator and aileron
surfaces enhance the aircraft to react as they are supposed; the ailerons have also
what seems an adequate proportional influence in the rolling rate of the aircraft
enabling the possibility of executing barrel roll maneuvers and loopings (these
maneuvers are difficult to program through step functions and were just achieved by
using the joystick).
The absolute positioning of the aircraft is not noticed due to the scarce camara angles
available in the virtual reality environment and the lack of reference points (only the
initial airport); hence the positioning can barely be studied from the output figures.
As the rolling takes place, the coupling between the lateral and directional stability
starts being empirically visible. This coupling is the responsible of an inaccurate
modelled rudder which detracts the simulator of being functional in yawing motions.
Another reason for the inappropriate rudder impact might bloom from the fact that
some control derivatives and other parameters were not calculated and remained
unchanged from the previous model. This is the reason why results were not analyzed
exhaustively as they are not considered yet representative enough. However, the
characteristic response of the model for the ailerons and elevator suggest that the
development is following a good path.
To scale this coupling without knowing the stability derivatives, neglecting the cross
terms of the stability and control matrixes is not enough as they are rotated into
different axes through the modelling process.
The linearization of the system is the most critical section for a potential development
of this study and should be sufficient condition to group a Centralized Aerodynamic
Navigation System of Unaccelerated aircrafts which is able to build a 6 degree of
freedom flying simulator for any general aircraft by just introducing its geometry, flying
conditions and stability derivatives. However further developments can be introduced
in the pursuit of achieving a more accurate model. These modifications have been
listed in Appendix C together with some ideas which intend to aid their
implementation.
50
APPENDIX A: MATLAB CODES
*Script 3.4 also includes the possibility of simulating the virtual reality environment and it is deeper
presented in Section 6
Function 1.1
function [XDOT] = FALCON_Model(X,U)
51
m=91188/9.81; % Mass (kg)
%Engine location
Xapt1 = 0; % x position of engine 1 (m)
Yapt1 = -0.01; % y position of engine 1 (m)
Zapt1 = -0.4; % z position of engine 1 (m)
%Other constants
rho = 1.225; % Air density (kg/m^3)
g = 9.81; % Gravitational acceleration (m/s^2)
depsda = 0.25; % Change in downwash with respect to alpha
n=2.5;
if (u2>u2max)
u2 = u2max;
elseif (u2<u2min)
52
u2 = u2min;
end
if (u3>u3max)
u3 = u3max;
elseif (u3<u3min)
u3 = u3min;
end
CD_0=0.03;
CL_0=-0.05;
k=0.265;
FA_b = C_bs*FA_s;
53
%2.Define dCMdx and dCMdu
eta=[eta1;
eta2;
eta3];
MEcg1_b = cross(mew1,FE1_b);
54
MEcg2_b = cross(mew2,FE2_b);
MEcg_b = MEcg1_b +MEcg2_b;
Fg_b = m*g_b;
%Velocities derivatives;
%x1_dot = u_dot; x2_dot = v_dot; x3_dot = w_dot
x1to3dot = (1/m)*F_b - cross(wbe_b,V_b); %3x1 vector
%Angle rates
%x4_dot = p_dot; x5_dot = q_dot; x6_dot = r_dot
x4to6dot = invIb*(Mcg_b - cross(wbe_b,Ib*wbe_b)); %3x1 vector
%Navigation Equations
%Euler Sequence defined by matrixes
C1v = [cos(x9) sin(x9) 0;
-sin(x9) cos(x9) 0;
0 0 1];
55
C21 = [cos(x8) 0 -sin(x8);
0 1 0;
sin(x8) 0 cos(x8)];
Cb2 = [1 0 0;
0 cos(x7) sin(x7);
0 -sin(x7) cos(x7)];
Cbv = Cb2*C21*C1v;
Cvb = Cbv';
end
Script 1.2
for count=1:n
else
Z_guess=[xStar;uStar];
end
initialization=1;
end
56
format long
ZStar %Display the state and control trim conditions
f0 %Display the value of the cost function
Function 1.3
xdot = RCAM_super(X,U);
Va = sqrt(X(1)^2 + X(2)^2 + X(3)^2); %Airspeed
%Restriction building;
Q = [xdot(1:9); %Steady state
gam; %Cruise trim; climbing angle =0
X(2); %Sideslip = 0
X(7); %No bank angle
Course; %Heading North (Course angle = 0)
X(10); %Initial position 0,0,0
X(11);
X(12);
Va-528]; %Velocity setting (M=1.6 SL)
Script 1.4
clear
clc
close all
%% Define constants
x0=xStar
u=uStar
57
%And provide the information to simulink model 2
joy = vrjoystick(1);
n=1:3;
a= axis(joy,n)
a_aileron=a(1);
a_elev=a(2);
a_rudder=a(3);
TrimJoystick=[a_aileron a_elev a_rudder];
u1 = simU.Data(:,1);
u2 = simU.Data(:,2);
u3 = simU.Data(:,3);
u4 = simU.Data(:,4);
x1 = simX.Data(:,1);
x2 = simX.Data(:,2);
x3 = simX.Data(:,3);
x4 = simX.Data(:,4);
x5 = simX.Data(:,5);
x6 = simX.Data(:,6);
x7 = simX.Data(:,7);
x8 = simX.Data(:,8);
x9 = simX.Data(:,9);
x10 = simX.Data(:,10);
x11 = simX.Data(:,11);
x12 = simX.Data(:,12);
subplot(4,1,2)
plot(t, u2)
legend('u_2 Elevator Deflection')
grid on
subplot(4,1,3)
plot(t, u3)
legend('u_3 Rudder Deflection')
grid on
58
subplot(4,1,4)
plot(t, u4)
legend('u_4 Throttle setting')
grid on
subplot(3,3,1)
plot(t, x1)
legend('u')
grid on
subplot(3,3,4)
plot(t, x2)
legend('v')
grid on
subplot(3,3,7)
plot(t, x3)
legend('w')
grid on
%p q r
subplot(3,3,2)
plot(t, x4)
legend('p')
grid on
subplot(3,3,5)
plot(t, x5)
legend('q')
grid on
subplot(3,3,8)
plot(t, x6)
legend('r')
grid on
subplot(3,3,6)
plot(t, x8)
legend('\theta')
grid on
subplot(3,3,9)
plot(t, x9)
legend('\psi')
grid on
59
figure
subplot(3,1,1)
plot(t, x10)
legend('North Position')
grid on
subplot(3,1,2)
plot(t, x11)
legend('East Position')
grid on
subplot(3,1,3)
plot(t, -x12) %x12 is the down position; change sign
legend('Up position')
grid on
60
APPENDIX B: USER GUIDE
This Appendix has the purpose of guiding any interested person into the current
developed software usage.
Change the velocity in Function 1.3 of APPENDIX A “Cost_FALCON” and the initial
approximation of it in Script 1.2 “”Trim_FALCON” (For F-16 only supersonic velocities
are accurately simulated due to the aerodynamic center positioning)
Once the Script 3.2 “Trim_FALCON” is executed, the trimmed values and hence the
starting position are saved in a created file in the working directory and named
“trim_values_FALCON”. This should be checked by obtaining a value highly
approximate to 0 for the cost function.
If the intention is simulating another aircraft rather than F-16 Falcon, in first place it
should be acknowledge that some of the parameters remained unchanged from the
original model in Ref.1 and hence, their alteration was not accurately tested. However,
if data can be obtained from control derivatives which shape these parameters, the
accurate modification of these parameters should be feasible as Section 1 describes
the general behavior of a 6 Degrees of Freedom body.
To change the aircraft settings in the main function; Funtion 1.1 of APPENDIX A
“FALCON_Model” ;
1. Alter the geometry constants of the aircraft. In addition, calculate the inverse inertia
matrix in a separate script and introduce it in the system
2. Impose the constraints required to the deflection surfaces
3. Introduce precisely the data gathered from stability derivatives. Notice that some
parameters are dependent on the geometry so they should be calculated considering
the new aircraft’s geometry.
4. Change the name of the functions and files
61
A key parameter to modify is the aerodynamic center depending on whether
subsonic or supersonic simulation will take place. This feature’s importance was
discussed in Section 5.1.3.
After this, follow the same steps as in the Section A of this appendix
NOTE;
As mentioned in section A, the cost function should output values near to 0. This is due
to the importance of the compliance of every single restriction imposed in the model
for cruise condition. This way, values of the cost function of a hundredth might still not
be sufficiently small to trim the aircraft.
Due to the mathematical nature of the problem (determined system where variables
and restrictions coincide) the function after a certain number of iterations should
converge (the number is set at 15 in Script 1.2 but can be increased if the user requires
to).
If results are not converging after the trimming stage, the problem can be found in the
imposed constraints which is the only feature that might impede the optimization
function from working freely. If this is the case, the constraints must be liberated in
Function 1.1 as a way of continuing the study of the model.
62
APPENDIX C: FUTURE DEVELOPMENT
The most critical idea for a potential future development of the software was
discussed in the conclusion (Section 7.3) and is the linearization of the system.
In addition, this appendix includes some features which would upgrade the system to
construct a more accurate model.
These ideas were not developed in this study but some guidance into how they would
have been carried out is provided.
• This feature can be included by integrating an if loop when calculating the lift
coefficient with alpha as an input. If alpha is higher than a certain number, then
an alternative shape of the lift coefficient (a cubic polynomial in the case of
RCAM) can be followed.
63
6. Exponential servos settings
• This feature would allow to be more precise in the operational envelope of the
control surfaces at the cost of being less precise for large deflections. It will
provide accurate maneuvering and can be included in the system by scaling by
some means the joystick in the disturbance block.
64
REFERENCES
[1] Group for Aeronautical Research and Technology in Europe, "Robust Flight Control
Design Challenge Problem Formulation and Manual: The Research Civil Aircraft Model
(RCAM)", GARTEUR/TP-0883. February 17, 1997
[3] HL20 version 1.0 Modified on 26-Jul-2016 based on Jackson E. B., Cruz C. L.,
"Preliminary Subsonic Aerodynamic Model for Simulation Studies of the HL-20 Lifting
Body", NASA TM4302, August 1992. Copyright 1990-2016 The MathWorks, Inc.
[4] NASA Technical Paper 1538 Simulator Study of Stall/Post Stall characteristics of a
fighter airplane with relaxed longitudinal static stability, Luat T. Nguyen, Marilyn E. Ogburn,
William P Gilbert, Kemper S. Kibler, Philip W. Brown, and Perry L. Deal
[5] Aircraft Control and Simulation by Brian L. Stevens (1992-02-05) (Reference System
Photographs)
[6] Optimization method - Fiacco, Anothny V. and McCormick, Garth P., “Nonlinear
Programming: Sequential Unconstrained Minimization Techniques,” Wiley, 1968.
Jensen, Paul A. and Bard, Jonathan F., “Operations Research Models and Methods,”
John Wiley & Sons, 2003.
65