Keywords: Fault Tolerance, Unmanned Aerial Vehicle,

This dissertation describes the design, development, and flight testing of a NeuralNetwork (NN) based Fault Tolerant Flight Control System (FTFCS) with the ability toaccommodate for actuator failures. The goal of this research was to demonstrate theability of a specific set of control laws to maintain aircraft handling qualities in thepresence of failures in the actuator channels. In this study, two-failure scenarios havebeen investigated: aileron failure (locking of the right aileron at a trim position) andelevator failure (locking of the right elevator at a trim position). A fleet of WVU YF-22research aircraft test-beds were manufactured and instrumented for developing andtesting of flight control software. An on-board payload with a PC-104 format computersystem, sensors, and custom made circuit boards were designed and developed for theseaircraft test-beds. The fault tolerant flight control systems for this study were designed torecover the aircraft with damaged actuators. On-board real-time data acquisition andcontrol software was developed to achieve the Actuator Failure Accommodation (AFA)flight demonstration. For the purposes of this research, control laws were required to be adaptive tochanging aircraft dynamics during a failure scenario. On-line learning NNs - with theirnon-linearity and learning abilities - were used in the design of the on-board aircraftcontrol scheme. The on-line training reduced the criticality of an extensive on-lineParameter IDentification (PID) during the failure and gives an on-board flight controllerthe capability to adjust to maintain the best possible flight performance during anunexpected failure. This document will outline and describe the design and building of the flightcontroller, aircraft test-beds, on-board payload systems, and software in detail. Flight testresults will be presented and documented to demonstrate the performance of a NN basedFTFCS under failure conditions. Acknowledgements

I would like first to thank my parents for their love, encouragement and supportthroughout my life. I would like to thank my committee chairman and research advisor Dr. MarcelloNapolitano. Your mentoring, guidance, and support throughout my graduate study hasbeen never-ending. I am grateful for the vast and challenging research opportunities wehave worked on together. You have always been there to guide and help me. ThankYou. I would like to thank my committee member Dr. Brad Seanor for your help andguidance with this research effort. Without your support, the success of this researchproject would not be possible. I would like to acknowledge and thank my committee members Dr. Larry Banta,Dr. Bojan Cukic, and Dr. Gary Morris, for taking time from your busy schedules toreview and contribute your thoughts to this research effort. At this point, I would like to commend and thank all the flight testing memberswho helped develop the YF-22 research UAV. Many thanks to my pilot, Peter Cooke foryour time and support in flying the YF-22s. I would like to acknowledge and thank therest of the flight crew; Srikanth Gururajan and Larry Rowe for their hard work helpingwith the construction, flight testing, and instrumentation issues. I would like toacknowledge and thank Dr. Giampiero Campa and Sheng Wan for your help inestimating the linear mathematic model and design the linear controller used with thisproject. I would like to acknowledge and thank Larry Rowe for help building the printedcircuit boards used on the YF-22 UAV payloads. All of your support and hard effortmade the YF-22 AFA project possible. Thank You. I would like to thank Chuck Coleman, David Estep, Lee Metheney, and CliffordJudy from the MAE department for their help with equipment and transportation issues. Last but not the least, I would like to thank all of my research friends, past andpresent that have served their time down in the depths of the flight testing program. Aspecial thanks goes out to all of you, who made graduate school a fun and enjoyableexperience.

With the increased requirement for aircraft reliability, Fault Tolerant FlightControl Systems (FTFCS) with the capabilities for accommodating sensor and actuatorfailures have become an important focus of study within the aerospace community for anumber of years. Related with aircraft system, a fault tolerant flight control system needsto perform the following tasks: 1. Sensor Failure Detection, Identification, and Accommodation (SFDIA); 2. Actuator Failure Detection, Identification, and Accommodation (AFDIA).Ideally, an aircraft control system should have the ability to detect a failure, analyze thedegree of damage and attempt to compensate for the failure with the remainingsensors/control surfaces. This research effort focused upon the area of Actuator FailureAccommodation (AFA), which determines on-line which actions and the degree thatshould be taken by the control system to recover an impaired aircraft. Due to theinherited risk of inducing actuator failure during flight testing, only a limited amount ofresearch activity leading to flight testing has been performed. The definition of actuator failure may imply a locked control surface, a missingportion of the control surface, or any combination of both. To avoid damaging the testbed aircraft, only locked control surfaces were considered in this research effort. Twofailure scenarios were selected for this study: 1. Right Aileron Failure; 2. Right Elevator Failure.To minimize the risk during flight test phases, a failure was defined as a control surfacelocked at the trim position. A detailed analysis, controller design, and flight test resultswill be discussed using the two failure scenarios. Within a conventional approach to the design of control laws, an accuratemathematic model of the aircraft is required. One critical issue is that during flight teststhe aircraft’s model is varying throughout the flight envelope. The non-linearity andcoupling between the longitudinal and lateral-directional channels also increases thedifficulty in designing a linear control law which can handle the entire problem. Thisdifficulty becomes extreme when an actuator failure occurs on the aircraft. Without the

1ability to adapt itself to a changing aircraft model, the linear controller would beineffective or, at worst, even cause the aircraft to become closed-loop unstable. As analternative approach, Neural Networks (NNs) were implemented in the flight controlsystem design to allow for an adaptive learning behavior. Two distinct advantages ofusing NNs in a control system design include: • Learning ability: the NN can be trained with past recorded flight data (off- line training) or directly trained with the real-time flight data (on-line training); • Non-linearity: the NN can be trained to approximate a nonlinear system.With sufficient training, a NN can approximate a nonlinear system with high accuracy[7]. This is very appealing for use with fault tolerant controller design. If properlyapplied, the use of a NN based system can give a controller the capability to adapt itselfwith a changing environment. In this study, a set of NNs was integrated into the faulttolerant controller design and installed on the on-board computer for flight testevaluation. Two training methods can be used for the NN learning: on-line and off-linelearning. The off-line learning consists of training with a pre-recorded data set and doesnot require to be performed in real-time. In this way, off-line training is not restricted bythe on-board computer’s computation power and the approximation can be highlyaccurate. At the same time, the off-line learning cannot take the advantage of a neuralnetworks’ learning ability to adapt to the changing aircraft dynamics during the flight.The on-line learning method uses the real-time flight data obtained for training and hasmuch higher requirements for on-board hardware and software implementation.However, this method has the ability to “learn” the changing aircraft dynamics and givethe controller some level of “intelligence”. The on-line NN’s learning speed andaccuracy is limited by the natural frequency of the system, the on-board computationpower and available resources. In this study, both on-line and off-line learning NNs wereimplemented in the controller design to take the advantage of both approaches. This project involved both simulation studies and flight testing evaluations. Theinherited risk of actuator failure made it a difficult challenge to be tested on a realaircraft. For that reason, Unmanned Aerial Vehicles (UAVs), with their flexibility and

Actuator failure during flight poses a significant flight safety concern and cancause catastrophic results. A passive approach to the problem is based upon hardwareredundancy. However, due to the cost and weight requirements for aircraft design, it isnot practical to have several redundant control surfaces. A solution fromsoftware/controller design provides a low cost solution to aid with this issue. Bothtraditional gain scheduling and NN based adaptive control methods have beenextensively studied in recent years. This section will give a brief overview of techniquesdeveloped for actuator failure accommodation purposes. The aircraft’s dynamics is non-linear in nature, especially following actuatorfailure. However, tools for analysis and design of nonlinear control systems are poorlydeveloped. One solution is to adopt a “divide and conquer” approach whereby theanalysis/design task for a nonlinear system is decomposed into a number of simpler lineartasks. Within this approach, gain scheduling has been used for the design of nonlinearcontrol flight systems. The conventional gain-scheduling design approach typicallyinvolves three phases: 1. Linearizing the nonlinear plant at a number of equilibrium points; 2. Design a linear controller for each of the plant linearizations; 3. Combine linear controllers to obtain a nonlinear controller.Several varieties of the gain-scheduling method based on on-line parameter identification[1] had been designed and used in fault tolerance flight control systems. In Shin’s work[2], a robust Linear Parameter Varying Control had been designed for HighlyManeuverable Aircraft Technology (HIMAT) vehicle subject to loss of controleffectiveness. The goal of actuator failure accommodation is to maintain or regain the bestpossible handling qualities in the presence of actuator failures. Conventional gain-scheduling methods involve a combination of on-line parameter identification controlredesign and/or adaptation for a degraded flight mode. Traditional approaches to flightcontrol reconfiguration requires controller gains to be redesigned in real time. Thecomplications here are substantial since this process requires a reasonably accurate

4knowledge of low frequency aircraft dynamics. Gain scheduling has been a verysuccessful approach in flight control system design without failure conditions. Onedrawback of this methodology in a fault tolerance system is that it depends on a pre-determined set of failure models, making it less effective in case of failures that have notbeen previously modeled. Also, the number of required gains, which have to be designedand scheduled can also be very large. Extensive off-line analysis, in-flight tuning, andvalidation of gain schedules are necessary to handle a large set of possible failure modes. In recent years, several theoretical developments have lead towards the use ofneural networks that learn and adapt on-line for nonlinear systems [3][4][5]. The mainadvantage lies in eliminating the need for a detailed Parameter IDentification (PID)during the recovery phase, and limiting the potential need for PID in the problem of gainrescheduling following a failure. In general, the need for an accurate aerodynamicdatabase for the purpose of flight control design can be significantly reduced through theuse of a NN-based approach. NNs have been applied very successfully in the identification and control ofdynamic systems [6]. The universal approximation capabilities [7] of the MultipLayerPerceptron (MLP) have made it a popular choice for modeling nonlinear systems andimplementing general-purpose nonlinear controllers [8]. NN based flight control systemsare designed to provide adaptive flight control without requiring extensive gainscheduling or explicit system identification. Most NN based controllers are developedfrom conventional controller architecture, including Fixed Stabilizing Control [9],Nonlinear Internal Model Control [10], Model Predictive Control [11], Model ReferenceControl [12], Adaptive Critic Control [13] and Adaptive Inverse Control [14]. NN augmented adaptive inverse control has been extensively studied for use withflight control systems. A NN based autopilot system, incorporating direct adaptivecontrol with dynamic inversion, has been used in John Kaneshige’s work [8]. FeedbackLinearization Augmented with NN inverse dynamic approximator was proposed in a X-33 Reusable Launch Vehicle controller design [15][16][17]. A NN based nonlinear inverse dynamic controller was flight tested with modelhelicopter at the Georgia Institute of Technology [18]. A methodology called Pseudo-

5Control Hedging (PCH)[19] was employed to protect the system from the adverse affectsof incorrect adaptation in the event of actuator saturation and failure. The performance analyses for the NN based controller have also been extensivelystudied. Thompson [20] discussed the performance analysis in the frequency domain inhis work. The controllability and stabilization analysis for the NN controller were alsodiscussed in [21][22][23]. Different types of activation function and training methods can lead to differentapproximation performance and learning speed. Radial Basis Function [24] and extendedback-propagation training [25] had been studied for the aircraft controller design. Due to the extreme risk of the actuator failure in flight, so far only very limitedflight testing has been performed. In fact, almost no NN based AFA scheme have beenfully evaluated in flight. Most of the related studies were theoretical or simulation based.Two-research efforts with both actuator failure study and NN based flight controller aresimilar to this research project: the Reconfigurable Control for Tailless Fighter Aircraft(RESTORE) program [26-29] and the Intelligent Flight Control System (IFCS) project[30-40]. A brief description of these two research activities will now be introduced. The purpose of the RESTORE program was to develop and evaluatereconfigurable flight control algorithms. Unlike traditional reconfiguration methods,RESTORE control laws were designed to compensate for unknown aircraft damage, aswell as actuator failures, by adapting to the changing aircraft dynamics. The Boeing RESTORE team designed the controller based on the dynamicinversion (Figure 2-1). The NN was developed to adaptively regulate the inversion errorbetween the pre-estimated aircraft model and the true aircraft dynamics. The inversionerror can be caused by the model uncertainty, actuator failure, or aircraft damage. Acontrol allocation module was used to distribute the desired control response from thecontrol algorithms to the remaining “healthy” control actuators. A system identificationmodule uses a Least Squares (LS) algorithm to estimate aerodynamic parameters. Nullspace injection is used to briefly excite control surfaces to obtain these estimates withoutsignificant performance degradation [27].

6 Figure 2-1 RESTORE Controller

The test-bed aircraft for the RESTORE project was the X-36 jointly sponsored by theAFRL and NAVAIR. This aircraft features redundant, multi-axis conventional controlsurfaces, split flaps, and yaw thrust vectoring to provide reconfiguration capability forsimulated control surface failures. A NN was integrated into the existing X-36 flight control system. Pilotedhardware-in-the-loop-simulation (HILS) testing was used to mature the reconfigurablecontrol laws and evaluate their robustness for a variety of simulated actuator failures.The control laws were given no prior knowledge of the simulated failure input. Whileperforming the HILS testing, the RESTORE control laws were compared to the baselineflight control laws. Two RESTORE research flights were flown in December 1998, proving theviability of the software approach. A wing trailing-edge control surface failure wastriggered during the flight testing. In addition to the limited flight testing completed inDecember 1998, the RESTORE technology was demonstrated using aircraft pilotedsimulations in the summer of 1999 [28]. The IFCS flight research project at NASA Dryden Flight Research Center wasestablished to design aircraft flight controls that can optimize aircraft performance in bothnormal and failure conditions. IFCS was designed to incorporate self-learning NNconcepts with different purposes and levels of criticality into the flight control software toenable a pilot to maintain control and safely land an aircraft that has suffered a majorsystems failure and/or combat damage [30].

7 The test-bed aircraft for the IFCS project is the NASA NF-15B (NASA 837.).This aircraft has been highly modified from a standard F-15 configuration to includecanard control surfaces, thrust vectoring nozzles, and a digital fly-by-wire flight controlsystem. The IFCS GEN I concept (Figure 2-2) is a direct adaptive NN approach.

Sensors

Baseline Neural Network

Online Real-Time baseline

Figure 2-2 General Block Diagram of the IFCS GEN I Controller

GEN I was designed to estimate the aircraft aerodynamic changes caused by simulatedfailure modes, and provides the information to the flight control system. The systemidentifies dynamic characteristics of the vehicle, with the form of the stability and controlderivatives, and uses them to stabilize the vehicle and provide specific flyingcharacteristics. Particularly, the updated values of the main stability derivatives withrespect to baseline values – through NN-based mapping – are fed to an optimal control-based set of control laws. The IFCS GEN II NNs are designed to take over more direct control of theaircraft by working with the flight controller to compensate for any shortcomings. TheNNs are an integral component of the control laws in the GEN-II architecture instead ofserving as “mapping” tools in the Gen I architecture. The GEN II concept is based on a dynamic inversion controller with a model-following command path shown in Figure 2-3.

Figure 2-3 General Block Diagram of the IFCS GEN II Controller

The feedback errors are controlled with a Proportional + Integral (PI) controller. Thisbasic system is then augmented with an adaptive NN which operates directly on feedbackerrors. The adaptive NN adjusts the system for miss-predicted behavior or changes inbehavior caused by the damage. Demonstration of this direct adaptive NN is the primaryobjective of the IFCS GEN II flight project [32]. The dynamic inversion portion of the control system generates accelerationcommands. These commands are translated into control surface commands by a controlallocation scheme. The dynamic inversion, control allocation, and model-followingalgorithm all require information on the dynamic behavior of the system to be controlled.This information is then provided in the form of aircraft aerodynamic stability andcontrol derivatives [33]. Initial PID test flights with an IFCS NN that was pre-trained to the F-15'saerodynamic database were flown in 1999. A follow-up series of flights are being flownin the summer of 2002 to calibrate new instrumentation and air data systems and repeatseveral of the test points flown in the 1999 series to reduce risk for the GEN I and IIflight research phases. The IFCS GEN I flight testing has been suspended to be concentrated on the GENII program. GEN II flight testing preparations are current underway. West VirginiaUniversity has been involved in the IFCS GEN II controller design and flight testing as

9well as the design of a “safety monitor” scheme to allow smooth and safe transitions fromconventional to research control laws and from research control laws at nominalconditions to failure conditions. Furthermore, within the activities of an additionalproject, one of the WVU YF-22 Research Aircraft Model will be used to test a set ofIFCS control laws as a scaled-down version of the IFCS flight testing program.

10 Chapter 3 AFA Controller Design

The design of the AFA controller represents a difficult and challenging problem.These difficulties arise from the changing and uncertainties associated with the aircraftdynamics following a failure occurrence. In a conventional fault tolerance controllerdesign, extensive knowledge of the aircraft dynamics after failure is required. However,this is not usually practical with numerous actuator failure conditions. Therefore, a set ofcontrol laws with self-learning ability would be preferred. In this project, two failuremodes were simulated during the flight testing phases, that is: right elevator failure andright aileron failure. The main objective of the effort was to demonstrate actuator failureaccommodation using both simulation and flight testing results. Neural networks wereselected in the controller design to provide the learning ability. To simplify the problem,we assume that the actuator failure is detected and identified instantly. Developed fromthe overall program goals laid out in Chapter one, the following requirements weredefined for the AFA controller design: • The NN learns on-line to approximate the aircraft’s response, especially after the actuator failure; • The controller uses the estimation of the aircraft dynamics from the NN and adjusts the control command to accommodate for the failure; • The learning process is required to be as short as possible to compensate for the fast changing aircraft dynamics; • The NN needs to be designed and implemented with limited on-board computation resources; • Stability for the closed-loop system after injection of the failure. In this chapter, the design of a NN based AFA controller will be presentedfollowed by the detailed design process: the type and dimension of the NN which wasselected to approximate the aircraft dynamics; a linear mathematic model of the test-bedaircraft acquired from flight test data; a linear controller was designed at a nominal flightcondition as the base-line control system; according to the different failure types, theeffect of the actuator failure will be analyzed and AFA controllers are designedaccordingly with detailed simulation analysis.

11 The AFA controller design, as a special case for the flight control system, had tobe closely associated with the flight testing program. Preliminary flight tests wereperformed for each of the controller design phases for analyzing the aircraft performanceand failure conditions. In this chapter, the flight testing data used for designing the AFAcontroller will be presented along with the simulation study. The flight testing data forthe final demonstration of designed AFA controllers will then be presented in Chapter 6.

3.1 - Neural Network based Controller Design

Artificial NNs in general can be defined as mathematical models of human brainactivities. Typically, NNs consist of many simple processing units that are wiredtogether in a complex communication network. Each unit, or node, is a simplified modelof a “real” neuron which sends a new signal if it receives a sufficiently strong input signalfrom the other nodes to which it is connected. The strength of these connections may bevaried in order for the network to perform different tasks corresponding to differentpatterns of node firing activity. The simplest definition of a neural network, is providedby the inventor of one of the first neurocomputers, Dr. Robert Hecht-Nielsen. He definesa neural network as: "...a computing system made up of a number of simple, highlyinterconnected processing elements, which process information by their dynamic stateresponse to external inputs” [41]. NNs have been widely applied in controller designs over the past decade. In aneural network based controller, the NN typically has been trained to approximate eitherthe dynamics or inverse dynamics of a plant. While trained with the inverse dynamics ofa plant, the NN is normally used to cancel out any nonlinear dynamics (nonlineardynamic inversion). Since the inverse dynamics of the plant is often unstable, it isdifficult to train a NN so that it can approximate it reliably. If the NN cannotapproximate the inverse dynamics of the system to a certain degree of accuracy, thestability of the control system cannot be guaranteed. Several types of NN controllersbased upon the inverse dynamics had been designed and simulated in early phases of thisproject but eventually abandoned because of the learning difficulties. NNs trained toapproximate the full or a portion of the aircraft dynamics was used in the final AFAcontroller design.

12 To overcome the linear controller’s shortcomings to accommodate for the time-varying dynamics of the aircraft, a new NN based controller structure was designed basedupon a linear feedback control system. The general architecture of the controller isshown in Figure 3-1.

Actuators Training Data

Flight Data Linear Controller Neural Network

Figure 3-1 Architecture of the NN Controller

In this design, a linear mathematical model of the aircraft at a normal flight condition wasrequired and a linear controller design was based upon the mathematical model tostabilize the aircraft at the normal flight condition. Two sets of NNs with the samestructure are used in the controller – On-line Learning NN and Off-line Learning NN.Both NNs are pre-trained with flight data acquired from the nominal flight condition.During the take-off and landing stages of the flight testing, the learning of the NN isturned off since the flight data would be relative to different flight conditions. In thiscase, both NNs will have exactly the same weights and thresholds so that they willprovide equal estimations. Once the aircraft reaches a nominal flight condition, the on-line NN begins training while the off-line NN stays constant and provides a referenceapproximation of the aircraft. If the aircraft model had been changed, the modeling errorcan then be calculated with the difference of both NN estimations. In the event ofactuator failure, the on-line learning NN will be trained to approximate the aircraftdynamics after the failure while the off-line learning NN will remain to provideestimation of the aircraft dynamics under a nominal flight condition (without failure).This estimation difference indicates the change of the aircraft dynamics and can be usedto tune the linear feedback control gains. In this way, the controller has the capability tolearn and adapt to the different flight conditions - including actuator failures - by

13redesigning the linear feedback gains on-line to compensate for the changing aircraftmodel.

3.2 - Neural Network Selection

Based upon the controller design concept and requirements of flight testing, theselected NNs must have the following capabilities: • Ability to approximate the nonlinear aircraft dynamics; • Capable of on-line learning; • Fast learning; • Require minimal memory and computation power.With these requirements, a Multilayer Perceptron (MLP) network with a backpropagationtraining algorithm was selected as the NN estimator. A MLP is a network of simpleneurons called perceptrons. The basic concept of a single perceptron was introduced in1958 by Rosenblatt. The perceptron computes a single output from multiple real-valueinputs by forming a linear combination according to its input weights and then putting theoutput through some nonlinear activation function. Mathematically this can be describedusing: p uk = ∑ wkj x j (3-1) j =1

yk = ϕ (uk − θ k ) ( 3-2)

where x1 , x2 ....x p are the inputs to each neuron in the input layer; wk1 , wk 2 ....w kp are the

synaptic weights associated with each input. The value uk is the output of the linear

combiner; θ k is the threshold value with ϕ ( ) being the activating function and yk beingthe final output of the individual neuron. The most used activation function for a MLP is the sigmoid function. Based upona bipolar characteristic of the sensor signal in the YF-22 research UAV’s on-boardpayload, the activation functions selected for this project was the “tansig” function Eq(3-3) for the hidden layer. A linear output layer was also used to provide a larger outputrange. Thus, the activation functions for the two layers are given by:

14 2 Hidden Layer: ϕ (v) = −1 (3-3) 1 + e −2 v

Output Layer: ϕ (v ) = v (3-4)

The backpropagation algorithm was created by generalizing the Widrow-Hoff

[42] learning rule to multiple-layer networks and nonlinear differentiable transferfunctions. Input vectors and corresponding output vectors are used to train the networkuntil it can approximate a function. Networks with biases, a “tansig” hidden layer, and alinear output layer are capable of approximating a nonlinear function with a finite numberof discontinuities [7]. Standard backpropagation is a gradient descent algorithm. The termbackpropagation refers to the manner in which the gradient is computed for nonlinearmultilayer networks [84]. The purpose of this rule is to minimize a cost function basedupon the error: ek (t ) = d k (t ) − yk (t ) (3-5)

where d k (t ) is the desired output from the network and yk (t ) is the actual response of thenetwork, to the input presented, such that the actual response of each neuron in the outputlayer approaches the target response in some statistical sense. The error-backpropagation training process consists of two distinct phases,namely a forward phase and a backward phase. In the forward phase, an input pattern isapplied to the nodes in the input layer, which are then propagated through each of thehidden layers until it reaches the output layer, where then the output of the computationalnodes are the overall response of the network to the input pattern presented. Once theoverall response of the network is obtained, the response is compared to the target outputand differences between the two produces an error term. This error term is thenpropagated backwards, leading to the term backpropagation through the networkstructure and the corresponding interconnection weights are adjusted to make theresponse of the network move closer to the desired value. In the forward phase, the output of hidden layer neurons can be calculated withEq(3-6) and (3-7)

15 n vbi |k = ∑ (ah whi ) |k −θ bi |k (3-6) h =1

2 bi |k = −2 vbi |k −1 (3-7) 1+ e

where bi |k is the value of the ith hidden neuron at step k. The value of output layerneurons can be calculated with Eq(3-8) and Eq(3-9). From the hidden to the output layer: p vci |k = ∑ (bi wij ) |k −θ cj |k (3-8) i =1

c j |k = vcj (3-9)

where c j |k is the value of the jth output neuron at step k. Through the application of the

this term can then be used to update the hidden layer weights and thresholds. In the designed AFA controller, NNs are used to approximate the dynamics of theresearch aircraft model. An example of NN design and simulation to approximate thelateral-directional dynamics of the YF-22 model aircraft is shown below. The real flight

16data was used for training the NN includes both the nominal flight condition and flightwith aileron failures. This particular NN was used in the aileron failure AFA controllerdesign which will be described in Section 3.5. To approximate the lateral-directionaldynamics of the aircraft, several states of the aircraft were required, including: • aileron deflection; • rudder deflection; • angle of Sideslip; • roll rate; • yaw rate.The inputs of the NN at step k been selected is shown in Table 3-1: δa(k) δr(k) δa(k-1) δr(k-1) β(k-1) P(k-1) R(k-1) δa(k-2) δr(k-2) β(k-2) P(k-2) R(k-2) Table 3-1 Inputs of the Lateral-Directional Neural Networks

β(k), P(k) and R(k) signals were used to evaluate and train the neural network: To guarantee the on-line training speed and minimize the overfitting problems,the size of the hidden layer was designed to be small, leading to a total of 5 hiddenneurons. In this way, the structure of the NN includes: • 12 input neurons; • 5 hidden neurons; • 3 output neurons.The NN was pre-trained (batch training) with flight data acquired from earlier flight testswithout failure. The last 20 seconds of the flight data was allocated for evaluation, whichhad not been included in the training sets of data. The training error is shown in Figure3-2:

17 0 Performance is 0.000903684, Goal is 0.001 10

-1 10 Training-Blue Goal-Black

-2 10

-3 10

-4 10 0 2 4 6 8 10 12 14 16 18 19 Epochs

Figure 3-2 Neural Networks Training

After 19 epochs of training, the output of the NN started to show a satisfactory

performance in approximating the aircraft dynamics and the training error had beendecreased to be under 0.001. Given the input of the aileron and rudder deflections, it canapproximate flight data of the YF-22 model aircraft to a high degree of accuracy. Theevaluations of the NN training with the last 20-seconds of flight data are shown inFigures 3-3 and 3-4.

18 60 Aircraft Response NN Estimation 40

20P (deg/sec)

-20

-40

-60

-80 0 2 4 6 8 10 12 14 16 18 20 Time (sec)

Figure 3-3 Neural Networks Evaluation P-Channel

10 Aircraft Response NN Estimation 5

0R (deg/sec)

-5

-10

-15

-20

-25 0 2 4 6 8 10 12 14 16 18 20 Time (sec)

Figure 3-4 Neural Networks Evaluation R-Channel

19The standard deviation of the estimation error for the P and R channels were 1.32 deg/secfor roll rate and 0.6451 deg/sec for yaw rate. The pre-trained NN was then used toestimate the flight data with the right aileron failure (Oct.31 2002 Flight #2 Failure #1).The estimation results are shown in Figure 3-5 and 3-6.

50 Aircraft Response 40 NN Estimation

30

20 P (deg/sec)

10

-10

-20

-30

-40 0 2 4 6 8 10 12 14 16 18 20 Time (sec)

Figure 3-5 Neural Networks Evaluation P-Channel (w/ failure)

20 10 Aircraft Response NN Estimation 5

0 R (deg/sec)

-5

-10

-15

-20 0 2 4 6 8 10 12 14 16 18 20 Time (sec)

Figure 3-6 Neural Networks Evaluation R-Channel (w/ failure)

The standard deviation of the estimation error on the P and R channels were 2.6773deg/sec and 1.0238 deg/sec respectively. The estimation results show that the lateral-directional dynamics of the aircraft model were changed after the right aileron had beenlocked at a trim position. The NN trained with the flight data under nominal flightconditions could not approximate it without additional on-line training. To compensate for the changing aircraft dynamics, the on-line incrementallearning of the NN had been turned on. The estimation results are shown in Figures 3-7and 3-8. The standard deviation of the estimation error on the P and R channels were1.6021 deg/sec and 0.9296 deg/sec respectively. Therefore, with the on-line training, theNN was able to learn the change of the aircraft dynamics and provide an improvedapproximation after the failure occurs.

22From the above simulation with the YF-22 flight data, the following conclusions can bederived: • Selected NNs can approximate the non-linear dynamics of the aircraft; • Lateral dynamics of the YF-22 research UAV were changed after the right aileron locked at the trim position; • A NN estimator can be used to detect this change; • On-line learning gives the on-board NNs the ability to adapt the new dynamics of the aircraft after the actuator failure.With the on-line learning NN’s ability to approximate and adapt to the changingdynamics of the aircraft, the AFA on-board controller was designed to accommodate foractuator failures of the YF-22 model aircraft.

3.3 - Linear Mathematical Model

According to the selected AFA controller design, a linear mathematical model forthe aircraft was required for designing the linear feedback controller under nominal flightconditions. Flight tests were performed to collect data for model identification purposes.Special maneuvers, including elevator doublets, aileron doublets, rudder doublets and acombination of aileron/rudder doublets were performed to fully excite the aircraft’slongitudinal and lateral-directional dynamics. A Batch Least Squares (BLS) techniquewas used to estimate the parameters to obtain a linear mathematical model. The method of least squares assumes that the best-fit curve of a given type is thecurve that has the minimal sum of the deviations squared (least square error) from agiven set of data [85]. The BLS technique consists essentially in solving an over-determined linear system in a “least square” sense. It is one of the most widely usedapproaches for the estimation of a vector of parameters from a collection of “almost-linearly” related input-output data. In other words, the reliability of this method comesfrom the property that a pseudo-inverse solution for a linear system with more equationsthan unknowns is optimal in the least squares sense. The general linear regression modelis given by: Y = Xβ + ε (3-14)

23where Y is a (n×1) vector of known responses of the system, X is a (n×p) matrix of knowninputs to the system. β is the (p×1) vector of parameters to be estimated, and ε is a (n×1)vector of independent normal random variables, with zero mean ( E{ε} = 0 ) andunknown diagonal variance-covariance matrix. This matrix is generally assumed to be amultiple of the (n×n) identity matrix: (σ 2{ε} = σ 2I ). Therefore, we have E{Y} = Xβ andσ 2{Y} = σ 2I. The problem is to find the vector β such that Xβ (which is the expectedvalue of Y) is as close as possible (in the least squares sense) to Y, so that σ 2 isminimized. Particularly, the objective is to find a value of β that minimizes the followingquadratic index: Q = ε T ε = (Y − Xβ ) T (Y − Xβ ) (3-15)

By transposing Eq(3-16) one can define the following:

A linear aircraft model can usually be considered as a decoupled longitudinal and lateral-directional sub-models. Both longitudinal and lateral-directional sub-models arenormally considered as the linearized models from the nonlinear model which trimmed ata steady-state condition of straight-level flight with nominal airspeed (about 42 m/s).

3.3.1 Longitudinal Model Identification

24Two sets of data - as shown in Figure 3-9 and 3-10 - were selected from recorded flightdata – one for identification and another for a validation purpose. The data was sampledat 100Hz. It should be noted that the data had been pre-processed – the non-zero steadystate value of α and δ E were removed - before being used for identification process.Both data sets were associated with typical elevator doublet maneuver, which were ableto sufficiently excite the longitudinal short-period mode.

Figure 3-11 Model Validation – Measured and Simulated Pitch Rate

Measured 8 Simulated

4 Alpha (deg)

-2

554 554.5 555 555.5 556 556.5

Time(sec)

Figure 3-12 Model Validation – Measured and Simulated Angle-of-attack

273.3.2 Lateral-Directional Model Identification The task of lateral-directional model identification was to identify the following3rd order linear model from collected flight test data:  β&  β      δ A   p&  = Ald  p  + Bld δ  (3-23)  r&   R    r  Similar to longitudinal identification, two sets of data, as shown in Figures 3-13and 3-14, were selected from flight testing data collection – one for identification and theother for validation purposes. The flight data was sampled at a rate of 100Hz. Unlike thelongitudinal situation, there was no need to conduct data pre-processing since all thesteady-state values of the sampled data were found to be very close to zero. Both datasets are representative of a typical aileron/rudder doublet combination, which includes anaileron doublet followed by a rudder doublet maneuver immediately after. Thismaneuver was found to provide sufficient excitation for both the dutch-roll mode and theroll response; therefore it was ideal for lateral-directional identification purposes.

526 527 528 529 530 531 532

Figure 3-15 Model Validation – Measured and Simulated Sideslip Angle

Figure 3-16 Model Validation – Measured and Simulated Roll Rate

30 Measured Simulated 20

10R (deg/sec)

-10

-20

-30 526 527 528 529 530 531 532 Time(sec)

Figure 3-17 Model Validation – Measured and Simulated Yaw Rate

313.3.3 Actuator Model Identification The actuators used in WVU research UAVs to drive all the aircraft controlsurfaces were digital servos made by JR Corp. (Figure 3-18). A model of the actuatoritself was needed for both controller design and flight control system simulation.

Figure 3-18 R/C Servo

The importance of a good actuator model relies in the fact that the bandwidth of thewhole flight control system is mainly dominated by the actuator’s bandwidth. Since thecommand to the actuator’s position was issued from the on-board computer through thecontroller board, the actuator model was thus defined as the transfer function from thedigital command from the computer to the actuator’s actual position. This definition isslightly different from the ‘conventional’ actuator model, in that the interface between thecomputer and the actuator (featured by a pure time delay in this case, as will be seenshortly) was also included in the model; this facilitates the analysis and design of thecontrol system. To conduct the actuator model identification, a ground-test experiment wasperformed by applying step input from the on-board computer to the actuator, and theactuator’s position response data was read back to the computer via the data acquisitioncard. Both the command and data sampling rate was set at 50Hz. The experiment wasperformed for all of the 6 major actuators installed on the aircraft model (left/rightelevators, left/right ailerons and rudders) and identification was attempted for all test datacollected from the six actuators. Figure 3-19 represents one typical actuator test used foridentification purposes.

32 8 Servo Input 7 Servo Output

5 Left Rudder (deg)

-1 8.9 8.95 9 9.05 9.1 9.15 9.2 9.25 9.3 Time(sec)

Figure 3-19 Data from Actuator Identification

It was found that the actuator model was best described by the following transferfunction: 1 Ga = e −τ d s (3-28) 1+τaswhere τ d is the pure time delay and takes a fixed value of 0.02 sec for all six actuators.

τ a is the actuator time constant taking different values for each actuator, as listed inTable 3-2:Left elevator Right elevator Left rudder Right rudder Left aileron Right aileron0.0375 0.0294 0.0294 0.0313 0.0424 0.0391 Table 3-2 Actuator time constant

A value of 0.0424, which was the longest (and thus most conservative) among the valuesin the above table, was selected as the time constant for the actuator model. Figure 3-20shows the measured and simulated step response of the identified actuator model.

33 8 Measured Data 7 Simulated Data

5 Left Rudder (deg)

-1 8.9 8.95 9 9.05 9.1 9.15 9.2 9.25 9.3 Time(sec)

Figure 3-20 Measured and Simulated Actuator Step-response

Since the full actuator models were associated with the aerodynamic force/torqueload, the final actuator model was validated/verified from actual flight test data. Sampleflight data shown in Figure 3-21 was collected from flight test session Oct.16th 2003. Theflight data represents the input-output relationship of the left rudder actuator.

34 4 Acuator Output Acuator Input 3

2 Left Rudder (deg)

-1

-2

-3 294 294.5 295 295.5 296 296.5 297 297.5 298 Time(sec)

Figure 3-21 In-flight Actuator’s Response

It is clearly shown that the bandwidth of the actuator limited the response of the flight-control system. The actuator worked as a low pass filter (with delay) and smoothed outthe noisy control command caused by the rate-sensor feedback but still maintain enoughspeed to control the aircraft. With the estimated actuator model: 1 Ga = e −0.02 s (3-29) 1 + 0.0424 sA simulation test was performed to simulate the actuator response. Figure 3-22 showsthe comparison of the measured (in-flight) and computed actuator’s response with thesame controller command shown in Figure 3-21.

It can be concluded that the identified actuator model can approximate the actual servoresponse within a desirable level of accuracy.

3.4 - Linear Controller Design

A linear feedback controller was designed as a baseline system to provide thereference point for analysis. Designed at the nominal flight condition, the linearcontroller has the capability of stabilizing the aircraft during a nominal flight condition(without failure) and provides a “basis” for the NN controller during actuator failure.Angular rate readings obtained from the Inertial Measurement Unit (IMU) were used forfeedback. A more detailed explanation of the on-board hardware/software flight controlpackage will be provided in Chapters 4 and 5. The linear controller can be considered as a Stability Augmentation System(SAS). The SAS typically uses sensors to measure the body-axes angular rates of thevehicle, feeding back a processed version of the signals to the servomechanisms thatdrive the aerodynamics control surfaces. In this way, an aerodynamic moment

36proportional to the angular velocity and its derivatives can be generated to produce adamping effect on the motion. Detailed description and design methods can be found in[44]. Stability augmentation systems are conventionally designed separately for thelongitudinal dynamics and lateral-directional dynamics. This is made possible bydecoupling of aircraft dynamics in most flight conditions (without actuator failure). Thedesign process of these two sub-controllers will be presented below.

3.4.1 Longitudinal Control Parameter Design

The purpose of a longitudinal SAS is to provide a desirable natural frequency anddamping for the short-period mode. The pitch rate feedback gain is preferred to be aslarge as possible to compensate for wind gust disturbances while still maintaining areasonable stability margin and short-period damping ratio.

Figure 3-23 Root-locus (Longitudinal Dynamics)

Using a root-locus based design as shown above in Figure 3-23, the pitch rate feedbackgain was selected to be: Kq =0.12 (3-30)

This gives a satisfactory damping ratio of 0.592 and a natural frequency of 3.56 rad/sec

373.4.2 Lateral-Directional Control Parameter Design The lateral-directional control design was basically a Multi-Input, Multi-Output(MIMO) controller design. This requires a detailed understanding of the control systemin order to proceed with a design phase. Once a control gain for a specific feedback isdesigned, the corresponding feedback loop is closed and thus forming a new closed loopsystem on which the next feedback gain design is based upon.

Yaw rate feedback gain/washout filter constant design

The purpose of the stability augmentation yaw-rate feedback was to use therudder control surface to generate a yawing moment which opposes any yaw rateassociated with the dutch roll. The design objective was to achieve the dutch rolldamping ratio a reasonable value by designing yaw rate feedback gain, K r , whilechoosing a reasonable washout filter constant. Note that the uncompensated dutch rolldamping ratio was 0.192. The assumption is that the washout filter has the followingformat: s Gw ( s ) = (3-31) s + ω0Through an iterative process a K r value was selected, which maximizes the dutch-roll

damping ratio with different ω 0 , the best roll feedback gain value obtained was

K r = 0.16 (3-32)

where ω 0 = 1.8 . With this design, the dutch roll damping ratio was 0.7 and the naturalfrequency was 7.47 rad/sec.

Roll angle/rate feedback gains design

To achieve a desirable gust disturbance attenuation and fast roll rate stabilization,the objective of the roll rate feedback gains design was to find a gain as large as possible,while maintaining a reasonable stability margin and damping ratio. In this design, theyaw rate feedback loop was then closed. The designed roll rate feedback gain was: K p = 0.04 (3-33)

The linear controller was designed to stabilize the aircraft at nominal flight condition andprovided a baseline controller performance for the NN based AFA controller design.

3.4.3 Linear Controller Validation

To validate the performance of the designed linear controller, a set of flight testswere performed. During the flight testing, the pilot may use the controller switch toactivate the on-board controller. In this way, the pilot can perform a maneuver (i.e.doublets) with individual control channel (elevator, aileron or rudder) to excite theaircraft dynamics and turn on the linear controller right afterwards. The linear controllerwould then send control commands to stabilize the aircraft. Figure 3-24 shows theaircraft’s longitudinal response after an elevator maneuver. Figures 3-25 and 3-26represent the aircraft’s lateral-directional response after the aileron and rudder maneuverswere performed.

39 50

Q(deg/sec) 0

-50 342 344 346 348 350 352 354 10 Left Elevator(deg)

-10 342 344 346 348 350 352 354 6 Switch(volt)

0 342 344 346 348 350 352 354 Time(s)

Figure 3-24 Linear Controller Performance after Elevator Maneuver

100P(deg/sec)

-100 368 370 372 374 376 378 380 10 Left Aileron(deg)

-10 368 370 372 374 376 378 380 6 Switch(volt)

0 368 370 372 374 376 378 380 Time(s)

Figure 3-25 Linear Controller Performance after Aileron Maneuver

40 50 R(deg/sec) 0

-50 419 420 421 422 423 424 425 426 427 428 429 10 Left Rudder(deg)

-10 419 420 421 422 423 424 425 426 427 428 429 6 Switch(volt)

0 419 420 421 422 423 424 425 426 427 428 429 Time(s)

Figure 3-26 Linear Controller Performance after Rudder Maneuver

From the above flight testing results, it can be concluded that the designed linearcontroller can effectively stabilize the aircraft at the nominal flight condition (withoutfailure). As a small UAV with only 6.5 ft wingspan, wind gusts can be a major source ofdisturbance, especially on the roll rate channel (Figure 3-25). This effect can only bedecreased by increasing the feedback control gains. Flight test with a set of higher gainswere performed; however, the aircraft closed-loop stability was compromised by thesehigh values of the control gains. As expected, wind gusts also negatively affect the NNlearning, which will be discussed in Chapter 6.

3.5 - Aileron Failure AFA Controller Design

In the scenario of aileron failure, the right aileron is locked at the trim positionwhile the left aileron remained functional. Flight tests were completed with this

41configuration without the on-board controller involved. During the flight testing, theright aileron was locked at trim instantly once the controller switch triggered. The pilotcan use the remaining left aileron to perform aileron doublets maneuvers and the flightdata was recorded and compared with the nominal flight conditions. Selected flighttesting data are shown in Figure 3-27 and 3-28. It shows that during the aileron failure(right aileron locked at trim), two adverse effects typically developed: 1. Roll control authority deteriorates. This is quite straightforward since the effective aileron area has been decreased into half. Flight data shown in Figure 3-27 is a comparison of two different flight configurations. The solid line shows the roll rate response after a ±7 degree aileron doublet with right aileron failure and the dot line shows the response of the same maneuver without aileron failure. The roll rate response under failure is only about half of the nominal flight condition.

Figure 3-28 Aileron Failure Response- Coupling

Considering the size and position of ailerons on the YF-22 research UAV, thecoupling of the longitudinal and lateral dynamics caused by aileron failure is – asexpected – very minor and can be fully compensated for by the linear longitudinalcontroller. This is not the case, however, for the elevator failure scenario, which will bedescribed next in Section 3.6. The major effect from the aileron failure would be the aircraft’s performancedegradation caused by a decreased area of effective aileron surface. To evaluate theperformance of the linear controller under a failed condition, different flight tests were

43performed with flight test data shown in Figures 3-29 and 3-30. Since the aileron failurewas designed to be a locked control surface at a trim position, the effect of failure couldnot be shown in a straight and level flight condition since there is no difference betweenfailure and non-failure conditions. The flight tests were then designed to let thecontroller follow a sine-wave pattern on the roll rate. The tracking accuracy was notimportant since the controller had been designed to stabilize the aircraft instead of being atracking controller. With this configuration, the aircraft could continue the maneuversonce the controller switch is engaged and the effect of failure can be fully excited. Thisconfiguration could also help the on-line NN to learn the aircraft dynamics.

3 Aileron Failure Non-failure 2

1 Left Aileron(deg)

-1

-2

-3 305 306 307 308 309 310 311 312 Time(s)

Figure 3-29 Linear Controller with/without Failure – Left Aileron

44 30 Aileron Failure Non-failure 20

10 P(deg/sec)

-10

-20

-30 305 306 307 308 309 310 311 312 Time(s)

Figure 3-30 Linear Controller with/without Failure – P channel

In the case of linear controller with aileron failure, the feedback gain is fixed andwill not accommodate for the failure. However, since the loss of half aileron areaincreased the tracking error, the command input on the ailerons would actually beincreased by only a small amount. This effect can be noticed back in Figure 3-29, wherethe solid line shows the left aileron deflection with the existence of the right aileronfailure and the dot line shows the same signal without failure. Even with this slightcompensation effect, the response of the roll rate is still noticeably less effective than thecondition without failure (shown in Figure 3-30, the signal is noisy because of windgusts), which indicates the degradation of handling quality. The AFA controller wasdesigned to learn from the failure and increase the feedback controller gain of the roll rateto compensate for the loss of the right aileron. The design of the aileron failure AFAcontroller is shown in Figure 3-31.

45 Aileron, Rudder Servos

DAQ Linear Lateral On-line Neural

Linear longitudinal Elevator Servos

Controller

Figure 3-31 Aileron Failure AFA Controller

The on-line learning NN (described in Section 3-2) learns and approximates the lateral-directional dynamics of the aircraft. The estimation of the NN is compared with the off-line NN’s outputs to calculate the modeling error. The linear controller feedback gainsare then updated according to this modeling error to compensate for the failure condition.To decrease the negative effect of the wind gust turbulence and measurement noise, thegain updating procedure has been smoothed by using the difference of the standarddeviation of the NN estimations of the last 50 time steps (one second total) instead ofusing them directly. The gain tuning procedure can be described as: K p (n + 1) = K p (n) + lr × ( Std ( PNNOff −line (n − 50)...PNNOff −line (n)) (3-36) − Std ( PNNOn−line (n − 50)...PNNOn−line (n)))

where lr is the learning rate used to tune the roll rate feedback gain. The Simulink® simulation scheme is shown in Figure 3-32. The aircraft wassimulated with the modified lateral linear model and the roll rate response was decreasedby half to simulate a failure condition.

46 Figure 3-32 Aileron Failure AFA Simulation

The simulation results are shown in Figure 3-33. The simulation lasted for 500 secondswith the failure triggered at 100 second. The sampling rate for the simulation was set at50 Hz.

Figure 3-33 Aileron Failure AFA Controller Simulation – Gain Updating

47 Once the failure was triggered, the on-line neural network began learning. Theerror between the on-line and off-line NNs was used to calculate the modeling error andtune the linear controller. The roll rate feedback gain (started at 0.04) was adjustedduring the iteration process and eventually stabilized around 0.736. At the same time, theAFA controller gradually gained the capability to compensate for the loss of the rightaileron. The performance comparison of linear controller without failure, linearcontroller with aileron failure, and the NN AFA controller with failure were simulatedand presented in Figure 3-34. It can be seen that without the learning ability, the linearcontroller’s performance degrades significantly. While the NN based AFA controllercompensated for the failure and provided a similar performance as the linear controllerwithout failure.

Figure 3-34 Performance Comparison of Three Conditions – P Channel

483.6 - Elevator Failure AFA Controller Design In the case of elevator failure, the right elevator was locked in a trim positionwhile the left elevator remained functional. Flight tests were completed with thisconfiguration under ground pilot control. Once the controller switch was activated, theright elevator would lock at the trim position and the pilot could then trigger elevatormaneuvers with the fully functional left elevator. It can be observed from the collectedflight data that during the elevator failure, two major adverse effects typically developed: 1. Elevator’s control authority degrades; this is similar to the case with aileron failure since the effective elevator area had been decreased into half. Flight data shown in Figure 3-35 shows the difference of pitch rate response with both the failure and non-failure conditions. The solid line shows the pitch rate response after a ±7 degree elevator doublet with right elevator failure and the dot line shows the response of the same maneuver without failure. It is clearly shown that with the right elevator locked, the pitch rate response caused by the same pilot command was decreased to almost half.

Elevator Failure 30 Non-failure

20

10 Q(deg/sec)

-10

-20

-30

243 244 245 246 247 248

Time(s)

Figure 3-35 Elevator Failure Response – Q Channel

49 2. Unsymmetrical elevator deflection caused a substantial rolling moment as expected. This is due to the moment arm from the x-axis and the center of application of the force generated by the ‘healthy’ stabilator. This effect is shown in Figure 3-36. With the right elevator locked at trim position, the left elevator doublet caused a significant response in lateral channels. This effect is visually noticeable during the flight test. It can be seen that a ±7 degree elevator doublet could cause 60 deg/sec rolling moment. Left Elevator(deg)

10

-10 656 657 658 659 660 661 662 663 Right Elevator(deg)

10

-10 656 657 658 659 660 661 662 663

50 P(deg/sec)

-50 656 657 658 659 660 661 662 663 50 Q(deg/sec)

-50 656 657 658 659 660 661 662 663 Time(s)

Figure 3-36 Elevator Failure Response - Coupling

This strong coupling effect can be explained by the relatively large size and position ofelevators on the YF-22 model; the rolling moment caused by one side elevator wassignificant and must be compensated for so the controller can guarantee a satisfactory

50handling quality. It is clear that strong coupling between the longitudinal and lateral-directional dynamics increased the complexity of the control problem. To evaluate the performance of the linear controller under elevator failure, flighttests were performed with a similar method as with the aileron failure. A sine-wave pitchrate command was sent to the controller and aircraft responses are shown in Figures 3-37though 3-39. Similar to the case of aileron failure, once the elevator failure had beentriggered, the linear controller slightly increased the control command on the left elevator(Figure 3-37). This is because of a higher tracking error; however, a significantdegradation on performance is still noticeable (Figure 3-38). The action of the linearcontroller also caused a rolling moment which is shown in Figure 3-39, where the solidline represents elevator failure and the dot line shows the response without failure (whichactually shows a weak coupling with reversed sign caused by the imperfection of theaircraft). This is because of the strong coupling between the longitudinal and lateral-directional dynamics after the elevator failure; as explained, the linear controller had nocapability to compensate for this effect.

5 Elevator Failure 4 Non-failure

2 Left Elevator(deg)

-1

-2

-3

-4

-5 448 449 450 451 452 453 454 455 Time(s)

Figure 3-37 Linear Controller with/without Failure – Left Elevator

51 20 Elevator Failure Non-failure 15

10

5Q(deg/sec)

-5

-10

-15

-20 448 449 450 451 452 453 454 455 Time(s)

Figure 3-38 Linear Controller with/without Failure – Q Channel

30 Elevator Failure Non-failure 20

10P(deg/sec)

-10

-20

-30 448 449 450 451 452 453 454 455 Time(s)

Figure 3-39 Linear Controller with/without Failure – P Channel

52 To solve the linear controller’s inability to handle the failure condition, an AFAcontroller had been designed to handle the elevator failure. The diagram of the controllerdesign is shown in Figure 3-40. + Liner longitudinal Elevator Actuators Controller +

To compensate for the coupling between the elevator input and the lateraldynamics of the aircraft, an off-line learning NN to approximate the lateral-directionaldynamics at nominal flight condition was used to provide a reference response. This NNis the same as the one used for the aileron failure AFA controller; so it is fully decoupledwith the longitudinal dynamics of the aircraft. The standard deviation of the estimationof roll channel from both lateral off-line NN and full on-line learning NN was used tomeasure the coupling and tune the linear feedback gain from the elevator command to

Where α(k), β(k), P(k), Q(k)and R(k) were used to evaluate and train the NN. The selected NN was a MLP with BP training algorithm. To guarantee on-linetraining speeds and minimize the overfitting problem, the size of the hidden layer wasselected to be small (7 hidden neurons). Thus, the structure of the NN include: • 19 input neurons; • 7 hidden neurons; • 5 output neurons.The NN was trained off-line with the flight data collected from nominal flight conditions;the weight and threshold information were stored in a data file. The on-line and off-lineNN used in the controller to approximate the full dynamics of the aircraft had the same

54structure and used the same weight/threshold value at the starting stage of the simulation.Once the failure was triggered, the on-line learning NN would start training toapproximate the post failure dynamics. Simulation tests were performed with the designed elevator failure AFAcontroller. The Simulink® simulation scheme is shown in Figure 3-41. The aircraft wassimulated with the modified longitudinal linear model, with the pitch rate response beingdecreased to half to simulate a failure condition. A coupling constant of 0.4 between theelevator command and aileron inputs was found to match the flight data with rightelevator failure, and was used to simulate the aircraft’s longitudinal/lateral coupling afterfailure.

Figure 3-41 Elevator Failure AFA Simulation

The simulation results are shown in Figure 3-42. The simulation lasted for 500 secondsand the failure was triggered at 100 second. The sampling rate for the simulation was setat 50Hz.

55 0.25 Q Feedback Gain 0.2

0.15

0.1 0 50 100 150 200 250 300 350 400 450 500

0.4 Decoupling Gain

0.2

0 0 50 100 150 200 250 300 350 400 450 500

6 Controller Switch 4

0 0 50 100 150 200 250 300 350 400 450 500 time(s)

Figure 3-42 Elevator Failure AFA Simulation – Gain Updating

Once the failure was triggered, the on-line neural network began the learningphase. The error between the on-line and off-line NNs was used to calculate themodeling change and tuning of the feedback gains. The pitch rate gain - starting at 0.12 -was adjusted during the iteration process and eventually stabilized around a value of0.205. At the same time, the AFA controller gradually gained the capability tocompensate for the loss of the right elevator. The left elevator/lateral coupling gain,starting at 0 had been increased during the learning process where it eventually stabilizedaround a value of 0.35. The performance comparison of linear controller without failure,linear controller with elevator failure, and the NN AFA controller with failure waspresented in Figures 3-43 and 3-44. Figure 3-43 shows the simulated pitch rate response.While the NN was learning, the designed AFA controller shows significant improvementof roll rate response over the linear controller. The simulated roll rate response in Figure3-44 shows the NN AFA controller effectively compensates for the coupling from the leftelevator while the unwanted lateral response was decreased to a very small value. Thehandling quality of the aircraft after failure was improved with the designed AFAcontroller.

Figure 3-43 Elevator Failure AFA Simulation – Q Channel

Figure 3-44 Elevator Failure AFA Simulation – P Channel

57 From the simulation results above, the AFA controller designed in this chaptershows promising performance in accommodating for the actuator failure. How toimplement these controller designs into the flight testing experiments and validate thesimulated controller performance had been a major issue in this research effort. Detailsabout the development of the test-bed aircraft, on-board hardware/software, and flighttesting activities will be discussed in the following chapters.

58 Chapter 4 Test-bed Aircrafts & On-board Payload

To fully evaluate the actuator failure conditions and validate the performance ofthe designed AFA controller, aircraft test-beds were initially developed. On-boardelectronic payload systems were designed around the aircraft systems to perform dataacquisition, failure condition triggering and control of the aircraft. This section providesdetails about the aircraft test-bed and the on-board hardware used for the flight testingexperiments.

4.1 Test-bed Aircrafts

The WVU YF-22 jet powered research UAVs were developed for flight testing ofthe controller designed. This project was initially started with “Version 1” of the WVUYF-22 shown in Figure 4-1.

Figure 4-1 WVU YF-22 Research Model Aircraft (Version 1)

On-board instrumentation and control hardware adequate for actuator failure triggeringand accommodation were developed for these UAVs. About 36 flight tests were

59performed on this particular aircraft including aircraft evaluation, data acquisition, failuresimulation and linear controller validation. With the starting of the formation flight project a new fleet of improved YF-22UAVs was developed. A picture of ship green at take-off is shown in Figure 4-2.

Figure 4-2 WVU YF-22 Research Model Aircraft (Version 2)

The new version of YF-22 UAVs have a larger avionics bay capable of carrying an evenheavier payload with increased flight mission duration. A vertical gyro and GPS unit wasadded to the new YF-22 on-board payload for formation flight testing to get a bettermeasurement of aircraft’s parameters. This additional information benefited engineersfor both aircraft capabilities and data analysis. The AFA software was then transferred toone aircraft in the new fleet. Flight testing activities included data acquisition, failureanalysis and actuator failure accommodation had been completed. As a flying test-bed, the aircraft’s performance had a direct relationship to thedesign of the on-board payload and controller. The aircraft frame was made ofcomposites fiberglass, carbon fiber, Kevlar, foam, and wood. Unlike the equivalentmodels used in recreational purposes, a perfectly scaled research model was not requiredand did not exhibit acceptable handling qualities due to the negative effect of the payloadon the dynamic characteristics. Therefore, specific changes were made to the geometric

60and aerodynamics characteristics of the aircraft model to achieve desirable handlingqualities in the model. In particular, the design was aimed at achieving acceptable valuesfor two specific parameters, the thrust/weight (T/W) ratio and the weight/wing surface(W/S) ratio.

4.1.1 - Aircraft Specifications

The WVU YF-22 research aircraft model (Version 2) has an approximate 6’6”wing span and is powered by a miniature jet engine with 28 lbs thrust. The payloadcapability is about 12 lbs, which can easily carry the on-board computer system and allnecessary instrumentation (Figure 4-3).

Figure 4-3 Aircraft Overview

The aircraft is controlled by a 10-channel R/C radio by the ground pilot with theon-board controller disengaged. Manual takeoff and landing are performed by the pilot.The pilot has the full control of elevators, ailerons, rudders, flaps, engine throttle, brakes,retractable landing gear, and a controller switch to activate the on-board controller. Thefuel capability is about 7 lbs with a typical mission duration of about 12 minutes. Thisensures adequate flight time for the actuator failure test without putting a high level ofstress on the UAV pilot. Specifications for the WVU YF-22 research UAVs are shown inTable 4-1:

4.2 On-board Payload

The on-board electronic payload system was designed to monitor and control theUAV. The on-board sensors provide measurements of all the major parameters of theaircraft. The on-board electronic package performs data acquisition, execution of thecontrol laws and distributes control signals to the individual aircraft control actuators.Six-controller channels were provided by the on-board controller including: left elevator,right elevator, left aileron, right aileron, rudders and the engine throttle. To perform theactuator failure accommodation the following specific requirements were used to definethe system architecture: 1. Different commands (control commands, failure, start/stop of learning) can be sent from the ground pilot;

62 2. The On-Board Computer (OBC) can have full control of the major aircraft control surfaces; 3. At any time the pilot can regain direct control of the aircraft; 4. Actuator failure can be simulated during the flight; 5. Actuator failure can be accommodated with the use of on-board controller during the flight; 6. The package should be small, robust, resistant to vibration, operate in cold/hot/humid environments and easy to be installed with a combined weight of less than 10 lbs. 7. The package should have a minimum Electromagnetic Interference (EMI)With these requirements, the selected hardware system was designed to be able to operatein the following three distinct modes of operation: 1. “Manual” Mode; 2. “Manual – Partial Automatic” Mode; 3. “Automatic” Mode.In the “Manual” mode the pilot has complete control of the aircraft. The pilot can switchto this mode at any time when operating in the other two modes. This mode wasdesigned to provide a safe operating condition before engaging the controller, and can beused for emergency recovery in case of controller instability. During the take off andlanding phase of the mission, the aircraft was required to be in the manual operatingmode. Within “Manual – Partial Automatic” Mode, the pilot has control over a subset ofthe aircraft main control surfaces while the on-board controller controls the remainingsurfaces. The preprogrammed on-board software decides which control channels to beallocated to the on-board computer while the pilot retains control of the remainingchannels. This mode was for intermediate testing of the actuator failure because it wouldminimize risk during flight tests and could be used to trigger certain maneuvers with pilotinputs. Within “Automatic” Mode, the control system has complete control of all majorcontrol surfaces. This mode was only used for the evaluation of linear controller designand the final phase of the actuator failure accommodation tests.

634.2.1 - On-board Payload Subsystems According to the requirements and the selected architecture, the on-board payloadsystem was designed to receive pilot commands, collect flight data with the on-boardinstrumentation, generate on-board control commands and distribute control signals tocontrol surfaces. In this way, the on-board payload (Figure 4-4) can be divided into threesubsystems: 1. R/C System; 2. Data Acquisition System; 3. Control Signal Distribution System.

GPS Compact Flash

Vertical Gyro OBC

IMU Battery Pack

Sensor cables Power Supply

Figure 4-4 On-board Payload

4.2.2 - R/C System

The WVU YF-22 research aircraft is remotely controlled with JR 10X radioshown in Figure 4-5.

Figure 4-6 R/C Receiver

Nine cables were used to transmit the receiver control signals to the on-boardcomputer. The Control Signal Distribution System (CSDS) inside the computer boxdistributes the control signals according to the on-board software and sends them to theindividual servos of each control surface. The receiver set-up features 10 channels,including eight for controlling the aircraft, one for turning on/off the on-board controller,and one for acquiring the throttle command.

4.2.3 - Data Acquisition System

The data acquisition system monitors the condition of the aircraft and collectsdata for both controller and post-flight analysis purposes. The data acquisition system

• Global Positioning System (GPS);

• Temperature sensor;These above sensors provide measurements of the aircraft’s angle of attack, angle ofsideslip, static & dynamic pressure, temperature, Euler angles, 3-axis angular rates, 3-axisaccelerations, position, velocity, and the deflection of all control surfaces. The generalarchitecture of the data-acquisition system is shown in Figure 4-7.

Potentiometers

IMU

Vertical Gyro GPS Data Acquisition Card Pressure Sensors

Serial Ports CPU Card

Temperature Sensor

Flash Memory Card Command Voltages

Figure 4-7 Data Acquisition System

The on-board computer is a PC104 format computer stack. This system includesa CPU card, data acquisition card, power supply card, custom sensor connection card,and a top panel for connection purposes to video/keyboard, etc. The layout of the OBC isshown in Figure 4-8.

66 GPS, Sensors Top Panel Control Box

Custom Interface Card

Data Acquisition Board

CPU Board

Battery Power Supply Board

Figure 4-8 Layout of the OBC

The YF-22 data acquisition card has the capacity of 32 analog/digital channels of which22 channels were used and with the remaining channels reserved for future expansions.

4.2.4 - Control Signal Distribution System

The main component of the control signal distribution system is the controllerboard, which acts as a hub for the whole flight control hardware. The functions of theCSDS include: 1. Receive control signals from the pilot; 2. Receive control signals from the OBC; 3. Transfer the command from the OBC into PWM signals; 4. Select the current operation mode of the aircraft (Manual or Automatic); 5. Select channels to be controlled by the OBC; 6. Distribute control signals to individual servos.In addition to all these functions, the controller board must be extremely reliable toguarantee aircraft safety. The pilot can use channel 7 of the transmitter to enter the“Automatic” Mode; however, he can reverse to manual mode at any time. The blockdiagram for the CSDS is shown in Figure 4-9.

Pilot Servo Flight mode

Figure 4-9 Control Signal Distribution System

A more detailed description of the hardware components is provided in Section 4.3.

4.3 Major Components

According to the architecture outlined in the previous section, the aircraft payloadcomponents were designed to have: 1. On-board computer modules to assemble the PC-104 on-board computer; 2. On-board instrumentation for acquiring the flight status of the aircraft; 3. Custom designed components for providing power, connecting sensors and servos with the on-board computer and distributing aircraft control signal.This section will give a detailed description of major components used in the YF-22research UAV on-board payload.

4.3.1 - On-Board Computer Modules

The OBC shown in Figure 4-10 is a PC-104 stack, which contains a CPU module,data acquisition module, power supply module and supporting components. The PC-104format devices were selected because of their miniature size, lightweight, and low powerconsumption.

68 Controller Servo Control Board Module

DAQ Card Power Supply

Card

CPU Card Interface-Board

CF Card Computer Box

Reader

Figure 4-10 YF-22 On-board Computer

A description of each individual component that makes up the stack will now bediscussed.

CPU Module - MSI-CM588

The CPU card is the “brain” of the aircraft payload. It collects data from the dataacquisition card and executes the control laws. It sends out control commands to thecontroller board. The speed of the CPU was also a requirement since the designed AFAcontroller feature on-line learning neural networks. The CPU card that selected was theMSI-CM588 (Figure 4-11) manufactured by Microcomputer Systems.

Figure 4-11 CPU Module

The MSI-CM588 is a versatile low-power PC/104 CPU card featuring a NS GXLV/GX1

processor and a GX5530 chipset with a built-in 6x86 300 MHz CPU operating from 0 to

6985° C without a fan from a single +5V power supply. The MSI-CM588 supports on-chipVGA display and two serial ports. 128 MB memory had been installed on the CPU cardfor each on-board computer system.

Data Acquisition Module - Diamond-MM-32-AT

The data acquisition card is one of the most important modules in the system. Itsmain function is to collect signals from the individual sensors; furthermore, it sendschannel selection commands to servo driving circuit through the digital output capability.The accuracy of the flight control command was directly dependant on the speed andaccuracy of the data acquisition card. The data acquisition card selected was a Diamond-MM-32-AT (Figure 4-12) made by Diamond Systems.

Figure 4-12 Data Acquisition Module

It has 32 analog input channels with 16 bits resolution. The maximum sampling rate is200 KHz (although the on-board computer system only uses up to 100 Hz). The card isalso capable of providing 24 high-current digital I/O; eight of them were used to send thechannel selection signal to the controller board.

Power Supply and Communication Module - Jupiter-MM-SIO

The power supply card selected is the Jupiter-MM-SIO (Figure 4-13)manufactured by Diamond Systems.

70 Figure 4-13 Power Supply Module

This module provides different voltage levels to power up the OBC and aircraft sensors.It also provides two additional serial ports, which can be used for communication and/orcontrol purposes

Servo Control Module

The servo control module transfers the OBC’s control commands (or serialsignals) into the PWM signal to drive the aircraft servos. The servo control module usedfor the electronic payload is the Mini SSC II (Figure 4-14).

Figure 4-14 Servo Control Module

This module accepts serial inputs at 2400 or 9600 bps and provides 8 channels of servo-control signals (PWM). It takes a three-byte control package including one header byte,one channel selection byte and one byte for control signal. In the YF-22 payload design,

71six controlling channels were used to control the aircraft with an update frequency of 50Hz.

Compact Flash Reader

Both the operating system and flight control software were installed in an 8 MBremovable compact flash card. An IDE card reader (Figure 4-15) had been installed onthe flight computer.

Figure 4-15 Compact Flash Card and Reader

This device is bootable and works like a hard drive. However, it can work within a muchhigher vibration environment. During flight testing sessions, different tasks can be storedin different compact flash cards for quick task reconfiguration at the field. The use of aremovable compact flash card greatly also simplifies the procedure for data downloadingafter each flight.

4.3.2 - On-board Sensors

The on-board sensors provide measurements of all the main aircraft flightparameters that were used for both parameter identification and control purposes. Anetwork of sensors for the aircraft model include: air data probe, pressure sensors,temperature sensor, IMU, vertical gyro, GPS and potentiometers for measure thedeflection of each control surfaces. A detailed description of each component will nowbe provided.

It is a lightweight component (approx. 6 oz) specially designed for light aircraft and UAVuses. The total length of the probe is 30 inches and the nominal maximum calibratedspeed is 340 knots. It features angle-of-attack and sideslip vanes as well as static anddynamic pressure pickups.

Figure 4-17 Pressure Sensor

The absolute pressure sensor measures the static pressure, which can be used to calculatethe altitude of the UAV. The range of the SenSym ASCX15AN is 0-15 psi. Thedifferential pressure sensor measures the difference between the static and dynamicpressure, which can be used to calculate the airspeed of the aircraft. The range of theSenSym ASCX01DN is 0-1 psi.

Figure 4-18 IMU400

for navigation and control, dynamic testing, and instrumentation applications. This highreliability inertial system provides accurate measurements of angular rates and linearaccelerations. The IMU400 achieves excellent performance by employing proprietaryalgorithms to characterize and correct for the effects of temperature, linearity, and mis-alignment. Fully compensated angular rate and acceleration outputs are provided in bothanalog and digital (RS-232) formats. The range of measurement for the IMU400 unit is±90 °/sec for angular rates and ±4 g for accelerations.

Vertical Gyro – VG34

The VG34 vertical gyro (Figure 4-19) - manufactured by Goodrich SensorSystems - was selected for the measurement of the Euler angles. This unit wasspecifically selected because of its small physical size and high performance.

74 Figure 4-19 Vertical Gyro

The measurement range for the vertical gyro is ±90° in Roll, with an accuracy of ±1°, and±60° in pitch, also with an accuracy of ±1°.

Potentiometers To measure the displacement of aircraft’s control surfaces, potentiometers (Figure4-20) were installed on each axis.

Figure 4-20 Potentiometer

The value of each potentiometer was selected to be 10kΩ. This value provided adesirable trade-off between Signal Noise ratio (S/N) and power consumption. 12 voltsare supplied to each potentiometer and the reading output is collected and calibrated toprovide the measurement of surface deflection in degrees.

75GPS Unit The position and velocity information are not strictly required. However, they arehelpful to verify other sensor data and assisted in obtain an accurate aircraft mathematicmodel. The GPS choice for the payload is the OEM4 (Figure 4-21) GPS unit made byNovatel, Inc.

Figure 4-21 GPS Unit

Key benefits of the OEM4 unit include the following: Up to 20Hz data update rate; PulseAperture Correlation (PAC) technology offers significant multipath eliminationcapabilities; On-board power conversion eliminates the need for external powerconditioning; on-board voltage and temperature monitoring provide greater systemreliability. This GPS unit provides the 3-axis position and velocity information of theaircraft via the serial port. The GPS antenna used on the YF-22 research UAV is theGPS-511 made by Novatel. A picture of the antenna unit mounted on top of the aircraftis shown in Figure 4-22.

76 Figure 4-22 GPS Antenna

The GPS-511 offers optimal L1 performance for airborne and high dynamic applications.Along with a low profile, the GPS-511 is just 89 millimeters in diameter, weighing 145grams, and is environmentally sealed to protect against harsh weather. The antennafeatures a four-hole mounting system to ensure secure installation.

4.3.3 - Custom Designed Components:

In addition to off-shelf components, several pieces of hardware had to be custom-designed from scratch to make the system fully functional. Printed Circuit Boards (PCB)had been designed and developed to meet the specified requirements including abaseboard, controller board, nose sensor board, power supply board, sensor & servo hubboards.

Baseboard The baseboard shown in Figure 4-23 is a custom-made signal connection boarddesigned to connect individual sensor outputs to each specified data acquisition channel.It provides power to each sensor (except vertical gyro and GPS which are poweredseparately) and provides a reference voltage for the controller usage.

77 Figure 4-23 Baseboard

Controller Board The controller board shown in Figure 4-24 below is one of the most criticalcomponents of the flight control hardware.

Figure 4-24 Controller Board

In fact, the safety of the aircraft is directly related with the reliability of the controllerboard. This board receives control signals from both the pilot (R/C receiver) and theOBC (which then converts to PWM signal). Two switching mechanisms had beendesigned to guarantee the safety that is: Hardware Switching and Software Switching.

78 Hardware Switching: Hardware switching gives the pilot the ability to switch off the entire controller instantly at any circumstance even if the on-board computer power is lost. A R/C channel was allocated for this exact purpose. The PWM controller switch signal from the receiver has been converted to High/Low switching signal according to the signal pulse width. This switching signal is then used to drive a set of AND gates to enable/disable the entire on-board controller. Software Switching: Software Switching gives the on-board computer the capability to control all or any subset of the aircraft’s control surfaces with pre- programmed selections. With this ability, the flight test can be configured to contain different subtests and greatly enhances the flexibility and the safety of the experiment. The software switching is a cooperation of both hardware and software. The on-board software reads pre-determined channel selection information from a log file at the initialization stage. Once the controller switch is turned on, it sends out the channel selection signal through the Digital Input/Output (DIO) port of the data acquisition card. This signal is passed to the multi-channel 74HC4053 analog multiplexer/demultiplexer on the controller board to select the pilot/on-board control. The design of the controller board is shown in Figure 4-25.

Figure 4-25 Controller Board Design

79Nose Sensor Board The nose sensor board (Figure 4-26) was designed to interface with the dynamicpressure sensor, static pressure sensor and temperature sensor.

Figure 4-26 Nose Sensor Board

Additional connectors on the nose-board allow for the air-data probe potentiometers to beadded to the data acquisition system.

Power Supply The voltage requirement of the vertical gyro is a 24-32V supply-range. Theaircraft on-board battery pack only supplies 14.8V; therefore, a DC-DC converter wasnecessary. The 24v DC converter was mounted on a custom-made power supply PCboard (Figure 4-27).

Figure 4-27 Power Supply

To minimize potential EMI problems several RF chokes were used in-line and thepackage is enclosed inside an aluminum case.

80Sensor Hubs The sensor hub (Figure 4-28) was designed to connect the on-board computer tothe potentiometers mounted on each control surface.

Figure 4-28 Sensor Hub

12volts had been supplied to each of the potentiometer and the signal reading is passedback to the on-board data acquisition card. Two sensor hubs, located near aircraftsurfaces, were used to provide connections on the left and right sides of the plane.

Servo Hubs The servo hub was designed to connect the controller hardware to individualservos (Figure 4-29).

Figure 4-29 Servo Hub

The servo control commands were sent out to the servo hub and then re-distributed toeach individual servo including left/right elevators, left/right rudders, left/right ailerons,left/right flaps, and the engine throttle signal.

81Interface Panel The interface panel is integrated on the computer enclosure. It is made ofaluminum and features power and mode switches and provides connection to sensors,monitor, and keyboard. The interface panel has three sections: front, rear and top(Figure 4-30).

Figure 4-30 Interface Panels

The front panel connects to the battery power, R/C receiver; vertical gyro and nose probesensors. The rear panel connects to the IMU, sensor hubs, servo hub, and GPS. The toppanel is for human interface and contains a computer power switch, vertical gyro powerswitch, running mode switch, power LED, controller switch LED, and a slot for thecompact flash card.

4.3.4 - Power Sources

A total of six battery packs have been used in each WVU research UAV. Four4.8v 1600mAh NiMN battery packs were used for R/C system including two for thereceiver and two for the aircraft servos. This provided a dual-redundancy for the power

82of the R/C system, which is the most critical part of the aircraft safety. A 7.2v 1250mAhNiCd battery pack had been used to power the electronics for the jet engine. To powerthe on-board computer and instruments, a battery pack made of four Li-Poly battery cells(Figure 4-31) was used.

Figure 4-31 Battery Cell

This battery pack provided 14.8v (nominal) with 3300mAh capacity. The YF-22 on-board payload power consumption in Table 4-2 shows that the selected Li-Poly batterypack can last for more than one hour after been fully charged, which is more thanadequate for AFA flight testing purposes.

4.4 Hardware Mounting

The installation of the hardware components needs carefully consider thefollowing important factors: Characteristic of each instrument, Cable length,

83 Level of vibration, Power supply, Electromagnetic interference, Balance of the aircraftMost of the payload components including the on-board computer, vertical gyro, IMU,GPS, Power supply were mounted on the two rails of the payload bay shown in Figure 4-32.

Figure 4-32 Payload Bay

With the jet engine mounted in the rear of the aircraft, most of the payload componentswere installed toward the forward section of the aircraft due to balance issues. The ideal position of the IMU was the C.G. of the aircraft to provide the correct 3-axis acceleration readings directly. However, because of balancing issues, the IMU hadto be relocated to a position forward of the C.G. With this configuration, the accelerationread-outs on the Y and Z-axis had to be corrected with the angular-rate readings. Sincethese two signals were not required in this project, the correction algorithms will not bediscussed in this dissertation. Both the vertical gyro and IMU needed to be perfectly leveled with the aircraft.The mounting of the nose probe was required to be parallel to the X-axis of the aircraft.To be away from most EMI sources and use the maximum length of the aircraft for

84antenna, the R/C receiver was mounted in the nose bay of the aircraft (Figure 4-33) withthe antenna attached to the tip of right vertical stabilizer.

Figure 4-33 Nose Bay

4.5 EMI ElectroMagnetic Interference (EMI) poses a significant threat for UAV safety.For a small UAV like the WVU YF-22 research aircraft model, there are several internalsources of interference including the on-board computer, vertical gyro, and power supplysystem. With the physical restriction of the aircraft, these components are located withina few feet of the R/C receiver. Therefore, special care was taken in the design,manufacture and installation of each component. Aluminum enclosures were designed toshield most of the hardware components and ferrite RF chokes were used on every powerand signal cables. The EMI of the completed on-board payload was evaluated with aspectrum analyzer before the first set of flight testing. To guarantee the safety of theaircraft, a ground range check for the R/C radio system is performed before each flight.During the range check, the on-board computer, sensors and jet engine were powered andan approximate 300 ft ground radio range was required with the transmitter antenna fullyretracted before flight operations proceeded.

85 Chapter 5 On-board Software

With the AFA controller been designed and all the on-board hardware beendeveloped, software was required to implement the control laws and provide an interfacebetween the controller and the on-board hardware. As for any flight control software, theon-board software must be executed in real time. Matlab® real-time workshop wasselected to generate the real-time target. The software was designed to be modulized andeach individual software component was programmed with C-language as a Matlab® S-functions. The Simulink® environment, a package within Matlab® was used as thesimulation environment. Once simulated test was completed, a final program wascompiled with Real-Time Workshop (RTW) as a real-time DOS target for flight testing.The operating system on-board the YF-22 flight computer system is DOS. The selectionof DOS was due to its simplicity and limited storage requirement. Both the operatingsystem and on-board software were stored on an 8 MB compact flash card, which is aself-supporting bootable device. All of the software components are individual modulesand are easy to be configured for various flight testing tasks. The UAV on-board software was designed to perform data acquisition, executecontrol laws and implement the control commands. The following ten requirements hadbeen used to define the software architecture: 1. Reliability; 2. Performance in Real Time; 3. System sampling rate no slower than 25Hz; 4. Data acquisition from all sensors and conversion into engineering units; 5. NN on-line training; 6. Execute control laws on-board; 7. Provide control command and control channel selection signals; 8. Store data for post flight analysis; 9. Ability to be reconfigured for different flight task at the flight testing facility (without recompiling); 10. Automatically update calibration data at field (without recompiling).

865.1 - Selected Architecture With the system requirements defined above, the YF-22 on-board software can bedivided to be two major subsystems: 1. Data acquisition system; 2. AFA flight control system. The data acquisition software acquires the sensor signals from analog I/O module,which converts the analog signal into a 16 bit digital signal. The raw voltage data is thencalibrated on-board to generate meaningful engineering values to be used by the flightcontroller. The flight data is also saved in the 8 MB on-board flash card for post flightanalysis. The AFA flight control software receives as input the flight data acquired throughthe DAQ software. On-line training NN based AFA controllers designed in Chapter 3 areexecuted in real-time. Commands generated by the control laws are then calibrated andsent to the servo control hardware for AFA purpose. A diagram of the on-board softwareis shown in Figure 5-1.

On-board Data Data Storage Acquisition

Data Flight Mode

TO DIO Calibration Selection System

NN AFA Servo Command

TO SIO Controller Calibration

Figure 5-1 On-Board Software

5.2 - Data Acquisition Software

The main purpose of the data acquisition software is to collect, convert, send, andstore sensor readings from the electronic payload. The development of this software wasbased upon a Diamond-MM-32 PC/104 format 16-bit analog I/O module.

87Analog Input Channels: The Diamond-MM-32 features 32 analog I/O channels. Only 22 analog I/Ochannels were actually used. A list of the data acquisition channels is provided in Table5-1.

Number Channel Name Sensor/Notes

1 Static Pressure Nose probe

2 Dynamic Pressure Nose probe

3 Alpha Nose probe

4 Beta Nose probe

5 Temperature Temperature sensor

6 Roll Angle Vertical Gyro

7 Pitch Angle Vertical Gyro

8 Left Aileron Potentiometer

9 Left Rudder Potentiometer

10 Left Elevator Potentiometer

11 Right Aileron Potentiometer

12 Right Rudder Potentiometer

13 Right Elevator Potentiometer

14 Control Switch Manual/Automatic control

15 Throttle Reading Receiver

16 Command Switch Voltage reference

17 Acceleration_X IMU

18 Acceleration_Y IMU

19 Acceleration_Z IMU

20 P IMU

21 Q IMU 22 R IMU Table 5-1 Data Acquisition Channels

88Input Ranges and Resolution All sensors in the electronic payload have an output range between –10 and 10V.Therefore all the analog I/O channels were configured to accept ±10V bipolar inputs.With the 16 bits A/D conversion, the resolution of the data acquisition is 305 µV, whichis accurate enough for data analysis and control purposes.

A/D Conversion Formulas

The 16-bit value returned by the A/D converter is always a complement numberranging from –32768 to 32767, regardless of the input range. The input signal is actuallymagnified and shifted to match this range before it reaches the A/D. The A/D conversionformula for bipolar input range is: FS = full-scale voltage (e.g. 10 for ±10V range) Input voltage = (A/D code / 32768) x FS

A/D Conversion There are 7 steps involved in performing this A/D conversion [73]: Step #1: Selection of the input channel or input channel range The Diamond-MM-32 contains a channel counter circuit that controls which channel is to be sampled on each A/D conversion command. This circuit uses two channel numbers called the low channel and high channel, which are stored in registers. The circuit starts at the low channel and automatically increments after each A/D conversion until the high channel is reached. When an A/D conversion is performed on the high channel, the circuit resets to the low channel and starts over again. For the data acquisition software, the low channel was 0 and the high channel was 21. The data acquisition card scans the whole range of 22 channels once for each sampling time. This range can also easily be expended as more sensors are added.

89Step #2: Selection of the analog input range (range, polarity, and gain codes) The desired input range can be selected by writing to the analog I/Ocontrol register. The analog input range used by the on-board payload was ±10V.

Step #3: Wait for analog input circuit to settle

After changing either the input channel or input range, the circuit needs tosettle on a new value before performing the A/D conversion. The settling time issubstantial when compared with the software execution times. Therefore, a timerwas provided on board to indicate when it is safe to precede with the A/Dsampling. The WAIT bit indicates when the circuit is settling and when it is safeto sample the input.

Step #4: Start an A/D conversion on the current channel

To generate an A/D conversion, write to base address to start theconversion.

Step #5: Wait for the conversion to finish

The A/D converter takes about four microseconds to complete aconversion. The A/D converter provides a status signal to indicate whether it isbusy or idle.

Step #6: Read the A/D data

Once the conversion is completed, the data can be read back from the A/Dconverter. The data is 16 bits wide and is read back in two 8-bit bytes: LeastSignificant Byte (LSB) and Most Significant Byte (MSB). The followingpseudocode illustrates how to construct the 16-bit A/D value from these twobytes: LSB = read (base) ; Get low 8 bits MSB = read (base+1) ; Get high 8 bits Data = MSB * 256 + LSB ; Combine the 2 bytes into a 16-bit value

90 The final data ranges from 0 to 65535 (0 to 216- 1) as an unsigned integer.This value must be interpreted as a signed integer ranging from -32768 to+32767.

Step #7: Convert the numerical data to meaningful engineering unit

Once the data acquisition is completed, it only provides a voltage readingof the individual sensor. For use by the controller board, the voltage value needsto be converted to an engineering unit. The calibration information for eachchannel was calculated and stored on the compact flash card. The on-boardsoftware loads the calibration file at the initialization phase of execution andconverts the data at each time step before feeding the results into the controller. Ablock diagram for the on-board Data Acquisition Software is shown in Figure 5-2.

91 Start

Software Initialize Load Calibration Data

Initialize the Sampling Rate

Initialize Data-Acquisition Card

Wait for analog circuit to settle

STOP?

Scan all channels and collect data

Transfer data to voltages To AFA Controller

Convert to meaningful value

Save Data to File

End

Figure 5-2 Data Acquisition Software

Digital Input Channels

The 3-axis position and velocity information of the aircraft GPS unit was acquiredon-board through the serial port. A total of six channels were acquired, which are shownin Table 5-2

Number Controller Command

Sampling Rate The sampling rate of the data acquisition software is adjustable. Due to the fastdynamics of the small UAV, the sampling rate of the on-board analog DAQ should be noslower than 25 Hz. For flight tests for data-acquisition purposes - such as the PID phaseof the program - the sampling rate was set to be 100 Hz. For flight testing with flightcontrol system and AFA software, the sampling rate was reduced to 50 Hz to save oncomputation power. The overall sampling rate for the GPS unit was 20 Hz, which is themaximum allowed by the selected hardware.

93Data Outputs The flight data acquired with the DAQ software can be used for three differentpurposes: 1. Pass to the on-board AFA flight control software simultaneously for controller use. 2. Send out selected sensor readings (reduced sampling rate) through a serial port simultaneously. During flight tests, this signal can then be received by the ground station through optional RF-Modems. 3. Save into a data file for post flight download and analysis by engineers.

5.3 - AFA Flight Control Software

The AFA Flight Control software gives the on-board computer the capability tocontrol the aircraft and accommodate for the actuator failure. In addition to the dataacquisition software, several additional components are necessary to meet this goal: • Digital channel selections; • AFA controller; • On-board servo calibration; • Servo control.A Simulink diagram for actuator failure accommodation flight control software is shownin Figure 5-3. This scheme was used for the final AFA flight testing.

94 Figure 5-3 Simulink Diagram for On-Board AFA Software

Digital Channel Selection

The YF-22 on-board payload has the ability to be configured for differentflight testing tasks on the field. To simplify the problem and for safety purposes,during some flight-tests only a subset of control surfaces were required to becontrolled by the on-board computer while the other channels remained in fullcontrol of the pilot. A digital channel selection module was necessary in theflight control software to perform this selection of the channels. A small data file called “Judgenum.dat” was stored on the computer’scompact flash card. This file provided a six-digit binary number deciding onwhich channel was selected. A relationship between the number and controlactivity is shown in Table 5-4. The digital channel selection software reads thisnumber at the initialization stage of the execution and saves into memory. In thisway, different flight tests using a different subset of control surfaces may beconfigured during a flight session in the field without recompiling the on-boardsoftware.

During the flight test, the digital channel selection software reads thecontrol switch signal (channel 14) from the DAQ software. Once channel 14 ishigh (5V), implying that the pilot turned the controller switch on, the digitalchannel selection will then start sending channel selection signal through theDigital Input/Output (DIO) port of the data acquisition card to the controllerboard. In this case, the channel pre-assigned will be activated and controlled bythe on-board computer while the pilot retains control of all other channels.

AFA Controller The structure of the AFA controller has been described with details inChapter 3. For the case of aileron failure, the control scheme in Figure 5-4 wasused and the control scheme in Figure 5-5 was designed to compensate theelevator failure.

96 Figure 5-4 Simulink Diagram for Aileron AFA Controller

Figure 5-5 Simulink Diagram for Elevator AFA Controller

The weights and thresholds of the pre-trained NNs were stored in a data file. TheAFA controller loads this file at the initialization stage of the execution and storesthe information into memory. The on-line learning of the NNs is then turned on

97only after the occurrence of the failure. According to the planning of theprocedure, once the pilot turned on the controller switch, the failure(aileron/elevator) occurs instantly. The pilot still has control on other channelsfor an additional four seconds. The NNs will start training instantly. The four-second-time delay was designed to avoid the initial high approximation error ofthe NN learning. After four seconds, the on-board controller takes over all of thecontrols and begins updating the feedback gains in the linear controller toaccommodate for the failure.

On-board Servo Calibration

The control command generated by the on-board AFA controller was indegrees, which were the desired deflection angle of each control surface, whilethe servo control module requires 8-bit digital signals (between 0-255) as inputs.Thus, the control commands need to be calibrated into a digital signal before feedinto the servo control module. The on-board servo calibration software loads thecalibration information (acquired with a ground servo calibration) at theinitialization stage of the execution and stores them in the memory. During theflight, it converts the control commands and sends the signals to the servo controlsoftware.

Servo Control The servo control block is the final stage of the flight control software. Itsends the calibrated control commands to the serial port. The servo controlmodule on the controller board will then convert this signal into multi-channelPulse Width Modulation (PWM) signal. Once the control switch is activated,these signals will be used for controlling the aircraft. The following six channelsare controlled independently on the aircraft: • Left Elevator; • Right Elevator; • Left Aileron; • Right Aileron;

98 • Left/Right Rudders (one signal); • Throttle. The on-board controller can have full control of the aircraft and have the capability of injecting the elevator and/or aileron failure.

5.4 – Calibration Software

In addition to the real-time flight control software, a set of supporting softwarewas also necessary for flight testing. One of the major categories is the aircraft groundcalibration software, which was essential for the accuracy and safety of the flight controlsystem. These include surface calibration software, servo calibration software and trimposition detection software. Each of these specific software schemes will now beoutlined.

5.4.1 Surface Calibration

The surface calibration software measures the relationship between the aircraft’smajor control surfaces and the potentiometers linked to them. In addition, the twopotentiometers in the nose probe were also calibrated with this software. Thisinformation was then used by the DAQ software to measure the actual deflection of eachcontrol surface and flow angles via potentiometers. In a surface calibration procedure, the operator moves each surface to the maximpositive deflection, zero deflection and the maximum negative deflection sequentially.The calibration software then measured the voltage output of each potentiometer with theDAQ card. These voltages were saved and used to calculate the gain/offset informationwith a linear fitting method.

5.4.2 Servo Calibration

Servo calibration software provides the information for the on-board controller toconvert control commands into actual surface deflections. The servo calibrationprocedure was designed to be performed after the surface calibration and it is fullyautomated. The software sends out servo control signal to each servo and scans thewhole range of the control surface travel. At the same time, the calibration software

99measures the deflection of each control surfaces and stores the servo commandaccordingly. The calibration results are then stored on the compact flash card to be usedby the control software.

5.4.3 Trim Position Detection

With the different configuration of the flight test, the trim positions for thedifferent aircraft control surfaces may change by small values. The trim positiondetection software was designed to find out the trim position of each control surface andthis information was provided to the on-board controller. During a trim positiondetection procedure, the operator turns on the R/C system and keeps all the controlsurface at the trim position of the previous flight. The calibration software will then readthese positions and store them in memory. Next, the servo control command was sent toeach servo to move the control surfaces through the entire deflection range. The positionthat matches the trim position was detected and the servo command at that moment wasstored in the file.

100 Chapter 6 Flight Testing

Flight testing was the most critical phase of this research work. The flight testingfacility is located at the WVU Jackson’s mill field about 60 miles south of Morgantown,WV. This facility was secluded from commercial and general aviation air trafficactivity; thus, perfectly suited for research flight testing activities. This facility features a3,200 feet long, 50 feet wide semi paved runway. In this chapter, details about flighttesting activities and final test results will be discussed.

6.1 – Flight Testing Phases

To meet the requirement of the controller design and guarantee aircraft safety, theflight testing activities for this project were divided into seven phases with different on-board hardware/software configurations and task requirements. Each of the individualphases will now be described in detail. Phase #1 Flight for Assessment of Handling Qualities The aircraft was flight tested in R/C mode only without any electronic payload. The objective was to evaluate the dynamic characteristics of the YF-22 research UAV, as well as determining the trim characteristics and the propulsion system performance. After the initial few flights, “dummy” payload weights were progressively added to the aircraft model; building up to a final weight configuration of an aircraft representing a full electronic payload. This allowed for an evaluation of the aircraft payload capability and handling qualities/performance at the standard operational flight test configuration. This phase of flight testing was completed within six flights and the pilot reported desirable aircraft handling qualities.

Phase #2 Data Acquisition Flights

After detailed evaluation of the aircraft dynamic characteristics, on-board instrumentation and computer equipment were then installed. The on-board computer collected flight data from all aircraft sensors and stored the information on a compact flash card for post-flight analysis. The purpose was to acquire flight

101data for parameter identification purposes and testing the following aircraftsubsystems: • Sensor systems; • OBC; • Data acquisition hardware/software; • On-board power system; • Aircraft EMIFor parameter identification purposes, to obtain an aircraft mathematic model, aset of dedicated PID maneuvers were performed: • Elevator doublets; • Aileron doublets; • Rudder doublets; • Aileron-rudder doublets combination.The linearized mathematic model of the aircraft used for the controller design,was then estimated from this set of flight data. In addition, the flight data wasalso used for training the AFA NNs. Sample data of aileron-rudder double combination and elevator doubletare shown in Figures 6-1 and 6-2. Sample data is from a flight-test on July 17th2003, specifically flight number #3. Figure 6-1 shows a typical aileron-rudderdoublet combo used to estimate the aircraft mathematic model for lateral-directional dynamics. Figure 6-2 shows typical elevator doublet used to estimatethe longitudinal mathematic model of the YF-22 aircraft. This phase of flighttesting was completed within three flights.

102 10 A ileron 5 Rudder

degree 0

-5

-10 586 587 588 589 590 591 592

10 B eta 5degree

-5

-10 586 587 588 589 590 591 592

50 P Rdegree/s ec

-50

586 587 588 589 590 591 592

tim e(s )

Figure 6-1 Flight Data Following Aileron-Rudder Doublet combination

103 10 E levator

degree 0

-10 561 561.5 562 562.5 563 563.5 564 564.5 565

10 A lpha degree

-10 561 561.5 562 562.5 563 563.5 564 564.5 565

50 Q degree/s ec

-50

561 561.5 562 562.5 563 563.5 564 564.5 565

tim e(s )

Figure 6-2 Flight Data Following Elevator Doublet

Phase #3 Data Acquisition Flights (with failure)

In this phase, additional on-board hardware/software for failure triggeringwere installed. To guarantee the safety of the aircraft, the “failure triggering”mechanism in the YF-22 on-board payload system was designed to be extremelyreliable. Two types of actuator failure were injected: aileron failure and elevatorfailure. In both modes, the right side of the actuators was locked at the trimposition while the rest of the control surfaces were manually controlled by theUAV pilot. The aircraft was under manual control for takeoff and landing. Thecommands for injecting and removing the failure mode were sent via the pilotwith the controller switch during a flight mission. No automatic controller wasinvolved during this stage of flight testing. Giving the criticality of the task, thepilot had to pay extra attention and release the failure situation once the aircraftfell into any unsafe conditions. A set of dedicated PID maneuvers was performed

104with the remaining control surfaces. The flight data files were then used for thefailure analysis, in both AFA NN training and AFA controller simulation. Thefailure trigger hardware/software was also fully tested during this stage andproved to be reliable. Sample data of right aileron failure is shown in Figure 6-3. Once thecontroller switch was active, the right aileron was locked at the trim position, andthe pilot had control of the left aileron. Sample data is from Oct 5th 2003 flight-test. This phase of flight testing was completed within two flights.

20 Left A ileron 10

-10

-20 0 100 200 300 400 500 600 700 800 900

20 Right A ileron 10

-10

-20 0 100 200 300 400 500 600 700 800 900

6 Control S witc h

4 V olt

0 0 100 200 300 400 500 600 700 800 900 tim e(s )

Figure 6-3 Aileron Deflection with Failure

105Phase #4 Linear Controller Flights (without failure) With the mathematic model acquired from Phase #2, a linear controllerwas designed to stabilize the aircraft at nominal flight conditions. The designedlinear controller was installed in the on-board computer. This was the first set oftesting where the pilot had no major control of the aircraft except for the enginethrottle. The pilot could regain the control of the plane at any moment during theflight by disengaging the controller switch. The goal for this phase was toevaluate the accuracy of the estimated mathematical model and validate the linearcontroller design. This provided a basis for the rest of the AFA controller design. Sample data collected from linear controller validation flights are shownin Figure 3-24 though 3-26. The designed linear controller showed a satisfactoryperformance to stabilize the aircraft at nominal flight condition without actuatorfailure (Section 3.4.3). This phase of flight testing was completed within fourflights and the linear controller designed exhibited desirable performance.

Phase #5 Linear Controller Flights (with failure)

In this phase, the same linear controller was installed on the on-boardcomputer along with the failure triggering software. Both types of failures weretested with the linear controller activated. The flight data was stored in thecompact flash card and were used to compare with final flight test data with theAFA controller. Sample data collected from this phase of flight testing were shown inFigure 3-29 though 3-30 for aileron failure and Figures 3-37 though 3-39 forelevator failure. From these plots, it can be concluded that the linear controllerdoes not have the ability to adapt to the failure condition and cannot maintain thehandling quality of the aircraft after the actuator failure (Section 3.5). Flighttesting activity for this phase was completed within four flights.

Phase #6 Aileron Failure with AFA Controller

This phase started after all the AFA software was simulated and fullyevaluated. The aircraft took off manually with the pilot control and the on-board

106controller off. Once the plane reached a safe altitude the pilot could activate thecontroller switch. The right aileron would then enter into the failure mode(locking at the trim position) instantly while the pilot retained control of all othercontrol surfaces for four seconds. The on-line learning NNs would begin trainingat the same time. During this period, the pilot was asked to perform aileronmaneuvers to help the NN learn about the lateral dynamics after failure. Afterfour seconds, the controller would take over all the rest control channels (exceptfor engine throttle) and begin updating the controller gain to accommodate for thefailure. This process was repeated several times during a flight test with the pilotdeciding to conclude the test and regain control instantly by using the controllerswitch. This phase of flight testing was completed within seven flights and theflight data collected will be presented in section 6.3.1.

Phase #7 Elevator Failure with AFA Controller

This phase shares basically the same procedures as Phase #6 but for thecase of elevator failure. Once the pilot activated the controller switch, the rightelevator would enter the failure mode (locked at a trim position) instantly and theon-board NNs would start training at the same time while the pilot retainedcontrol of the rest surfaces for four seconds. During this period the pilot wasasked to perform an elevator doublet to help the NN with longitudinal dynamicslearning. After four seconds, the controller would take over the remaining controlsurfaces and updating the feedback controller gain. The updated gain wouldincrease the controller’s ability to control the aircraft after failure and compensatefor the rolling moment caused by a single elevator failure. This phase of flight testing was completed within four flights and theflight data collected will be presented in Section 6.3.2. Details about the flighttesting procedure will be discussed in the next section.

1076.2 – Flight Testing Procedures The flight testing procedures typically included pre-flight preparations, in-flightprocedures, and post-flight data analysis. After several years of flight testing activities atWVU, the flight testing procedure have been refined and optimized to a very high degreeof reliability and efficiency.

6.2.1 Pre-flight Preparation

The “Pre-Flight Preparation” includes the following set of procedures: Aircraft mechanics are reviewed, including control surfaces, battery systems, landing gear, brakes, etc; Control surface calibration for each aircraft control surface to provide an accurate reading; Servo calibration for each servo to have an accurate control; DAQ system validation; Controller validation. The failure trigger mechanism and controller switch are tested prior to the flight operations; System start-up. Once the aircraft is on the runway, the vertical gyro is leveled before powering up the payload. After approximately three minutes (warm up time for the gyro), payload system is cleared for flight; R/C ground range check. To guarantee aircraft safety, ground testing of the R/C radio system with all the on-board payload system active (along with the propulsion systems) is found acceptable (>300 ft ground range with transmitter antenna fully retracted) for flight operations.

6.2.2 In-flight Procedures

In-flight procedures varied from task to task during the flight sessions dependingon the phase. The procedure for the final actuator failure accommodation tests will bediscussed in this section. In-flight procedures were designed to provide a safe and efficient way todemonstrate actuator failure accommodation control with the UAV test bed. Severalmajor difficulties were encountered during the flight tests:

108 Restricted airfield: flight tests were limited within the visual range since the aircraft was under manual control for takeoff and landing purposes. The aircraft’s on-board controller does not have the ability to automatically circle the airspace. Overall, the pilot had to engage and disengage each time the airplane reached a leg of the airspace. This limited the time available for each AFA controller engagement to be short, typically between 12-16 seconds, which are not long enough to finish a full-blown AFA test. Neural network training: the NN could not learn the aircraft’s dynamics efficiently under straight and level flight conditions. This issue is well known in the area of parameter identification. Aircraft control surface inputs were necessary to “excite” the vehicle dynamics. Wind gusts: since the UAV has only a 6.5 ft wing span, wind gust posed a major problem for on-line NN training. On average 5-10 mph winds are always present during a flight, leading to 20-40 deg/sec disturbances for roll rate measurements. This strong disturbance caused a very low signal/noise ratio and created a negative effect on updating the feedback gains.To solve or minimize the effect of these problems, special care was taken during thedesign of the flight procedure. Several flight procedures were tested and the final versionused for AFA test is shown in Figure 6-4.

109 Figure 6-4 In-flight Procedures

Within this procedure, the aircraft takes off manually with the ground control. Afterreaching the desired flight condition (about 150m high and 40m/s), the pilot begins toactivate the controller switch. The actuator failure triggers instantly with the on-linelearning NN training from real-time flight data. The pilot remains in control of all othercontrol surfaces for four seconds. During this period, the pilot can then perform certainmaneuvers (i.e. aileron doublets, elevator doublets, etc) to excite the aircraft dynamics.The controller feedback gain will not be updated during the maneuver. After four seconds, the AFA controller will take over aircraft control. The NNtraining will then be deactivated. The feedback controller gain will be updated with theestimation from both the on-line and off-line learning NNs. The reason the NN learningis not active at the same time as feedback controller gain updating is due to thedisturbance of wind gusts. With the existence of high disturbance, the estimation of theNN would then be affected during the training process. This effect is much lessnoticeable while the NN has not been training at the same time; this is because the NNacts as an integrator. A sine-wave pattern command was feed into the controller at thisstage of the flight testing to simulate the human pilot input. This would help exciting thedynamics of the aircraft for feedback gain updating and provide a way to validate thecontroller performance during the post-flight data analysis.

110 Once the aircraft reaches the end of the flight field, the pilot can turn thecontroller switch off, turn the aircraft manually and reset for the next engagement. Thisprocess is then repeated several times throughout the flight test mission. The on-linelearning NN and linear feedback controller gain are then updated from the previousvalues. In this way, the actuator failure accommodation test can be divided into severalrelatively small time-slots but still can have enough total time to complete the task athand. A drawing of a typical flight pattern is shown in Figure 6-5.

Figure 6-5 Flight Path

During the flight test, if anything abnormal happens to the aircraft, the pilotswitches back to manual control using the controller switch on the transmitter. Once themission tasks have been completed or a pre-defined flight time was reached, the pilotbegins the landing procedures. During this time, the controller switch will be turned offand the aircraft landed under manual control. This procedure was used for the final phaseof AFA flight-test with successful results.

6.3 – Final Test Results

With all early phases of the flight testing been completed and all the AFAcontroller been fully simulated, flight testing progressed towards final actuator failureaccommodation tests in 2004 flight season. A selection of flight data collected from bothaileron failure and elevator failure AFA tests will be presented in section 6.3.1 and 6.3.2.

6.3.1 Aileron Failure AFA Test

Figures 6-6 though 6-15 show the flight data collected from the aileron failureAFA test on Oct. 06th, 2004 flight testing session. The ground temperature wasapproximately 70 °F with less than 5 mph wind. The aircraft was launched fully fueled ataround 4:30pm. The total flight duration was 600 seconds; the controller switch wasactivated 19 times during the flight. The total duration of controller switch activation(w/aileron failure) was 228.28 seconds. The total time of on-line NN training was 76seconds and total time for controller gain updating was 133.28 seconds. After eachactivation of the AFA controller, the aircraft software was designed to track a sine-waveroll rate pattern. A full view of the aileron commands and controller switch activation isshown in Figure 6-6. Once the controller switch was activated, the right aileron waslocked at the trim position.

112 20

Left Aileron(deg) 0

-20 0 100 200 300 400 500 600 700 800 900 20 Right Aileron(deg)

-20 0 100 200 300 400 500 600 700 800 900 6 Control Switch(v)

0 0 100 200 300 400 500 600 700 800 900 Time(s)

Figure 6-6 Aileron Inputs

Both the on-line and off-line NN were pre-trained using previous flight datawithout a failure. The goal of the training was to approximate the lateral-directionaldynamics of the aircraft under typical flight conditions. During the flight testing, the on-line NN was trained to approximate the lateral-directional aircraft dynamics after failure.The difference between the outputs of both NNs was used by the AFA controller to tunethe roll rate feedback controller gain. The learning rate for the on-line learning NN wasset at 0.2 and the learning rate for the roll rate feedback gain updating was set at 5.0e-5.The roll rate feedback gain, starting from 0.04, and gradually increased until the valuestabilized at 0.0732 shown in Figure 6-7.

113 0.08

0.07 Feedback Gain 0.06

0.05

0.04

0.03 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 4 x 10 5 Control Switch(v)

0 0 100 200 300 400 500 600 700 800 900 Time(s)

Figure 6-7 Roll Rate Feedback Gain

For a more detailed understanding of the NN learning and gain updating

procedure, the flight data was fed into the simulator to playback the actual response of theNN outputs during the flight. Figure 6-8 illustrates the NN estimations and the gainupdating process from the 10th activation (429.10-442.42s). Estimates of the on-linelearning NN are shown with the solid line. The dot line refers to the reference estimationfrom the off-line learning NN. During the first four seconds, after the controller wasactivated, the on-line learning NN was trained with the real-time flight data. Theestimation of the on-line learning NN was affected by the wind gust at this moment andcould not be used to update the controller gain. After four seconds, the on-line learningwas turned off and the estimation difference between the on-line and off-line NN wasused to update the roll rate feedback gain. The difference between the two estimationswas limited but large enough to update the value of the gain. The roll rate feedback gainstarting from 0.0539 at the beginning of this activation had been increased to 0.0584 atthe end.

114 50 On-line learning NN Off-line learning NN

P (deg/sec) 0

-50

428 430 432 434 436 438 440 442 444

0.06

0.058 Gain

0.056

0.054 P Feedback Gain 0.052 428 430 432 434 436 438 440 442 444

6 Control Switch(v)

Controller Switch 4

0 428 430 432 434 436 438 440 442 444 time(s)

Figure 6-8 NN Approximations

Figure 6-9 shows the left aileron input and the roll rate response for the firstactivation (194.72- 207.42s) while the AFA controller just started to compensate for thefailure. The red circles indicate the four sec mark and where the AFA controller wasactivated after the mark. Figure 6-10 shows the same signals during the last activation(664.60- 675.14s) - which was 19th for this particular flight – where the AFA controlleralmost finished the feedback gain updating process and provided a best possibleaccommodation for the right aileron failure.

Figure 6-10 Roll Rate Response (Last Failure Activation)

116 To facilitate a comparison, the aileron input and the roll rate response of the firstand 19th activation had been put side by side in Figures 6-11 and 6-12 (data shown areafter the AFA controller was activated)

4 First Activation Last Activation 3

1 Left Aileron(deg)

-1

-2

-3

-4 669 670 671 672 673 674 675 Time(s)

Figure 6-11 Aileron Control Inputs

117 25 First Activation 20 Last Activation

15

10

5 P (deg/sec)

-5

-10

-15

-20

-25 669 670 671 672 673 674 675 Time(s)

Figure 6-12 Roll Rate Response

It is clearly shown that with the on-line NN learning, and the updated AFAfeedback gain, the control command on the left aileron was increased and the roll rateresponse shown improvements. To quantify the process of actuator failureaccommodation, statistic methods were used to analyze the flight data. The STandardDeviation (STD) of the left aileron deflection and the roll rate response of each controllerswitch activation are shown in Table 6-1:

to cover most of the flight data after the AFA controller been activated. To facilitate thedata analysis procedure, the STD values in Table 6-1 were plotted in Matlab, which isshown in Figure 6-13.

119 2 Left Aileron (STD) 1.8

1.6

deg 1.4

1.2

1 0 2 4 6 8 10 12 14 16 18 20

12 P (STD)

10 deg/sec

6 0 2 4 6 8 10 12 14 16 18 20 Controller Activation

Figure 6-13 Statistical Analysis – Aileron Failure

With the NN on-line learning, the designed AFA controller gradually increased the leftaileron control command to compensate for the loss of right aileron. In this way, thedesigned AFA controller effectively reduced the negative effect caused by the rightaileron failure and improved the aircraft’s dynamic response. A performance comparison was performed with three flight conditions: Linear controller at nominal flight condition (no aileron failure) Linear controller with right aileron failure AFA controller with right aileron failureFlight data collected from flight testing Phase 4 and Phase 5 was used in this comparison.The left aileron deflections for three scenarios are shown in Figure 6-14 and thecorresponding roll rate responses are shown in Figure 6-15.

Figure 6-14 Performance Comparison – Left Aileron

Figure 6-15 Performance Comparison – Roll Rate

121With the AFA controller activated, the left aileron control command had been increasedgreatly compared with the linear controller command. Due to the existence of wind gustdisturbance, the performance difference on the roll rate response was hard to comparefrom the plot directly. The STD of the roll rate response was calculated and listed inTable 6-2:

Linear Controller Linear Controller AFA Controller

With these values, it is clearly shown that the designed AFA controller provided animproved performance over the linear controller under right aileron failure condition andis close to the linear controller performance under the normal flight condition.

6.3.2 Elevator Failure AFA Test

Figures 6-16 though 6-31 shows the flight data collected from the elevator failureAFA test on a Sep.1st 2004 flight testing session. The ground temperature was about 80°F with less than 5 mph wind speed. The aircraft was launched at around 6:30pm withfull tanks of fuel. The total flight duration was 523secs; for which the controller switchwas activated 20 times during the flight. The total duration of controller switchactivation (w/elevator failure) was 226.9 seconds. The total time of on-line NN trainingwas 80 seconds and the total time for updating the controller gain was 126.9 seconds.For each activation of the AFA controller, the aircraft was designed to track a sine-wavepitch rate pattern. A full view of the elevator commands and the controller switchactivation is shown in Figure 6-16. Once the controller switch was activated, the rightelevator was locked at the trim position.

122 Left Elevator(deg) 20

10

-10 0 100 200 300 400 500 600 700 800 900 Right Elevator(deg)

20

10

-10 0 100 200 300 400 500 600 700 800 900 6 Control Switch(v)

0 0 100 200 300 400 500 600 700 800 900 Time(s)

Figure 6-16 Elevator Inputs

Both the on-line and off-line full NN were pre-trained with a previous flight data withoutfailure. The goal was to approximate the dynamics of the aircraft under nominal flightcondition. A NN to approximate the lateral-directional dynamics was also used in thecontroller, which was the same one for the aileron failure AFA test to provide a fullydecoupled lateral-directional estimation. During the flight testing, the on-line full NNwas trained to approximate the aircraft dynamics after the failure. The estimationdifference between the outputs of both full NNs was used by the AFA controller to adjustthe pitch rate feedback controller gain. The learning rate for the on-line learning full NNwas 0.2 and the learning rate for the pitch rate feedback gain updating was 2.0e-4. Thepitch rate feedback gain, starting from 0.12, was gradually increased until stopped at0.1757. The roll rate estimation difference between the on-line learning full NN and off-line learning lateral-directional NN was used by the controller to compensate for thecoupling between the elevator input and lateral dynamics. The learning rate for thedecoupling gain updating was 2.0e-4. The decoupling gain, starting from 0, wasgradually increased until stabilizing at a value of 0.3711 (Figure 6-17).

123 0.2

Q Feedback Gain 0.15

0.1 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 0.5 4 x 10 Decoupling Gain

-0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 6 4 Control Switch(v)

x 10

0 0 100 200 300 400 500 600 700 800 900 Time(s)

Figure 6-17 Feedback Gains

The learning process again, is demonstrated with the playback of the actual NNresponses during the flight. Figures 6-18 and 6-19 illustrate the NN estimations and thegain updating process for the 11th activation (434.66-447.02). The estimation from theon-line learning NN is shown with a solid line and a dotted line refers to referenceestimation from the off-line learning NN. During the first four seconds, the on-linelearning NN was trained with the real-time flight data. The estimation of the on-linelearning NN is affected by the wind gust at this moment and was not used to update thecontroller gain. After four seconds, the on-line learning was deactivated and theestimation difference between the on-line and off-line NN was used to update thefeedback controller gains. The pitch rate feedback gain starting from 0.1352 at thebeginning of this activation and increased to a value of 0.1399 at the end (Figure 6-18).The roll-rate estimation difference from the on-line full NN observer and the off-linelateral-directional NN observer was used to update the decoupling feedback control gain.This decoupling gain was increased from 0.2222 to 0.2613 during this period (Figure 6-19).

124 40 On-line learning NN 20

Q (deg/sec) Off-line learning NN

-20

-40 434 436 438 440 442 444 446 448

0.14

0.138Gain

0.136 Q Feedback Gain

434 436 438 440 442 444 446 448

5 Control Switch(v)

Controller Switch 4 3 2 1 0 434 436 438 440 442 444 446 448 time(s)

Figure 6-18 Pitch Rate Estimations

125 50 On-line learning NN Off-line learning NN

P (deg/sec) 0

-50

434 436 438 440 442 444 446 448

0.26 Gain

0.24

Decoupling Gain 0.22 434 436 438 440 442 444 446 448

5 Control Switch(v)

Controller Switch 4 3 2 1 0 434 436 438 440 442 444 446 448 time(s)

Figure 6-19 Roll Rate Estimations

Figure 6-20 shows the left elevator input, the roll rate response, the pitch rateresponse, and the angle of attack during the first activation (211.72- 224.78s) while theAFA controller just started to compensate for the failure. The circle indicates the four secmark and the AFA controller was engaged after the mark. Figure 6-21 shows the samesignals during the last (20th) activation (634.18- 644.98s), where the AFA controlleralmost finished the feedback gain updating process and provided a best possibleaccommodation for the right elevator failure.

Figure 6-21 Aircraft Response (Last Failure Activation)

Again, to make it easier to compare, the elevator input and pitch rate response ofthe first and 20th activation were plotted side by side in Figures 6-22 and 6-23 (data afterthe 4sec mark). The aileron inputs and roll rate response of the first and 20th activationwere also plotted in Figures 6-24 and 6-25.

128 6 First Activation Last Activation 4

2 Left Elevator(deg)

-2

-4

-6 639 640 641 642 643 644 Time(s)

Figure 6-22 Left Elevator Deflections

15 First Activation Last Activation 10

5Q (deg/sec)

-5

-10

-15 639 640 641 642 643 644 Time(s)

Figure 6-23 Pitch Rate

129 4 First Activation Last Activation 3

1 Aileron(deg)

-1

-2

-3

-4 639 640 641 642 643 644 Time(s)

Figure 6-24 Aileron Deflections

20 First Activation Last Activation 15

10

5P (deg/sec)

-5

-10

-15

-20 639 640 641 642 643 644 Time(s)

Figure 6-25 Roll Rate

130 From these flight data, it is clearly shown that with the on-line NN learning andthe updated AFA controller feedback gain, the control command on the left elevator hadbeen increased to achieve an improved pitch rate response. The aileron inputs, starting atzero, were increased to compensate for the rolling moment caused by the single leftelevator input. Figure 6-25 shows that with the AFA controller’s compensation, theelevator inputs caused almost no response (fully compensated) on the aircraft lateraldynamics at the 20th controller engagement. To further analysis the AFA controlleraccommodation process, the standard deviation of the left elevator deflection, ailerondeflection, pitch rate and roll rate response of each controller switch activation are shownin Table 6-3:

131Each of the STD value was calculated with 4 seconds of flight data after the actuatorfailure, which is the same time window as the one used for aileron failure analysis. Notethat the second controller switch activation lasted only for 7.06 seconds, which does notcontain enough information for analysis. This data point was abandoned in the analyzingprocedure. STD values from Table 6-3 were plotted in Matlab to facilitate the data analysis.Figure 6-26 shows the STD for the left elevator deflection and the pitch rate response,and Figure 6-27 shows the STD for the left aileron deflection and the roll rate response.

3.2 Left Elevator (STD) 3

2.8 deg

2.6

2.4

2.2 0 2 4 6 8 10 12 14 16 18 20

6.5 Q (STD) 6 deg/sec

5.5

4.5

4 0 2 4 6 8 10 12 14 16 18 20 Controller Activation

Figure 6-26 Elevator Failure Statistical Analysis –Longitudinal

132 1.5 Aileron (STD)

1 deg

0.5

0 0 2 4 6 8 10 12 14 16 18 20

8 P (STD) 6 deg/sec

0 0 2 4 6 8 10 12 14 16 18 20 Controller Activation

Figure 6-27 Elevator Failure Statistical Analysis –Lateral

From these plots, it can be observed that: with the NN on-line learning, thedesigned AFA controller gradually increased the left elevator control command tocompensate for the loss of right elevator. At the same time, the aileron command wasincreased to compensate for the rolling moment caused by the left elevator deflection. Inthis way, the designed AFA controller accommodated for the negative effect caused bythe right elevator failure and improved aircraft handling qualities. A performance comparison was also performed with three flight conditions: Linear controller at nominal flight condition (no elevator failure) Linear controller with right elevator failure AFA controller with right elevator failure Flight data collected from flight testing Phase 4 and Phase 5 was used in thiscomparison. The left elevator deflections for three scenarios are shown in Figure 6-28and the corresponding pitch rate responses are shown in Figure 6-29. The ailerondeflections are shown in Figure 6-30; with aircraft roll rate responses shown in Figure 6-31.

Figure 6-30 Performance Comparison – Left Aileron

Figure 6-31 Performance Comparison – Roll Rate

135With the AFA controller been activated, the left elevator control command had beenincreased greatly compared to the linear controller commands. Control commands werealso sent to ailerons to cancel out the coupling between the single left elevator deflectionand aircraft lateral dynamics. The STD of the left aileron deflection, pitch rate response,left aileron deflection, and roll rate response are listed in Table 6-4:

From these plots and calculated STD values, it is clearly shown that the AFA controllerimproved the aircraft’s pitch rate response and canceled out the rolling moment causedby one side elevator. In this way, the designed AFA controller compensated for theelevator failure and provided a performance very close to the linear controller under thenormal flight condition.

136 Chapter 7 Conclusions and Recommendations

This project successfully designed, implemented, and flight-tested an AFA

control scheme which can compensate for an aircraft with actuator failure. Two-failurescenarios were studied, simulated and flight-tested: Failure 1: Right aileron locked at the trim position Failure 2: Right elevator locked at the trim position.Neural networks were selected in the controller design for their learning ability andnonlinearity. An actuator failure accommodation controller scheme was designed anddeveloped. On-board hardware and software were tailored to implement the AFAcontroller scheme into the WVU YF-22 research UAVs. A set of flight tests from aircraftassessment, data acquisition, failure analysis, to a final demonstration of the AFA controlscheme had been successfully completed. The flight testing data shows a satisfactoryperformance of the AFA controller matching the results of simulation study. From this research effort, further work with the actuator failure accommodationcould be pursued in several ways. With caution, different configurations of actuatorfailures could be tested including the locking of one control surface at positions otherthan the trim. Different types of NN learning algorithms could be tested to minimize thelearning procedure. However, this type of study will have a much higher requirement onthe on-board computer’s CPU speed. Additional research may also be pursued towardscreating a more robust system to handle wind gust disturbances, which was a majordifficulty for flight testing a NN-based controller on a small UAV. Furthermore, thestability analysis and validation of the control system posts a large challenge, which is acommon and widely recognized problem in the NN control community,