Autonomous Hazardous Materials Handling Mobile Robot | Robot | Technology

I

AUTONOUMOS HAZARDOUS MATERIALS HANDLING
MOBILE ROBOT
A(HM)
2
R

A Report submitted in partial fulfillment of the requirement for the degree of
B.Sc. (HON)
In
Electrical and Electronic Engineering
Under Supervision of
Uzt. Loui Farouq Mustafa
Uzt. Samah Mohammed Hashim

By
MOMEN AHMED EL-SADIG DIAB
To
Department of Electrical and Electronic Engineering
Faculty of Engineering
University of Khartoum
July 2009
I



., »··~ .. ~.~ ~~~




I


Acknowledgments

Special thanks go to my supervisors, Uzt. Loui Farouq, who offered me this project, and who
provided invaluable advice and motivated me to succeed, and Uzt. Samah Hashim who was very
patient with us and who paid a lot attention even that she was extremely busy. Thanks also to my
uncle Dr. Kamal Diyab, Without his tremendous and unlimited support I wouldn’t have possibly
imagined to do such a wonderful and technically challenging work.
My fellow colleague, Osama El-Obied who pushed me to the limits and insisted that we
accomplish the mission in the best possible way, thank you.
To my friends, for their advice, support and friendship over the past five years. Thank you all in
no particular order.
Exceptional thanks to my friend Mohammed Talha for his great suggestions and assistance
through the last years and for the hilarious jokes he made about this project.










II

Abstract
The Autonomous Hazardous Materials Handling Mobile Robot A(EH)
2
R is an attempt to
initiate the study and design of autonomous mobile robots that seek to save human lives and to
shield people from working in contaminated areas. A(EH)
2
R mission is to pick up a sample
from a pile of some hazardous material and to deliver it to an identified deposit site. A(EH)
2
R is
a microcontroller based system in the midst of stepper motors, servo motors, mechanical
components and many other devices which are organized together to achieve the defined
mission. This thesis addresses the design, the construction, and the development of the control
system and the mechanical components for A(EH)
2
R two-wheeled differential drive system and
the manipulator that allow it to handle items.













III

¸'=---''

`' -,-¸'' =='' -',-'' _- .-'·--'' .----'' ¸'`--- ' , -'-'¸-'' ---' ª','=- ,» -¸, ¸`= -'-,-¸''- ª-'·--'' -'-,---''
`' ' ª,'`--- '' ¸· .-·'' ¸= ¸--'' -== _'= .-·- , ª,¸--'' _',¸`' _'= ='-='' ---- ¸-'' ª'----' ª`,'-'' ¸='-- . ª-+-
'' ´'---- --=- _'-,' _·,- _'' '+',-,- , -¸,== --'- »'´¸ ¸- ª-,= -=' ¸» -,-¸ . »'=- ,» -,-¸'' _,¸--'' ¸¸·'
¸- ª=,-=- =-, ¸· -,=,- ¸,·- »´=-- _'= ----- ' -'´¸=- ' ¸----'' ¸',- ) , -,=='' -'´¸=- ,·¸,-'' -'´¸=- ( ,
ª-=--- ¸¸=' -¸+=' , ª,´,-'´,-'' -'-,´-'' ¸- ª=,-=- ª-+-'' ¸'=-` '+-·- _- . -,,-- , »,--- _'= ¸´¸- ª''-¸'' --»
ª,´,-'´,-'' ¸-'-·'' , »´=-'' »'=- -'-=' , ¸'-´-, ¸'-''' ¸'`' _'¸-'' , ª,'-'--'' ¸,,--'' ª-,=--' _- .-'·-'' ¸- -,-¸''
-',-'' .















IV

Table of Contents
Acknowledgments............................................................................................................................ I
Abstract ........................................................................................................................................... II
¸'=---'' .......................................................................................................................................... III
List of Figures .............................................................................................................................. VII
Chapter One: Introduction ...................................................................................................... 1
1.1 Overview .......................................................................................................................... 1
1.2 Problem Statement ........................................................................................................... 1
1.3 Project Objectives ............................................................................................................ 1
1.4 Thesis Layout ................................................................................................................... 2
Chapter Two: Theoretical Concepts ....................................................................................... 3
2.1 Robotics ............................................................................................................................ 3
2.1.1 Definitions................................................................................................................. 3
2.1.2 Applications .............................................................................................................. 4
2.1.3 History of Robots ...................................................................................................... 5
2.1.4 Autonomous Robots ................................................................................................. 6
2.2 Hazardous Materials ......................................................................................................... 6
2.2.1 Definition .................................................................................................................. 6
2.2.2 Robots and Hazardous Materials .............................................................................. 6
2.3 Hardware Description and Theory of Operation .............................................................. 7
2.3.1 Actuators ................................................................................................................... 7
2.3.2 Microcontrollers ........................................................................................................ 9
2.3.3 Motor Interface (Darlington Transistor Array) ....................................................... 10
2.3.4 User Interface (Hex Keypad) .................................................................................. 10
2.3.5 Stepper Motors Position Feedback Sensor (Optical Encoder) ................................ 11
V

Chapter Three: Locomotion, kinematics and Manipulation ................................................. 13
3.1 Locomotion .................................................................................................................... 13
3.1.1 Legged Mobile Robots ............................................................................................ 14
3.1.2 Wheeled Mobile Robots ......................................................................................... 15
3.2 Kinematics ...................................................................................................................... 18
3.2.1 Kinematic Models and Constraints ......................................................................... 18
3.2.2 Differential Steering System Kinematics................................................................ 21
3.3 Manipulation .................................................................................................................. 23
3.3.1 Definitions............................................................................................................... 23
3.3.2 Manipulator Statics ................................................................................................. 27
3.3.3 Manipulator Kinematics.......................................................................................... 30
Chapter Four: Design and Implementation ........................................................................... 31
4.1 A(EH)
2
R Design ........................................................................................................... 31
4.1.1 Locomotion ............................................................................................................. 31
4.1.2 Mechanical Design.................................................................................................. 32
4.1.3 Electronics and Circuit Design ............................................................................... 37
4.1.4 Software Design ...................................................................................................... 43
Chapter Five: Results Discussion ......................................................................................... 52
5.1 Locomotion and Navigation Performance ..................................................................... 52
5.2 Manipulation Performance ............................................................................................. 52
Chapter Six: Conclusions and Future Work ......................................................................... 54
6.1 Conclusions .................................................................................................................... 54
6.2 Future Work ................................................................................................................... 54
References ..................................................................................................................................... 57
Appendix A: Circuit Schematic .................................................................................................... 60
VI

Appendix B: Software Code ......................................................................................................... 59
Appendix C: Tools and Components ............................................................................................ 74
Appendix D: Components Layout …....…………………………………………………………75


















VII

List of Figures
Figure 2.1 Task based classification of robots ................................................................................ 5
Figure 2.2 Unipolar stepper motor coils configuration (4) ............................................................. 8
Figure 2.3 Servo motor main parts ................................................................................................. 9
Figure 2.4 ULN2803 ..................................................................................................................... 10
Figure 2.5 Hex Keypad ................................................................................................................. 11
Figure 2.6 An Optical encoder ...................................................................................................... 12
Figure 3.1 A biped walking system can be approximated by a rolling polygon .......................... 13
Figure 3.2 The four basic wheel types. (a) Standard wheel: two degrees of freedom; rotation
around the (motorized) wheel axle and the contact point.(b) castor wheel: two degrees of
freedom; rotation around an offset steering joint. ......................................................................... 15
Figure 3.3 The global reference frame and the robot local reference frame. ................................ 19
Figure 3.4The mobile robot aligned with a global axis. ............................................................... 20
Figure 3.5 A differential-drive robot in its global reference frame. ............................................. 20
Figure 3.6 Differential steering ..................................................................................................... 22
Figure 3.7 Differential steering relations ...................................................................................... 23
Figure 3.8 A 4 DOF Robot Arm, three are out of plane and FBD for the human arm ................ 24
Figure 3.9 A 3 DOF manipulator .................................................................................................. 25
Figure 3.10 A(EH)
2
R work space .............................................................................................. 25
Figure 3.11 Shelled semi-sphere. ................................................................................................. 26
Figure 3.12 Mobile robot with manipulator ................................................................................. 26
Figure 3.13 Torque required to hold a mass. ................................................................................ 28
Figure 3.14 Perpendicular component of length between the pivot and the force. ..................... 28
Figure 3.15 The torque required at the second joint must be re-calculated .................................. 29
Figure 3.16 Multiple solurions ...................................................................................................... 30
Figure 4.1 A(EH)
2
R platform ..................................................................................................... 33
Figure 4.2 A(EH)
2
R dimensions (in mm). ................................................................................. 34
Figure 4.3 A(EH)
2
R manipulator ............................................................................................... 35
Figure 4.4 A(EH)
2
R container .................................................................................................... 35
Figure 4.5 A(EH)
2
R standard wheel .......................................................................................... 36
VIII

Figure 4.6 A(EH)
2
R ................................................................................................................... 36
Figure 4.7 ATmega32L pin configuration .................................................................................... 37
Figure 4.8 PM55L-048 specifications ........................................................................................... 38
Figure 4.9 PM55L-048 dimensions .............................................................................................. 39
Figure 4.10 PM35L-048 specifications......................................................................................... 39
Figure 4.11PM35L-048 dimensions ............................................................................................. 40
Figure 4.12 A(EH)
2
R manipulator FBD .................................................................................... 40
Figure 4.13 Parallax standard servo (#900-00005) ...................................................................... 41
Figure 4.14 Circuit Architecture .................................................................................................. 43
Figure 4.15 A(EH)
2
R takes an orientation toward destination .................................................. 44
Figure 4.16 A(EH)
2
R moves forward to destination .................................................................. 44
Figure 4.17 A(EH)
2
R rotates toward deposit site ....................................................................... 45
Figure 4.18 A(EH)
2
R moves forward to deposit site ................................................................. 46
Figure 4.19 rotates toward the origin ............................................................................................ 46
Figure 4.20 A(EH)
2
R moves to origin ....................................................................................... 46
Figure 4.21 A(EH)
2
R takes an orientation in the positive x-direction ....................................... 47
1


1 Chapter One
Introduction
1.1 Overview
Nowadays, the field of autonomous mobile robotics attracts an accelerating interest. Application
areas are plentiful in both industry and academia, but an autonomous mobile robot system also
demands high performance of both mechanical components and control software. Soon virtually
every aspect of human activity will be influenced by robotics. Advances in medicine, space
exploration, security, maintenance, transportation, agriculture, manufacturing, retailing, and
more will become dependent on intelligent machines programmed to carry out ever-increasingly
difficult tasks. Advances in robotics will be as dynamic and important as those of computers in
the 80s and 90s.
1.2 Problem Statement
Humans dealing with hazardous materials could get injured if appropriate regulations are not
taken. Even if attention is paid while handling such materials accidents are still possible.
Robots are ideal for use in hazardous environments by removing people from direct exposure to
unfriendly conditions such as materials that are radioactive or highly explosive.
1.3 Project Objectives
The main objective of this project is to design, construct and test an autonomous mobile robot
that can handle hazardous materials without continuous human intervention.
The project objectives are:
1 Construct the required parts of the robot platform and manipulator.
2 Attach the actuators to the platform and the manipulator.
3 Fasten the supporting parts such as the bucket and the container.
4 Build the electric circuit that drives and controls the motors.
2

5 Write a C program that accepts orders from an operator through a keypad and provides
the necessary signals for motors function.
6 Test the completed system and perform required refinements.
The following are assumed:
• The robot work space is a free even plane.
• The robot initial position is either known by the robot’s controller or entered by
an operator.
• The hazardous material that the robot is supposed to take a sample from is in
powder form.
• The pile of the hazardous material location is known and entered by an operator.
1.4 Thesis Layout
The thesis is organized as follows:
Chapter 2 states some definitions and explanations of robotics, hazardous materials and devices
used for the project implementation.
Chapter 3 discusses the physical and mathematical concepts related to mobile robots and
manipulators such as locomotion, kinematics and statics.
Chapter 4 shows the mechanical design of the unit with detailed drawings, electrical design
procedure and electronic circuit description is given in detail, and the software that controls the
robot is explained.
Chapter 5 gives the results obtained from testing the system and a brief discussion about these
results.
Chapter 6 has the conclusion and the future work.



3

2 Chapter Two
Theoretical Concepts
This chapter provides the necessary theoretical background for the project. It is attained through
examination of various textbooks and online resources.
2.1 Robotics
In this section an introduction to robotics and their application in our world is provided. A brief
history of the improvement of this fascinating field is given as well.
2.1.1 Definitions
The word robot made its debut in 1921, in the play R.U.R. (Rossum's Universal Robots) by
Karel Capek. It comes from the word "robota", a Czech term for forced labor. But definitions of
what a robot actually is vary widely.
The International Organization for Standardization gives a definition of robot in ISO 8373: "an
automatically controlled, reprogrammable, multipurpose, manipulator programmable in three or
more axes, which may be either fixed in place or mobile for use in industrial automation
applications."
Encyclopedia Britannica gives the following definition: "A robot device is an instrumented
mechanism used in science or industry to take the place of a human being. It may or may not
physically resemble a human or perform its tasks in a human way, and the line separating robot
devices from merely automated machinery is not always easy to define. In general, the more
sophisticated and individualized the machine, the more likely it is to be classed as a robot
device."[1]
Alan Mackworth, the director of the University of British Columbia Laboratory for
Computational Intelligence and president of the American Association for Artificial Intelligence,
says:
4

"It's a machine that can sense and act and react in the world and possibly involves some
reasoning for performing these actions, and it does so autonomously. By that definition a
thermostat would be a robot. Though it's not 'aware' it has a goal, that awareness isn't required."
Rodney Brooks, the director of the Massachusetts Institute of Technology computer science and
artificial intelligence laboratory, says:
"To me a robot is something that has some physical effect on the world, but it does it based on
how it senses the world and how the world changes around it."
Joseph Engelberger has been called the father of robotics. Asked to define a robot, he once said
"I can't define a robot, but I know one when I see one."
To mimic the human like operation is the core objective of any robot. Robotics is an “applied
science” which can incorporate high-technology, electronics, mechanics, pneumatics, remote
actuation and, of course, the technology of creating, designing, building, ‘manufacturing’ and
applying robots and robotic systems. To effectively conceive and then implement robotic designs
calls for more than a working knowledge of many separate ‘sciences’, including electronics,
mechanics, servo-mechanisms, computers, programming and a logical, ordered mind, even when
brainstorming.
2.1.2 Applications
Robots were initially used in the automation sector to handle repetitive and simple tasks reliably,
with the objective of cost reduction per product. Along with the increased speed of embedded
microcontrollers, the service robotic sector has started to grow. Figure 2.1 provides a task based
classification of robots in which service robots are divided into several subcategories. Domestic
robots are being designed to assist humans with tasks such as vacuum cleaning, lawn mowing,
mobile security, rescuing missions, materials handling, car production, packing and window
cleaning.

There are many jobs which humans would rather leave to robots. The job may be boring, such as
domestic cleaning, or dangerous like handling a hazardous material. Other jobs are physically

inaccessible, such as exploring another
laparoscopic


2.1.3
The concept of automated machines dates to antiquity with myths of mechanical beings brought
to life. Automata
churches, and 18th
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
but as humanity developed mechanical skills and
artificial creatures began to rely more on mechanism than ma
Mechanical computers and mechanical controllers were developed in the 19th century, but the
arrival of the moder
advent of 20th Century.
Many robots were constructed before the dawn of computer
public relations purposes of major firms. Electro appeared
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
perform a few stunts, like the autom
uomesLlc 8oboLs
inaccessible, such as exploring another
laparoscopic surgery.
History of R
The concept of automated machines dates to antiquity with myths of mechanical beings brought
to life. Automata, or humanlike machines, also appeared in the clockwork
churches, and 18th-century watchmakers were famous for their clever mechanical creatures.
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
but as humanity developed mechanical skills and
artificial creatures began to rely more on mechanism than ma
Mechanical computers and mechanical controllers were developed in the 19th century, but the
arrival of the modern concept of the robot, as well as the coining of the word "robot", awaited the
advent of 20th Century.
Many robots were constructed before the dawn of computer
public relations purposes of major firms. Electro appeared
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
perform a few stunts, like the autom
lndusLrlal 8oboLs
uomesLlc 8oboLs
inaccessible, such as exploring another
surgery.
Figure
History of Robots
The concept of automated machines dates to antiquity with myths of mechanical beings brought
, or humanlike machines, also appeared in the clockwork
century watchmakers were famous for their clever mechanical creatures.
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
but as humanity developed mechanical skills and
artificial creatures began to rely more on mechanism than ma
Mechanical computers and mechanical controllers were developed in the 19th century, but the
n concept of the robot, as well as the coining of the word "robot", awaited the
advent of 20th Century.
Many robots were constructed before the dawn of computer
public relations purposes of major firms. Electro appeared
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
perform a few stunts, like the autom
lndusLrlal 8oboLs
LnLerLalnmenL
8oboLs
inaccessible, such as exploring another planet
Figure 2.1 Task based classification of robots

The concept of automated machines dates to antiquity with myths of mechanical beings brought
, or humanlike machines, also appeared in the clockwork
century watchmakers were famous for their clever mechanical creatures.
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
but as humanity developed mechanical skills and
artificial creatures began to rely more on mechanism than ma
Mechanical computers and mechanical controllers were developed in the 19th century, but the
n concept of the robot, as well as the coining of the word "robot", awaited the
Many robots were constructed before the dawn of computer
public relations purposes of major firms. Electro appeared
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
perform a few stunts, like the automatons of the eighteenth century
8oboLs
lndusLrlal 8oboLs Servlce 8oboLs
LnLerLalnmenL
8oboLs for
Pazardous
LnvlronmenLs
planet, cleaning the inside of a long pipe, or performing
Task based classification of robots
The concept of automated machines dates to antiquity with myths of mechanical beings brought
, or humanlike machines, also appeared in the clockwork
century watchmakers were famous for their clever mechanical creatures.
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
but as humanity developed mechanical skills and discovered the principles of electricity, tales of
artificial creatures began to rely more on mechanism than ma
Mechanical computers and mechanical controllers were developed in the 19th century, but the
n concept of the robot, as well as the coining of the word "robot", awaited the
Many robots were constructed before the dawn of computer
public relations purposes of major firms. Electro appeared
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
ns of the eighteenth century
Servlce 8oboLs
8oboLs for
Pazardous
LnvlronmenLs
, cleaning the inside of a long pipe, or performing
Task based classification of robots
The concept of automated machines dates to antiquity with myths of mechanical beings brought
, or humanlike machines, also appeared in the clockwork
century watchmakers were famous for their clever mechanical creatures.
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
discovered the principles of electricity, tales of
artificial creatures began to rely more on mechanism than magic as the animating principal.
Mechanical computers and mechanical controllers were developed in the 19th century, but the
n concept of the robot, as well as the coining of the word "robot", awaited the
Many robots were constructed before the dawn of computer-controlled servomechanisms, for the
public relations purposes of major firms. Electro appeared in Westinghouse's pavilion at the
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
ns of the eighteenth century [2]
ConsLrucLlon
roboLs
, cleaning the inside of a long pipe, or performing
The concept of automated machines dates to antiquity with myths of mechanical beings brought
, or humanlike machines, also appeared in the clockwork figures of medieval
century watchmakers were famous for their clever mechanical creatures.
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
discovered the principles of electricity, tales of
gic as the animating principal.
Mechanical computers and mechanical controllers were developed in the 19th century, but the
n concept of the robot, as well as the coining of the word "robot", awaited the
controlled servomechanisms, for the
in Westinghouse's pavilion at the
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
[2].
ConsLrucLlon
roboLs
Medlcal Þurpose
, cleaning the inside of a long pipe, or performing
The concept of automated machines dates to antiquity with myths of mechanical beings brought
figures of medieval
century watchmakers were famous for their clever mechanical creatures.
Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
discovered the principles of electricity, tales of
gic as the animating principal.
Mechanical computers and mechanical controllers were developed in the 19th century, but the
n concept of the robot, as well as the coining of the word "robot", awaited the
controlled servomechanisms, for the
in Westinghouse's pavilion at the
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
Medlcal Þurpose
8oboLs
5
, cleaning the inside of a long pipe, or performing

The concept of automated machines dates to antiquity with myths of mechanical beings brought
figures of medieval

Prior to the industrial revolution, artificial organisms were usually animated by magical forces,
discovered the principles of electricity, tales of
gic as the animating principal.
Mechanical computers and mechanical controllers were developed in the 19th century, but the
n concept of the robot, as well as the coining of the word "robot", awaited the
controlled servomechanisms, for the
in Westinghouse's pavilion at the
1939 New York World's Fair. Some were built in between such major public gatherings, such as
Garco, made by the Garrett firm in the 1950's. These were essentially machines that could
Medlcal Þurpose
6

After 1950, computers (and robotics), began to rapidly increase in both complexity and numbers
as the technology needed to make the devices became easier to produce.
2.1.4 Autonomous Robots
An autonomous robot is self-contained, housing its own controller, and not depending on a
central computer for its commands. It navigates its work environment under its own power,
usually by rolling on wheels or a track drive. Robot autonomy might at first seem like a great
asset: if a robot functions by itself in a system, then when other parts of the system fail, the robot
will keep working. However, in systems where many identical robots are used, autonomy is
inefficient. It is better from an economic standpoint to put programs in one central computer that
controls all the robots.
Simple robots, like those in assembly lines, are not autonomous. The more complex the task, and
the more different things a robot must do, the more autonomy it can have. The most advanced
autonomous robots have artificial intelligence [3].
2.2 Hazardous Materials
2.2.1 Definition
Hazardous materials ("HazMats") are solids, liquids, or gases that can harm people, other living
organisms, property, or the environment. They are often subject to chemical regulations.
Dangerous goods include materials that are radioactive, flammable, explosive or corrosive,
oxidizers or asphyxiate, bio-hazardous, toxic, pathogen or allergen substances and organisms,
but also physical conditions as compressed gases and liquids or hot material, including all goods
containing such materials or chemicals, or may have other characteristics that render it hazardous
in specific circumstances [3].
The use of robotics in situations involving hazardous materials can significantly reduce the risk
of human injury.
2.2.2 Robots and Hazardous Materials
Among the many justifications for using robotics, the most important is to shield people from
working in dangerous environments and from handling hazardous materials.
7

A common application of robots is for use in places that humans can go only at risk to their own
health or safety or that human can not go at all. Industries where nuclear materials are used often
make use of robots so that human workers are not exposed to the dangerous effects of radioactive
materials.
2.3 Hardware Description and Theory of Operation
In this section a brief description and the operation theory of some devices and tools used in the
project are given.
2.3.1 Actuators
All motors operate by means of electromagnetic effects. Electric current flows through a set of
coils, producing magnetic fields. The magnetic forces result in rotation. The greater the current
in the coils, the greater is the rotating force. When the motor is connected to a load, the force
needed to turn the shaft increases. The more the force, the greater the current flow, and the more
power is drawn from the power source. In electric motors, one set of coils rotates with the motor
shaft. This is called the armature coil. The other set of coils is fixed, and is called the field coil.
The commutator reverses the current with each half-rotation of the motor, so that the shaft keeps
turning in the same direction. [3]
2.3.1.1 Stepper Motor
Stepper motors are electromechanical actuators which convert digital inputs to analog motion.
This is possible through the motor's controller electronics. There are various types of stepper
motors such as solenoid activated, variable reluctance, permanent magnet and synchronous
inductor. Independent of stepper type, all are devices which index in fixed angular increments
when energized in a programmed manner. Stepper motors' normal operation consists of discrete
angular motions of uniform magnitude rather than continuous motion. A stepper motor is
particularly well suited to applications where the controller signals appear as pulse trains. One
pulse causes the motor to increment one angle of motion. This is repeated for one pulse.
Most stepper motors are used in an open loop system configuration, which can result in
oscillations. To overcome this, complex circuits or feedback is employed, thus resulting in a
closed loop system.
8

Unipolar stepper motor is discussed in details in the following paragraph since it is the type used
in A(EH)
2
R
1
.
Unipolar Stepper Motor
A Unipolar stepper motor has four fixed coils arranged around a magnetized rotor, as shown in
figure 2.2. Typically, the coils are arranged in two centre tapped pairs, on opposing sides of the
motor. Driving current through any coil will cause the rotor magnet to be attracted to it, and by
sequencing the drive current though each coil in turn, the motor can be made to rotate
continuously. Higher torque can be achieved if two coils are energized at a time, and by
alternating between one and two coil drive states, half stepping mode can be realized.
Stepper motors vary in the amount of rotation delivered per step. They can turn as little as 0.72
degree to as much as 90 degrees per step. The most common motors are in the 7.5 degrees- to 18
degrees-per-step range. Many have integral reduction gear trains so that they have even higher
angular resolution. The motor shaft will freely rotate when none of the coils are energized, but if
the last pattern in a series is maintained, the motor will resist being moved to a different position.
Because the motors are open-loop, if you do manage to mechanically overwhelm the motor and
turn the shaft to a new position, the motor will not try to restore itself to the old position. The
easiest way to control a stepper motor is by using four bits of a parallel I/O port from a computer
or a microcontroller.

Figure 2.2 Unipolar stepper motor coils configuration (4)
Stepper motors are, however, limited to about one horsepower and 2000 rpm, therefore limiting
them in many applications [4].

1
Through this thesis Autonomous Hazardous Materials Handling Mobile Robot will be referred to as A(EH)
2
R
9

2.3.1.2 Servo Motor
Servo motors incorporate several components into one device package:
• A small DC motor;
• A gear reduction drive for torque increase;
• An electronic position sensing and control circuit.
The output shaft of a servo motor does not rotate freely, but rather is commanded 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.

Figure 2.3 Servo motor main parts
The control signal consists of a series of pulses that indicate the desired position of the shaft.
Each pulse represents one position command. The length of a pulse in time corresponds to the
angular position [4].
Typical pulse times range from 0.7 to 2.0 milliseconds for the full range of travel of a servo
shaft. Most servo shafts have a 180 degree range of rotation. The control pulse must repeat every
20 milliseconds.
2.3.2 Microcontrollers
Robots have to be equipped with an intelligent agent to perform their tasks. Microprocessors and
microcontrollers have been the most widely used devices to provide intelligence to robots.
10

A microcontroller (also microcontroller unit, MCU or µC) is a small computer on a single
integrated circuit consisting of a relatively simple CPU combined with support functions such as
a crystal oscillator, timers, watchdog, serial and analog I/O etc. a program memory in the form of
NOR flash or OTP ROM is also often included on chip, as well as a, typically small, read/write
memory.
2.3.3 Motor Interface (Darlington Transistor Array)
ULN2004 has eight high-voltage, high current Darlington NPN transistor pairs. Stepper motor
coils are connected to the microcontroller through these transistors. This is necessary to provide
the sufficient current for the coils by an external power supply, protect the microcontroller from
the back electromotive voltage and to isolate the low current circuit of the microcontroller and
the keypad from the high current circuit of the stepper motor.

Figure 2.4 ULN2803
2.3.4 User Interface (Hex Keypad)
The hex keypad contains 16 keys, symmetrically arranged in four rows with four keys each.
Each column and row of the keypad is connected to an I/O pin. One port (eight pins) is set for
the hex keypad function. The port is divided into two nibbles, the lower one (P0-P3) is set as an
output port and is connected to the matrix rows while the upper nibble (P4-P7) is set as an input
port and it is connected to the matrix columns.
11

The microcontroller continually scans the keypad by setting all row pins except one to low level
and reading all column pins. All column inputs have pull-up resistors, so when a key is pressed
the microcontroller will distinguish a high level on one of the column inputs.

Figure 2.5 Hex Keypad
2.3.5 Stepper Motors Position Feedback Sensor (Optical Encoder)
Stepper motors work great when they are driven in open-loop. But for wheels driving the
possibility of skidding and slipping is always a concern.
An optical encoder is an electronic device that measures the extent to which a mechanical shaft
has rotated. It can also measure the rate of rotation (angular speed).
An optical encoder consists of a pair of light-emitting diodes (LEDs), a photo-detector, and a
chopping wheel. The LEDs shine on the photo-detector through the chopping wheel. The wheel
has radial bands; alternately transparent and opaque (see figure 2.6). The wheel is attached to the
shaft. As the shaft turns, the light beam is interrupted. Each interruption actuates a counting
circuit. The number of pulses is a direct function of the extent to which the shaft has rotated. The
frequency of pulses is a direct function of the rotational speed. Two LEDs, placed in the correct
positions, allow the encoder to indicate the direction (clockwise or counterclockwise) in which
the shaft rotates. Optical encoders are used in various robotic applications. In particular, they are
used in manipulators to measure the extent of joint rotation [3].
12


Figure 2.6 An Optical encoder

Absolute encoders are best suited for slow 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 [5].









13

3 Chapter Three
Locomotion, kinematics and Manipulation
In this chapter, a general explanation concerning locomotion techniques used in modern robots is
provided and a description of mechanical behavior of robots is presented.
3.1 Locomotion
A mobile robot needs locomotion mechanisms that enable it to move unbounded throughout its
environment. But there are a large variety of possible ways to move, and so the selection of a
robot’s approach to locomotion is an important aspect of mobile robot design. In the laboratory,
there are research robots that can walk, jump, run, slide, skate, swim, fly, and, of course, roll.
Most of these locomotion mechanisms have been inspired by their biological counterparts.
There is, however, one exception: the actively powered wheel is a human invention that achieves
extremely high efficiency on flat ground. This mechanism is not completely foreign to biological
systems. Our bipedal walking system can be approximated by a rolling polygon, with sides equal
in length to the span of the step (figure 3.2). As the step size decreases, the polygon approaches a
circle or wheel. But nature did not develop a fully rotating, actively powered joint, which is the
technology necessary for wheeled locomotion. Owing to these limitations, mobile robots
generally locomote either using wheeled mechanisms, a well-known human technology for
vehicles, or using a small number of articulated legs, the simplest of the biological approaches to
locomotion [6].

Figure 3.1 A biped walking system can be approximated by a rolling polygon
14

Locomotion is the complement of manipulation. In manipulation, the robot arm is fixed but
moves objects in the workspace by imparting force to them. In locomotion, the environment is
fixed and the robot moves by imparting force to the environment. In both cases, the scientific
basis is the study of actuators that generate interaction forces, and mechanisms that implement
desired kinematic and dynamic properties. Locomotion and manipulation thus share the same
core issues of stability, contact characteristics, and environmental type:
• Stability
- number and geometry of contact points
- center of gravity
- static/dynamic stability
- inclination of terrain
• Characteristics of contact
- contact point/path size and shape
- angle of contact
- friction
• Type of environment
- structure
- medium, (e.g. water, air, soft or hard ground)
3.1.1 Legged Mobile Robots
Legged locomotion is characterized by a series of point contacts between the robot and the
ground. The key advantages include adaptability and maneuverability in rough terrain. Because
only a set of point contacts is required, the quality of the ground between those points does not
matter so long as the robot can maintain adequate ground clearance. In addition, a walking robot
is capable of crossing a hole or chasm so long as its reach exceeds the width of the hole. A final
advantage of legged locomotion is the potential to manipulate objects in the environment with
15

great skill. An excellent insect example, the dung beetle, is capable of rolling a ball while
locomoting by way of its dexterous front legs.
The main disadvantages of legged locomotion include power and mechanical complexity. The
leg, which may include several degrees of freedom, must be capable of sustaining part of the
robot’s total weight, and in many robots must be capable of lifting and lowering the robot.
Additionally, high maneuverability will only be achieved if the legs have a sufficient number of
degrees of freedom to impart forces in a number of different directions [6].
3.1.2 Wheeled Mobile Robots
The wheel has been by far the most popular locomotion mechanism in mobile robotics and in
man-made vehicles in general. It can achieve very good efficiencies and does so with a relatively
simple mechanical implementation. In addition, balance is not usually a research problem in
wheeled robot designs, because wheeled robots are almost always designed so that all wheels are
in ground contact at all times. Thus, three wheels are sufficient to guarantee stable balance,
although two-wheeled robots can also be stable. When more than three wheels are used, a
suspension system is required to allow all wheels to maintain ground contact when the robot
encounters uneven terrain [6].

Figure 3.2 The four basic wheel types. (a) Standard wheel: two degrees of freedom; rotation around the (motorized) wheel
axle and the contact point. (b) castor wheel: two degrees of freedom; rotation around an offset steering joint.


16

3.1.2.1 Wheeled locomotion: the design space [6]
There is a very large space of possible wheel configurations when one considers possible
techniques for mobile robot locomotion. As there are a number of different wheel types with
specific strengths and weaknesses each one should be discussed and considered. Then, a
complete wheel configurations that deliver particular forms of locomotion for a mobile robot is
examined.
Wheel design
There are two major wheel classes, as shown in figure 3.2. They differ widely in their
kinematics, and therefore the choice of wheel type has a large effect on the overall kinematics of
the mobile robot. The standard wheel and the castor wheel have a primary axis of rotation and
are thus highly directional. To move in a different direction, the wheel must be steered first along
a vertical axis. The key difference between these two wheels is that the standard wheel can
accomplish this steering motion with no side effects, as the center of rotation passes through the
contact patch with the ground, whereas the castor wheel rotates around an offset axis, causing a
force to be imparted to the robot chassis during steering.
Regardless of what wheel is used, in robots designed for all-terrain environments and in robots
with more than three wheels, a suspension system is normally required to maintain wheel contact
with the ground.
Wheel geometry
The choice of wheel types for a mobile robot is strongly linked to the choice of wheel
arrangement, or wheel geometry. The mobile robot designer must consider these two issues
simultaneously when designing the locomoting mechanism of a wheeled robot. Wheel type and
wheel geometry choice do matter as three fundamental characteristics of a robot are governed by
these choices: maneuverability, controllability, and stability.
Stublllty
Surprisingly, the minimum number of wheels required for static stability is two. A two-wheel
differential-drive robot can achieve static stability if the center of mass is below the wheel axle.
However, under ordinary circumstances such a solution requires wheel diameters that are
impractically large. Dynamics can also cause a two-wheeled robot to strike the floor with a third
17

point of contact, for instance, with sufficiently high motor torques from standstill.
Conventionally, static stability requires a minimum of three wheels, with the additional caveat
that the center of gravity must be contained within the triangle formed by the ground contact
points of the wheels. Stability can be further improved by adding more wheels, although once the
number of contact points exceeds three, the hyperstatic nature of the geometry will require some
form of flexible suspension on uneven terrain.
Muneuverublllty
Maneuverability is the ability to translate or change direction of motion. In the research
community, many classes of mobile robots are popular which achieve high maneuverability, only
slightly inferior to that of the omnidirectional configurations. In such robots, motion in a
particular direction may initially require a rotational motion. With a circular chassis and an axis
of rotation at the center of the robot, such a robot can spin without changing its ground footprint.
The most popular such robot is the two-wheel differential-drive robot where the two wheels
rotate around the center point of the robot. One or two additional ground contact points may be
used for stability, based on the application specifics.
Controllublllty
There is generally an inverse correlation between controllability and maneuverability. For
example, the omnidirectional designs such as the four-castor wheel configuration require
significant processing to convert desired rotational and translational velocities to individual
wheel commands. Furthermore, such omnidirectional designs often have greater degrees of
freedom at the wheel. In a differential-drive vehicle, the two motors attached to the two wheels
must be driven along exactly the same velocity profile, which can be challenging considering
variations between wheels, motors, and environmental differences.
In summary, there is no “ideal” drive configuration that simultaneously maximizes stability,
maneuverability, and controllability. Each mobile robot application places unique constraints on
the robot design problem, and the designer’s task is to choose the most appropriate drive
configuration possible from among this space of compromises.


18

3.2 Kinematics
Kinematics is the most basic study of how mechanical systems behave. In mobile robotics, we
need to understand the mechanical behavior of the robot both in order to design appropriate
mobile robots for tasks and to understand how to create control software for an instance of
mobile robot hardware. The process of understanding the motions of a robot begins with the
process of describing the contribution each wheel provides for motion. Each wheel has a role in
enabling the whole robot to move. By the same token, each wheel also imposes constraints on
the robot’s motion; for example, refusing to skid laterally [6].
3.2.1 Kinematic Models and Constraints
Deriving a model for the whole robot’s motion is a bottom-up process. Each individual wheel
contributes to the robot’s motion and, at the same time, imposes constraints on robot motion.
Wheels are tied together based on robot chassis geometry, and therefore their constraints
combine to form constraints on the overall motion of the robot chassis. But the forces and
constraints of each wheel must be expressed with respect to a clear and consistent reference
frame. This is particularly important in mobile robotics because of its self contained and mobile
nature; a clear mapping between global and local frames of reference is required. We begin by
defining these reference frames formally, then using the resulting formalism to annotate the
kinematics of individual wheels and whole robots.
3.2.1.1 Representing robot position
Throughout this analysis we model the robot as a rigid body on wheels, operating on a horizontal
plane. The total dimensionality of this robot chassis on the plane is three, two for position in the
plane and one for orientation along the vertical axis, which is orthogonal to the plane. Of course,
there are additional degrees of freedom and flexibility due to the wheel axles, wheel steering
joints, and wheel castor joints. However by robot chassis we refer only to the rigid body of the
robot, ignoring the joints and degrees of freedom internal to the robot and its wheels.
19


Figure 3.3 The global reference frame and the robot local reference frame.
In order to specify the position of the robot on the plane a relationship between the global
reference frame of the plane and the local reference frame of the robot is established, as in figure
3.3. The axes X
I
and ¥
I
define an arbitrary inertial basis on the plane as the global reference
frame from some origin 0: {X
I
, ¥
I
] . To specify the position of the robot, choose a point P on the
robot chassis as its position reference point. The basis defines two axes relative to P on the robot
chassis and is thus the robot’s local reference frame. The position of P in the global reference
frame is specified by coordinates x and y, and the angular difference between the global and local
reference frames is given by 0. We can describe the pose of the robot as a vector with these three
elements. Note the use of the subscript I to clarify the basis of this pose as the global reference
frame:
ç
I
= _
x
y
0
_ (3.1)
To describe robot motion in terms of component motions, it will be necessary to map motion
along the axes of the global reference frame to motion along the axes of the robot’s local
reference frame. Of course, the mapping is a function of the current pose of the robot. This
mapping is accomplished using the orthogonal rotation matrix:
20

R(0) = _
cos 0 sin0 u
-sin0 cos0 u
u u 1
_ (3.2)

Figure 3.4The mobile robot aligned with a global axis.
This matrix can be used to map motion in the global reference frame {X
I
, ¥
I
] to motion in terms
of the local reference frame {X
R
, ¥
R
] . This operation is denoted by R(0)ç
I
because the
computation of this operation depends on the value of 0:
ç
R
i
= R [
n
2
¸ ç
I
i
(3.3)

Figure 3.5 A differential-drive robot in its global reference frame.
21

3.2.1.2 Kinematic Modeling
Differential driven Mobile robot is a self contained autonomous entity, which can move wholly
with respect to its environment. Due to the entire body motion, it becomes difficult to estimate
the robot’s position, and there is no direct way of doing it , instead one much integrate the
motion of robot with respect to time by considering few other variables like the wheel slippage,
wheel misalignment etc, which makes motion estimation a challenging problem. To tackle this
problem we have to start bottom-up, we need to model the motion of wheels attached to the
motors. If we consider each wheel on the robot as a separate entity that when worked in alliance,
results in motion of entire robot body. So it is imperative to get a clear model of wheels and its
constraints on robot’s mobility in kinematic modeling we will describe the robot as a function of
its geometry and individual wheel behavior.
3.2.2 Differential Steering System Kinematics
The following paragraphs gives more details about differential steering technique as it is the
method applied to steer A(EH)
2
R.
This simple and reliable wheel-based propulsion system is commonly used in smaller robots. It is
familiar from ordinary life because it is essentially the same system that is used in a wheelchair,
two wheels mounted on a single axis are independently powered and controlled, thus providing
both drive and steering functions. The equations in this subsection provide an elementary model
for the differentially steered drive system (which is often called a differential steering system).
This model can be used to predict how a robot equipped with such a system will respond to
changes in its wheel speed and what path it will follow under various conditions.
If both drive wheels turn in tandem, the robot moves in a straight line. If one wheel rotates faster
than the other, the robot follows a curved path inward toward the slower wheel. If the wheels
turn at equal speed, but in opposite directions, the robot pivots. Thus, steering the robot is just a
matter of varying the speeds of the drive wheels.
22


Figure 3.6 Differential steering
Referring to Figure 3.7, these relations are found:
S
L
= r0
S
R
= (r + b)0
S
M
= (r +
b
2
, )0
where S
L
, S
R
give the displacement (distance traveled) for the left and right wheels respectively,
r is the turn radius for the inner (left) wheel, b is the distance between wheels (from center-to-
center along the length of the axle), 0 and is the angle of the turn in radians.S
M
is the speed at the
center point on the main axle. In later discussion, the axle's center point will be treated as the
origin of the simulated robot's frame of reference.
23


Figure 3.7 Differential steering relations
Now the simple geometry for the differential steering system, it is easy to develop algorithms for
controlling the robot's path. Note, though, that we did make an important simplifying
assumption: the wheels maintain a steady velocity. We neglected the effects of acceleration. If
the wheels are allowed to accelerate, the curve which describes the robot's trajectory can become
much more complicated. When working with very light robots, where the mass (and inertia) of
the platform is small, we can often get away with treating changes in speed as nearly
instantaneous. The path that the robot follows will not be truly circular, but it will be close
enough for many applications. For larger and heavier robots, mass is important and acceleration
must be considered.
3.3 Manipulation
A manipulator consists of a robot arm, and the gripper or end effector at the end of the arm. The
term can also refer to a remotely controlled robot. Some of the terms related to manipulators are
defined next [3].
3.3.1 Definitions
3.3.1.1 Degrees of Freedom (DOF)
The degree of freedom, or DOF, is a very important term to understand. Each degree
of freedom is a joint on the arm, a place where it can bend or rotate or translate. You
24

can typically identify the number of degrees of freedom by the number of actuators on
the robot arm.
3.3.1.2 Denavit-Hartenberg (DH) Convention
The Robot Arm Free Body Diagram (FBD)
The Denavit-Hartenberg (DH) Convention is the accepted method of drawing robot
arms in FBD's. There are only two motions a joint could make: translate and rotate.
There are only three axes this could happen on: x, y, and z (out of plane). Note that
the DOF on the gripper (otherwise known as the end effector) are not counted. The
gripper is often complex with multiple DOF, so for simplicity it is treated as separate
in basic robot arm design.


Figure 3.8 A 4 DOF Robot Arm, three are out of plane and FBD for the human arm

Also note that a DOF has its limitations, known as the configuration space. Not all joints can
swivel 360 degrees. A joint has some max angle restriction. For example, no human joint can
rotate more than about 200 degrees. Limitations could be from wire wrapping, actuator
capabilities, servo max angle, etc. It is a good idea to label each link length and joint max angle
on the FBD.
3.3.1.3 Robot Workspace
The robot workspace (sometimes known as reachable space) is all places that the end
effector (gripper) can reach. The workspace is dependent on the DOF
25

angle/translation limitations, the arm link lengths, the angle at which something must
be picked up at, etc. The workspace is highly dependent on the robot configuration.
Let’s take the 3 DOF configuration
2
because it is simple, yet isn’t limiting in ability.

Figure 3.9 A 3 DOF manipulator
Now let’s assume that all joints rotate a maximum of 180 degrees, because most servo
motors cannot exceed that amount. To determine the workspace, trace all locations that
the end effector can reach as in the image below.

Figure 3.10 A(HM)
2
R work space
Now rotating that by the base joint another 180 degrees to get 3D, we have this workspace
image. Remember that because it uses servos, all joints are limited to a max of 180 degrees. This
creates a workspace of a shelled semi-sphere.

2
A(EH)
2
R has a manipulator similar to this one.
26


Figure 3.11 Shelled semi-sphere.
If the link lengths are changed you can get very different sizes of workspaces, but this would be
the general shape. Any location outside of this space is a location the arm can’t reach. If there are
objects in the way of the arm, the workspace can get even more complicated.
3.3.1.4 Mobile Manipulators
A moving robot with a robot arm is a sub-class of robotic arms. They work just like other robotic
arms, but the DOF of the vehicle is added to the DOF of the arm. If say you have a differential
drive robot (2 DOF) with a robot arm (5 DOF) attached that would give the robot arm a total sum
of 7 DOF.

Figure 3.12 Mobile robot with manipulator

27

3.3.2 Manipulator Statics
Statics is the branch of mechanics concerned with the analysis of loads (force, torque/moment)
on physical systems in static equilibrium, that is, in a state where the relative positions of
subsystems do not vary over time, or where components and structures are at a constant velocity.
When in static equilibrium, the system is either at rest, or its center of mass moves at constant
velocity. The study of moving bodies is known as dynamics.
The point of doing force calculations is for motor selection. Attention must be paid to assure that
the motor chosen can not only support the weight of the robot arm, but also what the robot arm
will carry.
Torque T is defined as a turning or twisting force and is calculated using the following relation:
I = F × I

The force F acts at a length L from a pivot point. In a vertical plane, the force acting on an object
(causing it to fall) is the acceleration due to gravity (g = 9.81m/s
2
) multiplied by its mass:
F = m × g

The force above is also considered the object's weight (W).
w = m × g

The torque required to hold a mass at a given distance from a pivot is therefore:
I = (m × g) × I

This can be found similarly by doing a torque balance about a point. Note that the length L is the
perpendicular length from the pivot to the force.
28


Figure 3.13 Torque required to hold a mass.
I = u = F × I -I

Therefore, replacing F with (m × g), we find the same equation above. This method is the more
accurate way to find torque (using a torque balance).
m × g × I = I
A


In order to estimate the torque required at each joint, we must choose the worst case scenario.

Figure 3.14 Perpendicular component of length between the pivot and the force.
In figure 3.14, a link of length L is rotated clockwise. Only the perpendicular component of
length between the pivot and the force is taken into account. We observe that this distance
decreases from I
3
to I
1
(I
1
being zero). Since the equation for torque is length (or distance)
multiplied by the force, the greatest value will be obtained using I
3
, since F does not change.
You can similarly rotate the link counterclockwise and observe the same effect.
It can be safe to assume that the actuators in the arm will be subjected to the highest torque when
the arm is stretched horizontally. Although the robot may never be designed to encounter
this scenario, it should not fail under its own weight if stretched horizontally without a load.
29

The weight of the object (the load) being held (A
1
in the figure), multiplied by the distance
between its center of mass and the pivot gives the torque required at the pivot. It should be taken
into consideration that the links may have a significant weight (w
1
, w
2
,...) and assumes its center
of mass is located at roughly the center of its length. The torques caused by these different
masses must be added:
I
1
= I
1
× A
1
+
1
2
I
1
× w
1


Note that the actuator weight A
2
as shown in the diagram below is not included when
calculating the torque at that point. This is because the length between its center of mass and the
pivot point is zero. Similarly, when calculating the torque required by the actuator A
3
, its own
mass is not considered. The torque required at the second joint must be re-calculated with new
lengths, as shown below:

Figure 3.15 The torque required at the second joint must be re-calculated
I
2
= I
5
× A
1
+ I
4
× w
1
+ I
3
× A
2
+I
6
× w
2


Knowing that the link weight (w
1
, w
2
) are located in the center (middle) of the lengths, and the
distance between actuators (I
1
and I
3
as in the diagram above) the equations are re-written as:
I
2
= (I
1
+ I
3
) × A
1
+ (
1
2
I
1
+ I
3
) × w
1
+ I
3
× A
2
+
1
2
I
3
× w
2


The tool only requires that the user enter the lengths of each link, which would be I
1
and I
3

30

above so the equation is shown accordingly. The torques at each subsequent joint can be found
similarly, by re-calculating the lengths between each weight and each new pivot point.
Note: if any of the joints have two or more motors, they share the torque required evenly.
Because the base of the arm is subjected to the highest torque, often two actuators are used
instead of one.

3.3.3 Manipulator Kinematics
Forward Kinematics
Forward kinematics is the method for determining the orientation and position of the end
effector, given the joint angles and link lengths of the robot arm.
Inverse Kinematics
Inverse kinematics is the opposite of forward kinematics. This is when the desired end effector
position is known, but need to know the joint angles required to achieve it.
What makes inverse kinematics so hard? Well, other than the fact that it involves non-linear
simultaneous equations, there are other reasons too.
First, there is the very likely possibility of multiple, sometimes infinite, number of solutions (as
shown in figure 3.16).

Figure 3.16 Multiple solutions
There is the possibility of zero solutions. Maybe the location is outside the workspace, or maybe
the point within the workspace must be gripped at an impossible angle.
Singularities, a place of infinite acceleration, can blow up equations and/or leave motors lagging
behind (motors can’t achieve infinite acceleration).
31

4 Chapter Four
Design and Implementation
This chapter presents the selections made for A(EH)
2
R locomotion and wheels configuration.
Mechanical design issues are also explained and detailed CAD drawings with actual dimensions
are shown. The electronic devices that control the behavior of A(EH)
2
R are presented in details
next. The last section describes the C program installed to the microcontroller flash memory and
illustrates the algorithm that the system follows to accomplish its mission.
4.1 A(HM)
2
R Design
4.1.1 Locomotion
Wheels are used as the locomotion mechanism that enables A(EH)
2
R to move unbounded
around its work space. Wheeled mobile robots can achieve very good efficiencies if the power
used to move the unit is considered and does so with a relatively simple mechanical
implementation.
4.1.1.1 Wheel configuration
Two independently driven standard wheels in the rear and one unpowered castor wheel in the
front constitute the wheel arrangement of A(EH)
2
R.
As stated before the standard wheel and the castor wheel have a primary axis of rotation and are
thus highly directional.
Stability
Conventionally, static stability requires a minimum of three wheels, with the additional caveat
that the center of gravity must be contained within the triangle formed by the ground contact
points of the wheels.
Maneuverability
In two-wheel differential-drive robot, the two wheels rotate around the center point of the robot.
One or two additional ground contact points may be used for stability, based on the application
specifics.
32

Controllability
The two rear wheels enable the unit to steer differentially if the angular velocities of the
motorized wheels are different. The castor wheel in the front adds one more contact point to
assure stability.
In a differential-drive robot, the two motors attached to the two wheels must be driven along
exactly the same velocity profile, which can be challenging considering variations between
wheels, motors, and environmental differences.
4.1.1.2 Motion Operators [7]
From the previous Sections, it should be clear that a mobile robot cannot move instantaneously
in all directions, but that it is capable to reach all possible poses in a plane. The basic motion
operators for mobile robots are presented next.
Differentially-Driven Robots
Rotate: by applying opposite velocities to both wheels, a differentially-driven robot rotates
instantaneously about the midpoint of its wheel axle.
Drive: by applying equal velocities to both wheels, a differentially-driven robot moves along its
longitudinal axis.
4.1.2 Mechanical Design
This section provides the mechanical details of A(EH)
2
R platform, manipulator, container and
motors placement.
4.1.2.1 A(HM)
2
R Platform
The platform makes up the body of A(EH)
2
R. As shown in figure 4.1 below, it is a wooden T-
shaped member with external extensions and flanges for support and motors attachment. It also
holds the main electric circuit board and the manipulator base stepper motor.
Drive stepper motors are fastened on the side extensions and the wheels are connected directly
to the motors shafts. The castor wheel is fitted in the front at an appropriate distance from the
manipulator base to improve unit stability, since stability depends on the triangle formed by the
three contact points (two drive wheels and the castor). The platform shape also contributes to the
unit appeal.
33


Figure 4.1 A(HM)
2
R platform
A(EH)
2
R dimensions are shown in figure 4.2. Dimensions are selected according to many
measures. Since the rear wheels drive motor rotates in discrete steps, there is a step
that A(EH)
2
R can take no steps smaller. The smaller the drive wheel diameter the shorter this
step becomes. Referring to the differential steering equations derived earlier it was found that the
distance between the two wheels contributes directly to the arc length that the unit make while
steering. Once more because of the drive motors discrete steps, the length between the two
motors should be minimized as possible.
4.1.2.1 A(HM)
2
R Manipulator
A three degree of freedom (3 DOF) manipulator is fixed on the platform. The manipulator has
one stepper motor at the base that adjusts the direction and two servo motors to change the end
effector position within the plane defined by the stepper position. Such a manipulator can
achieve a large work space enclosed within two hemispheres. Figure 4.3 shows links and the
joints position on the arm. The base link is 13 mm long and the larger link is 23 mm long. End
effector is formed as a bucket that can contain a small sample of the hazardous material and it is
connected to the actuator by a small rod.

34





Figure 4.2 A(HM)
2
R dimensions (in mm).

35


Figure 4.3 A(HM)
2
R manipulator
All manipulator parts are constructed from wooden pieces.
4.1.2.2 A(HM)
2
R Container
A container to hold the sample picked by the manipulator bucket is fitted in the back of the
platform.

Figure 4.4 A(HM)
2
R container
4.1.2.3 A(HM)
2
R Wheels
Two standard wheels are linked to the rear motors shafts directly and their dimensions are shown
in figure 4.5.
36


Figure 4.5 A(HM)
2
R standard wheel
All the parts described are connected together and the finished A(EH)
2
R is shown in figure 4.6.

Figure 4.6 A(HM)
2
R



37

4.1.3 Electronics and Circuit Design
The following sections depict the electrical and electronic devices utilized by A(EH)
2
R to
accomplish its mission. The main parts are the microcontroller unit, stepper motors, servo
motors, motors interface (Darlington transistor arrays) and operator interface (Hex keypad).
4.1.3.1 Microcontroller Unit
The microcontroller is the most important part of the whole system. Its function is to receive
inputs from operator and provide the necessary signals for the actuators operation. A(EH)
2
R has
one Atmel AVR ATmega32L as its intelligence unit. ATmega32L is a high performance, low
power 8-bit microcontroller. In addition to the basic tasks of every microprocessor, it has a
number of supporting modules which make it ideal for robots application. Some of the
ATmega32L features used by A(EH)
2
R are:
• 32 Programmable I/O Lines
• One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
• Four PWM Channels
• Internal Calibrated RC Oscillator


Figure 4.7 ATmega32L pin configuration
38

4.1.3.2 Drive motors
Two stepper motors are used to drive the two rear active wheels of A(EH)
2
R. As mentioned
earlier, stepper motors provide considerable advantage over typical DC motors specially when
operating under a micro-controller. Many measures alter the motor selection for the mobile
robot. Estimated robot weight, number of active wheels, maximum incline and maximum
velocity are the major criteria that determines the motor torque, current (power) requirements
and rated voltage. Other measures are static and rolling friction between the wheels and the
ground.
The force applied to the wheel is always tangent to the wheel. The required torque to move a
mobile robot is the force times the radius of the wheel. This torque is afforded by both motors.
The stepper motor model selected is PM55L-048 by Minebea its specifications are shown in
figure 4.8 and dimensions are shown in figure 4.9.

Figure 4.8 PM55L-048 specifications
39


Figure 4.9 PM55L-048 dimensions
4.1.3.3 Manipulator Motors
A(EH)
2
R manipulator has 3 DOF which requires three motors; the base motor is a stepper with
the first linkage attached to its shaft. Accuracy is not a key issue for this motor operation, thus a
stepper motor is acceptable.
Manipulator base motor model is PM35L-048 also by Minebea and its specifications are shown
in figure 4.10 below and dimensions in figure 4.11.

Figure 4.10 PM35L-048 specifications
40


Figure 4.11PM35L-048 dimensions
The two other motors are servo motors with a 18u
·
maximum rotation. Servo motors have
feedback sensors which provide a great accuracy for the manipulator function.
To calculate the torques required for servo motors selections the equations described earlier in
the manipulator statics are used. The torque calculations are done below:

Figure 4.12 A(HM)
2
R manipulator FBD
All torque calculations are worked out at the worst case (0
1
= 9u
o
, 0
2
= 18u
o
)
The wooden linkages are assumed to be homogenous and have their center of mass at their
geometrical centers.
Maximum torque I
1
at joint 1 (first servo motor required torque) is given by:
41

I
1
=
1
2
I
2
× A
2
+ I
2
× w
Where:
A
2
: second link weight
w: bucket weight + load weight
Maximum torque I
2
at joint 2 (second servo motor required torque) is given by:
I
2
= I
3
× w
Where:
A
3
: bucket rod length
w: bucket weight + load weight
Servo motors selected are standard servo (#900-00005) by Parallax. Its technical features are:
• Power 6vdc max
• Speed 0 deg to 180 deg in 1.5 seconds on average
• Weight 45.0 grams/1.59oz
• Torque 3.40 kg-cm / 47oz-in
• Size in mm (L x W x H) 40.5x20.0x38.0

Figure 4.13 Parallax standard servo (#900-00005)
42

4.1.3.4 Circuit Design
The circuit simply consists of the microcontroller unit, three ULN2803 ICs for stepper motors
interfacing and the keypad with its pull-up resistors.
One port (PORT C) is set aside for the drive stepper motors. Signals are generated by the MCU
in the proper sequence and they are passed to the ULN2803 input channels. Stepper motors coils
are connected to the ULN2803 output channels and their common wire is connected directly to a
18 V power source. ULN2803 connects the output channel with ground when a high level
voltage is applied to the adjacent input channel, thus a voltage difference is presented across a
coil when the input channel is set to high voltage.
The manipulator stepper motor is assigned to PORTA and its coils are activated by the MCU
through a ULN2803 as described above.
Servo motors control wires are connected directly to the two PWM signal channels in PORTD
and their power wires are connected to a 5.5 V power supply.
PORTB is divided into two parts, the four most significant pins are initialized as an input port
and the four least significant pins are initialized as an output port. Keypad columns are connected
to the higher pins and rows are connected to the lower pins. Four pull-up resistors are connected
between the columns and I
cc
.
A push-button is attached to the reset pin and many LEDs are used to show motors status.
A complete circuit schematic is given in appendix A.


4.1.4
The system main two objectives are to nav
coordinates and to handle materials in powder form with a 3 DOF manipulator.
A(EH)
2
global frame origin) to given coordinates in t
it to another given coordinates in the global frame
robot is supposed to forward to the global frame origin where the operator is waiting.
Equations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and
here extensively.
From the given pile coordinates
keypad
ManlpulaLor
Second Servo
MoLor
ManlpulaLor
llrsL Servo
MoLor
Software
The system main two objectives are to nav
coordinates and to handle materials in powder form with a 3 DOF manipulator.
) R is supposed to move from known coordinates (these coordinates are taken as the
global frame origin) to given coordinates in t
it to another given coordinates in the global frame
supposed to forward to the global frame origin where the operator is waiting.
ations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and
here extensively.
From the given pile coordinates
keypad
ManlpulaLor
Second Servo
MoLor
ManlpulaLor
llrsL Servo
MoLor
Design
The system main two objectives are to nav
coordinates and to handle materials in powder form with a 3 DOF manipulator.
is supposed to move from known coordinates (these coordinates are taken as the
global frame origin) to given coordinates in t
it to another given coordinates in the global frame
supposed to forward to the global frame origin where the operator is waiting.
ations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and
From the given pile coordinates(
MlcroconLroller
Figure 4.14
The system main two objectives are to nav
coordinates and to handle materials in powder form with a 3 DOF manipulator.
is supposed to move from known coordinates (these coordinates are taken as the
global frame origin) to given coordinates in t
it to another given coordinates in the global frame
supposed to forward to the global frame origin where the operator is waiting.
ations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and
(x
ì
, y
ì
) , A(EH
MlcroconLroller
14 Circuit Architecture
The system main two objectives are to navigate around its work space and
coordinates and to handle materials in powder form with a 3 DOF manipulator.
is supposed to move from known coordinates (these coordinates are taken as the
global frame origin) to given coordinates in the global frame
it to another given coordinates in the global frame (x
d
supposed to forward to the global frame origin where the operator is waiting.
ations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and
(EH)
2
R new orientation is calculated as follow:
1ranslsLor Array
1ranslsLor Array
1ranslsLor Array
Circuit Architecture
round its work space and
coordinates and to handle materials in powder form with a 3 DOF manipulator.
is supposed to move from known coordinates (these coordinates are taken as the
he global frame (x
ì
, y
ì
)
(
d
, y
d
) to deposit the material. Then
supposed to forward to the global frame origin where the operator is waiting.
ations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and
new orientation is calculated as follow:
uarllngLon
1ranslsLor Array
uarllngLon
1ranslsLor Array
uarllngLon
1ranslsLor Array
round its work space and
coordinates and to handle materials in powder form with a 3 DOF manipulator.
is supposed to move from known coordinates (these coordinates are taken as the
) to pick the sample and take
to deposit the material. Then
supposed to forward to the global frame origin where the operator is waiting.
ations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and
new orientation is calculated as follow:
round its work space and reach defined

is supposed to move from known coordinates (these coordinates are taken as the
to pick the sample and take
to deposit the material. Then
supposed to forward to the global frame origin where the operator is waiting.
ations that allow the transformation from global to local frame with the relations that gives
the rotation angle and the distance to destination were derived in chapter four and they are used
new orientation is calculated as follow:
LefL Wheel
SLepper
MoLor
ManlpulaLor
8ase SLepper
MoLor
8lghL Wheel
SLepper
MoLor
43

reach defined
is supposed to move from known coordinates (these coordinates are taken as the
to pick the sample and take
to deposit the material. Then the
ations that allow the transformation from global to local frame with the relations that gives
they are used

44

0 = tan
-1
y
x
,


Figure 4.15 A(HM)
2
R takes an orientation toward destination
The arc length that the wheels need to travel to attain the new orientation is given by
S = I × 0
Where:
I: half distance between the two wheels
0: angle in radians
The distance between current coordinates (u,u) and destination coordinates (x, y) is given by:
R = _x
ì
2
+ y
ì
2



Figure 4.16 A(HM)
2
R moves forward to destination
45

The rotation that the robot should take to be oriented toward the deposit site coordinates is found
as follow:
x
R
= (x
d
- x
ì
) cos 0
ì
+ (y
d
- y
ì
) sin0
ì

y
R
= (x
d
- x
ì
) sinû
I
+(y
d
- y
ì
) cos 0
ì

0 = tan
-1
y
R
x
R
,
Distance from pile to deposit site is:
R = ¸(x
d
- x
ì
)
2
+(x
d
- x
ì
)
2

The above equations are the equations that the program uses to calculate necessary orientation
angles and distances. The movement from deposit site to operator site (global frame origin) is
done in a similar way and the figures below illustrate this.


Figure 4.17 A(HM)
2
R rotates toward deposit site
46


Figure 4.18 A(HM)
2
R moves forward to deposit site

Figure 4.19 rotates toward the origin

Figure 4.20 A(HM)
2
R moves to origin
47


Figure 4.21 A(HM)
2
R takes an orientation in the positive x-direction

A C program code is written to microcontroller flash memory to define its operation. CodeVision
AVR C Compiler was used to write, debug and compile the code and transfer it to the
microcontroller. The entire code is given in appendix B and it mainly consists of functions that
are called repeatedly, these functions are explained next.
Function key_scan takes no parameters and its purpose is to:
1 Set all row pins except one to low level. This is done 16 times to scan all keys
2 Read all column pins.
3 If the read value equals the one in the lookup_table then this key is pressed
int key_scan(void)
{
int lookup_table[] = {0xD7, 0xEE, 0xDE, 0xBE, 0xED, 0xDD, 0xBD, 0xEB, 0xDB, 0xBB, 0x7E, 0x7D, 0x7B,
0x77, 0xE7, 0xB7};
int i=0;
int key=16;
int readback;
int found=0;
while((i < 16) && (found == 0))
{
PORTB = lookup_table[i];
delay_us(500); // adjust this delay to debounce
48

readback = PINB;
if(readback == lookup_table[i])
{
key = i;
found = 1;
}
else
i=i+1;
}
return key;
}

Function get_key calls function key_scan and enters an infinite loop until a key is pressed
(key_scan returns a value).
int get_key(void)
{
int key;
do
{
key = key_scan( );
} while(key == 16);
return key;
}
Function wait_for_keyup makes sure that the pressed key is not mistakenly read more the once.
It does so by waiting for the user to release the key before any other actions can take place.
void wait_for_keyup(void)
{ while(key_scan( ) != 16)
{
}
}
Function rotate_steer_cw takes two parameters; the number of steps necessary to steer the robot
a calculated angle in a clockwise direction and the delay period between each step and the other
in milliseconds.
Void rotate_steer_cw(int no_of_steps, int delay_period)
{
while (no_of_steps>0)
{
PORTC=0x3c;
delay_ms(delay_period);
no_of_steps--;
if (no_of_steps>0)
{
PORTC=0x66;
delay_ms(delay_period);
no_of_steps--;
}
49

if (no_of_steps>0)
{
PORTC=0xc3;
delay_ms(delay_period);
no_of_steps--;
}
if (no_of_steps>0)
{
PORTC=0x99;
delay_ms(delay_period);
no_of_steps--;
}
}
}
Function rotate_manip_cw also takes two parameters; one identifies the number of steps for the
manipulator base stepper motor to travel and the delay period between steps.
void rotate_manip_cw(int no_of_steps,int delay_period)
{
while(no_of_steps>0)
{
PORTA=0x03;
delay_ms(delay_period);
no_of_steps--;
if (no_of_steps>0)
{
PORTA=0x06;
delay_ms(delay_period);
no_of_steps--;
}
if (no_of_steps>0)
{
PORTA=0x0c;
delay_ms(delay_period);
no_of_steps--;
}
if (no_of_steps>0)
{
PORTA=0x09;
delay_ms(delay_period);
no_of_steps--;
}
}
}
Function servo_OCR1 converts the desired angle for the servo motor into the value to be written
in the OCR1 register which is the control register responsible for the PWM signal duty cycle.
int servo_OCR1(int phi)
{
int servo;
servo=(2.222*phi)+100;
return servo;
}
50


The functions described above are just some of the functions in the code but all other functions
have similar action with slight differences. All function names are meaningful and designate
their tasks.
Function main is executed repeatedly and calls the supporting functions to carry out the complete
mission and its scenario is as follow:
1 Initialize the manipulator servo motors so that the manipulator bucket is high enough
from the ground to allow the unit to move.
2 Get user inputs in the subsequent manner:
• Get the hazardous material pile center x-coordinate in five digits (one for sign and
four for magnitude).
• Calculate the hazardous material pile center x-coordinate and adjust its sign.
• Get the hazardous material pile center y-coordinate in four digits (one for sign and
four for magnitude).
• Calculate the hazardous material pile center y-coordinate and adjust its sign.
• Get the deposit site center x-coordinate in five digits (one for sign and four for
magnitude).
• Calculate the deposit site center x-coordinate and adjust its sign.
• Get the deposit site center y-coordinate in five digits (one for sign and four for
magnitude).
• Calculate the deposit site center y-coordinate and adjust its sign.
• Get the delay periods between steps for drive wheels stepper motors in four digits.
• Calculate the delay periods between steps for drive wheels stepper motors.
3 Transform the pile center coordinates which are given with reference to the global frame
to the local frame with reference to the current robot position and orientation.
51

4 Identify the local frame quarter and steer A(EH)
2
R the proper number of degrees toward
the new position.
5 From the destination and current coordinates calculate the distance for A(EH)
2
R to
move and energize the wheels motors the required number of steps.
6 Set the new position coordinates as the current coordinates.
7 Start the manipulator action by swiveling the two servo motor for the appropriate angles
so that the bucket is in touch with the ground.
8 Move A(EH)
2
R forward toward the pile.
9 Turn the two servo motors again to lift the bucket and pick a sample from the pile.
10 Activate the manipulator base stepper motor to align the bucket right up the container.
11 Turn the manipulator servo motors in a predefined routine to load the sample into the
container.
12 The manipulator base stepper motor is energized again to return the manipulator to its
regular situation.
13 Calculate the local frame coordinates for the deposit site with reference to the current
position.
14 Steer A(EH)
2
R toward the deposit site and move forward to it.









52

5 Chapter Five
Results Discussion
A(EH)
2
R was tested for different user inputs to cover the entire work space that the system is
supposed to work on. As mentioned earlier the operator enters a four digits spatial coordinates in
millimeters, thus the larger work space that A(EH)
2
R can work within is a 1u × 1u meters
square shaped region where A(EH)
2
R is located at the square center.
Two parameters determines A(EH)
2
R performance; its ability to reach destinations with
acceptable accuracies and its manipulator capability to pick samples.
5.1 Locomotion and Navigation Performance
The ability to reach specific coordinates depends on two operations, the steering operation and
the driving operation.
Steering was tested for large number of rotation degrees and the results were satisfying. In the
worst case A(EH)
2
R failed to take the right orientation by S.7S
o
.
Forward driving process was also tested for different distances. When A(EH)
2
R was ordered to
move distances less than four meters, the errors were negligible (about 8-10 mm). But when
larger distances are entered noticeable inaccuracies occurs. These errors were due to wheels
skidding and slippage and they depend on the floor material. Reducing the unit speed decreased
those errors significantly, but this directly affects the system efficiency.
As chapter two suggests, using optical encoders to sense the stepper motors rotations will
eliminate these errors as long as the robot is on flat surfaces.
5.2 Manipulation Performance
Manipulator function was tested also and excellent outcomes were observed.
Manipulator base stepper motor misses at most one step while turning, this is because the stepper
motor usually needs to correct its shaft position by taking one step in the reverse direction since
the microcontroller always assumes that the shaft is at the first position even if it doesn’t
53

complete a full four steps the last time it was turned. This error in manipulator stepper motor is
acceptable as this motor function doesn’t require great accuracy.
Servo motors performance was very good when tested. They always achieve the desired angular
rotation with a satisfactory speed. Speed was even reduced by moving the motor shaft from one
position to another in discrete increments, thus the sample in the bucket was guaranteed to be
inside it during the manipulator operation and it was loaded gently in the container.
This servo motors performance was expected since they have built-in feedback sensors to sense
their shafts position. The use of these sensors along with PID controllers eliminates errors. This
was anticipated because servo motors are much more expensive than stepper motors.














54

6 Chapter Six
Conclusions and Future Work

6.1 Conclusions
Autonomous mobile robots may be used for a wide variety of purposes, keeping individuals
away from dealing with dangerous materials and objects is one of the essential applications that
engineers and academicians should make their best efforts to improve. A(EH)
2
R is just a
beginning to such efforts and a lot of work is still to be done.
Robustness is one of the major issues concerning robots design. And full autonomy is the aim of
every robotic project.
A(EH)
2
R depends on a user to provide it with key information for its operation, this is
considered as lack of autonomy and with more sophisticated tools and devices both robustness
and autonomy are enhanced.
6.2 Future Work
A number of tasks should be done in future to improve A(EH)
2
R performance. As mentioned
above developing methods to enhance robots robustness and autonomy is a continuous process
and every day new techniques are added to already known methods.
Ideas and recommendations for future work on A(EH)
2
R:
• Advanced localization techniques such as GPS and radio-waves may be added to the
system to increase its autonomy and reduce errors.
• Transducers and sensors might be inserted to improve robustness and accuracy for both
manipulation and driving operations.

55

• Rechargeable batteries should be attached to power the different devices and they are
supposed to have long life under heavy duties and light weights.
• Obstacle avoidance will expand the nature of areas at which A(EH)
2
R can work, this
feature actually is of great importance since hazardous materials may also be in
factories, laboratories, and warehouses instead of free open areas.
• A PC may be connected to A(EH)
2
R either through a wired or a wireless channel. This
opens a wide range of features such as continues monitoring, remote controlling and
easy interfacing with operators.
• More than one unit of A(EH)
2
R might be constructed to improve efficiency; one unit
may hold the manipulator and the other holds the container. The two units must
communicate and cooperate to achieve the mission.
• A(EH)
2
R is designed to handle materials in powder form. But by changing the
manipulator end-effector different types of hazardous materials may be collected. A
gripper for example is ideal to lift suspicious bags and solid objects.












56


7 References
1. Encyclopedia Britannica .
2. Wikipedia, The Free Encyclopedia.
3. Gibilisco, Stan. Concise Encyclopedia of Robotics.
4. Martin, Fred. The 6.270 Robot Builder’s Guide. s.l. : MIT press, 1992.
5. L. Feng, J. Borenstein, and H. R. Everett. Sensors and Methods forAutonomous Mobile
Robot Positioning. 1994.
6. Nourbakhsh, Roland Siegwart and Illah R. Introduction to Autonomous Mobile Robots.
7. Bruyninckx, Herman. Mobile Robots. 2005.











57

Appendix A: Schematic Circuit Diagram



58





59






















60

Appendix B: Software Code

























61

*****************************************************
This program was produced by the
CodeWizardAVR V1.25.7a Standard
Automatic Program Generator
© Copyright 1998-2007 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project : Autonomous Hazardous Materials Handelling Mobile Robot A(HM)2R
Version : 1.1
Date : 30/6/2009
Author : Momin A.Diyab & Osama Abdul-Rahim El-Obied
Company : U of K
Comments: Final Year Project Software
Chip type : ATmega32
Program type : Application
Clock frequency : 4.000000 MHz
Memory model : Small
External SRAM size : 0
Data Stack size : 512
*****************************************************/
#include <mega32.h>
#include <delay.h>
#include <math.h>
// Timer 1 overflow interrupt service routine
interrupt [TIM1_OVF] void timer1_ovf_isr(void)
{
}
//Global variables declaration
62

int key_scan(void); // keypad functions
int get_key(void); //
void wait_for_keyup(void); //

void rotate_steer_ccw(int,int); // steering functions
void rotate_steer_cw(int,int); //

void rotate_forward(int,int); // driving functions
void rotate_backward(int,int); //

int servo_OCR1(int); // manipulation actuators

void rotate_manip_ccw(int,int); //
void rotate_manip_cw(int,int); //

void main(void)
{
//Local variables declaration
double pi=3.141592654;
double xi=0; // local frame origin x coordinate
double xr; // destination x coordinate in mm (local frame)
int xsign=10; // 10 or 0x0a for + and 11 or 0x0b for -
long int x0,x1,x2,x3; //x coordinate digits
double x; //final destination x coordinate in mm (global frame)
double xd; // deposit area x coordinate in mm (global frame)
double yi=0; // local frame origin y coordinate
double yr; // destination y coordinate in mm (local frame)
63

int ysign=10; // 10 or 0x0a for + and 11 or 0x0b for -
long int y0,y1,y2,y3; //y coordinate digits
double y; //final destination y coordinate in mm
double yd; // deposit area y coordinate in mm (global frame)
double Ti=0; // local frame orientation
double T; // rotation angle in radian
double q=0;
double thetai=0; // local frame orientation with respect to +x direction
double theta; // rotation angle in radian with respect to +x direction
double s=0; // length of the arc cut by differential wheel in mm
double dist; //distance to travel in mm

//wheels and motors parameters
double step_arc=4.45; // arc length of one step in mm
double L=100; // half distance between diff. wheels in mm

int step_count_rot=0; // no. of steps to rotate T radians
int step_dist=0; // no. of steps to move dist mm

int delay_period2=5; // delay is initialized to be 500 ms
int delay_period1=0; //
int delay_period0=0; //

int delay_period; //delay between steps
int delay_period_manip=700; //delay bet steps for manipulator 1st actuator
int delay_period_steer=700; //delay bet steps for steering actions

64

int servoa0; //manipulator digits (if read by operator)
int servoa1; //
int servoa2; //

int servob0; //
int servob1; //
int servob2; //

int servoa; //manipulator actuator a angle
int servob; //manipulator actuator b angle

int manip_stepper; // manipulator actuator c steps no.

int temp0=0; //general purpose variables
double temp1=0; //
double temp2=0; //

// Input/Output Ports initialization
// Port A initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out
Func0=Out
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTA=0x00;
DDRA=0xFF;

// Port B initialization
// Func7=In Func6=In Func5=In Func4=In Func3=Out Func2=Out Func1=Out Func0=Out
// State7=T State6=T State5=T State4=T State3=0 State2=0 State1=0 State0=0
65

PORTB=0x00;
DDRB=0x0F;

// Port C initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out
Func0=Out
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTC=0x00;
DDRC=0xFF;

// Port D initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out
Func0=Out
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTD=0x00;
DDRD=0xFF;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
66

// Clock value: 500.000 kHz
// Mode: Ph. & fr. cor. PWM top=ICR1
// OC1A output: Non-Inv.
// OC1B output: Non-Inv.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: On
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0xA0;
TCCR1B=0x12;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x13;
ICR1L=0x88;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
67

TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x04;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// Global enable interrupts
#asm("sei")

while (1)
{
// PORTA=0x09;
// manipulator servo motors intialization
servoa=90;
68

servob=135;
OCR1A=servo_OCR1(servoa);
OCR1B=servo_OCR1(servob);
delay_ms(2000);

// get target coordinates
// get target x coordinate sign
// guarantee that the sign digit is either 10 or 11
do
{
xsign=get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
}
while ((xsign!=10)&&(xsign!=11)) ;

// get target x coordinate digits x3x2x1x0
x3= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
x2= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
x1= get_key();
69

wait_for_keyup();
delay_ms(50);
wait_for_keyup();
x0= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();

//calculate target x coordinate
//x-coordinate in the range [0000,9999] in mm
x=(1000*(double)x3)+(100*(double)x2)+(10*(double)x1)+(1*(double)x0);

if (xsign==11)
x=0-x;

// get target y coordinate sign
// guarantee that the sign digit is either 10 or 11
do
{
ysign=get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
}
while ((ysign!=10)&&(ysign!=11)) ;

// get target y coordinate digits y3y2y1y0
70

y3= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
y2= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
y1= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
y0= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();

//calculate target y coordinate
//y-coordinate in the range [0000,9999] in mm
y=(1000*(double)y3)+(100*(double)y2)+(10*(double)y1)+(1*(double)y0);

if (ysign==11)
y=0-y;

// get deposit coordinates
// get dposit x coordinate sign
// guarantee that the sign digit is either 10 or 11
71

do
{
xsign=get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
}
while ((xsign!=10)&&(xsign!=11)) ;

// get deposit x coordinate digits x3x2x1x0
x3= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
x2= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
x1= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
x0= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();

72

//calculate deposit x coordinate
//xd-coordinate in the range [0000,9999]in mm
xd=(1000*(double)x3)+(100*(double)x2)+(10*(double)x1)+(1*(double)x0);

if (xsign==11)
xd=0-xd;

// get deposit y coordinate sign
// guarantee that the sign digit is either 10 or 11
// if not read it again
do
{
ysign=get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
}
while ((ysign!=10)&&(ysign!=11)) ;

// get deposit y coordinate digits y3y2y1y0
y3= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
y2= get_key();
wait_for_keyup();
delay_ms(50);
73

wait_for_keyup();
y1= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
y0= get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();

//calculate deposit y coordinate
//yd-coordinate in the range [0000,9999] in mm
yd=(1000*(double)y3)+(100*(double)y2)+(10*(double)y1)+(1*(double)y0);

if (ysign==11)
yd=0-yd;

// get delay priod between steps
delay_period2=get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
delay_period1=get_key();
wait_for_keyup();
delay_ms(50);
wait_for_keyup();
delay_period0=get_key();
74

wait_for_keyup();
delay_ms(50);
wait_for_keyup();

//delay_period in the range [000,999] in ms
delay_period=(100*delay_period2)+(10*delay_period1)+(1*delay_period0);

//coordinate transformation from global to local frame
xr=(x-xi)*cos(thetai)+(y-yi)*sin(thetai);
yr=-(x-xi)*sin(thetai)+(y-yi)*cos(thetai);

if ((xr==0)&&(yr==0))
T=0;
else
{
if ((xr==0)&&(yr!=0))
T=pi/2;
else
{
temp1=(double)fabs(yr);
temp2=(double)fabs(xr);
T=atan(temp1/temp2);
}
}

q=fabs(T-Ti);

75

if ((xr==0)&&(yr==0)) // xr,yr at origin
{
s=L*T;
step_count_rot=s/step_arc;
rotate_steer_cw(step_count_rot,delay_period_steer);
theta=0+T;
}

if ((xr>0)&&(yr==0)) // xr,yr at positive x-axis
{
s=L*T;
step_count_rot=s/step_arc;
rotate_steer_cw(step_count_rot,delay_period_steer);
theta=0+T;
}

if ((xr<0)&&(yr==0)) // xr,yr at negative x-axis
{
s=pi*L;
step_count_rot=s/step_arc;
rotate_steer_cw(step_count_rot,delay_period_steer);
theta=0+T;
}

if ((xr==0)&&(yr>0)) // xr,yr at positive y-axis


76

Appendix C: Tools and Components
C.1 Software Applications
• CodeVision AVR C compiler by HP Info tech.
• ISIS Professional of Proteus Professional 7 by Labcenter Electronics.
C.2 Components and Devices
Component Manufacturer Quantity
ATmega32L Microcontroller
Unit
ATMEL 1
PM55L-048 Stepper Motor Minebea Motor Manufacturing
Corporation
2
PM35L-048 Stepper Motor Minebea Motor Manufacturing
Corporation
1
Standard Servo (#900-00005) Parallax 2
ULN2803 Darlington
Transistor Array
Motorola 3
Hex Keypad 1
Standard Wheel Parallax 2








77

8 Appendix D: Components Layout


78


Sign up to vote on this title
UsefulNot useful