You are on page 1of 92

MAZE SOLVING AUTONOMOUS VEHICLE

(NATIONAL ENGINEERING ROBOTICS CONTEST 2014)








AUTHORS
M. ISMAIL ZAFAR 10-MCT-08
SAQUIB SAEED 10-MCT-25
OMER SHAHZAD MUGHAL 10-MCT-31
ABDUL HANNAN SHAHID 10-MCT-35




SUPERVISOR
ENGR. SHOAIB ASLAM





JUNE 2014

DEPARTMENT OF MECHATRONICS ENGINEERING
UNIVERSITY OF ENGINEERING & TECHNOLOGY TAXILA
SUB CAMPUS CHAKWAL
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page ii

Table of Contents
List of Figures .................................................................................................................. vii
List of Tables ..................................................................................................................viii
List of Equations ............................................................................................................... ix
List of Software.................................................................................................................. x
List of Symbols ................................................................................................................. xi
List of Abbreviations ....................................................................................................... xii
Certificate ........................................................................................................................xiii
Undertaking ....xiv
Acknowledgment ............................................................................................................. xv
Abstract ........................................................................................................................... xvi
Chapter # 1 ......................................................................................................................... 1
1.1 Introductions ............................................................................................................. 2
1.2 Working Principle..................................................................................................... 2
1.3 Main Features ........................................................................................................... 3
1.4 Applications .............................................................................................................. 3
Chapter # 2 ......................................................................................................................... 4
2.1 Literature review ....................................................................................................... 5
2.2 Research Paper # 1 ................................................................................................... 5
2.2.1 Abstract .............................................................................................................. 5
2.2.2 Working Principle: ............................................................................................. 5
2.2.3 Conclusion:......................................................................................................... 7
2.3 Research Paper # 2 ................................................................................................... 8
2.3.1 Abstract: ............................................................................................................. 8
2.3.2 Working Principle .............................................................................................. 8
2.3.3 Conclusion:....................................................................................................... 10
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page iii

2.4 Research Paper # 3 ................................................................................................. 10
2.4.1 Abstract ............................................................................................................ 10
2.4.2Working Principle ............................................................................................. 10
2.4.3 Conclusion:....................................................................................................... 12
2.5 Research Paper # 4 ................................................................................................. 13
2.5.1 Abstract: ........................................................................................................... 13
2.5.2 Methods and Working Principle: ..................................................................... 13
2.5.3 Conclusion ........................................................................................................ 14
2.6 Research Paper # 5 ................................................................................................. 15
2.6.1 Abstract ............................................................................................................ 15
2.6.2 Conclusion ........................................................................................................ 15
Chapter # 3 ....................................................................................................................... 16
3.1 Adopted methodology ............................................................................................ 17
3.1.1 Dead End filling ............................................................................................... 17
3.1.2 Wall Following ................................................................................................. 17
3.1.3 Line Tracking (Pure Pursuit Algorithm) .......................................................... 18
Chapter # 4 ....................................................................................................................... 19
4.1 Mechanical Design ................................................................................................. 20
4.1.1 Selection of Material ........................................................................................ 20
4.1.2 3-Dimensional Modeling and robot dimensions .............................................. 21
4.2 Fabrication .............................................................................................................. 22
4.3 Mechanical Components ........................................................................................ 23
4.4 Feasibility of hardware ........................................................................................... 23
4.4.1 Selection of Motors: ......................................................................................... 23
4.4.2 Acceleration Torque ......................................................................................... 25
4.4.3 Total Torque ..................................................................................................... 26
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page iv

4.5 Justification of above design .................................................................................. 26
4.6 Power Calculations ................................................................................................. 26
4.7 Cotter joint design considerations for chains in sprocket chain mechanism .......... 28
4.7.1 Failure of the rods in tension ............................................................................ 30
4.7.2 Failure of spigot in tension ............................................................................... 30
4.7.3 Failure of the rod or cotter in crushing ............................................................. 31
4.7.4 Failure of the socket in tension across the slot ................................................. 32
4.7.5Failure of cotter in shear.................................................................................... 33
4.7.6 Failure of the socket collar in crushing ............................................................ 33
Chapter # 5 ....................................................................................................................... 35
5.1 Electronics Circuitry ............................................................................................... 36
5.2 IR Proximity sensor ................................................................................................ 37
5.2.1 Working ............................................................................................................ 37
5.2.2 Reason for using IR Proximity sensor.............................................................. 38
5.3 Color and Line tracking Sensors ............................................................................ 39
5.3.1 Working ............................................................................................................ 40
5.3.2 Reason for using LDR ...................................................................................... 40
5.4 Motor driving circuit H-Bridge .............................................................................. 40
5.4.1 Using electro - mechanical relays .................................................................... 41
5.4.2 H Bridge using MOSFETs (Switched through Transistors (BJTs)) ............. 42
Chapter # 6 ....................................................................................................................... 44
6.1 Embedded System (ARDUINO Kit) ...................................................................... 45
6.2 Why ARDUINO mega?.......................................................................................... 45
6.2.1 Power ................................................................................................................ 45
6.2.2 Memory ............................................................................................................ 45
6.2.3 USB over current Protection ............................................................................ 46
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page v

6.2.4 ADC ................................................................................................................. 46
6.2.5 ADC Conversion Result ................................................................................... 46
6.2.6 Programming .................................................................................................... 46
6.3 Programming Language used ................................................................................. 46
6.3.1 Examples .......................................................................................................... 47
6.4 Compiling Software ................................................................................................ 48
6.5 Source Code ............................................................................................................ 48
Chapter # 7 ....................................................................................................................... 49
7.1 Mathematical modeling using Control Systems Techniques ................................. 50
7.2 Modeling of electrical circuitry (motor driving circuits)........................................ 50
7.3 Modeling of mechanical and electromechanical part ............................................. 51
7.4 Simulation in MATLAB SIMULINK .................................................................... 54
7.4.1 Simulation Diagram: ........................................................................................ 54
7.4.2 Output Graph of Simulation diagram ............................................................... 55
Chapter # 8 ....................................................................................................................... 56
8.1 Mechatronics system .............................................................................................. 57
8.1.1 Control systems ................................................................................................ 57
8.1.2 Digital control systems (DCS) ......................................................................... 57
8.1.3 Computers ........................................................................................................ 58
8.1.4 Mechanical System .......................................................................................... 58
8.1.5 Electronics systems .......................................................................................... 58
8.2 Phases of Mechatronics system design ................................................................... 58
8.2.1 Modeling and Simulation ................................................................................. 59
8.2.2 Recognition of Need......................................................................................... 59
8.2.3 Conceptual Design ........................................................................................... 59
8.2.4 Mathematical modeling and Control system modeling.................................... 59
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page vi

8.2.5 Prototyping and System Development ............................................................. 59
8.3 General Block Diagram of Mechatronics System .................................................. 60
8.4 Block Diagram of our Mechatronics System ......................................................... 61
8.5 Comparison of General and our Mechatronics system design ............................... 62
8.5.1 Recognition of need and evaluation of engineering specs ............................... 62
8.5.2 Mechanical System .......................................................................................... 62
8.5.3 Electrical System .............................................................................................. 62
8.5.4 Electronic System ............................................................................................. 62
8.5.5 Control System ................................................................................................. 62
8.5.6 Operating Hardware ......................................................................................... 62
8.5.7 Process Design ................................................................................................. 63
8.5.8 Electronic Design ............................................................................................. 63
8.5.9 Hardware and Software Integration ................................................................. 63
8.5.10 Fabrication ...................................................................................................... 63
8.5.11 System testing ................................................................................................ 63
Future Work ..................................................................................................................... 65
Conclusion ....................................................................................................................... 68
Appendix .......................................................................................................................... 68
References ........................................................................................................................ 74








Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page vii

List of Figures
Figure 2.1: Block Diagram RP........................................................................................... 7
Figure 2.2: Pure Pursuit Algorithm .................................................................................... 9
Figure 2.3: Random Mouse Algorithm ............................................................................ 11
Figure 2.4: Tremauxs Algorithm .................................................................................... 12
Figure 4.1(a) : 3D Modeling ............................................................................................ 21
Figure 4.1(b) : Picture of Robot ....................................................................................... 22
Figure 4.2: Free Body Diagram of Robot ........................................................................ 24
Figure 4.3: Free Body Diagram of Mechanical Power Consumption ............................. 27
Figure 4.4: Cotter Joint 2D Drawing ............................................................................... 28
Figure 4.5: Failure of spigot in tension ............................................................................ 31
Figure 4.6:Failure of the rod crushing ............................................................................. 31
Figure 4.7:Failure of socket in tension ............................................................................ 32
Figure 4.8:Failure of cotter in shear ................................................................................. 33
Figure 4.9 Socket collar Failure ....................................................................................... 34
Figure 5.1: Complete circuit of our Project on Proteous ................................................. 37
Figure 5.2: Working of IR Sensor.................................................................................... 38
Figure 5.3: IR sensor principle......................................................................................... 38
Figure 5.4:Color sensor cicuit diagram ............................................................................ 39
Figure 5.5: H-Bridge via Relays ...................................................................................... 41
Figure 5.6: H-Bridge via Mosfets .................................................................................... 42
Figure 6.1: ARDUINO Kit .............................................................................................. 45
Figure 7.1: Electrical Circuit Modeling ........................................................................... 50
Figure 7.2: Modeling of Motors....................................................................................... 51
Figure 7.3: Motor interface .............................................................................................. 53
Figure 7.4: MATLAB SIMULINK diagram ................................................................... 54
Figure 7.5: MATLAB SIMULINK graph ....................................................................... 55
Figure 8.1: Mechatronics system ..................................................................................... 57
Fig 8.2: Phases of Mechatronics system .......................................................................... 58
Fig 8.3: General Block Diagram of Mechatronics system ............................................... 60
Fig 8.3:Block Diagram of our Mechatronics system ....................................................... 61
Figure 8.4: General Block Diagram of our system .......................................................... 63
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page viii

List of Tables
Table 4.1: Dimensions of Robot ...................................................................................... 22
Table 4.2: Mechanical Components ................................................................................ 23
Table 5.1: Electrical Components .................................................................................... 36
Table 6.1: General Commands of AURDUINO v1.1.8 ................................................... 47

























Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page ix

List of Equations
Equation 4.1: Weight of Robot ........................................................................................ 24
Equation 4.2: Moment of Inertia ...................................................................................... 24
Equation 4.3: Gravitational Torque ................................................................................. 24
Equation 4.4: Frictional Torque ....................................................................................... 25
Equation 4.5: Load Torque .............................................................................................. 25
Equation 4.6: Uniform velocity equation......................................................................... 25
Equation 4.7: Total Torque .............................................................................................. 26
Equation 4.8: Mechanical Power ..................................................................................... 27
Equation 4.9: Failure of rod ............................................................................................. 30
Equation 4.10: Failure of spigot....................................................................................... 31
Equation 4.11: Failure of the cotter ................................................................................. 31
Equation 4.12: Failure of the socket ................................................................................ 32
Equation 4.13: Failure of cotter ....................................................................................... 33
Equation 4.14: Socket collar failure ................................................................................. 34
Equation 7.1: Loop 1 differential equation. ..................................................................... 50
Equation 7.2: Loop 2 Differential eq. .............................................................................. 51
Equation 7.3: Loop 2 differential eq. ............................................................................... 51
Equation 7.4: Transfer function of motor ........................................................................ 52












Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page x

List of Software
1- Solid Edge V16
2- Proteus V7
3- ARDUINO MEGA Training Kit Programming Software
4- MATLAB 2007a
5- Microsoft Office





















Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page xi

List of Symbols
P= load carried by the rods
D= diameter of the rods,
D
1
= outside diameter of socket,
D
2
= diameter of spigot or inside diameter of socket
D
3
= outside diameter of spigot collar
T
1
= thickness of spigot collar
D
4
= diameter of socket collar
C = thickness of socket collar
B= mean width of cotter
T = thickness of cotter
L = length of cotter
A= distance from the end of the slot to the end of rod
= Torque

c=
Crushing Stress
r = radius of wheel
T
m
(s) = in terms of
m
(s) if we are to separate the input and output variables and obtain
the transfer function,
m
(s)/E
a
(s).
J
m
= inertia at the armature and includes both the armature inertia and, the load inertia
D
m
= viscous damping at the armature and includes both the armature viscous damping
and, the load viscous damping









Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page xii

List of Abbreviations
Direct Current (DC)
Rotations per Minute (rpm)
Volts (V)
3-Dimensional (3D)
Infrared (IR)
Input and Output (I/O)
Light Dependent Resistance (LDR)
Artificial Intelligence (AI)
Control System Runs Based maze solving algorithm (LSRB)
Maze Solving Robot (MSR)
Central Processing Unit (CPU)
Analog to Digital Converter (ADC)
Digital to Analog Converter (DAC)
Bipolar Junction Transistor (BJT)
Light Emitting Diode (LED)
Pulse width Modulation (PWM)
Electrically Erasable Program able Read Only Memory (EEPROM)
Alternating Current (AC)
Static Random Access Memory (SRAM)
Universal Storage Bus (USB)
Millie Amperes (mA)
Input Voltage (V
in
)
Output Voltage (V
ref
)
Analog to Digital converter Interrupt Flag (ADIF)
Analog to Digital converter least significant value (ADCL)
Analog to Digital converter highest significant value (ADCH)
Computer Aided Design (CAD)
Metal Oxide Semi-conductor Field Effected Transistor (MOSFET)
Sound Navigated And Ranging (SONAR)
National Engineering Robotics Contest (NERC)
Global Positioning system (GPS)
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page xiii

Certificate

This is to certify that M. Ismail Zafar, Saquib Saeed, Omer Shahzad Mughal and
Abdul Hannan Shahid have successfully completed their final year project. This
project Maze Solving Autonomous Vehicle had been assigned to them to fulfill
the partial requirements for the bachelor degree of Mechatronics Engineering.





Engr. Shoaib Aslam
Project Supervisor






Engr. Amir Sultan
Chairman















Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page xiv

Undertaking
We certify that project work titled Maze solving autonomous vehicle is our own work.
The work has not, in whole or in part, been presented elsewhere for assessment. Where
material has been used from other sources it has been properly referred.







____________________
M. Ismail Zafar
(10-MCT-08)

____________________
Saquib Saeed
(10-MCT-25)

____________________
Omer Shahzad Mughal
(10-MCT-31)

____________________
Abdul Hannan Shahid
(10-MCT-35)









Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page xv

Acknowledgment
We have taken efforts in this project. However, it would not have been possible
without the kind and merciful support and help of Allah Almighty and support of many
individuals and organizations. We would like to extend our sincere thanks to all of them.
We are highly indebted to our project advisor Engr. Shoaib Aslam for his
guidance and constant supervision as well as for providing necessary information
regarding the project.
We are thankful to our parents and family members for their support and
motivation throughout the project morally and monetarily.
We are obliged to faculty members of our campus, for the valuable information
provided by them in their respective fields. We are grateful for their cooperation during
the period of our project.


Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page xvi

Abstract
The main objective of the project is to come up with an autonomous robot that
can imitate the behavior of a Self-Guided Vehicle in an industry with manual loading
and automatic unloading at specified location. As we are also have a vision to win the
NERC 2014. So, we are preparing our vehicle on the theme of NERC 2014. Therefore,
we have to design the vehicle in the light of rules of NERC 2014.
We have selected aluminum sheet as material for the base of autonomous vehicle
because of its unique property of providing maximum strength with considerable less
weight than other metals. The DC Gear Motor having torque of 266 Nm and angular
speed 150 rpm was chosen over various other motors because the DC gear motor can
provide much greater torque than simple DC motor at same power rating. Chains of
suitable dimensions were used to provide drive to the wheels through motor. Mechanical
modeling of the project was implemented on Solid Edge (V16) successfully and after
consulting with our project supervisor, 3D model was translated and converted into
hardware.
We have used IR proximity sensors and SONAR sensor to perform path finding
and maze solving operations. IR proximity sensors are preferred over SONAR because
of its precision, high data refreshing rate and it is convenient to interface IR sensor with
AURDUINO kit than SONAR and other proximity sensors. Five IR proximity sensors
are used to solve the maze and for the alignment of vehicle in the arena while just a
single SONAR is interface with AURDUINO for the detection of wall in any case of
reverse motion. LDR based color sensors would be used for color detection and line
tracking operations in the workspace. Color detection is needed at the starting spot
where the vehicle would detect its initial path which it has to follow to reach at
unloading position and it would also be needed at traffic signals (zone detection) where
the vehicle had to stop during the course of its journey.
AURDUINO kit has been preferred over PIC and AVR microcontrollers
because it has more I/O terminals, operating power ratings are more desirable with a
less probability of burning out, data processing and execution speed are higher, higher
analog to digital convertor resolution and also there is no need for separate burner to
burn code into controller of AURDUINO kit.
To check the stability of our system (autonomous vehicle), the complete
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page xvii

mathematical modeling of the system was done using the techniques of control system
by which an improper fraction of transfer function was obtained. This equation
contains some constant factors related to the specifications of motor and would be
available to us when the pre ordered motors along with their data sheets will arrive.
Using MATLAB, the improper fraction has been converted into a proper one, than we
checked the stability of the equation by undergoing simulation in MATLAB
SIMULINK.

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 1

Chapter # 1








Preliminary Concepts








Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 2

1.1 Introductions
The main objective of the project is to come up with an autonomous robot that
can imitate the behavior of a Self-Guided Vehicle in an industry with manual loading
and automatic unloading at specified location. A maze is a tour puzzle in the form of a
complex branching passage through which the solver must find a route. In everyday
speech, both maze and labyrinth denote a complex and confusing series of pathways, but
technically the maze is distinguished from the labyrinth, as the labyrinth has a single
through-route with twists and turns but without branches, and is not designed to be as
difficult to navigate. The pathways and walls in a maze or labyrinth are fixed (pre -
determined) puzzles where the walls and paths can change during the game are
categorized as tour puzzles.
The robot consists of Analog sensor array (Five IR Proximity sensors and one
SONAR); the Arduino board must stay centered within the base wood to prevent
compounding errors in distance and damages with the obstacles. Controlling the motors
is responsible for safely moving the robot through the maze. There are two
motors, each, with RPMs of 150 to carry a weight of about 13kg (including board and
battery). In order to ensure that the robot is not slipping and to avoid collision with the
obstacles, the motors are controlled with IR Proximity sensor. And according to our
needs, we can make use of it to control the speed of the motors. The chases need to carry
the board, circuits, sensors and batteries. And the chases are designed to turn 90 and
180. If the and track branching or ending are available in the routing, then it makes the
decision based on the algorithms.
1.2 Working Principle
The vehicle using inputs from the sensors selects the most suitable path of the
given paths to reach a particular point. Then after reaching at that point (where it has
to unload) the vehicle has to manage itself in the middle of walls or obstacles of
maze. For this purpose, a line is present on the floor of maze and by following that
line vehicle will align itself in the center for better unloading. So, these are the main
points in working principle:
1- Wall following and Pledge algorithm
2- Pure pursuit algorithm


Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 3

1.3 Main Features
The robot is capable of solving the maze provided by using a combination of
algorithms thats why it is able to deal with a large variety of mazes. The robot we have
designed is also equipped with color sensors for detection of traffic signals which is
helpful in zone detection in case of industrial trucks. The robot is also equipped with line
tracking sensor which will guide the robot through an area in which there are no walls
present in maze and also help in attaining a perfect alignment between walls of the path.
We can also use an additional SONAR sensor in case there is noise in the inputs from IR
sensor. The unloading mechanism has two slots which will help in accommodation of
more material to deliver.
1.4 Applications
1- Spy robots
2- Suicidal robots
3- Inspection Robots
4- Automated Industrial Trucks etc.
5- Bomb Sniffing robots














Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 4

Chapter # 2







Literature review













Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 5

2.1 Literature review
Many engineers have worked on such type of projects. The main difference
among maze solving robots is the use of technique for solving the maze (finding
path).Here we will discuss those research works which have helped us in compiling
maze solving technique for our robot.
2.2 Research Paper # 1
Title: An Autonomous Robot Framework for Path Finding and Obstacle Evasion
Authors: Imran Sarwar Bajwa,Natasha Nigar and M J Arshad
Year of publication: November 2011
2.2.1 Abstract
When the history of world would be written surely out contemporary age would
be called the age of science and technology. The marvels of science and technology has
not only bewildered human minds but also brought convenience and quality to human
life. Our project is continuation of this tradition of science. We have endeavored to
design an autonomous path tracker vehicle. It has limitless possibilities of usage and it
would certainly become a future workhorse. It can be used to detect the theft vehicles.
Autonomous robot for path finding and obstacle evasion is a vehicle, which follows the
path in two different ways, which are:
2.2.1.1 Line Follower:
It is a vehicle, which is used to follow the reflecting line drawn on the floor. It
captures line position with IR sensors. The sensors will be mounted at front end of the
robot.
2.2.1.2 Obstacle Handling:
When an obstacle is appeared on the following line we will detect through a
sensor.
2.2.2 Working Principle:
There are two things in its working:
2.2.2.1 Line following:
The robot will follow the reflecting line drawn on the floor with the help of LDR
sensor. So, according to our requirement the robot should follow the line perfectly then
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 6

the positions of the sensors must be perfect. Now robot is left free on that line. Robot
will follow the line sensing it through the sensors placed on the front bottom of the
robot.
2.2.2.1.1 Pure Pursuit Algorithm
These algorithms utilize the spatial information for the sake of computation of
the guiding commands and assist a robot in following a given path or stripe.
However, both these algorithms do not often consider the actual curves of the target
path/stripe. Due to this short coming of this algorithm, this provides with less
accuracy.
These are the following steps which used to find the unknown path for a robot.
1- Obtain current position of the vehicle.
2- Find the goal point.
3- Calculate the point on the path closest to the vehicle.
4- Compute a certain look-ahead distance D.
5- Obtain goal point by moving distance D up the path from point.
6- Transform goal point to vehicle coordinates.
7- Compute desired curvature of the vehicle.
8- Move vehicle towards goal point with the desired curvature.
9- Obtain new position and go to point 2.
2.2.2.2 Wall Following:
The obstacles in the way of the robot will be detected by the sensors (IR analog)
mounted on the sides, front and back of the robot. When an obstacle will be detected the
robot will stop and turn to that side where the obstacle is not present.
2.2.2.2.1 Dead-end filling Algorithm
Dead-end filling is an algorithm for solving mazes that fills all dead ends,
leaving only the correct way unfilled. It can be used for solving mazes on paper or with
a computer program, but it is not useful to a person inside an unknown maze since this
method looks at the entire maze at once. The method is following:
1- Find all of the dead-ends in the maze, and then
2- "Fill in" the path from each dead-end until the first junction met.
Dead-end filling cannot accidentally "cut off" the start from the finish since each
step of the process preserves the topology of the maze. Furthermore, the process won't
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 7

stop "too soon" since the end result cannot contain any dead-ends. Thus if dead-end
filling is done on a perfect maze (maze with no loops) then only the solution will
remain. If it is done on a partially braid maze (maze with some loops), then every
possible solution will remain but nothing more.


Figure 2.1: Block Diagram RP2
2.2.3 Conclusion:
The motion of robot will be controlled by the line tracking and the obstacle
sensors on the path from start to the end point. A vehicle will following an ascender that
will send the path to the follower, follower will follow that path. This is done using
storing the signal values and particular time for which a value is retained is stored in the
memory of controller and when there is no signal interrupt from user then all of the data
from memory contents is sent to the memory of the other controller. Then this data is
executed by the follower which results in following the same path that is followed by the
leader vehicle.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 8



2.3 Research Paper # 2
Title: Path Tracking for a Miniature Robot
Authors: Martin Lundgren
Year Of publication: 2003
2.3.1 Abstract:
Path tracking is the process concerned with how to determine speed and steering
settings at each instant of time in order for the robot to follow a certain path. A path
consists of a set of points representing the positional coordinates of a particular route.
Often when implementing a path tracking algorithm, one also have to implement a path
recording unit responsible for saving all the coordinates that constitutes the path. A
human operator then has the possibility to manually steer the robot along some track
while the path recording unit saves the information about the path. The path tracking
algorithm also has to handle unplanned positional or orientation deviations from the
path. Such deviations can be caused by odd-metric errors of some kind, or by new
obstacles occurring on the path that must be avoided.

2.3.2 Working Principle
The robot will find the correct path and required final position by line tracking in
both methods mentioned below. In look a-head distance the robot will find its next
position in the path by comparing the current position with the next specified point
generated by the programmer with his calculation in the program. That program is stored
in the memory of the controller. The next point at some distance in the path is called the
look a-head point. In vector pursuit method there are two different algorithms present all
the time when robot is following a path. One is for straight path and other one is for
circular path. This method is also called the screw theory.
This research paper actually described the following techniques of maze solving:
1- Look a-head distance
2- Vector pursuit algorithm
2.3.2.1 Look a-head distance
This method uses a look a-head point, which is a point on the path a certain
distance L away from the orthogonal projection of the vehicles position on the path. The
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 9

distance L between these look a-head points is called a look a-head distance.
In this algorithm the path is divided into small goal positions called look a-
head points as explained above. Once the robot achieves the first position it then
moves towards the second one then towards the third and finally reaches the end
position.
Path tracking techniques that use this look-ahead point are called geometric
algorithms.
There are two problems that need to be considered:
1- Regaining a path
2- Maintaining the path
2.3.2.2 Vector pursuit algorithm
Vector pursuit is a path tracking method that uses the theory of screws first
introduced by Sir Robert S. Ball.
2.3.2.2.1 Screw theory
Screw theory has the following points:
1- Screw control was developed in an attempt to not only have the vehicle arrive at
the goal point, but also to arrive with the correct orientation and curvature.
2- The first screw accounts for the translation from the current vehicle position to
the look-ahead point, while the second screw represents the rotation from the
current vehicle orientation to the orientation at the look-ahead point.











Figure 2.2: Pure Pursuit Algorithm
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 10

2.3.3 Conclusion:

1- The look a-head distance method is useful where we just have to follow the path
and no alignment is required means accuracy is not important. Once the robot is
disturbed from the path during motion then it cannot find the path on its own
when its program is based on this method.
2- In vector pursuit method the robot can follow the path but whenever it is
disturbed from the path during motion it has the ability to find the path again on
its own. This is the benefit of this method over the look a-head distance method.
2.4 Research Paper # 3
Title: A Maze-Solving Robot
Author: C. Scott Ananian and Greg Humphreys
Year of publication: May 1997
2.4.1 Abstract
In this activity you will use RoboMind, a robot simulation environment, to solve
simply connected mazes. A simply connected maze is a maze has no loops, and no
inaccessible areas. There is programming involved in completing this activity. The
RoboMind programming language is very simple based on the maze solving
algorithms. Algorithms are a description of the steps one takes to solve a problem; a
maze solving algorithm is just the rules that the robot will follow to solve the maze,
once you have translated it into code. However this activity does not include a
programming tutorial. If you don't have any programming experience, you might want
to try the Getting Started activity first, as it includes step-by-step instructions for
programming the RoboMind robot.

2.4.2Working Principle
These algorithms are based on the obstacle detection. In these algorithms when
the robot will find an obstacle in front of it, at sides or at the backside, it will turn and
find the other path where no obstacle is present. By wandering around the maze, using
this method it will find the end of the maze. In solving the maze, robot may or may not
visit a path which it has already visited.
This research paper actually described the following techniques of maze solving:
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 11

1- Random mouse algorithm
2- Tremauxs Algorithm
2.4.2.1 Random mouse algorithm

The Random Mouse algorithm is just what it sounds like: it's the way a mouse
would solve a maze. The Random Mouse algorithm is just wandering around the maze,
hoping you find the end. It was quite time wasting technique. The figure mentioned
below gives the best explanation of random mouse algorithm.

Figure 2.3: Random Mouse Algorithm
2.4.2.2 Tremauxs Algorithm
This Maze solving method is designed to be able to be used by a human inside of
the Maze. It's similar to the recursive backtracker and will find a solution for all Mazes:
As you walk down a passage, draw a line behind you to mark your path. When you hit a
dead end turn around and go back the way you came. When you encounter a junction you
haven't visited before, pick a new passage at random. If you're walking down a new
passage and encounter a junction you have visited before, treat it like a dead end and go
back the way you came. (That last step is the key which prevents you from going around
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 12

in circles or missing passages in braid Mazes.) If walking down a passage you have
visited before (i.e. marked once) and you encounter a junction, take any new passage if
one is available and otherwise take an old passage (i.e. one you've marked once). All
passages will either be empty, meaning you haven't visited it yet, marked once, meaning
you've gone down it exactly once, or marked twice, meaning you've gone down it and
were forced to backtrack in the opposite direction. When you finally reach the solution,
paths marked exactly once will indicate a direct way back to the start. If the Maze has no
solution, you'll find yourself back at the start with all passages marked twice.

Figure 2.4: Tremauxs Algorithm
2.4.3 Conclusion:
In my view these algorithms are best just for the initial learning and
building concepts about the maze solving techniques. But these algorithms are
not suitable for my project as these are quite time consuming algorithms.
Tremauxs algorithm is the small application of A.I. but it is not the requirement
of my project.

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 13

2.5 Research Paper # 4
Title: MacroMouse: A Maze Solving Robot
Authors: Gagan Awhad, Kris Marose, Xi Qiao, Carl Magnuson
Year of Publication: March 2009
2.5.1 Abstract:
This report is based around the robots involved in a MicroMouse competition,
that is, a robot which is able to search and solve a maze. This project will focus on the
design of such a robot, including the advantages and disadvantages of different robot
designs. It will also touch on methods for solving a maze, specifically focusing on a
real-time search, where the robot searches an unknown maze until it finds a goal. The
project also includes localization and mapping of the maze in real time.
2.5.2 Methods and Working Principle:
The first focus of our work was to familiarize ourselves with the Explorer robot,
set up the build environment and implement and test simple motion and sensing. There
were a number of difficulties however in getting a working build environment such as
changed and undocumented access passwords to online data sources and dead links to
important files. After creating a working build environment the problem was to test
simple motion and sensing. Motion was already written into the Explorer Player driver,
however there was no existing code to read values from the two infrared sensors
mounted on the front of the robot. Reading this data would be essential to localization
and decision planning for mapping the maze. 3 We were able to implement the
necessary sensing functions in the Explorer Player driver and wrote code for the
Roboaudiostix board which handles the sensor I/O to communicate the sensor data to the
Player driver over the i2c bus. However in testing the sensing code we were receiving
nonsense data from the sensors and expect there is some fault in the code running on the
Roboaudiostix. Due to time constraints of the project and continuing difficulties in
reading sensor data we made the decision to stop work on the Explorer sensing and use a
fully functional and well documented robotic platform - the Pioneer robot.
The decision to move to the Pioneer platform changed many of the physical
implementation details. It would not be possible to build a very large physical maze due
to the size needed for each cell to fit the Pioneer plus some padding room to allow for
minor drift and imprecision. The Pioneer does however have the advantage of having a
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 14

180 degree laser sensor which is very precise. This became essential in the localization
and motion problem because as we would find out, its odometry is very poor. We also
lost some of the direct hardware control we would have had with the Explorer in moving
to the Pioneer which incorporates its own smoothing and trajectory to commands its
Player driver receives. There was fortunately a much smaller learning curve to working
with the Pioneer as we were already familiar with it from a previous assignment and
because it is a popular commercial product with many resources for help and
information.
2.5.3 Conclusion
The transition from a simulated model to real world testing is not a trivial one,
and exposes many factors which were not or could not be accounted for in the
simulation. The hard constraints of the real world mean that what is theoretically
possible and shown in a simulation may not be necessarily feasible to implement in
practice. The biggest challenge in our transition from simulation to the real world was of
that of accurate movement and localization. Due to the constraints of the Pioneer robot,
we solved the maze at a fairly low speed and did not do more advanced scanning of cells
to look ahead multiple positions as was possible in the simulation. The localization issue
was the biggest factor we had to deal with once we moved to the physical world. If this
problem were solved we could have much easier motion primitives and drift
compensation, have more precise and useful sensing and solved the maze at a higher
speed with essentially no risk of a collision. This project attempted to minimize the
difficulties of localization by leveraging the discrete structure of the maze, something
which did simplify the problem, but did not eliminate the problem of localization.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 15

2.6 Research Paper # 5
Title: Maze Solving Robot Using Arduino and LSRB Algorithm
Authors: J.Arun Pandian, R.Karthick, B.Karthikeyan
Year of Publication: June 2010
2.6.1 Abstract
This paper MAZE SOLVING ROBOT USING ARDUINO AND LSRB
ALGORITHM deals with the development maze robot using simple circuits. A MSR (maze
solving robot) is a clever little gadget with a silicon brain that finds its way through an
arbitrary maze. It competes against other members of its species, racing as fast as it can. Here
MSR is an electro-mechanical device, typically consisting of three main subsystems. They are
drive system, an array of sensors, and the control system. The drive system consists of a
mechanical chassis, a set of motors, gears and wheels. The chassis is usually designed
to operate like a wheel-chair, with two large drive wheels on either side of a
lightweight aluminum frame. The chassis is built to house the motors, gear system, batteries,
and circuitry, and must also be small enough to maneuver within the constraints of the maze.
The control system is series of circuit boards functioning as the brain of the critter. The control
system runs a maze solving algorithm (LSRB) based on the information received by the
CPU (ARDUINO BOARD) from the sensors. Typically the first several runs through the
maze will be a search sequence, in which the mouse learns the maze and stores it in memory. It
must then calculate the fastest possible path, which it will repeatedly run trying to achieve
successively faster times. The final sub-system is the sensors. They report to the CPU the
current state of the surroundings where the walls and paths are. These are usually either
infrared sensor which picks up light reflected light of the track. The main objective is to
achieve the fastest maze running time and easily find the goal.
2.6.2 Conclusion
Maze-solving involves Control Engineering and Artificial Intelligence. Using a good
algorithm can achieve the high efficiency of finding the shortest path. The proposed maze-
solving algorithm works better and has short searching time and low space complexity, and it
is significant for robots finding path in some areas like maze-solving.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 16

Chapter # 3







Methodology














Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 17

3.1 Adopted methodology
After a lot of research we finally select a combination of methodologies for our robot
depending upon our requirements. Let us discuss the methodologies we are using in detail.
3.1.1 Dead End filling
In dead end filling algorithm all the dead paths (paths that a robot will not follow or
those paths that will not lead a robot to its final destination point where it has to arrive for
unloading) are found manually by the programmer and then the alive path that will lead robot
to its final destination point for unloading be programmed in the memory of controller. Robot
will use the saved instructions and running on the correct path, it will reach at that point which
is the requirement of the programmer. As for every new location, the programmer has to do the
whole method and he has to save the multiple programs in the memory of the controller, which
is quite difficult process. So, here we are using this algorithm for just zone detection (by
following the traffic light signal system) so that our robot choose the right path for every new
required position.

3.1.2 Wall Following
After the detection of required path, now the robot has to follow the detected path. So,
for this purpose wall following algorithm is used. The Wall Follower algorithm is very simple
to understand. At the start of the maze, put your left (or right) hand on the wall, and then start
walking. Never take your hand off the wall. For a simply connected maze, you will find the
exit. That's all there is to it. The picture below shows a maze solved using the Wall Follower
algorithm; the red path shows the solution, the gray path shows the other parts of the maze that
were visited while following the wall. Look carefully at the maze, and see if you can figure
out if this was left- or right-hand wall following. In our logic we are using the concept of
priority for handling the conditions of X, T and + with wall following algorithms. The sensors
are just like the hands of the robot.




Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 18


3.1.3 Line Tracking (Pure Pursuit Algorithm)
The concept of the pure pursuit approach is to calculate the curvature that will take the
vehicle from its current position to a goal position.
Unloading of vehicle is automatic which will save time and reduce the need of manual
labor. The vehicle will have the ability to read and obey traffic signals on its path which will
help in traffic control within an industry.

















Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 19

Chapter # 4







Mechanical Design










Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 20

4.1 Mechanical Design
4.1.1 Selection of Material
We selected Aluminum for the fabrication of mechanical design. Aluminum is a
lightweight, reasonably cheap metal widely used for packaging and transport.
1- Raw aluminum has low strength and high ductility.
2- Aluminum is quite reactive, but protects itself very effectively with a thin oxide layer.
The surface can be "anodized", to resist corrosion and to give decorative effects.
4.1.1.1 Design I ssues
4.1.1.1.1Design strengths
1- High strength-to-weight ratio
2- High stiffness-to-weight ratio
3- High electrical and thermal conductivity
4- Easy to shape
5- Easy to recycle
4.1.1.1.2 Design weaknesses
Arc welding of aluminum is quite difficult.
4.1.1.1.3 Environmental issues

1- Aluminum production uses lots of energy (4% of total US energy consumption!)
2- Aluminum is easily recycled - this only uses 1% of the energy needed to produce
the metal.
3- Aluminum use in cars is growing rapidly - low weight means good fuel
economy and low emissions metal.

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal)Page 21

4.1.2 3-Dimensional Modeling and robot dimensions
4.1.2.1 3-Dimensional Modeling

Figure 4.1(a) : 3D Modeling
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 22

Now the picture of hardware of the project is following:

Figure 4.1(b) : Picture of Robot
4.1.2.2 Robot Dimensions
Base 30 x 30cm
Aluminum sheet thickness 4 mm
Diameter of tires 3 in
Number of teeth of sprocket 25
Thickness of tires 1 cm
Table 4.1: Dimensions of Robot
4.2 Fabrication
For fabrication of our project we used a private workshop. Workshop provides us
with powered tools and guidance for completing our design of base of our robot. We have
also used the Lathe for the preparing of bushes for barring, Cylindrical Grinder for
smoothing purposes and some hand tools for the opening and fitting the parts of
mechanical in case of any fault during troubleshooting.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 23

4.3 Mechanical Components

Item Specifications Cost(Rs.) Source
Wheels
Tensile Strength 3900 psi
Tensile Modulus 8000psi
1000 Lahore, Hall
Road
Acrylic Sheet
Tensile Strength 10,000 psi
Elongation 4.2%
Modulus Of Elasticity
400,000 psi (2800 M Pa)
1000
Lahore, Hall
Road
Sprocket Chain
Mechanism
Tensile Strength 55.76 KPa
Crushing Stress 265.78 Pa
2000 Lahore, Hall
Road
Aluminum Frame
Tensile Strength 276MPa 1000 Lahore, Hall
Road
Motors Torque 266.48 Nm 3000 Rawalpindi
Unloading Mechanism
Length 34 cm
Diameter 8.2 cm
Slope 2 Degrees
2000
Chakwal
Table 4.2: Mechanical Components

4.4 Feasibility of hardware
4.4.1 Selection of Motors:
Selection of motor is performed on the following parameters:
1- Torque of the motor
2- RPMs of the motor
3- Gear ratio and the flexibility in the arrangement of gear ratio (as if someone wants to
arrange the gears foe achieving the required speed then the gears should be adjustable)
4- Strength of the shaft of motor
5- Power rating of motor
We have to perform following calculations for the selection of suitable motors for
our vehicle.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 24


Weight of robot = weight of frame + weight of motor +weight of battery +weight of
aluminum sheet +weight of driving mechanism +miscellaneous weight.
............Equation 4.1: Weight of Robot
As the total weight of robot should be less than 90N then we can consider it 107.8N
maximum for calculation the torque and selecting the motors for our robot.
Weight of Robot = 107.8N










Acceleration required =?
Weight of wheels = 4.9N
Moment of inertia of wheel = 1/8*m
w
*d
2
Equation 4.2: Moment of Inertia
T
gravitational
= mc*g*sin = mc*g Equation 4.3: Gravitational Torque

As our maze is horizontal, so the reaction of cart and normal are perpendicular to each
other..
W = m*g* sin
W = m*g* sin90
W = m*g*1
W = m*g
T
gravitational
= 10.5 kg * 9.8
= 102.9 Nm
Figure 4.2: Free Body Diagram of Robot
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 25

T
frictional
= Fr*N*cos Equation 4.4: Frictional Torque
= 90
so
F
r
= C
r
*N*cos
F
r
= 0, as cos90 = 0
Now, we can say that in the case of wheel the frictional force is almost negligible as shown
in the calculations above
Load Torque = T
gravitational
+ T
frictional
= 102.9 + 0 Equation 4.5: Load Torque
T
L
= 103Nm
4.4.2 Acceleration Torque
By supposition and observing the mazes in past we got that maximum distance the
robot has to travel from starting point to the traffic signal A is almost 4.5m. Traffic signal
A will be green for 10 seconds, so the minimum speed of our robot should be enough to
reach there before the signal turns red.
Let suppose we have to reach there in 8 seconds, then
S = V*t
V = S/t Equation 4.6: Uniform velocity equation
V = 4.5/8
V = 0.5625 m/sec
r = radius of wheel = 2 inch
= 0.5625/r
= 0.5625/0.0501975 m
= 11.205
= 11.205*60
= 672.344 rpm
As this rpm is very difficult to control during breaking and turns during
maze solving. So the rpm should be in between range of 250rpm to 300rpm.
now suppose we have to reach signal A in 16 seconds
S = V*t
V = S/t
V = 3.5/16
V = 0.21875 m/sec
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 26

V = 0.21875 * 60 m/minute
V = 13.125 m/minute
= 13.125/r
= 13.125/0.0501975 m
= 261.46 rpm
The speed is now within our range and we can control it;
=(
f-

t
)/t
=16.3417m/min
2
Now,

We will find the acceleration torque as follow
T
a
= (m
c
* ) + 4(1/8 * m
w
* d
2
* )
=10.5 * + 4(1/8(0.125(0.0025) * (16.3417))
= 163.47 + 0.00255339 T
a
= 163.48 Nm
4.4.3 Total Torque
Total Torque = 103 + 163.48 Equation 4.7: Total Torque
= 266.48 Nm
4.5 Justification of above design
T = F * r T/r = F = m * g
T/r = m * g=266.48/20 = m=13.324 Kg
r = radius of wheel
The highlighted reverse calculations tell us that we have selected the required
motors to drive the robot.
4.6 Power Calculations
This calculation will result in the demanding quantity of power which my robot
will require to cover the distance of 30 meters in the maze from loading, unloading and
back to loading positions.




Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 27















S
total
= S1 + S2 + S3
By putting values
S
total
= a*t
a
(t
c
-t
a
)
P = m*a*v
P = (m*s
2
)/t
a
(t
c
-t
a
)
2
Equation 4.8: Mechanical Power
P = 6.60 Watts
This is the power which our robot requires only for travel. This amount of power
does not include the electrical power losses and power dissipation in stop and pause during
the motion. This is the power which robot consume during the continuous motion.
Figure 4.3: Free Body Diagram of Mechanical Power Consumption
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 28

4.7 Cotter joint design considerations for chains in sprocket chain
mechanism
As = 266.4 nm
P = / diameter of sprocket = 55.76 k pa.

t
=
c
= 265.780 pa


















The socket and spigot cotter joint is shown in fig.
Let
P= load carried by the rods
D= diameter of the rods,
D
1
= outside diameter of socket,
D
2
= diameter of spigot or inside diameter of socket
D
3
= outside diameter of spigot collar
T
1
= thickness of spigot collar
D
4
= diameter of socket collar
C = thickness of socket collar
Figure 4.4: Cotter Joint 2D Drawing
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 29

B= mean width of cotter
T = thickness of cotter
L = length of cotter A= distance from the end of the slot to the end of rod
The sprocket chain mechanism is selected on the basis of following parameters:
1- Tensile strength of the Chain
2- Compressive strength of the chain
3- Shear strength of the chain
4- Tensile strength of the sprocket
5- Compressive strength of the sprocket
6- Shear strength of the sprocket
There are two methods of designing. First is, assume or calculate the values of stresses
and find the other parameters mentioned above from them. And the second is, assume or
calculate the other parameters and calculate the values of stresses from them. Now we
have used the first method.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal)Page 30

The dimensions for a socket and spigot cotter joint may be obtained by
considering the various modes of failure as discussed below:
4.7.1 Failure of the rods in tension
The rods may fail in tension due to the tensile load p. We know that










D=(4*f/
t
) Equation 4.9: Failure of rod
= 7.8 mm
This will give us the diameter of rod.
4.7.2 Failure of spigot in tension
Since the weakest section of the spigot is that section which has a slot in it for
the cotter, as shown in figure.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal)Page 31

D
2
=[t + {t
2
+ ( * p)/
t
}]/ * 2 Equation 4.10: Failure of spigot
= 12.5 mm














4.7.3 Failure of the rod or cotter in crushing






T = (
c
* d
2
)/p Equation 4.11: Failure of the cotter

= 2.4 mm



Figure 9 Failure of spigot in tension 1 Figure 10 Failure of spigot in tension 1
Figure 4.5: Failure of spigot in tension
Figure 4.6:Failure of the rod crushing
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal)Page 32

4.7.4 Failure of the socket in tension across the slot
We know that the resisting area of the socket across the slot







D
1
= 2 * [t + { t
2
+ (
2
* d
2
2
)/4 d
2
* * t + (p * )/
c
}]/
.......Equation 4.12: Failure of the socket

Figure 4.7: Failure of socket in tension
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal)
Page 33

4.7.5Failure of cotter in shear



b = p/( * 2 * t) Equation 4.13: Failure of cotter
= 11.1 mm
4.7.6 Failure of the socket collar in crushing




Figure 4.8: Failure of cotter in shear
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 34




D
4
= [p/ ( * t)] + d
2
Equation 4.14: Socket collar failure
= 23.4 mm 7
Failure of socket end in shearing:
A = p/(d * ) = 6.1 mm
As = 266.4 nm
P = / diameter of sprocket = 55.76 k pa.
t
=
c
= 265.780 pa (calculated same as
above)
Figure 4.9 socket collar Failure
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 35

Chapter # 5







Electronic Circuitry









Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 36

5.1 Electronics Circuitry
The electronic circuitry of our project is the consisted of the following small
circuits.
1- IR proximity sensor and SONAR sensor (For Wall Detection)
2- Color sensor
3- LDR module for LINE TRACKING
4- Motor driving circuits (H-Bridges)
5- ARDUINO KIT
Item Serial Number Specifications Cost(Rs.) Source
IR Proximity
Sensor
GP2D120XJ00F 5v & Range=
30 cm
1000 Robocave,
Lahore
MOSFETs IRF 9540 &
75n75
24v & 100 A
75v & 75 A
100 Hall Road,
Lahore
OptoCouplers 813 Sharp 24v & 5 A 100 Chakwal
LDR .. 24v & 10 A 30 Chakwal
Voltage
Comparator
LM324 5v 30 Chakwal
Variable
Resister
.. 20Kohm 50 Hall Road,
Lahore
Magnetic Coil .. 24v & 3.13 A 750 Hall Road,
Lahore
Table 5.1: Electrical Components
The complete diagram of our circuit on Proteus is following:

This circuit includes ARDUINO kit, IR Proximity sensors, LDR based analog color
sensors and LDR based line tracking sensors. The complete working and theory of the
circuit has been discussed in this chapter.







Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 37



Figure 5.1: Complete circuit of our Project on Proteus

The detail of all these components is discussed below.
5.2 IR Proximity sensor
Sensors will be outputting an analog voltage that we will be reading with our
Arduino. The typical Arduino has 6 Analog In pins located on them. These analog inputs
act just like a voltage meter, sensing the voltage on that pin, and are actually 10 bit Analog
to digital converters (ADCs). The 10 bit part is the resolution of the ADC. 10 bit, or 2^10 =
1024 values. That means that when we read the voltage on that pin, 0-5v value will be
translated to between 0 (0V) and 1023(5V).
5.2.1 Working
It shines a beam of IR light from an LED, and measures the intensity of light that is
bounced pack using a phototransistor. If you stare at the sensor, you can see one of the
LEDs glowing slightly red as some of the IR falls into the visible-light spectrum.


Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 38












Circuit Working

5.2.2 Reason for using IR Proximity sensor
1- IR sensor has the more accuracy in detection of edges and corners as this work in
such a way that the IR emitter throws the rays on the IR receiver and the receiver
gives the output.
2- It uses the triangular principle for its working.
3- Refresh rate is high.
4- Easy to construct manually.
5- Low cost.
6- In case of analog IR sensor errors like nose in signals etc are very less due to the
use of light rays as compared to the sound signals in SONAR.







Figure 5.2: Working of IR Sensor
Figure 5.3: IR sensor principle
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 39

5.3 Color and Line tracking Sensors

For the color and line tracking sensors we have used the LDR module.








Figure 15 Color sensor cicuit diagram 1
Figure 5.4: Color sensor circuit diagram
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 40

5.3.1 Working
As the light dependent resistors gives the different ranges of voltages at output
according to the intensity of light. We know that the different colors of lights have the
different intensity then the LDR will give us the different ranges of voltages across the
green, red and yellow.
5.3.2 Reason for using LDR
The various limitations of the color sensing system are following:
Precise color sensors are expensive. Cheap sensors only detect a few colors.
1- The color sensing system is unable to recognize the brightest and darkest color level
for every of the colors.
2- As, in using the IR sensor we have to face the problems in sun light, because the
sun light has its own IR rays. Therefore the output of IR sensor is distorted in this
case. While on the other hand, LDR is not perfect but quite independent of this
problem in sun light or every other light intensity.
3- Its setting is very easy in case of changing light intensity if the output of LDR has
noise.
LDR is perfect in every case of such problems as compared to the IR sensor for
color sensing. Therefore we have used the LDR module as color sensor.
5.4 Motor driving circuit H-Bridge
An H bridge is an electronic circuit that enables a voltage to be applied across a
load in either direction. These circuits are often used in robotics and other applications
to allow DC motors to run forwards and backwards. H bridges are available as
integrated circuits, or can be built from discrete components.
H- Bridges can be built using following components:
1- Using electro - mechanical Relays
2- Using BJTs
3- Using MOSFETs
We are using the MOSFETs for building our H-Bridge but transistors
(BJTs) are used for switching of MOSFETs.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 41

5.4.1 Using electro - mechanical relays
































5.4.1.1 Advantages and disadvantages
1- Relay based circuit are cheaper
2- Easy to control can handle high current and voltage
easily 3- Slow switching not suitable when using
PWM
3- DE bouncing problems





Figure 5.5: H-Bridge via Relays
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 42

5.4.2 H Bridge using MOSFETs (Switched through Transistors (BJTs))

























The upper portion is P-Channel and the lower portion is N-Channel.
The reason of using such type of combination is the easy switching trough
controller as in this way only two pins of controller will be used instead of four pins (to
switch each MOSFET separately for the alternative combination of switching of
MOSFETs).
Figure 5.6: H-Bridge via MOSFETS
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 43

5.4.2.1 Advantages

1- Easy to control can handle high current and voltage easily.
2- Fast switching suitable when using PWM.
3- DE bouncing problems have been solved because there is no mechanical switch is
used.
4- Electrical signal noise is reduced in this case.
5- Refresh rate is high and easily synchronized with the execution rate of the
controller.
6- Highly efficient as compared to the electrical relays.














Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 44

Chapter # 6








Embedded System










Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 45

6.1 Embedded System (ARDUINO Kit)
We are using the ARDUINO kit instead of any controller.

Figure 6.1: ARDUINO Kit

6.2 Why ARDUINO mega?
6.2.1 Power
1- The ARDUINO Mega can be powered via the USB connection or with an external
power supply. The power source is selected automatically. External (non-USB)
power can come either from an AC-to-DC adapter or battery.
2- The board can operate on an external supply of 6 to 20 volts. If supplied with less
than 7V, however the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, voltage regulator may overheat and damage the
board. The recommended range is 7 to 12 volts.
6.2.2 Memory
The AT mega 1280 has 128 KB of flash memory for storing code of which 4 KB
is used for the bootloader (A Bootloader is the first program which executes before the
main program) whenever a system is initialized), 8 KB of SRAM and 4 KB of EEPROM
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 46

(which can be read and written with the EEPROM library).
6.2.3 USB over current Protection
The ARDUINO Mega has a resettable poly fuse that protects your computer's
USB ports from shorts and over current. Although most computers provide their own
internal protection, the fuse provides an extra layer of protection. If more than 500 mA is
applied to the USB port, the fuse will automatically break the connection until the short or
overload is removed.
6.2.4 ADC
1- 10-bit Resolution
2- 13s - 260s Conversion Time
3- 14 Differential input channels

6.2.5 ADC Conversion Result
1- After the conversion is complete (ADIF is high), the conversion result can be found
in the ADC Result Registers (ADCL , ADCH). For single ended conversion, the
result is



2- Where V
IN
is the voltage on the selected input pin and V
REF
the selected voltage
differential channels are used, the result is


6.2.6 Programming
1- The ARDUINO Mega can be programmed with the AURDUINO software.
2- The ATmega1280 on the AURDUINO Mega comes pre-burned with a boot loader
that allows you to upload new code to it without the use of an external hardware
programmer.
3- You can also bypass the boot loader and program the microcontroller..
6.3 Programming Language used
For programming the ARDUINO microcontroller, we are using C language. Some
general commands and examples are following:
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 47

Arduino Programming Basics

Table 6.1: General Commands of AURDUINO v1.1.8
6.3.1 Examples
6.3.1.1 To turn on LED
void setup() {
pinMode(2,OUTPUT);
digitalWrite(2,HIGH);
delay(1000);
digitalWrite(2,LOW);
}
void loop()
{}
6.3.1.2 To Flash LED
void setup() {
pinMode(2,OUTPUT);
}
void loop() {
digitalWrite(2,HIGH);
delay(500);
digitalWrite(2,LOW);
delay(500);
}
6.3.1.3 To turn on Motor
void setup() {
pinMode(4,OUTPUT);
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 48

digitalWrite(4,HIGH);
delay(1000);
digitalWrite(4,LOW);
}
void loop()
{}
6.4 Compiling Software
For programming ARDUINO Microcontroller, we are using software (ARUINO
V1.1.8). As the programming commands and algorithms for programming ARDUINO
Microcontroller are different then other PIC and AVR Microcontroller, therefore the
specially designed compiling software is used for the programming of ARDUINO
Microcontroller.


6.5 Source Code
The code burned in the Arduino kit is shown in detail in appendix at the end of the
report. It consist of different portions which shows the use of different commands with
respect to location in the maze.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 49

Chapter # 7









Control Circuitry

















Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 50

7.1 Mathematical modeling using Control Systems Techniques

The mathematical modeling depends on the following parts:
1- Modeling of electrical circuitry (motor driving circuits).
2- Modeling of electromechanical system (motors and mechanical part).
Now the detail is as follow:
7.2 Modeling of electrical circuitry (motor driving circuits)















As shown in the above figure only two MOSFETs will be on and two will
be off. Therefore the circuit can be simplified as shown in fig 1.
Figure 1 contains the two l oops. In loop 1 the transistors R
1
and R
2
are use d to
switch the MOSFETs in loop 2. Now the calculations are given below:
For loop 1:
By KVL;
V(s) = i
1
(s)*R
1
(s) + i
2
(s)*R
2
(s) Equation 7.1: Loop 1 differential eq.

V(s)/V
1
(s) = (R
1
+ R
2
)/R
0

Figure 7.1: Electrical Circuit Modeling i
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 51

V(s)/V
1
(s) = 1 Equation 7.2: Loop 2 Differential eq.

For loop 2:
By KVL;
V(s) = i
1
(s)*R
1
(s) + i
2
(s)*R
2
(s) Equation 7.3: Loop 2 differential eq.

V(s)/V
1
(s) = (R
1
+ R
2
)/R
0

V(s)/V
1
(s) = 1


7.3 Modeling of mechanical and electromechanical part
Electromechanical System Transfer Functions:





A magnetic field is developed by stationary permanent magnets or a stationary
electromagnet called the fixed field. A rotating circuit called the armature, through which
current i
a
(t) flows, passes through this magnetic field at right angles and feels a force,
F=Bli
a
(t) where B is the magnetic field strength and l is the length of the conductor. The
resulting torque turns the rotor, the rotating member of the motor. There is another
phenomenon that occurs in the motor. A conductor moving at right angles to a magnetic
field generates a voltage at the terminal so f the conductor equal to e=Blv, where e is the
voltage and v is the velocity of the conductor normal to the magnetic field. Since the
current-carrying armature is rotating in a magnetic field, its voltage is proportional to
speed. Thus the general transfer function of the motor is following:

Figure 7.2: Modeling of Motors
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 52




























T
m
(s) in terms of
m
(s) if we are to separate the input and output variables and
obtain the transfer function,
m
(s)/E
a
(s).
J
m
= inertia at the armature and includes both the armature inertia and, the load
inertia reflected to the armature.
D
m
= viscous damping at the armature and includes both the armature viscous
damping and, the load viscous damping reflected to the armature.
Equation 7.4: Transfer function of motor
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 53









This is the simple mechanical free body diagram of my project.
Now by using the upper relations we can calculate the transfer function of our
project.




By simplifying we get

m
/ E
a
= [ K
t
/R
a
{ J
a
+ J
L
(N
1
/ N
2
)
2
}]
--------------------------

[ s {s + 1 /( J
a
+ J
L
(N
1
/ N
2
)
2
)}{ D
a
+ D
L
(N
1
/ N
2
)
2
+ K
t
* K
b /
R
a
}]
N
1
= N
2
= 25
Now
J
L
= 0.485
D
L
= 0
By combining the electrical, mechanical and electromechanical part of our
calculation and solving we get the following transfer function of my whole system:
0.485 S
4
R
a
+ K
b
K
t
S
3
+ R
1
R
2
/2K
t

---------------------------------------------- Equation 7.5: Transfer function
0.485 R
a
S
2
+ K
b
K
t
S
Since this is the irregular equation and we have to convert it into the regular
equation this can be done by using the MATLAB commands of Partial Fraction.
Figure 7.3: Motor interface
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 54

7.4 Simulation in MATLAB SIMULINK
7.4.1 Simulation Diagram:

Figure 7.4: MATLAB SIMULINK diagram









Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 55


7.4.2 Output Graph of Simulation diagram


Figure 7.5: MATLAB SIMULINK graph
The graph is explaining that the response of the system was raised suddenly but
the magnitude has started to decrease. This indicated that, the system is attaining the
stable condition because it is moving towards the center in direction of positive x-axis.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 56

Chapter # 08




Mechatronics System



Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 57

8.1 Mechatronics system
The Mechatronics system can be explained by the following diagram:

Figure 8.1: Mechatronics system
From the diagram we can conclude the following results about the Mechatronics
system.
Mechatronics system is the sum of the following engineering departments:
8.1.1 Control systems
Control systems deals with the transfer function and the stability of system. In
other words, it deals with the disturbance in the system by any input to that system.
8.1.2 Digital control systems (DCS)
Digital control is a branch of control theory that uses digital computers to act as
system controllers. Depending on the requirements, a digital control system takes the
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 58

computed data in the form of a microcontroller to a standard desktop computer to control
the whole system for getting errorless output.
8.1.3 Computers
Computers are used to control the Mechatronics system. These are the sources of
code generations, HMI control and many other things such as motion cards and drives
etc.
8.1.4 Mechanical System
Mechanical systems basically deal with the mechanical calculations and mechanisms.
In mechanical calculations, we use the mechanics statics and mechanics dynamics
including the topics of forces calculations, velocity calculations, material properties and
their related stability calculations and design calculations for mechanisms.
8.1.5 Electronics systems
Electronics systems are the microcontrollers and microprocessors which are used to
control the system. The electronics circuits are the basic part of any system.
8.2 Phases of Mechatronics system design



Fig 8.2: Phases of Mechatronics system
The above mentioned diagram is explaining the complete concept of phases of
Mechatronics systems.

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 59


The explanation of these steps is following:
8.2.1 Modeling and Simulation
Modeling and simulation are the sum of the following steps:
1- Recognition of need
2- Conceptual Design
3- Mathematical Modeling
4- Sensors & Actuators Model
5- Detailed model
6- Control System Design
7- Optimization
8.2.2 Recognition of Need
It explains the objective of the system as why this system is designed?
8.2.3 Conceptual Design
It deals with the theoretical design which is present in the mind of designer. This
design is according to the type of system as the system is purely mechanical or purely
electrical. But in Mechatronics system design, the system consists of electrical,
mechanical and software part. Therefore the conceptual design of Mechatronics system is
having these three parts.
8.2.4 Mathematical modeling and Control system modeling
It is related to the mechanical calculation of mechanism including concepts of
Vector Mechanics and Mechanics of Materials and other subjects like CAD etc. It is the
application of Control Systems. It is explaining the behavior of the system when an input
is given to the system, theoretically. The whole theoretical calculations are done on the
base of the transfer functions of gains of components of system.
8.2.5 Prototyping and System Development
It is the technique of testing the system designing and making the hardware of
small design having the same applications of applications related to the original concept.
If it is working well then the original design on software is produced and then it is
converted into the hardware.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 60


Here is the diagram of general Mechatronics system.

8.3 General Block Diagram of Mechatronics System

Fig 8.3: General Block Diagram of Mechatronics system

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 61

8.4 Block Diagram of our Mechatronics System

Fig 8.3: Block Diagram of our Mechatronics system

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 62

8.5 Comparison of General and our Mechatronics system design
8.5.1 Recognition of need and evaluation of engineering specs
To increase the efficiency of industrial operation by reducing the time spent on
material handling and automates the operation with minimum use of human effort.
8.5.2 Mechanical System
After a lot of research about the base of robot, we concluded that a square robot
base is best as compared to a rectangular, circular or triangular base. We selected Skid
Steer Driving mechanism for our vehicle over different type of driving mechanisms like
differential drive, car type drive etc. The mechanism we selected for unloading is simple
an unlocking system which uses a solenoid to launch the object on the ramp.
8.5.3 Electrical System
We are not using any component which is related to electrical concepts.
8.5.4 Electronic System
We selected the suitable components for our motor driving circuits keeping in
view the power rating of our motors and battery. We are using the analogue infrared
proximity sensor and SONAR sensor for maze solving (object detection). For sensing
traffic light we are using LDR based color sensors (analog). For the detection of line we
are using LDR based digital sensors.
8.5.5 Control System
We calculated the transfer functions of our electrical, electronics and mechanical
systems. We checked the stability of our system by using simulation in MATLAB; we
found our system stable using step input. This is the basic requirement for a mechatronics
system, thus we can move on towards the fabrication of our system.
8.5.6 Operating Hardware
The operating system we are using is Arduino Mega 2560, Arduino is a single-
board microcontroller, intended to make the application of interactive objects or
environments more accessible. The hardware consists of an open-source hardware board
designed around an 8- bit Atmel AVR microcontroller.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 63

8.5.7 Process Design
We did the three dimensional modeling of our system using Solid Edge Software.
With the help of modeling we came to know of the machining processes needed for the
completion of our project. We also decided that how will we do the fitting and wiring of
our electromechanical system.
8.5.8 Electronic Design
We have designed the motor driving circuits, color sensor modules and line
tracking sensor circuit using the components which we have explained previously.
8.5.9 Hardware and Software Integration
The circuits designed are first checked on software using the programmed code
and a complete simulation of project is obtained. Then the next task is the integration of
hardware and software practically, connecting all circuits with Arduino board and then
giving outputs to the electrical and mechanical parts using Arduino.
8.5.10 Fabrication
After testing all the systems are ready to be fabricated and assembled. We
performed the machining processes required and our project is ready for testing.
8.5.11 System testing
After manufacturing we have done the testing of our system to check the
performance of all the systems involved, whether they are doing the tasks as we want
them to do or no. Now the final mechatronics system block diagram of our vehicle is
following which will explain the complete relation of our project with mechatronics
system.

Figure 8.4: General Block Diagram of our system

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 64

As the mechatronics system is a closed system so as our system is also a closed
system. The above closed system diagram of our project has explained the complete
relation of our project with mechatronics system design.
























Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 65

Future Work

There are many possible directions from which future work could proceed from
this project. While we were able to successfully solve a maze in simulation and in the real
world, there are many improvements that could be made in order to correct for drift, be
able to solve a larger or more complex maze, or utilize multiple robots to solve a maze in
parallel. The drift accumulated throughout the experiments was by far the biggest factor
keeping the robot from solving the maze in any given trial. One possible improvement to
compensate for the drift could be an improved rotation primitive. Such a function could
act similar to the previous one in that it will rotate as near to 90 degrees as possible, but
would improve upon it by using laser 6 readings in order to position itself more precisely
to 90 degrees. By making small rotations and observing the left and right wall distances
the function could look for a local minimum in the wall distance on both sides, which
should be the situation in which the robot is aligned perfectly parallel to its side walls. In
this way very accurate 90 degree turns should be possible, even in the case where the
robot has undershot or overshot forward motion, or has a slightly incorrect orientation
prior to the rotation. Another motion improvement could take place in the forward motion
function. By determining the number of cells to either side of the robot using the laser,
the forward movement could be compensated with a small angle to keep the distance on
either side of ratios of cell sizes. We implemented a simple version of this which would
apply compensation when the robot is following a wall to either side, but a version of the
function as described above may have superior results. Given slow enough velocities
such a method should be able to keep the robot nearly perfectly aligned in the center of a
maze cell. Implementing this in addition to the improved turn function described above is
expected to solve much of the drift error and localization issues which we struggled with.
Implementing better search algorithms could be a major advantage especially in situation
where time is a major cost. The easiest way to increase the data available to the search
algorithms can be done by scanning the walls of the cells that the robot may not have
visited yet lie in the range scanning range of the SICK lasers. This can save us the time of
having the robot explore some cells, and allows it to make better informed decisions
during the course of the search. The more information that can be plotted by the robot,
the more effective the searching can be done. The search algorithm can also be enhanced
by making it enough to detect and avoid getting into areas which can by guarantee not
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 66

have the goal. One such situation is when the algorithm tries to get the robot to search
into an area which is surrounded by all four sides by scanned cells and the goal lies
outside it. By that we can know that there is no path that escapes out of this area to the
goal and thus can be avoided. Given that the robot knows the dimensions of the maze, a
segmentation algorithm could be very effective - avoiding many possible routes by
attempting to segment off the goal location from the majority of the maze recursively.
Apart from that, though the use of SICK lasers has been highly beneficial, using a
different and better suited-for-the-task mechanical design than that of the
Pioneer can definitely be looked into. Research can also be done on using motors that
would be have a higher accuracy and are still capable of high velocities. One of the
possibilities would be using the Explorer instead of the Pioneer. After implementing
sensing on an Explorer, it could be an exciting platform for maze solving problems. Due
to its size it would be simpler to implement and test large maze structures then with a
Pioneer robot. Because of the smaller mass of the Pioneer, it could make a high velocity
search of a maze structure more feasible without risking damage to the robot or the
environment from accidental collisions. Due to the onboard wireless communication
capabilities, the Explorer could be well suited for multi-agent maze search problems as
well. One very interesting prospect for research would be decreasing the cell size in the
maze and relaxing some of the other experimental constraints until this problem is similar
to common SLAM problems being looked at. Theoretically speaking, as the cell size
reaches zero, the problem opens up into full-scale SLAM. The same or similar techniques
as we used for the maze solving could then be applied to the SLAM problem to see what
their effectiveness is versus standard SLAM techniques.





Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 67

Conclusion
Material handling is the backbone of any kind of industrial operation. The
efficiency of an industrial operation can be increased by reducing the time spent on
material handling rather than machining time as it is 80% to 90% of the total time. We
have tried to reduce the handling time by automating the process of material delivery or
taking the waste material away from the manufacturing site. Further, the vehicle we have
designed is capable of following traffic signals located in an industry or on a road. In
industrial applications zone detection is also an important task for an automated guided
vehicle, which helps in prevention of more than required number of vehicles in a specific
area and also prevents collisions between vehicles. If we have such area in the path where
there are no specific boundaries but a line on floor than the robot can find the path back
to track following that line, this also enables the robot to come back to its defined track in
case it gets out of the track given.
There are certain limitations in our robot because of the rules described by the
NERC. If we have to design the same kind of robot without any rules described we can
make many innovation in maze solving techniques and also the in the method of
unloading. One could use the latest technologies available like GPS for finding the paths
accurately and could also view the position of the vehicle via mobile application. Loading
of material in vehicle can also be automated with the help of a robotic arm.



















Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 68

Appendix

Source Code
The program burned in Aurdino kit for different paths, signals and unloading is as
follow:

////////////////////////////////////////////////////////////////////////////////////////
int frs,fls,bls,brs,fs,ap,bp,cp;
int rmf=22; // right motor forward direction if this is high
int rmb=24; // right motor backward direction if this is high
int lmf=26; // left motor forward direction if this is high
int lmb=28; // left motor backward direction if this is high
int rmm=30; // ball throwing from right pipe
int lmm=32; // ball throwing from left pipe
const int buttonPin = 34; // line tracking sensor input
double start=1,c1=0,b1=0,b2=1,b3=0; // different variables use
int buttonState = 0;
void setup()
{
Serial.begin(9600);
pinMode(rmf, OUTPUT); // setting as output
pinMode(rmb, OUTPUT);
pinMode(lmf, OUTPUT);
pinMode(lmb, OUTPUT);
pinMode(lmm, OUTPUT);
pinMode(rmm, OUTPUT);
pinMode(buttonPin, INPUT); // setting as input


digitalWrite(rmf, LOW); // low state
digitalWrite(rmb, LOW);
digitalWrite(lmf, LOW);
digitalWrite(lmb, LOW);
digitalWrite(lmm, LOW);
digitalWrite(rmm, LOW);
delay(1000); // creating delay
forward(); // calling forward function
delay(800);


}

void loop()
{

// all anlog sensor
frs = analogRead(A0)* 10*(5.0 / 1023.0); // reading front right side sensor
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 69

fls = analogRead(A1)* 10*(5.0 / 1023.0); // reading front left side sensor
brs = analogRead(A2)* 10*(5.0 / 1023.0); // reading back right side sensor
bls = analogRead(A3)* 10*(5.0 / 1023.0); // reading back left side sensor
fs = analogRead(A4)* 10*(5.0 / 1023.0); //// reading front side sensor

//digital sensor for line tracking
buttonState = digitalRead(buttonPin); // reading line tracking sensor state

//////////////////////////////////
// for stopping on red signal
if (buttonState == HIGH && start==0) {
stopp();
bp = analogRead(A6)* 10*(5.0 / 1023.0);
while(bp>2)
{
bp = analogRead(A6)* 10*(5.0 / 1023.0);
}
}
///////////////////////////////////////////

////////////////////////////////////////////////

// checking open path
if (buttonState == HIGH && start==1) {
stopp();
delay(100);
ap = analogRead(A5)* 10*(5.0 / 1023.0);
bp = analogRead(A6)* 10*(5.0 / 1023.0);
cp = analogRead(A7)* 10*(5.0 / 1023.0);
if(ap>bp && ap>cp)
path=1;
if(bp>ap && bp>cp)
path=2;
if(cp>ap && cp>bp)
path=2;
if(cp>ap && cp>bp)
path=3;
start=0;
}
/////////////////////////////////////

// for moving robot straight
if(frs==12)
forward();
if(frs<12)
right1();
if(frs>12)
left1();

Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 70

//for c path
if(fs==14 && path=3)
{
left();
delay(1250);
fs = analogRead(A4)* 10*(5.0 / 1023.0);
for (;fs!=19;)
{
forward();
fs = analogRead(A4)* 10*(5.0 / 1023.0);
}
brs = analogRead(A2)* 10*(5.0 / 1023.0);
for (;brs!=12;)
{
left();
brs = analogRead(A2)* 10*(5.0 / 1023.0);
}
path=0;
c1=1;
}

//for b path
if(fls>8 && bls>8 && b2==1 && path==2)
{
b1=1;
b2=0;
path=0;
}

if(fls<8 && b1==1)
{
for(int w=1;w<=3;w++)
{
left();
delay(225);
stopp();
delay(50);
forward();
delay(120);
}
for(;fs!=29 && b1==1;)
{
forward();
fs = analogRead(A4)* 10*(5.0 / 1023.0);
}
if (b1==1)
{
left();
delay(1300);
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 71

}
forward();
delay(500);
b1=0;
b3=1;

}


// entering in ball throwing area
if (brs<1 && (c1==1 || b3==1))
{
right();
delay(1500);
stopp();
delay(100);
forward();
delay(800);
stopp();
delay(100);
right();
delay(1400);
stopp();
delay(1000);
forward();
delay(2000);
stopp();
delay(1000);
digitalWrite(rmm, HIGH);
delay(500);
digitalWrite(rmm, LOW);
stopp();
delay(20000000);
c1=0;
b3=0;
}
}
// function for forward movement
long forward()
{
digitalWrite(rmf, HIGH);
digitalWrite(rmb, LOW);
digitalWrite(lmf, HIGH);
digitalWrite(lmb, LOW);
}
// function for spining anti-clockwise
long left()
{
digitalWrite(rmf, HIGH);
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 72

digitalWrite(rmb, LOW);
digitalWrite(lmf, LOW);
digitalWrite(lmb, HIGH);

}
// function for spining clockwise
long right()
{
digitalWrite(rmf, LOW);
digitalWrite(rmb, HIGH);
digitalWrite(lmf, HIGH);
digitalWrite(lmb, LOW);

}
// stopp function
long stopp()
{
digitalWrite(rmf, LOW);
digitalWrite(rmb, LOW);
digitalWrite(lmf, LOW);
digitalWrite(lmb, LOW);

}
// function for backward moving
long back()
{
digitalWrite(rmf, LOW);
digitalWrite(rmb, HIGH);
digitalWrite(lmf, LOW);
digitalWrite(lmb, HIGH);
}
// function right turn
long right1()
{
digitalWrite(rmf, HIGH);
digitalWrite(rmb, LOW);
delay(10);
digitalWrite(rmf, LOW);
digitalWrite(rmb, LOW);
delay(55);
digitalWrite(lmf, HIGH);
digitalWrite(lmb, LOW);

}
// function left turn
long left1()
{
digitalWrite(rmf, HIGH);
digitalWrite(rmb, LOW);
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 73


digitalWrite(lmf, HIGH);
digitalWrite(lmb, LOW);
delay(10);
digitalWrite(lmf, LOW);
digitalWrite(lmb, LOW);
delay(55);

}






































Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 74

References
[1] Research Kitchen, Freshbrain, Hill Air Force Base
[2] Ronald C. Arkin; Behaviour-Based Robotics, the MIT Press, Cambridge, 1998
[3] G W. Lucas; A Tutorial and Elementary Trajectory Model for the Differential
Steering System of Robot Wheel Actuators, The Rossum Project, 2001
[4] J S. Wit; Vector Pursuit Path Tracking for Autonomous Ground vehicles, Ph.D
thesis, University of Florida, 2000
[5] T. Hellstrm; Autonomous Navigation for Forest Machines, Department of
Computing Science, Ume University, Ume Sweden, 2002
[6] R C. Coulter; Implementation of the Pure Pursuit Path Tracking Algorithm,
Robotics Institute, Carnegie Mellon University, January, 1992
[7] G. Dudek, M. Jenkin; Computational Principles of Mobile Robotics, Cambridge
University Press, New York, 2000
[8] Pressman, Roger S [1994]; History of Automated Guided Vehicles", Second
Edition John Wiley & Sons Inc., 605 Third Avenue, New York.
[9] Automated Guided Vehicles, Applications [1990], Second Edition, Research and
Technology Development Center, John Hopkins University.
[10] Automated Guided Vehicles, An introduction and History
Safety Practices for Automated Guided Vehicles (AGVs), [2001], MIT Press.
[11] Pulse Width Modulation, Working and types, D. Murray and C. Jennings,
Stereo vision based mapping and navigation for mobile robots, in Proceedings of
the 1997 IEEE Conference on Robotics and Automation, 1997, pp. 16941699.
[12] S. Thrun and A. Bucken, Learning maps for indoor mobile robot navigation,
Artificial Intelligence, vol. 99, pp. 2171, 1998.
[13] S. Thrun, A. Bucken, W. Burgard, D. Fox, T. Frohlinghaus, D. Hennig, T.
Hofmann, M. Krell, and T. Schmidt, Map learning and high-speed navigation in
RHINO. Cambridge, MA, USA: MIT Press, 1998.
[14] J. del R. Millan, The Handbook of Brain Theory and Neural Networks, 2nd ed.
MIT Press, 2002.
[15] H. Durrant-Whyte and T. Bailey, Simultaneous localisation and mapping
(slam): Part i the essential algorithms, Robotics and Automation Magazine, June
2006.
Maze Solving Autonomous Vehicle

University Of Engineering and Technology, Taxila (Sub Campus Chakwal) Page 75

[16] Kazerouni B.H.Moradi. Variable Priorities in Maze-Solving Algorithms for
Robots Movement,Seville:Proceedings IEEE International Conference on Industrial
Informatics. vol. 6, pp181 -185,2003.
[17] Tondra De, Dfew Hall. The Inception of Chedda: A detailed design and
analysis of Micromouse, University of Nevada, Las Vegas Senior Design. vol. 5,
pp39-44, 2004.
[18] Huo Zhe Fu. A Design and Realize for Micromouses Mazesolving,
Microcomputer Appfications.vol 9, pp59-62. 2008.
[19] Jin Liang Fang, Yi Jun Zhou. Micormouse Based on ARM of IEEE Standard,
Machine Building and Automation.vol.5, pp99-101, 2008.
[20] UK Micromouse contest, held each year in United Kingdom.
[21] Maze Solving; Research Kitchen, Freshbrain, Hill Air Force Base (Book)
[22] Machine Design by R. S. Khurmi (Book)
[23] Control System by Noram S. Nise (Book)
[24]http://ewh.ieee.org/reg/1/sac/Main/RegionalEvents/StudentConf/MicromouseRul
es.pdf.
[25]http://www.powerdesigners.comllnfoWeb/designcenter/articles/PWM/pwm.shtm.
[26] www.robomind.net
[27] http://www.nuvts.de/
[28]http://first164.blogspot.com/2013/06/tremauxs-algorithm-and-few-simple-rule
s.html
[29] www.cems.uvm.edu/~snapp/teaching/cs32/lectures/tremau
[30] http://www.astrolog.org/labyrnth/algrithm.htm
[31] http://www.robotix.in/tutorials/category/mechanical/drivemechtut#57

You might also like