You are on page 1of 6

Comparative Analysis of Fuzzy PI/PD/PID Controller Based on Classical PID Controller Approach

Petr Pivoka
Brno University of Technology, Faculty of Electrical Engineering and Communication Department of Control, Measurement and Instrumentation, Boetchova 2, 612 66 Brno, Czech Republic E-mail: pivonka@feec.vutbr.cz WWW page: http://www.feec.vutbr.cz/~pivonka/

Abstract: Fuzzy PID controllers are physically related to classical PID controller. The parameters settings of classical and fuzzy controllers are based on deep common physical background. The original newly introduced method considerably simplifies the setting and realization of fuzzy PI/PD/PID controllers.

1. INTRODUCTION One of the main drawbacks of fuzzy controllers is big amount of parameters to be tuned. It is especially difficult to make initial approximate adjustment because there is no cookery book how to do it. Also it is very well known that good convergence of optimization method is strongly dependent on initial settings. In the literature are described many papers for solution of these problems. Till this time all the published papers can't ensure a setting of parameters fuzzy PID controller with the same physical meaning similar to classical PID controller, and can't solve the problems with time transformation and change of sample periods with using the same parameters. The adjustment of fuzzy controllers may be considerably simplified when fuzzy controller with a unified universe is used. The parameters to be tune then have their physical meaning and fuzzy controller can be approximately adjusted using known rules for classical controllers. The easiest way how to create fuzzy PID controller is probably to make fuzzy PID controller as a parallel combination of basic fuzzy controllers P+I+D [4] or PI+D [2]. Suitable choice of inference method can ensure behavior, which is close to one of classical PID controller for both the tracking problem and the step disturbance rejection. The fuzzy sets are assumed to have initially symmetrical layout and Ziegler - Nichols method, tunes the parameters of both regulators using for example. To improve behavior of such designed fuzzy controller it is necessary either to manually change the quantities of fuzzy controller or to use some optimization methods, which does this operation. One that can be implied is a genetic algorithm. Different quantities can be changed to reach the optimum values. These quantities are fuzzy set layout, number of fuzzy sets, rule base mapping, the parameters of basic fuzzy controllers and their various combinations. Note that all the optimizations must be always performed according to the chosen inference and defuzzification method. It is apparent that process of optimization can take a lot of time. Moreover this method is contingent on existence of accurate mathematical model of the process because in vast majority of the cases it is not possible to perform any kind of

optimization directly on real process. The model usually does not correspond to real system, which limits the success of optimization methods. The prime idea of fuzzy control was to apply it at the place where there is no deep knowledge of transfer function of controlled system and where this knowledge can be hardly identified. These are often the cases where the fuzzy control leads to better performance comparing with classical approach. Also for this instance it seems to be advantageous to have physical connection between fuzzy controller and its classical counterpart because it can significantly simplify the adjustment of regulator for real process. The heuristic optimization of parameters settings is also suitable for fuzzy PI controller with unified universe where the parameters are the same as the ones of classical PI controller. The parallel combination of fuzzy PI and PD controller can be used for heuristic optimization of parameters settings but it should be noted that because of the presence of double proportional part in this regulator the adjusted parameters would differ from the ones of classical PID controller. But important thing is that the adjustment of these parameters is still in the same physical meaning. Note that for all previously mentioned controllers it is also possible to employ time transformation (sample time modification) without having to change the scope of universes.

NB

NM

NS

ZO

PS

PM

PB

0 -1 -0.9

-0.6

-0.3

0.3

0.6

0.9 1

Fig. 1 Symmetrical membership function layout

For simpler design, universe ranges for inputs and outputs are normalised in interval <-1, 1> (Fig. 1). Input or output value is multiplied by a constant that indicates a real range of the universe. If the universe range is multiplied by coefficient 5 before fuzzification, the real range of the universe is <-0.2, 0.2 >. For coefficient 0.1 the real range of the universe is < -10, 10>. It is evident theres no conflict with commonness and this procedure leads to the significant simplicity for the fuzzy controller design.

2. FUZZY PI CONTROLLER DESIGN A classical PI controller is described by equation (1) 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), w(t) is the desired value, y(t) is the output from process and u(t) is the output from controller the action value.
1 u(t) = K (e(t)+ TI

e( )d
0

(1)

When we derive (1) we get 1 u(t) = K (e(t) + e(t)) (2) TI For a local extreme location we put 1 e(t)) = 0 (3) u(t) = K (e(t) + TI The solution of equation (3) is 1 e(t) = e(t) (4) TI because the PI controller gain is K > 0. The equation (4) depends only on the PI controller integral time constant TI !

state characteristic intersects the line (for u(t) = 0) and the action derivation u(t) changes its sign. By comparison we find out that the derivation of action value depends on the derivation of error magnitude. That is why we can map the rule base to the discrete state space - for example the shape that is in Fig. 3. We use the ZO elements on the diagonal for mapping of equation (4). If we translate the equation (3) to a discrete form, we get the equation for action value change of the discrete PI controller 1 u(k) = K (e(k) + e(k)) (5) TI where u(k) = (u(k) - u(k-1)) /T e(k) = (e(k) - e(k-1)) /T T is the sampling period, k is the step. From Fig. 2 is obvious that the time constant TI has relation to the change-in-error. Therefore we can modify the equation (5) for a fuzzy PI controller 1 u(k) = 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). We define the scale factor M for the universe range, M > 0. This scale factor sets the universe ranges for the error and its first difference (Fig. 3). We extend the equation (6) and get u(k) = K
1 M TI ( e(k) + e(k)) TI M M
M/TI PM PB PB PS PM PB ZO PS PM NS ZO PS NM NS ZO NB NM NS NB NB NM -M/TI e(k)

(7)

u(t) = 0 u(t)=0
ZO NS NM -M NB NB NB NB PS ZO NS NM NB NB NB

PB PB PB PM PS ZO NS

PB PB PB PB PM PS ZO

M e(k)

Fig. 2 State trajectory of the controlled system with the PI controller with some gain K1 closed loop Fig. 3 The rule base of fuzzy PI controller mapped to the discrete state space

The physical meaning of this equation rests upon the fact, that from the point when the PI regulator state trajectory intersects the straight line, the action signal derivation goes into negative values. We are going to exploit this fact further for the base rules mapping into a state plane, to match the straight line surrounding with the rules on the rule base ZO diagonal and herewith reach the necessary match for parameters setting in the physical meaning. Should u(t) have no extreme, than the transient is going to be strongly periodic, without overshoot and it doesnt affect the mathematical derivations in no way. The situation is displayed in Fig. 2. When the state trajectory passes from left to right (or from below to up) when it intersects the line, the sign of the action derivation changes from negative to positive. So there is a place in the step response where the

The placement of the base rules mapped into the state plane according to equation (7) is determined only by the chosen scale factor and the integral constant magnitude. Multiplication of the normalised universe is inversely proportional; therefore the values on axis are inverted up against the equation (7). If the scale M is lower than the initial difference in Fig. 3, the action signal will be limited and its value will correspond to the outer points in the base rules. The transient will be extended with limited overshoot. Scale M must be the same for e and e. We apply fuzzification to input variables and after defuzzification we get the equation T 1 M u(k) = K D{F{ I e(k) + e(k)}} (8) TI M M

where F is an operation for fuzzification and D for defuzzification. For u(k) we put
T M 1 u( k ) u( k 1) u(k) = =K D{F{ I e(k) + e(k)}} T TI M M (9) The output of the fuzzy PI controller in the step k is then KMT T 1 D{F{ I e(k)+ e(k)}}+u(k-1) (10) u(k)= M M TI
1 M

u(k) = KM D{F{

T 1 e(k) + D e(k)}} M M

(16)

The realisation of the fuzzy PD controller is depicted in Fig. 5.


1 M
u(k) KM
TD M

e(k)
Z -1

e(k) +
1 T

RB

e(k) u(k)
Z -1

e(k) +
1 T
TI M

RB

D
KMT TI

+ +
Z -1

u(k)

Fig. 5 Fuzzy PD controller structure with the normalised universe range

4. FUZZY I CONTROLLER The equation of classical I controller is u(t) = K

Fig. 4 Fuzzy PI controller structure with the normalized universe range with the antiwindup

A realisation of the fuzzy PI controller is in Fig. 4. A physical meaning of the parameters for the fuzzy PI controller remains the same like for the PI controller (the controller gain K and the time integral constant TI ). The saturation limits of the action value realises antiwindup. 3. FUZZY PD CONTROLLER A classical ideal PD controller is described: u(t) = K (e(t) + TDe(t))

1 TI

e( )d
0

(17)

When we derive (17) we get u(t) = K

1 e(t) TI

(18)

If we translate the equation (18) to the discrete form, we get the equation of a discrete I controller u(k) = K (11)

1 e(k) TI

(19)

Wed like to know when the action value is equal to zero, that is why we can write e(t) + TD e(t) = 0 (12)

where u(k) = (u(k) - u(k-1)) /T The rule base of fuzzy I controller is a one dimensional rule base (Tab. 1).
TAB. 1 THE ONE DIMENSIONAL RULE BASE FOR FUZZY I CONTROLLER

The solution of equation (12) is 1 e(t) = e(t) (13) TD The equation (13) depends only on the derivation time constant of the PD controller and its physical meaning is similar to equation (4) for the PI controller. If we transfer the equation (11) to the discrete form, we get an equation of the discrete PD controller u(k) = K (e(k) + TD e(k)) (14)

NB

NM

NS

ZO

PS

PM

PB

We initiate the scale M for the universe range, M > 0. After extending the equation (19) we get u(k) = K

M 1 ( e(k)) TI M

(20)

We apply fuzzification to input variables and after defuzzification we get the equation u(k) = K

where e(k) = (e(k) - e(k-1))/T and T is the sample period. In the next step we map the rule base to the discrete state space e(k), e(k). We initiate the scale M for the universe range, M > 0. This scale sets ranges for the error and the change-inerror. After extending the equation (14) we get T 1 u(k) = KM ( e(k) + D e(k)) (15) M M We apply fuzzification to input variables and after defuzzification we get the equation

M 1 D{F{ e(k)}} M TI

(21)

where F is an operation for fuzzification and D for defuzzification. For u(k) we put u(k)=

1 M u(k)u (k1 ) =K D{F{ e(k)}} TI T M

(22)

The output of the fuzzy I controller in the step k is then

u(k) =

1 KMT D{F{ e(k)}}+ u(k-1) TI M


u(k)

(23)

e(k)

1 M

u(k) + +
Z -1

RB

D
KMT TI

Fig. 6 Fuzzy I controller structure with the normalised universe range

valid also for non-symmetrical and non-linear fuzzy set layout. This fact has a large importance for parameters obtained from some optimisation method. Optimisation method that is often employed is genetic algorithms. This method requires accurate model of the system to be controlled. Unfortunately, the model usually does not perfectly correspond to real process. The universe ranges and fuzzy rule bases must be fine tuned afterwards. This could be hard job when there would not be the connection between parameters of fuzzy controller and physical reality.
e(k)
Z -1

5. FUZZY D CONTROLLER The transfer function of classical continuous D controller may be realised in the form [5].

1 MD

e(k) +
1 T

F
TD MD
TI MI

RB

uPD(k) + KDMD

u(k)

e(k)
Z -1

+ uPI(k)

Ts D FD(s) = K T D s +1 N
e(t)

1 MI

(24)

KI MIT TI

1 T

e(k)

RB

NK + -

uD(t)

u(k) + + +
Z -1

Fig. 9 Structure of the fuzzy PI +PD controller with the normalised universe range with antiwindup

N TD
e(k)
Z -1

1 M
1 T

Fig. 7 The structure of continuous D controller

e(k)

TI M

RB

u(k)

+
KMT + TI

uPI(k) + +
Z -1

+ + uD(k)

u(k)

where N is derivative gain, N < 3, 20 >. The structure of continuous D controller is in Fig. 7 and the structure of fuzzy D controller is similar Fig. 8.
e(k) + + uD(k)
1 M

+ Z -1 + + M TN TD

1 M

NK

RB

Fig. 10 The structure of fuzzy PI+D controller


1 MP

+ Z
-1

NK

+
M TN TD

RB

F
e(k)
1 MI

RB

D
KP MP

uP(k) + uI(k) + + + Z -1 + + + uD(k) u(k)

Fig. 8 The structure of fuzzy D controller

RB

D
K I M IT TI

u(k)

6. FUZZY PID CONTROLLER A fuzzy PID controller can have many variants. From a practical point of view there are the most frequent versions: a parallel combinations of fuzzy PI+PD, PD+I, PI+D or P+I+D controllers. Fuzzy PI+PD controller settings cant be equivalent to classical PID controller settings due to double proportional gain included in fuzzy controller structure. The physical connection between integral and derivative time constants remains the same. Fuzzy controller can be adjusted using the same procedure as for classical controllers. It means that the increase of proportional gain or decrease of integral time constant leads the system to higher oscillations. The oscillations can be compensated to some extend by increase of derivative time constant. In a case of slow time response we can increase the proportional gain or decrease integral time constant to make the response faster. These actions are
+ +

+ Z -1 + +

1 MD

NKD

D
M DTN TD

RB

Fig. 11 The structure of fuzzy P+I+D controller

For fuzzy PI+D or fuzzy P+I+D controller it is possible to use the same initial settings of parameters as they were found for classical PID controller. The values of parameters can be fine tuned using the rules mentioned above. Generally nonlinear fuzzy PID controller can exhibit better performance in real applications comparing with classical PID controller. But it is usually simpler to realise non-linear classical PID controller with the same results. Nevertheless, we are sure that fuzzy PID controllers can find their position in MIMO

systems where we can eliminate strict demand on realisation on realisation of classical MIMO controllers using fuzzy inversion. 7. EXAMPLES Results can be compared with a classical discrete PID controller (Fig. 12). The derivative gain of the derivation part was chosen N = 3 [1]. On the transfer function

F ( s) =

2 (10s + 1)( s + 1) 2

(25)

was designed the PID controller by Ziegler - Nichols method. We found these critical values: Kcrit = 12.1, Tcrit = 5.7 s. Then PID controller parameters are: K = 0.6Kcrit = 7.26; TI = 0.5Tcrit = 2.85 s; TD = 0.125Tcrit = 0.712 s. System step responses with this PID controller are in Fig. 13.
T TI

Fig. 14 Responses in the system with the I-PD controller and with the settings K = 7.26, TI = 3.2 s, TD = 0.8 s, N = 3, T = 0.1 s.

e(k)

u(k) + + +
Z -1

N + e + +
TN T

Z -1

e D Fig. 12 The structure of PID controller with antiwindup

Fig. 15 Responses in the system with the fuzzy PI+D controller and with the setting K = 7.26, TI = 2.85 s, TD = 0.712 s, M =10, N = 3, T = 0.1 s. The inference method is PROD-MAX for PI, MIN-MAX for D controller and defuzzification is COG.

output

output (V)

action
Fig. 13 Responses in the system with the classical PID controller and with the settings K = 7.26, TI = 2.85 s, TD = 0.712 s, N = 3, T = 0.1 s.

output disturbance

For a small overshoot we can use a modified classical I-PD controller and we changed a little the parameters. The transfer function of the I-PD controller in Z transformation is given by (Fig.14)
U(z)=K(-Y(z)+

time (s)
Fig. 16 Responses in the system with the fuzzy P+I+D controller and with the settings K = 7.26, TI = 2.85 s, TD = 0.712 s, M =10, N = 3, T = 0.1 s. The inference method is PROD-MAX for all controllers and defuzzification is COG

Tz

-1 -1

E(z)- N

1- z 1- e

-1

TI (1- z )

TN TD -1

Y(z)) (26)

In Fig. 15 are step responses with the same system transfer function and with the same parameters of fuzzy PI+D controller. For best results of comparison we must use the inference PROD-MAX for PI controller and MIN-MAX for D controller. For fuzzy P+I+D controller we must use for all controllers the PROD-MAX inference (Fig 16). Because a physical meaning of fuzzy controller constants is the same as for a classical controller, the first setting of parameters maybe equal and we can naturally continuing in optimising of the parameters. Fuzzy controller is generally inclined to oscillation with relatively small amplitude. The origin of these oscillations is not only incorrect tuning of the parameters but also by using of the inference method Min-Max. The oscillations are considerably eliminated when the Prod-Max inference method is employed and singletons for defuzzification are used. Another potential source of oscillations is wrong implementation of inference engine. Shift of the vertex point of middle membership function just for 0.01 on the normalized universe (illustrated in Fig. 17) causes the limit cycles to appear (see results in Fig. 18) without any other external intervention.

PD controller causes the initial deviation in Fig. 18 and PI controller gives the oscillations. When the singleton membership functions are used instead of triangular ones the described phenomena of oscillations disappear. Following the results in Fig. 18 it can be seen that the singletons as an output membership functions give at the beginning higher oscillation but after the time they disappear (dashed line). Triangular membership functions with COG defuzzification give after short transient response steady limit cycle. Note the non-zero steady state error in both cases. As a consequence we can say that there is a difference between defuzzification using singletons and triangular membership functions even if the COG method is used. 8. CONCLUSION For the fuzzy PID controller parameters setting it is necessary to determine universe ranges and perform tens or hundreds of simulation experiments until we find acceptable values. A retrieval of optimal parameters is very difficult, because the setting is dependent on a lot of other parameters. In addition, optimal parameters could be dependent on the desired value. The new method with the unified universe range, stated in this article, considerably simplifies setting of fuzzy PI/PD/PID controllers. It allows approximate adjustment of controller's parameters according to wellknown methods for PID controller synthesis. If the universe has non-linear membership function layout then the results can have better behaviour than the classical PID controller. The fuzzy PID controller can be programmed like a unified block in a controller and therefore work consumed on an implementation to the particular control system can be cut short.
Acknowledgements

0.01 0 u, u 0

0.01 u, u

Fig. 17 Wrong shift of the middle membership function

output

COG with triangles

This research was partially financially supported by the Czech Grant Agency GAR under the grant number 102/01/1485 Enviroment for Developing, Modelling and Application of Heterogeneous Systems and by the grant CEZ: MSM 260000013 Automation of Technological and Manufacturing Processes.
References
[1] P. Pivoka, Physical Background of Fuzzy PI and PD Controller, IFSA Eighth International Fuzzy Systems Association World Congress, Taipei, Taiwan, pp. 635 639, August 17 20, 1999 P. Pivoka, Fuzzy PI+D Controller with a Normalized Universe, European Congress EUFIT'98, Vol. 2, Aachen, Germany, pp. 890894 September 7 10, 1998 P. Pivoka and M. dlo, Fuzzy PI+PD Controller, BUSEFAL, Vol. 74, Toulouse France, pp. 93 97, 1998 P. Pivoka and M. Findura, The Alternative Realization of Fuzzy Controllers, Automatizace, Czech Republic, Vol. 41, No. 10, 11, 12, pp. P31 P38, in Czech, 1998 K. J. strm and B. Wittenmark, Computer Controlled Systems, Prentice-Hall Inc, London, 1990

y(t)

u(t) singletons

[2]

[3] [4]

time (s)
[5] Fig. 18 Effect of shift of the middle membership function

You might also like