Mapping of Inputs to the Interval [0 1]

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]
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
INTRODUCTION
Mapping of concept temperature to the interval [0 1] with membership functions
very
cold
cold
warm
hot
very
hot
1
0
45
60
70 75
85
95 105 115
(°C)
Mapping of Inputs to the Interval [0 1]
Mapping of concept temperature to the interval [0 1]
very hot
very cold
1
1
cold
hot
warm
warm
0.5
0.5
cold
hot
very hot
0
0
45
60
70 75
85
95 105 115
(°C)
very
cold
45
60
70 75
85
95 105 115
(°C)
• 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.
• The shape of the curves will be in the form of increasing or decreasing.
1
Mapping of Outputs to the Interval [0 1]
Mapping of voltage to the interval [0 1]
PB
1
PM
0.5
P
N
NM
0
NB
-12
0
12 (V)
• There are not any horizontal lines at the output curve hence the controller output will be unique.
2
Obtaining the Output from the Controller
1
a
0.5
0
2
Output
Input 2
1
0.5
(a+b)/2
b
0
1
Input 1
U1
U
U2
Output
• Every input is intersected with the curve assigned to it and obtained values are conciliated by taking
the arithmetic average.
• Obtained single logical value is intersected with the output curve which will yield the corresponding
output value assigned to this logical value.
3
• The procedure is same in case of there are more than two inputs.
The Rules Consisted Inherently in the Structure
PB
1
Z
PM
NM
0.5
P
1
NM
0.5
PM
NB
0
-90 -60 -40 0 40 60 90
1
N
0 N
-1
0
1
Output
Error
1
Z
0.5
0.5
P
0
0
-20
0
20
Change in Error
4
-1
0
Output
• 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]
1
Weighting Filter
PB
1
Z
1
PM
0.8
0.5
NM
0.5
NB
0
0
-90
-60 -40
0
40 60 90
-1
0
Error
U1
1
Output
Input 1
N
1
1
Z
0 0.1
1
1
(0.1*0.8+0.4)/(1+0.1)
0.5
0.4
P
0
0
-20
0
Change in Error
Input 2
0
20
-1
Weighting
Filter
U2 U
0
U1
1
Output
IF the change in error is POSITIVE THEN reduce the importance of the error
5
Tuning of the Controller
Tuning of the Inputs
Proposed FLC
Conventional FLC
P
N
1
N
0
10
10
0
N
NM Z PM
P
PM
N
-10
0
10
10
0
N
NM Z PM
P
Z
0.5
NM
N
0
10
0
5
-5
0
5
0.5
0.5
0
-10
-5
1
1
PM
5
0
0
-10
P
1
0
0.5
0.5
NM
-5
1
1
0.5
-10
0
0
-10
P
Z
6
1
0.5
1
0
P
Z
-10
0
Z
1
0.5
0
Tuning of the Output
0
0
10
Application Example 1 - Quadrotor
Z
Fz
Total Thrust
θ
Fx
X
Y
• 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.
Force to moment scaling factor
: Propeller Forces
1
x
2
y
z
4
3
7
Rotate Left
Rotate Right
Move Right
Going Up
Application Example 1 - Quadrotor
e
Signal 1
fcn U 1
de
e
theta
fcn
de
X desired
X FLC
Y desired
Signal 1
Phi desired
fcn U 2
Y FLC
U2
Z
psi
e
fcn U 3
In1
de
de
Y
Theta FLC
e
fcn psi
eY , deY
de
eT , deT
e
In1
de
e
de
In1
de
eX , deX
e
Signal 1
Saturation
Z FLC
e
e
In1
U1
de
eZ, deZ
Z desired
Signal 1
X
e
In1
ePsi, dePsi
de
Psi FLC
e
e
de
de
fcn U 1
In1
ePhi , dePhi
U3
theta
U4
phi
Phi FLC
Quadrotor Model
8
Z Controller Structure
INPUTS
OUTPUT
Error
CONTROL SURFACE
50
U1
0
-50
2
1
0.5
0
9
Change in Error
0
de
-0.5
-2
-1
e
X and Y Controller Structure
INPUTS
OUTPUT
Error
CONTROL SURFACE
1
0.5
theta ,psi
0
-0.5
-1
2
1
1
0.5
0
0
10
Change in Error
de
-1
-0.5
-2
-1
e
θ and ψ Controller Structure
INPUTS
OUTPUT
Error
CONTROL SURFACE
500
U2 ,U3
0
-500
4
2
2
0
0
11
Change in Error
de
-2
-2
-4
e
Φ Controller Structure
INPUTS
OUTPUT
Error
CONTROL SURFACE
2000
U4
0
-2000
2
1
0.5
0
0
de
12
Change in Error
-0.5
-2
-1
e
Rule Bases
1
500
50
2000
0.5
U1
0
theta ,psi
0
U2 ,U3
0
U4
-0.5
-1
-50
2
2
4
1
1
1
0.5
de
-0.5
-2
de
-1
e
-0.5
0.5
de
0
-2
-2
-2
-1
de
e
-0.5
0.5
-1
10
2
-500
50004
1
2
0
0
-1
-2
-0.5
0.5
-1
0
1
2
0
0
-2
-2
-2
-1
-0.5
0
0.5
1
-4
-1
-0.5
0
0.5
1
-2
e
White – Strictly PB output
Black – Strictly NB output
Gray – Strictly Z output
13
e
-1
2
de
-0.5
-2
-4
-1
-50
500
0
0
e
1
2
0
0
0
2
2
0.5
0
0
U1
0
-2000
-500
0
2
-1
-0.5
0
0.5
1
Quadrotor Simulation 1
14
z
y
x
Quadrotor Simulation 2
15
z
y
x
Application Example 2 – Inverted Pendulum
Negative
Positive
Region
Region
Negative
Positive
0.5
Region
Region
F
0-1
• There is a logical switch point at angle ±pi which must be considered.
• Logical 1 and Logical 0 are assigned to the same angle of the pendulum. Hence the
controller will lock up at the angle ±pi.
x
Cart
-9
Reference
Add
du /dt
xdot
FLC output
U
theta
Pendulum
Saturation
du /dt
thetadot
Self -Ruled
Fuzzy Logic Controller
Inverted Pendulum
out
16
PA
in
Logical Switching
Application Example 2 – Inverted Pendulum
INPUTS
WEIGHTING FILTERS
OUTPUT
Distance error
Velocity error
IF the pendulum angle or
angular velocity is PB-NB
THEN reduce the
importance of the distance
error and velocity error
Pendulum angle error
17
Pendulum angular velocity error
distance weight
velocity weight
Inverted Pendulum Simulation 1
θ0=0.9rad , Xd=-9m , Fmax=10N
18
Inverted Pendulum Simulation 2
θ0=3rad , Xd=-9m , Fmax=10N
19
Inverted Pendulum Simulation 3
Xd=Sinusoidal Amp=9m , Fmax=10N , Disturbance(±1N) , Noise(±0.1rad)
20
Application Example 3 – Bipedal Walking
du
Angle error
21
Angular velocity error
SRFLC
1/s
u
+
+
Torque
CONCLUSION
• 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 ATTENTION