You are on page 1of 14

CONVENTIONAL CONTROL

Example: design a cruise control system


After gaining an intuitive understanding of the plant’s
dynamics and establishing the design objectives, the
control engineer typically solves the cruise control
problem by doing the following:
FUZZY CONTROL 1. Developing a model of the automobile dynamics (which
may model vehicle and power train dynamics, tire and
suspension dynamics, the effect of road grade variations,
etc.).

2. Using the mathematical model, or a simplified version of


it, to design a controller (e.g., via a linear model, develop
a linear controller with techniques from classical control).
“Fuzzy Control” Kevin M. Passino and Stephen Yurkovich

CONVENTIONAL CONTROL CONVENTIONAL CONTROL

3. Using the mathematical model of the closed-loop system


and mathematical or simulation-based analysis to study
its performance (possibly leading to redesign).

4. Implementing the controller via, for example, a


microprocessor, and evaluating the performance of the
closed-loop system (again, possibly leading to redesign).

“Fuzzy Control” Kevin M. Passino and Stephen Yurkovich “Fuzzy Control” Kevin M. Passino and Stephen Yurkovich

CONVENTIONAL CONTROL CONVENTIONAL CONTROL


Performance Objectives:
Mathematical model of the plant:
– never perfect
– an abstraction of the real system 1. Disturbance rejection properties (e.g., for the cruise control
problem, that the control system will be able to dampen
– “is accurate enough to be able to design a controller
that will work.”! out the effects of winds or road grade variations).
– based on a system of differential equations
2. Insensitivity to plant parameter variations (e.g., for the
cruise control problem, that the control system will be
able to compensate for changes in the total mass of the
vehicle that may result from varying the numbers of
passengers or the amount of cargo).

“Fuzzy Control” Kevin M. Passino and Stephen Yurkovich “Fuzzy Control” Kevin M. Passino and Stephen Yurkovich

1
CONVENTIONAL CONTROL CONVENTIONAL CONTROL
Performance Objectives: Performance Objectives:

3. Stability (e.g., in the cruise control problem, to guarantee 6. Settling time (e.g., in the cruise control problem, how much
that on a level road the actual speed will converge to the time it takes for the speed to reach to within 1% of the set-
desired set-point). point).
4. Rise-time (e.g., in the cruise control problem, a measure of
how long it takes for the actual speed to get close to the 7. Steady-state error (e.g., in the cruise control problem, if you
desired speed when there is a step change in the set- have a level road, can the error between the set-point and
point speed). actual speed actually go to zero; or if there is a long
5. Overshoot (e.g., in the cruise control problem, when there is positive road grade, can the cruise controller eventually
a step change in the set-point, how much the speed will achieve the set-point).
increase above the set-point).
“Fuzzy Control” Kevin M. Passino and Stephen Yurkovich “Fuzzy Control” Kevin M. Passino and Stephen Yurkovich

CONVENTIONAL CONTROL CONVENTIONAL CONTROL


Design Constraints: Design Constraints:

Cost: How much money will it take to implement the controller, Maintainability: Will it be easy to perform maintenance and
or how much time will it take to develop the controller? routine adjustments to the controller?
Computational complexity: How much processor power and Adaptability: Can the same design be adapted to other similar
memory will it take to implement the controller? applications so that the cost of later designs can be
Manufacturability: Does your controller have any extraordinary reduced?
requirements with regard to manufacturing the hardware Understandability: Will the people that implement it or test it be
that is to implement it? able to fully understand it?
Reliability: Will the controller always perform properly? What is Politics: Is your boss biased against your approach? Is your
its “mean time between failures?” approach too novel and does it thereby depart too much
from standard practice?
“Fuzzy Control” Kevin M. Passino and Stephen Yurkovich “Fuzzy Control” Kevin M. Passino and Stephen Yurkovich

CONVENTIONAL CONTROL CONVENTIONAL CONTROL


Controller Design: Controller Design:

Proportional-integral-derivative (PID) control: Over 90% of the Optimal control: Linear quadratic regulator, use of Pontryagin’s
controllers in operation today are PID controllers. Often, minimum principle or dynamic programming, and so on.
like fuzzy controllers, heuristics are used to tune PID
controllers (e.g., the Zeigler-Nichols tuning rules). Robust control: H2 or H∞ methods, quantitative feedback
theory, loop shaping, and so on.
Classical control: Lead-lag compensation, Bode and Nyquist
methods, root-locus design, and so on. Nonlinear methods: Feedback linearization, Lyapunov
redesign, sliding mode control, backstepping, and so on.
State-space methods: State feedback, observers, and so on.
“Fuzzy Control” Kevin M. Passino and Stephen Yurkovich “Fuzzy Control” Kevin M. Passino and Stephen Yurkovich

2
CONVENTIONAL CONTROL FUZZY CONTROL
Controller Design:
Fuzzy control provides a formal methodology for
representing, manipulating, and implementing a
Adaptive control: Model reference adaptive control, self-tuning human’s heuristic knowledge about how to control a
regulators, nonlinear adaptive control, and so on. system.

Stochastic control: Minimum variance control, linear quadratic


gaussian (LQG) control, stochastic adaptive control, and
so on.

Discrete event systems: Petri nets, supervisory control,


infinitesimal perturbation analysis, and so on.
“Fuzzy Control” Kevin M. Passino and Stephen Yurkovich “Fuzzy Control” Kevin M. Passino and Stephen Yurkovich

FUZZY CONTROL FUZZY CONTROL


Useful cases:
Four main components of a fuzzy controller:
(1) The control processes are too complex to analyze by
(1) The fuzzification interface : transforms input crisp values
conventional quantitative techniques.
into fuzzy values
(2) The available sources of information are interpreted
(2) The knowledge base : contains a knowledge of the
qualitatively, inexactly, or uncertainly.
application domain and the control goals.
Advantages of FLC:
(3) The decision-making logic :performs inference for fuzzy
(1) Parallel or distributed control multiple fuzzy rules – complex control actions
nonlinear system
(4) The defuzzification interface
(2) Linguistic control. Linguistic terms - human knowledge
(3) Robust control. More than 1 control rules – a error of a rule
is not fatal.
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Step 1: Choice of state and control variables Step 2: Select inference method.
• Mamdani
State variables
• Larsen
– input variables of the fuzzy control system
– state, state error, state error deviation, and state error integral • Tsukamoto
are often used
• TSK (Takagi Sugeno Kang)
Control variables
– output variables of the fuzzy control system • Other methods (such as SAM)
– selection of the variables depends on expert knowledge on the
process

http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

3
FUZZY CONTROL FUZZY CONTROL
Inference method: Mamdani Inference method: Larsen
– minimum operator for a fuzzy implication – product operator(•) for a fuzzy implication
– max-min operator for the composition
– max-product operator for the composition
1 A1 A′ 1 B′ B1 1 C1 1 1 1

α1
α1
0 0 0 0 0 0
u v w 1 u v w 1

1 A′ A2 1 B′ 1 0 1 1 1 0
B2 C2
α2 α2

0 0 0 0 0
0 u v min w
u v min w
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Inference method: Tsukamoto Inference method: Tsukamoto
Min

– the consequent part : fuzzy set with µC (z ) A11 B 11 C 11

a monotonic membership function i α11

u v w1 w
– The rule base has the form: Ri: if u is Ai and v is Bi, then w is Ci, µ µ µ

i = 1, 2, … , n where Ci is a monotonic function.


A22 B 22 C 22

−1
– the result of rule Ri : zi = µ (α i ) Ci
α22

u v w22 w
u0

α1 z1 + α 2 z2
v0 Weighted Average

– the aggregated result : z′ = Graphical representation of α1w1 + α 2 w2


weighted sum – no defuzzification α1 + α 2 Tsukamoto method w0 =
α1 + α 2
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Inference method: TSK (Takagi-Sugeno-Kang) Inference method: TSK (Takagi-Sugeno-Kang)
- the consequent part is given as a function of input variables. µ µ
Min

Ri: if x is Ai and y is Bi then z is fi(x, y) A1 B1

where z = f(x, y) is a crisp function of input variables x and y. α1 w1=p1u0+q1v0+r1

u v
µ µ
- When input data are singletons x0 and y0, then the inferred
result of rule Ri is fi(x0, y0). A2 B2

w2=p2u0+q2v0+r2
α2

- The aggregated result : weighted average using the u0


u
v0
v Weighted Average

matching degree αi α f (x , y ) + α f (x , y ) α1w1 + α 2 w2


z′ = 1 1 0 0 2 2 0 0 w0 =
α1 + α 2 α1 + α 2
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

4
FUZZY CONTROL FUZZY CONTROL
Step 3: Fuzzification. Process of Step 3: Fuzzification. Process of
making a crisp quantity fuzzy making a crisp quantity fuzzy
µF(x) µF(x)
• If it is assumed that input data Fuzzification function
1 1
do not contain noise of x = fuzzifier (x0)
vagueness, a fuzzy singleton - x0 is a observed crisp value
can be used x0 x x0 x
µF(x) - x is a fuzzy set µF(x)
• If the data are vague or 1 Fuzzifier() represents a 1
perturbed by noise, they fuzzification operator
should be converted into a
fuzzy number x0 x x0 x
base base
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Range Level No.
x ≤ −2.4 −6
Step 4: Design the knowledge base. Data base design. −2.4 < x ≤ −2.0 −5
Discretization of the −1.6 < x ≤ −0.8 −4
−0.8 < x ≤ −0.4 −3
The knowledge base consists of two parts: universe of discourse.
−0.4 < x ≤ −0.2 −2
−0.2 < x ≤ −0.1 −1
1. Data base. Partition of the variable spaces −0.1 < x ≤ +0.1 0
2. Rule base. Fuzzy control rules. +0.1 < x ≤ +0.2 1
+0.2 < x ≤ +0.4 2
+0.4 < x ≤ +0.8 3
+0.8 < x ≤ +1.1 4
+1.1 < x ≤ +1.4 5
+1.4 < x 6

Example: A universe of discourse is discretized into 13


levels (-6, -5, -4, … , 0, 1, … , 5, 6).
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Range Normalized Normalized
segments universe
Data base design. Normalization Data base design. Fuzzy partition.
of the universe of discourse. [−6.9, −4.1] [−1.0, −0.5]

[−4.1, −2.2] [−0.5, −0.3] • determines how many terms should


• A discretization into a exist in a term set.
[−2.2, −0.0] [−0.3, 0.0] [−1.0, +1.0]
normalized universe. • to find the number of primary fuzzy
[−0.0, +1.0] [0.0, +0.2]
• The normalized universe sets (linguistic terms) Z
N P
consists of finite number of [+1.0, +2.5] [+0.2, +0.6]

segments.
[+2.5, +4.5] [+0.6, +1.0]
• The scale mapping can be
uniform, non-uniform, or both. the universe of discourse [-6.9, +4.5]
is transformed into the normalized −1 0 +1

closed interval [-1, 1].


http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

5
FUZZY CONTROL FUZZY CONTROL
Data base design. Fuzzy partition. Data base design. Fuzzy partition.
7 linguistic terms are often used x2

• NB: negative big


• NM: negative medium The number of fuzzy terms in the
• NS: negative small input space determines the PS

• ZE: zero
NB NM NS ZE PS PM PB maximum possible number of ZO

control rules. NS
• PS: positive small NB
• PM: positive medium x1
NB NS ZO PS PB
• PB: positive big
−1 0 +1 A fuzzy partition in a 2-dimensional input space.
The maximum number of control rules = 20 (5x4)
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Practical design principles for designing the A Membership Function that violates the second principle
data base:
– Each membership function should overlaps
only with the closest neighboring membership
functions;

– For any possible input, its membership values


in all relevant fuzzy sets should sum to 1 (or
nearly)
* Fuzzy Logic: Intelligence, control, and Information, J. Yen and R. Langari, Prentice Hall * Fuzzy Logic: Intelligence, control, and Information, J. Yen and R. Langari, Prentice Hall

FUZZY CONTROL FUZZY CONTROL


A Membership Function that violates both principles Asymmetric Membership Function that follows the guidelines

* Fuzzy Logic: Intelligence, control, and Information, J. Yen and R. Langari, Prentice Hall * Fuzzy Logic: Intelligence, control, and Information, J. Yen and R. Langari, Prentice Hall

6
FUZZY CONTROL FUZZY CONTROL
Data base design. Membership Rule base design.
functions of primary fuzzy
sets. Source of fuzzy control rules:
1. Expert knowledge and control engineering knowledge.
Various types of MFs: 2. Observation of operator’s actions.
- Triangular 3. Fuzzy model of the process: linguistic description of the
- Trapezoidal dynamic properties
- Gaussian 4. Learning: learning from example or self-organizing
- Bell learning.
- etc. Example of triangular membership functions

http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Rule base design. Types of fuzzy control rules. Rule base design. Types of fuzzy control rules.
State evaluation fuzzy rules: state variables in the
antecedent part, control variables in the consequent part. General representation of state evaluation fuzzy
rules:
– a collection of rules of the form(MISO version)
R1: if x is A1, … and y is B1 then z is C1
… Ri: if x is Ai, … and y is Bi then z = fi(x, … y)
Rn: if x is An, … and y is Bn then z is Cn
- The state evaluation rules evaluate the process state
where x, … y and z are linguistic variables representing the (e.g. state, state error, change of error) at time t and
process state variable and the control variable. Ai, … Bi and Ci are compute a fuzzy control action at time t.
linguistic values of the variables x, … y and z in the universe of - In the input variable space, the combination of input
discourse U, … V and W, respectively i = 1, 2, … , n. linguistic term may give a fuzzy rule.
That is, x ∈ U, Ai ⊂ U, …, y ∈ V, Bi ⊂ V, z ∈ W, Ci ⊂ W
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Rule base design. Types of fuzzy control rules. Rule base design. Types of fuzzy control rules.
Object evaluation fuzzy rules: predictive fuzzy control.
A set of fuzzy rules A collection of rules of the form
Ri: if x is Ai, and y is Bi then z is Ci, i = 1, 2, … , n R1: if (z is C1 → (x is A1 and y is B1)) then z is C1.
Can be represented as a rule table …
y
Rn: if (z is Cn → (x is An and y is Bn)) then z is Cn.
– A control action is determined by an objective evaluation that satisfies
Bn C6
the desired states and objectives.
… Cn C5 C5 – x and y are performance indices for the evaluation and z is control
command.
B2 C3 C4 C4
– Ai and Bi are fuzzy values such as NM and PS.
B1 C1 C2 … C7 – The most likely control rule is selected through predicting the results (x,
A1 A2 … An x y) corresponding to every control command Ci, i = 1, 2, … , n.
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

7
FUZZY CONTROL FUZZY CONTROL
Step 5: Select defuzzification method. Defuzzification methods.
• In many practical applications, a control
command is given as a crisp value.
• Centroid
• a process to get a non-fuzzy control action that
best represents the possibility distribution of an
inferred fuzzy control action. k zj
• Mean-of-maximum z0 = ∑
• no systematic procedure for choosing a good j =1 k
defuzzification strategy
• select one in considering the properties of • Weighted average
application case
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Step 6: Test and tuning. Step 7: (Optional) Produce a Lookup table.

• Due to the problem of time complexity, it may take a long time to


compute the fuzzy inference and defuzzification.
- Adjust data base
- Adjust rule base • A lookup table shows relationships between the input variables and
control output actions.
- Try different inference methods
- Try different defuzzification methods • A lookup table can be constructed after making the FLC and
identifying the relationships between the input and output variables.

• In general, it is extremely difficult to get an acceptable lookup table


of a nonlinear control system without constructing a corresponding
FLC.
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL FUZZY CONTROL


Step 7: (Optional) Produce a Lookup table. Review of the design procedure.
The control surface can be represented as a table
Step 1: Determination of state variables and control
variables
Step 2: Selection of the inference method
-Mamdani
-Larsen
-Tsukamoto
-TSK
Step 2: Selection of the fuzzification method
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

8
FUZZY CONTROL FUZZY CONTROL
Review of the design procedure.
Step 4: Determination of the knowledge base
- Discretization and normalization of state variable space
- Partition of variable space.
- Selection of the MF shapes
- Design of the rule base
Step 5: Selection of defuzzification strategy
Step 6: Test and tuning
Step 7: Construction of a lookup table
http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


SERVOMOTORS SERVOMOTORS
• Servomotors are used in many automatic Design procedure for servomotor control
system including drivers for printers, floppy
disks, tape recorders, and robot manipulations. 1) Determination of state variables and control variable

• The servomotor process shows nonlinear (1) State variables (input variable of FLC):
properties - Error : the set point minus the process output (e).
• The goal is to apply the fuzzy logic control to the - Change of error (ce) : the error from the process
motor control. output minus the error from the last process output.
• The task of the control is to rotate the shaft of
(2) Control variable (output variable of FLC):
the motor to a set point without overshoot.
- Control input (v) : the voltage applied to the process.
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


SERVOMOTORS SERVOMOTORS
Design procedure for servomotor control Design procedure for servomotor control
4) Discretization and normalization
2) Determination of inference method – The shaft encoder of the motor has a resolution of 1000.
- The Mandani inference method is selected for its – The universes of discourse are as follows:
simplicity −1000 ≤ e ≤ 1000 −100 ≤ ce ≤ 100
– The servo amplifier has an output range of 30 V and thus the
control variables (v) are in the range −30 ≤ v ≤ 30
3) Determination of fuzzification method
– We discretize and normalize the input variables in the range
- fuzzy singleton : measure the state variables without [−1, +1] (next slide).
uncertainty
– The control variable v is normalized in the range [−1, +1] with
the equation 1
v′ = v
30
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

9
FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-
SERVOMOTORS SERVOMOTORS
Design procedure for servomotor control Design procedure for servomotor control
4) Discretization and normalization 4) Partition of input and output spaces
error (e) error change (ce) quantized level

−1000 ≤ e ≤ −800 −100 ≤ ce ≤ −80 −1.0 - Partition space of each input and output variable into
−800 < e ≤ −600 −80 < ce ≤ −60 −0.8
−600 < e ≤ −400 −60 < ce ≤ −40 −0.6
seven regions.
−400 ≤<e ≤ −200 −40 < ce ≤ −20 −0.4 - Each region is associated with a linguistic term
−200 < e ≤ −100 −20 < ce ≤ −10 −0.2
−100 < e ≤ 100 −10 < ce ≤ 10 0
- The maximum number of possible fuzzy rules is 49.
100 < e ≤ 200 10 < ce ≤ 20 0.2
200 < e ≤ 400 20 < ce ≤ 40 0.4
NB NM NS ZE PS PM PB
400 < e ≤ 600 40 < ce ≤ 60 0.6
600 < e ≤ 800 60 < ce ≤ 80 0.8 −1 0 +1 e
800 < e ≤ 1000 80 < ce ≤ 100 1.0 ce
v

http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


SERVOMOTORS SERVOMOTORS
Design procedure for servomotor control Design procedure for servomotor control
4) Determination of the shapes of fuzzy sets 4) Construction of the rules
- Input and output variables are normalized on the interval – We interviewed with an expert of the servomotor control, and we
[-1, +1] collect knowledge such as:
“If the error is zero and the error change is positive small, then the
- The input and partitioned into seven linguistic terms control input is negative small”
- Select triangular fuzzy sets
NB NM NS ZE PS PM PB (1) If e is PB and ce is any, then v is PB.
1
(2) If e is PM and ce is NB, NM, or NS, then v is PS.
(3) If e is ZE and ce is ZE, PS, or PM, then v is ZE.
0.5
(4) If e is PS and ce is NS, ZE, or PS, then v is ZE.
(5) If e is NS and ce is NS, ZE, PS, or PM, then v is NS.
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1.0 (6) If e is NS or ZE and ce is PB, then v is PS.
http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


SERVOMOTORS SERVOMOTORS
Design procedure for servomotor control Design procedure for servomotor control
4) Construction of the rules 5) Select centroid defuzzification
ce 6) Test and tune. Compare performance to classical control
e NB NM NS ZE PS PM PB

NB
NB
NM
NM
NS NS
PS
ZE
NS ZE
PS
PM
PM PS

PB PB

http://if.kaist.ac.kr/lecture/cs670/textbook/ http://if.kaist.ac.kr/lecture/cs670/textbook/

10
FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-
SERVOMOTORS TRUCK BACKER-UPPER
Design procedure for servomotor control Harder formulation:
7) Construction the look-up table Back-up a truck-trailer to a dock

Simple formulation:
Back-up a truck to a dock.

Approach the dock at 90º angle!


http://if.kaist.ac.kr/lecture/cs670/textbook/

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


TRUCK BACKER-UPPER TRUCK BACKER-UPPER
Truck-and-trailer Truck dynamics:
dynamics: Θ - steering angle
ϕ - truck angle
x,y – truck position

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


TRUCK BACKER-UPPER TRUCK BACKER-UPPER
Assumption: The truck The truck dynamics can
travels at constant be represented in
velocity V and truck complex form:
length is L.
p = x + jy
 π
dp jϕ − 
= V (cos Θ)e  2 
dt
dϕ V
= sin Θ
dt L
Fuzzy Systems ToolBox, Mark Beale and Howard Demuth

11
FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-
TRUCK BACKER-UPPER TRUCK BACKER-UPPER
In MATLAB:
function ds=trukmod(s,u) % s(1) =x, s(2)=y, s(3)=f, u = q
The universe of
% Angles are in radians. discourse:
% CONSTANTS
L = 1; % Length of truck.
v = 1; % Velocity of truck.

% STATES
pos = s(1) + sqrt(-1)*s(2); angle = s(3);

% DERIVATIVES
dpos = v*cos(u)*exp(j*(angle-pi/2)); dangle = v*sin(u)/L;

ds = [real(dpos); imag(dpos); dangle];


Fuzzy Systems ToolBox, Mark Beale and Howard Demuth Fuzzy Systems ToolBox, Mark Beale and Howard Demuth

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


TRUCK BACKER-UPPER TRUCK BACKER-UPPER
Fuzzy sets for horizontal position: Fuzzy sets for truck angle:
- far left, left, center, right, far right - 0, 60, 120, 180, 240, 300, 360

Fuzzy Systems ToolBox, Mark Beale and Howard Demuth Fuzzy Systems ToolBox, Mark Beale and Howard Demuth

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


TRUCK BACKER-UPPER TRUCK BACKER-UPPER
Fuzzy sets for steering angle: Fuzzy rules:
- hard left, left, soft left, center, soft right, right, hard right

Fuzzy Systems ToolBox, Mark Beale and Howard Demuth Fuzzy Systems ToolBox, Mark Beale and Howard Demuth

12
FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-
TRUCK BACKER-UPPER TRUCK BACKER-UPPER
Fuzzy rules: MATLAB simulation:
% assume time step = 0.2 second
dt = 0.2;
For I=1:100
if rem(I,5) == 1
% Evaluate controller once a second
% (5 time steps *0.2 seconds)
theta = frule(A,C,Z,[s(1);s(3)]);
end
s = s + dt * truckmod (s,theta);
end

Fuzzy Systems ToolBox, Mark Beale and Howard Demuth Fuzzy Systems ToolBox, Mark Beale and Howard Demuth

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


TRUCK BACKER-UPPER TRUCK BACKER-UPPER
MATLAB simulation: trukcon1 Fuzzy sets for horizontal position:
Problem: the truck - far left, left, center, right, far right
takes too long to
get exactly to the
center line

Reason: coarse
definition of the
horizontal position

Solution: redefine
fuzzy sets for the
horizontal position

Fuzzy Systems ToolBox, Mark Beale and Howard Demuth Fuzzy Systems ToolBox, Mark Beale and Howard Demuth

FUZZY CONTROL EXAMPLE- FUZZY CONTROL EXAMPLE-


TRUCK BACKER-UPPER TRUCK BACKER-UPPER
MATLAB simulation: JAVA simulation: FuzzyTruck.html
trukcon2

Redefinition of the fuzzy sets


for the horizontal position
significantly improved
the results

Fuzzy Systems ToolBox, Mark Beale and Howard Demuth http://www.iit.nrc.ca/IR_public/fuzzy/FuzzyTruck.html

13
SUMMARY SUMMARY
Classical control does not provide a “perfect” solution Step 4: Determination of the knowledge base
- Discretization and normalization of state
Fuzzy control is a formal methodology for variable space
implementing control systems based on human’s - Partition of variable space.
heuristic knowledge - Selection of the MF shapes
- Design of the rule base
Design procedure: Step 5: Selection of defuzzification strategy
Step 1: Determination of state variables and Step 6: Test and tuning
control variables Step 7: Construction of a lookup table
Step 2: Selection of the inference method
Step 2: Selection of the fuzzification method

14

You might also like