Sei sulla pagina 1di 23

Introduction to Fuzzy Logic

and Fuzzy Control

Fuzzy logic
• Fuzzy Logic allows obtaining conclusions from vague,
ambiguous or imprecise information

• Linguistic variable
– A variable whose values are words or phrases in a natural or synthetic
language
– Knowledge is expressed through subjective concepts
• Tall, short, cold, hot, positive, zero, big, …

• Fuzzy rule: IF … THEN …


– A rule in which the antecedent and the consequent are propositions
containing linguistic variables

Fuzzy logic and fuzzy control 2

2
Fuzzy control

Fuzzy control, user’s view

• Rule based, linguistic, symbolic, qualitative, …


• The user’s view (interface)
Fuzzy logic and fuzzy control 3

Fuzzy control

Fuzzy control, process’ view

• Non linear, Quantitative, ...


• The process’ view
Fuzzy logic and fuzzy control 4

4
Non linear control
• The reality (the process to be controlled) is non linear
• Linear systems are, in general, a good local approximation of a
non linear system
• Linear control is, in general, sufficient (PID, for example)
• However, there is an increasing need of non linear control
– Increasing functionality/complexity
– Fast production changes
– Higher precision
– Larger operating ranges

Larger operating range of an


inverted pendulum
Fuzzy logic and fuzzy control 5

Need of non linear control


• Non linear process
– Non linear dynamics
– Non linear dynamics + constraints on the inputs, states, outputs
• “Non linear” specifications
– Time-optimal control
– Constraints
– Small signal vs large signal behaviour

Fuzzy logic and fuzzy control 6

6
Non linearities in control

• In the process model


– Basis for model based
controller design
– Part of a model based
controller

• In the controller
– Feedback path
– Direct path

Fuzzy logic and fuzzy control 7

Non linear mappings


• Difficult representation
• Different approaches (parameterizations)
– Look-up tables
– Splines
– Fuzzy systems
– Neural networks
– Wavelets
– Analytic functions
– Radial basis functions
– Logic and selection

Fuzzy logic and fuzzy control 8

8
Fuzzy logic
• Introduced by Lotfi Zadeh in the early 1960s
• Fuzzy sets theory / logic for dealing with non probabilistic
uncertainties
• Application domains
– Control systems, supervision, maintenance
– Decision support systems
– Data classification, pattern recognition, computer vision
– Knowledge based systems

• First application – automatic control


– Abe Mamdani, Queen Mary College, 1974
– Steam turbine and boiler

Fuzzy logic and fuzzy control 9

Fuzzy logic based control: motivation

Conceptual evolution of fuzzy logic based control

• Non linear connection


– Manual control is typically non linear, e.g. on-off control

Fuzzy logic and fuzzy control 10

10
Model-based control

Stages for implementation of model based control

• Conventional or fuzzy

Fuzzy logic and fuzzy control 11

11

Heuristic fuzzy control

Stages for implementation of heuristic based fuzzy


control

Fuzzy logic and fuzzy control 12

12
Crisp sets
• The set A := {x | x ∈ A}
• The characteristic function

⎧1, x∈ A
μA ( x) = ⎨
⎩0, otherwise
• Set operations:

Membership value
– Intersection
– Union
– Complement
– Subset

Definition of crisp sets and


membership values of their elements
Fuzzy logic and fuzzy control 13

13

Fuzzy sets.
Membership functions and membership value
• Membership function and membership value
μ A : x → [0,1]

A = {( x, μ A ( x )) | x ∈ U }
Membership value

Fuzzy sets definition

Fuzzy logic and fuzzy control 14

14
Typical membership functions

• Gaussian

Membership value
• Triangular/Trapezoidal
/Rectangular

Membership value
Fuzzy logic and fuzzy control 15

15

Typical membership functions

• Singleton
Membership value

Membership function example: singleton

Fuzzy logic and fuzzy control 16

16
Support, nucleous and α-cut

A(x)

Characterization and properties of a fuzzy set

Fuzzy logic and fuzzy control 17

17

Fuzzy set operations


• Intersection: AND A∩ B
μ A∩ B ( x ) = min (μ A ( x ), μ B ( x ))

• Union: OR A∪ B
μ A∪ B ( x ) = max (μ A ( x ), μ B ( x ))

• Complement: NOT A'


μ A' ( x ) = 1 − μ A ( x )

Fuzzy logic and fuzzy control 18

18
Intersection operators
• Probabilistic AND (product operator):

μ A∩ B ( x ) = μ A ( x ) ⋅ μ B ( x )

• Lukasiewicz AND (bounded difference):

μ A∩ B ( x ) = max (0, μ A ( x ) + μ B ( x ) − 1)

• Other T-Norm operators ...

[0,1]× [0,1] → [0,1]

Fuzzy logic and fuzzy control 19

19

Union operators
• Probabilistic OR:

μ A∪ B ( x ) = μ A ( x ) + μ B ( x ) − μ A ( x ) ⋅ μ B ( x )

• Lukasiewicz OR (bounded sum):

μ A∪ B ( x ) = min (1, μ A ( x ) + μ B ( x ))

• Other T-Conorm operators ...

[0,1]× [0,1] → [0,1]

Fuzzy logic and fuzzy control 20

20
Fuzzy logic
• Generalization of ordinary boolean logic
• Propositions have truth values between 0 and 1, the membership
values in the fuzzy sets

Truth values of simple propositions

Fuzzy logic and fuzzy control 21

21

Fuzzy logic
• AND, OR and NOT connect simple propositions into compound
propositions
( x1 is A1i ) AND (x2 is A2i ) OR ...

• Fuzzy inference is expressed by:


IF <fuzzy proposition> THEN <fuzzy proposition>

IF (x1 is A1i ) AND (x2 is A2i ) OR ... THEN (u1 is B1i ) AND (u2 ...)

Fuzzy logic and fuzzy control 22

22
Fuzzy logic
• A very large body of theory has been developed
• Very little of this theory is needed to understand/use fuzzy
control

Fuzzy set theory and its use in control


Fuzzy logic and fuzzy control 23

23

Architecture of a fuzzy control system


• A fuzzy system is consituted by:
– Knowledge Base, or Rule Base
– Inference mechanism
– Interfaces
– Fuzzification: numbers - > fuzzy sets
– Defuzzification: fuzzy sets -> numbers

Fuzzy logic and fuzzy control 24

24
Architecture of a fuzzy control system

Architecture of a fuzzy system with its input and output interfaces

• Which of the subsystems most influence the controller


performance?

Fuzzy logic and fuzzy control 25

25

Inference systems
• Mamdani inference system:
– Prototype of a rule, being A and B fuzzy sets:

IF x is A THEN u is B

• Takagi-Sugeno inference system:


– Prototype of a rule, being A a fuzzy set:
IF x is A THEN u = f ( x)

A fuzzy set, the f(x) function, is, in general, a linear


combination of the inputs:
f ( x) = l0 + l1x1 + ... + ln xn

Fuzzy logic and fuzzy control 26

26
Steps of a Mamdani inference system
1. Input fuzzy set evaluation

Membership value
Fuzzy set evaluation, depending on the input crisp values

i. Temperature is Cold with a truth value of 0.7


ii. Temperature is OK with a truth value of 0.3
iii. Temperature is Hot with a truth value of 0.0

Fuzzy logic and fuzzy control 27

27

Steps of a Mamdani inference system


2. Evaluate the firing level of each rule:

IF Temp is Low AND Pressure is Average THEN ...

Firing level of each rule Operators for the antecedent of a rule

Fuzzy logic and fuzzy control 28

28
Steps of a Mamdani inference system
3. Evaluate the fuzzy output of each rule:
IF ... THEN u is Zero
Depends of the definition of each operator ...

Determining the consequent of a rule

Fuzzy logic and fuzzy control 29

29

Steps of a Mamdani inference system


4. Fuzzy output aggregation

Fuzzy output aggregation, including all active rules, using the max operator

Fuzzy logic and fuzzy control 30

30
Steps of a Mamdani inference system
5. Defuzzification. Defuzzifier: Fuzzy set B’-> number y’
– Common choice: Center of Gravity

(u)

∫ u ⋅ μU (u )du ∑in=1ui μU (ui )


u= U u=
∫U μU (u )du ∑in=1μU (ui )
Deffuzification with Centre of Gravity – COG, for continuous and
discrete fuzzy sets.
– Other choices: Centre of sums, Mean of maximum, ...
Fuzzy logic and fuzzy control 31

31

Steps of a Mamdani inference system


5. Defuzzification (cont.)

Defuzzification methods: Centre of gravity (left) and Mean of maximum (right),


alternative: first maximum

Fuzzy logic and fuzzy control 32

32
Mamdani inference systems: internal vision

Architecture of a Mamdani controller

Fuzzy logic and fuzzy control 33

33

Mamdani inference systems: external vision


• Example: Mamdani controller for two input variables

X, Y Z

Mamdani generic control surface (non linear)

Fuzzy logic and fuzzy control 34

34
Mamdani inference systems: look-up tables

(Z)

(Z)
Control

Control
X, Y Z

Mamdani system: inputs, look-up table and control surface

• Piecewise constant systems with extensive interpolation


• Overlap of the input membership functions define the interpolation
regions
• Very little reason to use anything but singletons as output
membership functions
Fuzzy logic and fuzzy control 35

35

Takagi-Sugeno inference systems


• Rules for a Takagi-Sugeno inference system:
IF x is A THEN u = f ( x)

A fuzzy set, the f(x) function is, in general, a linear combination


of the inputs:
f ( x) = b0 + b1x1 + ... + bn xn

• The steps of the inference system are:


1. Input fuzzy set evaluation
2. Calculation of the firing degree (weight) of each rule
3. Calculation of the output of each rule
4. Calculation of the output by weighted average

Fuzzy logic and fuzzy control 36

36
Takagi-Sugeno inference systems

Takagi-Sugeno controller: rules firing level (weights) and rule output

• The global output of a Takagi-Sugeno inference system is:


∑N w u
u = i =N1 i i
∑i =1 wi
Fuzzy logic and fuzzy control 37

37

Takagi-Sugeno inference systems: internal vision

Architecture of a Takagi-Sugeno controller

Fuzzy logic and fuzzy control 38

38
Takagi-Sugeno inference systems: external vision
• Example:
R1: IF X is N AND Y is N THEN
u1=b01+b11X+b12Y
X, Y Z
R2: IF X is N AND Y is P THEN
u2=b02+b21X+b22Y
R3: IF X is P AND Y is N THEN
u3=b03+b31X+b32Y
R4: IF X is P AND Y is P THEN Control surface (non linear) of a
u4=b04+b41X+b42Y Takagi-Sugeno controller

• Generally, the Takagi-Sugeno controller can be viewed as a set of


hyper surfaces with weighted connections
Fuzzy logic and fuzzy control 39

39

Takagi-Sugeno inference systems: look-up tables

X, Y Z

Takagi-Sugeno system: inputs, look-up tables and control surface

• Piecewise linear systems with interpolation


• Operating regions interpolation regions
• Gain-scheduling

Fuzzy logic and fuzzy control 40

40
Summary
• Introduction to fuzzy logic and fuzzy logic based controllers
– Linguistic variables e linguistic values
– Linguistic rules
– Membership functions
– Fuzzy sets, operations with fuzzy sets
– Fuzzification, Inference and Defuzzification
– Fuzzy logic controller structures
• Mamdani
• Takagi-Sugeno

Fuzzy logic and fuzzy control 41

41

References
• D. Driankov, H. Hellendorn, M. Reinfrank, “An Introduction to
Fuzzy Control”. Springer-Verlag, Berlin, 1993
• L. Reznik, “Fuzzy Controllers”. Newnes, 1997
• K. M. Passino, S. Yurkovich, “Fuzzy Control”. Addison-Wesley,
Menlo Park, 1998

Fuzzy logic and fuzzy control 42

42
Appendix: Fuzzy relations
• The classical relation between two universes, U and V is defined as:
U × V = {( u, v ) u ∈ U , v ∈ V }

• It combines any element of U with any element of V in ordered


pairs, and makes associations without restrictions between u and v
– The strength of the ordered pairs of the elements of each universe is
measured by the characteristic function, with values of 1 (complete relation)
or 0 (no relation)
• Example:
U = (1, 2 ) V = ( a, b, c ) U × V = {(1, a ) , (1, b ) , (1, c ) , ( 2, a ) , ( 2, b ) , ( 2, c )}
• In a matrix representation:
a b c
1 ⎡1 1 1⎤
R = U ×V = ⎢
2 ⎣1 1 1⎥⎦
Fuzzy logic and fuzzy control 43

43

Fuzzy relations
• A fuzzy Relation, R, maps elements of one universe into the other
universe through the cartesian product of the two universes
– The relation strength between the pairs is measured by a membership
function:
R : U × V → [ 0,1]
• Example, using the min operator:
μ R ( u, v ) = μ A× B ( u, v ) = min ( μ A ( u ) , μ B ( v ) )
⎡0.2 ⎤
A1 = ( 0.2,0.9 ) A2 = ( 0.3,0.5,1) R = A1 × A2 = ⎢ ⎥ × [ 0.3 0.5 1]
⎣0.9 ⎦

⎡ min ( 0.2,0.3) min ( 0.2,0.5 ) min ( 0.2,1) ⎤ ⎡0.2 0.2 0.2 ⎤


R=⎢ ⎥=⎢ ⎥
⎣ min ( 0.9,0.3) min ( 0.9,0.5 ) min ( 0.9,1) ⎦ ⎣ 0.3 0.5 0.9 ⎦
Fuzzy logic and fuzzy control 44

44
Fuzzy relations
• R is a fuzzy relation between universes U and V. S is a fuzzy
relation between universes V and W. The fuzzy relation T, relating
the elements of U contained in R, with the elements of W contained
in S is given by the composition:

T = R D S = max {min ( μ R ( u , v ) , μ S ( v, w ) )}
v∈V

• Example, using min-max, the relation T=RoS:

⎡ 0.6 0.8⎤ ⎡ 0.3 0.1⎤ ⎡0.3 0.8⎤


R=⎢ ⎥ ; S=⎢ ⎥; RDS = ⎢ ⎥
⎣ 0.7 0.9 ⎦ ⎣ 0.2 0.8⎦ ⎣0.3 0.8⎦
• The element T(1,1) is obtained by: max{min(0.6, 0.3), (0.8, 0.2)}
• It is verified that: R D S ≠ S D R
Fuzzy logic and fuzzy control 45

45

Potrebbero piacerti anche