Safety Flight Envelope Calculation and Protection Control of UAV Based on Disturbance Observer

In this paper, as for the unmanned air vehicle (UAV) under external disturbance, an attainable-equilibrium-set-based safety fight envelope (SFE) calculation method is proposed, based on which a prescribed performance protection control scheme is presented. Firstly, the existing definition of the SFE based on attainable equilibrium set (AES) is extended to make it consistent and suitable for the UAV system under disturbance. Secondly, a higher-order disturbance observer (HODO) is developed to estimate the disturbances and the disturbance estimation is applied in the computation of the SFE. Thirdly, by using the calculated SFE, a desired safety trajectory based on the time-varying safety margin function and first-order filter is developed to prevent the states of the UAV system from exceeding the SFE. Moreover, a SFE protection controller is proposed by combining the desired safety trajectory, back-stepping method, HODO design, and prescribed performance (PP) control technique. In particular, the closed-loop system is established on the basis of disturbance estimation error, filter error, and tracking error. Finally, the stability of the closed-loop system is verified by Lyapunov stability theory, and the simulations are presented to illustrate the effectiveness of the proposed control scheme.


Introduction
The unmanned air vehicle (UAV) represents a new type of aircraft weapon system that can be autonomously controlled and perform air-to-air and air-to-ground military missions [1]. Using UAVs to perform dangerous missions instead of the pilot-piloted aircrafts is one of the essential trends in the future warfare [2]. Meanwhile, due to the advantages of the UAVs, a large number of higher requirements have been proposed for the future applications of the UAVs, such as intelligence, autonomy, large overload, and long range, which can further promote the developments of the UAVs.
Together with wide applications of the UAVs, flight safety issues have attracted much research attention from many scholars [3][4][5][6]. Normally, flight safety refers to the fact that during the operations of the aircraft, there are no incidents of improper operations or external factors (such as disturbances) that cause casualties or damages to the aircraft [7]. Compared with other traffic modes, the accident rate of aviation is low, while its destructiveness is enormous. Based on the results in [8], the leading cause of flight accidents was loss of control (LOC). Unfortunately, there is still no unified concept on the LOC so However, as for the application of SFE protection control, it is not enough to only consider these ideal situations. In practice, the SFE is always affected by various factors, such as outside disturbances. Then, for a class of uncertain nonlinear systems with output constraints and external disturbances, an adaptive neural safety boundary protection algorithm was developed in [26] based on disturbance observer, which could effectively limit the output trajectory within the output constraints, ensuring the flight safety. For unmanned helicopters under outside disturbances, model uncertainties, and output constraints, an adaptive fuzzy safety tracking control scheme was developed [27], where the safety margin was used to limit the desired output within a given range, and a tracking protection controller was designed by combining a fuzzy system. In summary, the existence of the disturbance will impose negative effects on the SFE of the UAV system, and deteriorate the performance of the SFE protection controller, which needs to be investigated and constitutes the focus of this paper.
Motivated by above discussions on SFE computation and SFE-based protection control, this paper proposes a co-design of disturbance-observer-based AES calculation method and a SFE protection control scheme. The main contributions of this paper are listed as follows: -The scope of the applications of existent AES is extended, and the definition of the AES-based SFE under disturbances is presented. That is to say, a HODO is developed to estimate external disturbances, and the disturbance observations are used for the calculation of the SFE; -Based on derived SFE, a time-varying safety margin function is proposed based on the prescribed performance function and safety margin constant. Then, by utilizing the safety margin function, a co-design method for the desired safety trajectory and SFE protection controller is proposed.
Five sections make up the whole structure of this paper. In section 2, the UAV attitude motion model is given. The definition and computation of AES under disturbance are studied based on the HODO in section 3. Section 4 proposes a method for generating the safety desired trajectory. Also, a SFE protection control law is developed in Section 4 based on the HODO, backstepping method, and PP control. Section 5 designs and completes simulations to verify the effectiveness of the SFE protection controller. The entire work is summarized in Section 6.

Problem Statement
This section gives the UAV attitude dynamic model under external disturbances, the control targets, and some related preliminary knowledge. Initially, the disturbances are taken into account in the fast-loop of the UAV's attitude dynamics, which is given as follows [28]: where x 1 = [α, β, µ] T ∈ R 3 denotes the attitude angle vector including the attack angle, sideslip angle, and roll angle, x 2 = [p, q, r] T ∈ R 3 represents the attitude angle rate vector of roll angle rate, pitch angle rate, and yaw angle rate, is the control input vector that, respectively, represents the aileron, canard, rudder, lateral thrust vectoring, and normal thrust vectoring deflection angles; f 1 : R 3 → R 3 and f 2 : R 6 → R 3 are the nonlinear vector-valued functions, g 1 : R 3 → R 3×3 and g 2 : R 6 → R 3×5 are the nonlinear matrix-valued functions. The expressions of f 1 , g 1 , f 2 , g 2 can be found in [29]. Here, d(t) = [d p (t), d q (t), d r (t)] T ∈ R 3 means the external time-varying disturbance, and y ∈ R 3 denotes the output vector.
The control objective of this paper is to design a HODO-based SFE protection controller to keep the state x 1 of system (1) within the SFE constraint. For this reason, the calculation of AES under disturbance is initially studied. Then, a method of obtaining the safety desired trajectory from desired trajectory is proposed by combining the time-varying safety margin function and the first-order filter. Finally, a SFE protection control controller is designed based on the backstepping method, the HODO, and the PP control.
The following assumptions and lemma are given to facilitate the subsequent calculation of the SFE and the design of the SFE protection control scheme.
Remark 1. Assumptions 1 and 2 are the standard assumptions that have been widely adopted in many publications such as [26], [27], [30], and [31]. Here, Assumption 1 implies that the desired trajectory y d is of finite energy. For Assumption 2, the disturbance d(t) is assumed to be smooth and bounded while its bounds are unknown, which is crucial for the design of the disturbance observer.
Lemma 1. For a control system with bounded initial condition, if there exists a C 1 continuous and positive definite Lyapunov function V (x): R n → R such that where ϑ 1 , ϑ 2 : R → R are class K functions, κ 1 > 0, and κ 2 > 0, then the state x(t) is uniformly bounded [27].

Safety Flight Envelope Calculation Under Disturbance
According to the basic concept of dynamic trim, the UAV system with twelve states can be divided into four loops: the position loop, the velocity loop, the attitude angle loop, and the attitude angle rate loop. The attitude angle loop and the attitude angle rate loop belong to the fast loop, while the position loop and the speed loop belong to the slow loop. In the UAV system, the states of the fast loop first reach the equilibrium point. That is to say, the derivatives of the fast states are normally zero, while the slow states remain constants. The AES represents the set of all dynamic trim points of the UAV and is defined as the SFE of the UAV. As an extension of the AES definition, this section introduces a new type of AES under disturbance and gives its computation method.
Considering the system (1) without the disturbance d(t), the dynamic model is rewritten aṡ The deflections of the rudders of the UAV system are limited within a specific range, which can generally be obtained as where δ i,max , δ i,min represent the upper bound and lower bound of δ i , i ∈ {a, c, r, y, z}, respectively. Then, considering the definition of AES in [17], the AES of system (5) can be written as where S ⊂ R 6 denotes the AES. Once the parameters of system (5) are given, S is uniquely determined and does not change with time on.
Remark 2. Considering Eq. (1), it can be seen that the outside disturbance will change the dynamic trim points of the UAV system. Then, a trim point without the disturbance may become an untrimmed point, which means that considering the problem of the AES under disturbance is essential and challenging.
Due to the introduction of external disturbance, the AES in (7) will become altered and unpredictive. By combining the idea of dynamic trim and the definition of AES, we define a time-varying AES of Eq.
(1) as: where S d (t) ⊂ R 6 denotes the AES under disturbance. It is worth noting that even though the AES in (8) has its rationality and application value, Eq. (8) contains the time-varying disturbance, usually unknown, which makes the AES uncomputable.
Remark 3. Considering that in the control law design and the SFE computation, a technique of estimating the disturbance needs to proposed to observe the time-varying unknown disturbance. Therefore, for the convenience of calculation, the observed valued(t) of the disturbance d(t) is used to replace the d(t) described in Eq. (8).
The approximate setŜ d (t) of the AES S d (t) under disturbance can be further extended as: In order to obtain the estimation of the disturbance, the following HODO is introduced [30] where z m ∈ R 3 , m ∈ {1, 2, . . . , r} are the internal states of the HODO, andd,d, . . . ,d (r−1) are the estimated values of d,ḋ, . . . , d (r−1) , respectively;d is the output of the HODO, k m ∈ R 3×3 , m ∈ {1, 2, . . . , r} are positive definite matrices to be designed. In what follows, define the qth order derivative estimation errord (q) of the disturbance d as: where q ∈ {0, 1, . . . , r − 1} and ζ (0) = ζ, ζ ∈ {d,d,d}. Taking the derivative ofd (q) and invoking Eq. (1) and Eq. (10), one can obtain , then the error dynamic in Eq. (12) can be rewritten in a compact form asḊ where Constructing the Lyapunov function V d (D) = 0.5D TD for Eq. (13), taking the derivative of V d (D), and applying the Young's inequality, one yieldṡ where I is the identity matrix with appropriate dimension. From Assumption 2, the following inequality is established Considering Eq. (17), Eq. (16) can be rewritten aṡ If the parameter K to be designed satisfies K − 0.5I > 0, then according to Eq. (18) and Lemma 1, the estimated errorD of the HODO is uniformly bounded. The basic idea of the AES under disturbance aims to estimate the disturbance online and replace the disturbance with its observed values to calculate AES. In practical applications, due to the limitation of the computing power of the flight control computer, it can be considered to store offline AES under the disturbances. When flying online, according to the observed value of the disturbance, the AES can be generated from the stored AES through interpolation. In this paper, we only consider the offline computation of the AES under external disturbance. Thus, based on the optimization method, the calculation of the AES with disturbance can be transformed into an optimization problem, which is described as [20] min where S 1 ∈ R 3×3 and S 2 ∈ R 3×3 are positive definite matrices to be predefined. J : R 6 → R is the objective function.
Remark 4. From (9), the optimization problem (19) has simple constraints, and its objective function is continuously differentiable. Thus, some first-order or second-order methods, such as the gradient, Newton, and Trust Region, can be utilized to solve such problem (19) since they are all based on the iteration. The iterative procedure means that it starts from an initial point, looks for the next point that reduces the objective function, until the termination condition is satisfied, then the algorithm stops.

PP-Based Flight Envelope Protection Control Scheme
Since flight safety is the first issue for UAVs, it is essential for the flight control law to conduct maneuvering flights and complete specified tasks, which needs SFE protection control to realize flight safety. Then, for the attitude dynamic model of the UAV system under disturbance, this section proposes a new SFE control method by integrating the HODO, the calculation of SFE, the filtering technology, and the prescribed performance control. The SFE protection control involves both the SFE constraints and the performance requirements of tracking control, such as steady-state and transient performances.
Since the SFE of the system (1) is altered due to time-varying disturbance, there must exist the SFE constraint upper bound x up (t) = [α up (t), β up (t), µ up (t)] T and SFE constraint lower bound x low (t) = [α low (t), β low (t), µ low (t)] T such that α up (t) > α low (t), β up (t) > β low (t), and µ up (t) > µ low (t). Yet, the conflicts between desired trajectory x 1d = [α d , β d , µ d ] T and SFE constraints may occur in actual flight. Then, it is necessary to adjust the desired trajectory x 1d to obtain the constraint desired trajectory x 1c = [α c , β c , µ c ] T and the safety desired trajectory x 1s = [α s , β s , µ s ] T to ensure the flight safety. This section proposes a new generation method of constraint and desired safety trajectories based on the PP functions. The procedure is mainly divided into three following steps [27]: Step 1: The first step is to obtain the SFE constraints x up (t) and x low (t). According to the calculation of the SFE proposed in the previous section, x up (t i ), x low (t i ), i ∈ {1, 2, . . . , n} at given moment can be obtained. Piecewise Hermit interpolation functions x up (t) and x low (t) can be constructed by using x up (t i ), x low (t i ), i ∈ {1, 2, . . . , n}. Both x up (t) and x low (t) are piecewise continuously differentiable.
Step 2: The second step is to generate the desired constraint trajectory x 1c . Let ρ α (t), ρ β (t), and ρ µ (t) be the performance functions of the angle-of-attack tracking error e α = α − α s , sideslip angle tracking error e β = β − β s , and roll angle tracking error e µ = µ − µ s , respectively. It is necessary to design the SFE protection control law such that the errors e i , i ∈ {α, β, µ} satisfy [32] where 0 < δ i < 1, i ∈ {α, β, µ} are the parameters to be designed. Here, ρ i (t), i ∈ {α, β, µ} are selected as [32] ρ where ρ i0 and ρ i∞ denote the initial and limit values of performance functions with ρ i0 > ρ i∞ > 0, l i > 0. Define that τ α , τ β , and τ µ are the safety margin constants to be designed later. The time-varying safety margin functions are constructed as min{ρ i (t), τ i }, i ∈ {α, β, µ}. Figure 1 shows a schematic diagram of the time-varying safety margin functions. Moreover, the schematic diagram of generating the constrained desired trajectory according to the time-varying safety margin function, the desired trajectory, and the upper and lower bounds of the SFE are illustrated in Figure 2.  Let's take α c as an example to illustrate this analytic process. When α d (t) ≥ α up (t) − min{τ α , ρ α (t)}, the desired trajectory has the risk of crossing the upper bound of the SFE. Define the desired constraint trajectory as α c (t) = α up (t) − min{τ α , ρ α (t)} As for α d (t) ≤ α low (t) + min{τ α , ρ α (t)}, the desired trajectory has the risk of crossing the lower bound of the SFE. Define the constrained desired trajectory as  For α low (t) + min{τ α , ρ α (t)} < α d (t) < α up (t) − min{τ α , ρ α (t)}, the desired trajectory has margins from the upper bound and lower bound of the SFE. The constrained desired trajectory is defined as In summary, α c can be further written as Similarly, β c and µ c can be accordingly obtained as Based on above discussions, we can define the desired constraint trajectory x 1c = [α c , β c , µ c ] T . Since min{ρ i (t), τ i }, i ∈ {α, β, µ}, x up (t), and x low (t) are all piecewise continuously differentiable and bounded, then x 1c is also a piecewise continuously differentiable bounded function. That is, in each differentiable interval, there must exist a constant Q > 0 such that Step 3: The desired constraint trajectory defined in above step is piecewise continuously differentiable, which is inconvenient for the subsequent tracking control law design. Then, a first-order filter is introduced for the smoothing, and it is designed as follows [33] where x 1s ∈ R 3 is the estimate of the constrained desired trajectory x 1c , called the safety desired trajectory. w 1 ∈ R 3×3 is a positive definite matrix that needs to be designed later.
Defining the filter errorx 1s = x 1s − x 1c and taking the derivative ofx 1s with respect to time, we havė For Eq. (30), the Lyapunov function is selected as Now, differentiating V s (x 1s ) with respect to time and invoking Eq. (30), one yieldṡ Then, considering Eq. (28), Eq. (32) can be rewritten aṡ One can check that if the parameter w 1 to be designed satisfies w 1 − 0.5I > 0, then according to Eq. (33) and Lemma 1, the filter errorx 1s is uniformly bounded. Based on the safety designed trajectory generated above, the control law is designed with the PP control method to make the output y = x 1 of Eq. (1) track x 1s in order to ensure the flight safety. The attitude angle tracking error e Ω ∈ R 3 and attitude angle rate tracking error e w ∈ R 3 are defined as where x * 2 ∈ R 3 is the virtual control law to be designed. Taking the derivative of e Ω with respect to time and invoking Eqs. (1), (35), one yieldṡ Moreover, according to the error transformation in [32], the transformed error can be obtained as where ε i ∈ R is the transformed error of the error variable e i , z i = e i (t)/ρ i (t), i ∈ {α, β, µ}. S i : R → R are the error transformation functions and can be written as Taking the derivative of ε i with respect to time yieldṡ where Defining T , i ∈ {α, β, µ}, Eq. (39) can be written in the compact form aṡ where ε Ω = [ε α , ε β , ε µ ] T . By substituting Eq. (36) into Eq. (40) , thenε Ω can be rewritten aṡ Thus, the virtual control law x * 2 is designed as where K Ω ∈ R 3×3 is the positive definite matrix to be designed, that is, K Ω = K T Ω > 0. Substituting Eq. (42) into Eq. (41),ε Ω can be obtained aṡ For Eq. (43), the Lyapunov function V Ω is constructed as Differentiating V Ω with respect to time and invoking Eq. (43) yielḋ Meanwhile, by considering Eq. (1), the derivative of e w can be obtained aṡ Then, the control law is designed as where K w ∈ R 3×3 is the positive definite matrix to be designed, that is, K w = K T w > 0. Thus, substituting Eq. (47) into Eq. (46) yieldsė For error dynamic (48), the Lyapunov function V w is selected as Taking the derivative of V w with respect to time and invoking Eq. (18),V ω can be written aṡ Motivated by above discussions, as for the system (1), the stability analysis of the SFE protection control law designed based on the HODO and the backstepping method can be summarized as the following theorem. Theorem 1 For the nonlinear attitude control UAV system (1) under outside disturbance, Assumptions 1 and 2 are satisfied, the design of HODO is shown in (10), the SFE under external disturbance is defined in (9) and computed by (19), the constrained desired trajectories are designed by (25), (26), and (27), based on which the safety desired trajectories are obtained by (29), and the design of virtual control law x * 2 and control input u are designed as (42) and (47). Then, as for the performance functions ρ i (t), i = (α, β, µ) taken as (21) with 0 < δ i < 1 and the safety margin constants τ i > 0, the UAV attitude SFE protection tracking errors are bounded convergent, and the signals of all closed-loop systems are uniformly bounded if there exist positive definite matrices w 1 , K Ω , K ω and K such that Proof. In order to prove Theorem 1, the overall Lyapunov function V is constructed as Taking the derivative of V with respect to time, invoking Eqs. (33), (45), (50), and noticing the fact that where ϖ = min {σ min (w 1 − 0.5I) , σ min (K Ω ) , σ min (K ω − 0.5I) , σ min (K 2 − I)} > 0, σ min (L) represents the smallest eigenvalue of matrix L, c 0 = 0.5η 2 r + 0.5Q. According to Lemma 1, the signals of the closed-loop system are uniformly bounded, and the proof of Theorem 1 is completed.

Numerical Simulations
In this section, simulations are presented to calculate AES under disturbance, based on which the effectiveness of the proposed SFE protection controller is verified.
Set the initial conditions for the simulation: flight altitude H(0) = 3000m, flight velocity V (0) = 150m/s, engine thrust T = 20000N , attitude angle α(0) = β(0) = µ(0) = 5 • , attitude angle rate p(0) = q(0) = r(0) = 5 • /s. In the simulation, the trust region algorithm is used to solve Eq. (19) ,and the parameters are selected as S 1 = diag(3, 3, 3), S 2 = diag(1, 1, 1). Moreover, the disturbance d(t) is assumed as d(t) = [0.25 sin(t), 0.3 sin(1.5t), 0.25 sin(2t)] T . The desired trajectories are taken as: By exploiting Theorem 1 and taking the order of HODO as 2, the gain matrices of the HODO are taken as k 1 = diag(10, 10, 10), k 2 = diag (3,3,3). The parameters of the prescribed performance functions are taken as: ρ α0 = ρ β0 = ρ µ0 = 0.2rad, ρ α∞ = ρ β∞ = ρ µ∞ = 0.01rad, l α = l β = l µ = 1, δ α = δ β = δ µ = 0.8. The safety margin constants are τ α = τ β = τ µ = 0.05rad. The parameter of first-order filter is selected as w 1 = diag (12.5, 12.5, 12.5). The controller gain matrices are taken as K Ω = K ω = diag (5,5,5). Based on Theorem 1, the selection of the designed parameters is mainly based on Eq. (51), and the parameters satisfying Eq. (51) can meet the desired control target. Moreover, the initial values of the internal states z 1 and z 2 of the HODO are taken as z 1 = z 2 = [0, 0, 0] T . The simulation is mainly from the SFE calculation and the requirements of the safety tracking accuracy to debug the parameters. Then, a series of parameter values are selected, and the optimal parameters are obtained according to the disturbance tracking error and SFE tracking accuracy. Figures 3 show the comparisons of the SFE under disturbance and the one without disturbance. It can be seen from Figure 3 that compared with the case without disturbance, the SFE under disturbance can shrink significantly, which means that when designing a boundary protection controller, the impact of disturbance should be taken into account. Otherwise, the performance loss of flight control may occur. The safety tracking curves of the attack, sideslip, and roll angles are illustrated in Figures 4 -6. Figure 4 indicates that the attitude protection control law of this paper can achieve adequate protection against the angle of attack. The desired signal of the attack angle does not violate the lower bound of the safety boundary in the whole control process. However, it violates the upper bound of the safety boundary for many times. Due to the time-varying safety margin, when the reference signal of the attack angle is close to the upper bound of the SFE, the SFE protection control system makes corresponding modifications to the reference signal of the attack angle, which can ensure the flight safety and avoid LOC. It follows from Figures 5 -6 that the designed attitude protection control law can realize the protection of sideslip angle and roll angle. During the entire control process, the sideslip angle reference signal and the roll angle reference signal violate the upper and lower bounds of the SFE for many times, and the protection control system successfully adjusts the signal to violate the boundary to ensure flight safety.  The attitude angle tracking errors in the protection control process are shown in Figure 7. Figure 7 shows that the tracking errors are strictly limited in the upper and lower bounds composed of prescribed performance functions. With time on, the upper and lower bounds of the preset performance gradually decrease, the attitude angle tracking error converges, and the prescribed performance conditions are always satisfied. Moreover, we give the detailed diagrams of attack angle SFE, desired trajectory, constraint desired trajectory, safety desired trajectory, and actual tracking trajectory in the protection control process, as shown in Figures 8. It can be seen from Figure 8 that the desired constraint trajectory, the safety desired trajectory, and the actual tracking trajectory are strictly limited within the SFE constraints, which ensures the flight safety. Finally, each channel's disturbance and estimated value are presented, as shown in Figure 9. Figure 9 indicates that the HODO designed in this paper can quickly and accurately estimate unknown time-varying disturbances.

Conclusions
In this paper, as for the attitude dynamic model of the UAV system under disturbance, the extension and calculation of the SFE based on HODO and AES was firstly investigated. Secondly, a time-varying  safety margin function was constructed, and a desired safety trajectory generation method was proposed. Then, by combining the prescribed performance control, the HODO, and the backstepping method, a SFE protection controller was designed. Finally, simulation results showed that the SFE under disturbance could shrink obviously, and the SFE protection control scheme could could achieve the protection of the attitude angles during tracking control. In this article, we mainly focused on the theory and the simulation rather than the experiment, which was mainly due to the lack of supporting conditions for doing the experiment. If possible in the future, we will make up for the experiment.
The main advantages of this paper are summarized in what follows. Firstly, the disturbances are considered in the computation of the SFE, and the influence of the disturbances on the SFE is analyzed. Secondly, a method for generating the safety desired trajectory is constructed based on the time-varying safety margin function and first-order filter, which guarantees that the desired trajectory remains within the SFE. Finally, a SFE protection controller is deduced by combining the HODO, prescribed performance control, and the backstepping method. In the future studies, both model uncertainties and outside disturbance in the UAV system will be jointly considered. Moreover, the protection control inside the SFE with the one outside the SFE will need to be considered simultaneously to ensure the flight safety in the case of state crossing caused by a sudden change of state.

Conflict of Interest
The author declare no conflict of interest.

Data Availability
No data are associated with this article.

Authors' Contributions
Biao Ma contributed to the investigation, writing, and validation. Mou Chen contributed to the methodology, project administration, and conceptualization.  (a) dp anddp.