Gain scheduled linear quadratic control for quadcopter

This study exploits the dynamics and control of quadcopters using Linear Quadratic Regulator (LQR) control approach. The quadcopter’s mathematical model is derived using the Newton-Euler method. It is a highly manoeuvrable, nonlinear, coupled with six degrees of freedom (DOF) model, which includes aerodynamics and detailed gyroscopic moments that are often ignored in many literatures. The linearized model is obtained and characterized by the heading angle (i.e. yaw angle) of the quadcopter. The adopted control approach utilizes LQR method to track several reference trajectories including circle and helix curves with significant variation in the yaw angle. The controller is modified to overcome difficulties related to the continuous changes in the operating points and eliminate chattering and discontinuity that is observed in the control input signal. Numerical non-linear simulations are performed using MATLAB and Simulink to illustrate to accuracy and effectiveness of the proposed controller.


Introduction
Quadcopters have significantly impacted the commercial and industrial fields with their multifaceted applications. They are ideal platforms for aerial photography, inspection, surveillance, and search and rescue missions in complex and dangerous environments due to their low cost, small size, superior mobility and hover capability. Many researchers are currently working on enhancing the quadcopter's capability and performance, especially when it comes to stability and control issues [1].
In literatures, researchers have designed various linear, nonlinear or even hybrid control techniques such as Proportional-Integral-Derivative (PID), Linear Quadratic Regulator (LQR), Sliding Mode, Backstepping, Model Predictive Control (MPC) and Robust Control techniques [2][3][4][5][6][7][8]. Most of these techniques have been successfully applied only for near hovering conditions. However, under the wide range of operating conditions or aggressive manoeuvres, it is difficult to control the quadcopter since it is a highly manoeuvrable, nonlinear, coupled and under-actuated system (i.e. it has four input forces with six output coordinates, so having an under-actuated degree of two). This paper is focused on improving the difficulties associated with LQR controller by considering actuator saturation, continuous changes of operating points with high manoeuvrability and chattering of the control input signal. Moreover, it utilizes an accurate mathematical model of quadcopter based on the Newton-Euler nonlinear detailed formulation. This mathematical model includes the gyroscopic rotor dynamics and aerodynamics drag and moments that affect the quadcopter.

Dynamic Model
Quadcopter has four rotors arranged in a planar fashion. Two of these rotors are opposite to each other rotate in clockwise direction and the other to rotate in counter-clockwise direction. Changing  speeds results in changing the overall lift an moments produced by the quadcopter. The quadcopter X configuration used in this study is shown in Figure 1, with body frame denoted by (xb, yb, zb) and the world frame denoted by (x, y, z) [7][8].   to Equation 9, it is evident that this system is under actuated since it has four inputs ( 1 , 2 , 3 , 4 ) with six coordinate outputs ( , , , , , ). In next section, the linearized model is obtained and LQR controller is employed to track several reference trajectories with a constant or varying heading angle ( , , , ).

LQR Controller Design
This linear parameter varying system is observable and controllable of rank 12 as found in Ref. The gain matrix can be computed using the following Matlab command, = ( , , , ). As observed in Equation 24, matrix is a parameter linear varying matrix in the heading angle, . To maintain stability, three LQR controllers are implemented and tested to track a time varying reference trajectories (i.e. circular and helical) with varying heading angle for the following cases: (1) fixed-gain control, where the controller gain is constant and the linearized model is evaluated at constant nominal heading angle, (2) gain-scheduled control, which the controller gains are switching based on heading angle reference value described by Equation 27 as shown in Figure 2

Results and Discussion
To assess the performance of the developed controller, Matlab and Simulink environments are applied in the numerical simulation. The quadrotor's parameters are taken from Ref. [2] and Ref. [7] based on the OS4 hardware. For physical implementation purposes, actuators' saturation limits are considered in the simulation. The numerical values of and matrices are tuned by trial and error method. These matrices are diagonal and have the following values: = diag(10,10,10,1,1,1,1,1,10,1,1,1) and = diag(0.001,.001,0.001,.001).
Simulation results are presented for the three cases mentioned in the previous section: (1) tracking circular trajectory with variable heading angle using LQR fixed-gain control, (2) tracking circular and helical trajectories with variable heading angle using LQR gain-scheduled control and (3) tracking circular and helical trajectories with variable heading angle using LQR continuous gain control. Figure  3 shows the 3D and 2D time history of the states (blue lines) and control input to track a circular reference trajectory (red dotted lines) with variable heading angle. In this figure, the LQR fixed-gain control is computed based on the linearized model at constant heading angle ( = 0). It is observed that this controller is no longer guaranteed stability as the heading angle deviates away from the value about the linearization is taken. To correct this issue, the LQR gain-scheduled control is employed and tested to track circular and helical trajectories with varying heading angles as shown in Figure 4 and Figure 5. In these figures, the controller is stable and able to track the reference signals. However, while the gain-scheduled control is successful in tracking various reference trajectories, the physical limitations of the control efforts need to be considered during implementations. Figure 6(a) shows the control efforts to track the helical trajectory for gain-scheduled case. As a result of switching discretely between operating points of gain-scheduled control, it is observed that there are discontinuity and chattering in the control input signals, which affect physical implementation of this control law. It is found that these limitations can be eliminated by employing continuous gain control techniques as shown in Figure 6(b). Furthermore, it is noted on all simulated cases that there are steady state errors in tracking reference signals. These errors can be reduced through proper selection of and weighting matrices. To have zero state error, the LQR method should be modified to include and integral action in the control law.

Conclusion
In this paper, a detailed mathematical model of quadcopter is derived using Newton-Euler method, including aerodynamic moments and gyroscopic nonlinear terms. Then, a parameter varying linearized model is obtained by linearizing the nonlinear model around the steady state values. The LQR control method is employed with fixed and variable gain control law to track various reference signals (circular and helical curves). It is observed, for conventional fixed gain control law, the controller is inadequate for tracking reference signal with significant variation in the heading angle. The gain-scheduled control law has been designed to successfully resolve this issue. Continuous gain control law is able to overcome scattering and discontinuity problems of control input signals. In future, an integral action term will be introduced in the LQR control design to eliminate the steady state errors that is observed in the tracking of reference signals. Furthermore, special attention will be given to the and weighting matrices to determine how they should be varied to best achieve various design objectives and shape the dynamic response. Finally, these laws will be tested and implemented on a quadcopter hardware in the loop real time simulation.