App 1934015024
App 1934015024
App 1934015024
ROBOTICS
■ 3-ROTATIONAL ARM ROBOT
Jason Damazo, Walla Walla College
FEATURES
■ SIMPLE ROBOTICS FRAME- ■ Discusses the major robot classifications including Wheeled Mobile Robots,
Legged Robots, and the Robotic Manipulator
WORK FOR RHINO ROBOT
ROBOTICS
V. Gourishankar
■ Provides an introduction to basic mechanics and electronics; presents math-
http://venkata83.com ematical modeling concepts; and performs robotic simulations using MATLAB
■ Includes extensive coverage of kinematics—integrated throughout the book
whenever appropriate
DEMOS ■ Includes a CD-ROM with demos, MATLAB simulations, photos, and more
■ PUMA 3D ROBOT DEMO
Don Riley, Walla Walla College
BRIEF TABLE OF CONTENTS
1. Introduction 2. Basic Mechanics 3. Basic Electronics 4. Wheeled
■ NEUROS ROBOT DEMO
Mobile Robots 5. Kinematics of Robotic Manipulators 6. Classification
Institut für Neuroinformatik
Ruhr-Universität Bochum of Sensors 7. Legged Robots. Appendix. Index.
(from the 3-ROTATIONAL ARM (from the PUMA (from the SIMPLE ROBOTICS
ROBOT) 3D ROBOT DEMO) FRAMEWORK FOR RHINO ROBOT)
ISBN: 978-1-934015-02-5
U.S. $59.95 / Canada $70.95 INFINITY SCIENCE PRESS
11 Leavitt Street
Hingham, MA 02043
(781) 740-4487
(781) 740-1677 FAX APPIN
info@infinitysciencepress.com KNOWLEDGE
www.infinitysciencepress.com SOLUTIONS
All trademarks and service marks are the property of their respective owners.
Cover design: Tyler Creative
E N G I N E E R I N G S E R I E S
The CD-ROM that accompanies this book may only be used on a single PC. This
license does not permit its use on the Internet or on a network (of any kind). By pur-
chasing or using this book/CD-ROM package(the “Work”), you agree that this license
grants permission to use the products contained herein, but does not give you the right
of ownership to any of the textual content in the book or ownership to any of the infor-
mation or products contained on the CD-ROM. Use of third party software contained
herein is limited to and subject to licensing terms for the respective products, and
permission must be obtained from the publisher or the owner of the software in order
to reproduce or network any portion of the textual material or software (in any media)
that is contained in the Work.
Infinity Science Press LLC (“ISP” or “the Publisher”) and anyone involved in
the creation, writing or production of the accompanying algorithms, code, or com-
puter programs (“the software”) or any of the third party software contained on the
CD-ROM or any of the textual material in the book, cannot and do not warrant the
performance or results that might be obtained by using the software or contents of the
book. The authors, developers, and the publisher have used their best efforts to insure
the accuracy and functionality of the textual material and programs contained in this
package; we, however, make no warranty of any kind, express or implied, regarding the
performance of these contents or programs. The Work is sold “as is” without warranty
(except for defective materials used in manufacturing the disc or due to faulty work-
manship);
The authors, developers, and the publisher of any third party software, and anyone
involved in the composition, production, and manufacturing of this work will not be
liable for damages of any kind arising out of the use of (or the inability to use) the algo-
rithms, source code, computer programs, or textual material contained in this publica-
tion. This includes, but is not limited to, loss of revenue or profit, or other incidental,
physical, or consequential damages arising out of the use of this Work.
The sole remedy in the event of a claim of any kind is expressly limited to replacement
of the book and/or the CD-ROM, and only at the discretion of the Publisher.
The use of “implied warranty” and certain “exclusions” vary from state to state, and
might not apply to the purchaser of this product.
ROBOTICS
APPIN KNOWLEDGE
SOLUTIONS
This publication, portions of it, or any accompanying software may not be reproduced in any way, stored
in a retrieval system of any type, or transmitted by any means or media, electronic or mechanical, includ-
ing, but not limited to, photocopy, recording, Internet postings or scanning, without prior permission in
writing from the publisher.
The publisher recognizes and respects all marks used by companies, manufacturers, and developers as
a means to distinguish their products. All brand names and product names mentioned in this book are
trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of service
marks or trademarks, etc. is not an attempt to infringe on the property of others.
7894321
Our titles are available for adoption, license, or bulk purchase by institutions, corporations, etc. For addi-
tional information, please contact the Customer Service Dept. at 877-266-5796 (toll free).
Requests for replacement of a defective CD-ROM must be accompanied by the original disc, your mailing
address, telephone number, date of purchase and purchase price. Please state the nature of the problem,
and send the information to Infinity Science Press, 11 Leavitt Street, Hingham, MA 02043.
The sole obligation of Infinity Science Press to the purchaser is to replace the disc, based on defective
materials or faulty workmanship, but not based on the operation or functionality of the product.
About the Authors
Appin Knowledge Solutions, with its Asia Pacific Headquarters in New Delhi, is an af-
filiate of the Appin Group of Companies based in Austin, Texas. Its many businesses
span software development, consulting, corporate training programs, and empowerment
seminars & products. Appin Knowledge Solutions is comprised of prominent industry
professionals, many from the University of Texas, Austin and the Indian Institute of
Technology, Delhi. The company has extensive experience working with Fortune 500
companies including Microsoft, AT&T, General Electric, & IBM. Appin Knowledge So-
lutions aims to bridge the gap between academia and industry by training people world-
wide in fields such as nanotechnology and information security through Appin Technol-
ogy Labs and its distance learning programs.
This book has been co-authored by the technical team at Appin Knowledge Solutions.
The group is headed by Rajat Khare and includes the following technology professionals:
Ashok Sapra, Ishan Gupta, Vipin Kumar, Anuj Khare, Tarun Wig, and Monika Chawla.
Table of Contents
About the Authors ................................................................................................ v
1. Introduction ....................................................................... 1
1.1 Introduction to Robotics .........................................................................................1
1.2 History of Robotics..................................................................................................2
1.3 Current Research in Robotics Around the World ...............................................10
1.4 Classification of Robotics ......................................................................................16
1.4.1 Robotic Arms ............................................................................................16
1.4.2 Wheeled Mobile Robots ...........................................................................16
1.4.3 Legged Robots .........................................................................................17
1.4.4 Underwater Robots ..................................................................................18
1.4.5 Flying Robots ............................................................................................19
1.4.6 Robot Vision ..............................................................................................19
1.4.7 Artificial Intelligence ................................................................................20
1.4.8 Industrial Automation...............................................................................22
1.5 An Overview of the Book ......................................................................................23
R
ecently there has been a lot of discussion about futuristic wars between
humans and robots, robots taking over the world and enslaving hu-
mans. Movies like The Terminator, Star Wars, etc., have propogated
these ideas faster than anything else. These movies are beautiful works of fic-
tion and present us with an interesting point of view to speculate. However,
the truth is much different but equally as interesting as the fiction. If you
look around yourself you will see several machines and gizmos within your
surroundings. When you use a simple pair of spectacles, do you become non-
living? When an elderly person uses a hearing aid or a physically challenged
person uses an artificial leg or arm do they become half machine? Yes, they do.
Now we are rapidly moving toward an era where we will have chips embedded
1
2 ROBOTICS
inside our bodies. Chips will communicate with our biological sensors and will
help us in performing several activities more efficiently. An artificial retina is
almost at the final stages of its development. Now we are thinking in terms of
nanobots helping us to strengthen our immune systems. Now we are already on
the verge of becoming half machine. Chips will be implanted inside our bodies
imparting telescopic and microscopic abilities in our eyes. Cell phones will be
permanently placed inside the ear. We will communicate with different devices
not through a control panel or keyboard; rather these devices will receive com-
mands from the brain directly. The next level of development will be the part
of the brain being replaced by chips, which will impart more capability to the
brain. You may ask, do we need all these? The answer is that the biological
evolution has already become obsolete. It is unable to keep pace with the rate
at which humans are growing. Many of our primary intuitions, such as mating
behavior, are still millions of years old. Evolution happens only after millions
of years. But humans have built the entire civilization in only 10,000 years.
And now the rate of growth has become exponential. Now we need to replace
our brain’s decision-making software with faster/better ones. So, where are we
heading? Yes, we are slowly becoming robots. Robots are not our competitors
on this planet. They are our successors. Robots are the next level in evolution;
rather we can call it robolution. We will begin our journey with a brief history
of robotics.
Our fascination with robots began more than 100 years ago. Looking back, it’s
easy to get confused about what is and is not a robot. Robotics’ history is tied to
so many other technological advances that today seem so trivial we don’t even
FIGURE 1.1
INTRODUCTION 3
FIGURE 1.2
Slaves of Steel
The first person to use the word robot wasn’t a scientist, but a playwright. Czecho-
slovakian writer Karel Capek first used the word robot in his satirical play, R.U.R.
(Rossum’s Universal Robots). Taken from the Czech word for forced labor, the
word was used to describe electronic servants who turn on their masters when
given emotions. This was only the beginning of the bad-mouthing robots would
receive for the next couple of decades. Many people feared that machines would
resent their role as slaves or use their steely strength to overthrow humanity.
Wartime Inventions
World War II was a catalyst in the development of two important robot com-
ponents i.e., artificial sensing and autonomous control. Radar was essential for
FIGURE 1.3
4 ROBOTICS
tracking the enemy. The U.S. military also created autocontrol systems for mine
detectors that would sit in front of a tank as it crossed enemy lines. If a mine was
detected, the control system would automatically stop the tank before it reached
the mine. The Germans developed guided robotic bombs that were capable of
correcting their trajectory.
FIGURE 1.4
INTRODUCTION 5
FIGURE 1.5
Industrial-strength Arms
As the demand for cars grew, manufacturers looked for new ways to increase
the efficiency of the assembly line through telecherics. This new field focused
on robots that mimicked the operator’s movements from a distance. In 1961
General Motors installed the applied telecherics system on their assembly line.
The one-armed robot unloaded die casts, cooled components, and delivered
them to a trim press. In 1978 the PUMA (Programmable Universal Machine
for Assembly) was introduced and quickly became the standard for commer-
cial telecherics.
FIGURE 1.6
6 ROBOTICS
FIGURE 1.7
Arms in Space
Once earthlings traveled to space, they wanted to build things there. One of
NASA’s essential construction tools is the Canadarm. First deployed in 1981
FIGURE 1.8
INTRODUCTION 7
FIGURE 1.9
aboard the Columbia, the Canadarm has gone on to deploy and repair satel-
lites, telescopes, and shuttles. Jet Propulsions Laboratories (JPL) in California
has been working on several other devices for space construction since the late
eighties. The Ranger Neutral Buoyancy Vehicle’s many manipulators are tested
in a large pool of water to simulate outer space.
Surgical Tools
While robots haven’t replaced doctors, they are performing many surgical tasks.
In 1985 Dr. Yik San Kwoh invented the robot-software interface used in the
first robot-aided surgery, a stereotactic procedure. The surgery involves a small
probe that travels into the skull. A CT scanner is used to give a 3D picture of the
brain, so that the robot can plot the best path to the tumor. The PUMA robots
are commonly used to learn the difference between healthy and diseased tissue,
using tofu for practice.
FIGURE 1.10
Hazardous Duties
As scientific knowledge grew so did the level of questioning. And, as with space
exploration, finding the answers could be dangerous. In 1994 the CMU Field
Robotics Center sent Dante II, a tethered walking robot to explore Mt. Spurr in
Alaska. Dante II aids in the dangerous recovery of volcanic gases and samples.
These robotic arms with wheels (a.k.a. mobile applied telecherics) saved count-
less lives defusing bombs and investigating nuclear accident sites. The range of
self-control, or autonomy, on these robots varies.
Solar-powered Insects
Some robots mimic humans, while others resemble lower life forms. Mark Til-
den’s BEAM robots look and act like big bugs. The name BEAM is an acronym
FIGURE 1.11
INTRODUCTION 9
FIGURE 1.12
A Range of Rovers
By the 1990s NASA was looking for something to regain the public’s enthu-
siasm for the space program. The answer was rovers. The first of these small,
semiautonomous robot platforms to be launched into space was the Sojourn-
er, sent to Mars in 1996. Its mission involved testing soil composition, wind
speed, and water vapor quantities. The problem was that it could only travel
FIGURE 1.13
10 ROBOTICS
FIGURE 1.14
short distances. NASA went back to work. In 2004, twin robot rovers caught
the public’s imagination again, sending back amazing images in journeys of
kilometers, not meters.
Entertaining Pets
In the late ’90s there was a return to consumer-oriented robots. The prolifera-
tion of the Internet also allowed a wider audience to get excited about robotics,
controlling small rovers via the Web or buying kits online. One of the real robotic
wonders of the late ’90s was AIBO the robotic dog, made by Sony Corp. Using
his sensor array, AIBO can autonomously navigate a room and play ball. Even
with a price tag of over $2,000, it took less than four days for AIBO to sell out
online. Other “pet robots” followed AIBO, but the challenge of keeping the pet
smart and the price low remains.
According to MSN Learning & Research, 700,000 robots were in the industrial
world in 1995 and over 500,000 were used in Japan, about 120,000 in Western
Europe, and 60,000 in the United States– and many were doing tasks that are
dangerous or unpleasant for humans. Some of the hazardous jobs are handling
material such as blood or urine samples, searching buildings for fugitives, and
deep water searches, and even some jobs that are repetitive—and these can run
24 hours a day without getting tired. General Motors Corporation uses these
robots for spot welding, painting, machine loading, parts transfer, and assembly.
INTRODUCTION 11
Assembly line robots are the fastest growing because of higher precision and
lower cost for labor. Basically a robot consists of:
(a) (b)
FIGURE 1.15 The older robots of the MIT leg Lab. (a) Quadruped demonstrated that two-legged
running algorithms could be generalized to allow four-legged running, including the trot, pace, and
bound. (b) The 3D biped hops, runs, and performs tucked somersaults.
12 ROBOTICS
the moon without radio communication might run into unexpected situations.
At a minimum, a planetary rover must have some source of sensory input, some
way of interpreting that input, and a way of modifying its actions to respond to
a changing world. Furthermore, the need to sense and adapt to a partially un-
known environment requires intelligence (in other words, artificial intelligence).
From military technology and space exploration to the health industry and com-
merce, the advantages of using robots have been realized to the point that they
are becoming a part of our collective experience and everyday lives.
Several universities and research organizations around the world are engaged
in active research in various fields of robotics. Some of the leading research or-
ganizations are MIT (Massachusetts Institute of Technology), JPL (Jet Propul-
sion Lab., NASA), CMU (Carnegie Mellon University), and Stanford University.
FIGURE 1.16 M2, a 3D bipedal walking robot that is currently being developed in the MIT Leg
Laboratory.
INTRODUCTION 13
These and many other organizations are involved in various fields of robotics.
These fields of robotics can be broadly categorized as:
■ Robotic Manipulator
■ Wheeled Mobile Robots
■ Legged Robots
■ Underwater Robots
■ Flying Robots
■ Robot Vision
■ Artificial Intelligence
■ Industrial Automation
The Leg Lab at MIT is dedicated to studying legged locomotion and build-
ing dynamic legged robots. They are specialists in exploring the roles of balance
and dynamic control. They are simulating and building creatures which walk,
run, and hop like their biological counterparts. The preceeding pictures show a
few of their research robots.
Jet Propulsion Laboratory is NASA’s lead center for creating robotic space-
craft and rovers. Robots can literally go where no person has gone before, to
other planets where the environments are not suitable for humans until we have
studied them in much greater detail. The robots and spacecraft we build are our
eyes and ears on these distant planets. The preceeding is a picture of a robot that
is being developed at JPL.
Carnegie Mellon University is another center that is involved in active
research of robotics. There are several robots that are being researched
FIGURE 1.19 Gyrover I, a single-wheel robot that is stabilized and steered by means of
an internal, mechanical gyroscope.
16 ROBOTICS
■ Robotic Manipulator
■ Wheeled Mobile Robots (WMR)
■ Legged Robots
■ Underwater Robots and Flying Robots
■ Robot Vision
■ Artificial Intelligence
■ Industrial Automation
FIGURE 1.20
INTRODUCTION 17
FIGURE 1.21
(i) Slider,
(ii) Liver, and
(iii) Wheel or track.
Out of the above three mechanisms, the first two are walking mechanisms,
and in these cases the robot moves on legs. So many robots have been designed
that follow the walking mechanism. Walking mechanisms have their own advan-
tages and they become more reasonable when moving on soft, uneven terrains.
FIGURE 1.22
18 ROBOTICS
■ Better mobility
■ Better stability on the platform
■ Better energy efficiency
■ Smaller impact on the ground
When choosing the mechanism for locomotion of a robot, one needs to keep
his eyes on the following factors:
(i) Periodic gaits: They repeat the same sequence of supporting leg configura-
tions.
(ii) Nonperiodic or free gaits: They do not have any periodicity in their gait
pattern.
FIGURE 1.23
FIGURE 1.24
20 ROBOTICS
Imager CCD
or CMOS
Laser
Diode
Collecting Joint
Lens
Laser Stripe
Part A Part B
Fig. 1 Laser Triangulation Principle
FIGURE 1.25
system uses. The two current technologies for creating vision sensors are CCD and
CMOS. These sensors have specific limitations in performance when compared to
the human eye. The vision-based sensors are discussed in detail in Chapter 6.
Schools of Thought
AI divides roughly into two schools of thought: Conventional AI and Computa-
tional Intelligence (CI). Conventional AI mostly involves methods now classified
as machine learning, characterized by formalism and statistical analysis. This is
also known as symbolic AI, logical AI, neat AI, and Good Old-Fashioned Artifi-
cial Intelligence (GOFAI). Methods include:
FIGURE 1.26
■ Case-based reasoning.
■ Bayesian networks.
■ Behavior-based AI: a modular method of building AI systems by hand.
better solutions to the problem. These methods most notably divide into
evolutionary algorithms (e.g., genetic algorithms) and swarm intelligence
(e.g., ant algorithms).
With hybrid intelligent systems attempts are made to combine these two
groups. Expert inference rules can be generated through neural network or
production rules from statistical learning such as in ACT-R. It is thought that
the human brain uses multiple techniques to both formulate and cross-check
results. Thus, integration is seen as promising and perhaps necessary for true
AI.
FIGURE 1.27
INTRODUCTION 23
This book includes different aspects of a robot in modules. It also explores the
different fields of robotics. Chapter 2 covers theory of machines and mecha-
nisms, introduction to gears and gear trains, kinematics analysis, and synthesis of
mechanisms. Section 2.6 covers a practical guide to using various mechanisms
in robotic projects.
Chapter 3 covers the basic introduction to electronics. It lays more stress on
the issues related to practical electronic circuit design without going into much
of the details of the theory. The chapter covers some fundamentals of sensors
and microcontrollers. Section 3.7 covers a practical guide to use Embedded C
programming for an 8051 microcontroller. It also covers how to use the parallel
port and the serial port of the computer to control a few devices using common
programming platforms like C++ and VB. Section 3.8 covers a basic introduction
to geared DC motors, stepper motors, and servo motors and practical circuits to
interface them with digital systems. Section 3.9 covers tips to use some common
things found in the neighborhood in projects.
NT
HE C
Chapter 4 goes into the details of wheeled mobile robots, their kinemat-
D
O
ics, mathematical modeling, and control. Section 4.5 covers the simulation of
wheeled mobile robots using ODE23 of MATLAB. A few examples will be pre-
sented. The simulation examples are also included on the CD-ROM. Section 4.6
covers the step-by-step construction of the hardware and software of an all-pur-
pose practical research WMR.
Chapter 5 covers the kinematics of robotic manipulators. The topics that
this chapter covers are, mapping of frames, forward kinematics, and inverse kin-
ematics. Chapter 5.5 includes the guide to make the hardware and software of a
two-link arm and a three-link robotic arm.
Chapter 6 talks about sensors that can be used in robots. Various sensors
such as digital encoders, infrared sensors, radio frequency sensors, sonar, active
beacons, digital compasses, acceleretometers, gyroscopes, laser rangefinders,
etc., will be discussed in this chapter. Section 6.12 includes two practical exam-
ples of making sensors and interfacing them with digital circuits.
Chapter 7 covers some basic fundamentals about legged robots. It discusses
the issues of static and dynamic balance, inverse pendulum model and the kine-
matics of leg design. The chapter includes a discussion about the gaits of various
legged animals found in nature. Section 7.6 covers the dynamic considerations
of leg design such as leg lengths and speed of travel, etc.
There is far more to learn about a cross-disciplinary field such as robotics
than can be contained in this single book. We hope that this will be enough to
place the reader in a comfortable position in the dynamic and challenging field
of robotics.
Chapter 2 BASIC MECHANICS
In This Chapter
• Introduction to Theory of Machines and Mechanisms
• Some Popular Mechanisms
• Gear and Gear Trains
• Synthesis of Mechanisms
• Kinematic Analysis of Mechanisms
• A Practical Guide to Use Various Mechanisms
A
mechanism is a device that transforms motion to some desirable pat-
tern and typically develops very low forces and transmits little power.
A machine typically contains mechanisms that are designed to pro-
vide significant forces and transmit significant power. Some examples of
typical mechanisms are a stapler, a door lock, car window wiper, etc. Some
examples of machines that possess motions similar to the mechanisms above
are an automobile engine, a crane, and a robot. There is no clear line of dif-
ference between mechanisms and machines. They differ in degree rather
than definition.
25
26 ROBOTICS
If a mechanism involves light forces and is run at slow speeds, it can some-
times be strictly treated as a kinematic device; that is, it can be analyzed kine-
matically without regard to forces. Machines (and mechanisms running at higher
speeds), on the other hand, must be first treated as mechanisms. A kinematic
analysis of their velocities and accelerations must be done and then they must
be treated as dynamic systems in which their static and dynamic forces due to
accelerations are analyzed using the principles of kinetics. Most of the applica-
tions in robotics involve motions at lower speeds and low or moderate forces are
involved. So we will restrict our discussion only to the kinematics of mechanisms
in this chapter. However, there are certain instances where the study of the dy-
namics becomes very essential in robotics. A discussion of those instances is
beyond the scope of this book.
Bar 2
Bar 3 Bar 1
3 2
Revolutes
4 1
The link opposite the frame is called the coupler link, and the links,
which are hinged to the frame, are called side links. A link, which is free
to rotate through 360 degrees with respect to a second link, will be said to
revolve relative to the second link (not necessarily a frame). If it is possible
for all four bars to become simultaneously aligned, such a state is called a
change point.
Some important concepts in link mechanisms are:
1. Crank: A side link, which revolves relative to the frame, is called a crank.
2. Rocker: Any link that does not revolve is called a rocker.
3. Crank-rocker mechanism: In a four-bar linkage, if the shorter side link
revolves and the other one rocks (i.e., oscillates), it is called a crank-rocker
mechanism.
4. Double-crank mechanism: In a four-bar linkage, if both of the side links
revolve, it is called a double-crank mechanism.
5. Double-rocker mechanism: In a four-bar linkage, if both of the side links
rock, it is called a double-rocker mechanism.
Grashof’s theorem states that a four-bar mechanism has at least one re-
volving link if
s + l <= p + q (2.1)
s + l > p + q. (2.2)
All four-bar mechanisms fall into one of the four categories listed in Table
2.1.
From Table 2.1 we can see that for a mechanism to have a crank, the sum
of the length of its shortest and longest links must be less than or equal to the
sum of the length of the other two links. However, this condition is necessary but
not sufficient. Mechanisms satisfying this condition fall into the following three
categories:
28 ROBOTICS
1. When the shortest link is a side link, the mechanism is a crank-rocker mech-
anism. The shortest link is the crank in the mechanism.
2. When the shortest link is the frame of the mechanism, the mechanism is a
double-crank mechanism.
3. When the shortest link is the coupler link, the mechanism is a double-rocker
mechanism.
B
Y
m
m 2
1
Y2
x
2
θ β
A m
X X C3 C 3
2
2 3 3
4
4 1
1
4
a b
a b c d
Basic Mechanics
Driven Driver
linker
Keep in mind that the inversion of a mechanism does not change the mo-
tions of its links relative to each other but does change their absolute motions.
FIGURE 2.6
BASIC MECHANICS 31
A good example of a ‘rack and pinion’ gear system can be seen on trains that
are designed to travel up steep inclines. The wheels on a train are steel and they
have no way of gripping the steel track. Usually the weight of the train is enough
to allow the train to travel safely and speed along the track. However, if a train
has to go up a steep bank or hill it is likely to slip backward. A ‘rack and pinion’
system is added to some trains to overcome this problem. A large gear wheel is
added to the center of the train and an extra track with teeth, called a ‘rack,’ is
added to the track. As the train approaches a steep hill or slope the gear is low-
ered to the track and it meshes with the ‘rack.’ The train does not slip backward
but it is pulled up the steep slope.
The railway system in Switzerland is probably the most advanced in the
world. The entire system is punctual and modern as a result of financial invest-
ment in railway building and locomotive technology. The cities and towns are
linked by fast, efficient trains running mainly on a electrified network. On the
other hand, the mountain trains rely on a combination of electrified track and
modern steam engines. The Swiss have been careful to develop a rail system that
is not only extremely efficient but also sensitive to the environment.
On such an incline, using a normal track is not practical as the locomotive
would simply slip backward, down the track. The Figure 2.7 below shows the typi-
cal ‘rack and pinion’ track system. The two outer rails are the same as any normal
rail track. However, the center track has teeth similar to those seen on a gear wheel
(this is called the ‘rack’). When the locomotive is required to go up a steep incline a
gear wheel (called the ‘pinion’) is lowered from the locomotive engine. This mesh-
es with the rack and pulls the locomotive and carriages up the steep slope.
Cam Crank
FIGURE 2.8 Cams and cranks.
A wheel and axle assembly becomes especially useful when gears and belts are
brought into the picture. Gears can be used to change the direction or speed of
movement, but changing the speed of rotation inversely affects the force trans-
mitted. A small gear meshed with a larger gear will turn faster, but with less
force. There are four basic types of gears: spur gears, ‘rack and pinion’ gears,
bevel gears, and worm gears. Spur gears are probably the type of gear that most
BASIC MECHANICS 33
people picture when they hear the word. The two wheels are in the same plane
(the axles are parallel). With ‘rack and pinion’ gears there is one wheel and one
‘rack’, a flat toothed bar that converts the rotary motion into linear motion. Bevel
gears are also known as pinion and crown or pinion and ring gears. In bevel
gears, two wheels intermesh at an angle changing the direction of rotation (the
axles are not parallel); the speed and force may also be modified, if desired.
Worm gears involve one wheel gear (a pinion) and one shaft with a screw thread
wrapped around it. Worm gears change the direction of motion as well as the
speed and force. Belts work in the same manner as spur gears except that they
do not change the direction of motion.
In both gears and belts, the way to alter speed and force is through the size
of the two interacting wheels. In any pair, the bigger wheel always rotates more
slowly, but with more force. This “tradeoff” between force and speed comes
from the difference in the distance between the point of rotation and the axle
between the two wheels. On both the big and the small gear, the linear velocity
at the point of contact for the wheels is equal. If it was unequal and one gear
were spinning faster than the other at the point of contact, then it would rip
the teeth right off of the other gear. As the circumference of the larger gear is
greater, a point on the outside of the larger gear must cover a greater distance
than a point on the smaller gear to complete a revolution. Therefore the smaller
gear must complete more revolutions than the larger gear in the same time span.
(It’s rotating more quickly.) The force applied to the outer surface of each wheel
must also be equal otherwise one of them would be accelerating more rapidly
than the other and again the teeth of the other wheel would break. The forces
of interest, however, are not the forces being applied to the outer surfaces of the
wheels, but rather the forces on the axles. Returning to the concept of levers, we
know that the distance at which the force is applied affects the force yielded, and
a wheel and axle works like a lever. Equal forces are being applied to each wheel,
but on the larger wheel that force is being applied over a greater distance. Thus
for the larger wheel the force on the axle is greater than the force on the axle for
the smaller wheel.
Gear Train
A gear train consists of one or more gear sets intended to give a specific velocity
ratio, or change direction of motion. Gear and gear train types can be grouped
based on their application and tooth geometry.
axis of rotation. These gears can only mesh correctly if they are fitted to parallel
axles.
Spur gears are inexpensive to manufacture. And they cause no axial thrust
between gears. Although they give lower performance, they may be satisfactory
in low-speed or simple applications.
degree of sliding friction between the meshing teeth, often addressed with
specific additives in the lubricant. Whereas spur gears are used for low-speed
applications and those situations where noise control is not a problem, the
use of helical gears is indicated when the application involves high speeds,
large power transmission, or where noise abatement is important. The speed
is considered to be high when the pitch line velocity (i.e., circumferential
velocity) exceeds 5,000 ft./min. or the rotational speed of the pinion (i.e.,
smaller gear) exceeds 3,600 rpm.
Worm Gear
Motor
Worm
Gear
Spur Gear
FIGURE 2.12
BASIC MECHANICS 37
The worm is always the driving gear. The worm gear can achieve a higher
gear ratio than spur gears of a comparable size. Designed properly, a built-in
safety feature can be obtained: This gear style will self-lock if power is lost to the
drive (worm). It doesn’t work if the pinion is powered.
ωd
ω3
ω2
ω1
1 2 3 4
a
ω 2
ωd
ω1
1 2 3 4
gear. Gear ‘A’ turns in a counter clockwise direction and also gear ‘C’ turns in a
counter clockwise direction. The ‘idler’ gear is used so that the rotation of the
two important gears is the same.
Velocity Ratio
We know that the velocity ratio of a pair of gears is the inverse proportion of the
diameters of their pitch circle, and the diameter of the pitch circle equals the
number of teeth divided by the diametric pitch. Also, we know that it is neces-
sary for the mating gears to have the same diametric pitch to satisfy the condition
of correct meshing. Thus, we infer that the velocity ratio of a pair of gears is the
inverse ratio of their number of teeth.
For the ordinary gear trains in Figure 2.13a, we have:
ω1 N2 ω2 N 3 ω3 N4
= = = . (2.3)
ω2 N1 ω3 N 2 ω4 N3
These equations can be combined to give the velocity ratio of the first gear
in the train to the last gear:
ω1 N 2 N 3 N 4 N 4 .
= = (2.4)
ω 4 N1 N 2 N 3 N1
NOTE
■ The tooth numbers in the numerator are those of the driven gears, and the
tooth numbers in the denominator belong to the driver gears.
■ Gear 2 and 3 both drive and are, in turn, driven. Thus, they are called idler
gears. Since their tooth numbers cancel, idler gears do not affect the magni-
tude of the input-output ratio, but they do change the directions of rotation.
Note the directional arrows in Figure 2.13. Idler gears can also constitute a
saving of space and money (if gear 1 and 4 mesh directly across a long center
distance, their pitch circle will be much larger).
■ There are two ways to determine the direction of the rotary direction. The
first way is to label arrows for each gear as in Figure 2.13. The second way is
to multiple mth power of “-1” to the general velocity ratio. Where m is the
number of pairs of external contact gears (internal contact gear pairs do not
change the rotary direction). However, the second method cannot be ap-
plied to the spatial gear trains.
Thus, it is not difficult to get the velocity ratio of the gear train in Figure
2.13b:
ω1 N N
= (−1)2 2 4 . (2.5)
ω4 N1 N 3
BASIC MECHANICS 39
Each of these solutions, while possible, may not be optimal or even practical.
More details need to be known about the problem to make that judgment. The
straight-line linkage may prove to be too large and to have undesirable accelera-
tions; the cam and follower will be expensive, though accurate and repeatable.
The air cylinder is inexpensive, but noisy and unreliable. The hydraulic cylinder
is more expensive as is the robot. The solenoid, while cheap, has high impact
loads and high impact velocity. So, you can see that the choice of the device type
can have a large effect on the quality of design. A poor design in the type synthe-
sis stage can create insoluble problems later on.
Dimensional Synthesis of a linkage is the determination of the propor-
tions (lengths) of the links necessary to accomplish the desired motion. It can be
a form of quantitative synthesis if an enough number of equations is available,
but can also be a form of qualitative synthesis. Dimensional synthesis of cams is
usually quantitative. However, dimensional synthesis of linkages is usually quali-
tative. Dimensional synthesis assumes that, through type synthesis, you have al-
ready determined that a linkage (or cam) is the most appropriate solution to the
problem. We will discuss some analytical and graphical dimensional synthesis of
linkages in the following sections of this chapter.
Number Synthesis of a linkage is done to determine the number and
order of links and joints necessary to produce motion of a particular DOF.
Link order in this context refers to the number of nodes per link, i.e., binary,
quaternary, ternary, etc. The value of number synthesis is to allow the exhaus-
tive determination of all possible combinations of links that will yield any
chosen DOF. This then equips the designer with a definitive catalog of poten-
tial linkages to solve a variety of motion-control problems. Using the number
synthesis method to determine all possible link configurations for one DOF
motion, we can arrive at the following conclusion. There is only one four-link
configuration, two six-link configurations, and five possibilities for an eight-
link configuration.
1. Crank: A side link, which revolves relative to the frame, is called a crank.
2. Rocker: Any link that does not revolve is called a rocker.
3. Crank-rocker mechanism: In a four-bar linkage, if the shorter side link
revolves and the other side rocks (i.e., oscillates), it is called a crank-rocker
mechanism.
You have to follow the following steps to design the above mechanism.
1. Draw the output link O4B in both extreme positions, B1 and B2 in any con-
venient location, such that the desire angle of motion θ4 is subtended.
2. Draw the chord B1B2 and extend it in either direction.
3. Select a convenient point O2 on line B1B2 extended.
4. Bisect line segment B1B2, and draw a circle of that radius about O2.
Link 3
Link 2
B1
B2
A2 A1
O2
θ4
O4
Your choice
Link 3
Link 2
B1
B2
A1
A2 Link 4
O2
Link 1
O4
Link 3
5. Label the two intersections of the circle B1B2 and extended A1 and A2.
6. Measure the length of the coupler as A1 to B1 or A2 to B2.
7. Measure ground length 1, crank length 2, and rocket length 4.
8. Find the Grashof condition. If non-Grashof, redo steps 3 to 8 with O2 further
from O4.
9. Make a cardboard model of the linkage and articulate it to check its func-
tions and its transmission angles.
10. You can input the file FO3-04.4br to program FOURBAR to see this exam-
ple come alive.
Note several things about this synthesis process. We started with the output
end of the system, as it was the only aspect defined in the problem statement.
We had to make many quite arbitrary decisions and assumptions to proceed be-
cause there were many more variables that we could have provided “equations”
for. We are frequently forced to make “free choices” of “a convenient angle or
length.” These free choices are actually definitions of design parameters. A poor
choice will lead to a poor design. Thus these are qualitative synthesis approaches
and require an iterative process, even for this simple an example. The first solu-
tion you reach will probably not be satisfactory, and several attempts (iterations)
should be expected to be necessary. As you gain more experience in designing
kinematics solutions you will be able to make better choices for these design pa-
rameters with less iteration. A simple cardboard model should be made after this
stage. You get the most insight into your design’s quality for the least effort by
making, articulating, and studying the model. Figure 2.14 represents the graphi-
cal synthesis method pictorially. It is much easier to understand this method
from the pictures.
The problem discussed here is one of the simplest synthesis problems. More
complicated synthesis can also be done using the above method. However, there
is a detailed analysis of which is beyond the scope of this book. The interested
reader can refer to texts of kinematics of mechanisms and theory of machines for
a detailed knowledge of the above topic.
The two-position graphical synthesis method is discussed in the following
example applied in a practical situation for clearer illustration.
FIGURE 2.15 Two points (red and gray) are chosen on the bin and plotted on the two desired
positions. This can be applied to transformations in a geometry classroom.
BASIC MECHANICS 45
logical extension of the method used in the previous section for two-position
synthesis. Compass, protector, and rule are the only tools needed in the graphi-
cal method.
Here we will design a four-bar linkage to move the link CD shown from posi-
tion C1D1 to C2D2 and then to position C3D3. Moving pivots are at C and D.
Note that while a solution is usually obtained for this case, it is possible that
you may not be able to move the linkage continuously from one position to the
next without disassembling the links and reassembling them to get them past a
limiting position. That will obviously be unsatisfactory. In the particular solution
presented in Figure 2.17, note that link 3 and 4 are in toggle at position one, and
46 ROBOTICS
Link 4 O4
O4
Link 4
D1
D1 Link 3
4 4
Link 3
C1 3 D2
C1 D2 C2
C2 D3
D3
3
2
C3 C3
Link 2 Link 2
2
FIGURE 2.17
link 2 and 3 are in toggle position at position three. In this case we will have to
drive link 3 with a driver dyad, since any attempt to drive either link 2 or link 4
will fail at the toggle positions. No amount of torque applied to link 2 at position
C1 will move link 4 away from point D1, and driving link 4 will not move link 2
away from position C3.
The position graphical synthesis method is discussed for a practical situation in the
following.
This method uses the same principle as the previous method, but it allows us
to prescribe one more position. This is good to account for not hitting the truck
cab, but bad because we constrain ourselves to using the two points determined
by the intersection of the two mid-normals. Do you think that it would be pos-
sible to prescribe 4 positions? Why or why not?
There are many other approaches to synthesize mechanisms. We have dis-
cussed the graphical synthesis method in this text. The graphical synthesis meth-
od is highly intuitive and depends heavily on the experience and expertise of the
person doing the synthesis. However, the graphical synthesis method becomes
exceedingly difficult for more than three-position synthesis. For problems in-
volving synthesis of more than three points, the analytical method is applied. The
analytical synthesis method is not discussed in this text. The purpose of this topic
is to introduce the idea of synthesis. The interested reader can refer to texts of
kinematics of mechanisms and theory of machines for a more rigorous study of
the above topic.
BASIC MECHANICS 47
FIGURE 2.18 Two points (red and gray) are chosen on the bin and plotted on the three desired
positions.
48 ROBOTICS
FIGURE 2.19
After the mechanism has been synthesized, it must be analyzed. A principal goal
of kinematic analysis is to determine the accelerations of all the moving parts in
the assembly, since dynamic forces are proportional to acceleration. We need to
know the dynamic forces in order to calculate the stresses in the components. In
order to calculate accelerations, we must first find the positions of all the links
or elements in the mechanism for each increment of input motion, and then
differentiate the position equations versus time to find velocities, and then to
differentiate again to obtain the expression for acceleration.
This can be done in several methods. We could use a graphical approach
to determine the position, velocity, and acceleration of the output links for all
180 positions of interest, or we could derive the general equations of motion
for any position, differentiate for velocity and acceleration, and then solve these
analytic expressions for our 180 (or more) crank rotations. A computer will make
this task much easier. If we choose the graphical approach to analysis, we have
to do an independent graphical solution for each of the positions of interest. In
contrast, once the analytical solution is derived for a particular mechanism, it
can be quickly solved (with a computer) for all positions. In this chapter, we will
discuss the graphical method and two analytical methods, namely the algebraic
method and the complex algebra method, for the position analysis of a few pla-
nar mechanisms.
Y
y B
3
A θ3 x 4
2 LNCS θ4
θ2
O2 X
O4 GCS
the angle of the input link. This is shown as θ2 in Figure 2.20. We want to find θ3
and θ4. The link lengths are known. Note that we will consistently number the
ground link as 1 and the driver link as 2 in these examples.
The graphical analysis of the problem is trivial and can be done using only
high school geometry. If we draw the linkage carefully to scale with rule, com-
pass, and protector in a particular position (given θ2), then it is only necessary to
measure the angles of links 3 and 4 with the protractor. Note that all link angles
are measured from a positive x-axis. In Figure 2.18, a local x-y axis system, paral-
lel to the global XY system, has been created at point A to measure θ3. The accu-
racy of this graphical solution will be limited by our care and drafting ability and
by the crudity of the protractor used. Nevertheless, a very rapid, approximate
solution can be found for any one position.
Figure 2.21 shows the construction of the graphical position solution.
The four link lengths a, b, c, d and the angle θ2 of the input link are given.
First, the ground link (1) and the input link (2) are drawn to a convenient
scale such that they intersect at the origin O2 of the global XY coordinate
system with link 2 placed at the input angle θ2. Link 1 is drawn along the x-
axis for convenience. The compass is set to the scale length of link 3, and an
arc of that radius swung about the end of link 2 (point A). Then the compass
is set to the scale length of link 4, and a second arc swung about the end of
link 1 (point θ4).
These two arcs will have two intersections at B and B’ that define the two
solutions to the position problem for a four-bar linkage that can be assembled
in two configurations, called circuits, labeled open and crossed in Figure 2.21.
Circuits in linkages will be discussed in a later section.
50 ROBOTICS
1
Y
Open
y B
θ3 3
b
A
θ3 x
a LNCS 4 θ4
θ2 θ4
2 1
X
d O4 GCS
3`
4`
Crossed
B`
FIGURE 2.21 Graphical position solution to the open and crossed
configurations of the four-bar linkage.
The angles of link 3 and 4 can be measured with a protractor. One circuit
has angles θ3 and θ4, the other θ3’ and θ4’. A graphical solution is only valid for
the particular value of input angle used. For each additional position analysis we
must completely redraw the linkage. This can become burdensome if we need
a complete analysis at every 1- or 2-degree increment of θ2. In that case we will
be better off to derive an analytical solution for θ3 and θ4, which can be solved
by computer.
Ax = a cos θ2
Ax = a sin θ2.
The coordinates of point B are found using the equations of circles about A
and O4
a 2 − b2 + c 2 − d 2 2 Ay By 2 Ay BY
Bx = − =S− (2.8)
2( A x − d ) 2( A x − d ) 2( A x − d)
Substituting equation 2.8 into 2.7 gives a quadratic equation in By, which has
two solutions corresponding to those in Figure 2.19.
⎛ Ay B y ⎞
B y + ⎜⎜ S − − d ⎟⎟ − c 2 = 0
2
(2.9)
⎝ Ax − d ⎠
This can be solved with the familiar expression for the roots of a quadratic
equation,
− Q ± Q 2 − 4PR
By = , (2.10)
2P
where:
AY 2
P= +1 (2.11)
(Ax − d )2
2 AY (d − S)
Q= (2.12)
Ax − d
R = (d – S2) – C2 (2.13)
a 2 − b2 + c 2 − d 2 .
S= (2.14)
2( A x − d)
Note that the solutions to this equation set can be real or imaginary. If the
latter, it indicates that the links cannot connect at the given input angle or at all.
Once the two values of By are found (if real), they can be substituted into equa-
tion 2.8 to find their corresponding x components. The link angles for this posi-
tion can then be found from
⎛ B − AY ⎞
θ 3 = tan − ⎜⎜ Y ⎟⎟ (2.15)
⎝ BX − AX ⎠
⎛ By ⎞
θ 4 = tan − ⎜⎜ ⎟⎟ . (2.16)
⎝ Bx − d ⎠
A two-argument arctangent must be used to solve the above equations
since the angles can be in any quadrant. The above can be encoded in any
52 ROBOTICS
computer language equation solver, and the value of θ2 varies over the linkage’s
usable range to find all corresponding values of the other two link angles.
Y θ3 y
B
R3
A
b R4
a Rs c
θ2 θ4
R3
O2 d
X
R1
ae jθ 2 − be jθ 3 − ce jθ 4 − de jθ1 = 0 (2.17)
Substitute the Euler equations:
We want to solve equation 2.18 simultaneously for the two unknowns, link
length d and link angle θ3. The independent variable is crank angle θ2. Link
lengths a and b, the offset c, and angle θ4 are known. But note that since we set
up the coordinate system to be parallel and perpendicular to the axis of the slider
block, the angle θ1 is zero and θ4 is 900. Equation 2.22 can be solved for θ3 and
the result substituted into equation 2.19 to solve for d. the solution is :
⎛ a sin θ 2 − c ⎞
θ 3 = arcsin ⎜ ⎟ (2.23)
⎝ b ⎠
1
Note that there are again two valid solutions corresponding to the two cir-
cuits of the linkage. The arcsine function is multivalued. Its evaluation will give a
value between + 900 representing only one circuit of the linkage. The value of d
is dependent on the calculated value of θ3. The value of θ3 for the second circuit
of the linkage can be found from:
⎛ − (a sin θ 2 − c ) ⎞
θ 3 = arcsin ⎜ ⎟ +π . (2.25)
⎝ b ⎠
2
FIGURE 2.23
BASIC MECHANICS 55
spur
gears
steering gear
wheel box
FIGURE 2.24 A steered wheel.
(a) (b)
FIGURE 2.25
56 ROBOTICS
pass through the ground contact point. The actual kinematics of castor wheels is
somewhat complex, however, they do not impose any real constraint on the kin-
ematics of the robot chassis. Castor wheels are usually used to provide support
to the structure.
Pulleys can be used to simply change the direction of an applied force or to
provide a force/distance tradeoff in addition to a directional change, as shown
in Figure 2.26. Pulleys are very flexible because they use ropes to transfer force
rather than a rigid object such as a board or a rod. Ropes can be routed through
virtually any path. They are able to abruptly change directions in three dimen-
sions without consequence. Ropes can be wrapped around a motor’s shaft and
either wound up or let out as the motor turns.
Ropes also have the advantage that their performance is not affected by
length. If a lever arm were extremely long, then it would be unable to handle the
magnitude of forces that a shorter version could withstand. In a lever, to move
a given distance next to the fulcrum, the end of the lever must move a distance
proportional to its length. As the length of the lever increases, it becomes more
likely that the lever will break somewhere along its length.
Figure 2.27 illustrates how a compound pulley ‘trades’ force for distance
through an action/reaction force pair. In a double pulley, as the rope passes over
the pulley the force is transmitted entirely but the direction has changed. The
BASIC MECHANICS 57
D=220
B C
A
119.65
w1 w2
effort is now pulling up on the left side of the bottom pulley. Now, for a moment
forget that the end of the rope is tied to the bottom of the top pulley. The me-
chanics are the same if the rope is fixed to the ceiling. The important thing is that
the end of the rope is immobile. The effort is once again transmitted entirely as
the rope passes over the bottom pulley and there is a direction change. The end
of the rope is attached to the ceiling so the rope is pulling down on the ceiling
with the force of the effort (and half of the force of the load). We assume that the
ceiling holds up, so this must mean that there is a force balancing out this down-
ward force. The ceiling pulls up on the rope as a reaction force. This upward
force is equal to the effort and now there is an upward force on the right side of
the bottom pulley. From the perspective of a free-body diagram the compound
pulley system could be replaced by tying two ropes to the load and pulling up on
each with a force equal to the effort.
The disadvantages of pulleys, in contrast to machines that use rigid objects to
transfer force, are slipping and stretching. A rope will permanently stretch under
tension, which may affect the future performance of a device. If a line becomes
slack, then the operation of a machine may change entirely. Also, ropes will slip
and stick along pulley wheels just like belts. One solution to the problems associ-
ated with rope is to use chain. Chain is pliable like rope, and is able to transfer
58 ROBOTICS
force through many direction changes, but the chain links are inflexible in ten-
sion, so that the chain will not stretch. Chains may also be made to fit on gears so
that slipping is not a problem.
The Screw
The screw is basically an inclined plane (see Figure 2.28) wrapped around a
cylinder. In an inclined plane, a linear force in the horizontal plane is converted
to a vertical “lifting” force. With a screw, a rotary force in the horizontal plane is
converted to a vertical “lifting” force.
When a wood screw is turned, the threads of the screw push up on the wood.
A reaction force from the wood pushes back down on the screw threads and in
this way the screw moves down even though the force of turning the screw is
in the horizontal plane. Screws are known for high friction, which is why they
are used to hold things together. This is true for the LEGO worm gears used in
ELEC 201. The friction between these gears and others can take away from the
force transmitted through them.
Springs
A favorite device for storing potential energy is the spring. Everything from
clocks to catapults makes use of springs. There are two distinctive forms of
Screw
A screw is simply
a spiraled inclined plane
Effort
Effect of Wedge
Raw effort
Force on
wood
FIGURE 2.28 The screw.
BASIC MECHANICS 59
no tension or compression
springs: the familiar coil and the bending bar. A common use for springs is to
return something to its original position. A more interesting application is to use
them to measure force—springs in scales. The third use is to store energy. All
springs perform all three functions all of the time, but specific devices are built
to exploit certain functions of the spring.
A coil spring works for more or less the same reason as a bar spring, it’s just in
a different shape. To understand a spring, one must zoom in to the microscopic
level where molecules interact. Molecules are held together in rigid bodies be-
cause of electromagnetic forces. Some of these forces are repulsive, and some of
them are attractive. Normally they balance out so that the molecules are evenly
spaced within an object; however, by bending a bar, some molecules are forced
farther apart and others are shoved closer together. Where the molecules have
been spread out, the attractive forces strive to return the original spacing. Where
molecules have been forced together, the repulsive forces work to return the
object to the original shape.
Rubber Bands
A rubber band is just a kind of spring. A rubber band is slightly more versatile
than a metal spring because of its flexibility, just as pulleys are more versatile
than their rigid cousin the lever. Using springs in ELEC 201 might take a small
amount of imagination, but rubber bands almost scream to be used. There might
be several small tasks that a robot performs only once during a round. It would
60 ROBOTICS
1 3
rubber band
axle
axle
2 4
not make sense to devote an entire motor to such a task. It’s not worth carrying
around the extra weight if the task could be accomplished just as well with rub-
ber bands.
Rubber bands also prove useful in the case of repetitive motions. Rather
than turning a motor forward then backward then forward and so on, one could
make use of a cam and a rubber band to allow the motor to always turn in one
direction. Look at the assembly in Figure 2.30 for an example.
Counterweights
Counterweighing is a necessary evil in constructing even a simple robot. Exam-
ples of common counterweights are shown in Figure 2.31. If a robot that has
been traveling along at a high speed suddenly comes to a halt, there is danger of
the robot overturning if the location of the robot’s center of mass has not been
well placed. The ELEC 201 robots carry around a fairly massive battery, and its
placement within the robot’s structure is important. When an arm extends, the
robot should remain stable. This is accomplished through the use of counter-
weights.
Counterweighing might also prove useful to raise a bin carrying blocks.
Rather than committing an entire motor to raising a bin, a set of counterweights
BASIC MECHANICS 61
Counter-
weight
LOTT
Counter-
Chalkboard weights
Crane
known to be heavier than the bin plus its contents could be suspended until the
time when the bin should rise. Of course if a motor was used to take care of the
counterweights then no motors have been saved. A motor could be used for
more than one task if a mechanical transmission was employed. Another solution
would be to use the high-current LED outputs to operate a solenoid.
Torque = 8 x 8 =64
Circular line
of action
F=8
Torque = 4 x 16 =64
motion can only be transmitted from the worm to the wheel not the other way
round. Hence, it is used in situations that require locking in one direction. Many
applications in robotics require one-way locking. For example, legged robots
and robotic arms. Moreover, the worm and wheel configuration provides much
higher gear reduction as compared to the other types of gears for similar dimen-
sions. So, due to these two features of worm and wheel gears, they are the most
widely used in robotic applications.
Edge of table
String
Mass
applying more force closer to the pivot, one may produce the same torque. This
concept of “trading” distance traveled/applied for force experienced/applied is
key to many simple machines.
A simple experiment can be performed to determine the torque rating of a
motor. All that is needed is a motor to be measured, a power supply for the motor,
a piece of thread, a mass of known weight, a table, and a ruler. The mass is attached
to one end of the thread. The other end of the thread is attached to the motor shaft
so that when the motor turns the thread will be wound around the motor shaft.
The motor shaft must be long enough to wind the thread like a bobbin.
The motor is put near the edge of a table with the mass hanging over the
edge, as illustrated in Figure 2.33. When the motor is powered it will begin
winding up the thread and lifting the mass. At first this will be an easy task be-
cause the arm movement required to lift the mass is small—the radius of the mo-
tor shaft. But soon, the thread will wind around the shaft, increasing the radius at
which the force is applied to lift the mass. Eventually, the motor will stall. At this
point, the radius of the thread bobbin should be measured. The torque rating of
the motor is this radius times the amount of mass that caused the stall.
Alternatively, a LEGO gear and long beam can be mounted on the motor
shaft, and a small scale (such as a postage scale) calibrated in grams can be used
to measure the force produced by the stalled motor at the end of the lever rest-
ing on the scale. The torque in mN-m is given by (force in grams) x (lever length
in cm) x (0.09807). The stall current can be measured at the same time. The
measurement must be made quickly (1 second) because the large current will
heat the motor winding, increasing its resistance, and significantly lowering the
current and torque.
Chapter 3 BASIC ELECTRONICS
In This Chapter
• Introduction to Electronics
• Some Basic Elements
• Steps to Design and Create a Project
• Sensor Design
• Using the Parallel Port of the Computer
• Serial Communication: RS-232
• Using the Microcontroller
• Actuators
T
he concept of electronics is used about electronic components, integrated
circuits, and electronic systems. Thirty years ago, no one ever thought of
the expansive growth of the electronics, information, and communication
technology we have seen the last few decades. Our new digital life is built on
the development of miniaturized electronic circuits (microchips) and broadband
telephone and data transmission through optical fiber and wireless networks.
The computer has been a common tool both at work and at home. By
continued miniaturization of digital electronic components and circuits, the
PC and other advanced electronics have been commercially available for
people in general. The capacity of computers almost doubles every year. This
65
66 ROBOTICS
Resistors, capacitors, and transistors are a few basic components that can be seen
in most electronic circuits. Resistors come in different values. Their resistance
BASIC ELECTRONICS 67
Schematic Schematic
Symbol Name
R
(a) (b)
3.2.1 Resistors
Fixed Resistors
Resistors are one of the most commonly used components in electronics. As its
name implies, resistors resist the flow of electrons. They are used to add resist-
ance to a circuit. The color bands around the resistors are color codes that tell
you its resistance value. Recall that a unit of resistance is an ohm.
One last important note about resistors is their wattage rating. You should not
use a 1/4-watt resistor in a circuit that has more than 1/4 watt of power flowing.
For example, it is not okay to use a 1/4-watt resistor in a 1/2-watt circuit.
However, it is okay to use a 1/2-watt resistor in a 1/4-watt circuit.
The tolerance band indicates the accuracy of the values. A 5% tolerance
(gold band) for example, indicates that the resistor will be within 5% of its value.
For most applications, a resistor within 5% tolerance should be sufficient.
0 Black = 0
1 Brown = 1
COLOR VALUES
2 Red = 2
3 Orange = 3
4 Yellow = 4 1
0
5 Green = 5
000
6 Blue = 6
7 Violet = 7 10000 ohm ±5%
8 Grey = 8 or 10k
9 White = 9
TOLERANCE
(a) (b)
To get the value of a resistor, hold the resistor so that the tolerance band is
on the right.
The first two color bands from the left are the significant figures—simply
write down the numbers represented by the colors. The third band is the multi-
plier—it tells you how many zeros to put after the significant figures. Put them
all together and you have the value.
NOTE
There are resistors with more bands and other types for specific applications.
However, 4-band resistors (the ones discussed here) are the most common and
should work for most projects.
Variable Resistors
Variable Resistors, or potentiometers, often have three terminals and can
change resistance easily.
Preset Symbol
Presets are much cheaper than standard variable resistors so they are sometimes
used in projects where a standard variable resistor would normally be used.
Multiturn presets are used where very precise adjustments must be made.
The screw must be turned many times (10+) to move the slider from one end of
the track to the other, giving very fine control.
BASIC ELECTRONICS 69
3.2.2 Capacitors
Capacitors are the second most commonly used component in electronics. They
can be thought of as tiny rechargeable batteries—capacitors can be charged and
discharged. The amount of charge that a capacitor can hold is measured in Far-
ads or the letter F. However, 1F is too large for capacitors, so microfarads (µF)
and picofarads (pF) are used:
Significant figures
121 120 pf
multiplier
Schematic Schematic
Symbol Name
C
(a) (b)
FIGURE 3.7 (a) A ceramic capacitor and (b) its schematic symbol and
name.
■ A ceramic capacitor is brown and has a disc shape. These capacitors are
nonpolarized, meaning that you can connect them in any way. To find the
value, you simply decode the 3-digit number on the surface of the capacitor.
The coding is just like the resistor color codes except that they used numbers
instead of colors. The first 2 digits are the significant figures and the third
digit is the multiplier. These capacitors are measured in pF.
■ Electrolytic capacitors have a cylinder shape. These capacitors are polar-
ized so you must connect the negative side in the right place. The value of
the resistor as well as the negative side is clearly printed on the capacitor.
These capacitors are measured in µF.
3.2.3 Breadboard
Circuits can be modeled to make sure they work the way you want them to.
Circuit modeling can be done either using a computer modeling application,
or on a prototype board—also called a breadboard or Vero board—which is
a board covered with small sockets into which components can be plugged and
connected up.
Figure 3.9 shows a breadboard with holes connected in two long rows at the
top and bottom, and columns of five linked holes elsewhere. Electronic compo-
nents and wires can be simply plugged into the board in order to make any re-
quired circuit connections. The top and bottom rows act as power supply chan-
nels for the circuit.
Schematic Schematic
Symbol Name
Electrolytic C
capacitor
(a) (b)
FIGURE 3.8 (a) An electrolytic capacitor and (b) its schematic symbol and name.
BASIC ELECTRONICS 71
A breadboard prototype for a 555 mono stable timer circuit might look
like this:
Power
Supply
(a) (b)
(c)
1. Initial Design Phase: Check that you have used the correct value compo-
nents, and that the various systems work together. These checks can be done
using a computer-simulation package.
2. Breadboard Phase: Use the breadboard to check whether the circuit works
properly. Test each part of the circuit using a millimeter or logic probe.
72 ROBOTICS
3. PCB Layout: Check that the components are in the correct positions and
that you have used the optimum track layout. Make sure that the compo-
nents are located neatly and that joints are well soldered.
4. Manufacturing and Packaging Phase: After manufacture, check that the
product conforms to its specification. During packaging, check that the prod-
uct fits securely in the package, and that any conducting parts are insulated.
5. Finally, the Analysis Phase: Look back over the design and making process.
Analyze how well it went, noting any modifications and improvements you
would make if you were to do it again. These notes are an important part of
your design portfolio.
3.2.4 Potentiometer
A potentiometer (or “pot,” for short) is a manually adjustable, variable resistor.
It is commonly used for volume and tone controls in stereo equipment. On the
RoboBoard a 10k pot is used as a contrast dial for the LCD screen, and the
RoboKnob of the board is also a potentiometer.
In robotics, a potentiometer can be used as a position sensor. A rotary po-
tentiometer (the most common type) can be used to measure the rotation of a
shaft. Gears can be used to connect the rotation of the shaft being measured to
the potentiometer shaft. It is easiest to use if the shaft being measured does not
need to rotate continuously (like the second hand on a clock), but rather rotates
back and forth (like the pendulum on a grandfather clock). Most potentiometers
rotate only about 270 degrees; some can be rotated continuously, but the values
are the same on each rotation. By using a gear ratio other than 1:1, the position
of a shaft that rotates more than 270 degrees can be measured.
+5v
Pull-up Resistor
R1
(47Kohm)
Electrical Data
Potentiometers have three terminals. The outer two terminals are connected to
a resistor and the resistance between them is constant (the value of the poten-
tiometer). The center terminal is connected to a contact that slides along the
resistance element as the shaft is turned, so the resistance between it and either
of the other terminals varies (one increases while the other decreases).
The assembly instructions suggest wiring the potentiometer in the voltage
divider configuration, with the on-board pull-up resistor in parallel with one of
the potentiometer’s two effective resistances. This will yield readings of greater
precision (although they will not be linear) than if the pot were used as a two-ter-
minal variable resistor. You may want to try different circuits to determine which
works best for your application.
3.2.5 Diodes
In electronics, a diode is a component that restricts the direction of movement of
charge carriers. Essentially, it allows an electric current to flow in one direction,
but blocks it in the opposite direction. Today the most common diodes are made
from semiconductor materials such as silicon or germanium.
Semiconductor Diodes
Most modern diodes are based on semiconductor P-N junctions. In a P-N diode,
conventional current can flow from the P-type side (the anode) to the N-type
74 ROBOTICS
side (the cathode), but not in the opposite direction. A semiconductor diode’s
current-voltage, or I-V, characteristic curve is ascribed to the behavior of the so-
called depletion layer or depletion zone which exists at the P-N junction between
the differing semiconductors. When a P-N junction is first created, conduction
band (mobile) electrons from the N-doped region diffuse into the P-doped re-
gion where there is a large population of holes (places for electrons in which
no electron is present) with which the electrons “recombine.” When a mobile
electron recombines with a hole, the hole vanishes and the electron is no longer
mobile. Thus, two charge carriers have vanished. The region around the P-N
junction becomes depleted of charge carriers and thus behaves as an insulator.
However, the depletion width cannot grow without limit. For each electron-
hole pair that recombines, a positively charged dopant ion is left behind in the
N-doped region, and a negatively charged dopant ion is left behind in the P-
doped region. As recombination proceeds and more ions are created, an increas-
ing electric field develops through the depletion zone which acts to slow and
then finally stop recombination. At this point, there is a ‘built-in’ potential across
the depletion zone.
If an external voltage is placed across the diode with the same polarity as the
built-in potential, the depletion zone continues to act as an insulator preventing
a significant electric current. This is the reverse bias phenomenon. However, if
the polarity of the external voltage opposes the built-in potential, recombination
can once again proceed resulting in substantial electric current through the P-N
junction. For silicon diodes, the built-in potential is approximately 0.6 V. Thus,
if an external current is passed through the diode, about 0.6 V will be developed
across the diode such that the P-doped region is positive with respect to the N-
doped region and the diode is said to be ‘turned on’ as it has a forward bias.
A diode’s I-V characteristic can be approximated by two regions of opera-
tion. Below a certain difference in potential between the two leads, the deple-
tion layer has significant width, and the diode can be thought of as an open
BASIC ELECTRONICS 75
lf
Forward
bias
Breakdown region
PIV
Vr Vf
On Voltage
Reverse ~0.65V for Si
current ~0.2V for Ge
~30µA
Zener Diode
Refer to the characteristic curve of a typical rectifier (diode) in Figure 3.14. The
forward characteristic of the curve we have previously described above in the
diode section. It is the reverse characteristics we will discuss here.
76 ROBOTICS
P
padln Rpoly to internal logic
N
Notice that as the reverse voltage is increased the leakage current remains
essentially constant until the breakdown voltage is reached where the current
increases dramatically. This breakdown voltage is the zener voltage for zener
diodes. While for the conventional rectifier or diode it is imperative to operate
below this voltage; the zener diode is intended to operate at that voltage, and so
finds its greatest application as a voltage regulator.
Varactor Diode
The varactor diode symbol is shown in Figure 3.15 with a diagram representation.
When a reverse voltage is applied to a P-N junction, the holes in the P-
region are attracted to the anode terminal and electrons in the N-region are
attracted to the cathode terminal creating a region where there is little current.
BASIC ELECTRONICS 77
(B)
(a) (b)
FIGURE 3.15 (a) Varactor diode symbol and (b) its diagram representation.
This region, the depletion region, is essentially devoid of carriers and behaves as
the dielectric of a capacitor.
The depletion region increases as the reverse voltage across it increases; and
since capacitance varies inversely as dielectric thickness, the junction capaci-
tance will decrease as the voltage across the P-N junction increases. So by vary-
ing the reverse voltage across a P-N junction the junction capacitance can be
varied. This is shown in the typical varactor voltage-capacitance curve below in
Figure 3.16.
Notice the nonlinear increase in capacitance as the reverse voltage is de-
creased. This nonlinearity allows the varactor to also be used as a harmonic gen-
erator.
Major varactor considerations are:
REVERSE VOLTAGE
-6.0 -5.5 -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0
220pf
200pf
180pf
160pf
140pf
120pf
100pf
80pf
60pf
40pf
20pf
Current vs Voltage
for a Tunnel Diode
1.4
1.2
Current (mA)
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.2
Voltage (V)
The negative resistance region is the important characteristic for the tunnel
diode. In this region, as the voltage is increased, the current decreases; just the
opposite of a conventional diode. The most important specifications for the tun-
nel diode are the Peak Voltage (Vp), Peak Current (Ip), Valley Voltage (Vv), and
Valley Current (Iv).
Back Diode
A back diode is a tunnel diode with a suppressed Ip and so approximates a con-
ventional diode characteristic. See the comparison in the figures below:
BASIC ELECTRONICS 79
VCC
VCC ADN2530
IBMON
+ + IBIAS
800Ω
800Ω − −
FIGURE 3.18
Anode Cathode
Anode Cathode
(long lead) (short lead flat
side or spot)
(a) (b)
The reverse breakdown for tunnel diodes is very low, typically 200 mV, and
the TD conducts very heavily at the reverse breakdown voltage. Referring to the
BD curve, the back diode conducts to a lesser degree in a forward direction. It
is the operation between these two points that makes the back diode important.
Forward conduction begins at 300 mV (for germanium) and a voltage swing of
only 500 mV is required for full-range operation.
3.2.6 LEDs
Definition: Light Emitting Diodes (LEDs) are compound semiconductor devices
that convert electricity to light when biased in the forward direction. Because of its
small size, ruggedness, fast switching, low power, and compatibility with integrated
circuitry, LED was developed for many indicator-type applications.
Today, advanced high-brightness LEDs are the next generation of lighting
technology and are currently being installed in a variety of lighting applications.
As a result of breakthroughs in material efficiencies and optoelectronic packag-
ing design, LEDs are no longer used in just indicator lamps. They are used as
a light source for illumination for monochromatic applications such as traffic
signals, brake lights, and commercial signage.
LED Benefits
■ Energy efficient
■ Compact size
■ Low wattage
■ Low heat
■ Long life
■ Extremely robust
■ Compatible with integrated circuits
Epoxy Body
Wire Bond
Die
Die Cup
Leads
LED Structure
■ Chip
■ Lead frame
■ Gold wire
■ Epoxy resin (plastic mold package)
■ Cathode
■ Anode
Applications of LEDs
Visible LED: General-purpose application in various industries including indi-
cation devices for electronic appliances, measuring instruments, etc.
Bi-color (dual color) LED: Charger for cellular phones, showcase boards, traf-
fic boards on highways, etc.
High & Ultra Brightness LED: Full-color display for indoor/outdoor, au-
tomotive signal lamps, high-mount lamps, indoor lamps, traffic signal lamps,
etc.
Infrared LED: With high output capacity, IR LED is used in remote controls,
IrDa (Infrared Data Storage Devices), etc.
3.2.7 Transistors
A semiconductor device consisting of two P-N junctions formed by either a P-type or
N-type semiconductor between a pair of opposite types is known as a transistor.
BASIC ELECTRONICS 83
E E WB C
WB
C
Emitter Base Collector
Emitter Base Collector p n p
n p n
B B
FIGURE 3.21
N P N
forward reverse
biased biased
FIGURE 3.22
ie=ic+ib.
P N P
Forward reverse
biased biased
FIGURE 3.23
BASIC ELECTRONICS 85
doped and very thin, only a few holes (less than 5%) combine with electrons to
constitute base current ib. The remaining holes (more than 95%) diffuse across
the thin base region and reach the collector space charge layer. These holes then
come under the influence of the negatively based P-region and are attracted or
collected by the collector. This constitutes collector current ic.
Thus, it is seen that almost the entire emitter current flows into the collector
circuit. However, to be more precise, the emitter current is the sum of the col-
lector current and base current i.e.,
ie= ic+ib.
Overview
■ ICs, often called “chips,” come in several shapes and sizes.
■ Most common are 8-, 14-, or 16-pin dual in-line (dil) chips.
■ ICs can be soldered directly into printed circuit boards, or may plug into
sockets which have already been soldered into the board.
■ When soldering, ensure that the IC (or the socket) is the correct way round
and that no pins have been bent underneath the body.
■ When fitting new ICs it is often necessary to bend the pins in slightly, in
order to fit it into the board (or socket).
■ Some ICs are damaged by the static electricity that most people carry on
their bodies. They should be stored in conductive foam or wrapped in tin
foil. When handling them, discharge yourself periodically by touching some
metalwork which is earthed, such as a radiator.
86 ROBOTICS
8 1
notch
cut
9 16
IC 7805
The 7805 supplies 5 volts at 1 amp maximum with an input of 7–25 volts.
The 7812 supplies 12 volts at 1 amp with an input of 14.5–30 volts.
The 7815 supplies 15 volts at 1 amp with an input of 17.5–30 volts.
The 7824 supplies 24 volts at 1 amp with an input of 27–38 volts.
The 7905, 7912, 7915, and 7924 are similar but require a negative voltage in
and give a negative voltage out.
Note that the electrolytic 10 uF must be reversed for negative supplies. En-
sure that the working voltage of this component is sufficient. Say 25 V for the 5-,
12-, and 15-volt supplies and 63 V for the 24-volt supply.
78 series 79 series
1 18
2 17
3 16 +
A
4 15
2k7
5 14
6 13 7k2 3k
7 12
INSIDE CIRCUIT
8 11
GND 9 10
ULN2803
Description
The ULN2801A–ULN2805A each contain eight Darlington transistors with common
emitters and integral suppression diodes for inductive loads. Each Darlington features
a peak load current rating of 600 mA (500 mA continuous) and can withstand at least
50 V in the off state. Outputs may be paralleled for higher current capability.
The output of the ULN2803 is “inverted.” This means that a HIGH at the in-
put becomes a LOW at the corresponding output line. E.g., if the motor line con-
nected to pin 1 goes HIGH, pin 18 on the ULN2803 will go LOW (switch off).
The ULN2803 is described as an “8-line driver.” This means that it con-
tains the circuitry to control eight individual output lines, each acting independ-
ently of the others. The IC can be thought of as an 8-line ‘black box.’
LM 324 IC
Out 1 1 14 Out 4
2 13
Inputs 1 Inputs 4
3 12
5 10
Inputs 2 Inputs 3
6 9
Out 2 7 8 Out 3
Top View
FIGURE 3.31
A design procedure is a series of steps which guide you through any electronic
design-and-make process. Sticking to the procedure will help deliver a first-class
product.
Once you have defined the purpose of your project, there are two important
documents you need to write. These are:
■ The design brief is a short statement of the problem to be solved. The brief
should outline the design problem you are tackling, perhaps including one
or two of the envisaged design features.
■ The design specification is a longer document, including full details of the
functional and design features of the finished electronic product as well as
information on weight and size, maintenance, cost, and safety.
Without sensors, a robot is just a machine. Robots need sensors to deduce what
is happening in their world and to be able to react to changing situations. This
section introduces a variety of robotic sensors and explains their electrical use
and practical application. The sensor applications presented here are not meant
to be exhaustive, but merely to suggest some of the possibilities.
Sensors as Transducers
The basic function of an electronic sensor is to measure some feature of the
world, such as light, sound, or pressure and convert that measurement into
an electrical signal, usually a voltage or current. Typical sensors respond to
stimuli by changing their resistance (photocells), changing their current flow
(phototransistors), or changing their voltage output (the Sharp IR sensor). The
electrical output of a given sensor can easily be converted into other electrical
representations.
resistance) when it is not pressed, and a short circuit (zero resistance) when
it is depressed.
Some sensors that produce a digital output are more complicated. These sen-
sors produce pulse trains of transitions between the 0-volt state and the 5-volt
state. With these types of sensors, the frequency characteristics or shape of this
pulse train convey the sensor’s measurement. An example of this type of sensor is
the Sharp modulated infrared light detector. With this sensor, the actual element-
measuring light is an analog device, but signal-processing circuitry is integral to the
sensor producing a digital output.
val = analog(27);
sets the value of the variable val equal to the output of port #27.
Many devices used as digital sensors are wired to be active low, meaning that
they generate 0 volts when they are active (or true). The digital inputs on the Ro-
boBoard have a pull-up resistor that makes the voltage input equal to 5 volts when
nothing is connected. A closed or depressed touch switch connected to a digital
port would change that voltage to 0 volts by shorting the input to ground. The
resulting outputs: open switch = 1, and closed switch = 0, are the logical opposite
of what we usually want. That is, we would prefer the output of the digital port to
have value 0 or False normally, and change to 1 or True only when the switch hit
something (like a wall or another robot) and was depressed. The IC library func-
tion digital (port-#), used to read a True-or-False value associated with a particular
sensor port, performs this logical inversion of the signal measured on a digital port.
Hence, the depressed touch switch (measuring 0 volts on the hardware) causes the
digital () function to return a 1 (logic True) or logical True value.
92 ROBOTICS
Sensor Plug
Gnd
+5v sensor
device
Signal
if (digital(2)) do_it();
returns a True value (the number 1) and calls the function do_it() if the value at
port #2 was 0 volts (indicating a depressed switch).
Sensor Wiring
Figure 3.33 shows a diagram of circuitry associated with each sensor. This cir-
cuitry, residing on the RoboBoard, is replicated for each sensor input channel.
The key thing to notice is the pull-up resistor wired from the sensor input signal
leads to the 5-volt power supply.
There are two reasons why this resistor is used. First, it provides a default
value for the sensor input—a value when no sensor is plugged in. Many ICs, such
as those on the board that read and interpret the sensor voltage, do not perform
BASIC ELECTRONICS 93
Pull-up Resistor
Sensor
+5v +5v Connector
Plug
Sensor
Input
IC
Sensor Input
well when their inputs are left unconnected. With this circuit, when nothing is
plugged into the sensor port, the pull-up resistor provides a 5-volt bias voltage
on the sensor input line. Thus, the default output value of an analog port is 255,
while the default output value of a digital port is 0 or logic False. (Remember
that the 5-volt default input value would lead to a digital value of 1 except that
this value is inverted by the digital () library function, as explained earlier.)
Second, the pull-up resistor is also used as part of the voltage divider circuit
required for some of the analog sensors, as explained in the following section.
The resistors on the RoboBoard eliminate the need for an additional resistor on
each of the sensors.
Vin
Current Flow
R1 Pull-up Resistor
Vout
R2 Sensor
computed from R2, the resistive sensor. From looking at the equation, it is easy
to see that if R2 is large with respect to R1, the output voltage will be large, and
if R2 is small with respect to R1, the output voltage will be small. The minimum
and maximum possible voltage values are 0 and 5 volts, matching the RoboBoard
input circuitry range.
Tactile Sensors
The primary sensors in the ELEC 201 kit used to detect tactile contact are
simple push-button or lever-actuated switches. Microswitch is the brand name
of a variety of switches that are so widely used that the brand name has become
the generic term for this type of switch, which is now manufactured by many
companies. A microswitch is housed in a rectangular body and has a very small
button (the “switch nub”) which is the external switching point. A lever arm on
the switch reduces the force needed to actuate the switch (see Figure 3.35).
Microswitches are an especially good type of switch to use for making touch
sensors.
Activation Force
Switch Nub
Obstacle
Often, the switch is simply mounted on a robot so that when the robot runs into
something, the switch is depressed, and the microprocessor can detect that the robot
has made contact with some object and take appropriate action. However, creative
mechanical design of the bumper-switch mechanism is required so that contact with
various objects (a wall, a robot, etc.) over a range of angles will be consistently de-
tected. A very sensitive touch bumper can be made by connecting a mechanism as
an extension of the microswitch’s lever arm, as illustrated in Figure 3.36.
Limit Switch
Touch sensors can also serve as limit switches to determine when some movable
part of the robot has reached the desired position. For example, if a robot arm is
driven by a motor, perhaps using a gear rack, touch switches could detect when
the arm reached the limit of travel on the rack in each direction.
Switch Circuitry
Figure 3.37 shows how a switch is wired to a sensor input port. When the switch
is open (as it is shown in the diagram), the sensor input is connected to the
5-volt supply by the pull-up resistor. When the switch is closed, the input is
connected directly to ground, generating a 0-volt signal (and causing current to
flow through the resistor and switch).
Most push-button-style switches are “normally open,” meaning that the
switch contacts are in the open-circuit position when the switch has not been
pressed. Microswitches often have both normally open and normally closed con-
tacts along with a common contact. When wiring a microswitch, it is custom-
ary to use the normally open contacts. Also, this configuration is the active-low
mode expected by the standard library software used to read the output values
96 ROBOTICS
from digital sensor ports. However, you can wire the switch differently to per-
form some special function. In particular, several switches can be wired in series
or parallel and connected to a single digital input port. For example, a touch
bumper might have two switches, and the robot only needs to know if either of
them (#1 OR #2) are closed. It takes less code and less time to check just one
digital port and to use parallel switch wiring to implement the logic OR function
in hardware.
Light Sensors
Measurement of light provides very valuable information about the environ-
ment. Often, particular features of the game board (such as goals) are marked
by a strong light beacon. The board surface has contrasting lines that can be
detected by the difference in the amount of light they reflect. A variety of light
sensors are provided in the ELEC 201 kit:
BASIC ELECTRONICS 97
Photocell
This device is a light-dependent resistor. It is most sensitive to visible light in
the red.
Photocells are made from a compound called cadmium sulfide (CdS) that
changes resistance when exposed to varying degrees of light. Cadmium sulfide
photocells are most sensitive to visible red light, with some sensitivity to other
wavelengths.
Photocells have a relatively slow response to changes in light. The charac-
teristic blinking of overhead fluorescent lamps, which turn on and off at the
60 Hertz line frequency, is not detected by photocells. This is in contrast to
phototransistors, which have frequency responses easily reaching above 10,000
Hertz and more. Therefore, if both sensors were used to measure the same fluo-
rescent lamp, the photocell would show the light to be always on and the pho-
totransistor would show the light to be blinking on and off.
Photocells are commonly used to detect the incandescent lamp that acts as
a contest start indicator. They are also used to find the light beacons marking
certain parts of the board, such as the goals. While they can be used to measure
the reflectivity of the game board surface if coupled with a light source such as a
red LED or an incandescent lamp, the IR reflectance sensors are usually better
98 ROBOTICS
at this function. Photocells are sensitive to ambient lighting and usually need to
be shielded. Certain parts of the game board might be marked with polarized
light sources. An array of photocells with polarizing filters at different orienta-
tions could be used to detect the polarization angle of polarized light and locate
those board features.
The photocell acts as resistor R2 in the voltage divider configuration. The
resistance of a photocell decreases with an increase in illumination (an inverse
relationship). Because of the wiring of the voltage divider (the photocell is on
the lower side of the voltage divider), an increase in light will correspond to a
decrease in sensor voltage and a lower analog value.
IR Phototransitor
IR LED
Phototransistor
The light falling on a phototransistor creates charge carriers in the base region
of a transistor, effectively providing base current. The intensity of the light de-
termines the effective base drive and thus the conductivity of the transistor.
Greater amounts of light cause greater currents to flow through the collector-
emitter leads. Because a transistor is an active element having current gain, the
phototransistor is more sensitive than a simple photoresistor. However, the in-
creased sensitivity comes at the price of reduced dynamic range. Dynamic range
is the difference between the lowest and highest levels that can be measured.
The RoboBoard analog sensor inputs have a range of 0–5 volts, and relatively
small variations in light can cause the phototransistor output to change through
this range. The exact range depends on the circuit used.
As shown in Figure 3.38, the phototransistor is wired in a configuration simi-
lar to the voltage divider. The variable current traveling through the resistor
causes a voltage drop in the pull-up resistor. This voltage is measured as the
output of the device.
Infrared Emitter
The Light Emitting Element (an LED) uses a resistor to limit the current
that can flow through the device to the proper value of about 10 milliamps.
Normally the emitter is always on, but it could be wired to one of the LED
output ports if you wanted to control it separately. In this way you could use
the same sensor to detect the starting light (using the phototransistor with
the emitter off) and then to follow a line on the board (normal operation with
the emitter on).
opaque enters the gap and blocks the light path. The slotted optical switch is
commonly used to build shaft encoders, which count the revolutions of a shaft.
A gear or other type of wheel with holes or slots is placed in the gap between the
emitter and detector. The light pulses created by the turning wheel can be de-
tected and counted with special software to yield rotation or distance data. This
detector also might be used to detect when an arm or other part of the robot has
reached a particular position by attaching a piece of cardboard to the arm so that
it entered the gap at the desired arm position.
The slotted optical switch operates in the same fashion as the infrared re-
flectance sensor, with the exception that a different value of pull-up resistor must
be added externally for the particular model of optical switch we use.
Other Sensors
Magnetic Field SensoAvrs
The ELEC 201 kit contains both an analog sensor that provides informa-
tion about the strength of the magnetic field and a digital sensor, a magnetic
switch.
A device called a hall-effect sensor can be used to detect the presence and
strength of magnetic fields. The hall-effect sensors have an output voltage even
when no magnetic field is present, and the output changes when a magnetic
field is present, the direction of change depending on the polarity of the field.
The digital magnetic sensors are simple switches that are open or closed.
Internally the switches have an arm made of magnetic material that is attracted
to a magnet and moves to short out the switch contacts. These switches are
commonly used as door and window position sensors in home security systems.
The switch will close when it comes within 1˝ of its companion magnet.
BASIC ELECTRONICS 101
TABLE 3.4 Hall-effect sensor test results Chart shows voltage drop across
Distance (mm) Voltage (V) RoboBoard Reading hall-effect sensor and correspond-
0 0.7 35 ing reading on the RoboBoard.
1 1.55 79
2 1.83 93
3 1.92 98
4 2.03 104
5 2.11 108
6 2.17 111
7 2.21 113
10 2.31 118
15 2.4 123
20 2.47 125
25 2.5 128
30 2.52 129
35 2.54 130
40 2.55 130
2.5
Voltage (V)
1.5
0.5
0
0 5 10 15 20 25 30 35 40
Distance (mm)
FIGURE 3.39
102 ROBOTICS
Either sensor can be used to detect magnets or magnetic strips that may be
present on the ELEC 201 game board table. With the magnets typically used
on the game board, the hall-effect sensor output voltage changes only a small
amount when a field is present. The no-field voltage varies between sensors, but
it is very stable for a particular sensor, so the small changes can be detected reli-
ably to determine the presence of a magnet. Hall-effect sensors can be used to
make magnetic shaft encoders by mounting a small piece of magnet on a wheel
that rotates past the sensor element. Hall-effect sensors can also be used to build
a proximity sensor or bounce-free switch, which detects a magnet mounted on a
moving component when it is near the sensor element.
Magnetic switches are used in much the same way as a touch switch, except
the switch closes when it is near a magnet, instead of when it contacts something.
The digital nature of the switch makes it easier to use than the hall-effect sen-
sors, but it may be less sensitive. You should try both.
They can also be used to make an inclination sensor by dangling a magnet
above the sensor.
The hall-effect sensor included in the ELEC 201 kit is a digital device that
operates from a 5-volt power supply. It uses about 6 mA of current for stand-
ard operation. It can sink 250 mA of current into its output, creating logic low.
The sensor cannot drive logic high and therefore requires a pull-up resistor for
proper operation.
A port contains a set of signal lines that the CPU uses to send or receive data with
other components. Ports are usually used to communicate via modem, printer,
keyboard, mouse, etc. In signaling, open signals are “1” and closed signals are
“0.” A parallel port sends 8 bits and receives 5 bits at a time. The serial port RS-
232 sends only 1 bit at a time. However, it is multidirectional. So it can send 1
bit and receive 1 bit at a time. Parallel ports are mainly meant for connecting the
printer to the PC. But this port can be programmed for many more applications
beyond that.
BASIC ELECTRONICS 103
Parallel ports are easy to program and faster compared to the serial ports.
But the main disadvantage is that it needs more number of transmission lines.
Because of this reason parallel ports are not used in long-distance communica-
tions. You should know the basic difference between working off a parallel port
and serial port. In serial ports, there will be two data lines: one transmission and
one receiving line. To send data in a serial port, it has to be sent one bit after
another with some extra bits like start bit, stop bit, and parity bit to detect errors.
But in a parallel port, all the 8 bits of a byte will be sent to the port at a time and
an indication will be sent in another line. There will be some data lines, some
control, and some handshaking lines in a parallel port.
The D-25 type of female connector is located at the backside of the CPU
cabinet and has 25 pins. The pin structure of D-25 is explained in Table 3.5.
In Figure 3.40, let us see how communication between a PC and printer takes
place. The computer places the data in the data pins, and then it makes the strobe
104 ROBOTICS
D7 D6 D5 D4 D3 D2 D1 D0
13 12 11 10 9 8 7 6 5 4 3 2 1
25 24 23 22 21 20 19 18 17 16 15 14
S7 S6 S5 S4 S3
C3 C2 C1 C0
low. When the strobe goes low, the printer understands that there is valid data in
the data pins. Other pins are used to send controls to the printer and get the status
of the printer; you can understand them by the names assigned to the pins.
To use the printer port for applications other than printing, we need to know
how ports are organized. There are three registers associated with an LPT port:
data register, control register, and status register. Data register will hold the data
of the data pins of the port. That means, if we store a byte of data to the data reg-
ister, that data will be sent to the data pins of the port. Similarly with control and
status registers. Table 3.6 explains how these registers are associated with ports.
Pins with an * symbol in this table are hardware inverted. That means, if a
pin has a ‘low’ i.e., 0 V, the corresponding bit in the register will have value 1.
Signals with the prefix ‘n’ are active low. That means that normally these pins
will have low value. When it needs to send some indication, it will become high.
For example, normally nStrobe will be high, when the data is placed in the port,
the computer makes that pin low.
Normally, data, control, and status registers will have the following address-
es. We need these addresses in programming later.
BASIC ELECTRONICS 105
NOTE
All the parallel ports do not have bidirectional capability. Earlier parallel
ports had only output enabled in data pins since printers only input data. But
later, to make the parallel port capable of communicating with other devices,
bidirectional ports were introduced.
By default, a data port is an output port. To enable the bidirectional property
of the port, we need to set the bit 5 of the control register.
To know the details of parallel ports available in your computer, follow this
procedure:
The outport() function sends a word to the port, inport() reads a word from
the port. outportb() sends a byte to the port and inportb() reads a byte from
the port. If you include the DOS.H header, these functions will be considered
as macro, otherwise as functions. Function inport() will return a word having
lower byte as the data at PORTID and higher byte as the data at PORTID+2.
So, we can use this function to read status and control registers together. in-
portb() function returns byte at PORTID. outport() writes the lower byte to
PORTID and higher byte to PORTID+1. So this can be used to write data and
LISTING 3.1
/* file: ex1.c
Displays contents of status register of parallel port.
Tested with TurboC 3.0 and Borland C 3.1 for DOS.
*/
#include”stdio.h”
#include”conio.h”
#include”dos.h”
void main()
{
int data;
clrscr();
while(!kbhit())
{
data=inportb(PORT+1);
gotoxy(3,10);
printf(“Data available in status register: %3d (decimal),
%3X (hex)\n”, data, data);
printf(“\n Pin 15: %d”,(data & 0x08)/0x08);
printf(“\n Pin 13: %d”,(data & 0x10)/0x10);
printf(“\n Pin 12: %d”,(data & 0x20)/0x20);
printf(“\n Pin 11: %d”,(data & 0x80)/0x80);
printf(“\n Pin 10: %d”,(data & 0x40)/0x40);
delay(10);
}
}
BASIC ELECTRONICS 107
LISTING 3.2
bit no. 7654 3210 bit no. 7654 3210
data : XXXX 1XXX & data : XXXX 0XXX &
with : 0000 1000 (0x08 ) with : 0000 1000 (0x08 )
-> 0000 1000 (0x08 -> bit 3 is high ) -> 0000 0000 (0x00 -> bit 3 is low)
TABLE 3.7
0x408 0x409 0x40a 0x40b 0x40c 0x40d
LPT1 lowbyte LPT1 highbyte LPT2 lowbyte LPT2 highbyte LPT3 lowbyte LPT3highbyte
LISTING 3.3
/*PortAdd.c
To find availability and addresses of the lpt ports in the computer.
*/
#include <stdio.h>
#include <dos.h>
void main()
{
unsigned int far *ptraddr;
/* Pointer to location of Port Addresses */
unsigned int address; /* Address of Port */
int a;
ptraddr=(unsigned int far *)0x00000408;
clrscr();
LISTING 3.4
#include”conio.h”
#include”dos.h”
#define PORT 0x378
void main()
{
while(!kbhit())
{
outportb(PORT, ~inportb(PORT) );
delay(1000);
}
}
BASIC ELECTRONICS 109
G
R 4 4 4 4 4 4 4 4
O 7 7 7 7 7 7 7 7
U 0 0 0 0 0 0 0 0
N
D
S4 S5 S7 S6 D7 D6 D5 D4 D3 D2 D1 D0 C0
G7 G6 G5 G4 G3 G2 G1 G0 C3 C2 S3 C1
We have made an electrical circuit to show you how our circuit works. It is
shown in Figure 3.41. And also we have different angled pictures of the com-
plete circuit in Figure 3.42.
Ok then, let’s find out what we have to supply:
■ 1 or 2 meter parallel port cable (3 meter is acceptable but the voltage drops
from 5 V to 4.7 V).
■ If you need to modify the code, you need not have to disconnect the circuit
or reprogram the chip as you do in the case of a microcontroller.
■ You need to spend less: one LCD module, D-25 female connector, one po-
tentiometer (optional), and some wires—this is what you need along with a
computer.
■ When you are using a computer in full-screen mode like games, movies or TV;
you need to exit the application to get small updating information from the
computer, i.e., if you need to watch time in that time, you have to close the
games. But instead of that you can use an LCD module to display real time
from the PC and you can use it along with your application. Real-time imple-
mentation from the system clock example is explained in this article. If you are
good at programming, you can even connect to the Internet to get news, stock
exchange updates, and make them flash in the LCD module, only if you found
it important, or you can go through it by exiting your application.
LCD modules are available in a wide range like 8x1, 8x2, 16x1, 16x2, 20x2,
20x4, and 40x4. Here we have used 16x2—that means 2 rows of 16 characters.
It is a Hitachi HD44780 compatible module, having 16 pins including 2 pins
for backlight.
Table 3.8 gives the pin structure of an LCD module. LCD modules without
backlight will have only 14 pins. If you are using such LCDs, simply ignore the
15th and 16th pins.
BASIC ELECTRONICS 111
To program the LCD module, first we have to initialize the LCD by send-
ing some control words. RS should be low and E should be high when we send
control. R/W pin 0 means write data or control to LCD and R/W pin 1 means
read data from the LCD. To send data to an LCD, make RS high, R/W low, place
the data in pins 7 to 14, and make pin E high and low once. You can understand
the exact method after seeing the code, later in this Chapter. To make this let us
first build a circuit.
Here, we are going to write on the LCD module and not read back. So, R/W is
connected to the ground directly. We need not have to input any data through, so
all output pins are used in our application. Data pins of the LCD are connected to
data pins of the port. Strobe signal (pin 1 of D-25 connector) is given to E (pin 6 of
the LCD). Select printer (pin 17 of D-25) is connected to RS (pin 4 of the LCD).
In Figure 3.43, the LCD module is connected to the lpt port using a D-25
male connector. Pin number 3 of the LCD is for adjusting the contrast, con-
+5V
1 GND L
14
1 1 2 Vcc C
2 10k 3 Vo D
3 4 RS
5 RW
17 4 M
6 E
5 o
7 D0
6 d
8 D1
7 u
9 D2
8 10 D3 l
9 11 D4 e
12 D5
13 D6
14 D7
16
15 Vb1 x
25
13 16 Vbo 2
Table 3.9 explains how to write control words. When RS=0 and R/W=0, data
in the pins D0 to D7 will have the following meaning.
We have left other instructions related to the read and write LCD RAM
area; we will see them later. Using this information, we will write some routines
for basic functions of LCDs. Now look at our first program below. Here we have
written functions for all our needs in LCD interfacing. So, in our next program,
we are going to change our “main” function only. You can save these functions
as a library and include them in your next programs if you want.
#include <dos.h>
#include <string.h>
#include <conio.h>
#include <time.h>
TABLE 3.9
Instruction D7 D6 D5 D4 D3 D2 D1 D0 Description
Clear display 0 0 0 0 0 0 0 1 Clears display and returns cursor to
home position.
Cursor home 0 0 0 0 0 0 1 X Returns cursor to home position.
Also returns display being shifted to
the original position.
Entry mode set 0 0 0 0 0 1 I/D S I/D = 0 —> cursor is in decrement
position. I/D = 1 —> cursor is in
increment position.
S = 0 —> Shift is invisible. S = 1 —>
Shift is visible.
Display ON-OFF 0 0 0 0 1 D C B D- Display, C- cursor, B- Blinking
control cursor = 0 —> OFF =1 —> ON
Cursor/Display 0 0 0 1 S/C R/L X X S/C = 0 —> Move cursor.
shift S/C = 1 —> Shift display.
R/L = 0 —> Shift left.
R/L = 1 —> Shift right
Function set 0 0 1 DL N F X X DL = 0 —> 4-bit interface.
DL = 1 —> 8-bit interface.
N = 0 —> 1/8 or 1/11 Duty (1 line).
N = 1 —> 1/16 Duty (2 lines).
F = 0 —> 5x7 dots.
F = 1 —> 5x10 dots.
void lcd_init(void);
void lcd_write(char char2write);
void lcd_putch(char char2write);
void lcd_puts(char * str2write);
void lcd_goto(int row, int column);
void lcd_clear(void);
void lcd_home(void);
void lcd_cursor(int cursor);
void lcd_entry_mode(int mode);
void main(void)
{
lcd_init();
lcd_goto(1,1);
lcd_puts(“Welcome To”);
114 ROBOTICS
lcd_goto(1,0);
lcd_puts(“Appin Knowledge Solutions”);
void lcd_init()
{
outportb(CONTROL, inportb(CONTROL) & 0xDF); //config data pins as
output
lcd_write(0x0f);
delay(20);
lcd_write( 0x01);
delay(20);
lcd_write( 0x38);
delay(20);
}
void lcd_clear()
{
outportb(CONTROL, inportb(CONTROL) | 0x08);
lcd_write(0x01);
}
void lcd_home()
{
outportb(CONTROL, inportb(CONTROL) | 0x08);
lcd_write(0x02);
}
We need not give details to all the functions above. You can understand them
yourself. So, try using all the functions. In the next examples, we will generate
a program that displays the system time in the LCD module. It may not have
much use in DOS, but if you transfer the same to Windows, you will gain many
benefits. Also, if your computer will be working in DOS most of the time, you
can think of writing a TSR for the same.
In order to program to display date and time in an LCD module just replace
the ‘main’ of the previous program with the following and run.
void main(void)
{
struct time t;
struct date d;
char strtime[17];
textbackground(0);
clrscr();
textcolor(0);
textbackground(10);
gotoxy(8,5);
cputs(“ “);
gotoxy(8,4);
cputs(“ “);
lcd_init();
lcd_cursor(0);
while(!kbhit())
{
gettime(&t);
getdate(&d);
lcd_goto(0,4);
sprintf(strtime,”%02d:%02d:%02d”, t.ti_hour%12, t.ti_min,
t.ti_sec);
lcd_puts(strtime);
gotoxy(12,4);
cputs(strtime);
lcd_goto(1,3);
sprintf(strtime,”%02d:%02d:%4d”, d.da_day, d.da_mon,
d.da_year);
lcd_puts(strtime);
gotoxy(11,5);
cputs(strtime);
BASIC ELECTRONICS 117
delay(200);
}
textbackground(0);
textcolor(7);
}
RS-232 is the most known serial port used in transmitting the data in commu-
nication and interface. Even though a serial port is harder to program than the
parallel port, this is the most effective method in which the data transmission
requires fewer wires and less cost. The RS-232 is the communication line which
enables data transmission by only using three wire links. The three links provide
‘transmit,’ ‘receive,’ and common ground.
The ‘transmit’ and ‘receive’ line on this connecter send and receive data be-
tween the computers. As the name indicates, the data is transmitted serially. The
two pins are TXD & RXD. There are other lines on this port such as RTS, CTS,
DSR, DTR, and RTS, RI. The ‘1’ and ‘0’ are the data which defines a voltage
level of 3 V to 25 V and -3 V to -25 V respectively.
The electrical characteristics of the serial port as per the EIA (Electron-
ics Industry Association) RS-232C Standard specifies a maximum baud rate
of 20,000bps, which is slow compared to today’s standard speed. For this
reason, we have chosen the new RS-232D Standard, which was recently re-
leased.
The RS-232D has existed in two types, i.e., D-Type 25-pin connector and
D-Type 9-pin connector, which are male connectors on the back of the PC. You
need a female connector on your communication from host to guest computer.
The pin outs of both D-9 & D-25 are shown in Table 3.10.
TABLE 3.10
D-type 9- D-type 25- Pin outs Function
pin no. pin no.
3 2 RD Receive data (serial data input)
2 3 TD Transmit data (serial data output)
7 4 RTS Request to send (acknowledge to modem that UART
is ready to exchange data)
8 5 CTS Clear to send (i.e., modem is ready to exchange data)
6 6 DSR Data ready state (UART establishes a link)
5 7 SG Signal ground
1 8 DCD Data carrier detect (this line is active when modem
detects a carrier)
4 20 DTR Data terminal ready
9 22 RI Ring Indicator (becomes active when modem detects
ringing signal from PSTN)
Most people today will have 28.8K or 33.6K modems. Therefore, we should
expect the DCE to DCE speed to be either 28.8K or 33.6K. Considering the
high speed of the modem we should expect the DTE to DCE speed to be about
115,200 BPS (maximum speed of the 16550a UART). The communications pro-
gram, which we use, has settings for DCE to DTE speeds. However, the speed
is 9.6 KBPS, 144 KBPS, etc., and the modem speed.
If we were transferring that text file at 28.8K (DCE to DCE), then when
the modem compresses it you are actually transferring 115.2 KBPS between
computers and thus have a DCE to DTE speed of 115.2 KBPS. Thus, this is why
the DCE to DTE should be much higher than the modem’s connection speed.
Therefore, if our DTE to DCE speed is several times faster than our DCE to
DCE speed the PC can send data to your modem at 115,200 BPS.
Null Modem
A null modem is used to connect two DTEs together. This is used to transfer files be-
tween the computers using protocols like zmodem protocol, xmodem protocol, etc.
Figure 3.45 shows the wiring of the null modem. The main feature indicated
here is to make the computer chat with the modem rather than another compu-
ter. The guest and host computer are connected through the TD, RD, and SG
pins. Any data that is transmitted through the TD line from the host to guest is
received on the RD line. The guest computer must have the same setup as the
host. The Signal Ground (SG) line of the both must be shorted so that grounds
are common to each computer.
BASIC ELECTRONICS 119
5
5
9 9
4 4
8 8
3
3
7 7
2 2
6 6
1 1
The Data Terminal Ready (DTR) is looped back to Data Set Ready and Car-
rier Detect on both computers. When the Data Terminal Ready is asserted ac-
tive, then the Data Set Ready and Carrier Detect immediately become active.
At this point, the computer thinks the virtual modem to which it is connected, is
ready, and has detected the carrier of the other modem.
All that’s left to worry about now is the Request to Send and Clear to Send.
As both computers communicate together at the same speed, flow control is not
needed; thus these two lines are also linked together on each computer. When
the computer wishes to send data, it asserts the Request to Send high and as it
is hooked together with the Clear to Send, it immediately gets a reply that it is
OK to send and does so.
The ring indicator line is only used to tell the computer that there is a ringing
signal on the phone line. As we do not have a modem connected to the phone
line this is left disconnected.
To know about the RS-232 ports available in your computer, right-click on
“My Computer,” go to ‘Properties,’ select the tab ‘Device Manager,’ go to Ports
(COM & LPT). In that you will find ‘Communication Port(Com1),’ etc. If you
right-click on that and go to properties, you will get device status. Make sure that
you have enabled the port (use this port selected).
Using outportb()
The function outportb() sends a data byte to the port ‘PORT_ID.’ The function
outport() sends a data word. These functions can be used for any port including
serial ports, and parallel ports. Similarly, these are used to receive data.
Declaration
■ int inport(int portid);
■ unsigned char inportb(int portid);
■ void outport(int portid, int value);
■ void outportb(int portid, unsigned char value);
Remarks
■ inport works just like the 80x86 instruction IN. It reads the low byte of a
word from portid, the high byte from portid + 2.
■ inportb is a macro that reads a byte.
■ outport works just like the 80x86 instructions OUT. It writes the low byte of
a value to portid, the high byte to portid + 1.
■ outportb is a macro that writes the value argument.
portid
■ Inport — port that inport and inportb read from;
■ Outport — port that outport and outportb write to
value
■ Word that outport writes to portid;
■ Byte that outportb writes to portid.
If you call inportb or outportb when dos.h has been included, they are treat-
ed as macros that expand to inline code.
If you don’t include dos.h, or if you do include dos.h and #undef the macro(s),
you get the function(s) of the same name.
Return Value
# inport and inportb return the value read
# outport and outportb do not return
BASIC ELECTRONICS 121
Using Bioscom
The macro bioscom() and function _bios_serialcom() are used in this method in the
serial communication using an RS-232 connecter. First we have to set the port with the
settings depending on our need and availability. In this method, the same function is
used to make the settings using a control word to send data to the port and check the
status of the port. These actions are distinguished using the first parameter of the func-
tion. Along with that we are sending data and the port to be used to communicate.
Here are the details of the Turbo C functions for communication ports.
Declaration
■ bioscom(int cmd, char abyte, int port)
■ _bios_serialcom(int cmd ,int port, char abyte)
■ bioscom() and _bios_serialcom() use the bios interrupt 0x14 to perform
various serial communications over the I/O ports given in port.
■ cmd: The I/O operation to be performed.
portid
Port to which data is sent or from which data is read.
0:COM1
1:COM2
2:COM3
a byte
When cmd = 2 or 3 (_COM_SEND or _COM_RECEIVE) parameter a byte is
ignored.
When cmd = 0 (_COM_INIT), a byte is an OR combination of the follow-
ing bits (one from each group). For example, if a byte = 0x8B = (0x80 | 0x08 |
0x00 | 0x03) = (_COM_1200 | _COM_ODDPARITY | _COM_STOP1 | _COM_
CHR8). The communications port is set to:
TABLE 3.11
cmd (boiscom) cmd(_bios_serialcom) Action
0 _COM_INIT Initialize the parameters to the port
1 _COM_SEND Send the character to the port
2 _COM_RECEIVE Receive character from the port
3 _COM_STATUS Returns the current status of the
communication port
122 ROBOTICS
TABLE 3.12
value of abyte Meaning
Bioscom _bios_serialcom
0x02 _COM_CHR7 7 data bits
0x03 _COM_CHR8 8 data bits
0x00 _COM_STOP1 1 stop bit
0x04 _COM_STOP2 2 stop bits
0x00 _COM_NOPARITY No parity
0x08 _COM_ODDPARITY Odd parity
0X10 _COM_EVENPARITY Even parity
0x00 _COM_110 110 baud
0x20 _COM_150 150 baud
0x40 _COM_300 300 baud
0x60 _COM_600 600 baud
0x80 _COM_1200 1200 baud
0xA0 _COM_2400 2400 baud
0xC0 _COM_4800 4800 baud
0xE0 _COM_9600 9600 baud
To initialize the port with the above settings we have to write, bioscom(0, 0x8B,
0). To send a data to COM1, the format of the function will be bioscom(1, data,
0). Similarly, bioscom(1, 0, 0) will read a data byte from the port.
The following example illustrates how to serial port programs. When data is
available in the port, it inputs the data and displays it onto the screen and if a key
is pressed the ASCII value will be sent to the port.
#include <bios.h>
#include <conio.h>
#define COM1 0
#define DATA_READY 0x100
#define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)
int main(void)
{
int in, out, status;
bioscom(0, SETTINGS, COM1); /*initialize the port*/
cprintf(“Data sent to you: “);
BASIC ELECTRONICS 123
while (1)
{
status = bioscom(3, 0, COM1); /*wait until get a data*/
if (status & DATA_READY)
if ((out = bioscom(2, 0, COM1) & 0x7F) != 0) /*in-
put a data*/
putch(out);
if (kbhit())
{
if ((in = getch()) == 27) /* ASCII of Esc*
break;
bioscom(1, in, COM1); /*output a data*/
}
}
return 0;
}
When you compile and run the above program in both computers, the char-
acters typed in one computer should appear on the other computer screen and
vice versa. Initially, we set the port to the desired settings as defined in macro
settings. Then we wait in an idle loop until a key is pressed or a data is available
on the port. If any key is pressed, then the kbhit() function returns a nonzero
value. Then we send it to the com port. Similarly, if any data is available on the
port, we receive it from the port and display it on the screen.
To check the port, if you have a single computer, you can use a loop-back
connection as follows. This is the most commonly used method for developing
communication programs. Here, data is transmitted to that port itself.
If you run the above program with the connection as in Figure 3.46, the
character entered in the keyboard should be displayed on the screen. This
5
9
4
8
3
7
2
6
method is helpful in writing serial port programs with a single computer. Also,
you can make changes in the port id if your computer has 2 RS-232 ports. You
can connect the com1 port to com2 of the same computer and change the
port id in the program. The data sent to the com1 port should come to the
com2 port. Then whatever you also type on the keyboard should appear on the
screen.
Before one uses the microcontroller, he or she should be well aware of the
connections of the microcontroller, like which pins are to be used as data pins
and which pin is to be given the power supply. Every pin of the microcontrol-
ler has a specific function and a wrong connection can completely destroy the
chip. The AT89C51 microcontrollers have, in total, 40 pins. Here we will be
demonstrating the pin configuration of the 8051 microcontroller. It has an on-
chip RAM capacity of 128 bytes and ROM size is 4k. But the total ROM size
with which it can work is 64k. So when we have programs of size more than 4k,
external memory is added to it as per our requirement. If the requirement is of
8k, we can go for an external ROM of size 4k such that it makes a total ROM
size of 8k (4k internal + 4k external). In this way we can go for 8k, 16k, 32k,
and 64k ROM sizes.
We have different commands for using these memories. Accordingly some
of the connections are to be changed. For example, if our program size is below
4k then the 31st pin, which is for external access, is to be given a power supply of
5 volts (an active low pin) but while using external memory we have to ground
this pin. We can also use both internal as well as external memories simultane-
ously, in that case the pin is to be given a power supply of 5 volts because the
microcontroller firstly reads internal ROM then goes for external ones.
8051 microcontrollers do have an internal oscillator but to run it, it needs
external clock pulses so an external oscillator is added between pins 18 (XTAL1)
and 19 (XTAL2). It also requires two capacitors of 30 pF value. One side of each
capacitor is grounded.
It must be noted that there are various speeds of the 8051 family. Speed re-
fers to the maximum oscillator frequency connected to the XTAL. For example,
a 12 MHz chip must be connected to a crystal with a 12 MHz frequency or less.
Likewise, a 20 MHz microcontroller requires a crystal frequency of no more
than 20 MHz. When the 8051 is connected to a crystal oscillator and is powered
up, we can observe the frequency on the XTAL2 pin using the oscilloscope.
Pin 40 of the microcontroller is given a power supply of +5 volts using a
single stranded wire; this provides supply voltage to the chip. Pin 20 of the mi-
crocontroller is grounded.
BASIC ELECTRONICS 125
8051
P1.0 1 40 VCC
P1.1 2 39 P0.0/AD0
P1.2 3 38 P0.1/AD1
P1.3 4 37 P0.2/AD2
P1.4 5 36 P0.3/AD3
P1.5 6 35 P0.4/AD4
P1.6 7 34 P0.5/AD5
P1.7 8 33 P0.6/AD6
RST 9 32 P0.7/AD7
RxD/P3.0 10 31 EA
TxD/P3.1 11 30 ALE
INTO/P3.2 12 29 PSEN
INT1/P3.3 13 28 P2.7/A15
T0/P3.4 14 27 P2.6/A14
T1/P3.5 15 26 P2.5/A13
WR/P3.6 16 25 P2.4/A12
RD/P3.7 17 24 P2.3/A11
XTAL2 18 23 P2.2/A10
XTAL1 19 22 P2.1/A9
VSS 20 21 P2.0/A8
as to burn the program it can first be written on a simulator like Keil C and its
accuracy can be checked by debugging it there. Now the program can be burned
on the microcontroller with the help of a programmer.
After the microcontroller is loaded with the program, it can be kept in the
proper circuit with accurate connections and LEDs start glowing.
3.8 ACTUATORS
Housing
Lower Chamber
Spring
Local Position
Indicator
Stem
Control Value
The position of the valve is controlled by varying the air supply pressure in the
upper chamber. This results in a varying force on the top of the diaphragm. Initially,
with no air supply, the spring forces the diaphragm upward against the mechanical
stops and holds the valve fully open. As air supply pressure is increased from zero, its
force on top of the diaphragm begins to overcome the opposing force of the spring.
This causes the diaphragm to move downward and the control valve to close.
With increasing air supply pressure, the diaphragm will continue to move
downward and compress the spring until the control valve is fully closed. Con-
versely, if air supply pressure is decreased, the spring will begin to force the di-
aphragm upward and open the control valve. Additionally, if supply pressure is
held constant at some value between zero and maximum, the valve will position
at an intermediate position. Therefore, the valve can be positioned anywhere be-
tween fully open and fully closed in response to changes in air supply pressure.
A positioner is a device that regulates the air supply pressure to a pneu-
matic actuator. It does this by comparing the actuator’s demanded position with
the control valve’s actual position. The demanded position is transmitted by a
pneumatic or electrical control signal from a controller to the positioner. The
128 ROBOTICS
pneumatic actuator in Figure 3.49 is shown in Figure 3.50 with a controller and
positioner added.
The controller generates an output signal that represents the demanded
position. This signal is sent to the positioner. Externally, the positioner consists
of an input connection for the control signal, an air supply input connection,
an air supply output connection, an air supply vent connection, and a feedback
linkage. Internally, it contains an intricate network of electrical transducers,
airlines, valves, linkages, and necessary adjustments. Other petitioners may
also provide controls for local valve positioning and gauges to indicate air sup-
ply pressure and air control pressure (for pneumatic controllers). From an
operator’s viewpoint, a description of the complex internal workings of a posi-
tioner is not needed. Therefore, this discussion will be limited to inputs to and
outputs from the positioner.
In Figure 3.50, the controller responds to a deviation of a controlled variable
from the setpoint and varies the control output signal accordingly to correct the
Supply Air
Out Actuator
Supply Air
Vent
Feedback
Linkage
Supply Air
In
Control
Value
Control
Output
Signal
Controller
deviation. The control output signal is sent to the positioner, which responds by
increasing or decreasing the air supply to the actuator. Positioning of the actua-
tor and control valve is fed back to the positioner through the feedback linkage.
When the valve has reached the position demanded by the controller, the posi-
tioner stops the change in air supply pressure and holds the valve at the new posi-
tion. This, in turn, corrects the controlled variable’s deviation from the setpoint.
For example, as the control signal increases, a valve inside the positioner ad-
mits more air supply to the actuator. As a result, the control valve moves down-
ward. The linkage transmits the valve position information back to the position-
er. This forms a small internal feedback loop for the actuator. When the valve
reaches the position that correlates to the control signal, the linkage stops air
supply flow to the actuator. This causes the actuator to stop. On the other hand,
if the control signal decreases, another valve inside the positioner opens and al-
lows the air supply pressure to decrease by venting the air supply. This causes the
valve to move upward and open.
When the valve has opened to the proper position, the positioner stops vent-
ing air from the actuator and stops movement of the control valve.
An important safety feature is provided by the spring in an actuator. It can be
designed to position a control valve in a safe position if a loss of air supply occurs.
On a loss of air supply, the actuator in Figure 3.50 will fail to open. This type of
arrangement is referred to as “air-to-close, spring-to-open” or simply “fail-open.”
Some valves fail in the closed position. This type of actuator is referred to as “air-
to-open, spring-to-close” or “fail-closed.” This “fail-safe” concept is an important
consideration in nuclear facility design.
Hydraulic actuators: Pneumatic actuators are normally used to control
processes requiring quick and accurate responses, as they do not require a large
amount of motive force. However, when a large amount of force is required to
operate a valve (for example, the main steam system valves), hydraulic actuators
are normally used. Although hydraulic actuators come in many designs, piston
types are the most common.
A typical piston-type hydraulic actuator is shown in Figure 3.51. It consists
of a cylinder, piston, spring, hydraulic supply and returns line, and stem. The
piston slides vertically inside the cylinder and separates the cylinder into two
chambers. The upper chamber contains the spring and the lower chamber con-
tains hydraulic oil.
The hydraulic supply and return line is connected to the lower chamber and
allows hydraulic fluid to flow to and from the lower chamber of the actuator. The
stem transmits the motion of the piston to a valve.
Initially, with no hydraulic fluid pressure, the spring force holds the valve in
the closed position. As fluid enters the lower chamber, pressure in the chamber
increases. This pressure results in a force on the bottom of the piston opposite
to the force caused by the spring. When the hydraulic force is greater than the
130 ROBOTICS
Cylinder
Spring
Piston
Hydraulic Fluid
Hydraulic Supply &
Return Line
Control Value
Stem
spring force, the piston begins to move upward, the spring compresses, and the
valve begins to open. As the hydraulic pressure increases, the valve continues
to open. Conversely, as hydraulic oil is drained from the cylinder, the hydraulic
force becomes less than the spring force, the piston moves downward, and the
valve closes. By regulating the amount of oil supplied or drained from the actua-
tor, the valve can be positioned between fully open and fully closed.
The principles of operation of a hydraulic actuator are like those of the pneu-
matic actuator. Each uses some motive force to overcome spring force to move
the valve. Also, hydraulic actuators can be designed to fail-open or fail-closed to
provide a fail-safe feature.
Electric solenoid actuators: A typical electric solenoid actuator is shown
in Figure 3.52. It consists of a coil, armature, spring, and stem. The coil is con-
nected to an external current supply. The spring rests on the armature to force it
downward. The armature moves vertically inside the coil and transmits its motion
through the stem to the valve. When current flows through the coil, a magnetic
field forms around the coil. The magnetic field attracts the armature toward the
center of the coil. As the armature moves upward, the spring collapses and the
valve opens. When the circuit is opened and current stops flowing to the coil, the
magnetic field collapses. This allows the spring to expand and shut the valve.
BASIC ELECTRONICS 131
Housing
Spring
Electrical Connection
Coil
Armature
Motors
This chapter introduces several types of motors commonly used in robotic and
related applications.
3.8.1 DC Motors
DC motors are widely used in robotics because of their small size and high en-
ergy output. They are excellent for powering the drive wheels of a mobile robot
as well as powering other mechanical assemblies.
Operating Voltage
If batteries are the source of power for the motor, low operating voltages are
desirable because fewer cells are needed to obtain the specified voltage. How-
ever, the electronics to drive motors are typically more efficient at higher volt-
ages. Typical DC motors may operate on as few as 1.5 volts or up to 100 volts
or more. Roboticists often use motors that operate on 6, 12, or 24 volts be-
cause most robots are battery powered, and batteries are typically available
with these values.
Operating Current
The ideal motor would produce a great deal of power while requiring a minimum
of current. However, the current rating (in conjunction with the voltage rating)
is usually a good indication of the power output capacity of a motor. The power
input (current times voltage) is a good indicator of the mechanical power output.
Also, a given motor draws more current as it delivers more output torque. Thus,
current ratings are often given when the motor is stalled. At this point it is draw-
ing the maximum amount of current and applying maximum torque. A low-volt-
age (e.g., 12 volts or less) DC motor may draw from 100 mA to several amperes
at stall, depending on its design.
The next three ratings describe the motor’s output characteristics.
Speed
Usually, this is specified as the speed in rotations per minute (RPM) of the motor
when it is unloaded, or running freely, at its specified operating voltage. Typical
DC motors run at speeds from one to twenty thousand RPM. Motor speed can
be measured easily by mounting a disk or LEGO pulley wheel with one hole on
the motor, and using a slotted optical switch and oscilloscope to measure the
time between the switch openings.
Torque
The torque of a motor is the rotary force produced on its output shaft. When
a motor is stalled it is producing the maximum amount of torque that it can
produce. Hence the torque rating is usually taken when the motor has stalled
and is called the stall torque. The motor torque is measured in ounces-inches
(in the English system) or Newton-meters (metric). The torque of small elec-
tric motors is often given in milli-Newton-meters (mN-m) or 1/1000 of a N-m.
A rating of one ounce-inch means that the motor is exerting a tangential force
of one ounce at a radius of one inch from the center of its shaft. Torque rat-
ings may vary from less than one ounce-inch to several dozen ounce-inches for
large motors.
BASIC ELECTRONICS 133
Power
The power of a motor is the product of its speed and torque. The power output
is greatest at about halfway between the unloaded speed (maximum speed, no
torque) and the stalled state (maximum torque, no speed). The output power in
watts is about (torque) x (rpm) / 9.57.
+12
R Function
-- -----------
1 Forward
0 Stop (Coast) Relay Ground
Common
(R)
FIGURE 3.53
134 ROBOTICS
be able to accelerate quickly, but will not be operating at peak efficiency once it
has reached the maximum velocity. Remember that the wheel is part of the drive
train and gearing, and its size, the velocity desired, the motor characteristics, and
other factors all affect the optimum gear ratio. While calculations can provide a
guide, experimentation is necessary to determine the best gear-train.
H-bridge
You take a battery; hook the positive side to one side of your DC motor. Then
you connect the negative side of the battery to the other motor lead. The motor
spins forward. If you swap the battery leads the motor spins in reverse.
Ok, that’s basic. Now lets say you want a Micro Controller Unit (MCU) to
control the motor, how would you do it? Well, for starters you get a device that
would act like a solid state switch, a transistor, and hook it up to the motor.
NOTE
If you connect up these relay circuits, remember to put a diode across the
coil of the relay. This will keep the spike voltage (back EMF), coming out of the
coil of the relay, from getting into the MCU and damaging it. The anode, which
is the arrow side of the diode, should connect to ground. The bar, which is the
cathode side of the diode, should connect to the coil where the MCU connects
to the relay.
If you connect this circuit to a small hobby motor you can control the motor
with a processor (MCU, etc.). Applying a logical one, (+12 volts in our example)
to point A causes the motor to turn forward. Applying a logical zero, (ground)
causes the motor to stop turning (to coast and stop).
+12
B Fuction
-- ----------
Relay 1 Reverse
0 Stop
(B)
FIGURE 3.54
Hook the motor up in this fashion and the circuit turns the motor in reverse
when you apply a logical one (+12 volts) to point B. Apply a logical zero, which is
usually a ground, and the motor stops spinning.
If you hook up these circuits you can only get the motor to stop or turn in
one direction, forward for the first circuit or reverse for the second circuit.
BASIC ELECTRONICS 135
Motor Speed
You can also pulse the motor control line, (A or B) on and off. This powers the
motor in short bursts and gets varying degrees of torque, which usually translates
into variable motor speed.
But if you want to be able to control the motor in both forward and reverse
with a processor, you will need more circuitry. You will need an H-bridge. Notice
the “H”-looking configuration in Figure 3.55. Relays configured in this fashion
make an H-bridge. The “high side drivers” are the relays that control the positive
voltage to the motor. This is called sourcing current.
The “low side drivers” are the relays that control the negative voltage to sink
current to the motor. “Sinking current” is the term for connecting the circuit to
the negative side of the power supply, which is usually ground.
So, you turn on the upper left and lower right circuits, and power flows
through the motor forward, i.e., 1 to A, 0 to B, 0 to C, and 1 to D.
Then for reverse you turn on the upper right and lower left circuits and pow-
er flows through the motor in reverse, i.e., 0 to A, 1 to B, 1 to C, and 0 to D.
Caution: You should be careful not to turn on both circuits on one side and
the other, or you have a direct short which will destroy your circuit; for example:
A and C or B and D both high (logical 1).
+12 +12
Relay Relay
(R) (B)
+12
Relay Relay
(C) (D)
A B C D Function
------ ------------
1 0 0 1 Forward
0 1 1 0 Reverse
1 1 0 0 Brake
0 0 1 1 Brake
1 0 1 0 Fuse Test : -)
0 1 0 1 Fuse Test : -)
Don’e de the Fuse bests
FIGURE 3.55
136 ROBOTICS
+12 +12
Relay Relay
(A) (B)
A B C D Function
- - - - -----------
1 0 0 1 Forward
FIGURE 3.56
Semiconductor H-bridges
We can better control our motor by using transistors or Field Effect Transistors
(FETs). Most of what we have discussed about the H-bridge relays is true of
these circuits. You don’t need diodes that were across the relay coils now. You
should use diodes across your transistors though. See Figure 3.56 see how they
are connected.
These solid state circuits provide power and ground connections to the motor,
as did the relay circuits. The high side drivers need to be current “sources” which is
what PNP transistors and P-channel FETs are good at. The low side drivers need to
be current “sinks” which is what NPN transistors and N-channel FETs are good at.
If you turn on the two upper circuits, the motor resists turning, so you ef-
fectively have a breaking mechanism. The same is true if you turn on both of
the lower circuits. This is because the motor is a generator and when it turns it
generates a voltage. If the terminals of the motor are connected (shorted), then
the voltage generated counteracts the motors freedom to turn. It is as if you are
applying a similar but opposite voltage to the one generated by the motor being
turned. Vis-á-vis, it acts like a brake.
To be nice to your transistors, you should add diodes to catch the back volt-
age that is generated by the motor’s coil when the power is switched on and off.
This flyback voltage can be many times higher than the supply voltage! If you
don’t use diodes, you could burn out your transistors.
BASIC ELECTRONICS 137
+12 +12
Relay Relay
(A) (B)
Relay Relay
(C) (D)
ABCD Function
- - - - - - --------------
0 1 1 0 Reverse
FIGURE 3.57
+12 +12
PNP PNP
(A) (B)
NPN NPN
(C) (D)
Ground Ground
A B C D Function
------ -------------
1 0 0 1 Forward
0 1 1 0 Reverse
1 1 0 0 Brake
0 0 1 1 Brake
1 0 1 0 Fuse test : -)
0 1 0 1 Fuse test : -)
Don’t do the fuse tests
FIGURE 3.58
H-bridge Devices
The L293 has 2 H-bridges, can provide about 1 amp to each and occasional peak
loads to 2 amps. Motors typically controlled with this controller are near the size
of a 35 mm film plastic canister.
+12 +12
PNP PNP
(A) (B)
NPN NPN
(C) (D)
Ground Ground
FIGURE 3.59
BASIC ELECTRONICS 139
The L298 has 2 H-bridges on board, can handle 1 amp, and peak current draws
to about 3 amps. You often see motors between the size of a 35 mm film plastic
canister and a coke can, driven by this type of H-bridge. The LMD18200 has one
H-bridge on board, can handle about 2 or 3 amps, and can handle a peak of about
6 amps. This H-bridge chip can usually handle an average motor about the size of a
coke. There are several more commercially designed H-bridge chips as well.
There! That’s the basics about motors and H-bridges! Hope it helps and be safe!
Darlington Connection
This is two transistors connected together so that the current amplified by the
first is amplified further by the second transistor. The overall current gain is
equal to the two individual gains multiplied together:
This gives the Darlington pair a very high current gain, such as 10,000, so
that only a tiny base current is required to make the pair switch on.
A Darlington pair behaves like a single transistor with a very high
current gain. It has three leads (B, C, and E) which are equivalent to the leads
of a standard individual transistor. To turn on there must be 0.7 V across both the
base-emitter junctions who are connected in series inside the Darlington pair,
therefore it requires 1.4 V to turn on.
Ry Ry
FIGURE 3.60
140 ROBOTICS
Darlington pairs are available as complete packages but you can make up
your own from two transistors; TR1 can be a low power type, but normally TR2
will need to be high power. The maximum collector current Ic(max) for the pair
is the same as Ic(max) for TR2.
A Darlington pair is sufficiently sensitive to respond to the small current
passed by your skin and it can be used to make a touch-switch as shown in
Figure 3.61. For this circuit, which just lights an LED, the two transistors can
be any general-purpose low-power transistors. The 100kΩ resistor protects the
transistors if the contacts are linked with a piece of wire.
Vcc +5 to 15 volts
100K 10M 8 4
7
3
6
2 555
LED
100uf
1K
1 Buzzer
Touch
Plate
Touch Switch
motor on
25% Duty
Cycle
motor off
1/125 sec.
Figure 3.62 illustrates this concept, showing pulse width modulation signals
to operate a motor at 75%, 50%, and 25% of the full power potential.
A wide range of frequencies could be used for the pulse width modulation
signal. The ELEC 201 system software used to control the motors operates at
1,000 Hertz.
A PWM waveform consisting of eight bits, each of which may be on or off,
is used to control the motor. Every 1/1000 of a second, a control bit determines
whether the motor is enabled or disabled. Every 1/125 of a second the waveform
is repeated. Therefore, the control bit make 8 checks per cycle, meaning the
PWM waveform may be adjusted to eight power levels between off and full on.
This provides the RoboBoard with eight motor speeds.
+ ve
A B C D
D1 D2 D3 D4
Q1 Q2 Q3 Q4
D1 - D4 are 1 N4001
Q1 - Q4 are SL100
1K 1K 1K 1K
XOR1
1
D0
3 D1
2 1 2
N1
4 3
N2
FIGURE 3.63
reversing the order that the coils are powered, a stepper motor can be made to
reverse direction. The rate at which the coils are respectively energized deter-
mines the velocity of the motor up to a physical limit. Typical stepper motors
have two or four coils. Anyway, here is a very simple stepper controller shown in
Figure 3.63.
anticipated stop position. The only way to effectively use a DC motor for pre-
cise positioning is to use a servo. Servos usually implement a small DC motor, a
feedback mechanism (usually a potentiometer attached to the shaft by gearing
or other means), and a control circuit which compares the position of the motor
with the desired position, and moves the motor accordingly. This can get fairly
complex and expensive for most hobby applications.
Stepper motors, however, behave differently than standard DC motors. First
of all, they cannot run freely by themselves. Stepper motors do as their name sug-
gests—they “step” a little bit at a time. Stepper motors also differ from DC motors in
their torque-speed relationship. DC motors generally are not very good at producing
high torque at low speeds, without the aid of a gearing mechanism. Stepper motors,
on the other hand, work in the opposite manner. They produce the highest torque at
low speeds. Stepper motors also have another characteristic, holding torque, which is
not present in DC motors. Holding torque allows a stepper motor to hold its position
firmly when not turning. This can be useful for applications where the motor may
be starting and stopping, while the force acting against the motor remains present.
This eliminates the need for a mechanical brake mechanism. Steppers don’t simply
respond to a clock signal, they have several windings which need to be energized in
the correct sequence before the motor’s shaft will rotate. Reversing the order of the
sequence will cause the motor to rotate the other way. If the control signals are not
sent in the correct order, the motor will not turn properly. It may simply buzz and
not move, or it may actually turn, but in a rough or jerky manner. A circuit which is
responsible for converting step and direction signals into winding energization pat-
terns is called a translator. Most stepper motor control systems include a driver in
addition to the translator, to handle the current drawn by the motor’s windings.
Figure 3.64 shows a basic example of the “translator + driver” type of con-
figuration. Notice the separate voltages for logic and for the stepper motor. Usu-
ally the motor will require a different voltage than the logic portion of the sys-
tem. Typically, logic voltage is +5 Vdc and the stepper motor voltage can range
V LOGIC V MOTOR
Power
Drivers
Stepper
Motor
Translator
from +5 Vdc up to about +48 Vdc. The driver is also an “open collector” driver,
wherein it takes its outputs to GND to activate the motor’s windings. Most semi-
conductor circuits are more capable of sinking (providing a GND or negative
voltage) than sourcing (outputting a positive voltage).
Voltage
Stepper motors usually have a voltage rating. This is either printed directly
on the unit, or is specified in the motor’s datasheet. Exceeding the rated
voltage is sometimes necessary to obtain the desired torque from a given
motor, but doing so may produce excessive heat and/or shorten the life of
the motor.
Resistance
Resistance-per-winding is another characteristic of a stepper motor. This re-
sistance will determine current draw of the motor, as well as affect the motor’s
torque curve and maximum operating speed.
1/6
7407 TIP110 A1
1k
TO STEPPER MOTOR
A1 IN4001
FROM TRANSLATOR
A2
1k
A2
B1
1k
B1
B2
1k
B2
FIGURE 3.65 A typical unipolar stepper motor driver circuit. Note the 4 back EMF protection diodes.
a
Index 1a 1b 2a 2b
1 1 0 0 0
Clockwise Rotation
2 0 1 0 0
1 2a 3 0 0 1 0
4 0 0 0 1
1b 2b 5 1 0 0 0
6 0 1 0 0
7 0 0 1
8 0 0 0 1
b
FIGURE 3.66 Unipolar stepper motor coil setup (left) and 1-phase drive pattern (right).
Index 1a 1b 2a 2b Index 1a 1b 2a 2b
Clockwise Rotation
Clockwise Rotation
1 1 0 0 1 1 1 0 0 0
2 1 1 0 0 2 1 1 0 0
3 0 1 1 0 3 0 1 0 0
4 0 0 1 1 4 0 1 1 0
5 1 0 0 1 5 0 0 1 0
6 1 1 0 0 6 0 0 1 1
7 0 1 1 0 7 0 0 0 1
8 0 0 1 1 8 1 0 0 1
9 1 0 0 0
Alternate Full-Step Sequence
10 1 1 0 0
(Provides more torque)
11 0 1 0 0
12 0 1 1 0
13 0 0 1 0
14 0 0 1 1
15 0 0 0 1
16 1 0 0 1
Half-Step Sequence
FIGURE 3.67 Two-phase stepping sequence (left) and half-step sequence (right).
BASIC ELECTRONICS 147
Index 1a 1b 2b 2b
Clockwise Rotation
1 + – – –
2 – + – –
1a 2a 3 – – + –
4 – – – +
1b 2b 5 + – – –
6 + – –
7 – – + –
8 – – – +
FIGURE 3.68 Bipolar stepper motor coil setup (left) and drive pattern (right).
+12v
7486
A
1k
Control
Inputs
1k
IN4004 B
TIP110
1 2
Coil Polarity
A B 1 2
0 0 0 0
0 1 – +
1 0 + –
1 1 0 0
H-Bridge Operation
FIGURE 3.69 A typical H-bridge circuit. The 4 diodes clamp inductive kickback.
Common
Index 1 2 3 4
Clockwise Rotation
1 1 0 0 0
1 2 0 1 0 0
3 0 0 1 0
2 4 0 0 0 1
3 5 1 0 0 0
6 0 1 0 0
4
7 0 0 1 0
n 8 0 0 0 1
FIGURE 3.70 Variable reluctance stepper motor coil setup (left) and drive pattern (right).
BASIC ELECTRONICS 149
is simply to energize each of the windings in order, one after the other (see drive
pattern table below). This type of stepper motor will often have only one lead,
which is the common lead for all the other leads. This type of motor feels like a
DC motor when the shaft is spun by hand; it turns freely and you cannot feel the
steps. This type of stepper motor is not permanently magnetized like its unipolar
and bipolar counterparts.
+5v
1k Vss
STEP CLK EN
Q4 1A
TO DRIVER
CD4017
1B
2A
Q4 2B
RST
Vdd
1k
+12v
16
Vdd
10 15
J Q 1A
1k x 2 4070 4027
14 (1/4) (1/2)
13
11 8
10 11 14
TO DRIVER
DIR K Q 1B
12
9 CLK
STEP
13
2 3
3 5 6 CLK 1
4 J Q 2A
1 7
6 4027
(1/2)
5 K Q 2 2B
Vss
8
FIGURE 3.72 A simple, bidirectional, two-phase drive stepper motor translator circuit.
be the case when you reverse the direction and continue stepping, the motor will
advance one more step in the previous direction it was going before responding.
As always, prototype this circuit to be sure it will work for your application be-
fore you build anything with it.
There are several standard stepper motor translation circuits that use discrete
logic ICs. Below you will find yet another one of these. The circuit in Figure 3.73
has not been tested, but theoretically should work without problems.
Words of Caution
When making connections to either a PC parallel port, or I/O pins of a microcon-
troller, be sure to isolate the motor well. High-voltage spikes of several hundred
volts are possible as back EMF from the stepper motor coils. Always use clamp-
ing diodes to short these spikes back to the motor’s power bus. The use of optical
isolation devices (optoisolators) will add yet another layer or protection between
the delicate control logic and the high-voltage potentials which may be present
in the power output stage. Whenever possible, use separate power supplies for
the motor and the translator/microcontroller. This further reduces the chance
of destructive voltages reaching the controller, and reduces or eliminates power
supply noise that may be introduced by the motor.
BASIC ELECTRONICS 151
+5v
Vcc Vcc
DIR S 1I0 CLR Q 1A
2Y D Q 1B
TO DRIVER
CLK
2I0
2I1
EN 1Y 74LS74
GND CLK (1/2)
CLR Q 2A
PR
D Q 2B
GND
FIGURE 3.73 Another example of a two-phase drive translator circuit, this time using a
multiplexer.
method of controlling a motor can also be useful where the hardware is not criti-
cal at first and a simple interface is needed to allow more time to be spent on the
development of the software before the hardware is refined.
Period 18 ms
1 ms Pulse Train
1 ms Pulse Servo Motor Position
Left
2 ms Pulse Train
Servo Motor Position
2 ms Pulse Right
FIGURE 3.74
BASIC ELECTRONICS 153
Servo Motors
Servo motors incorporate several components into one device package:
■ a small DC motor;
■ a gear reduction drive for torque increase;
■ an electronic shaft position sensing and control circuit.
The output shaft of a servo motor does not rotate freely, but rather is com-
manded to move to a particular angular position. The electronic sensing and
control circuitry—the servo feedback control loop—drives the motor to move
the shaft to the commanded position. If the position is outside the range of
movement of the shaft, or if the resisting torque on the shaft is too great, the
motor will continue trying to attain the commanded position.
Servo motors are used in model radio-controlled airplanes and helicopters to
control the position of wing flaps and other flight control mechanisms.
shaft. Most servo shafts have a 180-degree range of rotation. The control
pulse must repeat every 20 milliseconds. This pulse signal will cause the shaft
to locate itself at the midway position +/-90 degrees. The shaft rotation on
a servo motor is limited to approximately 180 degrees (+/-90 degrees from
center position). A 1 ms pulse will rotate the shaft all the way to the left,
while a 2 ms pulse will turn the shaft all the way to the right. By varying the
pulse width between 1 and 2 ms, the servo motor shaft can be rotated to any
degree position within its range.
Chapter 4 WHEELED MOBILE
ROBOTS
In This Chapter
• Introduction
• Classification of Wheeled Mobile Robots (WMRs)
• Kinematics and Mathematical Modeling of WMRs
• Control of WMRs
• Simulation of WMRs Using Matlab
• The Identification and Elimination of the Problem
• Modifying the Model to Make the Variation in Delta
Continuous
• Developing the Software and Hardware Model of an All-
Purpose Research WMR
4.1 INTRODUCTION
W
heeled Mobile Robots (WMRs) have been an active area of research
and development over the past three decades. This long-term interest
has been mainly fueled by the myriad of practical applications that
can be uniquely addressed by mobile robots due to their ability to work in large
(potentially unstructured and hazardous) domains.
WMRs are increasingly present in industrial and service robotics, particular-
ly when flexible motion capabilities are required on reasonably smooth grounds
and surfaces. Several mobility configurations (wheel number and type, their lo-
cation and actuation, single- or multibody vehicle structure) can be found in the
applications.
155
156 ROBOTICS
Mobile robots have quite simple mathematical models to describe their in-
stantaneous motion capabilities; especially compared to serial, parallel, and hu-
manoid robots. However, this only holds for single mobile robots only, because
the modeling does become complex as soon as one begins to add trailers to mobile
robots. Airport luggage carts are good examples of such mobile robot trains.
The wheeled mobile robots can have a large number of possible wheel con-
figurations and kinematic designs. Each type of configuration has its merits and
demerits with respect to the application. The following is the classification of
WMRs according to their wheel geometry.
(a) (b)
the other. The robot rotates about the fixed wheel. Sharp turning can be attained
by rotating both the wheels in opposite directions. Motion along an arc can be at-
tained by the differential motion of both the wheels with respect to each other.
Figure 4.1 represents a general arrangement of a differentially driven
wheeled mobile robot.
l
d
Y
Y
x
X
Passive Wheels
θ θSA 0i
°
P2
d
Y
P1 X
FIGURE 4.3 In an Ackerman-steered vehicle, the extended axes for all wheels intersect
in a common point.
addition, reliability of the drive components is high due to the inherited stabil-
ity of a proven power train. (Significant interface problems can be encountered,
however, in retrofitting off-the-shelf vehicles intended for human drivers to ac-
commodate remote or computer control.)
1. Swedish wheel
2. Spherical wheel
Swedish wheels don’t have a vertical axis of rotation. However, they can achieve
omnidirectional motion like a castor wheel. This is possible by adding a degree of
WHEELED MOBILE ROBOTS 159
+ Forward
Motor 1
Top View
of base
Motor 3
Motor 2
R
+ +
a. b.
FIGURE 4.4 a. Schematic of the wheel assembly used by the Veterans administration
on an omnidirectional wheel chair. b. Top view of base showing relative orientation of
components in the three-wheel configuration.
freedom to the fixed standard wheel with rollers attached to the fixed standard
wheel perimeter with axes that are antiparallel to the main axis of the fixed wheel
component. The exact angle between the roller axis and the main axis can vary.
A spherical wheel does not put any constraint on the robot chassis’ kinemat-
ics. Such a mechanism has no principal axis of rotation, and therefore no appro-
priate rolling or sliding constraints exist. The omnidirectional spherical wheel
can have any arbitrary direction of movement. This kind of wheel imparts com-
plete omnidirectional property to the robot chassis. However, this type of wheel
is strictly applicable for indoor application only.
The omnidirectional wheel configuration shown in Figure 4.4(b) is based
on three wheels, each actuated by one motor. The robot has three Swedish 90-
degree wheels, arranged radially symmetrically, with the rollers perpendicular to
the each main wheel.
Upper torso
Steering Chain
Rotation shaft
Wheel Foot
Drive Chain Steering
sprocket
Power
sprocket
Steering Drive
Motor Shaft Motor Shaft
a. b.
Rover-series robots, with dedicated drive motors for each of the three wheels.
Chain- and belt-drive configurations experience some degradation in steering ac-
curacy and alignment due to uneven distribution of slack, which varies as a func-
tion of loading and direction of rotation. In addition, whenever chains (or timing
belts) are tightened to reduce such slack, the individual wheels must be realigned.
These problems are eliminated with a completely enclosed gear-drive approach.
An enclosed gear train also significantly reduces noise as well as particulate gen-
eration, the latter being very important in clean-room applications.
Referring to Figure 4.5, drive torque is transferred down through the three
steering columns to polyurethane-filled rubber tires. The drive-motor output
shaft is mechanically coupled to each of the steering-column power shafts by a
heavy-duty timing belt to ensure synchronous operation. A second timing belt
transfers the rotational output of the steering motor to the three steering col-
umns, allowing them to synchronously pivot throughout a full 360-degree range.
The sentry’s upper head assembly is mechanically coupled to the steering mech-
anism in a manner similar to that illustrated in Figure 4.5, and thus always points
in the direction of forward travel. The three-point configuration ensures good
stability and traction, while the actively driven large-diameter wheels provide
more than adequate obstacle climbing capability for indoor scenarios. The disad-
vantages of this particular implementation include odometry errors introduced
by compliance in the drive belts as well as by reactionary frictional forces exerted
by the floor surface when turning in place.
To overcome these problems, the Cybermotion K2A Navmaster robot em-
ploys an enclosed gear-drive configuration with the wheels offset from the steer-
ing axis as shown in Figure 4.6. When a foot pivots during a turn, the attached
WHEELED MOBILE ROBOTS 161
Power Shaft
90 Miter gear
r′
wheel rotates in the appropriate direction to minimize floor and tire wear, power
consumption, and slippage. Note that for correct compensation, the miter gear
on the wheel axis must be on the opposite side of the power shaft gear from the
wheel as illustrated.
Simplify
Real-world Real
Problem Model
Interpret Abstract
Mathematical
Conclusions Model
Calculate
Simulate Program
Computer
Model
FIGURE 4.7
for in the conclusions of the mathematical study and that other predictions are
subsequently verified by experiment. A typical situation would be that the set of
conclusions of the mathematical theory contains some which seem to agree and
some, which seem to disagree with the outcomes of experiments. In such a case
one has to examine every step of the process again. It usually happens that the
model-building process precedes through several iterations, each a refinement
of the preceding, until finally an acceptable one is found. Pictorially, we can rep-
resent this process as in Figure 4.7.
The solid lines in the figure indicate the process of building, developing, and
testing a mathematical model as we have outlined it above. The dashed line is used
to indicate an abbreviated version of this process, which is often used in practice.
icr
r lr
l
wheel center points is called the steer radius, [18], or instantaneous rotation
radius. Figures 4.8 and 4.9 and some simple trigonometry show that
with the wheelbase of the car-like robot, [18], (i.e., the distance between the
points where both wheels contact the ground), the steer angle, the distance be-
tween the wheels of the differentially driven robot, and its wheel velocities.
Instantaneous
center of
rotation
r IT
V1
Vr
the car forward and backward and turning the wheels, the car can be placed in the
parking space. Ignoring the restrictions caused by external objects, the car can be
located at any position with any orientation, despite lack of sideways movement.
Let us consider the robot A while it is moving. Its configuration q is a differ-
entiable function of time t. We impose that A’s motion satisfy a scalar constrain
of the following form:
where G is a smooth function and qi’ = dqi/dt for every i = 1,…, m. The velocity
vector q’= (q1’,…, qm’) is a vector of Tq(C) the tangent space of C at q. In the
absence of kinematic constraints of the form (2), the tangent space is the space
of the velocities of A.
A kinematic constraint of the form (2) is holonomic if it is integrable, i.e., if all the
velocity parameters q1’ through qm’ can be eliminated and the equation (2) rewritten
in the form (1). Otherwise, the constraint is called a nonholonomic constraint.
Definition: A nonintegrable scalar constraint of the form:
Example
Consider a car-like robot (i.e., a four-wheel front-wheel-drive vehicle) on a flat
ground. We model this robot as a rectangle moving in W=R2, as illustrated in Fig-
ure 4.10. Its configuration space is R2*S1. We represent a configuration as a triple
(a) (b)
FIGURE 4.10
WHEELED MOBILE ROBOTS 167
(x,y,θ) where (x,y)ε R2 are the coordinates of the midpoint R between the two rear
wheels and θε[0,2π] is the angle between the x-axis of the frame Fw attached to
the workspace and the main axis of the car. We assume that the contact between
each of the wheels and the ground is a pure rolling contact between two perfectly
rigid bodies. When the robot moves the point R describes a curve γ that must be
tangent to the main axis of the car. Hence, the robot’s motion is constrained by:
V
c,2
V
c,1
V V V
l m r
Vc
Vr
VI
purpose is to keep the robot in balance). In addition, Figures 4.11 and 4.12
show how an equivalent (planar) parallel robot can model car-like and differ-
entially driven mobile robots. The nonholonomic constraint is represented by
a zero actuated joint velocity vc in the leg on the wheel axles. A car-like robot
has two such constraints; a differentially driven robot has one. Since the con-
straint is nonholonomic and hence not integrable, the equivalent parallel robot
is only an instantaneous model, i.e., the base of the robots moves together with
the robots. Hence, the model is only useful for the velocity kinematics of the
mobile robots. The velocities in the two kinematic chains on the rear wheels of
the car-like robot are not independent; in the rest of this Chapter they are re-
placed by one single similar chain connected to the midpoint of the rear axle.
The equivalent car-like robot model is only an approximation, because nei-
ther of the two wheels has an orientation that corresponds exactly to the steering
angle. In fact, in order to be perfectly outlined, a steering suspension should
orient both wheels in such a way that their perpendiculars intersect the per-
pendicular of the rear axle at the same point. In practice, this is never perfectly
achieved, so one hardly uses car-like mobile robots when accurate motion is
desired. Moreover, the two wheels of a real car are driven through a differential
gear transmission, in order to divide the torques over both wheels in such a way
WHEELED MOBILE ROBOTS 169
that neither of them slips. As a result, the mean velocity of both wheels is the
velocity of the drive shaft.
In the following sections we will construct the kinematic models of the above
two types of WMRs and develop appropriate control strategies for them.
qd = S(q)* v. (4.5)
⎡ xc ⎤
⎢y ⎥
q = ⎢ c⎥ (4.6)
⎢⎣θ c ⎥⎦
e2
e3
q2 e1
ω
e3
P (q1,q2,q3)
q
1
⎡ x&c ⎤
⎢ ⎥
y&
q& = ⎢ c ⎥ (4.7)
⎢θ& ⎥
⎣ c⎦
xc(t) and yc(t) denote the position of the center of mass of the WMR along the
X and Y Cartesian coordinate frames and θ(t) represents the orientation of the
WMR, xcd(t) and ycd(t) denote the Cartesian components of the linear velocity,
the matrix S(q) is defined as follows:
⎡cos θ 0⎤
⎢ sin θ 0
⎥
S (q ) = ⎢ ⎥. (4.8)
⎢⎣ 0 1 ⎥⎦
⎡v1 ⎤ ⎡v1 ⎤
v = ⎢ ⎥ = ⎢ ⎥. (4.9)
⎣v 2 ⎦ ⎣θ d ⎦
The control objective of regulation problem is to force the actual Carte-
sian position and orientation to a constant reference position and orientation.
To quantify the regulation control objective, we define x(t), y(t), and θ(t) as the
difference between the actual Cartesian position and orientation and the refer-
ence position as follows:
xrc, yrc, and θrc represent the constant position and orientation.
Where q1, q2, and q3 are the auxiliary error of the system. Taking the deriva-
tives of the above and using the kinematic model given in equation (4.7), it can
be rewritten as follows:
q1 = v1 + v 2 e 2 (4.16)
WHEELED MOBILE ROBOTS 171
q 2 = − v2 e 2 (4.17)
q 3 = v 2. (4.18)
⎛ y − q2 ⎞
e 3 = tan−1 ⎜⎜ d ⎟⎟ − θ . (4.21)
⎝ x d − q2 ⎠
The kinematic model for the so-called kinematic wheel under the nonholo-
nomic constraint of pure rolling and nonslipping is given as follows.
q1 = v1 * cos q 3 (4.22)
172 ROBOTICS
q 2 = v1 * sin q 3 (4.23)
q 3 = v2 (4.24)
(q1d, q2d)
q2
e1
e2
q3
q1
Where,
θ1
d
only detect the car’s location with respect to the desired path. Therefore, a more use-
ful model is one that describes the car’s behavior in terms of the path coordinates.
The path coordinates are shown in Figure 4.15. The perpendicular distance
between the rear axle and the path is given by d. The angle between the car and
the tangent to the path is θp = θ – θt. The distance traveled along the path starting
at some arbitrary initial position is given by s, the arc length.
The kinematic model in terms of the kinematic model is given by,
⎡ cos θ p ⎤
⎡ ⎤
s ⎢ ⎥
⎢ 1 − dc ( s ) ⎥ ⎡0 ⎤
⎢ ⎥ ⎢0 ⎥
⎢d ⎥ ⎢ sin θ p ⎥
⎢θ ⎥ = ⎢ ⎥ υ1 + ⎢ ⎥ υ2
θ ⎢0 ⎥
⎢ p ⎥ ⎢ tan φ − p ⎥
c ( s ) cos
⎢ ⎥
⎢⎣φ ⎥⎦ ⎢ l 1 − dc ( s ) ⎥ ⎣1 ⎦
⎢ ⎥
⎣⎢ 0 ⎦⎥
where c(s) is the path’s curvature and is defined as,
dθ t
c (s) = (4.31)
ds
We will not discuss the control law for this kinematic model in this text.
WHEELED MOBILE ROBOTS 175
goal
start
start
Ep = (Ex, Ey)
trajectory
time
t
WMR) in a kinematic model as the function of time, and then modify the as-
sumed function to fit their purpose. Steering using sinusoidal input algorithms
and iterative methods come under this category. For a differentially driven ro-
bot, this type of method is very easy to implement and is very efficient as well.
But it is generally difficult to find or modify the inputs (linear speed and the
steering angle), which transfer a car-like mobile robot to a desired posture, and
hence a tracking control should be designed.
We will discuss the control of a car-type mobile robot using the trajectory
following approach here.
This can be summarized as follows. The space in the vehicle frame of refer-
ence is divided into a number of different geometric regions. The behavior of
the vehicle can be modeled in a particular way according to the presence of the
point in a particular region of space until it reaches a very close vicinity of the de-
sired point when it finally stops. Thus, the behavior of the vehicle in this model
is pretty predictable and hence various control strategies can be applied to the
model easily. The model can be described as follows.
The Model
The model as shown in Figure 4.18 is very geometric. The space is divided into
five discrete regions with respect to the vehicle frame of reference. These re-
gions can be defined as follows.
xl ≥ 0, and – ε ≤ yl ≤ ε.
This is the thin rectangular strip of width 2 ε along the longitudinal axis in the
vehicle frame of reference.
2. This portion can be defined in the vehicle Cartesian coordinate reference
plane as,
yl > ε, for xl ≥ 0
yl ≥ 0, for xl ≤ 0
and, x12 + (yl − rb)2 > rb2.
rb
5 4
This is the portion inside a circle of radius rb in the positive y plane, as shown
in the figure.
4. This portion can be defined in the vehicle Cartesian coordinate reference
plane as,
yl > ε, for xl ≥ 0
yl ≤ 0, for xl ≤ 0
and, x12 + (yl − rb)2 > rb2.
This is the portion inside a circle of radius rb in the positive y plane, as shown
in Figure 4.18.
WHEELED MOBILE ROBOTS 179
else
v = V0
end.
This means that the velocity is a constant and has a value v = V0, for all the
points in the space except for the points inside a circle of radius c. This circle is
the region in which we can choose the vehicle to finally stop. This can be chosen
as small as required for the vehicle to stop at a very close vicinity of the desired
point.
For the angular velocity control, the following conditional control strategy is
adopted. The angular velocity fed to the system is region specific. A step angular
displacement value is fed to the system as follows:
δ = 0;
δ = δ0;
δ = −δ0;
This control strategy is simulated using MATLAB. The simulation and test
results are discussed in Section 4.5.
v1 = −k1e1 (4.32)
v2 = −k2e3 + e22 sin t (4.33)
where k1 and k2 are positive constant control gains. After substituting the equa-
tions the following closed-loop error system was obtained:
The control strategy adopted here is quiet simple. The linear velocity is
directly proportional to the longitudinal error or the projected distance of the
vehicle from the destination point alone. The rate at which the wheels should
be turned is proportional to the angular orientation of the desired point with
respect to the reference frame attached to the vehicle or the angular error and
an additional time-varying term. This term plays a key role when the vehicle
gets stuck at a point. Such a situation occurs when the longitudinal error of the
vehicle vanishes and it is oriented parallel to the desired direction, but the lateral
error is not zero. In such a case, in the absence of the second term of the angu-
lar velocity control, the vehicle would get locked in that position and will fail to
move any further even though the vehicle has not reached the destination point.
So this additional term is added to the steering control term. When the vehicle
gets locked in the above-mentioned situation, this term makes the angular error
nonzero again and makes the vehicle turn a bit. This gives rise to a longitudinal
error and the velocity is again nonzero. The term is a sine function of time mul-
tiplied with the square of the lateral error. The sine term varies between –1 and
1 making this term vary in an oscillatory fashion. The lateral error term makes
WHEELED MOBILE ROBOTS 181
the quantity bigger when the lateral error is large. So, when the lateral error is
large the disturbing steer is even larger. This quantity is smaller in comparison to
the first quantity, so that the cyclic nature of the sine function does not affect the
result much. Here k1 and k2 are positive constant control gains. The above model
will be simulated using Matlab in Section 4.5.
v = vpar* e1 (4.37)
v = vpar* e1 (4.38)
⎛ vpar * e1 ⎞
q3 = ⎜ ⎟ * tan( cpar * e 3 ) (4.41)
⎝ l ⎠
The above model will be simulated using MATLAB in Section 4.5.
The behavior of the model and the control strategy can be tested if we can obtain
the trajectory of the path, when subjected to a given set of conditions. For that
182 ROBOTICS
we need to get all the values of the state variables (q1, q2, q3) at small intervals
of time, which can later be plotted to obtain the trajectory of the path followed.
Hence the above set of first-order differential equations have to be integrated
in a time interval; given the values of the initial conditions and parameters using
ode23—a powerful tool of Matlab. Ode23 is a function for the numerical solu-
tion of ordinary differential equations. It can solve simple differential equations
or simulate complex dynamical systems. It integrates a system of ordinary dif-
ferential equations using second- and third-order Runge-Kutta formulas. This
particular third-order method reduces to Simpson’s 1/3 rule and uses the third-
order estimate for xout. The process of ode23 is as follows: A string variable with
the name of the M-file that defines the differential equations to be integrated.
The function needs to compute the state derivative vector, given the current
time and state vector. It must take two input arguments; scalar t (time) and col-
umn vector q (state), and return output argument qdot, a column vector of state
derivatives. The above set of first-order differential equations was converted into
the following M-file, to execute ode23.
0
5
-1
4
-2
3
-3
2
-4
1
-5
0
-1 0 1 2 3 4 5 -5 -4 -3 -2 -1 0 1
(a) (b)
FIGURE 4.19 (a) Vehicle starting from (5, 5, 0); k1 = 1, k2 = 1; (b) Vehicle starting from
(−5, −5, 0).
WHEELED MOBILE ROBOTS 183
to the vehicle chassis. So the destination points in the plots are situated at zero
and the starting points are the longitudinal and lateral errors. In the following
plots in Figure 4.19, the vehicle starts with error values e1 and e2 as, (5, 5). The
parameters are taken as, k1 = 1 and k2 = 1.
5.5 5
5 4.5
4.5 4
4 3.5
3.5
3
3
2.5
2.5
2
2
1.5 1.5
1 1
.5 .5
-1 0 1 2 3 4 5 6 -1 0 1 2 3 4 5
FIGURE 4.20 (a) The trajectory of the vehicle when, k1 = 1; k2 =1; (b) The trajectory of
the vehicle with the optimal values of the parameters, k1 = 2; k2 =0.1.
184 ROBOTICS
6
0.7
5
0.65
4 0.6
0.55
3
0.5
0.45
2
0.4
1 0.35
0.3
0
-1 0 1 2 3 4 5 6 -0.15 -0.1 -0.05 0 0.05 0.1 0.15
(a) (b)
FIGURE 4.21 (a) The trajectory of the vehicle for 100 seconds: k1 = 1, k2 =1; (b) The magnified
view of the oscillatory nature of the motion.
WHEELED MOBILE ROBOTS 185
constant, k3, yielded desirable results. When a constant k3 was multiplied with
the sine terms, the lateral error seemed to almost reduce to zero at a much faster
rate. The result was smoother trajectory and faster motion of the vehicle. Higher
values of constant k3 yielded even better results. The final oscillations seemed to
almost come down to zero.
v1 = –k1e1 (4.42)
v2 = –k2e3 + k3e22 sin t (4.43)
5 5
4.5 4.5
4 4
3.5 3.5
3 3
2.5 2.5
2 2
1.5 1.5
1 1
0.5 0.5
0 0
-1 0 1 2 3 4 5 -1 0 1 2 3 4 5
(a) (b)
FIGURE 4.22 The trajectory of the vehicle with the modified strategy: (a) k3 = 10; and
(b) k3 = 100.
186 ROBOTICS
0.01
0.005
-0.005
-0.01
-0.015
-5 0 5 10 15 20
x 10-3
From the above discussion, it is clearly seen that the final result has been
greatly improved by the modification in the strategy. By choosing a higher value
of k3, we are actually increasing the weight of the second term in the angular
velocity control term. That means the angle now changes faster than before, and
hence the vehicle reaches to the point at a faster rate. When the desired distance
becomes very small, the angular change also becomes small. But by choosing
higher values of k3, it has become very fast and the amplitude has also increased,
which makes the steps at which the vehicle nears the destination point bigger.
But since the second term is a sine function of time it will simply fluctuate about
a mean value, with amplitude diminishing slowly.
16 2
14 0
12 -2
-4
10
-6
8
-8
6
-10
4 -12
2 -14
0 -16
0 2 4 6 8 10 12 14 16 -16 -14 -12 -10 -8 -6 -4 -2 0
(a) (b)
FIGURE 4.24 (a) Trajectory while tracing (5, 5); (b) Trajectory while tracing (-5, -5).
■ The vehicle fails to start at all when the destination point lies on the y-axis
i.e., when xdes = 0. That is because the value of ddist is zero when xdes is
equal to zero. So, the velocity v, which is directly proportional to ddist, is also
zero. Hence the vehicle does not start.
■ After reaching sufficiently close to the destination point, the vehicle goes
round about the point, instead of stopping.
These points are discussed below and the attempts taken toward solving
those problems. Here the problems are shown diagrammatically.
15.4
15.1
15.2
15.05
15
15
14.8
14.6 14.95
14.4
14.9
14.2
14.8 14.85 14.9 14.95 15 15.05 15.1 15.15 15.2 15.15 15.165 15.17 15.175 15.18 15.185 15.19
(a) (b)
FIGURE 4.25 The above figure shows how the vehicle goes round the destination point.
188 ROBOTICS
■ By choosing suitable functions for vpar and cpar and thereby controlling the
linear velocity and angular velocity in the desired way.
■ By making certain improvements in the control strategy to deal with the prob-
lem, if satisfactory results were not obtained by the above two strategies.
The above strategies are applied and tested in the above model. The objec-
tive is to smoothen the motion of the vehicle and to remove all the above-men-
tioned problems so that finally, the vehicle should be able to reach all the points
in the plane smoothly.
The angular velocity remains the same as in the previous strategy. This en-
sures that the vehicle would start at all the conditions. But then the problem now
WHEELED MOBILE ROBOTS 189
arisen due to this strategy is that the vehicle will never stop finally, even after
reaching the point. It will continue to proceed in that direction with the same
velocity v0. This problem can be solved by choosing a strategy for the vehicle to
finally stop once it comes within a given closeness of the destination point. The
strategy is as in the following: the velocity of the vehicle greater than a particular
error value would be according to the previous strategy and velocity of the vehi-
cle for error less than that value is zero. The error value is the absolute distance
of the instantaneous position value from the destination point. The strategy can
be represented as follows:
where, dist = the absolute distance of the destination point from the instantane-
ous position of the vehicle and near = the required closeness at which the vehicle
should stop.
50 0.7
45
0.6
40
35 0.5
30
0.4
25
20 0.3
15
0.2
10
0.1
5
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
(a) (b)
FIGURE 4.26 (a) Point to be traced is (0, 50): cpar = 1, and vpar = 1; (b) Point to be traced
is (0.5, 0.5): cpar = 1, and vpar = 1.
190 ROBOTICS
30
30
25
25
20
20
15
15
10
10
5 5
0 0
0 5 10 15 20 25 25 -25 -20 -15 -10 -5 0 5 10 15
(a) (b)
FIGURE 4.27 (a) Trajectory while tracing (25, 25); (b) Trajectory while tracing (-25, 25).
simulated for 10 seconds. Some plots showing some typical results are also shown
for clearer visualization of the solution. The following plots show the trajectory
of the vehicle in a plane. The points to be traced are marked with circles.
80 30
70
20
60
10
50
40 0
30
-10
20
-20
10
-30
0
0 10 20 30 40 50 60 70 80 -30 -20 -10 0 10 20 30 40
(a) (b)
FIGURE 4.28 (a) The problem occurred when c was chosen to be 0.01, which is equal
to ε; (b) The problem occurred when c was chosen to be 0.01, which is equal to ε, while
tracing the point (5, 5). The starting point and the desired point are marked.
in the plots in Figure 4.28. In the plot for the strip width and the radius of the
error-range, both are taken to be equal to 0.01.
The problems were investigated for the possible reasons of failure. A number
of predictions were made and the solutions were proposed. The first task was to
isolate the region that contained the problem.
From a lot of iterative investigation of the above plots, it was observed that
the region, which is the intersection of regions 1, 3, and 5, is the region where
the problem occurs. To ensure this intuition the above-mentioned region was
also included inside the error range, where the vehicle has to stop finally. Thus,
from simple geometrical inspection, the modified error range was found to be,
c= 2 × rb × ε . (4.45)
This improvement in the strategy was implemented and simulated. The re-
sult clearly showed the problems removed. So the strategy changes a bit. Now in
the modified strategy, the error range is not a parameter, but is predefined.
So the results clearly indicate that the problem is centered to the above-
mentioned region only. After isolating the region where the problem was cen-
tered, the next task was to investigate the real reason why that problem occurs.
192 ROBOTICS
Finally, the problem was found to be the following: when the vehicle touches re-
gion 1, the angular velocity instantly becomes zero. So the desired point, instead
of getting into region 1, lies at the boundary and slowly proceeds longitudinally.
In the vehicle frame of reference, the desired point moves along the boundary
toward the vehicle slowly. This happens because of the discontinuous nature of
the angular velocity shift. So finally, when the desired point comes to the point
where the border of the circular region intersects region 1, it behaves according
to the conditions defined for being inside region 3. Hence, it attains an angular
velocity of either +δ0 or −δ0 and instead of stopping there, it moves away from
the destination point. This way it keeps on tracing circular trajectories indefi-
nitely instead of reaching the desired point and stopping there. The problem
can be solved if the point lies within region 1 instead of lying at the boundary.
This can be done by another approach: by making the change of angular velocity
continuous instead of discrete.
In the previous strategy, the variation in angular changes was discrete, which is
not possible practically. So the model needed a modification so as to make the
process continuous. That means the angular variation will not take place in steps,
but it will take place continuously. For this a fourth state variable q4 is included
in the model. This variable is the actual angular change that takes place when a
step change in the desired angle change takes place. That means there is a time
lag now between the required value of angular change and the actual change.
This time-lag factor is taken care of by a parameter k. So now the angular change
that takes place is, rather than. The modified model is given below.
= v*cos q3 (4.46)
1
= v*sin q3 (4.47)
2
v ⎛v⎞
q3 = = ⎜ ⎟ * tan q 4
ρ ⎝l ⎠ (4.48)
q4 =
(δ d − q4)
k (4.49)
This δd is a function of the region in which it lies. It is the same step function
that was for δ. It is defined as follows.
δ = 0.
δ d = δ 0.
δd = −δ0.
60
50
40
30
20
10
0
0 5 10 15 20 25 30 35 40 45
1. Mechanical
2. Electronic
3. Software
Mechanical Subsystem
The mechanical subsystem comprises of a 4-wheeled vehicle consisting of two
driving wheels powered by two stepper motors and two castor wheels to support
the vehicle. It also includes the structure, which houses the motors, batteries,
the driver circuit, and reduction gearing mechanism.
The mechanical subsystem derives its input from the electronic subsystem,
which is basically a stepper motor driving circuit. A schematic for this driving
circuit is shown in Figure 4.30.
WHEELED MOBILE ROBOTS 195
Electronic Subsystem
The electronic subsystem consists of a driver circuit to drive two unipolar step-
per motors. A brief idea is given below. Each of the stepper motors requires four
bits of data to drive it. These data energize the various motor coils in a particular
sequence of patterns. Each pattern causes the motor to move one step. Smooth
motion results from presenting the patterns in the proper order. A circuit or pro-
gram, which is responsible for converting step and direction signals into winding
energizing patterns, is called a translator. In our system the translator consists
of the hardware of a computer and the C++ program to generate signals at the
parallel port. Our stepper motor control system includes a driver in addition to
the translator to handle the current drawn by the motor’s windings.
Figure 4.31 shows a schematic representation of the “translator + driver”
configuration. There are separate voltages for logic and for the stepper motor.
The motor will require a different voltage than the logic portion of the system.
Typically, logic voltage is +5 Vdc and the stepper motor voltage can range from
+5 Vdc up to about +48 Vdc. The driver is also an “open collector” driver, where-
in it takes its outputs to GND to activate the motor’s windings.
196 ROBOTICS
VLOGIC VMOTOR
Power
Drivers
Stepper
Motor
Translator
DB25
MALE
ULN2003 Unipolar Stepper Motor
1
14 Yellow
2 1 16
15
3
16 2 15
4
17
5 3 14
18
6 brown
19 4 13
7 black
20
8 5 12
21
red
9
22 6 11
10
23 orange
11 7 10
24
12
25 8 9 +12-24V
13
ground _
electronics-dly.com
four times. The transistor controls the current, which is much higher than the
parallel port sink capacity. This is done to allow for the motor voltage to be
independent of the PC power supply. Figure 4.32 shows the schematic repre-
sentation of the driver circuit that is used in our system. A positive voltage at the
transistor base (writing a ‘1’ to the appropriate bit at #Data) causes the transistor
to conduct. This has the effect of completing the circuit by hooking up ground
to the motor coil (which has a positive voltage on the other side). So the chosen
coil is turned on.
Switching is one of the primary uses of transistors. A power transistor is used
in the driver circuit so that it can switch lots of current (up to five amps for the
TIP 120). A Darlington transistor is really a transistor pair in a single package
with one transistor driving the other. A control signal on the base is amplified and
then drives the second transistor. The resulting circuit cannot only switch large
currents, but it can do so with a very small controlling current. The resistors are to
provide current limiting through the parallel port. The diodes are a feature typi-
cal of circuits that handle magnetic coils that are inductive circuits. In this con-
text, the motor windings are the inductive element. Inductors provide a means
for storage of electrical current. The driving current causes a magnetic field to
be built up in the coil. As soon as the drive is removed, the magnetic field col-
lapses and causes the inductor to release its stored current. Semiconductors are
particularly sensitive to these currents (they briefly become conductors and then
become permanent nonconductors). The diodes provide a mechanism to safely
shunt these currents away and, thus, protect the transistors and the computer.
1/6
7406 TIP110 A1
TO STEPPER MOTOR
1k
A1 IN4001
FROM TRANSLATOR
A2
1k
A2
B1
1k
B1
B2
1k
B2
FIGURE 4.33 The unipolar stepper motor driver circuit used in our system.
198 ROBOTICS
a
Index 1a 1b 2a 2b
Clockwise Rotation
1 1 0 0 0
2 0 1 0 0
1a 2a 3 0 0 1 0
4 0 0 0 1
1b 2b 5 1 0 0 0
6 0 1 0 0
7 0 0 1 0
8 0 0 0 1
b
FIGURE 4.34 Unipolar stepper motor coil setup (left) and 1-phase drive
pattern (right).
1. The user provides the desired destination points that the vehicle has to reach.
The software designates an initial position to the vehicle and defines a final po-
sition that the vehicle has to reach in a Cartesian coordinate reference frame.
Based on these values the software calculates a desired steering angle that the
vehicle has to rotate and the desired distance that the vehicle has to travel.
2. Based on these values, the kinematic model of the system decides what
wheel speeds have to be provided to the individual wheels. The kinematic
model will be described in detail in the next section.
3. Finally, the stepper motor driving algorithm decides the stepping rate for the
individual wheels.
4. The software interface generates a plot of the vehicle while in motion.
WHEELED MOBILE ROBOTS 199
e2
e3
e1
q2 ω
q3
P (q1, q2, q3)
q1
simply driven in opposite directions so that the vehicle revolves about its own
center.
vr = −vl
or,
vl = −vr
In combined motion mode, the trajectory that the vehicle follows is an arc.
In this mode, the vehicle progresses and simultaneously changes the direction of
motion. The relative pattern of motion of both the wheels can be derived from
the geometry and condition of nonslip. The relationship is as follows.
The following are the parameters of the vehicle.
The values generated by the above equations are the exact decimal values
and usually fractional numbers, and many times generate recurring values,
however, these values may not be achieved always, due to the following limita-
tion of the hardware. The actuation device used in the WMR i.e., stepper mo-
tors can take discrete steps only. Hence, it cannot attain all the discrete values
of angles generated by the above equations. In such a case the required value
would lie between two discrete values achievable by the motor, separated by
the step angle of the motor. So one of the ways to solve this problem could be
to choose one of the nearest values (usually the nearer) and use it in the vehi-
cle. Rounding off the actual value to the nearest achievable value with respect
to the step size can do this. The round-off algorithm can do the rounding off
operation, so that the number of steps to be turned by the motors becomes
whole numbers.
y
q1 x
q2
accurately from the kinematic relationships of the motion. This is of course un-
der the assumption that there is no slipping in the wheels and the stepper mo-
tor is strong enough not to miss any step due to insufficient torque. Sufficiently
strong stepper motors can be used to ensure that the motor provides enough
torque to overcome missing of steps. Thus the stepper motor can also generate
very accurate feedback, if modeled correctly. The above WMR is modeled in
the following manner to give feedback of its current location.
The above WMR is modeled in the following manner to give feedback. The
velocity of the center of the vehicle or the origin of the local coordinate system
attached to the vehicle is computed from the corrected velocity, (v_{Rl_{a}},v_
{Rr_{a}}) assumed by the wheels. Thus, the values of actual longitudinal velocity
v_{a}, and actual steering angle delta_{a} assumed by the vehicle in the previous
interval can be computed from the above relations.
Hence, the next position of the vehicle in the global reference frame can be
found out as,
υa υa
ω = = tan δ a
p l
202 ROBOTICS
a ⎛υa ⎞
x= × sin ⎜ × tan δ a × t ⎟
tan δ ⎝ l ⎠
l ⎛ ⎛υ ⎞⎞
y= × ⎜⎜ 1 − cos ⎜ a × tan δ a × t ⎟ ⎟⎟
tan δ ⎝ ⎝ l ⎠⎠
These values of the position coordinates give the new position and orienta-
tion of the vehicle in the global reference frame. Then this point is treated as
the instantaneous position of the vehicle, and the entire procedure is repeated
until the vehicle reaches the destination point. The vehicle is assumed to follow
the trajectory calculated by the geometry of motion flawlessly. The small error
occurring due to slip at the wheels can, however, be neglected.
Function call
step (motor ID,dir)
Yes if No
dir=0
motor, the control of three motors requires twelve bits. The parallel port
organizes data pins into two sets of 8 and 4 bits each, with port addresses
0x378. Thus port 0x378 handles two motors (for the driving wheels). The
step function itself doesn’t address the parallel port. After determining the
next sequence set for the motor to be stepped, it calls a hardware-level func-
tion, which maps the two sequence sets into the bit values of the ports.
outSignal();
The stepper motor control software contains certain additional functions for
initializing the motors, for displaying the current position of the motors, and
204 ROBOTICS
a logging function for logging all the steps and their directions taken by each
motor. For initializing the motors, the motors are given the control signals cor-
responding to the last position in the stepping sequence. This makes sure that
stepping takes place as we proceed with the first position onward.
WMR-specific Functions
The kinematic model and the actual functions for controlling the motion of
the WMR form the second aspect of the control software. This includes the
incorporation of the WMR-specific data such as the geometry, the values of the
angle, and the distance traveled in one step of the stepper motor in the form of
Make
End RTWGEN
The parameter t specifies the time, in seconds, for which the WMR has to
travel with the particular values of v and delta. The last argument distance is op-
tional and can be used to specify the distance for which the WMR has to travel
instead of specifying the time t. The choice between distance and t is based on the
strategy used for the WMR. Figure 4.38 describes the algorithm for this function.
A peculiar problem encountered in the WMR motion function is that the
only control over time is by means of the C++ delay() function. The only thing
this function is capable of is to suspend the execution of the program for the
specified duration. In order to step the rear motors independently, we need to
step the motors at appropriate timings in the step-timing array for the individual
motors. Since there is no way to execute the stepping sequence simultaneously
for the two motors, the problem is overcome by combining the step-timing ar-
rays for the individual motors into a single step-timing array. The stepping se-
quence is finally executed by calling the step() function for the particular motor
at each instant defined in the combined step-timing array.
The second function, setSteering() is called by the moveVehicle() function itself.
The moveVehicle() function passes the value of delta as argument to this function:
setSteering (delta);
This function first determines the increment in the value of the steering an-
gle delta with respect to the current value. It then makes the steering motor take
the desired number of steps to reach the new value of delta.
Plotting Functions
The plotting portion of the software produces a graphical display of the instanta-
neous positions of the WMR in a two-dimensional coordinate system. It contains
relevant functions for drawing the coordinate system, displaying the position of
the WMR at any instant, displaying auxiliary information on the screen such as
the instantaneous coordinates (q1, q2, q3), and status of the WMR motion (i.e.,
steering or moving, etc.). The most important part of the plotting functions is the
algorithm for mapping the WMR coordinate system into the screen coordinate
206 ROBOTICS
system. As opposed to the WMR coordinate system, the screen coordinate sys-
tem, i.e., the pixel positions, start at the top-left corner of the screen and increase
from left to right along the width and from top to bottom along the height. The
basic transformations for mapping the WMR coordinate system into the screen
coordinate system are enumerated below.
q1_p=q1*q1_SF+q1_offset;
q2_p=screen_h-(q2*q2_SF+q2_offset);
q1_p is the horizontal pixel coordinate corresponding to the q1 axis and q2_
p is the vertical pixel coordinate corresponding to the q2 axis. Thus, the WMR
coordinates (q1,q2) are mapped into the screen coordinates (q1_p,q2_p). q1_SF
and q2_SF are the scaling factors along the q1 and q2 axis respectively. q1_ off-
set and q2_offset are the horizontal and vertical offsets of the origin of the WMR
coordinates from the top-left corner of the screen. The instantaneous position of
the WMR is displayed by drawing a point at the appropriate screen coordinates.
This is done by means of a plot() function, which carries the transformation and
draws a pixel on the screen by using low-level TurboC++ graphics functions:
plot(q1,q2,special_flag).
The special_flag argument can be used to specify the color or style of the plotted
point. The plot () function is called at appropriate situations by the WMR-specific
functions when the stepping sequence of the driving rear motors is executed.
Program Organization
The control software is organized into a set of header files, which correspond to
the three components as discussed in the beginning of this chapter. In addition
to these three header files, we have the main program, which includes these
header files and which contains the strategy for the determination of the values
of v and delta. For a simple, predetermined path-following program, the main
program serves to simply input the values of v, delta, and t. The control is then
transferred to the header files. For automatic tracking, the main program con-
tains the algorithm for calculating the values of v, delta, and t in a loop, which
terminates when the desired position has been reached. The general structure
of the main program is shown in Figure 4.39.
The header files are included in the beginning of the program so that the
main program can access the functions defined in these header files. The func-
tions for initializing the motors and the graphics display are called before the
other routines. Then we have the main motion loop of the WMR in which the v
and delta are calculated according to the mode of motion i.e., trajectory tracking
WHEELED MOBILE ROBOTS 207
Include<stepper.h>
Include<wmr.h>
Include<plot.h>
main()
{
initializeMotors();
initializeGFX();
----main motion loop----
calculating u, delta;
moveVehivle(delta,v,t);
----------------------------------
closeGFX();
}
FIGURE 4.39
or automatic control. Finally, after the motion loop is executed, the graphics are
closed by calling the closeGFX () function.
Running Turtle
The C++ program for the above project is in Appendix II. The program can be
run through Turbo C in DOS. Turtle can be run with the parallel port of the
computer using the following instructions.
Step 1: Provide turtle with a 12 V regulated power supply. The red and black
wires are the positive and negative terminals of the power supply to be fed to Turtle.
Step 2: Connect the parallel port male connector with the female connector
in the CPU.
Step 3: Run the executable files in the computer to generate the signals.
Working with executable files is described in detail in the following section.
Working with Turtle through an executable file:
NT
HE C
Turtle can be run through the executable file, turtle2.exe. The file is located
D
O
L – Choosing this option generates the log.txt file in the source folder. This
file contains the information about the motion for a detailed analysis later. On
each execution a new one displaces the old log file.
208 ROBOTICS
Log staus (L) Display onscreen (D) Both (B) None (N):
D – Choosing this option shows the information of the log file on the screen,
while the execution takes place. Log file is not generated.
B – Choosing this option shows the information of the log file on the screen.
A log file is also generated.
Log staus (L) / Display onscreen (D) / Both (B) / None (N) : 1
Do you want a motion along an arc (c) or to destination points (p)? _
N – Choosing this option neither shows the information on screen, nor is the
log file generated.
Once one of these four choices is selected, the screen in Figure 4.41 ap-
pears. It asks the user for the type of motion that is desired, e.g., motion along a
circular arc or motion to destination points.
Radius – It is the required radius of the curvature of the path that Turtle is
required to travel. The value is to be entered in ‘millimeters.’
Velocity – It is the required velocity of travel of the center of location of
Turtle. The value is to be entered in ‘millimeters/second.’
Angle – It is the total angle that Turtle has to turn through. The value is to
be entered in ‘degrees.’
The screen Figure 4.42 appears when these values are entered.
Once these values are entered, the execution begins and the real-time graphi-
cal simulation of the motion in Cartesian coordinates appears on the screen. The
screen looks like the Figure 4.43 while the execution takes place.
Log staus (L) / Display onscreen (D) / Both (B) / None (N) : 1
Do you want a motion along an arc(c) or to destination points(p)? c
679
566
453
339
226
113
-899 -749 -599 -449 -299 -149 149 299 449 599 749 899
-113
-226
-339
-679
3.5,199.9, 3.1 Execution Complete
The screen in Figure 4.44 appears when these values are entered.
The log file generated:
—Interval 1 Step Log—
delta_a=1.107149, delta_a_increment=3.23646, motor F-steps=204,
with delay=10ms, in dir=0
v_a=19.98, v_Rl_a=19.98, v_Rr_a=19.98
Global coordinates of vehicle CoG: [17.74898335.801888,1.11055]
motor Rl - 55 steps
motor Rr - 55 steps
———————————
—Interval 2 Step Log—
delta_a=-0.004141, delta_a_increment=-0.015865, motor F-steps=1,
with delay=10ms, in dir=1
v_a=19.98, v_Rl_a=19.98, v_Rr_a=19.98
Global coordinates of vehicle CoG: [35.49796771.603775,1.11055]
WHEELED MOBILE ROBOTS 211
Log staus (L) / Display onscreen (D) / Both (B) / None (N) : 1
Do you want a motion along an arc (c) or to destination points (p)? p
motor Rl - 55 steps
motor Rr - 55 steps
———————————
—Interval 3 Step Log—
delta_a=-0.005293, delta_a_increment=-0.015865, motor F-steps=1,
with delay=10ms, in dir=1
v_a=19.98, v_Rl_a=19.98, v_Rr_a=19.98
Global coordinates of vehicle CoG: [53.246952107.405663,1.11055]
motor Rl - 55 steps
motor Rr - 55 steps
———————————
—Interval 4 Step Log—
delta_a=-0.007332, delta_a_increment=-0.015865, motor F-steps=1,
with delay=10ms, in dir=1
v_a=19.98, v_Rl_a=19.98, v_Rr_a=19.98
Global coordinates of vehicle CoG: [70.995934143.20755,1.11055]
motor Rl - 55 steps
motor Rr - 55 steps
———————————
—Interval 5 Step Log—
delta_a=-0.011927, delta_a_increment=-0.03173, motor F-steps=2, with
delay=10ms, in dir=1
v_a=20.35, v_Rl_a=20.35, v_Rr_a=20.35
212 ROBOTICS
679
566
453
339
226
113
-899 -749 -599 -449 -299 -149 149 299 449 599 899 749
-113
-226
-339
-679
99.6, 100.2, 0.8 Execution Complete
M
NT
HE C
ost robotic manipulators are strong rigid devices with powerful mo-
D
O
tors, strong gearing systems, and very accurate models of the dynamic
response. For undemanding tasks it is possible to precompute and ap-
ply the forces needed to obtain a given velocity. This control is called computed
torque control. Alternatively, a high-gain feedback on joint angle control leads
to an adequate tracking performance. The important control problem is one
of understanding and controlling the manipulator kinematics. Very few robots
are regularly pushed to the limit where the dynamic model becomes important
since this will lead to greatly reduce operational life and high maintenance costs.
In this chapter we consider that part of the manipulator kinematics known as
forward kinematics.
213
214 ROBOTICS
z P (x, y, z)
O y
x
⎡ nx sx ax px ⎤ ⎡ px ⎤
⎢ py ⎥⎥ ⎢p ⎥
⎡ n s a P ⎤ ⎢ ny sy ay ⎢ y⎥
F =⎢ ⎥ =
pz ⎥ where, P = ⎢ p ⎥
⎣0 0 0 1 ⎦ ⎢ nz sz az z
⎢ ⎥ ⎢ ⎥
⎣0 0 0 1⎦ 1
⎣ ⎦
Y O
(VN7VO)
VX
Y NO VO
V
P
N
X VN
PX
⎡V X ⎤ ⎡V N ⎤ ⎡P ⎤
V XY
=⎢ Y⎥ V NO
=⎢ O⎥ P =⎢ x⎥
⎢⎣V ⎥⎦ ⎢⎣V ⎥⎦ ⎣0 ⎦
NO VO
V
VX
Y N
VN
XY
P
X
⎡PX ⎤
= ⎢ ⎥
XY
Y P
XY NO ⎡P + V N ⎤ ⎣PY ⎦
V = P +V =⎢ X O⎥
⎣PY + V ⎦
X
Y Z
O
O
V
V N
VY
N
V
?
X
VX
⎡V X ⎤ ⎡ V N⎤
V XY = ⎢ Y ⎥ V NO = ⎢ O ⎥
⎣⎢V ⎦⎥ ⎣V ⎦
V X = V XY cos α = V NO cos α = V NO • x
V X = ( VN * n + V O * o ) • x
V X = V N (x • n) + VO (x • o ) (Substituting for VNO using the N
= VN (cos θ) + V O (cos( θ + 90 )) and O components of the vector.)
= VN (cos θ) − V O (sin θ)
Similarly...
KINEMATICS OF ROBOTIC MANIPULATORS 217
V Y = V NO sin α = V NO cos( 90 − α ) = V NO • y
V Y = (V N * n + V O * o ) • y
V Y = V N ( y • n) + V O ( y • o )
= V N (cos( 90 − θ)) + V O (cos θ)
= V N (sin θ) − V O (cos θ).
So...
V X = V N (cos θ) − V O (sin θ) ⎡V X ⎤
V XY = ⎢ Y ⎥ .
V Y = V N (sin θ) + V O (cos θ) ⎢⎣V ⎥⎦
XY
⎡V X ⎤ ⎡cos θ − sin θ⎤ ⎡ V N ⎤
V =⎢ Y⎥ =⎢ ⎢ ⎥ Rotation matrix about the z-axis.
⎢⎣V ⎥⎦ ⎣sin θ cos θ ⎥⎦ ⎢⎣ V O ⎥⎦
Now generalizing the results for three dimensions, the rotation between two
frames about different axes are:
– Rotation about the x-axis with
⎡1 0 0 ⎤
Rot( x,θ ) = ⎢⎢0 Cθ − Sθ ⎥⎥ .
⎢⎣0 Sθ Cθ ⎥⎦
⎡ Cθ 0 Sθ ⎤
Rot( y, θ ) = ⎢⎢ 0 1 0 ⎥⎥ .
⎢⎣− Sθ 0 Cθ ⎥⎦
⎡Cθ − Sθ 0⎤
Rot ( z, θ ) = ⎢⎢ Sθ Cθ 0 ⎥⎥ .
⎢⎣ 0 0 1 ⎥⎦
218 ROBOTICS
Where,
C θ= Cos
S = Sin
a general rotation between any two frames can be represented as:
z
w
P
v
y
u
⎡ px ⎤ ⎡ i x ⋅ i u i x ⋅ jv i x ⋅ k w ⎤ ⎡ pu ⎤
Pxyz= ⎢⎢ p y ⎥⎥ = ⎢⎢ jy ⋅ i u j y ⋅ jv jy ⋅ k w ⎥⎥ ⎢⎢ pv ⎥⎥ = RPuvw
⎢⎣ pz ⎥⎦ ⎢⎣k z ⋅ i u k z ⋅ jv k z ⋅ k w ⎥⎦ ⎢⎣ pw ⎥⎦
Y1
O
(VN,VO)
Y0
VNO N
VXY
?
X1
P
Translation along P followed by rotation by
0
X
KINEMATICS OF ROBOTIC MANIPULATORS 219
(Note: Px, Py are relative to the original coordinate frame. Translation fol-
lowed by rotation is different than rotation followed by translation.)
In other words, knowing the coordinates of a point (VN, VO) in some coor-
dinate frame (NO) you can find the position of that point relative to your original
coordinate frame (XOYO).
⎡V X
⎤ ⎡ P x ⎤ ⎡ cos θ − sin θ ⎤ ⎡ V N
⎤ What we found by
= ⎢ ⎥ = ⎢ ⎥+ ⎢
XY
V ⎢ ⎥ doing a translation
⎢⎣ V
Y
⎥⎦ ⎣ P y ⎦ ⎣ sin θ cos θ ⎥⎦ ⎢⎣ V O
⎥⎦ and a rotation.
⎡V X
⎤ ⎡ Px ⎤ ⎡ cos θ − sin θ 0 ⎤ ⎡ V
N
⎤
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ Padding with 0s
= ⎢V Y
⎥ = ⎢Py ⎥ +
⎢ sin θ
⎢ cos θ 0 ⎥⎥ ⎢ V O
⎥ and 1s.
⎢1 ⎥ ⎢1 ⎥ ⎢⎣ 0 0 0 ⎥⎦ ⎢1 ⎥
⎣ ⎦ ⎣ ⎦ ⎣ ⎦
⎡V ⎤ ⎡ cos θ − sin θ P x ⎤ ⎡ V ⎤
X N
⎢ ⎥ ⎢ ⎥⎢ ⎥ Simplifying into a
= ⎢V ⎥ = ⎢ sin θ cos θ P y ⎥ ⎢ V O ⎥
Y
matrix form.
⎢1
⎣
⎥ ⎢0
⎦ ⎣ 0 1 ⎥⎦ ⎢⎣1 ⎥⎦
r = ARB B r P + Ar o '
A P
⎡ A r P ⎤ ⎡ A RB r ⎤⎡ Br P ⎤.
A o'
⎢ ⎥=⎢ ⎥⎢ ⎥
⎣ 1 ⎦ ⎣ 01×3 1 ⎦⎣ 1 ⎦
⎡ AR r ⎤ ⎡ R3 × 3 P3 ×1⎤
A o'
A
TB = ⎢ B ⎥=⎢ .
⎣ 01× 3 1 ⎦ ⎣ 0 1 ⎥⎦
220 ROBOTICS
However, there is a standard way to carryout these steps for robot manipula-
tors; it was introduced by Denavit and Hartenberg in1955 (J. Denavit and R.S.
Hartenberg, “A Kinematic Notation for Lower-Pair Mechanisms Based on Ma-
trices,” Journal of Applied Mechanics, pp. 215–221, June 1955.) The key ele-
ment of their work was providing a standard means of describing the geometry
of any manipulator, so that step 2 above becomes obvious. A robotic manipulator
is a chain of rigid links attached via a series of joints. Given below is a list of pos-
sible joint configurations.
Revolute Prismatic
Cylindrical Planar
Screw Spherical
A: Link length
α : Link twist
And the other 2 elements describing the linear and revolute offset of the link:
d : Link offset
θ : Joint angle
Let’s look at the details of these parameters for link i-1 and joint i of the chain.
Link length, ai-1: Consider the shortest distance between the axis of link i-1
and link i in R3.This distance is realized along the vector mutually perpendicular
to each axis and connecting the two axes. The length of this vector is the link
Axis i –1 Axis i
Link i –1
ai –1
ai –1
Axis i –1 Axis i
Link i –1
ai –1
ai –1
length ai-1. Note that link length need not be measured along a line contained in
the physical structure of the link. Although only the scalar link length is needed
in the mathematical formulation of joint transformations, the vector direction
between joint axes is also important in understanding the geometry of a robotic
manipulator. Thus, we use the terminology of link length both as a scalar denot-
ing the distance between links and as a vector ai-1direction that points from the
axis of joint (i-1) to joint i and such that ai-1= |ai-1|.
Axis i – 1 Axis i
Link i – 1
Link i
α – ai
i 1 di
θi
αi – 1
Axis i – 1 Axis i
Link i – 1
Link i
α – ai
i 1
di
θi
αi – 1
Link Twist, αi-1: Consider the plane orthogonal to the link length ai-1.Both
axis vectors of joint i-1 and I lie in this plane. Project the axes vectors of joints I
and i-1 onto this plane. The link twist is the angle measured from joint axis i-1
to joint axis i in the right-hand sense around the link length ai-1. Direction of ai-1
taken as from axis i-1 to i. This is to say that αi-1 will be positive when the link
twist (by the right-hand rule) is in the positive direction of ai-1.
Link Offset, di: On the joint axis of joint I consider the two points at which
the link lengths ai-1 and ai are attached. The distance between these points is the
link offset, measured positive from the ai-1 to ai connection points.
Joint Angle, θi: Consider a plane orthogonal to the joint axis i. By construc-
tion, both link length vectors ai-1 and ai lie in this plane. The joint angle is calcu-
lated as the clockwise angle that the link length ai-1 must be rotated to be colinear
with link length ai. This corresponds to the right-hand rule of a rotation of link
length ai-1 about the directed joint axis.
a0 = 0 = an
α0 = 0 = θn
KINEMATICS OF ROBOTIC MANIPULATORS 225
NOTE
■ For a revolute joint, link offset is fixed and joint angle is a controlled variable.
■ For a prismatic joint, joint angle is fixed and link offset is a controlled variable.
The first two parameters, link length and link twist, are always fixed parame-
ters. So, for any robot with n single-dof revolute or prismatic joints, there will be:
■ Three n fixed parameters, termed the link parameters. The link parameters
describe the fixed kinematics of the mechanism.
■ N controlled parameters (one for each joint), termed the joint variables.
For example, for a six-jointed robot with all revolute joints (anthropomor-
phic arm) the link parameters are (ai, αi, di) for i=1,..., 6, a set of 18 numbers.
Applying the conventions for the zero link and last link of a robotic manipulator
(The world frame is taken as fixed at the center of the first joint.)
Axis i – 1 Axis i
Link i – 1
Zi – 1 Link i
Ŷi
Ŷi – 1 Zi
αi
ai – 1 di Xi
Xi – 1
θi
ai – 1
1. The origin of the frame for link I is placed at the intersection of the joint axis
of link I with the vector direction ai (connecting link axis i with link axis i + 1).
2. The direction Zi is chosen in the direction of the link axis.
3. The direction Xi is chosen to lie along the vector ai connecting link axis i to
axis i + 1. (Note that choosing the direction of Xi is equivalent to choosing the
direction in which the twist €i is measured.)
4. The direction Yi is fixed by the choice of Xi and Zi and the right-hand rule, Yi
= Zi × Xi.
and
d1 = 0 if joint 1 is revolute or θ1 = 0 if joint 1 is prismatic.
Final Link: Again, choose the frame for link n coincident with the frame for
link n-1 in the robot zeroed position. Thus, again
an = 0, αn = 0
and
dn = 0 if joint 1 is revolute or αn = 0 if joint 1 is prismatic.
Link i:
1. If the joint length ai = 0 is zero (i.e., intersecting joint axes), choose Xi to be
orthogonal to the plane spanned by {Zi, Zi+1}.
2. If {Zi, Zi+1} are collinear, then the only non trivial arrangements of joints is
either prismatic/revolute or revolute/prismatic, i.e., a cylindrical joint.
3. The joint angle θi = 0 in the zeroed position of the robot.
Note that the conventions are usually chosen such that ai > 0 is a conse-
quence of the choices made. Since ai is a distance, it is generally written as a
positive number even if Xi is chosen in the negative direction.
Note that the frame attachment convention above does not result in a unique
attachment of frames. For example, the Zi axis can be attached in either direc-
tion of the frame axis. This is not a problem—we end up with the same answer.
depends on the three link parameters ai-1 and zi-1 (and either θi or di depending on
whether the joint is prismatic or revolute). The joint variable (either di or θi) is actu-
ated so that the transformation from frame {i} to frame {i-1} can be written down as
i −1
T := i −1iT( ai −1,α i −1, di ) ( θ i) ,
i
i −1
T := i −1iT( ai −1 ,α i −1,θi ) (di)
i
Axis i – 1 Axis i
Link i – 1
Zi – 1
Link i
ZR Zi
ZP Xi
ai – 1 di ZQ
XR X – 1 XP
i
θi
XQ
αi – 1
1. Frame {R} is made coincident with frame {i-1} except for a rotation about the
joint i-1 axis by αi-1.
2. Frame {Q} is given the same orientation as {R}, but is translated along Xi-1by
ai-1 so that its origin lies on the axis of joint i.
3. Frame {P} is made coincident with frame {Q} except for a rotation about the
joint I axis by θi. It then goes without saying that frame {P} and frame {i} dif-
fer only by a translation di.
i −1 i −1
We then may write iT = RT (α I −1 ) QT (a i −1 ) P T (θ i ) iT (d i ).
R Q P
⎛ Cθ i − Sθ i 0 a i −1 ⎞
⎜ ⎟
i −1 ⎜ Sθ i Cα i −1 Cθ i Cα i −1 − Sα i −1 − Sα i −1 d i ⎟
i T =⎜ .
Sθ Sα Cθ i Sα i −1 Cα i −1 Cα i −1 d i ⎟
⎜ i i −1 ⎟
⎜ 0 0 0 1 ⎟
⎝ ⎠
Z0
Link 2
Joint 2
Link 1
Joint 1 Joint 3
y0
Link 0
Link 3
Link 4
Joint 4 Joint 5
Link 5 Joint 6
Link 6
We have seen that the mapping from joint space into Cartesian space is ac-
complished via the homogeneous transformation N0T = 01T (θ1 ) 21T (θ 2 ).... N −N1 T (θ N )
and is known as the forward kinematics of the manipulator.
The reverse mapping N0T → (θ1 ........θ N ) is known as the inverse kinematics.
We will cover this in the next section.
z1 a2
z0
θ2
θ1 x1
y0 y1 d4
x0 d2
d6
y3 a3
z3
x2 θ y4
4
z2 z4 y1
θ5 z1
θ3 y6
x2 x4 θ6
y2 x5
z6
x6
The link frame assignment for the PUMA 562 is presented according to
DH-notation in Figure 5.10.
The location of DH-frames and DH-parameters is shown in Figure 5.11,
where the ‘zero’ position for the PUMA joints is assumed.
Transformations between all neighboring frames are given by the following
DH-transformations:
⎛ cos θ 1 0 − sin θ 1 0⎞
⎜ ⎟
⎜ sin θ 1 0 cos θ 1 0⎟
0
T1 = ⎜
0 −1 0 0⎟
⎜ ⎟
⎜ 0 0 0 0 ⎟⎠
⎝
Z6 Y6
X6
d6
Z5 Y5
X5
Z4
X4
Y4
Z0 Y0 Z1
d4
a2
Z2 Z3 Y3
X0 X1 d2 a3
Y1
X2 X3
Y2
⎛ cos θ 4 0 − sin θ 4 0 ⎞
⎜ ⎟
⎜ sin θ 4 0 cos θ 4 0 ⎟
3
T4 = ⎜
0 −1 d4 0 ⎟
⎜ ⎟
⎜ 0 0 0 1 ⎟⎠
⎝
⎛ cos θ 5 0 − sin θ 5 0 ⎞
⎜ ⎟
⎜ sin θ 5 0 − cos θ 2 0 ⎟
4
T5 = ⎜ ⎟
0 1 0 0
⎜ ⎟
⎜ 0 0 0 1 ⎟
⎝ ⎠
⎛ cos θ 6 − sin θ 6 0 0 ⎞
⎜ ⎟
⎜ sin θ 6 cos θ 6 0 0 ⎟
5
T6 = ⎜
0 0 0 d6 ⎟
⎜ ⎟
⎜ 0 0 0 1 ⎟⎠
⎝
⎛n sx ax px ⎞
⎜ x ⎟
⎜n sy ay py ⎟
0
T6 = 0 T1 1T2 2T3 3T4 4T5 5T6 = ⎜ y
n sz az pz ⎟
⎜ z ⎟
⎜0 0 0 1 ⎟⎠
⎝
nx = c1 (c 23 (c 4 c 5 c 6 − s 4 s 6 ) − s 23 s 5 c 6 ) − s1 ( s 4 c 5 c 6 + c 4 s 6 )
n y = s1 (c 23 (c 4 c 5 c 6 − s 4 s 6 ) − s 23 s 5 c 6 ) − c1 ( s 4 c 5 c 6 + c 4 s 6 )
nz = − s 23 (c 4 c 5 c 6 − s 4 s 5 ) − c 23 s 5 c 6
s x = c1 (c 23 (c 4 c 5 s 6 − s 4 c 6 ) − s 23 s 5 s 6 ) − s1 (− s 4 c 5 s 6 + c 4 s 6 )
s y = s1 (−c 23 (c 4 c 5 s 6 − s 4 c 6 ) + s 23 s 5 s 6 ) + c1 (− s 4 c 5 s 6 + c 4 c 6 )
s z = s 23 (c 4 c 5 s 6 + s 4 s 6 ) − c 23 s 5 s 6
KINEMATICS OF ROBOTIC MANIPULATORS 233
a x = c1 (c 23 c 4 s 5 + s 23 c 5 ) − s 2 s 4 s 5
a y = S1 (c 23 c 4 s 5 + s 23 c 5 ) + c1 s 4 s 5
a Z = − s 23 c 4 s 5 + c 23 c 5
s i = sin θ i
c i = cos θ i
s ij = sin(θ i + θ j )
c ij = cos(θ i + θ j )
Inverse kinematics is the determination of all possible and feasible sets of joint
variables, which would achieve the specified positions and orientations of the
manipulator’s end-effector with respect to the base frame. In practice, a robot
manipulator control requires knowledge of the end-effector position and orien-
tation for the instantaneous location of each joint as well as knowledge of the
joint displacements required to place the end-effector in a new location. Many
industrial applications such as welding and certain types of assembly operations
require that a specific path should be negotiated by the end-effector. To achieve
this, it is necessary to find the corresponding motion of each joint, which will
produce the desired tip motion. This is a typical case of inverse kinematic ap-
plication.
5.4.1 Workspace
The workspace of a manipulator is defined as the volume of space in which the
manipulator is able to locate its end-effector. The work space gets specified by
the existence or nonexistence of solutions to the inverse problem. The region
that can be reached by the origin of the end-effector frame with at least one ori-
entation is called the reachable workspace (RWS). If a point in workspace can be
reached only in one orientation, the manipulatoribility of the end-effector is very
poor and it is not possible to do any practical work satisfactorily with just one
fixed orientation. It is, therefore, necessary to look for the points in workspace
that can be reached in more than one orientation. The space where the end-ef-
fector can reach every point from all orientations is called dexterous workspace
(DWS). It is obvious that the dexterous workspace is either smaller (subset) or
the same as the reachable workspace.
234 ROBOTICS
-600 ≤ q 1 ≤ 600
-1000 ≤ q 2 ≤ 1000.
5.4.2 Solvability
Inverse kinematics is complex because solutions are found for nonlinier si-
multaneous equations, involving transcendental (harmonic sine and cosine)
functions. The number of simultaneous equations is also generally more than
the number of unknowns, making some of the equations mutually dependent.
These conditions lead to the possibility of multiple solutions or nonexistence of
any solution for the given end-effector position and orientation. The existence
KINEMATICS OF ROBOTIC MANIPULATORS 235
⎡ nx sx ax px ⎤ ⎡ px ⎤
⎢ py ⎥ ⎢p ⎥
⎡n s a P ⎤ ⎢ ny sy ay
⎥
F =⎢ ⎥= P = ⎢ y⎥
⎣0 0 0 1 ⎦ ⎢ nz sz az pz ⎥ Where ⎢ pz ⎥
⎢ ⎥ ⎢ ⎥
⎣0 0 0 1⎦ ⎣1⎦
Find: U1, U2
?2
Redundancy: A unique solution to
l2 this problem does not exist. Notice,
that using the “given” two solutions
are possible. Sometimes no solution
is possible.
l2 (x , y)
?1 l1
l2
l1
l1
KINEMATICS OF ROBOTIC MANIPULATORS 237
(x, y)
l2
Y2
l1
α
Y1
sin B sin C
=
b c
sin θ1 sin(180 − θ2 ) sin(θ2 )
= =
l2 x +y
2 2
x 2 + y2
θ1 = θ1 + a
⎛y⎞
α = arctan 2 ⎜ ⎟
⎝x ⎠
c 2 = a 2 + b 2 − 2ab cos C
( x 2 + y2 ) = l12 + l 22 − 2l1l 2 cos(180 − θ2 )
cos(180 − θ2 ) = − cos(θ2 )
x 2 + y2 − l12 − l 22
cos(θ2 ) =
2l1l 2
⎛ x 2 + y2 − l12 − l22 ⎞
θ2 = arccos ⎜⎜ ⎟⎟
⎝ 2l2l 2 ⎠
⎛ l sin(θ ) ⎞ ⎛y⎞
θ1 = arcsin ⎜ 2 2 ⎟
+ arctan 2 ⎜ ⎟
⎜ x 2 + y2 ⎟ ⎝x ⎠
⎝ ⎠
(x , y)
l2 Y
l2
l1
Y2
c1 = cos θ1
c1+ 2 = cos(θ2 + θ1 )
(1) 2 + (2) 2 = x 2 + y2 =
= (l12c12 + l 22 (c1+ 2 ) 2 + 2l1l 2c1 (c1+ 2 )) + (l12s12 + l 22 (sin1+ 2 ) 2 + 2l1l 2s1 (sin1+ 2 ))
We know what θ2 is from the previous slide. We need to solve for θ1. Now we
have two equations and two unknowns (sin θ1 and sin θ1).
x = l1c1 + l 2 c1+ 2
= l1c1 + l 2 c1c 2 − l 2 s1s2
= c1 (l1 + l 2 c 2 ) − s1 (l 2 s 2 )
x + s1 (l 2 s 2 )
c1 =
(l1 + l 2 c2 )
x + s1 (l 2 s 2 )
y= (l 2 s 2 ) + s1 (l1 + l 2 c2 )
l1 + l 2 c2 )
1 Notice this is the law of cosines
= ( xl 2 s2 + s1 (l12 + 2l1l 2 c2 ))
(l1 + l 2 c2 ) and can be replaced by x2 + y2.
y(l1 + l 2 c 2 ) − xl 2 s 2 ⎛ y (l + l c ) − xl s ⎞
s1 = θ1 = arcsin ⎜⎜ 1 22 2 2 2 2 ⎟⎟
x 2 + y2 ⎝ x +y ⎠
(a) Look at the equations involving only one joint variable. Solve these equations
first to get the corresponding joint variable solutions.
(b) Next, look for pairs or a set of equations that could be reduced to one equa-
tion in one joint variable by application of algebraic and trigonometry identi-
ties.
(c) Use the arc tangent (Atnt2) function instead of the arc cosine or arc sine
functions. The two-argument Atnt2 (y, x) function returns the accurate angle
in the range of such that θ lies between -π to π. By examining the sign of both
y and x and detecting whenever either x or y is 0.
240 ROBOTICS
(d) Solutions in terms of the element of the position vector components of 0Tn
are more efficient than those in terms of elements of the rotation matrix, as
that latter may involve solving more complex equations.
(e) In the inverse kinematic model, the right-hand side of the equation (section
5.4.3) is known, while the left-hand side has n unknowns (q1 , q2……qn). The
left-hand side consists of products of n link transformation matrices, that is
0
Tn = 0 T 1 1 T2 2 T3…. n-1 Tn = T.
1
Tn=1T2 2 T3…. n-1 Tn = [0T1]-1 T.
The left-hand side of the equation now has (n-1) unknowns (q2, q3, ….. ,
qn) and the right-hand side matrix has only one unknown, the q1. The matrix
elements of the right-hand side are zero, constant, or the function of the joint
variable q1. A new set of 12 equations is obtained and it may now be possible
to determine q1 from the results of equations using guideline (a) or (b) above.
Similarly, by postmultiplying both sides of the equation by the inverse of n-1Tn,
unknown equation qn can be determined. This process can be repeated by solv-
ing for one unknown at a time, sequentially from q1 to qn or qn to q1, until all like
unknown are found. This is known as the inverse transform approach.
The above systematic approach can be applied to find the inverse kinematic
solution of manipulators having more than 2 DOF. The interested reader can
refer to texts of robotic manipulators for examples of inverse kinematics involv-
ing more degrees of freedom.
Chapter 6 CLASSIFICATION OF
SENSORS
In This Chapter
• Classification of Sensors
• Encoders and Dead Reckoning
• Infrared Sensors
• Ground-based RF Systems
• Active Beacons
• Ultrasonic Transponder Trilateration
• Accelerometers
• Gyroscopes
• Laser Range Finder
• Vision-based Sensors
• Color-tracking Sensors
• Sensor Mounting Arrangement
• Design of the Circuitry
• Reading the Pulses in a Computer
T
here are a wide variety of sensors used in mobile robots (Figure 6.1).
Some sensors are used to measure simple values like the internal temper-
ature of a robot’s electronics or the rotational speed of the motors. Other,
more sophisticated sensors can be used to acquire information about the robot’s
environment or even to directly measure a robot’s global position. We classify
sensors using two important functional axes:
■ proprioceptive/exteroceptive and
■ passive/active.
241
242 ROBOTICS
(a) (b)
FIGURE 6.1 Examples of robots with multisensor systems. (a) Helpmate from Transition Research
Corporation; (b) BIBA Robot, BlueBotics SA.
Where:
A: Active
P: Passive
A/P: Active/Passive
PC: Proprioceptive
EC: Exteroceptive
The sensor classes in Table 6.1 are arranged in ascending order of complex-
ity and descending order of technological maturity. Tactile sensors and prospec-
tive sensors are critical to virtually all mobile robots, and are well understood
and easily implemented. Commercial quadrature encoders, for example, may be
purchased as part of a gear-motor assembly used in a mobile robot. At the other
extreme, visual interpretation by means of one or more CCD/CMOS cameras
provides a broad array of potential functionalities, from obstacle avoidance and
244 ROBOTICS
■ Brush encoders.
■ Potentiometers.
■ Synchros.
■ Resolvers.
■ Optical encoders.
■ Magnetic encoders.
■ Inductive encoders.
■ Capacitive encoders.
Optical Encoders
The first optical encoders were developed in the mid-1940s by the Baldwin
Piano Company for use as “tone wheels” that allowed electric organs to mimic
other musical instruments. Today’s corresponding devices basically embody
CLASSIFICATION OF SENSORS 245
FIGURE 6.2 The observed phase relationship between Channel A and B pulse trains can be
used to determine the direction of rotation with a phase-quadrature encoder, while unique
output states S - S allow for up to a four-fold increase in resolution. The single slot in the outer
track generates one index pulse per disk rotation.
approach is that all relative position information is lost in the event of a power
interruption.
In the case of limited rotation, such as the back-and-forth motion of a pan
or tilt axis, electrical limit switches and/or mechanical stops can be used to es-
tablish a home reference position. To improve repeatability this homing action
is sometimes broken into two steps. The axis is rotated at reduced speed in the
appropriate direction until the stop mechanism is encountered, whereupon rota-
tion is reversed for a short predefined interval. The shaft is then rotated slowly
back into the stop at a specified low velocity from this designated start point, thus
eliminating any variations in inertial loading that could influence the final hom-
ing position. This two-step approach can usually be observed in the power-on
initialization of stepper-motor positioners for dot-matrix printer heads.
Alternatively, the absolute indexing function can be based on some external
referencing action that is decoupled from the immediate servo-control loop. A
good illustration of this situation involves an incremental encoder used to keep
track of platform steering angles. For example, when the K2A Navmaster [CY-
BERMOTION] robot is first powered up, the absolute steering angle is un-
known, and must be initialized through a “referencing” action with the docking
beacon, a nearby wall, or some other identifiable set of landmarks of known ori-
entation. The up/down count output from the decoder electronics is then used
to modify the vehicle heading register in a relative fashion.
A growing number of very inexpensive off-the-shelf components have con-
tributed to making the phase-quadrature incremental encoder the rotational
sensor of choice within the robotics research and development community. Sev-
eral manufacturers now offer small DC gear-motors with incremental encoders
already attached to the armature shafts. Within the U.S. automated guided ve-
hicle (AGV) industry, however, resolves are still generally preferred over optical
encoders for their perceived superiority under harsh operating conditions.
CLASSIFICATION OF SENSORS 247
The HCTL 1100 has been tested and used in many different mobile robot
control interfaces. The chip has proven to work reliably and accurately, and it is
used on commercially available mobile robots, such as the TRC LabMate and
HelpMate. The HCTL 1100 costs only $40 and it comes highly recommended.
Detector
array
FIGURE 6.3 A line source of light passing through a coded pattern of opaque and
transparent segments on the rotating encoder disk results in a parallel output that uniquely
specifies the absolute angular position of the shaft (adapted from [Agent, 1991]).
248 ROBOTICS
brush encoder. The assignment of a dedicated track for each bit of resolution
results in larger-size disks (relative to incremental designs), with a corresponding
decrease in shock and vibration tolerance. A general rule of thumb is that each
additional encoder track doubles the resolution but quadruples the cost.
Instead of the serial bit streams of incremental designs, absolute optical en-
coders provide a parallel word output with a unique code pattern for each quan-
tized shaft position. The most common coding schemes are Gray code, natural
binary and binary-coded decimal. The Gray code is characterized by the fact
that only one bit changes at a time, a decided advantage in eliminating asynchro-
nous ambiguities caused by electronic and mechanical component tolerances
(see Figure 6.4a). Binary code, on the other hand, routinely involves multiple
bit changes when incrementing or decrementing the count by one. For example,
when going from position 255 to position 0 in Figure 6.4b, eight bits toggle
from 1s to 0s. Since there is no guarantee all threshold detectors monitoring
the detector elements tracking each bit will toggle at the same precise instant,
considerable ambiguity can exist during state transition with a coding scheme
of this form. Some type of handshake line signaling valid data available would
be required if more than one bit were allowed to change between consecutive
encoder positions.
Absolute encoders are best suited for slow and/or infrequent rotations such
as steering angle encoding, as opposed to measuring high-speed continuous (i.e.,
drive wheel) rotations as would be required for calculating displacement along
the path of travel. Although not quite as robust as resolvers for high-temperature,
high-shock applications, absolute encoders can operate at temperatures over 125
O
C, and medium-resolution (1,000 counts per revolution) metal or mylar disk
a. b.
Theory of Operation
A line sensor in its simplest form is a sensor capable of detecting a contrast
between adjacent surfaces, such as difference in color, roughness, or magnetic
properties. The simplest would be detecting a difference in color, for example,
black and white surfaces. Using simple optoelectronics, such as infrared photo-
transistors, color contrast can easily be detected. Infrared emitter/detectors or
phototransistors are inexpensive and are easy to interface to a microcontroller.
The theory of operation is simple and for brevity, only the basics will be con-
sidered. For more information about the physics of these sensors, please refer to
an optoelectronics and heat transfer text. For now we will consider the basic ef-
fects of light and what happens when it shines on a black or white surface. When
light shines on a white surface, most of the incoming light is reflected away from
the surface. In contrast, most of the incoming light is absorbed if the surface is
black. Therefore, by shining light on a surface and having a sensor to detect the
amount of light that is reflected, a contrast between black and white surfaces can
be detected. Figure 6.5 shows an illustration of the basics just covered.
Detector
Light Source
Detector
Light Source
White surface
Black surface
FIGURE 6.5 Light reflecting off a white and black surface. More light
is reflected from the white surface compared to the black surface.
250 ROBOTICS
Using what we know about black and white surfaces, the objective of track-
ing a line is simple and can be achieved using the appropriate sensors. In this
section, we will consider the use of two pairs of emitters and detectors. The drive
configuration for the robot is assumed to be differential, i.e., like the tracks of an
army tank vehicle. Two pairs of sensors are used to keep the robot on the line as
it moves. Each sensor output is monitored to determine the location of the tape
relative to the robot. The main objective of the robot is to position itself such that
the tape line falls between the two extreme sensors. If the tape line ever ventures
past these two extreme sensors, then the robot corrects by turning in the appro-
priate direction to maintain tracking. Two different types of light sensors set up
in the configuration will be used for line tracking.
6.4.1 LORAN
An early example of the first category is seen in LORAN (short for long range
navigation). Developed at MIT during World War II, such systems compare the
time of arrival of two identical signals broadcast simultaneously from high-power
transmitters located at surveyed sites with a known separation baseline. For each
finite time difference (as measured by the receiver) there is an associated hyper-
bolic line of position as shown in Figure 6.6. Two or more pairs of master/slave
stations are required to get intersecting hyperbolic lines resulting in a two-di-
mensional (latitude and longitude) fix.
The original implementation (LORAN A) was aimed at assisting convoys
of liberty ships crossing the North Atlantic in stormy winter weather. Two 100
kW slave transmitters were located about 200 miles on either side of the mas-
ter station. Non-line-of-sight ground-wave propagation at around 2 MHz was
employed, with pulsed as opposed to continuous-wave transmissions to aid in
sky-wave discrimination. The time-of-arrival difference was simply measured as
the lateral separation of the two pulses on an oscilloscope display, with a typical
CLASSIFICATION OF SENSORS 251
Vehicle
C
A B
Master Slave
Transmitter Transmitter
accuracy of around 1 µs. This numerical value was matched to the appropriate
line of position on a special LORAN chart of the region, and the procedure then
repeated for another set of transmitters. For discrimination purposes, four dif-
ferent frequencies were used, 50 kHz apart, with 24 different pulse repetition
rates in the neighborhood of 20 to 35 pulses per second. In situations where the
hyperbolic lines intersected more or less at right angles, the resulting (best-case)
accuracy was about 1.5 kilometers.
LORAN A was phased out in the early ’80s in favor of LORAN C, which
achieves much longer over-the-horizon ranges through use of 5 MW pulses ra-
diated from 400-meter (1,300 ft.) towers at a lower carrier frequency of 100
kHz. For improved accuracy, the phase differences of the first three cycles of
the master and slave pulses are tracked by phase-lock-loops in the receiver and
converted to a digital readout, which is again cross-referenced to a preprinted
chart. Effective operational range is about 1,000 miles, with best-case accuracies
in the neighborhood of 100 meters (330 ft.). Coverage is provided by about 50
transmitter sites to all U.S. coastal waters and parts of the North Atlantic, North
Pacific, and the Mediterranean.
FIGURE 6.7 Kaman sciences 1500 W navigation grid is a scaled-down version of the LORAN
concept, covering an area 8 to 15 km on a side with a position location repeatability of 1 m.
( Tc − Td ) C .
D=
2
site 1 site 4
Display transcalver
unit
Range processor
Optional Optional
Computer plotter
site 2 site 3
Where,
D = separation distance
Te = total elapsed time
Td = transponder turnaround delay
c = speed of light.
by each transmitter. The receiver is also equipped with a precision clock, so that
it can compare the timing information and time of arrival of the incoming signals
to its internal clock. This way, the system is able to accurately measure the signals’
time of flight and thus the distance between the receiver and the three beacons.
This method, known as “differential location regression” is essentially the same as
the locating method used in global positioning systems (GPS).
To improve accuracy over current range-lateration schemes, the HTI system
incorporates mutual data communications, permitting each mobile user access
to the time-tagged range measurements made by fixed reference devices and all
other mobile users. This additional network-level range and timing information
permits more accurate time synchronization among device clocks, and automatic
detection and compensation for uncalibrated hardware delays.
Each omnidirectional CDMA spread-spectrum “geometric” transmission
uniquely identifies the identity, location, and orientation of the transmitting
source. Typically the available geometric measurement update rate is in excess
of 1,000 kHz. Harris quotes a detection radius of 500 meters (1,640 ft.) with
100 mW peak power transmitters. Larger ranges can be achieved with stronger
transmitters. Harris also reports on “centimeter-class repeatability accuracy” ob-
tained with a modified transmitter called an “interactive beacon.” Tracking and
communications at operating ranges of up to 20 kilometers (12.5 mi.) are also
supported by higher transmission power levels of 1 to 3 W. Typical “raw data”
measurement resolution and accuracies are cited in Table 6.2.
Enhanced tracking accuracies for selected applications can be provided as cited
in Table 6.3. This significant improvement in performance is provided by sensor data
fusion algorithms that exploit the high degree of relational redundancy that is char-
acteristic for infogeometric network measurements and communications.
Infogeometric enhancement algorithms also provide the following capabilities:
Active beacon navigation systems are the most common navigation aids on ships
and airplanes. Active beacons can be detected reliably and provide very accurate
positioning information with minimal processing. As a result, this approach al-
lows high sampling rates and yields high reliability, but it does also incur high
cost in installation and maintenance. Accurate mounting of beacons is required
for accurate positioning. For example, land surveyors’ instruments are frequent-
ly used to install beacons in a high-accuracy application. Kleeman notes that:
“Although special beacons are at odds with notions of complete robot au-
tonomy in an unstructured environment, they offer advantages of accuracy, sim-
plicity, and speed—factors of interest in industrial and office applications, where
the environment can be partially structured.”
One can distinguish between two different types of active beacon systems:
trilateration and triangulation.
6.5.1 Trilateration
Trilateration is the determination of a vehicle’s position based on distance measure-
ments to known beacon sources. In trilateration navigation systems there are usu-
ally three or more transmitters mounted at known locations in the environment and
one receiver on board the robot. Conversely, there may be one transmitter on board
and the receivers are mounted on the walls. Using time-of-flight information, the
CLASSIFICATION OF SENSORS 257
system computes the distance between the stationary transmitters and the onboard
receiver. Beacon systems based on ultrasonic sensors are another example.
6.5.2 Triangulation
In this configuration there are three or more active transmitters (usually infrared)
mounted at known locations in the environment, as shown in Figure 6.9. A rotat-
ing sensor on board the robot registers the angles λ1, λ2 , and λ3 at which it “sees”
the transmitter beacons relative to the vehicle’s longitudinal axis. From these three
measurements the unknown x- and y-coordinates and the unknown vehicle ori-
entation θ can be computed. Simple navigation systems of this kind can be built
very inexpensively. One problem with this configuration is that the active beacons
need to be extremely powerful to insure omnidirectional transmission over large
distances. Since such powerful beacons are not very practical it is necessary to fo-
cus the beacon within a cone-shaped propagation pattern. As a result, beacons are
not visible in many areas, a problem that is particularly grave because at least three
beacons must be visible for triangulation. A commercially available sensor system
based on this configuration was tested at the University of Michigan in 1990. The
system provided an accuracy of approximately ±5 centimeters (±2 in.), but the
aforementioned limits on the area of application made the system unsuitable for
precise navigation in large open areas.
Triangulation methods can further be distinguished by the specifics of their
implementation:
Y
y
S1
S2
λ2
λ1 Robot
orientation
θ (unknown)
x
Yo R
λ3
S3
X
Xo
FIGURE 6.9 The basic triangulation problem: a rotating sensor head measures the three angles λ1, λ2,
and λ3 between the vehicle’s longitudinal axes and the three sources s1,s2, and s3.
258 ROBOTICS
For either one of the above methods, we will refer to the stationary devices
as “beacons,” even though they may physically be receivers, retroreflectors, or
transponders.
Three-point Triangulation
Cohen and Koss in 1992 performed a detailed analysis on three-point triangula-
tion algorithms and ran computer simulations to verify the performance of dif-
ferent algorithms. The results are summarized as follows:
■ The geometric triangulation method works consistently only when the robot is
within the triangle formed by the three beacons. There are areas outside the
beacon triangle where the geometric approach works, but these areas are dif-
ficult to determine and are highly dependent on how the angles are defined.
■ The geometric circle intersection method has large errors when the three
beacons and the robot all lie on, or close to, the same circle.
■ The Newton-Raphson method fails when the initial guess of the robot’s posi-
tion and orientation is beyond a certain bound.
■ The heading of at least two of the beacons was required to be greater than 90
degrees. The angular separation between any pair of beacons was required
to be greater than 45 degrees.
In summary, it appears that none of the above methods alone is always suit-
able, but an intelligent combination of two or more methods helps overcome the
individual weaknesses.
Yet another variation of the triangulation method is the so-called running
fix. The underlying principle of the running fix is that an angle or range obtained
CLASSIFICATION OF SENSORS 259
from a beacon at time t-1 can be utilized at time t, as long as the cumulative
movement vector recorded since the reading was obtained is added to the posi-
tion vector of the beacon, thus creating a virtual beacon.
(1) The problem of determining the robot position in a noisy environment is linearized,
(2) The algorithm runs in an amount of time that is a linear function of the num-
ber of landmarks,
(3) The algorithm provides a position estimate that is close to the actual robot
position, and
(4) Large errors (“outliers”) can be found and corrected.
(m)
1.6
1.4
Squared error in p
1.2
1
0.8
0.6
0.4
0.2
0
5% 10% 15% 20%
FIGURE 6.10 Simulations result using the position estimator algorithm on an input of noisy angle
measurements. The squired error in the position estimate p (in meters) is shown as a function of
measurement errors (in percent of the actual angle).
260 ROBOTICS
The results of a simulation for the following scenario are presented: the ro-
bot is at the origin of the map, and the landmarks are randomly distributed in a
10x10 meter (32x32 ft.) area.
The robot is at the corner of this area. The distance between a landmark and
the robot is at most 14.1 meters (46 ft.) and the angles are at most 45 degrees.
The simulation results show that large errors due to misidentified landmarks and
erroneous angle measurements can be found and discarded. Subsequently, the
algorithm can be repeated without the outliers, yielding improved results. One
example is shown in Figure 6.11, which depicts simulation results using the algo-
rithm position estimator. The algorithm works on an input of 20 landmarks (not
shown in Figure 6.11) that were randomly placed in a 10×10 meter (32×32 ft.)
workspace. The simulated robot is located at (0,0). Eighteen of the landmarks
were simulated to have a one-percent error in the angle measurement and two
of the landmarks were simulated to have a large 10-percent angle measurement
error. With the angle measurements from 20 landmarks the position estimator
produces 19 position estimates p1–p19 (shown as small blobs in Figure 6.11).
Averaging these 19 estimates yields the computed robot position. Because of the
two landmarks with large angle measurement errors, two position estimates are
bad: p5 at (79 cm, 72 cm) and p 18 at (12.5 cm, 18.3 cm).
Because of these poor position estimates, the resulting centroid (average) is
at P = (17 cm, 24 cm). However, the position estimator can identify and exclude
a
the two outliers. The centroid calculated without the outliers p5 and p18 is at Pb
= (12.5 cm, 18.3 cm). The final position estimate after the position estimator is
applied again on the 18 “good” landmarks (i.e., without the two outliers) is at Pc
= (6.5 cm, 6.5 cm).
(cm)
P18 P5
70
60
50
40
30 a
P+
20 b
P+
c
10 P+
0
0 10 20 30 40 50 60 70 (cm)
FIGURE 6.11 Simulation results showing the effect of outliers and the result of removing the outliers.
CLASSIFICATION OF SENSORS 261
Base station
“A” “B”
pinger pinger
Pinger side
view
FIGURE 6.12 The ISR Genghis series of legged robots localize x-y position with a master/slave trilat-
eration scheme using two 40 KHz ultrasonic “pingers”.
262 ROBOTICS
localize position to within 12.7 millimeters (0.5 in.) over a 9.1×9.1 meter (30×30
ft.) operating area. The ISR system consists of a base station master hard-wired
to two slave ultrasonic “pingers” positioned a known distance apart (typically
2.28 m — 90 in.) along the edge of the operating area as shown in Figure 6.12.
Each robot is equipped with a receiving ultrasonic transducer situated beneath
a cone-shaped reflector for omnidirectional coverage. Communication between
the base station and individual robots is accomplished using a Proxim spread-
spectrum (902 to 928 MHz) RF link.
The base station alternately fires the two 40-kHz ultrasonic pingers every half
second, each time transmitting a two-byte radio packet in broadcast mode to advise
all robots of pulse emission. Elapsed time between radio packet reception and de-
tection of the ultrasonic wave front is used to calculate distance between the robot’s
current position and the known location of the active beacon. Inter robot com-
munication is accomplished over the same spread-spectrum channel using a time-
division multiple-access scheme controlled by the base station. Principle sources
of error include variations in the speed of sound, the finite size of the ultrasonic
transducers, nonrepetitive propagation delays in the electronics, and ambiguities
associated with time-of-arrival detection. The cost for this system is $10,000.
Digital I/O
in PC
Phase Detection
TTL of received waveform
From
receiver
Amplified waveform Envelope of squared wave After differentiation Rough TOF
End of
RTOF
FIGURE 6.13 A combination of threshold adjusting and phase detection is employed to provide higher
accuracy in time-of-arrival measurements in the Tulane University ultrasonic position-locator system.
CLASSIFICATION OF SENSORS 263
⎧ p2 ⎫
⎪ 2 ⎪
⎡1 r12 2z 1 ⎤ ⎪c ⎪
⎧ (t 1 − t 2 ) ⎫ 2x 1 2y 1
⎪1 ⎪
⎪(t − t ) ⎪ ⎢ ⎥
⎪ 2 d ⎪ ⎢1 r22 2x 2 2y 2 2z 2 ⎥ ⎪c 2 ⎪
⎢* ⎥ ⎪ ⎪
⎪⎪ * ⎪⎪ ⎪ u⎪
⎨ ⎬ = ⎢ ⎥ ⎨− 2 ⎬
⎪ * ⎪ ⎢* ⎥ ⎪ c ⎪
⎪ * ⎪ ⎢* ⎥ ⎪ v⎪
⎪ ⎪ ⎢ ⎥ ⎪− c 2 ⎪
⎪⎩(t n − t d )⎪⎭ ⎢⎣1 rn2 2x n 2y n 2z n ⎥⎦ ⎪ ⎪
⎪− w ⎪
⎪ c2 ⎪
⎩ ⎭
whereas:
The above equation can be solved for the vector on the right to yield an es-
timated solution for the speed of sound c, transmitter coordinates (u, v, w), and
an independent term p2 that can be compared to the sum of the squares of the
transmitter coordinates as a checksum indicator. An important feature of this
representation is the use of an additional receiver (and associated equation) to
enable treatment of the speed of sound itself as an unknown, thus ensuring con-
tinuous on-the-fly recalibration to account for temperature and humidity effects.
264 ROBOTICS
■ Actual transmission range does not match the advertised operating range for
the ultrasonic transducers, probably due to a resonant frequency mismatch
between the transducers and electronic circuitry.
■ The resolution of the clocks (6 MHz) used to measure time of flight is insuf-
ficient for automatic compensation for variations in the speed of sound.
■ The phase-detection range-measurement correction sometimes fails when there
is more than one wavelength of uncertainty. This problem can likely be solved
using the frequency division scheme described by Figueroa and Barbieri.
Specifications
FIGURE 6.14
Interfacing
The compass provides eight headings (N, NE, E, SE, S, SW, W, and NW), which
are encoded in four signal wires (N, E, S, W). Each of the wires is standard TTL
open-collector NPN output and can be interfaced to digital input lines via pull-
up resistors.
However, the SV203 has no digital input lines—instead, it has five analog
voltage ports, three of which are already used by the IR sensors. It is still possible
to interface the compass to the SV203 by converting the four digital signals into
analog voltage and reading this voltage through a remaining analog port. The
circuit below is based on a standard resistor-ladder digital-to-analog converter
with four bits, with the addition of four pull-up resistors. Although these resis-
tors lead to deviations of the converted voltage from exact powers of two, this
circuit only has to encode eight different values for the possible headings, and
the choice of resistors in the circuit results in clear separation between the volt-
ages corresponding to different headings.
The transistors shown in the circuit are inside the compass—only the resis-
tors have to be supplied. The compass has 12 pins:
266 ROBOTICS
Vcc
20k 10k
pin 3 N Vout
10k
20k
pin 3 E
10k
20k
pin 3 S
10k
20k
pin 3 w
20k
pins 2 - N, E, S, W
FIGURE 6.15
The location of the pins is shown in the datasheet of the compass (PDF).
The output of the resistor ladder, Vout, can be connected either to pin 4 or pin
5 of SV203’s port A (J3).
6.7 ACCELEROMETERS
6.8 GYROSCOPES
Anyone who has ever ridden a bicycle has experienced (perhaps unknow-
ingly) an interesting characteristic of the mechanical gyroscope known as gyro-
scopic precession. If the rider leans the bike over to the left around its own hori-
zontal axis, the front wheel responds by turning left around the vertical axis. The
effect is much more noticeable if the wheel is removed from the bike, and held
by both ends of its axle while rapidly spinning. If the person holding the wheel
attempts to yaw it left or right about the vertical axis, a surprisingly violent reac-
tion will be felt as the axle instead twists about the horizontal roll axis. This is due
to the angular momentum associated with a spinning flywheel, which displaces
the applied force by 90 degrees in the direction of spin. The rate of precession is
proportional to the applied torque T:
T=IΩ (6.1)
where
There are two basic classes of rotational sensing gyros: 1) rate gyros, which
provide a voltage or frequency output signal proportional to the turning rate, and
2) rate-integrating gyros, which indicate the actual turn angle. Unlike the mag-
netic compass, however, rate-integrating gyros can only measure relative as op-
posed to absolute angular position, and must be initially referenced to a known
orientation by some external means.
A typical gyroscope configuration is shown in Figure 6.16. The electrically
driven rotor is suspended in a pair of precision low-friction bearings at either end
of the rotor axle. The rotor bearings are in turn supported by a circular ring, known
as the inner gimbal ring; this inner gimbal ring pivots on a second set of bearings
that attach it to the outer gimbal ring. This pivoting action of the inner gimbal de-
fines the horizontal axis of the gyro, which is perpendicular to the spin axis of the
rotor as shown in Figure 6.16. The outer gimbal ring is attached to the instrument
frame by a third set of bearings that define the vertical axis of the gyro. The vertical
axis is perpendicular to both the horizontal axis and the spin axis.
Notice that if this configuration is oriented such that the spin axis points
east-west, the horizontal axis is aligned with the north-south meridian. Since the
gyro is space-stable (i.e., fixed in the inertial reference frame), the horizontal axis
thus reads the horizontal earth rate component of the planet’s rotation, while the
vertical axis reads the vertical earth rate component. If the spin axis is rotated
90 degrees to a north-south alignment, the earth’s rotation does not affect the
gyro’s horizontal axis, since that axis is now orthogonal to the horizontal earth
rate component.
Outer pivot
Outer gimbal
Wheel
Inner pivot
Wheel bearing
Inner gimbal
6.8.2 Gyrocompasses
The gyrocompass is a special configuration of the rate-integrating gyroscope,
employing a gravity reference to implement a north-seeking function that can
be used as a true-north navigation reference. This phenomenon, first dem-
onstrated in the early 1800s by Leon Foucault, was patented in Germany by
Herman Anschutz-Kaempfe in 1903, and in the U.S. by Elmer Sperry in 1908.
The U.S. and German navies had both introduced gyrocompasses into their
fleets by 1911.
The north-seeking capability of the gyrocompass is directly tied to the hori-
zontal earth rate component measured by the horizontal axis. As mentioned ear-
lier, when the gyro spin axis is oriented in a north-south direction, it is insensitive
to the earth’s rotation, and no tilting occurs. From this it follows that if tilting is
observed, the spin axis is no longer aligned with the meridian. The direction and
magnitude of the measured tilt are directly related to the direction and magni-
tude of the misalignment between the spin axis and true north.
6.8.3 Gyros
Gyros have long been used in robots to augment the sometimes erroneous dead-
reckoning information of mobile robots. Mechanical gyros are either inhibitively
expensive for mobile robot applications, or they have too much drift. Work by
Barshan and Durrant-Whyte aimed at developing an INS based on solid-state
gyros, and a fiber-optic gyro was tested by Komoriya and Oyama.
that the standard deviation, here used as a measure for the amount of noise, was
0.160/s for the START gyro and 0.240/s for the Gyrostar. The drift in the rate out-
put, 10 minutes after switching on, is rated at 1.350/s for the Gyrostar (drift-rate
data for the START was not given).
The more interesting result from the experiment in Figure 6.17 is the drift in
the angular output, shown in the lower two plots. We recall that in most mobile
robot applications one is interested in the heading of the robot, not the rate of
change in the heading. The measured rate Æ must thus be integrated to obtain
Æ. After integration, any small constant bias in the rate measurement turns into
a constant-slope, unbounded error, as shown clearly in the lower two plots of
Figure 6.17. At the end of the five-minute experiment, the START had accumu-
lated a heading error of -70.8 degrees while that of the Gyrostar was -59 degrees
(see thin lines in Figure 6.17). However, with the EKF, the accumulated errors
φ [deg/sec] φ [deg/sec]
0.5 0.5
0.0 0.0
-0.5 -0.5
-1.0 -1.0
0 1 2 3 4 5 0 1 2 3 4 5
time [min] time [min]
φ [deg] “Start” gyro φ [deg] gyrostar
20 20
0
0
-20
-20
-40
-40
-60
-80 -60
0 1 2 3 4 5 0 1 2 3 4 5
time [min] time [min]
FIGURE 6.17
272 ROBOTICS
were much smaller: 12 degrees was the maximum heading error for the START
gyro, while that of the Gyrostar was -3.8 degrees.
Overall, the results from applying the EKF show a five- to six-fold reduction
in the angular measurement after a five-minute test period. However, even with
the EKF, a drift rate of 1 to 30 /min can still be expected.
Distribution of estimated
position error (x,y) Distribution of estimated
position error (x,θ)
y θ
Distribution of estimated
position error (x,y)
x x
Start
Position
FIGURE 6.18 Computer simulation of a mobile robot run. a. Only odometry, without gyro
information. b. Odometry and gyro information fused.
CLASSIFICATION OF SENSORS 273
deviation of the position estimation errors from the mean value is smaller in
the case where the gyro data was used (note that a large average deviation
from the mean value indicates larger nonsystematic errors). Komoriya and
Oyama explain that the noticeable deviation of the mean values from the
origin in both cases could be reduced by careful calibration of the systematic
errors of the mobile robot. We should note that from the description of this
experiment it is not immediately evident how the “position estimation error”
(i.e., the circles) in Figure 6.20b were found. In our opinion, these points
should have been measured by marking the return position of the robot on
the floor (or by any equivalent method that records the absolute position of
FIGURE 6.19 Melboy, the mobile robot used by Komoriya and Oyama for fusing odometry and gyro
data.
274 ROBOTICS
[cm]
y
1.00
[m]
1.50
Sampling time: 0.5 sec
1.25 0.5
1.00
0.75 0.0
0.50
End point Without gyro
-0.5
0.25 With gyro
0.00
FIGURE 6.20 Experimental results from Melboy using odometry with and without a
fiberoptic gyro. a. Actual trajectory of the robot for a triangular path. b. Position estimation
errors of the robot after completing the path of a. Black circles show the errors.
the robot and compares it with the internally computed position estimation).
The results of the plot in Figure 6.20b, however, appear to be too accurate
for the absolute position error of the robot. In our experience an error on
the order of several centimeters, not millimeters, should be expected after
completing the path of Figure 6.20a. Therefore, we interpret the data in
Figure 6.20b as showing a position error that was computed by the onboard
computer, but not measured absolutely without gyro; white circles show the
errors with the gyro.
A laser range finder is a device which uses a laser beam in order to determine the
distance to a reflective object. The most common form of laser range finder op-
erates on the time-of-flight principle by sending a laser pulse in a narrow beam
toward the object and measuring the time taken by the pulse to be reflected off
the target and returned to the sender. Due to the high speed of light, this tech-
nique is not appropriate for high-precision submillimeter measurements, where
triangulation and other techniques are often used.
CLASSIFICATION OF SENSORS 275
Operation
Pulse
The pulse may be coded in order to reduce the chance that the range find-
er can be jammed. It is possible to use Doppler effect techniques to judge
whether the object is moving toward or away from the range finder, and if
so, how fast.
The accuracy of the instrument is determined by the brevity of the laser
pulse and the speed of the receiver. One that uses very short, sharp laser pulses
and has a very fast detector can range an object to within a few centimeters.
Range
Despite the beam being narrow, it eventually spreads over long distances due to
the divergence of the laser beam, as well as to scintillation and beam wander ef-
fects, caused by the presence of air bubbles in the air acting as lenses ranging in
size from microscopic to roughly half the height of the laser beam’s path above
the earth.
These atmospheric distortions, coupled with the divergence of the laser it-
self and with transverse winds that serve to push the atmospheric heat bubbles
laterally, may combine to make it difficult to get an accurate reading of the dis-
tance of an object, say, beneath some trees or behind bushes, or even over long
distances of more than 1 km in open and unobscured desert terrain.
Some of the laser light might reflect off leaves or branches that are closer
than the object, giving an early return and a reading which is too low. Alterna-
tively, over distances longer than 1,200 ft. (365 m), the target, if in proximity to
the earth, may simply vanish into a mirage, caused by temperature gradients in
the air in proximity to the heated desert bending the laser light. All these effects
have to be taken into account.
Discrimination
Some instruments are able to determine multiple returns, as above. These instru-
ments use waveform-resolving detectors, which means they detect the amount
of light returned over a certain time, usually very short. The waveform from a
laser pulse that hit a tree and then the ground would have two peaks. The first
peak would be the distance to the tree, and the second would be the distance to
the ground.
The ability for aircraft-mounted instruments to see “through” dense cano-
pies and other semireflective surfaces, such as the ocean, provide many applica-
tions for airborne instruments such as:
Applications
Military
In order to make laser range finders and laser-guided weapons less useful against
military targets, various military arms may have developed laser-absorbing paint
for their vehicles. Regardless, some objects don’t reflect laser light very well and
using a laser range finder on them is difficult.
3D Modelling
Laser range finders are used extensively in 3D object recognition, 3D ob-
ject modelling, and a wide variety of computer vision-related fields. This
technology constitutes the heart of the so-called time-of-flight 3D scanners.
In contrast to the military instruments described above, laser range finders
offer high-precision scanning abilities, with either single-face or 360-degree
scanning modes.
A number of algorithms have been developed to merge the range data re-
trieved from multiple angles of a single object in order to produce complete 3D
models with as little error as possible. One of the advantages that laser range
finders offer over other methods of computer vision is that the computer does
not need to correlate features from two images to determine depth information
as in stereoscopic methods.
The laser range finders used in computer vision applications often have
depth resolutions of tenths of millimeters or less. This can be achieved by using
triangulation or refraction measurement techniques as opposed to the time-of-
flight techniques used in LIDAR.
reader understand these limitations. Afterward, the second and third sections
describe vision-based sensors that are commercially available, along with their
disadvantages and most popular applications.
are, as one would expect, significantly more expensive and therefore rarely
used in mobile robotics.
Both three-chip and single-chip color CCD cameras suffer from the fact that
photodiodes are much more sensitive to the near-infrared end of the spectrum.
This means that the overall system detects blue light much more poorly than
red and green. To compensate, the gain must be increased on the blue channel,
and this introduces the greater absolute noise on blue than on red and green.
It is not uncommon to assume at least one to two bits of additional noise on the
blue channel. Although there is no satisfactory solution to this problem today,
over time the processes for blue detection has been improved and we expect this
positive trend to continue.
The CCD camera has several camera parameters that affect its behavior. In
some cameras, these values are fixed. In others, the values are constantly chang-
ing based on built-in feedback loops. In higher-end cameras, the user can modify
the values of these parameters via software.The iris position and shutter speed
regulate the amount of light being measured by the camera. The iris is simply
a mechanical aperture that constricts incoming light, just as in standard 35 mm
cameras. Shutter speed regulates the integration period of the chip. In higher
end cameras, the effective shutter speed can be as brief at 1/30,000 seconds and
as long as 2 seconds. Camera gain controls the overall amplification of the analog
signal, prior to A/D conversion. However, it is very important to understand that,
even though the image may appear brighter after setting high gain, the shutter
speed and iris may not have changed at all. Thus gain merely amplifies the signal,
and amplifies along with the signal all of the associated noise and error. Although
useful in applications where imaging is done for human consumption (e.g., pho-
tography, television), gain is of little value to a mobile roboticist.
In color cameras, an additional control exists for white balance. Depending
on the source of illumination in a scene (e.g., fluorescent lamps, incandescent
lamps, sunlight, underwater filtered light, etc.), the relative measurements of
red, green, and blue light that define pure white light will change dramatically.
The human eye compensates for all such effects in ways that are not fully un-
derstood, but the camera can demonstrate glaring inconsistencies in which the
same table looks blue in one image taken during the night, and yellow in another
image taken during the day. White balance controls enable the user to change
the relative gains for red, green, and blue in order to maintain more consistent
color definitions in varying contexts.
The key disadvantages of CCD cameras are primarily in the areas of inconstancy
and dynamic range. As mentioned above, a number of parameters can change the
brightness and colors with which a camera creates its image. Manipulating these
parameters in a way to provide consistency over time and over environments, for
example, ensuring that a green shirt always looks green, and something dark gray
is always dark gray, remains an open problem in the vision community.
CLASSIFICATION OF SENSORS 279
face of the light-detecting array. Many photons hit the transistors rather than the
photodiode, making the CMOS chip significantly less sensitive than an equiva-
lent CCD chip. Second, the CMOS technology is younger and, as a result, the
best resolution that one can purchase in CMOS format continues to be far in-
ferior to the best CCD chip available. Time will doubtless bring the high-end
CMOS imagers closer to CCD imaging performance.
Given this summary of the mechanism behind CCD and CMOS chips, one
can appreciate the sensitivity of any vision-based robot sensor to its environ-
ment. As compared to the human eye, these chips all have far poorer adaptation,
cross-sensitivity, and dynamics range. As a result, vision sensors today continue
to be fragile. Only over time, as the underlying performance of imaging chips
improves, will significantly more robust vision-based sensors for mobile robots
be available.
Camera output considerations: Although digital cameras have inher-
ently digital output, throughout the 1980s and early 1990s, most affordable vi-
sion modules provided analog output signals, such as NTSC (National Television
Standards Committee) and PAL (Phase Alternating Line). These camera sys-
tems included a D/A converter which, ironically, which would be counteracted
on the computer using a framegrabber, effectively an A/D converter board situ-
ated, for example, on a computer’s bus. The D/A and A/D steps are far from
noisefree, and furthermore the color depth of the analog signal in such cameras
was optimized for human vision, not computer vision.
More recently, both CCD and CMOS technology vision systems provide
digital signals that can be directly utilized by the roboticist. At the most basic
level, an imaging chip provides parallel digital I/O (input/output) pins that com-
municate discrete pixel level values. Some vision modules make use of these
direct digital signals, which must be handled subject to hard-time constraints
governed by the imaging chip. To relieve the real-time demands, researchers
often place an image buffer chip between the imager’s digital output and the
computer’s digital inputs. Such chips, commonly used in webcams, capture a
complete image snapshot and enable non-real-time access to the pixels, usually
in a single, ordered pass.
At the highest level, a roboticist may choose instead to utilize a higher-level
digital transport protocol to communicate with an imager. Most common are the
IEEE 1394 (firewire) standard and the USB (and USB 2.0) standards, although
some order imaging modules also support serial (RS-232). To use any such high-
level protocol, one most locate or create drive code both for that communica-
tion layer and for the particular implementation detail of the imaging chip. Take
note, however, of the distinction between lossless digital video and the standard
digital video stream designed for human visual consumption. Most digital video
cameras provide digital output, but often only in compressed from. For vision
researchers, such compression must be avoided as it not only discards informa-
CLASSIFICATION OF SENSORS 281
tion but even introduces image detail that does not actually exist, such as MPEG
(Moving Picture Experts Group) discretization boundaries.
The cognachrome achieves a position resolution of one pixel for the centroid of
each object in a field that is 200x250 pixels in size. The key advantage of this sensor,
just as with laser range finding and ultrasonic, is that there is no load on the mobile
robot’s main sensor due to sensing modality, all processing is performed on sensor-
specific hardware (i.e., a Motorola 68332 processor and a mated frame grabber).
The cognechrome system costs several thousands dollars, but is being superseded
by higher-performance hardware vision processors at Newton Labs, Inc.
CMUcam Robotic Vision Sensor: Recent advances in chip manufactur-
ing, both in terms of CMOS imaging sensors and high-speed, readily available
microprocessors at the 50+ MHz range, have made it possible to manufacture
low-overhead intelligent vision sensors with functionality similar to cognachrome
for a fraction of the cost. The CMUcam sensor is a recent system that mates a
low-cost microprocessor with a consumer CMOS imaging chip to yield an intel-
ligent, self-contained vision sensor for $100.
This sensor is designed to provide high-level information extracted from the
camera image to an external processor that may, for example, control a mobile
robot. An external processor configures the sensor’s streaming data mode, for
instance, specifying tracking mode for a bounded RGB or YUV value set. Then
the vision sensor processes the data in real time and outputs a high level of infor-
mation to the external consumer. At less than 150 mA of current draw, the sensor
provides image color statistics and color-tracking services at approximately 20
frames per second at a resolution of 80X143.
Key performance bottlenecks for both the CMVision software, the CMU-
cam hardware system, and the Cognachrome hardware system continue to be
the quality of imaging chips and available computational speed. As significant
advances are made on these frontiers one can expect packaged vision systems to
witness tremendous performance improvements.
Theory
The infrared emitter and detector sensors are shown below in Figure 6.21. You
can buy these from a number of vendors, and depending on where they were
purchased, the sensors shown in Figure 6.21 may differ in color and packaging
from ones you’re using. The following picture shows the most commonly found
detector and emitter pair.
The circuit diagram is shown in Figure 6.22 and only one set of emitter/
detector sensors is depicted. Pay close attention to the anode (+ve) and cath-
ode (GND) of these sensors. Usually the longer leg is the anode (+ve) and the
shorter leg is the cathode (GND) in most LEDs, including the infrared emitter.
However, in the case of the detector it is the opposite, that is the longer LED is
the cathode (GND) and the shorter leg is the anode (+ve).
EMITTER
DETECTOR
180 Ohms
Black Tape
+5V
Anode
IR Emitter
Cathode
HB Analog
Input Port C
Cathode, E
IR Detector B
Anode, C
E
FIGURE 6.22 Circuit diagram for the infrared emitter/detector line sensor for the
AT89c52 microcontroller.
The sensor for the line-following robot needs to be able to distinguish be-
tween the black tape and the white floor. IR sensors will be used instead of
visible light sensors because visible light sensors are easily interfered with by
ambient light and shadow. The longer wavelength of IR creates a stronger, more
reliable signal while still being absorbed by the black tape.
+5
220 0.01uF
RA.0
+5
0.01uF
220
RA.1 Right
Left
Light
Light source Photo detector source
Photo
detector
Light &
detector
5 vdc
0 vdc
FIGURE 6.25 Reading the pulses.
CLASSIFICATION OF SENSORS 287
The light and dark horizontal strips represent the bars (or holes) on the ro-
tary encoder strip. Whenever a light strip is in front of the detector, the output
voltage switches to high (5 V DC). Whenever a dark strip is in front, the voltage
is low (0 V DC).
The processor reads these pulses and counts them (by various methods to be
described later). By knowing how many pulses are detected per wheel revolu-
tion, and the circumference of the wheel, it can be calculated how far the robot
has moved usually. But, there is one deficiency with this simple encoder. The
processor will receive pulses that look the same whether the wheel is turning for-
ward or reverse. Hence, the processor doesn’t know whether to add or subtract
the pulses from the distance traveled without some additional information. So
this feature has to be added in the software, so that it may be able to tell which
direction the wheel is turning (i.e., if the motor is being commanded forward,
then the encoder pulses are contented forward), but using a more sophisticated
encoder solves the problem directly.
The design and implementation of the shaft encoder will be done in the fol-
lowing steps:
The mounting of the sensor can be done in one of the following two types of ar-
rangements (see Figure 6.26):
Wheel
+5V
emitter
detector
Signal
Gnd
emitter detector
Wheel
Gnd
Signal
+5v
a transparent segment of the disc lies between the source and detector the cor-
responding output is 1, and when an opaque sector lies between the source and
detector the corresponding output is 0. Thus, the output alternates between 1
and 0 as the shaft is turned (see Figure 6.27).
After reading the pulse from the encoder, it is possible to count the pulses do-
ing the polling. The software continuously samples an input pin (pin 14) with
the detector signal on it and increments a counter when that signal changes
state. However, it is difficult to do anything else with the software while you
are doing this polling because a pulse may be missed while the software is off
Wheel
1k 1k
To parallel port Input pin
L.E.D. L.D.R.
Ground
doing something like navigation or controlling the motors. But, there is a bet-
ter way. Many processors have interrupt capabilities. An interrupt is a hardware/
software device that causes a software function to occur when something hap-
pens in the hardware. Specifically, whenever the detector A pulse goes high,
the processor can be interrupted such that it suspends its ongoing navigation or
motor control task, runs a special software routine (called an interrupt handler),
which can compute the new distance traveled. When the interrupt handler is
done, the processor automatically returns to the task it was working on when the
interrupt occurred. The working program to count the encoder pulses is listed
in Appendix II (b)
O
ne need only watch a few slow-motion instant replays on the sports chan-
nels to be amazed by the variety and complexity of ways a human can
carry, swing, toss, glide, and otherwise propel his body through space.
Orientation, balance, and control are maintained at all times without apparent
effort, while the ball is dunked, the bar is jumped, or the base is stolen, and
such spectacular performance is not confined to the sports arena only. Behavior
observable at any local playground is equally impressive from a mechanical engi-
neering, sensory motor integration point of view. The final wonder comes when
we observe the one-year-old infant’s wobble with the knowledge that running
and jumping will soon be learned and added to the repertoire.
291
292 ROBOTICS
Two-legged walking, running, jumping, and skipping are some of the most
sophisticated movements that occur in nature, because the feet are quiet small
and the balance at all times has to be dynamic; even standing still requires so-
phisticated control. If one falls asleep on ones feet he falls over. The human
stabilizes the movement by integrating signals from:
■ Vision, which includes ground position and estimates of the firmness of the
ground and the coefficient of friction.
■ Proprioception, that is, knowledge of the positions of all the interacting mus-
cles, the forces on them and the rate of movement of the joints.
■ The vesicular apparatus, the semicircular canals used for orientation and
balance.
The greatest challenge in building a legged robot is its balance. There are two
ways to balance a robot body, namely static balance and dynamic balance. Both
of these methods are discussed in this section.
The necessity for static stability in arthropods has been used as one of, if not
the most important, reason why insects have at least six legs and use two sets of
alternating tripods of support during locomotion. Numerous investigators have
discussed the stepping patterns that insects require to maintain static stability
during locomotion. Yet, few have attempted to quantify static stability as a func-
tion of gait or variation in body form. Research on legged walking machines
provided an approach to quantify static stability. The minimum requirement to
attain static stability is a tripod of support, as in a stool. If an animal’s center of
mass falls outside the triangle of support formed by its three feet on the ground,
it is statically unstable and will fall. In the quasi-static gait of a robot or animal,
the center of mass moves with respect to the legs, and the likelihood of fall-
ing increases the closer the center of mass comes to the edge of the triangle of
support. In Figure 7.1 static balance is compared between six-legged and four-
legged robotic platforms.
The problem of maintaining a stable platform is considerably more complex
with four legs than it is with five, six, or more, since to maintain a statically stable
platform there must always be at least three legs on the ground at any given time.
Hence, with only four legs a shift in the center of mass is required to take a step.
A six-legged robot, on the other hand, can always have a stable triangle—one
that strictly contains the center of mass. In Figure 7.1 two successive postures
or steps are shown for a four- and six-legged robot. In Figure 7.1 (a) the triangle
for the first posture is stable because it contains the center of mass, but for the
second posture the center of mass must be shifted in order for the triangle to be
stable. In contrast, for the six-legged robot in Figure 7.1 (b) the center of mass
can remain the same for successive postures.
294 ROBOTICS
center of mass
must be shifted
into the triangle
center of mass
can remain
in one place
triangle of support
motion
i. step 1 i. step 1
a. quadruped b. hexapod
ing the animal from side to side. These models, and force and velocity mea-
surements on animals, suggest that running at a constant average speed, while
clearly a dynamical process, is essentially periodic in time. We define locomo-
tor stability as the ability of characteristic measurements (i.e., state variables
such as velocities, angles, and positions) to return to a steady state, periodic
gait after a perturbation.
Quantifying dynamic stability—dynamical systems theory: The field
of dynamical systems provides an established methodology to quantify stability.
The aim of this text is not to explain the details of dynamical systems theory,
but to give sufficient background so that those studying locomotion can see its
potential in description and hypothesis formation. It is important to note that dy-
namical systems theory involves the formal analysis of how systems at any level of
organization (neuron, networks, or behaviors) change over time. In this context,
the term dynamical system is not restricted to a system generating forces (ki-
netics) and moving (kinematics), as is the common usage in biomechanics. The
description of stability resulting from dynamical systems theory, which addresses
mathematical models, differential equations, and iterated mappings, does not
necessarily provide us with a direct correspondence to a particular biomechani-
cal structure. Instead, the resulting stability analysis acts to guide our attention
in productive directions to search for just such a link between coordination hy-
potheses from dynamical systems and mechanisms based in biomechanics and
motor control.
Define and measure variables that specify the state of the system:
The first task in the quantification of stability is to decide on what is best to
measure. The goal is to specify a set of variables such as positions and velocities
that completely define the state of the system. State variables are distinct from
parameters such as mass, inertia, and leg length that are more or less fixed for a
given animal. State variables change over time as determined by the dynamics
of the system. Ideally, their values at any instant in time should allow the deter-
mination of all future values. Put another way, if two different trials of a running
animal converge to the same values, their locomotion patterns should be very
similar from that time forward.
Periodic trajectories called limit cycles characterize locomotion: During sta-
ble, steady-state locomotion, the value of state variables oscillates rhythmically
over time (e.g., lateral velocity in Figure 7.2 A). In addition to representing the
behavior of the state variables with respect to time, we can examine their behav-
ior relative to one another. Figure 7.2 B shows a plot of the state variables (e.g.,
lateral, rotational, and fore-aft velocity) in state space. Time is no longer an axis,
but changes as one moves along the loop in this three-dimensional space. The
closed loop trajectory tells us that the system is periodic in time. Such a trajec-
tory in state space is known as a limit cycle. If any other path converges to this
cycle, it has stabilized to the same trajectory.
296 ROBOTICS
A
Stride
t t+1
★ ★
1 2 3 4
B 1
Rotational ★
Velocity 2
4
3
0
Lateral
Velocity Fore-aft Valocity
FIGURE 7.2 Periodic orbit or limit cycle. A. Variation in a single state variable, lateral velocity over
one stride. A cycle is present within which lateral velocity repeats from t to t+1. B. Periodic orbit
showing a limit cycle in state space. Lateral, rotation, and fore-aft velocity oscillate following a regular
trajectory over a stride. Any point in the cycle can be considered an equilibrium point (star) of the
associated return map.
★
Equilibrium
FIGURE 7.3 Types of stability; schematic representations of asymptotic stability with an equilibrium
point (star), neutral stability with a continuum of equilibrium points, and an example of instability.
The axes represent any two state variables.
LEGGED ROBOTS 297
The Creep
Creep, sometimes known as the crawl, is demonstrated by cats when stalking
something—body low-slung to the ground, and slow meticulous movement of
only one leg at a time. We have also observed deer using this gait, when walking
over broken ground. Compared to the cat, however, they keep their bodies fully
erect, and lift each leg high during steps—to clear obstacles.
Tripod Stability: Whereas the alternating diagonal walk has dynamic stabil-
ity, the creep has “static” stability. Only one leg is ever lifted from the ground at
a time, while the other 3 maintain a stable tripod stance. The grounded legs are
maintained in a geometry that keeps the center of mass of the body inside the
triangle formed by the 3 points of the tripod at all times. As the suspended leg
moves forward, the tripod legs shift the body forward in synchrony, so that a new
stable tripod can be formed when the suspended leg comes down.
There are at least 2 variations of the creep:
1. The tripod can shift the body forward simultaneously with the suspended
leg, giving a nice smooth forward movement. This method should provide
good speed on level ground.
2. The tripod can shift the body forward after the suspended leg has
touched down, giving a more tentative and secure forward movement.
This method should be useful when engaging obstacles or moving over
broken ground.
COG
not coordinated correctly, a point of instability may occur nearby in the stride.
To improve stability here, the right front foot would have to touch down further
back.
Walk
The dog in Figure 7.6 walks with a 4-time gait, LF (left-front), RR (right-rear),
RF (right-front), LR (left-rear), then repeat. Presumably, most dogs prefer to
start the walk with a front leg.
Notice that balance and support are maintained by the LR+RF “diagonal”
while the LF and RR legs are suspended (positions 1, 2), and by the opposite
diagonal for the other 2 legs (positions 5, 6). At the start of each step (positions
1, 5), the legs of the support diagonal are vertical, and the COG (center of grav-
ity) of the dog is in the middle of the diagonal. Then the COG shifts forward as
the stepping leg is extended (positions 2, 3, 6, 7), giving forward momentum to
the body.
Regarding the suspended legs, the front leg precedes the rear leg (evident
in positions 1–3 and 5–7) slightly, thus the 4-part cadence. Furthermore, during
initiation of the succeeding steps (positions 4, 8), the front leg of the new step
lifts slightly before the rear leg of the previous step touches down. This prevents
the feet on the same side from banging into each other during the transition
between diagonals, since for a normal stride; the rear pad comes down near the
front pad mark.
300 ROBOTICS
1 2 3
4 5 6
7 8 9
FIGURE 7.6 In the nine diagrams, the dog demonstrates the complete sequence of a full stride of
the walk. The left front starts the action. Positions 1 and 2 show the right diagonal; 3, right diagonal
and left front; 4, the left lateral; 5 and 6, the left diagonal; 7, the left diagonal and right front; 8, the
right lateral; and 9 takes us back to the start.
The Trot
Faster gaits than the walk are the trot (positions 1–4) and the pace (posi-
tions 5, 6), which the German shepherd illustrates in Figure 7.7. The trot is
basically a direct extension of the walk shown above, used for greater speed,
while the pace is what a tired dog might use heading home after a long day
on the range.
The trot is a two-time gait, LR+RF alternating with RR+LF. Like the walk
above, the trot gets its stability by using alternating “diagonal bracing” under the
torso (positions 1, 3), but here the legs work more closely in unison, the strides
are longer and the forward lean is greater.
In practice, the phase of the front feet is slightly ahead of the rear, which
keeps the feet on the same side from banging each other (positions 2, 4). Quite
LEGGED ROBOTS 301
1 2
3 4
5 6
obviously, the length of the stride with respect to the length of the torso and legs,
as well as the precise phase relationship between front and rear legs on the same
side, distinguish a successful trot from a bang, stagger, and stumble. Dogs with
longer legs, compared to torso length, do not trot well.
The trot is an example of dynamic stability, where the animal could not hold
its balance when stopped. However, because the trot always keeps the COG of
the torso straddled by diagonal bracing, and the order of stepping is similar to
that of the walk, one should think this gait would be easily implementable in a
quadruped robot, once a successful walk has been achieved.
The Pace: In the pace, the dog uses “lateral” support, where both legs on
each side work together, and the sides alternate. In the trot, the COG of the
torso is not directly over the legs, but is centered within the diagonals. With the
pacing gait, the COG will be offset from the supporting side unless the animal
significantly leans its body sideways and angles its legs inward—an obvious sta-
bility problem.
302 ROBOTICS
Interestingly, humans also have something akin to a pacing gait. We have dis-
covered empirically that, at the end of a long tiring hike, when struggling up the
final hills, it turns out to be very comforting to twist and lean the body over onto
the supporting leg with each step. This produces a kind of ducky waddling move-
ment, which is not a good means for covering level ground at speed, but clearly
takes some of the stress off tired muscles by shifting the COG directly over the
grounded leg, so that the bones rather than the muscles take the effort. In a nor-
mal walk, the COG is normally kept in between the feet, so the leg muscles must
take more of the effort. Because of the instability inherent with the pacing gait,
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
a pacing robot would probably fall over and go to sleep at the first opportunity.
The trot, however, looks eminently doable in the robot.
Running Gaits
Galloping: The basic gallop is illustrated by the dog in Figure 7.8. This is a 4-
step gait, shown here as LR, RR, LF, then RF. The leg ordering is very different
from the walk and trot.
The RF leg is actually the “leading” leg here. The characteristic of this gait is
that the leading leg bears the weight of the body over longer periods of time than
any other leg, and is more prone to fatigue and injury. The single suspension
phase (positions 13–15) is initiated by catapulting the entire body off the leading
leg (positions 10–12). The force comes from the back legs pushing off onto the
nonleading front leg, and then onto the leading leg (positions 3–8). Notice the
length of time the back legs are suspended.
There is a position where all 4 legs are under the body, and others where ei-
ther the 2 front or 2 rear legs are extended away from the body, but none where
both fronts and both rears are extended simultaneously (as for the next gallop
shown below). This gives a degree of rocking to the body, as the relative position
of the COG moves forward and backward.
Flying: Lastly, the full-tilt double-suspension gallop is illustrated by the
greyhound in Figure 7.9. (Suspension is the phase where all feet are off the
ground simultaneously.)
The 3rd and 6th pictures illustrate well how the mirror image design of the
legs produces symmetrical limb movement during running, and helps keep the
COG of the animal at the same relative location during all aspects of the stride.
From a stability viewpoint, this is clearly vital in preventing the dog’s body from
pitching nose over during the run.
However, implementing these running gaits in robots is very difficult. Stabil-
ity is the biggest concern. Second is the availability of motors, which can gener-
ate such speed and power. The third problem is providing proper suspension to
the entire body.
Robots can prosper from the aspects of animal dynamics, just described, in
several ways:
Kinematics of legged robots is similar to that of the robotic arm. The same kin-
ematic analysis can be employed to legged robots to generate trajectories. So the
kinematics can be divided into forward and inverse kinematics as discussed in
Chapter 5 in Sections 5.3 and 5.4. We will implement forward and inverse kin-
ematics to a problem of a general 3-DOF leg in the following sections.
The frame assignment and calculation of joint link parameters is left for the
user’s practice. The users can revisit Section 5.3 (Forward Kinematics) for refer-
ence.
LEGGED ROBOTS 305
upward
z z
forward l1 side
x y
-θ1 -θ2
l2
-θ3
l3
⎛ x 2 + z 2 + ( y − l 1 ) 2 − ( l 22 + l 23 ) ⎞
θ 3 = ± cos ⎜⎜ −1
⎟⎟ ,
⎝ 2l 2 l 3 ⎠
⎛ y − l1 ⎞
θ 2 = sin −1 ⎜⎜ ⎟⎟ ,
⎝ l 2 + l 3 cos θ 3 ⎠
⎛ x ⎞ ⎛
−1 ( l 2 + l 3 cos θ 3 ) cos θ 2
⎞
θ 1 = tan −1 ⎜ ⎟ m cos ⎜⎜ ⎟.
⎝− z⎠ ⎟
⎝ x2 + z2 ⎠
Note that we have two solutions for any reachable position (x, y, z), depend-
ing on if the angle µ3 of the knee is either positive or negative. Moreover, if x =
z = 0 then µ1 can be arbitrarily chosen.
The derivation of inverse kinematics is left for the user’s practice. The users
can revisit Section 5.4 (Inverse Kinematics) for reference.
306 ROBOTICS
x x x x x
FrontZ FrontZ x x
x x BackZ
BackZ
x x
x
x
x x x x x x
Leg Motion
The following parameters have to be specified to produce wheel-like leg mo-
tion.
Landing position and leaving position: positions at which the leg reaches
the ground and leaves from it.
Lift height: lift heights of the leg.
Stroke shape: We can choose either rectangle or Hermite curve interpola-
tion of three points, shown in Figure 7.11. A Hermite curve smoothly connects
between specified points. These parameters determine the spatial trajectory of
the paw. Moreover, an additional two parameters determine the position (x, y, z)
of the paw at each time step.
Power ratio: time ratio of the paw touches the floor.
Time period: total steps of one stroke.
While the paw touches the floor, it moves on the straight line at a fixed
speed.
There are several simplified models to describe leg dynamics. The simplest treats
the body as an inverted pendulum mass, which transforms energy back and forth
from gravitational potential energy at the top of the stance phase to kinetic en-
ergy during the lift phase of the step. In this model, the leg and body essentially
rotate around the downed foot as a pivot point, with the up and down motions
of the body mass related to the energy transformations. Inverse pendulum is a
system consisting of a pole attached at its bottom to a moving cart. Whereas a
normal pendulum is stable when hanging downward, a vertical inverted pen-
dulum is inherently unstable, and must be actively balanced in order to remain
upright, typically by moving the cart horizontally as part of a nonlinear feedback
LEGGED ROBOTS 307
l sin θ
θ mg
l cos θ
l
O x
P
u M
system. We are going to discuss the dynamics of an inverse pendulum and its ap-
plication to the balance of legged robots in this section. A sketch of this system
is shown in Figure 7.12. The goal is to maintain the desired vertically oriented
position at all times.
We will discuss here how the inverse pendulum model is applied to a bi-
ped to find out the dynamics of its motion. The biped locomotion is composed
by two main phases: the single support phase and the double support phase.
During the double support phase the robot is controllable, while it is not in
the single support phase. This is due to the lack of an actuated foot. In the
double support phase there is the transition of the support leg, from right to
left or vice versa. Many authors have proposed a control strategy in which the
double support phase is assumed to be instantaneous, and the actual biped
locomotion is achieved by the single support phase. The main idea on which
we rely for the control of the system is to reduce the dynamic of the system,
in the single support phase, as that of a passive inverse pendulum. The single
support phase starts when the robot is about to lift one of its two feet off the
ground, more specifically the rear foot. This is the take-off configuration CTO,
which we have chosen to assign using three parameters: dStep, dSwitch, and
308 ROBOTICS
m5
q5 15=lo5
+ lo3
q3 lo2
13
12
q2 m3
m2
q4 lo4
y 14
m1 1c1
m4
q1 11
qMin. The meaning of these parameters is shown in Figure 7.13. In the CTO,
we treat the whole robot as an inverse pendulum (Figure 7.14). This is done
by calculating the center of gravity P and the inertia momentum I of the whole
system. Length of the pendulum l is given by the distance of the COG from the
front foot. The initial position of the pendulum, given by the angle β is easily
calculated.
The main principle of the control is to obtain a single support phase in which
the inverse pendulum moves clockwise, in order to obtain the locomotion of the
whole robot along the positive x-axis. To obtain such a goal, the initial velocity
of the pendulum must be greater than a minimum value calculated using the
conservation of the mechanical energy principle:
. 2mgl(1 − cos β 0 )
β0 =
ml 2 + I
where β0 is the initial velocity of the pendulum, m and I are the mass and the
inertia momentum of the pendulum, g is the gravity acceleration, and l is the
length of the pendulum.
Using the inverse kinematics, the velocity β0 is translated in a set of given
joint velocities in the CTO; this configuration is now completely defined. We can
now illustrate the basic principle of the control strategy: we want to use the dou-
ble support phase to bring the robot from a given initial configuration C0 to the
LEGGED ROBOTS 309
qMin
1
dSwitch
dStep
O
CTO; in the CTO the robot will switch to the single support phase where we will
use the inverse pendulum approximation to control the dynamic of the swing
leg. The objective is to swing this leg forward in coordination with the main
body movement. Now we can explain more deeply the meaning of the various
parameters used to define the CTO. In Figures 7.15 and 7.16 the parameter dStep
must be assigned accordingly to the robot legs length. A dStep too long would
provoke unfavorable situations for the actuators, plus the body oscillation would
be too great. A dStep too short would result in a slower locomotion and in stabil-
ity problems. The parameter qMin is a security margin to avoid the singularity
configuration of the knee joint, a situation in which the thigh and the leg are
aligned. This parameter is directly related to the maximum leg extension, which
is reached by the rear leg in the CTO. The starting angle β0 is directly related to
the dSwitch parameter. A higher value for dSwitch causes a longer path for the
inverse pendulum, thus a higher initial velocity, resulting in a higher actuators
power output needed.
Dynamics of legged robots is an active field, where a lot of research is cur-
rently going on. Readers are advised to study detailed texts on legged robots
to obtain a more detailed knowledge of the subject. A more practical interest
in legged robots will start after the development of very low-weight and high-
torque motors or other actuators and low-weight power storage devices.
APPENDIX A
TURTLE.CPP
/*
(C)-2004,
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<math.h>
#include<fstream.h>
#include<iomanip.h>
// —Global Variables—
intF[4],Rl[4],Rr[4];
// —> change to enum boolean
int motor=1;
// F=1, Rl=2, Rr=3
int dir=0; // 0=clockwise, 1=anticlockwise
int pos_F,pos_Rl,pos_Rr;
// step position flags
ofstream outfile(“Log.txt”);
// Logfile
char stat_flag=’L’;
char motion; // L/l=logging, D/d=display, B/b=both, N/n=none
unsigned int F_count=0,Rl_count=0,Rr_count=0;
// step counts - initialized to 0
int F_pos[5000],Rl_pos[5000],Rr_pos[5000];
// step log array
// ———
311
312 ROBOTICS
// —Function Declarations—
void outSignal();
void initializeMotors();
void step(int motor, int dir);
void showMotorStatus();
void promptForStatus();
void showStepLog();
void write(int var);
void write(unsigned int var);
void write(float var);
void write(char* string);
void write(int var, int width);
void write(unsigned int var, int width);
void write(float var, int width);
// ———
void outSignal()
{
int dec_378=0;
for(int i=0;i<4;i++)
{
dec_378 += Rl[i]*pow(2,i);
}
for(i=4;i<8;i++)
{
dec_378 += Rr[i-4]*pow(2,i);
}
int dec_37A=0;
for(i=0;i<4;i++)
{
dec_37A += F[i]*pow(2,i);
}
outportb(0x378,dec_378);
outportb(0x37A,dec_37A);
//write(“\ndec_378=”);write(dec_378);write
(“, dec_37A=”);write(dec_37A);
}
void initializeMotors()
// To initialize the motors to its first position. add posflag
{
F[0]=1;F[1]=0;F[2]=1;F[3]=1; pos_F=4;
// Front
APPENDIX A: TURTLE.CPP 313
Rl[0]=0;Rl[1]=1;Rl[2]=1;Rl[3]=0; pos_Rl=4;
// Rear Left
Rr[0]=0;Rr[1]=1;Rr[2]=1;Rr[3]=0; pos_Rr=4;
// Rear Right
outSignal();
}
//F_pos[F_count++]=dir;
break;
}
case 2:
{
if(dir==0)
{
pos_Rl++;
if(pos_Rl>4)
pos_Rl=1;
}
else
{
pos_Rl—;
if(pos_Rl<1)
pos_Rl=4;
}
switch(pos_Rl)
{
case 1:
{
Rl[0]=0;Rl[1]=1;Rl[2]=0;Rl[3]=1;break;
}
case 2:
{
Rl[0]=1;Rl[1]=0;Rl[2]=0;Rl[3]=1;break;
}
case 3:
{
Rl[0]=1;Rl[1]=0;Rl[2]=1;Rl[3]=0;break;
}
case 4:
{
Rl[0]=0;Rl[1]=1;Rl[2]=1;Rl[3]=0;break;
}
}
//Rl_pos[Rl_count++]=dir;
break;
}
case 3:
{
if(dir==1)
APPENDIX A: TURTLE.CPP 315
{
pos_Rr++;
if(pos_Rr>4)
pos_Rr=1;
}
else
{
pos_Rr—;
if(pos_Rr<1)
pos_Rr=4;
}
switch(pos_Rr)
{
case 1:
{
Rr[0]=0;Rr[1]=1;Rr[2]=0;Rr[3]=1;break;
}
case 2:
{
Rr[0]=1;Rr[1]=0;Rr[2]=0;Rr[3]=1;break;
}
case 3:
{
Rr[0]=1;Rr[1]=0;Rr[2]=1;Rr[3]=0;break;
}
case 4:
{
Rr[0]=0;Rr[1]=1;Rr[2]=1;Rr[3]=0;break;
}
}
//Rr_pos[Rr_count++]=dir;
break;
}
}
outSignal();
}
void showMotorStatus()
//overload << operator for single cout/outfile statement.
{
write(“\n——————”);
write(“\nF - Pos:”);write(pos_F);write(“, Current seq:”);
for(int i=0;i<4;i++)
316 ROBOTICS
write(F[i]);
write(“\nRl - Pos:”);write(pos_Rl);write(“, Current seq:”);
for(i=0;i<4;i++)
write(Rl[i]);
write(“\nRr - Pos:”);write(pos_Rr);write(“, Current seq:”);
for(i=0;i<4;i++)
write(Rr[i]);
write(“\n——————”);
}
void promptForStatus()
{
/* do
{
cout<<“\nCircle (C) / Coordinate Points (P):”;
cin>>motion;
flag=getche();
}
while(flag!=’C’&&flag!=’c’&&flag!=’P’&&flag!=’p’); */
do
{
cout<<“\nLog staus (L) / Display onscreen (D) / Both (B) /
None (N):”;
stat_flag=getche();
}
while(stat_flag!=’L’&&stat_flag!=’l’&&stat_flag!=’D’&&stat_flag!
=’d’&&stat_flag!=’B’&&stat_flag!=’b’&&stat_flag!=’N’&&stat_flag!
=’n’);
}
void showStepLog()
{
int i,j,k;
write(“\n—Step Log—”);
write(“\nMotor F, steps=”);write(F_count);write(“:-\n”);
for(i=0;i<F_count;i++)
{
write(F_pos[i]);write(“ “);
if((i+1)%25==0)
write(“\n”);
}
for(j=0;j<Rl_count;j++)
{
write(Rl_pos[j]);write(“ “);
if((j+1)%25==0)
write(“\n”);
}
write(“\n———”);
}
flag==’b’)
outfile<<var;
}
#include<graphics.h>
#include<stdio.h>
// —Global Variables—
const int screen_w=640,screen_h=480;
//the resolution of the graphics mode. values 640x480 for VGAHI driver
float q1_SF=4,q2_SF=4;
//the default scaling factors in the q1 & q2 co-ordinate axis
respectively. can change in the main prog
int q1_offset=320,q2_offset=240;
//should be a portin of screen_w & screen_h
int box1_x=10,box1_y=395,box1_w=150,box1_h=75;
//defines the position of the display box 1
int box2_x=330,box2_y=450,box2_w=300,box2_h=20;
//defines the position of the display box 2
int position_update_int=4;
//specifies intervals after which intermediate co-ords are displayed on
screen
// ———
// —Function Declarations—
void initializeGFX();
void initializeGFX(float _q1_SF, float _q2_SF);
//initialize the plot
void closeGFX();
void plot(float _q1, float _q2, int flag);
//flag specifies the type of entity to be plotted. 0=point, 1=small
filled circle.
void displayPar(float _delta, float _v_a);
void displayPosition(float _q1, float _q2, float _q3);
void displayStatus(char* string);
int q1ToScreenx(float _q1);
int q2ToScreeny(float _q2);
float screenxToq1(int x);
float screenyToq2(int y);
// ———
void initializeGFX()
{
//registerbgidriver(EGAVGA_driver);
int driver=DETECT,mode=VGAHI;
//q1_SF=_q1_SF;
//q2_SF=_q2_SF;
initgraph(&driver, &mode, “”);
320 ROBOTICS
line(x-2,y,x+2,y);
sprintf(ch,”%i”,int(screenyToq2(y)));
outtextxy(x-5,y,ch);
}
}
void closeGFX()
{
getch();
//closes after keypress
closegraph();
}
case 1:
{
setfillstyle(SOLID_FILL,EGA_LIGHTRED);
fillellipse(q1_p,q2_p,3,3);
break;
}
}
}
{
char ch[50];
settextjustify(LEFT_TEXT,TOP_TEXT);
setfillstyle(SOLID_FILL,EGA_BLACK);
bar(box1_x+1,box1_y+1,box1_x+box1_w-1,box1_y+54);
sprintf(ch,”delta_a = %5.3f”,_delta_a);
outtextxy(box1_x+5,box1_y+5,ch);
sprintf(ch,”v_a = %6.2f”,_v_a);
outtextxy(box1_x+5,box1_y+20,ch);
}
float screenxToq1(int x)
{
return (x-q1_offset)/q1_SF;
}
APPENDIX A: TURTLE.CPP 323
float screenyToq2(int y)
{
return (screen_h-q2_offset-y)/q2_SF;
}
#include<process.h>
// —Global Variables—
const float step_angle=(0.015865),step_distance=0.74;
// units in radians and mm —>may be diff for motors
const float l=113.5,b=137.5,r=47;
// l=length, 2b=width, in mm
float v=0,delta=0;
// current centroidal speed(mm/s) and steering angle(radians)
float q1=0,q2=0,q3=0;
// instantaneous global co-ordinates of vehicle CoG q1,q2 in mm and q3
in radians
float v_Rl,v_Rr;
// theoretical velovity of rear left and right wheel
float v_Rl_a=0,v_Rr_a=0;
// actual achievable velocities
float v_a=0,delta_a=0,delta_p=0;
// actual achievable centroidal velocity and steering angle
const int steering_delay=10;
// delay for steering steps, front motor, in ms
int interval_count=0; // interval counter
const float delta_a_min=0.01;
// min value of delta_a for making a finite radius
float q1_int[800],q2_int[800],q3_int[800];
// instantaneous global co-ordinates in the time interval - for plotting
purposes only
// ———
// —Function Declarations—
int round(float num);
void moveDist(float dist, float speed, int motor, int dir);
void moveAngle(float angle, float omega, int motor, int dir);
void setSteering(float _delta);
void moveVehicle(float _delta, float _v, float _t, float _distance);
void moveVehicle1(float _delta, float _v, float _t, float _distance);
// ———
{
if((num-floor(num))<0.5)
return floor(num);
else
return ceil(num);
}
interval_count++;
int p=0;
write(“\n—Interval “);write(interval_count);write(“ Step Log—”);
if(_v>=0)
dir=0;
else
dir=1;
if(_t==-1)
_t=_distance/_v;
displayPar(delta_a,v_a);
displayPosition(q1,q2,q3);
}
else
{
x_int=v_a*t_int;
y_int=0;
q1_int[p+1]=q1_int[p]+(x_int*cos(q3_int[p])-
y_int*sin(q3_int[p]));
q2_int[p+1]=q2_int[p]+(x_int*sin(q3_int[p])+
y_int*cos(q3_int[p]));
q3_int[p+1]=q3_int[p]+0;
//not required
}
if(fabs(delta_a)>delta_a_min)
{
x=(l/tan(delta_a))*sin((v_a/l)*tan(delta_a)*_t);
y=(l/tan(delta_a))*(1-cos((v_a/l)*tan(delta_a)*_t));
q1+=x*cos(q3)-y*sin(q3);
q2+=x*sin(q3)+y*cos(q3);
q3+=((v_a/l)*tan(delta_a)*_t);
}
else
{
x=v_a*_t;
y=0;
q1+=x*cos(q3)-y*sin(q3);
q2+=x*sin(q3)+y*cos(q3);
q3+=0;
}
write(“\nGlobal co-ordinates of vehicle CoG:
[“);write(q1,4);write(q2,4);write(“,”);write(q3,4);write(“]”);
//———
v_Rl_a=(round(1.02)*step_distance)/_t;*/
}
while((delay_Rl*(i+1))<=(_t*1000))
{
i++;
timer_Rl[i]=delay_Rl*i;
}
while((delay_Rr*(j+1))<=(_t*1000))
{
j++;
timer_Rr[j]=delay_Rr*j;
}
int k=1,l=1,m=0,flag;
timer_main[m][0]=0; timer_main[m][1]=5;
for(k=1;k<=i;k++)
{
flag=1;
while((l<=j)&&(flag==1))
{
if(timer_Rl[k]<timer_Rr[l])
{
timer_main[++m][0]=timer_Rl[k];
timer_main[m][1]=2;
flag=0;
}
else
{
if(timer_Rl[k]==timer_Rr[l])
328 ROBOTICS
{
timer_main[++m][0]=timer_Rl[k];
timer_main[m][1]=5;
l++;
flag=0;
}
else
{
timer_main[++m][0]=timer_Rr[l];
timer_main[m][1]=3;
l++;
}
}
}
if(stat_flag==’D’||stat_flag==’d’||stat_flag==’B’||stat_
flag==’b’)
{
cout<<“\nmotor Rl - “<<(i+1)<<“ steps”;
cout<<“\nmotor Rr - “<<(j+1)<<“ steps”;
}
if(stat_flag==’L’||stat_flag==’l’||stat_flag==’B’||stat_
flag==’b’)
{
outfile<<“\nmotor Rl - “<<(i+1)<<“ steps”;/*cout<<“ with
step times:-\n”;
for(p=0;p<=i;p++)
{
outfile<<setw(4)<<timer_Rl[p]<<“|”;
APPENDIX A: TURTLE.CPP 329
if((p+1)%25==0)
outfile<<“\n”;
}*/
outfile<<“\nmotor Rr - “<<(j+1)<<“ steps”;/*cout<<“ with
step times:-\n”;
for(p=0;p<=j;p++)
{
outfile<<setw(4)<<timer_Rr[p]<<“|”;
if((p+1)%25==0)
outfile<<“\n”;
}*/
/*outfile<<“\ncombined step timing array:-\n”;
for(p=0;p<=m;p++)
{
outfile<<setw(4)<<timer_main[p][0]<<“(“<<timer_main
[p][1]<<“)|”;
if((p+1)%25==0)
outfile<<“\n”;
}*/
}
write(“\n———————————”);
//———
if(timer_main[n][1]==5)
{
step(2,dir);
step(3,dir);
}
else
{
step(timer_main[n][1],dir);
}
while(((t_int*1000*p)>=timer_main[n-1][0])
&&((t_int*1000*p)<=timer_main[n][0]))
330 ROBOTICS
{
plot(q1_int[p],q2_int[p],0);
displayPosition(q1_int[p],q2_int[p],q3_int[p]);
p++;
}
}
//———
plot(q1,q2,0);
}
write(“\ndelta_a=”);write(delta_a);
write(“, delta_a_increment=”);write(delta_a_inc);
write(“, motor F-steps=”);write(abs(round(delta_a_inc/
step_angle)));write(“, with
delay=”);write(steering_delay);write(“ms”);
if(delta_a_inc>0)
write(“, in dir=0”);
if(delta_a_inc<0)
write(“, in dir=1”);
displayStatus(“Steering”);
if(delta_a_inc>0)
{
while(delta_a_inc_cur<delta_a_inc)
{
step(2,0);step(3,1);
delay(steering_delay);
delta_a_inc_cur+=step_angle;
}
}
if(delta_a_inc<0)
{
while(delta_a_inc_cur>delta_a_inc)
{
step(2,1);step(3,0);
APPENDIX A: TURTLE.CPP 331
delay(steering_delay);
delta_a_inc_cur-=step_angle;
}
}
}
if(_v>=0)
dir=0;
else
dir=1;
if(_t==-1)
_t=_distance/_v;
setSteering(_delta);
q3+=delta_p;
delta_a=0;
displayPar(delta_a,v_a);
displayPosition(q1,q2,q3);
{
//if global array used for whole problem then we’ve to use
a global increment (ie p here).
if(fabs(delta_a)>delta_a_min)
{
x_int=(l/tan(delta_a))*sin((v_a/l)*tan(delta_a)*t_int);
y_int=(l/tan(delta_a))*(1-cos((v_a/
l)*tan(delta_a)*t_int));
q1_int[p+1]=q1_int[p]+(x_int*cos(q3_int[p])-
y_int*sin(q3_int[p]));
q2_int[p+1]=q2_int[p]+(x_int*sin(q3_int[p])+
y_int*cos(q3_int[p]));
q3_int[p+1]=q3_int[p]+((v_a/l)*tan(delta_a)*t_int);
//not required
}
else
{
x_int=v_a*t_int;
y_int=0;
q1_int[p+1]=q1_int[p]+(x_int*cos(q3_int[p])-
y_int*sin(q3_int[p]));
q2_int[p+1]=q2_int[p]+(x_int*sin(q3_int[p])+
y_int*cos(q3_int[p]));
q3_int[p+1]=q3_int[p]+0;
//not required
}
}
/*for(int r=0;r<p;r++)
{
write(“\nq1_int[“);write(r);write(“]=”);write
(q1_int[r]);write(“ ,q2_int[“);write(r);
write(“]=”);write(q2_int[r]);
}*/
//———
else
{
x=v_a*_t;
y=0;
q1+=x*cos(q3)-y*sin(q3);
q2+=x*sin(q3)+y*cos(q3);
q3+=0;
}
write(“\nGlobal co-ordinates of vehicle CoG: [“);
write(q1,4);write(q2,4);write(“,”);write(q3,4);write(“]”);
//———
while((delay_Rl*(i+1))<=(_t*1000))
{
i++;
timer_Rl[i]=delay_Rl*i;
}
while((delay_Rr*(j+1))<=(_t*1000))
334 ROBOTICS
{
j++;
timer_Rr[j]=delay_Rr*j;
}
int k=1,l=1,m=0,flag;
timer_main[m][0]=0; timer_main[m][1]=5;
for(k=1;k<=i;k++)
{
flag=1;
while((l<=j)&&(flag==1))
{
if(timer_Rl[k]<timer_Rr[l])
{
timer_main[++m][0]=timer_Rl[k];
timer_main[m][1]=2;
flag=0;
}
else
{
if(timer_Rl[k]==timer_Rr[l])
{
timer_main[++m][0]=timer_Rl[k];
timer_main[m][1]=5;
l++;
flag=0;
}
else
{
timer_main[++m][0]=timer_Rr[l];
timer_main[m][1]=3;
l++;
}
}
}
if(timer_Rl[i]!=timer_Rr[l])
{
timer_main[++m][0]=timer_Rr[l];
timer_main[m][1]=3;
}
}
if(stat_flag==’D’||stat_flag==’d’||stat_flag==’B’||stat_
flag==’b’)
{
cout<<“\nmotor Rl - “<<(i+1)<<“ steps”;
cout<<“\nmotor Rr - “<<(j+1)<<“ steps”;
}
if(stat_flag==’L’||stat_flag==’l’||stat_flag==’B’||stat_
flag==’b’)
{
outfile<<“\nmotor Rl - “<<(i+1)<<“ steps”;/*cout<<“ with
step times:-\n”;
for(p=0;p<=i;p++)
{
outfile<<setw(4)<<timer_Rl[p]<<“|”;
if((p+1)%25==0)
outfile<<“\n”;
}*/
outfile<<“\nmotor Rr - “<<(j+1)<<“ steps”;/*cout<<“ with
step times:-\n”;
for(p=0;p<=j;p++)
{
outfile<<setw(4)<<timer_Rr[p]<<“|”;
if((p+1)%25==0)
outfile<<“\n”;
}*/
/*outfile<<“\ncombined step timing array:-\n”;
for(p=0;p<=m;p++)
{
outfile<<setw(4)<<timer_main[p][0]<<“(“<<timer_main
[p][1]<<“)|”;
if((p+1)%25==0)
outfile<<“\n”;
}*/
}
write(“\n———————————”);
//———
336 ROBOTICS
if(timer_main[n][1]==5)
{
step(2,dir);
step(3,dir);
}
else
{
step(timer_main[n][1],dir);
}
while(((t_int*1000*p)>=timer_main[n-1][0])&&((t_int*1000*p)
<=timer_main[n][0]))
{
plot(q1_int[p],q2_int[p],0);
displayPosition(q1_int[p],q2_int[p],q3_int[p]);
p++;
}
}
//———
plot(q1,q2,0);
}
void main()
{
const float pi=3.1416;
float xd=-100, yd=100;
// co-ordinates of destination point, values in mm
float v0=20.0,v1=3.5,vpar=0.5,cpar=1; // parameters
float t=2; // time interval in s
float e1,e2,e3;
// local co-ordinates of destination point (mm,mm,radians)
float x_err=0.5,y_err=0.5;
// final closeness to destination point
float rad,vel,angle,ang;
APPENDIX A: TURTLE.CPP 337
char motion;
clrscr();
promptForStatus();
cout<<“\nDo you want a motion along an arc(c) or to destination
points(p)? “;
cin>> motion;
if(motion==’p’)
{
cout<<“\n”;
cout<<“\nEnter destination co-ordinates:-”;
cout<<“\nx=”;
cin>>xd;
cout<<“y=”;
cin>>yd;
initializeGFX(.3,.3);
plot(xd,yd,1);
plot(q1,q2,0);
displayStatus(“Execution Begins”);
while((fabs(xd-q1)>x_err)||(fabs(yd-q2)>y_err))
{
e1= (xd-q1)*cos(q3)+(yd-q2)*sin(q3);
e2= -(xd-q1)*sin(q3)+(yd-q2)*cos(q3);
e3= atan((yd-q2)/(xd-q1))-q3;
delta_a=e3;
if((abs(e1)>30)&&(e1!=0))
{
v=v0*((e1)/abs(e1));
delta=e3;
}
else
if(e1==0)
{
v=v0;
delta=e3;
}
else
{
v=v1*((e1)/abs(e1))+vpar*e1;
delta=0;
t=1;
}
moveVehicle(delta, v, t, -1);
338 ROBOTICS
}
displayStatus(“Execution Complete”);
closeGFX();
}
else if(motion==’c’)
{
cout<<“\n”;
cout<<“\nEnter the Details of the path:-”;
cout<<“\nradius=”;
cin>>rad;
cout<<“velocity=”;
cin>>vel;
cout<<“angle=”;
cin>>angle;
initializeGFX(.3,.3);
plot(xd,yd,1);
plot(q1,q2,0);
displayStatus(“Execution Begins”);
ang=(pi/180)*angle;
delta= atan(l/rad);
v=vel;
t=(rad*ang)/v;
moveVehicle1(delta, v, t, -1);
displayStatus(“Execution Complete”);
closeGFX();
}
}
APPENDIX B
ABOUT THE CD-ROM
Included on the CD-ROM are simulations, figures from the text, third party
software, and other files related to topics in robotics.
See the “README” files on the CD-ROM for specific information/system
requirements related to each file folder, but most files will run on Windows 2000
or higher and Linux.
339
INDEX
A DC Motors 23, 132
Denavit-Hartenberg Notation 222, 226
Accelerometers, 23, 267
Detector 97
Actuators, 129, 130, 131
Differentially Driven 156
Analog, 93
Digital 93
Arms, 5, 6
Dynamic 99, 309
Artificial, 1, 12, 13, 20
Artificial Intelligence, 12, 13, 16, 20
Assembly, 5, 32, 133 E
Automation, 13, 16, 22
Electronics 9, 69, 117, 153
Emitter 100, 284
B Encoders 23, 285, 286, 288
Beacon 96, 97, 100, 243, 246, 254, 255, 256, ENIAC 4
257, 258, 259, 261, 262 Evolutionary 21, 22
Bevel gears 32, 33, 35, 61 Expert Systems 20
Brain 2, 7, 22
Breadboard 71, 110 F
Falcon 253, 254
C Feedback 11, 306
Cams and Cranks 32 Field Effect Transistors 136
Cars 5 Flying Robots 13, 16, 19
Control 8, 18, 23, 35, 88, 107, 111, 112, 114, Forward Kinematics 23
153, 156, 176, 179, 180, 182, 183, 184, 188, Four-bar Mechanism 26, 28
190, 194, 204, 205, 292, 295 Frame 28, 243, 263, 269
Coordinate 49, 171, 174, 177, 219, 257 Fuzzy 21
D G
Data 21, 65, 73, 102, 105, 106, 107, 111, 114, Gaits 18, 304
117, 119, 121, 122, 123, 125, 153, 158, 195, Genetic Algorithms 22
204, 282, 285, 327 Gyroscopes 23, 267, 268
341
342 ROBOTICS
J P
Joint 53, 168, 242, 277, 292 Parallel Axis Gear Trains 37
Parallel Port 105, 110, 120, 151, 196, 202,
K 207, 287
Phototransistor 98, 99
Kaman 251, 252
Pneumatic 126, 129
Kinematics 29, 56, 161, 167, 176, 199, 240,
Potentiometer 72, 73
285
Pulse 91, 141
Pulse Width Modulation 140, 141
L PUMA 5, 7, 230, 231
Laser 281, 282
LEDs 75, 81, 82, 90, 107, 110, 125, 126, 283
Legged Robots 13, 16, 17, 291, 293
R
Light Sensors 96 Rack and Pinion 30, 33, 34
LORAN 250, 251, 252 Radar 3
Radio Communication 12
RAM 112, 124
M RF 243, 250, 253, 262, 264, 299, 303
Manipulator 7, 13, 23, 236, 240 Robotic Arm 16
Mapping 23, 205, 206, 215, 218, 230, 295 Robotics 1, 8, 10, 15, 16, 23
MATLAB 23, 179, 182, 186, 190 Robots 11, 13, 16, 19, 90, 307, 309
Mechanics 9 Robot Vision 13, 16, 19
Mechanisms 29, 43, 54, 295 ROM 124
Microcontroller 126 Rotation 217
MIT 11, 12, 13, 14, 250, 261 Rovers 9, 10, 11, 14
INDEX 343
S Transponder 261
TURTLE 207, 209, 287
Sensors 6, 11, 19, 23, 92, 93, 96, 100, 102,
282, 283, 287
Serial Communication 117, 121 U
Serial Port 103, 119, 122, 124, 153 Ultrasonic 243, 261
Simulation 182, 193, 292 Underwater Robots 13, 16, 18
Slider-crank Mechanism 28, 29, 52
Spur Gears 33
Stairs 7, 15, 292 V
Static 293, 294 Vision 13, 20, 283, 292
Stepper Motors 144, 145, 147, 149, 200
Surgery 7
W
Wheeled Mobile Robots 13, 16, 23, 155,
T 156, 175
Tracking 176, 282, 311 WMR 23, 155, 158, 159, 161, 169, 172, 175,
Trajectory 175, 177, 184, 185, 186, 188, 190, 176, 181, 194, 195, 201, 202, 205, 206, 285
192, 193, 202 Worm and Wheel 36, 61, 62
Translation 34
O N THE CD ROBOTICS
The CD-ROM includes figures, Appin Knowledge Solutions
simulations, and other resources
This up-to-date text/reference is designed to present the fundamental
SIMULATIONS / TUTORIALS principles of robotics with a strong emphasis on engineering applications
■ KINEMATICS SIMULATIONS and industrial solutions based on robotic technology. It can be used by
& TUTORIALS practicing engineers and scientists—or as a text in standard university
John A. MacKinnon, Ph.D.
http://www.colba.net/~htran/physics
courses in robotics. The book has extensive coverage of the major robotic
classifications, including Wheeled Mobile Robots, Legged Robots, and the
■ NONHOLONOMIC-WHEEL Robotic Manipulator. A central theme is the importance of kinematics to
MOBILE ROBOT (WMR) robotic principles. The book is accompanied by a CD-ROM with MATLAB®
Tao Gan simulations, photographs, tutorials, and third-party software (see On the
CD-ROM section).
ROBOTICS
■ 3-ROTATIONAL ARM ROBOT
Jason Damazo, Walla Walla College
FEATURES
■ SIMPLE ROBOTICS FRAME- ■ Discusses the major robot classifications including Wheeled Mobile Robots,
Legged Robots, and the Robotic Manipulator
WORK FOR RHINO ROBOT
ROBOTICS
V. Gourishankar
■ Provides an introduction to basic mechanics and electronics; presents math-
http://venkata83.com ematical modeling concepts; and performs robotic simulations using MATLAB
■ Includes extensive coverage of kinematics—integrated throughout the book
whenever appropriate
DEMOS ■ Includes a CD-ROM with demos, MATLAB simulations, photos, and more
■ PUMA 3D ROBOT DEMO
Don Riley, Walla Walla College
BRIEF TABLE OF CONTENTS
1. Introduction 2. Basic Mechanics 3. Basic Electronics 4. Wheeled
■ NEUROS ROBOT DEMO
Mobile Robots 5. Kinematics of Robotic Manipulators 6. Classification
Institut für Neuroinformatik
Ruhr-Universität Bochum of Sensors 7. Legged Robots. Appendix. Index.
(from the 3-ROTATIONAL ARM (from the PUMA (from the SIMPLE ROBOTICS
ROBOT) 3D ROBOT DEMO) FRAMEWORK FOR RHINO ROBOT)
ISBN: 978-1-934015-02-5
U.S. $59.95 / Canada $70.95 INFINITY SCIENCE PRESS
11 Leavitt Street
Hingham, MA 02043
(781) 740-4487
(781) 740-1677 FAX APPIN
info@infinitysciencepress.com KNOWLEDGE
www.infinitysciencepress.com SOLUTIONS
All trademarks and service marks are the property of their respective owners.
Cover design: Tyler Creative
E N G I N E E R I N G S E R I E S