# Attitude and Altitude Controller Design for Quad-Rotor Type MAVs

Authors: Wei Wang; Hao Ma; Min Xia; Liguo Weng; Xuefei Ye
Journal: Mathematical Problems in Engineering
 (2013)

---

## Abstract

Micro air vehicles (MAVs) have a wide application such as the military reconnaissance, meteorological survey, environmental monitoring, and other aspects. In this paper, attitude and altitude control for Quad-Rotor type MAVs is discussed and analyzed. For the attitude control, a new method by using three gyroscopes and one triaxial accelerometer is proposed to estimate the attitude angle information. Then with the approximate linear model obtained by system identification, Model Reference Sliding Mode Control (MRSMC) technique is applied to enhance the robustness. In consideration of the relatively constant altitude model, a Linear Quadratic Gaussian (LQG) controller is adopted. The outdoor experimental results demonstrate the superior stability and robustness of the controllers.


---

## Body

## 1. Introduction

Recently, a new class of flight vehicles called micro air vehicles (MAVs) which have a great potential for military, industrial as well as civilian applications, has been gaining tremendous attention.Since 1990s, with the development of the Micro Electro Mechanical Systems (MEMS) technology, the single rotor helicopter has been the favorable platform for MAVs research. However, the limitations such as complexity, instability, and payload limitation slowed the trend down. Meanwhile, the multirotor vehicle especially the Quad-Rotor type MAVs become more attractive. The Quad-Rotor, compared with single rotor helicopter and dual-rotor vehicle, has excellent capabilities of superior payload, low cost, and simple construction. As a result, it can be widely used in military reconnaissance, meteorological survey, environmental monitoring, delivering light goods in emergency, and other aspects [1]. Normally, the Quad-Rotor needs to fly autonomously to accomplish such difficult missions. However, there are many technical problems caused by their small size and structure, especially the installment failure of the communication apparatus and sensors. Until now, great achievements have been made in solving these difficulties by research groups and institutions, such as MIT, Ascending Technology, Microdrones, Draganfly, Heudiasyc University, Pennsylvania University, and Chiba University [2–6]. Various types of control techniques have been attempted such as back stepping (BS) control, nonlinear control, and robust control [7]. Recently, the autonomous flight control of Quad-Rotor is driven to a maturity stage and the attention of MAV research is transferred to vision-based stunt flight, indoor obstacle avoidance, SLAM-based control, or the development of novel structure MAVs [8–11]. However, the stability of the attitude controller in jamming environment becomes a main limitation with these deeper research continues.In this paper, system dynamics for attitude and altitude control as well as the control algorithms of a typically Quad-Rotor type MAV are discussed. With the historical flight data of the vehicle obtained by experiments, the mathematical model is determined by system identification tools in Matlab. For the attitude control, instead of using the IMU unit or the extended Kalman filter (EKF), we select three gyroscopes and a triaxial accelerometer to estimate the attitude angle by Kalman flitre. The main advantages of this method are the low price and less computation which will promote the industrialization process. In consideration of the parameter uncertainties, model errors, and other interference, we apply the MRSMC to pursue good robustness. As to altitude control, we propose to use barometer and accelerometer instead of the widely used GPS to improve the precision. Then a model-based controller by optimal control methodology is designed.


## 2. Controlled Object

Our research platform is a 4-channel radio controlled Quad-Rotor type MAV designed by our research group. The vehicle airframe is constructed by carbon fiber which can provide significant stiffness and rigidity while keeping the weight down. The lift results from four AKE brushless motors. In order to drive these brushless motors, Pentium-18A Ultra-PWM brushless controllers which support 50 Hz–500 Hz PWM signal communication are selected. By using the brushless controllers, the maximum rotational speed can reach about 8000 rpm and acquire about 1 Kg payload with four APC1245 propellers. The flight time is about 20 minutes with a three-cell-2100 mAh LiPo battery without payload.  Figure1 shows an overview of our platform and the specification is shown in Table 1.Table 1
Specification of Quad-Rotor type MAV.
Parameter
Value
Unit
Maximum Diameter
500
mm
Height
250
mm
Total mass
1.1
kg
Maximum lift
1
kgFigure 1
Quad-Rotor type MAV.The embedded control system consists of three gyroscopes, one triaxial accelerometer, one barometer, one 12 bit ADC chip MCP3204, and one Arm7 micro controller. The gyroscope ADXRS610 and triaxial accelerometer ADXL335 from Analog Devices Corporation are used to stabilize the attitude of the vehicle. The MPX5100Ap barometer together with the accelerometer is used for altitude control.The running process of the embedded control system is as follows. Firstly, the Arm7 receives digital sensor data from ADC chip and control instruction from a 72 MHz PPM receiver. Then run the control program to draw a control output for each axis, respectively. At last, the summarized rotational control instructions are sent to the motor drivers to complete the specified movement. All the processing is done at a frequency of 400 Hz. The configuration of the overall system can be seen in Figure2.  In order to monitor the vehicle state and record the flight data, a wireless modem XBee-pro whose communication range can reach 1.6 Km with its maximum power of 63 mW is used to accomplish the communication between the MAV and the ground station.Figure 2
Configuration of 4 rotors type MAV system.


## 3. Attitude Modeling and Controller Design

For theX and Y directions, the autonomous flight control can be divided into three loops of attitude (Roll, Pitch), velocity, and position. This chapter mainly illustrates the attitude modeling and controller design which is the foundation of the study. In order to achieve attitude control, the attitude dynamics must be reviewed at first. Therefore, the relevant theoretical derivation and system identification are applied to acquire the mathematic model. In view of the necessity of robustness, a novel sliding mode controller combined with the model following control theory is proposed.


### 3.1. Attitude Modeling

The tuning of rotational speed of every rotor leads to one degree of freedom of the MAV; coupled motion and nonlinearity are very obvious. Therefore, it is quite difficult to analyze such system. In this research, we neglect the coupled motion and gain an approximate linear attitude model. Plus, the Roll attitude model is the same as Pitch owing to the symmetry structure, and the modeling is conducted aiming at roll angle only.As an assumption, no coupling exists and the variation range of attitude angle is small. The following relationship between the torque around the center and the obtained roll angle can be described as [12, 13]
(1)τ=Jϕ¨,
where τ is a torque vector, J is a moment of inertia, and ϕ is the Euler angle of attitude. Assuming that the transfer function between the instruction value and the torque actually obtained is the first-order inertial system. Then the transfer function is given
(2)Guϕ(s)=ϕ(s)u(s)=kJ(1+Ts)s2.Here,u represents the control input; k and T are the parameters of the inertial system.In general, the angular is estimated by the IMU sensor. In this research, we propose one accelerometer and three gyroscopes to estimate the angle. In particular, the accelerometer measures not only dynamic acceleration but also gravity. The relationship can be represented as(3)am=gϕ+ad,
where g is the acceleration of gravity, am is the measured acceleration, and ad is the dynamic acceleration.Considering that the air resistance exits and the coefficient isK, the mass of the plant is m. Then the force equilibrium equation of the vehicle is written as the following form:
(4)mad=mgϕ-K∫addt.Thereby, the transfer function from the attitude angle to the dynamic acceleration is derived as(5)ad(s)=(mg/K)s(m/K)s+1ϕ(s).The following block diagram in Figure3 gives a more concise expression of the previous equations.Figure 3
Block diagram of the transfer function.Consequently, the complete dynamic state model which governs the MAVs is formed by selecting angular acceleration, angular velocity, angle, dynamic acceleration as the state variables and angular velocity, measured acceleration as the output(6)[x˙1x˙2x˙3x˙4]=[-1T000100001000g0-Km][x1x2x3x4]+[kJT000]u,[y1y2]=[010000g-1].The unknown parameters mentioned previously are determined by the system identification tool in Matlab with the historical flight data supplied. To verify the model accuracy, a comparison of the real plant model and the simulated model output for the same control instruction is conducted in Figure4. The similar shape of the curves indicates the high accuracy of the identified model.Cross-validation result of angular velocity and acceleration output.
(a)
(b)


### 3.2. MRSMC Controller Design

Considering the nonlinearity and the strong coupling of the real Quad-Rotor model, it is of great importance to design the controller with good robustness in both stability and performance. Hence, the MRSMC technique is adopted to enhance the robustness.The basic idea of MRSMC is to minimize the tracking error of state variables between the vehicle and the reference model in sliding mode. The block diagram of MRSMC is shown in Figure5. Sliding mode control (SMC) is well known for its reliable performance which can be proven by its wide range of application. In this paper, the MRC structure is introduced to provide the reference variables so that the servo problem and the regulator problem are separated. Thereby, the task of the feedback controller is just to drive the error between the output of the process and the output of the reference model to zero. In view of the antidisturbance performance, the sliding mode control (SMC) is selected as the feedback controller [14].Figure 5
Block diagram of MRSMC.


#### 3.2.1. Design of the Reference Model

To generate the reference signals, a specified reference model whose states variables correspond directly to the identified model is built(7)x˙m=Amxm+Bmr,ym=Cmxm.Herer is the reference input. By setting Cm=C, e=x-xm, the error dynamics of the state variables can be computed by subtracting (7) from the plant model
(8)e˙=Ame+(A-Am)x+Bu-Bmr.Making the system satisfies the following conditions:(9)Am-A=BK1,Bm=BK2.Then(10)e˙=Ame-B(K1x+K2r-u).To ensure the outputym tracks r, the DC gain must be adjusted to 1. When the time variable tends to infinity, the following equation is obtained:
(11)Amxm+Bmr=0.The outputym can be given as
(12)ym=-CmAm-1Bmr=-CmAm-1BK2r.SoK2=(-CmAm-1B)-1 and Bm can be computed by
(13)Bm=BK2=B(-CmAm-1B)-1.Am is determined by adjusting in Matlab simulation
(14)Am=[-a1-a2-a30100001000g0-0.55].In this work, the parameters are chosen asa1=18, a2=160 and a3=600. Figure 6 shows the step response of the reference model. The model output can track the reference well in about 1 second with little overshoot, so the desired performance of the reference model is obtained.Figure 6
Step response of the reference model.


#### 3.2.2. Design of the SMC Control Loop

To design the feedback controller, the sliding mode control technique is proposed because of its high robustness to exogenous disturbances and parametric uncertainties.Considering that the control goal is to make the real plant output angle to track the angle of the reference model. Thus, a novel stateεy is introduced to enhance the tracking performance
(15)ε˙y=y-ym.And the expansion system can be given as(16)e˙s=[e˙ε˙y]=[Am0Cm0][eεy]+[B0]us=Ases+Bsus
with us=-(K1x+K2r-u).The switching functionσ∈R is selected as
(17)σ=Ses,σ˙=SAses-SBs(K1x+K2r-u).When the state variables are subject to the sliding surface,σ=σ˙=0,  the equivalent input is derived
(18)ueq=-(SBs)-1SAses+K1x+K2r.Substitutingueq into (16) as the control input, (19) is obtained:
(19)e˙s={I-Bs(SBs)-1S}Ases.The previous system described by (19) gains stability by stabilizing zeros. Then the optimal feedback gain F is selected as hyper plane S to stabilize it
(20)F=S=BsTP,
where P is the solution of the following Riccati equation and S satisfied the condition of SBs>0:
(21)PAs+AsTP-PBsBsTP+Q=0.The nonlinear term of SMC is selected as(22)unl=Knlf(σ)
with Knl being the witching gain and f(σ) being a switching function. In this paper, instead of using a sign function which is too critical for practical use, we choose the following smoothing function to avoid chattering:
(23)f(σ)=σ|σ|+δ,
where δ is the weight of smoothing function. The main advantage of this method is that the smoothing function can avoid making the gain high while sustaining sufficient robustness around the switching line. This method is called the quasisliding mode.Then the control input can be acquired:(24)U=ueq+unl.Because only part of the state variables can be measured, a Kalman filter is introduced to estimate the attitude angle and unobservable state variables. The Kalman filter has three main functions: provide the state variables for controller, estimate the attitude angle information, filter the sensor noise. Therefore, the calculation is greatly reduced and makes the attitude controller running at the 400 Hz frequency become possible. The simulation result of MRSMC is shown in Figure7.Simulation result of MRSMC.
(a)
(b)
(c)
(d)


## 3.1. Attitude Modeling

The tuning of rotational speed of every rotor leads to one degree of freedom of the MAV; coupled motion and nonlinearity are very obvious. Therefore, it is quite difficult to analyze such system. In this research, we neglect the coupled motion and gain an approximate linear attitude model. Plus, the Roll attitude model is the same as Pitch owing to the symmetry structure, and the modeling is conducted aiming at roll angle only.As an assumption, no coupling exists and the variation range of attitude angle is small. The following relationship between the torque around the center and the obtained roll angle can be described as [12, 13]
(1)τ=Jϕ¨,
where τ is a torque vector, J is a moment of inertia, and ϕ is the Euler angle of attitude. Assuming that the transfer function between the instruction value and the torque actually obtained is the first-order inertial system. Then the transfer function is given
(2)Guϕ(s)=ϕ(s)u(s)=kJ(1+Ts)s2.Here,u represents the control input; k and T are the parameters of the inertial system.In general, the angular is estimated by the IMU sensor. In this research, we propose one accelerometer and three gyroscopes to estimate the angle. In particular, the accelerometer measures not only dynamic acceleration but also gravity. The relationship can be represented as(3)am=gϕ+ad,
where g is the acceleration of gravity, am is the measured acceleration, and ad is the dynamic acceleration.Considering that the air resistance exits and the coefficient isK, the mass of the plant is m. Then the force equilibrium equation of the vehicle is written as the following form:
(4)mad=mgϕ-K∫addt.Thereby, the transfer function from the attitude angle to the dynamic acceleration is derived as(5)ad(s)=(mg/K)s(m/K)s+1ϕ(s).The following block diagram in Figure3 gives a more concise expression of the previous equations.Figure 3
Block diagram of the transfer function.Consequently, the complete dynamic state model which governs the MAVs is formed by selecting angular acceleration, angular velocity, angle, dynamic acceleration as the state variables and angular velocity, measured acceleration as the output(6)[x˙1x˙2x˙3x˙4]=[-1T000100001000g0-Km][x1x2x3x4]+[kJT000]u,[y1y2]=[010000g-1].The unknown parameters mentioned previously are determined by the system identification tool in Matlab with the historical flight data supplied. To verify the model accuracy, a comparison of the real plant model and the simulated model output for the same control instruction is conducted in Figure4. The similar shape of the curves indicates the high accuracy of the identified model.Cross-validation result of angular velocity and acceleration output.
(a)
(b)


## 3.2. MRSMC Controller Design

Considering the nonlinearity and the strong coupling of the real Quad-Rotor model, it is of great importance to design the controller with good robustness in both stability and performance. Hence, the MRSMC technique is adopted to enhance the robustness.The basic idea of MRSMC is to minimize the tracking error of state variables between the vehicle and the reference model in sliding mode. The block diagram of MRSMC is shown in Figure5. Sliding mode control (SMC) is well known for its reliable performance which can be proven by its wide range of application. In this paper, the MRC structure is introduced to provide the reference variables so that the servo problem and the regulator problem are separated. Thereby, the task of the feedback controller is just to drive the error between the output of the process and the output of the reference model to zero. In view of the antidisturbance performance, the sliding mode control (SMC) is selected as the feedback controller [14].Figure 5
Block diagram of MRSMC.


### 3.2.1. Design of the Reference Model

To generate the reference signals, a specified reference model whose states variables correspond directly to the identified model is built(7)x˙m=Amxm+Bmr,ym=Cmxm.Herer is the reference input. By setting Cm=C, e=x-xm, the error dynamics of the state variables can be computed by subtracting (7) from the plant model
(8)e˙=Ame+(A-Am)x+Bu-Bmr.Making the system satisfies the following conditions:(9)Am-A=BK1,Bm=BK2.Then(10)e˙=Ame-B(K1x+K2r-u).To ensure the outputym tracks r, the DC gain must be adjusted to 1. When the time variable tends to infinity, the following equation is obtained:
(11)Amxm+Bmr=0.The outputym can be given as
(12)ym=-CmAm-1Bmr=-CmAm-1BK2r.SoK2=(-CmAm-1B)-1 and Bm can be computed by
(13)Bm=BK2=B(-CmAm-1B)-1.Am is determined by adjusting in Matlab simulation
(14)Am=[-a1-a2-a30100001000g0-0.55].In this work, the parameters are chosen asa1=18, a2=160 and a3=600. Figure 6 shows the step response of the reference model. The model output can track the reference well in about 1 second with little overshoot, so the desired performance of the reference model is obtained.Figure 6
Step response of the reference model.


### 3.2.2. Design of the SMC Control Loop

To design the feedback controller, the sliding mode control technique is proposed because of its high robustness to exogenous disturbances and parametric uncertainties.Considering that the control goal is to make the real plant output angle to track the angle of the reference model. Thus, a novel stateεy is introduced to enhance the tracking performance
(15)ε˙y=y-ym.And the expansion system can be given as(16)e˙s=[e˙ε˙y]=[Am0Cm0][eεy]+[B0]us=Ases+Bsus
with us=-(K1x+K2r-u).The switching functionσ∈R is selected as
(17)σ=Ses,σ˙=SAses-SBs(K1x+K2r-u).When the state variables are subject to the sliding surface,σ=σ˙=0,  the equivalent input is derived
(18)ueq=-(SBs)-1SAses+K1x+K2r.Substitutingueq into (16) as the control input, (19) is obtained:
(19)e˙s={I-Bs(SBs)-1S}Ases.The previous system described by (19) gains stability by stabilizing zeros. Then the optimal feedback gain F is selected as hyper plane S to stabilize it
(20)F=S=BsTP,
where P is the solution of the following Riccati equation and S satisfied the condition of SBs>0:
(21)PAs+AsTP-PBsBsTP+Q=0.The nonlinear term of SMC is selected as(22)unl=Knlf(σ)
with Knl being the witching gain and f(σ) being a switching function. In this paper, instead of using a sign function which is too critical for practical use, we choose the following smoothing function to avoid chattering:
(23)f(σ)=σ|σ|+δ,
where δ is the weight of smoothing function. The main advantage of this method is that the smoothing function can avoid making the gain high while sustaining sufficient robustness around the switching line. This method is called the quasisliding mode.Then the control input can be acquired:(24)U=ueq+unl.Because only part of the state variables can be measured, a Kalman filter is introduced to estimate the attitude angle and unobservable state variables. The Kalman filter has three main functions: provide the state variables for controller, estimate the attitude angle information, filter the sensor noise. Therefore, the calculation is greatly reduced and makes the attitude controller running at the 400 Hz frequency become possible. The simulation result of MRSMC is shown in Figure7.Simulation result of MRSMC.
(a)
(b)
(c)
(d)


## 3.2.1. Design of the Reference Model

To generate the reference signals, a specified reference model whose states variables correspond directly to the identified model is built(7)x˙m=Amxm+Bmr,ym=Cmxm.Herer is the reference input. By setting Cm=C, e=x-xm, the error dynamics of the state variables can be computed by subtracting (7) from the plant model
(8)e˙=Ame+(A-Am)x+Bu-Bmr.Making the system satisfies the following conditions:(9)Am-A=BK1,Bm=BK2.Then(10)e˙=Ame-B(K1x+K2r-u).To ensure the outputym tracks r, the DC gain must be adjusted to 1. When the time variable tends to infinity, the following equation is obtained:
(11)Amxm+Bmr=0.The outputym can be given as
(12)ym=-CmAm-1Bmr=-CmAm-1BK2r.SoK2=(-CmAm-1B)-1 and Bm can be computed by
(13)Bm=BK2=B(-CmAm-1B)-1.Am is determined by adjusting in Matlab simulation
(14)Am=[-a1-a2-a30100001000g0-0.55].In this work, the parameters are chosen asa1=18, a2=160 and a3=600. Figure 6 shows the step response of the reference model. The model output can track the reference well in about 1 second with little overshoot, so the desired performance of the reference model is obtained.Figure 6
Step response of the reference model.


## 3.2.2. Design of the SMC Control Loop

To design the feedback controller, the sliding mode control technique is proposed because of its high robustness to exogenous disturbances and parametric uncertainties.Considering that the control goal is to make the real plant output angle to track the angle of the reference model. Thus, a novel stateεy is introduced to enhance the tracking performance
(15)ε˙y=y-ym.And the expansion system can be given as(16)e˙s=[e˙ε˙y]=[Am0Cm0][eεy]+[B0]us=Ases+Bsus
with us=-(K1x+K2r-u).The switching functionσ∈R is selected as
(17)σ=Ses,σ˙=SAses-SBs(K1x+K2r-u).When the state variables are subject to the sliding surface,σ=σ˙=0,  the equivalent input is derived
(18)ueq=-(SBs)-1SAses+K1x+K2r.Substitutingueq into (16) as the control input, (19) is obtained:
(19)e˙s={I-Bs(SBs)-1S}Ases.The previous system described by (19) gains stability by stabilizing zeros. Then the optimal feedback gain F is selected as hyper plane S to stabilize it
(20)F=S=BsTP,
where P is the solution of the following Riccati equation and S satisfied the condition of SBs>0:
(21)PAs+AsTP-PBsBsTP+Q=0.The nonlinear term of SMC is selected as(22)unl=Knlf(σ)
with Knl being the witching gain and f(σ) being a switching function. In this paper, instead of using a sign function which is too critical for practical use, we choose the following smoothing function to avoid chattering:
(23)f(σ)=σ|σ|+δ,
where δ is the weight of smoothing function. The main advantage of this method is that the smoothing function can avoid making the gain high while sustaining sufficient robustness around the switching line. This method is called the quasisliding mode.Then the control input can be acquired:(24)U=ueq+unl.Because only part of the state variables can be measured, a Kalman filter is introduced to estimate the attitude angle and unobservable state variables. The Kalman filter has three main functions: provide the state variables for controller, estimate the attitude angle information, filter the sensor noise. Therefore, the calculation is greatly reduced and makes the attitude controller running at the 400 Hz frequency become possible. The simulation result of MRSMC is shown in Figure7.Simulation result of MRSMC.
(a)
(b)
(c)
(d)


## 4. Altitude Modeling and Controller Design

The altitude results from the lift of four rotors, so the model can be easily obtained. Then the LQG controller based on optimal control is designed.


### 4.1. Altitude Modeling

The altitude of the vehicle is controlled by the rotational speed of four rotors. The control inputu is proportion to the rotation speed n. In consideration of the delay caused by the control loop and the motor load, the power F is proportion to rotation speed n. Therefore, the following equation can be obtained:
(25)F(s)=k1n(s)=k1k21+T1su(s).The relations of powerF and acceleration, velocity, and position can be represented as
(26)Z¨=a=(FCθCϕ-fZ-mg)m.Z is the altitude, Cx=cosx, ϕ, θ is roll and pitch angle, fZ is the air resistance, m is the mass of the plant. The Quad-Rotor MAV is mainly moving at a low speed and the lean angle is about 20 degree. Ignoring the air resistance, the linearization of (26) can be given as
(27)Z¨=a=(F-mg)m.From (25) and (27), we can get the following transfer function:
(28)G(s)=Z(s)u(s)=k1k2(1+T1s)mS2.As stated in earlier chapters, the unknown parameters are determined by identification and the system’s time history response is analyzed in Figure8 to verify the accuracy of the identified model.Figure 8
Cross-validation result of altitude model.


### 4.2. Optimal Controller Design

The altitude model is insensitive to the outer interference, so it is not difficult to obtain a relative stable model and the LQG control method is applied. LQG is a preferable design method for servo system based on the optimal control technique.To strengthen the controller performance in tracing, a new state variablexr(t) is constructed as the integral value of the tracing error. Therefore, the extended system is extracted
(29)x˙a(t)=ddt[x(t)xr(t)]=[A0-C0][x(t)xr(t)]+[B0]u(t)+[0I]r(t)=A*xa(t)+B*u(t)+[0I]r(t),
where A*=[A0-C0], B*=[B0].The quadratic form criterion function is defined:(30)J=12∫0∞[xaTQxa(t)+uT(t)Ru(t)]dt.The optimal control goal is to determine control inputu(t) to minimize the quadratic form criterion function.In view of (30), the Hamiltonian function is
(31)H=12xaT(t)Qxa(t)+12uT(t)Ru(t)+λT(t)[A*(t)xa(t)+B*(t)u(t)].Then the adjoint equation and boundary condition can be obtained:(32)λ˙(t)=-∂H∂xa=-A*T(t)λ(t)-Qxa(t),λ(T)=Sxa(T),∂H∂u=Ru(t)+B*T(t)λ(t)=0.With conditionR is positive, the control input is obtained
(33)u(t)=-R-1B*T(t)λ(t).Assuming the relationship betweenλ(t) state valuables, xa(t) can be described as
(34)λ(t)=P(t)xa(t).When the time variablet tends to infinity, the matrix P(t) becomes a constant, and it can be obtained from the Riccati equation
(35)PA*+A*TP-PB*R-1B*TP+Q=0.The feedback gainF can be given as follows and the control input is obtained accordingly:
(36)F=[F1F2]=R-1B*TP,(37)u(t)=-F1x(t)-F2xr(t)=-F1x(t)-F2∫0te(t)dt.Since the controller is designed based on state feedback, it is necessary to obtain all the state conditions. In the altitude model obtained previously, the acceleration and the altitude variable can be observed by the onboard sensors, and there is still one state variable that is unavailable. Then a Kalman filter is designed to estimate the unavailable state variable, and it can also filter the noise in the meanwhile. Therefore, the control performance is improved.


## 4.1. Altitude Modeling

The altitude of the vehicle is controlled by the rotational speed of four rotors. The control inputu is proportion to the rotation speed n. In consideration of the delay caused by the control loop and the motor load, the power F is proportion to rotation speed n. Therefore, the following equation can be obtained:
(25)F(s)=k1n(s)=k1k21+T1su(s).The relations of powerF and acceleration, velocity, and position can be represented as
(26)Z¨=a=(FCθCϕ-fZ-mg)m.Z is the altitude, Cx=cosx, ϕ, θ is roll and pitch angle, fZ is the air resistance, m is the mass of the plant. The Quad-Rotor MAV is mainly moving at a low speed and the lean angle is about 20 degree. Ignoring the air resistance, the linearization of (26) can be given as
(27)Z¨=a=(F-mg)m.From (25) and (27), we can get the following transfer function:
(28)G(s)=Z(s)u(s)=k1k2(1+T1s)mS2.As stated in earlier chapters, the unknown parameters are determined by identification and the system’s time history response is analyzed in Figure8 to verify the accuracy of the identified model.Figure 8
Cross-validation result of altitude model.


## 4.2. Optimal Controller Design

The altitude model is insensitive to the outer interference, so it is not difficult to obtain a relative stable model and the LQG control method is applied. LQG is a preferable design method for servo system based on the optimal control technique.To strengthen the controller performance in tracing, a new state variablexr(t) is constructed as the integral value of the tracing error. Therefore, the extended system is extracted
(29)x˙a(t)=ddt[x(t)xr(t)]=[A0-C0][x(t)xr(t)]+[B0]u(t)+[0I]r(t)=A*xa(t)+B*u(t)+[0I]r(t),
where A*=[A0-C0], B*=[B0].The quadratic form criterion function is defined:(30)J=12∫0∞[xaTQxa(t)+uT(t)Ru(t)]dt.The optimal control goal is to determine control inputu(t) to minimize the quadratic form criterion function.In view of (30), the Hamiltonian function is
(31)H=12xaT(t)Qxa(t)+12uT(t)Ru(t)+λT(t)[A*(t)xa(t)+B*(t)u(t)].Then the adjoint equation and boundary condition can be obtained:(32)λ˙(t)=-∂H∂xa=-A*T(t)λ(t)-Qxa(t),λ(T)=Sxa(T),∂H∂u=Ru(t)+B*T(t)λ(t)=0.With conditionR is positive, the control input is obtained
(33)u(t)=-R-1B*T(t)λ(t).Assuming the relationship betweenλ(t) state valuables, xa(t) can be described as
(34)λ(t)=P(t)xa(t).When the time variablet tends to infinity, the matrix P(t) becomes a constant, and it can be obtained from the Riccati equation
(35)PA*+A*TP-PB*R-1B*TP+Q=0.The feedback gainF can be given as follows and the control input is obtained accordingly:
(36)F=[F1F2]=R-1B*TP,(37)u(t)=-F1x(t)-F2xr(t)=-F1x(t)-F2∫0te(t)dt.Since the controller is designed based on state feedback, it is necessary to obtain all the state conditions. In the altitude model obtained previously, the acceleration and the altitude variable can be observed by the onboard sensors, and there is still one state variable that is unavailable. Then a Kalman filter is designed to estimate the unavailable state variable, and it can also filter the noise in the meanwhile. Therefore, the control performance is improved.


## 5. Experiments and Experimental Results

In order to verify the performance of our platform as well as the properties of attitude and altitude controller, outdoor flight experiments are carried out. The operator sends the reference instruction to the Quad-Rotor by using a 72 Mhz PPM Propo. The flight data is transmitted to the ground station by the XBee-pro wireless model.


### 5.1. Attitude Experiments

Firstly, a flight test of letting the MAV keep hovering and high-speed moving is performed. Figures9 and 10 show the demonstration result. From Figure 9, it is obvious that the output angle trajectory tracks the reference angle well. Some beating points around 10 s and 20 s may be caused by external force-like gust, but it can regain the stability soon. Figure 10 presents the comparison result of the Roll angle velocity and the related acceleration by Kalman estimation and measured from sensors. It shows that the estimated smooth lines keep the trend of the original sensor data and the good filter result is obtained.Attitude experimental result.
(a)
(b)Estimate result of roll angle and acceleration.
(a)
(b)As to the system’s robustness, a comparison experiment is conducted between LQG and MRSMC technology for attitude control with a 300 g payload. But when the LQG controller is installed, the flight performance degrades badly and the operation of the vehicle becomes a difficulty. Therefore, only the MRSMC robust experiment is carried out successfully. The corresponding plots can be seen in Figure11. The tracking performance is acceptable considering the heavy payload and it shows that the MRSMC is insensitive to model change, so the good robustness is obtained.Figure 11
Robust experimental result.


### 5.2. Altitude Experiments

In the altitude test, a step signal of 5 m is given to the MAV after hovering stably for some time in a fixed altitude. Result from the flight test is shown in Figure12. The real-time experimental result follows simulation result well and the outputs successfully tracks the reference input in about 5 s with a 0.5 m overshoot. The controller also has a good stability by stable control input.Altitude experimental result.
(a)
(b)


## 5.1. Attitude Experiments

Firstly, a flight test of letting the MAV keep hovering and high-speed moving is performed. Figures9 and 10 show the demonstration result. From Figure 9, it is obvious that the output angle trajectory tracks the reference angle well. Some beating points around 10 s and 20 s may be caused by external force-like gust, but it can regain the stability soon. Figure 10 presents the comparison result of the Roll angle velocity and the related acceleration by Kalman estimation and measured from sensors. It shows that the estimated smooth lines keep the trend of the original sensor data and the good filter result is obtained.Attitude experimental result.
(a)
(b)Estimate result of roll angle and acceleration.
(a)
(b)As to the system’s robustness, a comparison experiment is conducted between LQG and MRSMC technology for attitude control with a 300 g payload. But when the LQG controller is installed, the flight performance degrades badly and the operation of the vehicle becomes a difficulty. Therefore, only the MRSMC robust experiment is carried out successfully. The corresponding plots can be seen in Figure11. The tracking performance is acceptable considering the heavy payload and it shows that the MRSMC is insensitive to model change, so the good robustness is obtained.Figure 11
Robust experimental result.


## 5.2. Altitude Experiments

In the altitude test, a step signal of 5 m is given to the MAV after hovering stably for some time in a fixed altitude. Result from the flight test is shown in Figure12. The real-time experimental result follows simulation result well and the outputs successfully tracks the reference input in about 5 s with a 0.5 m overshoot. The controller also has a good stability by stable control input.Altitude experimental result.
(a)
(b)


## 6. Conclusion

In this research, a brief introduction is given to the Quad-Rotor, which is selected as our controlled object. Then the attitude and altitude control is discussed. For the attitude, MRSMC is proposed due to its insensitiveness to parametric uncertainties, model errors, and outer disturbances. Whereas in altitude control, the model-based optimal controller is designed. To verify the performance of the controllers, the hovering control and guidance control are conducted in flight experiments. By using MRSMC, the attitude controller also obtains good robustness. In the future, we will focus on velocity and position control, so that the fully autonomous flight will be accomplished.



---

*Source: 587098-2013-05-09.xml*