Zusammenfassung
Inhaltsangabe:Abstract:
The project aim was to a built a robot, controlled by a PIC microcontroller to follow a line completely autonomously and as quickly as possible. The robot meets the requirements from the RoboRama Contest, followed a T-shape course, and obtained more (safety) features. Different kinds of design features and digital algorithms were developed and tested, in order to achieve the best results.
Applied project management techniques and used key skills, guaranteed the successful completion of the project, in the design and construction of hardware and software technologies.
The hardware was based on a block structure with infrared sensors at the front of the vehicle. Their analogue signals were transferred to digital logic with a comparator. This information used a PIC 16F84A microcontroller to control the movement and direction of the robot with pulse width modulation (PWM). All parts were mounted on a chassis, implemented with a mechanical construction set. Batteries of 9V provided the necessary power supply.
Adjustments were done through iterative steps, to come to the final result of the robot system. The main adapted design feature was the motor and steering system. First of all a separate servomotor for the steering and a single DC motor for the forward movement was fixed. Through implemented and first testing steps, this resolution lacked the required performance. Hence, the design changed to two DC motors, which offered a satisfactory solution.
The electronic circuit was designed with the computer aided design tool Proteus and executed as a strip line board.
The software algorithm development started with the truth table to reduce the possible events from thirty-two to the eleven applied conditions. The generated flowchart gave the program a structure and applied the truth table decision in different PWM generations. Finally, the software was written in assembler language and implemented on the PIC.
Inhaltsverzeichnis:Table of Contents:
iTitlei
iiAbstractii
iiiAcknowledgementsiii
ivList of Figuresiv
vList of Tablesvi
viList of Abbreviationsvii
viiList of Symbolsix
viiiTable of Contentsx
1.Introduction1
1.1Project Aims2
1.2RoboRama Rules2
2.Specification and Analysis5
2.1Specification of the project5
2.1.1Research and definition for the project5
2.1.2Resources management7
2.2Project time plan8
3.Design of the robot9
3.1Design of the electronic hardware11
3.1.1Sensors OPD 70911
3.1.2Comparator […]
The project aim was to a built a robot, controlled by a PIC microcontroller to follow a line completely autonomously and as quickly as possible. The robot meets the requirements from the RoboRama Contest, followed a T-shape course, and obtained more (safety) features. Different kinds of design features and digital algorithms were developed and tested, in order to achieve the best results.
Applied project management techniques and used key skills, guaranteed the successful completion of the project, in the design and construction of hardware and software technologies.
The hardware was based on a block structure with infrared sensors at the front of the vehicle. Their analogue signals were transferred to digital logic with a comparator. This information used a PIC 16F84A microcontroller to control the movement and direction of the robot with pulse width modulation (PWM). All parts were mounted on a chassis, implemented with a mechanical construction set. Batteries of 9V provided the necessary power supply.
Adjustments were done through iterative steps, to come to the final result of the robot system. The main adapted design feature was the motor and steering system. First of all a separate servomotor for the steering and a single DC motor for the forward movement was fixed. Through implemented and first testing steps, this resolution lacked the required performance. Hence, the design changed to two DC motors, which offered a satisfactory solution.
The electronic circuit was designed with the computer aided design tool Proteus and executed as a strip line board.
The software algorithm development started with the truth table to reduce the possible events from thirty-two to the eleven applied conditions. The generated flowchart gave the program a structure and applied the truth table decision in different PWM generations. Finally, the software was written in assembler language and implemented on the PIC.
Inhaltsverzeichnis:Table of Contents:
iTitlei
iiAbstractii
iiiAcknowledgementsiii
ivList of Figuresiv
vList of Tablesvi
viList of Abbreviationsvii
viiList of Symbolsix
viiiTable of Contentsx
1.Introduction1
1.1Project Aims2
1.2RoboRama Rules2
2.Specification and Analysis5
2.1Specification of the project5
2.1.1Research and definition for the project5
2.1.2Resources management7
2.2Project time plan8
3.Design of the robot9
3.1Design of the electronic hardware11
3.1.1Sensors OPD 70911
3.1.2Comparator […]
Leseprobe
Inhaltsverzeichnis
ID 7512
Block, Steffen: Digital control methods for a line following robot
Hamburg: Diplomica GmbH, 2003
Zugl.: Fachhochschule Gießen-Friedberg, Fachhochschule, BA-Thesis / Bachelor, 2003
Dieses Werk ist urheberrechtlich geschützt. Die dadurch begründeten Rechte,
insbesondere die der Übersetzung, des Nachdrucks, des Vortrags, der Entnahme von
Abbildungen und Tabellen, der Funksendung, der Mikroverfilmung oder der
Vervielfältigung auf anderen Wegen und der Speicherung in Datenverarbeitungsanlagen,
bleiben, auch bei nur auszugsweiser Verwertung, vorbehalten. Eine Vervielfältigung
dieses Werkes oder von Teilen dieses Werkes ist auch im Einzelfall nur in den Grenzen
der gesetzlichen Bestimmungen des Urheberrechtsgesetzes der Bundesrepublik
Deutschland in der jeweils geltenden Fassung zulässig. Sie ist grundsätzlich
vergütungspflichtig. Zuwiderhandlungen unterliegen den Strafbestimmungen des
Urheberrechtes.
Die Wiedergabe von Gebrauchsnamen, Handelsnamen, Warenbezeichnungen usw. in
diesem Werk berechtigt auch ohne besondere Kennzeichnung nicht zu der Annahme,
dass solche Namen im Sinne der Warenzeichen- und Markenschutz-Gesetzgebung als frei
zu betrachten wären und daher von jedermann benutzt werden dürften.
Die Informationen in diesem Werk wurden mit Sorgfalt erarbeitet. Dennoch können
Fehler nicht vollständig ausgeschlossen werden, und die Diplomarbeiten Agentur, die
Autoren oder Übersetzer übernehmen keine juristische Verantwortung oder irgendeine
Haftung für evtl. verbliebene fehlerhafte Angaben und deren Folgen.
Diplomica GmbH
http://www.diplom.de, Hamburg 2003
Printed in Germany
- ii -
ii ABSTRACT
The project aim was to a built a robot, controlled by a PIC microcontroller to follow a line
completely autonomously and as quickly as possible. The robot meets the requirements from
the "RoboRama Contest" (
www.dprg.com
), followed a T-shape course, and obtained more
(safety) features. Different kinds of design features and digital algorithms were developed and
tested, in order to achieve the best results.
Applied project management techniques and used key skills, guaranteed the successful
completion of the project, in the design and construction of hardware and software
technologies.
The hardware was based on a block structure with infrared sensors at the front of the vehicle.
Their analogue signals were transferred to digital logic with a comparator. This information
used a PIC 16F84A microcontroller to control the movement and direction of the robot with
pulse width modulation (PWM). All parts were mounted on a chassis, implemented with a
mechanical construction set. Batteries of 9V provided the necessary power supply.
Adjustments were done through iterative steps, to come to the final result of the robot system.
The main adapted design feature was the motor and steering system. First of all a separate
servomotor for the steering and a single DC motor for the forward movement was fixed.
Through implemented and first testing steps, this resolution lacked the required performance.
Hence, the design changed to two DC motors, which offered a satisfactory solution.
The electronic circuit was designed with the computer aided design tool Proteus and executed
as a strip line board.
The software algorithm development started with the truth table to reduce the possible events
from thirty-two to the eleven applied conditions. The generated flowchart gave the program a
structure and applied the truth table decision in different PWM generations. Finally, the
software was written in assembler language and implemented on the PIC.
- iii -
iii ACKNOWLEDGEMENTS
In regards of my final year project at the University of Central Lancashire / England, I would
like to express my deepest thanks to all people who supported me during the whole period of
my stay.
Particularly I want to thank my tutor and supervisor Mahesh M Patel and all technicians at the
workshop for their estimable help and support for the successful realization of this project.
In addition, I also would like to thank my supervising professor at the University of Applied
Sciences Giessen / Germany, Prof. Dr. Müller, for his support and help for the Erasmus
Exchange Program.
Finally, I also want to appreciate the support given by my friends who are located in England
and Germany.
Preston / England, April 2003
Steffen Block
- iv -
iv LIST OF FIGURES
Figure number by chapter: Name of figure
Page
Figure 1.1 Robot T- Course... 4
Figure 3.1 General block structure... 10
Figure 3.2 Sensor reflection principle ... 11
Figure 3.3 OPD 704 housing and connections... 12
Figure 3.4 Comparator LM 339 schematic ... 14
Figure 3.5 Transistor TIP 31A connections in the TO-220 housing... 14
Figure 3.6 PIC pins connection ... 15
Figure 3.7 PIC Oscillator / Resonator connection... 17
Figure 3.8 Servomotor... 21
Figure 3.9 DC motor with multi ratio gearbox... 24
Figure 3.10 Used flow chart symbols... 29
Figure 3.11 General flowchart ... 31
Figure 3.12 Flowchart Sensor input decisions ... 32
Figure 3.13 Flowchart PWM generation and time loop... 34
Figure 3.14 Header of the program ... 35
Figure 3.15 Basic beginning of each assembler code ... 36
Figure 3.16 Bank switching to configure the I/O ports... 37
Figure 3.17 Start of main program and obstacle stop ... 37
Figure 3.18 Sensor input decision ... 38
Figure 3.19 Added sensor input decision ... 38
Figure 3.20 PWM generation ... 40
Figure 3.21 Decision for fast or slow... 40
Figure 3.22 Time loop... 41
Figure 3.23 MPLAB surface ... 43
Figure 3.24 1
st
toolbar ... 43
Figure 3.25 2
nd
toolbar ... 44
Figure 3.26 3
rd
toolbar... 44
Figure 3.27 Special function register window ... 46
Figure 3.28 Stopwatch window... 46
Figure 3.29 Edit project files window... 47
Figure 3.30 MPLAP Project / Handling of the data files ... 48
- v -
Figure 3.31 PICSTART Plus device programmer / Device specifications configuration bits. 50
Figure 4.1 Block Structure with servo motor and DC motor ... 51
Figure 4.2 Implemented block structure with servo motor and DC motor ... 52
Figure 4.3 Block Structure with two DC motors ... 53
Figure 4.4 Implemented block structure with two DC motors... 54
Figure 4.5 Circuit schematic / Sensor and comparator ... 56
Figure 4.6 Circuit schematic / Motor control... 56
Figure 4.7 Complete circuit schematic... 57
Figure 4.8 Implemented circuit board / Top view with components ... 59
Figure 5.1 Right Sensor Figure 5.2 Only Front Sensor without line ... 66
Figure 5.3 Only Front Sensor with line Figure 5.4 Left Sensor... 67
Figure 5.5 Applied T-course dimensions ... 68
- vi -
v LIST OF TABLES
Table number by chapter: Name of Table
Page
Table 1.1 Conversion course dimensions... 4
Table 3.1 Register file map of the PIC... 18
Table 3.2 Reduction table R.P.M. for DC motor ... 23
Table 3.3 Sensor abbreviations ... 27
Table 3.4 Truth table ... 27
Table 4.1 Bill of material ... 58
Table 4.2 Implemented circuit board / Terminal connections ... 60
Table 4.3 Implemented circuit board / LM 339 connections ... 61
Table 4.4 Implemented circuit board / PIC pin connections... 61
Table 5.1 Servomotor tested pulse length for steering... 63
Table 6.1 Pricelist of components ... 75
- vii -
vi LIST OF ABBREVIATIONS
DC
Direct Current
DIP
Dual Inline Package
DPRG
Dallas Personal Robotics Group
CMOS
Complementary Metal Oxide Semiconductor
EEPROM Electrically Erasable Programmable Read Only Memory
FR
Front Sensor
ICD
MPLAP
In-Circuit Debugger from Microchip
ICE
MPLAP
In-Circuit Emulator from Microchip
IDE
MPLAP
Independent-Development Tool from Microchip
IEE
Institution of Electrical Engineers
I/O
Input / Output
IT Information Technology
LI Left-Inside Sensor
LO
Left-Outside Sensor
PCB
Printed Circuit Board
PIC
Peripheral Interface Controller
PWM
Pulse Width Modulation
QTY
Quantity
RAM
Random Access Memory
RI
Right-Inside Sensor
RISC
Reduced Instruction Set
RO
Right-Outside Sensor
ROM
Read Only Memory
R.P.M. Revolution per Minute
- viii -
T.T.
Truth Table
VAT
Value Added Tax
- ix -
vii LIST OF SYMBOLS
f
Frequency [Hertz = Hz = s
-1
]
I
Current [Ampere = A]
l
Metre [m]; Millimetre 1/1000 of a meter [mm]
t
Time [seconds = s];
Millisecond 1/100 of a second [ms]; Microsecond 1/1000 of a second [µs]
T
Period time [seconds = s]
v
velocity [meter per second = m/s]
V
Voltage [Volt = V]
Foot [30.48 cm]
Inch [2.54 cm]
- x -
viii TABLE OF CONTENTS
i Title ... i
ii Abstract ...ii
iii Acknowledgements...iii
iv List of Figures ... iv
v List of Tables... vi
vi List of Abbreviations...vii
vii List of Symbols ... ix
viii Table of Contents... x
1. Introduction ... 1
1.1 Project Aims... 2
1.2 RoboRama Rules... 2
2. Specification and Analysis ... 5
2.1 Specification of the project ... 5
2.1.1 Research and definition for the project ... 5
2.1.2 Resources management ... 7
2.2 Project time plan... 8
3. Design of the robot... 9
3.1 Design of the electronic hardware... 11
3.1.1 Sensors OPD 709 ... 11
3.1.2 Comparator LM 339... 13
3.1.3 Transistor TIP 31A... 14
3.1.4 PIC 16F84 ... 15
3.1.5 Power Supply ... 19
3.1.5.1 Voltage Regulator 7805 ... 19
3.1.5.2 Batteries 9V... 19
3.1.6 Prototype strip board ... 20
3.2 Design of the electromechanical components and chassis... 21
3.2.1 Servo Motor... 21
3.2.2 DC Motor ... 22
3.2.3 Chassis... 24
3.3 Design of the software... 25
3.3.1 Truth table ... 26
- xi -
3.3.2 Flow charts ... 28
3.3.3 Assembler program ... 35
3.3.3 MPLAP software environment... 42
3.3.3.1 Programming Interface... 42
3.3.3.2 Programmer settings... 49
4. Implementation of the robot system... 51
4.1 Realisation of the robot with servo motor and DC motor ... 51
4.1.1 Block Structure with servo motor and DC motor ... 51
4.1.2 Implemented block structure with servo motor and DC motor... 52
4.2 Realisation of the robot with two DC motors ... 53
4.2.1 Block Structure with two DC motors... 53
4.2.2 Implemented block structure with two DC motors ... 53
4.2.3 Implemented Circuit Board... 55
4.2.3.1 Circuit schematic... 55
4.2.3.2 Bill of material ... 58
4.2.3.3 Implemented circuit board ... 59
5. Testing of the Robot system... 62
5.1 Testing the robot with servo motor and DC motor ... 62
5.1.1 Test of servo motor ... 62
5.1.2 Test of servo motor with robot... 63
5.1.3 Conclusions of servo motor test ... 64
5.2 Testing the robot with two DC motors... 65
5.2.1 Sensor position adjustment... 65
5.2.2 Test of the Pulse Width Modulation ... 66
5.2.3 Behaviour test of the robot ... 67
5.2.4 Final T Court test... 68
6. Overall Project Work ... 70
6.1 Development of key skills... 70
6.1.1 Development of the "Communications" key skill... 70
6.1.2 Development of the "Use of IT" key skill... 71
6.1.3 Development of the "Resources and time management" key skill ... 72
6.1.4 Development of the "Independent learning" key skill ... 73
6.2 Project risks and risks assessment... 74
6.3 Financial Factor of the Project ... 75
- xii -
6.4 Critically discussion of the project... 76
7. Conclusions and recommendations... 79
7.1 Conclusions ... 79
7.1.1 Project management and key skills ... 79
7.1.2 Hardware ... 80
7.1.3 Software ... 81
7.1.4 Overall Conclusions ... 82
7.2 Recommendations for further work ... 83
Bibliography... 84
Book
Sources: ... 84
Datasheets: ... 85
Internet
Sources:... 85
Glossary of terms ... 87
List of Appendices: ... 88
Appendix A "Main Assembler Program" ... 89
Appendix B "Assembler Include Header" ... 93
Appendix C "Datasheet "Sensor OPD 704" ... 95
Appendix D "Datasheet "Comparator LM 339" ... 96
Appendix E "Datasheet Power Regulator 7805" ... 97
Appendix F "Datasheet Transistor TIP 31A" ... 98
Appendix G "Datasheet main features PIC16F8X"... 99
Appendix H "Datasheet PIC16F8X block diagram"... 100
Appendix I "PIC16F8X instruction set" ... 101
Appendix J "Electrical circuit schematic" ... 102
Appendix K "Time schedule of the project"... 103
Appendix L "Adapted time schedule of the project" ... 105
Appendix M "Specification of the project"... 106
Appendix N "Example of the "To-Do-List" ... 110
Appendix O "Example of a section of the vocabulary sheet"... 111
Appendix P "University Deadlines" ... 112
Appendix Q "Example of the "Loan deadlines for resources at the library "... 113
Appendix R "Example of the tutor meeting sheet"... 114
Appendix S "Schematic of the PIC application board" ... 115
- 1 -
1.INTRODUCTION
This paper provides a detailed report of the final year project "Digital Control Methods for a
Line Following Robot".
The project's task was to build a robot with a digital microcontroller system to follow a line
completely autonomously and as quickly as possible. The robot had to fulfil the requirements
from the "RoboRama Contest" (
www.dprg.com
). In addition, the robot could for example,
work on a factory floor, have higher requirements to follow a line and earn additional (safety)
features. To achieve the best result of the line following, different kinds of design features and
digital algorithms were developed and tested.
Applied project management techniques guaranteed the successful completion of the project.
In general, the development of the robot system contained three main fields.
Mechanical construction
Electronic circuit board
Software programmed algorithm
The robot design outcome was a prototype model, therefore the following results showed the
best behaviour, but needed to be adapt for a manufacturer process of the robot in larger
quantity. The mechanical construction was based on a construction set. This allowed effective
handling, was easy to assemble, and produced a strong chassis in grid format. The circuit
board was executed on a strip line board and the applied software algorithm worked on a
PIC16F84A (Peripheral Interface Controller) microcontroller. This microcontroller were
commonly used in the industry and offered all required features for control of the robot
system.
- 2 -
1.1 Project Aims
The main aims of the project were to create:
A chassis to drive the robot forward
A microcontroller to control the robot to move forward / left / right
Sensors that the robot follow autonomously a line, an edge, and the T- course
Additional safety functions
Optimisation to move around the court as efficiently as possible
The robot behaviour fulfilled the RobaRama rules, which were explained in Chapter 1.2
1.2 RoboRama Rules
All over the world robot competitions exist, to develop new sophisticated robot technologies,
to improve existing methods, provide access to the public, and measure robot skills. These
competitions were the basis for the future, gave greater exposure to more people of robot
knowledge, and gained a higher technology output. Robot technologies were commonly used
in the industry. They need to be improved and the market for the end user in the private home
environment allows a wide range of future utilisations.
The robot for this project was more likely a goal for industrial applications to work for
example on a factory floor. The robot had to fulfil the requirements and rules to run on the
robot competition from the Dallas Personal Robotics Group (DPRG)
www.dprg.org
. The
group was founded 1984 in Dallas, USA. Annually the DPRG organized a robot competition
with several separate events, called RoboRama.
"The purpose of the RoboRama Robotics Contest is to provide a forum for DPRG robot
builders to demonstrate their robots' capability in a variety of challenges. Demonstrating
personal robots in a RoboRama contest will encourage others to build robots."
www.dprg.org
- 3 -
For each competition, special rules were applied. The general rules applying for all events
were:
"General Rules:
Robots must be autonomous -- self-controlled
Robots must be built from scratch or kit form
Robots must not rely upon human intervention during the contest except for starting,
stopping, or emergency situations
Robots can have on-board or off-board controllers, tethers are allowed
Robot dimensions must not be greater than, 48" length, 48" width, 96" height
Robots may extend arms etc. but may not exceed allowed dimensions at any time
Robots must not weigh more than 300 lbs.
Robots must not inherently present a danger to humans, other contestants, pets or property
Robots must not discharge materials that cannot be easily cleaned up
Robots must not materially damage the course" www.dprg.org
The primary objective was that the autonomous robot followed a marked line. The secondary
objective was to execute this action in the least amount of time, with a maximum time limit of
five minutes. The skills tested the "ability to recognize a navigational aid (the line) and used it
to reach the goal"
www.dprg.org
.
The imperial measurement system in Feet and Inches were transferred to the international
metric system. Hereby was one foot = 30.48 cm and one inch (a twelfth of a foot) = 2.54 cm.
For the practical implementation, the Table 1.1 displayed the conversion values of the T-
Shape course.
- 4 -
Imperial System
Feet ` Inches "
Metric System
cm
4' 00"
121.92
8' 00"
243.84
16' 00"
487.68
Table 1.1 Conversion course dimensions
For this project, two events were modified to set the project aim. Instead of the "Line
Following Course", the robot had to navigate the T-Shape course, see Figure 1.1. This made it
harder for the project, because the line following course obtained only soft turnings. The T-
shape course with sharp 90° edges required a better robot performance and the robot could
easier shot over the edge and lost the track.
Figure 1.1 Robot T- Course
- 5 -
2.SPECIFICATION AND ANALYSIS
The main parts of the specification, like the Project Aims, RoboRama rules, and requirements
were in detail explained in the introduction. The following parts described the research and
definition of the project, resources management, and the time plan.
The first research provided a first basic knowledge, to analyse the circumstances of the project
and to define the project. Therefore, it was a part of the specification, because it helped to
form the specification. Resources and time constraints were also a part of the specification.
The complete specification from the beginning of the project showed Appendix M.
2.1 Specification of the project
2.1.1 Research and definition for the project
For a better understanding of the project and to gain the knowledge in each affected field,
research was done through the whole project time. Especially at the beginning of the project,
main research was carried out, to obtain first impressions and gain an overview of the project
task. This allowed a better understanding of the oncoming task and introduced the author into
the fields of robot technology, electronic hardware, microcontroller behaviours, and software
algorithm development. With this knowledge, the project was in detail specified and the main
tasks / features defined. These specifications and definitions fixed the "Project Specification
and Plan" report, see Appendix M. This report provided a written working basic for
participating people, like tutor, moderator, second marker, student etc.
- 6 -
A project time plan in Gantt chart form allowed a time management and straightforward
handling of the project, as chapter 2.2 showed.
The research took place via the Internet, the university library and catalogues available from
the shop in the electronic department. The Internet search portal
www.google.com
allowed
comprehensively search information to related websites in each field. To get first impressions
of the robot world, different robot competitions websites offered a good overview, especially
www.dprg.org
. The links for each different subfield or other robot websites opened a larger
area of broad information.
After the overview and specification phase of the robot, more detail settings were necessary to
find and order the correct parts. The main UK vendors with their websites and catalogues
offered a good overview and comparison.
RS-Components
Maplin electronic
Farnell
CPC
From this point, the manufacture product information and datasheets finalized the settings of
the parts. Through the detailed research at the beginning, the work focused later on, more on
the accomplishment of the project itself. The library offered only some books for robot
technology, the most usage was made with books for PIC applications and programming.
All resources used showed the "Bibliography" list at the end of this report.
- 7 -
2.1.2 Resources management
The well-organized handling of the resources for the project was essential for the successful
completion. The external influence of the resources occurred maybe a risk for the project, that
it became delayed or disturbed. Therefore, the applied project management techniques,
together with the time plan and listings to control the resources were introduced. The basic
task in the control of the claimed resources was to identify them and check their availability.
The main claimed resources were the access to rooms, laboratories, computers, and program
devices, testing equipment, and other acquired parts. Therefore, the continues contact with the
technicians, lectures at the department, and university staff provided the necessary knowledge
about opening times and the availability of the requirements equipment. To obtain the
acquired parts, the time management allowed a better control and overview of the occupied
times. The most important part in the resources control was that everything was double-
checked, because things changed and generally everything needed confirmation to ensure the
availability.
- 8 -
2.2 Project time plan
The software Microsoft Project 2000 offered a professional aid for the project management.
The produced Gantt chart time plan listed all tasks, assignments, milestones, resources, risks,
critical paths, and deadlines in an adequate calendar overview. The predicted project plan
showed Appendix K and Appendix L showed the real progression of the project. A critical
review and comparison between the plan and reality, showed changes, critical tasks, delays
and quicker progress. With this knowledge, the author gained a better experience to specify
tasks and predict the time length for future project management. Most of the tasks and overall
complete project fulfilled the planned activities.
All milestones fulfilled their goals on time. The biggest changes were the adapted robot
structures with the new designed and build chassis and necessary adjusted circuit board and
software. However, these changes happened in the planned time resources and guaranteed the
success of the project.
- 9 -
3.DESIGN OF THE ROBOT
The first design step of the robot was the development of the general block structure Figure
3.1. The following chapters gave deeper details to each block part with their description. The
electrical schematic finalized the assembled and implemented parts. Many iterative steps were
necessary for the overall design of the robot. Throughout the development, continued reviews
with necessary adjustments were recognized. The main design feature was the motor and
steering system. First of all, a separate servomotor for the steering and a single DC motor for
the forward movement were implemented. Through implemented and first test steps, this
resolution did not showed the required performance. Hence, the design changed to two DC
motors. Therefore, the following chapters allowed a comparison between these two different
scenarios. Through the early recognition and changed design, the detailed representation in
this report focuses on the second resolution.
Through the "RoboRama" requirements and definitions from the tutor, the following basics
were defined and Figure 3.1 visualized these requirements:
Sensor to read the line information
A/D Interface to change the analogue information from the sensor to digital high / low
PIC microcontroller for digital control of the robot system
Motor controlled forward movement and steering
Power supply
Chassis to mount all components
- 10 -
Figure 3.1 General block structure
The design and definition of the parts contained a huge amount of research to come to the
final displayed results. The behaviour for each single part was studied. The acquired basic
knowledge in each field allows the capability of finding the best-fitted part. This contained
research from the Internet, library resources, product catalogues, and discussions with the
tutor. The parts were chosen from their technical features, price, and availability. Attention
was also paid to the interface between each part, so that the signals were able to interact
without any additional components.
- 11 -
3.1 Design of the electronic hardware
3.1.1 Sensors OPD 709
The main task of the sensors was to detect the line on the floor. A resolution with a digital
camera and the necessary computer power results in an expensive and overcomplicated
technical environment. A cheap and sufficient way was to use optical sensors from the type
OPD 709. One housing contained an infrared emitting LED and a phototransistor. The
principle, based on the physical effect, that a darker surface reflected less light than a lighter
surface. This application used the spectra of infrared light to eliminated ambient light
problems. The infrared light emitted by a LED reflected off the surrounding surface and
influenced the base of a phototransistor. The changed resistance over the collector and emitter
provided the necessary analogue signal level. see Figure 3.2.
Figure 3.2 Sensor reflection principle
The Sensors got four connections for soldering:
LED with negative and positive
Phototransistor with the emitter and collector
- 12 -
The emitter connected directly to ground; therefore the negative LED (-) was connected with
the emitter and only three wires connected to the circuit board.
The datasheet provided only the information of the maximum voltage V
f
= 2 V and maximum
current I
f
= 40 mA (at 25° C). To save battery power the minimum values were specified.
Through a testing experiment, the minimum current for a clear recognized line or no line
information was I
f
= 10.5 mA by V
f
= 1.32V. For the voltage environment of 5 V a R = 350
obtained this. The E12 series result to R = 330 and an I
f
= 11.2 mA. The chosen 20 lower
value offered a more stable condition. The phototransistor output showed the best result with
the emitter connected to ground and R = 47 k between the collector and 5 V power supply.
The best distance of four to six mm from the datasheet between the sensor and reflecting
surface confirmed the measurement. The Figure 3.3 visualized the black plastic package for
the infrared LED and phototransistor. The slotted mounting hole allowed distance adjustment
of the sensor. "The dust cover and infrared filter at the infrared LED out and the
phototransistor in prevent dust ingress and eliminate ambient light problems". RS-
Components Datasheet
Figure 3.3 OPD 704 housing and connections
Dust
Cover
In
Out
- 13 -
3.1.2 Comparator LM 339
The analogue voltage level from the sensor provided the necessary line information for the
PIC microcontroller. However, this information was changed to the digital level of high (5V)
and low (0V). There were the following opportunities.
A/D interface
PIC microcontroller with comparator inputs
Schmitt-Trigger device
Comparator device
The disadvantages of the first three components were; The A/D interface was too expensive
and technically over specified. The PIC with comparator inputs was too expensive, provided
only four inputs, and allowed only a software change of the threshold levels. Therefore, for
every new environment the PIC needed to be new programmed for every change of the
threshold level. The Schmitt-Trigger device was known for their hysteresis behaviour with
different threshold levels for on/off.
Hence, the comparator presented the best performance. The chosen comparator type, LM 339,
offered four (Quad) comparator in one 14-pin DIL package, see Figure 3.4. Each comparator
contained a negative and positive input and an output. One input provided the reference
voltage. The threshold level was adjusted by a changeable voltage divider. The other input,
connected to the collector of the sensor, contained the sensor information.
The comparator operated with digital high and low signals on the output, depending if the
input was lower or higher than the reference threshold. The inverting or no inverting
behaviour was dependent if the negative or positive input was set for the input voltage.
- 14 -
Overall, this result offered a low cost solution, with no hysteresis and an easy adjustable
threshold with trim potentiometers for applied adjustment for different environments.
Figure 3.4 Comparator LM 339 schematic
3.1.3 Transistor TIP 31A
The PIC controlled the DC motor with PWM. Through the limited current source from the
PIC, it was not possible to drive directly the DC motor. Therefore, a transistor from type TIP
31A provided enough current to drove the DC motor, see Figure 3.5.
Figure 3.5 Transistor TIP 31A connections in the TO-220 housing
- 15 -
The typical current of the DC motor was about 300 mA and the transistor allowed up to 3 A
(5 A pulse). General all CMOS (Complementary Metal Oxide Semiconductor) devices, like
the PIC were better in sinking than sourcing of current. For that reason a 330 resistor
connected from the PIC output port to the base of the transistor became the ideal solution. The
connected DC motor between collector and power supply obtained an anti-parallel diode from
the type 1N4001. The on/off switched motor produced high inductive loads. The anti-parallel
diode therefore provided a short circuit for these indicatives.
3.1.4 PIC 16F84
The appropriate microcontroller for the robot was established with the PIC 16F84 (Peripheral
Interface Controller) from Microchip
www.microchip.com
. The main features of the PIC
were shown in an excerpt of the Datasheet in Appendix G. The PIC provided 13 I/O pins with
individual setting as an input or output, wide operation voltage (2V 6V), with low power
consume for battery operation and standard high speed of 4 MHz. The device used the
standard 18-pin DIP (Dual Inline Package) socket, see Figure 3.6.
Figure 3.6 PIC pins connection
Details
- Seiten
- Erscheinungsform
- Originalausgabe
- Erscheinungsjahr
- 2003
- ISBN (eBook)
- 9783832475123
- ISBN (Paperback)
- 9783838675121
- DOI
- 10.3239/9783832475123
- Dateigröße
- 4.7 MB
- Sprache
- Englisch
- Institution / Hochschule
- Fachhochschule Gießen-Friedberg; Standort Gießen – unbekannt
- Erscheinungsdatum
- 2003 (Dezember)
- Note
- 1,0
- Schlagworte
- projekt management assembler electronic hardware pulse width modulation
- Produktsicherheit
- Diplom.de