Professional Documents
Culture Documents
Design Implementation of An Autonomous Forklift PDF
Design Implementation of An Autonomous Forklift PDF
&
Implementation
of
An Autonomous Forklift
BY
ARJOO SHANEESH
University of Mauritius
Faculty of Engineering
March 2012
Autonomous Forklift
TABLE OF CONTENTS
Table of Contents
CHAPTER 1 : INTRODUCTION ............................................................................. 1
1.1 Advantages of AGVs........................................................................................ 2
1.2 Problem Definition & Aims.............................................................................. 2
1.3 System Description .......................................................................................... 3
1.4 Thesis Structure................................................................................................ 4
CHAPTER 2 : LITTERATURE OVERVIEW ........................................................... 5
2.1 Introduction ................................................................................................. 5
2.2 Industrial Forklifts ....................................................................................... 5
2.3 Autonomous Navigation .............................................................................. 5
2.4 Sorting......................................................................................................... 7
2.5 Guide Tape AGV......................................................................................... 7
2.6 Trailer Loading AGV .................................................................................. 8
CHAPTER 3 : CONCEPTUAL DESIGN ................................................................ 10
3.1 Introduction.................................................................................................... 10
3.2 System Block Diagram ................................................................................... 10
3.2.1 Central PC........................................................................................................... 10
3.2.2 Autonomous Forklift ........................................................................................... 11
3.3 System Flow Chart ......................................................................................... 13
3.4 Conceptual Design ......................................................................................... 15
3.5 Central PC Design .......................................................................................... 16
3.5.1 Sorting ................................................................................................................ 16
3.5.2 Barcode Reader .................................................................................................. 19
3.5.3 Wireless Communicator...................................................................................... 20
3.6 Autonomous Forklift Design .......................................................................... 24
3.6.1 Obstacle Detection ............................................................................................. 24
3.6.2 Navigation System .............................................................................................. 27
3.6.3 Steering System .................................................................................................. 29
3.6.4 Motor Selection .................................................................................................. 34
3.6.5 Microcontroller Selection ................................................................................... 36
3.6.6 Material Selection............................................................................................... 40
Page | i
Autonomous Forklift
Page | ii
Autonomous Forklift
Page | iii
Autonomous Forklift
LIST OF TABLES
Table 3.1: Decision matrix for Sorting. .................................................................... 18
Table 3.2: Decision matrix for Wireless Communicator. .......................................... 23
Table 3.3: Decision matrix for Steering System ....................................................... 33
Table 3.4: Motor Torque Calculation ....................................................................... 34
Table 3.5: Components of Central PC ...................................................................... 36
Table 3.6: Components of AGV .............................................................................. 37
Table 3.7: Decision matrix for Microcontroller Selection ......................................... 40
Table 3.8: Decision matrix for Material Selection .................................................... 41
Table 4.1: Dimension of Parts.................................................................................. 45
Table 5.1: HC-SR04 Port Allocation ........................................................................ 52
Table 5.2: Voltage Regulators.................................................................................. 59
Table 5.3: L293D Features ...................................................................................... 64
Table 5.4: L293D Logic........................................................................................... 65
Table 5.5: Motor Driver IC Features ........................................................................ 66
Table 5.6: ShiftOut Numbers ................................................................................... 66
Table 5.7: Motor Driver IC Features ........................................................................ 67
Table 5.8: Motor Direction Relative to ShiftOut ...................................................... 70
Table 5.9: Nordic Transceiver Connections. ............................................................ 72
Table 5.10: Different Connections of Arduino ......................................................... 74
Table 5.11: Different Connections of Arduino Nano ................................................ 79
Table 6.1: Typical LDR Values ............................................................................... 86
Table 7.1: Problems and Solutions ......................................................................... 105
LIST OF FIGURES
Figure 2.1: Forklift Overview .................................................................................... 6
Figure 2.2: Barcode Sorting ....................................................................................... 7
Figure 2.3: Line Following AGV ............................................................................... 8
Figure 2.4: AGV Loading Trailer............................................................................... 9
Figure 2.5: Loading Pattern ....................................................................................... 9
Figure 3.1: Central PC Block Diagram..................................................................... 11
Figure 3.2: AGV Block Diagram ............................................................................. 12
Figure 3.3: PC Flowchart ......................................................................................... 13
Figure 3.4: AGV Flowchart ..................................................................................... 15
Figure 3.5: Typical Barcode..................................................................................... 17
Figure 3.6: Typical RFID Tag .................................................................................. 18
Figure 3.7: Handheld Barcode Scanner .................................................................... 19
Page | iv
Autonomous Forklift
Page | v
Autonomous Forklift
Page | vi
Autonomous Forklift
LIST OF ABBREVIATIONS
AGV..Autonomous Guided Vehicle
IC..Integrated Circuit
PC..Personal Computer
RF.Radio Frequency
Page | vii
Autonomous Forklift
ACKNOWLEDGEMENTS
First and foremost, I would like to express my deepest thanks to my supervisors; Mr.
V. Oree and especially Mrs. R. Ramjug-Ballgobin for her constant help, guidance and
assistance throughout the year without whom, I would have been unable to
successfully complete my project.
I would also like to thank Mr. Rioux, the robotics lab technician for his help and
precious advice.
Lastly, I would thank my friends that have made my four years at the university very
memorable and thrilling.
Im furthermore very grateful to my mother, uncle and family who have always been
there for me as moral support and also lending me a helping hand when necessary.
Page | viii
Autonomous Forklift
UNIVERSITY OF MAURITIUS
Declaration:
In accordance with the appropriate regulations, I hereby submit the above dissertation for
examination and I declare that:
(i) I have read and understood the sections on Plagiarism and Fabrication and
Falsification of Results found in the Universitys General Information to Students
Handbook (20. /20.) and certify that the dissertation embodies the results of my
own work.
(ii) I have adhered to the Harvard system of referencing or a system acceptable as per
The University of Mauritius Referencing Guide for referencing, quotations and
citations in my dissertation. Each contribution to, and quotation in my dissertation
from the work of other people has been attributed, and has been cited and referenced.
(iii) I have not allowed and will not allow anyone to copy my work with the intention of
passing it off as his or her own work.
(iv) I am aware that I may have to forfeit the certificate/diploma/degree in the event that
plagiarism has been detected after the award.
Signature: Date:
Page | ix
Autonomous Forklift
ABSTRACT
The aim of the project was to devise a system capable of performing multi-tasks, that
is; sorting of loads and loading of trailers in an environment shared with workers.
The project dealt with the design and implementation of a whole system comprising
of a central PC and an autonomous forklift in response to the above problem. The
central PC sorts out loads and transmits the corresponding wireless data to the forklift.
The latter follows a predefined path and loads the appropriate trailer whilst not
affecting the safety of workers.
The central PC makes use of Roborealm, the machine vision software to differentiate
the trailers into which loading has to be done based on barcodes. The information
obtained is then transferred to a microcontroller connected to the PC via USB. The
latter communicates the data to the forklift via wireless communication for it to act
accordingly.
The electronic and mechanical parts of both the sub-systems were implemented. A
great deal of work was involved in the conceptual and software design so that the
system could perform effectively. Tests were carried out to show that the whole
system operated exactly as desired.
Page | x
Autonomous Forklift
CHAPTER 1 : INTRODUCTION
The first AGV was a simple tow truck that followed a wire track that was
embedded in the factory floor. Sensors under the truck detected the magnetic field,
produced by current passing through the wire and the former guided the tow truck
around the factory. With the development of Integrated Circuits (ICs) in the mid
1970s the popularity of AGV was greatly increased due to the fact that ICs have
better capabilities and flexibilities. A good example of the success of AGVs in 1973 is
the Volvo car manufacturer in Sweden that replaced its typical conveyor assembly
line with no less that 280 AGVs controlled by a computer.
AGVs can be classified into categories based on the kind of load they are able to
transport, the type of navigation system they use to move around or the tasks they
perform. The latter is the most common type of classification. Automated Guided
Vehicles are used in a wide range of tasks. They are extensively used in the handling
of work-in-process goods in the manufacturing and automotive industries where they
move materials form one process to another throughout the manufacturing process.
Page | 1
Autonomous Forklift
The advantage of using AGVs for this type of handling is that the movements of
goods between workstations are independent. Another example is the handling of
finished goods where they are used in the automatic storage and retrieval of goods in
food, beverage and pharmaceutical warehouses, where goods have to be classified by
the warehousing software according to date of manufacture. AGV forklifts are most
suitable for these applications as the goods are usually packed into unit loads found on
pallets [4] . Nowadays they are also being used for more complex processes like
automatic trailer loading where pallets are picked up from staging lanes and loaded
into standard trailers using specific loading patterns for improved goods safety and
trailer stability. Secondly in the healthcare industry where AGVs move linens,
regulated medical waste, patient meals and surgical case carts. The main advantage is
that as they move through the hospital they can automatically operate doors, elevators
and even trash dumpers. And lastly also for outer space exploration, the Mars Rovers
Spirit and Opportunity are two specially designed AGVs used for the exploration of
Mars in an attempt to find traces of water. Originally designed to work for only 90
days on the Martian soil, they outperform every expectation by still being in activity
since their landing in January 2004.
The advantages offered by AGVs which have contributed to their increased popularity
are mainly: [5]
Nowadays AGVs are being used in every aspect of the manufacturing process from
the handling of material, sorting, storage and retrieval and trailer loading. But most
AGVs today can perform only one of the above mentioned tasks. The rare AGVs that
Page | 2
Autonomous Forklift
can accomplish multitasking are very expensive. So the main idea behind the project
is to design and implement an overall system consisting of a central PC and an
autonomous forklift that can sort out crates and also load the latter into trailers
according to a specific loading pattern.
The challenge of this project is to design an overall system that can operate safely in
an existing human work place where other vehicles and workers on foot are present.
To meet the challenge the following aims should be met:
To be able to meet the above aims the proposed methodology was to develop a system
in two parts.
The first one would be sorting part, which would consist of a PC equipped with the
appropriate hardware and software. The PC would normally be found in the loading
area, with loads in close proximity so as to be able to perform its required task.
Whereas the AGV would be in the parking zone found at a remote location.
The PC would sort out the loads base on an algorithm and determine the trailers into
which each would be loaded. For the sake of the project three different trailers
mainly: A, B & C would be implemented. After having received confirmation about
the availability of the forklift, the information of the trailer to be loaded would be
communicated to the latter via wireless communication.
The second part would be the implementation of the autonomous forklift itself. The
forklift would initially be found at the parking zone, where it would inform the PC
about its availability and wait for any load to be present at the loading area.
After having received confirmation of the presence and the specific trailer to be
loaded, the forklift would follow a predefined marked path towards the loading area.
Along the path the latter would use its sensor as a non-contact form of obstacle
detection. In case of any obstacle present for a prolonged time the PC would be
informed of the situation by wireless.
Page | 3
Autonomous Forklift
At the loading area, the forklift would lower its forks, load the pallet and continue
motion along the path towards the trailers. While being on the path the AGV would
continue to monitor any obstacle.
On reaching the junction to the specific trailer, the forklift would do a 90 0 turn on
itself and enter. This time the latter would use its sensor as a distance measuring
device. The sensor would measure the distance between the forklift and the walls of
the trailer or that between the forklift and any previous load already present in the
trailer. The AGV would continue to move forward until the measured distance would
be equal to that of the sum of the width of the pallet and the minimum clearance
required between pallets or pallets and trailer wall.
At this moment the forklift would lower its forks and reverse until it reaches the
junction again. The AGV would then send an RF message to the PC, informing the
latter that it has successfully delivered the load. Then after a 900 turn the former
would continue along the path while detecting obstacles as mentioned above.
On reaching the parking zone, the forklift would stop and inform the PC via RF about
its availability for any further task. The AGV would continue to wait until a message
about any new load is received. On reception of the message the above loop would be
repeated until the trailers are full.
Chapter 3: The conceptual design deals with the selection of the various components,
microcontroller and material that would be used to implement the whole system. The
characteristics and features of each component are discussed and selection is mostly
done by the decision matrix method.
Chapter 5: The electronic design deals with the implementation and interfacing of
the various ICs, sensors, motors and transceiver with the Arduino boards for both the
forklift and central PC.
Chapter 6: The software design gives an in depth explanation of the function of the
different programs by use of flowcharts, that would be run on the AGV and PC.
Chapter 7: The implementation and testing details the various problems faced after
having completely built the system and what specific solution was found for each one.
Page | 4
Autonomous Forklift
2.1 Introduction
This chapter enumerates the key points on current knowledge that have been
published by scholars and researches in the specific field of autonomous guided
forklifts and how these research work can be applied to the project.
A forklift is a powered truck that is used for lifting and transportation of materials.
The latter developed since 1920s has become an indispensable piece of equipment in
all manufacturing and warehousing companies. Forklifts are rated for specific weights
and centre of gravity. One of the main advantages of forklifts is their increase
manoeuvrability in making tight corners, which is due to rear wheel steering.
Instability is the main problem concerning forklifts. The latter and a load are
considered as a unit which has continuous varying centre of gravity for every
movement of the load. Tip-over accidents is another concern that usually occurs when
forklifts negotiate turns with raised loads, it's the combination of the centrifugal and
gravitational forces that combine to cause these accidents [6].
The most common type of forklifts is the counterbalanced ones. They use a heavy
iron mass found at the rear that servers as a counterweight to compensate for the load.
In the case of electric ones the large lead-acid battery is sufficient to counterweight
the load.
The means of guidance for AGVs can be of many different types mainly:
Wired which is the oldest means of guidance where a current carrying wire
track is embedded into the floor. The Automated guided vehicle equipped
with a magnetic sensor, senses the magnetic field generated by the current and
the data obtained is used to navigate the robot along the path.
Page | 5
Autonomous Forklift
Guide tape was the type of navigation selected for the project of the
Autonomous Forklift as it is simple and can be easily implemented.
Page | 6
Autonomous Forklift
2.4 Sorting
Sorting machines found in industries are usually large conveyor-based systems like
the one developed by the SDI group in Holland [7] . The boxes found on the conveyor
are sorted by reading the barcodes or RFID tags found on them and they are
discharged along chutes into respective areas.
[8]
They are later collected by AGVs and transported to the appropriate areas for storage
or loaded into trucks. Using the same principle a PC equipped with a webcam would
sort the packages by decoding the barcode found on them. After decoding the
information extracted from the barcode will indicate into which trailer the package
shall be loaded. This information will then be transmitted to the forklift via RF signal.
The E-Jet is an AGV developed by the S-Elektronik company found in Germany [9]. It
uses black coloured tape to guide itself along the path. Although the guide tape
method of navigation suffers from some drawbacks like, tape being easily damaged or
covered with dirty. Its main advantage is that the course of the track can be easily
modified and it is a cost efficient way compared to the other methods.
The same method of navigation was selected for the project. The guide tape used was
standard black adhesive electrical tape, which has a width of approximately 2.7 cm.
The tape was glued on a white background for increased contrast. The sensors used
for the detection of the line were light dependent resistors.
Page | 7
Autonomous Forklift
[10]
Modern and more sophisticated AGVs recently developed by companies like Egemin
and Daifuku Webb Company are now even capable of loading and unloading of over-
the-road trailers [11]. The AGVs can move loads found on pallets in warehouse to
trailer and vice versa. The main advantage is that the former can load and unload
conventional trailers so the company does not need to buy specialized ones. One
example of a trailer loading AGV is the Egemin Trailer Loader, shown in figure 2.4.
The Egemin is capable of optimizing the space available in the trailer by leaving
minimal clearances between pallets. And it is also able to load trailers using different
loading patterns which are made possible by its guidance system that adapts itself to
the length and width of each trailer. Being equipped with the latest security features
the AGV is capable of working with both personnel and other manual forklifts
without representing a risk for them [12].
The same concept of trailer loading was used for the project. But this time the sensor
used was the ultrasonic sensor. The latter is used in two different ways, first to detect
the distance between the wall of the container and the Autonomous forklift. Secondly
it is used to detect obstacles such as personnel or other vehicles along the path. Upon
detection the AGV would instantly come to a halt. As the type of microcontroller used
for the project has low processing capabilities, only the single loading pattern would
be implemented.
Page | 8
Autonomous Forklift
Page | 9
Autonomous Forklift
3.1 Introduction
It should be kept in mind that the system should meet certain specific requirements
that will greatly affect the choice and design of the components of the forklift. The
requirements are as follows:
1. The obstacle sensor on the AGV should not be blocked by the forks of the
latter. The sensor should be relatively accurate so as to be able to effectively
measure distance between AGV and any obstacle.
2. The central PC should not only decode loads present in the loading area. But it
should be able to differentiate whenever a load is present or absent.
The system block diagrams for both the PC and the autonomous forklift were
realized after the determination of the essential components required. The block
diagrams realized provide a clear view of the overall system.
3.2.1 Central PC
The Figure 3.1 shows the various inputs and outputs that will be present in the
decoding section of the project.
Page | 10
Autonomous Forklift
WEBCAM
MICROCHIP
LCD DISPLAY
WIRELESS
TRANSMITTER
All the different inputs, outputs and ICs related to the conception of the AGV are
detail in the following block diagram.
Page | 11
Autonomous Forklift
MICROCHIP
TRANSCEIVER SHIFT
MODULE REGISTER
MOTOR MOTOR
DRIVER IC DRIVER IC
FORK DC
MOTORS MOTORS
BUZZER
Page | 12
Autonomous Forklift
The system flow charts represent the basic steps through which the PC and Forklift
programs must undergo respectively so as to be able to complete their respective
functions.
START
SET
TRANSCEIVER
TO RECEIVER
N IS FORKLIFT
DELAY
AVAILABLE?
IS PACKAGE
DELAY
AVAILABLE?
N
Y
DECODE
SEND INFORMATION
TO MICROCONTROLLER
SET TRANSCEIVER
TO TRANSMITTER
TRANSMIT INFORMATION
TO FORKLIFT
Page | 13
Autonomous Forklift
START
SET TRANSCEIVER
TO TRANSMITTER
TRANSMIT
AVAILABILTY
SET TRANSCEIVER
TO RECEIVER
N IS PACKAGE
DELAY AVAILABLE?
SET
DESTINATION
LINE
FOLLOWER
IS LOADING
AREA REACHED?
LOAD
PALLETE
LINE
FOLLOWER
IS DESTINATION
REACHED?
Page | 14
Autonomous Forklift
LINE
FOLLOWER
MIN.CLEARANCE
REACHED?
UNLOAD
PALLETE
EXIT TRAILER
TURN RIGHT
LINE
FOLLOWER
IS PARKING
AREA REACHED?
STOP
The selection process of the different parts forming the whole automated system will
be described in the following section. The selection will be based on the advantages
Page | 15
Autonomous Forklift
offered by each component but mainly on their ability to be easily integrated in the
design.
When considering the design of the central PC part it should be taken into account
that the latter will perform two main functions mainly:
1. The differentiation between the presence and absence of loads, and their
sorting.
2. The establishment of two-way communication between PC and AGV.
3.5.1 Sorting
The different loads present at the loading area would have to be sorted in order to be
successfully loaded in to the specific trailer. To be able to accomplish this task the
sorting system would have to meet certain requirements:
The different systems of sorting available are discussed below and based on the
decision matrix method the best choice was made.
3.5.1.1 Barcode
Page | 16
Autonomous Forklift
Advantages of barcoding :
1. Inexpensive to design and print.
2. Fast and reliable.
3. Accurate.
4. Improves inventory control.
Disadvantages of barcoding:
1. Label prone to damages.
2. Reader requires direct line of sight to decrypt barcode.
Radio frequency identifiers also known as RFID are being developed as a new form
of sorting. This kind of method uses radio waves to establish communication between
the tags and the reader [14]. In context with the project the tags could be incorporated
to the pallets and decoded using appropriate equipment.
Advantages of RFID:
1. Modification of data present on tag.
2. Higher data holding capacity.
3. Accurate.
4. Fast and reliable.
5. Improves inventory control.
6. Reader can read multiple tags and does not require direct line of sight.
Disadvantages of RFID:
1. Very high cost of tags and appropriate reader.
2. Radio waves may pose problem with certain materials.
3. Tags can fail.
Page | 17
Autonomous Forklift
[15]
After having performed a thorough search on the above types of sorting Pughs
method was used as a means of comparison.
Barcodes RFID
Accuracy ++ ++
Reliability ++ +
Modifications + ++
Reading Speed + ++
Price ++ --
Pluses 8 7
RESULTS
Minuses 0 2
Barcoding was found to be the most appropriate system to be used for the sorting
process, as it meets all the requirements and has a very low cost of implementation.
Page | 18
Autonomous Forklift
After the selection of barcoding as the method of sorting, a question about the type of
reader to be used arises. There are two types of barcode reading devices available, a
typical barcode reader or machine vision software.
The laser barcode readers are the most common variety used. They provide fast and
accurate information which can be easily transferred to a PC for processing. If
implemented for the project the reader would be connected to the PC most likely via
USB. The information obtained would then be shifted to the microcontroller, for the
latter to take the required actions.
[16]
Page | 19
Autonomous Forklift
A PC equipped with a camera and the appropriate software can easily perform the
decoding of barcodes. The software Roborealm would most likely be selected for the
task, as the latter can perform the decrypting process and identify the presence of
loads without the need of external sensors [17]. The decrypted information would then
be transmitted to the microcontroller.
Advantages of Roborealm:
1. Very fast decoding.
2. Can support 9 types of barcodes.
3. Does not require pallets to be in motion to decrypt the information.
4. Can be easily interfaced with microcontrollers.
5. Does not require additional sensors to detect presence of loads.
Disadvantages of Roborealm:
1. Prone to errors in low light conditions.
2. A license has to be purchased yearly for its use.
For the determination of the most appropriate piece of equipment, the use of the
decision matrix was not required. As one of the major drawbacks of a typical barcode
reader is that the pallet should be in motion, most likely on a conveyor. Whereas in
the context of this project the load would simply be place on the loading area,
therefore the most suitable method would be the machine vision.
Page | 20
Autonomous Forklift
3.5.3.2 ZigBee
Advantages of XBee:
1. Supports multiple network topologies.
2. Low battery consumption.
Page | 21
Autonomous Forklift
3. Low latency.
4. 128-bit encryption.
5. Easy implementation.
Disadvantages of XBee:
1. Medium range (100 m).
2. Modules relatively expensive.
[20]
Page | 22
Autonomous Forklift
[22]
Based on the above table the nRF24L01+ Nordic wireless module was selected as the
most suitable transceiver for the system.
Page | 23
Autonomous Forklift
Before starting the selection of components for the AGV, it should be kept in mind
that there are certain key functions that the forklift should be able to perform mainly:
For increased security the forklift would have to be equipped with a non-contact form
of obstacle detection sensor while moving on the predefined path. The sensor should
also be able to measure distances accurately so that the AGV can precisely deliver the
load in the trailer. The latter would measure the distance between the forklift and the
walls of the trailer or that between the forklift and any previous load already present
in the trailer as shown in the Figure 3.11.
The AGV would continue to move forward, until the measured distance would be
equal to that of the sum of the width of the pallet and the minimum clearance required
between pallets or pallet and trailer wall.
Page | 24
Autonomous Forklift
The two means of obstacle detection considered were the infrared proximity sensor
and ultrasound sensor.
The sensor works on the simple principle that an IR light is emitted and on hitting an
object the latter is reflected back to the receiver. Depending on the angle between the
emitted and reflected light an analog voltage is output. [23]
Page | 25
Autonomous Forklift
The ultrasound sensor considered was the HC-SR04 Ultrasonic Range Finder. The
principle of operation of the sensor is that, a sound wave is generated by applying
logic 1 to the Trigger pin on the latter for a few milliseconds. On hitting the obstacle
the wave is reflected back to the sensor. When the reflected wave is detected, the
Echo pin generates a logic output of 1. To measure the distance between the obstacle,
the time in-between the Trigger and Echo is calculated. Then using the relationship
between speed, time and distance, the value of distance is calculated. [25]
Page | 26
Autonomous Forklift
Advantages of HC-SR04:
1. Cheap.
2. Can be easily interfaced.
3. Very large range from 2 to 400 cm.
4. Extremely accurate. (0.3 cm)
Disadvantage of HC-SR04:
1. Effective angle of detection is limited to 15o
The HC-SR04 Ultrasonic Range Finder was the obvious choice to be made due to the
numerous advantages it offers but also due to the fact that the Infrared Proximity
Sensor cannot be used for ranges below 10 cm. Measuring distances below 10 cm will
be imperative, especially for the trailer loading function.
In this section the numerous types of navigation available for robots will be discussed
and a choice about the most appropriate form will be made.
The requirements that should be met by the navigation system are as follows:
The systems that meet the above requirements are the line following and autonomous
navigation by use of GPS.
The easiest way to implement line following for the project would be to use black
electrical tape. The black tape would be used to define the path that the forklift would
need to follow. The specific places where the AGV would need to load, unload or
perform turns would be defined by junctions. To detect the junctions and the line the
Page | 27
Autonomous Forklift
forklift would either be equipped with LDR and led pairs or IR emitter and receiver
pairs.
The global positioning system (GPS) is a satellite based system that provides
accurate information about the location of any device. This information provided is in
the form of longitudinal and latitudinal values. The AGV would be given specific
points through which it should navigate. The latter should be equipped with a GPS
and compass module to be able to operate properly. [26]
The selected form of navigation was the line following method; the choice was made
clear by the low precision of the GPS modules considered. As in an industry a
difference of 5m from the designated position would be troublesome.
Page | 28
Autonomous Forklift
The different types of steering available for robots will be considered in this segment.
But before starting it should be kept in mind that the forklift would have to follow
certain requirements based on the project design:
The different types of steering are argued below and a choice for the best alternative
was made.
Differential steering is the most common form of steering used for robots. The term
differential comes from the fact that the direction of motion of the robot is affected by
the speed and direction of rotation of each wheel. Two independent wheels driven by
motors would be placed on each side of the forklift. Alterations in the speed of
rotation of the motors by PWM and direction of rotation, would affect the direction of
motion. [27]
Page | 29
Autonomous Forklift
The Ackerman steering is a type of steering initially developed for horse drawn
carriages that was later adapted to cars. It avoids tires to slip sideways while doing a
curved path as all the wheels have their axes set on the radius of a circle with a
common center. The rear wheels would be controlled by a single motor, which would
control the forward and backward motion. While the direction of the front ones,
would be controlled by a servo or stepper motor. [28]
Page | 30
Autonomous Forklift
This type of steering makes use of the mecanum wheels. Each of the wheels is
connected to a separate motor and depending on the speed and direction of rotation of
each motor the forklift would move in any direction. This type of steering has already
been implemented on certain real size forklifts as shown in Figure 3.17. [29]
Page | 31
Autonomous Forklift
Page | 32
Autonomous Forklift
The differential steering was the perfect choice for the AGV. Normally casters are
used to balance the system but due to their high price and the fact that they have to be
used in pairs for a stable structure. A more adapted system of tracks and wheels from
Tamiya was preferred, as show in Figure 3.19. One of the main advantages of the
latter is that it can be easily adapted to any kind of robot.
Page | 33
Autonomous Forklift
After the selection of the steering system, the required torque that should be
developed by each motor was calculated based on the following features.
The mass of the forklift together with the load was evaluated to be 2 Kg.
The radius of the driving wheel is equal to 1.5cm.
The AGV would normally operate on a flat surface but for the project an
inclination of 5o was considered.
The efficiency of motors was approximated to 65%.
A travelling speed of 5cm/s was chosen for the forklift. [33]
Mass of Forklift 2 Kg
Radius of Wheel 0.015 m
Travelling Speed 5 cm/s
Rotations of Wheel 31.83 rpm
Acceleration 0.1 m2/s
Inclination 5o
Efficiency of Motors 65%
Page | 34
Autonomous Forklift
The Tamiya Double Gearbox was preferred against geared motors due to the
numerous advantages it offers.
Advantages:
1. Can be built in numerous configurations depending on Torque and
speed requirements.
2. It consists of two dc motors whose speed and direction of rotation can
be altered independently.
3. Very low price compared to geared motors.
According to Tamiyas specification sheet the gear ratio selected for the AGV was
344.2:1. This type of configuration offers a Torque of 2276 gf.cm and a Rotational
speed of 38 rpm. This is more than sufficient to drive the forklift.
Page | 35
Autonomous Forklift
After the selection of all the components making up the AGV and the central PC a
clear idea about the different components and number of inputs and outputs needed
was made. Both the central PC and the Autonomous Forklift would be using a
microcontroller, which should be able to perform certain tasks.
They requirements that should be met by the microcontroller connected to the PC are
as follows:
To act as interface the controller should either be connected via USB or serial port.
An analysis of the different types of inputs needed was made and is shown in the
Table 3.5.
The number of inputs and outputs required for each of the selected components
composing the forklift are detailed in the Table 3.6.
Page | 36
Autonomous Forklift
A total of 18 digital outputs, 6 analog inputs and 1 digital input would be required
for the AGV. Out of the 18 digital outputs, 2 need to be capable of pulse width
modulation (PWM).
Two different types of microcontrollers were considered and based on their respective
advantages a decision was made.
The popular microcontroller PIC16F877A together with the development board from
Olimex was investigated as an option.
Page | 37
Autonomous Forklift
Advantages of PIC16F877A:
1. Widely used.
2. Huge number of ports available.
Disadvantages of PIC16F877A:
1. Limited library available for implementation with components.
2. Limited number of PWM outputs.
3. No online reference available.
4. Can only be programmed through serial RS 232 port. (Most modern PCs
are equipped with only USB).
5. Cost of PIC and development board relatively high.
6. Difficult to program.
The second microcontroller that was considered was the ATmega 328 that comes with
the Arduino Duemilanove Board. The Duemilanove is a modern development board
that is becoming increasing popular among hobbyist.
Page | 38
Autonomous Forklift
To select the most appropriate microcontroller for the project a decision matrix was
used.
Page | 39
Autonomous Forklift
The Arduino Duemilanove was the microcontroller carefully chosen even if the latter
has only 14 digital input or output ports and the required number for the project was
18. To increase the number of ports a shift register was used.
Different materials have been considered for the construction of the robot. The main
requirements of the material are:
1. Durability.
2. Good machinability.
3. Corrosion resistant.
4. Light weight.
5. Good toughness.
Page | 40
Autonomous Forklift
High-density
Stainless Steel Plywood polyethylene
(HDPE)
Durability ++ + ++
Machinability -- + ++
Light weight + ++ ++
Toughness ++ -- ++
Cost -- ++ +
Pluses 5 6 9
RESULTS
Minuses 4 2 0
It was clear from the decision matrix that HDPE is the most appropriate material.
HDPE can be easily found in kitchen cutting boards and it possesses all the required
characteristics.
Page | 41
Autonomous Forklift
4.1 Introduction
After the selection of the components and the material from which the AGV would be
build, this chapter will address the building of the different sub-systems that would
compose the forklift.
Before starting the construction of the structure, there were certain requirements that
should be met for the good functioning of the whole system.
Requirements:
1. The ultrasound sensor should not be blocked by the forks.
2. The height of the line following sensor should be adjustable.
3. The width of the forklift should not exceed 7 cm as this corresponds to the
width of the Tamiya Double Gearbox.
4.3 3D Design
Based on the above considerations a 3D design of the AGV was made using Google
SketchUp to get a better understanding of the structure.
Page | 42
Autonomous Forklift
Page | 43
Autonomous Forklift
The following section encompasses the building process of the forklift based on
the 3D designs.
The different parts that would form part of the structure of the AGV were drawn on a
piece of HDPE of thickness 0.4 cm.
Page | 44
Autonomous Forklift
Page | 45
Autonomous Forklift
The height of the base of the forklift would be 4 cm which would be enough to
accommodate the ultrasound sensor.
After the parts were cut apart, they were glued together to form the base of the AGV
as shown below in Figure 4.5.
A hinge was integrated on the bottom part so as to be able to control the height of the
line following sensor.
Page | 46
Autonomous Forklift
The battery and sonar sensor were then glued into place as show in Figure 4.7.
Page | 47
Autonomous Forklift
The Tamiya Double Gearbox selected in the motor selection unit, was mounted
according to the selected ratio of 344.2:1 by using the instruction sheet from the
supplier.
Page | 48
Autonomous Forklift
The top side of the AGV was sectioned into two parts so that the wires from the line
sensors, ultrasound and battery could be connected to the microcontroller and other
components found on the upper levels.
Page | 49
Autonomous Forklift
Two holes were drilled on to each of the sides of the base (SIDES A & B). The
wheels together with the tracks were then screwed into place. Wall plugs were also
glued on the top of the structure, so as to serve as support for the perfboards.
The requirements that should be met by the lifting mechanism are as follows:
1. Simple mechanism.
2. Light weight so as not to destabilize the AGV.
3. Easily programmable.
For lifting mechanisms usually the ball screw method is used but due to its heavy
weight and complexity it was not chosen.
Page | 50
Autonomous Forklift
A simpler alternative was selected; a modest CD drive. The latter was dismantled and
the tray mechanism removed. The mechanism was then glued vertically to the front of
the forklift.
Limit switches were also glued to the forks so as to detect the position of the latter,
whether they were up or down.
Page | 51
Autonomous Forklift
5.1 Introduction
The electronic design of the forklift and the central PC will be reviewed in this
chapter. The different connections and functions of the various ICs and equipment
will be discussed thoroughly.
The following section will deal with only the electronic part of the AGV.
The ultrasound sensor, HC-SR04 consists of four pins. Two of which are connected to
the power source while the rest are connected to two digital ports on the
microcontroller for normal functioning. The Table 5.1 shows the ports allocation.
Page | 52
Autonomous Forklift
The schematic in Figure 5.2 shows the HC-SR04 connected to the Arduino ATmega
328.
5.2.2 Battery
There were certain requirements that were taken into account while selecting the
appropriate battery for the AGV.
Requirements:
1. Rechargeable.
2. Width less than 7cm.
3. Relatively heavy so as to counter balance the weight of the forklift.
4. Minimum voltage of 5V which is the rated voltage of the motors.
The battery selected was a rechargeable 6V NiCd. The battery normally processes an
external recharge dock, but for better convenience the latter was dismantled. And the
recharging circuit integrated into the forklift itself.
Page | 53
Autonomous Forklift
After being dismantled all the components were de-soldered. The terminals were
connected to the battery and the other components re-soldered on a perfboard as
shown in Figure 5.4.
A two-way switch was also integrated, so that by controlling its position we can
control whether the battery is charging or delivering power to the motors. To
differentiate between the two functions status two leds were used.
Page | 54
Autonomous Forklift
The Figure 5.6 shows the whole schematic diagram of the battery circuit.
Page | 55
Autonomous Forklift
The method of navigation selected was the line following, this would normally consist
of a strip of black tape glued onto a white background for an increased contrast. To
differentiate between the black and white areas two types of sensors were investigated
mainly:
The leds when turned ON will emit light which on striking the surface will be
reflected back. This reflected light is then detected by the LDRs. The intensity of the
light reflected will greatly depend on the type of surface it stroke. The resistances of
the LDRs will then vary according to the intensity of the reflected light. By
monitoring these resistances the AGV will discern its position.
Advantages of LDRs:
1. Can be easily implemented.
2. Cheap.
3. Easily programed.
Disadvantages of LDRs:
1. Affected by ambient light condition.
2. Must be close to the surface for optimum result.
The IR emitter emits infrared light that will strike the surface. If the latter is white the
light is reflected back and is detected by the detector. But if it is black the infrared
light is absorbed and none is reflected. Again by monitoring the detectors the position
of the forklift is known.
Advantages of IR:
1. Less affected by ambient light.
Page | 56
Autonomous Forklift
Disadvantages of IR:
1. Expensive.
2. Not easy to implement and program.
After a quick comparison the LDR and led pair was the type of sensors selected due to
their easy implementation and programming. To overcome the problem caused by
ambient light a simple program was implemented, refer to Software Design.
The choice made was to have two LDRs on each side so as to be able to detect
junctions in the path. And two other LDRs were centered in the middle so as to be
able to detect the dark line. Figure 5.8 shows the line sensor soldered on a perfboard.
Page | 57
Autonomous Forklift
The Figure 5.9 shows the path taken by light to reach the LDRs. Whenever the forklift
goes off centered, the intensity of the light being reflected to one of the LDRs
increases dramatically. And based on the readings obtained from the latter, corrective
actions are taken by the microcontroller.
Page | 58
Autonomous Forklift
To power up the different components and ICs, the forklift would incorporate three
voltage regulators that would be found on the first level.
Page | 59
Autonomous Forklift
5.2.4.1 LM7805
The first voltage regulator would be used to power the three motors (2-differential
steering, 1-forks). Its schematic is shown in Figure 5.12.
The first capacitor C8 ensures that there are no ripples in the voltage being supplied
from the 6V battery. The second capacitor C9, on its part acts as a load balancer to
ensure a smooth output voltage of +5V from the regulator. Whenever the regulator is
supplying current to the motors LED5 will be ON. [36]
The second voltage regulator would be used to power up the ICs and various
components. Again LED13 this time will light up when it is delivering power. Its
schematic is shown in Figure 5.13.
Page | 60
Autonomous Forklift
5.2.4.2 LM317
The LM317 is a variable output voltage regulator, where the value of the output
voltage depends on the values of the resistance R1 and R2.
Page | 61
Autonomous Forklift
And the fact that Vout should be equal to 3.3V and that R1 was chosen as 1K, the
value of R2 was calculated as follows.
= (0.83.3 1) 1000
= 1.64 K
Page | 62
Autonomous Forklift
The L293D Dual H-Bride is a motor driver that was used to control the three motors
present on the AGV. It was selected mainly because of the following features [38]:
The Figure 5.16 shows the pin layout of the L293D motor driver IC.
The Table 5.3 gives an idea of the different pins present on the IC and their different
functions.
Page | 63
Autonomous Forklift
By changing the logic at the inputs 1 and 2, the direction of rotation of motors 1
would be altered. The same would happen with motor 2 once the logic at inputs 3 and
4 were changed. The Table 5.4 shows the different logics and their results on the
motors.
Page | 64
Autonomous Forklift
Two L293D ICs were required by the AGV, one to control the two motor for the
steering and the other one to control the motor of the forks.
Due to the fact that the Arduino possesses only 14 digital Input/ Output pins and 18
were required to control the forklift, a shift register was used.
The shift register used is the 74HC595, it was used to increase the number of output
ports on the microcontroller. The 74HC595 needs to be connected to 3 digital pins
from the Arduino and it provides 8 digital output pins. Several shift registers can be
interconnected together so as to provide more output pins to the microcontroller,
without utilizing any more than the initial 3 pins. The Figure5.17 shows the pin layout
of the shift register.
Page | 65
Autonomous Forklift
The Table 5.5 gives an idea of the different pins present on the IC and their different
functions.
The shift register 74HC595 uses the shiftOut function of the Arduino to control which
output pins to activate and which one to deactivate. The Arduino simply shifts out
numbers to the chip that corresponds to each pin as shown in the Table 5.6.
Output Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
Pin
Number
to be 1 2 4 8 16 32 64 128
shifted
Page | 66
Autonomous Forklift
So for example to activate output pin Q2 with logic 1, we shiftOut 4 and for pin Q6
we shiftOut 64. But to activate two pins at the same time for example Q0 and Q4, we
shiftOut 17 which corresponds to: 1+16.Using this simple principle multiple pins can
be activated.
Q6 Buzzer -
Q7 - -
Q7 - -
MR +5V -
OE Ground supply -
Vcc +5V -
The Figure 5.18 shows the connections between the shift register and the L293D IC
used for the differential steering. It can be noted that EN1 and EN2 would be
connected to the Arduino pins 9 and 10 respectively. They will be used to control the
motors via PWM. While the other pins found on the motor IC would be controlled via
the shift register, which will control the direction of rotation of each motor.
Page | 67
Autonomous Forklift
The Figure 5.19 shows the connections between the L293D and the two steering
motors.
A 0.1F capacitor was included across each motor to act as a short circuit for high-
frequency electrical noises. This reduces the unwanted fluctuations in voltage along
the motor wiring, especially at start up. [39]
Page | 68
Autonomous Forklift
The Figure 5.20 shows the connections between the shift register and the L293D used
to control the fork motor.
This time it can be noted that the enable pin EN1 would be directly connected to a
+5V source as PWM is not required for the fork motor. The outputs Q4and Q5 of the
shift register would control the direction of rotation of the fork motor via the pins IN1
and IN2 respectively.
The Figure 5.21 represents the connections between the L293D and the fork motor.
Page | 69
Autonomous Forklift
The Table 5.8 shows the different numbers that are shifted out and their consequences
on the different motors.
Page | 70
Autonomous Forklift
5.2.7 Transceiver
The Nordic transceiver selected would be found on the third level of the AGV
together with the microcontroller. The transceiver module and its schematic are
shown in Figure 5.23.
The Table 5.9 gives a description of the different pins on the Nordic and the digital
pins to which they are connected.
Page | 71
Autonomous Forklift
The Figure 5.24 shows the connections between the Arduino and the Transceiver.
Page | 72
Autonomous Forklift
Limit switches were integrated into the forks mechanism so as to be able to identify
when the latter has reached the required height. They were connected to the Arduinos
Analog input 4 and 5, as shown in the Figure 5.25.
5.2.9 Microcontroller
The Arduino microcontroller would be found on the third level of the AGV. A
summarization of the different allocated ports is shown in Table 5.10 and in Figure
5.26 respectively.
Note that the digital pins D0 and D1 were not used to connect components, as they are
used for serial communication between PC and the Arduino via USB.
Page | 73
Autonomous Forklift
Page | 74
Autonomous Forklift
An Arduino Nano which is a variant and breadboard friendly version of the Arduino
Duemilanove would be used to implement display of information and wireless
communication between PC and AGV.
5.3.1 LCD
To display information about the status of the forklift and the type of load available, a
204 character LCD with HD44780 parallel interface chipset was used [40].
Page | 75
Autonomous Forklift
The LCD was connected to the Arduino Nano as show in the Figure 5.28.
Page | 76
Autonomous Forklift
The Transceiver connected to the central PC is the same as the one used for the AGV.
Except that different ports on the Arduino Nano were used, as shown in Figure 5.29.
Three push button switches were also integrated into the system so as to re-initialize
the count of the pallets whenever a new trailer would be available. The buttons were
connected to the microcontroller via the analogue input pins 0, 1 and 2 as shown in
Figure 5.30.
Page | 77
Autonomous Forklift
5.3.4 Microcontroller
The Arduino Nano would be found on a breadboard and the latter would be connected
via jumper wires to the various components. A summarization of the different
allocated ports is shown in Table 5.11 and in Figure 5.31 respectively.
Note that digital pins D0 and D1 would be used as serial communication between the
PC and the Arduino Nano. They are used to transfer data from the machine vision
software to the microcontroller.
Page | 78
Autonomous Forklift
D0 - -
D1 - -
D2 DB7 LCD
D3 DB6 LCD
D4 DB5 LCD
D5 DB4 LCD
D6 E LCD
D7 RS LCD
D8 - -
D9 CE (3) Transceiver
A0 - Switch 1
A1 - Switch 2
A2 - Switch 3
A3 - -
A4 - -
A5 - -
Page | 79
Autonomous Forklift
Page | 80
Autonomous Forklift
6.1 Introduction
The software design chapter will deal with the different programs used for the
programming of each part. The functions of each key component will be explained in
detail by the use of flowcharts. The chapter will be divided into two parts, mainly the
software design of the central PC and that of the forklift respectively.
There are various tasks that have to be completed by the PC in a stepwise way, each
of them are discussed in greater detail in the following sections.
The first process would involve the decoding of the barcodes found on the pallets. As
selected in the conceptual design chapter, the machine vision technique was preferred.
The software used is Roborealm, which is a powerful image analysis and processing
program [41]. The flowchart below describes how the software will process the data.
The complete program is shown in Appendix G.
START
CAPTURE
IMAGE
IS LOAD
PRESENT?
Page | 81
Autonomous Forklift
DECODE
IMAGE
SEND TRAILER
INFO TO ARDUINO
NANO VIA SERIAL
After having received information about the presence of a new load, the
microcontroller will then wait until it receives confirmation from the forklift that the
latter is available. The Arduino will also access its database to see if the trailer into
which the pallet has to be deposited is full (A trailer can contain only a maximum of
three pallets). If the AVG is available and the trailer is empty, information is sent to
the forklift for it to come and collect the load. The push buttons implemented are
used to re-actualize the pallet count whenever a new trailer is available.
START
IS INFO
DELAY
AVAILABLE?
N
Y
DISPLAY TO
Y LCD
Page | 82
Autonomous Forklift
N
IS AGV
DELAY
AVAILABLE?
IS COUNTER
< 4?
Y
N
INCREMENT
COUNTER
IS BUTTON
DELAY
HIGH? N
RE-ACTUALIZE
COUNTER
Page | 83
Autonomous Forklift
The program uploaded to the AGV is explained in more detail in the section below.
The program consists of two main parts the setup program and the main loop.
The setup program defines all the input and output ports associated with the different
components. But a sub-program was also included, so as to calibrate the center LDRs.
As it was discussed in the Electronic Design section LDRs are affected by ambient
light conditions. To calibrate the latter, the AGV is first place in the middle of the
path and then the sub-program explained in Figure 6.3 is run.
Note that the typical values of the LDRs under any light condition, is less than 4.
START
COUNTER = 0
REF_LDR_CR=5
REF_LDR_CL=5
IS COUNTER
>30 ? Y
N
STOP
Page | 84
Autonomous Forklift
READ LDR_CR
READ LDR_CL
IS REF_LDR_CL >
LCDR_CL?
Y N
SET REF_LDR_CL
= LDR_CL
IS REF_LDR_CR >
LCDR_CR?
Y N
SET REF_LDR_CR
= LDR_CR
INCREMENT
COUNTER
DELAY
Page | 85
Autonomous Forklift
The Table 6.1 shows the shows the values of the LDRs in different conditions, after
having run the sub-program.
LDRs Position
LDR value
LEFT CENTER-LEFT CENTER-RIGHT RIGHT
On Black
Surface 1 REF_LDR_CL REF_LDR_CR 1
On White
Surface 6 > REF_LDR_CL > REF_LDR_CR 5
After having run the setup program, the main loop program would be run indefinitely
on the microcontroller. The main loop would go through the following steps
explained in Figure 6.4. Each of the steps would be discussed in greater detail in the
following sections.
The main loop program will be based on the predefined path in Appendix F.
START
STOP
RADIO
AVAILABILITY
RADIO
PACKAGE
FWD
Page | 86
Autonomous Forklift
FWD_JUNCTION
LOWER FORK
FWD NO
ULTRASOUND
RAISE FORK
TURN
CLOCKWISE
FWD
TARGET
TURN ANTI-
CLOCKWISE
FWD
DELIVERY
LOWER FORK
Page | 87
Autonomous Forklift
REV
TURN
CLOCKWISE
LOCATION
TURN
CLOCKWISE
6.3.2.1 Stop
The stop function is used to set the inputs of the H-bridges and buzzer with the logic 0
via the shift register.
START
SET DIR=0
SHIFTOUT DIR
STOP
Page | 88
Autonomous Forklift
This function informs the central PC that the forklift is available for operation.
START
SET TRANSCEIVER
TO TRANSMITTER
MODE
TRANSMIT
AVAILABILITY
STOP
The following loop is repeated until information about the presence of a load and the
specific trailer into which it has to be loaded is available.
Page | 89
Autonomous Forklift
START
SET TRANSCEIVER
TO RECEIVER
MODE
N
IS LOAD
AVAILABLE?
TRAILER TO
BE LOADED
STOP
Page | 90
Autonomous Forklift
6.3.2.4 Forward
The control of the forward drive of the robot is based on the readings obtained from
the central LDRs.
START
SET DIR=5
SHIFTOUT DIR
Y
STOP IS LDR
LEFT =1?
N
OBSTACLE
DETECTION
FUNCTION
Y
IS LDR_CL>
REF_LDR_CL
?
SET MOTOR
LEFT = PWM
N MOTOR
RIGHT=0
IS LDR_CR> Y
REF_LDR_CR
?
SET MOTOR
N LEFT = 0
MOTOR
SET MOTOR RIGHT=PWM
LEFT = PWM
MOTOR
RIGHT=PWM
Figure 6.8: Forward Flowchart
Page | 91
Autonomous Forklift
It is used to detect any obstruction found within 25cm of the AGV. In case of an
obstacle the latter stops immediately and if the path is not cleared within a predefined
time period the central PC is informed and a buzzer is sounded.
START
TRIGGER
SOUNDWAVE
LISTEN FOR
ECHO
CALCULATE
DISTANCE
Y
RETURN IS DISTANCE
PWM =200 >25 CM?
N
START
COUNTER
RETURN
PWM =0
DELAY
Page | 92
Autonomous Forklift
INCREMENT
COUNTER
IS DISTANCE Y
>25 CM?
DELAY
N
IS COUNTER
> 30?
SET RADIO TO
TRANSMITTER
MODE
TRANSMIT
OBSTACLE
INFO TO PC
BUZZER
DELAY
Figure 6.9: Obstacle Detection Flowchart
Page | 93
Autonomous Forklift
The forklift detects the junctions in the line so that it becomes aware of its position.
But for the latter not to detect the same junction twice the Forward Junction function
is used.
START
SET MOTOR
LEFT =225
MOTOR
RIGHT=225
DELAY
SET MOTOR
LEFT =0
MOTOR
RIGHT=0
STOP
Page | 94
Autonomous Forklift
START
SET DIR=16
SHIFTOUT DIR
IS LIMIT SWITCH
1 CLOSED?
Y
SET DIR=0
SHIFTOUT DIR
STOP
This is simply a forward function without ultrasound, so that the AGV does not detect
the load as an obstacle.
Page | 95
Autonomous Forklift
START
SET DIR=5
SHIFTOUT DIR
Y
STOP IS LDR
LEFT =1?
Y
IS LDR_CL>
REF_LDR_CL
?
SET MOTOR
LEFT = PWM
N MOTOR
RIGHT=0
IS LDR_CR> Y
REF_LDR_CR
?
SET MOTOR
LEFT = 0
MOTOR
N
RIGHT=PWM
SET MOTOR
LEFT = PWM
MOTOR
RIGHT=PWM
Page | 96
Autonomous Forklift
START
SET DIR=32
SHIFTOUT DIR
N IS LIMIT SWITCH
2 CLOSED?
Y
SET DIR=0
SHIFTOUT DIR
STOP
Page | 97
Autonomous Forklift
START
SET DIR=6
SHIFTOUT DIR
SET MOTOR
LEFT =200
MOTOR
RIGH=200
DELAY
Y IS LDR_CL>
REF_LDR_CL
?
N
SET MOTOR
LEFT =0
MOTOR
RIGHT=0
STOP
Page | 98
Autonomous Forklift
6.3.2.11 Target
The target function is used as a counter so that the AGV knows which trailer to load.
The junctions in the path, is used as a means to increment the function. The value set
for DESTINATION in the Radio Package function is used for comparison.
START
SET
JUNCTION=1
IS JUNCTION= Y
DESTINATION?
STOP
N
CALL
FORWARD
JUNCTION
FUNCTION
CALL
FORWARD
FUNCTION
INCREMENT
JUNCTION
Page | 99
Autonomous Forklift
START
SET DIR=9
SHIFTOUT DIR
SET MOTOR
LEFT =200
MOTOR
RIGH=200
DELAY
Y
IS LDR_CR>
REF_LDR_CR
SET MOTOR
LEFT =0
MOTOR
RIGHT=0
STOP
Page | 100
Autonomous Forklift
The sonar delivery function is used to monitor distance inside the trailer.
START
TRIGGER
SOUNDWAVE
LISTEN FOR
ECHO
CALCULATE
DISTANCE
IS DISTANCE
>15 CM?
N Y
RETURN RETURN
MOTION =0 MOTION=1
The forward delivery function makes use of the sonar sensor as a distance measuring
device. The forklift continues to move forward until the required distance between
itself and the walls of the container or a previous load is not reached.
Page | 101
Autonomous Forklift
START
SET DIR=5
SHIFTOUT DIR
CALL SONAR
DELIVERY FUNCTION
STOP IS MOTION
N =1?
Y
IS LDR_CL>
REF_LDR_CL
? SET MOTOR
LEFT =150
N MOTOR
RIGHT=0
IS LDR_CR>
REF_LDR_CR Y
?
SET MOTOR
N LEFT = 0
MOTOR
SET MOTOR RIGHT=150
LEFT =150
MOTOR
RIGHT=150
Figure 6.18: Forward Delivery Flowchart
Page | 102
Autonomous Forklift
6.3.2.15 Reverse
START
SET DIR=10
SHIFTOUT DIR
Y
STOP IS LDR
LEFT =1?
Y
IS LDR_CL>
REF_LDR_CL
?
SET MOTOR
LEFT = 0
N MOTOR
RIGHT=175
IS LDR_CR> Y
REF_LDR_CR
?
SET MOTOR
N LEFT = 175
MOTOR
RIGHT=0
SET MOTOR
LEFT=175
MOTOR
RIGHT=175
Page | 103
Autonomous Forklift
6.3.2.16 Location
The location is similar to the target function, but instead of detecting the trailer to be
loaded. The location function is used to return the AGV to its initial position (parking
area).
START
SET
PARKING = 4
IS PARKING = Y
LOCATION?
STOP
N
CALL
FORWARD
JUNCTION
FUNCTION
CALL
FORWARD
FUNCTION
INCREMENT
LOCATION
Page | 104
Autonomous Forklift
7.1 Introduction
After having completed the mechanical, electronic and software design of both the
central PC and forklift, they were both implemented and tested. The different
problems encountered and solutions found are described in detail in Table 7.1 after
the system was tested as a whole unit.
All of the above problems were successfully solved and no further ones were found
when the AGV was tested around the predefined path.
Page | 105
Autonomous Forklift
7.3 Central PC
The Roborealm program that was implemented was tested with barcodes generated
using the code 128 barcode symbology. The program performed as intended by
successfully being able to sort between the three different types of barcodes. The
decode information was then passed to the Arduino Nano via USB.
Page | 106
Autonomous Forklift
Page | 107
Autonomous Forklift
7.4 Forklift
After its complete construction the forklift was tested as a whole system. The software
and electronic part worked faultlessly even if some slight minor modifications in the
software were required.
The connections between the shift register and the two motor ICs work as anticipated
allowing a change in direction of the wheels, the upward and downward motion of the
forks and finally the operation of the buzzer also.
The AGV was able to follow the predefined path (Appendix F) and detect the
junctions in the line to identify its position based on the readings obtained from the
LDRs.
The ultrasound sensor on board detected obstacles within a range of 25cm, which
proved efficient along the path. But for better results while performing the trailer
loading function this was reduced to 15cm, that corresponds to the sum of the width
of the pallet and the minimum clearance required.
The Nordic transceiver implemented on the first level of the AGV, operated as
anticipated allowing the latter to establish two-way communication. The figure 7.4
shows the forklift after complete implementation with the fourth pair of wheels added.
Page | 108
Autonomous Forklift
8.1 Conclusion
The aim set for this project was the design and implementation of a system capable of
sorting loads and loading them into specific trailers by observing a loading pattern.
Since the system is meant to operate in a human environment the design includes the
necessary features to ensure the safety of any person who may be in the proximity of
the forklift.
To be able to meet the set aim a system comprising of two sub-systems mainly a
central PC and forklift were investigated in the conceptual design. Where the problem
of the selection of the most appropriate parts were addressed using the decision matrix
method.
A 3D design of the AGV was also prepared so as to a have better understanding of the
mechanical design, which had to meet certain requirements such as preventing the
forks from blocking the ultrasound sensor used for obstacle detection and trailer
loading.
The electronic design forms the major part of this thesis, here a problem of lack of
output ports on the microcontroller selected; Arduino Duemilanove was encountered
and solved by the use of a shift register. The latter was used to control the direction of
rotation of the steering motors, forks motor and buzzer. This chapter also
encompasses the implementation of the battery recharging circuit, sonar sensor,
transceiver, motor ICs and line sensor (led and LDRs) for the AGV. For the central
PC the electronic design on its part, involved the implementation of the transceiver
and LCD module with the Arduino Nano.
The software design consisted of three main programs, mainly; the machine vision
used for the sorting process, the Arduino Nano (microcontroller connected to PC) for
wireless communication and information display and that of the Arduino
Duemilanove used for controlling the AGV.
After implementation of the whole system, tests were carried to check whether the
system was able to carry out all the required tasks successfully.
The central PC is capable to sort out loads by use of machine vision and transmit the
required data via RF. While on its part the, forklift designed is a line following robot
that on reception of the information moved from its parking to the loading zone,
where the latter collected the load. Along the way a non-contact form of obstacle
detection using ultrasound was used for increased safety. After having loaded the
pallet, the AGV continued on its path towards the specific trailer. This time, the
Page | 109
Autonomous Forklift
forklift used the ultrasound sensor to measure distance, so as to precisely load the
trailer according to a predefined loading pattern. Having successfully delivered the
load the forklift returned to its parking zone to wait for further instructions from the
central PC.
The testing of the system concluded the successful realization of all the aims and
objectives set in the introductory chapter.
After completion of the project and having a clear idea of how the present system
works, some of the new ways suggested to improve the system are as follows:
1. Design and implementation a charging area at the parking zone so that the
AGVs can recharge their batteries without human intervention.
2. Use of wireless camera instead of LDRs for line following purposes.
3. Construction of more similar AGVs so that they can share the work load.
4. Substitution of track and wheels system by Omni directional wheels even if
they are a lot more expensive.
5. Design of a graphical user interface for the operator to control the sorting
process more efficiently.
Page | 110
Autonomous Forklift
BIBLIOGRAPHY
REFERENCES
Page | 111
Autonomous Forklift
15. Small Business Trends (2012) QR Codes, Barcodes and RFID: Whats the
Difference? [image online] Available at:
http://smallbiztrends.com/2011/02/qr-codes-barcodes-rfid-difference.html
[Accessed: 22 Feb 2012].
16. Buzzle (2012) What is Barcode Scanner. [image online] Available at:
http://www.buzzle.com/articles/what-is-barcode-scanner.html [Accessed: 22
Feb 2012].
17. Roborealm (2005) Barcode Reader. [online] Available at:
http://www.roborealm.com/help/Barcode.php [Accessed: 22 Feb 2012].
18. Sparkfun (2011) GainSpan WiFi Breakout - SparkFun Electronics. [online]
Available at: http://www.sparkfun.com/products/10505 [Accessed: 22 Feb
2012].
19. Digi (2003) ZigBee Wireless Standard - Technology - Digi International.
[online] Available at: http://www.digi.com/technology/rf-articles/wireless-
zigbee [Accessed: 22 Feb 2012].
20. Sparkfun (2011) XBee 1mW Wire Antenna - Series 1 (802.15.4) - SparkFun
Electronics. [online] Available at: http://www.sparkfun.com/products/8665
[Accessed: 22 Feb 2012].
21. Nordicsemi (2000) nRF24L01+ - 2.4GHz RF - Products - Nordic
Semiconductor. [online] Available at:
http://www.nordicsemi.com/kor/Products/2.4GHz-RF/nRF24L01P [Accessed:
22 Feb 2012].
22. Iteadstudio (2012) 2.4G Wireless nRF24L01+ Module. [image online]
Available at:
http://iteadstudio.com/store/index.php?main_page=product_info&cPath=7&pr
oducts_id= [Accessed: 22 Feb 2012].
23. Acroname.com (2011) Sharp IR Rangers Information. [online] Available at:
http://www.acroname.com/robotics/info/articles/sharp/sharp.html [Accessed: 7
Mar 2012].
24. Sparkfun.com (2012) Infrared proximity sensor. [image online] Available at:
http://dlnmh9ip6v2uc.cloudfront.net/images/products/00242-1_i_ma.jpg
[Accessed: 7 Mar 2012].
25. Jaktek.com (n.d.) HC-SR04 Ultrasonic Sensor | JAKTEK. [online] Available
at: http://jaktek.com/?wpsc-product=hc-sr04-ultrasonic-sensor [Accessed: 8
Mar 2012].
26. En.wikipedia.org (2012) Global Positioning System - Wikipedia, the free
encyclopedia. [online] Available at:
http://en.wikipedia.org/wiki/Global_Positioning_System [Accessed: 9 Mar
2012].
27. Robotoid.com (n.d.) My First Robot - Getting Started with Robotics. [online]
Available at: http://www.robotoid.com/my-first-robot/rbb-bot-phase1-
part1.html [Accessed: 9 Mar 2012].
Page | 112
Autonomous Forklift
Page | 113
Autonomous Forklift
APPENDIX
APPENDIX A
Page | 114
Autonomous Forklift
Lift Code 6 - Counterbalanced rider, pneumatic or either tire type, sit down,
high or low platform
Lift Code 4 - Side loaders, turret trucks, swing mast and convertible
turret/stock pickers
Page | 115
Autonomous Forklift
Lift Code 1 - Sit-down rider (draw bar pull over 999 lbs.)
APPENDIX B
MOTOR TORQUE CALCULATION
m.gx=mg sin ()
= 2 9.81 sin (5o)
=1.710 N
m.gy=mg cos ()
= 2 9.81 cos (5o)
=19. 55 N
For the forklift not to slide down the incline there must be friction between the wheel
and surface.
Page | 116
Autonomous Forklift
= 31.83 rpm
T =fR
Fx = M.a = M. gx + f
T = {a + g sin ()} M R
= 0.0220 Nm
Page | 117
Autonomous Forklift
APPENDIX C
PWM
Pulse width modulation (PWM) was the method used for the project to control the
cruising speed of the AGV. The latter was required to have a relatively fast travelling
speed while moving along the path and a slow one while performing turns and
delivering pallets in the trailers. PWM is a technique used to alter the voltage
delivered to the motors, by supplying the latter with an average voltage generated
from a fixed one (5V).
Digital control is used to create a square wave, a signal switched between on and off.
This on-off pattern can simulate voltages in between full on (5 Volts) and off (0
Volts) by changing the portion of the time the signal spends on versus the time that
the signal spends off. The duration of "on time" is called the pulse width.
For the Arduino the function that is used to generate the PWM is called analogWrite.
A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a
100% duty cycle (always on), and analogWrite(127) is a 50% duty cycle (on half the
time). [42]
Page | 118
Autonomous Forklift
APPENDIX D
ELECTRONIC CIRCUITS
Central PC:
Page | 119
Autonomous Forklift
Forklift:
Page | 120
Autonomous Forklift
Page | 121
Autonomous Forklift
Page | 122
Autonomous Forklift
Page | 123
Autonomous Forklift
APPENDIX E
3D DRAWINGS & PICTURES
TOP VIEW
Page | 124
Autonomous Forklift
BOTTOM VIEW
Page | 125
Autonomous Forklift
SIDE VIEW
Page | 126
Autonomous Forklift
BACK VIEW
Page | 127
Autonomous Forklift
FRONT VIEW
Page | 128
Autonomous Forklift
APPENDIX F
PREDEFINED PATH
Page | 129
Autonomous Forklift
APPENDIX G
PROGRAMMING
Central PC:
Roborealm:
Arduino Nano:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
#include <LiquidCrystal.h>
RF24 radio(9,10);
char val;
int availability=0;
int numB=0;
Page | 130
Autonomous Forklift
int numC=0;
void setup()
lcd.begin(20,4);
Serial.begin(9600);
printf_begin();
radio.begin();
radio.setRetries(15,15);
radio.setPayloadSize(8);
radio.openWritingPipe(pipes[0]);
radio.openReadingPipe(1,pipes[1]);
lcd.setCursor (0,1);
lcd.print("PALLETE:");
lcd.setCursor (0,2);
lcd.print("TRAILER:");
lcd.setCursor (8,2);
lcd.print("A");
lcd.setCursor (14,2);
lcd.print("B");
lcd.setCursor(19,2);
lcd.print("C");
Page | 131
Autonomous Forklift
radio.startListening();
radio.printDetails();
void loop()
if ( radio.available() )
while (!done)
switch (package)
case 80 ://P
Serial.println("FORKLIFT AVAILABLE");
lcd.setCursor (0,0);
availability =1;
break;
Page | 132
Autonomous Forklift
case 68://D
Serial.println("PALLETE DELIVERED");
lcd.setCursor (0,0);
break;
case 79://O
Serial.println("OBSTACLE DETECTED");
lcd.setCursor (0,0);
break;
case 88://X
Serial.println("PERFORMING ACTION");
lcd.setCursor (0,0);
break;
delay(20);
if ( Serial.available() >0)
val = Serial.read();
Page | 133
Autonomous Forklift
switch (val)
case 'A':
numA++;
Serial.print(numA);
lcd.setCursor (8,1);
lcd.print("A ");
present =65;
break;
case 'B':
numB++;
Serial.print(numB);
lcd.setCursor (8,1);
lcd.print("B ");
present =66;
break;
case 'C':
numC++;
Serial.print(numC);
lcd.setCursor (8,1);
lcd.print("C ");
Page | 134
Autonomous Forklift
present =67;
break;
case 'U':
Serial.println("Pallet UNAVAILABLE");
lcd.setCursor (8,1);
lcd.print("UNAVAILABLE");
present =0;
break;
if ( availability ==1 && numA >=1 && numA <=3 && present==65)
delay(500);
radio.stopListening();
availability =0;
present =0;
radio.startListening();
if ( availability ==1 && numB >=1 && numB <=3 && present==66)
Page | 135
Autonomous Forklift
delay(500);
radio.stopListening();
availability =0;
present=0;
radio.startListening();
if ( availability ==1 && numC >=1 && numC <=3 && present==67)
delay(500);
radio.stopListening();
availability =0;
present=0;
radio.startListening();
Page | 136
Autonomous Forklift
lcd.setCursor(8,3);
lcd.print(numA);
lcd.setCursor(14,3);
lcd.print(numB);
lcd.setCursor(19,3);
lcd.print(numC);
numA=0;
delay (1000);
numB=0;
delay (1000);
numC=0;
delay (1000);
Page | 137
Autonomous Forklift
Forklift:
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
int latchPin = 2;
int clockPin = 4;
int dataPin = 3;
//Direction
int dir=0;
int pwm=255;
int timer=0;
//SONAR
int Trig=6;
int Echo=5;
long duration,cm;
//LDR
int LDR_R=0;
int LDR_L=0;
int LDR_CL=0;
Page | 138
Autonomous Forklift
int LDR_CR=0;
//
int referenceCL=5;
int newval_CL;
int referenceCR=5;
int newval_CR;
//
int destination=0;
int package2=0;
int junction=0;
int motion=0;
int locations=0;
int parking;
int obstacle=0;
int message_sent=0;
int counter=0;
int Limit_S=0;
RF24 radio(7,8);
Page | 139
Autonomous Forklift
void setup(void)
Serial.begin(9600);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(latchPin, OUTPUT);
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
printf_begin();
radio.begin();
radio.setRetries(15,15);
radio.setPayloadSize(8);
radio.openWritingPipe(pipes[1]);
radio.openReadingPipe(1,pipes[0]);
Page | 140
Autonomous Forklift
radio.printDetails();
newval_CL = analogRead(A1);
newval_CR = analogRead(A2);
newval_CL=map( newval_CL,0,1023,0,10);
newval_CR=map( newval_CR,0,1023,0,20);
referenceCL = newval_CL;
if (referenceCR >newval_CR)
referenceCR = newval_CR;
delay(500);
counter++;
Page | 141
Autonomous Forklift
Serial.print("centre_left=");
Serial.print(referenceCL);
Serial.print("centre_right=");
Serial.print(referenceCR);
delay(2000);
void loop(void)
Stp();
radio_Availability();
radio_Package();
radio_Action();
Setfwd();
Fwd_Junction();
Stp();
Lower();
delay(2000);
Stp();
Setfwd();
Stp();
delay(2000);
Page | 142
Autonomous Forklift
Raise();
delay(2000);
Stp();
Setturn_cw();
Turn_cw();
Stp();
delay(2000);
Setfwd();
Fwd();
Target();
fwd_1();
Stp();
Setturn_acw();
Turn_acw();
Stp();
delay(1000);
Setfwd();
Fwd_Delivery();
Stp();
delay(2000);
Lower();
delay(2000);
Stp();
radio_Delivery();
Stp();
delay(1000);
Setrev();
Page | 143
Autonomous Forklift
Rev();
Stp();
Raise();
delay(2000);
Stp();
Setfwd();
fwd_2();
Stp();
Setturn_cw();
Turn_cw_left();
Stp();
Setfwd();
Fwdclear();
Fwd();
Location();
Stp();
Setturn_cw();
Turn_cw();
Stp();
void Stp()
dir =0;
digitalWrite(latchPin, LOW);
Page | 144
Autonomous Forklift
digitalWrite(latchPin, HIGH);
void radio_Availability()
radio.stopListening();
delay (20);
radio.startListening();
void radio_Package()
while ( package2==0)
if ( radio.available() )
while (!done)
Page | 145
Autonomous Forklift
switch (package)
case 65:
destination=1;
locations=1;
package2++;
break;
case 66:
destination=2;
locations=2;
package2++;
break;
case 67:
destination=3;
locations=3;
package2++;
break;
void radio_Action()
Page | 146
Autonomous Forklift
radio.stopListening();
delay (20);
radio.startListening();
package2=0;
void Setfwd()
dir =5;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
void Fwd()
LDR_L = analogRead(A0);
LDR_R = analogRead(A3);
LDR_L=map( LDR_L,0,1023,0,10);
LDR_R=map( LDR_R,0,1023,0,50);
Page | 147
Autonomous Forklift
timer= millis()%2000;
if( timer==0)
{ sonar();
LDR_L = analogRead(A0);
LDR_CL = analogRead(A1);
LDR_CR = analogRead(A2);
LDR_R = analogRead(A3);
LDR_L=map( LDR_L,0,1023,0,10);
LDR_CL=map( LDR_CL,0,1023,0,10);
LDR_CR=map( LDR_CR,0,1023,0,20);
LDR_R=map( LDR_R,0,1023,0,50);
analogWrite(10,pwm);
analogWrite(9,0);
// sonar();
Page | 148
Autonomous Forklift
analogWrite(9,pwm);
analogWrite(10,0);
// sonar();
else
{ analogWrite(10,pwm);
analogWrite(9,pwm);
//sonar();
analogWrite(9,0);
analogWrite(10,0);
void sonar()
digitalWrite(Trig,LOW);
delayMicroseconds(2);
digitalWrite(Trig,HIGH);
Page | 149
Autonomous Forklift
delayMicroseconds(10);
digitalWrite(Trig,LOW);
cm = microsecondsToCentimeters(duration);
pwm = (225);
if (message_sent==1)
radio_Action();
message_sent=0;
else
pwm=0;
obstacle++;
if (obstacle==30)
radio.stopListening();
delay (20);
Page | 150
Autonomous Forklift
radio.startListening();
buzzer();
obstacle=0;
message_sent=1;
return microseconds / 29 / 2;
void buzzer ()
Stp();
dir =64;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
delay (5000);
Stp();
Page | 151
Autonomous Forklift
Setfwd();
void Fwd_Junction()
analogWrite(9,225);
analogWrite(10,225);
delay(500);
analogWrite(9,0);
analogWrite(10,0);
void Lower()
dir =16;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
delay(300);
Page | 152
Autonomous Forklift
Limit_S=analogRead(A5);
Limit_S=analogRead(A5);
dir =0;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
void Fwd_noultra()
LDR_L = analogRead(A0);
LDR_R = analogRead(A3);
LDR_L=map( LDR_L,0,1023,0,10);
LDR_R=map( LDR_R,0,1023,0,50);
LDR_L = analogRead(A0);
LDR_CL = analogRead(A1);
LDR_CR = analogRead(A2);
LDR_R = analogRead(A3);
Page | 153
Autonomous Forklift
LDR_L=map( LDR_L,0,1023,0,10);
LDR_CL=map( LDR_CL,0,1023,0,10);
LDR_CR=map( LDR_CR,0,1023,0,20);
LDR_R=map( LDR_R,0,1023,0,50);
analogWrite(10,225);
analogWrite(9,0);
// sonar();
analogWrite(9,225);
analogWrite(10,0);
// sonar();
else
{ analogWrite(10,225);
analogWrite(9,225);
//sonar();
Page | 154
Autonomous Forklift
analogWrite(9,0);
analogWrite(10,0);
void Raise()
dir =32;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
delay(300);
Limit_S=analogRead(A5);
Limit_S=analogRead(A5);
Page | 155
Autonomous Forklift
dir =0;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
delay(250);
dir =6;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
void Turn_cw()
analogWrite(9,200);
analogWrite(10,200);
delay (2000);
LDR_CR = analogRead(A2);
Page | 156
Autonomous Forklift
LDR_CR=map( LDR_CR,0,1023,0,20);
analogWrite(9,175);
analogWrite(10,175);
LDR_CR = analogRead(A2);
LDR_CR=map( LDR_CR,0,1023,0,20);
analogWrite(9,0);
analogWrite(10,0);
void Target()
junction++;
Fwd_Junction();
junction++;
Page | 157
Autonomous Forklift
delay(250);
dir =9;
digitalWrite(latchPin, LOW);
digitalWrite(latchPin, HIGH);
void Turn_acw()
analogWrite(9,200);
analogWrite(10,200);
delay (800);
LDR_CL = analogRead(A1);
LDR_CL=map( LDR_CL,0,1023,0,10);
LDR_CL = analogRead(A1);
LDR_CL=map( LDR_CL,0,1023,0,10);
analogWrite(9,200);
analogWrite(10,200);
Page | 158
Autonomous Forklift
delay(300); //
analogWrite(9,0);
analogWrite(10,0);
void Fwd_Delivery()
sonar_d();
timer= millis()%750;
if( timer==0)
{ sonar_d();
LDR_L = analogRead(A0);
LDR_CL = analogRead(A1);
LDR_CR = analogRead(A2);
LDR_R = analogRead(A3);
LDR_L=map( LDR_L,0,1023,0,10);
LDR_CL=map( LDR_CL,0,1023,0,10);
Page | 159
Autonomous Forklift
LDR_CR=map( LDR_CR,0,1023,0,20);
LDR_R=map( LDR_R,0,1023,0,50);
analogWrite(10,150);
analogWrite(9,0);
// sonar();
analogWrite(9,150);
analogWrite(10,0);
// sonar();
else
{ analogWrite(10,150);
analogWrite(9,150);
//sonar();
Page | 160
Autonomous Forklift
analogWrite(9,0);
analogWrite(10,0);
void sonar_d()
digitalWrite(Trig,LOW);
delayMicroseconds(2);
digitalWrite(Trig,HIGH);
delayMicroseconds(10);
digitalWrite(Trig,LOW);
cm = microsecondsToCentimeters(duration);
motion = 1;
Page | 161
Autonomous Forklift
else
motion =0;
//Serial.println(duration);
Serial.println(cm);
//delay(300);
void radio_Delivery()
radio.stopListening();
delay (20);
radio.startListening();
void Setrev()
delay(250);
dir =58;
digitalWrite(latchPin, LOW);
Page | 162
Autonomous Forklift
digitalWrite(latchPin, HIGH);
void Rev ()
LDR_L = analogRead(A0);
LDR_R = analogRead(A3);
LDR_L=map( LDR_L,0,1023,0,10);
LDR_R=map( LDR_R,0,1023,0,50);
analogWrite(10,175);
analogWrite(9,175);
LDR_L = analogRead(A0);
LDR_L=map( LDR_L,0,1023,0,10);
analogWrite(9,0);
analogWrite(10,0);
Page | 163
Autonomous Forklift
void Location()
parking=4;
locations++;
Fwd_Junction();
locations++;
void Turn_cw_left()
analogWrite(9,175);
analogWrite(10,175);
delay (1500);
LDR_CR = analogRead(A2);
LDR_CR=map( LDR_CR,0,1023,0,20);
analogWrite(9,175);
analogWrite(10,175);
Page | 164
Autonomous Forklift
LDR_CR = analogRead(A2);
LDR_CR=map( LDR_CR,0,1023,0,20);
analogWrite(9,0);
analogWrite(10,0);
void Fwdclear()
LDR_L = analogRead(A0);
LDR_R = analogRead(A3);
LDR_L=map( LDR_L,0,1023,0,10);
LDR_R=map( LDR_R,0,1023,0,50);
LDR_L = analogRead(A0);
LDR_CL = analogRead(A1);
LDR_CR = analogRead(A2);
LDR_R = analogRead(A3);
LDR_L=map( LDR_L,0,1023,0,10);
LDR_CL=map( LDR_CL,0,1023,0,10);
LDR_CR=map( LDR_CR,0,1023,0,20);
Page | 165
Autonomous Forklift
LDR_R=map( LDR_R,0,1023,0,50);
analogWrite(10,200);
analogWrite(9,0);
// sonar();
analogWrite(9,200);
analogWrite(10,0);
// sonar();
else
{ analogWrite(10,200);
analogWrite(9,200);
//sonar();
Page | 166
Autonomous Forklift
analogWrite(9,0);
analogWrite(10,0);
void fwd_1()
analogWrite(9,200);
analogWrite(10,200);
delay(250);
analogWrite(9,0);
analogWrite(10,0);
void fwd_2()
analogWrite(9,175);
analogWrite(10,175);
delay(800);
analogWrite(9,0);
analogWrite(10,0);
Page | 167
Autonomous Forklift
APPENDIX H
COST OF MATERIALS
Page | 168
Autonomous Forklift
APPENDIX I
DATASHEETS
Page | 169
Tech Support: services@elecfreaks.com
Product features:
5V Supply
Trigger Pulse Input
Echo Pulse Output
0V Ground
Electric Parameter
Working Voltage DC 5 V
Working Current 15mA
Working Frequency 40Hz
Max Range 4m
Min Range 2cm
MeasuringAngle 15 degree
Trigger Input Signal 10uS TTL pulse
Echo Output Signal Input TTL lever signal and the range in
proportion
Dimension 45*20*15mm
Vcc Trig Echo GND
Timing diagram
The Timing diagram is shown below. You only need to supply a short 10uS
pulse to the trigger input to start the ranging, and then the module will send out
an 8 cycle burst of ultrasound at 40 kHz and raise its echo. The Echo is a
distance object that is pulse width and the range in proportion .You can
calculate the range through the time interval between sending trigger signal and
receiving echo signal. Formula: uS / 58 = centimeters or uS / 148 =inch; or: the
range = high level time * velocity (340M/S) / 2; we suggest to use over 60ms
measurement cycle, in order to prevent trigger signal to the echo signal.
Attention:
www.Elecfreaks.com
A7800 SERIES
POSITIVE-VOLTAGE REGULATORS
SLVS056J MAY 1976 REVISED MAY 2003
OUTPUT
COMMON
COMMON OUTPUT
INPUT
COMMON
KCS (TO-220) PACKAGE INPUT
(TOP VIEW)
COMMON
OUTPUT
COMMON
INPUT
description/ordering information
This series of fixed-voltage integrated-circuit voltage regulators is designed for a wide range of applications.
These applications include on-card regulation for elimination of noise and distribution problems associated with
single-point regulation. Each of these regulators can deliver up to 1.5 A of output current. The internal
current-limiting and thermal-shutdown features of these regulators essentially make them immune to overload.
In addition to use as fixed-voltage regulators, these devices can be used with external components to obtain
adjustable output voltages and currents, and also can be used as the power-pass element in precision
regulators.
ORDERING INFORMATION
VO(NOM) ORDERABLE TOP-SIDE
TJ PACKAGE
(V) PART NUMBER MARKING
POWER-FLEX (KTE) Reel of 2000 A7805CKTER A7805C
5 TO-220 (KC) Tube of 50 A7805CKC
A7805C
TO-220, short shoulder (KCS) Tube of 20 A7805CKCS
POWER-FLEX (KTE) Reel of 2000 A7808CKTER A7808C
8 TO-220 (KC) Tube of 50 A7808CKC
A7808C
TO-220, short shoulder (KCS) Tube of 20 A7808CKCS
POWER-FLEX (KTE) Reel of 2000 A7810CKTER A7810C
10
TO-220 (KC) Tube of 50 A7810CKC A7810C
0C to 125C
POWER-FLEX (KTE) Reel of 2000 A7812CKTER A7812C
12 TO-220 (KC) Tube of 50 A7812CKC
A7812C
TO-220, short shoulder (KCS) Tube of 20 A7812CKCS
POWER-FLEX (KTE) Reel of 2000 A7815CKTER A7815C
15 TO-220 (KC) Tube of 50 A7815CKC
A7815C
TO-220, short shoulder (KCS) Tube of 20 A7815CKCS
POWER-FLEX (KTE) Reel of 2000 A7824CKTER A7824C
24
TO-220 (KC) A7824C
Tube of 50 A7824CKC
Package drawings, standard packing quantities, thermal data, symbolization, and PCB design guidelines are available at
www.ti.com/sc/package.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.
PRODUCTION DATA information is current as of publication date. Copyright 2003, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments
standard warranty. Production processing does not necessarily include
testing of all parameters.
APPLICATION INFORMATION
+V A78xx +VO
0.33 F 0.1 F
IN OUT
+ A78xx G
VI IL
COM
VO
R1
IO
0.33 F 0.1 F
R2
VO +V )
xx )
NOTE A: The following formula is used when Vxx is the nominal output voltage (output to common) of the fixed regulator:
V xx
R1
I Q R2
Input A78xx
R1
0.33 F VO(Reg)
Output
IO
IO = (VO/R1) + IO Bias Current
INPUT
INPUT
OUTPUT
OUTPUT
ADJ
OUTPUT
ADJUST
INPUT
INPUT
OUTPUT
OUTPUT
ADJ OUTPUT
ADJUST
description/ordering information
The LM317 is an adjustable three-terminal positive-voltage regulator capable of supplying more than 1.5 A over
an output-voltage range of 1.25 V to 37 V. It is exceptionally easy to use and requires only two external resistors
to set the output voltage. Furthermore, both line and load regulation are better than standard fixed regulators.
ORDERING INFORMATION
ORDERABLE TOP-SIDE
TJ PACKAGE
PART NUMBER MARKING
POWER-FLEX (KTE) Reel of 2000 LM317KTER LM317
Tube of 80 LM317DCY
SOT 223 (DCY)
SOT-223 L3
0C to 125C Reel of 2500 LM317DCYR
TO-220 (KC) Tube of 50 LM317KC
LM317
TO-220, short shoulder (KCS) Tube of 20 LM317KCS
Package drawings, standard packing quantities, thermal data, symbolization, and PCB design guidelines are available
at www.ti.com/sc/package.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.
PRODUCTION DATA information is current as of publication date. Copyright 2003, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments
standard warranty. Production processing does not necessarily include
testing of all parameters.
APPLICATION INFORMATION
D1 (Note E)
1N4002
Input Output
VI LM317 VO (Note C)
Adjust R1
240
D2 (Note E)
Vref = 1.25 V 1N4002
IAdj
Ci (Note A) CO (Note B)
0.1 F 1.0 F
R2 CADJ (Note D)
NOTES: A. Ci is not required, but is recommended, particularly if the regulator is not in close proximity
to the power-supply filter capacitors. A 0.1-F disc or 1-F tantalum provides sufficient
bypassing for most applications, especially when adjustment and output capacitors are
used.
) )
C. VO is calculated as shown:
VO +V ref 1
R2
R1
(I Adj R 2)
D. CADJ is used to improve ripple rejection; it prevents amplification of the ripple as the output voltage
is adjusted higher. If CADJ is used, it is best to include protection diodes.
E. If the input is shorted to ground during a fault condition, protection diodes provide measures to
prevent the possibility of external capacitors discharging through low-impedance paths in the IC.
By providing low-impedance discharge paths for CO and CADJ, respectively, D1 and D2 prevent
the capacitors from discharging into the output of the regulator.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.
PRODUCTION DATA information is current as of publication date. Copyright 2002, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments
standard warranty. Production processing does not necessarily include
testing of all parameters.
block diagram
VCC1
1
0 1 16
2 15 M
1 1
0 0
1 4
3 14
4 13
M 5 12
6 11
2 3
1 1
7 10 0
0
9 1 M
8
0
VC
TEXAS INSTRUMENTS
AVAILABLE OPTIONS
PACKAGE
TA PLASTIC
DIP
(NE)
L293NE
0C to 70C
L293DNE
AVAILABLE OPTIONS
PACKAGED DEVICES
TA SMALL PLASTIC
OUTLINE DIP
(DWP) (N)
L293DWP L293N
0C to 70C
L293DDWP L293DN
The DWP package is available taped and reeled. Add
the suffix TR to device type (e.g., L293DWPTR).
FUNCTION TABLE
(each driver)
INPUTS OUTPUT
A EN Y
H H H
L H L
X L Z
H = high level, L = low level, X = irrelevant,
Z = high impedance (off)
In the thermal shutdown mode, the output is
in the high-impedance state, regardless of
the input levels.
logic diagram
2 3
1A 1Y
1,2EN
1
7
6
2A 2Y
10
11
3A 3Y
9
3,4EN
15 14
4A 4Y
VCC1 VCC2
Current
Source
Input
Output
GND
GND
APPLICATION INFORMATION
VCC2
SES5001
M1
SES5001
M2
3A 4A EN 3A M1 4A M2
10 11 15 14 H H Fast motor stop H Run
16 H L Run L Fast motor stop
VCC1
8 Free-running motor Free-running motor
L X X
stop stop
1/2 L293 9
EN L = low, H = high, X = dont care
4, 5, 12, 13
GND
VCC2
2 SES5001
2 SES5001 EN 1A 2A FUNCTION
H L H Turn right
2A 1A
7 6 3 2 H H L Turn left
16 H L L Fast motor stop
VCC1
8 H H H Fast motor stop
1/2 L293 1 L X X Fast motor stop
EN
L = low, H = high, X = dont care
4, 5, 12, 13
GND
Figure 5. Bidirectional DC Motor Control
VCC
storage register. The storage register has parallel
QC
NC
QB
QA
3-state outputs. Separate clocks are provided for
both the shift and storage register. The shift 3 2 1 20 19
register has a direct overriding clear (SRCLR) QD 4 18 SER
input, serial (SER) input, and serial outputs for QE 5 17 OE
cascading. When the output-enable (OE) input is NC 6 16 NC
high, the outputs are in the high-impedance state. QF 7 15 RCLK
QG 8 14 SRCLK
Both the shift register clock (SRCLK) and storage 9 10 11 12 13
register clock (RCLK) are positive-edge triggered.
QH
GND
NC
SRCLR
Q H
If both clocks are connected together, the shift
register always is one clock pulse ahead of the
storage register.
NC No internal connection
ORDERING INFORMATION
ORDERABLE TOP-SIDE
TA PACKAGE
PART NUMBER MARKING
PDIP N Tube of 25 SN74HC595N SN74HC595N
Tube of 40 SN74HC595D
SOIC D Reel of 2500 SN74HC595DR HC595
Reel of 250 SN74HC595DT
40C to 85C
Tube of 40 SN74HC595DW
SOIC DW HC595
Reel of 2000 SN74HC595DWR
SOP NS Reel of 2000 SN74HC595NSR HC595
SSOP DB Reel of 2000 SN74HC595DBR HC595
CDIP J Tube of 25 SNJ54HC595J SNJ54HC595J
55C
55 C to 125
125C
C CFP W Tube of 150 SNJ54HC595W SNJ54HC595W
LCCC FK Tube of 55 SNJ54HC595FK
SNJ54HC595FK
Package drawings, standard packing quantities, thermal data, symbolization, and PCB design
guidelines are available at www.ti.com/sc/package.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.
!" # $%&" !# '%()$!" *!"&+ Copyright 2004, Texas Instruments Incorporated
*%$"# $ " #'&$$!"# '& ",& "&# &-!#
#"%&"# '*%$"# $')!" " 1
2
!)) '!!&"&# !& "&#"&*
#"!*!* .!!"/+ *%$" '$&##0 *&# " &$&##!)/ $)%*& %)&## ",&.#& "&*+ !)) ",& '*%$"# '*%$"
"&#"0 !)) '!!&"&#+ '$&##0 *&# " &$&##!)/ $)%*& "&#"0 !)) '!!&"&#+
SCLS041G DECEMBER 1982 REVISED FEBRUARY 2004
FUNCTION TABLE
INPUTS
FUNCTION
SER SRCLK SRCLR RCLK OE
X X X X H Outputs QAQH are disabled.
X X X X L Outputs QAQH are enabled.
X X L X X Shift register is cleared.
First stage of the shift register goes low.
L H X X
Other stages store the data of previous stage, respectively.
First stage of the shift register goes high.
H H X X
Other stages store the data of previous stage, respectively.
X X X X Shift-register data is stored in the storage register.
13
OE
12
RCLK
10
SRCLR
11
SRCLK
14
SER 1D 3R 15
C1 C3 QA
R 3S
2S
2R 3R 1
C2 C3 QB
R 3S
2S
2R 3R 2
C2 C3 QC
R 3S
2S
2R 3R 3
C2 C3 QD
R 3S
2S
2R 3R 4
C2 C3 QE
R 3S
2S
2R 3R 5
C2 C3 QF
R 3S
2S
2R 3R 6
C2 C3 QG
R 3S
2S
2R 3R 7
C2 C3 QH
R 3S
9
QH
Pin numbers shown are for the D, DB, DW, J, N, NS, and W packages.
SCLS041G DECEMBER 1982 REVISED FEBRUARY 2004
timing diagram
SRCLK
SER
RCLK
SRCLR
OE
QA
QB
QC
QD
QE
QF
QG
QH
QH
NOTE:
implies that the output is in 3-State mode.
ADE-207-272(Z)
'99.9
Rev. 0.0
Description
The HD44780U dot-matrix liquid crystal display controller and driver LSI displays alphanumerics,
Japanese kana characters, and symbols. It can be configured to drive a dot-matrix liquid crystal display
under the control of a 4- or 8-bit microprocessor. Since all the functions such as display RAM, character
generator, and liquid crystal driver, required for driving a dot-matrix liquid crystal display are internally
provided on one chip, a minimal system can be interfaced with this controller/driver.
A single HD44780U can display up to one 8-character line or two 8-character lines.
The HD44780U has pin function compatibility with the HD44780S which allows the user to easily replace
an LCD-II with an HD44780U. The HD44780U character generator ROM is extended to generate 208 5
8 dot character fonts and 32 5 10 dot character fonts for a total of 240 different character fonts.
The low power supply (2.7V to 5.5V) of the HD44780U is suitable for any portable battery-driven product
requiring low power dissipation.
Features
1
HD44780U
Pin Functions
No. of Device
Signal Lines I/O Interfaced with Function
RS 1 I MPU Selects registers.
0: Instruction register (for write) Busy flag:
address counter (for read)
1: Data register (for write and read)
R/W 1 I MPU Selects read or write.
0: Write
1: Read
E 1 I MPU Starts data read/write.
DB4 to DB7 4 I/O MPU Four high order bidirectional tristate data bus
pins. Used for data transfer and receive between
the MPU and the HD44780U. DB7 can be used
as a busy flag.
DB0 to DB3 4 I/O MPU Four low order bidirectional tristate data bus pins.
Used for data transfer and receive between the
MPU and the HD44780U.
These pins are not used during 4-bit operation.
CL1 1 O Extension driver Clock to latch serial data D sent to the extension
driver
CL2 1 O Extension driver Clock to shift serial data D
M 1 O Extension driver Switch signal for converting the liquid crystal
drive waveform to AC
D 1 O Extension driver Character pattern data corresponding to each
segment signal
COM1 to COM16 16 O LCD Common signals that are not used are changed
to non-selection waveforms. COM9 to COM16
are non-selection waveforms at 1/8 duty factor
and COM12 to COM16 are non-selection
waveforms at 1/11 duty factor.
SEG1 to SEG40 40 O LCD Segment signals
V1 to V5 5 Power supply Power supply for LCD drive
VCC V5 = 11 V (max)
VCC, GND 2 Power supply VCC: 2.7V to 5.5V, GND: 0V
OSC1, OSC2 2 Oscillation When crystal oscillation is performed, a resistor
resistor clock must be connected externally. When the pin input
is an external clock, it must be input to OSC1.
8
nRF24L01+
Single Chip 2.4GHz Transceiver
1.1 Features
Features of the nRF24L01+ include:
Radio
X Worldwide 2.4GHz ISM band operation
X 126 RF channels
X GFSK modulation
Transmitter
X Programmable output power: 0, -6, -12 or -18dBm
Receiver
X Fast AGC for improved dynamic range
X 13.5mA at 2Mbps
RF Synthesizer
X Fully integrated synthesizer
Enhanced ShockBurst
X 1 to 32 bytes dynamic payload length
Power Management
X Integrated voltage regulator
X Idle modes with fast start-up times for advanced power management
Host Interface
X 4-pin hardware SPI
X Max 10Mbps
X 5V tolerant inputs
2 Pin Information
DVDD
IREF
VSS
VDD
VSS
20 19 18 17 16
CE 1 15 VDD
CSN 2 14 VSS
nRF24L01+
SCK 3 13 ANT2
QFN20 4X4
MOSI 4 12 ANT1
MISO 5 11 VDD_PA
6 7 8 9 10
IRQ
VDD
VSS
XC2
XC1
Figure 2. nRF24L01+ pin assignment (top view) for the QFN20 4x4 package