Aerodynamic Analysis and Design Lab.
Flight Simulation Seminar
Wai Nwe Tun
23rd January, 2017
Flight Simulation Codes
Aerodynamic Analysis and Design Lab.
Contents
2
 Flight Simulation Environment
 Flight Simulator
• Characteristics
• Software architecture
– Structural Modelling
 FlightGear Simulator
• Architecture
• fgMainInit function
 Flight Dynamics & Control (FDC) Toolbox
 Aerospace Blockset
Aerodynamic Analysis and Design Lab.
Flight Simulation Environment
3
 Needs at least three components
1) Input device such as yoke, rudder pedals, or even keyboard
2) Simulation environment
3) Graphic environment
 Simulation environment
• Full nonlinear and coupled aircraft
equations of motion are solved as
driven by the different forces and
moments acting on the aircraft
(Flight Dynamics Model)
1 2
3
Aerodynamic Analysis and Design Lab.
Flight Simulator: Characteristics
4
 Real-time performance constraints
• Flight simulators must meet hard real-time deadlines for fidelity and
coordination.
 Continuous development and modification
 Large size and high complexity
 Developed in geographically distributed areas
 Very expensive debugging, testing, and modification
 Unclear mapping between software structure and aircraft structure
Aerodynamic Analysis and Design Lab.
Generic Flight Simulator
5
Aerodynamic Analysis and Design Lab.
Software Architecture
6
 Focus that the software has both functional and non-functional qualities
which it must fulfill.
 Functional Requirements
• System functionalities
• What we want to do
• Easy to capture – tangible
(Laptop: certain applications can be installed and used.)
 Non-functional Requirements
• System properties
• How we need to do
• Not easy to capture – intangible
(Laptop: persistence, cost, performance)
Image source: https://s-media-cache-ak0.pinimg.com/236x/eb/a6/4c/eba64c8d3572d4340879a27066f0117e
Aerodynamic Analysis and Design Lab.
Software Architecture
7
 Traditionally, when satisfying system’s requirements, engineers try to
solve functional requirements first.
 For complex systems like flight simulators, engineers must first consider
how their system will meet its non-functional goals by which architecture
and then how to implement the desired functionality within that
architecture.
• Structural modeling
 Deal with systems at the level of
• computational components,
• their connections,
• their patterns of structure, and
• their restrictions on usage.
Aerodynamic Analysis and Design Lab.
Flight Simulator: ABC
8
ABC – Architecture Business Cyc
Aerodynamic Analysis and Design Lab.
Structural Modeling
9
 A reusable collection of software structures (objects) of levels of
abstraction proving the basis from which flight simulator software is
derived.
 Includes an object-oriented design to model the subsystems and
controllers and adds them real-time scheduling to control the execution
order of subsystems.
 Properly limits
• Unconstrained communication/data passing which object-oriented
programming affords
• Types of objects from which a system may be constructed and how these
types may be composed.
Aerodynamic Analysis and Design Lab.
Flight Simulator: Structural Modeling
10
 The FS architecture can be divided into two phases: executive and
application.
 The executive handles coordination (i.e., creation, communication,
synchronization) issues such as real-time scheduling, event
management, data sharing, data integrity by:
• Periodic sequencer
• Event handler
• Timeline synchronizer
 The application handles
computation:
• Sub-systems
• Components
Aerodynamic Analysis and Design Lab.
Flight Simulator: Structural Modeling
11
Aerodynamic Analysis and Design Lab.
Flight Simulator: Structural Modeling
12
Piano roll – pre-defined
scheduling table
containing a list of sub-
system invocations
required to achieve the
desired mode.
Aerodynamic Analysis and Design Lab.
FlightGear Simulator
13
 The open source flight simulator FlightGear has come a long way since
first being showcased at LinuxWorld in San Jose.
 In April 1996, David Murr proposed a new flight simulator developed by
volunteers over the Internet. It was to be distributed free of charge via
the Internet and similar networks. Curt Olson made a multi-platform
release of FlightGear in July 1997.
 The FG architecture is based on an infinite loop called the “main loop”.
 Unlike the main loop of typical event-driven programs
• Runs in idle, polling for users’ inputs.
 FG main loop is responsible for periodically ordering components to
update themselves since many components are working in the
background, regardless of inputs.
Aerodynamic Analysis and Design Lab.
FlightGear Simulator
14
 With all components controlled from within
one loop, FlightGear was a single thread
application.
 Rendering is the most resource intensive
process and may cause frequency of main
loop to be slower than the frame rate.
 This effect the frequency at which other
components such as FDM can run.
 The core components must be run in a
time-critical manner.
Aerodynamic Analysis and Design Lab.
FlightGear Flight Simulator
15
 FlightGear code is refactored using MVC (Model-View-Controller)
architecture.
• A software architecture in which the data model, user interface, and control
logic are separated into distinct components.
 Under MVC scheme, FlightGear has two primary independent
components:
• one being an FDM, server, and
• the other rendering and controlling components, client.
Picture source: https://daveh.io/blog/the-model-view-controller-pattern
Aerodynamic Analysis and Design Lab.
FlightGear MVC Architecture
16
 Client
• Controller/view without any simulation calculation components
• Process inputs from user
• Forward them to the server, listen to the
servers and display objects in the scene
• Provide visual and audio cues to the user
and manage communications between user and
FDM
• Two threaded loops: handling I/O and rendering
 FDM Server
• Provide services to simulate the flight
dynamics and systems of multiple aircraft.
ModelView/Controller
Aerodynamic Analysis and Design Lab.
FlightGear: Main/main.cxx
17
Aerodynamic Analysis and Design Lab.
FlightGear: Main/main.cxx
18
Aerodynamic Analysis and Design Lab.
Flight Dynamics & Control Toolbox
19
 Open source developed by M.O. Rauw
 A MATLAB and Simulink-based software developed specifically for the
design and analysis of aircraft dynamics and control systems.
 Is implemented around a general nonlinear aircraft model developed
using a modular design approach.
 Features a detailed mathematical model for a general aviation aircraft
but can be easily reconfigured for that of any aircraft at the desired level
of accuracy with linear or non linear aerodynamic modeling.
Aerodynamic Analysis and Design Lab.
Flight Dynamics & Control Toolbox
20
Aerodynamic Analysis and Design Lab.
FDC Toolbox as AFCS Design Cycle
21AFCS: Automatic Flight Control Systems
Aerodynamic Analysis and Design Lab.
FDC Toolbox Library
22
Aerodynamic Analysis and Design Lab.
FDC Toolbox – Equations of Motion
23
Aerodynamic Analysis and Design Lab.
FDC Toolbox: Beaver’s Equations
24
Aerodynamic Analysis and Design Lab.
Aerospace Blockset
25
 Produced and distributed by the Mathworks
 Extends Simulink with blocks for modeling and
simulating aircrafts
 Presents a collection of features and blocks
for the solution of
• Aircraft equations of motion
• Modeling of all different forces and moments
 Visualize vehicle flight dynamics using
MATLAB graphics-based 3DoF and 6DoF
animation blocks or other third party.
Aerodynamic Analysis and Design Lab.
Aerospace Blockset
26
Aerodynamic Analysis and Design Lab.
References
27
 M. R. Napolitano, “Aircraft Dynamics from Modeling to Simulation,”
Chap. 9, 2011.
 A. Wesley, “Software Architecture in Practice 2nd Edition,” Chap. 8, 2003.
 AJ MacLeod et. al., “A New Architecture for FlightGear Flight Simulator”,
Technical Reports, 2006.
 M. Rauw, “FDC 1.2 – A Simulink Toolbox for Flight Dynamics and
Control Analysis,” 2001.
 R. Kazman, “Distributed Flight Simulation: A Challenge for Software
Architecture,” 1996.
 G. D. Abow et. al., “Structural Modeling: An Application Framework and
Development Process for Flight Simulators,” 1993.
 The FDC Toolbox, http://dutchroll.sourceforge.net/fdc.html
 FlightGear GitHub, https://github.com/FlightGear/flightgear
Aerodynamic Analysis and Design Lab.
Flight Simulation Seminar
Thank you!
28

Study for flight simulation environments

  • 1.
    Aerodynamic Analysis andDesign Lab. Flight Simulation Seminar Wai Nwe Tun 23rd January, 2017 Flight Simulation Codes
  • 2.
    Aerodynamic Analysis andDesign Lab. Contents 2  Flight Simulation Environment  Flight Simulator • Characteristics • Software architecture – Structural Modelling  FlightGear Simulator • Architecture • fgMainInit function  Flight Dynamics & Control (FDC) Toolbox  Aerospace Blockset
  • 3.
    Aerodynamic Analysis andDesign Lab. Flight Simulation Environment 3  Needs at least three components 1) Input device such as yoke, rudder pedals, or even keyboard 2) Simulation environment 3) Graphic environment  Simulation environment • Full nonlinear and coupled aircraft equations of motion are solved as driven by the different forces and moments acting on the aircraft (Flight Dynamics Model) 1 2 3
  • 4.
    Aerodynamic Analysis andDesign Lab. Flight Simulator: Characteristics 4  Real-time performance constraints • Flight simulators must meet hard real-time deadlines for fidelity and coordination.  Continuous development and modification  Large size and high complexity  Developed in geographically distributed areas  Very expensive debugging, testing, and modification  Unclear mapping between software structure and aircraft structure
  • 5.
    Aerodynamic Analysis andDesign Lab. Generic Flight Simulator 5
  • 6.
    Aerodynamic Analysis andDesign Lab. Software Architecture 6  Focus that the software has both functional and non-functional qualities which it must fulfill.  Functional Requirements • System functionalities • What we want to do • Easy to capture – tangible (Laptop: certain applications can be installed and used.)  Non-functional Requirements • System properties • How we need to do • Not easy to capture – intangible (Laptop: persistence, cost, performance) Image source: https://s-media-cache-ak0.pinimg.com/236x/eb/a6/4c/eba64c8d3572d4340879a27066f0117e
  • 7.
    Aerodynamic Analysis andDesign Lab. Software Architecture 7  Traditionally, when satisfying system’s requirements, engineers try to solve functional requirements first.  For complex systems like flight simulators, engineers must first consider how their system will meet its non-functional goals by which architecture and then how to implement the desired functionality within that architecture. • Structural modeling  Deal with systems at the level of • computational components, • their connections, • their patterns of structure, and • their restrictions on usage.
  • 8.
    Aerodynamic Analysis andDesign Lab. Flight Simulator: ABC 8 ABC – Architecture Business Cyc
  • 9.
    Aerodynamic Analysis andDesign Lab. Structural Modeling 9  A reusable collection of software structures (objects) of levels of abstraction proving the basis from which flight simulator software is derived.  Includes an object-oriented design to model the subsystems and controllers and adds them real-time scheduling to control the execution order of subsystems.  Properly limits • Unconstrained communication/data passing which object-oriented programming affords • Types of objects from which a system may be constructed and how these types may be composed.
  • 10.
    Aerodynamic Analysis andDesign Lab. Flight Simulator: Structural Modeling 10  The FS architecture can be divided into two phases: executive and application.  The executive handles coordination (i.e., creation, communication, synchronization) issues such as real-time scheduling, event management, data sharing, data integrity by: • Periodic sequencer • Event handler • Timeline synchronizer  The application handles computation: • Sub-systems • Components
  • 11.
    Aerodynamic Analysis andDesign Lab. Flight Simulator: Structural Modeling 11
  • 12.
    Aerodynamic Analysis andDesign Lab. Flight Simulator: Structural Modeling 12 Piano roll – pre-defined scheduling table containing a list of sub- system invocations required to achieve the desired mode.
  • 13.
    Aerodynamic Analysis andDesign Lab. FlightGear Simulator 13  The open source flight simulator FlightGear has come a long way since first being showcased at LinuxWorld in San Jose.  In April 1996, David Murr proposed a new flight simulator developed by volunteers over the Internet. It was to be distributed free of charge via the Internet and similar networks. Curt Olson made a multi-platform release of FlightGear in July 1997.  The FG architecture is based on an infinite loop called the “main loop”.  Unlike the main loop of typical event-driven programs • Runs in idle, polling for users’ inputs.  FG main loop is responsible for periodically ordering components to update themselves since many components are working in the background, regardless of inputs.
  • 14.
    Aerodynamic Analysis andDesign Lab. FlightGear Simulator 14  With all components controlled from within one loop, FlightGear was a single thread application.  Rendering is the most resource intensive process and may cause frequency of main loop to be slower than the frame rate.  This effect the frequency at which other components such as FDM can run.  The core components must be run in a time-critical manner.
  • 15.
    Aerodynamic Analysis andDesign Lab. FlightGear Flight Simulator 15  FlightGear code is refactored using MVC (Model-View-Controller) architecture. • A software architecture in which the data model, user interface, and control logic are separated into distinct components.  Under MVC scheme, FlightGear has two primary independent components: • one being an FDM, server, and • the other rendering and controlling components, client. Picture source: https://daveh.io/blog/the-model-view-controller-pattern
  • 16.
    Aerodynamic Analysis andDesign Lab. FlightGear MVC Architecture 16  Client • Controller/view without any simulation calculation components • Process inputs from user • Forward them to the server, listen to the servers and display objects in the scene • Provide visual and audio cues to the user and manage communications between user and FDM • Two threaded loops: handling I/O and rendering  FDM Server • Provide services to simulate the flight dynamics and systems of multiple aircraft. ModelView/Controller
  • 17.
    Aerodynamic Analysis andDesign Lab. FlightGear: Main/main.cxx 17
  • 18.
    Aerodynamic Analysis andDesign Lab. FlightGear: Main/main.cxx 18
  • 19.
    Aerodynamic Analysis andDesign Lab. Flight Dynamics & Control Toolbox 19  Open source developed by M.O. Rauw  A MATLAB and Simulink-based software developed specifically for the design and analysis of aircraft dynamics and control systems.  Is implemented around a general nonlinear aircraft model developed using a modular design approach.  Features a detailed mathematical model for a general aviation aircraft but can be easily reconfigured for that of any aircraft at the desired level of accuracy with linear or non linear aerodynamic modeling.
  • 20.
    Aerodynamic Analysis andDesign Lab. Flight Dynamics & Control Toolbox 20
  • 21.
    Aerodynamic Analysis andDesign Lab. FDC Toolbox as AFCS Design Cycle 21AFCS: Automatic Flight Control Systems
  • 22.
    Aerodynamic Analysis andDesign Lab. FDC Toolbox Library 22
  • 23.
    Aerodynamic Analysis andDesign Lab. FDC Toolbox – Equations of Motion 23
  • 24.
    Aerodynamic Analysis andDesign Lab. FDC Toolbox: Beaver’s Equations 24
  • 25.
    Aerodynamic Analysis andDesign Lab. Aerospace Blockset 25  Produced and distributed by the Mathworks  Extends Simulink with blocks for modeling and simulating aircrafts  Presents a collection of features and blocks for the solution of • Aircraft equations of motion • Modeling of all different forces and moments  Visualize vehicle flight dynamics using MATLAB graphics-based 3DoF and 6DoF animation blocks or other third party.
  • 26.
    Aerodynamic Analysis andDesign Lab. Aerospace Blockset 26
  • 27.
    Aerodynamic Analysis andDesign Lab. References 27  M. R. Napolitano, “Aircraft Dynamics from Modeling to Simulation,” Chap. 9, 2011.  A. Wesley, “Software Architecture in Practice 2nd Edition,” Chap. 8, 2003.  AJ MacLeod et. al., “A New Architecture for FlightGear Flight Simulator”, Technical Reports, 2006.  M. Rauw, “FDC 1.2 – A Simulink Toolbox for Flight Dynamics and Control Analysis,” 2001.  R. Kazman, “Distributed Flight Simulation: A Challenge for Software Architecture,” 1996.  G. D. Abow et. al., “Structural Modeling: An Application Framework and Development Process for Flight Simulators,” 1993.  The FDC Toolbox, http://dutchroll.sourceforge.net/fdc.html  FlightGear GitHub, https://github.com/FlightGear/flightgear
  • 28.
    Aerodynamic Analysis andDesign Lab. Flight Simulation Seminar Thank you! 28