Tuning Fuzzy PID Controllers

After the development of fuzzy logic, an important application of it was developed in control systems and it is known as fuzzy PID controllers. They represent interest in order to be applied in practical applications instead of the linear PID controllers, in the feedback control of a variety of processes, due to their advantages imposed by the non-linear behavior. The design of fuzzy PID controllers remains a challenging area that requires approaches in solving non-linear tuning problems while capturing the effects of noise and process variations. In the literature there are many papers treating this domain, some of them being presented as references in this chapter. Fuzzy PID controllers may be used as controllers instead of linear PID controller in all classical or modern control system applications. They are converting the error between the measured or controlled variable and the reference variable, into a command, which is applied to the actuator of a process. In practical design it is important to have information about their equivalent input-output transfer characteristics. The main purpose of research is to develop control systems for all kind of processes with a higher efficiency of the energy conversion and better values of the control quality criteria. What has been accomplished by other researchers is reviewed in some of these references, related to the chapter theme, making a short review of the related work form the last years and other papers. The applications suddenly met in practice of fuzzy logic, as PID fuzzy controllers, are resulted after the introduction of a fuzzy block into the structure of a linear PID controller (Buhler, 1994, Jantzen, 2007). A related tuning method is presented in (Buhler, 1994). That method makes the equivalence between the fuzzy PID controller and a linear control structure with state feedback. Relations for equivalence are derived. In the paper (Moon, 1995) the author proves that a fuzzy logic controller may be designed to have an identical output to a given PI controller. Also, the reciprocal case is proven that a PI controller may be obtained with identical output to a given fuzzy logic controller with specified fuzzy logic operations. A methodology for analytical and optimal design of fuzzy PID controllers based on evaluation approach is given in (Bao-Gang et all, 1999, 2001). The book (Jantzen, 2007) and other papers of the same author present a theory of fuzzy control, in which the fuzzy PID controllers are analyzed. Tuning fuzzy PID controller is starting from a tuned linear PID controller, replacing it with a linear fuzzy controller, making the fuzzy controller nonlinear and then, in the end, making a fine tuning. In the papers (Mohan & Sinha, 2006, 2008), there are presented some mathematical models for the simplest fuzzy PID controllers and an approach to design


Introduction
After the development of fuzzy logic, an important application of it was developed in control systems and it is known as fuzzy PID controllers. They represent interest in order to be applied in practical applications instead of the linear PID controllers, in the feedback control of a variety of processes, due to their advantages imposed by the non-linear behavior. The design of fuzzy PID controllers remains a challenging area that requires approaches in solving non-linear tuning problems while capturing the effects of noise and process variations. In the literature there are many papers treating this domain, some of them being presented as references in this chapter. Fuzzy PID controllers may be used as controllers instead of linear PID controller in all classical or modern control system applications. They are converting the error between the measured or controlled variable and the reference variable, into a command, which is applied to the actuator of a process. In practical design it is important to have information about their equivalent input-output transfer characteristics. The main purpose of research is to develop control systems for all kind of processes with a higher efficiency of the energy conversion and better values of the control quality criteria. What has been accomplished by other researchers is reviewed in some of these references, related to the chapter theme, making a short review of the related work form the last years and other papers. The applications suddenly met in practice of fuzzy logic, as PID fuzzy controllers, are resulted after the introduction of a fuzzy block into the structure of a linear PID controller (Buhler, 1994, Jantzen, 2007. A related tuning method is presented in (Buhler, 1994). That method makes the equivalence between the fuzzy PID controller and a linear control structure with state feedback. Relations for equivalence are derived. In the paper (Moon, 1995) the author proves that a fuzzy logic controller may be designed to have an identical output to a given PI controller. Also, the reciprocal case is proven that a PI controller may be obtained with identical output to a given fuzzy logic controller with specified fuzzy logic operations. A methodology for analytical and optimal design of fuzzy PID controllers based on evaluation approach is given in (Bao-Gang et all, 1999. The book (Jantzen, 2007) and other papers of the same author present a theory of fuzzy control, in which the fuzzy PID controllers are analyzed. Tuning fuzzy PID controller is starting from a tuned linear PID controller, replacing it with a linear fuzzy controller, making the fuzzy controller nonlinear and then, in the end, making a fine tuning. In the papers (Mohan & Sinha, 2006, 2008, there are presented some mathematical models for the simplest fuzzy PID controllers and an approach to design www.intechopen.com Introduction to PID Controllers -Theory, Tuning and Application to Frontier Areas 172 fuzzy PID controllers. The paper (Santos & all, 1096) shows that it is possible to apply the empirical tools to predict the achievable performance of the conventional PID controllers to evaluate the performance of a fuzzy logic controller based on the equivalence between a fuzzy controller and a PI controller. The paper (Yame, 2006) analyses the analytical structure of a simple class of Takagi-Sugeno PI controller with respect to conventional control theory. An example shows an approach to Takagi-Sugeno fuzzy PI controllers tuning. In the paper (Xu & all, 1998) a tuning method based on gain and phase margins has been proposed to determine the weighting coefficients of the fuzzy PI controllers in the frame of a linear plant control. There are presented numerical simulations. Mamdani fuzzy PID controllers are studied in (Ying, 2000). The author has published his theory on tuning fuzzy PID controllers at international conferences and on journals ). This chapter presents some techniques, under unitary vision, to solve the problem of tuning fuzzy PID controllers, developed based on the most general structure of Mamdani type of fuzzy systems, giving some tuning guidelines and recommendations for increasing the quality of the control systems, based on the practical experience of the author. There is given a method in order to make a pseudo-equivalence between the linear PID controllers and the fuzzy PID controllers. Some considerations related to the stability analysis of the control systems based on fuzzy controllers are made. Some methods to design fuzzy PID controllers are there presented. The tuning is made using a graphical-analytical analysis based on the input-output transfer characteristics of the fuzzy block, the linear characteristic of the fuzzy block around the origin and the usage of the gain in origin obtained as an origin limit of the variable gain of the fuzzy block. Transfer functions and equivalence relations between controller's parameters are obtained for the common structures of the PID fuzzy controllers. Some algorithms of equivalence are there presented. The linear PID controllers may be designed based on different methods, for example the modulus or symmetrical criterion, in Kessler's variant. The linear controller may be used for an initial design. Refining calculus and simulations must follow the equivalence algorithm. The author used this equivalence theory in fuzzy control applications as the speed control of electrical drives, with good results. The unitary theory presented in this chapter may be applied to the most general fuzzy PID controllers, based on the general Mamdani structure, which may be developed using all kind of membership functions, rule bases, inference methods and defuzzification methods. A case study of a control system using linear and fuzzy controllers is there also presented. Some advantages of this method are emphasized. Better control quality criteria are demonstrated for control systems using fuzzy controllers tuned, by using the presented approach. In the second paragraph there are presented some considerations related to the fuzzy controllers with dynamics, the structures of the fuzzy PI, PD and PID controllers. In the third paragraph there are presented: the transfer characteristics of the fuzzy blocks, the principle of linearization, with the main relations for pseudo-equivalence of the PI, PD and PID controllers. A circuit of correction for the fuzzy PI controller, to assure stability, is also presented. In the fourth paragraph there are presented some considerations for internal and external stability assurance. There is also presented a speed fuzzy control system for electrical drives based on a fuzzy PI controller, emphasizing the better control quality criteria obtained using the fuzzy PI controller.

Fuzzy controllers with dynamics
The basic structure of the fuzzy controllers with dynamics is presented in Fig. 1.  The fuzzy block does not treat a well-defined mathematical relation (a control algorithm), as a linear controller does, but it is using the inference with many rules, based on linguistic variables. The inference is treated with the operators of the fuzzy logic. The fuzzy block from Fig. 2 has three distinctive parts, in Mamdani type: fuzzyfication, inference and defuzzification. The fuzzy controller is an inertial system, but the fuzzy block is a noninertial system. The fuzzy controller has in the most common case two input variables x 1 and x 2 and one output variable u. The input variables are taken from the control system. The inference interface of the fuzzy block releases a treatment by linguistic variables of the input variables, obtained by the filtration of the controller input variables. For the linguistic treatment, a definition with membership functions of the input variable is needed. In the interior of the fuzzy block the linguistic variables are linked by rules that are taking account of the static and dynamic behavior of the control system and also they are taking account of the limitations imposed to the controlled process. In particular, the control system must be stable and it must assure a good amortization. After the inference we obtain fuzzy information for the output variable. The defuzzification is used because, generally, the actuator that follows the controller must be commanded with a crisp value u d ,. The command variable u, furnished by the fuzzy controller, from Fig. 1, is obtained by filtering the defuzzified variable u d . The output variable of the controller is the command input for the process. The fuzzification, the inference and the defuzzification bring a nonlinear behavior of the fuzzy block. The nonlinear behavior of the fuzzy block is transmitted also to the fuzzy PID controllers. By an adequate choosing of the input and output filters we may realize different structures of the fuzzy controllers with imposed dynamics, as are the general PI, PD and PID dynamics.

Fuzzy PI controller
The structure of a PI fuzzy controller with integration at its output (FC-PI-OI) is presented in Fig. 3. The controller is working after the error e between the input variable reference and the feedback variable r. In this structure we may notice that two filter were used. One of them is placed at the input of the fuzzy block FB and the other at the output of the fuzzy block. In the approach of the PID fuzzy controllers the concepts of integration and derivation are used for describing that these filters have mathematical models obtained by discretization of a continuous time mathematical models for integrator and derivative filters. The structure of the linear PI controller may be presented in a modified block diagram from Fig. 4. For this structure the following modified form of the transfer function may be written: In the next paragraph we shall show that the fuzzy block BF may be described using its input-output transfer characteristics, its variable gain and its gain in origin, as a linear function around the origin (~0, 0, 0 The block diagram of the linear PI controller may be put similar as the block diagram of the fuzzy PI controller as in Fig For the transfer function of the linear PI controller with scaling coefficients the following relation may be written: In the place of the summation block from Fig The filter from the controller input, placed on the low channel, takes the operation of digital derivation; at its output we obtain the derivative de of the error e: where h is the sampling period. In the domain of discrete time the derivative block has the input-output model: That shows us that the digital derivation is there accomplished based on the information of error at the time moments t=t k =k.h and t k+1 =t k +h: So, the digital equipment is making in fact the substraction of the two values.
The error e and its derivative de are scaled with two scaling coefficients c e and c de , as it follows: The variables x e and x de from the inputs of the fuzzy block FB are obtained by a superior limitation to 1 and an inferior limitation to -1, of the scaled variables e and de. This limitation is introduced because in general case the numerical calculus of the inference is made only on the scaled universe of discourse [-1, 1].
The fuzzy block offers the defuzzified value of the output variable u d . This value is scaled with an output scaling coefficient c du : In the case of the PI fuzzy controller with integration at the output the scaled variable ~d u is the derivative of the output variable u of the controller. The output variable is obtained at the output of the second filter, which has an integrator character and it is placed at the output of the controller: The input-output model in the discrete time of the output filter is: The above relation shows that the output variable is computed based on the information from the time moments t and t+h: From the above relations we may notice that the "integration" is reduced in fact at a summation: This equation could be easily implemented in digital equipments. Due to this operation of summation, the output scaling coefficient c du is called also the increment coefficient. Observation: The controller presented above could be called "fuzzy controller with summation at the output" and not with "integration at the output".

Fuzzy PD controller
The structure of the fuzzy PD controller (RF-PD) is presented in Fig. 6. In this case the derivation is made at the input of the fuzzy bock, on the error e.
For the fuzzy controller FC-PD there is obtained the following relation in the z-domain: With this relation the transfer function results: For the PD linear controller we take the transfer function:

Fuzzy PID controller
The structure of the fuzzy PID controller is presented in Fig. 7.
In this case the derivation and integration is made at the input of the fuzzy bock, on the error e. The fuzzy block has three input variables x e , x ie and x de . The transfer function of the PID controller is obtained considering a linearization of the fuzzy block BF around the origin, for x e =0, x ie =0, x de =0 şi u d =0 with a relation of the following form: A relation, as the fuzzy block from the PID controller -which has 3 input variables -may describe, is: where: The value K 0 is the limit value in origin of the characteristics of the function: www.intechopen.com Introduction to PID Controllers -Theory, Tuning and Application to Frontier Areas Taking account of the correction made on the fuzzy block with the incremental coefficient c u , the characteristic of the fuzzy block corrected and linearized around the origin is given by the relation: We are denoting: For the fuzzy controller RF-PID, with the fuzzy block BF linearized, the following inputoutput relation in the z domain may be written: With these observations the transfer function of the fuzzy ID controller becomes: For the linear PID controller, the following relation for the transfer function is considered: with x de as a parameter. The passing from a frequency model to the parameter model is reduced to the determination of the parameters of the transfer impedance. The steps in such identification procedure are: organization and obtaining of experimental data on the transducer, interpretation of measured data, model deduction with its structure definition and model validation. Using the above translated characteristics we may obtain the characteristic of the variable gain of the fuzzy block: The MISO transfer characteristic of the fuzzy block may be written as follows: If the fuzzy bloc is linearized around the point of the origin, in the permanent regime: x e =0, x de =0 and u d =0, the following relation will be obtained: The value K 0 is the value at the limit, in origin of the characteristic K BF (x t ; This value may be determined with a good approximation, at the limit, from the gain characteristics. We show here an example of the above characteristics for the fuzzy block with max-min inference, defuzzification with center of gravity, were the variables have the 3x3 primary rule base from Tab. 1 and three membership values from Fig. 8. The MISO characteristic is presented in Fig. 9.a). The SISO characteristics are presented in Fig. 9.b). The translated characteristics are presented in Fig. 9.c). The characteristics of the variable gain are presented in Fig. 9.d).
a) b) c) d)

Fig. 9. Transfer characteristics: a) MISO transfer characteristic b) SISO transfer characteristic c) Translated transfer characteristic d) Gain characteristic
From the Fig. 9.d) we may notice that the value of the gain in origin is K 0  1,2. Taking account of the correction made upon the fuzzy block with the scaling coefficient c du , the characteristic of the fuzzy bloc around the origin is given by the relation: We use:

Pseudo-equivalence of the fuzzy PI controller
For the fuzzy controller with the fuzzy block BF linearized around the origin, we may write the following input-output relation in the z-domain: www.intechopen.com A pseudo-equivalence may be made for the fuzzy controller with a linear PI controller in the continuous time, used in common applications. The equivalence is a false one, because the fuzzy controller is not linear, so we use the word "pseudo". The PI controller has the general transfer function: We use the quasi-continual form of the transfer function, obtained by the conversion from the discrete time in the continuous time with the transformation: where h is the sampling period for the conversion of the transfer function: We may notice the influence of the gain in origin on c e and also c de . The linear PI controller may be designed with different methods taken from the linear control theory. Because the gain in origin is the main issue in this equivalence, we present the algorithm of computation of the gain in origin is: 1. Obtaining the MIMO transfer characteristic of the fuzzy block. 2. Obtaining the family of SISO transfer characteristics from the MIMO characteristic, using one of the input variables as a parameter. 3. Obtaining the family of translated characteristic from the SISO characteristic, using a compound variable as summation of the two input variables. 4. Obtaining the gain characteristic by dividing the translated characteristic to the compound variable. 5. Obtaining the gain in origin by computing the limit in origin of the families of gain characteristics.

Anti-wind-up circuit
As in the case of the analogue linear PI controllers for the digital fuzzy controllers with integration, there is needed an anti-wind-up circuit. For the PI controller with integration at the output, an equivalent anti-wind-up circuit may be implemented as it is shown in Fig. 10.

Tuning Fuzzy PID Controllers
This structure is different from the first structure. Because of the integration block, a feedback is made with the anti-wind-up circuit AW. The circuit is needed because the output of the controller is limited at maximum and minimum values +/-U M . The limitations are imposed by the maximum value of the command u of the process.

Correction of the fuzzy block
To assure stability to control systems using fuzzy PI controllers, we need a correction in order to modify the input-output transfer characteristic and a quasi-fuzzy controller results, with the structure from Fig. 11. Fig. 11. The structure of the fuzzy PI controller (RFC) with an anti-wind-up circuit The characteristic of the nonlinear part of the control system is placed only in the I-st and IIIrd quadrants, like in Fig. 12. With the correction circuit from Fig. 11, the correction command is given by the relation: Even if the quasi-fuzzy structure in parallel with the fuzzy block BF a linear structure is introduced, the correction will be nonlinear.

Pseudo-equivalence of the fuzzy PD controller
As in the case of the fuzzy PI controller, a quasi-continual form is obtained:

Pseudo-equivalence of the fuzzy PID controller
As in the case of the fuzzy PI controller, there is obtained a quasi-continual form:  

Stability assurance 4.1 Internal stability
For stability analysis, we are working with the structure from Fig. 13. Fig. 13. The structure of the control system with the correction of the non-linear part N The linear part L has the input-state-output model (60).
The characteristic of the non-linear part has null intervention, due to the limitations placed at the inputs of the fuzzy block. To the fuzzy blocks we may attach a fuzzy relation of which characteristic is placed only in the quadrants I and III. From the relation (, ) BF e de f xx , which is describing the fuzzy block, a source of nonlinearity is there made by the membership functions. If the block will work on the universe of discourse [-1, 1], its characteristic will only be in the sector [K 1 , K 2 ], 0<K 1 <K 2 . By introducing the saturation elements with a role of limitation at the inputs of the fuzzy block, the non-linear part Ñ is placed in a sector [0, K]. To accomplish the sector condition, necessary for the stability insurance, a correction is used to the non-linear part. It consists in summation at the output du d of the fuzzy block of the quantity  du : The value K c >0 will be chosen in a way that the nonlinearity ~c N characteristic is to be framed in an adequate sector [K min , K max ]. The design method in order to obtain the value for the gain coefficient is presented as it follows: The method recommended for stability insurance is as it follows: 1. For a certain fuzzy block type, the minimum value of K m and the maximum value of K M are chosen from the curve families K Nc =f(x t ), or du dc =f(x t ), with d e as a parameter. 2. The value of incremental coefficient of the command variable is limited by the capacity of control system to furnish the command variable to the process. 3. The incremental coefficient of the command variable may be determined with the relation that is describing the digital integration. 4. The maximum value of the command variable cannot overpass a maximum value. 5. At an incremental step, on a sampling period h, for the incremental of the command variable, a value is not recommended. For this, there may be chosen maximum a value of the incremental coefficient of c duM .K M . 6. The values of coefficients c du and K c may be chosen to insure sector stability. 7. In the choosing of c du we must take account to the maximum values of K M of the superior limit of the nonlinearity of the fuzzy block. 8. The chosen of K c is done by taking account on the rapport r k =K min /K max .

External stability
To assure external BIBO stability (Khalil, 1991) the following relation may be taken in consideration:  Fig. 16. The value of c de was decreased to the final value from the sixth step. Decreasing more this scaling coefficient, the fuzzy control system becomes unstable. Simulations are made for the control system with fuzzy PI controller and also for linear PI controller, for tuned and detuned system parameters. The transient characteristics for the current and speed are to be presented in Fig. 17. With continuous line, there are represented the characteristics for fuzzy control, and with dash-dot line, there are represented the characteristics for conventional control. The regime consists in starting the process unloaded, with a constant speed reference. A constant load torque, in the range of the rated process torque, is also introduced. Then, the motor is reversed, maintaining the constant load torque. The quality criteria of the control system, with linear (l) and fuzzy controller (f), for tuned (a) and detuned (d) parameter are there presented in Tab Based on a comparative analysis of the speed performance criteria, better results were there obtained with the fuzzy PI controller designed, using the above methods as it follows: -better quality criteria: zero overshot and shorter settling time; -better performances for detuned parameters; -the fuzzy control system is more robust at the identification errors and at the disturbance.

Conclusion
In this chapter, there were analyzed some digital controller, based on fuzzy blocks with Mamdani structure and PID dynamics. A pseudo-equivalence of them with linear PID controllers was made, based on the inputoutput transfer characteristics of the fuzzy block, obtained by digital computer calculation. The design of the fuzzy controller is based on the linearization of the fuzzy block around the origin, for the permanent regime. There is used the gain in the origin obtained as a limit in origin of the gain function, obtained from the translated SISO transfer characteristic. For this type of controllers, the design relations were demonstrated. There was made an analysis of these design relations. There were also presented some observations related to the influences of the scaling coefficients. The results presented in this chapter are important in the practice design of the control systems based on PID fuzzy controllers. This method for equivalence is valid for all kind of fuzzyfication and defuzzification methods, all types of membership functions, all inference methods, because it is based on analytic transfer characteristic, which may be obtained using computer calculations.
If there is a designed linear PID controller for a process control, we may use the equivalent fuzzy PID controller in its place in order to control the process with better control quality criteria. Based on the above notice, the method may be used also for tuning the fuzzy PID controller in a control system. The term of "pseudo-equivalence" is used because there is no direct equivalence between the nonlinear digital fuzzy PI controller, with linearization only in the origin, and a linear analogue PI controller. The theory presented in this paper is used and proved by the author in practical control applications, as speed control of electrical drives for dc motors, synchronous and induction motors. This book discusses the theory, application, and practice of PID control technology. It is designed for engineers, researchers, students of process control, and industry professionals. It will also be of interest for those seeking an overview of the subject of green automation who need to procure single loop and multi-loop PID controllers and who aim for an exceptional, stable, and robust closed-loop performance through process automation. Process modeling, controller design, and analyses using conventional and heuristic schemes are explained through different applications here. The readers should have primary knowledge of transfer functions, poles, zeros, regulation concepts, and background. The following sections are covered: The Theory of PID Controllers and their Design Methods, Tuning Criteria, Multivariable Systems: Automatic Tuning and Adaptation, Intelligent PID Control, Discrete, Intelligent PID Controller, Fractional Order PID Controllers, Extended Applications of PID, and Practical Applications. A wide variety of researchers and engineers seeking methods of designing and analyzing controllers will create a heavy demand for this book: interdisciplinary researchers, real time process developers, control engineers, instrument technicians, and many more entities that are recognizing the value of shifting to PID controller procurement.