I J C I R A 6(1) 2012, pp. 47-52 Serials Publications ISSN: 0973-6794 Position Control of Servo Motor Using Fuzzy Logic Controller Pradnya Pathade 1 and S. D. Lokhande 2 1 Department of Electronics Engineering, Sinhgad Institute of Technology, Lonavala Dist: Pune, Maharashtra, India 2 Department of Electronics Engineering, Sinhgad College of Engineering, Pune, Maharashtra, India ABSTRACT Most of the industrial processes uses the conventional PID controllers due to their simple and robust design, affordable price, and effectiveness for linear systems, but conventional PID controllers are usually not effective if the processes involved are higher order and time delay systems. For this, fuzzy Logic controllers were appeared. If we combine the two intelligent control systems, the problem will be resolved. The application of FLC s to servo systems produces results superior to classical controllers. It is seen that, if there is a change in system parameters or load disturbances, the response of system due to proportional integral derivative (PID) controller is considerably affected and PID controller needs retuning. However, FLCs preserve the desired response over wide range of system parameters and load disturbances. A FLC usually gives better results than those of conventional controllers, in terms of the response time, settling time and particularly in robustness. The objective of this paper is to compare the time specification performance between conven-tional controller and fuzzy logic controller in position control system of a DC servomotor. This will include design and development of a controller for position control using Matlab / Simulink. The scope of this work is to apply two types of controller namely PID and fuzzy logic controller. The software part includes programming real-time software using Matlab/Simulink. Finally, the software will be integrating with hardware for position control of servo system. Keywords: PID, fuzzy logic, position control system, servomotor. 1. INTRODUCTION Servomotors are widely used in many automatic systems, including drive for printers, tape recorders, robotic manipulators, machine tools, rolling machines etc. Proportional integral derivative (PID) controllers usually control these motors. Such controllers will be effective enough if the speed and accuracy requirements of control systems are not critical under varying environments of the systems. Also, the usual way to optimize the control action is to tune the PID coefficients, but this can t cope with varying control environments resulting from load disturbances, system non-linearties and change of plant parameters. The experience shows that FLC yields superior results to those obtained by conventional control algorithms [3], [4]. Also, FLC have, common feature of not requiring a detailed mathematical model and lead to much faster and accurate controllers for servo systems [5]. Fuzzy Logic Controllers are based on the fuzzy set and fuzzy logic theory originally advocated by Lotfi A. Zadeh. Due to its heuristic nature, fuzzy logic control is much closer in spirit to human thinking and natural language than traditional logic systems. The FLC provides an algorithm, which can convert the linguistic * E-mail: pihu_pradnya@rediffmail.com control strategy, based on expert knowledge into an automatic control strategy. In particular, the methodology of FLC appears very useful when the plants are too complex for analysis by conventional quantitative techniques or when the available sources of information are interpreted qualitatively, inexactly or with uncertainty. The use of FLC significantly changes the approach to control of drives. A conventional controller adjusts the system control parameters on the basis of a set of the differential equations, which describes the model of drive system. In a fuzzy controller, the adjustments are made by a fuzzy rule based expert system, which is a logical model of human behavior of the plant operator [7], [8]. An FLC usually gives better results than those of conventional controllers, in terms of the response time, settling time and particularly in robustness. The robustness of FLC is commendable feature in motor drive applications, where, the system parameters are widely varying during plant operation. Due to non-linear structure of the FLC, the main design problem lies in the determination of the consistent & complete rule set and the shape of membership functions. However, FLC s design is made easier by friendly and meaning tools of the fuzzy logic. In this paper, the concept of fuzzy logic has been used for position control, employing dc
48 IJCIRA Pradnya Pathade and S. D. Lokhande servomotor. Since the introduction of fuzzy set theory by Zadeh and the first invention of a fuzzy controller by Mamadani, fuzzy control has gained a wide acceptance, due to the closeness of inference logic to human thinking and has found applications in many power plants and power systems. It provides an effective means of converting the expert type control knowledge into an automatic control strategy. Two reasons most often signed for pursuing fuzzy control are the desire to incorporate linguistic control rules and the need to design a controller without developing a precise system model. The main advantages of the fuzzy control systems are as follows. (i) It is not necessary to built a detailed mathematical model (ii) Fuzzy controllers have a high strength and a high adjustment. (iii) They can operate with a high input numbers. (iv) They can be adapted easily into nonlinear systems (v) The human knowledge can be easily applied (vi) The process development time is relatively lower 2. NONLINEARITIES INVOLVED IN PLANT The performances of the servo system directly affect the stability, response speed and tracking accuracy of the machine tool. In a servo system of CNC machine tool, it faces an important problem that it should still keep good dynamic characteristics ands steady-state tracking accuracy with the effects of time variation, nonlinearity and load disturbance. Traditional PID controller is widely applied in the servo system, but it can not meet the needs of parameters adjusting ability and disturbance rejection capability. Fuzzy control is an intelligent control method which imitates logical thinking of human and is independent on an accurate mathematical model of the controlled object. What is more, it is insensitive to parameters Variation, and has strong robustness. It is perfectly applied to overcome the effects of nonlinearity, time variation and coupling of servo system. To the problem that the steady-state error is hard to be eliminated with a fuzzy controller, a fuzzy-pid controller is proposed in this paper. The suggested controller incorporates in virtues of both control strategies, which are flexibility, perfect disturbance rejection capability of the fuzzy control, and the high steady-state precision of PID control. 3. DESIGN OF CONTROLLER In process control today, more than 95% of the control loops are of PID type, most loops are actually PI control. PID controllers are today found in all areas where control is used. The controllers come in many different forms. There are standalone Systems in boxes for one or a few loops, which are manufactured by the hundred thousands yearly. Fig. 1 shows the block diagram of PID controller. Figure 1: Block Diagram of PID Controller PID controller is a linear controller. The most conventional PID controller (also called the linear PID controller) is described as follows: u()()() t = K e t + K e t dt + K t p I D 0 de() t dt Where, K P, K I are the proportional, integral, and derivative gains respectively. The signal e(t) defined as e (t) = r(t) - c(t), is the error signal between the reference and the process output c(t). 3.1. Ziegler-Nichols Method Ziegler and Nichols had proposed a famous tuning parameter of PID controller in 1942. Steps involved in this method are as follows: 1. First, note whether the required proportional control gain is positive or negative. To do so increase the step the input under manual control and see that the resulting steady state value of the process output has also increased. If so, then the steady-state process gain is positive and the required Proportional control gain, K P, has to be positive as well. 2. Turn the controller to P-only mode, i.e. turn both the Integral and Derivative modes off. 3. Turn the controller gain, K P, up slowly (more positive if K P was decided to be so in step 1, otherwise more negative if K P was found to be negative in step (1) and observe the output response. When a value of K P results in a sustained periodic oscillation in the output, mark this critical value of K P as Ku, the ultimate gain. Also, measure the period of oscillation, Pu referred to as the ultimate period. Using the
Position Control of Servo Motor using Fuzzy Logic Controller 49 values of the ultimate gain Ku, and the ultimate period Pu, Ziegler and Nichols prescribes the following values for K P, K I, depending on which type of controller is desired. Figure 5: Block Diagram of Fuzzy Logic Controller Figure 3: Response of Ultimate Gain With some real processes the response to a step change or set point disturbance differs depending on the direction or size of the change. In this case it is irrelevant to look at the open-loop response to tune the controller. Instead the closed-loop response i.e. the behavior of the system with control has to be studied. The values of K P, K I are calculated from table 1 and Fig.4 shows the SIMULINK diagram of PID Controller. Table 1 Value of K P, K I Controller Type K P K I K D P ku/2 PI ku/1.2 Pu/1.2 PID ku/1.7 Pu/2 Pu/8 Figure 4: Simulink Diagram of PID Controller 4. DESIGN OF FUZZY LOGIC CONTROLLER The Fuzzy Logic Controller is designed to have two fuzzy state Variables and one control variable for achieving position control of the DC Servo Motor. These two input variable are the error and change in error. Figure 5 shows the basic block diagram of fuzzy logic controller with input and output variables. In fuzzy logic controller (FLC), the dynamic behavior of a controlled system is described by a set of fuzzy associative memory (FAM) rules that correlate a fuzzy input set to a fuzzy output set of the FLC. These rules are given by Mamdani hence it is called as Mamdani s FIS. Based on expert knowledge, these rules establish linguistically how the control output should vary with the control input. The expert knowledge is usually of the form IF (a set of conditions, antecedent components are satisfied) THEN (a set of consequences, can be inferred) practically given a set of control inputs the controller applies appropriate rules to generate a set of control outputs. A fuzzy logic system has 3 blocks as shown in fig. 6. Figure 6: Block Diagram of Fuzzy Inference System Crisp input information from the sensor is converted into fuzzy values for each input fuzzy set with the fuzzification block. The decision making logic determines how the fuzzy logic operations are performed and together with the knowledge base determines the outputs of each fuzzy IF-THEN rules. These two components are combined into the inference block. All the outputs are combined and converted to crispy values within the defuzzification block. Fuzzy rules can be described as a relational matrix R, R=E x EC KP x Ki x Kd Firstly, min implication method is used to calculate the matrix R. Then the fuzzy reasoning results of outputs are gained by aggregation operation of fuzzy sets of inputs and matrix R, where max-min aggregation method is used. Because definite values of outputs are needed for application, the fuzzy results should be defuzzified. In this paper, the centroid method is used for defuzzification to gain the accurate values kp, ki and kd
50 IJCIRA Pradnya Pathade and S. D. Lokhande which are then sent to PID controller to control the system. The error signal is the difference between the set point and output position of the motor. Following seven linguistic terms are used for the fuzzy sets i.e. negative big, negative medium, negative small, zero, positive small, positive medium, positive big which are denoted NB, NM, NS, ZE, PS, PM, PB respectively. The fuzzy sets are then defined by the triangular membership functions. The same membership functions are also used for change in error which is shown in fig. 7. Table 2 Rule Base for FIS e NB NM NS ZE PS PM PB NB NB NM NS NS PS PM PB NM NM NS NS PS PM NS NS NS PS ZE NB NM NS ZE PS PM PB PS NS PS PS PM NM NS PS PS Figure 8: Membership Functions for Output of FIS PB NB NM NS PS PS PM 5. MOTOR PARAMETERS In order to verify the effectiveness of the used controller, the following numerical simulations are performed with Matlab Simulink. θ () S 31.0688 = E S S S S m 3 2 a () + 29.5009 + 61.57014 + 31.0688 (1) The Transfer function of the servo system is defined in equation 1 and the system parameters are listed in Table 3. Figure 7: Membership Functions for Error and Change in Error 4.1. Output of FIS For membership functions of output signal following seven linguistic terms are used for the fuzzy sets i.e. negative big, negative medium, negative small, zero, positive small, positive medium, positive big which are denoted NB, NM, NS, ZE, PS, PM, PB respectively. The fuzzy sets are then defined by the triangular membership functions as shown in Fig. 8 6. OVERVIEW OF SERVO SYSTEM Fig. 9 shows the review of servo system where set point is given through personal computer. The computer program (FIS) output is given to DAC which converts digital to analog signal. This analog signal is given to driver circuit of servo amplifier. From driver circuit output is given to servo amplifier which amplifies current to the motor. A potentiometer is connected to the shaft of the motor and a voltage of 5V is given to it, which is distributed over 360. Thus the motor shaft position is converted in voltage signal and given back to PC through ADC as feedback signal. From set point and feedback signal error is calculated the difference between the errors of two conjugative iterations gives change in error and this error and change in error is given as input to FIS which gives the output signal to achieve desired position.
Position Control of Servo Motor using Fuzzy Logic Controller 51 Potentiometer sensitivity (Kp) Table 3 System Parameters Signal amplifier gain (Ka) 1 Back emf constant (K) Armature Resistance (R) Armature Inductance (L r ) Motor Torque Constant (K r ) 5.093 V/rad 15x10-3 V/rad/s 2Ω 1mH 15x10-3 N-m/A Combined moment of inertia motor 42.6x10-6 Kg-m 2 shaft & load referred to the motor shaft side (Jm) Viscous damping coefficient of the 47.3x10-6 motor referred to the motor Nm/rad/s shaft side (Dm) Fig. 11 shows the output response of conventional PID controller, Fuzzy PI controller and Fuzzy PID controller. 8. CONCLUSIONS It is seen that the fuzzy controller preserves the desired response, even in the presence of load disturbance and varying contra1 environments. This ensures the controller s robustness. The choice of rules and membership functions has considerable effect on fuzzy controller performance, e.g., rise time, settling time, overshoot etc. It is observed that using the superposition of different consequent active at particular region of domain, for the same combinations of antecedents, performance of FLC is improved considerably in terms of settling time and overshoot. The combination of two sets of rules with same antecedents but different consequent reduces the settling time and overshoot. Figure 9: Block Diagram of Servo System Figure 10: Simulink Diagram of Servo System using PID, Fuzzy PI and Fuzzy PID Controller 7. SIMULATION RESULTS With a traditional PID controller, it will cause large overshoot or poor stability. In this paper, a fuzzy-pid controller is proposed in order to improve the performance of the servo system. The proposed controller incorporates the advantages of PID control which can eliminate the steady-state error, and the advantages of fuzzy logic such as simple design, no need of an accurate mathematical model and some adaptability to nonlinearity and time-variation. The Fuzzy-PID controller accepts the error (e) and error change (ec) as inputs, while the parameters kp, ki, kd as outputs. Control rules of the controller are established based on experience so that selfregulation of the values of PID parameters is achieved. Figure 11: Output Response with Fuzzy, Fuzzy PI and Fuzzy PID Controller References [1] I. J. Nagrath and M.Gopal, Control System Engineering. Fifth Edition. [2] Xiaodiao Huang and Liting Shi, Simulation on a Fuzzy-PID Position Controller of the CNC Servo System, Sixth IEEE International Conference on Intelligent Systems Design and Applications (ISDA 06), 2006. [3] Dongmei Yu, Qingding Guo and Qing Hu, Position Control of Linear Servo System Using Intelligent Feedback Controller, Sixth IEEE International Conference on Intelligent Systems Design and Applications (ISDA 06), 2006. [4] A. B. Patil, A.V.Salunkhe, Temperature Controller Using Takagi-Sugeno Model Fuzzy Logic Asian Conference on Intelligent Systems and Networks, 2006. [5] Mohd Fua ad Rahamat & Mariam md Ghazaly, Performance Comparison between PID And Fuzzy Logic Controller in
52 IJCIRA Pradnya Pathade and S. D. Lokhande position Control System of DC Servomotor. Journal Teknologi Malayshia, 45(D), 2006. [6] K. S. Tang, Kim Fung Man, Guanrong Chen, and Sam Kwong, An Optimal Fuzzy PID Controller IEEE Transactions on Industrial Electronics, 48(4), 2001. [7] Maki K. Habib, Designing of Fuzzy Logic Controllers for DC Servomotor Supported by Fuzzy Logic Control Development Environment IECON01:The 27 th Annual Conference of the IEEE Industrial Electronics Society. 2001. [8] C. C. Lee, Fuzzy Logic in Control Systems: Fuzzy Logic Controller, Part II IEEE Transactions on Systems, Man. and Cybernetics, 20(2), 2000. [9] George K. I. Mann, Bao-Gang Hu, Raymond G. Analysis of Direct Action Fuzzy PID Controller Structures, IEEE Transactions on Systems, Man, and Cybernetics Part B: Cybernetics, 29(3), 1999. [10] Baogang Hu, George K. I. Mann, and Raymond G. Gosine, New Methodology for Analytical and Optimal Design of Fuzzy PID Controllers IEEE Transactions on Fuzzy System, 7, Oct. BER 1999 521. [11] Zuo Yusheng, Compared with PID, Fuzzy, PID Fuzzy Controller Hohai University, Nanking in Jiangsu Province. [12] M. Maeda and S. Murakami, Fuzzy Gain Scheduling of PID Controllers, Fuzzy Sets Syst., 51, 29 40, 1992.