com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/
sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/ 1/9
2/26/2020 sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/
sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/ 2/9
2/26/2020 sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/
1 //Sensor Ultrasonic
2 #include <NewPing.h>
3 #define TRIGGER_PIN 4 // Arduino pin tied to trigger p
4 #define ECHO_PIN 6 // Arduino pin tied to echo pin
5 #define MAX_DISTANCE 50 // Maximum distance we want to p
6 NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // N
7
8 float sensorUS;
9 int enablePin = 11;
10 int in1Pin = 10;
11 int in2Pin = 9;
12 int switchPin = 7;
13 float defuz, pwm;
14
15 //Sensor Suhu
16 float PinSuhu = A2;
17 int vin;
18 int PinUS = A1;
19 float sensorSuhu;
20 float temp;
21
22 //Rule Base
sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/ 3/9
2/26/2020 sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/
23 float suhu [3];
24 float jarak [3];
25 float rule [3][3];
26 float rule00, rule01, rule02;
27 float rule10, rule11, rule12;
28 float rule20, rule21, rule22;
1 //suhu
2 vin = analogRead(PinSuhu);
3 sensorSuhu = (500*vin)/1024;
4 // ultrasonic
5 unsigned int uS = sonar.ping(); // Send ping, get ping
6 sensorUS = (sonar.convert_cm(uS)); // Convert ping tim
7 void setMotor(int speed, boolean reverse)
8 {
9 analogWrite(enablePin, speed);
10 digitalWrite(in1Pin, ! reverse);
11 digitalWrite(in2Pin, reverse);
12 }
1 void FuzzySuhu(){
2 // untuk suhu dingin
3 if (sensorSuhu <= 22.5)
4 { suhu [0] = 1;}
5 else if (sensorSuhu > 22.5 && sensorSuhu <= 25)
6 { suhu [0] = (25 - sensorSuhu)/(25 - 22.5); }
7 else
8 { suhu [0] = 0;}
9
10 // untuk suhu hangat
11 if (sensorSuhu <= 22.5)
sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/ 4/9
2/26/2020 sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/
12 { suhu [1] = 0;}
13 else if (sensorSuhu > 22.5 && sensorSuhu <= 25)
14 { suhu [1] = (sensorSuhu-22.5)/(25-22.5);}
15 else if (sensorSuhu > 25 && sensorSuhu <= 27.5)
16 { suhu [1] = (27.5-sensorSuhu)/(27.5 - 25);}
17 else
18 { suhu [1] = 0;}
19
20 // untuk suhu panas
21 if (sensorSuhu <= 25)
22 { suhu [2] = 0;}
23 else if (sensorSuhu > 25 && sensorSuhu <= 27.5)
24 { suhu [2] = (sensorSuhu-25)/(27.5-25);}
25 else
26 { suhu [2] = 1;}
27 }
1 void FuzzyJarak(){
2 // untuk kondisi dekat
3 if (sensorUS <= 10)
4 { jarak [0] = 1;}
5 else if (sensorUS > 10 && sensorUS <= 20)
6 { jarak [0] = (20 - sensorUS)/(20 - 10); }
7 else
8 { jarak [0] = 0;}
9
10 // untuk kondisi sedang
11 if (sensorUS <= 10)
12 { jarak [1] = 0;}
13 else if (sensorUS > 10 && sensorUS <= 20)
14 { jarak [1] = (sensorUS -10)/(20-10);}
15 else if (sensorUS > 20 && sensorUS <= 40)
16 { jarak [1] = (40-sensorUS)/(40 - 20);}
17 else
18 { jarak [1] = 0;}
19
20 // untuk kondisi jauh
21 if (sensorSuhu <= 20)
22 { jarak [2] = 0;}
23 else if (sensorUS > 20 && sensorUS <= 30)
24 { jarak [2] = (sensorUS-20)/(30-20);}
25 else if (sensorUS > 30)
sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/ 5/9
2/26/2020 sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/
26 { jarak [2] = 1;}
27 }
Comments
52 comments
Add a comment...
Hidayat Turilah
Assalamu'alaikum,bang mau tanya pakai fuzzy apa
metodenya ya?untuk yg in.
Like · Reply · 1y
Ulfah Putri
assalamualaikum
mas, boleh minta tolong kirim source code nya untuk
referensi TA?
ulfahpb@gmail.com
Fahri Ismail
Assalamu'allaikum.
mas boleh minta untuk refensi TA .
Makasih mas.
Fahri.ismail@ymail.com
Like · Reply · 1y
Zulfaesa Hamka
mas boleh mintak untuk refensi TESIS makasi mas
zulfaesa.hamka@gmail.com
Like · Reply · 1y
Rifqi Fauzan
mas boleh mintak untuk refensi TA makasi mas
rifqi.fzn@gmail.com
Like · Reply · 1y
Yusuf Afif
Zidni Chori Nurindra belum dapat gan
Like · Reply · 1y
Leave a Reply
You must be logged in to post a comment.
Author
Benny Wijaya
sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/ 7/9
2/26/2020 sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/
Dian
Pancawati
Alif Tony
Christopher
Alexander
Tanujaya
Bel Cerdas
Cermat Murah
Status
Pesanan
Cek Status
Kiriman
#Resi:
CHECK
CONTACT US
SUPPORT
PRIVACY STATEMENT
sonoku.com/implementasi-fuzzy-logic-controller-untuk-kontrol-kecepatan-motor-dc-pada-prototype-kipas-angin/ 9/9