Open Access
Issue
Int. J. Simul. Multisci. Des. Optim.
Volume 8, 2017
Article Number A8
Number of page(s) 9
DOI https://doi.org/10.1051/smdo/2017001
Published online 10 February 2017

© M. Khodja et al., Published by EDP Sciences, 2017

Licence Creative Commons
This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

1 Introduction

The most popular of Unmanned Arial Vehicles is the quadrotor. Because of its ability to perform agile manoeuvres, take-off and land vertically, and hover, it is an ideal choice for search and surveillance, rescue, monitoring, military, and agriculture applications in both outdoor and indoor environments.

However, it is difficult to model [1, 2] complex and suitable quadrotor control systems. Many control methods, such as fractional sliding mode [3], backstepping [4], nonlinear proportional-integral-derivative (PID) [5], sliding model controllers [6], and fuzzy PID [7], have been studied. The simplest control method among these is the PID controller [8] because of its low program complexity, low processing speed, and small program size, occupying little memory. Therefore, the PID can be implemented in a low-cost microcontroller.

In PID control design, the parameters of the controllers are tuned manually or by using the tuning rules found in the linear control-based literature, such as Zieglar-Nichols (Z-N) tuning [9, 10]. Unfortunately, the manual tuning method has limitations of being time consuming and very tedious. While the conventional Z-N method has been very useful and helpful in our research in terms of practicality, it is criticized by many other researchers.

After developing a quadrotor, we were met with the problem of how to choose PID gains in order for our quadrotor to achieve stability. The fastest method with the least required effort to experimentally select the appropriate PID gains was the Z-N tuning. Within a few minutes of implementation we could obtain the PID gain values required to stabilize the quadrotor. With respect to time and effort, the Z-N method was the most advantageous. However, regarding robustness, overshoot, steady-state error, and rise time, the Z-N method falls short of the necessary standards. To overcome this, we instead employed a modern heuristics approach [1114], specifically particle swarm optimization (PSO) with the constriction coefficient method unlike in [15] they use the basic PSO. PSO used to determine the optimal PID gains for attitude stabilization of the quadrotor experimentally counterpart in [15] they applied for position control and is very clear the optimization of the attitude stabilisation has more priority than position control optimization for quadrotor. This stands in contrast with many other research efforts whose results come only from simulations [1618]. The second advantage of the Z-N method found in this study is that it produces PID gains that can be put into intervals, such that the PSO search within an interval by determining the sum of the Integral of Square Error (ISE) and the maximum of the overshoot as a multi-objective function [19] or a fitness function. Using this process, we found the optimized PID controller via simulation (offline) and validated the results experimentally. The results demonstrated the effectiveness of PSO applied to PID controllers for attitude stabilization of the quadrotor.

This paper is organized as follows: Section 2 provides a general description and presents a dynamical model of a quadrotor. Section 3 gives an overview of the Z-N method. Section 4 gives an overview of PSO and presents the PID controller design method incorporating PSO using a simulation to achieve stabilization of the quadrotor. Section 5 shows the simulation and experimental results. Section 6 provides the conclusions of the study.

2 The quadrotor model

A quadrotor has four propellers mounted on the end of two perpendicular arms and is actuated by four brushless DC motors. A basic configuration of a quadrotor [20] is shown in Figure 1.

thumbnail Figure 1.

A basic configuration of a quadrotor.

Each rotor pair of the same arm rotates in the same direction; one pair rotates clockwise, while the other rotates counter clockwise. The quadrotor moves by adjusting the angular velocity of each rotor. We used the simplified attitude dynamical model of a quadrotor same in [1] given by:(1) where fi are the thrust forces generated by four motors, l is the length of the quad-rotor arm, and τθ, τφτΨ are the generated torques of roll and pitch and yaw plans. τm1, τm2, τm3, τm4 are induced moments from there propeller rotation [20], inertial of quadrotor are Ix, Iy, and Iz calculated by SOLIDWORKS, the trust and drag coefficients data I found them in this technical data on this website [23] (see Table 1).

Table 1.

Quadrotor parameters.

The dynamic thrust of the motor-driven propeller was identified experimentally as described in references [2, 21] also the trust coefficient calculated in same experiment is approximate to trust coefficient in [23] (see Table 1). The frequency response of the propeller (GemFan 5030) speed with respect to the duty ratio of the motor speed controller (see Table 2) showed that dynamic thrust and duty ratio could be modelled as a first-order transfer function [21].

Table 2.

Some experiment results for trust calculation.

Our platform was based on a 250 mm (QAV250) fiberglass frame similar to experiment in this work [24]. The onboard autopilot software was developed in home, and the electronic components included an Arduino Due, an IMU, and an electronic speed controller the real photo of quadrotor in Figure 2. The front adds part because Arduino Duo is long and the black thing below it is just polyster to reduce noise affected on Ultrasonic sensor. Since the software was mostly custom-developed, it could easily interface with any additional sensors and modify the control laws of the PID control strategy [17] for attitude stabilization in Figure 3.

thumbnail Figure 2.

The realized quadrotor.

thumbnail Figure 3.

PID control strategy for attitude stabilization [17]. θd: Desired roll angle; φd: desired pitch angle; Ψd: desired yaw angle.

3 Tuning the PID controller using the Ziegler-Nichols method

The Ziegler and Nichols proposed rules [9, 10] for determining the values of proportional gain Kp, integral time Ki, and derivative time Kd. The determination of such parameters of PID controllers or tuning of PID controllers can be achieved on-site using experiments involving the quadrotor. There are two methods within the Z-N tuning approach. The first method of Z-N tuning is based on the open-loop step response of the system.

The second method of Z-N tuning, used in this paper, is a closed-loop tuning method that requires finding the ultimate gain and period. This can be achieved by adjusting the controller gain (Kc) until the system undergoes sustained oscillations (at the ultimate gain or critical gain), while maintaining the integral time constant (Ti) at infinity and the derivative time constant (Td) at zero. This paper used the second method as shown in Table 3 [9, 10].

Table 3.

Ziegler-Nichols tuning rule based on critical gain Kc and critical period Pc.

After completing development of the quadrotor, we had to determine the PID parameters efficiently, and with little theoretical basis since initially, the quadrotor dynamics were not precisely determined. Therefore, the Z-N method was applied as the first step towards stabilizing the quadrotor because it enabled experiments to be used for real-time acquisition of responses that could be plotted to determine PID parameters. Our quadrotor was symmetric, so therefore we only applied this method to the pitch component of the PID controller.

To verify the performance we used the integral of square error (ISE) as comparison criteria, defined as follows:(2)

Therefore, for PSO-PID tuning, this criteria (2) was used as the objective function to seek a set of PID gains such that the control system met the minimum performance criteria.

4 PID tuning by particle swarm optimization

There are a lot of heuristic optimization methods, and one of the most technical of these is PSO, first created by Kennedy and Eberhart in 1995 [13]. It is based on Swarm Intelligence methods, and aims to identify the optimal solution by imitating the movement of particles in a swarm similar to fish schooling or birds flocking.

There are several algorithms used for PSO [1113]. In this work, the integral of square error (ISE) and maximum overshoot of error were fitness functions (multi-objective functions), and the constriction coefficient [13, 22] method was selected because method was selected because never used before with our case. The swarm is guaranteed to converge [13] and with simplest control of the convergence speed, whereby the speed in (3) and position in (4) of each particle changed according the following:(3)where:with: c1 and c2 are the acceleration coefficients, and r1 and r2 are random values in [0, 1].(4)

PSO was used to tune PID gains (Kp, Ki, and Kd) offline using the model given in equation (1). PSO first produced an initial swarm of particles in the search space. Each particle represented a solution for PID gains, where their values were set within the range of the produced Z-N gains. Fifteen and 20 were chosen as the number of particles within the swarm and iterations within the search, respectively. A good set of PID controller gains yielded a good system response, and resulted in minimization of the performance criteria in listed in equation (2). The general strategy of the optimization problems is represented in Figure 4.

thumbnail Figure 4.

The general strategy of optimization. Note: Overshoot = Max(Actual angle) − Desired angle.

5 Results and discussion

In this section we describe the simulation and experimental results for three sets of PID gains. The first PID gains were obtained using the Z-N method. The second PID gains were obtained using PSO, for which the objective function was equal to sum of the integral square of error and maximum of overshoot. The third PID gains were also obtained using the PSO method, but the objective function was replaced with the Integral Square of Error function.

5.1 Z-N PID tuning

This First, we employed Z-N tuning experimentally to determine PID controller gains. Then, we varied the Z-N gain (Kc) until an oscillation appeared in our experiment as shown in Figure 5.

thumbnail Figure 5.

Critical gain (Kc) variation in real time.

Figure 6 shows the pitch angle error when the Z-N gain was varied. Here, a decrease in error could be observed as Kc increased, until oscillation occurred. Based on the Z-N method, the critical gain is depicted in the black rectangular region in Figure 6 and its corresponding value is shown in Figure 5 (Kc = 40). A magnified rendition of the black rectangle shown in Figure 6 was used to calculate the critical period (Pc = 0.2 s), as shown in Figure 7.

thumbnail Figure 6.

Pitch error angle when Kc was varied in real time.

thumbnail Figure 7.

Magnified black rectangle to calculate critical period Pc in real time.

Using the second Z-N method in Table 1, we found that:

Kc = 40, Pc = 0.2 for PID rule: Kp = 0.6 × Kc = 24; Ki = 0.5 × Pc = 0.1; Kd = 0.125 × Pc = 0.025.

5.2 PSO – PID gains optimization

We established intervals for the resulting PID gains achieved using the Z-N method, as shown in Table 4. The PSO method then searched for the optimal PID gains depending on the objective function. The search for the optimal PID was conducted offline, meaning that all calculations were performed via simulation, for which the determined gains were verified both using the simulation and experimentally. We used two different objective functions: the first was the sum of the maximum of the overshoot and the Integral Square of Error (ISE), and the second was just the Integral Square of Error.

Table 4.

Limited PSO search interval based on Z-N derived gains.

The PSO needed to determine number of particles and iterative number in order to calculate the PID gains. In our case the number, of particles was set to 15 and the iterative number was set to 20. Figure 8 shows changes in the particles’ positions during the search for optimized PID gains according to the first objective function. The blue points represent the swarms, the black points represent the local best particles, and the red points represent the global best particles.

thumbnail Figure 8.

Change in particles’ position during the search for the optimal PID controller gains.

The calculated PID gains obtained using two objective functions and the Z-N method, are summarized in Table 5.

Table 5.

Summary of PID gains obtained by Z-N tuning and PSO.

The PID gains shown in Table 5, were tested in our simulation model, and the step responses for the pitch angles are shown in Figure 9. The comparative simulation results are given in Table 6, based on ISE, overshoot, and rise time.

thumbnail Figure 9.

Pitch angles step responses for the three PID gains in simulation.

Table 6.

Comparison of the Z-N and PSO gains for pitch angle stabilization.

The objective function of PSO2 was only the Integral Square of Error. From Table 6, it can be seen that the rise time was the same for PID Z-N and PSO2, given the existing overshoot, but with lower ISE in the latter. It is very clear that the rise time and overshoot in the PID Z-N case was ameliorated by the PSO2. However, when we added the maximum of the overshoot as a second criterion to the objective function, it resulted in a lower overshoot, but with a smaller rise in ISE.

The PID controllers in Table 5, were tested experimentally, and the plots of the pitch error angle in steady-state for PID Z-N, PID PSO1, and PID PSO2 are shown in Figures 10, 12, and 14, respectively. The pulse responses are shown in Figures 11, 13, and 15, respectively and the comparative results are listed in Table 7, based on ISE for steady-state and pulse response conditions.

thumbnail Figure 10.

Pitch error angle in steady-state for Z-N PID.

thumbnail Figure 11.

Pitch error angle for Z-N PID.

thumbnail Figure 12.

Pitch error angle in steady-state for PID PSO1.

thumbnail Figure 13.

Pitch error angle for PID PSO1.

thumbnail Figure 14.

Pitch error angle in steady-state for PSO2.

thumbnail Figure 15.

Pitch error angle for PSO2.

Table 7.

Experimental comparative results for three optimized PID gains.

The simulation results of the Z-N tuned PID show that the pitch angle error response produced high ISE, high overshoot, and low rise time, but a better PID performance was obtained by applying PSO. Different objective functions provided different PID controller gains. In case when the overshoot was taken into consideration by the objective function, the pitch error response produced the lowest overshoot with a low ISE, but the highest rise time. In the case when the overshoot was not taken into consideration by the objective function, the response produced the lowest ISE with an existing overshoot. The experimental results in Table 7 and Figures 1014 depict the corresponding simulation analyses. However, the Integral Square of Error of PSO1 was lower than PSO2 because the response of the latter had greater overshoot than PSO1. In actual tests, the quadrotor is a noisy system and we cannot eliminate the gyroscopic torque and Coriolis-centripetal force that were neglected in the simulation results. For roll and the yaw motions, PID controllers were optimized using the same method presented in Figure 16, and demonstrated successful results and the error of three angles roll, pitch and yaw around 0.3°.

thumbnail Figure 16.

Error angle of the roll, pitch and yaw implemented together in experiment.

6 Conclusion

This research paper presents an optimized PID controller for attitude stabilization of a quadrotor using PSO the constriction coefficient method was never used before for attitude control of a quadrotor. The main advantage of optimization process that find the optimal solution with scientific method not as manual finding depending on the luck, and let the user of it more confidence with their results. The proposed method was tested both using a MATLAB simulation and experimentally. The simulation and experimental results were also compared with a conventional Z-N tuning PID controller and with two different objective functions that the PSO depends on to search the optimal PID controller. The efficiency of PSO was verified through experimental results.

References

  1. Bouabdallah S. 2007. Design and control of quadrotors with application to autonomous flying. Switzerland: Autonomous Systems Laboratory, Swiss Federal Institute of Technology Lausanne. (In the text)
  2. Alexis K, Nikolakopoulos G, Tzes A. 2012. Model predictive quadrotor control: attitude, altitude and position experimental studies. IET Control Theory & Applications, 6(12), 1812–1827. [CrossRef] [MathSciNet] (In the text)
  3. Carlos IE, Aldo JMV, Anand SO. 2016. Attitude control of quadrotors based on fractional sliding modes: theory and experiments. IET Control Theory & Applications, 10(7), 825–832. [CrossRef] [MathSciNet] (In the text)
  4. Chen F, Jiang R, Zhang K, Jiang B, Tao G. 2016. Robust backstepping sliding mode control and observer-based fault estimation for a quadrotor UAV. IEEE Transactions on Industrial Electronics, 63(8), 5044–5056. (In the text)
  5. Benboualia A, Tadjine M, Chrifi-Alaoui L. 2016. Robust tracking control of quadrotor using a nonlinear PID on eulidean group. The Mediterranean Journal of Measurement and Control, 12(1), 529–536. (In the text)
  6. Haoping W, Xuefei Y, Yang T, et al. 2015. Attitude control of a quadrotor using model free based sliding model controller, in Proceedings of International Conference on Control Systems and Computer Science, Bucharest. p. 149–154. (In the text)
  7. Faiz AS, Kushsairy K, Izhar ABM, et al. 2015. Attitude stabilization of quad-rotor (UAV) system using fuzzy PID controller (an experimental test), in Proceedings of International Conference on Computing Technology and Information Management, Johor. p. 99–104. (In the text)
  8. Tanveer MH, Faiz AS, Hazry D, et al. 2013. Stabilized controller design for attitude and altitude controlling of quad-rotor under disturbance and noisy conditions. American Journal of Applied Sciences, 10(8), 819–831. [CrossRef] (In the text)
  9. Ogata K. 2010. Modern control engineering, 5th edn, Pearson Education, New Jersey, USA. (In the text)
  10. Mallesham G, Mishra S, Jha AN. 2011. Ziegler-Nichols based controller parameters tuning for load frequency control in a microgrid, in Proceedings of International Conference on Energy Automation and Signal, Bhubaneswar, Odisha. p. 1–8. (In the text)
  11. Federico M, Beata W. 2015. Particle swarm optimization (PSO). A tutorial. Chemometrics and Intelligent Laboratory Systems, 149, 153–163. [CrossRef] (In the text)
  12. Dian PR, Siti MS, Siti SY. 2011. Particle swarm optimization: technique, system and challenges. International Journal of Computer Applications, 14(1), 19–26.
  13. Andries PE. 2007. Computational intelligence: an introduction, 2nd edn. John Wiley & Sons, West Sussex, England. (In the text)
  14. Khodier M. 2013. Optimisation of antenna arrays using the cuckoo search algorithm. IET Microwaves Antennas & Propagation, 7(6), 458–464. [CrossRef] (In the text)
  15. Mac TT, Copot C, Duc TT, Keyser RD. 2016. AR.Drone UAV control parameters tuning based on particle swarm optimization algorithm, in Proceedings of International Conference on Automation, Quality and Testing, Robotics – THETA 20th edition (AQTR), Cluj-Napoca, Romania, p. 475. (In the text)
  16. Mohammed JM, Mofeed TR, Abduladhem AA. 2014. Design optimal PID controller for quad rotor system. International Journal of Computer Applications, 106(3), 15–20. [CrossRef] (In the text)
  17. Boubertakh H, Bencharef S, Labiod S. 2013. PSO-based PID control design for the stabilization of a quadrotor, in Proceedings of International Conference on Systems and Control, Algiers, Algeria. p. 514–517. (In the text)
  18. Bolandi H, Rezaei M, Mohsenipour R, et al. 2013. Attitude control of a quadrotor with optimized PID controller. Intelligent Control and Automation, 4(3), 335–342. [CrossRef] (In the text)
  19. Hélio FF, Paulo BDMO, Eduardo JSP, et al. 2015. Many-objective PSO PID controller tuning, in Proceedings of 11th Portuguese Conference on Automatic Control, Portuguese. 183–192. (In the text)
  20. Hao L, Yongqiang B, Geng L, et al. 2012. Robust attitude control of uncertain quadrotors. IET Control Theory & Applications, 7(11), 1583–1589. (In the text)
  21. Myunggon Y. 2016. A transfer function model of thrust dynamics for multi-rotor helicopters. International Journal of Engineering Research & Technology, 5(1), 15–18, ISSN 2278-0181 (In the text)
  22. Goranka Š, Sanjin B, Roberto Ž. 2014. Comparative analysis of PSO algorithms for PID controller tuning. Chinese Journal of Mechanical Engineering, 27(5), 928–936. [CrossRef] (In the text)
  23. http://ecalc.ch/. (In the text)
  24. Liu C, Prior SD. 2015. Design and implementation of a mini quadrotor control system in GPS denied environments. Unmanned Aircraft Systems (ICUAS), 2015 International Conference on, Denver, CO, p. 462–469. (In the text)

Biography

Khodja Mohammed Abdallah received the engineer degree from M’sila university – M’sila – Algeria, in 2006 and the MS degrees from National Polytechnic School of Algiers (ENP), – Alharrche – Algiers, Algeria, in 2011, in electrical engineering, and actually PhD student in same school and from 2012 to now assistant professor in electrical engineering department at M’sila university. Current research interests include intelligent control for robotic systems.

Prof Mohamed Tadjine received his Engineering degree from the National Polytechnic School of Algiers (ENP), Algeria in 1990 and a PhD degree in Automatic Control from the National Polytechnic Institute of Grenoble (INPG), France, in 1994. From 1995 to 1997, he was a Researcher at the Automatic Systems Laboratory, Amiens, France. Since 1997, Professor Tadjine has been with the Department of Electric Engineering, ENP, Algeria. His research interests are in robust and non-linear control.

Prof Mohamed Seghir Boucherit was born in 1954 in Algiers. He received the Engineer degree in Electrotechnics, the Master degree and the Doctor (PhD degree) in Electrical Engineering, from the National Polytechnic School of Algiers (ENP), of Algiers, Algeria, in 1980, 1988, and 1995, respectively. Upon graduation, he joined the Electrical Engineering Department of the National Polytechnic School of Algiers (ENP). He is a Professor, Head of the Industrial systems and Diagnosis research team of the Process Control Laboratory and his research interests are in the area of Electrical Drives, Process Control Applications, and Diagnosis.

Moussa Benzaoui received the Master degree from M’sila university – Mechanical Department –M’sila- Algeria, in 2016. Current research interests include design of drone using SOLIDWORKS.

Cite this article as: Khodja MA, Tadjine M, Boucherit MS & Benzaoui M: Tuning PID attitude stabilization of a quadrotor using particle swarm optimization (experimental). Int. J. Simul. Multisci. Des. Optim., 2017, 8, A8.

All Tables

Table 1.

Quadrotor parameters.

Table 2.

Some experiment results for trust calculation.

Table 3.

Ziegler-Nichols tuning rule based on critical gain Kc and critical period Pc.

Table 4.

Limited PSO search interval based on Z-N derived gains.

Table 5.

Summary of PID gains obtained by Z-N tuning and PSO.

Table 6.

Comparison of the Z-N and PSO gains for pitch angle stabilization.

Table 7.

Experimental comparative results for three optimized PID gains.

All Figures

thumbnail Figure 1.

A basic configuration of a quadrotor.

In the text
thumbnail Figure 2.

The realized quadrotor.

In the text
thumbnail Figure 3.

PID control strategy for attitude stabilization [17]. θd: Desired roll angle; φd: desired pitch angle; Ψd: desired yaw angle.

In the text
thumbnail Figure 4.

The general strategy of optimization. Note: Overshoot = Max(Actual angle) − Desired angle.

In the text
thumbnail Figure 5.

Critical gain (Kc) variation in real time.

In the text
thumbnail Figure 6.

Pitch error angle when Kc was varied in real time.

In the text
thumbnail Figure 7.

Magnified black rectangle to calculate critical period Pc in real time.

In the text
thumbnail Figure 8.

Change in particles’ position during the search for the optimal PID controller gains.

In the text
thumbnail Figure 9.

Pitch angles step responses for the three PID gains in simulation.

In the text
thumbnail Figure 10.

Pitch error angle in steady-state for Z-N PID.

In the text
thumbnail Figure 11.

Pitch error angle for Z-N PID.

In the text
thumbnail Figure 12.

Pitch error angle in steady-state for PID PSO1.

In the text
thumbnail Figure 13.

Pitch error angle for PID PSO1.

In the text
thumbnail Figure 14.

Pitch error angle in steady-state for PSO2.

In the text
thumbnail Figure 15.

Pitch error angle for PSO2.

In the text
thumbnail Figure 16.

Error angle of the roll, pitch and yaw implemented together in experiment.

In the text

Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.

Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.

Initial download of the metrics may take a while.