KOCAELI UNIVERSITY – MECHATRONICS ENGINEERING
INTRODUCTION TO FUZZY LOGIC
(2020- 2021 Fall Semester FINAL Exam)
Date: January 14, 2021
Time: 75 minutes
Question Grade
Alperen YILMAZ
Student name
1 10
Student 160224023 2 10
number
3 20
4 20
5 20
6 20
Good Luck.
H. Metin ERTUNÇ, PhD
TOTAL
Hint: The way to find the weighted average.
1. For the controller system given below
a. What type of controller is applied?
b. In general, how do you determine performance of this control system to a unit
step input? (What are the performance criteria for a system when it was applied
a step input?)
c. What would you do if you want to apply this control system in real time using a
microcontroller? Explain.
a-) Fuzzy Logic Controller
b-) If it is sufficiently adjusted with the required gain values, the system fits in an optimum way.
It can be evaluated according to Staty Steate, Over shoot, rise time, peak time values.
c-) I convert it to look-ip table form and transfer it to microcontroller.
2. Suppose we want design a fuzzy system to balance the inverted pendulum shown in
the figure. Let the angle 𝜃 and its derivation 𝜃̇ be the inputs to the fuzzy system and
the force u applied to the cart be its output. Fill up the rule table using fuzzy IF-THEN
rules based on the common sense of how to balance the inverted pendulum.
x2
NB NS Z PS PB
x1
NB PB PB PB PS Z
NS PB PB PS Z NS
Z PB PS Z NS NB
PS PS Z NS NB NB
PB Z NS NB NB NB
3. Consider a simulation of an automobile cruise control system. There are two inputs
(v:velocity and Ɵ:slope of the road) and one output (T:throttle positon). The
membership functions and rule table are given below. Mamdani (max-min) fuzzy
inference is used for fuzzy logic controller.
If the input variables are given as v = 103 km and Ɵ = 4º, then calculate the Throttle
position (T) according to the following defuzzification rules BY HAND:
a. MoM (Mean of Maxima) = …
b. LoM (Largest of Maxima) = …
c. SoM (Smallest of Maxima) = …
d. Weighted Average = …
[Açıklama: Bir araba için tasarlanan hız sabitleyici sisteminde arabanın hızına ve yolun eğimine
göre gaz subapının açıklığı kontrol edilmek istenmektedir. Verilen giriş değerlerine ve bulanık
yöntemlere göre subap açıklığını hesaplayınız.]
DİKKAT: BU PROBLEMİ ELLE AŞAĞIDAKİ GRAFİKLER ÜZERİNDE ÇÖZÜNÜZ.
x1 = v
FLC y=T
x2 = Ɵ (Cruise control)
1 Low OK High 1
Down Level Up
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
90 95 100 105 110 -5 0 5
v(km) (degrees)
Rule table:
Medium HM
1 Low LM
High
0.8
v\Ɵ Up Level Down
0.6 High LM LM Low
0.4 OK HM Medium LM
0.2
Low High HM HM
0
1 2 3 4 5 6 7 8 9 10 11
Throttle position
4. Consider a simulation of an automobile cruise control system. There are two inputs
(v:velocity and Ɵ:slope of the road) and one output (T:throttle positon). The
membership functions and rule table are given below. Mamdani (max-min) fuzzy
inference is used for fuzzy logic controller.
If the input variables are given as v = 103 km and Ɵ = 4º, then calculate the Throttle
position (T) according to the following defuzzification rules BY MATLAB:
a. Centroid =
b. Bisector =
c. MoM (Mean of Maxima) =
d. LoM (Largest of Maxima) =
e. SoM (Smallest of Maxima) =
[Açıklama: Bir araba için tasarlanan hız sabitleyici sisteminde arabanın hızına ve yolun eğimine
göre gaz subapının açıklığı kontrol edilmek istenmektedir. Verilen giriş değerlerine ve bulanık
yöntemlere göre subap açıklığını hesaplayınız.]
DİKKAT: BU PROBLEMİ MATLAB İLE ÇÖZÜP İLGİLİ BÜTÜN GRAFİKLERİ
YAPIŞTIRINIZ.
x1 = v
FLC y=T
x2 = Ɵ (Cruise control)
1 Low OK High 1
Down Level Up
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
90 95 100 105 110 -5 0 5
v(km) (degrees)
Rule table:
Medium HM
1 Low LM
High
0.8
v\Ɵ Up Level Down
0.6 High LM LM Low
0.4 OK HM Medium LM
0.2
Low High HM HM
0
1 2 3 4 5 6 7 8 9 10 11
Throttle position
CENTROİD:
BISECTOR:
MOM:
LOM:
SOM:
5. Consider an inverted pendulum system discussed in the class. The inputs of the system
(error and change-in-error) are given with two rules as follows:
π 𝑑𝑒(𝑡) 3𝜋
𝑒(𝑡) = and =
8 𝑑𝑡 32
When applying fuzzy logic, you have to use weighted average as defuzzification rule
and find firing strength according to the minimum (min).
Then calculate the force control signal BY HAND
a) using max-min (Mamdani) inference method.
b) using max-prod (Larsen) inference method.
DİKKAT: BU PROBLEMİ ELLE AŞAĞIDAKİ GRAFİKLER ÜZERİNDE ÇÖZÜNÜZ.
6. Consider an inverted pendulum system discussed in the class. The inputs of the system
(error and change-in-error) are given with two rules as follows:
π 𝑑𝑒(𝑡) 3𝜋
𝑒(𝑡) = and =
8 𝑑𝑡 32
When applying fuzzy logic, you have to use centroid as defuzzification rule and find
firing strength according to the minimum (min).
Then calculate the force control signal BY MATLAB
a) using max-min (Mamdani) inference method
b) using max-prod (Larsen) inference method.
DİKKAT: BU PROBLEMİ MATLAB İLE ÇÖZÜP İLGİLİ BÜTÜN GRAFİKLERİ YAPIŞTIRINIZ.