ROBUST NEURAL NETWORK CONTROL OF A QUADROTOR HELICOPTER C. Nicol1 ,C.J.B. Macnab1, A.

Ramirez-Serrano2 Schulich School of Engineering, University of Calgary 1 Department of Electrical and Computer Engineering 2 Department of Mechanical and Manufacturing Engineering 2500 University Dr. NW, Calgary, Alberta, Canada, T2N 1N2
ABSTRACT This paper proposes a new adaptive neural network control to stabilize a quadrotor helicopter against modeling error and considerable wind disturbance. The new method is compared to both deadzone and e-modification adaptive techniques and through simulation demonstrates a clear improvement in terms of achieving a desired attitude and reducing weight drift. Index Terms— Quadrotor Helicopter, Neural Network Control, Direct Adaptive Control, Cerebellar Model Articulation Controller (CMAC), Unmanned Aerial Vehicle 1. INTRODUCTION Small electrically-actuated helicopters with four rotors, or simply quadrotors, have interested the robotics and control community in recent years. Many have proposed quadrotor helicopter attitude stabilization techniques including linear (PD) controls [1],[2] and nonlinear (backstepping and sliding-mode) controls [3], [4]. Some have even investigated advanced visualfeedback techniques [5],[6]. One major problem rarely addressed by researchers to date is that of a wind disturbance. A constant wind velocity [3] and very small wind gusts [4] are all that appear in the literature. Despite the lack of research, the effects of a significant wind disturbance should be considered a major concern because typical applications call for autonomous small lightweight vehicles. A buffeting (sinusoidal) wind disturbance could be considered as the worst case scenario for such a vehicle, throwing off angular and Cartesian estimations and making control very difficult. The work presented in this paper represents a new method for stabilizing a quadrotor helicopter against unknown parameters in the system model as well as significant wind disturbances. The method is based on the use of a CMAC neural network in which neural-adaptive control techniques are used to train the approximation weights online. As sinusoidal 978-1-4244-1643-1/08/$25 © 2008 IEEE disturbances tend to produce weight drift (which can eventually cause bursting and other undesirable effects), a secondary CMAC is incorporated which attempts to force the approximation weights towards smaller acceptable weights. Simulations establish the stability and performance of the new method in a situation where other robust adaptive control methods, e-modification and deadzone, both fail to produce a practical result. 2. QUADROTOR MODEL A quadrotor helicopter consists of four perpendicular arms, each with its own motor and rotor (Fig. 1). The four rotors provide upwards propulsion as well direction control. The system consist of two opposite rotor pairs (1,3) and (2,4). To balance torque, one pair rotates clockwise while the other rotates counter clockwise (Fig. 2 - note Ωi , i = 1...4 are rotor speeds). A difference in speeds between the two pairs creates either positive or negative yaw acceleration. Increasing rotor 1 and decreasing rotor 2 speed produces positive pitch. Similarly, rotors 2 and 4 change roll. Like any other aerial vehicle, the quadrotor helicopter has six degrees of freedom, Cartesian (X,Y,Z) and angular (φ,θ,ψ ). As a result the model should consider both the angular and translational dynamics. 2.1. System Dynamics Using the Newton-Euler method, the system angular dynamics can be expressed as [7] ˙ + ω × (Jω + Jr Ωr e3 ), τ = Jω where: • τ a column vector of torques along the three axis, • J is the rigid body inertia tensor, • ω is a column vector of angular velocities, • Jr is the rotor inertia, • Ωr = Ω1 − Ω2 + Ω3 − Ω4 is total rotor speed, • e3 = [0 0 1]T describes rotor orientation. (1)

001233

The outer loop is responsible for providing a desired roll and pitch (and the velocities) to the inner control loop in an effort to achieve desired X and Y coordinates (or velocities). R is a desired rotation matrix. 4. it is simpler to define control signals: ⎡ ⎤⎡ 2 ⎤ ⎤ ⎡ u1 Ω1 1 1 1 1 ⎢ u2 ⎥ ⎢ 0 −1 0 ⎥ ⎢ Ω2 ⎥ 1 ⎢ ⎥⎢ 2 ⎥ ⎢ ⎥ (3) 2 ⎦ ⎣ u3 ⎦ = ⎣ −1 ⎦ ⎣ 0 1 0 Ω3 1 −1 1 −1 u4 Ω2 4 The above matrix is invertible so commanded speeds follow directly from control signals. Quadrotor Fig.1.2. SYSTEM DESIGN The control strategy for the flying/hovering modes involved the development of two loops. 2. For details on deriving (4)-(6) see. The CMAC consists of layers of offset look-up tables. [4] or [8]. the commanded yaw should always be zero and roll should be small to ensure Euler angles are close to roll. T is a 2 2 2 T column vector of forces (T = [0 0 b(Ω2 1 + Ω2 + Ω3 + Ω4 )] ) and g is gravitational acceleration. Thus Γ is a row vector and w is a column vector. pitch and yaw provided by gyroscopes. 2. 4. NEURAL NETWORK IMPLEMENTATION The choice to use a neural network for the main quadrotor control was based on the need to deal with large uncertainties in both parameter estimates and wind disturbances. each Γi is the value of the basis function of the activated cell on the ith layer. Each cell then has a basis function and weight associated with it. The constants used for system development and simulations were obtained from [9] (Table 1). 001234 . Thus. and wi is the associated weight. Each input is a dimension in the CMAC structure. The (faster) inner loop is responsible for achieving the desired roll and pitch. we arrive at the angular and Cartesian equations of motion ¨=θ ˙ψ ˙ (IY − IZ )/IX − (Jr /IX )θ ˙Ωr + (lb/IX )u2 φ ¨= φ ˙ψ ˙ (IZ − IX )/IY + (Jr /IY )φ ˙ Ωr + (lb/IY )u3 θ ¨=φ ˙θ ˙(IX − IY )/IZ + (d/IZ )u4 ψ ¨ = −(sin θ cos φ)(b/m)u1 X ¨ = (sin φ)(b/m)u1 Y ¨ = −g + (cos θ cos φ)(b/m)u1 Z (4) (5) (6) (7) (8) (9) Γi (q)wi = Γ(q)w i=1 (10) where m is the number of layers. given inputs in vector q ∈ Rn the output can be expressed as a weighted sum of basis functions: ˆ(q) = f m where m is the mass of the quadrotor. Similar to a radial basis function network. Using the dynamics developed in (1) and (2) along with input definitions (3). Coordinate systems The translational dynamics in a fixed frame can be written as mv ˙ = RT − mg e3 (2) 3. With this rotation matrix. Equations of Motion Rather than use rotor speeds as control inputs. State Space Representation In an effort to simplify stability proofs and demonstrate the system representation used in simulations. v is a column vector of Cartesian velocities. for example. using a hash-coding scheme to avoid allocating m arrays of dimension n [11]. 1. This makes providing the desired roll and pitch (and their velocities) to achieve desired Cartesian coordinates possible without linearization. divided into hypercube cells. The neural network chosen for the task was the Cerebellar Model Articulation Controller (CMAC) [10].Fig. the X axis faces into the flight direction. The Cartesian equations (7)-(9) use the rotation matrix RZXY rather than the more common RZYX . or ideally into the wind when hovering. the system was reduced to the following state space form with state space variables given by x1 = Z x2 = φ − φd x3 = θ − θd x4 = ψ (11) where l is the length of an arm. The computer algorithm for calculating this output is more complex. b is a thrust factor and d is a drag factor.

X Inertia (Ixx ) Y Inertia (Iyy ) Z Inertia (Izz ) rotor inertia Value 0. Parameters for Adaptive Techniques Parameter β1 max /G1 κ1 ν ρ ζ1 δ Value 0. Xd = Yd = Zd = ψd = 0).4 40 0. the ˆ bi s are rough order-of-magnitude approximations ˜ i s are weight errors (i.e. a Lyapunov candidate based on sliding mode errors zi = xi + xi+4 (i = 1. q) = ˆ f(q.2. w ˜i ) space) as well as the initial condition will be a uniform ultimate bound on the trajectory. x) < max ∀x ∈ Rn ). (20) where the Gi s are simple control gains.225e-3 Kg m2 1. The use of adaptivedition will be a uniform ultimate bound on the trajectory. The system can be then be represented as x ˙ i = xi+4 for i = 1. thrust coef. 001235 .e. Taking the time derivative of the Lyapunov function ˙ = V 1 T ˙ ˜ wi zi(Γi(x)wi + i(t. The deadzone technique produces ˙i= ˆ w βi ΓT i zi 0 if |zi | > max /Gi . q) (16) where Γ is now an n × m matrix of activated basis functions and (t.4 0. 3. 2. of the constants chosen in (13). 4 ⎡ ⎤⎡ ⎤ −d1(t) − g + b1u1 x ˙5 ¨d(t)+ b2 u2 ⎥ ⎢x ⎥ ⎢−d2(t)+ x7 x8 a1 + x7 a2 Ωr − φ ⎢ ˙ 6⎥ ⎥ ⎢ = ⎣x ¨d(t)+ b3 u3 ⎦ ˙ 7 ⎦ ⎣ −d3(t)+ x6 x8 a3 + x6 a4 Ωr − θ x ˙8 −d4(t)+ x6 x7 a5 + b4 u4 where a1 a2 a3 a4 a5 = (IY − IZ )/IX = Jr /IX = (IZ − IX )/IY = Jr /IY = (IX − IY )/IZ b1(t) = b cos θ cos φ/m b2 = lb/IX b3 = lb/IY b4 = d/IZ di(t) = wind disturbance of approximation ( (t. Constants Parameter l m d b IX IY IZ Jr Definition lever length mass of quadrotor drag coef.Table 1.2 0.5e-7 N m s2 3. w ˜ i ) that encloses the initial conwhere K1 and K2 are simple control gains.0005 Parameter β2 . w) + (t.232 m 0. β3 . x)+ˆ bi ui ) − w βi i i=1 4 (13) (19) The control can then be chosen as It is important to note that (12) is assuming the system is in hovering mode (i. the outer loop controls designed to drive the system towards a desired Cartesian position are ˙0 ) φd = arcsin(K1 (Yd − Y0 ) − K2 Y ˙ 0 )/ cos φ] θd = − arcsin[(K1 (Xd − X0 ) − K2 X (14) (15) 1 ui = ˆ b− i (−Γi (x)wi − Gi zi ). (21) The application of deadzone therefore ensures that the smallest level set Vi (|zi |.228e-3 Kg m2 6. The neural techniques the for inner loop allows the controller to e -modification technique results in handle model uncertainty as well as possible disturbances. The four nonlinear equations depend on variables in vector ˙ i = βi (ΓT zi − ν |zi |wi ) ˆ w (22) i q and it is assumed the CMACs uniformly approximate nonlinear terms: where βi s are weight update gains and ν is a leakage gain. .15 10 and xi+4 = x ˙ i for i = 1 . . w ˜i = the difference between the ideal and estimated weights w wi − wi ) and V is positive definite assuming |φ. ˙i < 0 if Using (22). 4) is 4 V = i=1 ˆ 1 T bi 2 ˜ w ˜i z + w 2 bi i 2 βi i (18) (12) In (18). κ3 . 4. Two common techniques for designing a robust weight update law are deadzone and e-modification. q) = d(t) + dapprox (q) (17) represents all time-varying disturbances and the approximation error. otherwise.1 0. Assuming the error is bounded in a local region |zi | > emax Gi + ν wi 4Gi or w ˜i > wi 2 + e2 max 4Gi ν + wi 4 The application of e-modification therefore ensures that the smallest level set Vi (|zi |. q) = Γw + (t.3.4 κ2 . w ˜ i ) that encloses the area defined above (in (|zi |.4 0. it can be shown that V f(t.121e-2 Kg m2 6e-5 Kg m2 Table 2.52 Kg 7.1 0.01 0.2 5 0. κ4 α η ζ2 Value 0. 4. θ| < (π/2). β4 max /G2. 2.13e-5 N s2 6. Control strategy For hovering. 3.

3. pmax ˜ ˆ 0 |zi | w ˜i ˙ < 0 outside a compact set in ( z .3 0 20 40 60 80 100 120 140 160 180 200 Time (s) Fig.1 −0. All three techniques with sinusoidal disturbances Taking the time derivative we arrive at ˙ i = zi V 2 T − zi Gi + w ˜i (ΓT i zi − i ˙i ˙i w ˆ p ˆ )+p ˜T ). p ˜ ) space and all signals are uniformly ultimately bounded.1 −0. βi(Γi zi + ζ2(pi − wi )) As long as the first term has eigenvalues with negative real ˙ <0 parts (parameters are chosen such that η > ζ1 /4) then V outside a compact set in ( z . Here all three methods have very similar transient responses. the first simulations compare the three adaptive techniques in the case of no disturbances. p ˜ ) space and all signals are uniformly ultimately bounded. (28) With this in mind. RESULTS In the simulations the pitch position starts at 0. Using a common set of parameters (Table 2).2 −0.4 −0. When σ < δ . then p ˜ < pmax and 3T2 |zi | −Gi ˙i ≤ 4 w ˜i 5 4 0 V p ˜i 0 + ˆ max 2 0 −ζ2 0 3 2 3 |zi | 0 4 w 0 5 ˜i 5 −η p ˜i p ˜i ˜T + pmax (2ρ + η ) wi . The proposed approximation weight update rule is T T ˙ i = βi(Γi zi − αΓi σi + ζ1(pi − wi )) if |σi | > δ w T otherwise. Assuming that there is a set of alternate weights p.1 radians and all other states are zero. Writ4 ing V = i=1 Vi allows us to analyze just Vi = ˆ bi 2 1 T 1 T ˜ w ˜i + ˜ p ˜i. then the error can be represented as σi = (Γi wi − Γi pi ). except for deadzone which has 0.32m error in Z (Fig. Inner Loop (Method of Alternative Weights) The method of alternative weights was first proposed in [12] and investigated for use on a quadrotor helicopter in [13]. ρ and η are positive gains used for adjusting the alternative weight update law and p ¯i =mean(pi ) The middle term ρ(¯ pi − pi ) is used to not only reduce the size of the alternate weights. w ˜ . the proposed alternate weights update rule that would bring the alternate output to within ±δ of the approximation output is ˙ = p i pi − pi ) − η pi ) if |σi | > δ κi(αΓT i σi + ρ(¯ κi(ρ(¯ pi − pi ) − η pi ) otherwise (24) 0 (2ρ + η ) wi where κi s. (23) Time (s) Fig.2 −0. 3.2 −0. 4. (27) i (− β κ When σ > δ . Since the training is done online (which really just means adjusting weights only to suite the particular trajectory).1 deadzone new method 0 20 40 60 80 100 120 140 160 180 200 e-modification ν = 40180 120 140 160 deadzone new method 200 0.4 −0. w where again V ˜ . w p z + 2 bi i 2 βi i 2 κi i (26) 001236 .6 20 40 60 80 100 120 140 160 180 200 0. All three techniques with no disturbance 4. but guarantee that they are different from the approximation weights. α. then 3T2 |zi | −Gi ˙i ≤ 4 w ˜i 5 4 0 V p ˜i 0 + ˆ max 2 0 −ζ1 ζ1 /2 3 2 3 0 |zi | 4 w ζ1 /2 5 ˜i 5 −η p ˜i ˜ ˆ |zi | w ˜i p ˜i ˜T .0 0 X (m) X (m) −0. there exists any number of weights that could fulfill the task of approximating the nonlinear function. while using knowledge of the alternate weights to reduce weight size. (25) where βi s.3 0 20 40 60 80 100 120 140 160 180 200 Z (m) −0. 5.6 0 4 x 10 −7 −0. ζ1 and ζ2 are positive gains used for adjusting the weight update law and ζ1 ζ2 (these last terms are thus used to force the approximation weights towards the alternative weights once the two outputs are similar enough).2 −0.4 0 20 40 60 80 100 Y (m) Y (m) 2 0 −2 e-modification ν = 0. The key to creating a stable approximation weight update rule requires adaptation based on state error.3 0. 3).1 0 0 20 40 60 80 100 120 140 160 180 200 0 0 Z (m) −0.2 0.

Further tests will be conducted with regards to other quadrotor flight modes and with such encouraging results.4 0. d3 . 228–233. Tippetts. Hughes. 220–227. 2006.4 0. 894–899. on Industrial Electronics.1 0 10 20 30 40 0 Y (m) 0.3 0. “Backstepping and sliding-mode techniques applied to an indoor micro quadrotor. The reason for this is apparent by looking at weight drift (measured as the average increase in the maximum weight magnitude per second in Fig. ζ2 (by a constant multiplier) demonstrates that the new method has an optimum value for the parameters whereas no value of ν can achieve high performance (Fig. Sys.4 0. 2006. Benallegue and T. A. ζ1 .K. 001237 . 1975. IEEE Intelligent Vehicles Symposium. “A new approach to manipulator control: the cerebellar model articulation controller (CMAC). vol.2 0. Paris. Tayebi.B. [3] A.C. 2006.” in Proc. 3. [12] C.1 0 10 20 30 40 0 0 1 2 3 4 5 Z (m) 0. Varying the robust parameter ν in e-modification and varying η . pp. [11] J. ζ1 . Sym.3 0. “Robust direct adaptive control with associative memories in the presence of persistent oscillations. Advances in Telerobotics. ζ2 Fig. Control Applications. pp.D.” in Proc. Fowers. 6. B. 6. The second simulations included the addition of disturbances d1 = 0.1 0 ˆ 1 drift w X (m) 2 0 −2 −4 2 1 0 0 x 10 −4 10 20 30 40 0 x 10 −4 1 2 3 4 5 0. Albus.J.2 0.W. Bouabdallah and R. IEEE Int.” in IEEE Trans. and J. Montreal.3 0. by a factor of more than 10 in all coordinates (Fig. Contr.” in Proc. “A new robust adaptive-fuzzy control method applied to quadrotor helicopter stabilization. Munich. 2003.1 0 ˆ 2 drift w 0 x 10 −4 10 20 30 40 0 x 10 −4 1 2 3 4 5 ˆ 3 drift w 0 1 2 3 4 5 2 1 0 4 2 0 0 x 10 −4 2 1 10 20 30 40 0 4 2 0 0 x 10 −4 0. [9] S. Lillywhite. Control Systems Technology. “Attitude stabilization of a vtol quadrotor aircraft. 5.” in Proc. Florida. pp. New York: Wiley. hopefully real prototype tests can be conducted in the near future. Contr. 562–571. 4). J.G. pp. 429–440. pp. Archibald. North American Fuzzy Information Processing Society Conference. no. 2007.” in Proc. Albus. 2005. Siegwart.2 0. 2006. Weight drift at t = 200 when varying the robust parameters [2] E. 14. but the new method can halt the weight drift easily. Spain.J. and C. Dyn. 5). pp.” in Proc.1(10 + 5 sin(2πt) (29) (30) For e-modification. pp. Ostrowski. Conf. [10] J.Canada. IEEE Int. [7] P. Dec. ζ1 .J. 454–458. Taylor. Meas.3 0.4 0. France. “Nonlinear state-dependent riccati equation control of a quadrotor uav. Macnab. pp. Jacksonville. ν needs to be at least 40 in order to avoid bursting in the first 200 seconds.2 0. 2006.3 0.2 0. Dennis.01(10 + 5 sin(2πt) d2 . 6). Voos. 10. Macnab. McGilvray and A. Spacecraft Attitude Dynamics.4 0. d4 = 0.1 0 10 20 30 40 0 0 1 2 3 4 5 x 10 −4 x 10 2 0 −2 −4 2 1 0 −4 0. Germany. vol.. “Data storage in the cerebellar model articulation controller (CMAC). 143–148. Turkey. “Vision aided stabilization and the development of a quad-rotor micro uav. 4294–4299. 1975. “Quadrotor control using dual camera visual feedback. [6] S. ζ2 0 10 ν 20 30 40 0 1 2 3 4 5 multiplier of η.4 0. Sys. K. Madani. Lee. Dyn.B. The new method outperforms both e-modification and deadzone when the large oscillations are present. Bouabdallah and R. IEEE Conf.” Neural Information Processing Letters. [8] H. vol. In e-modification ν must be very large to halt weight drift entirely. 7. Cartesian position error at t = 200 s when varying the robust parameters Fig. Erginer.” J.” J. 277–287. vol. Computational Intelligence in Robotics and Automation. IEEE Conf. [4] S. Conf. Altug and B.0. [5] E. REFERENCES [1] S.1 0 1 2 3 4 5 ν ˆ 4 drift w multiplier of η. Taipei. No changes were required for either deadzone or the new method. 2247–2252. Istanbul. on Robotics and Automation. CONCLUSIONS Although Lyapunov stability proofs gave uniform ultimate bounds for deadzone. Barcelona.3 0.” in Proc. Meas. 2007. pp. pp.2 0. 12. 1986. vol. e-modification and the new method. 97. 700–705. “Backstepping sliding mode control applied to a miniature quadrotor flying robot.P. “Modeling and pd control of a quadrotor vtol vehicle. IEEE Int. D.J. Taiwan.. pp. [13] C. Robotics and Automation. 2547–2552. 2006. 97. Siegwart. simulation results show that the new method is able to achieve far less error in terms of obtaining a desired attitude while also reducing weight drift when large oscillations are present. chapter Towards Intelligent Miniature Flying Robots. without sacrificing performance. Altug. pp. Coza and C.

Intentional Blank Page 001238 .