# Quadcopter System Modeling and Autopilot Synthesis

DOI : 10.17577/IJERTV3IS110007

Text Only Version

#### Quadcopter System Modeling and Autopilot Synthesis

Egypt

Prof. Dr. Adel-Ezzat EL-Henawy2 Electronics and Communications Department -Ain Shams University Egypt

Dr. Oda, A.N3

Electronics and Communications Department -Ain Shams University Egypt

Abstract – The developments in applied mathematics and computational capabilities facilitate the design and implementation of control. In addition, huge developments in nanotechnology and its availability attract many of the researchers towards embedded systems especially the embedded flight control. Among the real applications are the unmanned air vehicles (UAV), which is the state of art in the last few years especially the four rotors vertical take-off and landing (VTOL) aircraft known as the quadcopter, due to their maneuverability, ease of design and control. Although it remains a complete nonlinear system, this paper manipulate with mathematical representation of the quadcopter and modelling of the intended system. A linearization of the obtained mathematical model has been achieved via algebraic manipulation, the next objective for this paper is the autopilot design using with justification against previous work concerning the performance requirements of time responses and flight path characteristics. So a PID controller has been designed. Also, a FUZZY logic controller has been established, the evaluation of the obtained controllers and the original one with the nonlinear system has been achieved. The evaluation results reveals that the designed PID controller has the best performance and less control effort compared to the original and designed fuzzy controller.

1. INTRODUCTION

Unmanned aerial vehicle is the center of attention nowadays especially quadcopter, also known as Quadrotor helicopter, quadcopter is a multirotorhelicopter that is lifted and propelled by four rotors. Quadcopter are classified as rotorcraft, as opposed to fixed-wing aircraft, because their lift is generated by a set of rotors (vertically oriented propellers). Unlike most helicopters, quadcopter use 2 sets of identical fixed pitched propellers, 2 clockwise (CW) and 2 counter-clockwise (CCW). These use variation of RPM to control lift and torque. Control of vehicle motion is achieved by altering the rotation rate of one or more rotor discs, thereby changing its torque load and thrust/lift characteristics, it has a very high maneuverability over both helicopter and normal aircraft.

More recently quadcopter designs have become popular in unmanned aerial vehicle (UAV) research. These vehicles use an electronic control system and electronic sensors to stabilize the aircraft. With their small size and agile manoeuvrability, these quadcopter can be flown indoors as well as outdoors.

Even though there are a lot of different topics about the quadcopter structure, but most of the publications have focused on the control algorithm [1]. It can be stated that most of the articles propose a complex control algorithm or compare the performance of few of them. The most important techniques and the respective publications are now presented:

The first control is done using Lyapunov Theory [2, 3, 4, 5]. According to this technique, it is possible to ensure, under certain condition, the stability of the quadcopter.

The second control is provided by PD2 feedback [6, 7,8]. The strength of the PD2 feedback is the exponential convergence property mainly due to the compensation of the Coriolis and gyroscopic terms.

The third control uses adaptive techniques [9,10 ]. These methods provide good performance with parametric uncertainties and unmodeled dynamics.

The fourth control is based on Linear Quadratic Regulator (LQR) [6, 11]. The main advantage of this technique is that the optimal input signal turns out to be obtainable from full state feedback (by solving the Ricatti equation). On the other hand the analytical solution to the Ricatti equation is difficult to compute.

The fifth control is done with backstepping control [12, 13,14]. In the respective publications the convergence of the

Figure 2: coordinatesystem

The modelling of the quadcopter differs from fixed wing vehicle in the fact that we are not making the rotational transformations in the same order to go from the earth to body axes. Indeed, the most practical way is to carry out the final rotation of the earth to body transformation along the thrust direction [20]. Thus, the body to earth transformation, is done by the following direction cosine matrix:

quadcopter internal states is guaranteed, but a lot of computation is required.

sin sin sin cos cos

R cos sin

sin sin cos cos sin

cos cos

sin cos

sin

(1)

zxy

The sixth control is based on visual feedback. The camera used for this purpose can be mounted on-board [15, 16, 17] (fixed on the helicopter) or off board [18, 19] (fixed on the ground).

The main objective of the present paper is to design two controllers on a granted quadcopter Matlab Simulink model [2].

cos sin sin sin cos cos sin cos sin sin cos cos

Where , , : roll, pitch, yaw angle as shown in Fig.2.

The equation of motion including thrust force, hub force, drag moment, rolling moment, pitching moment, yawing moment and forces along X, Y, Z axis can be summarized as follows.

• A classical PID controller that sustain the stability of the

4 i+1 4

Ixx j= I -I +J +l -T +T -h H + -1 R

• An advanced controller (FUZZY controller).

yy zz

r r 2 4

i=1 yi 4

i=1

i+1 4

mxi

• Then comparison between the designed controllers and

I = j I -I +J j +l T -T +h H + -1 R

yy zz xx r r 1 3

i=1 xi

i=1

myi

the original one has been presented.

I = j I -I

+J + -1i 4 Q +l H -H

+l -H +H

zz xx yy

r r i x2 x4

y1 y3

4

i=1

(2)

mz=mg- cjc T

i=1 i

4 4 1

The model developed in this thesis assumes the following

mx= cscj+ssj T – H – C A x x

[1]:

i=1 i i=1

4 4

xi 2 x c

my= sscj-csj T – H – 1 C A y y

• The structure is supposed rigid.

• The structure is supposed symmetrical.

i=1 i i=1

yi 2 y c

• The center of gravity and the body fixed frame origin are assumed to coincide.

• The propellers are supposed rigid.

• Thrust and drag are proportional to the square of propellers speed.

The rotation dynamics of the quadcopter is modelled using Euler-Lagrange Formalism. Let us consider earth fixed frame E and body fixed frame B, as seen in Fig.2. The airframe orientation in space is given by a rotation R from B to E, where R belong to SO3 is the rotation matrix.

Where Ixx , Iyy , IzzBody inertia moment,r: rotor speed, Jr: rotor inertia moment. : solidity ratio , : inflow ratio, a : lift slope , : induced velocity , Âµ : rotor advance ratio ,

: air density ,T: motor thrust ,H: hub forces, c: cosine, s: sine

A simulation program using Matlab m files and Simulink file has been established or modeling the underlying system

[2] as shown in fig.3.

If a mathematicalmodel of the plant can be derived, then it is possible to apply various designtechniques for determining parameters of the controller that will meet the transient andsteady-state specifications of the closed-loop system. However, if the plant is so complicatedthat its mathematical model cannot be easily obtained, then an analytical orcomputational approach to the design of a PID controller is not possible. Then we mustresort to experimental approaches to the tuning of PID controllers. Fig. 4 shows the control loop.

The quadcopter dynamics must be linearized to provide an easy inversemodel which can be implemented in the control

Input

Controller

Feedback

Platform

Output

algorithms.so equation (2) can be rearranged concerning to the following consideration.[1]

The angular contributes are quite complex because several variables havebeen taken into account. Most of those come from cross coupling of angularspeeds (gyroscopic effects and Coriolis-centripetal form). Since the motion of the quadcopter can be assumed close to the hovering condition, smallangular changes occur (especially for roll and pitch) It follows that theseterms can be simplified because smaller than the main ones, and also one can neglect these gyroscopic effects and thus remove the cross coupling due to this near hovering position.

The whole control algorithm is used to give the right signals to the propellers. Since they are four, no more than four variables can be controlled in the loop. From the beginning of the project, it has been decided to stabilize attitude (Euler angles) and height. According to this choice, the equations which describe the X and Y position have been deleted. And the model is rewritten as follows.

Figure 4: closed loop control loop

The closed loop system including the designed controller and the linearized airframe has the following step response as shown in fig. 5

Figure 5: Altitude step response

Table 1: Altitude Response

 Controller Parameters Settling time Max. overshoot Steady state error PID on linear platform 2 sec 0.015 radian 0.01 radian

U

2

I xx

U 3

(3)

I

xx

U

4

I zz

3. DESIGN OF PID CONTROLLER

4. FUZZY CONTROLLER DESIGN AND TUNING

Fuzzy logic is a convenient way to map an input space to an output space [22]. Between the input and the output there is a black box that does the work [23]. What could go in the black box any number of things: fuzzy systems, linear

PID technique represents the basics of control, PID is often

chosen because of its Simple structure, Good performance and Tuning even without a specific model of the controlled system [21].

systems, expert systems, neural networks, differential equations. etc.Clearly the list could go on and on. Of the dozens of ways to make the black box work, it turns out that fuzzy is often the very best way.

The fuzzy logic system block diagram is shown in Fig 6. It consists mainly of four basic blocks: the fuzzification interface, the inference engine (mechanism), the rule-base, and the defuzzification interface, [24].

Figure 6: Fuzzy control loop

The rule base is provided by experts or can be extracted from numerical data, fuzzificationmaps crisp input numbers (controller input) into fuzzy input sets (information) that can be used to activate rules,Inference engine maps fuzzy input sets into fuzzy output sets,defuzzification maps output sets into crispoutput numbers, which correspond to control activities.

According to past experience on the underlying system, a FUZZY logic controller is designed that is consists of:

• Five membership function.

• Three of them is triangular and the two trapezoidal as shown in fig.7

• The input to the fuzzy system is the error signal and its derivative.

• The output of each channel is the control signal to the motors.

For example in the following figures 7, 8 shows the membership function of the pitch channel input error signal and output signal.

Figure 7: Pitch error membership function

Figure 8: Output membership function

The input to the FUZZY controller is the error and the derivative of the error, so according to the inputs and the membership function a twenty five rule is written as shown in fig.9. For the rules of the pitch channel.

Figure 9: Pitch rules

The surface shown in figure.10 shows the surface of the pitch channel which indicates a smooth surface indicating a smooth changing from one rule to another that yields to a suitable controller. As shown in fig.10.

Figure 10: Pitch control surface

5. EVALUATION OF THE DESIGNED CONTROLLER ON THE NONLINEAR PLATFORM.

In order to test the performance of the designed controllers a test procedure is chosen so that the initial condition for the pitch, roll and yaw angle is 0.3 radian=17 [deg.] and the height is 1[m.], the controller is supposed to make the 3 angles reach 0 radian and the height to reach 3 meter .

The following figures shows the response of the system, the blue line indicates the designed PID controller, the red indicates the designed FUZZY controller and the black one indicates the original controller.

Figure 11: Pitch response. Table 2: Pitch Response

Figure 12: Roll response Table 3: roll Response

Figure 13: Yaw

Table 4: Yaw Response

Figure 14: Altitude response

Table 5: Altitude Response

 Controller Parameters Settling time Max. overshoot Steady state error DESIGNED PID 3.6 sec 0 meter 0 radian DESIGNEDFUZZY 3.5 sec 0 meter 0.04 radian ORIGINAL CONTROLLER 4 sec 0.05 meter 0 radian

As shown from figures and tables the designed PID controller gives a very stable and good performance in both attitude and altitude control than FUZZY controller and original controller, in settling time ,steady state error, max overshoot and the response of the PID system is faster than the other two controller.

And from the point concerning the controller control effort as an example the yaw controller as shown in Table6.

 Parameter Controller DESIGNED PID DESIGNED FUZZY ORIGINAL model VARIANCE 7.7682e-07 2.1523e-06 1.4003e-06

The control effort from the designed PID controller is smaller than the other two controllers and thats shown from calculating the variance of the control signal from each controller.

6. CONCLUSION

The paper presented the modelling of the intended system concerning the reference frames, coordinates transformations and equations of motion. This model is built in the form of modules assigned to each process within the Quadcopter system. Then, it is programmed within MATLAB environment.The simulation is conducted with different engagement scenarios and different sources of uncertainties. The designedautopilots proved its robustness, but the PID controller shows better in performance in both attitude and altitude than fuzzy and the original controller, even the control effort of the designed PID controller is less than that of the FUZZY and the original controller and much simpler so the PID controller is more than enough for this platform.

7. FUTURE WORK

Implementation of the designed PID controller on an embedded system and place it on a real quadcopter platform to stabilize its attitude performance.

REFERENCES

1. Tommaso Bresciani. Modelling, Identification and Control of a Quadrotor Helicopter. (Department of Automatic Control Lund University October 2008).

2. P. Murrieri S. Bouabdallah and R. Siegwart. Design and control of an indoor micro quadrotor.( 2009)

3. A. Dzul P. Castillo and R. Lozano. Real-time stabilization and tracking of a four-rotor mini rotorcraft. IEEE Transaction on Control System Technology, 12(4):510 516, July 2004. 2

4. R. Lozano P. Castillo and A. Dzul. Stabilization of a mini rotorcraft having four rotors. Proceedings of 2004 IEEE/RSJ International Conference on Intelligent Robots and Systems.

5. A. Palomino S. Salazar-Cruz and R. Lozano. Trajectory tracking for a four rotor mini-aircraft. Proceedings of the 44th IEEE Conference on Decision and control, and the European Control Conference 2005.

6. A. Noth S. Bouabdallah and R. Siegwart. Pid vs lq control techniques applied to an indoor micro quadrotor.(2010)

7. A. Tayebi and S. McGilvray. Attitude stabilization of a four-rotor aerial robot. 43rd IEEE Conference on Decision and Control, pages 1216 1221, 2004.

8. A. Tayebi and S. McGilvray. Attitude stabilization of a vtol quadrotor aircraft. IEEE Transaction on Control System Technology, 14(3):562

571, May 2006. 2, 6.1

9. A. Fradkov B. Andrievsky and D. Peaucelle. Adaptive control experiments for laas helicopter benchmark. (2005) 760 765,

10. Y. Morel and A. Leonessa. Direct adaptive tracking control of quadrotor aerial vehicles. Florida Conference on Recent Advances in Robotics, pages 1 6, 2006. 2

11. R. Lozano P. Castillo and A. Dzul. Stabilization of a mini rotorcraft with four rotors. IEEE Control Systems Magazine, pages 45 55, 2005. 2

12. T. Madani and A. Benallegue. Backstepping control for a quadrotor helicopter. Proceedings of 2006 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 3255 3260, 2006. 2

13. T. Madani and A. Benallegue. Backstepping sliding mode control applied to a miniature quadrotor flying robot. 2006. IEEE Industrial Electronics, IECON 2006 – 32nd Annual Conference

14. T. Madani and A. Benallegue. Control of a quadrotor mini-helicopter via full state backstepping technique. Proceedings of the 45th IEEE Conference on Decision and Control, pages 1515 1520, 2006.

15. T. Hamel N. Guenard and R. Mahony. A practical visual servo control for a unmanned aerial vehicle. 2007 IEEE International Conference on Robotics and Automation, pages 1342 1348, 2007.

16. M. Valenti G. P. Tournier and J. P. How. Estimation and control of a quadrotor vehicle using monocular vision and moire patterns. AIAA Guidance, Navigation, and Control Conference and Exhibit, 2006.

17. T. Hamel N. Metni and F. Derkx. Visual tracking control of aerial robotic systems with adaptive depth estimation. Proceedings of the 44th IEEE Conference on Decision and Control, and the European Control Conference 2005, pages 6078 6084, 2005.

18. J. P. Ostrowski E. Altug and C. J. Taylor. Quadrotor control using dual camera visual feedback. Proceedings of the 2003 IEEE International Conference on Robotics and Automation, pages 4294 4299, 2003. 2 [19] M. G. Earl and R. DAndrea. Real-time attitude estimation techniques applied to a four rotor helicopter. 43rd IEEE on Decision and Control, pages 3956 3961, 2004. 2

19. Eck C., Navigation Algorithms with Applications to Unmanned Helicopters. Thesis, ETHZ, 2001. [21] Katsuhiko Ogata, Modern Control Engineering, Fifth Edition (2009), ch.8.

20. Jerry M. Mendel, Fuzzy logic system for engineering, Proceedings of the IEEE, pp 345-377. [23] Robert Babuska, Fuzzy systems, modeling and identification.

21. John Yen and Reza Langari, Fuzzy logic intelligence, control, and information, (1999).