self-ruled fuzzy logic based controller

25
Self-Ruled Fuzzy Self-Ruled Fuzzy Logic Logic Based Controller Based Controller K. Oytun Yapıcı K. Oytun Yapıcı Istanbul Technical University Istanbul Technical University Mechanical Engineering Mechanical Engineering System Dynamics and Control Laboratory System Dynamics and Control Laboratory

Upload: beau

Post on 11-Jan-2016

54 views

Category:

Documents


0 download

DESCRIPTION

Self-Ruled Fuzzy Logic Based Controller. K. Oytun Yapıcı Istanbul Technical University Mechanical Engineering System Dynamics and Control Laboratory. Presentation Outline. CONTROLLER STRUCTURE 1 – Mapping of Inputs to the Interval [0 1] 2 – Mapping of Outputs to the Interval [0 1] - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Self-Ruled Fuzzy Logic Based Controller

Self-Ruled Fuzzy LogicSelf-Ruled Fuzzy LogicBased ControllerBased Controller

K. Oytun YapıcıK. Oytun Yapıcı

Istanbul Technical UniversityIstanbul Technical University

Mechanical EngineeringMechanical Engineering

System Dynamics and Control LaboratorySystem Dynamics and Control Laboratory

Page 2: Self-Ruled Fuzzy Logic Based Controller

Presentation OutlinePresentation Outline

CONTROLLER STRUCTURE

1 – Mapping of Inputs to the Interval [0 1]

2 – Mapping of Outputs to the Interval [0 1]

3 – Obtaining the Output from the Controller

4 – The Rules Consisted Inherently in the Structure

5 – Weighting Filter

6 – Tuning of the Controller

APPLICATION EXAMPLE 1 – QUADROTOR

APPLICATION EXAMPLE 2 – INVERTED PENDULUM

APPLICATION EXAMPLE 3 – BIPEDAL WALKING

Page 3: Self-Ruled Fuzzy Logic Based Controller

INTRODUCTIONINTRODUCTION

Mapping of concept temperature to the interval [0 1] with membership functionsMapping of concept temperature to the interval [0 1] with membership functions

verycold

45 60

1

0

cold warm hot

70 75 85 95 105 115

very hot

(°C)

Page 4: Self-Ruled Fuzzy Logic Based Controller

Mapping of Inputs to the Mapping of Inputs to the Interval [0 1]Interval [0 1]

1

very cold

0.5

(°C)45 60

1

0

cold

warm

hot

very hot

70 75 85 95 105 115

• Concepts are modelled as a whole with one curve.

• Logical 0 and logical 1 are assigned to the poles of the concepts, hence there can be two possible mappings.

Mapping of concept temperature to the interval [0 1]Mapping of concept temperature to the interval [0 1]

(°C)

verycold

0.5

45 60

1

0

cold

warm

hot

very hot

70 75 85 95 105 115

• The shape of the curves will be in the form of increasing or decreasing.

Page 5: Self-Ruled Fuzzy Logic Based Controller

Mapping of Outputs to the Mapping of Outputs to the Interval [0 1]Interval [0 1]

2

(V)

• There are not any horizontal lines at the output curve hence the controller output will be unique.

Mapping of voltage to the interval [0 1]Mapping of voltage to the interval [0 1]

0.5

-12

1

0

120

PB

PM

PN

NM

NB

Page 6: Self-Ruled Fuzzy Logic Based Controller

Obtaining the Output from the Obtaining the Output from the ControllerController

3

• Every input is intersected with the curve assigned to it and obtained values are conciliated by taking the arithmetic average.

1

0

0.5

0

1

0.5

b

a

2

1 U1 U2

(a+b)/2

U

• Obtained single logical value is intersected with the output curve which will yield the corresponding output value assigned to this logical value.

Input 2Input 2

Input 1Input 1

OutputOutput

OutputOutput

• The procedure is same in case of there are more than two inputs.

Page 7: Self-Ruled Fuzzy Logic Based Controller

The Rules Consisted Inherently in The Rules Consisted Inherently in the Structurethe Structure

4

Change in ErrorChange in Error

1

NB

PB

Z

0

0.5

ErrorErrorN

P

Z0.5

0

1

OutputOutput

OutputOutput

0.5

1

1

0

0

-60 -40 0 90 0 1-1

-1 0 1-20 0 20

60

PM

NM

-90 40

0.5

PM

P

NM

N

• If the error is PB [1] and the change in error is N [1] then the output will be P [1]• If the error is NB [0] and the change in error is N [1] then the output will be Z [0.5]• If the error is Z [0.5] and the change in error is Z [0.5] then the output will be Z [0.5]• If the error is Z [0.5] and the change in error is N [1] then the output will be PM [0.75]

Page 8: Self-Ruled Fuzzy Logic Based Controller

Weighting FilterWeighting Filter

5

IF the change in error is POSITIVE THEN reduce the importance of the error

Change in ErrorChange in Error

U1

1

NB

PB

Z

0

0.5

ErrorError

N

P

Z0.5

0

1

OutputOutput

OutputOutput

0.5

1

1

0

0

-60 -40 0 90 0 1-1

-1 0 1-20 0 20

10

0

1Input 1

Input 2

0.1

WeightingWeightingFilterFilter

U2 U1

0.8

U

0.4

(0.1*0.8+0.4)/(1+0.1)

60

PM

NM

-90 40

Page 9: Self-Ruled Fuzzy Logic Based Controller

Tuning of the ControllerTuning of the Controller

6

1

0

-10 100

1

0

-10 100

0

1

010

-10

0

1

0.5

010

-10

0.5

0.5

1

0

-10 100

0.5

0

1

0.5

010

-10

Tuning of the Inputs Tuning of the Output

1

0

-5 50

0.5

1

0

-5 0 5

-5 0

0

1

0.5

0.5

5

P

N

Z

PZN

N

P

PMNM

Z

PN Z PMNM

P

PM

NM

N

Z

PN NM PMZ

Proposed FLCProposed FLC Conventional FLCConventional FLC

Page 10: Self-Ruled Fuzzy Logic Based Controller

Application Example 1 - QuadrotorApplication Example 1 - Quadrotor

7

X

Z

Y

θ

Total Thrust

Fx

Fz

Rotate RightRotate RightRotate LeftRotate Left Move RightMove Right Going UpGoing Up

• Angular motions will be controlled with 3 SRFLCs, X and Y motion will be controlled through the angles θ and ψ with 2 SRFLCs, Z motion will be controlled with 1 SRFLC.

1

2

34

y

x

z

Force to moment scaling factor

: Propeller Forces

Page 11: Self-Ruled Fuzzy Logic Based Controller

Application Example 1 - QuadrotorApplication Example 1 - Quadrotor

8

eZ, deZ

In1e

de

eY, deY

In1e

de

eX, deX

In1e

de

eT , deT

In1e

de

ePsi, dePsi

In1e

de

ePhi , dePhi

In1e

de

Z desired

Signal 1

Z FLC

e

deU1fcn

Y desired

Signal 1

Y FLC

e

depsifcn

X desired

Signal 1

X FLC

e

dethetafcn

Theta FLC

e

deU2fcn

Saturation

Quadrotor Model

X

Y

Z

psi

theta

phi

U1

U2

U3

U4

Psi FLC

e

deU3fcn

Phi desired

Signal 1

Phi FLC

e

deU1fcn

Page 12: Self-Ruled Fuzzy Logic Based Controller

Z Controller StructureZ Controller Structure

9

INPUTSINPUTS OUTPUTOUTPUT

ErrorError

Change in ErrorChange in Error

CONTROL SURFACECONTROL SURFACE

-1

-0.5

0

0.5

1

e-2

0

2

de

-50

0

50

U1

-1

-0.5

0

0.5

1

e

-50

0

50

U1

Page 13: Self-Ruled Fuzzy Logic Based Controller

X and Y Controller StructureX and Y Controller Structure

10

INPUTSINPUTS OUTPUTOUTPUT

ErrorError

Change in ErrorChange in Error

CONTROL SURFACECONTROL SURFACE

-1

-0.5

0

0.5

1

e

-2

-1

0

1

2

de

-1

-0.5

0

0.5

1

theta ,psi

-1

-0.5

0

0.5

1

e

-1

-0.5

0

0.5

1

theta ,psi

Page 14: Self-Ruled Fuzzy Logic Based Controller

θθ and and ψψ Controller Structure Controller Structure

11

INPUTSINPUTS OUTPUTOUTPUT

ErrorError

Change in ErrorChange in Error

CONTROL SURFACECONTROL SURFACE

-2

0

2

e

-4

-2

0

2

4

de

-500

0

500

U2,U3

-2

0

2

e

-500

0

500

U2,U3

Page 15: Self-Ruled Fuzzy Logic Based Controller

ΦΦ Controller StructureController Structure

12

INPUTSINPUTS OUTPUTOUTPUT

ErrorError

Change in ErrorChange in Error

CONTROL SURFACECONTROL SURFACE

-1

-0.5

0

0.5

1

e-2

0

2

de

-2000

0

2000

U4

-1

-0.5

0

0.5

1

e

-2000

0

2000

U4

Page 16: Self-Ruled Fuzzy Logic Based Controller

Rule BasesRule Bases

13

-1

-0.5

0

0.5

1

e-2

0

2

de

-50

0

50

U1

-1

-0.5

0

0.5

1

e

-50

0

50

U1

-1

-0.5

0

0.5

1

e

-2

-1

0

1

2

de

-1

-0.5

0

0.5

1

theta ,psi

-1

-0.5

0

0.5

1

e

-1

-0.5

0

0.5

1

theta ,psi

-2

0

2

e

-4

-2

0

2

4

de

-500

0

500

U2,U3

-2

0

2

e

-500

0

500

U2,U3

-1

-0.5

0

0.5

1

e-2

0

2

de

-2000

0

2000

U4

-1

-0.5

0

0.5

1

e

-2000

0

2000

U4

-1 -0.5 0 0.5 1

e

-2

0

2

de

-50050U1

-1 -0.5 0 0.5 1-2

-1

0

1

2-1-0.500.51

-2 0 2-4

-2

0

2

4-5000500

-1 -0.5 0 0.5 1

-2

0

2

-1-0.500.51

White – Strictly PB output

Black – Strictly NB output

Gray – Strictly Z output

Page 17: Self-Ruled Fuzzy Logic Based Controller

Quadrotor Simulation 1Quadrotor Simulation 1

14

x

yz

Page 18: Self-Ruled Fuzzy Logic Based Controller

Quadrotor Simulation 2Quadrotor Simulation 2

15

x

yz

Page 19: Self-Ruled Fuzzy Logic Based Controller

Application Example 2 – Inverted Application Example 2 – Inverted PendulumPendulum

16

0 - 1

0.5Positive

Region

Negative

Region

Positive

Region

Negative

Region

F

• Logical 1 and Logical 0 are assigned to the same angle of the pendulum. Hence the controller will lock up at the angle ±pi.

• There is a logical switch point at angle ±pi which must be considered.

Self -RuledFuzzy Logic Controller

x

xdot

theta

thetadot

outputFLC

Saturation

Reference

-9

Logical Switching

inout PA

Inverted Pendulum

U

Cart

Pendulumdu /dt

du /dtAdd

Page 20: Self-Ruled Fuzzy Logic Based Controller

Application Example 2 – Inverted Application Example 2 – Inverted PendulumPendulum

17

INPUTSINPUTS OUTPUTOUTPUT

Distance error

Velocity error

Pendulum angle error

Pendulum angular velocity error

WEIGHTING FILTERSWEIGHTING FILTERS

distance weight velocity weight

IF the pendulum angle or angular velocity is PB-NB

THEN reduce the importance of the distance

error and velocity error

Page 21: Self-Ruled Fuzzy Logic Based Controller

Inverted Pendulum Simulation 1Inverted Pendulum Simulation 1

18

θ0=0.9rad , Xd=-9m , Fmax=10N

Page 22: Self-Ruled Fuzzy Logic Based Controller

Inverted Pendulum Simulation 2Inverted Pendulum Simulation 2

19

θ0=3rad , Xd=-9m , Fmax=10N

Page 23: Self-Ruled Fuzzy Logic Based Controller

Inverted Pendulum Simulation 3Inverted Pendulum Simulation 3

20

Xd=Sinusoidal Amp=9m , Fmax=10N , Disturbance(±1N) , Noise(±0.1rad)

Page 24: Self-Ruled Fuzzy Logic Based Controller

Application Example 3 – Bipedal Application Example 3 – Bipedal WalkingWalking

21

Angle error

Angular velocity error

du

1/s

+

+SRFLC Torqueu

Page 25: Self-Ruled Fuzzy Logic Based Controller

CONCLUSIONCONCLUSION

• Obtaining the output from the controller is computationally efficient.

• The controller has guaranteed continuity at the output.

• Due to the simple and systematic nature of the structure applications with multi-input controllers will be easier.

• The structure may not be as flexible as conventional FLCs.

• The controller can be tuned with a trial and error method however there is a need to make the controller adaptive.

THANKS FOR YOUR ATTENTIONTHANKS FOR YOUR ATTENTION