GROUND BASED VARIABLE STABILITY FLIGHT SIMULATOR

This paper discusses the development of a ground based variable stability flight simulator. The simulator is designed to meet the pilot training requirements on flying qualities. Such a requirement arose from a premier Flight-Testing School of the Indian Air Force. The simulator also provides a platform for researchers and aerospace students to understand aircraft dynamics, conduct studies on aircraft configuration design, flight mechanics, guidance & control and to evaluate autonomous navigation algorithms. The aircraft model is built using open source data. The simulator is strengthened with optimization techniques to configure variable aircraft stability and control characteristics to fly and evaluate the various aspects of flying qualities. The methodology is evaluated through a series of engineer and pilot-in-the-loop simulations for varying aircraft stability conditions. The tasks chosen are the proven CAT A HUD tracking tasks. The simulator is also reconfigurable to host an augmented fighter aircraft that can be evaluated by the test pilot team for the functional integrity as a fly-through model.


Introduction
It is well known that flight simulator is a versatile tool that mimics the experience of flying. Flight simulators are widely used for an aircraft's aerodynamic and control system development; handling qualities evaluation; exploration of failure conditions; human factors research and pilot training. The degree of realism and accuracy of flight simulation varies as per the requirement and application. Engineer-In-the-loop simulators are developed to carry out design, tuning of flight control laws and for handling quality evaluation (ELS, 2016;Pashilkar, 2014). Realistic Flight Training Devices (FTD) (CSIR-NAL, 2018) are built to provide pilot training and also to provide a platform to evaluate handling qualities for an aircraft. System level simulation tests can be performed in hardware in the loop simulators (Gholkar et al., 2004;Kamali & Jain, 2016) and Iron bird (Aeromag, Asia, 2013). Recently, a simulation framework for assessing the handling qualities of a flexible wing aircraft is proposed by Centre for Aeronautics, Cranfield University (Portapas & Cooke, 2020). Hence any aircraft development programme by default involves the development of a flight simulator.
However, all the above-mentioned expensive simulator platforms are generally developed for a specific aircraft programme and represent the flying qualities of the same aircraft. It is well known that different types of aircrafts exhibit completely different flight stability and control characteristics. Hence pilots are required to be trained to rate the various aircraft types. This is absolutely necessary to assure their flying proficiency in terms of handling the aircraft in different aerodynamic and atmospheric conditions. This requirement calls for a need to develop a variable stability flight simulator that can simulate different levels of aircraft dynamics. The build and fly capability of such a simulator can help novice pilots to recognize different levels of flying qualities. Different aircraft configurations ranging from very good to vary bad can be experimented and presented to the pilots.
The process of changing the aircraft dynamic characteristics and handling qualities has several applications, such as pilot training, control law development and handling quality research. A variable stability control system is designed for a medium range business jet using Incremental Non-linear Dynamic Inversion (Scholten et al., 2020). Method based on response feedback to achieve variable stability system for a business jet is addressed by (Mirza et al., 2019). Variable stability In-flight Simulator and Test Aircraft (VISTA) built by Calspan (Weingarten, 2005) is also one such available platform that has been instrumental in development of aerodynamics, flight mechanics and control concepts for wide range of aircraft programmes for over 25 years. However, the flight envelope of VISTA is understandably restricted to the aerodynamics of the airframe. Also, the cost of maintaining VISTA is phenomenal. Hence the need for a ground based variable stability simulator is envisaged. A linear variable stability transfer function simulation model (TFSM) developed by Pettersson (2002) addresses this issue by representing a non-linear numerical aircraft model with its stability parameters. The aerodynamics is eliminated by suitably programming the simulation model in terms of time constants, damping ratios and natural frequencies. By changing these parameters, one can change the flying qualities. In this study, states of the aircraft are calculated by combining these parameters and controls in a linear manner. The resulting aircraft forces and moments can be computed from these states through a simple dynamic inversion. This paper presents another method for achieving the same goal. Authors used an optimization-based approach that computes the aerodynamic derivatives, given the damping ratio and natural frequency of a mode. The optimization uses the power of literal approximation of aircraft modes. Once the aerodynamic derivatives are calculated by the optimization method, a full nonlinear aircraft simulation is performed using equations of motion. Hence the aircraft simulation does not isolate coupling between different modes.
The ground based variable stability flight simulator described in this paper is built around a distributed PC framework that uses commercially off the shelf hardware. Pilot station is equipped with an adjustable pilot seat. The overall framework is suitably designed to provide the users a good understanding of variations in the flying using standard flight test techniques. This system is directed to be a potential platform for trainee pilots and aerospace students to understand aircraft dynamics, conduct studies on aircraft configuration design, flight mechanics, guidance & control and evaluate autonomous navigation algorithms. Kamali et al. (2014) proposed a least square optimization-based methodology for creating different aircraft configurations. The limitations in that methodology were that literal approximation that were used for mode optimization assumed almost all parameters as unknown and hence all were estimated. Also, the resultant natural frequency and damping ratios were not compared with linear models generated from nonlinear 6 Degrees of Freedom (DOF) simulation model as the simulation was linear. In the present paper, only important parameters that affect the modes are considered. Moreover, the resultant natural frequencies and damping ratios are compared with linear models generated from nonlinear 6 DOF model in order to ensure the feel for the flying qualities arising out of the nonlinear 6 DOF. This gave a more realistic feel for the pilots during different handling qualities studies. Also, here the modelling is extended to include other modes such as phugoid, roll and spiral as shall be presented in the later sections of the paper. Tracking tasks for level 1, level 2 and level 3 handling qualities are performed for an un-augmented transport aircraft and results are presented to show the capabilities of simulation.
The simulator is also completely reconfigurable to host an augmented fighter aircraft model that serves as a fly through model. An augmented model facilitates the demonstration of gain scheduling, effect of bandwidth on servo actuator and effect of signal rate limiting on the inputs to the servo actuator. Both the models have the capability to demonstrate the effect of degradation of handling qualities on the aircraft. This paper begins with describing the NALSim architecture and the simulator setup in section 1. Section 2 presents the aircraft model description. Section 3 describes the optimization method for creating variable stability simulator. Section 4 discusses the test and evaluation methods and analysis results. Finally, Conclusions summarizes the work, identifies the key contributions and suggests future directions.

NALSim architecture
NALSim is designed to provide cost effective, rapid prototyping and real time simulation environment. The architecture consists of aircraft model, out the window visuals, avionics displays, data analysis tools and an instructor station Graphical User Interface (GUI) housed in five workstations as shown in Figure 1. The simulator is developed based on Model-Based Design (MBD) architecture.
The aircraft model, built in high level MBD platform, consists of models for flight dynamics, aerodynamics, propulsion, landing gear, navigation and atmosphere. MAT-LAB/Simulink is one of the MBD platform (Matos et al., 2018) to realize this kind of work. The plant model used in this study is customized to feature Learjet aircraft using the data available in literature (Roskam, 1995). Learjet model for the simulator was a mandatory requirement given by the test pilot school. Open-source tools like FlightGear and JSBSim aircraft models are not used for this simulator as they are in the form of XML files and are difficult to use them within the variable stability optimization framework discussed in the paper. Pilot inputs are realized through USB based controllers. Out of The Window (OTW) visualization is developed using open source 3D rendering Application Programming Interface (API), OpenSceneGraph (OSG) (Wang & Qian, 2010) and Delta3D (Darken et al., 2005) libraries. The OTW system consists of three image generators (left, right and center) to provide better horizontal field of view. Left and right channels are offset by 50 degrees to provide continuous image. Head Up Display (HUD) and Head Down Display (HDD) are developed using VAPS XT. Features for data logging and real time plotting are developed using VC++ application. The physical set up for NALSim is shown in Figure 2.

Aircraft model
The aerodynamic data for high weight, low weight and sea level conditions for Learjet aircraft are obtained from Roskam, 1995. The application rule for aerodynamic force and moment coefficients are implemented as follows: (1) (2) ( ) 2 np nr n n n a n r The trim angle of attack is matched with the corresponding value provided in Roskam (1995). Thrust is modelled from trim drag. Thrust is varied from trim value with the help of joystick to realize the engine model. The mass, centre of gravity (CG), inertia, geometry information is all provided in Roskam (1995). Equations of Motion in the navigation frame are implemented as detailed in Rauw (2001). The sign conventions are as provided in Table 1.
The aerodynamic coefficients provided in (Roskam, 1995) are clearly for specific flight conditions. But, to get a fly-through model within a limited envelope, the following changes are made: In Eq (2), two different values of D C α are used with respect to AoA. Negative D C α for negative values of AoA and positive D C α for positive values of AoA. This is because the shape of D C α with respect to AoA is a drag polar (parabolic). For all the control surface deflections, positive or negative, the drag has to always increase. Hence, absolute values are used. This always yields a positive drag throughout the envelope.

Optimization method for variable stability aircraft model
The simulator uses the 3 basic configurations provided in (Roskam, 1995) as the basic configurations for un-augmented aircraft model. Other aircraft configurations with respect to stability and control characteristics are created using a novel optimization approach. The formulation described here takes into account the requirement of attaining the modal characteristics as desired by the pilot and is shown to be matching with the modal characteristics calculated from the 6 DOF model through linearization. User can enter desired values of natural frequency and damping ratio for various modes such as phugoid, short period and Dutch roll. The optimization program will change the aircraft derivatives to achieve the desired values of damping ratio and natural frequency. To achieve the desired lateral characteristics, in addition to damping ratio and natural frequency, the user can also provide desired roll mode time constant and ϕ β ratio. Figure 3 shows the work flow of how a variable stability aircraft model is created using optimization.

Variable damping and natural frequency characteristics -longitudinal modes
Aircraft is trimmed for wings level condition and linear models are generated numerically using central differences. Short period and Dutch roll damping factor and natural frequencies are calculated and displayed on the instructor station. User now can change these values for the intended study. Once the desired values are entered by the user, a nonlinear least squares optimization is performed.
Brief details of optimization are as follows: Nonlinear least-squares solves  The Gauss-Newton algorithm and the Levenberg-Marquardt (LM) algorithm are the most widely used optimization algorithms to solve a nonlinear least squares problem (Nocedal & Wright, 1999). The author has used LM algorithm in this work. The LM algorithm outperforms simple gradient descent and other conjugate gradient methods in a wide variety of problems. The update rule of LM algorithm is written as: where H is the Hessian. λ is a weighing factor. ∇ is gradient. The maximum number of iterations is chosen as 200, the maximum number of function evaluations is fixed at 100, and the tolerance is 6 1e − ≤ . The two degree of freedom approximation for phugoid natural frequency and damping ratio are as follows: (8) Eq (7), (8) were used to form the optimization cost function with u Z and u X as the variables for a desired nP ω and P ζ . The result of optimization yielded u Z and u X were converted to the corresponding non-dimensional derivatives. These non-dimensional derivatives are used in the 6 DOF model for the pilot to feel the desired phugoid characteristics. This method could not achieve the phugoid natural frequency and damping ratio calculated by the fourth order model obtained from complete 6 DOF model through linearization. Hence, better phugoid approximation as reported by Pradeep (1998) are used as follows: (10) Using Eq (9) and (10), the optimization cost functions were formulated. u Z , u M and u X are the optimization variables and are therefore treated as unknowns to be determined. The procedure is described below: First the following cost function is minimized to achieve the desired phugoid frequency by varying only u Z as optimization variable 1 O : 1 nP ω is calculated using 1 O obtained from the previous optimization as follows: Subsequently the following cost function is minimized by varying u M and u X as optimization variables as follows: The above cost function Eq (13) with O 2 and O 3 is optimized to obtain the desired phugoid damping ratio. The remaining variables are frozen to the basic aircraft values. This method is found to provide better results compared to the approximate formulae given in Eq (7) and (8).
The second order approximation for short period natural frequency and damping ratio are as follows (Nelson, 1989): The following cost functions were made such that they are minimized to achieve the desired values by varying M α and q M as optimization variables 1 O and 2 O : i.e., The desired short period characteristics not only depend on stability and damping derivatives but also on the control derivative e M δ . When the user wants to vary the short period natural frequency by maintaining the damping ratio at a specific value, then e M δ is scaled as per the following thumb rule: Mil-1797A classifies flying qualities under three levels (MIL-STD-1797A, 1990). Level 1 states that the aircraft's flying qualities are clearly adequate for the mission Flight Phase. In Level 2, flying qualities are adequate to accomplish the mission, but some increase in pilot workload or degradation in mission effectiveness, or both, exists. However, aircraft parameters in Level 3 suggests that flying qualities are such that the airplane can be controlled safely but pilot workload is excessive or mission effectiveness is inadequate, or both. The bounds on the flying qualities parameters used in the study are referred from Hodgkinson (1999).
A typical output of optimization is shown in Figure 4. It shows how the cost function and first order optimality varied over number of iterations for a desired short period characteristic. The time histories of states and control for the desired short period characteristic is shown in Figure 5. The second order approximation for Dutch roll natural frequency and damping ratio are as follows (Nelson, 1989): The following cost functions are minimized by varying N β and r N : The optimum N β and r N obtained are converted to their non-dimensional values and they replace their previous values in the 6 DOF to obtain the desired Dutch roll characteristics. Figure 6 shows a simulation of a desired Dutch roll characteristic.
The desired Roll Mode Time Constant (RMTC) is obtained by calculating: p l is then converted to lp C and substituted in 6 DOF to obtain the desired RMTC.
The ϕ β ratio is given by n β in Eq (20) is same the optimum n β obtained from Dutch roll optimization and l β can be computed if desired ϕ β is provided by the user.
Finally, the desired spiral characteristics are obtained as follows: The desired spiral root location is entered by the user: Spiral time constant is obtained as below: 1 root SpiralTC abs Spiral   In Eq (21), l β , r n and n β are all optimally selected to meet desired ϕ β and Dutch roll characteristics, only r l can be obtained from user defined root Spiral / SpiralTC . All the above optimizations result in only dimensional derivatives which are then converted to non-dimensional values and substituted in the 6 DOF model to realize all the above desired modes and characteristics.
Phugoid and spiral are all low frequency modes and they can be controlled by pilots easily. They can be trained in the real aircraft too. Whereas the short period and Dutch roll modes are difficult to practice in aircraft, this simulator provides an ideal platform to practice those modes. The optimization quickly configures the aircraft for level1, level2, level3 and CAT1, CAT2, CAT3 tasks.
Tables 2-8 are the various aircraft configurations created using the optimization technique discussed before.

Longitudinal and directional Static stability
The simulator provides feature to shift the X CG of the aircraft to forward most point, rear most point, neutral point and maneuver point ( Table 8). The m C α of the aircraft thus gets modified suitably to provide the effect of longitudinal static stability. Similarly l C β can be varied to study the lateral stability and n C β can be varied to study the directional stability.

Control characteristics
The simulator is provided with features such as varying the stick friction, hysteresis, lag, lead-lag to realize different control characteristics. It is planned to use a control loading system in the future version to simulate the operating force of the pilot. Such a system shall simulate realistic control forces and augment the realism in the simulator.

Engine asymmetry and wind disturbance models
The aircraft model is implemented with twin engines. Provisions are provided to simulate engine failure and practice against asymmetries. Similarly, wind gust, turbulence and shear models are implemented to practice sorties such as cross wind landing.

Validation and analysis
Validation of the simulation platform is conducted through closed loop evaluations by the design engineers and the instructors. The flying qualities of the un-augmented aircraft is changed for varying damping and natural frequencies and simulations are conducted through proven CAT A HUD tracking tasks in longitudinal, lateral and directional planes. Similar tasks can also be used for the evaluation of Pilot Induced Oscillations by varying the control characteristics of the stick. All the configurations and tasks mentioned in this section are also presented to and evaluated by the test pilots. This section discusses some of the validation test results.

Longitudinal dynamic flying qualities evaluation
Sum of sines (SOS) tracking task is used to evaluate changes in longitudinal stability. This task is a pitch only task that aims to expose system's phase lag (Mitchell, 1998). The target's theta command is constructed by summing 7 sine waves. It shall have a random appearing frequencybased function computed using Eq (23).
where n = 7. Table 9 provides the list of default values for parameters in Eq (23). The task gain ' k ' is set to achieve the desired task amplitude. User is also provided with an interface to change the amplitudes and frequencies. The desired criterion is to minimize the error between watermark and the command bar (Figure 7). Simulations are conducted with SOS tracking command for varying values of short period damping ratio and with fixed natural frequency. The values chosen are as discussed in Table 2. Figure 8 shows the error between the commanded theta and the aircraft's pitch angle in degrees. It can be observed from Figure 8 that mean error between command and response is found to increase with deteriorating flying quality levels. Table 10 shows the summary of error in pitch tracking task. The increase in error with the FQ levels 1, 2 and 3 respectively indicates the degradation in aircraft's longitudinal stability.

Dutch roll mode
The effect of dutch roll mode on the flying qualities can be evaluated through a lateral task that is developed based on pilot's feedback. The task is described as follows: A command signal as shown in Figure 9(a) is generated and is added to the instantaneous heading of the aircraft when the task is engaged.
where is the trim heading angle of the aircraft and track ψ is the signal shown in Figure 9(b). The aircraft heading has to track the heading command. The frequency and amplitude of track command shown in Figure 9(b) is adjustable.  Figure 9(c) shows the increase in difficulty during heading command tracking when dutch roll damping ratio is changed from level 1 to level 2 (as discussed in Table 4-5). The mean and standard deviation (SD) of error is significantly higher (0.1405 ± 2.4026 degree) for level 2 tracking task (Table 11).

Roll mode
Change in lp C affects RMTC as discussed in section 3.2. This is evaluated using the roll command from a discrete pitch and roll tracking task (Mitchell et al., 1998). This task is implemented using a combination of series of step and ramp inputs as shown in Figure 10 and 11. Eq. (25) is used to generate the signal to drive the command bar in pitch axis. This signal is called pitch error and is limited to ± 3 degrees. This limit prevents the command bar from flying outside the HUD field of view.
where cmd pitch is the one shown Figure 6. The command bar on the HUD is driven by the following signal along the roll axis. The roll error is limited to ± 70 degrees.

0.88( )
where: AC ϕ is the aircraft roll angle (deg), roll command is the one shown in Figure 7.
The HUD symbols for tracking is same as shown in Figure 9(a).
The maximum RMTC values for Learjet class of aircraft for CAT A tracking tasks are: Level 1: 1.0; Level 2: 1.4 and Level 3: 10 (MIL-F- 8785C, 1980). Due to limitations in the flying capabilities of the test engineers, simulations areconstrained to RMTC = 0.15, RMTC = 0.3, RMTC = 2.5. However, it can be seen from Figure 12 that no significant differences were observed between roll command and response for different RMTCs.

Longitudinal static stability and control
Longitudinal static stability is highly dependent on the position of center of gravity (Xcg) in x plane. As the CG goes aft, static margin reduces and aircraft becomes unstable at Xcg greater than neutral point. This scenario is critical in any flight because as loads are shifted or fuel is expended, there is a shift in CG location. Similar effect can be demonstrated in the simulator by shifting the aircraft's CG to different locations as mentioned in Table 8.
Pitch only tracking trials are conducted for nominal, forward and aft CG configurations. Figure 13 shows error in pitch angle is same for all three configurations. Mean absolute error is significantly less for forward CG configuration (0.007 ± 2.68 degrees). However, forward CG configuration is prone to insufficient elevator power as can be seen in Figure 13. Error in aft CG configuration is 0.146 ± 2.87 degrees and the error in nominal CG configuration is 0.1543 ± 2.33 degrees. However, elevator power requirement is comparitively less in the nominal CG configuration.

Conclusions
A ground based variable stability simulator has been developed to provide novice pilots and aerospace students a feel for different levels of flying qualities manifested due to aircraft stability and control derivatives. The focus of this paper is mainly on providing a useful insight into the methodology applied to create and simulate different aircraft stability conditions. A numerical optimization method has been developed to modify the relevant derivatives which influences the short period, phugoid and dutch roll modes of the nominal Learjet aircraft. Improved literal approximations for these modes were very helpful to accurately position the mode frequencies and damping as per the flying qualities criteria. Using the approach, NALSim can simulate any aircraft by changing the stability derivatives.
Section 4 discusses the different methods developed for evaluating the above mentioned effects in the simu-lator. Real time, engineer/pilot-in-the-loop tests are conducted to evaluate the simulator's capabilities. Results for few cases are discussed and compared with respect to the principles of flight dynamics. Aircraft's longitudinal stability is verified with the standard sum of sines tracking task. Results indicate positive correlation between mean absolute error and the FQ levels 1, 2 and 3. Lateral and directional stability is verified with the help of lateral tracking task and discrete roll tracking tasks respectively. Mean ± SD of error in heading angle is observed to increase when dutch roll damping ratio is changed from level 1 to level 2. Similarly, longitudinal static stability is evaluated with SOS tracking task for different CG locations. It is seen that tracking error in forward CG configuration is considerably less; but with increased elevator control power requirement. Hence, the results demonstrate NAL-Sim's capability to be used as a platform for flight dynamics studies.
The simulator also hosts a fly through aircraft model. Various events such as failure in gain scheduler, control surface failures, degraded spin mode and air to air/ stores configuration are simulated using the fly through model.
In a nutshell, this paper outlines the requirement for a variable stability flight simulator, the current base NAL-Sim framework for its implementation and its capabilities. The approach discussed in the paper demonstrates a unique capability of the ground-based simulator for simulating variable stability aircrafts.

Author contributions
Kamali C has developed the aircraft models, variable stability aircraft characteristics through optimization, implementation of tracking tasks. She has significant contributions in testing and validating the simulator using the Pilots/Instructors feedback at ASTE, IAF.
Vijeesh T has developed the instructor station Graphical User Interface (GUI), visuals, simulated displays and the implementation of tracking tasks. Also he has significant contributions in realizing the simulator hardware and in testing and validating the simulator using the Pilots/ Instructors feedback at ASTE, IAF.
Hebbar P. A has contributed to the development of instructor station Graphical User Interface (GUI), Real time plotting software and the implementation of tracking tasks.