Anda di halaman 1dari 23

Ecole Polytechnique Fdrale de Lausanne

Dpartement dInformatique
Laboratoire de Microinformatique

Comparison between PID and


fuzzy control

Internal Report R93.36I

Jelena Godjevac
LAMI IN F EPFL Ecublens
1015 Lausanne
email: godjevac@di.epfl.ch

Abstract

The goal of this work is to make an analysis of the performances of a fuzzy controller and a
comparative study of fuzzy control algorithms with a conventional control approach (PID)
in the case of linear dynamic process control. This comparative study is made using compu-
ter simulation.
The first part is devoted to the formal framework of the theory of fuzzy sets and fuzzy con-
trollers. The second part of this paper is a description of a simulated system, and a presenta-
tion of simulated controllers. In the second part, fuzzy controller is examined in details. A
sensitivity of the fuzzy logic controller to design parameters, different shapes and superpo-
sition of membership functions, is tested. Moreover, the simulations are done for the differ-
ent types of fuzzy reasoning and defuzzification methods.
1. Introduction
The humans, when making decisions tend to work with vague or imprecise concepts which can often be
expressed linguistically. One of the ways of modelling this decision making process has been proposed
by Zadeh [Zadeh65] and is based on the theory of Approximate Reasoning which enables certain
classes of linguistic statements to be treated mathematically. First investigations by prof. Zadeh
[Zadeh73] concerned how to use mathematical tools to represent a human language and human knowl-
edge. He was the first who introduced the term of fuzzy rules and linguistic variables in control theory.
His paper from 1972 [Zadeh72] claims that fuzzy algorithms underlie much of human thinking. We use
them both consciously and subconsciously when we walk, park a car, recognize patterns. This use is
more intuitive and qualitative than systematic and quantitative. Moreover, Zadeh believes that the mod-
ern control theory must become less preoccupied with mathematical rigor and precision, and more con-
cerned with the development of qualitative or approximate solutions to pressing real world problems. In
short, he proposed that all problems in which the data, the objectives and the constraints are too com-
plex, or too ill-defined to admit a precise mathematical analysis have to be treated by approximate
(fuzzy) solutions. This new approach is receiving more and more attention, not only in test cases but
also in industrial applications.
Fuzzy controllers were developed to imitate the performance of human expert operators by encoding
their knowledge in the form of linguistic rules [Mamdani75]. They provide a complementary alterna-
tive to the conventional analytical control methodology. Some authors argue that fuzzy controllers are
suitable where a precise mathematical model of the process being controlled is not available [Kick-
ert78] [Li88]. But, it is impossible to build a controller which need not assume anything about its envi-
ronment.
An often remarked disadvantage of the methods based on the fuzzy logic is the lack of appropriate tools
for analysing the controllers performance, such as stability, optimality, robustness, etc. The main advan-
tage is the possibility to implement a human experience, intuition and heuristics into the controller.
The goal of this work is to study the performances of a fuzzy controller and to compare it with a classi-
cal control approach. In the first part, the basic notions of fuzzy logic will be presented. The second part
is devoted to the description of the fuzzy controller, its architecture and the different types of fuzzy rea-
soning. The third part is the presentation of the linear system simulated in order to test the performance
of the fuzzy controller, and after a classical control approach will be presented. The last part is devoted
to the analyse of the results of simulation.

2. Basic notions of fuzzy logic


2. 1 Fuzzy set

General definition of a set is that a set is a collection of objects distinct and perfectly specified
[Kaufmann88]. A part of a set is a subset. For example, let E is a finite referential set:
E = {a, b, c, d, e}
We can form a crisp subset of E, for example:
A = {b, d, e}
If we present it in the other form:
A= 0 1 0 1 1
a b c d e

2
In the classical set theory one element can either belong to a set, or not. This property can be repre-
sented by a degree of membership. In the case shown before, the element b belongs to A, and its degree
of membership is 1. The element a doesnt belong to A and its membership is 0. We can form a function
which represents this property:
1 if x A
A ( x) = {
0 if' x A

This concept is basic in the classical set theory. The main concept of fuzzy theory is a notion of fuzzy
set. Fuzzy set is an extension of crisp set. Zadeh [Zadeh65] gave the following definition:
A fuzzy set is a class of objects with a continuum of grades of membership. Such a set is characterized
by a membership (characteristic) function which assigns to each object a grade of membership ranging
between zero and one.
After him, many authors found different ways of denoting fuzzy sets. Zimmermann [Zimmerman90]
writes:
A fuzzy set is denoted by an ordered set of pairs, the first element of which denotes the element (x) and
the second (A(x)) the degree of membership:
A = { x, ( x ) x X }
A
where A takes values in the interval [0,1].
One of the biggest differences between crisp and fuzzy sets is that the former always have unique mem-
bership functions, whereas every fuzzy set has an infinite number of membership functions that can
represent it [Bezdek93]. From the above definitions follows that one possible fuzzy subset of the refer-
ential E is:
B = 0.4 0.2 0 0.8 1
a b c d e
It means that the element a belongs to B with a value of 0.4, element b with 0.2 etc. This value has dif-
ferent names in the literature. The mostly used are: membership value, degree of membership, degree of
compatibility, degree of truth, grade of membership, level of membership etc.
The other notations for fuzzy set are [Zimmerman90]:
B = { (a, 0.4), (b, 0.2), (c, 0), (d, 0.8), (e, 1) } 2.1.1
or:
B = 0.4/a + 0.2/b + 0/c + 0.8/d + 1/e 2.1.2
Note that in the above definition, / does not refer to a division and is used as a notation to separate the
membership of an element from the element itself.
Fuzzy sets can be regarded as a generalization of the concept of the ordinary (simple, crisp) sets whose
membership function only takes two values {0,1}.

2. 2 Linguistic variable

We can use fuzzy sets to represent linguistic variables. Linguistic variables represent the process states
and control variables in a fuzzy controller. Their values are defined in linguistic terms and they can be
words or sentences in a natural or artificial language. For example, for the linguistic variable: tempera-
ture, we can define a set of terms:

3
T(temperature) = { negative big, negative medium, negative small, close to zero,
positive small, positive medium, positive big }

2. 3 Membership function

Every fuzzy set can be represented by its membership function. In the example above, the referential set
is a finite set. Membership values are discrete values defined in the [0,1]. If the referential set is infinite
set, we can represent these values as a continuous membership function. In general, the shape of mem-
bership function depends of the application and can be monotonic, triangular, trapezoidal or bell-shaped
as shown in Figure 1.

1 1 1 1

x x x x

FIGURE 1. Different shapes of membership functions: monotonic, triangular, trapezoidal and bell-shaped

Suppose that we want to represent the property: positive small for the linguistic variable: temperature
(Figure 2). In the example below, if the measured temperature in one system is x, then the level of mem-
bership of x in the fuzzy set positive small is given by (x) (Figure 2) and it is 0.8. We can say that the
level of truth for the proposition: The temperature x is positive small is 0.8 or 80%.

1
(x) positive small
(0.8)

x
temperature
FIGURE 2. An example for membership function (positive small temperature)

temperature
NEGATIVE NEGATIVE NEGATIVE 0 POSITIVE POSITIVE POSITIVE
BIG MEDIUM SMALL ZERO SMALL MEDIUM BIG

FIGURE 3. Universe of discourse for linguistic variable: temperature

One of the first steps in every fuzzy application is to define the universe of discourse (dynamic range)

4
for every linguistic variable. The set of terms: T(temperature) can be characterized as fuzzy sets whose
membership functions are shown in Figure 3. Every fuzzy set in a universe of discourse represents one
linguistic value or label.

2. 4 Operations with fuzzy sets

The most important operators in classical set theory with ordinary (crisp) sets are complement, intersec-
tion, union. These operations are defined in fuzzy logic via membership functions. Moreover, fuzzy set
theory offers the vast range of operations on fuzzy sets that dont exist in the classical theory
[Zadeh65].

2. 4. 1 Complement

Complementation in fuzzy set theory corresponds to the complementation in classical set theory. For
example, the element b in ( 2.1.1) belongs to the fuzzy subset B with a level 0.2. It means that it does
not belong to B with a level 0.8. Thus, the membership values in a complement subset B are:
B(x) = not (B(x)) = 1 - B(x)

which corresponds to the same operation in the classical theory. The algebra of fuzzy sets is similar to
the algebra with ordinary sets except:

BB and BBE
It means that the Aristotelian non contradiction is not acceptable with fuzzy sets.

2. 4. 2 Intersection or Triangular Norms

For the intersection of fuzzy sets Zadeh [Zadeh65] suggested the min operator and the algebraic prod-
uct. Following Zadehs idea a lot of researchers proposed various operators for this operation. [Zimmer-
man90]
Let A and B be two fuzzy sets in U universe of discourse, with membership functions A and B
respectively. The most important intersection operators are:

min operator
A(x) and B(x) = min { A(x), B(x)}

algebraic product
A(x) and B(x) = A(x)*B(x)

bounded product
A(x) and B(x) = max (0, A(x)+B(x)-1)

drastic product
x if y = 1

A and B = y if x = 1

0 if x,y < 1

5
Einstein product
A ( x) B ( x)
A and B = -------------------------------------------------------------------------------------------
-
2 [ A ( x) + B ( x) A ( x) B ( x) ]

Hamacher product
A ( x) B ( x)
A and B = ---------------------------------------------------------------------------
-
A ( x) + B ( x) A ( x) B ( x)

All these operators belong to the so-called triangular or t-norms. Functions t define a general class of
intersection operators for fuzzy sets and can be parametric or nonparametric. Here, we mentioned only
nonparametric operators.

2. 4. 3 Union Triangular Co-Norms

For the union of two fuzzy sets, there is a class of operators named t-conorms or s-norms. The most
used in the literature are:

max operator
A(x) or B(x) = max { A(x), B(x)}

algebraic sum
A(x) or B(x) = A(x)+B(x)-A(x)* B(x)

bounded sum
A(x) or B(x) = min { 1, A(x) + B(x) }

drastic sum
x if y = 0

A or B = y if x = 0

1 if x,y > 0

Einstein sum
A ( x) + B ( x)
A or B = ----------------------------------------
-
1 + A ( x) B ( x)

Hamasher sum
A ( x ) + B ( x ) 2 A ( x ) B ( x )
A or B = ------------------------------------------------------------------------------
-
1 A ( x) B ( x)

disjoint sum
A(x) or B(x) = max { min (A(x), 1 - B(x)), min(1 - A(x), B(x)) }

Suppose that we defined two fuzzy sets by their membership functions A and B which have triangular
shape (dotted lines on Figure 4). The application of t - norm (in this example the operator is min) gives
the fuzzy set andB which is represented by its membership function AandB(x) (solid line on

6
Figure 4a). The application of t-conorm (here max operator) on these fuzzy sets gives the fuzzy set rep-
resented with solid line on the Figure 4b.

A B A B
AorB (x)

AandB (x)

x x

Triangular norm Triangular co-norm


min operator max operator
FIGURE 4. Graphical representation of operations with fuzzy sets

2. 4. 4 Semantic operators

In the ordinary set theory the only operators used are complementation, union and intersection and their
logical combinations. In the fuzzy set theory the semantics and the subjectivity are taken into account,
which permit to introduce the semantic operators such as: very, closer, almost, fairly, more or less etc.
These operators are the modifiers of the fuzzy sets. Of course, the definitions of these operators are sub-
jective, which produces in fact an infinity of different operations [Berenji92].
For example, the mostly used operator for the term very is a concentration, which is commonly defined
as:
CON ( A) ( x ) = A ( x )
2

Mathematical model, frequently used for the term fairly is a dilatation:

DIL ( A ) ( x ) = A ( x)

3. Notion of linguistic rule


As mentioned above, the principal idea of fuzzy logic systems is to express the human knowledge in the
form of linguistic if-then rules. Every rule has two parts:
antecedent part (premise), expressed by if... and
consequent part, expressed by: then...
The antecedent part is the description of the state of the system, and the consequent is the action that the
operator who controls the system must take. There are several forms of if-then rules. The general is:
If (a set of conditions is satisfied) then (a set of consequences can be inferred).
Zadeh [Zadeh73] was the first who introduced a notion of fuzzy rule in the form:
Example: If the temperature is high, then the pressure is small.
The general form of this rule is:
Rule: If x is A, then y is B.
Temperature (x) and pressure (y) are linguistic variables. x represents the state of the system, and y is

7
control variable and represents the action of the operator. High (A) and small (B) are linguistic values
or labels characterised by appropriate membership functions of fuzzy sets. They are defined in the uni-
verse of discourse of the linguistic variables x and y.
Takagi and Sugeno [Takagi83] proposed the form which has the fuzzy sets only in the premise part of
the rule, and the consequent part is described by a non-fuzzy equation of the input variable.
Example: If velocity is high, then force is k*(velocity)2
An other form of this rule is:
Rule: If x is A, then y is k*x2.
or more general,
Rule: If x is A, then y is f(x)
Like in the rule of Zadeh, high (A) is the linguistic label characterised by an appropriate membership
function. Every fuzzy rule is implemented by a fuzzy implication.

3. 1 Fuzzy implication (fuzzy relation)

In the classical logic the main tools of reasoning are tautologies, such as modus ponens [Zimmer-
mann90]. If A and B are statements or propositions (crisply defined), the reasoning is the following:
Premise: A is true
Implication: If A then B
Conclusion: B is true
A fuzzy implication inference is based on the same principle, but the statements characterised by fuzzy
values are allowed, and it is called generalised modus ponens (GMP):
Premise: x is A
Implication: If x is A then y is B
Consequence: y is B
In this example, x and y are linguistic variables, A, A, B, B are fuzzy sets defined in the universes of
discourse for x and y. When A=A and B=B, GMP is reduced to modus ponens. We will denote the
fuzzy implication:
If x is A then y is B
by AB. There are many ways in which the fuzzy implication may be defined. Zadeh [Zadeh73] sug-
gested the compositional rule of inference for the above mentioned type of fuzzy conditional inference.
Nearly, 40 distinct fuzzy implication functions have been described in the literature. We will mention
here only two of them:
material implication
A(x) B(x) = not (A(x)) or B(x)

propositional calculus
A(x) B(x) = not (A(x)) or (A(x) and B(x))

The generalization of a control rule R which has two conditions in the antecedent part has a following
form:
Rule: If x is A and y is B, then z is C

8
Also:
R = (A and B) C
This control rule is implemented by a fuzzy implication (fuzzy relation) [Lee90] and is defined as fol-
lows:
R = AandB C ( x, y, z ) = [ A ( x ) and B ( y ) ] C ( z ) 3.1.1
A, B and C are fuzzy sets defined in the universes of discourse for x, y and z. R is the firing strength or
weight (level of the truth) for the statement R and A is the level of membership (membership value) of
the variable x in fuzzy set A.
As shown above, there are many ways to define the fuzzy implication and the fuzzy operator and. The
operators used for and are all t-norms functions and the most used are product and min operator.

4. General structure of fuzzy system


Every fuzzy system is composed of four principal blocks (Figure 5):
1. knowledge base (rules and parameters for membership functions)
2. decision unit (inference operations on the rules)
3. fuzzification interface (transformation of the crisp inputs into degrees of match with linguistic vari-
ables)
4. defuzzification interface (transformation of the fuzzy result of the inference into a crisp output)

Knowledge base
Data base Rule base

Fuzzification Decision Defuzzification


interface making unit interface

FUZZY

input output
Process

FIGURE 5. General structure of fuzzy inference system

4. 1 Procedure of fuzzy reasoning

The steps in fuzzy reasoning are:


1. Fuzzification: to every measure of input variable is attributed the degree of membership (member-
ship value) for all the fuzzy sets defined in the universe of discourse.
2. Application of the t - norm (usually, this operator is min or product) on the membership values of the
premise part of the rules to get firing strength or the weight for each rule (A(x) and B(y) in
( 3.1.1)).
3. Generation of the consequent value (C(z) in ( 3.1.1)) of each rule. It can be crisp or fuzzy.

9
4. Defuzzification: generate the crisp output values.
The first step in the application of fuzzy reasoning is a fuzzification of inputs in the controller. It means
that to every crisp value of input we attribute a set of degrees of membership (j, j=1,n) to fuzzy sets
defined in the universe of discourse for that input. Next step is the application of the linguistic rules. A
fuzzy controller consists of a set of control rules which are combined using the sentence connectives
and and also [Lee90]. Suppose that fuzzy system has two inputs x, y and one output z, and that we
defined n linguistic rules as follows:
If x = A1 and y = B1 then z = C1
If x = A2 and y = B2 then z = C2
...
If x = An and y = Bn then z = Cn
where x, y and z are linguistic variables representing the process state variables and the control variable;
Ai, Bi and Ci (i=1,n) are fuzzy sets defined in the universes of discourse for x, y and z respectively.
In mathematical sense, activation of the rules is the application of t-norms [Lee90] in order to get a fir-
ing strength for every rule. Usually, it means that we apply the operator min or product on membership
values. We will denote it here by wi:
wi = A(x) and B(y)

After, the firing strengths are combined using the compositional operator which expresses the sentence
connective also and the consequent value (crisp or fuzzy) is generated. At last, we perform defuzzifica-
tion in order to get crisp output. The scheme of FUZZY part of the system from Figure 5 is represented
on the Figure 6.
Linguistic rules

If x=A1 and y=B1


then z=C1 w1
x w2
If x=A2 and y=B2

y
Fuzzification then z=C2 .
..
Defuzzification
z

wn
If x=An and y=Bn
then z=Cn
FIGURE 6. General structure of the FUZZY part of the system

4. 2 Types of fuzzy reasoning

There are several types of fuzzy reasoning. The most important, in the literature, are:
Type 1: Max Dot method. The final output membership function for each output is the union of the
fuzzy sets assigned to that output in a conclusion after scaling their degree of membership values to
peak at the degree of membership for the corresponding premise [Zimmermann90]
Type 2: Min max method. The final output membership function is the union of the fuzzy sets
assigned to that output in a conclusion after cutting their degree of membership values at the degree
of membership for the corresponding premise. The crisp value of output is, most usually, the center
of gravity of resulting fuzzy set [Lee90].
Type 3: Tsukamotos method. The output membership function has to be monotonically non-

10
decreasing [Tsukamoto79]. Then, the overall output is the weighted average of each rules crisp out-
put induced by the rule strength and output membership functions.
Type 4: Takagi and Sugeno method. Each rules output is a linear combination of input variables.
The crisp output is the weighted average of each ruless output [Jang92].
To illustrate these four types of fuzzy reasoning, we will take the system shown in the Figure 6. Sup-
pose that two rules are activated. (A rule is activated when its firing strength is different than zero.) The
rules are the following:
R1: If x is A1 and y is B1 then z is C1
R2: If x is A2 and y is B2 then z is C2
The decision procedure for the four types of fuzzy inference systems is shown on the Figure 7. Fuzzy
operator and is min. One can notice that operator or is different for every type of system.

Antecedent part of the rule Consequent part of the rule


Application Type 1 Type 2 Type 3 Type 4
of T norm
product
x A1 B1 or min
C1
C1
1 C1
C1 z1 = f1(x,y)
C1
w1 = ax+by+c

x y z z z1 z
y C2
A2 B2 C2 C2
1 C2
C2
w2 z2 = f2(x,y)
= px+qy+r
x y z z z2 z
x y

C1 or C2 C1 or C2
Inputs

z z
rizi w1z1 + w2z2 w z + w2z2
z z= z= z= 1 1
zi w1 + w2 w1 + w2
Mean of Center Tsukamotos Weighted
maxima of gravity method average
FIGURE 7. Four types of reasoning in fuzzy inference systems

4. 3 Defuzzification strategies

Defuzzification is an operation with the aim to produce a nonfuzzy control action. It transforms an
union of fuzzy sets into a crisp value. There are several methods for the defuzzification, proposed in the
literature. We will describe here four of them shown in the Figure 7.

11
4. 3. 1 The center of gravity method

This widely used method generates a center of gravity (or center of area) of the resulting fuzzy set of a
control action. If we discretize the universe it is:
n

r z i i
i=1
z = ---------------
n

z i
i=1

where n is the number of quantisation levels, ri is the amount of control output at the quantisation level
i and zi represents its membership value [Berenji92].

4. 3. 2 The mean of maximum method

The mean of maxima method generates a crisp control action by averaging the support values which
their membership values reach the maximum. In the case of discrete universe:
l
ri
z = --l-
i=1

where l is the number of the quantized r values which reach their maximum memberships [Lee90].

4. 3. 3 Tsukamotos method

If monotonic membership functions are used, then the crisp control action can be calculated as follows:
n

w z i i
i=1
z = ----------------
n
-
w i
i=1

where n is the number of rules with firing strength wi is grater than zero and zi is the amount of control
action recommended by the rule i [Tsukamoto79].

4. 3. 4 The weighted average method

This method is used when the fuzzy control rules are the functions of their inputs [Takagi83] as shown
in the Figure 7 for type 4 of fuzzy reasoning. In general, the consequent part of the rule is:
z = f(x,y)
If wi is the firing strength of the rule i, then the crisp value is given by:
n

w f (x , y )
i i i
i=1
z = --------------------------------
n
-
w i
i=1

where n is the number of firing rules.

12
5. Structure of a controlled system
The objectives of this simulation is to control the position of a servomotor based on the use of a direct
current motor with separated excitation [Boverie91]. The purpose of the regulation is to keep process
variables close to specified values inspite of process disturbances. In the servo problem, the task is to
make the process variables respond to changes in a command signal in a given way, where the com-
mand signal must be known. One way to express how the system should respond to a command signal
is to give a model of the desired response. This can be done in specifying a desired transfer function
from the command signal to the process variables. Moreover, it is possible to express servo response in
terms of specifications on the desired closed loop step response or frequency response. We will mention
here only the time domain specifications (Figure 8). They are:
risetime Tr
overshoot M
settling time Ts (time before the step response is within p from its steady state value)
steady-state error e0

y
M 2p e0=0

t
Tr
Ts

FIGURE 8. Expressing servo specifications in terms of requirements on the step response [Buhler83]

The example system that we simulated is the same as in [Li88] and [Boverie91].
That system can be represented by a diagram in Figure 9, where:
u is an input voltage (control variable)
y observed output
e - electrical time constant (0.0028 sec)
m mechanical time constant (0.28sec)
K static gain of the motor (K=0.25)
As e<<m, the equivalent transfer function will be:
K
G ( s ) = ---------------------------
s ( 1 + m s)

13
u 1 1 K y
1+es 1+ms s

FIGURE 9. Structure of the simulated system

General structure of this system in a control loop is shown in the Figure 10. Reference signal is a step
function shown in the Figure 11.

r(k) e(k) u(k) y(k)


Controller Plant
+
-

FIGURE 10. Structure of the controlled system

r(t)

FIGURE 11. Reference signal

Sampling period taken in this simulation is 10ms according to the Shannons theorem. Discretised
transfer function [Astrom89] is:
1 1 b1 z + b2
G ( z ) = K ( 1 z ) Z --- ---------------------------
1
= -----------------------------
- 5.1
s s ( 1 + s m ) 2
z + a1 z + a2
where:

-----
T
m
T
b 1 = K m ----- 1 + e

m

T
-----
1 1 + ----- e
T m
b 2 = K m
m

-----
T
m
a1 = 1 + e

T
-----
m
a2 = e

14
Recursive model of the system is:
y ( kT ) = a 1 y [ ( k 1 ) T ] a 2 y [ ( k 2 ) T ] + b 1 e [ ( k 1 ) T ] + b 2 e [ ( k 2 ) T ]

6. Classical control approach


The control problem presented here is simple problem and can be handled very well by PID control.
PID is very well known and proved as very efficient. The textbook version of the algorithm is:
t
de

u ( t ) = K p e ( t ) + K i e ( s ) ds + K d -----
dt
0

where u is the control variable, e is the error defined as e = r - y (Figure 10) where r is the reference
value (Figure 11) and y is the process output.

Kp

e(k) u(k)
Ki dt

d
Kd
dt
FIGURE 12. Structure of the PID controller

There are three parameters to adjust Kp, Ki and Kd. The structure of the controller is represented in the
Figure 12. A reasonably realistic PID regulator can be described by:
k

u ( kT ) = K p e ( kT ) + K i e ( jT) + K d [ e ( kT ) e ( ( k 1 ) T ) ] 6.1
j=0

One of the most used method for the adjustment of parameters for PID controller is Ziegler-Nichols
method [Astrom89]. This simulation is done with PD because the controlled system has an intergrator
term. The response of the system with the controller in the closed loop is given in the Figure 13.

FIGURE 13. Step response of the system controlled with the PID in the closed loop

15
Control signal and error signal are represented in the Figure 14. One can notice that the range for the
control signal is [0, 12] and the range for the error signal is [0, 1]. Changes in the error e are in the
[0,1]. It is very important for the design of the fuzzy controller.

u e

t t

FIGURE 14. Control and error signal of the system

7. Fuzzy controller
There are several methods to design a fuzzy controller:
modellization of the knowledge of the control engineer
modellization of the human operator actions and his experience
fuzzy modellization of the controlled plant
There is no systematic methodology to design the fuzzy controller. The most used approach is to define
membership functions of the inputs and outputs, after rule data base and to test a controller. Fuzzy con-
troller is nonlinear and it is very difficult to examine the influence of certain parameters. Because of
that, the only method would be to test the controller on the system, and to adjust parameters which seem
to be wrong. Our goal is to examine the influence of certain parameters and to control a linear system
with known parameters and transfer function.
A basic structure of a system controlled by the fuzzy controller is presented in the Figure 10. Inputs var-
iables, or process states in the fuzzy controller are:
the error e(k)
the change in error e(k) = e(k) - e(k-1)
Since the inputs in this controller are the same as for one PD controller, we can consider that the fuzzy
controller simulated here corresponds to the classical PD controller. Its structure is presented in the
Figure 5. The design of fuzzy controller is related with a choice of following parameters:
1. Knowledge base
the rule base (choice of input and control variables and control rules)
the universe of dicourse for every process state (choice of membership functions with their
parameters and shapes)
2. Decision making logic
definition of fuzzy implication
interpretation of the terms and and also (choice of the type of fuzzy reasoning)
3. Defuzzification mechanism

16
In this simulation, we partitioned a space of input and output variables into 7 fuzzy subsets. They are
presented by 7 membership functions as in the Figure 3. These functions are:
Negative Big (NB)
Negative Medium (NM)
Negative Small (NS)
Close to Zero (ZR)
Positive Small (PS)
Positive Medium (PM)
Positive Big (PB)
The rule base that we have taken the rule base proposed by Mamdani [Mamdani75] for the simulation
of PD controller. These rules are shown in the Table 1. The table is read in the following way:
If the error is negative small (NS) and the change of error positive big (PB),
than the control action is positive medium (PM).

TABLE 1. Rule base


e
NB NM NS ZR PS PM PB
e
NB NB NB NB NB NS ZR PS
NM NB NB NB NM NS ZR PS
NS NB NB NM NS ZR PS PM
ZR NB NM NS ZR PS PM PB
PS NM NS ZR PS PM PB PB
PM NS ZR PS PM PB PB PB
PB ZR PS PM PB PB PB PB

Fuzzy reasoning methods that were simulated are the methods of type 1 and 2 presented in the Figure 7,
and the defuzzification strategies are the center of gravity and mean of maximum method.

8. Results of the simulation

8. 1 Influence of the parameters of the membership functions

The first experiment is a test of the influence of the parameters of membership functions. Once they are
adjusted, we can proceed to test the influences of other factors to the quality of the system response.
Membership functions for inputs ant output are symmetrical, triangular or bell shaped and uniformly
distributed as in the Figure 15. We will test the sensibility of the controlled system to three parameters:
limits for the universe of discourse for e, for e and for u and we will denote them with emax, emax and
umax respectively. Fuzzy inference is of the type 2 with the defuzzification method center of gravity.
The reason is that these methods are most frequently used in the literature.
The choice of the limits for membership functions were done with a knowledge of the range for the
error and control signal of the system controlled by the PID controller (Figure 14). It was impossible to
make this choice without any knowledge on the controlled system. We can consider these informations
as something that we could receive from the operator.

17
NL NM NS ZR PS PM PL NL NM NS ZR PS PM PL

-Em a Em -Em b Em
FIGURE 15. Uniform distribution of membership functions for e, e and u
a) triangular functions
b) bell-shaped functions
y A y B
B C A C

D
D

E
E

t t
a b
FIGURE 16. Responses of the system with fuzzy controller, emax = 3, emax = 1

A. umax = 18, B. umax = 14, C. umax = 12, D. umax = 5, E. umax = 1


a) triangular membership functions
b) bell-shaped membership functions
Dashed lines represent the step response with the PID controller
y A y A
B B
C C

D
E D

t t

a b
FIGURE 17. Responses of the system with fuzzy controller, umax = 14, emax = 1

A. emax = 0.5, B. emax = 1.1, C. emax = 3, D. emax = 7, E. emax = 10


a) triangular membership functions
b) bell-shaped membership functions

18
y y
B,C,D,E A B,C,D,E
A

t t
a b
FIGURE 18. Responses of the system with fuzzy controller, umax = 14, emax = 3

A. emax = 0.1, B. emax = 0.5, C. emax = 1, D. emax = 2, E. emax = 5


a) triangular membership functions
b) bell-shaped membership functions
From the results shown in the Figure 17 and Figure 18, we can conclude that the choice of emax and
emax corresponds to the choice of constants Kp and Kd ( 6.1). The changes of the emax have the same
effect to the quality of the response as the changes of the constant Kd and the changes of the emax have
the same effect to the quality of the response as the changes of the constant Kp which prove that this
controller corresponds to the classical PD controller.
As we can see in the Figure 18 the response is not very sensitive to the changes of emax if emax is
bigger that 0.5. It is due to the fact that the most of the time the changes of the error signal are very
close to zero and that the most activated function is ZR.
The shape of the membership functions is not an important parameter, but we can observe that the trian-
gular functions give the slightly better result. Specially, the risetime and setting time are shorter when
triangular functions are used.
For the limits of u, the best choice is to take the range of control signal same as for the PID controller,
since the response of the fuzzy controlled system is very sensitive to this parameter (Figure 16).

8. 2 Distribution of the membership functions

From the first experiment, we noticed that the best results were received with the following parameters
for membership functions:
emax = 3
emax = 1
u = 14
In this experiment the sensitivity of the system response to the distribution and the overlap of the mem-
bership functions is tested. We have taken the same fuzzy inference and defuzzification method as
before and we have tested only the triangular functions.
The result of the simulation is shown in the Figure 21 and different distributions simulated are pre-
sented in the Figure 19 and Figure 20.

19
NL NM NS ZR PS PM PL NL NM NS ZR PS PM PL

A B
FIGURE 19. Nonuniform distribution of the membership functions

NL NM NS ZR PS PM PL NL NM NS ZR PS PM PL

C D
FIGURE 20. Nonuniform distribution of the membership functions

y
A C,D

FIGURE 21. Response of the system for different distributions of membership functions (Figure 19 and
Figure 20)

We can notice that the system is very sensible to the distribution of the membership functions, and that
the parameters that we adjusted for the regular distribution are not the adequate. It means that the con-

20
troller has to be readjusted.
It is interesting to notice that the overlap of the functions is very important. If there is no overlap as in
the Figure 20D, the system can not reach the set point. It is due to the fact that two rules cant be acti-
vated in the same time. Moreover, if the distribution is quite uniform and the membership functions NS
and PS dont touch as in the Figure 20C, it is impossible to reach the set point. The reason is that for the
very small values of the error and the change of the error, only one rule is activated (If the e is ZR and
e is ZR then u is ZR) and the control signal has always the same value.

8. 3 Different types of fuzzy reasoning and defuzzification method

The last experience is devoted to the different types of fuzzy reasoning and defuzzification method. As
before, the simulation is done for the parameters that were the best in the first experiment and for the
uniform distribution of the membership functions. The fuzzy reasoning methods are the type 1 and type
2 presented in the Figure 7. There is no a sensitivity of the response to the types of fuzzy reasoning A,
B and C. The response of the system has a risetime and settling time the same as for the PID controlled
system. The problem is the Max Dot fuzzy reasoning combined with mean of maximum defuzzification
method. The reason is that the crisp values for the control signal are the centres of membership func-
tions defined for u.

y A,B,C
D

FIGURE 22. Response of the system for different fuzzy reasoning methods and methods for defuzzification

A. Min max and center of gravity


B. Max Dot and center of gravity
C. Min max and mean of maximum
D. Max Dot and mean of maximum

9. Conclusions
Fuzzy controllers have the advantage that can deal with nonlinear systems and use the human operator
knowledge. Here we tested it with a linear system of second order with known parameters. In order to
compare it with one classical controller we simulated the same system controlled by PID.
PID controller has only three parameters to adjust. Controlled system shows good results in terms of
response time and precision when these parameters are well adjusted.
Fuzzy controller has a lot of parameters. The most important is to make a good choice of rule base and
parameters of membership functions. Once a fuzzy controller is given, the whole system can actually be

21
considered as a deterministic system. When the parameters are well chosen, the response of the system
has very good time domain characteristics. The fuzzy controlled system is very sensitive to the distribu-
tion of membership functions but not to the shape of membership functions.
Fuzzy controlled system doesnt have much better characteristics in time domain that PID controlled
system, but its advantage is that it can deal with nonlinear systems.
One of the most important problems with fuzzy controller is that the computiong time is much more
long that for PID, because of the complex operations as fuzzification and particularly defuzzification.
Some optimization can be done if the defuzzification method is simplified. It means that it is recom-
mended to avoid center of gravity method.
PID controller can not be applied with the systems which have a fast change of parameters, because it
would require the change of PID constants in the time. It is necessary to further study the possible com-
bination of PID and fuzzy controller. It means that the system can be well controlled by PID which is
supervised by a fuzzy system.

10. References
[Astrom84] K. J. Astrom, B. Wittenmark, Computer Controlled systems, Prentice-Hall Information
and System Sciences Series, 1984
[Astrom89] K. J. Astrom, B. Wittenmark, Adaptive control, Addison-Wesley Publishing Company,
1989
[Berenji92] H. Berenji, Fuzzy Logic Controllers, in An Introduction to Fuzzy Logic Applications in
Intelligent System, Editors R. Yager, L. Zadeh, Kluwer Academic Publishers, 1992, p. 69-96
[Berenji91] H. R. Berenji, Y. Y. Chen, C. C. Lee, J. S. Jang, S. Murugesan, A Hierarchical Approach to
Designing Approximate Reasoning-Based Controllers for Dynamic Phisical Systems, Uncertainty in
Artificial Intelligence 6, P. P. Bonissone, M. Henrion, L. N. Kanal and J. F. Lemmer (Editors), Elseiver
Science Publishers B. V. 1991, p. 331-343
[Bezdek93] J. Bezdek, Editorial Fuzzy Models - What Are They, and Why, Fuzzy Systems, Vol. 1, No.
1, Feb. 93, p. 1-6
[Boverie91] S. Boverie, B. Demaya, A. Titli, Fuzzy Logic Control Compared with Other Automatic
Control Approaches, 30th IEEE-CDC, Conf. on Decision and Control, Brighton, Dec. 1991
[Boverie92] S. Boverie, B. Demaya, R. Ketata, A. Titli, Performance Evaluation of Fuzzy Controller,
IFAC, Symposium on Intelligent Components and Instruments for Control Applications, Malaga, Spain
May 1992
[Buhler83] H. Buhler, Rglages chantillonns vol 1 et 2, Trait dElectricit, Presses polytechniques
romandes 1983
[Chen89] Y. Y. Chen, T. C. Tsao, A Descprition of the Dynamical Behavior of Fuzzy Systems, IEEE
Trans. on Systems, Man and Cybernetics, vol. 19, no. 4, 1989, p. 745-755
[Jang92] J.-S. Roger Jang, ANFIS, Adaptive-network-based fuzzy inference systems, IEEE Trans. on
systems, Man and Cybernetics, 1992
[Kaufmann88] A. Kaufmann, Le paramtrage des moteurs dinfrence, Hermes, 1988
[Kickert78] W. J. M. Kickert, E. H. Mamdani, Analysis of a Fuzzy Logic Controller, Fuzzy Sets and
Systems 1, 1978, North Holland Publishing Company, p. 29-44
[Lee90] C. C. Lee, Fuzzy logic in control systems: fuzzy logic controller- part 1 and part 2, IEEE Trans.

22
on systems, Man and Cybernetics, 20 (2) p. 404-435, 1990
[Li88] Y. F. Li, C. C. Lau, Development of Fuzzy Algorithms for Servo Systems, IEEE International
Conference on Robotics and Automation, Philadelohia, Pensylvania, April 1988
[Mamdani75] E. H. Mamdani, S. Assilian, An Axperiment in Linguistic Synthesis With a Fuzzy Logic
Controller, Int. Journal of Man-Machine Studies, Vol. 7, no. 1, 1975, p. 1-13
[Mizumoto88] M. Mizumoto, Fuzzy Controls Under Various Fuzzy Reasoning Methods, Information
Sciences 45, 1988, p. 129-151
[Procyk79] T. J. Procyk, E. H. Mamdani, A Linguistic Self-Organizing Process Controller, Automatica,
Vol. 15, 1979, p. 15-30
[Takagi83] T. Takagi and M. Sugeno, Derivation of fuzzy control rules from human operators control
actions, Proc. of the IFAC Symp. on Fuzzy Information, Knowledge Representation and Decision analy-
sis, p. 55-60, July 1983

[Tsukamoto79] An approach to fuzzy reasoning method, in: Madan Gupta, R. K. Ragade and R. R.
Yager, editors, Advances in Fuzzy Set Theory and Applications, p. 137-149, North Holland, Amster-
dam, 1979
[Zadeh65] L. A. Zadeh, Fuzzy sets, Information and Control 8, p. 338-353, 1965
[Zadeh72] L. A. Zadeh, A Rationale for Fuzzy Control, Journal of Dynamic Systems, Measurment and
Control, March 1972, p. 3-4
[Zadeh73] L. A. Zadeh, Outline of a new approach to the analysis of complex systems and decision
processes, IEEE Trans. on systems, Man and Cybernetics, 3 (1): p. 28-44, Jan. 1973
[Zimmermann90] H.-J. Zimmermann, Fuzzy Sets Theory - and Its Applications, Kluwer Academic
Publishers, 1990.

23

Anda mungkin juga menyukai