A fuzzy system is an universal approximator


A fuzzy rule-base system, FRBS = (ab, R, T, S, DEF), is a
family of fuzzy systems with membership functions ab a fuzzy
rule base R, the t-norm, for fuzzy aggregation T (i.e. operations
within one rule), the s-norm for fuzzy composition S (i.e.
operations among rules), and the defuzzification method DEF.
Defuzzification consists of the conversion of the fuzzy output
into a single crisp output.
Any given fuzzy system FS  FRBS is a universal approximator
according to a theorem. Let the fuzzy rule-based system FRBS
be the set of all fuzzy systems FS and f: U  Rn  R be a
continuous function defined on a universe of discourse U. For
each  > 0, there exists a FSe  FRBS such that
sup {  f(x) - FSe(x)  , x  U }  
Defuzzification
Process that converts a fuzzy set or fuzzy number into
a crisp value or number
 Defuzzification is such inverse transformation which
maps the output from the fuzzy domain back into the
crisp domain. The following defuzzification methods
are of practical importance:

• Center-of-Area (C-o-A)
• Center-of-Maximum (C-o-M)
• Mean-of-Maximum (M-o-M)


The Center-of-Area method is often referred to as the Center-ofGravity method because it computes the centroid of the composite area
representing the output fuzzy term.
Figure shows the membership functions of a linguistic output variable
MotorPower where the areas of ZE and PM are combined by the union
operator and thus their contour becomes the composite fuzzy output
for MotorPower. C-o-A defuzzification method computes the centroid
of this area
N
u
i
u* 
OUT
i 1
N

i 1
OUT
u i 
u i 



The Center-of-Maximum requires only the peaks of the membership
functions. Defuzzified value is determined by finding the fulcrum where
the weights are balanced. This method is also called by Height-Method
The crisp output is computed as a weighted mean of the term
membership maxima, weighted by the inference results.
Equations are very similar, except that for C-O-A it is used the areas of
each membership functions. For C-O-M it is used only their maxima.
Naturally the results are slightly different.
N
n
 u    u 
i
u* 
O ,k
i 1
i
k 1
N
n
   u 
O ,k
i 1 k 1
i

The Mean-of-Maxima is used when the maxima of the membership
functions are not unique, one can then take the mean of all maxima.
Max (I) is the inferred fuzzy output term with the highest degree of
truth and M is the integer number of such peaks.
M
u* 

m 1
um
M



It may be desirable to leave out the boundaries of the
control inference membership function. Hence, the set
over which the defuzzification is performed is only an acut in which the a is the threshold value.
The idea here is to try to make defuzzification insensitive
to multimodal fuzzy output inference.
Height method is a good choice when using triangular or
trapezoidal functions. However, the Gaussian membership
functions have a couple of important properties:
1. produces smooth mapping
2. universal approximation property can be easily proven
3. central limit theorem: usually data distributions tend to
be normal which can be approximated well by Gaussian
basis functions
• Recommended to use Center of Area

Criteria for comparison:
• Continuity
• Disambiguity (producing a crisp output for every combination of output
membership functions
• Plausibility (output lies approximately in the middle of support and has
a high degree of membership)
• Computational complexity
• Weight counting (weight information is not lost)




Which defuzzification method for what application?
Closed-loop control: continuity is important because jumps in the
controller output can cause instabilities and oscillations.
Pattern recognition: can use M-o-M defuzzification, because if one
wishes to identify objects by classification based on the most
plausible result yielding the similarity of the signal to the standard
objects.
Decision support: the choice of defuzzification technique depends on
the context of the decision. Quantitative decisions can use C-o-M
while M-o-M is recommended for qualitative decisions.
FUZZY CONTROL SYSTEM

A Fuzzy Control System consists of four blocks:
IN P U T
F U Z Z IF IC AT IO N
D E C IS IO N
M A K IN G
L O G IC
KNOW LEDGE
BA SE
OUTPUT
D E F U Z Z IF IC AT IO N
Six steps for creation and execution of a
rule based fuzzy system
1.
2.
3.
4.
5.
6.
Identify the inputs and their ranges and name them.
Identify the outputs and their ranges and name them.
Create the fuzzy partitions (degree of fuzzy
membership function) for each input and output.
Construct the rule base that the system will operate
under
Decide how the action will be executed by assigning
strengths to the rules
Combine the rules and defuzzify the output.

A seven rules fuzzy
system to output an
action for an
inverted pendulum
Where the fuzzy sets come from ?

Polling: The question “Do you agree that x is A?” is
stated to different individuals.
• An average is taken to construct the membership
function. Answers are typically yes/no type.

Direct rating: “How A is x?” This approach
supposes that the fuzziness arises from individual
subjective vagueness.
• The person is made to classify an object over and over
again in time in such a way that it is hard for he/she to
remember the past answers.
• The membership function is constructed by estimating
the density function.

Reverse rating: The question “Identify x which is A to the
degree A( x)” is stated to an individual or a group of
individuals.
• Responses are recorded and normally distributed distributions are
formed (mean and variance are estimated).

Interval estimation: The person is asked to give an interval that
describes best the access of x. This is suited to random set -view
of membership functions.
• Membership exemplification: “To what degree x is A?” Person may
be told to draw a membership function that best describes A.

Pairwise comparison: “Which is a better example of A, x1 or x2
and by how much?”
• The results of comparisons could be used to fill a matrix of relative
weights and the membership function is found by taking the
components of the eigenvector corresponding to the maximum
eigenvalue

Clustering methods: Membership functions are constructed
given a set of data.
• Euclidean norm is used to form clusters on data.

Neurofuzzy techniques: Neural networks are used to construct
membership functions.
• An essential part of forming membership functions is the input
space partitioning.A grid, which is fixed beforehand and it does not
change later. Set to some “initial value” and tuned.
• Fuzzy clusters are best suited for classification problems, because
they implement a similarity measure.

Genetic algorithm techniques:
• Evolutionary approach to optimize the cluster of data into fuzzy
sets
1 .0
o
11
o
14
o
17
o
20
o
23
o
o
Tem p e ra tu re ( C )
26
o
29
o
32
o
70
50 60
M otor S p eed (R P M )
80
HOT
G O O D WA R M
COOL
10
STO P
IF C O L D ,
THEN
STO P
8
40
20
SLO W
IF C O O L ,
THEN
SLO W
30
IF G O O D ,
THEN
M E D IU M
COLD
90 100
BLAST
M E D IU M FA S T
IF WA R M ,
THEN
FA S T
0
Example of Fuzzy
Controller
Air – Conditioning
System
1.0

IF H O T,
THEN
BLAST
Rules for the Air-Conditioning System
Rule 1
If temperature is cold then stop motor, vent is downward
Rule 2
If temperature is cool then motor speed is slow, vent is downward
Rule 3
If temperature is comfortable then motor speed is medium, vent is horizontal
Rule 4
If temperature is warm then motor speed is fast, vent is upward
Rule 5
If temperature is hot then blast motor speed, vent is upward

Fuzzy Inference Relating
Motor Speed and Vent
Angle For Temperature Input
Implementing Fuzzy Controllers

Can be either implemented in hardware or software

There are many degrees of freedom inherent to fuzzy
system design, requiring a great deal regarding trialand-error and the availability of easy ways to select
different fuzzification and defuzzification schemes.
Such flexibility suggests the use of software.
Development of Fuzzy Controller
with Matlab
.m programs are useful to translate the
implementation in other languages (C) and to have the
feeling in how to implement
 FIS Editor displays high-level information about a
Fuzzy Inference System. At the top is a diagram of the
system with each input and output clearly labeled. By
double-clicking on the input or output boxes, you can
bring up the Membership Function Editor. Doubleclicking on the fuzzy rule box in the center of the
diagram will bring up the Rule Editor.


The following program is an implementation in
MatLab® of a fuzzy controller with the following
characteristics:
• Rule based fuzzy controller
• It supports any number of inputs, limited only by the
processing capability of your computer and Matlab
• It supports any number of outputs, limited only by the
processing capability of your computer and Matlab
• Any input and output can have any number of triangular
membership functions. Each input or output may have
different number of membership functions
• You can defuzzify either by the height method or by
computing the center of gravity
Flowchart
Initalizeexecution
Contr oller Definit ion
Keyboar dDataI nput
InputUser s Data
Fuzzif ication
RulesCom putation
Defuzzificat ion
Scr eenOutputData
DataOut put
ExitExecution
Inputs and Outputs Definition
1
Exam pl e of one var i abl e w i t h
5 m em ber shi p f unct i ons
U ni ver se of di scour se
1
Exam pl e of one var i abl e w i t h
3 m em ber shi p f unct i ons
U ni ver se of di scour se
ne 2
ns 2
2)
1, var
var
s (
nput
e_i
nam
s2)
(s1,
s
put
e_out
nam
4
nr
g
=Bi
1
s
n
The
l
ea
2=Sm
ar
v
d
an
g
=Bi
1
r
a
Fv
I
1:
e
l
u
R
2 1
r_e
1 2

2 0
0 1

1 1 2
r_ s

2 1 1
2



2
g
=Bi
2
s
n
The
l
a
=Sm
2
r
a
Fv
I
2:
e
l
u
R
Fuzzification
Rules Evaluation





The rules were generated by the vectors r_e e r_s . For
rules evaluation, the following procedure is made:
An auxiliary vector is used “aux” with ne (number of
inputs) elements equal to “1”.
For each input variable it is verified if that variable (j)
participate for the antecedent of that rule, if that is positive,
the element aux(j) is attributed the fuzzified input value
correspondent to the membership function of that rule
condition.
The truth value of the rule is the minimum value of aux
and it is stored into the matrix output_aux((i,j,k) where the
i indicates which is the output number, j indicates which is
the membership function and k indicates the rule number.
The final output matrix is the maximum value of each
input membership function evaluation
Defuzzification
ns

Height Method
 ((output(i
s (i ) 
(j - 1)
, j) *
(nps(i) - 1)
j 1
ns
 output(i,
j)
j 1

Center of Gravity

(j - 1)
  area(i, j)* (nps(i) - 1)
j 1 
ns
s (i ) 
ns

 

ns

j 1

  double_are
  area(i,
j 1
j)  
ns
 (j - 1)
1
a(i, j)* 

 (nps(i) - 1) (nps(i) - 1)
  double_are
a(i, j) 
j 1

1 - output(i, j)  2  1
1
area(i, j)  
*




nps(i)
1
nps(i)
1

 2

1 - 2 * min([0.5, output(i, j), output(i, j  1)]
1
double_are a(i, j)  
 nps(i) - 1 
  nps(i) - 1 
2 
1
*
 8

 


Two cases are presented

Case 1: 2 inputs were considered, one with 2 membership
functions within an universe of discourse between 5 and 50, and
another with three membership functions within an universe of
discourse between 0 and 1. 2 outputs were considered, one with 2
membership functions within an universe of discourse between 1
and 10, and another with 3 membership functions within an
universe of discourse between 4 and 20.

Case 2: The efficiency of fuel consumption for a car can be
described linguistically. It depends on the car velocity, air
dragging, thermal cycle.

The file case1.m shows the Matlab implementation
for this fuzzy modeling
Simulation
for Case 1
What is the variable_1 (5.0<x<50.0)?
45
What is the variable_2 (0.0<x<1.0)?
0.8
Defuzzification results with height method
The variable_3 is : 6.4
The variable_4 is : 10.56
Defuzzification results with center of gravity method
The variable_3 is : 5.944
The variable_4 is : 11.206
Simulation
for Case 1
What is the variable_1 (5.0<x<50.0)?
23
What is the variable_2 (0.0<x<1.0)?
0.2
Defuzzification results with height method
The variable_3 is : 4.6
The variable_4 is : 10.8571
Defuzzification results with center of gravity method
The variable_3 is : 5.056
The variable_4 is : 11.3363
Evaluation of fuel consumption
Efficiency of fuel consumption for a car can be
described linguistically.
 For small velocity the car takes too much fuel for the
thermal cycle itself, since the RPM is not optimized
 As your RPM is optimized and the speed increases the
air-dragging adds friction
 There is an intermediate optimal speed point

The car velocity is divided into three fuzzy sets as
below (Small, Medium and High)
FUNCOES DE PERTINENCIA - (OP OM OG)
1
0.9
0.8
0.7
0.6
SAIDA

0.5
0.4
0.3
0.2
0.1
0
0
10
20
30
40
50
60
70
UNIVERSO DE DISCURSO
80
90
100
Consumo x Velocidade
90
L arge
80
M ediu m H igh
70
60
M ediu m
M ediu m
M ediu m L o w
Consumo

Figure below shows the fuel consumption on the left side
depicted in from the linguistic description of the car velocity.
The Rules are:
1. If Vel is Small Then Consumption is High
2. If Vel is Medium Then Consumption is Low
3. If Vel is High Then Consumption is Medium
C o n su m p tion

50
40
L ow
30
20
1 0 k m /h 4 0 k m /h 6 0 k m /h 8 0 k m /h
C a r velo city
10
0
10
20
30
40
50
60
Velocidade
70
80
90
100

The file case2.m shows the Matlab implementation
for this fuzzy modeling

Development of fuzzy coding can
be easily done by using a Shell
Environment. There are several
companies with visual based
development platforms, Togai,
FuzzyTech, FIDE, just to name a
few.
•
•
•
•
Real-time on-line debugging and
tuning of rules, membership
functions and rule weights,
including addition and deletion of
rules
Graphical object-based "point and
click" CASE tool
User-defined inference methods
Color rulebase and operator
visualization tools
•
•

Fully integrated graphical
simulation of fuzzy systems and
conventional methods
ANSI and Keil C code generation
from the Fuzzy-C compiler
Those environments make
provisions for the following:
•
•
•
•
Reduction of programming efforts
Fast prototyping
Availability of several options
regarding several degrees of
freedom( typical of a fuzzy
systems)
Visual feedback for assessing fuzzy
controller modifications
Project Editor: Defining the control structure
“Spreadsheet Editor”: Defining the rule base
Membership editor: Graphically defining the
membership functions
Various types of defuzzification methods can be
selected
1
1
1
0.
8
0.
8
0.
8
0.
6
0.
6
0.
6
0.
4
0.
4
0.
4
0.
2
0.
2
0.
2
0
0
0
5
10
P
R
E
S
S
U
R
E
0
1530
55
80
T
E
M
P
E
R
A
T
U
R
E
0%
50%100%
V
A
L
V
E
S
E
T
T
N
I
G

The reason for using the fuzzy software development system described in the
foregoing is to tune the initial fuzzy design. This requires many iterations
involving modifications of both the rules and the membership functions. By
using the Interactive Debug option the designer can immediately visualize the
effect of each of such changes, thus he knows whether or not a particular
change has caused an improvement in system response. This visual feedback
is essential for fuzzy system design.

The Interactive Debug window, provides for entries for both inputs and
displays the current output as determined by the current fuzzy controller. If the
displayed value is incorrect, the designer can make modifications in the rules,
or the degree of support of the rules, or the membership functions
interactively, until the displayed output matches with the output value required
for the specific input combinations entered. By monitoring the threedimensional control surface the designer can also change the fuzzy inference
structure from max-min to another type provided by the software package. For
example, a smoother response with no creases or abrupt jumps of the control
surface can be obtained by using max-product type fuzzy inference.
Fuzzy Controllers in Industrial Environment
Industrial electronics use PID control,implemented by
embedded system or PLC programming
 PID control works well for linear processes
 PID control has poor performance in non-linear
processes
 Fairly complex systems usually need human control
operators for operation and supervision

Fuzzy Controllers
PID fuzzy control can implement a single feedback
loop
 A supervisory control can be implemented with fuzzy
rules to control the operation of standard PID
controllers running on every loop

c 1 (3 )
c 2 (7 )
1 .2
c 3 (11 )
b 1 (2 )
S econ d -ord er
system o u tp u t
1 .0
Let us understand
the dynamics
of a controller
d 1 (4 )
b 2 (6 )
d 3 (1 2 )
a 3 (9 )
a 2 (5 )
0 .8
R eferen ce
L evel
b 3 (1 0 )
d 2 (8 )
0 .6
0 .4
0 .2
a 1 (1 )
0 .0
0
5
10
15
20
25
T im e (sec)
PB
PM
PS
AZ
NS
NM
NB
E \ DE
NB
NM
NS
AZ
PS
PM
PB
-5
0
0
0
0
0
0.4
1
-4
0
0
0
0
0.1
0.7
0.7
-3
0
0
0
0.1
0.4
1
0.4
-2
0
0
0.1
0.4
0.7
0.7
0.1
-1
0
0
0.4
0.7
1
0.4
0
NB
NM
NS
PM(17)
PB(4)
PM(8)
AZ(19)
PS(12)
0
0
0.1
0.7
1
0.7
0.1
0
AZ
NB(3)
NM(7)
NS(11)
AZ(13)
PS(9)
PM(5)
PB(1)
1
0
0.4
1
0.7
0.4
0
0
2
0.1
0.7
0.7
0.4
0,1
0
0
3
0.4
1
0.4
0.1
0
0
0
4
0.7
0.7
0.1
0
0
0
0
5
1
0.4
0
0
0
0
0
PS
PM
PB
NS(10)
AZ(18)
NM(16)
NB(2)
NM(15)
PM(14)
Rule Table
Fuzzy – PI Controller
E
CE
NVL
NL
NM
NS
NVL
NL
PS
PM
PL
PVL
NVL
NL
NM
NS
ZE
NL
NM
NS
ZE
PS
NL
NM
NS
ZE
PS
PM
NL
NM
NS
ZE
PS
PM
PL
NL
NM
NS
ZE
PS
PM
PL
PL
NM
NS
ZE
ZE
PS
NL
NM
NS
ZE
PS
PM
PM
NM
NS
ZE
PS
PM
PL
PL
NS
ZE
PS
PM
PL
PVL
ZE
PS
PM
PL
PVL
Block Diagram
KE
r +
*
  r(pu )
E r
r
FUZZY
KT
+
CONTROL
+
Dr
D   r(pu )
-1
T*
e
+
Di *
q s(pu )
Z
K CE
Z
D e*
-1
Supervising a multi-loop PID industrial process
P ID
S U PE RV ISO RY
FUZZY
CONTROLLER
P ID
PROCESS
P ID
O bse rva ble
varia bles
C ontrol
Va ria bles
PLANT
O U T PU T S
Fuzzy Decision Support Algorithm
Descargar

Document