• Tidak ada hasil yang ditemukan

BAB V KESIMPULAN DAN SARAN

5.2. Saran

Saran untuk pengembangan kontroler lengan robot dengan kendali mouse lebih lanjut ada beberapa saran agar alat ini dapat bekerja lebik baik, yaitu:

1. Perancangan ulang pada konstruksi lengan robot agar lebih kuat dan stabil. Khususnya untuk roda gigi pada Gripper yang belum sempurna.

2. Penggunaan motor mikro servo yang lebih berkualitas pada bagian gripper yang sering kali mudah rusak.

3. Komunikasi antara lengan robot dengan gamepad menggunakan kabel USB. Untuk kedepannya dapat digantikan dengan komunikasi wireless misalnya menggunakan bluetooth dongle, RF, ZigBee, dan Wifi.

59

Daftar Pustaka

[1] http://beriomolina.com/Controlling-a-servo-motor-with diakses pada tanggal 11 Juni 2015

[2] http://arduino.cc/en/guide/introduction diakses pada tanggal 18 November 2014 [3] http://avrprogrammers.com/atmega/atmegaxx8 diakses pada tanggal 25 November 2015 [4] http://hardi-santosa.blog.ugm.ac.id/2012/06/24/kelebihan-arduino-yang-memikat/

diakses pada tanggal 18 Desember 2014

[5] Winoto, Ardi, 2008, Mikrokontroler AVR Atmega8/32/16/8535 dan pemrograman dengan bahasa C pada WinAVR, Bandung : Informatika.

[6] http://www.mdp.ac.id/materi/2011-2012-1/.../TK322-041035-859-21.pdf diakses pada tanggal 11 November 2014

[7] http://bansky.net/blog_stuff/images/servo_pulse_width.png diakses pada tanggal 21 November 2014.

[8] http://datasheet.sparkgo.com.br/SG90Servo.pdf diakses pada tanggal 22 November 2014.

[9] http://www.computer-engineering.org/usbmouse/ diakses pada tanggal 25 November 2014.

[10] http://www.mouser.com/new/arduino/arduino-usb-host-shield/ diakses pada tanggal 18 Desember 2014.

[11] http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus diakses pada tanggal 7 Mei 2015.

[12] https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi diakses pada tanggal 8 Mei 2015.

[13] https://pccontrol.wordpress.com/2011/09/16/pengetahuan-dasar-pemrograman-spi- serial-pheriperal-interface-pada-avr-dengan-avr-studio/ diakses pada tanggal 8 Juni 2015.

[14] http://www.se7ensins.com/forums/threads/tutorial-making-a-usb-to-molex-for-a- ck3-or-other-things.785623/ diakses pada tanggal 28 Januari 2015.

[15] http://www.usbmadesimple.co.uk/index.html diakses pada tanggal 10 November 2014.

60

[17] https://www.networktechinc.com/usb-prots.html diakses pada tanggal 10 Mei 2015. [18] http://www.dfe.com/resources/faq_openloopvsclosedloop.html diakses pada

tanggal 10 Februari 2015.

[19] Pitowarno, Endra,2006, Robotika – Desain, Kontrol, dan Kecerdasan Buatan. Yogyakarta: Andi.

[20] http://www.buildcircuit.com/ftdi-basic-breakout-board/ diakses pada tanggal 24 Februari 2015.

[21] Simanjuntak, Hotlan Y. 2013. Timbangan Saku Digital Miligram Berbasis Mikrokontroler Atmega328. Skripsi Sarjana pada Universitas Sanata Dharma Yogyakarta: tidak diterbitkan.

[22] http://share.pdfonline.com/2e212161834342f9ac9b77b7a56791cf/BAB%20II.html diakses pada tanggal 23 januari 2015.

[23] http://zaada.co.id/ngooprek/?p=18 diakses pada tanggal 9 Maret 2015.

[24] http://www.thingiverse.com/thing:298820 diakses pada tanggal 20 Maret 2015. [25] https://grabcad.com/library/me-arm-v3-0-1 diakses pada tanggal 20 Maret 2015 [26] http://www.rumus-fisika.com/2013/10/pesawat-sederhana.html diakses pada

61

Hasil Pengujian Alat

Grafik L1. Kestabilan Gerak Base

Grafik L2. Kestabilan Gerak Shoulder

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% 1 2 3 4 5 6 7 8 9 10 SUDUT PERCOBAAN

BASE

SUDUT AKTUAL SUDUT ACUAN 0 20 40 60 80 100 120 1 2 3 4 5 6 7 8 9 10 SUDUT PERCOBAAN

SHOULDER

SUDUT AKTUAL SUDUT ACUAN

Grafik L3. Kestabilan Gerak Elbow

Grafik L4. Kestabilan Gerak Gripper

0 20 40 60 80 100 120 1 2 3 4 5 6 7 8 9 10 SUDUT PERCOBAAN

ELBOW

SUDUT AKTUAL SUDUT ACUAN 0 10 20 30 40 50 60 70 80 1 2 3 4 5 6 7 8 9 10 SUDUT PERCOBAAN

GRIPPER

SUDUT AKTUAL SUDUT ACUAN

LISTING KESELURUHAN PROGRAM

L5. Listing Program Keseluruhan Kontroler Lengan Robot dengan kendali mouse #include <avr/pgmspace.h> #include <avrpins.h> #include <max3421e.h> #include <usbhost.h> #include <usb_ch9.h> #include <Usb.h> #include <usbhub.h> #include <avr/pgmspace.h> #include <address.h> #include <hidboot.h> #include <printhex.h> #include <message.h> #include <hexdump.h> #include <parsetools.h> #include <Servo.h> int pos1 = 90; int pos2 = 90; int pos3 = 90; int pos4 = 90;

Servo myservo1; // create servo object to control a servo Servo myservo2; // create servo object to control a servo

Servo myservo3; // create servo object to control a servo Servo myservo4; // create servo object to control a servo

const int maxDeg1 = 180; const int minDeg1 = 0; const int maxDeg2 = 160; const int minDeg2 = 5; const int maxDeg3 = 90; const int minDeg3 = 0; const int maxDeg4 = 180; const int minDeg4 = 40;

const int servo1 = 6; // first servo const int servo2 = 7; // second servo const int servo3 = 8; // third servo const int servo4 = 5; // four servo

class MouseRptParser : public MouseReportParser {

protected:

virtual void OnMouseMove (MOUSEINFO *mi); virtual void OnLeftButtonUp (MOUSEINFO *mi); virtual void OnLeftButtonDown (MOUSEINFO *mi); virtual void OnRightButtonUp (MOUSEINFO *mi);

virtual void OnRightButtonDown (MOUSEINFO *mi); virtual void OnMiddleButtonUp (MOUSEINFO *mi);

virtual void OnMiddleButtonDown (MOUSEINFO *mi); };

void MouseRptParser::OnMouseMove(MOUSEINFO *mi) {

Serial.print("dx=");

Serial.print(mi->dX, DEC);

myservo1.write(pos1);

if(mi->dX >=125 && pos1 > minDeg1) pos1 -= 1; myservo1.write(pos1);

delay(30);

Serial.print(" dy=");

Serial.println(mi->dY, DEC);

if(mi->dY <=-125 && pos2 > minDeg2) pos2 -= 1; myservo2.write(pos2);

if(mi->dY >=125 && pos2 < maxDeg2) pos2 += 1; myservo2.write(pos2);

delay(30);

};

void MouseRptParser::OnLeftButtonUp (MOUSEINFO *mi) {

Serial.println("L Butt Up"); };

void MouseRptParser::OnLeftButtonDown (MOUSEINFO *mi) {

if(pos3 > minDeg3) pos3 -= 5; myservo3.write(pos3); Serial.println("L Butt Dn"); delay(30);

};

void MouseRptParser::OnRightButtonUp (MOUSEINFO *mi) {

Serial.println("R Butt Up"); };

void MouseRptParser::OnRightButtonDown (MOUSEINFO *mi) {

if(pos3 < maxDeg3) pos3 += 5; myservo3.write(pos3); Serial.println("R Butt Dn"); delay(30);

};

void MouseRptParser::OnMiddleButtonUp (MOUSEINFO *mi) {

Serial.println("M Butt Up"); };

void MouseRptParser::OnMiddleButtonDown (MOUSEINFO *mi) {

Serial.println("M Butt Dn");

if(Serial.println("M Butt Dn") && mi->dY >= 0 && pos4 < maxDeg4) pos4 += 1; myservo4.write(pos4);

delay(30);

if(Serial.println("M Butt Dn") && mi->dY <= -0 && pos4 > minDeg4) pos4 -= 1; myservo4.write(pos4); delay(30); }; USB Usb; USBHub Hub(&Usb); HIDBoot<HID_PROTOCOL_MOUSE> Mouse(&Usb); uint32_t next_time; MouseRptParser Prs;

void setup() {

myservo1.attach(servo1); // attaches the servo on pin 6 to the servo object myservo2.attach(servo2); // attaches the servo on pin 7 to the servo object myservo3.attach(servo3); // attaches the servo on pin 8 to the servo object myservo4.attach(servo4); // attaches the servo on pin 5 to the servo object Serial.begin( 115200 );

Serial.println("Start");

if (Usb.Init() == -1)

Serial.println("OSC did not start."); delay( 200 ); next_time = millis() + 5000; Mouse.SetReportParser(0,(HIDReportParser*)&Prs); } void loop() { Usb.Task(); delay(15); }

DATA SHEET KOMPONEN

L8. USB Host Shield

The following device classes are currently supported by the shield:  HID devices, such as keyboards, mice, joysticks, etc.  game controllers - Sony PS3, Nintendo Wii, Xbox360

 USB to serial converters - FTDI, PL-2303, ACM, as well as certain cell phones and GPS receivers

 ADK-capable Android phones and tables

 Digital cameras - Canon EOS, Powershot, Nikon DSLRs and P&S, as well as generic PTP

 Mass storage devices, such as USB sticks, memory card readers, external hard drives  Bluetooth dongles

Dokumen terkait