Fuzzy Control and Fuzzy Decision for Practical Human ...

37
Fuzzy Control and Fuzzy Decision for Practical Human-Friendly System Seiji YASUNOBU University of Tsukuba [email protected] SCIS&ISIS 2014@Kitakyushu

Transcript of Fuzzy Control and Fuzzy Decision for Practical Human ...

Page 1: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control and Fuzzy Decision for

Practical Human-Friendly System

Seiji YASUNOBUUniversity of Tsukuba

[email protected] SCIS&ISIS 2014@Kitakyushu

Page 2: Fuzzy Control and Fuzzy Decision for Practical Human ...

Outline・History of fuzzy control and feature of fuzzy set

1) Fuzzy control (FC)

An easy non-linear control element as enhancing

the linear PD control.

・Single/Double pendulum control

2) Fuzzy decision (Predictive fuzzy control (PFC) )

Decides gentle human-friendly operation

・Automatic train operation (ATO) system

[email protected] SCIS&ISIS 2014@Kitakyushu [2]

Page 3: Fuzzy Control and Fuzzy Decision for Practical Human ...

History of Fuzzy Control

[email protected] SCIS&ISIS 2014@Kitakyushu[3]

•Automatic Train Operation System

'80

'85

'95

'90

Predictive Fuzzy Control

Home Appliance•Washing Machine•Video Cameras•Air Conditioner

Sendai Subway in Practical Use

Process Control•Iron Plant•Gas Plant

'65

'70

Fuzzy Logic Control(Mamdani)(State Evaluate)

•Steam Engine•Cement Kiln Plants

Linguistic Variable, Fuzzy If-Then rule (Zadeh)

Water Purification Process

2nd IFSA in Tokyo

Machine Control•Automobile•Robot

‘89

Japan

Fuzzy Set was proposed by Prof. Zadeh (UCB)

2000

‘05

‘87

‘10

Design Support System•Fuzzy tool box / MATLAB

Control & Support for Human Life With Prof. Zadeh (2011)‘15

Page 4: Fuzzy Control and Fuzzy Decision for Practical Human ...

The fuzzy set treats a grade of membership with the computer

[email protected] SCIS&ISIS 2014@Kitakyushu [4]

Comfort is true(1)

Label

Comfort is false(0)

Crisp Set

Hot

00 10 20 30 40

Comfort

Room Temperature ℃

25℃

25.1℃

Cool

Label & Grade of Membership

Comfort is 0.70

Comfort is 0.65

Fuzzy Set

1.0

0.00 10 20 30 40

Cool Comfort

Room Temperature ℃

25℃

25.1℃

Hot

In the case, “Room temperature is 25 ℃”,

a grade of comfort is 0.7 and a grade of hot is 0.8.

μ

Page 5: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Reasoning Achieves a Flexible Functionwith The Computer

[email protected] SCIS&ISIS 2014@Kitakyushu[5]

Page 6: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control & DecisionControl know-how : Skilled human operator

Control engineer, Control theory

Algorithm: fuzzy sets and If-then & Do-if rules

(1) Fuzzy Control

Observed system states → Control command

• Water Level Control

• Pendulum, Swing Up and Stabilize

[email protected] SCIS&ISIS 2014@Kitakyushu [6]

Page 7: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control by Linguistic Variable (1)

[email protected] SCIS&ISIS 2014@Kitakyushu [7]

Page 8: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control by Linguistic Variable (2)

[email protected] SCIS&ISIS 2014@Kitakyushu [8]

Page 9: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control for Water Tank(1)*

[email protected] SCIS&ISIS 2014@Kitakyushu [9]

If level is * and rate is * then valve is *.

okay

okay

okay

low

high

charge

positive

negative

close

discharge

small charge

small discharge

Output “charge”

Input-Outputlevel x

XT

+ ー

dx/dt Reasoning

Valve

No accurate model

*Demo of fuzzy toolbox MATLAB by the MathWorks, Inc.

Page 10: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control for Water Tank(2)

[email protected] SCIS&ISIS 2014@Kitakyushu [10]

FuzzyControlWRule

yasutank_FLC with Ruleviewer

tank max

inflow

0.5

tank 2

WATER

TANK

error

change

scope

change

XY Graph

Sum1

Subsystem

VALVE

Signal

Generator

Scope4

Scope2

Scope1

S-Function

animtank

PID

Controller

PID

Mux2

Mux

Mux1

Mux

Manual Switch

Derivative

du/dt

Constant

1

-1

0

1

-0.1

0

0.1

-0.5

0

0.5

levelratevalveFuzzy control is a non-linear control element.

However, a flexible design is difficult.

Page 11: Fuzzy Control and Fuzzy Decision for Practical Human ...

Simplified Fuzzy Inference[Feature]

Fuzzy Control by Linguistic Variable,

Enhancing the linear function Ex: y = a*x1 + b*x2,

And, it can be freely transformed.

[Rule form]

If-part: Triangle fuzzy sets

(Linear interpolation)

Then-part: Real number rmExample of rules for N-input, 1-output.

R1: if x1 is F11 and x2 is F12 and ・・ and xN is F1N then y=r1.

RM: if x1 is FM1 and x2 is FM2 and ・・ and xN is FMN then y=rM.

[email protected] SCIS&ISIS 2014@Kitakyushu [11]

-1.0 0.0

μ

1.0

0.0

NB NM ZO PM PB

1.0-0.5 0.5

0.50.25

Page 12: Fuzzy Control and Fuzzy Decision for Practical Human ...

Inference process of simplified fuzzy inference

b22

a11

b11

0.0

1.0

X1 r10.0

1.0

Y

r2

推論結果:y

0.0

1.0

r1

a12

b120.0

1.0

X2

a21

b21

0.0

1.0

X1 r20.0

1.0

a220.0

1.0

X2 Y

Y

x1 x2

p11

p21

p12h1= p11*p12

h1

h2

p22h2=p21*p22

y = h1 + h2

h1*r1+h2*r2

If x1 is F11 and x2 is F12 then y = r1

If x1 is F21 and x2 is F22 then y = r2

[email protected] SCIS&ISIS 2014@Kitakyushu [12]

At fuzzy tool box of MATLAB

FIS Type: sugeno

And.method : Prod

Or.method: Max

Defuzzification: Wtsum

Output variable :Constant

Output: y

Page 13: Fuzzy Control and Fuzzy Decision for Practical Human ...

Input range[-1.0,1.0]

Fuzzy Inference Rules(3x3)Fuzzy rules for y = 0.5*x1 + 0.5*x2.

Each input x1,x2 have 3 fuzzy sets N, Z, and P.

Nine(9=3x3) rules are prepared.

[email protected] SCIS&ISIS 2014@Kitakyushu [13]

x10-1.0 1.0

x2

(R1)-1.0

0

1.0

(R2)

(R3)

(R4)

(R5)

(R6)

(R7)

(R8)

(R9)

Rule (R2) If x1 is N and x2 is Z,Center values of input: x1=-1.0, x2=0.0y = 0.5*(-1.0)+0.5*0.0 = -0.5.

Therefore, y = -0.5.

(R1) if x1 is N and x2 is N then y = -1.0(R2) if x1 is N and x2 is Z then y = -0.5(R3) if x1 is N and x2 is P then y = 0.0(R4) if x1 is Z and x2 is N then y = -0.5(R5) if x1 is Z and x2 is Z then y = 0.0(R6) if x1 is Z and x2 is P then y = 0.5(R7) if x1 is P and x2 is N then y = 0.0(R8) if x1 is P and x2 is Z then y = 0.5(R9) if x1 is P and x2 is P then y = 1.0

0.0

μ

1.0

0.0

N Z P

-1.0 1.0

0.50.5

Page 14: Fuzzy Control and Fuzzy Decision for Practical Human ...

The Fuzzy Control has the ability of Linear PD control: u=0.5・x+0.5・dx.

[email protected] SCIS&ISIS 2014@Kitakyushu [14]

・ Rule view and Surface view of fuzzy toolbox MATLAB by the MathWorks, Inc.

Page 15: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Inference Rules(5x5)

(R1) if x1 is N1 and x2 is N1 then y = -1.0.

(R2) if x1 is N1 and x2 is N.5 then y = -0.5.

(R3) if x1 is N1 and x2 is Z then y = 0.0.

(R4) if x1 is N1 and x2 is P.5 then y = 0.5.

(R5) if x1 is N1 and x2 is P1 then y = 1.0.

:

(R13) if x1 is Z and x2 is Z then y = 0.0.

:

(R24) if x1 is P1 and x2 is P.5 then y = 0.5.

(R25) if x1 is P1 and x2 is P1 then y = 1.0.

[email protected] SCIS&ISIS 2014@Kitakyushu [15]

x1-1.0 1.0

x2

(R1)-1.0

0

1.0

0.0

μ1.0

0.0

N1 Z P1

-1.0 1.00.5-0.5

Fuzzy rules for y = 0.5*x1 + 0.5*x2.

Each input x1, x2, there are 5 fuzzy sets

N1, N.5, Z, P.5 and P1.

25(=5x5) rules are prepared.

0

(R2)

(R3)

(R4)

(R5)

(R6)

(R7)

(R8)

(R9)

(R10)

(R11)

(R12)

(R13)

(R25)

(R24)

N.5 P.5

x1

(R14) (R19)

Inputx1=0.3,x2=0.2

From (R13)(R14)(R18)(R19)

Output: y = 0.25

From 25 rules, moreover, 49(7x7), 121(11x11),output value is calculated by adjacent 4 rules. => Low calculation cost

(R18)

Page 16: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control (Multi-input, 1 output)

[email protected] SCIS&ISIS 2014@Kitakyushu [16]

-1-0.5

00.5

1

-1-0.5

00.5

1-1

-0.5

0

0.5

1

入力 x1

入力 x2

出力 y

Input:x1

Input:x2

Output:y

Fuzzy sets IF-then rulesIf x1 is P, x2 is N then y = 0.0.

If x1 is P, x2 is P then y = 1.0.

:

-1

0

1

-0.1

0

0.1

-0.5

0

0.5

levelrate

valve

Linear and Non-linear

Control elementFuzzy control enhancing

the linear PD control.

0.0

1.0

X-1.0 0.0 1.0

0.5

μ

Page 17: Fuzzy Control and Fuzzy Decision for Practical Human ...

1

2

4

3

Intelligent Control Based on Human Knowledge

- Pendulum, Swing Up and Stabilize -

Acquirement of knowledge for the system which is difficult

to operate in real-time.

Step2 Constructing the

control system based on

operating knowledge

Step3 Simulation Step4 Actual experiment

Step1 Acquirement of operating knowledge

Operating the model on computer at extended simulation-time

The method for development of the intelligent control system

[email protected] SCIS&ISIS 2014@Kitakyushu

[17]

Page 18: Fuzzy Control and Fuzzy Decision for Practical Human ...

Intelligent Control Based on Human Knowledge(1)

- Single Pendulum, Swing Up and Stabilize -

[email protected] SCIS&ISIS 2014@Kitakyushu [18]

Stabilize

Swing Up

24cm

Sampling interval:10ms

Control instruction:-10V~+10V

“If the pendulum is standing, moves the cart in the

direction that pendulum seems to fall.”

“If the pendulum is hanging, moves the cart in opposite

direction of the pendulum.”

[Linguistic Rules ]

Page 19: Fuzzy Control and Fuzzy Decision for Practical Human ...

2nd pendulum

1st pendulum

cart

"Swing Up Intelligent Control of Double Inverted Pendulum Based on Human Knowledge", Proc. of SICE Annual Conference 2004 in Sapporo, pp.1869-1873, 2004.

Intelligent Control Based on Human Knowledge(2)

- Double Pendulum -

[email protected] SCIS&ISIS 2014@Kitakyushu [19]

Controller

Human

or

Pendulum

Pendulum

au Fx

u

2

1 2nd

1st

x x

1, 1

2, 2

,

.

.

.

xController

Human

or

Pendulum

Pendulum

au Fx

u

2

1 2nd

1st

x x

1, 1

2, 2

,

.

.

.

x

Double Pendulum

• Suitable Control by Judging state of Double Pendulum

Page 20: Fuzzy Control and Fuzzy Decision for Practical Human ...

Step1:Acquirment of Operating Knowledge

[email protected] SCIS&ISIS 2014@Kitakyushu [20]

SimMechanics(The Math Works Inc.).

2 2

2 1 21 2

2 211 1 1 1

2 2 2

[{ ( sin )} { ( cos )} ]2

M J JT x

m d dx l l

dt dt

No equation

Step2:

Configuration of Control System

Operation by joystick

The model is constructed on computer

Operation by input with joystick many times

at extended simulation-time

• Moment of Inertia

• Mass of 1st & 2nd Pendulum

• Center of Mass etc

Page 21: Fuzzy Control and Fuzzy Decision for Practical Human ...

Step3:Simulation

Step4:Actual experiment

Step3:Simulation → Step4:Actual experiment

[email protected] SCIS&ISIS 2014@Kitakyushu

[21]

exp1

exp2

Simulation

Swing Up and Stabilize for Double Pendulum

Page 22: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Control & DecisionControl know-how : Skilled human operator

Control engineer, Control theory

Algorithm: fuzzy sets and If-then & Do-if rules

(2) Fuzzy Decision (Predictive Fuzzy Control)

System purpose → Good operation

• Automatic Focusing Camera

• Automatic Train Operation

• Automatic Car-Drive & Support

[email protected] SCIS&ISIS 2014@Kitakyushu [22]

Page 23: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Decision, Selection.(Predictive Fuzzy Control )

[email protected] SCIS&ISIS 2014@Kitakyushu [23]

Rule 1: Do u=c1, if X(c1) is Good and Y is Big.

Rule n: Do u=cn, if X(cn) is Very Good and Y is Small.

Rule N: Do u=cN, if X(CN) is Very Good and Y is Medium.

c1cncN

X(c1)X(cn)X(cN)

c*

Y

ControlAlternatives

Good Control

c1 cn cN

Page 24: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Decision for Automatic Focusing Camera

(With no system model)

[email protected] SCIS&ISIS 2014@Kitakyushu [24]

Control Rules

1. Do Focus on Left, if Left is Near.

:

n. Do Focus on Center, if Left is far & Center is medium & Right is near.

Focus on Right

Focus on LeftCenter

Right

Good focus

Page 25: Fuzzy Control and Fuzzy Decision for Practical Human ...

Intelligent Control for Real Train

Do accelerate, If the speed will be slow.

Do brake, If the speed will be fast.

Gentle control by soft rules

X in

Y out

y

x

Fuzzy inference

Control

purpose

Intelligent (soft)

control system

Formulate

Controlled

train

Instruction

Control

knowledge

Sendai subway (since 1987)

State X

Train

model

Fuzzy set

1.0

0.0

μ0.3

slow

Speed

Compute using human’s word

The intelligent control achieves human’s good train operation. [25]yasunobu [a] iit.tsukuba.ac.jp SCIS & ISIS 2014@Kitakyushu

Page 26: Fuzzy Control and Fuzzy Decision for Practical Human ...

Purpose of Train Operation

[email protected] SCIS&ISIS 2014@Kitakyushu [26]

・Acceleration to Target Speed

・Keeping a Target Speed

・Stopping Accurately at Target Position

Page 27: Fuzzy Control and Fuzzy Decision for Practical Human ...

Automatic Train Operation by PID Control(Conventional Control)

[email protected] SCIS&ISIS 2014@Kitakyushu[27]

Page 28: Fuzzy Control and Fuzzy Decision for Practical Human ...

Performance is defined by the fuzzy sets

(Ex: Stop Accuracy)

[email protected] SCIS&ISIS 2014@Kitakyushu[28]

0.5m-0.5m

In the case “Stopping error is 0.2m”,

a grade of Good Stop is 1.0

a grade of Very Good Stop is 0.6.

Page 29: Fuzzy Control and Fuzzy Decision for Practical Human ...

Train Dynamics ModelPredict Performances from

Control Alternative and Train States

[email protected] SCIS&ISIS 2014@Kitakyushu[29]

: Control AlternativeNp

: Current Control CommandtN

: Train Accelerationt

: Train Speedtv

: Train Positiontx

Train ModelMotor, Brake, ..

+ ( )tv Np TPredicted Train Speed

( )p p t Tv N

0

Predicted Stop Position

( )p p vx N

Predicted Running Time

Tz

2

2 ( )

tv

Np

-T t

t

x x

v

Page 30: Fuzzy Control and Fuzzy Decision for Practical Human ...

Fuzzy Decision (PFC) Rules

From Human Know-how

[email protected] SCIS&ISIS 2014@Kitakyushu [30]

Example: The rule for accurate stopping

Do the control command is changed by n steps, ⇒ Do ΔN is n,

if if

・Riding comfort is “Good” ⇒ Riding comfort is good

・”No” Running time margin ⇒ Running time is good

・Stopping seems to be done with “Very good”. ⇒ Stop gap is very good.

[TASC Predictive Fuzzy Control Rules]

(T-1) Do N is B7+, if Safety is very bad. (Emergency brake)

(T-2) Do N is B7, if Safety is bad. (Maximum brake)

(T-3) Do N is P7, if Riding comfort is good, and Running time is long.

(T-4) Do N is P4, if Riding comfort is good, and Running time is short.

(T-5) Do N is P0, if Riding comfort is good, and Running time is medium.

(T-6) Do N is B2, if Riding comfort is good, and Running time is good.

(T-7) Do ΔN is 0, if Running time is good, and Stop gap is good.

(T-8,12) Do ΔN is n, if Riding comfort is good, and Running time is good,

and Stop gap is very good. (n= ±1, ±2, ±3)

Page 31: Fuzzy Control and Fuzzy Decision for Practical Human ...

Predictive Fuzzy Control for Stopping Control

[31][email protected] SCIS&ISIS 2014@Kitakyushu

Page 32: Fuzzy Control and Fuzzy Decision for Practical Human ...

Operate trains as skillfully as expert operators

[email protected] SCIS&ISIS 2014@Kitakyushu [32]

Sendai subway,Tokyo metro,..

In Practical Use, Since 1987.ATOvideo

ATO & ATP controllers

Page 33: Fuzzy Control and Fuzzy Decision for Practical Human ...

Result of Real Train

[email protected] SCIS&ISIS 2014@Kitakyushu [33]

Run

Do accelerate, If the speed will be slow, comfort.Do hold, If the speed will be good, safety, (comfort).Do brake, If the speed will be fast, comfort.

:

Page 34: Fuzzy Control and Fuzzy Decision for Practical Human ...

Summary of Field Test Results(Stopping Accuracy)

[email protected] SCIS&ISIS 2014@Kitakyushu [34]

2,000

1,500

1,000

500

-50cm 0 +50cmStop Gap

Frequency Number of Trials 11,395

Average +3.57 cm

Standard Deviation 10.61 cm

StopFuzzy ATO achieved a comfortable(no shock), accurate stop and short driving time.

Page 35: Fuzzy Control and Fuzzy Decision for Practical Human ...

Auto-driving by Fuzzy Decision(PFC)

[email protected] SCIS&ISIS 2014@Kitakyushu [35]

⇒ Output the best control instruction

Target

Current

Position

u=C1

u=C3

Wall

u=C2

Distance to wall

u=C0(Keep current operation)

Future States

Error to target

Seiji Yasunobu, Ryota Sasaki: Intelligent Auto-Driving System for an Electric Four-Wheeled Cart,

Proceedings of SCIS & ISIS 2004( TUP-4-1), pp.1-4 (2004), (IEEE-FUZZ'94)

Keep

Center

Turn RightTurn Left

C1 C0 C3C2

Good Operation

Automatic parking control

Page 36: Fuzzy Control and Fuzzy Decision for Practical Human ...

Car-driving by Intelligent Fuzzy Support

[email protected] SCIS&ISIS 2014@Kitakyushu [36]

Guidance

member

Driver(Supported person)

State

Operation

Support for a cart Operation

Support for a real vehicleOperation

SimulationAutomatic parking control

(IEEE-FUZZ'94 - SCIS&ISIS2004) (IEEE-CIRA2003)

(IEEE-SMC2004)

Keep

Center

Turn RightTurn Left

C1 C0 C3C2

Good Operation

Page 37: Fuzzy Control and Fuzzy Decision for Practical Human ...

Summary・The fuzzy set can handle man's concept with the computer

1) The fuzzy control (FC) method

• An easy non-linear control element as enhancing the

linear PD control

• Low calculation cost by Simplified FC

2) Fuzzy decision (Predictive fuzzy control (PFC)) method

Decides gentle human-friendly operation for practical

system.

• Automatic train operation (ATO) system

• Drive support for four-wheel car

[email protected] SCIS&ISIS 2014@Kitakyushu [37]

If I (system) wasn‘t hard, I (system) wouldn’t be alive. If I (system) couldn‘t ever be

gentle, I (system) wouldn’t deserve to be alive. “By Raymond Chandler”