universiti teknikal malaysia melaka -...

24
UNIVERSITI TEKNIKAL MALAYSIA MELAKA VISION-BASED LINE FOLLOWING ROBOT This report submitted in accordance with requirement of the Universiti Teknikal Malaysia Melaka (UTeM) for the Bachelor Degree of Manufacturing Engineering (Robotic and Automation). by SHAMSUDIN BIN SANIP B050810328 FACULTY OF MANUFACTURING ENGINEERING 2011

Upload: others

Post on 02-Sep-2019

32 views

Category:

Documents


0 download

TRANSCRIPT

UNIVERSITI TEKNIKAL MALAYSIA MELAKA

VISION-BASED LINE FOLLOWING ROBOT

This report submitted in accordance with requirement of the Universiti Teknikal

Malaysia Melaka (UTeM) for the Bachelor Degree of Manufacturing Engineering

(Robotic and Automation).

by

SHAMSUDIN BIN SANIP

B050810328

FACULTY OF MANUFACTURING ENGINEERING

2011

UNIVERSITI TEKNIKAL MALAYSIA MELAKA

BORANG PENGESAHAN STATUS LAPORAN PROJEK SARJANA MUDA

TAJUK: Vision-based Line Following Robot

SESI PENGAJIAN: 2010/11 Semester 2

Saya SHAMSUDIN BIN SANIP

mengaku membenarkan Laporan PSM ini disimpan di Perpustakaan Universiti Teknikal Malaysia Melaka (UTeM) dengan syarat-syarat kegunaan seperti berikut:

1. Laporan PSM adalah hak milik Universiti Teknikal Malaysia Melaka dan penulis. 2. Perpustakaan Universiti Teknikal Malaysia Melaka dibenarkan membuat salinan

untuk tujuan pengajian sahaja dengan izin penulis. 3. Perpustakaan dibenarkan membuat salinan laporan PSM ini sebagai bahan

pertukaran antara institusi pengajian tinggi.

4. **Sila tandakan (√)

SULIT

TERHAD

TIDAK TERHAD

(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia yang termaktub di dalam

AKTA RAHSIA RASMI 1972)

(Mengandungi maklumat TERHAD yang telah ditentukan

oleh organisasi/badan di mana penyelidikan dijalankan)

(TANDATANGAN PENULIS) Alamat Tetap:

Kg Parit Penghulu,

Mukin 4, Parit Sulong,83500

Batu Pahat, Johor

Tarikh: 18th May 2011

Disahkan oleh:

(TANDATANGAN PENYELIA)

Cop Rasmi:

Tarikh: 18th May 2011

** Jika Laporan PSM ini SULIT atau TERHAD, sila lampirkan surat daripada pihak berkuasa/organisasi berkenaan dengan menyatakan sekali sebab dan tempoh laporan PSM ini perlu dikelaskan sebagai

SULIT atau TERHAD.

DECLARATION

I hereby, declare this report entitled “VISION-BASED LINE FOLLOWING ROBOT”

is the result of my own research except as cited in references.

Signature : ………………………………

Author’s Name : SHAMSUDIN BIN SANIP

Date : 18th

MAY 2011

APPROVAL

This report is submitted to the Faculty of Manufacturing Engineering of UTEM as a

partial fulfillment of the requirements of the degree of Bachelor Of Manufacturing

Engineering (Robotic and Automation) with Honors’. The member of the supervisory

committee is as follow:

…………………………………..

Mr. Mohd Nazrin bin Muhammad

Supervisor

(Faculty of Manufacturing Engineering)

i

ABSTRACT

Nowadays, technology grows rapidly including the development of the robot. This

project will explore the technology behind vision-based application to control the

movement of the robot. The aim of this project is to develop the vision-based line

following robot. The robot will detect and follow the line image that will be captured

by a camera attached to the robot. Camera that used to capture line image is mounted

on the top of the robot. Moreover, combination of hardware and software plays an

important role along this project. Therefore, one of the objective of this project is to

use the C++ platform and Visual Basic to process the line image. The line image had

to be process through a series of functions to convert into a binary form. Meanwhile,

Micro C is used to process the output from Visual Basic so that Microcontroller

(PIC) can read the instruction. Once the microcontroller received signal from the PC,

it will actuate respective motor in order to make the robot move along the line.

ii

ABSTRAK

Saat ini, teknologi berkembang pesat termasuk pembangunan robot. Projek ini akan

menjelajah teknologi aplikasi berasaskan visi untuk mengendalikan gerakan robot.

Tujuan dari projek ini adalah untuk membangunkan garis visi yang berpusat robot

berikut. Robot ini akan mengesan dan mengikuti garis gambar yang akan ditangkap

oleh kamera yang melekat pada robot. Kamera yang digunakan untuk menangkap

gambar garisan yang telah dipasang di bahagian atas robot. Selain itu, gabungan dari

peranti keras (hardware) dan peranti lembut (software) memainkan peranan penting

di sepanjang projek ini. Oleh kerana itu, salah satu tujuan daripada projek ini adalah

menggunakan landasan C + + dan Visual Basic untuk memproses gambar garisan yg

telah ditangkap.

Gambar garis harus melalui proses siri fungsi-fungsi untuk menukarkan ke dalam

bentuk binari. Sementara itu, Micro C digunakan untuk memproses keluaran (output)

dari Visual Basic sehingga Microcontroller (PIC) dapat membaca arahan yang

ada. Setelah microcontroller menerima isyarat dari PC, maka akan mendorong motor

masing-masing dalam rangka untuk membuat robot bergerak sepanjang garis.

iii

DEDICATION

This thesis is gratefully dedicated to my family and all my friends.

iv

ACKNOWLEGEMENT

Assalamualaikum and I am grateful to God that finally I complete the PSM 1 and

PSM 2 on building and designing a vision-based line following robot. First and

foremost, I would like to express my appreciation and deep respect to my supervisor,

Mr. Mohd Nazrin bin Muhammad for the guidance and encouragement through out

the progress in completing this project.

Secondly, I want to thank my lovely mother and my late father because supporting

me to continue this study. With prayers and moral support from both of them, I have

gained strength to endure in this study. I also want to thank UTeM management

especially from the Faculty of Manufacturing because they give me the opportunity

to get more experiences and knowledge during the period of the research. Special

thanks to my friends that share their idea and advice in completing my project. Their

support and encouragement in my project have helped me in various aspects.

Without their help, this project would very difficult to complete and it will take a

long time to finish.

Finally, thank to my dear family that support me in various field such as fund, idea

and moral in completing the project.

Thank you.

v

TABLE OF CONTENT

ABSTRACT i

ABSTRAK ii

DEDICATION iii

ACKNOWLEGEMENT iv

TABLE OF CONTENT v

LIST OF FIGURES viii

LIST OF TABLE ix

1. INTRODUCTION

1.1 Background 1

1.2 Robots 3

1.3 Problem statement 4

1.4 Objective 4

1.5 Scope 4

2. LITERATURE REVIEW

2.1 Autonomous Robot 6

2.1.1 Manual Remote or Tele-op 7

2.1.2 Guarded Tele-op 7

2.1.3 Line-following Robot 7

2.1.4 Autonomously Randomized Robot 8

2.1.5 Autonomously Guided Robot 8

2.1.6 Sliding Autonomy 8

2.2 Line Following Robot 9

2.2.1 Attiny 2313 10

2.2.2 Microcontroller (PIC16F877A) 10

2.2.3 IR sensor 12

2.2.4 Comparator – LM 324 13

vi

2.2.5 Motor Driver – L293D 13

2.2.6 Algorithm for Line Follower 14

2.3 Vision Based Hardware Setup 14

2.4 Vision Based Software Setup 15

2.5 Motors and Power Transmission 15

2.6 Wireless System Robot 16

2.6.1 RoboEye Wireless Vision System 16

2.6.2 R/C Snooper Robot 17

2.6.3 Surveyor SRV-1 BlackFin Robot 18

2.7 OpenCV 19

2.7.1 IplImage 20

2.7.2 Other structures 20

2.7.3 Image Parameter 21

2.7.4 Capturing an Image and Displaying Images 21

2.7.5 Resolution selection 22

2.7.6 Colour Thresholding – Fixed and Adaptive 22

3. METHODOLOGY

3.1 Mechanical Components 24

3.1.1 Motor 25

3.1.2 Base 26

3.1.3 The chassis and body 26

3.1.4 Battery 27

3.2 Electrical Component 28

3.2.1 Electronic Design 28

3.2.2 Sensor 28

3.2.3 SK40C-CYTRON 30

3.2.4 Motor Driver - CYTRON MD10B10A 31

vii

3.3 Programming Part 32

3.3.1 Visual Basic 32

3.3.2 C++ Programming 33

3.4 Process Flow Chart 34

3.5 Image Processing 35

3.5.1 Image processing flow chart 40

4. DESIGN AND DEVELOPMENT

4.1 Introduction 41

4.2 Body design 42

4.2.1 First design 42

4.2.2 Second design 44

4.2.3 Design Selection Using Pugh Method 45

4.3 Hardware design 46

4.4 Software design 48

4.4.1 Visual Basic 48

4.4.2 Mikro C and Proteus software 51

4.5 Electrical circuit design 52

4.5.1 SK 40C Circuit 53

4.5.2 Motor Driver – MD30B 54

4.6 Finishing development of line following robot 55

5. RESULT AND DISCUSSION

5.1 Introduction 56

5.2 Performance analysis 57

5.3 Problem solution 60

5.4 Conclusion 61

viii

6. CONCLUSION & RECOMMENDATION

6.1 Conclusion 62

6.2 Recommendation 63

REFERENCES 64

APPENDICES

ix

LIST OF FIGURE

FIGURE TITLE PAGE

1.1 Line following robot 2

2.1 Line Following Robot 9

2.2 IR sensor Placement 9

2.3 Comparator Board 9

2.4 Voltage Regulator Board 10

2.5 PIC16F877A Pin Configuration 11

2.6 Line Following Robot Circuit 13

2.7 Mobile Robot Configuration Systems 15

2.8 DC motor 16

2.9 RoboEye 17

2.10 R/C Snooper Robot 17

2.11 Surveyor SRV-1 BlackFin Robot 18

2.12 The visual description of thresholding types 23

3.1 DC Motor SPG30-XX by Cytron 25

3.2 Front and rear wheels 26

3.3 LiPo Rechargeable Battery 7.4V 1300mAH 27

3.4 The webcam sensor built in laptop 29

3.5 SK40C-CYTRON 30

3.6 CYTRON MD10B10A Motor Driver 31

3.7 C++ Programming 33

3.8 A photograph of sub-pixel display elements on a laptop's 36

3.9 The center point 36

x

3.10 The reference point 37

3.11 A counter clockwise rotation through angle θ 37

3.12 The angle of new point 38

4.1 First design of robot 42

4.2 Side view 43

4.3 Top view 43

4.4 Second design of robot 44

4.5 Side view 44

4.6 Front view 45

4.7 The body line following robot. 47

4.8 The webcam located. 47

4.9 The base and body. 48

4.10 Four point detection at visual basic 49

4.11 Program for web cam declaration 50

4.12 Flow chart for operation in visual basic 51

4.13 Connection between computer and microcontroller 52

4.14 Program in MikroC 52

4.15 SK 40C 54

4.16 Line following robot 56

5.1 Line chart for colour range 59

xi

LIST OF TABLE

TABLE TITLE PAGE

2.1 Table Specification of Microcontroller PIC16F877A 12

3.1 Technical specification of LiPo Rechargeable Battery 27

7.4V 1300mAH

4.1 Final Pugh Chart to Obtain the Best Design. 46

4.2 Function Label of SK 40C. 54

5.1 Result for time line following robot navigation 58