Aerosim Ug
Aerosim Ug
Version 1.01
User’s Guide
Unmanned Dynamics, LLC
No.8 Fourth St.
Hood River, OR 97031
(541) 308-0894
http://www.u-dynamics.com
[email protected]
2
CONTENTS AeroSim Blockset User’s Guide
4.6.7 Body-frame EOM: Navigation . . . . . . . 96 4.11.3 Simple Sensor - 1st-order dynamics . . . . 135
4.6.8 Geodetic-frame EOM: Position . . . . . . 98 4.11.4 Simple Sensor - 2nd-order dynamics . . . . 136
4.6.9 Geodetic-frame EOM: Velocity . . . . . . 100 4.11.5 Analog Sensor . . . . . . . . . . . . . . . 137
4.6.10 Geodetic-frame EOM: Attitude (Quaternions)102 4.11.6 A/D Converter . . . . . . . . . . . . . . . 138
4.6.11 Geodetic-frame EOM: Attitude (Euler An- 4.11.7 Single GPS Measurement . . . . . . . . . 139
gles) . . . . . . . . . . . . . . . . . . . . . 103 4.11.8 GPS PV . . . . . . . . . . . . . . . . . . . 140
4.6.12 Geodetic-frame EOM: Angular Rate . . . . 104 4.12 Transformations . . . . . . . . . . . . . . . . . . . 141
4.7 Inertia . . . . . . . . . . . . . . . . . . . . . . . . 106 4.12.1 Body-Inertial DCM From Quaternions . . . 142
4.7.1 Aircraft Inertia . . . . . . . . . . . . . . . 107 4.12.2 Body-Inertial DCM From Euler Angles . . 143
4.7.2 Inertia Coefficients . . . . . . . . . . . . . 109 4.12.3 Body-Wind DCM . . . . . . . . . . . . . . 144
4.8 Math . . . . . . . . . . . . . . . . . . . . . . . . . 110 4.12.4 Euler Angles From Quaternions . . . . . . 145
4.8.1 Cross Product . . . . . . . . . . . . . . . . 111 4.12.5 Euler Angles from DCM . . . . . . . . . . 146
4.8.2 Normalization . . . . . . . . . . . . . . . 112 4.12.6 Quaternions From Euler Angles . . . . . . 147
4.8.3 Vector Norm . . . . . . . . . . . . . . . . 113 4.12.7 ECEF Position . . . . . . . . . . . . . . . 148
4.8.4 Non-zero Sign . . . . . . . . . . . . . . . 114 4.13 Unit Conversion . . . . . . . . . . . . . . . . . . . 149
4.8.5 Zero Offset . . . . . . . . . . . . . . . . . 115 4.13.1 Angular position: Deg 2 rad and Rad 2 deg 150
4.8.6 pi Bound . . . . . . . . . . . . . . . . . . 116 4.13.2 Angular velocity: Rad/s 2 RPM and RPM
4.8.7 2pi Bound . . . . . . . . . . . . . . . . . . 117 2 rad/s . . . . . . . . . . . . . . . . . . . . 151
4.9 Pilot Interface . . . . . . . . . . . . . . . . . . . . 118 4.13.3 Distance: ft 2 m and m 2 ft . . . . . . . . . 152
4.9.1 FS Interface . . . . . . . . . . . . . . . . . 119 4.13.4 Distance: m 2 nm and nm to m . . . . . . . 153
4.9.2 FlightGear Interface . . . . . . . . . . . . 121 4.13.5 Velocity: m/s 2 km/h and km/h 2 m/s . . . 154
4.9.3 Joystick Interface . . . . . . . . . . . . . . 123 4.13.6 Velocity: m/s 2 mph and mph 2 m/s . . . . 155
4.9.4 CH F-16 Combat Stick . . . . . . . . . . . 124 4.13.7 Velocity: m/s 2 kts and kts 2 m/s . . . . . . 156
4.10 Propulsion . . . . . . . . . . . . . . . . . . . . . . 126 4.13.8 Force: lbf 2 N and N 2 lbf . . . . . . . . . 157
4.10.1 Fixed-Pitch Propeller . . . . . . . . . . . . 127 4.13.9 Mass: lb 2 kg and kg 2 lb . . . . . . . . . . 158
4.10.2 Piston Engine . . . . . . . . . . . . . . . . 128 4.13.10 Mass: slug 2 kg and kg 2 slug . . . . . . . 159
4.10.3 GA Propulsion System . . . . . . . . . . . 130 4.13.11 Volume: gal 2 l and l 2 gal . . . . . . . . . 160
4.11 Sensors . . . . . . . . . . . . . . . . . . . . . . . 132 4.13.12 Pressure: Pa 2 in.Hg. and in.Hg. 2 Pa . . . 161
4.11.1 Noise Correlation: Random Walk . . . . . 133 4.13.13 Temperature: K 2 F and F 2 K . . . . . . . 162
4.11.2 Noise Correlation: Gauss-Markov Process . 134 4.14 FlightGear-Compatible . . . . . . . . . . . . . . . 163
3
4.14.1 Inertia: Empty Aircraft . . . . . . . . . . . 164
4.14.2 Inertia: Point Mass . . . . . . . . . . . . . 165
4.14.3 Propulsion: FG Piston Engine + Fixed-
Pitch Prop . . . . . . . . . . . . . . . . . . 166
4.14.4 Propulsion: FG Piston Engine + Variable-
Pitch Prop . . . . . . . . . . . . . . . . . . 168
4.14.5 Piston Engine: Intake Model . . . . . . . . 170
4.14.6 Piston Engine: AirFlow Model . . . . . . . 171
4.14.7 Piston Engine: FuelFlow Model . . . . . . 172
4.14.8 Piston Engine: Power Model . . . . . . . . 173
4.14.9 Piston Engine: FG Piston Engine . . . . . 174
4.14.10 Propeller Thruster: FG Fixed-Pitch Propeller175
4.14.11 Propeller Thruster: FG Variable-Pitch Pro-
peller . . . . . . . . . . . . . . . . . . . . 176
4.14.12 Tank: Fuel Tank . . . . . . . . . . . . . . 177
4.14.13 Aerodynamics: Value . . . . . . . . . . . . 178
4.14.14 Aerodynamics: Vector . . . . . . . . . . . 179
4.14.15 Aerodynamics: Table . . . . . . . . . . . . 180
4.14.16 Aerodynamics: Coefficient . . . . . . . . . 181
4.14.17 Complete Aircraft: Cessna-172 . . . . . . 182
4.14.18 Complete Aircraft: Cessna-182 . . . . . . 184
4.14.19 Complete Aircraft: Cessna-310 . . . . . . 186
1 INTRODUCTION AeroSim Blockset User’s Guide
• In the Body-Frame EOM folder, the block Kinematics has • Aircraft model trim and linearization script. The Matlab
been renamed to Kinematics (Quaternions). Similarly, in program trims an AeroSim aircraft model for a user-provided
the Geodetic-Frame EOM, the block Attitude has been re- flight condition and extracts the linear model at that flight
named to Attitude (Quaternions). condition.
1
AeroSim Blockset User’s Guide 1 INTRODUCTION
• The addition of attitude representation by Euler angles. For 1.5 Contents of the installation CD
this the following blocks were added to the library: in the
The installation CD includes the following:
Transformations section - Body-Inertial DCM From Eu-
ler Angles, Quaternions From Euler Angles, in the Body- 1. The AeroSim installer, in the directory aerosim-setup.
Frame EOM section - Kinematics (Euler Angles), and in
the Geodetic-Frame EOM - Attitude (Euler Angles). 2. The FlightGear Flight Simulator - an open-source flight sim-
ulator application, in the directory flightgear. The latest ver-
sion of the software can also be downloaded from:
1.3 Keeping up-to-date with the AeroSim Block- http://www.flightgear.org.
set: The AeroSim Mailing List
3. Utilities for Microsoft Flight Simulator, in the directory fsu-
The AeroSim Blockset is evolving steadily. An AeroSim mailing til. These are the following:
list was created at Yahoo Groups for new release announcements
• Flight Simulator Update 2b, for Flight Simulator 2000
as well as for technical discussions regarding the AeroSim Block-
only. This is required for using the other utility pro-
set. The mailing list can be found at:
grams with Microsoft Flight Simulator 2000.
http://groups.yahoo.com/group/aerosim/
We encourage our users to subscribe to this list, by sending a • FSUIPC, an utility which allows inter-process com-
blank email to: munication with Microsoft Flight Simulator 2000 and
[email protected]. 2002 (by Peter L. Dowson). The latest version of this
application can be downloaded from
http://www.flightsim.com.
1.4 System Requirements • WIDEFS, an utility which extends FSUIPC functional-
The minimum software requirements for the AeroSim blockset ity by allowing inter-process communication with Flight
are Matlab version 6 and Simulink version 4. The blockset will Simulator over the local network (by Peter L. Dow-
not operate properly with earlier versions of Matlab (such as 5.x) son). Also, the latest version of the program can be
since AeroSim makes use of matrix signals and matrix operations downloaded at
which are not available in the earlier versions of Simulink. http://www.flightsim.com.
The Flight Simulator and FlightGear interface blocks which • Flight Simulator aircraft. Visual models for the Aerosonde
can be used for visual output require Microsoft Flight Simulator UAV and for the Navion, the two aircraft examples fea-
2000 or later, respectively FlightGear version 0.8. tured in the AeroSim blockset demos can be found
2
1 INTRODUCTION AeroSim Blockset User’s Guide
on the installation disk, in the /fsutil/aircraft/ direc- The entries that will be added to the path listing are $AEROSIM-
tory. There are three versions of each aircraft model ROOT, $AEROSIMROOT/samples, $AEROSIMROOT/trim,
in standard FS5 format, in Flight Simulator 2000 for- $AEROSIMROOT/util, and $AEROSIMROOT/fgutil. If for
mat, and in Flight Simulator 2002 format. The stan- some reason the path file cannot be edited by the installer (cur-
dard FS5 models can be used with any Flight Simu- rent user does not have write permission, or file does not exist) the
lator version from 5.0 up to 98, by making use of the installation program will display a warning message.
Aircraft Converter included with your Flight Simu- After completing the AeroSim blockset installation, start Mat-
lator software. The FS2000 and FS2002 aircraft can lab and open the Simulink browser window. The AeroSim block-
be installed by directly copying the airplane directories set will be available for use, and the library tree will look similar
as provided on the AeroSim disk to your /$FLIGHT- to Fig. 1.
SIM/aircraft/ directory.
The software available on the installation CD can also be down- 1.7 Uninstall the AeroSim Blockset
loaded directly from the AeroSim product page at: To remove the AeroSim Blockset from your machine, choose UnIn-
http://www.u-dynamics.com/aerosim/. stall AeroSim from the Windows Start Menu, or uninstall the
program from the Windows Control Panel. The uninstaller will
1.6 Install the AeroSim Blockset remove all files in the AeroSim directory, and the Start Menu
entries. However, the uninstaller is unable to undo the changes
To install the AeroSim blockset, run the setup.exe executable which made to the Matlab path file. You must manually replace your
is located in the aerosim-setup directory of the installation CD. current pathdef.m file with the original file which was saved as
By default, the installer will place the AeroSim files in the pathdef.old, otherwise Matlab will display a warning during start-
C:/Program Files/AeroSim directory. A dialog box will give the up.
user the option to choose a different directory for installation. The
setup program will also create a new Start Menu entry, in which it
1.8 Library Description
will place a link to a PDF copy of this User Guide.
After the installer finishes copying all the files it will update The AeroSim library folders, presented in Fig. 2, provide more
the Matlab path file by adding entries for the AeroSim blockset. than one-hundred blocks commonly used in the development of
The path file that will be modified is aircraft dynamic models. These include nonlinear equations of
$MATLABROOT/toolbox/local/pathdef.m. Before making any motion, linear aerodynamics, piston-engine propulsion, aircraft in-
changes, a back-up copy of the original file will be saved as pathdef.old.
ertia parameters, atmosphere models, Earth models, sensors and
3
AeroSim Blockset User’s Guide 1 INTRODUCTION
5
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
6
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
2.1 Open-loop Flight Both files are located in the sub-directory samples of the main
AeroSim directory.
The first demo, with the Simulink model shown in Fig. 3, repre- The unbalanced roll moment caused by the propulsion system
sents a simulation of the aircraft in open-loop flight. That is, all air- excites the spiral mode and the aircraft settles in a constant bank
craft control inputs are set to fixed values, independent of the air- angle turn, as shown in Fig. 4.
craft states. The Simulink model can be opened by typing its name
7
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
8
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
2.3 Airspeed Control same time, the airspeed settles to a value which depends on the
elevator setting. The model aerosonde demo4 adds an airspeed
To open the third demo, type aerosonde demo3 at the Matlab control loop using PID (proportional, integral, derivative) control
command prompt. The Simulink diagram is shown in Fig. 7. With laws - see Fig. 9. The airspeed command is set to a constant value
of 25 m/s. By running the simulation, you should see a plot of
the airspeed and pitch angle similar to Fig. 10. The airspeed does
indeed settle to the commanded value, while the phugoid oscilla-
tions are virtually eliminated and the pitch angle settles to a value
of approximately 1.7 degrees.
Figure 8: Airspeed and pitch angle outputs Figure 9: Aerosonde longitudinal control demo
10
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
11
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
2.4 Wind Effects First, we notice that compared to the results of previous sim-
ulations, the airspeed and pitch plots are noisy - the effect of the
To open the fifth demo, type aerosonde demo5 at the Matlab com- von Karman turbulence models - see Fig. 12.
mand prompt. The Simulink diagram is shown in Fig. 11. This ex- We also plot the orientation of the aircraft airspeed vector, ver-
sus the orientation of the aircraft groundspeed vector. When there
is no wind the two vectors are overlapped, and their magnitudes
are identical. In the presence of background wind, this will cause
a difference in the orientation and the magnitude of the airspeed
and groundspeed vectors. We can see that in our case, there is a
difference of approximately 30 degrees (airspeed heading is 25,
while the groundspeed heading is 355).
13
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
14
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
2.6 Joystick Control states. Any joystick inputs given by the user will be displayed in
real-time.
The joystick demo, with the Simulink model joystick demo1 re-
quires the presence of a properly calibrated joystick on the system.
The model is shown in Fig. 15. While the simulation is running,
the display blocks will show the current values for the joystick po-
sition on the 6 axes, as well as the buttons and POV hat switch
15
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
With these parameters, FlightGear will disable its internal flight Figure 16: FGFS interface demo
dynamics, and it will accept aircraft states from the local network,
as a UDP stream, on port 5500.
Now run the Simulink model aerosonde demo fgfs. The Flight-
Gear screen should display a view from the aircraft in straight and
16
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
level flight, see Fig. 18. While the simulation is running, change
the value in the Bank angle Command block from 0 to 30 de-
grees. The FlightGear screen will show the aircraft banking right,
as it settles at the new bank angle command - see Fig. 19.
17
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
4. Check to make sure FSUIPC is installed by starting Flight 9. Start the Simulink model. The Flight Simulator screen will
Simulator and looking for FSUIPC in the Modules pull- display the current position and attitude of the aircraft. Give
down menu, as in Fig. 20. the autopilot a new bank angle command, by updating the
Bank angle Command block. You should be able to see the
5. Check if the WideFS server is running by looking at the
change in aircraft attitude in Flight Simulator immediately.
Flight Simulator window title-bar - see Fig. 20.
Particular aircraft visual models can be loaded in Microsoft
6. On the Matlab machine, copy the WideFS client files (Wide- Flight Simulator before starting the simulation. The FS
Client.exe and WideClient.ini). Edit the client initialization models provided on the AeroSim installation CD include
file to specify the address of the computer running the Flight the Aerosonde - Fig. 22 and the Navion - Fig. 23.
Simulator with WideServer.
8. On the Matlab machine, open the Simulink demo aerosonde demo msfs.mdl.
The demo model is shown in Fig. 21
18
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
19
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
20
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
• FinalTime = the final time for the Simulink mode during the
trim process.
21
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
• RatesIni = the initial value for the aircraft angular rate inte- • Mixture = the air/fuel mixture at which the aircraft will be
grators (Moment Equations). trimmed.
• AttitudeIni = the initial value for the Euler angle integrators • Ignition = choose whether this is a power-on or power-off
(Kinematic Equations). trim condition.
• PositionIni = the initial value for the geographic position • Winds = the background wind vector for which the aircraft
integrators (Navigation Equations). will be trimmed.
• FuelIni = the initial value for the fuel mass integrator. • StateIdx = the state order index maps the order of states in
the Simulink diagram to a desired order of states. Often
• EngineSpeedIni = the initial value for the engine rotation the order in which Matlab considers the states in a Simulink
speed. block diagram is different that the order we intend to use.
In this case, the desired order is [Velocities Rates Attitude
• Airspeed = the airspeed at which the aircraft will be trimmed.
Position Fuel EngineSpeed].
• Altitude = the altitude at which the aircraft will be trimmed.
• Options = the Matlab structure which defines the optimiza-
• BankAngle = the bank (roll) angle at which the aircraft will tion function options.
be trimmed.
• SimOptions = the Matlab structure which defines the simu-
• Elevator = the initial guess for the elevator position at trim lation function options.
condition.
• NAircraftStates = the size of the desired aircraft state vector.
• Aileron = the initial guess for the aileron position at trim
• NSimulinkStates = the size of the Simulink model state vec-
condition.
tor (could be larger since it could include states for other
• Rudder = the initial guess for the rudder position at trim dynamics which are of no interest for trim (such as the tur-
condition. bulence filter states)
• Throttle = the initial guess for the throttle position at trim The trim and linearization script will create the trim parameters
condition. structure with values provided by the user and with default values
for several parameters.
• Flap = the flap setting at which the aircraft will be trimmed. The script performs several steps, as presented below:
22
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
• Set the initial parameters. These include the Simulink model the nonlinear aircraft model is linearized about the trim con-
name and sample time settings as well as default values for dition, using the Matlab function linmod. The resulting lin-
aircraft control inputs. ear model is then decoupled into longitudinal and lateral-
directional plants; this procedure is valid only if the aircraft
• Identify the order of the aircraft states. The identification is trimmed for straight and level flight. At the end of the
is done by running the Simulink model for a single sample linearization procedure, a simple eigenvalue analysis of the
time with some default initial guesses and reading back the longitudinal and lateral-directional dynamics is performed.
Simulink model state vector to identify the indices for each
of the states of interest. To illustrate the process, we will trim the Aerosonde model for
a typical flight condition (Va = 23m/s, h = 200m, φ = 0). By run-
• Initial guess for the aircraft controls. The procedure first ning the trim program trim aerosonde.m we obtain the following
requires user input regarding the flight condition at which output:
the aircraft is to be trimmed. Once the flight condition is
completely defined, the Simulink model is run for a limited Setting initial trim parameters...
amount of time, in an iterative process, and the aircraft con-
The Simulink modelaerosonde_trim.mdl will be trimmed.
trol inputs are adjusted each time by proportional feedback
from selected model outputs (for example, elevator feed- Identifying the order of the Simulink model states...done.
• Perform the aircraft trim. Once a reasonable initial guess for Flap setting [frac]: 0
the aircraft control inputs is obtained, the program will run Computing the initial estimates for the trim inputs...
the optimization which will accurately trim the aircraft for
Iteration # 1, Airsp err = 3.86 m/s, Alt err = -23.96 m, phi
the selected flight-condition. The Matlab function used by err = -15.80 deg.
this procedure is trim.
Iteration # 2, Airsp err = 0.88 m/s, Alt err = 12.95 m, phi err
= -24.39 deg.
• Extract the linear model. Knowing the trim inputs and states,
23
AeroSim Blockset User’s Guide 2 AIRCRAFT MODEL DEMOS
Iteration # 3, Airsp err = 0.27 m/s, Alt err = 2.89 m, phi err = 343 0.00221129 0.125 Hessian modified twice
10.67 deg. 363 0.000299534 1 Hessian modified twice
364 0.00029908 1 Hessian modified twice
Iteration # 4, Airsp err = 0.04 m/s, Alt err = 2.14 m, phi err Optimization Converged Successfully Active Constraints:
= 1.04 deg. 1
2
Iteration # 5, Airsp err = 0.05 m/s, Alt err = 0.85 m, phi err = 3
1.07 deg. 4
5
Iteration # 6, Airsp err = 0.04 m/s, Alt err = 0.35 m, phi err = 6
0.46 deg. 7
8
Iteration # 7, Airsp err = 0.03 m/s, Alt err = 0.16 m, phi err = 9
0.19 deg. 10
11
Iteration # 8, Airsp err = 0.02 m/s, Alt err = 0.10 m, phi err 19
= 0.07 deg. 28
30
Done.
Initial guesses for trim inputs are: Finished. The trim results are:
Elevator = -0.1034 INPUTS:
Aileron = -0.0093 Elevator = -0.1088
Rudder = 0.0000 Aileron = -0.0084
Throttle = 0.4925 Rudder = -0.0010
Throttle = 0.4846
Performing the aircraft trim... STATES:
u = 22.95 m/s
f-COUNT MAX{g} STEP Procedures v = 0.01 m/s
20 0.567619 1 w = 1.51 m/s
40 0.0781559 1 p = -0.00 deg/s
60 0.0581701 1 Hessian modified twice q = -0.00 deg/s
80 0.521641 1 Hessian modified r = -0.00 deg/s
100 0.0379462 1 Hessian modified phi = -0.02 deg
120 0.130393 1 Hessian modified twice theta = 3.77 deg
140 0.000300865 1 Hessian modified psi = 0.02 deg
160 0.000299109 1 Hessian modified twice Alt = 200.00 m
180 0.000299108 1 Hessian modified twice Fuel = 2.00 kg
200 0.000299153 1 Hessian modified Engine = 4812 rot/min
220 0.000299106 1 Hessian modified twice OUTPUTS:
240 0.000299116 1 Hessian modified twice Airspeed = 23.00 m/s
260 0.000299417 1 Hessian modified twice Sideslip = 0.02 deg
280 0.000299103 1 Hessian modified twice AOA = 3.77 deg
300 0.000299113 1 Hessian modified twice Bank = -0.02 deg
320 0.00203574 1 Hessian modified twice Pitch = 3.77 deg
24
2 AIRCRAFT MODEL DEMOS AeroSim Blockset User’s Guide
Observation matrix: C =
0.9978 0.0658 0 0 0 0 Eigenvalue: -19.7263
-0.0029 0.0434 0 0 0 0 Time constant = 0.0507 s
0 0 1.0000 0 0 0 Eigenvalue: -1.3190 +/- 5.5958 i
0 0 0 1.0000 0 0 Damping = 0.2294, natural frequency = 5.7492 rad/s, period = 1.1228 s
0 0 0 0 1.0000 0 Eigenvalue: 0.0611
Time constant = -16.3757 s
25
AeroSim Blockset User’s Guide 3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL
26
3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL AeroSim Blockset User’s Guide
Fig. 27 shows the various reference points required throughout Section 1 of the aircraft configuration script specifies the aerody-
the aircraft configuration script. The locations of these points will namic parameters of the aircraft. These are explained next:
have to be specified with respect to the arbitrarily-chosen origin • Reference point = specify the location, with respect to the
of the body-frame. These reference points include the CG loca- body-frame origin, of the aerodynamic forces application
tions for zero-fuel and for full-tank, the application points for the point. This should be a 1x3 row vector with the x, y, and
aerodynamic and propulsion forces. z coordinates. All the aerodynamic coefficients (force and
The orientation of the body axes should be chosen as in the moment coefficients) should be given referenced to this point.
Fig. 27 - X should point forward, Y toward the right wing tip, and
Z down. • Aerodynamic parameter bounds = the limits that the aircraft
For consistency, we recommend that all parameters be given in model will impose on the airspeed, sideslip, and angle-of-
metric (SI) units. Conversion to English units can be performed in attack, given as 1x2 vector of min and max values. The pur-
28
3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL AeroSim Blockset User’s Guide
pose of using these limits is to keep the outputs of the aero- • Pitch moment coefficient terms. The pitch moment coeffi-
dynamic model within the linear region. The component cient is computed using the expression (4).
build-up method implemented by the aerodynamic model
δ
in the AeroSim library uses first order terms, therefore the Cm = Cm 0 +Cmα · α +Cmf · δ f +Cmδe · δe +
aerodynamic model will provide acceptable results only in (4)
+ 2Vc a Cmα̇ · α̇ +Cm · q +CmM · M
q
the linear aerodynamics conditions (small angles).
• Aerodynamic reference parameters = the reference param-
• Roll moment coefficient terms. The roll moment coefficient
eters for which the aerodynamic coefficients were normal-
is computed using the expression (5).
ized. These include the reference wing chord, the wing span,
and the reference wing area. β
Cl = Cl · β +Clδa · δa +Clδr · δr +
• Lift coefficient terms. The lift coefficient is computed using (5)
p
+ 2Vba Cl · p +Clr · r
the expression (1).
δ
CL = CL0 +CLα · α +CL f · δ f +CLδe · δe + • Yaw moment coefficient terms. The yaw moment coefficient
(1)
is computed using the expression (6).
+ 2Vc a CLα̇ · α̇ +CL · q +CLM · M
q
β
• Drag coefficient terms. The drag coefficient is computed Cn = Cn · β +Cnδa · δa +Cnδr · δr +
(6)
using the expression (2). p
+ 2Vba Cn · p +Cnr · r
δ
+CDf · δ f +CDδe · δe +
−CL0 ) 2
CD = CD0 + (CLπeAR
(2) 3.2.3 Section 2: Propeller
+CDδa · δa +CDδr · δr +CLM · M
The second section of the aircraft configuration script specifies the
• Side force coefficient terms. The side force coefficient is geometry and aerodynamic performance of the propeller.
computed using the expression (3).
• Propeller hub location = the position of the propulsion force
β
CY = CY · β +CYδa · δa +CYδr · δr + and moment application point, given with respect to the body-
(3) frame origin. The location is specified as a 1x3 row vector
p
+ 2Vba CY · p +CYr · r
of x, y, and z coordinates.
29
AeroSim Blockset User’s Guide 3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL
• Advance ratio. The aerodynamic performance of the pro- effects. For a normally-aspirated general aviation piston engine,
peller should be given as a look-up table of propeller coef- this includes the following parameters:
ficients (CP and CT) as functions of the propeller advance
ratio. This variable specifies the advance ratio vector which • RPM = the vector of engine speeds for which the engine data
corresponds to the look-up table. is given, in rotations-per-minute. All engine parameters are
specified as 2-D look-up tables (functions of engine speed
• Coefficient of thrust. The vector of coefficients of thrust for and intake manifold pressure).
the advance ratios given above (the vector should have the
same size). • MAP = the vector of manifold pressures for which the en-
gine data is given, in kilo-pascals.
• Coefficient of power. The vector of coefficients of power for
the advance ratios given above (the vector should have the • Fuel flow = the sea-level fuel flow as a function of RPM
same size). and MAP. The number of rows in the matrix should match
the size of the RPM vector, the number of columns should
• Propeller radius = the radius of the propeller is used by the match the size of the MAP vector.
propulsion model to compute the force and torque from the
normalized coefficients. These loads are computed as fol- • Power = the engine power at sea-level, as a function of RPM
lows: and MAP. The number of rows in the matrix should match
4 the size of the RPM vector, the number of columns should
Fp = 2 ρR4 Ω2CT (7)
π match the size of the MAP vector.
4
M p = − 3 ρR5 Ω2CP (8) • Sea-level atmospheric conditions = the sea-level atmospheric
π
conditions, including pressure in Pascals and temperature in
• Propeller inertia = the propeller moment of inertia is used degrees Kelvin, for which the engine data above is given.
by the propulsion equation of motion (dynamics) to solve
for the current rotation speed. • Engine shaft inertia = the moment of inertia of the rotating
parts of the engine. This is added to the propeller inertia
and used in the propulsion equation of motion to compute
3.2.4 Section 3: Engine
the current engine speed. Generally, the engine shaft inertia
The third section of the aircraft configuration scripts allows the is significantly lower than that of the propeller, and it can be
user to specify the engine characteristics. All engine data is given neglected without any major effects over the aircraft dynam-
at sea-level. The engine model will correct the data for altitude ics.
30
3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL AeroSim Blockset User’s Guide
3.2.5 Section 4: Inertia able that can be edited is the calendar date used by the World Mag-
netic Model to compute the magnetic field at aircraft location. The
The fourth section of the aircraft configuration script specifies the
date is specified as a 1x3 vector of day, month, and year.
inertia parameters of the aircraft: mass, CG location, and moments
of inertia.
• Empty aircraft mass = the mass of the aircraft without fuel.
• Gross aircraft mass = the mass of the aircraft with the fuel
tank full.
• CG empty = the position of the center of gravity for the air-
craft without fuel. This is provided as a 1x3 vector of x, y, z
coordinates with respect to the origin.
• CG gross = the position of the center of gravity for the air-
craft with full fuel tank. This is provided as a 1x3 vector of
x, y, z coordinates with respect to the origin.
• Empty moments of inertia = the moments of inertia of the
aircraft without fuel. These are provided as a 1x4 vector of
moment of inertia about body axes - Jx , Jy , Jz , and Jxz . For
most aircraft the inertia cross-products Jxy and Jyz can be
neglected because of the symmetry about the x-z plane.
• Gross moments of inertia = the moments of inertia of the air-
craft with full fuel tank. These are provided as a 1x4 vector
of moment of inertia about body axes - Jx , Jy , Jz , and Jxz .
33
AeroSim Blockset User’s Guide 3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL
34
3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL AeroSim Blockset User’s Guide
3.4 Using FlightGear Aircraft Configuration Files community is well known and poses problems since most aircraft
development projects involve several contractors and these would
FlightGear is an open-source multi-platform cooperative flight sim- have to exchange flight dynamic models on a regular basis. The
ulator project. Source code for the entire project is available and open-source community, and JSBSim in particular, have taken the
licensed under the GNU General Public License. The goal of first steps in establishing an XML-based standard for aircraft mod-
the FlightGear project is to create a sophisticated flight simula- els.
tor framework for use in research or academic environments, for A detailed and evolving document that describes the JSBSim
the development and pursuit of other interesting flight simulation configuration or definition files can be found on the main JSBSim
ideas, and as an end-user application. For more information please website. A brief presentation of these files is done next.
visit the main FlightGear website, at There are three types of JSBSim definition files:
http://www.flightgear.org.
Initially, the FlightGear project used the LaRCSim flight dy- 1. Aircraft Definition File, which describes the airframe ge-
namics code for the simulation of aircraft dynamics. However, ometry and inertia parameters, the aerodynamics, the flight
the LaRCSim software was inflexible in defining the aircraft pa- control system, and which types of engine(s) and thruster(s)
rameters (any change to the default aircraft - Navion - parameters the aircraft has.
required manual editing of the LaRCSim source code). Due to this
fact, several new flight dynamic codes for FlightGear were created 2. Engine Definition File, which describes the properties of a
and are in various stages of development. Of these, the best known specific engine. At this time JSBSim supports piston and
project is JSBSim, an open-source flight dynamics model which rocket engines, but turbine engine models are under devel-
can be used either from FlightGear or independent of the visual opment.
interface. For more information about the JSBSim project, visit
3. Thruster Definition File, which describes the properties of a
the main JSBSim website, at
specific thruster. At this time JSBSim provides models for
http://jsbsim.sourceforge.net.
propellers and nozzles.
3.4.1 The JSBSim XML Configuration File This layout permits development of aircraft models in a struc-
tured fashion in which the same aircraft can be easily fitted with a
The main strength of JSBSim is that it provides flexibility to the different engine or propeller. The engine and thruster components
flight dynamics developer by accepting aircraft configurations as can be reused for new aircraft configurations.
XML files which are structured and easy to read. The lack of The Aircraft Definition File is structured in the following sub-
standards for exchange of aircraft models in the flight simulation sections, defined as xml tags:
35
AeroSim Blockset User’s Guide 3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL
• METRICS, which describes the aircraft geometry and inertia • xmlThruster, which can parse a thruster definition file into a
parameters Matlab thruster structure.
• UNDERCARRIAGE, which describes the landing gear and • xmlSearchForTag, which searches an XML tree for specific
ground contact points, tags and returns their UIDs.
• xmlParameter, which searches a character string for spe-
• PROPULSION, which specifies which engine(s) and thruster(s)
cific parameter strings and returns their corresponding data
are used, what is their location in the aircraft coordinates. It
(scalar or vector).
also specifies the fuel/oxydizer tanks.
• xmlMetrics, which parses the METRICS tag of an aircraft
• FLIGHT CONTROL, which specifies the aircraft flight con- XML tree into a Matlab metrics structure.
trol laws.
• xmlTank, which parses a propellant tank tag into a Matlab
• AERODYNAMICS, which includes all of the aerodynamic tank structure.
coefficients and scaling parameters required for computing
the aerodynamic forces and moments. • xmlPropulsion, which parses the PROPULSION tag of an
aircraft XML tree into a Matlab propulsion structure.
• OUTPUT, which specifies what parameters of the flight dy-
• xmlAeroCoeff, which parses an aerodynamic coefficient tag
namics model the program will output.
of an aircraft XML tree into a Matlab coefficient structure.
3.4.2 The xmlAircraft Parser • xmlAeroFactor, which parses an aerodynamic factor tag of
on aircraft XML tree into a Matlab factor structure.
The XML aircraft parsing utilities are located in the fgutil direc-
tory. The system is based on the xml parser, a generic XML parser • xmlAeroGroup, which parses an aerodynamic factor group
utility for Matlab, written by Guillaume Flandin. The generic tag into a Matlab factor group structure.
XML parser is used to load any xml file into a Matlab xml tree • xmlAeroAxis, which parses an aerodynamic axis tag into a
structure. The AeroSim Blockset adds the following aircraft-specific Matlab aerodynamic axis structure.
parsing scripts:
• xmlAerodynamics, which parses the AERODYNAMICS tag
• xmlEngine, which can parse an engine definition file into a of an aircraft XML tree into a Matlab aerodynamics struc-
Matlab engine structure. ture.
36
3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL AeroSim Blockset User’s Guide
• xmlAircraft, which is the main aircraft definition file parser. >> c172.Metrics
The function reads an aircraft definition file along with its ans =
engine and thruster definition files and parses the complete
WingArea: 174
aircraft model into a Matlab aircraft structure. The aircraft WingSpan: 35.8000
structure is documented in the next subsection. WingChord: 4.9000
HTailArea: 21.9000
HTailArm: 15.7000
• AircraftUnitConv, which is an unit conversion function that VTailArea: 16.5000
processes a Matlab aircraft structure returned by xmlAircraft VTailArm: 15.7000
InertiaX: 948
(JSBSim uses English units) and converts all parameters to InertiaY: 1346
metric units. InertiaZ: 1967
InertiaXZ: 0
EmptyWeight: 1500
ACLoc: [3x1 double]
3.4.3 The Matlab Aircraft Structure CGLoc: [3x1 double]
PointMass: {[4x1 double]}
To parse an aircraft, we will use the xmlAircraft utility. For exam- PilotLoc: [3x1 double]
ple, if the path to FlightGear is c:flightgear-0.8 then we would use
the following Matlab command: Individual aircraft parameters can be retrieved in a similar fash-
c172 = xmlAircraft(’c172’, ’c:\flightgear-0.8’)
ion. For example, if we want to see the aircraft CG location, we
could type c172.Metrics.CGLoc to get:
The newly created Matlab aircraft structure is c172 and this
>> c172.Metrics.CGLoc
contains:
ans =
c172 =
41.0000
Name: ’c172’ 0
Version: ’1.58’ 36.5000
Metrics: [1x1 struct]
Propulsion: [1x1 struct]
Aerodynamics: [1x1 struct] The PointMass variable can contain more than one point mass
(for example pilot + passengers), so it is saved as a structure of
Besides the aircraft name and version strings, the aircraft struc-
arrays. To see the data for one of the point-masses, we can refer to
ture contains other structures such as Metrics, Propulsion, and
the structure index - for example, we can type c172.Metrics.PointMass{1}
Aerodynamics.
to get:
We can now list the metrics structure by typing c172.Metrics
at the Matlab prompt, to get: >> c172.Metrics.PointMass{1}
37
AeroSim Blockset User’s Guide 3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL
>> c172.Propulsion.Engine{1}.Param
ans =
ans =
180
36 MAPLim: [6.5000 28.5000]
-14 Displacement: 360
24 MaxPower: 160
NCycles: 2
IdleRPM: 900
which represents the mass and the location in aircraft coordi- ThrottleLim: [0.2000 1]
nates of the first point-mass.
Similarly, the data for the thruster and fuel tank can be ac-
To take a quick look at the propulsion model data, type c172.Propulsion.
The output is shown below: cessed.
If we take a look at the aerodynamics sub-structure we find:
>> c172.Propulsion
>> c172.Aerodynamics
ans =
ans =
Engine: {[1x1 struct]}
Thruster: {[1x1 struct]} AlphaLim: [2x1 double]
Tank: {[1x1 struct] [1x1 struct]} HystLim: [2x1 double]
Lift: [1x1 struct]
Since the aircraft can have one or more engines, thrusters, re- Drag: [1x1 struct]
Side: [1x1 struct]
spectively propellant tanks, they are loaded as structures. To get Roll: [1x1 struct]
the structure of one of the engines we could again use the index, Pitch: [1x1 struct]
Yaw: [1x1 struct]
by typing c172.Propulsion.Engine{1} to get:
>> c172.Propulsion.Engine{1}
Each of the 6 aerodynamic axes (lift, drag, side, roll, pitch,
yaw) contains aerodynamic groups and coefficients. For example,
ans =
the lift axis contains one factor group (Basic lift) and 3 additional
Name: ’IO360C’ coefficients:
Type: ’PISTON’
Param: [1x1 struct] >> c172.Aerodynamics.Lift
Loc: [-19.7000 0 26.6000]
Pitch: 0 ans =
Yaw: 0
Feed: [0 1] Name: ’LIFT’
Basic: [1x1 struct]
CLDe: [1x1 struct]
We can get one more level deeper by taking a look at the spe- CLadot: [1x1 struct]
cific engine parameters: CLq: [1x1 struct]
38
3 SETTING-UP AND RUNNING AN AIRCRAFT MODEL AeroSim Blockset User’s Guide
Inside the basic lift group we will find the group factor which >> c172.Aerodynamics.Lift.Basic.CLwbh.Data
augments all of the group coefficients for ground effect, and the 2 ans =
main lift coefficients - the AOA dependence and the flap deflection
-0.2200 -0.2200
effect. 0.2500 0.2500
0.7300 0.7300
>> c172.Aerodynamics.Lift.Basic
0.8300 0.7800
0.9200 0.7900
ans =
1.0200 0.8100
1.0800 0.8200
Name: ’CLb’
1.1300 0.8300
Description: ’Basic_lift’
1.1900 0.8500
kCLge: [1x1 struct]
1.2500 0.8600
CLwbh: [1x1 struct]
1.3500 0.8800
CLDf: [1x1 struct]
1.4400 0.9000
1.4700 0.9200
If we go one level deeper to take a closer look at the lift coef- 1.4300 0.9500
ficient due to angle-of-attack we have: 1.3800 0.9900
1.3000 1.0500
>> c172.Aerodynamics.Lift.Basic.CLwbh 1.1500 1.1500
ans =
Name: ’CLwbh’
Type: ’TABLE’
Description: ’Lift_due_to_alpha’
RowIndex: ’FG_ALPHA’
ColIndex: ’FG_HYSTPARM’
ColArg: [2x1 double]
RowArg: [17x1 double]
Data: [17x2 double]
40
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4 Block Reference
The AeroSim library includes all of the blocks needed for build-
ing a nonlinear six-degree-of-freedom aircraft model. This section
provides a detailed description for each block that can be found in
the library. In addition to the information in the User’s Guide, each
block is provided with online help for quick reference. To access
it, right-click on any block and select Help from the pop-up menu.
The main library folder, shown in Fig. 31 includes sub-folders
for various parts of the aircraft dynamic model. The sub-sections
of the Block Reference section correspond to these library sub-
folders. The AeroSim library contains a total of 103 blocks. Al-
most all of them are implemented using basic Simulink blocks,
with the exception of a few such as the WMM-2000 Earth mag-
netic model, and the pilot interface blocks which use operating
system calls unavailable in Simulink - these are implemented us-
ing C/C++ as C-MEX S-functions. The source code for these S-
function is provided with the AeroSim library.
41
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.1 Actuators
The Actuators folder contains generic models of electro-mechanical
actuators used in flight control systems. Although a fully-functional
aircraft dynamic model can be created without making use of these
blocks, the actuator models are very useful for testing the stability
and performance of airplane-autopilot closed-loop systems.
42
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
3. Outputs:
44
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
2. Inputs:
Block characteristics:
1. Parameters:
2. Inputs:
3. Outputs:
46
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.2 Aerodynamics
The Aerodynamics library folder contains all the blocks required
to develop a simple aerodynamic model of the aircraft. The ap-
proach taken in the AeroSim library involves linear aerodynamics
in which the aerodynamic force and moment coefficients are com-
puted using linear combinations of aerodynamic derivatives.
47
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.2.2 Aerodynamic Moment • Cl = the current roll moment coefficient with respect
to a reference point, such as the aerodynamic center of
The aerodynamic moment block, shown in Fig. 36, computes the the wing.
aerodynamic moment that acts on the airframe, based on the cur-
• Cm = the current pitch moment coefficient with respect
rent aerodynamic moment coefficients and dynamic pressure.
to a reference point, such as the aerodynamic center of
the wing.
• Cn = the current yaw moment coefficient with respect
to a reference point, such as the aerodynamic center of
the wing.
• pdyn = the dynamic pressure q = 12 ρVa2 .
3. Outputs:
Figure 36: Aerodynamic Moment Block • Maero = the 3 × 1 vector of aerodynamic moments
with respect to a reference point, such as the aerody-
namic center of the wing.
Block characteristics:
4. Details: The block implements the standard expressions for
1. Parameters: aerodynamic moments, as shown in (14), (15), and (16).
1
• Mean aerodynamic chord = the reference chord with L = ρVa2 SbCl (14)
2
respect to which the pitch moment coefficient was com- 1
puted. M = ρVa2 ScCm (15)
2
• Wing span = the reference wing span with respect to 1
N = ρVa2 SbCn (16)
which the roll and yaw moment coefficients were com- 2
puted. 5. Usage: The block should get its inputs from the other aero-
• Wing reference area = the reference area with respect dynamic blocks, that compute aerodynamic coefficients and
to which the moment coefficients were computed. dynamic pressure. The output from the Aerodynamic Mo-
ment block should go to the Total Moment block to be summed-
2. Inputs: up with the other moments applied to the airframe.
49
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
51
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.2.4 Dynamic Pressure 5. Usage: The Dynamic Pressure block gets its inputs from
the Wind-Axes Velocities and Standard Atmosphere blocks.
The block computes the current dynamic pressure and it is repre- The dynamic pressure output is required in the computation
sented in Fig. 38. of aerodynamic forces and moments. It can also be used as
an aircraft model output since most aircraft are measuring it
directly using the Pitot probe.
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
1
q = ρVa2 (19)
2
52
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.2.5 Lift Coefficient • Pitch rate derivative = the variation of CL with the pitch
q
rate - CL .
The block computes the airplane non-dimensional lift coefficient
(CL ) as a linear combination of individual contributions of various • Mach number derivative = the variation of CL with the
flight parameters. The block is represented in Fig. 39. Mach number - CLM .
• Mean aerodynamic chord = the wing reference chord.
2. Inputs:
54
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.2.6 Drag Coefficient • Yaw control derivative = the variation of CD with yaw
control surface deflection (rudder) - CDδr .
The block computes the airplane non-dimensional drag coefficient
(CD ) as a linear combination of individual contributions of various • Mach number derivative = the variation of CD with the
flight parameters. The block is represented in Fig. 40. Mach number - CDM .
• Oswald’s coefficient = the wing efficiency factor e, used
for the parabolic approximation of the induced drag
CL2
CDi = πeAR .
• Wing span = the reference wing span b.
• Wing reference area = the wing reference area S which,
together with the wing span, are used to compute the
2
Figure 40: Drag Coefficient Block wing aspect ratio AR = bS .
55
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
56
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
3. Outputs:
Figure 41: Side Force Coefficient Block
• CY = the current airplane side force coefficient.
Block characteristics:
4. Details: The side force coefficient is computed using the
1. Parameters: expression (22).
β
• Sideslip derivative = the variation (first-order deriva- CY = CY · β +CYδa · δa +CYδr · δr +
β (22)
tive) of CY with respect to the sideslip angle - CY . p
+ 2Vba CY · p +CYr · r
• Roll control derivative = the variation of CY with roll
control surface deflection (aileron) - CYδa .
5. Usage: The inputs should be provided by Wind-axes Veloci-
• Yaw control derivative = the variation of CY with yaw ties block in Aerodynamics, Moments block in Equations of
control surface deflection (rudder) - CYδr . Motion. Control input is provided by manual or automatic
• Roll rate derivative = the variation of CY with the roll pilot. Block output is used by Aerodynamic Force block.
p
rate - CY .
• Yaw rate derivative = the variation of CY with the yaw
rate - CYr .
• Wing span = the reference wing span b.
57
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.2.8 Pitch Moment Coefficient • Pitch rate derivative = the variation of Cm with the pitch
q
rate - Cm .
The block computes the airplane non-dimensional pitch moment
coefficient (Cm ) as a linear combination of individual contributions • Mach number derivative = the variation of Cm with the
of various flight parameters. The block is represented in Fig. 42. Mach number - CmM .
• Mean aerodynamic chord = the wing reference chord.
2. Inputs:
58
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
59
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.2.9 Roll Moment Coefficient • Wing span = the reference wing span b.
The block computes the airplane non-dimensional roll moment co- 2. Inputs:
efficient (Cl ) as a linear combination of individual contributions of
various flight parameters. The block is represented in Fig. 43. • WindAxesVel = the 3 × 1 vector of wind-axes veloci-
ties [Va α β ].
• Control = the 4 ×1 vector of aerodynamic controls (ac-
tuators) in the following order: lift control (flap), pitch
control (elevator), roll control (aileron), and yaw con-
trol (rudder) [ δ f δe δa δr ].
• AngularRates = the 3 × 1 vector of body angular rates
[ p q r ].
4.2.10 Yaw Moment Coefficient • Wing span = the reference wing span b.
The block computes the airplane non-dimensional yaw moment 2. Inputs:
coefficient (Cn ) as a linear combination of individual contributions
of various flight parameters. The block is represented in Fig. 44. • WindAxesVel = the 3 × 1 vector of wind-axes veloci-
ties [Va α β ].
• Control = the 4 ×1 vector of aerodynamic controls (ac-
tuators) in the following order: lift control (flap), pitch
control (elevator), roll control (aileron), and yaw con-
trol (rudder) [ δ f δe δa δr ].
• AngularRates = the 3 × 1 vector of body angular rates
[ p q r ].
4.3 Atmosphere
The Atmosphere library folder includes blocks to estimate the air
parameters and the wind effects.
62
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.3.1 Standard Atmosphere 5. Usage: The block input can be provided by the EGM-96
block in Earth Model section of the AeroSim library.
The standard atmosphere block provides the air parameters at the
current altitude. The block is presented in Fig. 45.
Block characteristics:
1. Parameters: none.
2. Inputs:
• MSLAlt = the current altitude above Mean-Sea Level,
in [m].
3. Outputs:
• p = static pressure, in [Pa].
• T = Outside-Air Temperature, in [K].
• rho = air density, in [kg/m3 ].
• a = speed of sound, in [m/s].
4. Details: The standard atmosphere block is using interpola-
tion through look-up tables which provide air data for an
altitude range of 0 to 86000 meters.
63
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.3.2 Background Wind 4. Details: The block is applying a frame transformation from
inertial (geographic) to body frame, using the rotation ma-
The block computes the background wind velocity components in trix provided. The numerical time derivative of the resulting
body axes. It is represented in Fig. 46. velocity vector is then computed. This captures the effect of
time-varying background wind which can be encountered in
some weather conditions (wind shear, thermals, cyclones).
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
64
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
2. Inputs:
3. Outputs:
3. Outputs:
66
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.3.6 Wind Moment 4. Details: The block Inertia Coefficients from Inertia model
is being nested inside this block to compute the inertia coef-
The Wind Moment block computes the moments that the back- ficients c1 − c9 as described in [3]. The equations for com-
ground wind and turbulence apply to the airframe. The picture of puting the three moments are presented in (29).
this block can be found in Fig. 50.
1
Mx wind = c24 −c3 c9
· (c9 A − c4C)
2. Inputs:
5. Usage: The inputs to this block are provided by the Wind
• WindAngRates = the 3×1 vector of body angular rates Shear block in Atmosphere and by the Aircraft Inertia block
caused by wind components. in the Inertia model. The output of the Wind Moment block
is used by the Total Moment block in the Inertia model.
• WindAngAcc = the 3 × 1 vector of body angular accel-
erations caused by the wind components.
• Inertia = the 4×1 vector of moments of inertia [Jx Jy Jz Jxz ].
3. Outputs:
68
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
69
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.4.1 6-DOF Aircraft Model - body-frame EOM • Aircraft configuration file = the path and name of the
aircraft parameter mat-file, provided as a string. For
The block implements a nonlinear 6-degree-of-freedom aircraft
example, if the mat-file is someairplane.mat, and it is
dynamic model, using blocks provided in the AeroSim library.
in the current directory, then we would use ’someair-
The equations of motion are implemented in body-axes. The model
plane.mat’.
parameters are read from a user-configurable mat-file. The block
is shown in Fig. 51. • Initial velocities = the 3 × 1 vector of initial aircraft ve-
locity components (groundspeed in body axes) [ u v w ]T .
• Initial angular rates = the 3 × 1 vector of initial aircraft
angular rates (in body axes)[ p q r ]T .
• Initial attitude = the 4 × 1 vector of initial aircraft atti-
tude provided as Euler-Rodrigues quaterions [ e0 ex
ey ez ]T .
• Initial position = the 3 × 1 vector of initial aircraft lo-
cation [ Lat Lon Alt ]T , in [rad rad m].
• Initial fuel mass = the initial mass of the fuel quantity
available on-board the aircraft, in kg.
• Initial engine speed = the initial engine shaft rotation
speed, in rad/s.
• Ground altitude = the altitude of the terrain relative to
mean-sea-level, at aircraft location, in meters.
• WMM coefficient file = the complete path to the mag-
netic model coefficient file, as a string - for example,
0 c : \udynamics\pro jects\AeroSim\wmm.co f 0 .
Figure 51: 6-DOF Aircraft Model Block • Simulation date = the 3 × 1 vector of the calendar date
in the format [Day Month Year].
Block characteristics: • Sample time = the sample time at which the aircraft
1. Parameters: model will run.
70
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
• PropCoeff = the 3 × 1 vector of propeller coefficients 5. Usage: The complete aircraft model can be used for mod-
[ J CT CP ]T . eling and simulating the dynamics of a conventional aircraft
71
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
72
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.4.2 6-DOF Aircraft Model - geodetic-frame EOM • Aircraft configuration file = the path and name of the
aircraft parameter mat-file, provided as a string. For
The block implements a nonlinear 6-degree-of-freedom aircraft
example, if the mat-file is someairplane.mat, and it is
dynamic model, using blocks provided in the AeroSim library.
in the current directory, then we would use ’someair-
The equations of motion are implemented in geodetic-frame. The
plane.mat’.
model parameters are read from a user-configurable mat-file. The
block is shown in Fig. 52. • Initial position = the 3 × 1 vector of initial aircraft lo-
cation [ Lat Lon Alt ]T , in [rad rad m].
• Initial velocities = the 3 × 1 vector of initial aircraft ve-
locity components in geodetic-frame [VN VE VD ]T .
• Initial attitude = the 4 × 1 vector of initial aircraft atti-
tude provided as Euler-Rodrigues quaterions [ e0 ex
ey ez ]T .
• Initial angular rates = the 3 × 1 vector of initial aircraft
angular rates (in body axes)[ p q r ]T .
• Initial fuel mass = the initial mass of the fuel quantity
available on-board the aircraft, in kg.
• Initial engine speed = the initial engine shaft rotation
speed, in rad/s.
• Ground altitude = the altitude of the terrain relative to
mean-sea-level, at aircraft location, in meters.
• WMM coefficient file = the complete path to the mag-
netic model coefficient file, as a string - for example,
0 c : \udynamics\pro jects\AeroSim\wmm.co f 0 .
Figure 52: 6-DOF Aircraft Model Block • Simulation date = the 3 × 1 vector of the calendar date
in the format [Day Month Year].
Block characteristics: • Sample time = the sample time at which the aircraft
1. Parameters: model will run.
73
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
• PropCoeff = the 3 × 1 vector of propeller coefficients 5. Usage: The complete aircraft model can be used for mod-
[ J CT CP ]T . eling and simulating the dynamics of a conventional aircraft
74
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
75
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
• Controls = the 7 × 1 vector of aircraft controls [ f lap • Mass = the current aircraft mass, in kg.
elevator aileron rudder throttle mixture ignition ]T • ECEF = the 3 × 1 vector of aircraft position in the
in [rad rad rad rad frac ratio bool]. Earth-centered, Earth-fixed frame [ X Y Z ]T .
• Winds = the 3 × 1 vector of background wind veloci- • MSL = the aircraft altitude above mean-sea-level, in
ties, in navigation frame [WN WE WD ]T , in m/s. m.
• RST = the integrator reset flag (can take values of 0 or • AGL = the aircraft altitude above ground, in m.
1, all integrators reset on rising-edge).
• REarth = the Earth equivalent radius, at current aircraft
3. Outputs: location, in m.
• States = the 15×1 vector of aircraft states [VN VE VD p • AConGnd = the aircraft-on-the-ground flag (0 if air-
q r e0 ex ey ez Lat Lon Alt m f uel Ωeng ]T . craft above ground, 1 if aircraft is on the ground).
• Sensors = the 15×1 vector of sensor data [ Lat Lon Alt 4. Details: Most of the AeroSim blocks are used in this com-
T
VN VE VD ax ay az p q r pstat pdyn OAT ] . plete aircraft model. The blocks not included are the sensor
• VelW = the 3 × 1 vector of aircraft velocity in wind models, actuator models, and pilot interface blocks (joystick
axes [Va β α ] in [m/s rad rad].
T input and graphical output).
• Mach = the current aircraft Mach number. The model reads the aircraft parameters at the start of sim-
ulation from the specified mat-file. The mat-file is gen-
• Angular Acc = the 3 × 1 vector of body angular accel-
erated by the user for a particular aircraft model, by cus-
erations [ ṗ q̇ ṙ ]T .
tomizing and running an aircraft configuration script (Mat-
• Euler = the 3 × 1 vector of the attitude of the aircraft lab program). An aircraft configuration script template as
given in Euler angles [ φ θ ψ ]T , in radians. well as sample aircraft configuration scripts can be found in
• AeroCoeff = the 6 × 1 vector of aerodynamic coeffi- the Samples directory under the AeroSim tree.
cients [CD CY CL Cl Cm Cn ]T , in rad −1 .
5. Usage: The complete aircraft model can be used for mod-
• PropCoeff = the 3 × 1 vector of propeller coefficients eling and simulating the dynamics of a conventional aircraft
[ J CT CP ]T . with single piston engine and fixed pitch propeller. Specific
• EngCoeff = the 5×1 vector of engine coefficients [ MAP aircraft parameters are set from a user-generated configura-
ṁair ṁ f uel BSFC P ]T given in [kPa kg/s kg/s g/(W*hr) tion script. Control inputs can be provided from a joystick
W]. for manual flight, or from an autopilot block for autonomous
77
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
78
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.4.4 Simple Aircraft Model in the current directory, then we would use ’someair-
plane.mat’.
The block implements a nonlinear 6-degree-of-freedom aircraft
dynamic model, using blocks provided in the AeroSim library. • Initial velocities = the 3 × 1 vector of initial aircraft ve-
The equations of motion are implemented in body-axes. The model locity components (groundspeed in body axes) [ u v w ]T .
parameters are read from a user-configurable mat-file. The model • Initial angular rates = the 3 × 1 vector of initial aircraft
does not include wind effects. Earth is assumed spherical (constant angular rates (in body axes)[ p q r ]T .
radius, constant gravity). The block is shown in Fig. 54.
• Initial attitude = the 4 × 1 vector of initial aircraft atti-
tude provided as Euler-Rodrigues quaterions [ e0 ex
ey ez ]T .
• Initial position = the 3 × 1 vector of initial aircraft lo-
cation [ Lat Lon Alt ]T , in [rad rad m].
• Initial fuel mass = the initial mass of the fuel quantity
available on-board the aircraft, in kg.
• Initial engine speed = the initial engine shaft rotation
speed, in rad/s.
• Sample time = the sample time at which the aircraft
model will run.
2. Inputs:
Figure 54: Simple Aircraft Model Block
• Controls = the 7 × 1 vector of aircraft controls [ f lap
Block characteristics: elevator aileron rudder throttle mixture ignition ]T
in [rad rad rad rad frac ratio bool].
1. Parameters:
3. Outputs:
• Aircraft configuration file = the path and name of the
aircraft parameter mat-file, provided as a string. For • States = the 15×1 vector of aircraft states [ u v w p
example, if the mat-file is someairplane.mat, and it is q r e0 ex ey ez Lat Lon Alt m f uel Ωeng ]T .
79
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
• Sensors = the 15×1 vector of sensor data [ Lat Lon Alt tomizing and running an aircraft configuration script (Mat-
VN VE VD ax ay az p q r pstat lab program). An aircraft configuration script template as
pdyn OAT ]T . well as sample aircraft configuration scripts can be found in
• VelW = the 3 × 1 vector of aircraft velocity in wind the Samples directory under the AeroSim tree.
axes [Va β α ]T in [m/s rad rad]. 5. Usage: The simple aircraft model can be used for modeling
• Mach = the current aircraft Mach number. and simulating the dynamics of a conventional aircraft with
single piston engine and fixed pitch propeller. Specific air-
• Angular Acc = the 3 × 1 vector of body angular accel-
craft parameters are set from a user-generated configuration
erations [ ṗ q̇ ṙ ]T .
script. Control inputs can be provided from a joystick for
• Euler = the 3 × 1 vector of the attitude of the aircraft manual flight, or from an autopilot block for autonomous
given in Euler angles [ φ θ ψ ]T , in radians. flight. Simulation output can be visualized using the Flight
• AeroCoeff = the 6 × 1 vector of aerodynamic coeffi- Simulator or FlightGear interface blocks.
cients [CD CY CL Cl Cm Cn ]T , in rad −1 .
• PropCoeff = the 3 × 1 vector of propeller coefficients
[ J CT CP ]T .
• EngCoeff = the 5×1 vector of engine coefficients [ MAP
ṁair ṁ f uel BSFC P ]T given in [kPa kg/s kg/s g/(W*hr)
W].
• Mass = the current aircraft mass, in kg.
4.4.5 Glider Model • Initial velocities = the 3 × 1 vector of initial aircraft ve-
locity components (groundspeed in body axes) [ u v w ]T .
The block implements a basic un-powered nonlinear 6-degree-of-
freedom aircraft model, using blocks provided in the AeroSim li- • Initial angular rates = the 3 × 1 vector of initial aircraft
brary. The equations of motion are implemented in body-axes. angular rates (in body axes)[ p q r ]T .
The model parameters are read from a user-configurable mat-file. • Initial attitude = the 4 × 1 vector of initial aircraft atti-
The model does not include propulsion nor wind effects. Earth is tude provided as Euler-Rodrigues quaterions [ e0 ex
assumed spherical (constant radius, constant gravity). The block ey ez ]T .
is shown in Fig. 55. • Initial position = the 3 × 1 vector of initial aircraft lo-
cation [ Lat Lon Alt ]T , in [rad rad m].
• Sample time = the sample time at which the aircraft
model will run.
2. Inputs:
• Controls = the 4 × 1 vector of aerodynamic controls
[ f lap elevator aileron rudder ]T in radians.
3. Outputs:
Figure 55: Glider Model Block • States = the 13×1 vector of aircraft states [ u v w p
q r e0 ex ey ez Lat Lon Alt ]T .
Block characteristics: • Sensors = the 15×1 vector of sensor data [ Lat Lon Alt
VN VE VD ax ay az p q r pstat
1. Parameters: pdyn OAT ]T .
• VelW = the 3 × 1 vector of aircraft velocity in wind
• Aircraft configuration file = the path and name of the axes [Va β α ]T in [m/s rad rad].
aircraft parameter mat-file, provided as a string. For
example, if the mat-file is someairplane.mat, and it is • Mach = the current aircraft Mach number.
in the current directory, then we would use ’someair- • Angular Acc = the 3 × 1 vector of body angular accel-
plane.mat’. erations [ ṗ q̇ ṙ ]T .
81
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
82
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.4.6 Inertial Navigation System • IMU = the 6 × 1 vector of inertial measurements (3 ac-
celerations + 3 angular rates) in body axes [ ax ay az
The block implements the nonlinear 6-DOF INS (inertial naviga-
p q r ]T .
tion system) equations which integrate inertial measurements pro-
vided by an IMU (inertial measurement unit) to return the PVA • RST = the INS integrator reset flag (reset on rising-
(position velocity attitude) solution. The block is shown in Fig. edge).
56.
3. Outputs:
4.5 Earth
The Earth library folder includes blocks that model the Earth’s
shape, gravity, and magnetic field.
84
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
85
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
5. Usage: The EGM-96 block gets its input from the Naviga-
tion block in Equations of Motion. The block output is used
in Standard Atmosphere block in the Atmosphere model, and
Figure 58: EGM-96 Block in the Ground Detection block in the Earth model.
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
4.5.3 Ground Detection both cases it should be measured with respect to the MSL
and the unit of measure must match that of the MSL altitude.
The Ground Detection block computes the aircraft altitude Above
Ground Level and sets a flag if it is zero. The block is shown in The ”Aircraft on the Ground” flag can be used to stop the
Fig. 59. simulation when the aircraft has landed.
5. Usage: The Ground Detection block gets its inputs from the
EGM-96 block in the Earth model, and from the user. The
outputs of this block are used by the Turbulence block in
Atmosphere and by the Navigation block in the Equations of
Motion.
Figure 59: Ground Detection Block
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
3. Outputs:
88
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
89
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
3. Outputs:
90
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.6.4 Body-frame EOM: Moments • Angular Rates = the 3 × 1 vector of body angular rates
[ p q r ]T .
The block integrates the rigid-body 6 degree-of-freedom moment
equations to obtain the instantaneous body angular rates. The • Angular Acc = the 3 × 1 vector of body angular accel-
block is presented in Fig. 64. erations [ ṗ q̇ ṙ ]T .
ṗ = (c1 r + c2 p) q + c3 L + c4 N
q̇ = c5 pr − c6 p2 − r2 + c7 M
(39)
ṙ = (c8 p − c2 r) q + c4 L + c9 N
Figure 64: Moments Block where the inertia coefficients c1 - c9 are computed using the
Inertia Coefficients block available in the Inertia section of
Block characteristics: the AeroSim library. The moments should include all avail-
able loads (i.e. aerodynamics, propulsion, winds) and they
1. Parameters:
should be given with respect to the current location of air-
• Initial angular rates = the 3 × 1 vector of initial body craft CG. The initial condition for the integration is taken
angular rates [ p0 q0 r0 ]T . from the block parameters. If the reset flag changes from 0
to 1 during the simulation the integrator is reset back to the
2. Inputs: initial condition.
• Inertia = the 4 × 1 vector of current moments of inertia 5. Usage: The block gets its inputs from the Aircraft Inertia
[ Jx Jy Jz Jxz ]T . and Total Moment blocks in the Inertia model. The reset
flag can be handled by the user. The block output is part of
• Moments = the 3 × 1 vector of airframe moments with
the aircraft state vector and it is used extensively throughout
respect to the CG [ L M N ]T .
the aircraft model.
• RST = the integrator reset flag, which can be 0 or 1.
3. Outputs:
93
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.6.5 Body-frame EOM: Kinematics (Quaternions) 4. Details: The kinematic equations are using the Euler-Rodrigues
quaternions. This type of implementation is considered su-
The Kinematics (Quaternions) block integrates the angular rates to perior to the simple Euler angle equations, since quaternion
obtain the aircraft attitude as quaternion representation. The block equations are linear and the solution does not exhibit gimbal
is presented in Fig. 65. lock singularity. The equations, which are presented below,
are described in more detail in [2].
ė0 0 −p −q −r e0
ėx 1 p 0 r −q ex
=
ėy 2 q −r · (40)
0 p ey
ėz r q −p 0 ez
1. Parameters: 5. Usage: The block gets its input from the Moments block in
the Equations of Motion. The reset flag can be handled by
• Initial quaternions = the 4 × 1 vector of initial values the user. The block output is part of the aircraft state vector
for the quaternions [ e0 0 ex 0 ey 0 ez 0 ]T . and it serves as an input to the Body-Inertial DCM From
Quaternions block in Transformations, whose output - the
2. Inputs: Direction Cosine Matrix is used extensively throughout the
aircraft model.
• Rates = the 3×1 vector of body angular rates [ p q r ]T ,
given in rad/s.
• RST = the integrator reset flag, which can be 0 or 1.
3. Outputs:
94
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.6.6 Body-frame EOM: Kinematics (Euler Angles) 4. Details: The kinematic equations are using the classic Euler
angle representation.
The Kinematics (Euler Angles) block integrates the angular rates
to obtain the aircraft attitude as Euler angle representation. The φ̇ = p + tanθ(qsinφ + rcosφ) (41)
block is presented in Fig. 66.
θ̇ = qcosφ − rsinφ (42)
qsinφ + rcosφ
ψ̇ = (43)
cosθ
The initial condition for the integration is taken from the
block parameters. If the reset flag changes from 0 to 1 dur-
ing the simulation the integrator is reset back to the initial
condition.
Figure 66: Kinematics (Euler Angles) Block
5. Usage: The block gets its input from the Moments block in
Block characteristics: the Equations of Motion. The reset flag can be handled by
the user. The block output is part of the aircraft state vector
1. Parameters: and it serves as an input to the Body-Inertial DCM From
Euler Angles block in Transformations, whose output - the
• Initial Euler angles = the 3 × 1 vector of initial values Direction Cosine Matrix is used extensively throughout the
for the Euler angles [ φ0 θ0 ψ0 ]T . aircraft model.
2. Inputs:
3. Outputs:
95
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
3. Outputs:
5. Usage: The Navigation block gets its inputs from the Forces
block in Equations of Motion, Body-Inertial DCM block in
Transformations, WGS-84 and Ground Detection blocks in
the Earth model. The reset flag can be handled by the user.
The position output is part of the aircraft state vector and it
is used in the WGS-84, EGM-96, WMM-2000 blocks in the
Earth model, in the ECEF Position block in Transforma-
tions, and by the FS Interface block in Pilot Interface. The
groundspeed vector components are not used in the model
but they can be output as simulated GPS velocity measure-
ments.
97
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.6.8 Geodetic-frame EOM: Position • RST = the integrator reset flag, which can be 0 or 1.
The block integrates the aircraft inertial velocities to obtain the 3. Outputs:
current aircraft position. It is represented in Fig. 68.
• Position = the 3×1 position vector [ Lat Lon Alt ]T .
Latitude and longitude are provided in radians.
• dPosdt = the 3×1 vector of aircraft position derivatives
˙
[ Lat ˙
Lon ˙ ]T .
Alt
˙ = VNorth
Figure 68: Position Block Lat (48)
Rmeridian + Alt
Block characteristics: VEast
˙ =
Lon (49)
1. Parameters: (Rnormal + Alt) cos Lat
−VDown , AConGnd = 0
(
• Initial position = the 3 × 1 vector of initial geographic ˙ =
Alt (50)
position [ Lat0 Lon0 Alt0 ]T , where latitude and lon- 0, AConGnd = 1
gitude are given in radians.
The altitude integration depends on the status of the ”Air-
2. Inputs: craft on the Ground” flag.
• Vel NED = the 3 × 1 vector of inertial geodetic-frame 5. Usage: The Position block gets its inputs from the Velocity
velocities [VN VE VD ]T . block in Equations of Motion, WGS-84 and Ground Detec-
• Rmeridian = the meridian radius, in meters. tion blocks in the Earth model. The reset flag can be handled
by the user. The position output is part of the aircraft state
• Rnormal = the normal radius, in meters. vector and it is used in the WGS-84, EGM-96, WMM-2000
• AConGnd = the ”Aircraft on the Ground” flag (0 or 1). blocks in the Earth model, in the ECEF Position block in
98
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
99
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
V˙N = −(Lon
˙ + 2ωie )sin(Lat)VE + LatV
˙ D + fN
V˙E = (Lon
˙ + 2ωie )sin(Lat)VN + (Lon
˙ + 2ωie )cos(Lat)VD + fE
V˙D = −LatV
˙ N − (Lon
˙ + 2ωie )cos(Lat)VE + fD + g
Figure 69: Velocity Block (51)
where:
Block characteristics:
fN ax
fE = R p2n · ay (52)
1. Parameters:
fD az
• Initial velocities = the 3 × 1 vector of initial geodetic- The initial condition for the integration of velocities is taken
frame velocities [VN 0 VE 0 VD0 ]T . from the block parameters. If the reset flag changes from
2. Inputs: 0 to 1 during the simulation the integrator is reset back to
the initial condition. The accelerations ax , ay , and az must
• Position = the 3×1 position vector [ Lat Lon Alt ]T . include all the airframe loads (aerodynamics, propulsion,
• dPosdt = the 3×1 vector of aircraft position derivatives winds).
˙
[ Lat ˙
Lon ˙ ]T .
Alt
5. Usage: The block takes its inputs from the Position block
• Accel = the 3×1 vector of body accelerations [ ax ay az ]T . in Equations of Motion, from Total Acceleration block in
• DCM = the 3 × 3 frame transformation matrix (from the Inertia model, and from the WGS-84 Earth geoid model.
navigation (geodetic) to platform (body) frame. The reset flag can be handled by the user. The block output
100
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
101
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.6.10 Geodetic-frame EOM: Attitude (Quaternions) 4. Details: The kinematic equations are using the Euler-Rodrigues
quaternions. This type of implementation is considered su-
The Attitude (Quaternions) block is identical to the Kinematics perior to the simple Euler angle equations, since quaternion
(Quaternions) block and it integrates the angular rates to obtain equations are linear and the solution does not exhibit gimbal
the aircraft attitude. The block is presented in Fig. 70. lock singularity. The equations, which are presented below,
are described in more detail in [2].
ė0 0 −p −q −r e0
ėx 1 p 0 r −q ex
=
ėy 2 q −r · (53)
0 p ey
ėz r q −p 0 ez
1. Parameters: 5. Usage: The block gets its input from the Angular Rate block
in the Equations of Motion. The reset flag can be handled by
• Initial quaternions = the 4 × 1 vector of initial values the user. The block output is part of the aircraft state vector
for the quaternions [ e0 0 ex 0 ey 0 ez 0 ]T . and it serves as an input to the Body-Inertial DCM From
Quaternions block in Transformations, whose output - the
2. Inputs: Direction Cosine Matrix is used extensively throughout the
aircraft model.
• Rates = the 3×1 vector of body angular rates [ p q r ]T ,
given in rad/s.
• RST = the integrator reset flag, which can be 0 or 1.
3. Outputs:
102
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.6.11 Geodetic-frame EOM: Attitude (Euler Angles) 4. Details: The kinematic equations are using the classic Euler
angle representation.
The Attitude (Euler Angles) block is identical to the Kinematics
(Euler Angles) block and it integrates the angular rates to obtain φ̇ = p + tanθ(qsinφ + rcosφ) (54)
the aircraft attitude. The block is presented in Fig. 71.
θ̇ = qcosφ − rsinφ (55)
qsinφ + rcosφ
ψ̇ = (56)
cosθ
The initial condition for the integration is taken from the
block parameters. If the reset flag changes from 0 to 1 dur-
ing the simulation the integrator is reset back to the initial
condition.
Figure 71: Attitude (Euler Angles) Block
5. Usage: The block gets its input from the Moments block in
the Equations of Motion. The reset flag can be handled by
Block characteristics:
the user. The block output is part of the aircraft state vector
1. Parameters: and it serves as an input to the Body-Inertial DCM From
Euler Angles block in Transformations, whose output - the
• Initial Euler angles = the 3 × 1 vector of initial values Direction Cosine Matrix is used extensively throughout the
for the Euler angles [ φ0 θ0 ψ0 ]T . aircraft model.
2. Inputs:
3. Outputs:
103
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.6.12 Geodetic-frame EOM: Angular Rate • dPosdt = the 3×1 vector of aircraft position derivatives
˙
[ Lat ˙
Lon ˙ ]T .
Alt
The block integrates the rigid-body 6 degree-of-freedom moment
equations to obtain the instantaneous body angular rates. The • DCM = the 3 × 3 frame transformation matrix (from
block is presented in Fig. 72. navigation (geodetic) to platform (body) frame.
• RST = the integrator reset flag, which can be 0 or 1.
3. Outputs:
Figure 72: Angular Rate Block 4. Details: The moment equations are implemented as shown
in [3]. A summary of the equations is given below:
Block characteristics: p
ṗ = (c1 r + c2 p) q + c3 L + c4 N − (ωin )x
1. Parameters: p
q̇ = c5 pr − c6 p2 − r2 + c7 M − (ωin )y
(57)
• Initial angular rates = the 3 × 1 vector of initial body p
ṙ = (c8 p − c2 r) q + c4 L + c9 N − (ωin )z
angular rates [ p0 q0 r0 ]T .
where the inertia coefficients c1 - c9 are computed using the
2. Inputs:
Inertia Coefficients block available in the Inertia section of
• Inertia = the 4 × 1 vector of current moments of inertia the AeroSim library. The moments should include all avail-
[ Jx Jy Jz Jxz ]T . able loads (i.e. aerodynamics, propulsion, winds) and they
should be given with respect to the current location of air-
• Moments = the 3 × 1 vector of airframe moments with craft CG. The initial condition for the integration is taken
respect to the CG [ L M N ]T . from the block parameters. If the reset flag changes from 0
• Position = the 3×1 position vector [ Lat Lon Alt ]T . to 1 during the simulation the integrator is reset back to the
104
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
p
initial condition. The ωin vector represents the Earth rota-
tion rate in body-axes and it can be computed as follows:
˙ + ωie )cos(Lat)
(Lon
p
ωin = Rn2p ˙
−Lat (58)
−(Lon + ωie )sin(Lat)
˙
5. Usage: The block gets its inputs from the Aircraft Inertia
and Total Moment blocks in the Inertia model, and from the
Position block in Equations of Motion. The reset flag can be
handled by the user. The block output is part of the aircraft
state vector and it is used extensively throughout the aircraft
model.
105
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.7 Inertia
The Inertia library folder includes blocks that model the evolution
of the aircraft inertia parameters, including mass, CG position, and
moments of inertia. Also, the same folder includes the blocks that
sum-up all the forces and moments provided by the aerodynamic,
propulsion, and atmospheric models to obtain a single force and a
single moment that can be used in the equations of motion.
106
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
107
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
108
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.7.2 Inertia Coefficients and Jyz are not zero. The inertia coefficients expressions are
presented below:
The block computes the inertia coefficients c1 - c9 that are used in
the Moments equations. The block is presented in Fig. 74. 2
(Jy − Jz )Jz − Jxz
c1 = Γ
(Jx − Jy + Jz )Jxz
c2 = Γ
Jz
c3 = Γ
Figure 74: Inertia Coefficients Block Jxz
c4 = Γ
Jz − Jx
Block characteristics: c5 = Jy (59)
1. Parameters: none. J
c6 = Jxz
y
2. Inputs:
c7 = J1
y
• Inertia = the 4×1 moments of inertia vector [ Jx Jy Jz Jxz ] 2
with respect to the current CG location. Jx (Jx − Jy ) + Jxz
c8 = Γ
3. Outputs: c9 = JΓx
• Coeff = the 9 × 1 vector of inertia coefficients. where
Γ = Jx Jz − Jxz
2
(60)
4. Details: The inertia coefficients are presented in [3] as a
convenient way of bypassing the matrix inversion that would 5. Usage: The block is referenced in two places - in the Mo-
normally be required for solving the Moment Equations. ments block in the Equations of Motion and in the Wind Mo-
The method is valid for most aircraft due to the symmetry ment block in the Atmosphere model.
about the mid plane, but it will not work for asymmetric
configurations such as Burt Rutan’s Boomerang since for
these type of airplanes the coupling moments of inertia Jxy
109
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.8 Math
This library folder includes all of the math functions that are ref-
erenced by blocks in the AeroSim library.
110
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
111
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.8.2 Normalization
The block normalizes a vector of arbitrary dimension by dividing
each vector element by the vector norm (magnitude). It is shown
in Fig. 76.
Block characteristics:
1. Parameters: none.
2. Inputs:
• VecIn = the input column vector of dimension n × 1.
3. Outputs:
• VecOut = the output normal vector of the same dimen-
sion n × 1.
4. Details: The block implementation is simply:
~
~Vout = Vin (62)
k~Vin k
112
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
113
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
• In = a real number.
3. Outputs:
114
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.8.5 Zero Offset 5. Usage: The block is referenced from Wind Shear block in
Atmosphere to prevent division-by-zero.
The block prevents division-by-zero errors by outputting a small
non-zero value equal to the specified tolerance if the block input
value falls below this tolerance threshold. If the input is outside
the sphere specified by this tolerance, then the output will match
the input exactly. The block is presented in Fig. 79.
Block characteristics:
1. Parameters:
• Tolerance = the tolerance about origin for which the
block will hold output.
2. Inputs:
• In = a real number.
3. Outputs:
• Out = a non-zero real number.
4. Details: The block is implementing the following function:
x, f or kxk ≥ tol
f (x) = (65)
tol, f or kxk < tol
115
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.8.6 pi Bound
The pi Bound block clamps an angle input to the interval [−π, π].
The block is shown in Fig. 80.
Block characteristics:
1. Parameters: none.
2. Inputs:
• Input = an angle in radians.
3. Outputs:
• Output = an angle in radians, inside the interval [−π, π].
4. Details: When the input angle crosses a multiple of π, the
output angle wraps back to −π. Similarly, then the input
angle crosses the lower bound, the output wraps back to π.
This is accomplished using the mod function, as shown be-
low:
Out put = mod(Input + π, 2π) − π (66)
5. Usage: The block is referenced in Euler Angles block in
Transformations to limit the roll and the pitch angle to the
[−π, π] interval.
116
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
• Input = an angle in radians.
3. Outputs:
• Output = an angle in radians, inside the interval [0, 2π].
4. Details: When the input angle crosses a multiple of 2π, the
output angle wraps back to 0. Similarly, then the input angle
crosses the lower bound, the output wraps back to 2π. This
is accomplished using the mod function, as shown below:
Out put = mod(Input, 2π) (67)
117
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
118
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.9.1 FS Interface 4. Details: The block is implemented using the CMEX S-function
sfunflightsim.dll. The mechanism through which MSFS
The block provides an interface to Microsoft Flight Simulator
state variables are accessed and written is by using Inter-
for a real-time visual display of the aircraft. The block is shown in
Process Communication provided by FSUIPC utility by Pe-
Fig. 82.
ter L. Dowson. The module fsuipc.dll has to be installed
in Microsoft Flight Simulator. The MSFS state variables
are then accessed using the functions available in the library
IPCuser.c. Memory addresses of these state variables are
defined in FSUIPC User.h.
The S-function provided with the FS Interface block is over-
writing the aircraft position, attitude, and airspeed variables
Figure 82: FS Interface Block in Microsoft Flight Simulator to provide a visual display
of the aircraft behavior. To prevent interference with MSFS’
Block characteristics:
own aircraft dynamics, MSFS should be run in SLEW mode.
1. Parameters: When starting the simulation, the FS Interface block will
enable the SLEW mode automatically. The disadvantage is
• Sample time = the sample time at which position and that some instruments in the aircraft cockpit panel displayed
attitude data will be sent to Microsoft Flight Simula- in MSFS are not updated in this mode. However, the main
tor. objective - displaying an outside view of the aircraft - is ac-
complished, see Fig. 83.
2. Inputs:
Both Matlab/Simulink and Microsoft Flight Simulator are
• Position = the 3 × 1 vector of geographic position [Lat computationally-intensive applications. Although it is pos-
Lon Alt] in [rad rad m]. sible to run both on the same computer, we recommend ex-
• Euler = the 3 × 1 vector of Euler angles [ φ θ ψ ]T ecuting them on separate machines. The way this can be
in radians. done is by making use of the WideFS utility by Peter L.
• Airspeed = the current aircraft airspeed, in m/s. Dowson. This Client/Server application allows remote ac-
cess to MSFS state variables using FSUIPC. This requires
3. Outputs: no output signals to Simulink, only visual output the installation of wideserver.dll in addition to fsuipc.dll on
in Microsoft Flight Simulator. the MSFS machine, and the execution of wideclient.exe on
119
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
5. Usage: The FS Interface block gets its inputs from the Nav-
igation block in Equations of Motion, from Euler Angles
block in Transformations and from Wind-axes Velocities block
in Aerodynamics. The only block output is visual and it re-
quires the presence of Microsoft Flight Simulator on the
local machine or on a secondary machine on the local net-
work.
120
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
122
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.9.3 Joystick Interface • POV = the position of the point-of-view hat switch.
The output is an unsigned integer from 0 to 65535.
The Joystick Interface block provides access to joystick position
and buttons using the standard Microsoft Windows joystick class. 4. Details: The block is using the CMEX S-function sfun-
The block is presented in Fig. 86. joy.dll. If there is more than one joystick installed the func-
tion will use the first one (JOYSTICKID1). A different joy-
stick can be used if the joystick ID is changed in the source
file sfunjoy.cpp and a new S-function is re-generated from
the updated source file.
Block characteristics:
1. Parameters:
3. Outputs:
1. Parameters:
124
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
3. Outputs:
125
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.10 Propulsion
This library folder includes blocks that model various types of
aircraft propulsion systems. Although propulsion models can be
extremely complex, the implementations in the AeroSim library
were kept relatively simple and generic, allowing the designer to
quickly develop and test a fully-functional aircraft model.
126
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
127
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.10.2 Piston Engine • Power look-up table = the engine power at sea level, as
a NRPM × NMAP matrix, given in Watts.
The Piston Engine block provides a simple internal combustion
engine model based on look-up tables of engine parameters. The • Sea-level pressure = the ambient pressure at which the
tables needed include 2-dimensional matrix tables for fuel flow above engine data was collected, in Pa.
and engine power at sea-level, as functions of RPM and manifold • Sea-level temperature = the temperature at which the
pressure (MAP), as well as the RPM and MAP vectors containing above engine data was collected, in K.
the data points for which the above-mentioned tables are given.
The block is shown in Fig. 90. 2. Inputs:
128
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
129
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.10.3 GA Propulsion System • Fuel flow look-up table = the mass fuel flow data as a
NRPM × NMAP matrix, given in grams per hour.
The general-aviation propulsion system includes a fixed-pitch pro-
peller, a piston engine, and the differential equation which is solved • Power look-up table = the engine power at sea level, as
for the engine shaft rotation speed. The block is shown in Fig. 91. a NRPM × NMAP matrix, given in Watts.
• Sea-level pressure = the ambient pressure at which the
above engine data was collected, in Pa.
• Sea-level temperature = the temperature at which the
above engine data was collected, in K.
• Advance ratio = the advance ratio J vector n × 1.
• Coefficient of thrust = the coefficient of thrust CT vec-
tor corresponding to the advance ratios above n × 1.
• Coefficient of power = the coefficient of power CP vec-
tor corresponding to the advance ratios above n × 1.
• Radius = the propeller radius.
• Propeller moment of inertia = the moment of inertia of
Figure 91: GA Propulsion System Block the propeller.
• Engine moment of inertia = the moment of inertia of
Block characteristics: the rotating part of the engine (shaft) - generally it is
significantly smaller than the propeller moment inertia.
1. Parameters:
• Initial engine speed = the initial condition for the en- 2. Inputs:
gine rotation speed integrator, in rad/s. • Control = the 3 × 1 vector of engine control inputs,
• RPM vector = the engine speed data points as a NRPM × which are throttle, mixture, and ignition. The ignition
1 vector, given in rotations per minute. can be 1 or 0 to turn the engine on, respectively off.
• MAP vector = the manifold pressure data points as a • OutofFuel = the ”out-of-fuel” has a similar functional-
NMAP × 1 vector, given in kPa. ity to the ignition switch.
130
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
• p = the atmospheric pressure at current altitude, in Pa. This equation is integrated forward in time to compute the
• T = the atmospheric temperature at current altitude, in engine speed Ω at the next time step.
K.
5. Usage: The GA Propulsion System is used in the nonlin-
• rho = the air density at current altitude. ear aircraft model to compute the propulsion forces and mo-
• WindAxesVel = the 3×1 vector of wind axes velocities ments that are applied to the vehicle. These will depend on
(airspeed, sideslip angle, angle-of-attack). the engine control inputs, atmospheric conditions, altitude,
• RST = the engine speed integrator reset flag. and airspeed.
3. Outputs:
• Fprop = the 3 × 1 vector of propulsion forces (the pro-
peller thrust force is on X axis).
• Mprop = the 3 × 1 vector of propulsion moments (the
torque at engine mount is on X axis).
• Omega = the engine shaft rotation speed, in rad/s.
• Fuelflow = the instantaneous mass fuel flow, in kg/s.
• EngCoeff = the 5×1 vector of engine coefficients, which
include MAP, air flow, fuel flow, BSFC, and power.
• PropCoeff = the 3 × 1 vector of propeller coefficients
[ J CT CP ]T .
4. Details: The GA Propulsion System includes a Piston En-
gine and a Fixed-pitch Propeller. These blocks return the
torque provide by the engine, respectively the torque re-
quired by the propeller, at current engine shaft rotation speed,
current atmospheric conditions, and airspeed. Then the dif-
ferential equation that describes the dynamics of the propul-
sion system is:
(Ieng + I prop )Ω̇ = Meng + M prop (71)
131
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.11 Sensors
The Sensors library folder includes generic, analog and digital
sensor models. These can be placed between the aircraft model
and the real or simulated flight control system in order to increase
the realism of the hardware or software in the loop simulation. The
Sensors library is divided into 4 sub-folders: noise correlations,
generic sensors, analog sensors, and digital sensors.
132
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.11.1 Noise Correlation: Random Walk 4. Details: The random walk process is implemented by inte-
grating the output ”w” of a white-noise source:
The block implements a ”Random-Walk” process, by integrating
the output of a white-noise source. The block is pictured in Fig. ẋ = w (72)
92.
5. Usage: The random-walk process is used to simulate the
noise for sensors whose time correlation characteristic is not
known (the random-walk basically assumes infinite correla-
tion time).
Block characteristics:
1. Parameters:
2. Inputs:
• None
3. Outputs:
133
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.11.2 Noise Correlation: Gauss-Markov Process • Output = a noise signal with exponentially-decreasing
autocorrelation.
The block implements a Gauss-Markov process with exponentially-
decaying correlation. The block is pictured in Fig. 93. 4. Details: The Gauss-Markov process is one which has an
exponentially-decreasing autocorrelation function. In prac-
tical terms, this amounts to the assumption that the process
exhibits little correlation between values which are suffi-
ciently well separated in time. If the correlation time is τ
and the white-noise input is w then the process dynamics
are:
Figure 93: Gauss-Markov Process Block 1
ẋ = − x + w (73)
τ
Block characteristics: 5. Usage: The Gauss-Markov process can be used to simulate
sensors for which we have an idea about their correlation
1. Parameters: time. For example, it is reasonable to model GPS output as
a Gauss-Markov process with a correlation time of the order
• Time constant = the Gauss-Markov time constant, or
of 102 seconds.
correlation time.
• White-noise seed = the starting sequence of the white-
noise source, for example [23341]. Refer to Math-
works documentation on the Simulink block ”White-
Noise” for more information about the noise seed.
• Variance = the variance (rms) of the white-noise source.
• Sample time = the sample time of the white-noise source.
2. Inputs:
• None
3. Outputs:
134
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.11.3 Simple Sensor - 1st-order dynamics • Noise variance = the variance (rms) of the white-noise
source.
The block implements a simple sensor that includes saturation lim-
its, time lag (1st-order dynamics) and random walk. The block is • Noise sample time = the sample time of the white-
shown in Fig. 94. noise source.
2. Inputs:
3. Outputs:
4.11.4 Simple Sensor - 2nd-order dynamics • Noise seed = the starting sequence of the white-noise
source, for example [23341]. Refer to Mathworks doc-
The block implements a simple sensor that includes saturation lim- umentation on the Simulink block ”White-Noise” for
its, 2nd-order dynamics, and random walk. The block is shown in more information about the noise seed.
Fig. 95.
• Noise variance = the variance (rms) of the white-noise
source.
• Noise sample time = the sample time of the white-
noise source.
2. Inputs:
Figure 95: Simple Sensor Block • Input = the measured signal (scalar).
3. Outputs:
Block characteristics:
• Output = the sensor output signal.
1. Parameters:
4. Details: None.
• Max value = the upper limit for the saturation block
(max sensed value). 5. Usage: The simple sensor block is used as a basis for cre-
ating more detailed sensor models, but it can also be used
• Min value = the lower limit for the saturation block stand-alone when the sensor characteristics are not known
(min sensed value). in detail.
• Bandwidth = the sensor bandwidth b at a gain g =
−3dB and phase φ = −90◦ . The 2-nd order transfer
function is implemented as in (75).
ω2n
Gs (s) = (75)
s2 + 2ζωn s + ω2n
−g
where ωn = 2πb and ζ = 12 10 20 .
136
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
• Scale factor = the conversion factor (gain) from mea- 5. Usage: The block input is taken from the aircraft dynamic
sured signal to voltage. model. The output can be provided to an A/D converter
block for discretization and then to a flight control system
• Bandwidth = the sensor bandwidth b at a gain g = model.
−3dB and phase φ = −90◦ . The 2-nd order transfer
137
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters:
2. Inputs:
3. Outputs:
138
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.11.7 Single GPS Measurement 4. Details: The block includes a Gauss-Markov noise correla-
tion block and a transport delay block.
The block models a single GPS measurement with a Gauss-Markov
process and a transport delay. The block is shown in Fig. 98. 5. Usage: The block is used by the GPS PV model.
Block characteristics:
1. Parameters:
• Initial value = the initial value for the block output.
• Output lag = the transport delay time.
• Noise correlation time = the Gauss-Markov time con-
stant.
• Noise seed = the white-noise source starting seed.
• Noise variance = the white-noise variance.
• Noise sample time = the white noise sample time.
2. Inputs:
• In = a single GPS measurement (position or velocity).
3. Outputs:
• Out = the GPS measurement output (position or veloc-
ity).
139
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
2. Inputs:
4.12 Transformations
The Transformations library folder includes parameter and refer-
ence frame transformations that are required in the aircraft model
equations or in autopilot design.
141
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.12.1 Body-Inertial DCM From Quaternions 5. Usage: The block input is taken from Kinematics (Quater-
nions) in the Equations of Motion. The block output is used
The block computes the direction cosine matrix required for trans-
extensively throughout the aircraft model, to transfer vectors
formation from inertial to body frame. It is pictured in Fig. 100.
from body to inertial frame and vice-versa.
Block characteristics:
1. Parameters: none.
2. Inputs:
• Quaternions = the 4×1 vector of quaternions [ e0 ex ey ez ]T .
3. Outputs:
• DCM = the 3 × 3 direction cosine matrix.
4. Details: The equation for the direction cosine matrix is straight-
forward (from [2]):
2
ex + e20 − e2y − e2z 2(ex ez − ey e0 )
2(ex ey + ez e0 )
DCM = 2(ex ey − ez e0 ) e2y + e20 − e2x − e2z 2(ey ez + ex e0 )
2(ex ez + ey e0 ) 2(ey ez − ex e0 ) e2z + e20 − e2x − e2y
(77)
142
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.12.2 Body-Inertial DCM From Euler Angles 5. Usage: The block input is taken from Kinematics (Euler
Angles) in the Equations of Motion. The block output is
The block computes the direction cosine matrix required for trans-
used extensively throughout the aircraft model, to transfer
formation from inertial to body frame. It is pictured in Fig. 101.
vectors from body to inertial frame and vice-versa.
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
4.12.3 Body-Wind DCM 4. Details: The equation for the body-to-wind frame transfor-
mation is shown in [3] to be:
The Body-Wind DCM block computes the direction cosine matrix
cos α cos β sin β sin α cos β
for transformation from body to wind frame. The rotation angles
for this transformation are the sideslip β and the angle-of-attack α. DCM = − cos α sin β cos β − sin α sin β (79)
The block is shown in Fig. 102. − sin α 0 cos α
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
144
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.12.4 Euler Angles From Quaternions 5. Usage: The block gets its inputs from the Kinematics (Quater-
nions) block in Equations of Motion. The resulting Euler
The block computes the Euler angles from Euler-Rodrigues quater-
angles are only used by the FS Interface block in the Pilot
nions. It is shown in Fig. 103.
Interface.
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
Figure 104: Euler Angles from DCM Block θ = asin (−C13 ) (82)
C23
φ = asin (83)
Block characteristics: Cθ
C12
ψ = asin (84)
1. Parameters: none. Cθ
5. Usage: The block is not used anywhere in the aircraft dy-
2. Inputs: namic models built using AeroSim library, since the Euler
angles can be computed directly from quaternions, using
• DCM = the 3 × 3 direction cosine matrix. the Euler Angles block provided in Transformations. The
block was provided for completeness and the only situation
in which it could be required is in the design of an Integrated
3. Outputs:
Navigation System algorithm.
146
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.12.6 Quaternions From Euler Angles 5. Usage: The block gets its inputs from the Kinematics (Euler
Angles) block in Equations of Motion.
The block computes the Euler-Rodrigues quaternions from the Eu-
ler angles. It is shown in Fig. 105.
Block characteristics:
1. Parameters: none.
2. Inputs:
• Euler = the 3 × 1 vector of Euler angles [ φ θ ψ ]T ,
in radians.
3. Outputs:
• Quaternions = the 4×1 vector of quaternions [ e0 ex ey ez ]T .
4. Details: As shown in [2], the equations for computing the
quaternions from Euler angles are:
e0 Cφ/2Cθ/2Cψ/2 + Sφ/2 Sθ/2 Sψ/2
= ± Sφ/2Cθ/2Cψ/2 −Cφ/2 Sθ/2 Sψ/2
ex
ey Cφ/2 Sθ/2Cψ/2 + Sφ/2Cθ/2 Sψ/2 (85)
ez Cφ/2Cθ/2 Sψ/2 − Sφ/2 Sθ/2Cψ/2
147
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.12.7 ECEF Position 4. Details: The equations to compute the ECEF position, as
presented in [4], are:
The block computes the aircraft coordinates in the Earth-Centered
Earth-Fixed frame, given the position of the aircraft in the geo-
!
re
graphic frame. The block is shown in Fig. 106. XECEF = p + Alt cos Lat cos Lon (86)
1 − ε2 sin2 Lat
!
re
YECEF = p + Alt cos Lat sin Lon (87)
1 − ε2 sin2 Lat
!
re (1 − ε2 )
ZECEF = p + Alt sin Lat (88)
1 − ε2 sin2 Lat
Figure 106: ECEF Position Block
5. Usage: Although the block is not required in aircraft mod-
els built using AeroSim library, it can be used in autopilot
Block characteristics:
blocks that implement Great Circle navigation algorithms.
1. Parameters: none. The block can get its position input from a GPS receiver or
from the Navigation block in the Equations of Motion. The
2. Inputs: Earth radii can be obtained using the WGS-84 block in the
Earth model.
• LLA = the 3×1 vector of geographic position [Lat Lon
Alt] given in [rad rad m].
• Rmeridian = the Earth meridian radius at current loca-
tion, given in meters.
• Rnormal = the Earth normal radius at current location,
given in meters.
3. Outputs:
148
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
149
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
150
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
151
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
152
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
153
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
154
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
155
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
156
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
157
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
158
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
159
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
160
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
161
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters: none.
2. Inputs:
3. Outputs:
162
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.14 FlightGear-Compatible
AeroSim’s FlightGear-compatibility layer includes XML parsers
that can load aircraft, engine, and thruster parameters into Mat-
lab structures, as well as the necessary aircraft-dynamics blocks
that use such Matlab structures. These aircraft dynamics blocks
as well as several complete aircraft models can be found in the
FlightGear-Compatible library folder and they are presented in
detail in this subsection.
163
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.1 Inertia: Empty Aircraft 4. Details: The block simply converts the inertia parameters
from the Matlab aircraft structure to Simulink signals.
The Empty Aircraft block returns the aircraft mass, CG location
and moments of inertia when there is no fuel in the fuel tank(s). 5. Usage: The inertia parameters provided by the Empty Air-
The block is shown in Fig. 120. craft block are summed with inertia parameters of pilot, pay-
loads, and fuel tanks to obtain the gross aircraft inertia.
Block characteristics:
1. Parameters:
2. Inputs:
• none.
3. Outputs:
164
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.14.2 Inertia: Point Mass 4. Details: A consequence of the point-mass assumption is that
moments of inertia are zero about its location. Therefore,
The Point Mass provides a convenient way for including additional the only moments of inertia are those created by the compo-
small components to the total aircraft inertia. The block is shown nent mass with respect to the aircraft reference point. Since
in Fig. 121. moments Jxy and Jyz are not taken into account, the moment
of inertia contribution is only valid if the point-mass com-
ponents are distributed symmetrically to the aircraft’s XZ
plane.
Block characteristics:
1. Parameters:
2. Inputs:
• none.
3. Outputs:
165
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.3 Propulsion: FG Piston Engine + Fixed-Pitch Prop • Sea-level pressure = the sea-level pressure, in Pa.
The FG Piston Engine + Fixed-Pitch Prop block provides a simple • Sea-level temperature = the sea-level temperature, in
but complete propulsion solution for low-speed aircraft models. K.
The block is shown in Fig. 122. • Initial engine speed = the initial value for the engine
speed integrator, in rad/s.
2. Inputs:
• Fixed-pitch prop structure = a Matlab structure which • FuelFlow = the fuel flow rate.
contains the propeller data from the JSBSim configu- • EngCoeff = the engine coefficients (MAP, air flow, fuel
ration files. flow, BSFC, and power).
166
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
167
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.4 Propulsion: FG Piston Engine + Variable-Pitch Prop • Sea-level temperature = the sea-level temperature, in
K.
The FG Piston Engine + Variable-Pitch Prop block provides a
more complex propulsion solution for low-speed aircraft models. • Initial engine speed = the initial value for the engine
The block is shown in Fig. 123. speed integrator, in rad/s.
2. Inputs:
• Control = the 4×1 vector of propulsion controls (Throt-
tle, Mixture, Ignition, Prop pitch angle).
• p = the current atmospheric pressure.
• T = the current outside air temperature.
• rho = the current air density.
• WindAxesVel = the 3 × 1 vector of wind-axes veloci-
ties [Va β α ]T .
• CGpos = the current aircraft CG location.
• RST = the integrator reset flag.
Figure 123: FG Piston Engine + Variable-Pitch Prop
3. Outputs:
Block characteristics: • Fprop = the propulsion force vector.
1. Parameters: • Mprop = the propulsion moment vector, with respect
to the current aircraft CG location.
• Piston engine structure = a Matlab structure which con-
tains the engine data from the JSBSim configuration • Omega = the current engine rotation speed.
files. • FuelFlow = the fuel flow rate.
• Fixed-pitch prop structure = a Matlab structure which • EngCoeff = the engine coefficients (MAP, air flow, fuel
contains the propeller data from the JSBSim configu- flow, BSFC, and power).
ration files. • PropCoeff = the propeller coefficients (advance ratio,
• Sea-level pressure = the sea-level pressure, in Pa. thrust coefficient, and power coefficient).
168
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
169
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.5 Piston Engine: Intake Model 4. Details: The block performs a linear interpolation of MAP
as a function of throttle fraction. The result is then corrected
The Intake Model computes the manifold presure (MAP) for the for altitude by multiplying with the ratio of atmospheric
current throttle setting and atmospheric pressure. The block is pressures at current altitude and at sea-level.
shown in Fig. 124.
5. Usage: The block should be a part of the Piston Engine
model and it should provide MAP to the AirFlow, FuelFlow
and Power models.
Block characteristics:
1. Parameters:
2. Inputs:
3. Outputs:
170
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters:
2. Inputs:
171
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.7 Piston Engine: FuelFlow Model 4. Details: The FuelFlow block implements the same equa-
tions used by the JSBSim piston engine model.
The FuelFlow Model block computes the mass fuel flow to the
engine as a function of airflow and current mixture setting. The 5. Usage: The block outputs are required by the other engine
block is shown in Fig. 126. sub-models such as the computation of engine power and
BSFC. The output is also integrated by the Fuel Tank model
to obtain the current fuel quantity available on-board the air-
craft.
Block characteristics:
1. Parameters:
2. Inputs:
3. Outputs:
172
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.14.8 Piston Engine: Power Model • RPM = the current engine rpm
The Power Model block computes the power released by the en- • T = the current outside-air temperature
gine through the shaft, as a function of manifold pressure and en- • EquivRatio = the equivalence ratio as computed by the
gine shaft rotation speed. The block is shown in Fig. 127. fuel-flow model.
3. Outputs:
4.14.9 Piston Engine: FG Piston Engine • Omega = the current engine rotation speed
The FG Piston Engine combines all of the engine models pre- • p = the atmospheric pressure
sented previously in a single component. The block is shown in • T = the outside air temperature
Fig. 128.
• rho = the outside air density
3. Outputs:
2. Inputs:
174
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.14.10 Propeller Thruster: FG Fixed-Pitch Propeller • PropCoeff = the propeller coefficient vector [ J CT CP ]
The FG Fixed-Pitch Propeller provides a simple propeller model 4. Details: Consult the AeroSim Fixed-pitch Propeller block
with look-up tables for coefficients of power and thrust as func- reference for more details regarding the propeller model equa-
tions of advance ratio. The block is shown in Fig. 129. tions.
Block characteristics:
1. Parameters:
2. Inputs:
3. Outputs:
4.14.11 Propeller Thruster: FG Variable-Pitch Propeller • Fprop = the propeller thrust force.
The FG Variable-Pitch Propeller provides a simple propeller model • Mprop = the propeller resisting torque.
with look-up tables for coefficients of power and thrust as func- • PropCoeff = the propeller coefficient vector. [ J CT CP ].
tions of advance ratio and blade pitch angle. The block is shown
in Fig. 130. 4. Details: The model is a more general formulation for the
propeller model presented previously. The look-up tables
CT = CT (J) and CP = CP (J) are now bi-dimensional, the
second input argument being the blade pitch angle.
Block characteristics:
1. Parameters:
2. Inputs:
3. Outputs:
176
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
4.14.12 Tank: Fuel Tank • Mass = the current mass of the fuel in the tank.
The Fuel Tank model integrates the mass fuel flow to obtain the • Inertia = the current moments of inertia of the fuel
fuel tank inertia parameters at each time step. The block is shown tank, in aircraft coordinates.
in Fig. 131.
4. Details: The fuel tank model assumes a spherical shape for
computing the moments of inertia.
Block characteristics:
1. Parameters:
• Initial mass = the initial value for the fuel flow integra-
tor.
• Tank structure = a Matlab structure which contains the
tank parameters read from the JSBSim configuration
file.
2. Inputs:
3. Outputs:
177
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
Block characteristics:
1. Parameters:
• Coefficient = the scalar coefficient
2. Inputs:
• RowParam = the scalar input parameter
3. Outputs:
• Coeff = the scalar aerodynamic coefficient
4. Details: The block provides a method for computing aero-
dynamic coefficients which depend on only a single param-
eter.
5. Usage: The block can be used to model aerodynamic coeffi-
cient build-up using linear parameters (stability derivatives).
For example, to account for the roll moment due to yaw rate
we can use the value block to compute the roll moment con-
tribution Clr · r.
178
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters:
• Coefficient = the 1-D look-up table for the aerody-
namic coefficient
2. Inputs:
• RowParam = the scalar input parameter
3. Outputs:
• Coeff = the scalar aerodynamic coefficient
4. Details: The block performs an interpolation on a 1-D look-
up table.
5. Usage: The block can be used to model aerodynamic coef-
ficients that depend on a single parameter. For example, the
induced drag can be modeled as CDi = CDi (CL ) using the
Vector block.
179
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.15 Aerodynamics: Table 5. Usage: The block can be used to model aerodynamic coef-
ficients that depend on more than one parameter. For exam-
The Table block computes an aerodynamic coefficient by interpo-
ple, the block can be used to model the lift coefficient which
lation through a 2-D look-up table, as function of two flight pa-
depends on angle-of-attack and flap setting CL = CL (α, δ f ).
rameters. The block is shown in Fig. 134.
Block characteristics:
1. Parameters:
• Coefficient = the 2-D look-up table for the aerody-
namic coefficient
2. Inputs:
• RowParam = the input parameter corresponding to the
row of the look-up table.
• ColParam = the input parameter corresponding to the
column of the look-up table.
3. Outputs:
• Coeff = the aerodynamic coefficient
4. Details: The block performs an interpolation on a 2-D look-
up table.
180
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
Block characteristics:
1. Parameters:
2. Inputs:
3. Outputs:
181
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.17 Complete Aircraft: Cessna-172 • FlightGear path = the main path for the FlightGear in-
stallation (used for locating the aircraft configuration
The block contains a pre-built model of the single-engine C-172
file).
with aircraft parameters provided by the JSBSim c172.xml con-
figuration file. The block is shown in Fig. 136. • Initial velocities = the initial ground speed components,
in geodetic frame [VN VE VD ]T .
• Initial angular rates = the initial aircraft angular rates
[ p q r ]T .
• Initial quaternions = the initial aircraft attitude, as a
quaternion representation [ e0 ex ey ez ]T .
• Initial position = the initial location of the aircraft, in
geographic coordinates [ Lat Lon h ]T .
• Initial engine speed = the initial engine rotation speed,
in rad/s.
• Initial fuel = a row vector with the initial fuel mass in
the left and right fuel tanks.
• Ground altitude = the ground altitude above sea-level,
at current location.
• Sample time = the simulation sample time, in seconds.
2. Inputs:
Figure 136: Cessna-172 Block • Control = the aircraft control vector, which includes
flap, elevator, aileron, rudder, throttle, mixture, and ig-
Block characteristics: nition.
• Wind = the background wind velocity components in
1. Parameters:
geodetic frame [WN WE WD ].
• Aircraft name = a string which contains the name of • RST = the integrator reset flag. All integrators reset on
the JSBSim aircraft model (in this case it is c172). the rising edge.
182
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
3. Outputs:
183
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.18 Complete Aircraft: Cessna-182 • FlightGear path = the main path for the FlightGear in-
stallation (used for locating the aircraft configuration
The block contains a pre-built model of the single-engine C-182
file).
with aircraft parameters provided by the JSBSim c182.xml con-
figuration file. The block is shown in Fig. 137. • Initial velocities = the initial ground speed components,
in geodetic frame [VN VE VD ]T .
• Initial angular rates = the initial aircraft angular rates
[ p q r ]T .
• Initial quaternions = the initial aircraft attitude, as a
quaternion representation [ e0 ex ey ez ]T .
• Initial position = the initial location of the aircraft, in
geographic coordinates [ Lat Lon h ]T .
• Initial engine speed = the initial engine rotation speed,
in rad/s.
• Initial fuel = a row vector with the initial fuel mass in
the left and right fuel tanks.
• Ground altitude = the ground altitude above sea-level,
at current location.
• Sample time = the simulation sample time, in seconds.
2. Inputs:
Figure 137: Cessna-182 Block • Control = the aircraft control vector, which includes
flap, elevator, aileron, rudder, throttle, mixture, igni-
Block characteristics: tion, and prop blade pitch angle.
• Wind = the background wind velocity components in
1. Parameters:
geodetic frame [WN WE WD ].
• Aircraft name = a string which contains the name of • RST = the integrator reset flag. All integrators reset on
the JSBSim aircraft model (in this case it is c172). the rising edge.
184
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
3. Outputs:
185
AeroSim Blockset User’s Guide 4 BLOCK REFERENCE
4.14.19 Complete Aircraft: Cessna-310 • Aircraft name = a string which contains the name of
the JSBSim aircraft model (in this case it is c172).
The block contains a pre-built model of the twin-engine C-310
with aircraft parameters provided by the JSBSim c310.xml con- • FlightGear path = the main path for the FlightGear in-
figuration file. The block is shown in Fig. 138. stallation (used for locating the aircraft configuration
file).
• Initial velocities = the initial ground speed components,
in geodetic frame [VN VE VD ]T .
• Initial angular rates = the initial aircraft angular rates
[ p q r ]T .
• Initial quaternions = the initial aircraft attitude, as a
quaternion representation [ e0 ex ey ez ]T .
• Initial position = the initial location of the aircraft, in
geographic coordinates [ Lat Lon h ]T .
• Initial engine speed = the initial engine rotation speed,
in rad/s.
• Initial fuel = a row vector with the initial fuel mass in
the left and right fuel tanks (4 tanks).
• Ground altitude = the ground altitude above sea-level,
at current location.
• Sample time = the simulation sample time, in seconds.
186
4 BLOCK REFERENCE AeroSim Blockset User’s Guide
• Gear = the retractable landing gear position, used for the aircraft configuration specified in the JSBSim XML con-
computing aerodynamic coefficients (1 = gear down, 0 figuration file c310.xml. This includes two engines with
= gear up). variable-pitch props, and four wing-mounted fuel tanks. The
• Wind = the background wind velocity components in model does not include ground roll/contact dynamics.
geodetic frame [WN WE WD ]. 5. Usage: The complete aircraft model can be used for model-
• RST = the integrator reset flag. All integrators reset on ing and simulating the dynamics of a Cessna-310. Control
the rising edge. inputs can be provided from a joystick for manual flight,
or from an autopilot block for autonomous flight. Simula-
3. Outputs: tion output can be visualized using the Flight Simulator or
• TAS = the true airspeed, in m/s. FlightGear interface blocks.
• AOA = the angle-of-attack, in rad.
• Position = the aircraft position in geographic frame.
Latitude and longitude are given in rad, altitude in m.
• Attitude = the aircraft attitude given in Euler angles, in
rad.
• Rates = the angular rates in body axes, in rad/s.
• Aero = the aerodynamic coefficients.
• PropL = the left propeller coefficients.
• EngL = the left piston engine coefficients.
• RPML = the left engine rotation speed in rot/min.
• PropR = the right propeller coefficients.
• EngR = the right piston engine coefficients.
• RPMR = the right engine rotation speed in rot/min.
References
[1] Farrell J. A. and Barth M. The Global Positioning System &
Inertial Navigation. McGraw Hill, 1999. ISBN 0-07-022045-
X.
188