Fault Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed

Unmanned Aerial Vehicles (UAVs) are gaining more and more attention during the last few years due to their important contributions and cost-effective applications in several tasks such as surveillance, search and rescue missions, geographic studies, as well as various military and security applications. Due to the requirements of autonomous flight under different flight conditions without a pilot onboard, control of UAV flight is much more challenging compared with manned aerial vehicles since all operations have to be carried out by the automated flight control, navigation and guidance algorithms embedded on the onboard flight microcomputer/microcontroller or with limited interference by a ground pilot if needed.


Introduction
Unmanned Aerial Vehicles (UAVs) are gaining more and more attention during the last few years due to their important contributions and cost-effective applications in several tasks such as surveillance, search and rescue missions, geographic studies, as well as various military and security applications.Due to the requirements of autonomous flight under different flight conditions without a pilot onboard, control of UAV flight is much more challenging compared with manned aerial vehicles since all operations have to be carried out by the automated flight control, navigation and guidance algorithms embedded on the onboard flight microcomputer/microcontroller or with limited interference by a ground pilot if needed.
As an example of UAV systems, the quadrotor helicopter is relatively a simple, affordable and easy to fly system and thus it has been widely used to develop, implement and test-fly methods in control, fault diagnosis, fault tolerant control as well as multi-agent based technologies in formation flight, cooperative control, distributed control, mobile wireless networks and communications.Some theoretical works consider the problems of control (Dierks & Jagannathan, 2008), formation flight (Dierks & Jagannathan, 2009) and fault diagnosis (Nguyen et al., 2009;Rafaralahy et al., 2008) of the quadrotor UAV.However, few research laboratories are carrying out advanced theoretical and experimental works on the system.Among others, one may cite for example, the UAV SWARM health management project of the Aerospace Controls Laboratory at MIT (SWARM, 2011), the Stanford Testbed of Autonomous Rotorcraft for Multi-Agent Control (STARMAC) project (STARMAC, 2011) and the Micro Autonomous Systems Technologies (MAST) project (MAST, 2011).
A team of researchers at the Department of Mechanical and Industrial Engineering of Concordia University, with the financial support from NSERC (Natural Sciences and Engineering Research Council of Canada) through a Strategic Project Grant and a Discovery Project Grant and three Canadian-based industrial partners (Quanser Inc., Opal-RT Technologies Inc., and Numerica Technologies Inc.) as well as Defence Research and Development Canada (DRDC) and Laval University, have been working on a research and development project on fault-tolerant and cooperative control of multiple UAVs since 2007 (see the Networked Autonomous Vehicles laboratory (NAV, 2011)).In addition to the work that has been carried out for the multi-vehicles case, many fault-tolerant control (FTC) strategies have been developed and applied to the single vehicle quadrotor helicopter UAV system.The objective is to consider actuator faults and to propose FTC methods to 2 Will-be-set-by-IN-TECH accommodate as much as possible the fault effects on the system performance.The proposed methods have been tested either in simulation, experimental or both frameworks where the experimental implementation has been carried out using a cutting-edge quadrotor UAV testbed known also as Qball-X4.The developed approaches include the Gain-Scheduled PID (GS-PID), Model Reference Adaptive Control (MRAC), Sliding Mode Control (SMC), Backstepping Control (BSC), Model Predictive Control (MPC) and Flatness-based Trajectory Planning/Re-planning (FTPR), etc.Some of these methods require an information about the time of occurrence, the location and the amplitude of faults whereas others do not.In the former case, a fault detection and diagnosis (FDD) module is needed to detect, isolate and identify the faults which occurred.
Table 1 summarizes the main fault-tolerant control methodologies that have been developed and applied to the quadrotor helicopter UAV.The table shows which methods require an FDD scheme and whether they have been tested in simulation or experimentally.In the case of experimental application, one can also distinguish between two categories of faults: a simulated fault and a real damage.In the first case, a fault has been generated in an actuator by multiplying its control input by a gain smaller than one, thus simulating a loss in the control effectiveness.In the second case, the fault/damage has been introduced by breaking the tip of a propeller of the Qball-X4 UAV during flight.
Strategy Passive/Active Need for FDD Simulation Experiment Real damage Table 1.Fault-tolerant control methods (Note: ( ) Yes/Done; (X) No/Not done yet).
These methods will be discussed in the subsequent sections.The remainder of this chapter is then organized as follows.Section 2 introduces the quadrotor UAV system that is used as a testbed for the proposed methods.Section 3 presents the FTC methods summarized in Table 1.The simulation as well as the experimental flight results are given and discussed in Section 4. Some concluding remarks together with future work are finally given.Note that due to space consideration, only some of the developed control methods will be included in this chapter.Interested readers can refer to the website of the NAV Lab on 'http://users.encs.concordia.ca/~ymzhang/UAVs.htm' for more information.

Description and dynamics of the quadrotor UAV system
The quadrotor UAV of the Department of Mechanical and Industrial Engineering of Concordia University is the Qball-X4 testbed (Figure 1(a)) developed by Quanser Consulting Inc.The quadrotor UAV is enclosed within a protective carbon fiber round cage (therefore a name of Qball-X4) to ensure safe operation of the vehicle and protection to the personnel who is working with the vehicle in an indoor research and development environment.It uses • The second part is the geometry that relates the generated thrusts to the applied lift and torques to the system.This geometry corresponds to the position and orientation of the propellers with respect to the system's center of mass.• The third part is the dynamics that relate the applied lift and torques to the position (P), velocity (V) and acceleration (A) of the Qball-X4.
The subsequent sections describe the corresponding mathematical model for each of the blocks of Figure 2.

Qball-X4 dynamics
The Qball-X4 dynamics in a hybrid coordinate system are given hereafter where the position dynamics are expressed in the inertial frame and the angular dynamics are expressed in the body frame (Bresciani, 2008): where x, y and z are the coordinates of the quadrotor UAV center of mass in the inertial frame.m is the system mass and J x , J y and J z are the moments of inertia along y, x and z directions respectively.θ, φ and ψ are the pitch, roll and yaw Euler angles and p, q and r are the angular velocities in the body-fixed frame.k x , k y , k z , k p , k q and k r are drag coefficients and are constant.J T is the moment of inertia for each motor and Ω is the overall speed of propellers: where Ω i is the i th propeller speed.
The angular velocities in the inertial frame (Euler rates) can be related to those in the body frame as follows: Close to hovering conditions, the matrix in the above equation is close to identity matrix and therefore the angular velocities in the body frame can be seen as the angular velocities in the inertial frame.The model (1) can then be written as: where u p , u q , u r , k p , k q and k r have been respectively changed to u θ , u φ , u ψ , k θ , k φ , k ψ for notation convenience.At low speeds, one can obtain a simplified nonlinear model of (4) by neglecting drag terms and gyroscopic and Coriolis-centripetal effects: A further simplified linear model can be obtained by assuming hovering conditions (u z ≈ mg in the x and y directions) with no yawing (ψ = 0) and small roll and pitch angles as follows: The nonlinear model (4) will be used later on in the design of fault-tolerant control strategies such as the BSC, the MPC and the SMC.The simplified model ( 6) will be used for the MRAC design as well as for the trajectory planning and re-planning approach.

ESCs, motors and propellers
The motors of the Qball-X4 are outrunner brushless motors.The generated thrust T i of the i th motor is related to the i th PWM input u i by a first-order linear transfer function: where K is a positive gain and ω is the motor bandwidth.K and ω are theoretically the same for the four motors but this may not be the case in practice and therefore, this can be one of sources of modeling errors/uncertainties for fault-tolerant control design and trajectory planning/re-planning.

Geometry
A schematic representation of the Qball-X4 is given in Figure 1(b).The motors and propellers are configured in such a way that the back and front (1 and 2) motors spin clockwise and the left and right (3 and 4) spin counter-clockwise.Each motor is located at a distance L from the center of mass o and when spinning, a motor produces a torque τ i .The origin of the body-fixed frame is the system's center of mass o with the x-axis pointing from back to front and the y-axis pointing from right to left.The thrust T i generated by the i th propeller is always pointing upward in the z-direction in parallel to the motor's rotation axis.The thrusts T i and 123 Fault Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.comthe torques τ i result in a lift in the z-direction (body-fixed frame) and torques about the x, y and z axis.The relation between the lift/torques and the thrusts is: The torque τ i produced by the i th motor is directly related to the thrust T i via the relation of τ i = K ψ T i with K ψ as a constant.In addition, by setting T i ≈ Ku i from ( 7), the relation (8) reads: where u z is the total lift generated by the four propellers and applied to the quadrotor UAV in the z-direction (body-fixed frame).u θ , u φ and u ψ are respectively the applied torques in θ, φ and ψ directions (see Figure 1(b)).

Fault-tolerant control algorithms
Modern technological systems rely on sophisticated control systems to replace or reduce the intervention of human operators.In the event of malfunctions in actuators, sensors or other system components, a conventional feedback control design may result in an unsatisfactory performance or even instability of the controlled system.To prevent such situations, new control approaches have been developed in order to tolerate component malfunctions while maintaining desirable stability and performance properties.This is particularly important for safety-critical systems, such as aircrafts, spacecrafts, nuclear power plants, and chemical plants processing hazardous materials.In such systems, the consequences of a minor fault in a system component can be catastrophic.It is necessary then to design control systems which are capable of tolerating potential faults in these systems in order to improve the reliability and availability while providing a desirable performance.These types of control systems are often known as fault-tolerant control systems (FTCS).More precisely, FTCS are control systems which possess the ability to accommodate component failures automatically.They are capable of maintaining overall system stability and acceptable performance in the event of such failures (Zhang & Jiang, 2008).
Generally speaking, FTCS can be classified into two types: passive (PFTCS) and active (AFTCS).In PFTCS, controllers are fixed and are designed to be robust against a class of presumed faults.This approach needs neither FDD schemes nor controller reconfiguration, but it has limited fault-tolerant capabilities.In contrast to PFTCS, AFTCS react to the system component failures actively by reconfiguring control actions so that the stability and acceptable performance of the entire system can be maintained (Zhang & Jiang, 2008).
An overall structure of a typical AFTCS is shown in Figure 3.In the FDD module, faults must be detected and isolated as quickly as possible, and fault parameters, system 124 Automatic Flight Control Systems -Latest Developments www.intechopen.comstate/output variables, and post-fault system models need to be estimated on-line in real-time.Based on the on-line information on the post-fault system model, the controller must be automatically reconfigured to maintain stability, desired dynamic performance and steady-state performance.To avoid potential actuator saturation and to take into consideration the degraded performance after fault occurrence, a command/reference governor may also need to be designed to adjust command input or reference trajectory automatically.Interested readers about FTCS may refer to the bibliographical review (Zhang & Jiang, 2008) and the recently published books (Noura et al., 2009) and (Edwards et al., 2010).Fig. 3.A general structure of AFTCS (Zhang & Jiang, 2008).
The subsequent sections consider some of the FTC methods that have been developed for the quadrotor UAV.Some of these are classified as passive FTC methods where the fault tolerance is achieved thanks to the controller's robustness without changing the controller gains.Others are active FTC methods where control gains are updated in function of the occurring faults.

Gain-scheduled PID (GS-PID)
The Proportional-Integral-Derivative (PID) controller is the most widely used among controllers in industry.This is due to its unique features such as the simple structure, the ease of use and tunning.Its main advantages over other control strategies is that it does not require a mathematical model of the process/system to be controlled and thus allows to save time and effort by skipping the modeling phase.PID controllers are reliable and can be used for linear and nonlinear systems with certain level of robustness to model uncertainties and disturbances.Although one single PID controller can handle a wide range of system nonlinearities, better performance can be obtained when using multiple PIDs to cover the entire operation range of a nonlinear process/system.This is known as gain-scheduled PID (GS-PID) (Sadeghzadeh et al., 2011).
The operating principle of GS-PID is shown in Figure 4(a) where the controlled system may have varying dynamic properties as for example a varying gain (Haugen, 2004).The adjustment/scheduling of the PID controller gains is performed by using a gain scheduling variable GS.This is some measured process variable which at every instant of time expresses or represents the dynamic properties of the process.

125
Fault Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com

Sensor
Adjustment mechanism

Sensor
Adjustment mechanism

PID
(a) Operating principle of GS-PID

Linear interpolation
Piecewise constant value Linear interpolation Piecewise constant value (b) Constant and linear interpolation Fig. 4. The operating principle of GS-PID and two rules for the interpolation of the proportional gain K p .
There are several ways to express the PID parameters as functions of the GS variable such as the piecewise constant controller parameters and the piecewise interpolation.In the former method, an interval is defined around each GS value and the controller parameters are kept constant as long as the GS value is within the interval (see Figure 4(b) for an example of the proportional gain K p ).When the GS variable changes from one interval to another, the controller parameters are changed abruptly (Haugen, 2004).The same idea applies for the Integrator and Derivative gains.In the second method also shown in Figure 4(b), a linear function is found relating the controller parameter (output variable) and the GS variable (input variable).For the proportional gain, the linear function is of the form K p = aGS + b where a and b are two constants to be calculated.
Since faults can be seen as varying parameters, GS-PID can also be used to deal with possible fault conditions that may take place in the actuators or the system components.Some research works consider this problem: a GS-PID control strategy is proposed in (Bani Milhim, 2010a) and (Bani Milhim et al., 2010b) in simulation framework to achieve fault-tolerant control for the quadrotor helicopter UAV in the presence of actuator faults.In (Johnson et al., 2010), the authors investigate this technique for a Georgia Tech Twinstar fixed-wing research vehicle in the presence of partial damage of the wing.As continuation of the work presented in (Bani Milhim et al., 2010b), GS-PID has been considered for further investigation and most importantly for experimental implementation and application to the Qball-X4 UAV testbed for fault-tolerant trajectory tracking control (Sadeghzadeh et al., 2011).The GS-PID has been implemented for different sections of the entire flight envelope by properly tuning the PID controller gains for both normal and fault conditions.A set of PID controllers is then designed for the fault-free situation and each possible fault situation.The switching from one PID to another is then based on the actuator's health status (hence, the scheduling variable GS is the actuator's health status).A Fault Detection and Diagnosis (FDD) scheme is then needed to provide the time of fault occurrence as well as the location and the magnitude of the fault during the flight.Based on the information provided by the FDD module, the GS-PID controller will switch the controller gains under normal flight conditions to the pre-tuned and fault-related gains to handle the faults during the flight of the UAV.One of the main issues to consider in GS-PID is how fast to switch from the nominal PID gains to the pre-tuned fault-related gains after fault occurrence.This issue does not represent a problem when the scheduling variable GS is a measured variable since in most cases it is instantaneously provided by the sensors.However, when the GS is the health status of the actuators then 126 Automatic Flight Control Systems -Latest Developments www.intechopen.comclearly, the switching time and gains depend on how fast and precise the FDD module is in detecting, isolating and identifying the faults.It is shown in Section 4 and through experimentations how the switching time affects the behavior of the system in handling the occurring faults.

Model reference adaptive control (MRAC)
Many adaptive control techniques for preserving stability have been proposed to deal with disturbances, unmodeled dynamics and time delays.Particularly, the concept of model reference adaptive control (MRAC) has gained significant attention and is now part of many standard textbooks on nonlinear and adaptive control.Two basic approaches for MRAC can be distinguished: the direct and the indirect approaches.In the direct method, the controller parameters are adjusted based on the error between the reference model describing the desired dynamics and the closed-loop dynamics of the physical plant.In the indirect approach, the parameters of the plant are estimated by updating them based on the identification error between the measured states and those provided by the estimation model.In this work, three MRAC techniques are implemented and applied to the Qball-X4, namely the MIT rule-based MRAC, the conventional MRAC and the modified MRAC (Chamseddine et al., 2011a).

MIT rule
This MRAC approach has been developed around 1960 at the Massachusetts Institute of Technology (MIT) for aerospace applications (Ioannou & Sun, 1995).For illustration, consider the plant: ÿ(t)=−a 1 ẏ(t) − a 2 y(t)+bu(t) (10) where a 1 , a 2 and b are the unknown plant parameters.The reference model to be matched by the closed-loop plant is: where r(t) is the reference command and a m i (i = 1, 2, 3) and b m are constant and are chosen according to performance specifications.Let the control input u(t) be defined as follows: By replacing ( 12) in ( 10) and differentiating with respect to time, one obtains: It is obvious that one can achieve perfect model following if k 1 , k 2 and k 3 are chosen such that: The control signal given by ( 12) cannot be implemented since the system parameters a 1 , a 2 and b are assumed to be unknown.Nevertheless, one can use the following: where ki are the estimates of k i and are updated according to the MIT rule.The objective of the MIT rule is to adjust the parameters k 1 , k 2 and k 3 so as to minimize a cost function J.This cost function can be chosen for example as follows: where e is the tracking error between the system and the reference model, i.e. e = y − y m .I ti s reasonable to adjust the parameters in the direction of the negative gradient of J: where γ > 0 is the adaptation rate.∂e/∂ ki is called the sensitivity derivative of the system and is evaluated under the assumption that ki varies slowly.To calculate ∂y/∂ ki in ( 17) one can use ( 13) to obtain: With the assumption that the rate of adaptation is slow, i.e. ki are small and the changes of y (3) , ÿ and y with respect to k1 , k2 and k3 are also small, one can interchange the order of differentiation to obtain: These latter equations can be written as: where p is the differential operator.Because a 1 , a 2 and b are unknown, the above sensitivity functions cannot be used.Using the MIT rule, we replace a 1 , a 2 and b with their estimates â1 , â2 and b in the matching condition ( 14), i.e. we relate the estimates â1 , â2 and b with k1 , k2 and k3 using â1 and obtain the approximate sensitivity functions as: Finally, the adaptation of k1 , k2 and k3 is: where the unknow parameter b in the numerator is absorbed by the gains ki .
The equations given by ( 22) are known as the sensitivity filters or models, and can be easily implemented to generate the approximate sensitivity functions for the adaptive law (23).It should be noted that the MRAC based on the MIT rule is locally stable provided the adaptive gain γ is small, the reference input signal r has a small amplitude and sufficient number of frequencies, and the initial conditions ki (0) are close to the nominal values of k i .For large γ and ki (0) away from the nominal values of k i , the MIT rule may lead to instability and unbounded signal response.

Conventional MRAC
Consider a multi-input multi-output (MIMO) uncertain linear system (Stepanyan & Krinshnakumar, 2010a): where x ∈ℜ n and u ∈ℜare the state and the control input of the system respectively.f (t) ∈ ℜ is a bounded and piece-wise continuous external disturbance.A ∈ℜ n×n and B ∈ℜ n×p are unknown constant matrices satisfying the following matching conditions.
Assumption 1.Given a Hurwitz matrix A m ∈ℜ n×n and a matrix B m ∈ℜ n×p of full column rank, there exists a matrix K 1 ∈ℜ p×n and a sign definite matrix Λ ∈ℜ p×p such that the following equations hold 129 Fault Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com The sign definiteness of Λ corresponds to the conventional sign condition of the high frequency gain matrix of MIMO systems.Without loss of generality, we assume that Λ is positive definite.The rest of the conditions for the existence of an adaptive controller are given by ( 25).
The control objective is to design a control signal u(t) such that the system tracks the reference model: ẋm (t)=A m x m (t)+B m Nr(t), x m (0)=x 0 (26) A m and B m are chosen according to performance specifications and satisfy Assumption 1 and r(t) is a bounded and smooth external reference command.The matrix is chosen such that the output y m (t)=Cx m (t) perfectly tracks the reference command r(t).By using ( 25) and ( 26), one can note that system (24) can be written in the form: where K 2 = Λ −1 N. Hence, choosing the control input u(t) as: translates the system (24) into the reference model ( 26).The reference model ( 26) can always be specified from the performance perspective, however the control signal (28) cannot be implemented since the matrices K 1 and K 2 and the vector-function f (t) are assumed to be unknown.Thus, the adaptive control is designed according to the MRAC architecture as: where K1 (t) and K2 (t) are the estimates of the ideal control gains K 1 and K 2 , and f (t) is the estimate of a constant vector f that can be referred to as an average value of f (t).These estimates are updated online according to robust adaptive laws: where γ > 0 is the adaptation rate, P = P T > 0 is the solution of the Lyapunov equation: for some Q = Q T > 0. The terms Ψ 1 , Ψ 2 and Ψ 3 represent the robust modifications such as σ-modification, e-modification, projection operator or dead-zone modification (Stepanyan & Krinshnakumar, 2010a).Here e(t)=x(t) − x m (t) is the tracking error between the system and the reference model.

Modified MRAC
The Modified MRAC (M-MRAC) is proposed in (Stepanyan & Krinshnakumar, 2010a;b).This approach is motivated by the fact that the initial large error in the control gains generates large transient excursions both in system's control and output signals.Therefore, driving the reference model toward the system proportional to the tracking error prevents the system's 130 Automatic Flight Control Systems -Latest Developments www.intechopen.comattempt to aggressively maneuver toward the reference model.In this case, the modified reference model is defined as follows: where λ > 0 is a design parameter that specifies the tracking error feedback into the reference model.As the tracking error approaches zero, the reference model (32) approaches its original form, which is called an ideal reference model: The control input u as well as the adaptive laws for K1 , K2 and f are the same as in the previous section.It has been shown that the error feedback term λ(x(t) − x m (t)) determines the damping in the control signal.Increasing this term makes it possible to increase the learning rate for better transient performance without generating high frequency oscillations in the adaptive system.

Sliding mode control (SMC)
Closed-loop systems can have some fault-tolerance when the controller gains are carefully chosen to take care of effects of both faults and system uncertainties.Such systems are called passive fault-tolerant control (PFTC) systems.Passive approaches make use of robust control techniques to ensure that a closed-loop system remains insensitive to certain faults using constant controller parameters and without use of on-line fault information.In the case of PFTC, systems continue to operate with the same control gains and structures and the scheme effectiveness depends upon the robustness of the nominal (fault-free) closed-loop system.Systems are made robust to faults by assuming a restrictive repertoire of likely faults and the way in which they affect the control function.
Sliding mode control (SMC) techniques have a strong capability in handling uncertainties and disturbances, which makes them an excellent candidate for passive fault tolerant control system.The design of the SMC for the Qball-X4 starts by expressing the system model (4) in state-space representation (Li, 2011a), (Li et al., 2011b): x 8 x 9 x 10 x 11 where [x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , x 9 , x 10 , x 11 , x 12 ] T = x, y, z, θ, φ, ψ, ẋ, ẏ, ż, θ, φ, ψ T and u z , u θ , u φ and u ψ are defined in (9).In order to achieve tracking for the system, the tracking errors need to be defined as following where x d i is the desired path for the i th state x i : To guarantee the robustness of the passive fault tolerant control in both fault-free case and fault case, the faults need to be considered during the phase of controller design.Therefore, to design a controller that can handle both fault-free and fault situations, an integral sliding mode technique is employed to further enhance the robustness and to ensure a faster and smoother convergence.The sliding surface is then designed as: Consider the Lyapunov functions: The objective now is to design the control laws so that the time derivatives of the Lyapunov functions are negative.That is: This latter condition states that the squared distance to the switching surface as measured by s 2 decreases along all system trajectories.However, this condition is not feasible in practice because the switching of real components is not instantaneous and this leads to an undesired phenomenon known as chattering in the direction of the switching surface.Thus, condition (38) is expanded by a boundary layer in which the controller switching is not required as: The control inputs should be chosen so that trajectories approach the sliding surface and then stay on it for all future time instants.Thus, the control inputs are expressed as the sum of two terms (Singh & Holé, 2004).The first one, called the equivalent control, is chosen so as to make ṡi = 0 when s i = 0. Taking the time derivative of (36), the dynamics of the sliding surfaces can be obtained as following: where u x = (cosx 5 sinx 4 cosx 6 + sinx 5 sinx 6 ) /m and u y = (cosx 5 sinx 4 sinx 6 − sinx 5 cosx 6 ) /m are defined as virtual inputs.By setting ṡi = 0i n 132 Automatic Flight Control Systems -Latest Developments www.intechopen.com(40) the equivalent control inputs can be derived as: The second term of the control inputs is chosen to tackle uncertainties in the system and to introduce reaching law.One can achieve a proportional (l i s i ) plus constant (m i sign(s i )) rate reaching law by selecting the second term as: where l i and m i (i = 1, ..., 6) are positive control gains.The total control inputs u = u eq + u * are then (Li, 2011a), (Li et al., 2011b): It is straightforward to verify the negativity of condition (39).For illustration purpose, taking for example u x of (43) and plugging it into ṡ1 of (40) gives: Multiplying both sides of the previous equation by s 1 : and properly choosing control gains l 1 and m 1 allows to verify (39).The same procedure can be followed for the other control inputs.
The elimination of the chattering effect produced by the discontinuous function sign can be attained by using a saturation function sat instead of the sign function.This saturation function is defined as follows: where δ b is the boundary of the saturation function and is set small enough.

Backstepping control (BSC)
Backstepping design refers to "step back" to the control input, and a major advantage of backstepping design is its flexibility to avoid cancellation of useful nonlinearities and pursue the objectives of stabilization and tracking, rather than those of linearization.Recursively constructed backstepping controller (BSC) employs the control Lyapunov function to guarantee the global stability (Krstic et al., 1995).
In order to illustrate the BSC techniques, consider the following nonlinear system: where x is the state vector and ξ is the control input.As a first step, define the tracking error between the actual value x and its desired value x d as follows: As a second step, define the following states: The key idea of BSC is to choose certain variables as virtual controls.Assuming x 2 is the virtual control variable and a(z 1 ) is the function which makes z 1 → 0, define z 1 as: The time derivative of z 1 is: Let us choose a(z 1 ) as a(z 1 )= ẋd + k 1 z 1 with k 1 > 0 and define the Lyapunov function: 134 Automatic Flight Control Systems -Latest Developments www.intechopen.comOne can see that the time derivative of V 1 is: Clearly if z 1 = 0, then V1 = −k 1 z 2 1 and z 1 is guaranteed to converge to zero asymptotically.Then, the next step is to define a Lyapunov function so as to make z 1 → 0: The time derivative of V 2 is: To obtain V2 < 0, ẋ2 is chosen as: The application of the method above to the state-space representation (34) of the Qball-X4 model gives the control inputs (Zhang, 2010a), (Zhang et al., 2010b): with u x = (cosx 5 sinx 4 cosx 6 + sinx 5 sinx 6 ) /m and u y = (cosx 5 sinx 4 sinx 6 − sinx 5 cosx 6 ) /m defined as virtual inputs and z i = x d i − x i and z i = ẋd i + k 1 z i − ẋi (i = 1, ..., 6).

Model predictive control (MPC)
Model Predictive Control (MPC) is a promising tool for fault tolerant control applications (Maciejowski & Jones, 2003) due to its prominent capabilities such as constraint handling, flexibility to changes in the process dynamics and applicability to nonlinear dynamics.Since MPC recalculates the control signal at each sampling time, any change in the process dynamics can be reflected simply into the control signal calculation.Also, the constraint handling capability of MPC allows system working close to the boundaries of the tight post-failure operation envelope.The drawback of MPC is that similarly to most of the control techniques, it needs an almost explicit model of the system to calculate a stabilizing control signal.On the other hand, the abrupt changes in the model parameters, due to failure, cannot be predicted beforehand and an online data-driven parameter estimation methodology is required to extract the post-failure model parameters from online input/output data.In other words, an FDD module is required to provide information about the occurring faults to allow MPC to consider faults.

135
Fault Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com

Notation and terminology
In the MPC, also known as Receding Horizon Control (RHC), a cost function is minimized over a future prediction horizon time step denoted by N, subject to the dynamical constraints.
The first control input in the sequence is applied to the plant until the next update is available.
The discrete timing is shown by k where k ∈ N. The state vectors are introduced as follows: • x(k) : actual state vector at time step k.

Fault-free MPC formulation
The cost function at time step k is defined as follows: where x 2 Q = x T Qx, and P > 0, Q > 0 and R > 0 are symmetric matrices.x d is the desired or reference state of x.Then the MPC problem at each step time k is defined as follows: Subject to: for j = 0, 1, ..., N − 1.
X ⊆ R n , U ⊆ R m and X t ⊆ X denote the set of admissible states, inputs and terminal states (terminal region) respectively.J * denotes the optimal value of the cost function J.This MPC formulation is based on the quasi-infinite model predictive control (Chen & Allgower, 1998).At each time step k, MPC generates the input and state trajectories, by solving Problem 1.After generating these trajectories, MPC controller applies only the first computed control input, i.e. u k (0) to the system.The following algorithm presents the online implementation of Problem 1 (Izadi, 2009a), (Izadi et al., 2011b).

Measure x(k).
136 This algorithm is repeated for k = 0, 1, ..., ∞.In step #2, if full state measurement is not available, then a state estimator (observer) can be used to provide the state estimate.

Fault-tolerant MPC
In the presence of an actuator fault, the system dynamics can be rewritten as follows: where α captures the fault information and is called the fault parameter matrix which determines the fault severity.α is a diagonal matrix, i.e. α = diag(α 1 , α 2 , ..., α m ) where m is the number of inputs (m = 4 for the quadrotor helicopter) and the scalar α i denotes the amplitude of the fault in the i th actuator.α i = 1 denotes a healthy actuator, α i = 0 denotes a complete loss of actuator effectiveness and 0 < α i < 1 represents a partial loss.Taking into consideration the model representation ( 65) after fault occurrence, the fault-tolerant MPC problem can be defined as follows (Izadi et al., 2011b): Subject to: x k (j) ∈ X (68) for j = 0, 1, ..., N − 1.
One can see that the difference between Problem 1 and Problem 2 resides in the consideration of the fault matrix α in (67).Clearly, solving Problem 2 requires an FDD module for fault identification and thus the algorithm for solving Problem 2 is similar to Algorithm1 except that an FDD module is needed to run parallelly to provide an estimation of α.

Flatness-based trajectory planning/re-planning (FTPR)
This section does not present an FTC method but a trajectory planning/re-planning approach that can be combined with any FTC module to provide a better management of the system resources after fault occurrence.This is achieved by redefining the reference trajectories to be followed by the damaged system depending on the fault severity.This approach is equivalent to the reconfiguration of command governor block in Figure 3.

137
Fault Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com

Flatness notion
The flatness can be defined as follows.A dynamic system: with x ∈ℜ n and u ∈ℜ m , is flat if and only if there exist variables F ∈ℜ m called the flat outputs such that: ) and u = Ξ 3 (F, Ḟ, ..., F (n) ).Ξ 1 , Ξ 2 and Ξ 3 are three smooth mappings and F (i) is the i th derivative of F.
The parameterization of the control inputs u in function of the flat outputs F plays a key role in the trajectory planning problem: the nominal control inputs to be applied during a mission can be expressed in function of the desired trajectories.Thus allowing to tune the profile of the trajectories for keeping the applied control inputs below the actuator limits (Chamseddine et al., 2011b).
For the quadrotor UAV simplified model given in ( 6), one can see that the outputs to be controlled can be chosen as flat outputs.Thus, system ( 6) is flat with flat outputs F 1 = z, F 2 = x, F 3 = y and F 4 = ψ.In addition to x, y, z and ψ, the parameterization of θ and φ in function of the flat outputs is: The parameterization of the control inputs in function of the flat outputs is:

Reference trajectory design
Let's define F * i as the reference trajectories for the flat output F i .Several methods can be used to design F * i .In this work we employ the Bézier polynomial function.A general Bézier polynomial function of degree n is: where t is the time and a i (i = 0, ..., n) are constant coefficients to be calculated in function of the initial and final conditions.It is clear that the larger is n, the smoother is the reference trajectory.However, calculations for trajectory planning become heavier as n increases.For the quad-rotor UAV, it can be seen in ( 73) that u z is function of F1 , u θ of at the initial and final time (i.e. up to where n i = 2 for i = 1, 4 and n i = 4 for i = 2, 3. To this end, we employ a Bézier polynomial function of degree 5 for F 1 and F 4 and a Bézier polynomial function of degree 9 for F 2 and F 3 .The reference trajectories are then: and The coefficients a i j (i = 1, 4 and j = 0, ..., 5) are calculated to verify the initial conditions F i (t 0 ), Ḟi (t 0 ), Fi (t 0 ) and the final conditions F i (t f ), Ḟi (t f ), Fi (t f ).The coefficients a i j (i = 2, 3 and j = 0, ..., 9) are calculated to verify the initial conditions i (t f ).t 0 and t f are respectively the initial and the final instants of the mission.

Trajectory planning
The trajectory planning consists in driving the quadrotor from an initial to a final position.The initial and final conditions as well as the initial time t 0 are all known and the only unknown is the final time of the mission t f .Thus, the trajectory planning tends to tune the profile of the trajectory (by tuning t f ) so that to drive the system along the desired trajectory without violating actuator constraints.Thanks to flatness, it is possible to find the relation between the applied control inputs and the reference trajectories.According to (73) the nominal control inputs to be applied along the reference trajectories are: Since the quadrotor is assumed to have a zero yaw angle (ψ = 0), then F * 4 = 0 ∀ t ∈ [t 0 , t f ].It is also assumed that the quadrotor is not changing altitude and thus F * 1 = 0 ∀ t ∈ [t 0 , t f ].I n this case, the nominal control inputs are: Fault Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com The system is required to move from an initial position F i (t 0 )=0 with initial conditions Ḟi (t 0 )= Fi (t 0 )=F (3) ).Without loss of generality, by setting t 0 = 0 one can write (76) as where c j (j = 1, ..., 5) are constants that can be easily derived from (79) and are not given here for simplicity.From ( 9), ( 78) and ( 80), it is possible to determine the nominal PWM inputs to be applied along the references trajectories, which are: where ) are known, one must find the minimal t f so that u * i < u max where u max is the maximal PWM that corresponds to the maximal thrust that can be generated by a rotor.One way to determine t f is to analytically calculate when the extrema of u * i take place and what are their values (where the extrema collectively denote the maxima and the minima of a function).For this purpose, it is necessary to calculate the derivative of u * i in (81) with respect to time and then solve for t the following equation: For a fixed i (i = 1, ..., 4), each equation du * i /dt is a polynomial function of fourth degree and thus has four extrema which take place at: The values of the four extrema can be obtained by replacing t of ( 81) by the values obtained in (83).As an example, the values of the four extrema of u * 1 of the first rotor are: with c 6 and c 7 two constants.The determination of t f consists finally in solving (84) so that the extrema of the nominal PWM input verifies: Automatic Flight Control Systems -Latest Developments www.intechopen.com Since the above study is based on the simplified model ( 6), the constant 0 ≤ ρ ≤ 1i s introduced to create some safety margin and to robustify the obtained solution with respect to model uncertainties.Four solutions can then be obtained: The four extrema of u * 2 , u * 3 and u * 4 have the same structure as for u * 1 with different values for the constants c 6 and c 7 .In conclusion, the quadrotor UAV will have 16 extrema (four per motor) and therefore 16 solutions are obtained and the maximal one among them is to be considered.

Trajectory re-planning
As for the fault-free case, the trajectory re-planning consists in determining the minimal time of the mission t f so that the actuator constraints are not violated.For the damaged UAV, this is written as: where δ i represents the loss of effectiveness in the i th rotor.δ i = 0 denotes a healthy rotor, δ i = 1 denotes a complete loss of the rotor and 0 < δ i < 1 represents a partial loss of control effectiveness.Clearly, trajectory re-planning in the fault case requires the knowledge of the fault amplitude δ i .Thus, a fault detection and diagnosis module is needed to detect, isolate and identify the fault.Unlike trajectory planning, the initial conditions are not zero at the re-planning instant i.e.Ḟi (t rep ) = 0, Fi (t rep ) = 0, F i (t rep ) = 0 and F (4) i (t rep ) = 0 where t rep is the re-planning time.Therefore, it is difficult to analytically calculate t f as in the previous section since the expressions are much more complicated and thus another method is needed to solve the problem.Starting from the idea that the larger t f is, the smaller are the PWM inputs u i , we propose the following algorithm to calculate t f : 1. Develop the expressions of u * i (t) (similar to the procedure in the previous section) with nonzero initial conditions.2. Start with an initial guess of the mission time t f .3. For t = 0:T e : t f calculate u * i (t) and determine the maximum value u * i max among all the u * i (t).T e is a sampling period.4. Determine the error E i between u * i max and the maximal allowable PWM input (ρu max for the healthy UAVs and ρ(1 − δ i )u max for the damaged one). 5.If the error is smaller than a predefined threshold, exit the algorithm and the solution is the current t f .If not, update the current t f as follows t f ← t f + t f E/ν with ν is a positive constant.6. Repeat from Step #3.
As can be seen in Step #5, if the error E i is positive then u * i max is larger than the maximal allowable PWM input and thus it is necessary to increase t f .If the error is negative then u * i max is smaller than the maximal allowable PWM input and thus it is necessary to decrease t f .The constant ν must be carefully selected since it affects the convergence speed of the algorithm.

Simulation and experimental testing results
The approaches that have been experimentally tested on the Qball-X4 are built using Matlab/Simulink and downloaded on the Gumstix emdedded computer to be run on-board with a frequency of 200 Hz.The experiments are taking place indoor in the absence of GPS signals and thus the OptiTrack camera system from NaturalPoint is employed to provide the system position in the 3D space.Some photos of the NAV Lab of Concordia University are shown in Figure 5 and many videos related to the above approaches as well as other videos can be watched online on http://www.youtube.com/user/NAVConcordia.

GS-PID experimental results
Starting with the GS-PID, an 18% loss of overall power of all motors is considered where the Qball-X4 is requested to track a one meter square trajectory tracking.The fault-free case is shown in the left-hand side plot of Figure 6 whereas the middle one shows a deviation from the desired trajectory after the fault occurrence when the switching between the PID gains is taking place after 0.5 s of fault occurrence.Better tracking performance can be achieved with shorter switching time which requires fast and correct fault detection.The right-hand plot of Figure 6 demonstrates better performance when the switching is done without time delay.Fig. 6.Fault-free case and 18% loss in the total thrust with and without time delay.

MRAC experimental results
As for the MRAC, a partial effectiveness loss of 30% and 40% are simulated in the total thrust u z .The faults are injected at t = 40 s and the experimental results are illustrated in Figure 7.This kind of fault induces a loss in the height z without significant effect on x, y or ψ directions.One can see that all the three MRAC techniques give better performance than the baseline LQR controller and that the conventional MRAC (C-MRAC) is the best among the MRAC techniques.The MRAC has been also tested in the presence of a partial damage of the 4 th propeller.This type of faults is more realistic than the simulated faults given above.To accommodate a partial damage of the propeller, the controller tries to speed up the 4 th rotor so that to produce the same lift as for the fault-free case.Thus, the maximal speed that a rotor can reach is a critical factor that does not play a role in simulated faults.Figure 8 shows the system behavior along the z and y directions where the first row corresponds to 12% damage and the second to 16%.One can see that the performance obtained with the C-MRAC is better than that of the LQR.

SMC experimental results
The objective in the SMC is to track a square trajectory of 1.5 m × 1.5 m. Figure 9 shows the system evolution along the x, y and z directions when the SMC-based PFTC is experimentally applied to the Qball-X4.The SMC-based PFTC is giving good performance where very small deviation in position z can be observed at 20 s due to a partial damage in the 4 th propeller.

BSC simulation results
In the BSC approach, the system is required to follow a circular trajectory and the the actuator faults are injected at time t = 5 s.Simulations are carried out with different control gains k 1 = 1, k 2 = 3 and k 1 = 5, k 2 = 30.Figures 10(a) and 10(b) show a comparison between the fault-free case and the fault-case of 50% loss of control effectiveness for both position and angle tracking errors.The control gains used in Figures 10(a) and 10(b) are k 1 = 1 and k 2 = 3.One can see that in the fault case, the position tracking errors in the x and y directions change slightly whereas the z tracking error is greatly affected.The roll, pitch and yaw tracking errors are also affected as can be seen in Figure 10(b).With higher control gains k 1 = 5 and k 2 = 30, it is possible to reduce fault effects on tracking errors as can be seen in Figures 10(c) and 10(d).

MPC simulation results
To illustrate the MPC approach, the quadrotor is assumed to be on the ground initially and it is required to reach a hover height of 4 m and stay in that height while stabilizing the pitch and roll angles.The x d , y d and ψ d are x d = 2 m, y d = 3 m and ψ d = 0.The upper left plot of Figure 11 shows the time history of states for fault-free condition (the desired position values are dotted and the velocities are dashed lines).
The fault is designed to happen at time t = 5 s.At this time it is assumed that actuator faults occur which lead to multiple simultaneous partial loss of effectiveness of three actuators as follows: α 1 = 0.9, α 2 = 0.7, α 3 = 0.8 and α 4 = 1.0 (i.e.10% loss of control effectiveness in the first motor, 30% in the second, 20% in the third and no fault in the fourth one).The upper right plot of Figure 11 shows the time history of the states when no fault estimation is performed.In fact in this case Algorithm 1 is used without any information about the occurred fault.One  can see that system states do not converge to their desired values and therefore it exhibits poor performance.The figure also shows that interestingly MPC exhibits some degree of fault tolerance inherently; all the linear and angular velocities are stabilized and there is only some error in the positions and orientations.
For the fault-tolerant MPC, Problem 2 is used where fault parameters estimation is provided by employing the Moving Horizon Estimator (MHE) Izadi et al. (2011b).The two lower plots of Figure 11 show fault parameters estimates as well as system states.It is clear that fault-tolerant MPC improves the system performance compared to the case without fault-tolerance.

FTPR simulation results
To illustrate the FTPR approach, let us assume that the quadrotor system is required to move from an initial position to a final one with F 2 (t 0 )=0 and F 3 (t 0 )=0, F 2 (t f )=20 m and F 3 (t f )=30 m.It is also assumed that the maximal thrust that can be generated by each motor is T max = 8 N. ρ is set to 0.1 and the approach described is Section 3.6.3gives the solution of t f = 6.81 s.The simulation results for this scenario are given in Figure 12 which shows the system trajectories along the x and y directions.The figure also shows that the four applied thrusts do not exceed ρT max .
For the fault scenario, it is assumed that the Qball-X4 loses 25% of the control effectiveness of its fourth rotor at the time instant t = 2 s.In this case and without trajectory re-planning, Figure 13(a) shows that the damaged system is not able anymore to reach the final desired  position.Figure 13(c) shows how the applied thrusts saturate when the system is forced to follow the pre-fault nominal trajectory.For the trajectory re-planning, once the fault is detected, isolated and identified, the trajectories are re-planned at t = 2.5 s where 0.5 s is the time assumed to be taken by the FDD module.The solution obtained from Section 3.6.4 is t f = 13.3 s. Figure 13(b) shows that after re-planning, the UAV is able to reach the final desired position.The applied thrusts are illustrated in Figure 13(d) where it can be seen that the thrusts remain smaller than their maximal allowable limits.Thus, trajectory planning can help in keeping system stability by redefining the desired trajectories to be followed by taking into consideration the post-fault actuators limits.

Conclusion
This chapter presents some of the work that have been carried out at the Networked Autonomous Vehicles Laboratory of Concordia University.The main concern is to propose approaches that can be effective, easy to implement and to run on-board the UAVs.Many of the proposed methods have been implemented and tested with the Qball-X4 testbed and current work aims to propose and implement more advanced and practical techniques.As one of functional blocks in an AFTCS framework, FDD plays an important role for successful fault-tolerant control of systems (see Figure 3).Development on FDD techniques could not be included in the chapter due to space limit.Interested readers can refer to our recent work in 146 Automatic Flight Control Systems -Latest Developments www.intechopen.com(Ma & Zhang, 2010a), (Ma & Zhang, 2010b), (Ma, 2011), (Gollu & Zhang, 2011), (Zhou, 2009) and (Amoozgar et al., 2011) for information on FDD techniques applied to UAV and satellite systems.Research work on fault-tolerant attitude control for spacecraft in the presence of actuator faults could not also be included but can be found in (Hu et al., 2011a), (Hu et al., 2011b), (Xiao et al., 2011a) and (Xiao et al., 2011b).Current and future work will focus more on the multi-vehicles cooperative control where preliminary works on cooperative control have been presented in (Izadi et al., 2009b), (Izadi et al., 2011a), (Sharifi et al., 2010), (Sharifi et al., 2011), (Mirzaei et al., 2011) and (Qu & Zhang, 2011).

Fault
Fig. 1.The Quanser Qball-X4 quadrotor UAV and its schematic representation.The block diagram of the entire UAV system is illustrated in Figure 2. It is composed of three main parts: • The first part represents the Electronic Speed Controllers (ESCs) + the motors + the propellers in a set of four.The input to this part is u =[ u 1 u 2 u 3 u 4 ] T which are Pulse Width Modulation (PWM) signals.The output is the thrust vector T =[ T 1 T 2 T 3 T 4 ] T generated by four individually-controlled motor-driven propellers.•The second part is the geometry that relates the generated thrusts to the applied lift and torques to the system.This geometry corresponds to the position and orientation of the propellers with respect to the system's center of mass.• The third part is the dynamics that relate the applied lift and torques to the position (P), velocity (V) and acceleration (A) of the Qball-X4.
Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com

34) 131 Fault
Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com

) 133 Fault
Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com Systems -Latest Developments www.intechopen.comu ψ of F4 .The relative degrees are then r 1 = 2, r 2 = 4, r 3 = 4 and r 4 = 2. Smooth control inputs can be obtained if one can impose

141Fault
Tolerant Flight Control Techniques with Application to a Quadrotor UAV Testbed www.intechopen.com

Fig. 7 .
Fig.7.System behavior with a simulated fault of 30% and 40% loss in the total thrust.

Fig. 8 .
Fig.8.System behavior with a damage of 12% and 16% of the fourth propeller.

144
Automatic Flight Control Systems -Latest Developments www.intechopen.com

Fig. 11 .
Fig. 11.MPC in fault-free and fault conditions without and with fault estimation.

145FaultFig. 12 .
Fig. 12. System evolution in the x and y directions and the applied thrusts.
Fig. 13.Trajectories and control inputs without and with re-planning.