Академический Документы
Профессиональный Документы
Культура Документы
PROJECT REPORT
Design &Design
Implementation
of FPGA Based
& Implementation of FPGA
Robotic
ArmArm
Control
Based Robotic
Control
PROJECT ADVISOR
ENGR. TAUHEED-UR-REHMAN
PROJECT TEAM
2006-EE-04
2006-EE-10
MEHRAN ZAFAR
2006-EE-24
SESSION
2006-2010
Page i
PROJECT REPORT
PROJECT TEAM
MUHAMMAD MAJID ALTAF
2006-EE-04
2006-EE-10
MEHRAN ZAFAR
2006-EE-24
INTERNAL EXAMINER
__________________________________
Engr. Tauheed-ur-Rehman
Lecturer EED, UCE&T BZU, Multan
H.O.D.
__________________________________
Engr. Nek Muhammad
Page ii
PROJECT REPORT
To
Our beloved Parents, Teachers &
Friends
For their patience and understanding
Page iii
PROJECT REPORT
DECLARATION
We declare that the data in this Robotic arm controlling through FPGA report is not
our work only; it is pirated to some extent.
It is our own effort and hard work, no other person helps us in collecting data for
this Robotic arm controlling through FPGA report.
This report is not copied from any other report, but the motivation was given by my
honored teacher
Engr. TAUHEED-UR-REHMAN.
Page iv
PROJECT REPORT
ACKNOWLEDGEMENT
The whole praise to almighty ALLAH, Creator of the universe, who made us the
Super Creature, blessed us with Knowledge and able to Accomplish the Work.
We are indebted to our class fellows and friends who have helped, inspired, and
given moral support and encouragement, in various ways, in completing this task.
I owe a special debt to my honored and respected Teacher Engr. TAUHEEDUR-REHMAN for his support, sacrifices, patience, understanding and
encouragement during the completion of this Feasibility Report. We also thanks to
ENGR. ADIL BASHIR whose guidance was always a source of encouragement
for us.
We are pleased to acknowledge the helpful comments and suggestions provided
by faculty of
Page v
PROJECT REPORT
ABSTRACT
Page vi
PROJECT REPORT
LIST OF FIGURES
13
15
15
20
22
27
27
28
29
30
33
33
35
36
36
37
39
40
41
41
42
42
Page vii
PROJECT REPORT
43
43
44
46
52
54
55
56
59
62
62
63
63
64
64
65
66
66
67
Page viii
PROJECT REPORT
TABLE OF CONTENTS
Chapter 1
ABSTRACT
vi
LIST OF FIGURES
vii
Introduction to Robotics
1.1
Robotics
1.2
Robotics Terminology
1.3
1.4
History of Robotics
1.5
Robotics Kinematics
1.5.1
1.5.2
1.5.3
1.6
1.7
Robotic Arm
1.8
Robotic Parts
1.9
6
6
1.10
1.11
Applications
1.10.1 Space Application of Robotic Arm
1.10.2 Bomb Disposal Applications of Robotic Arm
Robotics Future
8
8
9
10
1.12
11
1.9.2
Chapter 2
Robot Sensors
Robot Terminologies
12
Page ix
2.1
Chapter 3
3.1
3.2
3.3
3.4
Chapter 4
4.1
PROJECT REPORT
Robot Terminologies
12
16
16
3.1.1
17
3.1.2
18
3.1.3
18
Control Mechanism
18
3.2.1
18
3.2.2
19
3.2.3
19
A Gateway to FPGA
20
3.3.1
20
3.3.2
Final Conclusion
22
Modeling Language
22
3.4.1
23
3.4.2
Advantage of HDL
23
3.4.3
Hardware Description
Servo Motors
26
26
26
27
4.1.3 Construction
27
28
Page x
4.2
4.3
PROJECT REPORT
28
29
29
What Is FPGA?
30
31
32
34
39
39
41
44
45
47
48
What is VHDL?
4.3.1 A Brief History of VHDL
50
51
4.4
Chapter 5
54
55
57
57
Hardware Implementation
58
5.1
58
5.2
Servo Motor
59
60
60
Page xi
Hardware Design
PROJECT REPORT
60
61
61
64
5.4
65
5.5
67
Future Developments
68
APPENDIX A
69
APPENDIX B
76
REFRENCES
79
Chapter 6
Page xii
PROJECT REPORT
CHAPTER 1
INTRODUCTI`ON TO ROBOTICS
1.1 Robotics
Robotics is the branch of technology that deals with the design, construction,
operation, structural disposition, manufacture and application of robots. Technically
defining robot is a reprogrammable multi functional manipulator designed to do
functions generally assigned to human beings i.e., moving objects from one place to
another, repairing parts, tools etc. through programmed motions so that the robots
perform a variety of tasks. Precisely speaking robots are general purpose
reprogrammable workers with inbuilt sensors that perform various assembly tasks.
Robotics brings together several very different engineering areas and skills.
There is metalworking for the body. There is mechanics for mounting the wheels on
the axles, connecting them to the motors and keeping the body in balance. You need
electronics to power the motors and connect the sensors to the controllers. At last
you need the software to understand the sensors and drive the robot.
1.2 Robotics Terminology
Isaac Asimov popularized the term robotics; robots do not threaten humans since
Asimov invented the three laws of robotics:
1) A robot may not harm a human or, through inaction, allow a human to come to
harm.
2) A robot must obey the orders given by human beings, except when such orders
conflict with the First Law.
3) A robot must protect its own existence as long as it does not conflict with the First
or Second Laws.
Page 1
PROJECT REPORT
PROJECT REPORT
Page 3
PROJECT REPORT
Cartesian/Gantry robots
Cylindrical robots
Spherical robots
SCARA robots
Articulated robots (robotic arms)
Parallel robots
2. Wheeled robots
3. Legged robots
4. Swimming robots
5. Flying robots
6. Mobile spherical robots (robotic balls)
Page 4
PROJECT REPORT
The end effector can be designed to perform any desired task such as welding,
gripping, spinning etc., depending on the application. For example robot arms in
automotive assembly lines perform a variety of tasks such as welding and parts
rotation and placement during assembly.
Page 5
PROJECT REPORT
Base
Shoulder
Elbow
Wrist
Tool-plate
End-effectors
PROJECT REPORT
1.9.2
Robot Sensors
Robots under computer control interact with a variety of sensors, which
are small electronic or Electro-mechanical components that allow the robot to react
to its environment. Some common sensors are described below.
Vision
A vision system has a computer-controlled camera that allows the robot to
see its environment and adjust its motion accordingly. Used commonly in
electronics assembly to place expensive circuit chips accurately through holes in the
circuit boards. Note that the camera is actually under computer control and the
computer sends the signals to the robot based upon what it sees.
Voice
Voice systems allow the control of the robots using voice commands. This
is useful in training Robots when the trainer has to manipulate other objects.
Tactile
Tactile sensors provide the robot with the ability to touch and feel. These
sensors are used for measuring applications and interacting gently with the
environment.
Force/Pressure
Force/pressure sensors provide the robot with a sense of the force being
applied on the arm and the direction of the force. These sensors are used to help the
robot auto-correct for misalignments, or to sense the distribution of loads on
irregular geometry. Can also measure torques, or moments, which are forces acting
through a distance. Can be used in conjunction with haptic interfaces to allow the
human operator to feel what the robot is exerting on the environment during teleoperation tasks.
Proximity
Proximity sensors allow the robots to detect the presence of objects that
are very close to the arm before the arm actually contacts the objects. These sensors
are used to provide the robot with a method of collision avoidance.
Limit Switches
Limit switches may be installed at end-of-motion areas in the workspace to
automatically stop the robot or reverse its direction when a move out-of-bounds is
attempted; again, used to avoid collisions.
Other Sensors
Encoder measures angle
Potentiometer measures angle or length
Page 7
1.10
PROJECT REPORT
Applications
The robotic arm comes under the type of the robots that is the stationary
robots. It has a lot of uses depending on the type (Cartesian, cylindrical, spherical
and so on as mentioned above). Some of the uses of the robotic arm along with the
type of the robotic arm is given below.
Cartesian Robot /Gantry Robot: Used for pick and place work, application
of sealant, assembly operations, handling machine tools and arc welding. It's a
robot whose arm has three prismatic joints, whose axes are coincident with a
Cartesian coordinator.
Cylindrical Robot: Used for assembly operations, handling at machine tools,
spot welding, and handling at die-casting machines. It's a robot whose axes
form a cylindrical coordinate system.
Spherical/Polar Robot: Used for handling at machine tools, spot welding,
die-casting, fettling machines, gas welding and arc welding. It's a robot whose
axes form a polar coordinate system.
SCARA Robot: Used for pick and place work, application of sealant,
assembly operations and handling machine tools. It's a robot which has two
parallel rotary joints to provide compliance in a plane.
Articulated Robot: Used for assembly operations, die-casting, fettling
machines, gas welding, arc welding and spray painting. It's a robot whose arm
has at least three rotary joints.
Parallel Robot: One use is a mobile platform handling cockpit flight
simulators. It's a robot whose arms have concurrent prismatic or rotary joints.
1.10.1 Space Application of Robotic Arm
The application of robotic arm is the mobile serving system. The Mobile
Servicing System (MSS), better known by its primary component Canadarm2, is a
robotic arm system and associated equipment on the International Space Station.
Page 8
PROJECT REPORT
The squad operates the robotic arm through wireless connection and the
camera interfaced at the arm provides the vision of the bomb. This is the very best
Page 9
PROJECT REPORT
application of the robotic arm in the countries like Pakistan and Afghanistan. It
can save lives if used by the experienced persons.
1.11
Robotics Future
Page 10
1.12
PROJECT REPORT
Improvements of the quality, robustness, smaller size and reduced cost of camera,
laser range, ultrasonics, radar, and inertial sensors.
Improvements in computational power at low cost. This aspect will not need any
special attention because of existing market forces.
Improvement in mechanisms for robot platforms in terms of weight, strength, and
capability and the use of new materials, including ceramics, carbon fiber, titanium
etc.
Improvements in navigation algorithms including natural landmark based
approaches, recovery mechanisms, accommodation of varying cost structures
related to navigability, collision risk, visibility etc.
Improvements of Human/Machine cooperation, including communication, task
refinement, intervention etc.
Improvement in risk assessment and endurance in terms of operational times and
graceful degradation.
Clarification of legal aspects of humans and robots working together.
Better understanding of emotional aspects of robots working with humans.
Evolution of the robot/biology cross-inspirational trend.
Development of robotic ethics.
Page 11
PROJECT REPORT
CHAPTER 2
ROBOT TERMINOLOGIES
Robot arms come in all shapes and sizes. The arm is the part of the robot
that positions the end-effecter and sensors to do their pre-programmed business.
Many (but not all) resemble human arms, and have shoulders, elbows, wrists, even
fingers. This gives the robot a lot of ways to position itself in its environment.
In robotics several specific terminologies are used to describe certain
conditions and components. In this chapter we are going to include some important
terminologies used for the robotic arm design for a particular application.
PROJECT REPORT
Control Device: An instrument that allows a person to have control over a robot or
automated system for times such as startup or an emergency.
Control Program: The control information built into the robot or automated system
that allows for possible behaviors. The control information is not expected to be
altered.
Degree of Freedom: The degree of freedom, or DOF, is a very important term to
understand. Each degree of freedom is a joint on the arm, a place where it can bend
or rotate or translate. You can typically identify the number of degrees of freedom
by the number of actuators on the robot arm. A simple robot arm with 3 degrees of
freedom could move in 3 ways: up and down, left and right, forward and backward.
Most working robots today have 6 degrees of freedom. Humans have many more
and some robots have 8, 12, or even 20 degrees of freedom, but these 6 are enough
for most basic tasks. As a result, most jointed-arm robots in use today have 6
degrees of freedom. Figure below shows a robot with 3 Degree of Freedom
configuration because it is simple, yet isnt limiting in its ability.
Drive Power: Actuators convert this source of energy into usable energy for the
robot's movement.
End-Effector: Any object attached to the robot flange (wrist) that serves a function.
This would include robotic grippers, robotic tool changers, robotic crash protection,
robotic rotary joint, robotic press tooling, compliance device, robotic paint gun,
robotic arc welding gun etc. End effector is also known as robotic peripheral,
robotic accessory, robot or robotic tool, end of arm (EOA) tooling, or end-of-arm
device. End effector may also be hyphenated as "end-effector.
End-effector space: The area of the robot's end-effector movement with respect to
its base. (Common Misspellings: end-effecter space, end-affecter space, end-affecter
space).
Page 13
PROJECT REPORT
Joint: The device which allows relative motion between two adjoining links in a
robot. A robot joint is a mechanism that permits relative movement between parts of
a robot arm. The joints of a robot are designed to enable the robot to move its endeffectors along a path from one position to another as desired.
Joint Motion: A way to regulate the joint's movement so that all reach the specified
position at the same time.
Jointed Arm Robot: The arm of the robot has two junctions allowing for rotation
and enhanced movement much like a person's shoulder and elbow on their arm.
Link: A rigid piece of material connecting joints in a robot.
Motion axis: The line defining the axis of motion either linear or rotary, of a
segment of a manipulator.
Reach: The distance from the center of the robot to the fullest extension of the
robotic arm. The work envelope is determined from this distance.
Robot Workspace: The robot workspace (sometimes known as reachable space)
is all places that the end effector (gripper) can reach. The workspace is dependent
on the DOF angle/translation limitations, the arm link lengths, the angle at which
something must be picked up at, etc. The workspace is highly dependent on the
robot configuration.
Now lets assume that all joints rotate a maximum of 180 degrees,
because most motors cannot exceed that amount. To determine the workspace, trace
all locations that the end effector can reach as in the image below.
Page 14
PROJECT REPORT
Now rotating that by the base joints another 180 degrees to get 3D, we
have this workspace image. Remember that because it uses servos, all joints are
limited to a max of 180 degrees. This creates a workspace of a shelled semi-sphere
(its a shape because I said so).
If you change the link lengths you can get very different sizes of
workspaces, but this would be the general shape. Any location outside of this space
is a location the arm cant reach. If there are objects in the way of the arm, the
workspace can get even more complicated.
Sensing: Most robot arms only have internal sensors, such as encoders. But for
good reasons you may want to add additional sensors, such as video, touch, haptic,
etc. A robot arm without video sensing is like an artist painting with his eyes closed.
Using basic visual feedback algorithms, a robot arm could go from point to point on
its own without a list of preprogrammed positions. Giving the arm a red ball, it
could actually reach for it (visual tracking and servoing). If the arm can locate a
position in X-Y space of an image, it could then direct the end effector to go to that
same X-Y location (by using inverse kinematics).
Swing: A robot's rotational movement with respect to its centerline.
Yaw: The side-to-side motion of the end-effector's rotation at an axis.
Page 15
PROJECT REPORT
CHAPTER 3
IMPLEMENTATION PLAN FOR
ROBOTIC ARM
After a broad theoretical study regarding project next step was to select
hardware components and coding techniques. A comparison was made between
different methods and actuators to finally select the best suited for the project.
Process of selection went through following steps:
Page 16
PROJECT REPORT
Characteristics
Servo Motor
Stepper Motor
Flexibility in
motor resolution
Torque to Inertia
Ratio
Efficiency
Noise
Resonance and
Vibration
Page 17
Power Range
PROJECT REPORT
PROJECT REPORT
Who is Winner?
For general application, microcontroller is good enough for system
implementation. However, in some critical arithmetic processing such as DSP
algorithm would need real-time processing that is time critical. In this case, FPGA
would be the best solution.
Who Is Winner?
Although again choice between them is Particular design dependent but
still FPGA has more flexibility, speed and provide Faster Time to Market solution
as compared to microprocessor
3.2.3
Page 19
PROJECT REPORT
Who Is Winner?
In general, FPGAs can contain large digital designs, while CPLDs
can contain small designs only. The choice between CPLDs and
FPGAs depend upon specific application.
Page 20
PROJECT REPORT
Time Until
Running
Very Long
Long
Time to High
Performance
Very Long
Long
ASIC
Custom Processor
DSP
FPGA
Generic
Low Medium
Low Medium
Short
Short
Short
Not Attainable
Short
Short
Page 21
Relaxability
Speed
Technology
PROJECT REPORT
3.3.2
Final Conclusion
Using these simple guidelines, an intelligent choice can be made about the
best platform to choose, and also which hardware device to select based on these
assumptions. The nice aspect of most synthesis software packages is that multiple
design platforms can be tested for performance and utilization (e.g. PLD or
FPGA) prior to making a final decision on the hardware of choice.
3.4.1
PROJECT REPORT
Page 23
3.4.3
PROJECT REPORT
This section compares and contrasts individual aspects of the two languages; they
are listed in alphabetical order.
1. Data types
VHDL A multitude of language or user defined data types can be used. This
may mean dedicated conversion functions are needed to convert objects
from one type to another.
Verilog Unlike VHDL, all data types used in a Verilog model are defined by
the Verilog language and not by the user.
2. Design reusability
VHDL Procedures and functions may be placed in a package so that they are
avail able to any design-unit that wishes to use them.
Verilog There is no concept of packages in Verilog. Functions and
procedures used within a model must be defined in the module.
3. Easiest to learn
Verilog Starting with zero knowledge of either language, Verilog is probably
the easiest to grasp and understand.
VHDL may seem less intuitive at first for two primary reasons. First, it is
very strongly typed; a feature that makes it robust and powerful for the
advanced user after a longer learning phase. Second, there are many ways to
model the same circuit, especially those with large hierarchical structures.
4. Compilation
VHDL multiple design units (entity/architecture pairs), that reside in the same
system file, may be separately compiled if so desired.
The Verilog language is still rooted in its native interpretative mode.
Compilation is a means of speeding up simulation, but has not changed the
original nature of the language.
5.
Page 24
PROJECT REPORT
6. Language extensions
Although the use of language extensions will make a model non standard and
most likely not portable across other design tools. However, sometimes they
are necessary in order to achieve the desired results.
VHDL has an attribute called 'foreign that allows architectures and
subprograms to be modeled in another language.
7.
Libraries
VHDL A library is a store for compiled entities, architectures, packages
and configurations. Useful for managing multiple design projects.
Verilog There is no concept of a library in Verilog. This is due to it's
origins as an interpretive language.
Page 25
PROJECT REPORT
CHAPTER 4
HARDWARE DESCRIPTION
In this chapter we explain a brief theory about the selections we made
about our project.
Page 26
PROJECT REPORT
4.1.3 Construction
The servo motor has some control circuit and a potentiometer that is
connected to the output shaft. Potentiometer allows the control circuitry top monitor
the current angle of the servo motor. If the circuit finds that angle is not correct
direction until the angle is correct. If the shaft is at the correct angle, it shuts off.
The output shaft of the servo is capable of rotating some where around 180 degrees.
Page 27
PROJECT REPORT
PROJECT REPORT
Page 29
PROJECT REPORT
Page 30
PROJECT REPORT
Page 31
PROJECT REPORT
Because video processing requires processing large data in high speed and
make these types of applications are very suitable for FPGA that is capable of
parallel processing.
Since the user can determine the hardware structure of FPGAs, you can
program FPGA to process larger data with few clock cycles. But this is not
possible with the processor. Because data flow is limited by processor bus (16-bit,
32 bit, etc.) and the processing speed. As a result, applications that require more
performance such as intensive data processing FPGA has come to the fore, and
processor / microcontroller has come to the fore for routine control operations.
Nevertheless, processors / microcontrollers can be embedded into the FPGA
since they are logic circuits in fact.
Thus it possible to define and use processor and user-specific hardware
functions on only one chip by using FPGA. This solution gives engineers the
opportunity to control the hardware because of its great flexibility. You can
modify and update whole design (FPGA on the processor and other logic circuits)
by only changing the code on FPGA, without any change on circuit board layout.
PROJECT REPORT
PROJECT REPORT
within a CPLD may or may not be fully connected. In other words, some of the
theoretically possible connections between logic block outputs and inputs may not
actually be supported within a given CPLD. The effect of this is most often to
make 100% utilization of the macrocells very difficult to achieve. Some hardware
designs simply won't fit within a given CPLD, even though there are sufficient
logic gates and flip-flops available. Because CPLDs can hold larger designs than
PLDs, their potential uses are more varied. They are still sometimes used for
simple applications like address decoding, but more often contain highperformance control-logic or complex finite state machines. At the high-end (in
terms of numbers of gates), there is also a lot of overlap in potential applications
with FPGAs.
Traditionally, CPLDs have been chosen over FPGAs whenever highperformance logic is required. Because of its less flexible internal architecture, the
delay through a CPLD (measured in nanoseconds) is more predictable and usually
shorter. The development of the FPGA was distinct from the SPLD/CPLD
evolution just described. FPGAs offer the highest amount of logic density, the
most features, and the highest performance. The largest FPGA now shipping, part
of the Xilinx Vertex line of devices, provides eight million "system gates" (the
relative density of logic). These advanced devices also offer features such as builtin hardwired processors (such as the IBM Power PC), substantial amounts of
memory, clock management systems, and support for many of the latest, very fast
device-to-device signaling technologies.
FPGAs are used in a wide variety of applications ranging from data
processing and storage, to instrumentation, telecommunications, and digital signal
processing. The value of programmable logic has always been its ability to
shorten development cycles for electronic equipment manufacturers and help them
get their product to market faster. As PLD (Programmable Logic Device)
suppliers continue to integrate more functions inside their devices, reduce costs,
and increase the availability of time-saving IP cores, programmable logic is
certain to expand its popularity with digital designers
Page 34
PROJECT REPORT
PROJECT REPORT
PROJECT REPORT
Typical erase/program times: some milliseconds per cell / about 0.1 msec. per
cell
3. Static Memory Technology (SRAM)
Similar to the technology used in static RAM devices but with a few
modifications. The RAM cells in a memory device are designed for fastest
possible read/write performance. The RAM cells in a programmable device are
usually designed for stability instead of read/write performance. Consequently,
RAM cells in a programmable device have a low-impedance connect to VCC and
ground to provide maximum stability over voltage fluctuations.
Because static memory is volatile (i.e.-the contents disappear when the power
is turned off), SRAM-based devices are "booted" after power-on. This makes
them in-system programmable and re-programmable, even in real-time. As a
result, SRAM-based FPGA is common in reconfigurable computing applications
where the device's function is dynamically changed.
The configuration process typically requires only a few hundred milliseconds
at most. Most SRAM-based devices can boot themselves automatically at poweron much like a microprocessor. Furthermore, most SRAM-based devices are
designed to work with either standard byte-wide PROMs or with sequential-access
serial PROMs.
SRAM based memory cell is shown in figure. The entire cell comprises a multi
transistor SRAM storage element whose output drives an additional control
transistor. Depending on the contents of the storage element (logic 0 or logic 1),
the control transistor will be either OFF (disabled) or ON (enabled).
This is the most widely used technology. SRAM cells are also used in
many non-volatile CPLDs to hold some configuration bits to reduce internal
capacitive loading.
Typical data retention time: only at stable power-on (volatile)
Typical erase/program cycles: unlimited
Typical erase/program times: about some milliseconds / milliseconds.. minutes
for whole chip (depends on ROM-interface)
Page 37
PROJECT REPORT
Page 38
Technology
PROJECT REPORT
Volatile
Re-Prog
Chip Area
R (ohm)
C (FF)
Static RAM
Yes
In circuit
1 -2 K
10-20 FF
No
No
300 - 500
3-5 FF
Vialink AntiFuse
No
No
Anti-fuse--- small
prog. Trans.--- large
50 - 60
3-5 FF
EPROM
No
Out of circuit
Small
2-4k
10-20 FF
EEPROM
No
Out of circuit
2x EPROM
2-4k
10-20 FF
Large
----
PROJECT REPORT
Each CLB consists of n-input Lookup table and a pair of programmable flip flops.
I/O blocks also control functions such as tri-state control, output transition speed.
Interconnects provide routing path. Direct interconnects between adjacent logic
elements have smaller delay compared to general purpose interconnect
Row Based Architecture
Row based architecture shown in figure consists of alternating rows of
logic modules and programmable interconnect tracks. Input output blocks is
located in the periphery of the rows. One row may be connected to adjacent rows
via vertical interconnect. Logic modules can be implemented in various
combinations. Combinatorial modules contain only combinational elements which
Sequential modules contain both combinational elements along with flip flops.
This sequential module can implement complex combinatorial-sequential
functions. Routing tracks are divided into smaller segments connected by anti-fuse
elements between them.
Hierarchical PLDs
This architecture is designed in hierarchical manner with top level
containing only logic blocks and interconnects. Each logic block contains number
of logic modules. And each logic module has combinatorial as well as sequential
functional elements. Each of these functional elements is controlled by the
programmed memory. Communication between logic blocks is achieved by
programmable interconnects arrays. Input output blocks surround this scheme of
logic blocks and interconnects. This type of architecture is shown in figure.
Page 40
PROJECT REPORT
Page 41
PROJECT REPORT
Each logic block input pin can connect to any one of the wiring segments
in the channel adjacent to it. Each logic block output pin can connect to any of the
wiring segments in the channels adjacent to it. (In the usual FPGA terminology,
then, Fc = the number of tracks per channel, W). The figure below should make
the situation clear.
Page 42
PROJECT REPORT
Similarly, an I/O pad can connect to any one of the wiring segments in the
channel adjacent to it. For example, an I/O pad at the top of the chip can connect
to any of the W wires (where W is the channel width) in the horizontal channel
immediately below it.
The FPGA routing is un-segmented. That is, each wiring segment spans
one logic block before it terminates in a switch box. By turning on some of the
programmable switches within a switch box, longer paths can be constructed.
Page 43
PROJECT REPORT
wires in track number 2 connect only to other wires in track number 2 and so on.
The figure below illustrates the connections in a switch box.
There are four types of wire routing segments available:
General purpose segments, the ones that pass through switches in the switch
block.
Direct interconnect : ones which connect logic block pins to four surrounding
connecting blocks
long line : high fan out uniform delay connections
Clock lines: clock signal provider which runs all over the chip.
Switch box topology is used in the FPGAs. A switch box exists at the
junction of vertical and horizontal lines in the FPGA. The switch box allows the
dedicated path between two different logic blocks performing different operations.
A switching block and its location is shown in the above figure.
PROJECT REPORT
uses some of the logic cells as RAM as a distributed RAM. For the same purpose,
Block RAMs in Altera FPGAs are shared in different sizes.
PROJECT REPORT
popular as designs have become more complex and the language-based tools have
improved. The overall process of hardware development for programmable logic
is shown in Fig. and described in the paragraphs that follow. Perhaps the most
striking difference between hardware and software design is the way a developer
must think about the problem. Software developers tend to think sequentially,
even when they are developing a multithreaded application. The lines of source
code that they write are always executed in that order, at least within a given
thread. If there is an operating system it is used to create the appearance of
parallelism, but there is still just one execution engine. During design entry,
hardware designers must think-and program-in parallel. All of the input signals
are processed in parallel, as they travel through a set of execution engines-each
one a series of macrocells and interconnections-toward their destination output
signals. Therefore, the statements of a hardware description language create
structures, all of which are "executed" at the very same time.
PROJECT REPORT
PROJECT REPORT
o The most popular one is the Platform Cable USB (and its PDF).
o Xilinx parallel cable is called Parallel cable III.
About parallel cables: a parallel cable connects to your PC's parallel (printer)
port. It buffers a few pins of the PC parallel interface, and connects to the target board
using a flat cable or flying leads. The parallel cable is an active device and needs power.
It is usually powered from the target FPGA board. FPGA vendors sometimes provide the
schematic of the cable, which is valuable if you want to build a cable yourself.
PROJECT REPORT
JTAG primary purpose is to allow a computer to take control of the state of all the
device pins on a board. In turn, this allows all device-to-device combinations on the board
to be tested. Standard JTAG commands can be used for this purpose.
FPGAs are JTAG-aware and so all the FPGA IO pins can be controlled from the JTAG
interface. FPGAs add the ability to be configured through JTAG (using proprietary JTAG
commands).
Page 49
PROJECT REPORT
Altera pin
Direction
name
data
data0
input to the
configuration data bit
FPGA
clk
dclk
Pin function
prog_b nConfig
init_b
nStatus
done
output
When high, indicates that the FPGA is configured (in
ConfDone from the
user-mode).
FPGA
Note: the init_b and done pins are actually open-collector pins, so pull-up
resistors are required on these. Also if multiple FPGAs are to be configured, these pins
are usually connected together on all FPGAs, so that all the FPGAs switch into "usermode" together. There is many more details, so for a complete description, check your
FPGA datasheet. Among all the ways to download the VHDL design to FPGA we
selected the JTAG method for downloading.
PROJECT REPORT
description languages, which are to some extent defined in an ad hoc way by the
behavior of tools that use them. VHDL is an international standard, regulated by
the IEEE. The definition of the language is non-proprietary.
VHDL divides entities (components, circuits, or systems) into an external
or visible part (entity name and connections) and an internal or hidden part (entity
algorithm and implementation). After you define the external interface to an
entity, other entities can use that entity when they all are being developed. This
concept of internal and external views is central to a VHDL view of system
design. An entity is defined, relative to other entities, by its connections and
behavior. You can explore alternate implementations (architectures) of an entity
without changing the rest of the design.
After you define an entity for one design, you can reuse it in other designs
as needed. You can develop libraries of entities to use with many designs or a
family of designs.
Page 51
Year
1981
1983-85
1986
1987
1987
1994
PROJECT REPORT
Achievements
Initiated by US DoD to address hardware life-cycle crisis
Development of baseline language by Intermetrics, IBM and TI
All rights transferred to IEEE
Publication of IEEE Standards
Mil Std 454 requires comprehensive VHDL descriptions to be
delivered with ASICs
Revised standard (named VHDL 1076-1993)
Table 4-2 History of VHDL
PROJECT REPORT
Page 53
PROJECT REPORT
Page 54
PROJECT REPORT
Algorithm
A pure algorithm consists of a set of instructions that are executed in
sequence to perform some task. A pure algorithm has neither a clock nor detailed
delays. Some aspects of timing can be inferred from the partial ordering of
operations within the algorithm. Some synthesis tools (behavioral synthesis) are
available that can take algorithmic VHDL code as input.
RTL
An RTL description has an explicit clock. All operations are scheduled to
occur in specific clock cycles, but there are no detailed delays below the cycle
level. Commercially available synthesis tools do allow some freedom in this
respect. A single global clock is not required but may be preferred. In addition,
retiming is a feature that allows operations to be re-scheduled across clock cycles,
though not to the degree permitted in behavioral synthesis tools.
Gates
A gate level description consists of a network of gates and registers
instanced from a technology library, which contains technology-specific delay
information for each gate.
PROJECT REPORT
3. Simulate the design by using a VHDL simulator and verify that the
description is correct.
4. Using Foundation Express, synthesize and optimize the VHDL design
descriptions into a gate-level netlist.
Foundation Express generates optimized netlists to satisfy timing
constraints for a targeted FPGA architecture.
5. Using your Foundation development system, link the FPGA technologyspecific version of the design to the VHDL simulator.
The development system includes simulation models and interfaces
required for the design flow.
6. Simulate the technology-specific version of the design with the VHDL
simulator.
You can use the original VHDL simulation drivers from Step 2, because
module and port definitions are preserved through the translation and
optimization processes.
7. Compare the output of the gate-level simulation (Step 6) against the
output of the original VHDL description simulation (Step 3) to verify that
the implementation is correct.
PROJECT REPORT
Page 57
PROJECT REPORT
CHAPTER 5
HARDWARE IMPLMENTATION
FPGA, servo motors were combined through an interface to produce motion.
FPGA gives instructions in form of signals and servo motors follow the
instructions moving in accordance to the signals indicated by the FPGA. Few
characteristics of the FPGAs and servo motors are as follows.
Page 58
PROJECT REPORT
Features
Very low cost, high-performance logic solution for high-volume, costconscious applications
Dual-range VCCAUX supply simplifies 3.3V-only design
Suspend, Hibernate modes reduce system power
Multi-voltage, multi-standard Select IO interface pins
Up to eight Digital Clock Managers (DCMs)
Page 59
PROJECT REPORT
3 Pole Ferrite
Bearing type
66 x 30 x 58 mm
Weight
152 g
5.2.2
HS-645 Mg Servo
The powerful HS-645MG is one of Hitecs most popular servos. Its the
perfect choice for those larger sport planes or monster trucks and buggies
requiring a durable high torque servo. Featuring our unique M/P and metal gear
train technology, the HS-645MG offers one of the strongest gear trains available
in any servo.
Some of the motor specifications are given below:
Motor Type
3 Pole Ferrite
Bearing type
Speed4.8/6
Size
Weight
55g
5.2.3
HS-475HB SERVO
Is a durable and reliable servo that features one ball bearing and Karbonite
gear train. Karbonite is four times stronger than the standard nylon gears and even
after hundreds of thousands of cycles it will not show any signs of wear . With
single ball bearing, and powerful motor, the HS-475HB offers plenty of torque and
speed, and a sweet price. It's the perfect choice for any application where more
speed and torque are needed from a standard size servo.
Page 60
PROJECT REPORT
Motor Type
Dimensions
Weight
1.4oz (39g)
1. User control
Manual Control
o Select the motor that is the be moved by the FPGA
o Increase the Pulse width (Duty cycle) using increment switch
or Decrease the Pulse width using the decrement switch
Automatic Control
o Take the states and the sequence as defined in the program
2. Take the motor pulse width from the part one and create a pulse of the
duration as specified by the PCM Variable for each motor.
5.3.1
Input to FPGA
Input was given to FPGA with the help of slide switches and push buttons
at the bottom of FPGA and clock was used for synchronization. These buttons
can represent the binary value that is 0 or 1.
Slide switches
The Spartan 3A/3AN FPGA Starter Kit board has four slide switches, as
shown in figure. The slide switches are located in the lower right corner of the
board and are labeled SW3 through SW0. Switch SW3 is the left-most switch,
and SW0 is the right-most switch.
Page 61
PROJECT REPORT
Page 62
PROJECT REPORT
Clock sources
Clocks are used to produce synchronization for the generation of pulses.
The Spartan-3A/3AN Starter Kit board supports three primary clock input
sources, as shown.
The board includes an on-board 50 MHz clock oscillator.
Clocks can be supplied off-board via an SMA-style connector.
Alternatively, the FPGA can generate clock signals or other high-speed
signals on the SMA-style connector.
A 133 MHz clock oscillator is installed in the CLK_AUX socket.
Optionally substitute a separate eight-pin DIP-style clock oscillator in the
provided socket.
We selected 50 MHz clock oscillator for use in our program. The board
includes a 50 MHz oscillator with a 40% to 60% output duty cycle. The
oscillator is accurate to 2500 Hz or 50 ppm.
PROJECT REPORT
Page 64
PROJECT REPORT
Page 65
PROJECT REPORT
Here in figure vin 3.3V is the output of the FPGA. Whis is to be shifted to
5V and is given to the motors.
Vout is the output of the opto coupler that is isolated from the input or
FPGA output. R1 and R2 are small resistances of ohms and 220ohm
respectively. As the program downloaded in the FPGA uses the PWM. That
generates pulses of 3.3V that is shown in figure. Now these 3.3 V when given
to the opto coupler then pulse output for the motors is shown in figure.
PROJECT REPORT
Page 67
PROJECT REPORT
CHAPTER 6
FUTURE DEVELOPMENT
The application developed here in our project is just the pick and drop. We
can pick and drop using manual control and the automatic control. Here we will
discuss some improvements that can be made in this project. When using manual
control for pick and drop application we have selection mechanism. We used
switches located at FPGA to select a particular motor out of five in the robotic
arm. We used three switches to select one servo. Now here using this selection
mechanism only one motor can be operated at a time. More than one motor can
also be operated at the same time manually. But the need is to have nearly 10
switches/pushbuttons and of course we dont have too much switches. So here the
improvement that can be made is to use the receiver header of FPGA. The header,
that allows the pin connections from which we can give signals to FPGA. And by
designing an external control circuit containing buttons or switches that can give
control signals to FPGA and appropriate code for the PWM we can move all the
servos of robot at the same time, it means all the parts can be moved at the same
time. So in short there is a possibility to improve the manual pick and drop
application.
Secondly the most important field in robotics is the kinematics both
forward and reverse kinematics. In our project we didnt included them because
those are related to the physics of motion and is more related to the mechanical
engineering. But, for future improvement it should be included in the project.
Now if we consider the automatic control. Then this pick and drop
application can further be improved by using a camera on the top of wrist motor
of the robot. The FPGA as we know is batter suited for image processing. So
proper coding of FPGA and camera with the robot arm can be used to provide
color selection pick and drop application. Color sorting shape sorting and similar
to these applications can be developed. Of course the better coding can made the
robotic arm intelligent. That is the need today.
Page 68
PROJECT REPORT
APPENDIX A
VHDL Code for Robotic Arm Control
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Servo_Timing is
Port (
Clock : in STD_LOGIC;
s1,s2 : in STD_LOGIC;
sel0, sel1, sel2,sel3: in STD_LOGIC;
Pulse1 : out STD_LOGIC;
Pulse2 : out STD_LOGIC;
Pulse3 : out STD_LOGIC;
Pulse4 : out STD_LOGIC;
Pulse5 : out STD_LOGIC
);
end Servo_Timing;
architecture Behavioral of Servo_Timing is
signal width1 :Integer range 100 to 500;
signal width2 :Integer range 100 to 500;
signal width3 :Integer range 100 to 500;
signal width4 :Integer range 300 to 1500;
signal width5 :Integer range 100 to 500;
begin
process(Clock)
variable w1: integer range 100 to 500:=190;
variable w2: integer range 100 to 500:=280;
variable w3: integer range 100 to 500:=280;
variable w4: integer range 300 to 1500:=1100;
variable w5: integer range 100 to 500:=320;
variable tmp: integer range 0 to 499;
variable Counter : integer := 800000;
begin
if( rising_edge(Clock) ) then
counter:=counter-1;
if (counter=0) then
counter:=800000; -- execute hoe her 20ms ka bad
tmp:=tmp-1;
-- normal state
if (sel3='0' and sel0='1' and sel1='1' and sel2='1') then
w1:=190;
Page 69
PROJECT REPORT
w2:=280;
w3:=280;
w4:=1100;
w5:=320;
end if;
-- 1st servo control PWM-if (sel3='0' and sel0='0' and sel1='0' and sel2='0' and s1='1' and w1<420) then
-- this is done to ensure thar grip does not expand much so drop it from 480 to 420.
w1:=w1+1;
elsif(sel3='0' and sel0='0' and sel1='0' and sel2='0' and s2='1' and w1>185)
then
w1:=w1-1;
end if;
-- 2nd servo control PWM-if (sel3='0' and sel0='0' and sel1='0' and sel2='1' and s1='1' and w2<440) then
-- this is done to ensure that servo does not get grip out of limit upwords
w2:=w2+1;
elsif(sel3='0' and sel0='0' and sel1='0' and sel2='1' and s2='1' and w2>180)
then
w2:=w2-1;
end if;
-- 3rd servo control PWM-if (sel3='0' and sel0='0' and sel1='1' and sel2='0' and s1='1' and w3<460) then
w3:=w3+1;
elsif(sel3='0' and sel0='0' and sel1='1' and sel2='0' and s2='1' and w3>180)
then
w3:=w3-1;
end if;
-- 4th servo control PWM-if (sel3='0' and sel0='0' and sel1='1' and sel2='1' and s1='1' and w4<1280)
then -- this is dine that servo setup remins upwords
w4:=w4+1;
elsif(sel3='0' and sel0='0' and sel1='1' and sel2='1' and s2='1' and w4>960)
then
w4:=w4-1;
end if;
-- 5th servo control PWM-if (sel3='0' and sel0='1' and sel1='0' and sel2='0' and s1='1' and w5<480) then
w5:=w5+1;
elsif(sel3='0' and sel0='1' and sel1='0' and sel2='0' and s2='1' and w5>180)
then
w5:=w5-1;
end if;
if (sel3='1') then
case tmp is
Page 70
PROJECT REPORT
Page 71
PROJECT REPORT
Page 72
PROJECT REPORT
Sync2 := Sync_Start2;
Pulses2 := '1';
Pulse2 <= not Pulses2;
end if;
end if;
end if;
end process;
-- 3rd servo control PWM-process (Clock)
Variable Pulse_Count_Start3 : integer;
Variable Pulse_Count3
: integer;
Variable Sync3
: integer := 4000;
Variable Sync_Start3
: integer;
variable Counter3
: integer := 250;
variable Pulses3
: std_logic;
variable abc: integer;
begin
if( rising_edge(Clock) ) then
Counter3 := Counter3-1;
if( Counter3 = 0 ) then
Counter3 := 250;
if( Pulse_Count3 = 0) then
Pulses3 := '0';
Pulse3 <= not Pulses3;
if( Sync3 = 0) then
pulse_count_start3:=width3;
Pulse_Count3 := Pulse_Count_Start3;
else
Sync3 :=Sync3-1;
end if;
else
Pulse_Count3 := Pulse_Count3-1;
Sync_Start3 := 4000 - Pulse_Count_Start3;
Sync3 := Sync_Start3;
Pulses3 := '1';
Pulse3 <= not Pulses3;
end if;
end if;
end if;
end process;
-- 4th servo control PWM-process (Clock)
Variable Pulse_Count_Start4 : integer;
Variable Pulse_Count4
: integer;
Variable Sync4
: integer := 4000;
Page 73
Variable Sync_Start4
variable Counter4
variable Pulses4
PROJECT REPORT
: integer;
: integer :=250;
: std_logic;
begin
if( rising_edge(Clock) ) then
Counter4 := Counter4-1;
if( Counter4 = 0 ) then
Counter4 := 250;
if( Pulse_Count4 = 0) then
Pulses4 := '0';
Pulse4<= not Pulses4;
if( Sync4 = 0) then
pulse_count_start4:=width4/4;
Pulse_Count4 := Pulse_Count_Start4;
else
Sync4 :=Sync4-1;
end if;
else
Pulse_Count4 := Pulse_Count4-1;
Sync_Start4 := 4000 - Pulse_Count_Start4;
Sync4 := Sync_Start4;
Pulses4:= '1';
Pulse4 <= not Pulses4;
end if;
end if;
end if;
end process;
-- 5th servo control PWM-process (Clock)
Variable Pulse_Count_Start5 : integer;
Variable Pulse_Count5
: integer;
Variable Sync5
: integer := 4000;
Variable Sync_Start5
: integer;
variable Counter5
: integer := 250;
variable Pulses5
: std_logic;
begin
if( rising_edge(Clock) ) then
Counter5 := Counter5-1;
if( Counter5 = 0 ) then
Counter5 := 250;
if( Pulse_Count5 = 0) then
Pulses5 := '0';
Pulse5 <= not pulses5;
if( Sync5 = 0) then
pulse_count_start5:=width5;
Pulse_Count5 := Pulse_Count_Start5;
Page 74
PROJECT REPORT
else
Sync5 :=Sync5-1;
end if;
else
Pulse_Count5 := Pulse_Count5-1;
Sync_Start5 := 4000 - Pulse_Count_Start5;
Sync5 := Sync_Start5;
Pulses5 := '1';
Pulse5 <= not Pulses5;
end if;
end if;
end if;
end process;
end Behavioral;
Page 75
PROJECT REPORT
APPENDIX-B
HS 475-HB Standard Deluxe Servo
Operation voltage range
4.8 to 6.0 V
Test Voltage
4.8 V
Operating Speed
Stall Torque
4.4Kg.cm To 5.5Kg.cm
Idle Current
Running Current
Stall Current
900 mA To 1100 mA
Dead Bandwidth
5 usec
Direction
Motor Type
Potentiometer Type
Indirect Drive
Amplifier Type
22AWG
Weight
40g
Ball Bearing
Top/MR106
Gear Material
Page 76
PROJECT REPORT
HS-805BB Servo
Required Pulse
Operating Voltage
4.8-6.0 Volts
20 to +60 Degree C
0.19sec/60 at no load
0.14sec/60 at no load
Operating Angle
Direction
8usec
Motor Type
3 Pole Ferrite
Potentiometer Drive
Indirect Drive
Bearing Type
Gear Type
Page 77
PROJECT REPORT
Operating Voltage
4.8-6.0 Volts
0.24sec/60 at no load
0.20sec/60 at no load
Operating Angle
Direction
8usec
Motor Type
3 Pole Ferrite
Potentiometer Drive:
Indirect Drive
Bearing Type
Gear Type
Page 78
PROJECT REPORT
REFRENCES
Charles H. Roth, Jr. (1997) Digital System Design Using VHDL, PWS
Publishing Company, pp 265-283
Clive "Max" Maxfield, (2009), FPGA: World Class Design, pp 4-102
Douglas L. Perry, McGraw-Hill, (2002), VHDL: Programming by Example,
4th edition, pp 173-201
Steve Kilts, Wiley-IEEE, (2007), Advanced FPGA Design Architecture,
Implementation and Optimization, pp 37-46
Voleni A. Pedroni, (2004) Circuit Design with VHDL, MIT Press Cambridge,
Massachusetts, pp 13-84
http://www.crustcrawler.com
http://www.fpga4fun.com/
http://www.seattlerobotics.org/guide/servos.html
http://www.xilinx.com
Page 79