You are on page 1of 7

Available online at www.sciencedirect.


Procedia Engineering 41 (2012) 458 – 464

International Symposium on Robotics and Intelligent Sensors 2012 (IRIS 2012)

Low-Cost Microcontroller-based Hover Control Design of a Quadcopter
Bernard Tat Meng Leong, Sew Ming Low, Melanie Po-Leen Ooi*
School of Engineering, Monash University, Sunway Campus, Bandar Sunway, 46150 Selangor Darul Ehsan, Malaysia

In this paper, a low-cost hover control mechanism is developed and implemented on low-cost microcontroller for a type of aircraft
configuration known as the quadcopter. Flight control becomes simpler as the quadcopter hovers at a constant level from ground by itself,
at the same time allowing anyone to easily maneuver it at that height and perform tasks such as imaging. When successfully implemented,
the proposed hover control design will simplify the flight control of a quadcopter, especially for beginners and unskilled individuals.

© 2012 The Authors. Published by Elsevier Ltd. Selection and/or peer-review under responsibility of the Centre of
Humanoid Robots and Bio-Sensor (HuRoBs), Faculty of Mechanical Engineering, Universiti Teknologi MARA.
Keywords: hover control; quadcopter; microcontroller.

1. Introduction
The hover stability of a quadcopter is important for many of its applications such as security surveillance, crop
monitoring and on-board imaging to allow clear still images to be taken in surveillance operations [1]. It also prevents the
quadcopter from crashing in the event of strong wind or due to its weight. Fig. 1 shows the six degrees of freedom of the
quadcopter. In Fig. 1(a), x and y represents the translational motion along the x- and y-axes respectively and represents
yaw, the rotational motion about the z-axis, while in Fig. 1(b), represents roll, the rotational motion about the x-axis,
represents pitch, the rotational motion about the y-axis and z represents the translational motion in the direction
perpendicular to ground. The label ‘1’ signifies the front propeller.








Fig. 1 The six degrees of freedom of a quadcopter at (a) Bird’s eye view, (b) Frontal view

With a hover control unit, the quadcopter will hover at a constant height z (see Fig. 1(b)), with its roll and pitch angles
stabilised by the gyroscope. The person at the command base will only need to control the quadcopter’s motion along the xand y-axes and also its rotation about the z-axis (to turn corners), reducing the degree of complexity from six to only three.
This defines the purpose and aim of this paper, which is to obtain a stable quadcopter hover that will last for at least 5
minutes with an acceptable error of within
of the hover altitude.

* Corresponding author. Tel.: +6-035-514-6238; fax: +6-035-514-6207.
E-mail address:

1877-7058 © 2012 Published by Elsevier Ltd.

This paper proposes a Hover Control System which will operate on a low cost microcontroller board. the performance index is defined as (2). the linear quadratic regulation (LQR) method was employed. k u (k ) = K P e(k ) + K I ¦ e(i ) + K D (e(k ) − e(k − 1) ) (1) i =0 Table 1. 1. P – Proportional. This makes the proposed prototype portable as it can be installed in other quadcopter units without affecting their existing operation. controller boards have been developed and mass produced to be sold in the market.2. The mathematical expression of the discrete-time PID algorithm is given in (1).459 Bernard Tat Meng Leong et al. Control Theories 1. LQR is a form of linear optimal control regulation which aims to reduce the magnitude of the control input without affecting the performance of the control algorithm [12]. The LQR algorithm is used to obtain the parameter settings that will minimise the undesired deviations (in this research. the optimal control sequence that minimises the performance index is given by (3). A few notable off-the-shelf controller board developers are KKmulticopter. which usually have good performance but can be costly (up to USD 260 [6]). I determines the reaction based on a sum of recent errors while D responds to the rate at which the error has been changing. As opposed to the controller boards available in the market. A PID controller functions by calculating the error. The cost function or performance index refers to the sum of deviations of measured values from its desired values [12]. Hoverfly and DJI Naza. I – Integral and D – Derivative. Effects of Independent P. Successful implementation of the proposed prototype hover controller will enable the quadcopter hover control to be achieved at approximately 10% of the current controller market price in addition to being customisable to suit user’s needs. The PID algorithm consists mainly of three control parameters. P determines the reaction to the current error. / Procedia Engineering 41 (2012) 458 – 464 A significant number of research works have been performed to obtain a mathematical model which describes the quadcopter flight dynamics [2][3][4][5]. altitude) while at the same time limiting the energy expended by the control action by using a mathematical algorithm that minimises a cost function or performance index with weighting factors.1. PID control is a type of linear control that is widely used in the robotics and automation industry [10]. To solve this problem. Arduino Duemilanove. Table 1 summarizes the effects of increasing these parameters to the system. The PID algorithm is popularly used mainly because [11]: • It has a simple structure • It provides good performance • It can be tuned even if the specific model of the controlled plant or system is not available The last factor is important as it was not easy to obtain the exact mathematical model of the quadcopter [11]. the implementation of the Arduino board in this research does not require the original quadcopter gyroscope to be removed. Linear Quadratic Regulator Calculation of the control input by control algorithms such as PID control may return a control input gain which may be too high for the quadcopter system. which costs USD 24[7]. For a discrete-time LQR. I and D Tuning [11] Closed Loop Response Increasing Kp Increasing Ki Increasing Kd Rise Time Overshoot Decrease Increase Small Decrease Small Decrease Settling Time Small Increase Steady-State Error Decrease Stability Degrade Increase Increase Large Decrease Degrade Decrease Decrease Minor Change Improve 1. As a result. This results in a large control input magnitude which may be out of the limits recognisable by the system. PID Control The PID (Proportional-Integral-Derivative) control algorithm has been considered and implemented in literature to control the hover altitude of the quadcopter [8][9]. By adjusting the weight parameters Q and R. N ( J = ¦ x kT Qx k + u kT Ru k k =0 ) (2) . or difference between a measured output and a desired setpoint and adjusts the system control inputs such that the calculated error is minimised.

based on the height information provided by the sensor subsystem. thus achieving automatic hover control. 2. the propeller speed is either increased or decreased to bring the quadcopter altitude to the reference level. was used. Depending on the throttle control signal. The main function of the MCU is to obtain altitude readings from the sensor module and determine if hover control mode is asserted. and the actual altitude can be computed using the formula given in [13]. The flight altitude is then continuously monitored and communicated to the controller board. Integration of Subsystems To integrate the subsystems into a complete system. electronic speed controller (ESC) circuits. sensor and microcontroller. Microcontroller (MCU) Subsystem The Arduino Duemilanove MCU is placed in between the receiver and the gyroscope module (see Fig. propeller DC motors and a Lithium-Polymer battery.2) to manipulate the throttle command signal for hover control. The height information is transmitted by the sensor module to the MCU in terms of a PWM signal pulse width. 3 illustrates the integration of the hardware and subsystems to form the hover control system. / Procedia Engineering 41 (2012) 458 – 464 u k = − Fk x k −1 (3) 2.2 shows the components of the quadcopter subsystem. . Sensor Subsystem The sensor subsystem functions to provide the altitude information to the microcontroller subsystem. The command signal is a pulse-width modulated (PWM) signal that is received by the receiver module. The gyroscope unit will modify this signal by incorporating the attitude (roll. the PING))) Ultrasound Sensor. Fig. >ŝƚŚŝƵŵWŽůLJŵĞƌĂƚƚĞƌLJ ŽŵŵĂŶĚ ^ŝŐŶĂů ZĞĐĞŝǀĞƌ DŽĚƵůĞ 'LJƌŽƐĐŽƉĞ DŽĚƵůĞ ^ DŽĚƵůĞƐ WƌŽƉĞůůĞƌ DŽƚŽƌƐ ZŽůů͕WŝƚĐŚĂŶĚ zĂǁĂŶŐůĞƐ Fig. pitch and yaw angles) information before transmitting the signal to the ESC circuits. In this research. Quadcopter subsystem The quadcopter model used in this research is the GAUI 330-X Quadflyer. the microcontroller subsystem is used as the common interfacing point for all hardware and subsystems. Fig. The ESC modules functions to smoothen the speed variation of the DC motors. a low-cost ultrasound sensor unit developed by Parallax Inc. the PID control algorithm would be executed by the MCU.1. When hover control is activated. the ultrasound sensor captures the current altitude as the reference point. Hover Control System Design The hover control system consists of three major subsystems: quadcopter.460 Bernard Tat Meng Leong et al. a gyroscope unit. The quadcopter subsystem forms the physical system that requires control while the sensor subsystem provides altitude information to the control system.4.2. The PID control algorithm programmed into the MCU determines the throttle control signal that is transmitted to the gyroscope module based on the error computed in (1). If hover control mode is on. The microcontroller subsystem combines the electronic signals with the hardware in the hover control routine. This modification is performed to keep the quadcopter’s chassis level with respect to ground. 2 Components in the Quadcopter Subsystem 2. 2. The quadcopter subsystem consists of a receiver module.3. 2.

4(a). / Procedia Engineering 41 (2012) 458 – 464 Fig.1. It was found to be closely modeled by (4).461 Bernard Tat Meng Leong et al. Results and Discussion 3. Three types of control were tested and evaluated: P (Proportional). The step responses of the model using different PID tuning parameters were simulated using MATLAB Simulink. PI (Proportional-Integral) and PID (Proportional-Integral-Derivative). G( z) = 0.5 0 45 Time (s) -2 1. (b) and (c).5 0 Control Input Magnitude Altitude (m) 1. Software Simulation A model of the quadcopter’s dynamics along the z-axis is empirically obtained by performing system identification on the input-output data. with the corresponding tuning parameters are displayed in Fig. Table 2 summarizes the results obtained from software simulation. The simulation results. 3 Component and hardware design of the hover control unit 3.5 0 5 10 15 20 25 30 35 40 6 4 2 0 0 5 10 15 20 25 Time (s) (a) 30 35 40 45 Reference System Response 1 0.0025 (4) Plot of System's Step Response Plot of System's Step Response 2 Reference System Response 1 0.0228 z + 1.5 Control Input Magnitude Altitude (m) 2 0 5 10 15 20 25 30 35 40 45 30 35 40 45 Time (s) 6 4 2 0 -2 0 5 10 15 20 25 Time (s) (b) .

0. The steps involved in the empirical approach are shown in Fig.4 7.5 0 5 10 15 20 25 30 35 40 45 30 35 40 45 Time (s) 30 20 10 0 -10 0 5 10 15 20 25 Time (s) (c) Fig.0 Table 2. 4 The system response for (a) Proportional Control. (c) Proportional-IntegralDerivative Control. Software Simulation Results Control Type Proportional (P) Proportional-Integral (PI) Proportional-Integral-Derivative (PID) Settling Time (s) 5.1557. D = 1. I = 1. P = 3. P = 3. Thus an empirical method was developed to empirically obtain the control parameters. 3. However.6 0 0 Simulation results show that the PID control returns zero steady state error with lower settling time and overshoot compared to P and PI control.462 Bernard Tat Meng Leong et al.0. The tuning of the control system was performed based on the theoretical control effects summarised in Table 3. I = 4. it is desirable to have a low overshoot percentage and settling time with zero steady state error. Hardware Implementation The software simulation provided a good platform to understand the effects of the control parameters on the system.3 Overshoot (%) 0 22. thus the PID control is selected.81 17.9 Steady State Error (cm) 5.5. In this research. / Procedia Engineering 41 (2012) 458 – 464 Plot of System's Step Response Altitude (m) 2 1 0.0. This could be caused by inaccurate mathematical modelling of the actual quadcopter system. Set an initial Kp (Ki and Kd = 0) Large Overshoot? Yes Decrease Kp or Increase Kd No Stable? No Increase Kd Yes Steady State Error? No Optimum Control Achieved Yes Increase Ki .2.7 12.1557. a actual hardware implementation using the software-obtained parameters showed unstable hovering of the quadcopter..5 0 Control Input Magnitude Reference System Response 1. (b) Proportional-Integral Control. P = 7.

L. Hoffmann. no. making it difficult to navigate and be used in precise monitoring operations. Lund University. and Mr. In addition to that. ICRA '04. Acceleration Profile (x-dimension) 2 0 -2 0 200 400 600 800 1000 1200 Sample Number Acceleration Profile (y-dimension) 1 0 -1 0 200 400 600 800 1000 1200 Sample Number Acceleration Profile (z-dimension) 11 10 9 0 200 400 600 800 1000 1200 Sample Number Fig.. no. IEEE/WIC/ACM International Joint Conferences on . Waslander. the hovering of the quadcopter can be unstable. Bresciani. Identification and Control of a Quadrotor Helicopter”. 15-18 Sept.. Siegwart. P. vol.php?main_page=product_info&cPath=11&products_id=74 [Accessed 20 May 2012] [8] Erginer. The new acceleration profile shows that the quadcopter’s hover is stable at the reference altitude. [3] H. 2009. pp. S. Michal. [Online] Available: http://store.894-899. the optimal P. master’s thesis. 26 April-1 May 2004 [6]“DJI Naza (multicopter)”. CA. [Online] Available: http://quadcopter. 2004 IEEE International Conference on . Department of Automatic Control. J.005. but fully customisable to suit its users’ needs. y." Intelligent Vehicles Symposium. 2007 IEEE .dimensions 4. The purpose of this research was to address this hover stability issue and develop a hover control system that is not only low cost. Pechoucek. Altug. "Design and control of an indoor micro quadrotor.82-85. I and D values were found to be 0. / Procedia Engineering 41 (2012) 458 – 464 Fig. “Aerodynamics and Control of Autonomous Quadrotor Helicopters in Aggressive Maneuvering” in Proceedings of IEEE International Conference on Robotics and Automation (Kobe. "Autonomous UAV Surveillance in Complex Urban Environments. Siegwart..Bernard Tat Meng Leong et al. Conclusion The quadcopter configuration generally has a greater stability as compared to the other configurations. WI-IAT '09. .5. Acknowledgements The authors would like to thank Monash University for their support and resources to conduct this research.. USA) October 29. 4393. vol. Dušan. S. References [1] Semsch. unlike its other counterparts. vol.November 2." Web Intelligence and Intelligent Agent Technologies.arduino. the stability of the quadcopter can be evaluated." Robotics and Automation. 6 displays the acceleration profile obtained in the hardware implementation test. Eduard. 5 Empirical Methodology to Obtain Control Parameters Acceleration. R. M. .5. pp. Khoo Boon How for provision of the use of his data acquisition module. m/(s 2) Acceleration. Bouadballah.heliguy. Michal.003 respectively. 2004. B.01 and 0.. [4] S. 13-15 June 2007 463 . However.. . Pavlicek. Jakob. m/(s 2) Acceleration. G. the quadcopter is able to hover close to its target.and z. “Modeling.4398 [Accessed 20 May 2012] [7]“Arduino Duemilanove w/ Atmega 328”. m/(s 2) Using the empirical approach in Fig 5. no. E. 2009 [2] T. October 2008. Japan) May 2009. "Modeling and PD Control of a Quadrotor VTOL Vehicle.2. pp. “Full Control of a Quadrotor” in Proceedings of the 2007 IEEE/RSJ International Conference on Intelligent Robotics and Systems (San Diego. C. Murrieri. The results of the hardware implementation show that the quadcopter has a stable hover with an error of ±2 cm for a total flight time of 5 minutes with a total implementation cost of USD 24. Fig.. Using a 3-axis accelerometer. 6 Acceleration Profiles in the x-. Huang. Sweden.. [5] Bouabdallah. thus achieving stable hover control. Proceedings. R. Tomlin. 2007.

Nakazawa. W.576. Autonomous Flying Robots – Unmanned Aerial Vehicles and Micro Aerial Vehicles. S.540-545. 2010." Control Systems Technology..Kendoul. H. 559. B.. Tyagi.3. Suzuki. . S. Yun Li. .com/dl/docs/prod/acc/28015-PING-v1. Computing and Engineering (ICCSCE). IEEE Transactions on . May 2006 [10] K. / Procedia Engineering 41 (2012) 458 – 464 [9] Tayebi. pp. pp. "Optimal control of nonlinear inverted pendulum dynamical system with disturbance input using PID controller & LQR. and technology. 25-27 Nov.parallax." Control Systems Technology. A.48-52.. no. L..3. Gupta. design.571. pp.4. G. Nonami. "Attitude stabilization of a VTOL quadrotor aircraft. vol. Chong. Wang. pp.13.. 2011 IEEE International Conference on .O.14. vol. 562." Control System. Tokyo: Springer.. 2011 [13] “PING)))TM Ultrasonic Distance Sensor (#28015)” [Online] Available: www.pdf . IEEE Transactions on . . McGilvray.B. "PID control system analysis. [11] Kiam Heong Ang. F. vol.. no. no.464 Bernard Tat Meng Leong et al.. D. July 2005 [12] Prasad.