project research

48
Republic of Iraq Ministry of higher Education and Scientific Research University of Baghdad College of Al-Khwarizmi Engineering Automated Manufacturing Engineering Department Graduate Project Titled Black Line Tracking Robot By

Upload: zainab-falaiah

Post on 08-Jan-2017

62 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Project research

Republic of Iraq

Ministry of higher Education and Scientific Research

University of Baghdad

College of Al-Khwarizmi Engineering

Automated Manufacturing Engineering Department

Graduate Project Titled

Black Line Tracking Robot

By

Zainab Falaih Hasan Ulla Ahmed Ouda

Under Supervision

Dr. Hussein Tbena Kadhim Msc. Raghad Ahmed

June/2016

Page 2: Project research

University of Baghdad

College of Al-Khwarizmi Engineering

Automated Manufacturing Engineering Department

Graduate Project Titled

Black Line Tracking Robot

Submitted for partial fulfillment of the degree of

Bachelor of Automated Manufacturing Engineering

By Zainab Falaih Hasan Ulla Ahmed Ouda

Under Supervision

Dr. Hussein Tbena Kadhim Msc. Raghad Ahmed

Committee Certificate

June/2016

Page 3: Project research

وقل رب زدني علما

Page 4: Project research

Acknowledgments

We have received an amazing guidance from our supervisors "Dr. Hussien Tabeena" and "Msc. Raghad

Ahmed", we would like to convey our gratitude to them.

We would like to dedicate our project to all our "family members" for supporting us in all aspects of our lives

since we were born, without them we wouldn’t do anything.

We would like to thank all of our "lecturers" who were like candles in our way in every single information they

gave it to us from their knowledge.

At the end we would like to dedicate our project to all our "classmates" who shared with us everything and

supported us in the good and the bad times.

Page 5: Project research

Abstract

This paper describes algorithm of line tracking robot (any contrasting colors) it’s a machine that can follow a

path. The path can be visible like a black line on a white surface (or vice-versa), the line follower robot is an

automated part of a fully automated factory which are considered to be the most flexible type of material

handling system, the vehicles’ working environment ranges from small offices with carpet floor to huge harbor

dockside areas, as it give many advantages in our lives.

The aim of this project is to build a prototype of a black line tracking robot that can move on a flat white surface

with visible black line to follow by its two driving wheels that connected to two DC gear motors and a third

wheel that make the vehicle to rotate 360°. The prototype is able to follow the black line on floor with the AVR

microcontroller to synchronize the orders from the sensors and for controlling the delay.

To follow the line, the microcontroller is attached to a sensor that continuously reflecting to the surface

condition by proximity sensor which control the movement and the direction of the vehicle which play role of

stern and a distance sensor which act like a brakes when necessary.

Therefore, this project involves designing and fabrication of the hardware and the software.

Keywords

Infrared detector, Mobile robots, Path planning, Line follower robot, Robot sensing system

Page 6: Project research

Contents

Acknowledgments

Abstract

Chapter One: Introduction…………………...…………………………………………1

1.1 Line tracking robot definition………………...…………………………………….1

1.2 Literature review……………………………………..………………………….

….1

1.3 Objective…………..

………………………………………………………………..1

1.4 Scopes of project…………………..

………………………………………………..2

1.5 Advantages……..…………………………………………………………………..2

1.6 Disadvantages………..……………………………………………………………..2

1.7 Applications…………..…………………………………………………………….3

Chapter Two: Robot Design……………………………………………………………4

2.1 Line tracking robot principle……..………………………………………………...4

2.2 Algorithm…..………………………………………………………………………5

2.3 Theory of differential steering system…………………..…………………………6

2.4 Path specification………… ………………………………………………………7

2.5 Methodology………..……………………………………………………………...7

Chapter Three: Hardware components………..………………………………………..8

3.1 Arduino Uno……..…………………………………………………………………8

3.2 The AVR microcontroller…..……………………………………………………...9

3.3 L298 dual H-bridge motor controller module………..…………………………...10

3.4 IR proximity sensor……………..………………………………………………...11

3.5 Carriage……..…………………………………………………………………….11

I

Page 7: Project research

3.6 Batteries………………….……………………………………………………….12

3.7 Wires…..………………………………………………………………………….12

Chapter Four: Implementation………………………………………………………..13

4.1 Main board schematic……..……………………………………………………...13

4.2 Sensor circuit…..………………………………………………………………….15

4.3 Motor interface and control circuit…………..……………………………………16

4.4 The H-bridge control hardware..………………………………………………….17

4.5 PMW specification & calculation…………..…………………………………….18

4.6 Voltage experiment…………..…………………………………………………...19

4.7 Process explanation…………..…………………………………………………...20

4.8 Flow chart…………………..……………………………………………………..21

4.9 Programming………………..…………………………………………………….22

4.10 Code……………………………………………………………………………...22

4.11 Final shape……………………………………………………………………….25

Chapter Five: Results & Conclusion……………………………………...…………..27

5.1 Results…..………..……………………………………………………………….27

5.2 Proposal for future work………………..…………………………………………27

References & resources..………..…………………………………………………….28

II

Page 8: Project research

List of figures

FIGURE NAME PAGE NUM.2.1 Sensor principle 42.2 The robot principle 52.3 Theory of differential steering system 62.4 The path 73.1 Arduino UNO 83.2 AVR microcontrollers 93.3 L298 Dual H-bridge motor controller module 103.4 The proximity sensor 113.5 Automation carriage 113.6 Batteries 123.7 Wires 124.1 Schematic main board 134.2 Complete circuit diagram 144.3 Circuit connections 144.4 Schematic of a single sensor 154.5 Relative voltage swing 164.6 Internal schematic of L298 174.7 The motor controller 174.8 Line tracking process 204.9 Rotating algorithm 214.10 Process flow chart 214.11 Programmable code 224.12 Linking motors to tires 254.13 Final shape 264.14 Black line tracking robot on path 26

III

Page 9: Project research

Chapter one

Introduction

1.1 Line tracking definition

The line tracking is a self-operating robot that detects and follows a line that is drawn on the floor. The path

consists of a black line on a white surface (or it may be reverse of that). The control system used must sense a

line and maneuver the robot to stay on course, while constantly correcting the wrong moves using feedback

mechanism, thus forming a simple yet effective closed loop System. The robot is designed to follow very tight

curves.[1]

1.2 Literature review

In this section some of the existing tools and technologies developed so far in the field line tracking robots are

reviewed. Hymavathi & Vijay Kumar (2011) presented a paper on Design of a double line tracking using IR

sensors, op-amp and 8051 Microcontroller. Arora & Mengi (2011) presented a paper on line follower using IR

sensors and S12X Microcontroller. These techniques have a major drawback that they are color dependent. The

voltages outputted by the sensors depend on the color sensed. Hence they are not flexible. Also these IR sensors

are affected by other IR radiations if present in the same environment. The placement of sensors is also

dependent on the dimensions of the path. Also IR sensors have a limited lifetime and it’s difficult to debug

faults.[6]

1.3 Objective

In the industry carriers are required to carry products from one manufacturing plant to another which are usually

in different buildings or separate blocks. Conventionally, carts or trucks were used with human drivers.

Unreliability and inefficiency in this part of the assembly line formed the weakest link. The project objective is

to automate this sector, using carts to follow a line instead of laying railway tracks which are both costly and an

inconvenience.[1]

1

Page 10: Project research

1.4 Scopes of project

• The robot must be capable of following a line.

• It should be capable of taking various degrees of turns

• It must be prepared of a situation that it runs into a territory which has no line to follow.

• The robot must also be capable of following a line even if it has breaks.

• The robot must be insensitive to environmental factors such as lighting and noise.

• The color of the line must not be a factor as long as it is darker than the surroundings.

1.5 Advantages Can be moved on the straight or arc-shaped railways to carry many different kinds of stuff.

Different shape, size and weight can be carry.

Flexible and intelligent.

Time consuming.

Used to reduce manufacturing and labor costs while increasing productivity and efficiency.

Robot movement is automatic.

It is used for long distance applications.

Simplicity of building.

Used in home, industrial automations etc.[8]

1.6 Disadvantages

Follows a black line about 1 or 2 inches in width on a white surface.

Simple robots with an additional sensors placed on them.

Needs a path to run either white or black since the IR rays should reflect from the particular path.

Slow speed and instability on different line thickness or hard angles.[8]

2

Page 11: Project research

1.7 Applications

Industrial Applications: These robots can be used as automated equipment carriers in industries replacing

traditional conveyer belts, automatic storage, packaging, use as a handling materials vehicle inside the

factories, in harbors with the aid of robotic arm can make completely automated system of loading and

unloading from the ships.

Automobile applications: These robots can also be used as automatic cars running on roads with

embedded magnets.

Domestic applications: These can also be used at homes for domestic purposes like floor cleaning etc.

Guidance applications: These can be used in public places like shopping malls, museums etc. to provide

path guidance.

Medical applications: As a wheel chair for patients to use it, can be used in walking stick for blind

persons which react as an alarm when get out of the way instead of the motor, efficient automatic

transportation of goods, the goods typically transported by ATLIS System include carts of dietary/food

items, medical/surgical supplies (case carts), linens, trash, regulated medical waste, pharmaceuticals, items

for decontamination centers, and general housekeeping items.[1]

3

Page 12: Project research

Chapter two

Robot design

2.1 Line tracking robot principle

The working of a line follower robot is pretty straight forward. These robots have the capability to detect a

black/dark line on a lighter surface depending on the contrast. They estimate whether the line underneath them

is shifting towards their left/right as they move over them. Based on that estimation they give respective signals

to the motors to turn left/right so as to maintain a steady center with respect to the line.

These robots usually use an array of IR (Infrared) sensors in order to calculate the reflectance of the surface

beneath them. The basic criteria being that the black line will have a lesser reflectance value (black absorbs

light) than the lighter surface around it. This low value of reflectance is the parameter used to detect the position

of the line by the robot. The higher value of reflectance will be the surface around the line. So in this linear

array of IR sensors, if the leftmost/rightmost IR sensor presents the low value for reflectance, then the black line

is towards the left/right of the robot correspondingly. The controller then compensates for this by signaling the

motor to go in the opposite direction of the line. [2]

Fig. (2.1) Sensor Principle

4

Page 13: Project research

Fig. (2.2) The robot principle

2.2 Algorithm

The robot uses IR sensors to sense the line, IR LEDs (Tx) and sensors (Rx), facing the ground has been used in

this setup. The output of the sensors is an analog signal which depends on the amount of light reflected back,

this analog signal is given to the comparator to produce 0s and 1s which are then fed to the uC.

1. L= left sensor which reads 0; R= right sensor which reads 0.

If no sensor on Left (or Right) is 0 then L (or R) equals 0;

2. If both sensors read 1 go to step 3,

Else,

If L>R Move Left

If L<R Move Right

If L=R Move Forward5

Page 14: Project research

Go to step 4

3. Move clockwise if line was last seen on Right

Move counter clockwise if line was last seen on Left

Repeat step 3 till line is found.

4. Go to step 1.[3]

2.3 Theory of the differential steering system

The differential steering system is familiar from ordinary life because it is the arrangement used in a

wheelchair. Two wheels mounted on a single axis are independently powered and controlled, thus providing

both drive and steering. Additional passive wheels (usually casters) are provided for support. Most of us have

an intuitive grasp of the basic behavior of a differential steering system. If both drive wheels turn in tandem,

the robot moves in a straight line. If one wheel turns faster than the other, the robot follows a curved path. If

the wheels turn at equal speed, but in opposite directions,

the robot pivots.[8]

Fig. (2.3) Theory of differential steering system

6

Page 15: Project research

2.4 Path specifications

There are two colors chosen for the guide-path.

Guiding Color: very low reflection color (black) drawn on the ground, which form the path of the vehicle;

the basic width of the line is (200mm) which is a bit more than the space between the two sensors, this is to

avoid failures happening while turnings. In this case the sensor board may go out of the basis path and read the

data from the basic carpet of the shop floor which makes the plan unlikely and unpredictable.

Base Color: This color is a shiny color with high reflection (white) which the line follower sensor react with

to move the vehicle, it forms the basic platform of the factory or the place where the vehicle work in.[3]

Fig. (2.4) The path

2.5 Methodology

First we used the reflective optical sensors but when we experienced it the signal that gave us was too weak so

we used an amplifier circuit but also the signal wasn’t strong enough to operate and sense the line from a

distance ,Then we changed the sensors into the IR proximity sensor and tested it by connecting it with the

Arduino and when we passed it over a white color path it gave us signal (1) and when we passed it over black

path gave us (zero) , then we started the hardware part of the project and the programing part using the C/C++

language and finally it worked. For which we’re thankful for, as we have learnt much more in the processes.[3]

7

Page 16: Project research

Chapter three

Hardware component

3.1 Arduino Uno

The Uno is a microcontroller board based on the ATmega328P.It has 14 digital input/output pins (of which 6

can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an

ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect

it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. You can

tinker with your UNO without worrying too much about doing something wrong, worst case scenario you can

replace the chip for a few dollars and start over again. "Uno" means one in Italian and was chosen to mark the

release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the

reference versions of Arduino, now evolved to newer releases. The Uno board is the first in a series of USB

Arduino boards, and the evolved to newer releases. The Uno board is the first in a series of USB Arduino

boards, and the reference model for the Arduino platform; for an extensive list of current, past or outdated

boards see the Arduino index of boards.[1]

Fig. (3.1) Arduino UNO

8

Page 17: Project research

3.2 The AVR microcontroller

Atmel's AVR® microcontrollers have a RISC core running single cycle instructions and a well-defined I/O

structure that limits the need for external components. Internal oscillators, timers, UART, SPI, pull-up resistors,

pulse width modulation, ADC, analog comparator and watch-dog timers are some of the features you will find

in AVR devices.

AVR instructions are tuned to decrease the size of the program whether the code is written in C or Assembly.

With on-chip in-system programmable Flash and EEPROM, the AVR is a perfect choice in order to optimize

cost and get product to the market quickly.[4]

Fig. (3.2) AVR microcontrollers

9

Page 18: Project research

3.3 L298 Dual H-bridge Motor Controller module

H- Bridges are typically used in controlling motors speed and direction, but can be used for other projects such

as driving the brightness of certain lighting projects such as high powered LED arrays. An H-

Bridge is a circuit that can drive a current in either polarity and controlled by *Pulse Width Modulation (PWM).

Pulse Width Modulation is a mean in controlling the duration of an electronic pulse.[4]

Fig. (3.3) L298 Dual H-bridge Motor Controller module

3.4 IR Proximity sensor

The IR Proximity sensor is one of the most commonly used sensors you will find these in automatic taps,

automatic door opening, etc. This sensor works on the principle of IR reflectance.

There is an IR LED (white / light blue in color) that’s constantly emitting emitting IR light. The light when

reflected back falls on the IR Receiver) LED / Photodiode (the black / dark blue color led) this received signal

is then Already a member? Sign in processed by an OpAmp and the OpAmp gives a HIGH signal. So the sensor

module will give a HIGH signal if there is an object in front of the LED's. The range of sensing can be varied by

adjusting the potentiometer on the sensor module. The maximum range of this module is only a few cms, so

don't expect to use this as a distance sensor.  The module will not work when pointed at black objects as black

color tends to absorb the IR light program to trigger the Buzzer every time the sensor gives a high signal.[2]

10

Page 19: Project research

Fig. (3.4) The proximity sensor

3.5 Carriage

Contain three tires used in the project taken from baby carriage, two of them are attached to the motors and the

third is restricted in movement only rotate forward and backward. Three tires are used instead of four to lessen

the friction while turning because there is no steering to rotate the tire.[3]

Fig. (3.5) Automation carriage

11

Page 20: Project research

3.6 Batteries

The vehicle is powered by two (9 volts) batteries as a primary source of an electrical energy for the motors and

as a power supply for the Arduino.

Fig.(3.6) 9v batteries

3.7 Wires

Fig. (3.7) Wires

12

Page 21: Project research

Chapter four

Implementation

4.1 Main board schematic

Each of the hardware is dissected and was designed/implemented separately for their functional and later

incorporated as one whole application. This helped in the debugging processes. In similar fashion the separate

modules forming the ensemble will be explained separately.

Fig. (4.1) Schematic main board

13

Page 22: Project research

Fig. (4.2) Complete circuit diagram

Fig. (4.3) Circuit connections

14

Page 23: Project research

4.2 Sensor circuit

The resistance of the sensor decreases when IR light falls on it. A good sensor will have near zero resistance in

presence of light and a very large resistance in absence of light, we have used this property of the sensor to form

a potential divider. The potential at point ‘2’ is R sensor / (R sensor + R1). Again, a good sensor circuit should

give maximum change in potential at point ‘2’ for no-light and bright-light conditions. This is especially

important if you plan to use an ADC in place of the comparator. To get a good voltage swing, the value of R1

must be carefully chosen. If R sensor = a when no light falls on it and R sensor = b when light falls on it. The

difference in the two potentials is:

Vcc * { a/(a+R1) - b/(b+R1) }……….(1)

Fig. (4.4) Schematic of a single sensor

15

Page 24: Project research

Fig. (4.5) Relative voltage swing

Relative voltage swing = Actual Voltage Swing / Vcc……….(2)

= Vcc * { a/(a+R1) - b/(b+R1) } / Vcc

= a/(a+R1) - b/(b+R1)

4.3 Motor interface and control circuit

The L298 Motor Driver has 4 inputs to control the motion of the motors and two enable inputs which are used

for switching the motors on and off. To control the speed of the motors a PWM Waveform with variable duty

cycle is applied to the enable pins. Rapidly switching the voltage between Vs and GND gives an effective

voltage between Vs and GND whose value depends on the duty cycle of PWM. 100% duty cycle corresponds to

voltage equal to Vs, 50 % corresponds to 0.5Vs and so on.

Many circuits use L293D for motor control, I chose L298 as it has current capacity of 2A per channel @ 45V

compared to 0.6 A @ 36 V of a L293D. L293D’s package is not suitable for attaching a good heat sink,

practically you can’t use it above 16V without frying it. L298 on the other hand works happily at 16V without a

heat sink, though it is always better to use one.

16

Page 25: Project research

Fig. (4.6) Internal Schematic of L298

4.4 The H-bridge control hardware

Fig. (4.7) The motor control

17

Page 26: Project research

The entire motor control circuitry is shown in the above figure along with the internal circuitry of the L298 motor control IC. The table below clearly indicated the operation of the IC.

Table (1)

The total number of directional control signals required is 4; but as it can be observed in the above table, IN1 &

IN2 are complimentary (and so is IN3 & IN4) that is, both the inputs have to take the opposite states for a safe

operation. This is done by connecting DL to IN1 and L D to IN2. The same is done to IN3 & IN4. Now we have

1 directional control per motor. The ENABLE of each motor section is given PWM inputs to further improve on

the control. Now, each motor has a direction control and a speed control. The clamping diodes are built into the

chip which prevent the back EMF generated by the motors to harm the H-bridge.

4.5 PWM Specification & Calculation The L293D chip can operate on PWM signals up to 5kHz, which was decided to be used.

..........(3)

1/5kHz = [(PR2) + 1] × 4 × (1/4MHz) × 1200μs = [(PR2) + 1] × 1μs

PR2 = 200-1 = 199 ≈200

Three speeds are used for the line following robot and their corresponding duty cycles are 0%, 50% & 96%. These calculations are shown below.

18

Page 27: Project research

For 0% duty cycle the value to be loaded is obviously zero,For 50 % duty cycle,PWM duty cycle = 200μ s100× 50 = 100μs .100 μ s = [DCx] •0.25μs • 1DCx = 400 = 110010000bThus, clear the bits DCxB1 & DCxB0 and load 1100100b i.e. 100 into the CCPRxLregister.For 96 % duty cycle,PWM duty cycle = 200μ s100× 96 = 192μs .192 μ s = [DCx] •0.25μs • 1DCx = 768 = 1100000000b

Thus, clear the bits DCxB1 & DCxB0 and load 11000000b i.e. 192 into the CCPRxL register.

4.6 Voltage experiment

Orientation Voltage at node A Voltage at node B INFERENCE Both sensors on white 3.5v 3.5v Robot not moving

Left sensor on white and right

sensor on black0v 3.5v Robot drifted to right

Left sensor on black and right

sensor on white3.5v 0v Robot drifted to left

Both sensors on black 0v 0v Robot moving

Forward

Table (2)

19

Page 28: Project research

4.7 Process explanation

Fig. (4.8) Line tracking process

As shown in the figure above, is a typical situation involved. At every sampled time the commands executed by the microcontroller is also shown. From the above figure, it should be clear about the software requirements.If no line is seen, the microcontroller just follows the previous action. This process is continued till either 5 seconds elapse or a line is reached. If a line is not reached within 5 seconds (software controlled), the microcontroller shifts into “line find” mode. In this mode, the robot takes a right turn and starts rotating about a fixed point. The radius is continuously incremented every second. Thus the robot follows the path of a spiral. This process is continued till either a line is reached or till the robot has achieved a maximum radius of curvature (is traveling in straight line) when the

Process is reset and the robot is made to turn in the starting circle, but now at a different point. This is the algorithm with minimum complexity considering speed requirements.

20

Page 29: Project research

Fig. (4.9) Rotating algorithm

4.8 Flow chart

Fig. (4.10) Process flow chart

21

Page 30: Project research

4.9 Programming

We used C++ language for programming using the Arduino application

Fig. (4.11) Programming code

4.10 Code float Kp=0,Ki=0,Kd=0;

float error=0, P=0, I=0, D=0, PID_value=0;

float previous_error=0, previous_I=0;

int sensor[5]={0, 0, 0, 0, 0};

int initial_motor_speed=100;

void read_sensor_values(void);

void calculate_pid(void);

void motor_control(void);

void setup()

22

Page 31: Project research

{

pinMode(9,OUTPUT); //PWM Pin 1

pinMode(10,OUTPUT); //PWM Pin 2

pinMode(4,OUTPUT); //Left Motor Pin 1

pinMode(5,OUTPUT); //Left Motor Pin 2

pinMode(6,OUTPUT); //Right Motor Pin 1

pinMode(7,OUTPUT); //Right Motor Pin 2

Serial.begin(9600); //Enable Serial Communications

}

void loop()

{

read_sensor_values();

calculate_pid();

motor_control();

}

void read_sensor_values()

{

sensor[0]=digitalRead(A0);

sensor[1]=digitalRead(A1);

sensor[2]=digitalRead(A2);

sensor[3]=digitalRead(A3);

sensor[4]=digitalRead(A4);

if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==0)&&(sensor[4]==0)&&(sensor[4]==1))

error=4;

else if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==0)&&(sensor[4]==1)&&(sensor[4]==1))

error=3;

else if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==0)&&(sensor[4]==1)&&(sensor[4]==0))

error=2;

else if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==1)&&(sensor[4]==1)&&(sensor[4]==0))

error=1;

23

Page 32: Project research

else if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==1)&&(sensor[4]==0)&&(sensor[4]==0))

error=0;

else if((sensor[0]==0)&&(sensor[1]==1)&&(sensor[2]==1)&&(sensor[4]==0)&&(sensor[4]==0))

error=-1;

else if((sensor[0]==0)&&(sensor[1]==1)&&(sensor[2]==0)&&(sensor[4]==0)&&(sensor[4]==0))

error=-2;

else if((sensor[0]==1)&&(sensor[1]==1)&&(sensor[2]==0)&&(sensor[4]==0)&&(sensor[4]==0))

error=-3;

else if((sensor[0]==1)&&(sensor[1]==0)&&(sensor[2]==0)&&(sensor[4]==0)&&(sensor[4]==0))

error=-4;

else if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==0)&&(sensor[4]==0)&&(sensor[4]==0))

if(error==-4) error=-5;

else error=5;

}

void calculate_pid()

{

P = error;

I = I + previous_I;

D = error-previous_error;

PID_value = (Kp*P) + (Ki*I) + (Kd*D);

previous_I=I;

previous_error=error;

}

void motor_control()

{

// Calculating the effective motor speed:

int left_motor_speed = initial_motor_speed-PID_value;

int right_motor_speed = initial_motor_speed+PID_value;

24

Page 33: Project research

// The motor speed should not exceed the max PWM value

constrain(left_motor_speed,0,255);

constrain(right_motor_speed,0,255);

analogWrite(9,initial_motor_speed-PID_value); //Left Motor Speed

analogWrite(10,initial_motor_speed+PID_value); //Right Motor Speed

//following lines of code are to make the bot move forward

/*The pin numbers and high, low values might be different

depending on your connections */

digitalWrite(4,HIGH);

digitalWrite(5,LOW);

digitalWrite(6,LOW);

digitalWrite(7,HIGH);

}

4.11 Final shape We assembled all the parts tires to carriage, connected the motors to the tires and to the motor driver, the

Arduino kit was placed with glue on the cart and at last the electrical kit with the micro controller of the

Arduino

Fig. (4.12) Linking motors to tires25

Page 34: Project research

Fig. (4.13) Final Shape

Fig. (4.14) Black line tracking robot on its path

26

Page 35: Project research

Chapter five

Results & Conclusion

5.1 Results

In general, LTR was tested employing all the navigational strategies discussed in this paper. Observation made for every proposed strategy show that the robot is capable of navigating the line with no difficulties at all. Introducing ambient lighting to the test pitch does not affect the line following capability. The same can be said in terms of junction navigation algorithms.

When the both sensors read 3.5V the robot stopped. When the right sensor read 3.5V and the left sensor read 0V the robot turned left. When the right sensor read 0V and the left sensor read 3.5 V the robot turned right. When the both sensors read 0V the robot moved forward.

Unexpected problems didn't take it in consideration:

It was supposed to use 5 sensors instead of two but because of the market limitations we had to work with just two and that caused us troubles in movement accuracy.

We had batteries problem we couldn’t find rechargeable batteries so we had to use less efficiency batteries which drains fast.

We switched the sensors from color sensor to proximity sensor because it didn’t give us enough voltage.

5.2 Proposal for future work

Many developing can achieve to the project like: A camera to help in monitoring the way. Adding fork- lift or robotic arm for automatic loading and unloading. Add wiper for cleaning. We can use more sensors to increase the accuracy or use the PID control to increase the flexibility and

control the errors.

27

Page 36: Project research

References & Resources

Books:[1] Bajestani, S.E.M., Vosoughinia, A., “Technical Report of Building a Line Follower Robot” International

Conference on Electronics and Information Engineering

[2] M. Zafri Baharuddin, Izham Z. Abidin, S. Sulaiman Kaja Mohideen, Yap Keem Siah, Jeffrey Tan Too

Chuan,"Analysis of Line Sensor Configuration fo or the Advanced Line Follower Robot",University Tenaga

Nasional.

[3] Miller Peter , “Building a Two Wheeled Balancing Robot”, University of Southern Queensland, Faculty of

Engineering and Surveying. Retrieved Nov 18, 2008.

[4] Priyank Patil , “AVR Line Following Robot,” Department of Information Technology K. J. Somaiya

College of Engineering Mumbai, India. Retrieved Mar 5, 2010.

[5] Digital logic and computer design by M. Morris Mano - Prentice – Hall of India PVT limited

Digital Systems Principles & applications by Ronald J. Tocci Sixth Edition - Prentice – Hall of India PVT

limited

Links:[6] The Seattle Robotics Society Encoder library of robotics articles

http://www.seattlerobotics.org/encoder/library.html

[7] Dallas Personal Robotics Group. Most of these tutorials and articles were referred.

http://www.dprg.org/articles/index.html

[8] Go Robotics.NET, this page has many useful links to robotics articles.

http://www.gorobotics.net/articles/index.php

[9] Carnegie Mellon Robotics Club. This is the links page with lots of useful resources

http://www.roboticsclub.org/links.html

28

Page 37: Project research

البحث ملخص

الروبت(, متباين لون اي او )االسود للمسار متتبع روبوت انجاز يشمل البحث هذا

يكون ان ممكن, مسار اي تتبع على قادره ماكنه عن هوعباره االسود للمسار المتتبع

جزء هو الروبت هذا(, العكس او )ابيض سطح على االسود كاللون ظاهر المسار

نقل نظام في جزء اهم يعتبر ان الممكن من الذي مؤتمت مصنع اي من مؤتمت

االرضيات ذات الصغيره المكاتب من واسعه نطاقات في يعمل الروبوت, المواد

حياتنا في الفوائد من الكثير لنا يوفر والذي الضخمه الموانئ وحتى المفروشه .االسود للمسار المتتبع الروبوت عن مصغر نموذج بناء هو المشروع من الهدف

بواسطه ليتبعه اسود ظاهر خط ذات بيضاء ارضيه على التحرك يستطيع والذي

درجه 360 الدوران من تتمكن متحرره ثالثه وعجله بماطورين مربوطين عجلتين .مزامنه من ليتمكن مايكروكونترولر بواسطه الخط هذا تتبع على قادر النموذج

بالمهله والتحكم المتحسسات من االوامر .باستقبال تستمر التي المتحسسات مع يربط المايكروكونترولر االسود الخط التباع

تتحكم التي القرب متحسسات بواسطه السطح لحاله تبعا المنعكسه االشارات

الحاجه عند كمكابح حتى مهما دورا تلعب والتي العربه واتجاه بحركه .والمعدات وصنع تصميم يشمل المشروع, لذلك للبرمجيات .

29