Enhancement of the Dynamic Performance of a DC Motor using Fuzzy Logic Algorithm

— Among the most effective controllers that are world wide spread are the Proportional integral and derivative PID Controllers. It is well known that tuning the parameters of the conventional PID changes the plant response such that plant could be faster and more robust. In conventional PID controllers the parameters K p , K i , K d are kept constant during the plant operation and they are adjusted only once at the beginning of the plant operation, This paper presents online tuning technique using Fuzzy logic algorithm for continuous updating of the parameters of the PID for achieving effective speed control of the DC motor. This technique proved to be enhancing the overall performance of the plant by decreasing the overshoot, reducing settling time and rise time. Additionally this Fuzzy logic PID algorithm is found to be very effective in bringing the DC motor system to more stable operation. The MATLAB/SIMULINK is used for modeling of the DC motor system along with the Fuzzy logic PID controller and conventional PID controller. The speed responses of the DC motor for both controllers are presented and compared.


I. INTRODUCTION
Seeking of robust , effective and stable drive system is the most critical issue that faces control engineers nowadays in the field of automation technology [1]. DC Motors are used extensively in the automation technology and industrial application due to their outstanding performance and simplicity of their control commands, they are the first choice in applications that require accurate speed regulation as well as precise positioning [2].
PID controllers are widely used due to their simple implementation, easy to tune in addition to reasonable stable output response. About 85% of dynamic control systems are PID based systems [3]. However PID controllers are reliable and stable, in some applications they can't satisfy the system needs when maximum accuracy and effectiveness are needed, this may be due to aggressive changes in the load profile that the PID controller should track and noises that the system would face. This is obvious when undesirable overshoot, time lag and oscillations appear clearly in the output responses of a PID controlled system [4]. In DC motor control, tuning parameters of the PID controllers became more challenging task for control engineers, this is due to the nonlinearity relationship between the motor speed and the input voltage along with the damping coefficient that is dependent on the motor parameters [5].Therefore it is important to correctly tune the parameters of the PID controllers to get an optimal output response for effective DC motor control. In conventional PID controllers the three parameters Kp, Kd and Ki are constant during the plant operation and tuned only once at the beginning of operation using several methods like Ziegler-Nichols method sometimes using trial and error but as mentioned optimal response was difficult to be achieved [6]. Therefore with the aid of the evolution in the field of artificial intelligence , computer programming and microprocessors ,new tuning algorithms are proposed using neural networks , fuzzy logic ,genetic algorithms ,….etc., the idea is to optimize these three parameters as possible to get better performance than these conventional controller methods [4,7]. In this paper, Fuzzy logic algorithm for continuous tuning of the PID controllers parameters for DC motor speed control is presented. Fuzzy logic concept was firstly introduced by Dr. Lotfi Zadeh in 1965 [8]. Fuzzy models or sets are mathematical means of representing input/output information, they may have crossed ranges and the final output is based on the fuzzy rules. Fuzzy rules are decisions like what people take based on imprecise and non-numerical information hence the term fuzzy [9]. In the Fuzzy logic based PID controller for DC motor speed control, two closed control loops are used, one is for conventional PID to control the output speed by controlling the input voltage and the other is for the Fuzzy logic controller to continuously update the parameters of PID controller aiming to reach the desired performance, hence these PID controller parameters are continuously changing based on the outputs of the Fuzzy logic controller [10]. DC motor mathematical model is required for judging whether the output response of Fuzzy logic PID is superior to the conventional PID controller or not by comparing rise time , settling time , overshoot and stability margin of both controllers responses.

II. OPEN LOOP DC MOTOR MODEL
In armature voltage controlled DC motor, the field current if is held constant, and the armature current is controlled through  (1) ,Where Kf is the motor constant.
DC motor system consists mainly of two systems one is the electrical system and the other is the mechanical system , both are coupled by the back emf constant and the torque constant , they are assumed to be the same (Kf) , Fig. (1) shows this clearly.
Where is the back e.m.f , = Kf . ΩM (3) Substituting and using Laplace transformation : System Mechanical equations : Similarly ; Hence the full block diagram of the DC motor can be developed as follows in Fig. (2). Hence the transfer function relating the angular speed and the input voltage is as follows The data of the DC motor studied is shown in Appendix I.

III. PID CONTROLLER STRUCTURE A. Conventional PID Controller
PID controller structure is shown in Fig.(4) in the time domain , it's transfer function is as per equation (8) in the (S) domain.

B. Fuzzy logic PID Controller
The parameters of the conventional PID controller could greatly improve the output response of the plant if correctly tuned . Nevertheless the desired dynamic response can't be fully reached, this is because the PID parameters are kept constant during the whole plant operation [7]. Ziegler and Nichols method is a popular method that mainly focuses on tuning the PID controller and improve the dynamic performance of the system response, but sometimes using this method the plant will still suffer from large overshoot and large settling time for the step response. This might not be acceptable for some processes [11].
The idea here in the Fuzzy logic controller is to constantly update the preset parameter values of the PID controller depending on the inputs, Then the fuzzy algorithm will develop a relationship between the input and output linguistically using Fuzzy sets and the final values of the outputs will be determined using fuzzy rules Hence online tuning could be achieved [10,11]. The architecture of the fuzzy PID is shown in Fig.(5) ,it consists of two parts. The first is the control loop of normal PID, the second part is the fuzzy controller loop that constantly inject the rehabilitation factors to the PID controller.   B. Establishment of Fuzzy rules: Fuzzy rules are established to link the three output parameters to the variation of the inputs , in other words to select the appropriate values for the three gains (Kp, Ki and Kd) from their fuzzy set depending on particular set of inputs in order to reach the optimum response required. Five membership functions are built for inputs and seven for the outputs thus they will give total of 35 rules, but for simplicity we consider only five membership functions for both thus producing only 25 rules. Appendix II Shows the fuzzy rules developed in the fuzzy-tool box of MATLAB.
A. Matlab Tuning method for the conventional PID In order to start the simulation the preset/initial three parameters Kp.o ,Ki.o and Kd.o are needed to be determined in order to be inserted in both conventional and fuzzy PID controllers ,MATLAB/SIMULINK includes a PID block that could tune the PID parameters based on reference speed tracking and disturbance rejection. Fig.(9) shows the tuned response by MATLAB for the presented DC motor system along with the tuned values that will be considered as the preset values.  Fig.(10). The required speed is assumed to be the rated value of the Dc motor 125.7 rad/sec ,The motor is assumed to start and run at half its rated load that is 4.18 N-m then it will be subjected to a load disturbance at t = 0.6 sec at which the load changed to be 35 N-M. Simulation starts by inserting the initial/preset values acquired from MATLAB tuning method in both conventional and fuzzy PID controllers then let the system shown in Fig.(10) to run with the conventional PID Dc motor system simultaneously. The simulation times are 1.5 seconds for the load disturbance and 3 seconds for speed tracking. It can be seen in Fig. (10)  V. SIMULATION RESULTS In Fig. (11) , Fig. (12) and Fig. (13), the speed responses of both controllers are shown . They are a clear prove that the speed response of the fuzzy logic PID controller is much better in performance than the conventional PID controller in terms of settling time ,rise time and over shoot. VI. STABILITY ENHANCEMENT In order to compare between the two controllers in terms of stability , First the parameters of the fuzzy logic PID controller are assumed to be any value that produced from the fuzzy logic tool box output (Kp.u, Ki.u, Kd.u)Fuzzy because as per Fig.(14) they are continuously changing specially at starting of the DC motor and at any load disturbance [12]. Second MATLAB will be used to draw the Bode plot & Nyquiest for the open loop transfer functions [C(S)*P(S)] for DC motor system with both controllers added [13]. Fig.(16) shows the closed loop system diagram with a controller added. Where (C) will be the PID transfer function for both controllers that is equal to equation (8) after adding their parameters that are (Kp.u, Ki.u, Kd.u)fuzzy that were acquired from the workspace of the Fuzzy logic PID controller and (Kp.o, Ki.o, Kd.o) that were acquired from the MATLAB tuning method for the conventional PID controller as mentioned earlier in section III. (P) will be the DC motor transfer function that is equal to Equation (7)   It is well known that by increasing the phase margin the system becomes more stable and impregnable to noises and disturbances therefore the Fuzzy logic PID controller enhances the stability of the DC motor system better than conventional PID controller. This is clear from the location of the (zeros) of [1+C(s) P(S)] which is the denominator of the below closed loop transfer function.
If there is a zero in right hand side of the (S) plane for [1+C(s)P(S)] then the closed loop system is unstable in other words Nyquist plot could be drawn for [1+C(s)P(S)] for both controllers and then check the phase margin or distance between their plots and the (-1) unstable point , higher distance means the system is better in terms of stability. Fig (18) shows this Nyquist plot and proved that the closed loop system is asymptotically more stable in case of fuzzy logic PID controller at steady state as the phase margin is higher by using it than by using the conventional PID controller ,also the plot in case of fuzzy logic PID controller is far away from the (-1) unstable point than the plot in case of using the conventional PID.  In this Paper, the fuzzy logic algorithm is used to perform online tuning for the parameters of a PID controller for a closed loop speed control of a DC motor, the new controller called the Fuzzy logic PID controller (FLCP) , it continuously update the parameters of the PID during the starting of the DC motor and any load disturbance in order maintain the desired operation based on the fuzzy rules and according to the inputs that are the error and it's rate of change. MATLAB/SIMULINK is used to simulate the whole system then a comparison in speed response between the new controller and the conventional PID controller is done in terms of overshoot, rise time, settling time and stability margin, the comparison showed that the fuzzy logic PID controller is faster and more robust because it's speed response has lower settling time, rise time and much lower overshoot compared to conventional PID. The speed response obtained by using the new controller is tested for reference speed that showed the robustness of the system. Finally by testing the stability of the system using both controllers, the fuzzy logic PID controller led the system to more stable operating point better than using the conventional PID because it increased the phase margin at steady state, in other words the system became more impregnable to small noises and disturbances. The Fuzzy logic PID controller could replace the conventional ones in applications that require much more accuracy in speed tracking as well as precise positioning.
IX. APPENDIXES A. Appendix