Model Predictive Control Based on ILQR for Tilt-Propulsion UAV

: The transition ﬂight of tilt-propulsion UAV is a complex and time-varying process, which leads to great challenges in the design of a stable and robust controller. This work presents a uniﬁed model predictive controller, which can handle the full envelope from vertical take-off and landing to cruise ﬂight, to mean that the UAV can achieve a near-optimal transition ﬂight under uncertainty conditions. Firstly, the nonlinear dynamic model of the tilt-propulsion UAV is developed, in which the aerodynamic/propulsion coupling effect of the ducted propeller is considered. Then, a control framework, including global trajectory planning and ﬁnite horizon control, is designed. Taking the planned global trajectory as the reference input, a controller is proposed with an inner layer based on ILQR optimization and an outer layer based on feedback correction and forward rolling of the MPC frame. The ILQR-MPC controller has high computational efﬁciency to deal with nonlinear problems, and has the ability to give full play to UAV’s control ability and suppress uncertainty. Finally, the simulation results show that ILQR-MPC controller obviously performs better than the ILQR feedforward controller, and gains a scheduling PID controller and MPC controller.


Introduction
Vertical take-off and landing (VTOL) aircraft have two outstanding advantages: flexible take-off and landing, without the requirement for airport conditions, and a long endurance with high-speed cruise ability. In terms of military use, it could be used for mountain battle and VTOL from ships, while more and more VTOL urban aircrafts are gradually emerging for civil use. Therefore, based on its significant advantages and great application prospects, VTOL aircraft have attracted more attention in recent years [1][2][3][4].
VTOL aircrafts are mainly classified into tilt-rotor aircraft [5], tilt-wing aircraft [6], tilt-propulsion aircraft [7], tail-seat aircraft [8], etc. These four kinds of aircrafts realize mode transition between VTOL flight and high-speed cruise through thrust vector tilting. The transition flight is a crucial and complex process. Taking the tilt-propulsion aircraft as an example, in transition flight, the aerodynamic force of the wing rapidly changes with the airspeed, the propulsion system has a time-varying propulsion and aerodynamic characteristics, and the system has obvious uncertainty; therefore, the challenges in tiltpropulsion aircraft development are mainly the transition trajectory plan and the control scheme design of a transition flight.
As in the commercial PixHawk autopilot, the common approach to VTOL UAVs is to design two or three sub-controllers [9][10][11], in which some schemes with only the rotor controller and the fixed-wing controller realize transition flight control by combining the two controllers. In addition, many researchers [12,13] split the control problem into several control regimes and focus on a smooth switch between the individual modes.
MPC is an advanced optimal control strategy based on the receding horizon, which can handle Multi-Input Multi-Output (MIMO) and nonlinear systems, as well as switching systems with soft and hard constraints [14]. Papachristos et al. [15] applied a Linear Model

Tilt-Propulsion UAV Configuration
We designed a novel tilt-propulsion UAV with BWB configuration (shown in Figure 1), consisting of fuselage, front propellers, ducted propellers, and elevon. The front propellers, composed of a pair of propellers, are symmetrical at the X axis of the fuselage, which cannot tilt, so that they just provide a vertical thrust for UAV. The ducted propellers were installed at the rear of the fuselage, dividing the left and right groups, and the ducted propellers have the ability to change thrust direction by tilting, with a range from π/2 to 0.

Tilt-Propulsion UAV Configuration
We designed a novel tilt-propulsion UAV with BWB configuration (shown in Figure  1), consisting of fuselage, front propellers, ducted propellers, and elevon. The front propellers, composed of a pair of propellers, are symmetrical at the X axis of the fuselage, which cannot tilt, so that they just provide a vertical thrust for UAV. The ducted propellers were installed at the rear of the fuselage, dividing the left and right groups, and the ducted propellers have the ability to change thrust direction by tilting, with a range from π⁄2 to 0.
TPUAV has a large flight envelope, including vertical takeoff and landing and highspeed cruise. Its flight modes are similar to those of a tiltrotor aircraft with rotor mode, transition mode and fixed-wing mode. In addition, there are two unique advantages of TPUAV compared with a traditional tiltrotor aircraft. On the one hand, the flexibly configured propulsion system and BWB configuration improve the lift-drag ratio as well as the aerodynamic efficiency. On the other hand, the design of the distributed propulsion system enhances the fault tolerance of the system and provides a stronger security guarantee for UAV.

Dynamic Model of TPUAV
Due to the special layout of TPUAV, the high complexity of the propulsion system, and the obvious changes in system equations during the transition process, it is necessary to develop a reliable dynamic model to achieve the global trajectory plan and high-precision control in transition flight.

Aerodynamic Model of Fuselage
The elevon of TPUAV has the functions of aileron and elevator of traditional aircraft.
The deflection of left surface is el δ and the right one is er δ ; then, the compound control variable could be expressed as

Ducted propellers
Front propellers Elevon TPUAV has a large flight envelope, including vertical takeoff and landing and highspeed cruise. Its flight modes are similar to those of a tiltrotor aircraft with rotor mode, transition mode and fixed-wing mode. In addition, there are two unique advantages of TPUAV compared with a traditional tiltrotor aircraft. On the one hand, the flexibly configured propulsion system and BWB configuration improve the lift-drag ratio as well as the aerodynamic efficiency. On the other hand, the design of the distributed propulsion system enhances the fault tolerance of the system and provides a stronger security guarantee for UAV.

Dynamic Model of TPUAV
Due to the special layout of TPUAV, the high complexity of the propulsion system, and the obvious changes in system equations during the transition process, it is necessary to develop a reliable dynamic model to achieve the global trajectory plan and high-precision control in transition flight.

Aerodynamic Model of Fuselage
The elevon of TPUAV has the functions of aileron and elevator of traditional aircraft. The deflection of left surface is δ el and the right one is δ er ; then, the compound control variable could be expressed as where δ a represents the equivalent deflection of aileron, while δ e represents that of elevator. The lift, drag, and pitch moment of the fuselage in the wind axis system could be expressed as where ρ is the air density, V is the airspeed, S is the reference area of fuselage (including the traditional wing), α = arctan(V z /V x ) is the angle of attack, c is the average aerodynamic chord, q is pitch angular speed, C L , C D , C M , respectively, denote the coefficients of lift, drag and pitch moment, and the different subscripts 0, α, q, δ e indicate that coefficients are related to different parameters.

Model of Front Propellers
The rotation of front propellers produces lift as well as reverse torque. The calculation formula of thrust and torque coefficient of the front propellers are expressed as follows where T f , Q f represent the thrust and torque of front propellers, respectively; n f , D f represent the rotation speed and diameter of front propellers, respectively. The incoming flow velocity would have an impact on the coefficients of thrust and torque, in which the influence of axial flow velocity is much greater than that of radial. However, the front propeller is perpendicular to the XZ plane of airframe. In the transition process, the axial component of the incoming flow is so small to ignore; therefore, the influence of incoming flow on the front propeller could be ignored. In real flight, the neglected part of the system model is regarded as uncertainty.

Model of Ducted Propellers
Compared with the isolated propeller, the external duct could provide an extra thrust when the incoming flow speed is low, so the ducted propeller has a higher propulsion efficiency. At present, the research on the isolated propeller has been quite perfect; however, for the ducted propeller, how to accurately describe the quantitative relationship between the rotor thrust and the total thrust needs to be fully explored.
The typical stations of the ducted propeller are introduced as follows: "1, out" respectively represent inlet station and outlet station; "2, 3", respectively, represent front and rear stations of the rotor disc; the subscript "∞" represents the variables related to free flow state. More details about typical stations are showed in Figure 2 and the real ducted propellers are showed in Figure 3. In this paper, the duct shape is a conventional circle with central symmetry; the airflow inside the duct is regarded as a uniform axial flow with the restoration of static pressure to free-flow static pressure at the outlet station.  Figure 2 and the real ducted propellers are showed in Figure 3. In this paper, the duct shape is a conventional circle with central symmetry; the airflow inside the duct is regarded as a uniform axial flow with the restoration of static pressure to free-flow static pressure at the outlet station.    The disc model can accurately describe the flow field change passing through the rotor and the upstream and downstream inviscid region [29]; as a result, it is still widely used. The thrust of rotor is expressed as ( ) The total thrust of the duct system is composed of the thrust of external duct and the rotor thrust. Based on the momentum equation in integral form [30], from the upstream constant pressure zone to the downstream outlet station, the total thrust is expressed as  The disc model can accurately describe the flow field change passing through the rotor and the upstream and downstream inviscid region [29]; as a result, it is still widely used. The thrust of rotor is expressed as The total thrust of the duct system is composed of the thrust of external duct and the rotor thrust. Based on the momentum equation in integral form [30], from the upstream constant pressure zone to the downstream outlet station, the total thrust is expressed as To define T s = C s T r where C s is the thrust ratio coefficient, and C st = 1 + C s represent the thrust enhancement coefficient, T = C st T r . With reference to [31], C st is developed below. When the input power of ducted propeller equal to zero, the first-order approximation of C st is written as Based on the linear fluid mechanics method, the axial flow of ducted propeller is divided into uniform flow relating to the thickness of duct airfoil, uniform flow passing through the rotor disk, and uniform flow around the bending of the duct inner wall.
Firstly, attention is focused on the velocity of the centerline to consider the influence of geometric parameters on the flow field. The centerline velocity has four components, and their nondimensional form is given by As with McCormick [30] and Lewis [32], the induced velocity along the nondimensional distance on the duct centerline could be obtained by integrating this with the Biot-Savart law. The radius of the ducted propeller inlet station, rotor disc station and outlet station are defined as r 1 , r, r out , the distance from inlet station to outlet station is l, the distance from inlet station to rotor disc station is x 1 , and the distance from rotor disc station to outlet station is x out . In the following formulas, R 1 = r 1 /r, R out = r out /r, X out = x out /r. The rotor contribution is modeled through a semi-infinite vortex cylinder, so that the wake rotation, as well as the wake contraction, are ignored. At downstream infinity, the centerline velocity is u out , which leads to Then, the induced velocity produced by the inner wall bending at the outlet station is calculated as The influence of airfoil thickness of duct on centerline velocity is expressed as Based on the equation of the conservation of mass on the centerline, it is considered that the mass flow at rotor disc station is equal to that of the outlet station. After algebraic operation, a new formula is obtained where A number of key design parameters are included in the thrust enhancement coefficient C st of the ducted propeller derived above, such as the radius of inlet and outlet station, and the length from the rotor disc station to the outlet station, which reflects the design characteristics of ducted propeller, and means that the parameters of C st have clear physical significance. A more detailed analysis can be found in References [29,31].
Based on the most widely used engineering model, the thrust coefficient of ducted propeller is written as where n d , D d represent the rotation speed and diameter of ducted propellers, respectively. The thrust coefficient has a linear relationship with the advanced ratio J = V ∞ /n d D d ; therefore, a further formulation could be obtained Combining Equations (5) and (13), the total thrust and rotor thrust of the ducted propeller could be obtained when the inflow conditions and the rotor speed are known. Furthermore, based on the Bernoulli equation (equations (b,f,h) of Equation (14)), momentum equation (equation (d) of Equation (14)) and mass conservation equation (equations Aerospace 2022, 9, 688 7 of 21 (c,g) of Equation (14)), we could gain the real-time velocity and pressure of each station of the internal flow field of the ducted propeller.
Further simplifying, Equation (14), the centerline velocity at rotor disc station leads to The working state of the internal rotor would have an impact on the aerodynamic force of the external duct. Therefore, the aerodynamic model of ducted propeller is modified below.
The aerodynamic force of the ducted propeller mainly comes from the external duct. The duct is generally a body of revolution around an airfoil, whose characteristics are very similar to the ring-wing. Werle [33] verified the reliability of a linear inviscid aerodynamic model through a number of experiments and computational data, which could calculate the lift of the duct/ring-wing (without rotor) at different angles of attack. Based on this model, the aerodynamic coefficient of ducted propeller can be obtained with the zero input of the internal rotor.
The tilt angle of ducted propeller is defined as ζ, and the attack angle of UAV is α; therefore, the real attack angle of ducted propeller is α d = α + ζ as Figure 4 showed.
Further simplifying, Eq. (14), the centerline velocity at rotor disc station leads to The working state of the internal rotor would have an impact on the aerodynamic force of the external duct. Therefore, the aerodynamic model of ducted propeller is modified below.
The aerodynamic force of the ducted propeller mainly comes from the external duct. The duct is generally a body of revolution around an airfoil, whose characteristics are very similar to the ring-wing. Werle [33] verified the reliability of a linear inviscid aerodynamic model through a number of experiments and computational data, which could calculate the lift of the duct/ring-wing (without rotor) at different angles of attack. Based on this model, the aerodynamic coefficient of ducted propeller can be obtained with the zero input of the internal rotor.
The tilt angle of ducted propeller is defined as ζ , and the attack angle of UAV is α ; therefore, the real attack angle of ducted propeller is d α α ζ = + as Figure 4 showed. The expression of the aerodynamic lift coefficient of the ducted propeller is given by where C D0d is the drag coefficient under zero lift, α d is the attack angle of duct, and AR = l/d is the equivalent aspect ratio of duct. The expression of aerodynamic drag coefficient of the ducted propeller is given by where e denotes the Oswald efficiency factor of duct, with AR = 2, e = 1.36 and AR = 1, e = 1.25. Further, it is easy tot th obtain calculation formula for the lift and drag of the ducted propeller with S d = l * d: Therefore, the axial and normal aerodynamic forces of the ducted propeller are written as follows: The internal flow field changes with the working state of the internal rotor. Referring to the approach used in engine model [31], the normal force of the external duct is corrected according to the mass flow variation at the rotor disc station, Therefore, the longitudinal force and moment in the ducted propeller frame are obtained: 2.2.4. Dynamic Model Γ I = (x, y, z) denotes the inertial coordinate frame. Γ B = (x B , y B , z B ) denotes the body coordinate frame attached to the c.g. of TPUAV. Γ F = (x F , y F , z F ) denotes the body translation coordinate frame, and its coordinate origin is fixed on the centre of the front propellers. Γ D = (x D , y D , z D ) denotes the ducted propellers coordinate frame, whose origin is at the center of the ducted propellers.
The external forces of TPUAV are modeled in different coordinate frames, so their action positions and vector directions are different. To concentrate the external forces and moments into the body coordinate frame, a number of transformation matrices are introduced, as follows.
R BI denotes the transformation matrix from the inertial coordinate frame to body coordinate frame, in which simplified expressions are used: where φ, θ, ψ are Euler angles representing roll, pitch, yaw angle, respectively. R BD denotes the transformation matrix from coordinate Γ D to coordinate Γ B .
where ζ represents the tilt angle of the ducted propellers. The transformation matrix from air coordinate frame to body coordinate frame is R αβ where α, β represents the angle of attack and angle of sideslip. The external forces acting on the TPUAV include gravity, aerodynamic force of fuselage, front propellers' thrust and force produced by ducted propellers. Combining the Equations (2), (3), and (24), the total forces and moments are expressed in the body coordinate frame as follows where b f denotes the distance between the left and right hubs of the front propellers, c f denotes the distance between the midpoint of hubs connection line and the c.m. of TPUAV, c d denotes the distance from the thrust center point of the ducted propellers to the c.m. of Furthermore, the nonlinear dynamic model, including the translation model and rotation model, could be formulated as follows

Method
The transition flight of TPUAV is a nonlinear, time-varying process with an aerodynamic coupling effect and strong uncertainty. In order to realize a safe, stable, even optimal transition flight, the transition trajectory plan and controller design is presented in this section.

ILQR Formulation
Consider a nonlinear system with discrete-time dynamics, which is expressed by the generic form This dynamic model describes the evolution from the last time to next in the state x t , given the control u t .
Based on Equation (30), the discretized optimal control problem (OCP) takes the following form where x, u represent state and control trajectories, T represents the number of knots, t represents the discrete time, f 0 represents the initial state, l T , l represent terminal and intermediate cost functions, used to define the tasks the UAV has to perform, and to regularize state and control trajectory.
Differential Dynamic Programming (DDP) is an efficient method featuring a superlinear convergence rate with linear complexity in the horizon length. Unlike the Differential Dynamic Programming accounting for the second-order derivatives of the dynamics, ILQR only linearizes the dynamics using Taylor expansion, which is beneficial when simplifying the computation complexity. Then, Equation (31) would be solved by ILQR. Based on Bellman's principle [34], the optimal solution would be obtained through ILQR cyclic iteration. The control trajectory is obtained in the backward pass, while the state trajectory is updated in the forward pass until the solution reaches convergence.
ILQR computes the state trajectory according to the initial or updated control law in the forward process. Additionally, the system is linearized and a quadratic approximation of the cost function is computed around the reference trajectory.
Equation (32) denotes the quadratic approximation of cost function around the reference trajectory, where l x , l u , l xx , l xu , l uu are the gradients and Hessians of the cost function. The value functions and control gains are computed during the backward pass. As with Tassa [26], the second-order expansion of Q is given by where f x , f u are the first derivation of dynamics about state and control. Then, the optimal control modification ∆u * for ∆x could be obtained by minimizing the value of Q, Therefore, the feedforward modification and feedback gain matrix are written as Then, plugging updated control law back into the Q function, the expression of V is obtained where the backward pass begins from V T = l xx , v T = l x .
Additionally, the locally linear control law is evaluated with a forward pass once the backward pass is completed. The control law would be optimized by an approach called lineal search [35].

Global Trajectory Plan Based on ILQR
The transition window of TPUAV is narrow, with many constraints. In order to achieve a safe, stable and even optimal transition flight, it is necessary to comprehensively consider all variables for global trajectory planning to provide a flight reference for the controller.
The essence of the trajectory planning of TPUAV is to find the optimal flight trajectory between the initial state and the terminal state. In this paper, the trajectory planning for the transition process of TPUAV is formed as an optimal control problem, which is solved based on ILQR. The trajectory planning would be completed offline with the global time domain of the transition process, which is run until cost function convergence, and, finally, the optimal control trajectory and state trajectory are obtained. Algorithm 1 summarizes the global trajectory planning of TPUAV.
We denote the state variables by x = [V, q, θ, H], and the corresponding input actions as u = δ f , δ d , δ e . The system dynamics of the UAV are discretized for trajectory planning with a sampling time of t s and a planning horizon of N. Let x(t), u(t) denote the state and input, respectively, at time-step t, and t f denotes terminal time. To ensure that the states reach the prescribed set points and delivers unputs that are as small as possible in the transition process, it is necessary to design a suitable cost function. The quadratic approximation of the cost function is calculated in ILQR, and the quadratic function is widely used and easy to adjust. Therefore, referring to the standard Bolza form, the cost function of global trajectory planning is designed as: where x represents the deviation of a state from a desired one, u represents the input, and P, Q, R are the weight matrices of terminal cost, state cost and input cost, respectively. More details about cost function (37) are shown in Table 1. Table 1. Weights for state, input and terminal cost of global trajectory plan. In addition, formulating the tilt angle of ducted propellers as Algorithm 1 Global trajectory plan based on ILQR 1: Input 2: System dynamics:

Finite Horizon Optimal Control Based on ILQR-MPC
We designed an MPC controller based on ILQR to realize optimal control in a finite horizon. The main concept is that the new flight state constantly triggers MPC updates, and the ILQR within MPC continuously circulates to compute the control trajectory until convergence. Algorithm 2 summarizes the proposed approach. Algorithm 2 Finite horizon optimal control based on ILQR-MPC 1: Input 2: Reference trajectory: 3: optimal state trajectory x * (produced by global trajectory planning) 4: System dynamics:

6:
Tilt law: ζ(t) 7: Output 8: Optimal control: u = u * (1) 9: Repeat 10: Warm starting 11: Initial control trajectory: u 0 = u * (2) · · · u * (N) u * (N) 12: Run ILQR (similar to Algorithm 1) 13: Prediction horizon N 14: Weight matrixes P 2 , Q 2 , R 2 15: Feedback compensation 16: Prediction model compensation: f = f dyn + f f bc 17: Until terminal time (1) Reference trajectory The global trajectory planned in Section 3.2 was taken as the reference trajectory of the MPC controller. The tracking effect for global trajectory is an important performance measure during transition flight. We focused on the track of the airspeed and pitch angle of the global trajectory. As the altitude is expected to be stable in transition flight, the desired altitude was designed to be constant.
(2) Cost function There is a difference in the design requirements for finite-time optimal control and global trajectory plan, so the weights of their cost functions are different. In order to realize smooth transition and utilize the results of the global trajectory plan, the weight of state-tracking was designed to be bigger in the MPC controller. Additionally, the terminal weight was designed, referring to the Riccati solution of LQR.
(3) Warm starting ILQR of the MPC controller needs to be provided with an initial control trajectory, which determines the convergence speed of ILQR. When running an MPC at a high frequency, the subsequently produced control trajectories usually do not significantly deviate from each other. Therefore, the last controller could provide a good initialization for the next one.

4) Feedback correction
On the one hand, at each new sampling time, the rolling optimization of MPC controller is realized based on the current state to prevent the system error from being too large to effectively track the desired state because of a model mismatch or external disturbance. On the other hand, according to the error between the system state of TPUAV and the state computed by prediction model, a feedback correction matrix was designed for the uncertainty compensation to correct the system model.
The ILQR-MPC controller continuously updates the control action with its rolling optimization at each sampling time, with stronger robustness and greater control effect than the ILQR controller.
The Control frame is shown in Figure 5.

Results
To verify the performance of the ILQR-MPC controller, the simulation results TPUAV are provided in this section.

Simulation System Description
The simulations were carried out based on matlab/simulink with the help of Int Core i7-1065g7 CPU with 16 GB of RAM.
The model parameters of TPUAV are provided as follows: the mass of UAV

Results
To verify the performance of the ILQR-MPC controller, the simulation results of TPUAV are provided in this section.

Simulation System Description
The simulations were carried out based on matlab/simulink with the help of Intel Core i7-1065g7 CPU with 16 GB of RAM.
The model parameters of TPUAV are provided as follows: the mass of UAV is m = 10 kg , the fuselage/wing area is S = 1.01 m 2 , the chord is c = 0.4 m, the diameter of front propeller is R f = 0.28 m, the distance from center of front propellers to c.g. is l f = 0.455 m, the diameter of ducted propeller is R d = 0.14 m , and the distance from center of ducted propellers to c.g. is l d = 0.425 m.

Main Results
A gain scheduling PID controller was designed with reference to commercial autopilot PX4, composed of a rotor controller and a fixed-wing controller. Additionally, an MPC controller was designed simiarly to that of Manzoor et al. [21].
Then, the simulations of transition flight were performed for comparison between the ILQR-MPC with an ILQR feedforward controller, the PID controller and the MPC controller.
Before control performance verification, we planned the global trajectory for the transition flight first. Compared with the tracking terminal desired state, the tracking global trajectory would gain a smoother state variation and avoid input saturation.
The simulations would be performed based on conditions without and with uncertainty, respectively, as in the following. The initial states of TPUAV are denoted as follows: The prediction horizon, control horizon and sample time employed in this paper are given as N c = N p = 40, ts = 0.05 s.
The cost function (shown in Algorithm 2) of the MPC controller is designed as MPC The design of the cost function of the MPC controller is based on multiple optimization objectives, among which good tracking for the reference trajectory is the most important one. In addition, the input should be as small as possible to save energy consumption in the transition flight.
To improve the performance of the controller, the weights were empirically tuned during the testing process (shown in Table 2). Table 2. Weights for state, input and terminal cost of MPC controller.
Under the condition of no uncertainty (shown in Figures 6 and 7), both the ILQR feedforward controller and ILQR-MPC controller achieve an excellent control effect. Both controllers have smooth inputs, maintain the altitude at the desired point, and realize the airspeed and pitch angle well-tracking. However, the PID controller based on the PX4 framework has a general control effect from the tracking of airspeed and pitch angle, and has obvious deviations in the most important altitude tracking. Due to the singleinput and single-output characteristics, PID controller cannot account for altitude, speed and pitch angle tracking at the same time. Even the altitude sub-controller and attitude sub-controller compete for the control ability, so cooperative control between multiple inputs and multiple outputs cannot be realized. The computation of MPC depends on the linearization dynamics at the initial time of the finite horizon. Unfortunately, the transition flight is a complex, nonlinear, time-varying process, so the model error in MPC is more significant than that of ILQR-MPC, which linearizes the dynamics along the trajectory. Therefore, the control effect of MPC controller is slightly inferior to that of the ILQR-MPC controller. However, it has better control precision than the PID controller.   The manipulation difference between ILQR-MPC and PID controllers is mainly shown in the second half of the transition flight (5 s~10 s). The throttle of the ducted propellers δ d of the ILQR-MPC controller is significantly higher than that of the PID controller, while the throttle of the front propeller δ f of the ILQR-MPC controller is lower. In addition, the δ e is smaller, meaning that the upward deflection angle of elevon is larger based on the ILQR-MPC controller (the downward deflection is positive). When the tilt angle of the ducted propellers is large, the UAV overcomes the drag by lowering its head, while the UAV relies on the thrust horizontal component of the ducted propellers to obtain a stronger acceleration ability when the tilt angle is small. The δ d of the ILQR-MPC controller is larger, so it achieves better speed-tracking in transition flight. After 8s, δ f of the ILQR-MPC controller reduces to zero; that is, the front propellers stop, which is a reasonable operation for the following two reasons: on the one hand, a smaller δ f leads to more energy being saved, and on the other hand, as the flight mode gradually changes to a fixed-wing mode, the front-propeller propellers are no longer required to provide lift. In second half of the transition flight, the airspeed is big enough, and the attitude control has a better efficiency based on aerodynamic surfaces than the thrust differential produced by the front propellers and the ducted propellers, so the elevation deflection angle of the ILQR-MPC controller is larger.
Considering that there are uncertainties such as system modeling errors and external environment disturbance, more simulations are taken for conditions with uncertainty in transition flight. System uncertainties in simulations are modeled as the Gaussian white noise (shown in Figure 8), with different noise intensities in each direction according to their characteristics.
In addition, the e is smaller, meaning that the upward deflection angle of elevon is larger based on the ILQR-MPC controller (the downward deflection is positive). When the tilt angle of the ducted propellers is large, the UAV overcomes the drag by lowering its head, while the UAV relies on the thrust horizontal component of the ducted propellers to obtain a stronger acceleration ability when the tilt angle is small. The d δ of the ILQR-MPC controller is larger, so it achieves better speed-tracking in transition flight. After 8s, f δ of the ILQR-MPC controller reduces to zero; that is, the front propellers stop, which is a reasonable operation for the following two reasons: on the one hand, a smaller f δ leads to more energy being saved, and on the other hand, as the flight mode gradually changes to a fixed-wing mode, the front-propeller propellers are no longer required to provide lift. In second half of the transition flight, the airspeed is big enough, and the attitude control has a better efficiency based on aerodynamic surfaces than the thrust differential produced by the front propellers and the ducted propellers, so the elevation deflection angle of the ILQR-MPC controller is larger.
Considering that there are uncertainties such as system modeling errors and external environment disturbance, more simulations are taken for conditions with uncertainty in transition flight. System uncertainties in simulations are modeled as the Gaussian white noise (shown in Figure 8), with different noise intensities in each direction according to their characteristics.  The ILQR feedforward controller cannot suppress the significant uncertainty leading to the rapid deterioration in the control effects, which leads to serious altitude errors, and even the risk of crash. Although the control effect of the PID controller is only slightly reduced, the inputs are greatly shaken, bringing a great burden to actuators.
Based on feedback correction, MPC and ILQR-MPC have the advantage of disturbance rejection. Therefore, the altitude tracking error of the ILQR-MPC controller is very small during the whole transition flight, with the smooth change in airspeed and pitch angle. ILQR-MPC linearizes the dynamics along the state trajectory, which has two advantages. On the one hand, the ILQR-MPC has linear complexity to improve the computation efficiency and greatly reduces the difficulty in solving nonlinear problems. On the other hand, the method with dynamics linearization at discrete points has a higher control precision than MPC [21]. To suppress the disturbance caused by high-frequency Gaussian white noise, the input variation in MPC and ILQR-MPC controllers is no longer smooth. However, based on the receding horizontal optimization, MPC and ILQR-MPC controllers can make full use of the dynamics used to predict states in the future time domain; therefore, the chattering of inputs is much smaller than that of the PID controller. Overall, compared with the ILQR feedforward controller, PID controller and MPC controller, ILQR-MPC can deal with uncertainties more effectively, with stable inputs and state tracking.

Implementation
The ILQR-MPC controller proposed in this paper is suitable for a full flight envelope. Although the main goal is to achieve the optimal transition flight of TPUAV, the controller is also applicable to rotor and fixed-wing modes. In order to prove the full envelope control ability of the ILQR-MPC controller, two simulations would be designed, in the rotor mode and fixed-wing mode, respectively.
The results in Figure 11 show that the ILQR-MPC controller has a fast and accurate tracking response with a smooth change of states. TPUAV lowers its head quickly to improve velocity near the time of 2s , and raises its head sharply near the time of 6s to realize rapid deceleration by the horizontal component of thrust and aerodynamic resistance. Under this velocity step commander, the altitude tracking error is kept within 0.2m , which reflects the applicability of the ILQR-MPC controller in the rotor mode. The ILQR feedforward controller cannot suppress the significant uncertainty leading to the rapid deterioration in the control effects, which leads to serious altitude errors, and even the risk of crash. Although the control effect of the PID controller is only slightly reduced, the inputs are greatly shaken, bringing a great burden to actuators.
Based on feedback correction, MPC and ILQR-MPC have the advantage of disturbance rejection. Therefore, the altitude tracking error of the ILQR-MPC controller is very small during the whole transition flight, with the smooth change in airspeed and pitch angle. ILQR-MPC linearizes the dynamics along the state trajectory, which has two advantages. On the one hand, the ILQR-MPC has linear complexity to improve the computation efficiency and greatly reduces the difficulty in solving nonlinear problems. On the other hand, the method with dynamics linearization at discrete points has a higher control precision than MPC [21]. To suppress the disturbance caused by high-frequency Gaussian white noise, the input variation in MPC and ILQR-MPC controllers is no longer smooth. However, based on the receding horizontal optimization, MPC and ILQR-MPC controllers can make full use of the dynamics used to predict states in the future time domain; therefore, the chattering of inputs is much smaller than that of the PID controller. Overall, compared with the ILQR feedforward controller, PID controller and MPC controller, ILQR-MPC can deal with uncertainties more effectively, with stable inputs and state tracking.

Implementation
The ILQR-MPC controller proposed in this paper is suitable for a full flight envelope. Although the main goal is to achieve the optimal transition flight of TPUAV, the controller is also applicable to rotor and fixed-wing modes. In order to prove the full envelope control ability of the ILQR-MPC controller, two simulations would be designed, in the rotor mode and fixed-wing mode, respectively.
Under the rotor mode, the tilt angle of the ducted propeller is 90 • , and the core indexes are altitude-tracking and velocity-tracking. The reference trajectory is designed as The results in Figure 11 show that the ILQR-MPC controller has a fast and accurate tracking response with a smooth change of states. TPUAV lowers its head quickly to improve velocity near the time of 2 s, and raises its head sharply near the time of 6 s to realize rapid deceleration by the horizontal component of thrust and aerodynamic resistance. Under this velocity step commander, the altitude tracking error is kept within 0.2 m, which reflects the applicability of the ILQR-MPC controller in the rotor mode.  Subsequently, the reference trajectory for fixed-wing mode simulation is designed In this simulation shown as Figure 12, TPUAV accelerates to cruise speed and goes through the process of first climbing and then descending. The throttle input of the ducted propeller is large during the acceleration process, while the throttle input remains stable in final cruise flight. When TPUAV climbs, the path angle is positive, so the pitch angle is large. On the contrary, when TPUAV descends, the path angle is negative, and the pitch angle is small. Under the complex flight command, the altitude tracking error remains within 0.2 m, which reflects the applicability of the ILQR-MPC controller in fixed-wing mode. In this simulation shown as Figure 12, TPUAV accelerates to cruise speed and g through the process of first climbing and then descending. The throttle input of the duc propeller is large during the acceleration process, while the throttle input remains sta in final cruise flight. When TPUAV climbs, the path angle is positive, so the pitch ang large. On the contrary, when TPUAV descends, the path angle is negative, and the p angle is small. Under the complex flight command, the altitude tracking error rem within 0.2m , which reflects the applicability of the ILQR-MPC controller in fixed-w mode.   In addition, the R matrix of the controller in rotor and fixed-wing modes are different from the transition flight, which are proposed as R rotor = diag (20,20,2000), R rotor = diag (2000,20,20) for a simpler and clearer control logic.

Conclusions
This work presents a new MPC controller for the transition flight of tilt-propulsion UAV, and verifies the controller performance using simulations. To accurately describe the dynamic behavior of UAV in transition flight, a ducted propeller model with aerodynamic/propulsion coupling is proposed; furthermore, a high-precision dynamic model is developed. Then, a control framework of transitional flight, including offline global trajectory planning and online finite-horizon control is proposed, which has good computation efficiency to solve nonlinear problems such as transition flights due to the application of ILQR. The finite-horizon controller is a unified MPC controller for the full transition envelope, which could be applied from the rotor mode to fixed-wing mode, making full use of configurations to develop the control potential of UAV. The simulations show that the ILQR-MPC controller has a better control effect, more reasonable control logic, and stronger anti-interference ability compared with the ILQR feedforward controller, gain scheduling PID controller and MPC controller.