Vous êtes sur la page 1sur 82

Intelligent Control System

(Fuzzy Control)
Yusuf Hendrawan STP., M.App.Life Sc., Ph.D
What is Intelligence???
[1] IF … THEN …
[2] Learning Iteration Process
[3] Optimization

GA Fuzzy

ANN
Logika Fuzzy : memetakan suatu ruang input ke dalam suatu ruang output

Ruang
Ruang Kotak output
input Hitam

Alasan digunakannya Logika Fuzzy:


1. Konsep logika fuzzy mudah dimengerti
2. Logika fuzzy sangat sederhana
3. Logika fuzzy memiliki toleransi terhadap data-data yang tidak tepat
4. Logika fuzzy mampu memodelkan fungsi-fungsi nonlinear yang sangat
kompleks
5. Logika fuzzy dapat membangun dan mengaplikasikan pengalaman-
pengalaman para pakar secara langsung tanpa harus melalui proses
pelatihan
6. Logika fuzzy dapat bekerjasama dengan teknik-teknik kendali secara
konvensional
7. Logika fuzzy didasarkan pada bahasa alami
4

Fuzzy Applications
• Theory of fuzzy sets and fuzzy logic has been applied to problems in
a variety of fields:
▫ pattern recognition, decision support, data mining & information
retrieval, medicine, law, taxonomy, topology, linguistics,
automata theory, game theory, etc.

• And more recently fuzzy machines have been developed including:


▫ automatic train control, tunnel digging machinery,
home appliances: washing machines, air conditioners, etc.
TRADITIONAL REPRESENTATION OF LOGIC

Slow Fast
Speed = 0 Speed = 1
bool speed;
get the speed
if ( speed == 0) {
// speed is slow
}
else {
// speed is fast
}
FUZZY LOGIC REPRESENTATION
Slowest
 For every problem
[ 0.0 – 0.25 ]
must represent in
terms of fuzzy sets.
Slow
 What are fuzzy [ 0.25 – 0.50 ]

sets?
Fast
[ 0.50 – 0.75 ]

Fastest
[ 0.75 – 1.00 ]
FUZZY LOGIC REPRESENTATION

Slowest Slow Fast Fastest


float speed;
get the speed
if ((speed >= 0.0)&&(speed < 0.25)) {
// speed is slowest
}
else if ((speed >= 0.25)&&(speed < 0.5))
{
// speed is slow
}
else if ((speed >= 0.5)&&(speed < 0.75))
{
// speed is fast
}
else // speed >= 0.75 && speed < 1.0
{
// speed is fastest
}
Fuzzy Expert System
• How to represent a fuzzy set in a computer ?
The membership function must be determined first.
Terminology:
Crisp or Fuzzy Logic

• Crisp Logic
▫ A proposition can be true or false only.
• Bob is a student (true)
• Smoking is healthy (false)
▫ The degree of truth is 0 or 1.
• Fuzzy Logic
▫ The degree of truth is between 0 and 1.
• William is young (0.3 truth)
• Ariel is smart (0.9 truth)
Sistem Fuzzy
a. Variabel Fuzzy
- Merupakan variabel yang hendak dibahas dalam suatu sistem fuzzy,
contoh: umur, temperatur, permintaan, dll
b. Himpunan Fuzzy
- Merupakan suatu grup yang mewakili suatu kondisi atau keadaan
tertentu dalam suatu variabel fuzzy
- Contoh: 1) variabel umur terbagi menjadi 3 himpunan fuzzy: MUDA,
PAROBAYA, TUA ; 2) variabel temperatur terbagi menjadi 5
himpunan fuzzy: DINGIN, SEJUK, NORMAL, HANGAT, PANAS
c. Semesta Pembicaraan
- Keseluruhan nilai yang diperbolehkan untuk dioperasikan dalam suatu
variabel fuzzy, senantiasa bertambah (naik) secara monoton dari krii ke
kanan. Contoh: 1) variabel umur [0, +∞]; 2) variabel temperatur [0, 40]
d. Domain
- Keseluruhan nilai yang diijinkan dalam semesta pembicaraan dan
boleh dioperasikan dalam suatu himpunan fuzzy. Contoh: 1) MUDA [0,
45]; 2) PAROBAYA [35, 55]; 3) TUA [45, +∞]; 4) DINGIN [0, 20]; 5)
SEJUK [15, 25]; 6) NORMAL [20, 30]; 7) HANGAT [25, 35]; 8) PANAS
[30, 40]
Fungsi Keanggotaan
(Membership Function)
Membership function adalah suatu kurva yang menunjukkan pemetaan titik-
titik input data ke dalam nilai keanggotaannya yang memiliki interval antara 0
sampai 1 melalui pendekatan fungsi.

a. Representasi Linear → pemetaan input ke derajat keanggotaannya


digambarkan sebagai suatu garis lurus. Bentuk ini paling sederhana dan
menjadi pilihan yang baik untuk mendekati suatu konsep yang kurang jelas.

1
0, 𝑥≤𝑎 Derajat
(𝑥−𝑎) keanggotaan µ[x]
𝜇[𝑥]= 𝑎≤𝑥≤𝑏
(𝑏−𝑎)
1, 𝑥≥𝑏
0 a domain b

Representasi Linear Naik


PANAS
1
32−25
𝜇𝑃𝐴𝑁𝐴𝑆 32 = 35−25 =0.7 Derajat 0.7
keanggotaan
µ[x]

0 25 32 35
temperatur
1

Derajat
keanggotaan µ[x] (𝑏 − 𝑥)
; 𝑎≤𝑥≤𝑏
𝜇 𝑥 = ൞(𝑏 − 𝑎)
0; 𝑥≥𝑏
0 a domain b

Representasi Linear Turun


DINGIN
1
Derajat
30−20 0.667
𝜇𝐷𝐼𝑁𝐺𝐼𝑁 20 = =0.667 keanggotaan
30−15 µ[x]

0 15 20 30
temperatur
• b. Representasi Kurva Segitiga
 Gabungan antara 2 garis (linear).

1 0; 𝑥 ≤ 𝑎 𝑎𝑡𝑎𝑢 𝑥 ≥ c
𝑏
(𝑥−𝑎)
Derajat ; 𝑎≤𝑥≤𝑏
keanggotaan µ[x] 𝜇[𝑥]= (𝑏−𝑎)
(𝑐−𝑥)
; 𝑏≤𝑥≤𝑐
(𝑐−𝑏)

0 a b c
domain

Kurva Segitiga
NORMAL
1
0.8
Derajat
23−15
𝜇𝑁𝑂𝑅𝑀𝐴𝐿 23 = =0.8 keanggotaan
25−15
µ[x]

0 15 23 30
25
temperatur
• c. Representasi Kurva Trapesium
 Sama seperti bentuk segitiga, hanya beberapa titik
memiliki nilai keanggotaan 1

0; 𝑥 ≤ 𝑎 𝑎𝑡𝑎𝑢 𝑥 ≥d
𝑏
1
(𝑥−𝑎)
; 𝑎≤𝑥≤𝑏
Derajat (𝑏−𝑎)
keanggotaan µ[x] 𝜇[𝑥]=
1; 𝑏≤𝑥≤𝑐
(𝑑−𝑥)
; 𝑐≤𝑥≤𝑑
(𝑑−𝑐)
0 a b c d
domain

Kurva Trapesium
NORMAL
1
Derajat
35−32
𝜇𝑁𝑂𝑅𝑀𝐴𝐿 23 = =0.375 keanggotaan
35−27
µ[x] 0.375

0 15 24 27 32 35

temperatur
• d. Representasi Kurva Bentuk Bahu
 Daerah yang terletak di tengah-tengah suatu variabel yang dipresentasikan dalam
bentuk segitiga, pada sisi kanan dan kirinya akan naik dan turun.

Bahu Kiri Bahu Kanan

DINGIN SEJUK NORMAL HANGAT PANAS


1

Derajat
keanggotaan µ[x]

0 0 28 40

temperature

Daerah bahu pada variabel Temperatur


• d. Representasi Kurva S
 Kurva PERTUMBUHAN dan PENYUSUTAN merupakan kurva-S atau sigmoid yang
berhubungan dengan kenaikan dan penurunan permukaan secara tak linear

1 1
μ[x]
Derajat Derajat
keanggotaan µ[x] keanggotaan µ[x]

μ[x]

0 a x b 0 a x b
domain domain

Kurva S PERTUMBUHAN Kurva S PENYUSUTAN

b−x
2
b−x
2

 x = 1 − 2   x = 2 
b−a b−a
Operator Dasar Zadeh untuk Operasi
Himpunan Fuzzy
• 1. Operator AND
▫ Berhubungan dengan operasi interseksi pada himpunan → mengambil nilai
keanggotaan terkecil.
▫ Contoh: Misal nilai keanggotaan 27 tahun pada himpunan MUDA adalah 0.6
(µMUDA[27]=0.6); dan nilai keanggotaan Rp. 2 juta pada himpunan penghasilan
TINGGI adalah 0.8 (µGAJITINGGI[2x106=0.8]; maka α-predikat untuk usia
MUDA dan berpenghasilan TINGGI adalah 0.6
• 2. Operator OR
▫ Operator ini berhubungan dengan operasi union pada himpunan → mengambil
nilai keanggotaan terbesar.
▫ Contoh: Pada contoh diatas α-predikat untuk usia MUDA atau berpenghasilan
TINGGI adalah 0.8
• 3. Operator NOT
▫ Berhubungan dengan operasi komplemen pada himpunan
▫ Contoh: nilai α-predikat untuk usia TIDAK MUDA adalah
▫ 1- µMUDA[27]=1-0.6= 0.4
Penalaran MONOTON
• Metoda penalaran secara monoton digunakan
sebagai dasar untuk teknik implikasi fuzzy →
digunakan untuk penskalaan fuzzy.
• Jika 2 daerah fuzzy direalisasikan dengan implikasi
sederhana: IF x is A THEN y is B; transfer fungsinya
y=f((x,A),B); maka sistem fuzzy dapat berjalan
tanpa harus melalui komposisi dan dekomposisi
fuzzy. Nilai output dapat diestimasi langsung dari
nilai keanggotaan yang berhubungan dengan
antesedennya.
1
0.7

0 50 75 100

Light Intensity

1
0.7

0 3 5

Photosynthesis
umol CO2 m-2 s-1
Fuzzy Inference System
• Metode Tsukamoto
• Metode Mamdani
• Metode Sugeno
Metode Tsukamoto
• Setiap konsekuen pada aturan yang berbentuk
IF-THEN harus direpresentasikan dengan suatu
himpunan fuzzy dengan fungsi keanggotaan
yang monoton;
• Output hasil inferensi dari tiap-tiap aturan
diberikan secara tegas (crisp) berdasarkan α-
predikat (fire strength);
• Hasil akhirnya diperoleh dengan menggunakan
rata-rata terbobot.
Contoh
• Misalkan ada 2 variabel input, Var-1(x) dan Var-
2(y), serta 1 variabel output, Var-3(z), dimana
Var-1 terbagi atas 2 himpunan yaitu A1 dan A2
terbagi atas 2 himpunan B1 dan B2, Var-3 juga
terbagi atas 2 himpunan yaitu C1 dan C2 (C1 dan
C2 harus monoton). Ada 2 aturan yang
digunakan, yaitu:
• [R1] IF (x is A1) AND (y is B2) THEN (z is C1)
• [R2] IF (x is A2) AND (y is B1) THEN (z is C2)
μ[x] μ[y] μ[z]
A1 B2 C1
1 1 1

α1

0 0 0 z1
Var-1 Var-2 Var-3

μ[x] μ[y] μ[z]


A2 B1 C2
1 1 1

α2

0 0 0 z2
Var-2
Var-3
Var-1

Rata-rata
terbobot
Inferensi dengan menggunakan metode Tsukamoto

1 z1 +  2 z 2
z=
1 +  2
Contoh 2
• Suatu perusahaan makanan akan memproduksi makanan
jenis ABC. Dari data 1 bulan terakhir, permintaan terbesar
mencapai 5000 kemasan/hari, dan permintaan
terkecil mencapai 1000 kemasan/hari. Persediaan
barang di gudang terbanyak mencapai 600
kemasan/hari, dan terkecil pernah mencapai 100
kemasan/hari. Dengan segala keterbatasannya, sampai saat
ini, perusahaan baru mampu memproduksi barang
maksimum 7000 kemasan/hari, untuk efisiensi mesin
dan SDM tiap hari diharapkan perusahaan memproduksi
paling tidak 2000 kemasan/hari. Berapa kemasan
makanan jenis ABC yang harus diproduksi, jika jumlah
permintaan sebanyak 4000 kemasan, dan persediaan
di gudang masih 300 kemasan, apabila proses produksi
perusahaan tersebut menggunakan 4 aturan fuzzy sebagai
berikut:
Rules
• [R1] IF permintaan TURUN And Persedian
BANYAK THEN Produksi Barang BERKURANG
• [R2] IF permintaan TURUN And Persedian
SEDIKIT THEN Produksi Barang BERKURANG
• [R3] IF permintaan NAIK And Persedian
BANYAK THEN Produksi Barang BERTAMBAH
• [R4] IF permintaan NAIK And Persedian
SEDIKIT THEN Produksi Barang BERTAMBAH
Permintaan, terdiri atas 2 himpunan fuzzy, yaitu: NAIK dan TURUN
μ[x] TURUN NAIK
1.00

0.75

0.25

1000 4000 5000

Permintaan (kemasan/hari)

Fungsi keanggotaan variabel Permintaan


Nilai Keanggotaan:
5000 − 4000
 PERMINTAAN TURUN [4000] = = 0.25
4000
4000 − 1000
 PERMINTAAN NAIK [4000 ] = = 0.75
4000
Persediaan, terdiri atas 2 himpunan fuzzy, yaitu: SEDIKIT dan BANYAK
μ[x] SEDIKIT BANYAK
1.00

0.60

0.40

100 600
300
Persediaan (kemasan/hari)

Fungsi keanggotaan variabel Persediaan


Nilai Keanggotaan:
600 − 300
 PERSEDIAANSEDIKIT[300] = = 0.6
500
300 − 100
 PERSEDIAANBANYAK [300] = = 0.4
500
Produksi, terdiri atas 2 himpunan fuzzy, yaitu: BERKURANG dan BERTAMBAH
μ[x] BERKURANG BERTAMBAH
1.00

0.6

0.4
0.25

2000 4000 5000 5750 7000

Produksi (kemasan/hari)
Fungsi keanggotaan variabel Produksi

Mencari Nilai z untuk setiap aturan dengan fungsi MIN → karena menggunakan And
⚫[R1] α1 = min (μ PERMINTAAN TURUN [4000], μ PERSEDIAAN BANYAK [300] → min (0.25; 0.4) = 0.25
THEN Produksi Barang BERKURANG → (7000-z)/5000 = 0.25 → z1 = 5750

⚫[R2] α2 = min (μ PERMINTAAN TURUN [4000], μ PERSEDIAAN SEDIKIT [300] → min(0.25; 0.6) = 0.25
THEN Produksi Barang BERKURANG → (7000-z)/5000 = 0.25 → z2 = 5750

⚫[R3] α3 = min (μ PERMINTAAN NAIK [4000], μ PERSEDIAAN BANYAK [300] → min (0.75; 0.4) = 0.4
THEN Produksi Barang BERTAMBAH → (z-2000)/5000 = 0.4 → z3= 4000

⚫[R4] α4 = min (μ PERMINTAAN NAIK [4000], μ PERSEDIAAN SEDIKIT [300] → min (0.75; 0.6) = 0.6
THEN Produksi Barang BERTAMBAH → (z-2000)/5000 = 0.6 → z4= 5000
Nilai z dapat dicari dengan cara:

1 z1 +  2 z2 +  3 z3 +  4 z4
z=
1 +  2 +  3 +  4
0.25 * 5750 + 0.25 * 5750 + 0.4 * 4000 + 0.6 * 5000
z=
0.25 + 0.25 + 0.4 + 0.6
7475
z= = 4983
1.5
Jadi jumlah makanan yang harus diproduksi sebanyak 4983 kemasan
Metode Mamdani
• Metode Mamdani sering dikenal sebagai metode
Max-Min, yang diperkenalkan oleh Ebrahim
Mamdani tahun 1975;
• Output didapatkan dari 4 tahapan:
1) Pembentukan himpunan Fuzzy
2) Aplikasi fungsi implikasi (aturan)
3) Komposisi aturan
4) Penegasan (defuzzy)
[R1] IF Permintaan TURUN And Persediaan BANYAK THEN Produksi Barang BERKURANG

[R1] α1 = min (μ PERMINTAAN TURUN [4000], μ PERSEDIAAN BANYAK [300]


→ min (0.25; 0.4) = 0.25

μ[x] μ[y] μ[z]


μ[z]
TURUN BANYAK BERKURANG
1 1 1 1

0.4 α1 0.25
0.25
0 0 0 0
4000 300
Permintaan Persediaan Produksi Barang
[R2] IF Permintaan TURUN And Persediaan SEDIKIT THEN Produksi Barang BERKURANG

[R2] α2 = min (μ PERMINTAAN TURUN [4000], μ PERSEDIAAN SEDIKIT [300]


→ min (0.25; 0.6) = 0.25

μ[x] μ[y] μ[z]


μ[z]
TURUN SEDIKIT BERKURANG
1 1 1 1
0.6
α2 0.25
0.25
0 0 0 0
4000 300
Permintaan Persediaan Produksi Barang
[R3] IF Permintaan NAIK And Persediaan BANYAK THEN Produksi Barang BERTAMBAH

[R3] α3 = min (μ PERMINTAAN NAIK[4000], μ PERSEDIAAN BANYAK [300]


→ min (0.75; 0.4) = 0.4

μ[x] μ[y] μ[z]


μ[z]
NAIK BANYAK BERTAMBAH
1 1 1 1
0.75
α3 0.4
0.4

0 0 0 0
4000 300
Permintaan Persediaan Produksi Barang
[R4] IF Permintaan NAIK And Persediaan SEDIKIT THEN Produksi Barang BERTAMBAH

[R4] α4 = min (μ PERMINTAAN NAIK[4000], μ PERSEDIAAN SEDIKIT [300]


→ min (0.75; 0.6) = 0.6

μ[x] μ[y] μ[z]


μ[z]
NAIK SEDIKIT BERTAMBAH
1 1 1 1
0.75 α4 0.6
0.6

0 0 0 0
4000 300
Permintaan Persediaan Produksi Barang
Komposisi Antar Aturan
Dari hasil aplikasi fungsi implikasi dari tiap aturan, digunakan metoda MAX
untuk melakukan komposisi antar semua aturan

→(a1-2000)/5000 = 0.25 → a1 = 3250


→(a2-2000)/5000 = 0.6 → a2 = 5000
0.25; z≤3250
μ[z] = (z-2000)/5000; 3250≤z≤5000
0.6; z≥5000

μ[x] BERKURANG BERTAMBAH


1.00

0.6

0.25

2000 a1 a2 7000
3250 5000
Penegasan (Defuzzy)
Salah satu metode penegasan yang bisa digunakan adalah metode centroid. Untuk,
itu perlu dihitung momen untuk setiap daerah

0.25; z≤3250
μ[z] = (z-2000)/5000; 3250≤z≤5000
0.6; z≥5000
3250

 (0.25) z dz = 0.125 z |
2 3250
M1 = = 1320312 .5
0
0

( z − 2000 )
5000 5000
M2=  z dz =  0.0002 z − 0.4 z dz =0.000067 z − 0.2 z | = 3187515 .625
2 3 2 5000

3250
5000 3250
3250

7000

 (0.6) z dz = 0.3z |
2 7000
M3= = 7200000
5000
5000

Kemudian dihitung luas setiap daerah:


A1 = 3250*0.25 = 812.5
A2 = (0.25+0.6)*(5000-3250)/2 = 743.75 Menghitung Titik Pusat:
A3 = (7000-5000)*0.6 = 1200 1320312 .5 + 3187515 .625 + 7200000
z= = 4247 .74
812.5 + 743.75 + 1200
Jadi jumlah makanan yang harus
diproduksi sebanyak 4248 kemasan
Metode Sugeno
• Penalaran SUGENO hampir sama dengan
MAMDANI;
• Diperkenalkan oleh Takagi-Sugeno Kang tahun
1985;
• Output sistem tidak berupa himpunan fuzzy,
melainkan berupa konstanta atau persamaan
linier.
Metode Sugeno
AND / OR
• Model Fuzzy Sugeno Orde Nol
IF (x1 is A1) ο (x2 is A2) ο (x3 is A3) ο … ο (xN is AN) THEN z=k
- dengan Ai adalah himpunan fuzzy ke-i sebagai antesenden, dan k
adalah suatu konstanta (tegas) sebagai konsekuen.

• Model Fuzzy Sugeno Orde Satu


IF (x1 is A1) ο (x2 is A2) ο (x3 is A3) ο … ο (xN is AN) THEN z=p*x1 +
… + pN*xN + q
- dengan Ai adalah himpunan fuzzy ke-i sebagai antesenden, dan pi
adalah suatu konstanta (tegas) ke-i dan q juga merupakan
konstanta dalam konsekuen.

Apabila komposisi aturan menggunakan metode SUGENO, maka


defuzzy dilakukan dengan cara mencari nilai rata-ratanya.
Modifikasi Aturan
Persamaan ditentukan oleh User

• [R1] IF permintaan TURUN And Persedian BANYAK


▫ THEN Produksi Barang = Permintaan - Persediaan
• [R2] IF permintaan TURUN And Persedian SEDIKIT
▫ THEN Produksi Barang = Permintaan
• [R3] IF permintaan NAIK And Persedian BANYAK
▫ THEN Produksi Barang = Permintaan
• [R4] IF permintaan NAIK And Persedian SEDIKIT
▫ THEN Produksi Barang = (1.25 * Permintaan) - Persediaan
Mencari Nilai α dan nilai z untuk setiap aturan dengan fungsi MIN → karena menggunakan And

⚫[R1] α1 = min (μ PERMINTAAN TURUN [4000], μ PERSEDIAAN BANYAK [300] → min (0.25; 0.4) = 0.25
THEN Produksi Barang = Permintaan – Persediaan → Nilai z1 = 4000-300 = 3700

⚫[R2] α2 = min (μ PERMINTAAN TURUN [4000], μ PERSEDIAAN SEDIKIT [300] → min(0.25; 0.6) = 0.25
THEN Produksi Barang = Permintaan → Nilai z2 = 4000

⚫[R3] α3 = min (μ PERMINTAAN NAIK [4000], μ PERSEDIAAN BANYAK [300] → min (0.75; 0.4) = 0.4
THEN Produksi Barang = Permintaan → Nilai z3 = 4000

⚫[R4] α4 = min (μ PERMINTAAN NAIK [4000], μ PERSEDIAAN SEDIKIT [300] → min (0.75; 0.6) = 0.6
THEN Produksi Barang = (1.25 * Permintaan) – Persediaan → Nilai z4 = (1.25*4000)-300 = 4700

Nilai z:
1 z1 +  2 z2 +  3 z3 +  4 z4
z=
1 +  2 +  3 +  4
0.25 * 3700 + 0.25 * 4000 + 0.4 * 4000 + 0.6 * 4700
z=
0.25 + 0.25 + 0.4 + 0.6
6345
z= = 4230 Jadi jumlah makanan yang harus
1.5
diproduksi sebanyak 4230 kemasan
Fuzzy Method
Metode
Tsukamoto
Metode Mamdani
Metode Sugeno
z *
=
 z
i i

 i

Input Output
Fuzzifikas Mesin DeFuzzifikas
i Inferensi i

[R1] IF PxlRed Red0 And PxlGreen


Green0 And PxlBlue Blue0 Then Intensity
µ(x) Ints0
[R2] IF PxlRed Red1 And PxlGreen
Green0 And PxlBlue Blue0 Then Intensity
Ints0
Basis [R3] IF PxlRed Red2 And PxlGreen
Green0 And PxlBlue Blue0 Then Intensity
Pengetahuan Ints0
[R4] IF PxlRed Red3 And PxlGreen
Fuzzy Green0 And PxlBlue Blue0 Then Intensity
Ints0
0 100 180 255 Pixsel [R5] IF PxlRed Red0 And PxlGreen
Green1 And PxlBlue Blue0 Then Intensity
Ints0
Example Problem
Fuzzyfikasi
Piksel Red = 140
Berapa µ(x)?
μ[x]
Red0 Red1 Red2 Red3
1 Solution:
➢ Representasi turun

μ 1 (x ) =
(c − x )
(c − b )
(153 − 140)
= = 0.2549
0 51 102 153 204 255 (153 − 102)
➢ Representasi naik
1 ;0  x  51 (b ≤ x ≤ c)
 (c − x) μ 2 (x ) =
( x − a)

 (c − b)
;52  x  102 or 103  x  153 or 154  x  204 (b − a )
μ(x) =  (140 − 102)
 (x − a) ;52  x  102 or 103  x  153 or 154  x  204 = = 0.7451
 (b − a) (153 − 102)

1 ;205  x  255 (a ≤ x ≤ b)
Example Problem
Fuzzyfikasi
Piksel Green = 120
Berapa µ(x)?
μ[x]
Green0 Green1 Green2 Green3
1 Solution:
➢ Representasi turun

μ1 (x ) =
(c − x )
(c − b )
(153 − 120)
= = 0.66
0 51 102 153 204 255 (153 − 103)
➢ Representasi naik
1 ;0  x  51 (b ≤ x ≤ c)
 (c − x) μ 2 (x ) =
(x − a)

 (c − b)
;52  x  102 or 103  x  153 or 154  x  204 (b − a )
μ(x) =  (120 − 103)
 (x − a) ;52  x  102 or 103  x  153 or 154  x  204 = = 0.33
 (b − a) (154 − 103)

1 ;205  x  255 (a ≤ x ≤ b)
Example Problem
Fuzzyfikasi
Piksel Blue = 230
Berapa µ(x)?
μ[x]
Blue0 Blue1 Blue2 Blue3
1 Solution:
➢ Representasi turun

μ1 (x ) = 1

➢ Representasi naik

0 51 102 153 204 255


μ 2 (x ) = 0

1 ;0  x  51 (b ≤ x ≤ c)
 (c − x)
 ;52  x  102 or 103  x  153 or 154  x  204
 (c − b)
μ(x) = 
 (x − a) ;52  x  102 or 103  x  153 or 154  x  204
 (b − a)

1 ;205  x  255 (a ≤ x ≤ b)
Basis Pengetahuan Fuzzy
μ[x]
Ints6
1 Ints1_1 Ints1_1 Ints3_1 Ints3_2 Ints5_1 Ints5_2
Ints2_1 Ints2_2 Ints4_1 Ints4_2

0 Ints0 1 2 3 4 5 6 7 8
Basis Pengetahuan Fuzzy
[R1] IF PxlRed Red0 And PxlGreen Green0 And PxlBlue Blue0 Then Intensity Ints0
[R2] IF PxlRed Red1 And PxlGreen Green0 And PxlBlue Blue0 Then Intensity Ints0
.
[R28] IF PxlRed Red1 And PxlGreen Green1 And PxlBlue Blue3 Then Intensity Ints3_2
.
.
[R31] IF PxlRed Red1 And PxlGreen Green2 And PxlBlue Blue3 Then Intensity Ints4_2
.
.
[R37] IF PxlRed Red2 And PxlGreen Green1 And PxlBlue Blue3 Then Intensity Ints5_2
.
[R40] IF PxlRed Red2 And PxlGreen Green2 And PxlBlue Blue3 Then Intensity Ints6
.
R50] IF PxlRed Red3 And PxlGreen Green3 And PxlBlue Blue1 Then Intensity Ints6
[R51] IF PxlRed Red3 And PxlGreen Green3 And PxlBlue Blue2 Then Intensity Ints6
[R52] IF PxlRed Red3 And PxlGreen Green3 And PxlBlue Blue3 Then Intensity Ints6
Mesin Inferensi (Metode Tsukamoto)

Mencari Nilai z untuk setiap aturan dengan fungsi MIN → karena menggunakan And

⚫[R28] α1 = min (μ Red1[140], μ Green1[120] , μ Blue3[230] → min (0.2549; 0.66; 1) = 0.2549


THEN Ints3_2→ (5-z)/1 = 0.2549 → z1 = 4.7451= 5

⚫[R31] α2 = min (μ Red1[140], μ Green2[120] , μ Blue3[230] → min (0.2549; 0.33; 1) = 0.2549


THEN Ints4_2→ (6-z)/1 = 0.2549 → z2 = 5.7451= 6

⚫[R37] α3 = min (μ Red2[140], μ Green1[120] , μ Blue3[230] → min (0.7451; 0.66;1) = 0.66


THEN Ints5_2→ (7-z)/1 = 0.66 → z3 = 6.34= 6

⚫[R40] α4 = min (μ Red2[140], μ Green2[120] , μ Blue3[230] → min (0.7451; 0.33; 1) = 0.33


THEN Ints6→ (8-z)/1 = 0.33 → z4 = 7.67= 8
DeFuzzifikasi

1 z1 +  2 z2 +  3 z3 +  4 z4
z=
1 +  2 +  3 +  4
0.2549 * 5 + 0.2549 * 6 + 0.66 * 6 + 0.33 * 8
z=
0.2549 + 0.2549 + 0.66 + 0.33
9.4039
z= = 6.2701 = 6
1.4998
Jadi Intensitas LED yang harus diatur adalah pada tingkatan ke 6
GreenHouse Climate Controller Fuzzy Logic
Programing
Purpose of GHCC
 It takes care of maintaining a protected
environment despite fluctuations of
external climate
 It acts as a program memory, which can
be operated by the grower as a tool to
steer their cultivation

GreenHouse Climate Controller Fuzzy Logic


Programing
Advantages of GHCC
 Energy Conservation
 Better productivity of plants
 Reduced human intervention

GreenHouse Climate Controller Fuzzy Logic


Programing
Environmental factors
Major Factors Minor Factors
 Temperature of the  Wind speed
inside air  Wind direction
 Relative humidity of  Rate of transpiration
the inside air
 Sunlight

GreenHouse Climate Controller Fuzzy Logic


Programing
Control Actuators
 Thermal System
 Humidification System
 Lighting system
 Thermal shade system
 CO2 generator
 Performance of the system

GreenHouse Climate Controller Fuzzy Logic


Programing
Fuzzy Logic
 an alternative design methodology
 linear and non-linear systems for control
 lower development costs
 superior features
 better end product performance
 market faster
 more cost-effectively

GreenHouse Climate Controller Fuzzy Logic


Programing
Fuzzification
 Measure the values of input variables
 Performs a scale mapping that transfers
the range of values of input variables
into corresponding universes of
discourse,
 Performs the function of fuzzification
that converts input data into suitable
linguistic values, which may be viewed
as labels of fuzzy sets.

GreenHouse Climate Controller Fuzzy Logic


Programing
Knowledge Base
 Comprises knowledge of the application
domain and the attendant control goals. It
consists of a “database” and a “linguistic
(fuzzy) control rule base:”
 The database provides necessary
definitions, which are used to define
linguistic control rules and fuzzy data
manipulation in an FLC.
 The rule base characterizes the control
goals and control policy of the domain
experts by means of a set of linguistic
control rules.

GreenHouse Climate Controller Fuzzy Logic


Programing
The decision-making logic
 It is the kernel of an FLC. It has the
capability of simulating human decision-
making based on fuzzy concepts,
implication and the rules of inference in
fuzzy logic

GreenHouse Climate Controller Fuzzy Logic


Programing
The defuzzification inference
 Scale mapping, which converts the
range of values of output variables into
corresponding universe of discourse,
 Defuzzification, which yields a non-fuzzy
control action from an inferred control
action.
 A defuzzifier converts an inferred fuzzy
control action into a crisp one

GreenHouse Climate Controller Fuzzy Logic


Programing
Comparison of Conventional & Fuzzy
Design

GreenHouse Climate Controller Fuzzy Logic


Programing
Advantages
 Reduces Design Development Cycle
 Simplifies Design Complexities
 Improve time to market
 Better for non Linear system
 Improve control performance
 Reduces hardware cost

GreenHouse Climate Controller Fuzzy Logic


Programing
Greenhouse Layout

GreenHouse Climate Controller Fuzzy Logic


Programing
Function of Controller

GreenHouse Climate Controller Fuzzy Logic


Programing
Role of FLC in GHCC

GreenHouse Climate Controller Fuzzy Logic


Programing
Input Variables
 Difference in temperature between inside greenhouse & optimum
must be maintained in greenhouse [-10 to +10 ºC]
 Difference in temperature between outside greenhouse &
optimum must be maintained in greenhouse [-20 to +20 ºC]
 Difference in R-Humidity between inside greenhouse & optimum
must be maintained in greenhouse [0 to 100 %]
 Difference in R-Humidity between outside greenhouse & optimum
must be maintained in greenhouse [0 to 100 %]
 Sunlight incident on the greenhouse roof [0 to 20 W/m2]
 Seasonal Cloudiness which reduces the sun’s radiation [0 to
100 %]
 Wind speed [0 to 100 mph]
 Wind direction with respect to the direction of the ventilation
system of the greenhouse
 Measurement error of the sensing system (-4 to 4)
 Change in Error of the measurement of the sensing system (-1 to
1)

GreenHouse Climate Controller Fuzzy Logic


Programing
Output Variables
 Thermal system (0 to 100 %)
 Ventilation & humidification system (0 to
100 %)
 Thermal shade system (0 to 100 %)
 CO2 generation system (0 to 100 %)
 Forced ventilation system (0 to 100 %)
 Performance of the system (0 to 100 %)

GreenHouse Climate Controller Fuzzy Logic


Programing
FLC System

GreenHouse Climate Controller Fuzzy Logic


Programing
Input Membership Function

GreenHouse Climate Controller Fuzzy Logic


Programing
Input MFs

GreenHouse Climate Controller Fuzzy Logic


Programing
Input MFs

GreenHouse Climate Controller Fuzzy Logic


Programing
Output MFs

GreenHouse Climate Controller Fuzzy Logic


Programing
Output MFs

GreenHouse Climate Controller Fuzzy Logic


Programing
Rules-1

GreenHouse Climate Controller Fuzzy Logic


Programing
Rules-2

GreenHouse Climate Controller Fuzzy Logic


Programing
Rules-3 & 4

GreenHouse Climate Controller Fuzzy Logic


Programing
Rules 5 & 6

GreenHouse Climate Controller Fuzzy Logic


Programing
GUI

GreenHouse Climate Controller Fuzzy Logic


Programing
78

Fuzzy Controllers
• Used to control a physical system
79

Structure of a Fuzzy Controller


Types of Fuzzy Controllers:
- Supervisory Control -
Fuzzy Logic Controller Outputs Set Values for Underlying PID Controllers:

IF temp=low
Set Values PID
AND P=high
THEN A=med

PID Plant
IF ...

Fuzzification Inference Defuzzification PID

Measured Variables
Types of Fuzzy Controllers:
- PID Adaptation -
Fuzzy Logic Controller Adapts the P, I, and D Parameter of a Conventional PID Controller:
Set Point Variable

IF temp=low
AND P=high P
THEN A=med
I Command Variable
D
IF ...
PID Plant
Fuzzification Inference Defuzzification

Measured Variable
Types of Fuzzy Controllers:
- Fuzzy Intervention -
Fuzzy Logic Controller and PID Controller in Parallel:
Set Point Variable

IF temp=low
AND P=high
THEN A=med Command Variable

IF ...
Plant
PID
Fuzzification Inference Defuzzification

Measured Variable

Vous aimerez peut-être aussi