fuzzy control

36
Fuzzy Control Jan Jantzen [email protected] www.inference.dk 2013

Upload: mairi

Post on 23-Feb-2016

34 views

Category:

Documents


0 download

DESCRIPTION

Fuzzy Control. Jan Jantzen [email protected] www.inference.dk 2013. Summary. Configuration of controller Design choices The Takagi- Sugeno controller. End-user. Controller. Rule. Ref. Deviations. Actions. Outputs. base. Plant. Inference. engine. Direct Control Configuration. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Fuzzy Control

Fuzzy Control

Jan [email protected]

www.inference.dk2013

Page 2: Fuzzy Control

2

Summary

• Configuration of controller• Design choices• The Takagi-Sugeno controller

Page 3: Fuzzy Control

3

Direct Control Configuration

Deviations Actions OutputsRef

Controller

End-user

Inferenceengine

Rulebase

Plant

Could be a multi-input-multi-output controller

Page 4: Fuzzy Control

4

Example: Tank Level ControlV1

Control valve

Inlet stream

Outlet stream

Tank

Page 5: Fuzzy Control

5

Control Rules

1. If the level is low, then open V1

2. If the level is high, then close V1

Actually, a single rule might be sufficient. Which?

Page 6: Fuzzy Control

6

High Level

This requires a level sensor, which is able to measure how full the tank is. Ultrasound, for instance.

Page 7: Fuzzy Control

7

High And Low Levels

Page 8: Fuzzy Control

8

Choice of Rule Base

1. If error is Neg and change in error is Neg then output is NB2. If error is Neg and change in error is Zero then output is NM3. If error is Neg and change in error is Pos then output is Zero4. If error is Zero and change in error is Neg then output is NM5. If error is Zero and change in error is Zero then output is Zero6. If error is Zero and change in error is Pos then output is PM7. If error is Pos and change in error is Neg then output is Zero8. If error is Pos and change in error is Zero then output is PM9. If error is Pos and change in error is Pos then output is PB

Two inputs with three values each (Neg, Zero, Pos) results in nine rules.Two inputs with two values each (Neg, Pos) results in four rules.

Page 9: Fuzzy Control

9

Choice of Connectives

)(),(max

)(),(minxxBAxxBA

BA

BA

)()()()()()(

xxxxBAxxBA

BABA

BA

minimum

maximum

product

probabilistic sum

Choose product and probabilistic sum, if you wish to achieve linearity.

Page 10: Fuzzy Control

10

Choice Of Primary Sets

Classical set

Singleton

Universal setTrapezoidalTriangular

An input family

Page 11: Fuzzy Control

11

Inference in a Fuzzy PD Controller

Input error enters here

Input change in error enters here

Membership of input error of this set

Membership of input change in error of this set

The AND of the two memberships is carried forward as a weight on the control signal singleton

All rules contribute, and the final control signal is the weighted average of the contributions from the rules.

Sugeno type of rule base with singleton outputs

Page 12: Fuzzy Control

12

Singleton Output

1. If error is Pos then control is 102. If error is Zero then control is 03. If error is Neg then control is -10

Equivalent to a singleton placed in the position -10 in the universe. It is simpler than a full membership function, and more intuitive too.

Page 13: Fuzzy Control

13

Sugeno Inference

1. If error is Pos then control is 102. If error is Zero then control is 03. If error is Neg then control is -10

Rule 3

Rule 2

Rule 1

The weighted average

Page 14: Fuzzy Control

14

First Order Output

1. If error is Large then control is a1*error + b1

2. If error is Small then control is a2*error + b2

The equation for a line L2, which depends on the coefficients a2 and b2.

Page 15: Fuzzy Control

15

Interpolation (Takagi-Sugeno)

Line 1

Line 2

Interpolant

Page 16: Fuzzy Control

16

Rule Base to Table

Choose discrete values, for instance one for every 10 %

Same

Calculate the result for every combination of the two inputs

Page 17: Fuzzy Control

17

Look-Up TableChange in error

-100 -50 0 50 100

Error

100 0 40 100 100 200

50 -40 0 61 121 160

0 -100 -61 0 61 100

-50 -100 -121 -61 0 40

-100 -200 -160 -100 -40 0

Five discrete points were chosen in each input universe, resulting in 25 pre-calculated values of the control signal

Page 18: Fuzzy Control

18

Control Surface

1. If E is Neg and CE is Neg then u = -2002. If E is Neg and CE is Pos then u = 03. If E is Pos and CE is Neg then u = 04. If E is Pos and CE is Pos then u = 200

Neg PosA mesh plot of the control table

Page 19: Fuzzy Control

19

Linear Rule Base

Page 20: Fuzzy Control

20

Linear Control Surface

Page 21: Fuzzy Control

21

Conditions For Linearity• Triangular sets, crossing at = 0.5• Rules: complete -combination• Define as multiplication (×)• Use conclusion singletons, positioned at sum of input

peak positions• Calculate the control signal as the weighted average

These five conditions settle many design choices. Very easy!

Page 22: Fuzzy Control

22

Summary Of Choices• Rule-base related choices (# of inputs and outputs,

rules, universes, continuous or discrete, # of membership functions, their overlap and width, singleton conclusions)

• Inference engine choices (connectives, modifiers)• Pre- and postprocessing (scaling, quantization, sampling

time)

Page 23: Fuzzy Control

23

ADVANCED SECTION*

Page 24: Fuzzy Control

24

Building Blocks

Fuzzy controller

Inferenceengine

Rulebase Defuzzi

-ficationPostpro-cessing

Fuzzi-fication

Prepro-cessing

Page 25: Fuzzy Control

25

Nonlinear Input Scaling

-5 0 5

-100

-50

0

50

100

measured input

scal

ed in

put

Page 26: Fuzzy Control

26

Relational Rule FormatError Change in error ControlPos Pos PBPos Zero PMPos Neg ZeroZero Pos PM Zero Zero ZeroZero Neg NMNeg Pos ZeroNeg Zero NMNeg Neg NB

Page 27: Fuzzy Control

27

Tabular Rule Format

Change in error

Neg Zero Pos

Neg NB NM Zero

Error Zero NM Zero PM

Pos Zero PM PB

Page 28: Fuzzy Control

28

Defuzzification

0 50 1000

0.5

1

RM

BOA

COGMOM

LM

Page 29: Fuzzy Control

29

FLS I/O Families

-1 -0.5 0 0.5 10

0.5

1

Input

Mem

bers

hip

-1 -0.5 0 0.5 10

0.5

1

Output

Mem

bers

hip

NegZero

Pos

Page 30: Fuzzy Control

30

Inference And TerminologyAND

Aggregation

Accumulation

Defuzzification

Activation

a 4

a 5

Page 31: Fuzzy Control

31

Rule Base To Table

Page 32: Fuzzy Control

32

Rule Based Controllers

1. If error is Neg then control is Neg2. If error is Zero then control is Zero3. If error is Pos then control is Pos

Page 33: Fuzzy Control

33

Mamdani Inference

-100 0 1000

0.5

1error

-100 0 1000

0.5

1control

-100 0 1000

0.5

1

-100 0 1000

0.5

1

-100 0 1000

0.5

1

-100 0 1000

0.5

1-100 0 1000

0.5

1

u = -25.7

Page 34: Fuzzy Control

34

FLS Inference

-100 0 1000

0.5

1error

-100 0 1000

0.5

1control

-100 0 1000

0.5

1

-100 0 1000

0.5

1

-100 0 1000

0.5

1

-100 0 1000

0.5

1-100 0 1000

0.5

1

u = -29.7

Page 35: Fuzzy Control

35

Simplification of 4 rules1. If error is Neg and change in error is Neg then control is NB3. If error is Neg and change in error is Pos then control is Zero7. If error is Pos and change in error is Neg then control is Zero9. If error is Pos and change in error is Pos then control is PB

PBPosPos CEEu )1(

is

Page 36: Fuzzy Control

36

Simplification of 9 rules1. If error is Neg and change in error is Neg then output is NB2. If error is Neg and change in error is Zero then output is NM3. If error is Neg and change in error is Pos then output is Zero4. If error is Zero and change in error is Neg then output is NM5. If error is Zero and change in error is Zero then output is Zero6. If error is Zero and change in error is Pos then output is PM7. If error is Pos and change in error is Neg then output is Zero8. If error is Pos and change in error is Zero then output is PM9. If error is Pos and change in error is Pos then output is PB

is

PBNegPosNegPos CECEEEu 21