SOCCER ROBOT: ROBOT DEVELOPMENT
SUPARDI BIN DAWING
This Report Is Submitted In Partial Fulfillment of Requirements for the Bachelor of Electronic Engineering (Industrial Electronics) with honours.
Fakulti Kejuruteraan Elektronik dan Kejuruteraan Komputer Universiti Teknikal Malaysia Melaka
UNIVERSTI TEKNIKAL MALAYSIA MELAKA
FAKULTI KEJURUTERAAN ELEKTRONTK DAN KEJURUTERAAN KOMPUTER BORANG PENGESAHAN STATUS LAPORAN
PROJEK SARJANA MUDA IJ
Tajuk Projek Sesi
Pengajian
Soccer Robot 2006-2007
Saya SUPARDI BIN DAWING
mengaku membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-syarat kegunaan seperti berikut:
I. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.
2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.
3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi pengajian tinggi.
4. Sila tandakan ( ..J ) :
D
SULIT*D
TERBAD*[Z]
TIDAK TERHAD(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKT A RAHSlA RASMI 1972)
(Mengandungi maklumat terhad yang telah ditentukan oleh organisasilbadan di mana penyelidikan dijalankan)
Disahkan oleh:
Alamat Tetap: 46 2 3 Sri Ayu Apartment,jln 14/55 Taman Setiawangsa 54300, Kuala Lumpur.
NU~ULY:AJA~ 8 A!D MANAP ,.ensyarah
Tarikh: ...
~/>-/~
.
~
----Fakulti Kej Elektro:-1k 'a:1 Ker KOI':'111Juter {FKEKK) Unrver•itl Tekr.fka' Malays1a Meleka (UTeM),
Karung 8ef1(:.Jnci 1200, Ayer Keroh, 75-450 Melaka
iii
"I hereby declare that this report is the result of my own work except for quotes as
cited in the references."
Signature: ....
t2t4. ...
.
...
.
..
..
.
..
... .
"I hereby declare that I have read this report and in my opinion this report is sufficient in terms of scope and quality for the award of Bachelor of Electronic
Engineering (Industrial Electronics) with honours."
Signature : . . . .LUA~~-:-:
Supervisor's Name: ... ?n .. ~.~'f:Y.I.~/'J!':f.; .... ~ ... . Date : ....
Lr.(~?::
..
..
..
..
...
.
...
.
...
.
v
I dedicated this to both of my parents, my family,
VI
ACKNOWLEDGEMENT
Special thanks to my supervisor, En. Nurulfajar Bin Abdul Manap for his
support, idea, knowledge and sharing his experience to fulfill the objective of this
final year project. With his support I gain knowledge from this project. I have
learned a lot of project management skill which include the time and cost effective to
realize the project.
Also thanks to my project group members, for spending times helping me to
realize the project.
Also thanks to my friend for spending their time teaching me about the
programming, which seems to be very difficult for me to understand before. Million
thanks to all of my friends that giving me so much supports to accomplished this
project.
vii
ABSTRACT
This project was purposed to develop a set of soccer robot consisting of two
players for each two teams. The robots are controlled by wireless controller through
radio frequency (RF). The robots can moved forward, backward, left, right and
360-degree turns. Each robot is equipped with RF receiver so that the movements can be
controlled from the wireless controller that equipped with RF transmitter. The robot
system is built from PIC as the controller for the whole system. In order to
accomplish the project, several methods have been taken starting from gathering all
information about the mobile robot, designed and tested the hardware and software
for the robot, develop the software and hardware and combining both software and
hardware. The software for the project consists of developing a programming to
control the movements of the robot. The hardware part consists of the motor driver
circuit and robot body. By the end of the project, a set of robot to play soccer is
viii
ABSTRAK
Projek ini adalah bertujuan untuk membangunkan satu set robot untuk
bermain bola sepak yang mengandungi dua robot pemain untuk setiap dua pasukan.
Robot-robot ini dikawal dengan pengawal tanpa wayar melalui radio frekuensi (RF).
Robot- robot ini boleh bergerak ke hadapan, ke kiri, ke kanan dan membuat pusingan
360 darjah. Setiap robot dilengkapi dengan penerima RF supaya pergerakan robot
dapat dikawal melalui pengawal tanpa wayar yang dilengkapi dengan pemancar RF.
Keseluruhan sistem robot ini dikawal melalui PIC. Untuk melaksanakan projek ini,
beberapa cara dan pendekatan telah diambil bermula dengan mengumpul semua
maklumat yang berkaitan dengan robot mobil, mereka serta menguji bahagian
struktur mekanikal dan perisian, seterusnya membangunkan bahagian-bahagian
tersebut. Sahagian perisian melibatkan pembinaan program untuk mengawal
pergerakan robot. Bahagian struktur mekanikal melibatkan pembinaan litar kawalan
motor dan bahagian badan robot. Di akhir projek ini, satu set robot untuk bermain
TABLE OF CONTENTS
CHAPTER SUBJECT
TITLE
APPROVAL
ACKNOWLEDGEMENT
ABSTRACT
ABSTRAK
TABLE OF CONTENTS
TABLE LIST
FIGURE LIST
APPENDICES LIST
I INTRODUCTION
1.1 PROJECT BACKGROUND
1.2 OBJECTIVES
1.3 SCOPES OF PROJECT
1.4 PROBLEM STATEMENTS
1.5 CHAPTER SUMMARY
ll LITERATURE REVIEW
2.1 INTRODUCTION
2.2 BASIC MOBILE ROBOT DEVELOPMENT
CONCEPT
2.3 MICROCONTROLLER
2.4 PIC I 6F84A
X
2.4.1 Peripheral Features 7
2.4.2 Pin Diagram of PIC 16F84 7
2.5 PROGRAMMING 9
2.5.1 Assembly Language (ASM) 10
2.5.2 C Programming 11
2.5.3 Visual Basic 13
2.6 MOTOR 14
2.6.1 De Motor 14
2.6.2 Servo Motor 18
2.7 H-BRIDGE 20
2.8 SOFTWARE 26
2.8.1 SourceBoost IDE 27
2.8.2 Proteus VSM 6 Professional 27
2.9 POWER SUPPLY 28
m
PROJECT METHODOLOGY3.1 INTRODUCTION 30
3.2 PROJECT OVERVIEW 30
3.3 HARDWARE DESIGN AND DEVELOPMENT 33 3.3.1 Robot Movements 33
3.3.2 Chassis and Wheels 35
3.3.3 De Motor 36
3.3.4 PIC16F84A 38
3.3.5 ICL293D 39
3.3.6 Motor Gear System 41
3.3.7 Power Supply 42
3.3.8 Batteries 44
3.5 PROGRAMMlNG DEVELOPMENT 3.5.1 Programming
IV RESULT, ANALYSIS AND DISCUSSION
4.1 INTRODUCTION
4.2 MOTOR DRIVER CIRCUIT
4.3 SIMULATION RESULT OF THE MOTOR
DRIVER CIRCUIT
4.4 DEVELOPING THE CIRCUIT ON PCB BOARD
4.5 POWER SUPPLY CIRCUIT
4.6 SOCCER ROBOT MECHANICAL STRUCTURE
4.7 COMPLETE SOCCER ROBOT
4.8 DISCUSSION
V CONCLUSION AND SUGGESTIONS
5.1 CONCLUSION
5.2 SUGGESTIONS
VI REFERENCE
xi
46
48
50
50
52
54
56
59
61
63
64
65
XII
TABLE LIST
NO
SUBJECT PAGExiii
FIGURE LIST
NO SUBJECT PAGE
2.1 Pin Diagram ofPIC16F84A 8
2.2 PIC 16F84A block diagram. 9
2.3 Basic part of the DC Motor 15
2.4 The operation of DC motor 16
2.5 Servo Disassembled 19
2.6 H-Bridge circuit using switch 21
2.7 H-bridge circuit using transistor 22
2.8 H-Bridge with diodes 24
2.9 V(voltage) vs t (time) for DC Motor 25
2.10 V(voltage) vs t (time) for DC Motor 25
2.11 L293D and L6202 26
2.12 The comparison flow using Proteus and
Traditional design tools 28
2.13 Typical Battery Life Chart 29
3.1 The illustrate ofthe whole systems of soccer robot 31
3.2 Process Flow Chart of Robot Motor drive
System and Robot Design 32
3.3 Skid steering 34
3.4 Robot chassis 35
3.5 Robot wheels 36
3.6 Double gearbox and two DC motors 37
3.7 liP and 0/P port ofthe PIC16F84A 38
xiv
3.9 Block diagram of L293D 39
3.10 LM293D Pin connections 40
3.11 Connection between L293B and PIC 16F84A 41
3.12 Type of gear system 42
3.13 LM7805 voltage regulator 43
3.14 Power supply block diagram 43
3.15 Power supply circuit diagram 44
3.16 9 Volt Battery 44
3.17 9.6 Rechargeable Volt Battery 45
3.18 Flow Chart ofthe Programming 47
3.19 Burning Process 49
4.1 Motor Driver Schematic Diagram 51
4.2 Simulation for Both Motor Forward 52
4.3 Simulation for Left Motor Backward, Right Motor Forward 53
4.4 Simulation for Left Motor Forward, Right Motor Backward 53
4.5 PCB Layout for Motor Driver Circuit 54
4.6 Motor Driver Circuit Layout on PCB board 55
4.7 Completed Motor Driver Circuit on PCB 56
4.8 Power Supply Circuit 56
4.9 Power Supply Simulation Result 57
4.10 Power Supply PCB Layout 58
4.11 Complete Power Supply Circuit on PCB 58
4.12 Completed Power Supply and Motor Driver Circuit 59
4.13 Mechanical Structure of Soccer Robot 60
XV
APPENDICES LIST
NO
SUBJECT PAGECHAPTER I
INTRODUCTION
1.1 Project Background
A robot is comprised of mechanical, electronic, electrical and sensory system [1].
The mechanical system of a robot incorporates mechanisms for locomotion and physical
support structure. Motors and drive train composed of gears, shaft and hubs provides
support for all system components [2]. An electronic system is implemented to control the mechanical system and the motion of the robot [3].
The project purposed was to develop a set of soccer robot consisting of two
players for each two teams. The robots are controlled by wireless controller through
radio frequency (RF). Each robot is equipped with a receiver and it will receive signal
from the transmitter at the controller. Two controllers are used to control the robots. One
controller controlled a team which means each controller controls two robots but only
one robot at a time. The robots are controlled to move forward, left, right and 360
-degree turn. The robots' motor drive system is controlled by PIC. The signal will be
transmitted from the controller transmitter to the receiver of the robot. The receiver is
2
from the transmitter. The microcontroller programming determine the robot movements
by referring to the signal that is received at the receiver.
1.2 Objectives
Project Objectives:
1. To develop and design a set of robot to play soccer by using PIC.
2. To develop and design robots that can move forward, backward, left, right and
360-degree turn.
1.3 Scopes of Project
The scope of this project is concentrated on the material (hardware and
programming) decision and specification including designing method such as circuit,
programming and robot chassis for the locomotion hardware and control. In this project,
four units' soccer robots will be developed and it will be separated into two teams. Each
controller can control two units of robot, but it can only control one robot at a time.
The project scope covers the selection of suitable motors by gathering their
information, concept and principle. For this project, DC motor has been chosen as the
drive train for the robot movement. The DC motors will connect to the microcontroller
which is PIC16F84A. Then a program is developed for each direction that has been
3
1.4 Problem Statements
Most of the soccer robot is autonomous or semi-autonomous [4]. It is less fun
because it moves by itself. Besides that, certain soccer robots are using more than two
wheels. This causes the robot to take a long time in doing rotation movements. Problems
often occur in wired robot due to broken wires, difficulties in system placement and
movement poor adaptation [5].
Wired remote control or tethered control can be the right way to interface a
computer with a stationary robot [6]. For mobile robots, the cable can become a burden
to the robot. Furthermore, the electric signal transferred over a wire loses energy because
of the wire's resistances. The result is that the amplitude of the signal decreases as
distance increases.
Reflection also can be a problem when the data rate is high. This means a
previous signal doesn't disappear before the next is transmitted. This is why
transmission lives are 'terminated' with a resistor to ground.
Mechanical issues with cables also become problems to wired robot. Cables have
fixed number of wires in them, so if we need more cables, we have to replace the whole
cable, which can be very time consuming. Cables also have certain stiffness. The thicker
the cable, the more force we need to apply to bend the cable. Another problem with
wired robot is the cables have weight. This makes it hard for smaller robots to drag
around. A part from that, the cable can get in the way of the robot. So, this project
proposes a wireless system soccer robot where all wires and cables can be eliminated.
1.5 CHAPTER SUMMARY
CHAPTER I will describe the definition of this project will be explained in this
4
CHAPTER II will discuss about research and information which are related to this
project. Every fact and information are gained from different references will be discussed
so that the best technique and method can be implemented on this project.
CHAPTER III will be describing how this project is separated to small partition.
The elements which are used to build each circuit are described by concept and theory.
Plus, figures are provided to ensure the understanding.
CHAPTER IV is describing about the project result and outcome discovery. The
project outcome discovery will be presented from the many data analysis results.
The fmal chapter, CHAPTER V will be explaining about the conclusion of the
whole project which includes project finding, achievement analysis and conclusion about
the research implementation which have been used. The project suggestion for
CHAPTER
II
LITERATURE REVIEW
2.1 Introduction
The literature review of this project consists of the theory and application of the
basic components that are used to meet the objective of this project. There have been
many investigations in the field of robotics of the concept that were used in building mobile robot locomotion. These includes the DC motor concept, mobile robot locomotion and the wheel positioning encoding, microcontroller, C programming, and language application software. All these aspects, components, specifications, technical data, theory and their functions need to be understood thoroughly as guidance in designing and developing the soccer robot's locomotion hardware and the control.
2.2 Basic Mobile Robot Development Concept
5
needed. Next is focusing on what objective is required by the mobile robot. Then, a block
diagram of the whole system can be sketched out to plan the whole robot system.
Therefore, how many input and output system of the robot will be used can be known
from the plan. Next is to determine how each input and output will interact with each
other by using microcontroller or programmable PIC. Then, the component that will be
used such as DC motor, transmitter, receiver and PIC circuit are defmed.
Most of the article review on the drive system of the robots states that most robots come from many categories such as two wheeled, four wheeled and others. From this
review, it helps to choose the suitable drive trains for the robots.
2.3 Microcontroller
A microcontroller is essentially an inexpensive single-chip computer [6]. Single
chip means the entire computer system lies within the confmes of a silver silicon
encapsulated inside the plastic housing of an integrated circuit. The rnicrocontroller has features similar to those of standard personal computer. The microcontroller contains
CPU (central processing unit), RAM (random access memory), ROM (read-only
memory), 110 (input/output) lines, serial and parallel ports, timers and sometimes other
built-in peripherals such as analog to digital (AID) and digital-to-analog (D/A)
converters. The key feature however is the rnicrocontroller's capability of uploading,
storing and running a program [6].
Being inexpensive single-chip computers, microcontrollers are easy to embed into larger electronic circuit designs. Their ability to store and run unique programs makes
them extremely versatile. For instance, one can program a rnicrocontroller to make decisions and performs functions based on situations (110 line logic) and events. The
math and logic functions allow the microcontroller mimic sophisticated logic and
6
There are several microcontrollers that exist nowadays. The STAMP
microcontroller only has a single byte PORT. It has eight pins which may be
reconfigured to be outputs or inputs. By changing the number of visible pins, any
combination of input and output pins can be obtained, up to a maximum of eight. Generic
microcontroller does not exist in reality but demonstrates the theory and practice of
microcontrollers. It has eight digital input pins, eight analog input pins and sixteen digital
output pins. PIC microcontroller is a family of Harvard architecture microcontrollers
made by Microchip Technology, derived from the PIC1650 originally developed by
General Instrument's Microelectronics Division.
PIC are popular with developers and hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re-programming with flash memory) capability.
2.4 PIC16F84A
The PIC 16F84A is a high-performance, low-cost, CMOS, fully-static 8-bit
microcontroller with 1K x 14 EEPROM program memory and 64 bytes of EEPROM data
memory. It is the second member of an enhanced family ofPIC16CXX microcontrollers.
Its high performance is due to instructions that are all in single word (14-bit
wide), which execute in single cycle (400 ns at lOMHz clock) except for
program-branches which take tow cycles (800ns). The PIC16C84 has four interrupt sources and an
eight level hardware stack. The peripherals include an 8-bit timer/counter with an 8- bit
prescaler (effectively a 16 bit timer) and 13 bi- directional I/0 pins. The high current
drive (25 rnA max. sink, 20 rnA max source) ofthe I/0 pins help reduce external drivers
and therefore, system cost. The PIC16C84 product is supported by an assembler, an
in-circuit emulator and a production quality programmer. These tools are supported on the
2.4.1 Peripheral Features
• 13 110 pins with individual direction control
• High current sink/source for direct LED drive 25 rnA sink max. per pin
• 20 rnA source max. per pin
• 8-bit real time clock/counter (RTCC) with 8-bit programmable prescaler
• Special Microcontroller Features
- Power-on reset
-Power up timer
-Oscillator start-up timer
7
- Watchdog timer (WDT) with its own on-chip RC oscillator for reliable
operation
-Security EPROM fuse for code-protection
- Power saving SLEEP mode
-User selectable oscillator options:
• RC oscillator: RC
• Crystal/resonator: XT
• High speed crystal/resonator: HS
• Power saving low frequency crystal: LP
- Serial, In-System Programming (ISP) of EPROM program memory using
only two pins
2.4.2 Pin Diagram of PIC16F84A
The 18-pin 16F84 chip devotes 13 of its pms to 110. Each pm may be
independently programmed as an input or output. The pin's status (I/0 direction control)
may also be changed on the fly via programming. Other features include power on reset,
power-saving sleep mode, power-up timer and code protection. Figure 2.1 shows the pin
PDIP, SOJC
RA2
-RA3 -RA41TOCKI
-MCLR
-vss
-RBOnNT -RB1
-RB2 -RB3 -SSOP RA2 -RA3 -RA4ITOCKI -MCLR
-vss
-vss
-RBOilNT
-RB1 -RB2 -RB3 -"'tJ 0 ~ en
,
cot
- RA1- RAO
- - -OSC11Cl.KIN
....---. OSC2/CLKOUT
----.voo
- RB7
- R B6
- RBS
- RB4
- RA1
- RAo
~oSC1fCLKIN
- OSC2/CLKOUT
- voo ---voo
- RB7
- RB6
- RBS
[image:24.520.104.390.39.467.2]- R84
Figure 2.1: Pin Diagram ofPIC16F84A
8
The PIC16F84A belongs to the mid-range family of the microcontroller devices.