Sunteți pe pagina 1din 12

International Journal of Pure and Applied Mathematics

Volume 114 No. 9 2017, 271-281


ISSN: 1311-8080 (printed version); ISSN: 1314-3395 (on-line version)
url: http://www.ijpam.eu
Special Issue
Autonomous Obstacle Avoiding and Path ijpam.eu

Following Rover
Sandeep Polina1, Pavan Kumar Barathula2and
K P Prasad Rao3

Department of Electrical and Electronics


Engineering
K L University, Vaddeswaram - 522 502, Andhra
Pradesh, India.
sandeep.polina@gmail.com

Abstract. With the advancement of automation


technology, the industries are adopting automated
robots in workplace instead of humans. This paper deals
with designing and implementing the basic prototype of
line follower robot with obstacle avoiding capabilities.
The basic line follower robot follows the path either
black or white colour in inverted surface but having an
obstacle in its path becomes a reasonable issue effects
its utilization in workplaces. This prototype of the robot
follows line, detects obstacle and take necessary actions
to avoid it. The 3 sets of IR transmitter-receiver and
ultra-sonic sensors are implemented in this prototype to
detect path and obstacles respectively. The Arduino Uno
board is the control system of this robot. The design
includes two modules- line following and obstacle
detection, both modules and its algorithm are
implemented individually and at final both are
combined in such a way that the robot performs
specified task. Arduino motor shield and sensors are
connected to control system and power is taken from
12V battery.

Keywords: Robot, obstacle, sensors, ultra-sonic, IR transmitter-


receiver.

1 Introduction
Robot is usually a machine controlled by a computer
program or electronic circuitry. These are designed mainly to
reduce the work of a human. In most of the situations where
humans are under risks. So, to reduce the risk factors as well
as to increase the comfort these are developed. And by using
it we can achieve more efficient outputs with in a low span of
time. In olden days’ machines are only used to reduce the
human effort they don’t have any capability of making
decisions. But now, the world is moving towards the
autonomous in every aspect. By incorporating a little amount
271
International Journal of Pure and Applied Mathematics Special Issue

of knowledge to the robots they can take a bounded decision


on its own without any human involvement.
We have designed a robot that performs additional
tasks along with following a path. It avoids an obstacle in its
path and continuous to follow its path after the obstacle been
avoided. We can set the gap between the robot and intrusion
at that point which the robot take its deviation from the path.
Our robot follows the black line if it was removed from
the black line it stops and while following the line if any
obstacle was present in its path it detects the object from a
distance which we set in programme.
When the distance between obstacle and robot is
reduced to minimum value the robot control instructions
transfers from line following module to the obstacle avoiding
module. When the robot avoids the obstacle, and detects the
black line again the control sent back to the line follower
module. Our robot contains single ultra-sonic sensor mounted
on the servo motor helps to detect obstacles around 1800 in
front of robot

2. BLOCK DIAGRAM
This is the block diagram of line follower. The direction
of the arrow indicates the signal flow. The connection between
Arduino board and Arduino motor shield is bi directional.
Since we are using three motors (2 dc and 1 servo) it is easy
and comfortable to use the motor shield in controlling the
speed of the motors and if we want the four-wheel drive we
can increase the number of dc motor to four for heavy loads
with the help of motor shield.

Fig1. Block Diagram of Specimen model

The signal from IR sensors are the input to the Arduino


board. This signal helps in determining the position of the
robot with respect to the black line and Arduino gives the
necessary commands to the motor shield to adjust the motors
speeds in controlling the robots position. This loop continuous
unless any obstacle was detected.
The ultra-sonic sensor detects the obstacle and sent the
data to the Arduino, based on the data the Arduino calculates
the distance between the obstacle and robot.

272
International Journal of Pure and Applied Mathematics Special Issue

The servo motor helps in rotating the head of the robot


(ultra-sonic sensor) through 1800 to find the obstacles is
present in other direction.

3. LINE FOLLOWER MODULE


The IR sensors mounted under the robot near the caster
wheel helps in the detecting the black line. The line following
strategy can be achieved by minimum two sets of IR
transmitter and receiver to increase preciseness and
smoothness in operation we use three sets of them. Line
follower works on the principle that light reflects on white
surface and doesn’t reflect on black. IR transmitter transmits
IR waves on to the surface receiver sends the information
about the presence of black line to the Arduino board based on
the reflection of the IR wave, based on the information
Arduino sends signal to the motor shield to control the speed
of the motors to take turning.
The direction of the robot making a turn depends of the
individual speed of left and right motors. If the speed of the
left motor was more than the speed of the right motor the
robot takes right turn and vice versa. To move the robot in
straight forward both motors should be in same speed.

3.1 FLOW CHART OF LINE FOLLOWER


This flow-chart explains how the robot movement
related to the sensor inputs.

Fig 2. Flow chart for Line Follower

Number 0 and 1 under respective sensor indicates the


logical high or low value. When the wave is reflected that
means surface is white so, sensor output is logical high (1)
value and if the surface is black then the wave will not be
reflected so the sensor output is logical low (0) value.

273
International Journal of Pure and Applied Mathematics Special Issue

F indicates the label hence the robot should


continuously check for the black line and calibrate its position
per path the process should continuously run in the loop.

3.2 PSUEDO CODE FOR LINE FOLLOWER


Following code is used to explain how the coding is
done on Arduino to make the robot to follow the line.
Include AFMotor library
Define left sensor to A0
Define middle sensor to A1
Define right sensor to A2
Assign right motor to the 3rd motor slot of Arduino
motor shield.
Assign left motor to the 4th motor slot of Arduino
motor shield.
Firstly:
Set left sensor(A0) as input.
Set middle sensor(A1) as input
Set right sensor (A2) as input to the Arduino.
Set the speed of left motor and right motor
Initially make the both motors stop.
Here loop starts:
If left sensor and right sensor is on white and middle
sensor is in black (case 1)
Make both motors to run forward
//it makes motor to move forward.
Delay for some time.
If middle sensor and right sensor is on white and
left sensor is on black (case 2)
Stop left motor and make the right motor to run
//this makes robot to turn left
Delay for some time
If middle sensor and left sensor is on white and right
sensor is on black (case 3)
Stop the right motor and make left motor to run
//this makes robot to turn right
Delay for some time
If all the sensors is on the black (case 4)
Stop the both motors
//this indicates the robot is at finish point
Delay for some time.
If all the sensors is on white (case 5)
Stop the both motors
//this indicates robot is out of track
Delay for some time.
If left sensor is on white and right sensor and middle
sensor is on black (case 6)
Stop right motor and run the left motor
//it makes robot to turn right
Delay for some time
If right sensor is on white and left sensor and middle
sensor is on back (case 7)
Stop left motor and run the right motor
//it makes robot to turn left
Delay for some time
If left sensor and right sensor is on black and
middle sensor is on white (case 8)
Stop both the motors
//it indicates invalid path
Delay for some time
Go back to the loop.
The entire loop executes repeatedly until the robot stops
Even we use the analog pins of Arduino board we read the
sensor inputs as digitally.
274
International Journal of Pure and Applied Mathematics Special Issue

4. OBSTACLE AVOIDING MODULE


In this module, we make the circuit and explain the
strategy followed by robot to avoid the obstacle present in its
path and continue following the path.
The robot head turns 180 degrees to check the obstacle
in three directions. Arduino is the brain of this robot it takes
the data from the ultra-sonic sensor and calculate the
distance between obstacle and robot. From the angle of the
servo motor Arduino gets the direction of obstacle.
By knowing the speed of the wave and time delay
between triggered wave and echo the distance is calculated by
formula.
Distance =(speed*time)/2
When obstacle is present it path it check the distance
in both directions and prefer the direction where there is a
large gap. It travels in that direction leaving the path and
travels through the boundary of an obstacle until it finds a
black line. After finding the black line it continues its path.
The threshold distance is set in the program when the gap
between the object and the robot is below the threshold
distance then the obstacle avoiding module gets activated.

4.1 FLOW-CHART OF OBSTACLE AVOIDING


MODULE

275
International Journal of Pure and Applied Mathematics Special Issue

Fig 3. Flow chart of obstacle avoiding module.

The above flow chart repeats continuously in a loop measures


the distances and take its course.

4.2 PSUEDO CODE FOR OBSTACLE AVOIDING


MODULE
Following code is for the obstacle avoiding module and
shows the connection between the line follower module and
this module by calling the line follower functions (discussed
under 5th heading) at certain constraints.
Include servo library
Include AFMotor library
Set servo to pin 9
Set trig pin to A3
Set echo pin to A4
Initially make the robot stop.
Check weather left distance is greater than right
distance.
If left distance is greater than right
Make robot to turn left
Delay for some time
Step 1:
make robot to move forward
delay for some time
check right greater than max distance.
If right greater than max distance
Make Robot to turn right.
Delay for some time
Step 2:
Make robot to move276
forward
International Journal of Pure and Applied Mathematics Special Issue

Delay for some time


Check right greater than max distance
If right greater than max distance
Make robot to turn right
Delay for some time
Step 3:
Make robot to move forward.
Delay for some time
Check for black line
If black line is present
Make robot to turn left.
Delay for some time
Go to line follower module
Else
Go to step 3
Else
Go to step 2
Else
Go to step 1
Else
Make robot to turn right
Delay for some time
Step 4:
Make robot to move forward
Delay for some time
Check for left greater than max distance
If left is greater than max distance
Make robot to turn left
Delay for some time
Step 5:
Make robot to move forward
Delay for some time.
Check for left greater than max distance
If left greater than max distance
Make robot to turn left
Delay for some time
Step 6:
Make robot to move forward.
Delay for some time
Check for black line
If black line is present
make robot to turn right
delay for some time
go to line follower module
Else
Go to step 6
Else
Go to step 5
Else
Go to step 4
This loop continuous
Check:// this function is used to check the left
distance is greater than right distance.
Turns servo to 0 degrees calculate distance
Store the value in left
Turn servo to 180 degrees calculate distance
Store the value in right
Turn servo to 90 degree
Compare left and right distances
If left is greater
Return Boolean true
Else
Return Boolean false
Distance:// this function is used to calculate
distance
make trig pin low
delay for 2 micro seconds
make trig pin high
delay for 10 micro seconds
277
International Journal of Pure and Applied Mathematics Special Issue

make trig pin low


calculate delay between triggered wave to
reflected echo wave
calculate distance = duration/58.2;
return distance

CheckLGM and CheckRGM is the functions works same as


check function but compare left distance to threshold and
right distance to threshold value respectively. The robot stops
controlling is in the line follower module. In line follower
module while following the black line the robot check the
presence of object in its path once in loop when distance is
below set distance then the control is back to the obstacle
avoiding module.
5. CIRCUIT

Fig 4. Circuit connections of robot.

6. WORKING OF ROBOT
Robot follows the black line as per the code of line follower
module while following it continuously check for presence of
an obstacle in its path. When an obstacle is detected it shifts
the robot control to the obstacle avoiding module. After the
avoiding obstacle, it sent back control to line follower module.
Several functions are used in code to reduce complexity and
increase preciseness of robot. The complete function of robot
as per the pseudo code that explained above.

X. RESULTS
Following figures are the results of specimen. It was
working fine by detecting obstacles while following the path

278
International Journal of Pure and Applied Mathematics Special Issue

Fig 5. Working of specimen snapshots

CONCLUSION
The robot that designed has different functionality
than other line followers and obstacle avoidance robots. By
using servo motor we reduced number of ultra-sonic sensors
from 3 to 1 and cover all the three directions by rotation of
robot head and we can know in which direction the robot was
looking by observing its head.
By making some changes in the programming of the
robot we can detect the obstacle at each degree around the
robot and get the position of the obstacle. By replacing
ultrasonic sensor with camera, it can capture the obstacles
and take a necessary action. By incorporating some logical
commands the robot it can be used for multipurpose. the
preciseness of the robot in following line can be increased by
increasing number of IR sensors. This robot can be used in
industries, hospitals and army applications. This robot can
replace conventional conveyor belts.

REFERENCES

1. K.H. Ng, C.F. Yeong, E.L.M. Su, T.Y. Lim, Y. Subramaniam, and R.S. Teng, “Adaptive
Phototransistor Sensor for Line Finding”, International Symposium on Robotics and
Intelligent Sensors 2012 (IRIS 2012), vol. 41, pp. 237-243, 2012.
2. F.H. Jen and B.T. Mai, “Building an autonomous line tracing car”, IEEE Intelligent Control
and Automation (WCICA), 2012 10th World Congress on, pp. 4478 - 4483, July 2012.
3. M. Engin and D. Engin, “Path planning of line follower robot”, IEEE Education and
Research Conference (EDERC), 2012 5th European DSP, pp. 1-5, September 2012.
4. N.M. Arshad, M.F. Misnan, and N.A. Razak, “Single InfraRed Sensor Technique for Line-
Tracking Autonomous Mobile Vehicle”, Signal Processing and its Applications (CSPA),
2011 IEEE 7th International Colloquium on, pp. 159-162, March 2011.
5. Y. Li, X. Wu, D. Shin, W. Wang, J. Bai1, Q. He1, F. Luo, and W. Zheng, “An Improved
Line Following Optimization Algorithm for Mobile Robot”, IEEE Computing and
Convergence Technology (ICCCT), 2012 7th International Conference on, pp. 84-87,
December 2012.

279
International Journal of Pure and Applied Mathematics Special Issue

280
281
282

S-ar putea să vă placă și