Design and Self-Stabilization of Unmanned Aerial Vehicle (UAV) using PID Controller

Download Full-Text PDF Cite this Publication

Text Only Version

Design and Self-Stabilization of Unmanned Aerial Vehicle (UAV) using PID Controller

Dhanush Kumar1 Hafeel Hassan2 K. Adithya Rao3 Nishanth Salian4 Ms. Jayalakshmi K P5

Department of Electronics and Communication Engineering St Joseph Engineering College, Vamanjoor,

Mangalore, India.

Abstract – In today's advanced technological life, self-ruling quad copter or unmanned aerial vehicle (UAV) is gaining more importance because of their various applications. UAV is accurately made to keep up harmony between velocity, weight, soundness and force. UAVs are widely used in military operation as well as industries nowadays because of their reliability, cost effectiveness and multi functionalities. The idea behind the project is to implement an UAV with self-stabilization system. The idea started by building a quad copter with help of KK board which controls the basic movement of the quad copter such as yaw, roll, pitch and throttle. KK board was the efficient one for self-stabilization but does not guarantee efficient results in stabilization of the quad copter. Arduino platform is the other way for the stabilization operation, where four accelerometers are used to read the X, Y, Z axis values when the quad copter positions are changed. By this the behavior of quad copter is analyzed for different quad copter movements with efficient algorithm using PID controller. The above system constantly measures the angle of the drone and compares that value with the desired value and rectifies the error if there is one. But using this method stability was not up to the mark. Another method for developing stability system for quad copter is by using Arduino mini along with other component such as GPS module, telemetry devices and Pressure sensors along with compass. This packed system will help in attaining the maximum stability. This system has a special feature such as even if the signal between the transmitter and receiver is lost, with the help of GPS module the quad copter can be landed in same position where it was taken off.

Keywords: UAV, PID, Quad copter.


    A quad copter is multirotor helicopter that is lifted and propelled by four motors. Quad copter uses two sets of identical fixed pitched propellers, two clockwise and two counter-clockwise [1]. Control of vehicle motion is achieved by altering the rotation rate of one or more rotor. The application for quad copter is escalating day by day, from defense to agricultural farms quad copter finds its application everywhere. Today quad copter is used for aerial surveillance, pesticide sprinkling, delivery purpose, ground mapping etc. The initial implementation involves KK board which is having inbuilt flight controller. But the System response were not satisfying which lead for microcontroller platform which is programmed to control and monitor the drone movement during the flight. This method includes implementation of the system using

    efficient control system known as PID controller. This system has many advantages like reduced rise time, better transient response and better stability over other controlling system. Accelerometer is used to read the values of X, Y and Z axis readings corresponding to the drone movement in order to analyze the behavior of drone in different conditions, an efficient control mechanism is needed which will result in better control over the drone in different conditions. Quad copter nowadays is replacing normal day to day services with in-fusion of speedy deliveries and faster results. There is a widespread research and development possible in this spectrum.


    Quad copter construction includes different hardware components with respective values, different sensor with respective application and microcontroller. They are listed as follow:

    1. Quad-copter Frame

    2. Electronic Speed Controllers

    3. BLDC motor

    4. Propellers

    5. Channel Receiver

    6. Channel transmitter

    7. Arduino UNO

    8. Sensor

    9. LiPo battery

    Quad-copter frame

    The frame of the quad copter provides the physical structure for the entire aircraft. It joins the motors to the rest of the aircraft and houses all of the other components. The frame must be large enough to allow all four propellers to spin without collision but must not be too large. The F-450 quad copter frame is used as its suitable for the propellers and the payloads which have to be lifted.

    Fig 1 Quad-copter Frame

    Electronic speed controller

    Every motor needs an individual electronic speed controller. These speed controllers accept commands in the form of PWM signals and output the appropriate motor speed accordingly. Every ESC has a current rating, which indicated the maximum current that it may provide the motor without overheating. Appropriate ESCs must be chosen to ensure that they can provide enough current for the motors. 30A ESC is the good choice as used in the design, as they are well reviewed for use with quad copters and have a sufficient current rating. As 30A ESC is used so the maximum current it can handle is 23A.

    Arduino UNO

    Fig 5 Arduino UNO

    BLDC motor

    Fig 2 Electronics speed controller

    Arduino is an open-source prototyping platform based on easy-to-use hardware and software. Arduino boards are able to read inputs and turn it into an output. In this case activating a motor, turning on an LED, publishing something online. Arduino IDE (Integrated Development Environment) is use to upload programs to the Arduino boards and these microcontroller boards can be used to perform intended tasks.

    A typical brushless motor has permanent magnets which rotate around a fixed armature eliminating problems associated with connecting current to the moving armature. Brushless motors offer several advantages over brushed DC motors, including high torque to weight ratio, increased efficiency, increased reliability, reduced noise, longer lifetime, elimination of ionizing sparks from the comutator. The motors spin the propellers to provide the quad copter with lifting thrust. Quad copters almost exclusively use brushless DC motors, as they provide thrust-to-weight ratios superior to brushed DC motors. However, they require more complex speed controllers. The KV rating indicates how fast the motor will spin (RPM) for 1V of applied voltage.

    LiPo battery

    The battery provides electrical power to the motors and all electronic components of the aircraft. Lithium Polymer (LiPo) batteries are used almost exclusively, because they have high specific energy. LiPo batteries have a capacity rating and discharge rating. The main use of LiPo battery over here is that it provides large current required for operating the BLDC motors. 3000mAh LiPo battery of 40C discharging rate of 12V (3S) is used for design.

    Fig 6 Li-Po battery

    Channel Receiver


    Fig 3 BLDC motor

    Propellers come in many sizes and materials. They are measured by their diameter and their pitch, (diameter) x (pitch). 10×4.5 Propellers Black CW CCW 4 pieces have been used as per the requirements.

    Fig 4 Propellers

    Fig 7 Receiver

    The 6-channel receiver is used to control the Quad copter by using only first four channels of it.


    Fig 8 MPU 6050

    The gyroscope is a low-power three-axis angular rate sensor. It includes a sensing element and an IC interface able to provide the measured angular rate to the external world through digital interface



      Implementaion of the system design using KK board with the drone setup. At initial stage take off was the main problem which was encountered, then by calibrating the KK board with respect to raw, pitch, yaw and throttle values the takeoff problem is resolved, but stabilizing of quad copter became an challenging task.

      Throttle: It is provided by concurrently increasing or decreasing all propeller speeds with the same amount and rate. This generates a cumulative vertical force from the four propellers, with respect to the body-fixed frame. As a result, the quad copter is raised or lowered by a certain value.

      Roll: it is provided by concurrently increasing or decreases the left propellers speed and decreasing or increasing the right propellers speed at the same rate. Thus, this command leads only to a roll angular acceleration.

      Pitch: The pitch and roll are very similar. It is provided by concurrently increasing or decreasing the speed of the rear propellers and by decreasing or increasing the speed of the front propellers at the same rate. This generates a torque with respect to the y axis which makes the quad-rotor to tilt about the same axis, thereby creating a pitch.

      Fig 9 KK board

    2. Using Arduino controller with different sensor.

    System design of the self-stabilization of quad copter with microcontroller platform using different sensor is shown in the figure

    Fig 10 System diagram of Quad-Copter

    UNO development board consisting of Atmel Atmega328P IC as the main brain of the quad copter. The other interfaces to it are gyroscope, four BLDC (Brushless DC) motors connected through corresponding electronic speed controller (ESC), LiPo (Lithium Polymer) battery which is of 12V when fully charged and six-channel receiver. The receiver channels are aileron, elevator, throttle, rudder, aux1, aux2. Out of four BLDC motors two motors facing each other are connected in such a manner that they will rotate CW (Clockwise) while the rest of two facing each other will rotate CCW (Counter Clockwise).

    Table 1 Description of main system diagram


    Arduino programming

    Development Board

    Arduino UNO

    Power Supply

    3 Cell LiPo Battery-12 V


    MPU 6050

    BLDC Motor





    10×4.5 Propellers

    Quad-copter Frame


    The Table 1 shows the neat description of the main system with respective parameter which is used to perform the stabilization to the system. The ESC (Electronic speed controller) is used to supply a suitable power to the motor to turn the motor in suitable speed for the stable path. The ESC configuration is made as per the design which is show in the table 2 which describes the digital pin which has to be connected to the respective location to turn in suitable direction.

    Table 2 ESC Arduino connection

    Arduino Pins


    Direction of rotation


    Right Front

    Counter CLK


    Right Rear



    Left Front

    Counter CLK


    Left Rear


    Fig.11 Flowchart of system design

    The above flow chart represents the steps involved implementation of the system. The first step is to gather the required hardware specifications required to implement the quad copter and design the physical circuit for the same. This involves implementation of the basic circuitry for the quad copter.

    Second step is set up calibration, after the implementation of the quad copter the different components involved in the implementation such as MPU 6050, transmitter, receiver and ESCs should be interfaced properly with the micro controller. So, they can communicate efficiently with other interfaced components which will aid in further steps.

    Electronic Speed Controller (ESC) is one of the important components of the system which will control the speed of the BLDC motors which will control the Quad copter movements. ESC calibration involves the calibrating the current that flow from ESC to BLDC motors. Based on the pulse input given to the ESC the current output of the ESC will change to alter the speed of rotors. ESC calibration will ensure that the current output of the ESC will change according to PID controller output so that undesired movement in quad copter.

    Flight mode calibration focuses on the controlling the movement of the quad copter. Basically, there are two possible modes for the Quad copter that is '+' mode and X mode according to the mode the Throttle, Roll, Pitch and yaw input will alter. So, calibrating this step will make sure the system design can be extended to both modes.

    Calibration of the system will set up all the hardware component together, once the calibration step is complete the testing of the system will make sure that the designed system is working according to the requirement. At each testing phase if the performance is not up to the mark then previous calibration steps are carried out again to improve accuracy, additional feature like altitude hold can be introduced to the system using GPS module, barometer and telemetry.


    PID stands for Proportional-Integral-Derivative. PID controllers are found in a wide range of applications for industrial process control. Approximately 95% of the closed loop operations of industrial automation sector use PID controllers. After determining the attitude of the aircraft, it is necessary to implement a dynamic system controller to stabilize the quad copter at the desired attitude. One of the most effective methods of doing so is to implement a proportional, integral and derivative (PID) controller[2].

    Fig 12 PID controller

    PID controller shown in the above figure performs the operation as follow:

    State 1: The error e(t) is calculated as the set point is measured.

    State 2: The proportional term P is Kp * e (t).

    State 3: The integral term I is calculated as KI * (time integral of e (t)).

    State 4: The derivative term D is calculated as follow KD * (time derivative of e (t)).

    State 5: The 3 terms are summed to produce the controller output, u (t) = P + I + D.

    For the better analysis of system model, the mathematical model of quad copter has to be analyzed. In order to perform the analysis simulation of the mathematical model of the quad copter has to be done. MATLAB simulink tool is used for this purpose.

    Fig 13 The basic principle of PID Controller

    The quad copter model consists of four rotors which makes it a 4th order system with one pair of rotors rotating in clockwise and another in anticlockwise direction. Considering one pair of motor which becomes second order system is analyzed and its response is observed for the given input signal. Using MATLAB simulink tool second order system is analyzed.

    Fig 14 Block diagram of 2nd order system

    The model consists of 3 PID controllers each corresponding to X, Y and Z axis respectively, the second order system takes inputs from the PIDs and the output of the PIDs controls the movements in Y and Z axis. Two saturators are used to saturate the output. Output signals are been observed through scope. Here in simulink the parameter of the PID is changed and the response is observed. When the stable response is achieved then that values of the parameter are taken for the further operation.

    Fig 15 PID controller tuning

    Output for the PID parameter is shown below which describes the effect of the system when the parameter value is changed.

    Fig 16 Output with random alue of PID

    Fig.16 shows the response of the second order system when it is not stabilized. Hence the overshoot and undesired oscillation are observed in the system response

    Fig 17 Output with respective value of PID

    The Fig 17 represents the output of the system when it is stabilized. This response is observed when the PID controller is tuned for particular value of Derivative, Proportional and Integral parameter using trial and error method which decides the value for physical system design. It is observed that when the PID controller is tuned with proper P, I, D values the estimated output tends to follow the desired output.

    Involving GPS Module and other components for further stability

    This method includes GPS module for auto level, altitude hold for the smooth fly of the quad copter.

    Fig 18 GPS module

    The GPS/compass module is needed for the heading lock and GPS hold function

    Fig.19 Barometer

    The MS5611 barometer is used for the altitude hold function. It is very sensitive pressure sensor that can detect pressure differences within a10cm accuracy. MS5611 is light sensitive. Electronic speed controllers are controlled with a 1000us till 2000us pulse. 1000us means off and 2000us means full throttle. To make sure that ESCs react the same way, calibration of the 1000us and 2000us point is required. Without proper ESC calibration the motors

    will perform different and the quad copter doesn't fly. Without well balanced props and motors the gyro and accelerometer will produce noise that makes the motors react jerky which leads to minimal stability.

    To get the best performance the props and motors need to be balanced properly. For this the pressure sensor connection are as follow:

    Process used in the method of system design:

    1. Checking the angles of the quad copter.

    2. Calibrating the accelerometer to set the angles to zero when the quad copter is level.

    3. Calibrating the compass

    4. Testing the altitude hold function

    5. Depending on the location of the pressure sensor it might be necessary to adjust the PID values.

    6. Testing the GPS hold function.

    7. With this function activated the quad copter will hold its position fully autonomous.


    Case 1-(With KK board)

    First the methodology involves using KK board to control the stability. But the quad copter was not able to get the inputs suitably at some condition which led to loosen of control and due to the instability drone used to draw to ground. Hence this method of stabilization is not a good choice for the system.

    Case 2-(With Microcontroller)

    This method involves usage of microcontroller with the different sensors.

    Step 1

    Running some basic checks by removing the Propellers, disconnect the flight battery and ESC calibration is done.

    Step 2-(Channel Reading)

    Now move the sticks and see if the values on the screen correspond with the movements of the sticks. All the channels should read 1000us till 2000us with a center position of 1500 the input is held at the center position.

    Step 3-(Gyro / accelerometer angle check)

    Gyro is calibrated by keeping the quad copter at stable position. After the calibration, the roll and pitch angles are shown. The yaw value is the output of the gyro and will go back to zero if the yaw rotation stops.

    Fig 21 Angle Readings

    Step 4-(Calibrate the ESCs)

    Electronic speed controllers or ESC's are controlled with a 1000us till 2000us pulse. 1000us means LOW and 2000us means HIGH.

    Fig 21 Receiver output pulse (LOW)

    Step 5

    Fig 22 Receiver output pulse (HIGH)

    Fig 20 Joystick Reading

    Tests are conducted by varying altitude and angle based on the response of quad copter. The pulse ranging from 1000µs to 2000µs can be given to the quad copter since these are the limits for achieving the better performance of BLDC motors. The receivers first four channels are fed to the Arduino, while the lowest stick position of all the four channels in the transmitter is set to 1000µs and the uppermost stick position is set to 2000µs. Thus, all the four channels of receiver can receive the pulses in between 1000µs to 2000µs based on users input and control.



The design and Self-stabilization of unmanned aerial vehicle (UAV) is focused to deliver a low cost robust and system extendable solution for the existing problems in stabilization of quad copter. The design and approach in the project are novel and has achieved the objectives that are pre-decided in the beginning of the project. It has also achieved better efficiency than the previous approach thereby provides an effective solution. The stabilization is implemented using PID controller which is a closed loop control system, analyses the desired response with the actual response to nullify the factors which affects the stabilization of quad copter. The Stabilization system is designed for quad copter which consists of two pairs of counter rotating rotors. The stability of the system is tested and the additional features such as altitude hold are implemented for further optimization of the system.


The above system is implemented for quad copter and can be extended for an octa-copter or hexa-copter. The system can be designed to work in more rugged environment. The system can be made more autonomous by adding features such as auto landing in the case of transmitter failure and automated collision avoidance can be implemented for the same system.


  1. Luis E. Romero, David F. Pozo, Jorge A. Rosales,Quadcopter stabilization by using PID controllers, 978-1-4799-05500-6/13/

    ©2015 IEEE.

  2. Bresciani, T, Tesis de Maestría Modelling, identification and control of a quadrotor helicopter, Department of Automatic Control, Lund University, Lund, 2008

  3. Castillo P., Lozano R., Dzul A, Stabilization of a mini rotorcraft with four rotors. Control Systems, IEEE, 2015.

  4. Dhriti Raj Borah, Lidia Debnath, Mriganka Gogoi, A review on Quadcopter Surveillance and Control,School of Technology, Technology, Assam Don Bosco University.M. Young, The Technical Writers Handbook. Mill Valley, CA: University Science, 1989.

  5. Lucas M. Argenti, Willian C. Rezende, Paulo E. Santos, Renato

    1. Aguiar PID, LQR and LQR-PID on a Quadcopter Platform978-1-4799-0400-6/13/ ©2013 IEEE.

Leave a Reply

Your email address will not be published.