DT-AVR Application Note

dokumen-dokumen yang mirip
DT-AVR Application Note

DT-AVR Application Note

DT-AVR Application Note

DT-51 Application Note

DT-AVR Application Note

DT-BASIC Application Note

DT-SENSE Application Note

DT-51 Application Note

DT-51 Application Note

AVR Application Note AN95 Wireless Chatting with PC

DT-51 Application Note

DT-51 Application Note

DT-51 Application Note

Akses SD Card & FRAM Menggunakan MCS-51. Oleh: Tim IE

DT-51 Application Note

DT-AVR Application Note. Gambar 1 Blok Diagram AN133

PC-Link Application Note

DT-51 Application Note

GPS Starter Kit Application Note AN GPS - GPS Navigator. Oleh: Tim IE

DT-BASIC Application Note

asic Application Note AN97 BASIC Chatting

DT-BASIC Mini System. Gambar 1 Blok Diagram AN132

DT-51 Application Note

DT-BASIC Application Note

DT-SENSE. UltraSonic Ranger (USR)

DT-AVR Application Note. AN186 Digital Compass

Gambar 1 Blok Diagram AN72. (a) (b) (c) Gambar 2 SPC Seven Segment (a), DT-51 Low Cost Micro System (b), dan DT-51 Low Cost Nano System (c)

DT-SENSE Application Note

DT-AVR Application Note

SureLink A. Gambar 1 Blok Diagram AN63

DT-51 Application Note

Application Note. Oleh: Tim Digiware dan Hadid T.B. - Sihmanto - Idam F.R. (Institut Teknologi Sepuluh Nopember)

DT-IO Application Note

DT-AVR Application Note

Akses SD Card & FRAM Menggunakan AVR. Oleh: Tim IE

DT-BASIC Application Note

DT-AVR Application Note AN191 SMS Gateway dengan GSM STARTER KIT

DT-I/O DT-I/O. Application Note AN171

DT-I/O. DT-I/O Application Note

SPC SPC. SPC Application Note AN175 Bluetooth Mobile Robot. Application Note AN175

How2Use DT-51 AT89C51XXX BMS. Oleh: Tim IE. Gambar 1 Tata Letak DT-51 AT89C51XXX BMS

DT-SENSE Application Note AN168 Color Game. Gambar 1 Blok Diagram AN168

DT-AVR Application Note

DT-51 Application Note

DT-AVR. AVR Application Note AN160 Graphic LCD Dengan Bahasa C. Application Note AN160

DT-AVR Application Note

DT-AVR. Application Note AN214

DT-AVR Application Note

SPC Application Note. SPC Blue-Link (J2) Tabel 1 Hubungan SPC Blue-Link Dengan Komputer

DT-SENSE. Barometric Pressure & Temperature Sensor

SPC Application Note. SPC IR Transceiver. Gambar 1 Blok Diagram AN159. RX (PORTD.0 J13 pin3 / J4 pin2)

DT-SENSE. Temperature & Humidity Sensor

DT-SENSE. Humidity Sensor

de KITS Application Note AN30 Rotating Display with DT-51 MinSys & de KITS SPC DC Motor

PC-Link Application Note

BAB III DESKRIPSI DAN PERANCANGAN SISTEM

Starter Kit Application Note AN165 - Update Tampilan Character LCD Berbasis USB Flash Disk

DT-SENSE. IR Proximity Detector

DT-SENSE Color Sensor Q uick S tart

DT-I/O DT-I/O. Application Note. Application Note AN193

PC-Link Application Note

DT-Sense Current Sensor With OpAmp Gambar 1 Blok Diagram AN212

2. SPESIFIKASI EKSTERNAL SPC DC MOTOR

DT-AVR Application Note

DT-AVR Low Cost Micro System. Gambar 1 Blok Diagram AN154. RXD (J13 Pin 3) TXD (J8 Pin 4) GND (J10/J11/J12/J13 Pin 1) GND (J7/J8 Pin 1)

DHT11 Temperature and Humidity Sensor Board Gambar 1 Blok Diagram AN196. 5V (Power) GND (Power)

a b c Gambar 1 DT-BASIC Nano System (a), DT-BASIC Micro System (b), DT-BASIC Mini System (c), de KITS Phone Interface ver 2.0 (d)

PC-Link. PC-Link. Application Note AN202

PC-Link. Gambar 1 Blok Diagram AN201. AGND (J3 pin 1) Pin 1 VCC (J3 pin 2) Pin 3 Dapat dipilih salah satu dari A0 s.d. A7 (J3 pin 3 s.d.

BAB 3 PERANCANGAN SISTEM. Computer. Parallel Port ICSP. Microcontroller. Motor Driver Encoder. DC Motor. Gambar 3.1: Blok Diagram Perangkat Keras

DT-SENSE. UltraSonic and InfraRed Ranger (USIRR)

Application Note. Adapun blok diagram secara keseluruhan adalah sebagai berikut: AN156 Touch Screen Panel Graphic LCD 320 x 240

STARTER KIT Application Note AN162 Web Scrapping Dengan GSM STARTER KIT

DT-SENSE. Photoreflector

DC MOTOR. Smart Peripheral Controller

SPC Application Note

de KITS Application Note AN18 - How 2 Use de KITS SPC Stepper Motor with StarTech PPI Card

PC-Link. 1x Komputer / Laptop dengan OS Windows 2000, Windows XP atau yang lebih tinggi. Gambar 1 Blok Diagram AN200

de KITS Application Note AN51 How 2 Use de KITS SPC Character LCD w/ PC

Trademarks & Copyright

DT-AVR Application Note Monitoring Suhu Nirkabel (Bahasa BASIC)

DT-SENSE Application Note

Low Cost Motor Controller

BAB IV PENGUJIAN ALAT DAN ANALISA

Apllication Note AN155 Mini Reklame pada Graphic LCD 320 x 240

DT Series Application Note

DT-AVR. Application Note AN213

DT-AVR Low Cost Nano System. Gambar 1 Blok Diagram Remote TV Berbasis ATtiny2313. DT-I/O I/O Logic Tester

DT-SENSE. Flame Detector

PC-Link Application Note

a b c Gambar 1 DT-BASIC Nano System (a), DT-BASIC Micro System (b), DT-BASIC Mini System (c), de KITS SPC Seven Segment Display (d)

DT-51 Application Note

BAB III METODE PENELITIAN. oleh karenanya akan dibuat seperti pada Gambar 3.1.

BAB III ANALISIS DAN PERANCANGAN SISTEM. besar berupa gambar dengan tujuan agar sebuah sistem dapat lebih mudah

DT-I/O. Application Note AN211. Komunikasi data saat ini terus dikembangkan dan diimplementasikan di dalam setiap bidang, seperti proses

DT-SENSE. Temperature Sensor

Neo Stepper Motor 1.2A

DT-51Application Note

DT-I/O. I/O Application Notes AN164 Komunikasi Jarak Jauh antara 2 PC dengan RS-485. Application Note AN164

SPC SPC. SPC Application Note AN181 - SPC for Hexapod Robot

Transkripsi:

DT-AVR Application Note AN81 Sistem pengendali DC Motor Oleh: Tim IE Sebuah motor DC seringkali digunakan sebagai divais penggerak dalam aplikasi robotika karena harganya relatif murah, tetapi sayangnya untuk mengendalikan motor DC ini relatif rumit. Artikel berikut ini akan menunjukkan bahwa mengendalikan motor DC dengan bantuan adalah sangat sederhana dan mudah. Modul mikrokontroler yang akan digunakan adalah DT-AVR Low Cost Nano System / Low Cost Micro System dan bahasa pemrograman BASIC dengan compiler BASCOM-AVR. Aplikasi ini akan memberi contoh komunikasi SPC DC Motor dengan DT-AVR Low Cost Series, baik secara serial I 2 C maupun paralel. Aplikasi ini dapat dikembangkan menjadi suatu sistem pengendali motor DC sebagai penggerak dalam sebuah peralatan otomatis maupun robot. Komponen yang diperlukan: - 1 DT-AVR Low Cost Nano System / Low Cost Micro System - 1 (Gambar 2) - 1 DC Motor /w Speed Encoder Module (Gambar 2) Adapun blok diagram sistem secara keseluruhan adalah sebagai berikut: Komputer DT-AVR Low Cost Nano System / Low Cost Micro System DC Motor /w Speed Encoder Module Gambar 1 Blok Diagram AN81 Hubungan antara modul-modul tersebut adalah sebagai berikut: DT-AVR Low Cost Nano System / Low Cost Micro System +5VDC GND PB.4* PB.5* +5V (J1) GND (J1) SCL (J2) SDA (J2) * Pin ini tidak mutlak dan dapat diganti pin lain tetapi harus mengubah program Tabel 1 Hubungan DT-AVR Low Cost Nano System / Low Cost Micro System dengan secara Serial I 2 C Pasanglah jumper J3 dari untuk memberi resistor pull up pada jalur komunikasi serial I 2 C (SCL dan SDA). Dan aturlah juga jumper J4 dari agar alamat terprogram board menjadi 111b. Hubungkan DC Motor /w Speed Encoder Module ke sesuai dengan petunjuk dalam manual SPC DC Motor. Gunakan kabel serial DT-AVR Low Cost Nano System / Low Cost Micro System untuk menghubungkan modul dengan komputer. Setelah semua rangkaian dan sumber tegangan terhubung dengan benar, programlah I2CDCMOTOR.BIN atau I2CDCMOTOR.HEX ke dalam DT-AVR Low Cost Nano System (berbasis AT90S2313) dengan menggunakan DT-HiQ AVR In System Programmer atau divais ISP programmer lain dengan konektor header 10-pin standar Atmel. Page 1 of 5

DT-AVR Low Cost Nano System / Low Cost Micro System +5VDC GND PB.4* PB.5* PB.6* PB.7* +5V (J1) GND (J1) Run1 (S1-J5) Dir1 (S2-J5) Run2 (S3-J5) Dir2 (S4-J5) * Pin ini tidak mutlak dan dapat diganti pin lain tetapi harus mengubah program Tabel 2 Hubungan DT-AVR Low Cost Nano System / Low Cost Micro System dengan secara Paralel Untuk komunikasi secara paralel, hubungan antara DT-AVR Low Cost Nano System / Low Cost Micro System dan mengikuti Tabel 2. Setelah semua rangkaian dan sumber tegangan terhubung dengan benar, programlah PARALLELDCMOTOR.BIN atau PARALLELDCMOTOR.HEX ke dalam DT-AVR Low Cost Nano System (berbasis AT90S2313) dengan menggunakan DT-HiQ AVR In System Programmer atau divais ISP programmer lain dengan konektor header 10-pin standar Atmel. Catatan: Dalam aplikasi ini menggunakan DT-AVR Low Cost Nano System (dengan mikrokontroler AT90S2313) sehingga I2CDCMOTOR.BIN / I2CDCMOTOR.HEX maupun PARALLELDCMOTOR.BIN / PARALLELDCMOTOR.HEX yang disertakan dalam AN81.ZIP hanya berlaku untuk AT90S2313. Apabila menggunakan mikrokontroler tipe lain, bukalah I2CDCMOTOR.BAS atau PARALLELDCMOTOR.BAS menggunakan BASCOM-AVR dan ubahlah baris pertama dalam program tersebut: $regfile = 2313def.dat untuk AT90S2313 $regfile = 8535def.dat untuk AT90S8535 $regfile = m8535.dat untuk ATmega8535 (DT-AVR Low Cost Micro System) agar sesuai dengan tipe mikrokontroler yang akan digunakan. Lalu compile ulang program sehingga menghasilkan file dengan ekstensi.bin atau.hex yang sesuai dan dapat diprogram ke dalam modul mikrokontroler. Jalur komunikasi serial I 2 C (SCL & SDA) Jumper alamat terprogram board SPC Input catu daya digital (5 VDC) Jumper untuk resistor pull up Input catu daya motor DC (5-36 VDC) Input pulsa kecepatan motor DC Hubungkan ke terminal motor DC Jalur komunikasi paralel Gambar 2 dan DC Motor /w Speed Encoder Module Page 2 of 5

Flowchart program untuk komunikasi secara Serial I 2 C adalah sebagai berikut: START Konfigurasi port UART Konfigurasi pin I 2 C Penetapan alamat SPC Deklarasi variabel Ubah PWM1 (90h) dan arah putar motor DC 1 (CW) PWM1 = 90h Atur PWM1 (0h), GateTime (40h), arah putar motor DC 1 (CCW) PWM1 = PWM1-5 Aktifkan motor DC 1 Inisialisasi PWM1 J = 0 Tunggu 500 ms Tunggu 1 detik PWM1> 10? J = J + 1 Inputhigh:Inputlow jumlah pulsa kecepatan motor DC 1 dalam 1 detik Kirimkan Inputlow ke komputer Kirimkan Inputhigh ke komputer Ubah PWM1 (0h) dan arah putar motor DC 1 (CCW) Tunggu 5 ms Hentikan motor DC 1 J < 5? END Gambar 3 Flowchart program untuk komunikasi secara Serial I 2 C Program utama untuk komunikasi secara serial I 2 C akan diproses sebagai berikut: 1. Program melakukan konfigurasi port UART dengan baudrate 9600 bps, 8-bit data, 1 stop bit, tanpa bit parity. Dan menentukan definisi pin SDA dan SCL sebagai input / output untuk komunikasi serial I 2 C. Serta penetapan alamat yaitu EEh (alamat terprogram 111b). 2. Kemudian program melakukan deklarasi variabel Sub_data, Inputlow, Inputhigh, I, J. Fungsi dari masingmasing variabel tersebut yaitu: Sub_data adalah variabel yang digunakan untuk data input / output pada sub rutin (misalnya: Init_pwm1). Inputhigh adalah variabel untuk 8-bit data MSB dari jumlah pulsa kecepatan motor DC dalam 1 detik. Inputlow adalah variabel untuk 8-bit data LSB dari jumlah pulsa kecepatan motor DC dalam 1 detik. I, J adalah variabel yang digunakan dalam proses looping. 3. Program menjalankan motor DC 1 dengan kecepatan penuh (PWM1=0h), berlawanan arah jarum jam, dan resolusi pengukuran pulsa kecepatan motor DC sebesar 1Hz (GateTime=40h). Page 3 of 5

4. Program mengambil data jumlah pulsa kecepatan motor DC 1 dalam 1 detik dan dikirimkan ke komputer. Hal ini dilakukan sebanyak enam kali dengan selang waktu 1 detik. Data tersebut dapat dilihat pada layar komputer dengan bantuan HyperTerminal atau Terminal (baudrate 9600 bps, 8-bit data, 1 stop bit, tanpa bit parity). 5. Program mengubah arah putar motor DC 1 menjadi searah jarum jam dan dengan kecepatan agak pelan (PWM1=90h). 6. Naikkan kecepatan motor DC 1 dari PWM1=90h sampai PWM1=10h secara perlahan (dengan resolusi penurunan PWM1 sebesar 5h dan selang waktu 500 ms tiap perubahannya). 7. Program mengubah lagi arah putar motor DC 1 menjadi berlawanan arah jarum jam dan dengan kecepatan penuh (PWM1=0h). 8. Setelah menunggu 5 ms, program menghentikan motor DC 1. Flowchart program untuk komunikasi secara Paralel adalah sebagai berikut: START Konfigurasi pin I/O Deklarasi variabel I Atur arah putar motor DC 1 (searah jarum jam) I = 0 Atur arah putar motor DC 1 (berlawanan arah jarum jam) Run motor DC 1 Run motor DC 1 Tunggu 700 µs Tunggu 2 s Stop motor DC 1 Stop motor DC 1 I = I + 1 Tunggu 700 µs END I < FFFh? Gambar 4 Flowchart program untuk komunikasi secara Paralel Program untuk komunikasi secara Paralel akan diproses sebagai berikut: 1. Program menentukan definisi pin I/O untuk komunikasi Paralel. Dan mendeklarasikan variabel I yang akan digunakan dalam proses looping. 2. Menjalankan motor DC 1 searah jarum jam dengan kecepatan setengah dari kecepatan penuh (T H =700 µs, T L =700 µs), selama 1,4 x 1000h mili detik. 3. Menjalankan motor DC 1 berlawanan arah jarum jam dengan kecepatan penuh selama 2 detik. 4. Menghentikan motor DC 1. Listing program terdapat pada AN81.ZIP. Page 4 of 5

Selamat berinovasi! BASCOM-AVR is copyright by MCS Electronics. HyperTerminal is a copyright by Hilgraeve Inc. Terminal is a copyright by Bray++. Page 5 of 5