International Journal of Science and Research (IJSR) ISSN (Online): 2319-7064 Comparison between Genetic Algorithm based PID Controller and Fuzzy Logic based PD Controller for Position Control of DC Motor in Simulink Laxmi Sahu1, Nivedita Singh2 1 M. Tech Scholar (D.E.), Electronics and Telecommunication Rungta College of Engineering & Technology, Bhilai, C.G., India 2 Assistant Professor, Electronics and Telecommunication, Rungta College of Engineering & Technology, Bhilai, C.G., India Abstract: The objective of this paper is to compare the Genetic Algorithm based PID controller and Fuzzy Logic based PD controller in position control system of a DC motor. Mainly there are two types of controller; PID and Fuzzy Logic PD controller will be used to control the output response. The Fuzzy controller is used to control the position of a motor and motor parameters are taken from a datasheet with respect to a real motor and a simulated model is developed using MATLAB Simulink Toolbox. The controlling signal is computed in real time using suitable fuzzy membership functions depending upon the state of the power factor. It was found that the proposed PD parameters adjustment by the Fuzzy Logic is better than the genetic algorithm method. Keywords: Position control system, PID controller,PD controller, Fuzzy Logic controller,Genetic Algorithm, DC motor 1. Introduction 2. Mathematical Representation of a DC Motor DC motor has excellent speed and position control characteristics; hence it has been widely used in industry even though its maintenance costs are higher than the induction motor. As a result, position control of DC motor has attracted considerable research and several methods have evolved. Proportional-Integral Derivative (PID) controllers have been widely used for speed and position control of DC motor. The application of fuzzy logic is an effective alternative for any problem where logical inferences can be derived on the basis of causal relationships 7],[8] Proportional-Integral-Derivative (PID) control is the most common control algorithm used in industry and has been universally accepted in industrial control. The PID controller includes a proportional term, integral term and derivative term, where the proportional term is to adjust the output of controller according to all of the magnitude of error, the integral term is used to remove the steady state error of control system and improve the steady state response, the derivative term is used to predict a trend of error and improve the transient response of the system. A PID controller improves the transient response of a system by reducing the overshoot, and the settling time of a system [8] Figure 1: DC Motor Model In armature control of separately excited DC motors, the voltage applied to the armature of the motor is adjusted without changing the voltage applied to the field. Fig (1) shows a separately excited DC motor equivalent model [7] GA is a stochastic global adaptive search optimization technique based on the mechanisms of natural selection. Recently, GA has been recognized as an effective and efficient technique to solve optimization problems, compared with other optimization techniques. GA starts with an initial population containing a number of chromosomes where each one represents a solution of the problem which performance is evaluated by a fitness function [11]. Paper ID: 020131408 Volume 3 Issue 4, April 2014 www.ijsr.net 164 International Journal of Science and Research (IJSR) ISSN (Online): 2319-7064 Let us combine the upper equations together: Laplace transforms of (5) and (6) are: If current is obtained from (8) and substituted in (7) we have Then the relation between rotor shaft speed and applied armature voltage is represented by transfer function: The relation between position and speed is: 3. Proportional Controller Integral Derivative (PID) PID controllers are widely used in industrial control applications due to their simple structures, comprehensible control algorithms and low costs. PID stands for Proportional-Integral-Derivative. Each element of the PID controller refers to a particular action taken on the error. This section reviews the fundamental of PID controllers and presents detailed simulations or design for development of DC motor controller. PID controllers are commonly in the time-domain behaviour of dynamic systems. They are extremely popular because the controller provides good response characteristics, which can be tuned using simple rules and are easy to construct 9], [10] Electric motor converts electrical energy into the mechanical motion and are broadly classified into two different categories: DC (Direct Current) motor and AC (Alternating Current) motor. DC motors are usually modelled as linear systems where linear control approaches are implemented. Most of the linear controllers give unsatisfactory performance due to the load changes of motor and due to the nonlinearities of armature reaction. The impact of external disturbances and of nonlinearities may risk the stability of the closed loop system. Fig (3) shows the schematic model of a control system with a PID controller 10] Then the transfer functions between shaft position and armature voltage at no-load is: Fig (2) shows the DC motor model built in Simulink. Motor model was converted to a 2-in 2-out subsystem. Input ports are armature voltage (Va) and load torque (Tload) and the output ports are angular speed in (w) and position (teta). Figure 3: PID control system Control signal is u (t) a linear combination of error e (t), its integral and derivative. Figure 2: Simulink Model for DC Motor A 3.70 kW, 240V, 1750 rpm DC motor with the below parameters was used: 4. Fuzzy Logic Fuzzy logic is a derivative from classical Boolean logic and implements soft linguistic on a continuous range of truth values to be defined between conventional binary. It can often be considered a suspect of conventional set theory. Since fuzzy logic handles approximate information in a systematic manner, it is ideal for controlling non-liner systems and fro modelling complex systems where an Paper ID: 020131408 Volume 3 Issue 4, April 2014 www.ijsr.net 165 International Journal of Science and Research (IJSR) ISSN (Online): 2319-7064 inexact model exists or systems where ambiguity or vagueness is common. A typical fuzzy system consists of a rule base, membership functions and an inference procedure [9]. Today, fuzzy logic are found in a variety of control applications like chemical process control, manufacturing and in such consumer products as washing machines, video cameras and automobiles. Fuzzy logic is a suspect of conventional Boolean logic that has been extended to handle the concept of partial truth- truth- values between “completely true” and “completely false”. Fuzzy theory as a single theory, we should regard the process of fuzzification as a methodology to generalize ANY specific theory from a crisp (discrete) to a fuzzy (continuous) form. Thus, recently, researchers have also introduced “fuzzy calculus” and “fuzzy differential equations” [2], [3]. 4.1. Fuzzy Rule Base Fuzzy logic has been centered on the point that it makes use of linguistic variables as its rule base. If a variable can take words in natural language as its values, it is called linguistic variable, where the words are characterized by fuzzy sets defined in the universe of discourse in which the variable is defined. Examples of these linguistic variables are slow, medium, high, young and thin. There could be combinations of this variable too, like “slow-young horse”, “a thin young female.” These characteristics are termed atomic terms while their combinations are called compounded terms. In the real world, words are often used to describe characteristics rather than numerical values. For example, one would say “the car was going at 100 miles per hour.” Terms such as slightly, very, more or less, etc. are called linguistic hedges since they add extra description to the variables, i.e. very – slow, more or less, slightly high, etc. At the heart of the fuzzy rule base are the IF-THEN rules 5], [6] control rules based on the inputs. The precise fuzzy membership functions depend on the wide range of inputs and the general response characteristics of the system. Within power systems, fuzzy logic controllers primarily using MATLAB – FIS Editor have been proposed. The structure of the Fuzzy Logic Controller (FLC) and its design consist of the following steps: 1) Identification of input and output variables. 2) Construction of control rules. 3) Establishing the approach for describing system state in terms of fuzzy sets, i.e., establishing fuzzification method and fuzzy membership functions. 4) Selection of the compositional rule of the inference. 4.3. Membership Functions The membership functions consist of the seven linguistic terms: * Negative Large Large (NLL) * Negative Large (NL) * Negative Small (NS) * Zero (Z) * Positive Small (PS) * Positive Large (PL) * Positive Large Large (PLL) The input e presented in Fig (6) consists of all seven terms to increase response with respect to the error. The input ce and output cu both have five terms as shown in Fig (7) and Fig (8) since it was optimal to keep them at a lower degree of precision. All membership functions were chosen to be of the triangular and trapezoidal type, mostly due to its common use during class and straightforward implementation. A fuzzy IF-THEN rule is expressed as, IF<fuzzy proposition>, THEN <fuzzy proposition> Propositions are linguistic variables or atomic terms as described previously. This type of rule based system is different from the classical expert systems, In that, rules may not necessarily be derived from human expertise; they may also be derived from other sources. Three types of linguistic variable forms exist. Figure 6: Membership function for e, μe(x1) 1. Assignment statements 2. Conditional statements 3. Unconditional statements 4.2. Fuzzy Logic Controller Design The traditional control design paradigm is to form a system model and develop control laws. The controller may be modified based on results of testing and experience. Due to difficulties of analysis, many such controllers are linear. The fuzzy controller approach should be reversed to some extent. General control rules will be based on experience are introduced and analyzed. Implementation of this concept is for anticipating the position and reducing the control level to avoid overshoot. The quantities like “small” and “large” are used in fuzzy quantities. A controller design requires a set of Paper ID: 020131408 Figure 7: Membership function for ce, μce(x2) Volume 3 Issue 4, April 2014 www.ijsr.net 166 International Journal of Science and Research (IJSR) ISSN (Online): 2319-7064 5. Tuning of PID Controller Using Genetic Algorithm Approach 5.1 Overview of Genetic Algorithm Figure 8: Membership function for cu, μcu(y) 4.4. Membership Rule Base The input e uses seven membership functions, while ce uses five, which required a rule base consisting of 35(7x5) rules. The resulting rule base can be seen in Table 1. The rule base was developed to present smooth, gradual transitions to an error relative to zero error by attempting to decrease the change in error, ce. GA is a stochastic global adaptive search optimization technique based on the mechanisms of natural selection. Recently, GA has been recognized as an effective and efficient technique to solve optimization problems, compared with other optimization techniques. GA starts with an initial population containing a number of chromosomes where each one represents a solution of the problem which performance is evaluated by a fitness function. Basically, GA consists of three main stages: Selection, Crossover and Mutation. The application of these three basic operations allows the creation of new individuals which may be better than their parents. This algorithm is repeated for many generations and finally stops when reaching individuals that represent the optimum solution to the problem. The GA architecture is shown in Fig (11). Table 1: Membership Rule Base Figure 9: Response of the system based on the fuzzy logic controller. 4.5. FPD controller design Fig (10) shows the control system with an FPD controller Figure 11: Genetic Algorithm Architecture 5.2 Implementation of GA based PID controller GA can be applied to the tuning of PID position controller gains to ensure optimal control performance at nominal operating conditions. The block diagram GA-PID controller system is given below and also the genetic algorithm parameters chosen for the tuning purpose are shown below, Figure 10: Control system with an FPD controller Paper ID: 020131408 Volume 3 Issue 4, April 2014 www.ijsr.net 167 International Journal of Science and Research (IJSR) ISSN (Online): 2319-7064 Figure 12: Structure of GA-PID controller 6. Conclusion The results of experiments on FPD & GA PID model revels that the controller designed with FPD has much faster response than the response of GA PID controller .The Fuzzy Logic designed PD is much better than the GA PID in terms of the rise time and the settling time. Also fuzzy logic controller is able to sensitiveness to the variation of the reference position compared to GA PID. Moreover the FPD is very easy to implement as it is designed only based on the input & output of the plant and does not required a mathematical model of the plant as in case of GA PID. The comparison of both the Fuzzy based controller and PID controller on a DC motor,” Procee. of IEEE (FOCI 2007), pp. 531-538, 2007. [8] G. Haung and S. Lee, “PC based PID speed control in DC motor,” IEEE Conf. SALIP-2008, pp. 400- 408, 2008. [9] Zadeh, M. H., Yazdian, A. and Mohamadian, M., Robust Position Control in DC Motor by Fuzzy Sliding Mode Control. International Symposium on Power Electronics, Electrical Drives, Automation and Motion (SPEEDAM 2006), 1413-1418, 2006. [10] G. Haung and S. Lee, “PC based PID speed control in DC motor,” IEEE Conf. SALIP-2008, pp. 400- 408, 2008. [11] Petr Kejík, Stanislav Hanus “Comparison of Fuzzy Logic and Genetic Algorithm Based Admission Control Strategies for UMTS System” Dept. of Radio Electronics, Brno University of Technology, Purkyňova 118, 612 00 Brno, Czech Republic,pp.6-10, VOL. 19, NO. 1, APRIL 2010. GA based controller meets to the conclusion that fuzzy based controller (FPD) has the optimized performance compared to the genetic based controller (GA PID). 7. Acknowledgment Here we would like to acknowledge all the people associated with this project that has helped in one or the other manner towards the completion of the project. I also like to thank to my guide who has helped me in this project. I also acknowledge my friends and family members. References [1] J. Jantzen, "Tutorial on Fuzzy Logic", Technical University of Denmark: Department of Automation, Technical report number 98-E 868, 19 Aug 1998. [2] J. Jantzen, "Design of Fuzzy Controllers", Technical University of Denmark: Department of Automation, Technical report number 98-E 864, 19 Aug 1998. [3] C. C. Lee, "Fuzzy Logic in Control Systems: Fuzzy Logic Controller-Part I", IEEE Transactions on Systems, Man, and Cybernetics, Vol. 20, No. 2, pp. 404-418, 1990. [4] C. C. Lee, "Fuzzy Logic in Control Systems: Fuzzy Logic Controller-Part II", IEEE Transactions on Systems, Man, and Cybernetics, Vol. 20, No. 2, pp. 419-435, 1990. [5] R. Isermann, "On Fuzzy Logic Applications for Automatic Control, Supervision, and Fault Diagnosis", IEEE Transactions on Systems, Man, and Cybernetics Part A: Systems and Humans, Vol. SMC-28, No. 2, pp. 221-235, 1998. [6] R. R. Yager and D. P. Filev, "Essentials of Fuzzy Modeling and Control", John Wiley & Sons, 1994. [7] O. Montiel, R. Sepúlveda, P. Melin and O. Castillo, “Performance of a simple tuned Fuzzy controller and a Paper ID: 020131408 Volume 3 Issue 4, April 2014 www.ijsr.net 168