7th WSEAS Int. Conf. on ARTIFICIAL INTELLIGENCE, KNOWLEDGE ENGINEERING and DATA BASES (AIKED'08), University of Cambridge, UK, Feb 20-22, 2008 COMPARATIVE ANALYSIS OF CLASSICAL AND FUZZY PI ALGORITHMS JENICA ILEANA CORCAU Division Avionics University of Craiova, Faculty of Electrotechnics Blv. Decebal, nr. 107, Craiova, Dolj ROMANIA ELEONOR STOENESCU University of Craiova, Faculty of Electrotechnics Blv. Decebal, nr. 107, Craiova, Dolj ROMANIA MIHAI LUNGU Division Avionics University of Craiova, Faculty of Electrotechnics Blv. Decebal, nr. 107, Craiova, Dolj Abstract: - In this paper is presented a fuzzy PI controller. Fuzzy PI controller and principles their performing is considered in large applications. Some investigations deal with the comparison of PI and Fuzzy PI algorithms for application. The settings of classical controllers are based on deep common physical background. Fuzzy controller can employ better behavior comparing with classical PI controller because of its nonlinear characteristics. Key-Words: - Fuzzy Logic Control, linear control, nonlinear control, discrete, continuous. 1 Introduction Fuzzy Logic Control (FLC) is one of most successful application of fuzzy Set Theory, introduced by Zadeh in 1965. Its major features are the use of linguistic variables rather than numerical variables. Linguistic variables, defined as variable, whose values are sentences in a natural language, may be represented by fuzzy sets. The principles of fuzzy controllers design are investigated in a number of applications [1]. The main aims of fuzzy controller application are: - improving of dynamic behavior of the system (in comparison with classical algorithm); - adaptation to change of a system parameters. Analysis shows a fuzzy PI controller is a fuzzy controller with two crisp input signals, which represent: error e(t ), integral of the error and one analog crisp output signal u (t ). ISSN: 1790-5109 The Fuzzy PI a discrete digital controller: the initial information is represented in digital form by values e[(k − 2)T ] all necessary e[kT ], e[(k − 1)T ] , computations are digital. Obviously, sampling time must be greater than the computation time. The quantization of signal in time reduces the stability margin of the system. The Fuzzy PI controller can differ by: - basis of control rule; - number of terms for each input variable; - shapes by fuzzy sets; - fuzzification methods; - deffuzzification methods; - structure controller. Page 189 ISBN: 978-960-6766-41-1 7th WSEAS Int. Conf. on ARTIFICIAL INTELLIGENCE, KNOWLEDGE ENGINEERING and DATA BASES (AIKED'08), University of Cambridge, UK, Feb 20-22, 2008 2 Fuzzy PI controller design A classical PI controller is described by equation (1) [1], t ⎛ ⎞ 1 u (t ) = K ⎜⎜ e(t ) + ∫ e(τ )dτ ⎟⎟, (1) Ti 0 ⎝ ⎠ Where K is the gain of PI controller, Ti is an integral constant, e(t ) is an error signal, e(t ) = w(t ) − y (t ), y (t ) is the output from process and u (t ) is the output from controller (the action value). Deriving equation (1) we get ⎛ ⎞ 1 u& (t ) = K ⎜⎜ e&(t ) + e(t ) ⎟⎟. (2) Ti ⎝ ⎠ For a local extreme location we put 1 u& (t ) = e&(t ) + e(t ) = 0 (3) Ti The solution of equation (3), is 1 e&(t ) = − e(t ), (4) Ti because the PI controller gain K > 0. The equation (4) depends only on the PI controller integral time constant Ti . By comparison we find out that the deviation of action values depends on the derivation of error magnitude. Fuzzy sets must be defined for each input and output variable. Seven fuzzy subsets PB (Positive Big), PM (Positive Medium), PS (Positive Small), ZO (Zero), NB (Negative Big), NM (Negative Medium), NS (Negative Small) have been chosen for input variables and output variable. In table 1 is presented map the rule base to the discrete state space. We use the zero elements on the diagonal for mapping of equation (4). Table 1. The rule base of fuzzy PI controller mapped to the discrete state space Δe(k ) ZO PS PM PB PB PB PB NS ZO PS PM PB PB PB NM NS ZO PS PM PB PB NB NM NS ZO PS PM PB NB NB NM NS ZO PS PM NB NB NB NM NS ZO PS NB NB NB NB NM NS ZO ⎛ ⎞ 1 Δu ( k ) = K ⎜⎜ Δe(k ) + e(k ) ⎟⎟, (5) Ti ⎝ ⎠ u (k ) − u (k − 1) e(k ) − e(k − 1) , Δe(k ) = , Where Δu ( k ) = T T T is the sampling period, k is the step. The time constant Ti determine relation to the change in error. For a fuzzy PI controller [2] K (Ti Δe(k ) + e(k )). (6) Ti In the next step it is necessary to map the rule base to the discrete state space Δe(k ), e(k ). It is introduced the scaling factor M for the universe range, M > 0. This scale factor sets the universe range for the error and its first difference (see to table 1). We extend the equation (6) obtains KM ⎛ Ti 1 ⎞ Δu ( k ) = e(k ) ⎟. (7) ⎜ Δe ( k ) + Ti ⎝ M M ⎠ Δu ( k ) = We apply fuzzification to input variables and after deffuzzification we get the equation KM ⎧ ⎧ Ti 1 ⎫⎫ D ⎨ F ⎨ Δe(k ) + e(k )⎬⎬. (8) Ti M ⎭⎭ ⎩ ⎩M Where F is an operation for fuzzyfication and D for deffuzzification. Δu (k ) we can written For action value u (k ) − u (k − 1) Δu ( k ) = = T 1 KM ⎧ ⎧ Ti ⎫⎫ (9) = D ⎨ F ⎨ Δe ( k ) + e(k )⎬⎬. Ti M ⎭⎭ ⎩ ⎩M Δu ( k ) = The control signal generated by fuzzy PI controller in step k is ⎧ T ⎫ u (k ) = KM D ⎨ F ⎧⎨ i Δe(k ) + 1 e(k )⎫⎬⎬ + u (k − 1). Ti ⎩ ⎩M M ⎭⎭ (10) In figure 1 is presented the fuzzy PI controller realized using the toolbox of Simulink (anfisedit). As shown in figure 1, triangular and trapezoidal shapes have been adopted for the membership functions; the values of each input and output variable are [-1, 1]. e(k ) If we translate the equation (3) to a discrete form, we get the equation for action value change of the discrete PI controller ISSN: 1790-5109 Page 190 ISBN: 978-960-6766-41-1 7th WSEAS Int. Conf. on ARTIFICIAL INTELLIGENCE, KNOWLEDGE ENGINEERING and DATA BASES (AIKED'08), University of Cambridge, UK, Feb 20-22, 2008 Figure 3. The structure system using Fuzzy PI controller A physical meaning of the parameters for fuzzy PI controller remains the same like for the PI controller (the gain controller K and time integral constant Ti ). For exemplifies let us assume plant described by following transfer function to illustrate and to compare behavior of fuzzy PI controller with classical continuous PI controller 1 H (s) = . (11) (10 s + 1)( s + 1) 2 The parameters Ti = 5,8; M = 10 and sample period was set to T = 0.1 In figure 2 is presented the block scheme realized in Simulink of system using the PI classic, and in figure 3 is presented the structure of system using the fuzzy PI controller. PID Step PID Controller 1 The saturation limits present in figure 3, limits of the action values realizes antiwindup. The inference method min-max and deffuzzification COG method was utilized in simulation. output Figure 1. The fuzzy PI controller Scope Figure 4. The simulation results using classical and fuzzy PI controller den(s) Transfer Fcn yl To Workspace The simulation results obtained using classical PI controller and fuzzy PI is shown in figure 4. Simulation results of controllers confirm the validity of the proposed control technique. Scope1 Scope2 3 Conclusions Figure 2. The structure system using the classical PI ISSN: 1790-5109 In this paper is presented comparative analysis of classical and fuzzy PI algorithms. Is realized a fuzzy PI controller using same like parameters for PI controller. Comparing the results obtained using classical PI and fuzzy PI controllers following discussion can take place. The output of the system has very small overshoot when it is controlled with fuzzy regulator. The disturbance Page 191 ISBN: 978-960-6766-41-1 7th WSEAS Int. Conf. on ARTIFICIAL INTELLIGENCE, KNOWLEDGE ENGINEERING and DATA BASES (AIKED'08), University of Cambridge, UK, Feb 20-22, 2008 rejection using fuzzy controller is comparable with disturbance rejection of classical PI controller. References [1]. Pivonka P. Analysis and design of fuzzy PID controller based on classical PID controllers approach, Physica-Verlag, 2000. [2]. Edik Arakeljan, Mark Panko, Vasili Usenko. Comparative analysis of classical and fuzzy PID algorithms, Physica-Verlag, 2000. [3]. Sofron, E., Bizon, N., Ioniţă, S., Răducu, R. Sisteme de control fuzzy. Modelare şi proiectare asistate de calculator. Editura ALL EDUCAŢIONAL, Bucureşti, 1998. ISSN: 1790-5109 Page 192 ISBN: 978-960-6766-41-1