Download as pdf or txt
Download as pdf or txt
You are on page 1of 69

FIGHTER AIRCRAFT STABILITY ANALYSIS WITH COMPUTATIONAL

METHODS

Yrd. Doç. Dr. Hayri Acar


acarh@itu.edu.tr

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

Scope and Introduction ............................................................................................ 1


i) Scope .............................................................................................................. 1
ii) ii) Introduction ............................................................................................... 1
Section 1: Mathematical description of existing model ............................................. 2
1.1 Variables and relations ............................................................................ 3
1.2 Equations of the model ........................................................................... 4
a) Aerodynamic forces ....................................................................... 5
b) Aerodynamic moments ................................................................. 7
c) Propulsion effects .......................................................................... 8
d) Gravity effects ............................................................................... 8
1.3 First order differential form .................................................................... 9
Section 2: Implementation of the model in MATLAB/Simulink................................. 11
2.1 MATLAB implementation ...................................................................... 11
2.2 Simulink implementation ...................................................................... 14
Section 3: Trimming the aircraft .............................................................................. 16
3.1 Introduction to the trimming problem .................................................. 16
3.2 Steady state straight and level flight conditions ................................... 16
3.3 Penalty Method optimization ................................................................ 17
Section 4: Navigation Equations implementation .................................................... 20
4.1 Definition of the navigation equations .................................................. 20
4.2 Implementation in MATLAB model ....................................................... 21
Section 5: Model modifications ............................................................................... 24
5.1 Modifications in the model ................................................................... 24
5.1.1 General modifications process ............................................... 24
5.1.2 Particular modifications .......................................................... 24
5.1.3 Modification criteria .............................................................. 25
5.2 Remaining parameters .......................................................................... 30
5.3 Final first order differential form for F-16 Falcon ................................. 30
5.3.1 Aerodynamic force coefficients .............................................. 30
5.3.2 Aerodynamic moments coefficients ....................................... 30
Section 6: Automatic and Virtual Reality simulation ................................................ 31
6.1 Computer-time simulator. .................................................................... 31
6.2 Real time simulator visualized in virtual reality .................................... 33
6.2.1 Virtual Reality Simulator graphical Interface .......................... 33
6.2.2 Real time pace setting ............................................................ 35
6.2.3 Disturbance input .................................................................. 35
6.2.4 Joystick Setting ....................................................................... 36
6.2.5 Simulation environment ......................................................... 40
6.3 Final Simulink model ............................................................................. 41
Section 7: Results and Plots ..................................................................................... 44
7.1 Trim Point .............................................................................................. 44
7.2 Response to disturbances from the Trim Point ..................................... 44
7.2.1 Climb maneuver ..................................................................... 45
7.2.2 Roll maneuver ......................................................................... 47
7.3 Conclusion ............................................................................................. 50
APPENDIX A; MATLAB Codes ................................................................................... 51
APPENDIX B; USER GUIDE ........................................................................................ 61
APPENDIX C; FUTURE DEVELOPMENT ...................................................................... 63
References .............................................................................................................. 65
Scope;
Adapt an existing nonlinear model of a civil aircraft to an F-16 Falcon fighter aircraft
through its stability derivatives obtained from experimental data. Trim the model in
order to analyze the longitudinal and lateral stability response to a set of disturbances
from its trim point. Observe and analyze the Aircraft attitude in a Virtually Simulated
environment.

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

Fig. I General structure of the non-linear model

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.

Fig 1.0 Body, wind and Stability frames representation; [Ref.

2
1.1 Variables and relations

State variables;
𝑥 = [𝑢 𝑣 𝑤 𝑝 𝑞 𝑟 𝜙 𝜃 𝜓 ] !
Control variables
𝑢 = [𝛿" 𝛿# 𝛿$ 𝛿! ]!

Axis mentioned below are referred to body frame system

𝑢; 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;

In order to define the system completely, intermediate parameters as functions of the


state vector will be stablished. Air density is considered constant for the moment but
after Navigation equations are implemented further ahead and the altitude is included
as a state, a variable density might be feasible for a future development of the model
(Appendix C). An important remark is that the nonlinear character of the velocity
impedes the model from being considered linear.

𝑣% = 0𝑢& + 𝑣 & + 𝑤 &


𝑤
𝛼 = tan'( 6 7
𝑢
'(
𝑣
𝛽 = sin ; <
𝑣%
1 &
𝑄 = 𝜌𝑣%
2
Where

𝑣% ; 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;

a) Obtention of Aerodynamic Forces in the body frame.

i) Obtention of Nondimensional Aerodynamic Force coefficients in


stability frame.
ii) Obtention of Aerodynamic Forces in the body frame through
dimensionalization and rotation.

b) Obtention of Aerodynamic Moments about the center of gravity in body frame

i) Obtention of Nondimensional Aerodynamic Moment coefficients


about aerodynamic center in the body frame
ii) Obtention of Aerodynamic Moments about aerodynamic center
through dimensionalization.
iii) Obtention of Aerodynamic Moments about center of gravity in
the body frame by performing a moment transfer.

c) Propulsion Effects inclusion in the model


d) Gravity Effects inclusion in the model

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.

Lift coefficient (provided by wing and tail)

𝑐) = 𝑐) * + 𝑐) +

𝑐) * = 𝒏(𝛼 − 𝜶𝑳-𝟎 )
𝑆+
𝑐) + = 𝑨 ∗ 𝛼+
𝑆
Where;
𝛼+ = 𝛼 − 𝜖 + 𝛿# + 𝐷𝑃𝑅
Where;
𝒅𝝐 𝑙+
𝜖= (𝛼 − 𝜶𝑳-𝟎 ); 𝐷𝑃𝑅 = 𝑩 ∗ 𝑞 ; <
𝒅𝜶 𝑣%

Notation;

𝑛; Lift curve slope


𝑤; Wing
𝑡; Tail
𝑆+ ; Tail surface
𝑆; Wing surface
𝛼; Aircraft angle of attack
𝛼)-/ ; Zero lift angle of attack
𝛼+ ; Tail effective angle of attack;
𝛿# ; Horizontal stabilizer deflection
𝜖; Downwash;
01
02
= 0.25; Change in downwash due to angle of attack;
𝐷𝑃𝑅; Dynamic pitch response
𝑞; Pitch rate
𝑙+ ; Distance from aerodynamic center to tail aerodynamic center
𝑣% ; Airspeed

Coefficient’s values in the model are

𝐴 = 3.1; 𝐵 = 1.3;
Drag coefficient

𝑐3 = 𝒄𝑫𝟎 + 𝒌𝑐)&
Where;

𝑐3" ; Parasite drag coefficient

5
Side force coefficient

𝑐5 = 𝑪𝛽 + 𝑫𝛿$

Where;

𝛽; Sideslip angle
𝛿$ ; Rudder deflection
C; Side force stability derivative
D; Side force control derivative

Derivatives values for RCAM;

𝐶 = −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)

AC; Aerodynamic center

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!

𝑋@A , 𝑌@A , 𝑍@A ; Center of gravity in the body frame


𝑋%B! , 𝑌%B! , 𝑍%B! ; Application point of the thrust in the body frame
𝛿! ; Throttle setting

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
𝑔

Rotated to the body frame, the resultant components become;

𝑔 sin(𝜃 )
ffff⃗
7
𝐹C = 𝑚 … 𝑔 cos(𝜃) sin(𝜓) ˆ
𝑔 cos(𝜃) cos(𝜓)

8
1.3 First Order differential form

𝒙̇ = 𝒇(𝒙, 𝒖)

𝑥(̇ 𝑢̇ 1 7 fffff⃗7 ffff⃗7


b 𝑥&̇ c = b 𝑣̇ c = ffff⃗
𝐹 − 𝑤7 × 𝑣
𝑥Ė 𝑚
𝑤̇ D

𝑥Ḟ 𝑝̇
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;

- 𝑆(𝑎𝑛𝑔𝑙𝑒), 𝐶(𝑎𝑛𝑔𝑙𝑒), 𝑇(𝑎𝑛𝑔𝑙𝑒); are the “sine”, “cosine” and “tangent”


functions

The super index

- b; Referred to the body frame

The sub-indexes;

- b/e; Body respect to earth


- A; Aerodynamic
- E: Engine
- g; Gravity
- cg; Center of gravity

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.

The syntax implemented for this function therefore, consists in;

function [XDOT] = FALCON_Model(X,U)



end
(The complete function is available in Appendix A)

The notation used in the model is;

Parameter Description Code Parameter Description Code


Notation Notation
u Velocity in X axis ! * "
) x1 𝜹𝒂 Aileron u1
deflection
(rad)
v Velocity in Y axis ! * "
) x2 𝜹𝒉 Horizontal u2
stabilizer
deflection
(rad)
w Velocity in Z axis ! * "
) x3 𝜹𝒓 Rudder u3
deflection
(rad)
p Roll rate !
./0
" x4 𝜹𝑻𝟏 Throttle 1 u4
*
setting
q Pitch rate !
./0
" x5 𝜹𝑻𝟐 Throttle 2 u5
*
setting
r Yaw rate !
./0
" x6
*
NOTE; FOR F-16 THERE IS
𝝓 Roll angle (rad) x7 ONLY ONE ENGINE AND
HENCE ONLY 4 CONTROL
𝜽 Pitch angle (rad) x8 INPUTS

𝝍 Yaw angle (rad) x9

Table 2.1 Notation used for coding

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

Mean aerodynamic chord cbar 6.6 3.45


(𝑚)
Distance from aerodynamic lt 24.8 5.5
center of tail and body (m)
Wing Surface (𝑚4 ) S 260 27.87

Tail planform area (𝑚4 ) St 64 10.5


COG positions as a function Xcg [0.23,0,0.1]*cbar [0.3,0,0.1]*cbar
of the chord (𝑚) Ycg
Zcg
AC positions as a function of Xac [0.12 0 0]*cbar [0.5 0 0] *cbar
the chord Yac
Zac
Engine 1 placement Xapt1 [0,-7.94,-1.9] [0,0, -0.4]
coordinates (𝑚) Yapt1
Zapt1
Engine 2 placement Xapt2 [0,7.94,1.9] NR
coordinates (𝑚) Yapt2
Zapt2
NR; Not Relevant AC; Aerodynamic center COG: Center of gravity

Table 2.2 External characteristics of both aircrafts

Inertia matrixes are;

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.

The inverse of this matrixes is;

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;

rho= 1.225; % Density assumed constant


Va = sqrt(x1^2 + x2^2 + x3^2); % Airspeed
Q=0.5*rho*Va^2; % Dynamic pressure
alpha = atan2(x3,x1); % Angle of attack
beta = asin(x2/Va); % Sideslip angle

3. Design constraints; imposing control saturations, the system works between


the structural limits of the aircraft, in RCAM model, restrictions were specified
while for F-16, [Ref. 4] was use. The implementation of the restrictions is
simple by setting the maximum or minimum value if the limit is exceeded
through the use of two “If loops” for each control parameter.

Parameter Code RCAM F-16


Notation
Maximum aileron deflection u1max 25*pi/180 21.5*pi/180
(𝑟𝑎𝑑𝑠)
Minimum aileron deflection u1min -25*pi/180 -21.5*pi/180
(𝑟𝑎𝑑𝑠)
Maximum horizontal u2max 10*pi/180 25*pi/180
stabilizer deflection (𝑟𝑎𝑑𝑠)
Minimum horizontal u2min -25*pi/180 -25*pi/180
stabilizer deflection (𝑟𝑎𝑑𝑠)
Maximum rudder deflection u3max 30*pi/180 30*pi/180
(𝑟𝑎𝑑𝑠)
Minimum rudder deflection u3min -30*pi/180 -30*pi/180
(𝑟𝑎𝑑𝑠)
Maximum engine 1 throttle u4max 10*pi/180; NR
setting
Minimum engine 1 throttle u4min 0.5*pi/180 NR
setting
Maximum engine 2 throttle u5max 10*pi/180; NR
setting
Minimum engine 2 throttle u5min 0.5*pi/180 NR
setting
*NR; Not References *BOLD; Arbitrary *AC; Aerodynamic center

Table 2.3 Constraints on each aircraft based on [Ref.1] and [Ref.2]

4. Aerodynamic forces and moments; The modelling of these equations address


directly to the previous section. The rotation of the frames and the
dimensionalization of the forces and moments are also implemented in the
model and its description is simple but not relevant for the purpose of this
study. In the other hand, the supposition of arbitrary coefficients which model
the forces and moments is essential in order to obtain an accurate model.
Stability derivatives and coefficients of the model must be altered to suit the F-

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.

Hence, the equations implemented in MATLAB define the 9 state variable’s


derivatives in terms of the state and control function as it was the objective for this
section.

2.2 Simulink implementation


The basic Simulink model is presented here. This model still subjected to the several
steps describes in the following sections which are;

a) Obtaining a suitable initial condition (Section 3; Trimming the aircraft)


b) Implementation of Navigation equations (Section 4)
c) Input disturbances manually through a Joystick hardware and output the
results in a virtual reality environment (Section 6)

Fig 2.1 Simulink Preliminary model.


The complete preliminary model is highlighted in blue on the top and the sub systems are decomposed below

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
-

Fig 2.2 Interpreted MATLAB Function block

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.

3.1 Introduction to the trimming problem


In order to set a starting condition for the aircraft since where the nonlinear system
described in previous sections can be linearized, a series of conditions is set and the
state and control vectors which satisfies these conditions are found.

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.

The equations imposed can be physically seen as geometrical conditions and


mathematically as numerical constraints.

3.2 Steady state straight and level flight conditions


In order for the aircraft to be trimmed in steady straight leveled flight, 𝒏 = 𝟏𝟒
restrictions (equations) described below are imposed. This number match the
number of variables; , 𝒎 = 𝟏𝟒 (9 state variables + 5 control surfaces).

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 ;

(Rearranged in case of 10 to equal the function to 0 and simplify the implementation)

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.

3.3 Penalty method optimization


This technique was first developed in [Ref. 6] and consists in transforming a
constrained problem (minimize an objective function 𝑓/ subjected to a set of
restrictions 𝑓9 ) into an unconstrained approximated problem (integrating the
restrictions in an approximate objective function 𝑓¢/ through the use of penalty
coefficients and hence minimize it using in this case “fminsearch” MATLAB command).

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;

min 𝑓©/ = 𝑓/ + 𝛼( ∗ 𝑓(& + 𝛼& ∗ 𝑓&& + ⋯ 𝛼9 ∗ 𝑓9&

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;

min 𝑓©/ = 𝛼 ∗ 𝑓(& + 𝛼 ∗ 𝑓&& + ⋯ 𝛼 ∗ 𝑓9&

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 .

This way, the final unconstrained problem results in;

min 𝑓©/ = 𝑓(& + 𝑓&& + ⋯ + 𝑓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);

𝑓(/ = 𝑣% − 100 = √𝑢 + 𝑣 + 𝑤 = 0𝑋(1) + 𝑋(2) + 𝑋(3) − 100 = 0


𝑋(3)
𝑓(& = 𝛾 = 𝜃 − 𝛼 = 𝑋(8) − atan Ž •=0
𝑋(1)
Further restrictions are simply;

𝑓(( = 𝑣 = 𝑋(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.

The MATLAB command “fminsearch” in Script 1.3 “Trim_FALCON”, attempts to


minimize the function built inside “Cost_FALCON”, with the initial condition of 𝑥/ , and
outputs the value of the cost function (which proximity to zero defines how good the
approximation was) and also outputs the state for which this condition is accomplish.
The values of the parameters obtained are saved (through “save” command) as 𝑥𝑆𝑡𝑎𝑟
and 𝑢𝑆𝑡𝑎𝑟 and are the initial guess (through “load” command) for the next iteration of
the script. After the first results, the iterative process is repeated a desired number of
times with the support of a “for loop”.

When the script converges to a solution the system is considered trimmed.

19
SECTION 4
NAVIGATION EQUATIONS IMPLEMENTATION

4.1 Definition of the navigation equations


In order to completely characterize the system, 12 state variables are required; the
three translational velocities and the three rotational velocities have been obtained as
well as the three Euler angles, hence the three position variables are missing and will
be obtained during this section.

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

Fig. 4.1 Vehicle’s velocity in body and NED frames

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;

a) A yawing through 𝜓 angle (rotation through 𝑧 R )


b) A pitch through 𝜃 angle (rotation through 𝑦 R )
c) A roll through 𝜙 angle (rotation through 𝑥 R )

Each of those rotations is characterized by a rotation matrix. Multiplying the 3


matrixes sequentially, the direction cosine matrix DCM is obtained and shown in Fig
4.2. However, for the purpose considered, the requirement is to rotate the velocities
from the body frame into the NED frame and therefore, the inverse of the matrix is
going to be multiplied by the velocity vector expressed in the body axis. As this matrix
is orthogonal, the inverse equals the transpose which facilitates the computing
resources used.

20
Fig 4.2 Direction Cosine Matrix for Euler Transformation https://www.programmersought.com/article/86673323097/ (modified
for notation purpose) [REFERENCE]

This way, in order to obtain the velocity in the NED frame;

𝑣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.

4.2 Implementation in MATLAB model


As all the Euler angles are part of the state vector, the only additional block that must
be implemented in MATLAB Function 1.1 “FALCON_Model” is the definition of the
DCM matrix and its transposition and further multiplication with the velocity vector;

C1v = [cos(x9) sin(x9) 0;


-sin(x9) cos(x9) 0;
0 0 1];

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';

positions = Cvb*V_b;

Following this block, all the states are already defined;


- 3 translational velocities; 𝑢, 𝑣, 𝑤 (in the body frame)
- 3 angular velocities; 𝑝, 𝑞, 𝑟
- 3 Euler angles 𝜙, 𝜃, 𝜓

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.

The appropriate definition of this angle is schematically represented in Fig. 4.3.

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.

5.1 Modifications in the model


Two types of modifications which address directly to the model are performed with
the criteria described in 5.1.3.

5.1.1 General modifications


Two major General factors differ from the original model;

Label Description RCAM F-16 FALCON


G-1 Engine number 2 1
G-2 Cruise Airspeed (m/s) 85 528 (M=1.6 at Sea Level)

5.1.2 Particular modifications


Apart from the modifications stated in Section 2, particular modifications to meet F-16
characteristics were made;

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𝜋

5.1.3 Modification criteria


G-1: In order to avoid over constraining the model (by subtracting one engine, one
control parameter will be avoided and hence a higher number of restrictions than of
parameters would be considered), the two engines remain operational in the program
for this computational purpose although they were centered; in the original model
they were positioned 7.43 meters from the fuselage’s root while for the F-16 Falcon
they have been positioned 0.01 meters from it (effectively meaning they act as a single
engine).
This also helps double checking an appropriate behavior of the trimming function as
propelling must be symmetrical when trimmed and could be later use to build an
appropriate propulsive model for the aircraft (APPENDIX C).

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.

𝑑𝐶) 0.48 − 0 180 (𝑑𝑒𝑔)


= ∗ = 2.5 𝑟𝑎𝑑 '(
𝑑𝛼 12 − 1 (𝑑𝑒𝑔) 𝜋 (𝑟𝑎𝑑)

Also, from the graph;

𝜋
𝛼/ = 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;

𝐶3 = 𝐶3/ + 𝑘 (𝐶) − 𝐶)/ )&

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.

Fig 5.3; Drag polar approximation in www.desmos.com

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 𝑟𝑎𝑑 '(

Hence assuming linearity, this coefficient can be approach as;

𝑑𝐶9 180𝛼
= ;0.048 − <
𝑑𝛽 345.95𝜋

P-9: Finally, to obtain this derivative, the relation below was used

𝑑𝐶6 𝑑𝐶6 𝑑𝐶)


=
𝑑𝛼 𝑑𝐶) 𝑑𝛼

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.

5.3 Final first order differential form for F-16 Falcon


The description of the model parameters was already performed in Section 1. Here the
values of the changed coefficients are stated. The rest of the coefficients remained
unchanged in the model.

5.3.1 Aerodynamic force coefficients


𝜋
𝑐) *7 = 2.5 6𝛼 − 1 ∗ 7
180
𝑆+
𝑐) + = 2.025 ∗ 𝛼+
𝑆
Where;
𝒅𝝐 𝜋
𝛼+ = 𝛼 − 6𝛼 − 1 ∗ 7 + 𝛿# + 𝑫𝑷𝑹
𝒅𝜶 180
𝑐3 = 0.03 + 0.265(𝑐8 + 0.05)&
𝑐5 = 0.477𝛽 + 𝑩𝛿$

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.

5.3.2 Aerodynamic moments coefficients


The coefficients of the dynamic effects of angular velocity matrixes and the control
effectiveness matrix remain unchanged. Vector which models the static stability
effects, after the stability derivatives have been calculated transforms in;

−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.

Furthermore, the disturbances analyzed can be introduced through step or impulse


functions but in addition, a 3-axis Joystick is used for this purpose and helps gathering
larger amount of data. Its configuration and arrangement are also described in this
section

These simulators can be divided into 3 general sections;


- Introduction of data (1st Section)
- Computation of data (2nd Section)
- Output of data (3rd Section)

6.1 Computer-time simulator.


In first place, the simplest simulator is described and shown in Fig.6.1a.
The advantage of this structure is that it runs in computer time pace so long periods
can be simulated in a short amount of real time and can be used to study long term
effects on a set of disturbances.

Introduction of control data is the addition of the trimmed control configuration


summed with a predefined set of disturbances (Fig.6.1b) in this case, given by step
functions. An example on how the disturbances are set is shown in Fig.6.1c where the
aileron has been deviated 5 degrees at 𝑡 = 5 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 through a step function and
then restored to its original position 1 second later through an step function of -5
degrees.

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

6.2 Real time simulator visualized in virtual reality


In this section, the virtual reality build up is described. Two similar Simulink blocks
were created for the purpose. In one of them, the introduction of disturbance data is
preset in the same way as in the simulator described in 6.1 whilst in the other one, the
data is introduced with a Joystick tool which configuration is described in Section 6.2.4

6.2.1 Virtual Reality Simulator graphical Interface


MATLAB aerospace toolbox includes several packages which are available for every
user. One of these packages is “aeroblk_HL20” and is a similar 6 degree of freedom
model to the one approached during this study. The model interface is shown in Fig.
6.2 and is referenced in [Ref.3].

33
Fig.6.2 Simulink Interface of “aeroblk_HL20”

Furthermore, inside the visualization subsystem (Fig.6.3), a virtual reality visualization


block is available. It can be observed that the only requirements for the virtual reality
display is that both, position and Euler angles are feed at every moment. This
characteristic makes suitable to fit this block in the F-16 Falcon model that is being
created, hence the block is translocated to the Simulink model. In Fig.6.4 the graphical
interface of the simulator is shown and in Section 6.3 a deeper exploration of the
simulator capabilities is described.

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

6.2.2 Real time pace setting


In order to solve the mismatch between computational and real time, a block named
“Set Pace” must be included in the Simulink model by itself. This block, as it is shown in
Fig.6.5, attempts to make the simulation pace in accordance with clock pace so “1
simulation second per clock second is selected”. The Sample time remained in its
default setting as by using the scope it could be proved that the purpose was
appropriately accomplished.

Fig.6.5 Real time simulation pace block

6.2.3 Disturbance input


In order to analyze the dynamic stability of the aircraft once trimmed, different
approaches for entering the disturbances can be made. The first one is identical to the

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

6.2.4 Joystick Setting


For the purpose of this study, the 4-axis “jWin USB Joystick” shown in Fig. 6.6 was
elected. The throttle axis which regulates the throttle setting was not successfully
configurated so the operations analyzed will be at the trimmed constant throttle
setting (but not at a constant speed as different maneuvers will influence velocity).

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

In Fig.6.8 a comparison between a set of disturbances through step functions


predetermined automatically and another smoother set of disturbances by using the
joystick is shown

Fig. 6.8 a) Predefined set of disturbances


b) Attempt of copying the disturbance sequence with the Joystick

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.

Fig.6.9 a) Pitch down and up maneuvers


b) Roll clockwise and anticlockwise maneuvers
c) Yaw left and right maneuvers

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 3 models are summed up in the following table;

Model Model name Pace Input of Output of data


number disturbances
1 FALCON_sim1.slx Computational Pre-defined Graphs
2 FALCON_sim2.slx Real time Pre-defined Virtual Reality + Graphs
3 FALCON_sim3.slx Real time Joystick Virtual Reality + Graphs

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

7.1 Trim Point


After all of the new data is introduced in the model, the velocity is set to 528 m/s
(M=1.6) and the trim point calculated by using Script 1.2. The trimmed state of the
aircraft is as follows;

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 𝑟𝑎𝑑 ;

𝑋/ (10) = 𝑁/ = 0; 𝑋/ (11) = 𝐸/ = 0; 𝑋/ (12) = 𝐷/ = 0;

Where 𝑁/ , 𝐸/ and 𝐷/ are the initial positions.

The aircraft trimmed deflection surfaces in radians are;

𝑈/ (1) = 𝛿"" = 0 ; 𝑈/ (2) = 𝛿#" = −0.2105 ; 𝑈/ (3) = 𝛿$" = 0

𝑈/ (4) = 𝛿!(" = 0.8159; 𝑈/ (5) = 𝛿!&" = 0.8159

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.

These values output a value of the constructed cost functions of;

𝑓/ = 3.345 ∗ 10'&F

Which means that the aircraft is correctly trimmed as it is sufficiently close to 0.

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.

7.2 Results to disturbances of the Trim Point


To obtain these results, Simulink Model 2 of Section 6.3 is going to be used as it allows
a precise input in the disturbance subsystems and a clear observation of the results in
the VR simulator can be observe. Two maneuvers are studied; climbing and rolling

44
7.2.1 Climb maneuver

In order to perform this maneuver, 2 double-steps functions are provided to the


system. The first one deflecting the elevator 3º upwards to make the aircraft pitch and
cancel by an equivalent step after 2 seconds. At this point the aircraft has the nose up.
The second step consists in an additional deflection in the opposite direction of 3º to
stabilize the aircraft during 2.2 seconds until an opposite step is implemented and
hence the elevator is leveled and the aircraft as well. Figures below show the evolution
of control surfaces, positions and states during this maneuver. In Fig 7.2.1.2 its
observable the fact that 3000 m had been climbed during the maneuver which took
12.2 seconds in total and also that the aircraft have advanced 22000 meters during the
48 seconds that the simulation took. In Fig.7.2.1.3, the state parameters evolution is
shown.

Fig 7.2.1.1 Control surfaces deflections for the climb maneuver

45
Fig. 7.2.1.2 Position evolution during the climb maneuver

Fig.7.2.1.3 State 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

Fig 7.2.2.2b State evolution during the corrected 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.

A possible solution for an appropriate sensitivity analysis and to observe and


quantify the impact of each of the coefficients is the linearization of the system
through Simulink tool or through some numerical method. This way, de-coupled
matrixes which model the different aircraft vibration modes could be obtained,
studied and developed. In addition to observe how the coupling affects lateral and
directional modes, with the linearization, eigenvalues and eigenvector analysis can be
performed and this way, the stability of the aircraft could be accurately quantified.

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

Function Function Name Description


Numbering
Function 1.1 FALCON_Model Calculates the complete differential
state 𝑥̇ with the state and control
vectors (𝑥, 𝑢) supplied.

Script 1.2 Trim_FALCON Finds the trim point by minimizing the


cost function (Function 1.3)

Function 1.3 Cost_FALCON Builds the cost function with the


appropriate definition of angles and
with the starting point in the origin.

Script 1.4* Initialize_FALCON Runs the Simulink complete model


from its trimming condition with the
desired disturbances imposed in
Simulink.

*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)

%----------------STATE AND CONTROL VECTOR-----------------


%Extract state vector
x1=X(1); %u velocity X axis (m/s)
x2=X(2); %v velocity Y axis
x3=X(3); %w velocity Z axis
x4=X(4); %p roll rate about X (rad/s)
x5=X(5); %q pitch rate about Y
x6=X(6); %r yaw rate about Z
x7=X(7); %phi (rad)
x8=X(8); %theta
x9=X(9); %psi
x10=X(10); %PN
x11=X(11); %PE
x12=X(12); %Pdown

u1=U(1); %d_a aileron deflection


u2=U(2); %d_h horizontal stabilizer deflection
u3=U(3); %d_r rudder deflection
u4=U(4); %d_t throttle 1
u5=U(5);

%----------------F-16 GEOMETRY CONSTANTS---------------


%Nominal vehicle constants: F-16 Uncommented

51
m=91188/9.81; % Mass (kg)

cbar = 3.45; % Mean chord


lt = 5.5; % Distance Aero Center tail-body
S = 27.87; % Wing surface (m^2)
St= 10.5 ; % Tail planform area (m^2)

Xcg = 0.3*cbar; % x position of CG (m)


Ycg = 0; % y position of CG (m)
Zcg = 0*cbar; % z position of CG (m)

Xac = 0.5*cbar; % x position of aerodynamic center (m)


Yac = 0; % y position of aerodynamic center (m)
Zac = 0; % z position of aerodynamic center (m)

%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)

Xapt2 = 0; % x position of engine 2 (m)


Yapt2 = 0.01; % y position of engine 2 (m)
Zapt2 = -0.4; % z position of engine 2 (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

alpha_L0 = 1*pi/180; % Zero lift angle of attack (rad)

n=2.5;

%-----------------------1. CONTROL LIMITS/SATURATION----------


% 1. Set maximum and minimun deflections
u1min = -21.5*pi/180; %Ailerons
u1max = 21.5*pi/180;

u2min = -25*pi/180; %Elevator


u2max = 25*pi/180;

u3min = -30*pi/180; %Rudder


u3max = 30*pi/180;

% 2. Impose the constraints through if loops


if (u1>u1max)
u1 = u1max;
elseif (u1<u1min)
u1 = u1min;
end

if (u2>u2max)
u2 = u2max;
elseif (u2<u2min)

52
u2 = u2min;
end

if (u3>u3max)
u3 = u3max;
elseif (u3<u3min)
u3 = u3min;
end

%-----------------2. INTERMEDIATE VARIABLES--------


%Calculate airspeed
Va = sqrt(x1^2 + x2^2 + x3^2);

%Calculate alpha and beta


alpha = atan2(x3,x1);
beta = asin(x2/Va);

%Calculate dynamic pressure


Q=0.5*rho*Va^2;

%Define the angular velocity vectors


wbe_b= [x4;x5;x6];
V_b=[x1;x2;x3];

%-------------------3. AERODYNAMIC FORCE COEFFICIENTS-----


CL_wb=n*(alpha - alpha_L0); %Wing Lift Coef
epsilon = depsda*(alpha - alpha_L0); %Downwash modelling
alpha_t = alpha - epsilon + u2+1.3*x5*lt/Va;%Tail effective AoA
CL_t = 2.025*(St/S)*alpha_t; %Tail Lift Coef
CL = CL_wb +CL_t; %Total lift force

CD_0=0.03;
CL_0=-0.05;
k=0.265;

CD=CD_0 + k*(CL-CL_0)^2; %Drag polar

%Calculate the sideforce coeficient


CY= -0.477*beta + 0.24*u3;

%-----------------------4. DIMENSIONAL AERO FORCES-----


%Calculate the actual dimensional fotces (_s is stability axis)
FA_s =[-CD*Q*S;
CY*Q*S;
-CL*Q*S]; %If CL +ve, force in -ve direction of Z

%Rotate these forces to FA_b (body axis)


C_bs = [cos(alpha) 0 -sin(alpha);
0 1 0;
sin(alpha) 0 cos(alpha)];

FA_b = C_bs*FA_s;

%------------------------5. DIMENSIONAL AERO COEF AC


%Calculate the moments in Fb.
%1.Define eta,

53
%2.Define dCMdx and dCMdu

%Static Stability effects


eta1 = -0.048*beta;

eta2 = -0.59 - (0.469*(St*lt)/(S*cbar))*(alpha - epsilon);

eta3 = (0.048 - alpha*(180/(346*pi)))*beta;

eta=[eta1;
eta2;
eta3];

%F-16 Stability derivatives


dCMdx = (cbar/Va)*[-11 0 5;
0 (-27.8*(St*lt^2)/(S*cbar)) 0;
1.7 0 -11.5];

%F-16 Control derivatives


dCMdu = [-0.6 0 0.3;
0 (-4.735*(St*lt)/(S*cbar)) 0;
0 0 -0.63];

%Calculate CM =[Cl;Cm;Cn] about aero center in Fb


CMac_b = eta + dCMdx*wbe_b + dCMdu*[u1;u2;u3];

%------------------------ 6. AERODIN MOMENTS ABOUT AC-----------


%Dimensionalize to aerodynamic moments
MAac_b = CMac_b*Q*S*cbar;

%------------------------ 7. AERODIN MOMENT ABOUT CG------------


%Transfer moments to cg
rcg_b = [Xcg;Ycg;Zcg];
rac_b = [Xac;Yac;Zac];
MAcg_b = MAac_b + cross(FA_b,rcg_b - rac_b); %Transition to CG

%------------------------- 8. ENGINE FORCE & MOMENT-------------


%1.Calculate the thrust of each engine
F1 = u4*m*g;
F2 = u5*m*g;

%Assuming that engine thrust is alligned with Fb;


FE1_b = [F1;0;0];
FE2_b = [F2;0;0];
FE_b= FE1_b +FE2_b;

%Engine moment due to offset of engine thrust from CG.


mew1 = [Xcg - Xapt1;
Yapt1 - Ycg;
Zcg - Zapt1];

mew2 = [Xcg - Xapt2;


Yapt2 - Ycg;
Zcg - Zapt2];

MEcg1_b = cross(mew1,FE1_b);

54
MEcg2_b = cross(mew2,FE2_b);
MEcg_b = MEcg1_b +MEcg2_b;

%------------------------- 9. GRAVITY EFFECTS----------


%Gravitational forces in the body frame. No moment about CoG;
g_b = [-g*sin(x8);
g*cos(x8)*sin(x7);
g*cos(x8)*cos(x7)];

Fg_b = m*g_b;

%-------------------------- 10. STATE DERIVATIVES --------


%Inertia matrix
Ib= [12875 0 1331;
0 75674 0;
1331 0 85552];

%Inverse inertia matrix (Executed separated)


invIb=1e-04*[0.7779 0 -0.01210;
0 0.1321 0;
-0.01210 0 0.1171];

%Total Forces in body frame F_b


F_b = Fg_b + FE_b +FA_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

%Total moments about CG in body frame Mcg_b


Mcg_b = MAcg_b + MEcg_b;

%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

%Calculate phidot,thetadot and psidot


%1.Define Rotation matrix
H_phi =[1 sin(x7)*tan(x8) cos(x7)*tan(x8);
0 cos(x7) -sin(x7);
0 sin(x7)/cos(x8) cos(x7)/cos(x8)];

%x7_dot = phi_dot; x8_dot = theta_dot; x9_dot = psi_dot


x7to9dot = H_phi*wbe_b; %3x1 vector

%Arrange the simple first order form (without Navigation Eq)


x1to9dot = [x1to3dot
x4to6dot
x7to9dot];

%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';

%Velocities in NED frame (To integrate for position)


x10to12dot = Cvb*V_b;

%Set the complete first order form


XDOT = [x1to9dot;
x10to12dot];

end

Script 1.2

%initialization == 1 iterates and optimizes the parameters

clear; clc; close all

%1. Initialize Z_guess


initialization = 0; %0 = start from initial guess
%1 = use saved values from last run
n=15; %Number of cycles

for count=1:n

count %Displays the evolution of the process


if initialization==0
Z_guess = zeros(17,1);
Z_guess(1)=528;

else

Z_guess=[xStar;uStar];
end

%Solve unconstrained optimization problem


[ZStar,f0] = fminsearch('Cost_super',Z_guess,...
optimset('TolX',1e-
10,'MaxFunEvals',100000,'MaxIter',100000));

xStar = ZStar(1:12); %Save trimmed State vector


uStar = ZStar(13:17);%Save trimmed Control vector

initialization=1;
end

56
format long
ZStar %Display the state and control trim conditions
f0 %Display the value of the cost function

%Next command creates file and stores trimmed values


save trim_values_FALCON

Function 1.3

function [F0] = Cost_super(Z)


X = Z(1:12);
U = Z(13:17);

xdot = RCAM_super(X,U);
Va = sqrt(X(1)^2 + X(2)^2 + X(3)^2); %Airspeed

%Accurate definition of climbing angle and course angle;


gam = atan2(-xdot(12),sqrt(xdot(10)^2+xdot(11)^2));
Course=pi/2 -atan2(xdot(10),xdot(11));

%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)

H = diag(ones(1,17)); %All penalty parameters set to 1


F0 = Q'*H*Q; %Cost Function building

Script 1.4

%Initialize constants for the simulation and run the model

clear
clc
close all

%% Define constants

%Load the values in the file created with Function 1.2


load('trim_values_FALCON')

x0=xStar
u=uStar

TF=0.5*60; %Simulation time

%Joystick Configuration (Comment if Joystick not used)


%This block finds the "zero" position of the Joystick

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];

%% Run the model


%Uncomment the model being used

%sim('FALCON_sim1.slx') %COMPUTING TIME (for long runs)


sim('FALCON_sim2.slx') %REAL TIME with Joystick
%sim('FALCON_sim3.slx') %REAL TIME with pre-set disturbances

%% Plot the results


t = simX.Time;

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);

%Plot the evolution of the control surfaces


figure
subplot(4,1,1)
plot(t, u1)
legend('u_1 Aileron Deflection')
grid on

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

%Plot the evolution of the states during the flight


figure

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

%phi theta psi


subplot(3,3,3)
plot(t, x7)
legend('\phi')
grid on

subplot(3,3,6)
plot(t, x8)
legend('\theta')
grid on

subplot(3,3,9)
plot(t, x9)
legend('\psi')
grid on

%Plot the evolution of the positions during the simulation

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.

A) Simulating the F-16 Falcon.

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.

Afterwards, in Script 3.4 “Initialize_FALCON” one of the three models is uncommented


(deleting the “%” symbol at the front) and executed. To visualize simultaneously the
virtual simulator if Model 2 or 3 is being simulated, the Simulink model must be
opened and the block “VR Sink” shown in the subsystem of Fig.6.10e double clicked.

As a final note, if a joystick is not connected, the joystick configuration block of


“Initialize_FALCON” referred in section 6.2.4 must be commented (with the addition
of “%” symbol at the front), else, the program will not be executed.

B) Simulating an alternative aircraft

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.

1. Inclusion of a Standard Atmosphere influence;

• This feature can be added by including altitude as a variable in Function 1.1 of


APPENDIX A “FALCON_Model” and in the same function, the dependance of
density with altitude should be stated. In the Simulink model, altitude should
be feedback to the function

2. Inclusion of Engine Mapping

• This feature can be included by constraining parameters u4 and u5 and


modeling them according to engine system. The purpose would be to observe
the behavior of the aircraft when accelerated or decelerated. In the existing
model these parameters are set in the optimization procedure without any
constraint and as the aircraft requires and remain unaltered during the
simulation.

3. Inclusion of Stall modelling;

• 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.

4. Inclusion of an Automatic Pilot;

• This feature can be included in the Simulink model by doing an appropriate


feedback (with a consistent autopilot design method) and could be activated or
disactivated manually by the user or automatically under certain conditions.

5. Dynamic constraints on the control surfaces;

• This feature exists in some aircrafts to preserve structural integrity or simply by


physical impossibility of instant deflections. It could be model the same way as
limiting constraints for the control surfaces are modelled in the current
software.

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

[2] NASA Technical Paper 3355 Supersonic aerodynamic Characteristics of an Advanced


F-16 Derivative Aircraft Configuration. Mike C Fox and Dana K Forrest

[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

You might also like