5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution...

30
5. Lecture Fuzzy Systems Fuzzy Control Soft Control (AT 3, RMA)

Transcript of 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution...

Page 1: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

5. Lecture

Fuzzy Systems

Fuzzy Control

Soft Control

(AT 3, RMA)

Page 2: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

120WS 19/20 Georg Frey

5. Structure of the lecture

1. Introduction Soft Control: Definition and delimitation, basic of 'intelligent'

systems

2. Knowledge representation and knowledge engineering (symbolic AI)

Application: Expert Systems

3. FuzzySystems: dealing with fuzzy knowledge

Application: Fuzzy control

1. Fuzzy-Quantity

2. Fuzzy-Relations, Fuzzy-Inference

3. Fuzzy-System, Fuzzy-Control

4. Connective Systems: Neural Networks

Application: Identification and neural control

5. Genetic algorithms, Simulated annealing, Differential evolution

Application: Optimization

6. Summary & References

Page 3: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

121WS 19/20 Georg Frey

Contents of the Lecture 5.

1. Fuzzy Systems

1. Fuzzification

2. Defuzzyfying

3. Operation of the overall system

2. Fuzzy Control

1. Rules

2. Control

3. Fuzzy Control

4. Design Process

3. Summary

Page 4: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

122WS 19/20 Georg Frey

Fuzzy System

• engl.: Fuzzy system

System, that used linguistic rules and with the help of the partial blocks

fuzzification, inference and defuzzyfying, mapped the numeric input variables

to numeric output variables

(VDI/VDE 3550)

Fuzzification Inference Defuzzyfication

Page 5: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

123WS 19/20 Georg Frey

Fuzzification

• engl.: fuzzification

Conversion of a numeric size in a degree of membership to linguistic

expressions of a linguistic size

(VDI/VDE 3550)

Fuzzification Inference Defuzzyfication

Page 6: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

124WS 19/20 Georg Frey

Fuzzification

• Transition from a sharp signal value X to a fuzzy signal value X*

• Assignment of the degrees of membership for all linguistic terms of the

corresponding linguistic variable

• For n linguistic terms, there is a n-tuples of degrees of membership

In the fuzzification, a sharp signal is not transferred in a fuzzy-quantity, but in a

vector of sharp degrees of memberships of fuzzy-quantities

1

0

μ

T/°C

50 1000

very low low very highhighmedium

T = 58°C T * = (0 0 0.5 0.15 0)

0.5

0.15

Page 7: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

125WS 19/20 Georg Frey

Example for Fuzzification

• T1 = 28 °C T1*= (0 0,8 0 0 0) The temperature T1 = 28 °C is low

• T2 = 58°C T2*= (0 0 0,5 0,15 0) The temperature T2 = 58 °C isbetween medium and high, more medium

• T3 = 95°C T3*= (0 0 0 0 1) The temperature T3 = 95 °C is very high

0

μ

T/°C

50 1000

very low low very highhighmedium

T2 = 58°C

0.5

0.15

1

T3 = 95°CT1 = 28°C

0.8

Page 8: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

126WS 19/20 Georg Frey

Defuzzyfication

• Engl.: defuzzyfication

Conversion of a fuzzy-quantity in a numeric output value (e.g. in a control

variable).

(VDI/VDE 3550)

Fuzzification Inference Defuzzyfication

Page 9: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

127WS 19/20 Georg Frey

Thoughts about Defuzzyfication

• The output fuzzy-quantity represents a activation function

• Question: What exact value best describes the result of the inference?

• Basic Ideas:

Maxima of the function:

Value, that is the maximum in the fuzzy quantity

(Problem: Definition by multiple maxima)

"Middle" of the area

Center or median of the area under the curve

(Problem: complex calculation)

• Methods

Maximum-Defuzzyfication

gravity method

Area median method

• First an example

Page 10: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

128WS 19/20 Georg Frey

Example: linguistic variables

1

0

μ

T/°C

50 1000

very low low very highhighmedium

1

0

μ

W/%

50 1000

very low low very highhighmedium

Page 11: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

129WS 19/20 Georg Frey

Example: rule base and factum

Rule base

• R1: IF T = very low THEN W = very high

• R2: IF T = low THEN W = high

• R3: IF T = medium THEN W = medium

• R4: IF T = high THEN W = low

• R5: IF T = very high THEN W = very low

• Input Variable: T = 15 °C

1

0

μ

T/°C

50 1000

very low low very highhighmedium

1

0

μ

W/%

50 1000

very low low very highhighmedium

1

0

μ

W/%

50 1000

very low low very highhighmedium

0.75

0.25

Fuzzification: T * = (0.75 0.25 0 0 0)

Page 12: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

130WS 19/20 Georg Frey

Example: Accumulation (MAX)

1

0

μ

W/%

50 1000

Very Low Low Very HighHighMedium

1

0

μ

W/%

50 1000

Very Low Low Very HighHighMedium

1

0

μ

W/%

50 1000

Very Low Low Very HighHighMedium

0.75

0.25

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

Page 13: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

131WS 19/20 Georg Frey

Maximum-Defuzzyfication

• Where is the maximum ?

Mean-of-Maxima (mean value of the

Maxima)

Smallest-of-Maxima (first Maximum)

Largest of maxima (last peak)

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

MOM: YD = 93.75 SOM: YD = 87.5 LOM: YD = 100

Evaluation

Simple Calculation

Only rules with a maximum degree of fulfillment go to the result (usually one)

The degree of fulfillment of the rule is not taken into account (for MOM and

triangular-structured ZGF, others partially).

Range boundaries are not always possible (depends on ZGF)

Discontinuous output values

Page 14: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

132WS 19/20 Georg Frey

Gravity method

• General

= Center of

gravity (COG)

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

Evaluation

All the rules are taken into account

Continuous output values

Levels of fulfillment are taken into account

Complex calculation

Range boundaries are not possible ( Advanced gravity method)

dyy

dyyy

yD

COG: YD =

• Simplified

or for Singletons

= Center of singletons

(COS), centroide

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

n

i

i

n

i

ii

D

y

yy

y

1

1

COS: YD = 85

Page 15: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

133WS 19/20 Georg Frey

Area median method

• = Center of

area (COA)

μ

W/%

50 100

Very HighHigh1

0

0.75

0.25

Evaluation (almost like in gravity method)

All the rules are taken into account

Continuous output values

Levels of fulfillment are taken into account

Complex calculation (more complex than in gravity method)

Range boundaries are not possible

For singletons in output Fuzzy-Quantities unsuitable

D

D

y

y

D dyydyymity

COA: YD =

Page 16: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

134WS 19/20 Georg Frey

Operation of a Fuzzy-System

1. FuzzificationDetermination of the degrees of membership of the sharp inputvariables to the Input-Fuzzy-Quantities

2. Aggregation (premise analysis)Determination of the levels of fulfillment of the single rule premises(Determination of active rules)

3. ActivationDetermination of the single Output-Fuzzy-Quantities (for each rule)

4. AccumulationOverlap of the single Output-Fuzzy-Quantities to an overall Output-Fuzzy-Quantity (function of attractiveness)

5. DefuzzyficationDetermination of the sharp output values from the function ofattractiveness

Page 17: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

135WS 19/20 Georg Frey

Application: Fuzzy control

• Basics

Properties of a scheme

Properties of a control

Comparison of control (close loop and open loop)

• Fuzzy control

Application of a Fuzzy-System to control

• Design Methodology

Page 18: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

136WS 19/20 Georg Frey

Block diagram of a control

Process variable

routeActuators

Sensors

Control element

Control output

reference variable w

-

Feedback variable

Comparing

element

Algorithm

Disturbances(incl. EMC, environment, ... )

Control

Characteristics

• Sphere of influence, where variables continuously retroact to themself

• Continuous values

• Standardized task: disturbance correction, tuning the reference variable

Example: Balancing of an inverted pendulum

Page 19: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

137WS 19/20 Georg Frey

Control

Block Diagram

Output variablesControl Part

Control SignalsInput Variables

route

Actuator feedback

Actuators

SensorsFeedback variables

Disturbances(incl. EMF, environment, ...)

Algorithms

Characteristics

• Variables in the loop do NOTcontinously retroact themselves

• Binary values

• No standardized task

Example: Positioning of an inverted pendulum

Page 20: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

138WS 19/20 Georg Frey

„Always restart, "not standardized bar: usually extensive

Rules can be applied“

„Always same“, standardized: „Controlled variable adjust the reference input“

Specification

Always several loops/mehrschleifig, i.e. several hundred sensors and actuators Complexity

>95% of control loops are one-loop/einschleifig (1 Sensor, 1 Actuator)

Number of signals

Variables in loop effects other variables

Variables in loop retroact themselves

Feedback variables

discretecontinousVariables

Boolean Algebra, Automata, Petri Nets

Differential equationsMathematics

Amplifier loop

Disturbances

Feedback system

No amplifier loopAmplification loop is defined Stability problem

only known in advance and trackabledisturbances can be corrected

unknown disturbances can be corrected

Asynchronous binary feedback variables( Events)

Permanently synchronised closed loop

ControlAutomation

Comparison of Automation and Control

Page 21: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

139WS 19/20 Georg Frey

Fuzzy-Control

• Fuzzy controller (fuzzy controller) can be used for regulatory as well as for control tasks. Often combinations of the two are found.

• The resulting controller can be the described link between inputs and outputs

Characterstics curve

In general not-linear

Application of a fuzzy system for the control and automation

(Control)

Fuzzy controllers are not novel controller types.They belong to the class of nonlinear curves or

Characterstics diagram controller.

However, there are new design methods and the interpretation of results.

Page 22: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

140WS 19/20 Georg Frey

m

1

negative-up positive-up

positive-downnegative-down

middle-up

180120900-90-120-180

0

negative-up

middle-

up

negative-

up

positive-

down

positive-

up

-30 30

Fuzzy Control in the example of inverted pendulum

Regel 1:

IF Pendulum angle

positiv-downAND

Angular acceleration negative

ANDWagon position

middle

THENacceleration should be

negative

Page 23: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

141WS 19/20 Georg FreyE

Swing up with Fuzzy Controller

Page 24: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

142WS 19/20 Georg Frey

Static characteristics of fuzzy controllers

Control base:

R1: IF e = NG THEN u = NG

R2: IF e = NU THEN u = NU

R3: IF e = PG DANN u = PG

• Examples with mixed Degree of overlap Input fuzzy quantities

• Max-Min-Inference

• COS-Defuzzification

Page 25: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

143WS 19/20 Georg Frey

Control and Variables characteristics

Control variale y Variable u

Page 26: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

144WS 19/20 Georg Frey

Example with two input variables

Page 27: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

145WS 19/20 Georg Frey

Design parameters of a fuzzy controller

Fuzzification Inference Defuzzification

Control base

y

ZGFZGF Input variables Output variables

x

Problem orienteddesign parameters

Method oriented design parameters

Defuzzificationmethods

Inference-methods

(see 4. VL)

•Premise evaluation: Operators for AND and OR

(t-Norm und s-Norm)• Activation: Operator for

the closing of the Premise Conclusion (t-Norm)

• Accumulation: Operator for the

summary of single

control output (s-Norm)

Page 28: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

146WS 19/20 Georg Frey

Design process of a fuzzy controller

Design process

1. Defining the parameters method

2. Defining the parameters problem

1. Define the linguistic variables and the number of terms

2. Defining the membership functions

3. Defining the rules (expertise)

3. Simulation using a model (if possible)

4. Implementation

Depending on the result of 3 (or 4): Optimization through interventions in 2 (or 1)

• Note: Even method parameters usually have not much influence on the behaviour

• method parameters will be partially used by the design tool set

Design process = method for determining the method and parameters of the problem

Page 29: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

147WS 19/20 Georg Frey

Dynamic fuzzy controller

• Fuzzy controllers are initially static

• Dynamic behaviour can only be produced by external components are

Post-processing of output variables(integration)

pre-processing of input variables (Derivation)

• Example: Fuzzy-PID-Controller

Page 30: 5. Lecture Fuzzy Systems...Genetic algorithms, Simulated annealing, Differential evolution Application: Optimization 6. Summary & References. SC WS 19/20 Georg Frey121 Contents of

SC

148WS 19/20 Georg Frey

Summary and learning for 5th Lecture

To know the concept of fuzzy system

Fuzzification

Apply and describe the methods of De-fuzzification

Functionality of Fuzzy sytems

Concept of fuzzy controller with respect to with control and regulation

Design process of fuzzy controller