Line Detecting Mobile Robot For Delivering And Receiving Loads To Different Set Points.

(1)

LINE DETECTING MOBILE ROBOT FOR DELIVERING AND RECEIVING LOADS TO DIFFERENT SET POINTS

CHAN SENG KIONG


(2)

LINE DETECTING MOBILE ROBOT FOR DELIVERING AND RECEIVING LOADS TO DIFFERENT SET POINTS

CHAN SENG KIONG

This Report Is Submitted In Partial Fulfillment of Requirements For The Degree of Bachelor In Electrical Engineering (Control, Instrumentation, and Automation)

Faculty of Electrical Engineering Universiti Teknikal Malaysia Melaka


(3)

“I hereby declared that I have read through this report and I found that it has comply the partial fulfillment for awarding the degree of Bachelor of Electrical Engineering

(control, instrumentation, and automation)

Signature : ..………..

Supervisor’s name : ………


(4)

“I hereby declared that this report is a result of my own work except for the excepts that have been cited clearly in the references.”

Signature : ………..

Name : ………..

Date : ………..


(5)

iii

Special dedication to my loving parents, Mr. Chan Pak Kim and Mrs. Yong Mui Chai, all my siblings, my kindhearted supervisor Mr. Ahmad Zaki bin Hj Shukor and thanks


(6)

ACKKOWLEDGEMENT

In submitting this report, I would like to thanks Mr. Ahmad Zaki bin Hj Shukor, my supervisor Projek Sarjana Muda (PSM), for his guidance and teachings. His knowledge and insights were invaluable in identifying the ways to solve my problems regarding to my project. I would also wish to extend my gratitude to my parents for their support and their understanding. Lastly, I wish to thanks all my friends that help me in this project.


(7)

v

ABSTRACT

Mobile robots are used extensively nowadays that not only are they used in production lines, mobile robots are even used for household tasks, such as vacuum cleaning and garbage collecting. Mobile robots can now plan their path, do their tasks and then come back to charge up batteries and repeat the cycle for tomorrow and the days after. PIC, is one of the many types of controller that are used to control automatic machinery. It is popular due to its low cost, wide availability, large user base and an extensive collection of application notes. This project intends to design and implement a line following robot to deliver and receive loads from different points in open space. For example in an open office separated with partitions, in hospital corridors or in production lines. This project requires the construction a line following robot and PIC control board for controlling the robot movement such as line following and identifying the destination points. Besides that, the program I use for the PIC control board is MikroC. MikroC is a multi-usage development tool for PIC micros that uses C language as its program language. The target for this design is for delivering loads for humans in an office. This will save human energy and time for delivering document at the office. Once the prototype is complete its use for application can be upgraded.


(8)

ABSTRAK

Pada hari ini robot bergerak alih telah digunakan secara meluas, robot bergerak alih bukan sahaja digunakan di dalam jurusan penghasilan, robot bergerak alih juga digunakan untuk menyelesaikan kerja rumah, seperti membersih vacuum dan mengumpul sampah. Robot mudah alih ini boleh rancang perjalanannya, membuat kerja yang ditetapkan dan kembali untuk mengecas bateri dan mengulangi kerja yang sama pada hari-hari seterusnya. PIC adalah salah satu pengawal yang digunakan untuk mengawal mesin automatik. Ia menjadi pilihan kerana kos rendah, kebolehdapatan yang mudah, terdapat pengguna yang ramai, dan koleksi nota aplikasi yang banyak. Projek ini asalah mereka dan melaksanakan sebuah robot mengikut garis yang boleh menghantar dan menerima beban daripada tempat yang berbeza di kawasan terbuka. Sebagai contoh, dalam sebuah pejabat yang dipisahkan dengan bahagian, lorong hospital atau dalam jurusan penghasilan. Projek ini memerlukan kerja-kerja membina sebuah robot mengikut garis dan papan kawalan PIC untuk kawal pergerakan robot seperti mengikut garisan dan mengenal pasti destinasi. Selain itu, program yang saya gunakan untuk papan kawalan PIC adalah MikroC. Matlamat bagi rekaan ini adalah untuk menghantar beban untuk manusia dalam pejabat. Cara ini dapat menjimatkan masa dan tenaga manusia untuk menghantar dokumen di pejabat. Setelah prototiap ini siap aplikasinya boleh dinaik taraf.


(9)

vii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

SUPERVISOR DECLARATION

PROJECT TITLE i

DECLARATION ii

DEDICATION iii

AKNOWLEDGMENT iv

ABSTRACT v

ABSTRAK vi

TABLE OF CONTENTS vii-x

LIST OF TABLES xiii

LIST OF FIGURES xiv-xvii

1 INTRODUCTION

1.1 Introduction 1

1.1.1 What is a robot? 2

1.1.2 An Autonomous Robot 3 1.1.3 Application of Robot 3-4

1.2 Objective 4

1.3 Problem Statement 4


(10)

2 LITERARUTE REVIEW

2.1 Introduction 6

2.2 Background Study on Line Following Robot 7 2.2.1 Project sample 1: Two inexpensive line

tracking sensors for the MIT Handy Board

Microcontroller 7

2.2.1.1 Prototype Assembly 7-8

2.2.1.2 Comparison between 8-9

IR and LEB/CDs photocell

Line sensor 9-10

2.2.2 Project Sample 2: Desktop line

Following robot 10

2.2.2.1 About line follower 10

2.2.2.2 Hardware 11

2.2.2.2.1 Mechanical part 11-12 2.2.2.2.2 Electronic part 12-13 2.2.2.3 Using photo-reflectors 13-14 2.2.2.4 Signal Processing of line detection 15 2.2.2.5 Tracking Control 16-17

2.3 Microcontroller 17-18

2.3.1 Why Use Microcontroller? 18-19 2.3.2 Overview of microcontroller from Microchip 20 2.3.3 Why Use PIC18F4550 Microcontroller 20-21

2.4 Sensor 21

2.4.1 Infrared sensor 22-24

2.4.1.1 Transmit Configuration 22 2.4.1.2 Reflectance Configuration 23


(11)

ix

2.4.1.3 Triangulation configuration 23-24 2.4.2 How Infrared Sensor work 24

2.5 Motor driver: L293B 25-26

2.5.1 Application Information for L293B 26 2.6 Analog-to-digital converter (ADC) 27

2.7 DC Motor 27

3 METHODOLOGY

3.1 Introduction 28

3.2 Project Methodology 29-30

3.3 Hardware

3.3.1 PIC USB burner 31-33

3.3.2 Microcontroller Board (16F877A 33-37

3.3.2.1 Port Assignment 37

3.3.3 Sensor circuit 38-39

3.3.4 Set Point Switch Circuit 39

3.3.5 Power Supply 40-41

3.4 Software

3.4.1 MikroC Programming 42-45

3.4.2 Proteus Professional 6 45-47

3.4.3 WinPIC800 47-51

4 FINAL RESULT

4.1 Introduction 52

4.2 Electrical and Electronic Development 53

4.2.1 Microcontroller Board 53


(12)

4.2.3 Sensor Circuit 55

4.2.4 Set Point Switch 56

4.2.5 Robot Structure 56-58

4.2.6 Robot Flow Plant 58-59

4.3 Software Development

4.3.1 Program for the Line Following Robot 60 4.4 Analysis

4.4.1 Failure of Circuit Board with USB PIC

Programmer and Microcontroller 61-62 4.4.2 Problem Occurs at Junction Counting 63 5 CONCLUSION

5.1 Introduction 64

5.2 Conclusion 64

5.3 Recommendation and Future Planning 65

REFERENCES 66

APPENDIX A 67

APPENDIX A-1 68-79

APPENDIX B 80-85

APPENDIX C 86-89


(13)

xi

LIST OF TABLE

NO TITLE PAGE

2.1 Component list for desktop line following robot 12 2.2 Some 8-bit Microcontroller and their features 19 3.1 Features and main pin of PIC 16F877A 35 3.2 Assign Input or Output Port of Microcontroller board 37


(14)

LIST OF FIGURES

NO TITLE PAGE

1.1 Robot compared to human 2

2.1 Spacing of emitter and collector 7

2.2 Position of sensor for the robot 7

2.3 Detector/emitter added isolate 8

2.4 Distance between sensors and floor 8 2.5 The line following robot for IR and LED/Cds

Photocell sensors comparison 9

2.6 Bottom and side view of the Desktop line following robot 11 2.7 Electrical circuit diagram for desktop line following robot 13 2.8 Function of photo reflector with or without ambient light 14 2.9 Graph actual line position Vs detected line position 15 2.10 Position of sensors between sensors and distance

Between sensors and floor 15

2.11 Tracking control using PID control 17

2.12 Microcontroller-Based 18

2.13 Pin Diagram of Microcontroller PIC16F877A 21 2.14 The common Strategies of IR sensor 22 2.15 Different Angles with Different Distances 23 2.16 Operation of Infrared Reflective Sensor 24


(15)

xiii

2.18 Motor driver L293B 25

2.19 DC Motor Controls (With connection to ground and

to the supply voltage) 26

2.20 Bidirectional DC Motor Control 26

3.1 Project flow chart 1 29

3.2 Project flow chart 2 29

3.3 USB PIC programmer circuit 31

3.4 USB PIC Programmer 32

3.5 USB PIC burner with 2 selections 33

3.6 PIC 86F877A 34

3.7 Block diagram of microcontroller board 35

3.8 Arrangement of 4 sensors 38

3.9 Sensors circuit 39

3.10 Set point switch circuit 39

3.11 Block diagram of 5V Power Supply to Microcontroller 40 3.12 Block diagram of 9V power supply to DC motor 40 3.13 1.5V GP Nickel Metal Hydride AA battery x 12pieces 41 3.14 Software MikroC open the new project 43

3.15 Step setting up the project 43

3.16 Example writing the program 44

3.17 Example of build project 45

3.18 Proteus Professional 6 Software 46

3.19 Place the HEX file into the microcontroller PIC 16F877 47

3.20 PIC16F877A detected 49


(16)

3.22 Program burning process 50

3.23 Program burning process success 51

3.24 Verifying PIC after burning process 51

4.1 Microcontroller board 53

4.2 Motor Driver 54

4.3 Sensor board (inverter) get signal from sensors and

send to microcontroller board 55

4.4 Sensors board 55

4.5 Set Point Switch 56

4.6 Base structure double gear box and wheel 56

4.7 Robot base structure 57

4.8 Robot structure without basket for deliver purpose 57 4.9 Robot structure with basket for deliver purpose 58

4.10 Flow plant 59

4.11 Circuit diagram of a board with USB programmer

and microcontroller 62


(17)

1

CHAPTER 1

INTRODUCTION

1.1Introduction

In this chapter, robot is the main topic. The topics that will be discussed are the definition of a robot? What is an autonomous robot? Beside that, the objective, scope and also the problem statement of the project will also be presented in this chapter. All these will be discussed in more detail in the sub-topics.


(18)

1.1.1 What is a robot?

According to Robot Institute of America (1979):

“A robot is a reprogrammable, multifunctional manipulator designed to move material, parts, tools, or specialized devices through various programmed motions for the performance of a variety of tasks”.

According to Webster dictionary:

“A robot is an automatic device that performs functions normally ascribed to humans or a machine in the form of human (Webster, 1993).”

Generally, robots have three main parts known as processor, sensor, and motor control system. There are quite similar when comparing human with robot, only the mechanism is different. Sensor of the robot can represent eyes, while actuators represent the legs and controller as the brain as shown in Figure 1.1.

Human Robot

Brain Legs Eyes

Controller Actuators Sensors


(19)

3

1.1.2 An Autonomous Robot

Autonomous robots are robots which can perform desired tasks in unstructured environments without continuous human guidance. A high degree of autonomy is particularly desirable in fields such as space exploration, where communication and delays and interruptions are unavoidable.

A fully autonomous robot in the real world has the ability to gain information about the environments and work for months or years without human navigation assistance. Furthermore, it can avoid situation that are harmful to human, property or itself and repair without outside assistance.

1.1.3 Application of Robot

Robot can replace human’s job in industry because robot can do many things faster than humans. Robots do not need to be paid, eat, drink, or go to the bathroom like human. They can do repetitive work that is absolutely boring to human and they will not stop, slow down, or fall asleep like human.

Individual stationary sensors have limited ranges and applications. Watchdogs or human can lose their level of alertness during a shift or can easily be injured by an intruder. Autonomous robot systems are tools which combine the precision of sensors with the mobility and intelligence of humans. Robotic site security sentries are able to work long hours at a consistently high level of precision and vigilance.

Nowadays, doctors have to use a robot instead when operating. A human would not be able to make a hole exactly one 100th of a inch wide and long. When making medicines, robots can do the job much faster and more accurately and delicate than a human. Some doctors and engineers are developing prosthetic (bionic) limbs by using robotic mechanisms.

People are interested in places that are sometimes full of danger, like outer space, or the deep ocean. Thus, when they cannot go there themselves, they make robots which are able to go there for exploration. The robots are able to carry cameras and others instruments so that they can collect information and send it back


(20)

to their human operators. The continuing development of autonomous robot technologies furthers our abilities to explore the universe.

Beside that, robot can be applied in military operations to reduce the number of casualties which occur during military actions. The military also uses robots for locating and destroying mines on land and in water, entering enemy bases to gather information and spying on enemy troops.

1.2 Objective

The objectives of this project are:

1. To construct a prototype of mobile robot. 2. To construct a prototype controller board.

3. To integrate controller with robot body and sensors for line following. 4. To program the robot to detect destination point when called.

5. To navigate to destination points via knowledge base.

1.3 Problem Statement

Nowadays, document delivery in office and medicine delivery in hospital are very important. Sometimes, humans are careless make the wrong delivery, delivery not on time, and delivering process wasting time. All of these problems can be avoided. So, a delivery robot needed for saving human time, energy, reduce the human carelessness and make sure load is delivered on time.


(21)

5 1.4 Scopes of Project

1. The prototype robot able to follow line to deliver load and receive load to different set point, and able to making decision at junction. 2. The robot is design to function in indoor environment.

3. The robot is design to deliver light weight load such as document.


(22)

CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

There are a number of microcontrollers, motors and sensors in the market with various specifications. Therefore, literature review is done in this chapter to make a review between the various types of microcontroller, motor, and sensors. This is very important as a guide line to choose the most suitable microcontroller, motor and sensor to be used in this project. In this chapter a few sample of line following robot projects becomes references of the project.


(23)

7

2.2 Background Study on Line Following Robot

A line following robot is one of self operating robot that follows the line that drawn on the floor. The movement of the robot is controlled by a programmed microcontroller. Programmer has to ‘teach’ the robot how to follow the line drawn on floor. A few samples of line following robots will be discussed in this chapter.

2.2.1 Project sample 1: Two inexpensive line tracking sensors for the MIT Handy Board Microcontroller.[8]

This project is comparing two types of inexpensive and simple line tracking sensor for line following robot which uses the MIT Handy Board microcontroller. The design of these sensors is somewhat general and can easily be adapted to other microcontrollers, such as Bot Board by Marvin Green, Parallalax Basic Stamps and others. The first sensor presented is infrared based, while the second one uses a red LED and a Cds photocell.

2.2.1.1 Prototype Assembly

Position the sensors on a small PCB with the spacing shown in figure below. This recommended spacing works well for ¾’’ width tape lines.

Figure 2.1: Spacing of emitter and collector

Figure 2.2: Position of sensor for the robot


(24)

The heat shrink tubing was added to isolate each detector/emitter pair to increase sensitivity.

The sensor should be rides between 1/16’’ to 1/8’’ above the ground

2.2.1.2 Comparison between IR and LED/CDs photocell line sensor

A comparison was made between the IR and LED/CDs photocell line sensor. Both sensors were easy to construct and cost about the same amount, however; the IR sensor outperformed the LED/CDs version because of two observed reasons: larger sensor output range and robustness. First, the output of the IR sensor showed higher contrast between black and near white surfaces, i.e., had more range

Figure 2.3: Detector/emitter added isolate.

Figure 2.4: Distance between sensors and floor.


(1)

1.1.2 An Autonomous Robot

Autonomous robots are robots which can perform desired tasks in unstructured environments without continuous human guidance. A high degree of autonomy is particularly desirable in fields such as space exploration, where communication and delays and interruptions are unavoidable.

A fully autonomous robot in the real world has the ability to gain information about the environments and work for months or years without human navigation assistance. Furthermore, it can avoid situation that are harmful to human, property or itself and repair without outside assistance.

1.1.3 Application of Robot

Robot can replace human’s job in industry because robot can do many things faster than humans. Robots do not need to be paid, eat, drink, or go to the bathroom like human. They can do repetitive work that is absolutely boring to human and they will not stop, slow down, or fall asleep like human.

Individual stationary sensors have limited ranges and applications. Watchdogs or human can lose their level of alertness during a shift or can easily be injured by an intruder. Autonomous robot systems are tools which combine the precision of sensors with the mobility and intelligence of humans. Robotic site security sentries are able to work long hours at a consistently high level of precision and vigilance.

Nowadays, doctors have to use a robot instead when operating. A human would not be able to make a hole exactly one 100th of a inch wide and long. When making medicines, robots can do the job much faster and more accurately and delicate than a human. Some doctors and engineers are developing prosthetic (bionic) limbs by using robotic mechanisms.

People are interested in places that are sometimes full of danger, like outer space, or the deep ocean. Thus, when they cannot go there themselves, they make robots which are able to go there for exploration. The robots are able to carry cameras and others instruments so that they can collect information and send it back


(2)

to their human operators. The continuing development of autonomous robot technologies furthers our abilities to explore the universe.

Beside that, robot can be applied in military operations to reduce the number of casualties which occur during military actions. The military also uses robots for locating and destroying mines on land and in water, entering enemy bases to gather information and spying on enemy troops.

1.2 Objective

The objectives of this project are:

1. To construct a prototype of mobile robot.

2. To construct a prototype controller board.

3. To integrate controller with robot body and sensors for line following.

4. To program the robot to detect destination point when called.

5. To navigate to destination points via knowledge base.

1.3 Problem Statement

Nowadays, document delivery in office and medicine delivery in hospital are very important. Sometimes, humans are careless make the wrong delivery, delivery not on time, and delivering process wasting time. All of these problems can be avoided. So, a delivery robot needed for saving human time, energy, reduce the human carelessness and make sure load is delivered on time.


(3)

1.4 Scopes of Project

1. The prototype robot able to follow line to deliver load and receive load to different set point, and able to making decision at junction. 2. The robot is design to function in indoor environment.

3. The robot is design to deliver light weight load such as document.


(4)

CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

There are a number of microcontrollers, motors and sensors in the market with various specifications. Therefore, literature review is done in this chapter to make a review between the various types of microcontroller, motor, and sensors. This is very important as a guide line to choose the most suitable microcontroller, motor and sensor to be used in this project. In this chapter a few sample of line following robot projects becomes references of the project.


(5)

2.2 Background Study on Line Following Robot

A line following robot is one of self operating robot that follows the line that drawn on the floor. The movement of the robot is controlled by a programmed microcontroller. Programmer has to ‘teach’ the robot how to follow the line drawn on floor. A few samples of line following robots will be discussed in this chapter.

2.2.1 Project sample 1: Two inexpensive line tracking sensors for the MIT Handy Board Microcontroller.[8]

This project is comparing two types of inexpensive and simple line tracking sensor for line following robot which uses the MIT Handy Board microcontroller. The design of these sensors is somewhat general and can easily be adapted to other microcontrollers, such as Bot Board by Marvin Green, Parallalax Basic Stamps and others. The first sensor presented is infrared based, while the second one uses a red LED and a Cds photocell.

2.2.1.1 Prototype Assembly

Position the sensors on a small PCB with the spacing shown in figure below. This recommended spacing works well for ¾’’ width tape lines.

Figure 2.1: Spacing of emitter and collector

Figure 2.2: Position of sensor for the robot


(6)

The heat shrink tubing was added to isolate each detector/emitter pair to increase sensitivity.

The sensor should be rides between 1/16’’ to 1/8’’ above the ground

2.2.1.2 Comparison between IR and LED/CDs photocell line sensor

A comparison was made between the IR and LED/CDs photocell line sensor. Both sensors were easy to construct and cost about the same amount, however; the IR sensor outperformed the LED/CDs version because of two observed reasons: larger sensor output range and robustness. First, the output of the IR sensor showed higher contrast between black and near white surfaces, i.e., had more range

Figure 2.3: Detector/emitter added isolate.

Figure 2.4: Distance between sensors and floor.