Exploring A Maze And Finding The Shortest Path Using Soccer Robot.
EXPLORING A MAZE AND FINDING THE SHORTEST PATH USING SOCCER ROBOT
ZULHASNIZAM BIN HASAN
(2)
EXPLORING A MAZE AND FINDING THE SHORTEST PATH USING SOCCER ROBOT
ZULHASNIZAM BIN HASAN
This report is submitted in partial fulfillment of the requirements for the award of Bachelor of Electronic Engineering (Industrial Electronics) With Honours
Faculty of Electronic and Computer Engineering Universiti Teknikal Malaysia Melaka
(3)
UNIVERSTI TEKNIKAL MALAYSIA MELAKA
FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER
BORANG PENGESAHAN STATUS LAPORAN PROJEK SARJANA MUDA II
Tajuk Projek : EXPLORING A MAZE AND FINDING THE SHORTEST PATH USING SOCCER ROBOT
Sesi
Pengajian : 2008/2009
Saya ZULHASNIZAM BIN HASAN mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-syarat kegunaan seperti berikut:
1. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.
2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.
3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi pengajian tinggi.
4. Sila tandakan ( √ ) :
SULIT*
(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKTA RAHSIA RASMI 1972)
TERHAD* (Mengandungi maklumat terhad yang telah ditentukan oleh organisasi/badan di mana penyelidikan dijalankan) TIDAK
TERHAD
Disahkan oleh:
__________________________ ___________________________________
(TANDATANGAN PENULIS) (COP DAN TANDATANGAN
PENYELIA) Alamat Tetap: F 23 JLN PARIT SATU,
PONTIAN
26800 KUALA ROMPIN, PAHANG.
(4)
iii
“I hereby declare that this report is the result of my own work except for quotes as cited
in the references”.
Signature :………..
Author : ZULHASNIZAM BIN HASAN
(5)
iv
“I hereby declare that I have read this report and in my opinion this report is sufficient in
terms of the scope and quality for the award of Bachelor of Electronic Engineering (Industrial Electronics) With Honours.”
Signature :………..
Supervisor name : PN YUSMARNITA BINTI YUSOP
(6)
v
Special dedicated to my beloved parents, family, lectures, and friends, who had strongly encouraged and supported me in my entire journey of learning.
(7)
vi
ACKNOWLEDGEMENT
I have just completed my Final Year Project (PSM) and thesis. First of all, I would like to take this opportunity to express my appreciation to some organization and individuals who kindly contributed for my final year project in UTeM. With the cooperation and contributions from all parties, the objectives of the project; soft-skills, knowledge and experiences were gained accordingly even this is just part of the whole project. Furthermore, I would like thank to my supervisor, Mrs Yusmarnita bt Yusop for the proper guidance, cooperation and involvement throughout my Final Year Project. Her effort to ensure the successful and comfort ability of students under her responsibility was simply not doubtful. Moreover, I would like to extend my sincere acknowledgement to my parent and family member’s who have been very supportive for the past six months. Their understanding and support in term of moral and financial were entirely significance towards the project completion. Last but not list, my appreciation goes to my fellow student in UTeM, especially for who are from FKEKK. Their willingness to help, opinions and suggestions on some matters, advices and technical knowledge are simply precious while doing upon completion of my final year project.
(8)
vii
ABSTRACT
The purpose of this project is to build the program in order to control the system of the robot. The existing mobile robot has function as soccer robot and this project try reprogram that mobile robot using the C language to solve the difficult maze,. The main objective of this project is to navigate the robot to solve the maze. The maze exploration algorithms have been implementing by using wall-following and recursive exploration method on the difficult maze. This method use in this project to get the overcome using that method by implementation into the robot and compares the differential of both methods. The maze exploration algorithm using wall-following used to follow the wall along the maze. However, the maze exploration algorithm by using recursive exploration method is method that used the counter to solve the maze and analysis that maze and try to find the possible shortest path. This project is successfully done by proven both algorithms by solving the maze and the differences of both algorithms are already known.
(9)
viii
ABSTRAK
Projek ini bertujuan membina aturcara kawalan untuk mobil robot. Robot yang digunakan adalah robot yang sebelum ini berfungsi sebagai robot bola sepak dan diprogramkan semula untuk projek ini menggunakan aturcara C sebagai sistem kawalan untuk menyelesaikan masalah “maze” yang sukar. Objektif utama projek ini untuk menunjukkan satu sistem lengkap pergerakan robot bagi menyelesaikan “ maze. Pergerakkan sistem ini membenarkan robot menyelesaikan masalah “maze” yang sukar dengan mengunakan dua algoritma iaitu keaedah penjelajahan “recursive” dan kaedah ikutan dinding. Projek ini cuba mencapai hasil dengan menggunakan dua algoritma tersebut dan membandingkan perbezaan kedua-dua algoritma tersebut. Kaedah algoritma ikutan dinding adalah secara umumnya kaedah ini robot dapat menyelesaikan masalah
“maze” dengan mengikuti dinding kiri pada “ maze” tersebut. Sementara kaedah “
recursive” adalah kaedah mobil robot menyelesaikan “maze” dengan melalui perkiraan
atau bilangan bagi mencari jalan keluar untuk “maze” tersebut dan menganalis jalan
yang paling hampir untuk menyelesaikan masalah “maze” tersebut. Projek ini telah
berjaya membuktikan kedua-dua algorithma dan membandingkan kedua-dua algaritma tersebut.
(10)
ix
TABLE OF CONTENT
CHAPTER CONTENT PAGE
PROJECT TITLE ii
ADMISSION iii
DEDICATION v
ACKNOWLEDGEMENT vi
ABSTRACT vii
ABSTRAK viii
TABLE OF CONTENTS ix
LIST OF FIGURE xii
LIST OF ABREVIATIONS xv
LIST OF APPENDIXS xvii
I INTRODUCTION 1
1.1 Project Introduction 1
1.2 Objective 3
1.3 Scope of Project 3
1.4 Problem Statement 4
1.5 Research methodology 5
1.6 Thesis Outline 5
II LITERATURE REVIEW 7
(11)
x
2.1.1 A Brief History of Maze And Trajectory Planning 8
2.2 Advantage of Soccer Robot 9
2.2.1 Easy to Program (Using The Eyebot Controller) 9
2.2.2 Good Computational Power 9
2.3 Feature of Soccer Robot 10
2.3.1 Specification 11
2.3.2 Eyebot Controller 12
2.3.3 Dc Motor 15
2.3.4 Psd Sensor 16
2.4 Maze Exploration Algorithms 18
2.4.1 Wall-Following 19
2.4.2 Recursive Exploration 19
2.5 Simulation Versus Real Maze Program 23
2.6 Eyesim 24
2.6.1 Feature 25
2.6.2 Creating A Custom Driving Robot 25
III METHODOLOGY 27
3.1 Block Diagram 27
3.2 Flow Chart 29
3.3 Description of Project Process 31
3.4 Procedure And Making The First Step 32
3.4.1 Installation 32
3.4.2 Switching It On 32
3.4.3 Working With Motor, Servos And IR Sensor 34
(12)
xi
IV RESULT AND DISCUSSION 40
4.1 Result and Analysis 40
4.2 Simulation Program 41
4.2.1 Wall Following Exploration Algorithm 41
4.2.2 Recursive Exploration Algorithm 43
4.2.3 Common Flow chart of Both algorithm 48
4.3 Hardware Development 50
4.3.1 Implementation Wall Following Algorithm
on Mobile Robot 50
4.3.2 Implementation of Recursive Exploration
Algorithm on Mobile Robot 54
4.4 Discussion 58
V CONCLUSION AND FUTURE WORK 62
5.1 Conclusion 62
5.2 Suggestion 63
5.3 Project Application 63
5.4 Future Work 64
REFERENCE 65
(13)
xii
LIST OF FIGURE
NO TITLE PAGE
1.1 System block diagram 2
1.2 Maze 2
1.3 Soccer Robot 2
2.1 Block Diagram of Mobile Robot 10
2.2 SoccerBot or Soccer Robot 10
2.3 Eyebot Controller 12
2.4 EyeCon Controller 14
2.5 Motor- Encoder Combinations 15
2.6 Motor Model 16
2.7 Sonar Sensor 17
2.8 Infrared Sensor 18
2.9 Problems For Wall-Following 19
2.10 Left Wall Following versus Recursive Exploration 20
2.11 Maze Algorithm Output 21
2.12 Distance Map Development (Excerpt) 22
2.13 Screen Dump: Exploration, Visited Cells, Distances,
Shortest Path 22
2.14 Shortest Path Position [y,x]=[1,2] 23
2.15 Simulators For Solve The Maze using Virtual Mobile Robot
(14)
xiii
2.16 Simulation Interface 26
3.1 Block Diagram of Project 27
3.2 Flow Chart of The Project Process 30
3.3 Structure Eyebot Controllers 32
3.4 Eyebot Logo 33
4.1 Mobile Robot in Initial Condition 41
4.2 The Coordinates Setting For Y = 4 And X = 4 42
4.3 The Coordinates X-Axis And Y-Axis 42
4.4 The Last Destination of The Mobile Robot At Coordinates 4,4
43
4.5 Mobile Robot in Initial Position 44
4.6 Coordinates X-Axis and Y-Axis 44
4.7 The Mobile Robot Exploring The Maze 45
4.8 The Mobile Robot Exploring The Maze 45
4.9 The Map that Create By Mobile Robot During Exploration
Maze 46
4.10 Control Panel Show The Possible Path to Go to
Coordinates 1,1 46
4.11 Control Panel Calculate the Shortest Possible Path at The
Command Prompt. 47
4.12 The Mobile Robot Move Based on The Possible Path that
Analyzed By Control Panel to Reach Coordinates 1, 1 47
4.13 The Real Maze Build Up For This Project 50
4.14 Initial Position 51
4.15 User Must Put On Any Coordinates in Eyebot Controller 51 4.16 The Mobile Robot Only Follow the Left Wall by Turn 90˚ 52 4.17 The Mobile Robot Turn 180˚ When Have Obstacle on The
Left, Right and at front 53 4.18 The Mobile Robot Explore the Maze and Build The Map 54
(15)
xiv
4.19 Initial Position 55
4.20 User Must Put on Any Coordinates on Eyebot Controller 55 4.21 The Mobile Robot Only Follow the Left Wall by Turn 90˚ 56 4.22 The Mobile Robot Turn 180˚ When Have Obstacle on
Left, Right and at Front 57
4.23 The Different Position of Infrared Sensor On Soccer
Robot And Maze Robot 58
4.24 The Mobile Robot Doesn’t Reach Goal Using Wall
Following Algorithm 59
4.25 Left Wall Following versus Recursive Exploration 59
4.26 The Infrared Sensor Cannot Detect Obstacle When Near
The Wall 60
4.27 The Mobile Robot Must Move on Straight 61
4.28 The Position of Mobile Robot When No Infrared Sensor to
(16)
xv
LIST OF ABREVIATIONS
CCD - Charge-Coupled Device
PSD - Position Sensitive Device
PC - Personal Computer
LCD - Large Graphics Display
CMOS - Complementary Metal-Oxide- Semiconductor
DC - Direct Current
LED - Light Emitting Diode
2D - Two Dimension
3D - Three Dimension
API - Application Programming Interface
RAM - Random Access Memory
ROM - Random –Only Memory TTL - Transistor-Transistor Logic
Hz - Hertz
IR - Infrared
(17)
xvi
CPU - Central Processing Unit
OOP - Object-Oriented Programming
FIRA - Federation of International Robot-Soccer Association
I/O - Input/output
HDT - Hardware Description Table
PWM - Pulse Width Modulation
(18)
xvii
LIST OF APPENDIXS
NO TITLE PAGE
A Eyecon Eyebot Controller M5 66
B Port Interface 67
C Infrared PSD 68
D Programming Instruction 69
E User Manual 95
(19)
CHAPTER I
INTRODUCTION
This chapter discuss about the brief overview about the project such as introduction, objective, scope of study and research methodology.
1.1 Project Introduction
This project about to build the soccer robot that has to explore and analyze an unknown maze consisting of squares of a known fixed size. An important sub-goal is to
keep track of the robot’s position, measured in squares in the x- and y- direction from
the starting position. By referring to Figure 1.2 the soccer robot explores the maze by using exploration algorithms and that algorithm is wall-following and recursive exploration method that interface into the robot. This robot has function only on the maze and tries to solve the difficult maze. This project has divide by 3 important elements to success and that important element as shown in Figure 1.1.
(20)
2
Figure 1.1 System Block Diagram
Figure 1.2 Maze
Figure 1.3 Soccer Robot Input
(Sensor-infrared)
Eyebot controller (C program)
Output
(The motion of robotic to solve the maze)
(21)
3
1.2 Objective
The objective and priority had been locate and been top listed because to ensure the positive progress of the development system. The objective is listed as below:
i) To build the instruction using C language. ii) To implement the maze exploration algorithm. iii) To download c language into the soccer robot.
1.3 Scope of Project
The scope of project will decide the limitation in completing this project. It is important to make sure the project follows as planned. The scope of this project is included:
a) The C Language Software
The project is focus assemble on the mobile robot and generate the program by using the C language software to perform a number of instructions. The C language software used to compile and interface the data by implement into the robot. The program that created by C language software suppose to control and manipulate the mobile robot in order by saving that program into the Eyebot controller.
b) Eyesim Simulator
The Eyesim simulator is introduced that has function as a tool which allows construction of simulated robot environment with using c language and testing of mobile robot program before they are used on the real robot.
(22)
4
c) Eyebot Software
The Eyebot software used to compile and as decoder C language code and generate to hexadecimal code that Eyebot controller on the mobile robot can understand that instruction and make the robot to function.
d) Soccer Robot
The soccer Robot is type of mobile robot was used in this project that reprograms by C language and has function to solve any type of maze using PSD sensor.
1.4 Problem Statements
This project was already done by using this robot as soccer robot. The robot will be reprogramming to solve the maze using the C language. The C language used has function to control the Eyebot controller and the Eyebot have function to control the operation of robot.
This project used two methods to solve the maze. The both of method are implementing the maze exploration algorithms by using wall- following and recursive exploration method. This method use in this project to get the overcome from that method by implemented into the robot.
The existing of the wall-following exploration method used to make the mobile robot always follow the left wall and this project try to solve that problem by follow the right and left wall.
The existing of the recursive exploration method is guarantees that each reachable square in the maze will be visited, independent of the maze construction. The
(23)
5
robot will take the long time to solve that maze but this project try to make the robot can solve the maze by make analysis and find the shortest path.
1.5 Research Methodology
During this project, there are some steps that are taken in order to finish the project. The first step is preparing the Gantt chart for guidelines and work plan.
The second step is study and understands the mobile robot specification, the programming and other related information about it. The research about the system is done and the information will be found at books, internet, library and supervisor. Some programming was doing and run the simulation and assembles to the mobile robot.
The Third step is Software development, the programming was preparing and the simulated program was run to a real situation and tests the function of the mobile robot and the last step is demonstration the supervisor for further adjustment.
1.6 Thesis Outline
Chapter I: This chapter discuss about the brief overview about the project such as introduction, objective, scope of study and research methodology.
Chapter II: This chapter will tell about the theories and algorithm that are being used in order to complete this project. Two exploration alogorithm are being covered in this chapter.
Chapter III: This chapter is about the project methodology. Project methodology is about what processes are being done to complete the project. It emphasizes the details on the processes that are used.
(24)
6
Chapter IV: This chapter is the results and findings chapter. This chapter consists of the results and its findings which most of them are Figures. Alongside with some explanation, this chapter covers the output for this project.
Chapter V: This chapter is to discuss and concludes on the overall project. This chapter emphasizes on advantages and disadvantages. Plus, it includes future modifications and suggestions.
(1)
CHAPTER I
INTRODUCTION
This chapter discuss about the brief overview about the project such as introduction, objective, scope of study and research methodology.
1.1 Project Introduction
This project about to build the soccer robot that has to explore and analyze an unknown maze consisting of squares of a known fixed size. An important sub-goal is to keep track of the robot’s position, measured in squares in the x- and y- direction from the starting position. By referring to Figure 1.2 the soccer robot explores the maze by using exploration algorithms and that algorithm is wall-following and recursive exploration method that interface into the robot. This robot has function only on the maze and tries to solve the difficult maze. This project has divide by 3 important elements to success and that important element as shown in Figure 1.1.
(2)
Figure 1.1 System Block Diagram
Figure 1.2 Maze
Figure 1.3 Soccer Robot Input
(Sensor-infrared)
Eyebot controller (C program)
Output
(The motion of robotic to solve the maze)
(3)
1.2 Objective
The objective and priority had been locate and been top listed because to ensure the positive progress of the development system. The objective is listed as below:
i) To build the instruction using C language. ii) To implement the maze exploration algorithm. iii) To download c language into the soccer robot.
1.3 Scope of Project
The scope of project will decide the limitation in completing this project. It is important to make sure the project follows as planned. The scope of this project is included:
a) The C Language Software
The project is focus assemble on the mobile robot and generate the program by using the C language software to perform a number of instructions. The C language software used to compile and interface the data by implement into the robot. The program that created by C language software suppose to control and manipulate the mobile robot in order by saving that program into the Eyebot controller.
b) Eyesim Simulator
The Eyesim simulator is introduced that has function as a tool which allows construction of simulated robot environment with using c language and testing of mobile robot program before they are used on the real robot.
(4)
c) Eyebot Software
The Eyebot software used to compile and as decoder C language code and generate to hexadecimal code that Eyebot controller on the mobile robot can understand that instruction and make the robot to function.
d) Soccer Robot
The soccer Robot is type of mobile robot was used in this project that reprograms by C language and has function to solve any type of maze using PSD sensor.
1.4 Problem Statements
This project was already done by using this robot as soccer robot. The robot will be reprogramming to solve the maze using the C language. The C language used has function to control the Eyebot controller and the Eyebot have function to control the operation of robot.
This project used two methods to solve the maze. The both of method are implementing the maze exploration algorithms by using wall- following and recursive exploration method. This method use in this project to get the overcome from that method by implemented into the robot.
The existing of the wall-following exploration method used to make the mobile robot always follow the left wall and this project try to solve that problem by follow the right and left wall.
The existing of the recursive exploration method is guarantees that each reachable square in the maze will be visited, independent of the maze construction. The
(5)
robot will take the long time to solve that maze but this project try to make the robot can solve the maze by make analysis and find the shortest path.
1.5 Research Methodology
During this project, there are some steps that are taken in order to finish the project. The first step is preparing the Gantt chart for guidelines and work plan.
The second step is study and understands the mobile robot specification, the programming and other related information about it. The research about the system is done and the information will be found at books, internet, library and supervisor. Some programming was doing and run the simulation and assembles to the mobile robot.
The Third step is Software development, the programming was preparing and the simulated program was run to a real situation and tests the function of the mobile robot and the last step is demonstration the supervisor for further adjustment.
1.6 Thesis Outline
Chapter I: This chapter discuss about the brief overview about the project such as introduction, objective, scope of study and research methodology.
Chapter II: This chapter will tell about the theories and algorithm that are being used in order to complete this project. Two exploration alogorithm are being covered in this chapter.
Chapter III: This chapter is about the project methodology. Project methodology is about what processes are being done to complete the project. It emphasizes the details on the processes that are used.
(6)
Chapter IV: This chapter is the results and findings chapter. This chapter consists of the results and its findings which most of them are Figures. Alongside with some explanation, this chapter covers the output for this project.
Chapter V: This chapter is to discuss and concludes on the overall project. This chapter emphasizes on advantages and disadvantages. Plus, it includes future modifications and suggestions.