Upload
milind-chitale
View
167
Download
11
Tags:
Embed Size (px)
DESCRIPTION
this is the user manual for the revobot which is used in school curriculum for robotic classes. the robot is capable of : line following, light following, and various simple and slightly complex tasks.
Citation preview
INTRODUCTION
TO ROBOTICS
WITH REVOBOT
Student Guide
Introduction to Robotics is intended to be a complete theoretical and
practical reference for robotics. The book guides robotics hobbyists
and students to understand, appreciate experiment and ultimately
build completely autonomous robots from scratch.
Introduction to Robotics with Revobot
Page 2
TABLE OF CONTENTS
TABLE OF CONTENTSTABLE OF CONTENTSTABLE OF CONTENTSTABLE OF CONTENTS......................................................................................... 2
PREFACPREFACPREFACPREFACEEEE ................................................................................................................. 6
CHAPTER 1CHAPTER 1CHAPTER 1CHAPTER 1 ............................................................................................................. 9
INTRODUCTION ..................................................................................................... 9
1.1 Voltage (V) ...................................................................................... 9
1.2 Electric Current (I) ..................................................................... 13
1.3 Electrical Resistance (R) .......................................................... 16
1.4 Ohm’s Law..................................................................................... 20
1.5 Electric Power............................................................................... 23
CHAPTER 2CHAPTER 2CHAPTER 2CHAPTER 2 ........................................................................................................... 25
ACTIVE AND PASSIVE COMPONENTS ................................................................ 25
2.1 Electronics Components........................................................... 25
2.2 Active and Passive Components ........................................... 25
2.2.1.1 Resistors.............................................................................. 26
2.2.1.2 Measurement of Resistance Values ............................ 26
2.2.1.3 Calculation of Resistances in circuits ......................... 28
2.2.1.4 Series Connection ............................................................. 29
2.2.1.5 Parallel Connection ........................................................... 29
2.2.1.6 Special Kinds of Resistors .............................................. 29
2.2.1.7 Thermister...............................Error! Bookmark not defined.
2.2.1.8 Capacitors ............................................................................ 31
2.2.1.9 Inductor ................................................................................ 35
2.2.1.10 Diodes .................................................................................... 37
2.2.1.11 Light emitting diode [LED]............................................. 38
2.2.1.12 Variable capacitance diode ............................................ 38
2.2.2 Active Components ............................................................... 38
2.2.2.1 Bipolar Junction Transistor ............................................ 39
2.2.2.2 Operational amplifiers ..................................................... 41
CHAPTER 3CHAPTER 3CHAPTER 3CHAPTER 3 ........................................................................................................... 43
ELECTRICAL CIRCUIT & THEORY ....................................................................... 43
3.1 Electrical circuit ........................................................................... 43
3.2 Ground concept in a circuit..................................................... 46
3.3 DC and AC ..................................................................................... 46 3.4 Designing DC power Supply or Battery Eliminator.......................... 49
3.4.1 The Power Transformer ....................................................... 49
3.4.2 The Rectifier ............................................................................. 50
3.4.3 Bridge Rectifiers ..................................................................... 52
3.4.4 The Conventional Full-Wave Rectifier ............................ 52
CHAPTER 4CHAPTER 4CHAPTER 4CHAPTER 4 ........................................................................................................... 62
SENSORS AND ACTUATORS ............................................................................... 62
4.1 Sensory Systems ........................................................................ 62
Introduction to Robotics with Revobot
Page 3
4.2 Rangefinders ................................................................................ 62
4.3 Light Sensors ............................................................................... 65
4.4 Color Sensor ................................................................................. 69
4.5 Accelerometers ............................................................................ 70
4.6 Gyroscope...................................................................................... 72
4.7 Rotation Sensors......................................................................... 73
4.8 Contact and Proximity Sensor ............................................... 76
4.9 Force Sensors .............................................................................. 79
4.10 Magnetic Sensors ................................................................... 80
4.11 Thermal Sensors .................................................................... 83
4.12 Vision Sensors ......................................................................... 87
4.13 Acoustic Sensors .................................................................... 90
4.14 Localization............................................................................... 91
4.15 Voltage and Current Sensor............................................... 93
4.16 Analog-To-Digital Converter .............................................. 94
4.17 Other Sensors and Time Reference ................................ 94
CHAPTER 5CHAPTER 5CHAPTER 5CHAPTER 5 ........................................................................................................... 98
ACTUATORS......................................................................................................... 98
5.1 Mechanical movements ............................................................ 98
5.2 Types of Actuators ..................................................................... 98
5.3 Electromagnetism..................................................................... 103
5.4 Solenoids ..................................................................................... 106
5.5 Electrical Motors........................................................................ 107
5.6 Brushed Direct Current (DC) Motor ................................... 107
5.7 Brushless Direct Current (DC) Motor ................................ 109
5.8 Stepper Motor ............................................................................ 111
5.9 RC Servo Motor ......................................................................... 112
5.10 Application of Electrical Rotary Motor in Robotics ... 114
5.11 Guideline to Electrical Motor selection ......................... 116
5.12 Gears ........................................................................................ 117
CHAPCHAPCHAPCHAPTER 6TER 6TER 6TER 6 ......................................................................................................... 125
FUNDAMENTALS OF ROBOTICS ........................................................................ 125
6.1 Robots ........................................................................................... 125
6.2 The very first concept – Robot and Robotics ................. 125
6.3 The three laws of robotics by Isaac Asimov: ................. 126
6.4 Early Industrial Robots ........................................................... 126
6.5 Industrial Robots:..................................................................... 128
6.6 Mobile Robots............................................................................. 129
6.7 Humanoids .................................................................................. 132
6.8 Cooperative Robotics .............................................................. 133
6.9 Robotic Design Approaches .................................................. 134
6.10 Neuromorphics ...................................................................... 136
6.11 Biomorphics............................................................................ 136
6.12 Looking forward .................................................................... 137
CHAPTER 7CHAPTER 7CHAPTER 7CHAPTER 7 ......................................................................................................... 139
Introduction to Robotics with Revobot
Page 4
MECHANICAL ASSEMBLY .................................................................................. 139
7.1 Nuts and Bolts ........................................................................... 139
7.2 Mechanical Parts of the Revobot ........................................ 139
CHAPTER 8CHAPTER 8CHAPTER 8CHAPTER 8 ......................................................................................................... 152
ELECTRICAL ASSEMBLY.................................................................................... 152
8.1 Hooking it UP.............................................................................. 152
8.2 How to turn on your Revobot .............................................. 152
8.3 Tuning the sensor modules .................................................. 162
8.4 Mode Selection .......................................................................... 163
8.5 Enable/Disable the motors.................................................... 165
8.6 Reset the Revoboard ............................................................... 165
8.7 Turn off the Revoboard .......................................................... 165
CHAPTER 9CHAPTER 9CHAPTER 9CHAPTER 9 ......................................................................................................... 166
GETTING STARTED WITH REVOBOT ................................................................ 166
9.1 Getting Start............................................................................... 166
9.2 Obstacle Detection and Avoidance .................................... 167
9.3 Line Follower .............................................................................. 170
9.4 Wall Follower .............................................................................. 173
9.5 Pit avoidance .............................................................................. 174
9.6 Light Follower............................................................................. 177
9.6.1 LDR Circuit Assembly on the breadboard ................... 180
9.7 Revobot Projects ....................................................................... 187
9.7.1 Sumobot .................................................................................. 187
9.7.2 Robo-Race............................................................................... 188
9.7.3 Mine hunter ............................................................................ 188
9.7.4 Fire Extinguisher .................................................................. 188
CHAPTER 10CHAPTER 10CHAPTER 10CHAPTER 10 ...................................................................................................... 189
EXPLORING THE REVOBOARD AND THE SENSOR MODULE............................ 189
10.1 Revoboard............................................................................... 189
10.2 Microcontroller ...................................................................... 189
10.3 Motor and Motor Driver ..................................................... 189
10.4 Mode selection ...................................................................... 190
10.5 Buzzer ...................................................................................... 190
10.6 IR sensor module ................................................................. 191
10.6.1 Timer......................................................................................... 192
10.6.2 IR transmitter........................................................................ 192
10.6.3 IR receiver .............................................................................. 192
10.7 Power Supply......................................................................... 193
CHAPTER 11CHAPTER 11CHAPTER 11CHAPTER 11 ...................................................................................................... 195
INTRODUCTION ................................................................................................. 195
11.1 Installation Procedure: ...................................................... 195
CHAPTER 12CHAPTER 12CHAPTER 12CHAPTER 12 ...................................................................................................... 197
CREATING THE WORKSPACE ............................................................................... 197
Introduction to Robotics with Revobot
Page 5
12.1 MPLAB....................................................................................... 197
12.2 USB Bootloading: ................................................................. 207
CHAPTER 13CHAPTER 13CHAPTER 13CHAPTER 13 ...................................................................................................... 209
HOW TO LOAD A PROGRAM IN TO REVOBOT ...................................................... 209
13.1 Programming Revobot ....................................................... 209
13.2 Installing the PIC USB driver : ....................................... 210
13.3 Loading a new program via the USB Bootloader: ... 212
CHAPTER CHAPTER CHAPTER CHAPTER 14141414 ...................................................................................................... 215
HOW TO WRITE A C PROGRAMMING IN MPLAB USING C-18 ............................. 215
14.1 First Program ......................................................................... 215
CHAPTER 15CHAPTER 15CHAPTER 15CHAPTER 15 ...................................................................................................... 225
SAMPLE C PROGRAMS...................................................................................... 225
15.1 More Programs...................................................................... 225
15.2 Tips to improve performance: ........................................ 229
CHAPTER 16CHAPTER 16CHAPTER 16CHAPTER 16 ...................................................................................................... 242
SUPPORT ........................................................................................................... 242
INDEXINDEXINDEXINDEX .................................................................................................................. 243
Introduction to Robotics with Revobot
Page 6
PREFACE
The Revobot educational kit is the one of its kind from Robhatah Robotic Solutions Pvt. Ltd. intended to facilitate students, professionals and hobbyists with a concrete
platform for their foray into the exciting world of robotics and artificial intelligence.
The kit introduces basic concepts of electrical,
electronics, mechanical and computer engineering, with an elaborate learning manual, and detailed projects that
will enable users to gain valuable insights into these disciplines. Hands on experiments on the kit will nurture
the understanding of basic engineering disciplines and the robotics concepts providing the users a strong entry
into the world of robotics and automation.
Robhatah Robotic Solutions Private Limited was founded in Singapore in the year 2004 with the vision to enable
peaceful human-robot co-existence. Scientists at Robhatah see robots as being faithful assistants to humans, extremely useful to humans to do the dull,
difficult and dangerous tasks.
The Roboticists at Robhatah have dwelled into extensive research and development in wheeled robots, legged
robots, Humanoids, pipe crawling snake robots, underwater robotics, biologically inspired Robotic
systems, real-time vision based navigation, target tracking, robot path planning and a variety of other
cutting edge robotic technologies.
Robhatah's technology team comprises of celebrated pioneers in international robotics research. Dr.Prahlad
Vadakkepat, director and chief mentor of Robhatah is a renowned robotic researcher. He holds respectable positions in numerous international professional bodies
(senior member IEEE USA, and Fellow IETE, India) and several Robotic associations (For a detailed profile of Dr.
Prahlad Vadakkepat visit www.robhatah.com/prahlad ).
The educational research platforms from Robhatah have won several international accolades: the coveted FIRA
international Robot Championships four times in a row – Austria (2003), Korea (2004), Singapore (2005) and
Introduction to Robotics with Revobot
Page 7
Germany (2006). Our humanoid platforms have been widely recognized and have been casted on various
international television and print media.
Intelligence and capabilities are very subjective. Even the simplest action may become the best intelligent way of
tackling an issue at a point in time. Revobot is designed to guide you on journey into the robotics world, thus it
must have a few tricks in its pocket to perform this important task.
Intelligence and capabilities are very subjective. Even the
simplest action may become the best intelligent way of tackling an issue at a point in time
Chapter Outline Chapter Outline Chapter Outline Chapter Outline
Chapter One Introduction to Basic Engineering Concepts
Chapter Two Electrical Components, Types, Features
Chapter Three Fundamentals on Electrical circuits
Chapter Four Sensors
Chapter Five Actuators
Chapter Six Introduction to Robotics
Chapter Seven Getting started with Revobot
Chapter Eight Working of Revoboard
Chapter Nine Assembling Mechanical components
Chapter Ten Making Electrical connections
Chapter Eleven Introduction to Software
Chapter Twelve Starting a project for Revobot
Chapter Thirteen Loading a program into Microcontroller
Chapter Fourteen C Programming
Chapter Fifteen Example Programs
Introduction to Robotics with Revobot
Page 8
PART IPART IPART IPART I
BASIC BASIC BASIC BASIC
CONCEPTSCONCEPTSCONCEPTSCONCEPTS
Introduction to Robotics with Revobot
Page 9
CHAPTER 1
IntroductionIntroductionIntroductionIntroduction
1.11.11.11.1 Voltage (V)Voltage (V)Voltage (V)Voltage (V)
Voltage or Electrical Potential Difference is the difference
of electrical potential between two points of an electrical or electronic circuit. The unit of Voltage is volt and is
generally represented by V. An electrical source of energy typically consist of two
terminals- the positive terminal is known as the anode and the negative terminal as the cathode as shown in Figure 1.1 indicated by the + (anode) and – (cathode)
signs.
In all electrical circuits, an electrical source of energy (E shown in Figure.1.1) is required to drive the
circuit. To create the driving force for the circuit, there must be a potential energy difference between the anode
and cathode and, the magnitude of difference is known as the voltage (V) or electrical potential difference. The
terminal with higher potential is denoted by the anode (+) and the lower potential by the cathode (-).
FigureFigureFigureFigure.1.1 .1.1 .1.1 .1.1
Representation of an Representation of an Representation of an Representation of an
Electrical source Electrical source Electrical source Electrical source
Introduction to Robotics with Revobot
Page 10
Voltage measurement can take on both positive and
negative values. When the measurement is made with respect to the cathode, the voltage is a positive value since the anode represents a higher potential and vice-
versa.
Figure1.3 Illustrates how the voltage can be positive (V*) and negative (V’) depending on the point of
measurement indicated by the arrow.
FigureFigureFigureFigure.1.3 .1.3 .1.3 .1.3
Introduction to Robotics with Revobot
Page 11
There are many types of electrical energy sources, which can convert various forms of potential energy into
electrical energy. One of the most common and well-known electrical energy sources is the dry cells shown in
Figure1.4. Dry cells store potential energy in chemical form and converts back into electrical energy when used.
Commercially available electrical energy sources are usually sold in fixed voltage range. For an instance, dry
cells are available in fixed voltage values of 1.5V, 9V, etc.
Different voltages of electrical energy sources can be combined together in two types of configurations- Series
or Parallel as shown Figure 1.4.
Figure: 1.4 Dry CellsFigure: 1.4 Dry CellsFigure: 1.4 Dry CellsFigure: 1.4 Dry Cells
Introduction to Robotics with Revobot
Page 12
When two electrical energy sources are connected in
series, the total voltage is the equivalent of the individual voltages as shown in Figure 1.4 (a). Series connection is usually employed when the desired voltage can be made up of fixed voltage energy sources. For instance,
connecting a series of four 1.5V dry cells can produce an output voltage of 6V.
Figure1.4 (b) shows two energy sources connected in
parallel. The only type of parallel configuration allowed is that the potential difference or voltage in parallel must be the same. Energy sources with different voltages in
parallel would result in undetermined voltage output and hence only parallel configuration with the same voltage is
employed in practice.
FAQ: But why do we need to have the same energy
source since the output resultant voltage is the same?
FigurFigurFigurFigure: 1.e: 1.e: 1.e: 1.4 Series and 4 Series and 4 Series and 4 Series and
Parallel configurations of Parallel configurations of Parallel configurations of Parallel configurations of
energy sources energy sources energy sources energy sources
Introduction to Robotics with Revobot
Page 13
In actual applications, usually a single electrical energy source is present. However, what happens when different
voltages are required from a single electrical energy source? One of the easiest solutions is to use an
electrical energy source that provides a voltage above or equal to the maximum voltage required in the circuit.
Then, using potential divider, voltage regulator (Figure 1.5) or switching regulator1, the voltage can be step down to the required voltages.
In this section, the voltage
highlighted only relates to direct current (DC) voltages however, voltages can also be in another form called the alternative current (AC) voltage where the energy source produces alternating voltages at
intervals.
1.21.21.21.2 Electric CurrentElectric CurrentElectric CurrentElectric Current (I) (I) (I) (I) Electric Current (I) is the rate of flow of electric charges with respect to time. The unit of current is Ampere (A)
and is generally represented by A A A A.
As a general convention, the direction of electric current is considered opposite to the direction of flow of electrons. Often, there is a need to indicate the direction
of the current as shown in Figure1.6.
1 Voltage regulator and switching regulator are commercially available
products to step down voltages
Figure: 1.5 Figure: 1.5 Figure: 1.5 Figure: 1.5
Voltage Regulator Voltage Regulator Voltage Regulator Voltage Regulator
Introduction to Robotics with Revobot
Page 14
I* = 3A
I’ = -3A
Figure: 1.6Figure: 1.6Figure: 1.6Figure: 1.6
Conducting WireConducting WireConducting WireConducting Wire
Normally, the flow and direction of the current is indicated from the point of higher to lower potential. However,
there can be instances where the indicated current direction is reverse which implies that the magnitude of
the current is negative (I’).
Introduction to Robotics with Revobot
Page 15
As discussed earlier, the electrical energy source provides the driving force, however for current to flow,
there must exist a closed loop path in which the current can flow. Using the analogy of the water tank and pipe,
there must be at least one pipe to connect the two tanks for the water to flow thru and fro. In other words, no
electric current will flow if there is an open loop (I=0).
Short circuit or short circuit current occurs when the positive terminal of the electric energy source is
connected to the negative terminal directly without any passive or active components in between. Short circuit in
practice is not desirable unless it is intentionally required, as short circuit results in large current flow, which may in
turn burn the conductor through which it flows. Using the water tank analogy, a short circuit can be seen as an
extreme high rate of water flow, which might eventually burst the pipe.
Electric current splitting and merging relate to how current flows when wiring connection transits from single
to multiple or vice versa. Current split occurs when there is more than one closed loop path in which it could flow.
Fig1.8 shows how current can split in multiple wire connections and Figure1.9 shows the merging of currents.
Figure: 1.8Figure: 1.8Figure: 1.8Figure: 1.8 Splitting of Splitting of Splitting of Splitting of electricalelectricalelectricalelectrical CurrentCurrentCurrentCurrent
Figure: 1.9Figure: 1.9Figure: 1.9Figure: 1.9 Merging of Merging of Merging of Merging of
electrical electrical electrical electrical
currentcurrentcurrentcurrent
Introduction to Robotics with Revobot
Page 16
Figure: 1.10Figure: 1.10Figure: 1.10Figure: 1.10
Representation of ResistanceRepresentation of ResistanceRepresentation of ResistanceRepresentation of Resistance
1.31.31.31.3 Electrical ResistanceElectrical ResistanceElectrical ResistanceElectrical Resistance (R) (R) (R) (R)
Electrical resistance (R) is the opposition offered by a conductor to the flow of electrical current. It explains the
relationship between voltage and electrical current.
In all conductors, there exist characteristics that oppose
the flow of electrical current known as resistance of the conducting material. Resistances are inherited in all
materials. In an electrical circuit, resistance is required to control the magnitude of the electric current. Conductance (G) is the terminology to represent the
inverse of resistance where G = 1/R. Figure 1.10 shows the typical drawing symbol used to represent resistance.
Resistance is the direct measurement of the resistive
characteristics of the material in relation to voltage and current. Since resistance opposes the current, controllable
resistance is required to effectively vary the magnitude of the electric current flow.
Controllable resistance or fixed value resistance
components are known as resistors. Resistors help engineers to control the electrical current flow. There are
different types of resistors in the market. Two of the commonly used resistors are the standard value resistors and the variable value resistors.
Standard value resistors with various fixed values are
commercially available in the market. A typical standard value resistor comes in a package shown in Figure 1.11
where the color band indicates the resistance of the resistor.
Introduction to Robotics with Revobot
Page 17
The color bands on the resistors indicate the followings:
(1st band is the first color strip on the left as shown in Figure 1.11)
1st band is first significant figure of component value 2nd band is the second significant figure
3rd band is the decimal multiplier 4th band if present, indicates tolerance of value in percent (no color means 20%) The 4th band also represents the
amount of resistance that the actual resistance of the resistor can deviate from the resistance indicated by the
colored band. *Figure 1.11 shows a resistor with a resistance of 2000 ohms. A variable resistor, Figure 1.12, provides a range of
resistances with the use of a mechanical knob or adjustment. By adjustment of the mechanical knob, the
resultant resistance of the variable resistor varies accordingly.
The main advantage of such a resistor is that it can give
dynamic value of resistance in comparison to the
Figure: 1.1Figure: 1.1Figure: 1.1Figure: 1.11 1 1 1
ResistorResistorResistorResistor
Figure: 1.1Figure: 1.1Figure: 1.1Figure: 1.12222
Variable ResistorVariable ResistorVariable ResistorVariable Resistor
Introduction to Robotics with Revobot
Page 18
standard fixed value resistor. However, a multi-meter2 is required to effectively measure the resistance.
Resistors can be connected in series and parallel to form
various resultant resistances. When the resistors are connected in series, the resultant resistance is the total of
the individual resistances as shown in Figure1.13
For the parallel configuration, the resultant resistance of
all the individual resistance is given by the reciprocal of the summation where the summation is the sum of the
reciprocals of the individual resistances. Figure 1.14 is an illustrative example of resistances in parallel.
Figure: 1.14 Figure: 1.14 Figure: 1.14 Figure: 1.14
Resistors in Resistors in Resistors in Resistors in
parallelparallelparallelparallel
Introduction to Robotics with Revobot
Page 19
Resistor Power Ratings
The resistor power rating can be differentiated by its
size. Normally, a larger size indicates higher power ratings. Figure 1.15 shows resistors with different
power ratings.
1.3.11.3.11.3.11.3.1 EEEExercise xercise xercise xercise
Determine the total resistance of the circuit shown in
figure 1.15?
Example:
In Problem 4, Power dissipated by R1 is
0.5A * 3V = 1.5W
Thus, the 2W resistor should be used in the
circuit.
Figure: 1.Figure: 1.Figure: 1.Figure: 1.11115555
Introduction to Robotics with Revobot
Page 20
1.41.41.41.4 Ohm’s LawOhm’s LawOhm’s LawOhm’s Law
The Ohm’s Law was named after a German physicist George Ohm (1789 - 1854). It defines the relationship
between Voltages (V), Current (I) and the Resistance (R). On the Insert tab, the galleries include items that are
designed to coordinate with the overall look of your document. You can use these galleries to insert tables,
headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current
document look.
RV
I
The relationship states that voltage across a resistor is
proportional to the current flowing into the resistor and the resistance of the resistor.
Ohm's Law is given by:
V = I RV = I RV = I RV = I R
Figure: 1.17Figure: 1.17Figure: 1.17Figure: 1.17
Introduction to Robotics with Revobot
Page 21
Figure: 1.20Figure: 1.20Figure: 1.20Figure: 1.20
Where V is the potential difference between two
points that include a resistanceresistanceresistanceresistance R. I is the current flowing through the resistance.
Now we will put Ohm’s law into application and solve some simple problems
Problem 1:Problem 1:Problem 1:Problem 1:
Find the Voltage across R1 & R2 in
Figure: 1.19
R 1
1
3V
1 .5A
R 2
1
Solution:
Voltage across R1 is 1.5A * 1Ω = 1.5V
Voltage across R2 is 1.5A * 1Ω = 1.5V
Problem 2:Problem 2:Problem 2:Problem 2:
Find the Voltage across R1 & R2 in figure 1.20 Solution:
Voltage across R1 is 1A * 1Ω = 1V
Voltage across R2 is 1A * 2Ω = 2V
Problem 3Problem 3Problem 3Problem 3
Find the current flowing into R1 in Figure 1.21
Figure: 1.Figure: 1.Figure: 1.Figure: 1.11119999
Introduction to Robotics with Revobot
Page 22
Solution:
Current into R1 is 3V ÷ 6Ω = 0.5A
Problem 4:Problem 4:Problem 4:Problem 4:
Find the current flowing into R1 in
Solution:
Current into R1 is 3V ÷ 3Ω = 1A
Figure: 1.22Figure: 1.22Figure: 1.22Figure: 1.22
Figure: 1.23Figure: 1.23Figure: 1.23Figure: 1.23
Figure: 1.21Figure: 1.21Figure: 1.21Figure: 1.21
Introduction to Robotics with Revobot
Page 23
ProblemProblemProblemProblem 5 5 5 5
Find the Current IT, I1 and I2 in figure 1.24 Solution:Solution:Solution:Solution: Since the voltage across both resistors is the same
(3V), I1 & I2 can easily be calculated using Ohm’s Law.
Where
, And
1.51.51.51.5 Electric PowerElectric PowerElectric PowerElectric Power
The Electric Power (P) formula is
given as where ‘I’ is the current flowing into a resistor /
system and V is the voltage across the resistor / system.
Together with Ohm’s Law, the Power formula can be
manipulated into several other forms.
The next Chapter introduces the Printed Circuit Board (PCB) that is
Figure: 1.24Figure: 1.24Figure: 1.24Figure: 1.24
Note:Note:Note:Note: The amount of current flowing depends on
resistors that we use in electric circuits. Hence to
select the correct rating of a resistor, the concept
of power needs to be introduced. We will also be
looking at how Power is computed.
EQUATION EQUATION EQUATION EQUATION 3333
EQUATION EQUATION EQUATION EQUATION 3333
EQEQEQEQUATION UATION UATION UATION 3333
Introduction to Robotics with Revobot
Page 24
used to connect various electronics components to perform certain
functions. Besides the soldering tips are shared and discussed.
Furthermore, various types of batteries as well as batteries’
characteristic are summarized as the reference to choose the right
battery.
Introduction to Robotics with Revobot
Page 25
CHAPTER 2
Active and Passive ComponentsActive and Passive ComponentsActive and Passive ComponentsActive and Passive Components
2.12.12.12.1 Electronics ComponentsElectronics ComponentsElectronics ComponentsElectronics Components
Electronics deals with flow of electrons through nonmetal conductors or semi conductors. Electrical refers to the
flow of charge through metal conductors. Flow of charge through Germanium, which is not a metal, would come
under electronics. The study of new semiconductor devices and related technology is a branch of physics
whereas the design and construction of electronic circuits to solve practical problems comes under electronics engineering.
An electronic component is an entity in an electronic
system, who serves the purpose of changing, the nature of charges in accordance with the purpose of the
electronic system as a whole. Components are generally used to create an electronic circuit with a particular
function (for example an amplifier, radio receiver, or oscillator). Some common electronic components are
capacitors, resistors, diodes, transistors etc.
2.22.22.22.2 Active and Passive ComponentsActive and Passive ComponentsActive and Passive ComponentsActive and Passive Components
The main components used in electronics are of two general types: passive (e.g. resistors and capacitors) and
active (e.g. transistors and integrated circuits).
• PassivePassivePassivePassive components components components components are those that do not have
gain or directionality. They require power from outside to operate.
• ActiveActiveActiveActive components components components components are those that have gain or directionality. They can amplify signals on their
own.
2.2.12.2.12.2.12.2.1 Passive ComponentsPassive ComponentsPassive ComponentsPassive Components
The following section outlines the commonly used passive
components.
Introduction to Robotics with Revobot
Page 26
2.2.1.1 Resistors
Ohm’s law states that with all the physical conditions remaining unchanged the current through a conductor
between two points is directly proportional to the voltage drop across the two points. The proportionality constant is
defined as resistance. Resistors are symbolized as .
The name comes from its main property; it resists the flow of charge through itself, hence allowing the control of current. Two wires are connected to opposite ends of the
resistor. When we apply a potential difference between the wires, we set up a current from one wire to the other,
through the resistor. The size of the current is proportional to the difference in voltage between the
wires. The resistance (in units of Ohms) is defined as the ratio of the applied voltage, V (in Volts), divided by the
current, I (in Amps), produced by the applied voltage. Resistors come in a wide variety of shapes and sizes, but
the most common type is a cylinder with wires at the ends.
Most of the resistors used in electronics have 'fixed'
values, but resistors can also be made which have a controlled, variable resistance. These are sometimes
called pots, and they are used for tasks like the volume control on an audio amplifier.
2.2.1.22.2.1.22.2.1.22.2.1.2 Measurement of Resistance ValuesMeasurement of Resistance ValuesMeasurement of Resistance ValuesMeasurement of Resistance Values
Resistance values can be identified manually by using
color codes. The value of most resistors is shown by a pattern of colored rings. These are read starting from the
band closest to an end. The colors are internationally defined as listed below.
A brief illustration of how the color code is read is shown in the figure below.
The First band is red and it stands for two, violet for seven, orange for three and gold for tolerance of 5%.
Therefore, the total value of resistance is 27*103 with 5% tolerance.
Introduction to Robotics with Revobot
Page 27
This value is commonly specified as 27kΩ.
There are two classes of resistors; fixed resistors and the
variable resistors. They are also classified according to the material from which they are made. The typical
resistor is made of either carbon film or metal film. There are other types as well, but these are the most common.
The resistance value of the resistor is not the only thing
to consider when selecting a resistor for use in a circuit. The "tolerance" and the electric power ratings of the
resistor are also important. The tolerance of a resistor denotes how close it is to the
actual rated resistance value. For example, a ±5% tolerance would indicate a resistor that is within ±5% of
the specified resistance value.
The power rating indicates how much power the resistor can safely tolerate. Just as if you would not use a 6-volt
flashlight lamp to replace a burned out light in your house, you would not use a 1/8 watt resistor when you
should be using a 1/2 watt resistor.
The maximum rated power of the resistor is specified in Watts. Power is calculated using the square of the current
(I2) x the resistance value (R) of the resistor. If the maximum rating of the resistor is exceeded, it will become extremely hot and even burn.
Figure: 2.1Figure: 2.1Figure: 2.1Figure: 2.1
Introduction to Robotics with Revobot
Page 28
Resistors in electronic circuits are typically rated 1/8W,
1/4W, and 1/2W. 1/8W is usually used in signal circuit applications.
When powering a light emitting diode, a comparatively
large current flow through the resistor, so you need to consider the power rating of the resistor you choose.
1/8W
1/4W
1/2W
2.2.1.32.2.1.32.2.1.32.2.1.3 Calculation of Resistances in circuitsCalculation of Resistances in circuitsCalculation of Resistances in circuitsCalculation of Resistances in circuits
Resistances come in standard values. Therefore, to customize the value of resistance needed resistances are
connected in series or parallel in a circuit. This section describes how to calculate the value of resistances
connected in series or parallel.
Figure: 2.2Figure: 2.2Figure: 2.2Figure: 2.2
Figure: 2.3Figure: 2.3Figure: 2.3Figure: 2.3
Introduction to Robotics with Revobot
Page 29
2.2.1.4 Series Connection
In a seriesseriesseriesseries circuit, the current flowing is the same at all
points. The circuit diagram shows two resistors connected in series with a 6 V battery: The total resistance in this
circuit is the sum of both the resistances R1 and R2. R total = R1 + R2 = 2 kΩ (As shown in figure 2.3)
The current can be hence measured as
V/R = 6v/ 2kΩ= 6 (2*103) = 3 * 10-3 Or 3mA (milli Ampere)
2.2.1.5 Parallel Connection
In parallel connection, the potential drop is constant in all the branches, but the current varies in accordance to the value of resistances in each branch. The total resistance is
calculated as R total = (R1 * R2)/ (R1+R2) =1*1/ (1+1) = 0.5kΩ
The current can be hence measured as V/R = 6v/ 0.5kΩ= 6 / (0.5*103) = 12 * 10-3 Or 12mA (milli Ampere).
In general, if there are ‘n’ Resistors connected in parallel then total resistance is calculated by the formula
1/Rtotal = 1/R1 + 1/R2 + …….. + 1/Rn
2.2.1.6 Special Kinds of Resistors
Some Resistors have values which changes according to the environmental parameters. Most common amongst
Figure: 2.Figure: 2.Figure: 2.Figure: 2.4444
Introduction to Robotics with Revobot
Page 30
this category is the LDRs (Light dependent Resistors) and Temperature dependent resistors commonly called as
Thermistors (Thermally sensitive Resistors).
2.2.1.6.1 Light Dependent Resistor (LDR)
A photo resistor or Light Dependent Resistor or CdS () Cell is a resistor whose resistance decreases with
increasing incident light intensity. It can also be referred to as a photoconductor.
A photo resistor is made of a high resistance
semiconductor. If light falling on the device is of high enough frequency, photons absorbed by the
semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electron
(and its hole partner) conduct electricity, thereby lowering resistance.
A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has its own charge carriers and
is not an efficient semiconductor, e.g. silicon. In intrinsic devices, the only available electrons are in the valence
band, and hence the photon must have enough energy to excite the electron across the entire band gap. Extrinsic
devices have impurities, also called dopants, added whose ground state energy is closer to the conduction band;
since the electrons do not have, as far to jump, lower energy photons (i.e., longer wavelengths and lower
frequencies) are sufficient to trigger the device. If a sample of silicon has some of its atoms replaced by
phosphorus atoms (impurities), there will be extra electrons available for conduction. This is an example of
an extrinsic semiconductor. Photo resistors come in many different types. Inexpensive
cadmium sulfide cells can be found in many consumer items such as camera light meters, streetlights, clock
radios, security alarms, and outdoor clocks.
Introduction to Robotics with Revobot
Page 31
2.2.1.72.2.1.72.2.1.72.2.1.7 ThermistorThermistorThermistorThermistor The resistance value of the thermistor changes according
to temperature.
This part is used as a temperature sensor.
2.2.1.82.2.1.82.2.1.82.2.1.8 CapacitorsCapacitorsCapacitorsCapacitors
A capacitor is a passive electrical component that can
store energy in the electric field between a pair of conductors (called "plates"). The process of storing
energy in the capacitor is known as "charging", and involves electric charges of equal magnitude, but opposite
polarity, building up on each plate. A capacitor's ability to store charge is measured by its capacitance, in units of
farads.
Capacitors are often used in electric and electronic circuits
as energy-storage devices. Capacitors are occasionally referred to as condensers. A wide variety of capacitors
have been invented, including small electrolytic capacitors used in electronic circuits, basic parallel-plate capacitors, mechanical variable capacitors, and the early Leyden jars,
among numerous other types of capacitors.
Figure: 2.5Figure: 2.5Figure: 2.5Figure: 2.5
Figure: 2.6Figure: 2.6Figure: 2.6Figure: 2.6
Symbol for ThermistorSymbol for ThermistorSymbol for ThermistorSymbol for Thermistor
Figure: 2.7Figure: 2.7Figure: 2.7Figure: 2.7
Introduction to Robotics with Revobot
Page 32
The symbol is used to indicate a capacitor in a circuit diagram.
Generally, capacitors have two leads. Some are axial
leaded, like resistors, and others are radial leaded, with both leads at one end. Unlike resistors, some capacitors
are polarized, with positive and negative leads: the voltage across such capacitors must agree with the
polarity of the leads. Take care to orient polarized capacitors correctly in a circuit.
A capacitor acts as a charge store. It contains a pair of
metal plates separated by a thin sheet of insulating material. Left to them the plates is electrically neutral -
the number of positive protons in each exactly equals the number of negative electrons. However, if we connect
wires to the plates and apply and external voltage we can drag electrons off one plate and push them on to the other. This takes energy, i.e. we have to do work
charging the capacitor. The result is a capacitor with one plate positively charged and the other negatively charged.
The energy used to move charge is stored by this imbalance. If we connect two plates together with a
resistor, the electrons 'rush back home' releasing their energy again. The voltage between the plates of a
charged capacitor is proportional to the amount of charge moved. The charge/voltage ratio for any specific capacitor
is called its capacitance.
Figure: 2.8Figure: 2.8Figure: 2.8Figure: 2.8
Introduction to Robotics with Revobot
Page 33
BBBBreakdown voltagereakdown voltagereakdown voltagereakdown voltage
When using a capacitor, you must pay attention to the maximum voltage, which can be used. This is the
"breakdown voltage." The breakdown voltage depends on the kind of capacitor being used. You must be especially
careful with electrolytic capacitors because the breakdown voltage is comparatively low. The breakdown voltage of
electrolytic capacitors is displayed as Working Voltage. The breakdown voltage is the voltage that when exceeded
will cause the dielectric (insulator) inside the capacitor to break down and conduct. When this happens, the failure
can be catastrophic.
Different types of capacitors.Different types of capacitors.Different types of capacitors.Different types of capacitors. Electrolytic CapacitorsElectrolytic CapacitorsElectrolytic CapacitorsElectrolytic Capacitors (Electrochemical type capacitors) (Electrochemical type capacitors) (Electrochemical type capacitors) (Electrochemical type capacitors) Aluminum is used for the electrodes by using a thin
oxidization membrane. Large values of capacitance can be obtained in comparison with the size of the capacitor,
because the dielectric used is very thin. The most important characteristic of electrolytic capacitors is that
they have polarity. They have a positive and a negative electrode. [Polarized] This means that it is very important
which way round they are connected. If the capacitor is subjected to voltage exceeding its working voltage, or if it
is connected with incorrect polarity, it may burst. It is extremely dangerous, because it can quite literally
explode. Make absolutely no mistakes.
Generally, in the circuit diagram, the positive side is indicated by a "+" (plus) symbol.
Electrolytic capacitors range in value from about 1µF to thousands of µF. mainly this type of capacitor is used as a
ripple filter in a power supply circuit, or as a filter to bypass low frequency signals, etc. Because this type of
capacitor is comparatively similar to the nature of a coil in
Figure: 2.9Figure: 2.9Figure: 2.9Figure: 2.9
Introduction to Robotics with Revobot
Page 34
construction, it is not possible to use for high-frequency circuits. (It is said that the frequency characteristic is
bad.)
Tantalum CapacitorsTantalum CapacitorsTantalum CapacitorsTantalum Capacitors
Tantalum Capacitors are electrolytic capacitor that use a material called tantalum for the electrodes. Large values
of capacitance similar to aluminum electrolytic capacitors can be obtained. In addition, tantalum capacitors are
superior to aluminum electrolytic capacitors in temperature and frequency characteristics. When
tantalum powder is baked in order to solidify it, a crack forms inside. An electric charge can be stored on this
crack.
These capacitors have polarity as well. Usually, the "+" symbol is used to show the positive component lead. Do not make a mistake with the polarity on these types.
Tantalum capacitors are a little bit more expensive than
aluminum electrolytic capacitors. Capacitance can change with temperature as well as frequency, and these types
are very stable. Therefore, tantalum capacitors are used for circuits, which demand high stability in the
capacitance values. In addition, it is said to be common sense to use tantalum capacitors for analog signal
systems, because the current-spike noise that occurs with aluminum electrolytic capacitors does not appear.
Aluminum electrolytic capacitors are fine if you do not use them for circuits, which need the high stability
characteristics of tantalum capacitors.
2.2.1.8.12.2.1.8.12.2.1.8.12.2.1.8.1 Capacitors in Series
Figure: 2.10Figure: 2.10Figure: 2.10Figure: 2.10
Introduction to Robotics with Revobot
Page 35
1/C total = 1/C1 + 1/C21/C total = 1/C1 + 1/C21/C total = 1/C1 + 1/C21/C total = 1/C1 + 1/C2
Capacitors in parallelCapacitors in parallelCapacitors in parallelCapacitors in parallel
Ctotal=C1 + C2Ctotal=C1 + C2Ctotal=C1 + C2Ctotal=C1 + C2
2.2.1.92.2.1.92.2.1.92.2.1.9 InductorInductorInductorInductor
An inductorinductorinductorinductor is a passive electrical component designed to provide inductance in a circuit.
Inductors store energy in a magnetic field created when
an electric current flows through them. Some sort of coiled conductive winding usually implements them. The
winding may surround a magnetic core, in which case it is called a ferromagnetic-core or iron-core inductor. Large inductors used at low frequencies may have thousands of
turns of wire around an iron core; however even a straight piece of wire (i.e., with turns and core reduced to
zero) has significant inductance.
An "ideal inductor" has inductance, but no resistance or
capacitance, and does not dissipate energy. A real inductor is equivalent to a combination of inductance,
some resistance due to the resistivity of the wire, and
Figure: 2.11Figure: 2.11Figure: 2.11Figure: 2.11
Figure: 2.12Figure: 2.12Figure: 2.12Figure: 2.12
Figure: 2.13Figure: 2.13Figure: 2.13Figure: 2.13
Introduction to Robotics with Revobot
Page 36
some capacitance. At some frequency, usually much higher than the working frequency, a real inductor
behaves as a resonant circuit (due to its self-capacitance). In addition to dissipating energy in the
resistance of the wire, magnetic core inductors may dissipate energy in the core due to hysteresis, and at high
currents may show other departures from ideal behavior due to nonlinearity.
Inductors are used extensively in analog circuits and signal processing. Inductors in conjunction with capacitors
and other components form tuned circuits, which can emphasize or filter out specific signal frequencies. This
can range from the use of large inductors as chokes in power supplies, which in conjunction with filter capacitors
remove residual hum or other fluctuations from the direct current output, to such small inductances as generated by
a ferrite bead or torus around a cable to prevent radio frequency interference from being transmitted down the
wire. Smaller inductor/capacitor combinations provide tuned circuits used in radio reception and broadcasting,
for instance.
Two (or more) inductors, which have coupled magnetic flux, form a transformer, which is a fundamental component of every electric utility power grid. An inductor
is used as the energy storage device in some switched-mode power supplies. Inductors are also employed in
electrical transmission systems, where they are used to depress voltages from lightning strikes and to limit
switching currents and fault current. In this field, they are more commonly referred to as reactors.
As inductors tend to be larger and heavier than other
components, their use has been reduced in modern equipment; solid-state switching power supplies eliminate
large transformers, for instance, and circuits are designed
Figure: 2.14Figure: 2.14Figure: 2.14Figure: 2.14
Introduction to Robotics with Revobot
Page 37
to use only small inductors, if any; larger values are simulated by use of gyrator circuits.
2.2.1.102.2.1.102.2.1.102.2.1.10 DiodesDiodesDiodesDiodes
A diode is a semiconductor device, which allows current to
flow through it in only one direction. Although a transistor is also a semiconductor device, it does not operate the
way a diode does. A diode is specifically made to allow current to flow through it in only one direction.
A diode can be used as a rectifier that converts AC
(Alternating Current) to DC (Direct Current) for a power supply device.
Diodes can be used as an on/off switch that controls
current. This symbol is used to indicate a diode in a circuit diagram. The meaning of the symbol is (Anode) (Cathode). Current flows from the anode
side to the cathode side. Although all diodes operate with the same general principle, there are different types
suited to different applications. For example, the following devices are best used for the applications noted.
Voltage regulation diodeVoltage regulation diodeVoltage regulation diodeVoltage regulation diode (Zener Diode (Zener Diode (Zener Diode (Zener Diode))))
The circuit symbol is .
It is used to regulate voltage, by taking advantage of the
fact that Zener diodes tend to stabilize at a certain voltage when that voltage is applied in the opposite
direction.
Diodes that can be made to conduct backwards. This effect, called Zener breakdown, occurs at a precisely
defined voltage, allowing the diode to be used as a precision voltage reference. In practical voltage reference,
circuits Zener and switching diodes are connected in series and opposite directions to balance the temperature coefficient to near zero.
Introduction to Robotics with Revobot
Page 38
2.2.1.112.2.1.112.2.1.112.2.1.11 Light emitting diodeLight emitting diodeLight emitting diodeLight emitting diode [LED][LED][LED][LED]
The circuit symbol is .
This type of diode emits light when current flows through
it in the forward direction. (Forward biased.) In a diode formed from a direct band-gap semiconductor,
such as gallium arsenide, carriers that cross the junction emit photons when they recombine with the majority
carrier on the other side. Depending on the material, wavelengths (or colors) from the infrared to the near
ultraviolet may be produced. The forward potential of these diodes depends on the wavelength of the emitted
photons.
2.2.1.122.2.1.122.2.1.122.2.1.12 Variable capacitance diodeVariable capacitance diodeVariable capacitance diodeVariable capacitance diode
The circuit symbol is . The current does not flow when applying the voltage of
the opposite direction to the diode. In this condition, the diode has a capacitance like the capacitor. It is a very
small capacitance. The capacitance of the diode changes when changing voltage. With the change of this
capacitance, the frequency of the oscillator can be changed.
2.2.2 Active Components
A transistortransistortransistortransistor is a semiconductor device commonly used to
amplify or switch electronic signals. A transistor is made of a solid piece of a semiconductor material, with at least
three terminals for connection to an external circuit. A voltage or current applied to one pair of the transistor's terminals changes the current flowing through another
pair of terminals. Because the controlled (output) power can be much larger than the controlling (input) power,
the transistor provides amplification of a signal. The transistor is the fundamental building block of modern
electronic devices, and is used in radio, telephone, computer and other electronic systems. Some transistors
Introduction to Robotics with Revobot
Page 39
are packaged individually but most are found in integrated circuits.
2.2.2.12.2.2.12.2.2.12.2.2.1 Bipolar Junction TransistorBipolar Junction TransistorBipolar Junction TransistorBipolar Junction Transistor
A Bipolar Junction Transistor essentially consists of a pair of PN Junction Diodes that are joined back-to-back. This
forms a sort of a sandwich where one kind of semiconductor is placed in between two others. There are
therefore two kinds of bipolar sandwich, the NPN and PNP varieties. The three layers of the sandwich are
conventionally called the Collector, Base, and Emitter. The reasons for these names will become clear later once we
see how the transistor works.
A transistor may be used to switch or to amplify. The image to the right represents a typical transistor in a
circuit. Its three components are the base, emitter and collector, which correspond to regions of the mixed
semiconductors from which the transistor is made. Current may flow from the emitter to the collector
depending on the voltage applied to the base, but only if this voltage exceed a certain value:
Figure: 2.1Figure: 2.1Figure: 2.1Figure: 2.15555
Figure: 2.1Figure: 2.1Figure: 2.1Figure: 2.16666
Introduction to Robotics with Revobot
Page 40
Transistor as a switchTransistor as a switchTransistor as a switchTransistor as a switch
Once the base voltage reaches a certain level, no more current will flow and the output will be held at a fixed
voltage. The transistor is then said to be saturated. Hence, values of input voltage can be chosen such that
the output is either completely off, or completely on. The transistor is acting as a switch, and this type of operation
is common in digital circuits where only "on" and "off" values are relevant.
Transistor as an amplifierTransistor as an amplifierTransistor as an amplifierTransistor as an amplifier
A varying base voltage, Vin, as long as it exceeds Vbe, controls current through the transistor and thus
influences the output voltage Vout. The slope of the graph is such that small swings in Vin will produce large changes
in Vout.
Types of transistorTypes of transistorTypes of transistorTypes of transistor This occurs because the base voltage controls how much
of the power supply voltage Vcc causes current through the transistor itself, and how much of it causes current
through a load driven by Vout. It is important that the operating parameters of the transistor are chosen and the circuit designed such that as far as possible the transistor
operates within a linear portion of the graph, such as that shown between A and B, otherwise the output signal will
suffer distortion.
Figure: 2.17Figure: 2.17Figure: 2.17Figure: 2.17
Introduction to Robotics with Revobot
Page 41
Semiconductor material: germanium, silicon, gallium arsenide, silicon carbide, etc.
Structure BJT, JFET, IGFET (MOSFET), IGBT, "other types"
Polarity NPN, PNP (BJTs); N-channel, P-channel (FETs)
Maximum power rating
Low, medium, high
Maximum operating frequency
Low, medium, high, radio frequency (RF), microwave (The maximum effective frequency of a transistor is denoted by the term fT, an abbreviation for "frequency of transition". The frequency of transition is the frequency at which the transistor yields unity gain).
Application witch, general purpose, audio, high voltage, super-beta, matched pair
Physical packaging
Through hole metal, through hole plastic, surface mount, ball grid array, power modules
Amplification factor hfe (transistor beta)[7]
2.2.2.22.2.2.22.2.2.22.2.2.2 Operational amplifiersOperational amplifiersOperational amplifiersOperational amplifiers
An operational amplifieroperational amplifieroperational amplifieroperational amplifier (11/19/2008) is a high-gain
electronic voltage amplifier. An Opamp has two inputs and one output. The output of the Opamp is high since
the high gain of the Opamp drives the output value into saturation. So in order to control the output voltage,
Feedbacks are provided. Feedbacks are of two type, positive feedback and negative feed back. Negative feed
back helps in stabilizing the gain. Depending on whether the feedback is there or not, the op-amp configurations
are classified into open loop and closed loop configurations.
Introduction to Robotics with Revobot
Page 42
Op-amps are among the most widely used electronic devices. The simplicity and the integrated circuitry help it
to be used in vast consumer electronic devices and other applications.
FigureFigureFigureFigure: 2.18: 2.18: 2.18: 2.18
Introduction to Robotics with Revobot
Page 43
CHAPTER 3
Electrical circuit & TheoryElectrical circuit & TheoryElectrical circuit & TheoryElectrical circuit & Theory
This chapter covers the fundamentals on basic circuit and
voltage source.
3.1 Electrical circuit
Electrical circuit is the system may consist of active, passive and reactive electrical elements (described in chapter 1) connected in any possible combination.
However, to make a circuit working without damaging its own components to perform a desired task, there are
several rules and methods to design and implement a circuit.
Most fundamentally, circuits can be classified in two class
open circuit and closed circuit.
In Figure 3.1 (a), there is an electrical potential difference across the battery but as the two terminal of the voltage
source is not closed by a conductive loop, there is no current flowing through the battery. In case of Fig 3.1 (b) two terminals of a 5V, battery is connected to a 10Ω
resistor by some connecting wires (ideally having 0Ω resistance). Therefore, across the two terminal of the
Figure: 3.1(a) Figure: 3.1(a) Figure: 3.1(a) Figure: 3.1(a)
Open circuitOpen circuitOpen circuitOpen circuit
Figure: 3.1(b) Figure: 3.1(b) Figure: 3.1(b) Figure: 3.1(b)
Closed circuitClosed circuitClosed circuitClosed circuit
Introduction to Robotics with Revobot
Page 44
voltage source (5V battery) there is a 10Ω of load resistance.
Note:Note:Note:Note: If no current is flowing through a battery then what ever the
potential difference is found across the two terminal of a battery is
equal to the electromotive force (EMF) of the battery
By applying Ohm’s Law, we can find the current flowing in the closed circuit as shown in Fig- 3.2.
As Ohm’s law states that with all the physical conditions remaining unchanged, the current through a conductor between two points is directly proportional to the voltage drop across the two points. The proportionality constant is defined as resistance (R).
Therefore, as ideal battery is connected between the two
terminals of the 10Ω so potential drop across the 10Ω resistor is also 5V. Therefore, current through the resistor
is IIII. I = (5V/10Ω) = 0.5AI = (5V/10Ω) = 0.5AI = (5V/10Ω) = 0.5AI = (5V/10Ω) = 0.5A....
However, while using a practical battery to make this circuit, we cannot get the 0.5Amp current as every
practical battery has some internal resistance initially when fully charged this internal resistance remains small
and it starts increasing as the battery goes on discharging. At the same time, the EMF goes decreasing with discharging the battery. Now let us see, what the
voltage a typical practical voltage source can offer while driving a typical load.
Let us consider we have a 5V battery having 1Ω internal
resistance driving a 10Ω load resistance.
Figure: 3.2 Flow of current Figure: 3.2 Flow of current Figure: 3.2 Flow of current Figure: 3.2 Flow of current
in a closed circuitin a closed circuitin a closed circuitin a closed circuit
Introduction to Robotics with Revobot
Page 45
In Fig-3.3, the ellipse is representing the practical battery having an ideal source and internal resistance. As the
resultant resistance the ideal 5V battery is facing is (10Ω + 1Ω) = 11Ω, the current flowing through the circuit is
the (5V/11Ω) = 0.455Amp.
To find the effective voltage the battery is offering while driving the 10Ω load resistor, we can follow several ways:
1. (The current through a load resistor) x (value of load resistor) = (10Ω) x (0.455A) = 4.55V
2. ( EMF or no-load battery voltage) – (Voltage drop
across the internal resistance) = (5V) – (0.455A x 1Ω) = (5V) – (0.45 V) = 4.55V
Note:Note:Note:Note: Fig 3.3 is showing a simplified model of a practical battery.
More practical and complicated model can be found in online and
in electrical engineering books. Actually the current through the
circuit is 0.45454545Amp which is approximated as 0.455Amp
Figure: 3.3 Practical Figure: 3.3 Practical Figure: 3.3 Practical Figure: 3.3 Practical
batteries driving a batteries driving a batteries driving a batteries driving a
load resisterload resisterload resisterload resister
Figure: 3.4 Voltage Figure: 3.4 Voltage Figure: 3.4 Voltage Figure: 3.4 Voltage
across practical battery across practical battery across practical battery across practical battery
driving a loaddriving a loaddriving a loaddriving a load
Introduction to Robotics with Revobot
Page 46
3.2 Ground concept in a circuit
The term ‘ground’ in an electrical network means a point or node* with respect to which all the electrical potential difference is measured. If it is said that voltage at point-A
is 5V, it means that point-A is in 5V potential difference with respect to ground point. Otherwise, while mentioning
voltage at any point it is conventional to mention the reference point for that.
There are various symbols to represent a ground point in a circuit, as shown in Fig-3.5.
Point in a circuit means junction of some components but
in practical sense, it may not be a geometrical point. There are some highly conductive copper wires or track is
used to make a junction of components in a circuit. As the resistance of the connecting copper wires or track having
a very low resistance with respect to all the components used in a circuit, the complete inter-connected copper
wires or track can be considered as the same point.
3.33.33.33.3 DCDCDCDC and AC and AC and AC and AC The term DC (Direct Current) and AC (Alternating Current) are the widely used terminology in circuit theory.
However, the ‘C’ in the abbreviation ‘AC’ and ‘DC’ relates to ‘Current’ but the terms AC and DC are used while
Figure: 3.5 Symbols of ground Figure: 3.5 Symbols of ground Figure: 3.5 Symbols of ground Figure: 3.5 Symbols of ground pointpointpointpoint
Figure: 3.6 Use of Figure: 3.6 Use of Figure: 3.6 Use of Figure: 3.6 Use of
ground symbol in ground symbol in ground symbol in ground symbol in
circuitcircuitcircuitcircuit
Introduction to Robotics with Revobot
Page 47
referring the voltage also. The following figure (Fig-3.7) shows the difference between a DC and AC circuit.
The graphs shown in Fig 3.8 represent the variation of current (IR1) flowing through the resistor R1 with respect to time. It can be easily observed in Fig 3.8 (a) the dependent variable IR1 in Fig 3.8 (a) is not varying with time that is why this type of current is known as Direct Current or DC. In comparison to the Fig 3.8 (a) graph, Fig
3.8(b) shows that the current IR1 (in Fig 3.8(b)) varies and changes its direction with respect to time, that’s why
this type of current is known is Alternating Current or AC.
As mentioned earlier the terminologies AC and DC are not only limited to the current but also widely used for
voltage, such as AC voltage and DC voltage. Fig 3.8 shows the variation of voltage* at Point-P with respect to time.
Figure: 3.7 Difference between DC and ACFigure: 3.7 Difference between DC and ACFigure: 3.7 Difference between DC and ACFigure: 3.7 Difference between DC and AC
Figure: 3.8Figure: 3.8Figure: 3.8Figure: 3.8(a) (a) (a) (a) Figure: 3.8Figure: 3.8Figure: 3.8Figure: 3.8(b) (b) (b) (b)
Graphical representations of DC and AC Graphical representations of DC and AC Graphical representations of DC and AC Graphical representations of DC and AC
Introduction to Robotics with Revobot
Page 48
* As no reference point is mentioned while referring the voltage at Point-P so implicitly it means that it is with
respect to ground point.
Coming at this point, a question may arise that in India the voltage of our power line is 230V AC, what it means.
Actually, 230V AC means that the Root Mean Square (RMS) value of the alternating voltage of approximately
320V peak to peak and having frequency 50Hz.
Now the question is what is RMS? Instead of going for the mathematical explanation of the term RMS, we can think
that it is the equivalent DC value of the AC, which can create same amount of heat energy if applied on a same
resistor. As for example while our line voltage 320V peak to peak / 50 Hz is referred as 230V / 50Hz, it means that
this AC voltage can create same heating effect like 230V DC voltage while applied on same resistor.
Domestic Power socketDomestic Power socketDomestic Power socketDomestic Power socket: Body: Body: Body: Body
Figure: 3.Figure: 3.Figure: 3.Figure: 3.9999
Figure: 3.9 Domestic Power SocketFigure: 3.9 Domestic Power SocketFigure: 3.9 Domestic Power SocketFigure: 3.9 Domestic Power Socket
Introduction to Robotics with Revobot
Page 49
3.43.43.43.4 DesigDesigDesigDesigning DC power Supply or Batterning DC power Supply or Batterning DC power Supply or Batterning DC power Supply or Battery y y y
EliminatorEliminatorEliminatorEliminator
The following components are essential for designing a
DC power supply.
3.4.1 The Power Transformer
In some cases, a power supply may not use a
transformer; therefore, the power supply would be connected directly to the source line voltage. This type of
connection is used primarily because it is economical. However, unless the power supply is completely insulated, it presents a dangerous shock hazard to
anyone who meets it. When a transformer is not being used, the return side of the ac line is connected to the
metal chassis. To remove this potential shock hazard and to have the option of stepping up or stepping down the
input voltage to the rectifier, a transformer must be used.
View A of figure 3.10 shows the schematic diagram for a STEP-UP transformer; view B shows a STEP-DOWN
transformer; and, view C shows a STEP-UP, CENTER-TAPPED transformer. The step-up and step-down
transformers were discussed in earlier NEETS modules, so only the center-tapped transformer will be mentioned in
this chapter. The primary purpose of the center-tapped transformer is to provide two equal voltages to the conventional full-wave rectifier.
Figure: 3.10Figure: 3.10Figure: 3.10Figure: 3.10 (a) (a) (a) (a)
Common types of transformers. Common types of transformers. Common types of transformers. Common types of transformers.
STEP UPSTEP UPSTEP UPSTEP UP
Introduction to Robotics with Revobot
Page 50
3.4.23.4.23.4.23.4.2 The RectifierThe RectifierThe RectifierThe Rectifier From previous discussions, you should know that rectification is the conversion of an alternating current to
a pulsating direct current. Now let us see how the process of RECTIFICATION occurs in both a half-wave and a full-
wave rectifier. . . . The HalfThe HalfThe HalfThe Half----Wave RectifierWave RectifierWave RectifierWave Rectifier
Figure: 3.10Figure: 3.10Figure: 3.10Figure: 3.10 (b) (b) (b) (b)
Common Common Common Common types of transformers. types of transformers. types of transformers. types of transformers.
STEP DOWNSTEP DOWNSTEP DOWNSTEP DOWN
Figure: 3.10Figure: 3.10Figure: 3.10Figure: 3.10 (c) (c) (c) (c)
Common types of Common types of Common types of Common types of
transformers. CENTERtransformers. CENTERtransformers. CENTERtransformers. CENTER----
TAPPEDTAPPEDTAPPEDTAPPED
Figure: 3.11 Figure: 3.11 Figure: 3.11 Figure: 3.11
Simple halfSimple halfSimple halfSimple half----wave wave wave wave
rectifier.rectifier.rectifier.rectifier. HALFHALFHALFHALF----WAVE WAVE WAVE WAVE
RECTIFIERRECTIFIERRECTIFIERRECTIFIER
Introduction to Robotics with Revobot
Page 51
Since a silicon-diode will pass current in only one direction, it is ideally suited for converting alternating
current (ac) to direct current (dc). When ac voltage is applied to a diode, the diode conducts ONLY ON THE
POSITIVE ALTERNATION OF VOLTAGE; that is, when the anode of the diode is positive with respect to the cathode.
This simplest type of rectifier is the half-wave rectifier.
As shown in view A of figure 3.11, the half-wave rectifier uses only one diode. During the positive alternation of input voltage, the sine wave applied to the
diode makes the anode positive with respect to the cathode. The diode then conducts, and current (I) flows
from the negative supply lead (the secondary of the transformer), through the millimeter, through the diode,
and to the positive supply lead. As indicated by the shaded area of the output waveform in view B, this
current exists during the entire period of time that the anode is positive with respect to the cathode (in other
words, for the first 180 degrees of the input sine wave).
During the negative alternation of input voltage (dotted polarity signs), the anode is driven negative and the diode
cannot conduct. When conditions such as these exist, the diode is in cutoff and remains in cutoff for 180 degrees,
during which time no current flows in the circuit. The
Figure: 3.12 Figure: 3.12 Figure: 3.12 Figure: 3.12
Simple halfSimple halfSimple halfSimple half----wave wave wave wave
rectifier. OUTPUT rectifier. OUTPUT rectifier. OUTPUT rectifier. OUTPUT
WAVEFORMWAVEFORMWAVEFORMWAVEFORM
Figure: 3.13Figure: 3.13Figure: 3.13Figure: 3.13
Introduction to Robotics with Revobot
Page 52
circuit current therefore has the appearance of a series of positive pulses, as illustrated by the shaded areas on the
waveform in view B. Notice that although the current is in the form of pulses, the current always flows in the same
direction. Current that flows in pulses in the same direction is called PULSATING DC. The diode has thus
RECTIFIED the ac input voltage.
Full-Wave Rectifiers
Conduct on both halves of the input ac cycles. As a result, the dc pulses are not separated from each other. A
characteristic of full-wave rectifiers is the use of a center-tapped, high-voltage secondary. Because of the center
tap, the output of the rectifier is limited to one-half of the input voltage of the high-voltage secondary.
3.4.3 Bridge Rectifiers
Are full-wave rectifiers that do not use a center-tapped,
high-voltage secondary. Because of this, their dc output voltage is equal to the input voltage from the high-
voltage secondary of the power transformer. Bridge rectifiers use four diodes connected in a bridge network.
Diodes conduct in diagonal pairs to give a full-wave pulsating dc output.
3.4.4 The Conventional Full-Wave Rectifier A full-wave rectifier is a device that has two or more diodes arranged so that load current flows in the same
direction during each half cycle of the ac supply.
A diagram of a simple full-wave rectifier is shown in figure 3.17. The transformer supplies the source voltage for two
diode rectifiers, D1 and D2. This power transformer has a center-tapped, high-voltage secondary winding that is
Figure: 3.15Figure: 3.15Figure: 3.15Figure: 3.15
Full Full Full Full----wave rectifiers. POSITIVE wave rectifiers. POSITIVE wave rectifiers. POSITIVE wave rectifiers. POSITIVE
ALTERNATION.ALTERNATION.ALTERNATION.ALTERNATION.
Introduction to Robotics with Revobot
Page 53
divided into two equal parts (W1 and W2). W1 provides the source voltage for D1, and W2 provides the source
voltage for D2. The connections to the diodes are arranged so that the diodes conduct on alternate half
cycles.
During one alternation of the secondary voltage, the
polarities are as shown in view A. The source for D2 is the voltage induced into the lower half of the secondary
winding of the transformer (W2). At the specific instant of time shown in the figure, the anode voltage on D2 is
negative, and D2 cannot conduct. Throughout the period of time during which the anode of D2 is negative, the
anode of D1 is positive. Since the anode of D1 is positive, it conducts, causing current to flow through the load
resistor in the direction shown by the arrow.
View B shows the next half cycle of secondary voltage. Now the polarities across W1 and W2 are reversed. During this alternation, the anode of D1 is driven negative
and D1 cannot conduct. For the period of time that the anode of D1 is negative, the anode of D2 is positive,
permitting D2 to conduct. Notice that the anode current
Figure: 3.16 Figure: 3.16 Figure: 3.16 Figure: 3.16
FullFullFullFull----wave rectifiers. NEGATIVE wave rectifiers. NEGATIVE wave rectifiers. NEGATIVE wave rectifiers. NEGATIVE
ALTERNATIONALTERNATIONALTERNATIONALTERNATION
Figure: 3.17 Practical fullFigure: 3.17 Practical fullFigure: 3.17 Practical fullFigure: 3.17 Practical full----wave rectifier7wave rectifier7wave rectifier7wave rectifier7
Introduction to Robotics with Revobot
Page 54
of D2 passes through the load resistor in the same direction as the current of D1 did. In this circuit
arrangement, a pulse of load current flows during each alternation of the input cycle. Since both alternations of
the input voltage cycle are used, the circuit is called a FULL-WAVE RECTIFIER.
Now that you have a basic understanding of how a full-
wave rectifier works, let us cover in detail a practical full-wave rectifier and its waveforms.
A Practical FullA Practical FullA Practical FullA Practical Full----Wave Rectifier Wave Rectifier Wave Rectifier Wave Rectifier A practical full-wave rectifier circuit is shown in view A of
figure 4-6. It uses two diodes (D1 and D2) and a center-tapped transformer (T1). When the center tap is
grounded, the voltages at the opposite ends of the secondary windings are 180 degrees out of phase with each other. Thus, when the voltage at point A is positive
with respect to ground, the voltage at point B is negative with respect to ground. Let us examine the operation of
the circuit during one complete cycle.
During the first half cycle (indicated by the solid arrows), the anode of D1 is positive with respect to
ground and the anode of D2 is negative. As shown, current flows from ground (center tap), up through the
load resistor (RL), through diode D1 to point A. In the transformer, current flows from point A, through the
upper winding, and back to ground (center tap). When D1 conducts, it acts like a closed switch so that the positive
half cycle is felt across the load (RL).
During the second half cycle (indicated by the dotted lines), the polarity of the applied voltage has reversed. Now the anode of D2 is positive with respect to ground
and the anode of D1 is negative. Now only D2 can conduct. Current now flows, as shown, from ground
(center tap), up through the load resistor (RL), through diode D2 to point B of T1. In the transformer, current
flows from point B up through the lower windings and back to ground (center tap). Notice that the current flows
across the load resistor (RL) in the same direction for both halves of the input cycle.
Introduction to Robotics with Revobot
Page 55
View B represents the output waveform from the full-wave rectifier. The waveform consists of two pulses of
current (or voltage) for each cycle of input voltage. The ripple frequency at the output of the full-wave rectifier is
therefore twice the line frequency.
The higher frequency at the output of a full-wave rectifier offers a distinct advantage: Because of the higher ripple
frequency, the output is closely approximate to pure dc. The higher frequency also makes filtering much easier
than it is for the output of the half-wave rectifier.
In terms of peak value, the average value of current and voltage at the output of the full-wave rectifier is twice as great as that at the output of the half-wave rectifier. The
relationship between the peak value and the average value is illustrated in figure 3.18. Since the output
waveform is essentially a sine wave with both alternations at the same polarity, the average current or voltage is
63.7 percent (or 0.637) of the peak current or voltage.
3.4.63.4.63.4.63.4.6 Filter CircuitsFilter CircuitsFilter CircuitsFilter Circuits
Figure: 3.18 Peak and average values foFigure: 3.18 Peak and average values foFigure: 3.18 Peak and average values foFigure: 3.18 Peak and average values for a fullr a fullr a fullr a full----wave wave wave wave
rectifierrectifierrectifierrectifier
Figure: 3.18 Figure: 3.18 Figure: 3.18 Figure: 3.18
Peak and average values for a Peak and average values for a Peak and average values for a Peak and average values for a
fullfullfullfull----wave rectifierwave rectifierwave rectifierwave rectifier
Introduction to Robotics with Revobot
Page 56
Are designed to smooth, or filter, the ripple voltage
present on the pulsating dc output of the rectifier. This is done by, an electrical device that has the ability to
store energy and to release the stored energy.
3.4.73.4.73.4.73.4.7 Capacitance FiltersCapacitance FiltersCapacitance FiltersCapacitance Filters
Is nothing more than large capacitors placed across the output of the rectifier section. Because of the large
size of the capacitors, fast charge paths, and slow discharge paths, the capacitor will charge to average
value, which will keep the pulsating dc output from reaching zero volts.
The Basic Power Supply The Basic Power Supply The Basic Power Supply The Basic Power Supply View A of figure 3.19 shows the block diagram of a basic power supply. Most power supplies are made up of four
basic sections: a TRANSFORMER, a RECTIFIER, a FILTER, and a REGULATOR.
As illustrated in view B of figure 3.20, the first section is
the TRANSFORMER. The transformer steps up or steps down the input line voltage and isolates the power supply
from the power line. The RECTIFIER section converts the alternating current input signal to a pulsating direct
current. However, as you proceed in this chapter you will learn that pulsating dc is not desirable. For this reason, a
FILTER section is used to convert pulsating dc to a purer, more desirable form of dc voltage.
The final section, the REGULATOR, does just what the
name implies. It maintains the output of the power supply
Figure: 3.19 Figure: 3.19 Figure: 3.19 Figure: 3.19 Block diagram of a basic power supplyBlock diagram of a basic power supplyBlock diagram of a basic power supplyBlock diagram of a basic power supply
Introduction to Robotics with Revobot
Page 57
at a constant level in spite of large changes in load current or input line voltages.
Now that you know what each section does, let us trace an ac signal through the power supply. At this point, you
need to see how this signal is altered within each section of the power supply. Later on in the chapter, you will see
how these changes take place. In view, B of figure 3.20, an input signal of 115 volts ac is applied to the primary of
the transformer. The transformer is a step-up transformer with a turn-ratio of 1:3. You can calculate the output for
this transformer by multiplying the input voltage by the ratio of turns in the primary to the ratio of turns in the
secondary; therefore, 115 volts ac X 3 = 345 volts ac (peak-to-peak) at the output. Because each diode in the
rectifier section conducts for 180 degrees of the 360-degree input, the output of the rectifier will be one-half,
or approximately 173 volts of pulsating dc.
The filter section, a network of resistors, capacitors, or
inductors, controls the rise and fall time of the varying signal; consequently, the signal remains at a more
constant dc level. You will see the filter process more clearly in the discussion of the actual filter circuits. The
output of the filter is a signal of 110 volts dc, with ac ripple riding on the dc. The reason for the lower voltage
(average voltage) will be explained later in this chapter. The regulator maintains its output at a constant 110-volt
dc level, which is used by the electronic equipment (more commonly called the load).
The Practical Implementation Unregulated Power Supply The Practical Implementation Unregulated Power Supply The Practical Implementation Unregulated Power Supply The Practical Implementation Unregulated Power Supply The following circuits are showing how to design a basic power supply that will deliver 12V DC voltages to the
electronic circuit.
Figure: 3.20 Block diagram of a basic power supplyFigure: 3.20 Block diagram of a basic power supplyFigure: 3.20 Block diagram of a basic power supplyFigure: 3.20 Block diagram of a basic power supply
Introduction to Robotics with Revobot
Page 58
Limitations of an unregulated power supply is explained below
Output is varying with changing of the input voltage
of AC power supply.
Figure: 3.21Figure: 3.21Figure: 3.21Figure: 3.21
Figure: 3.22Figure: 3.22Figure: 3.22Figure: 3.22
Introduction to Robotics with Revobot
Page 59
Output voltage drops when the power supply is loaded (output is connected to ground through a
resistor). Though this circuit uses a 1000-µF capacitor for
filtering the fluctuation (ripples) in the output voltages, it is impossible to remove the ripple
completely by increasing the capacitance of the filtering capacitor.
If accidentally the output is shorted to ground (resistance between output terminal and ground
becoming very low), the component(s) in this power supply may be damaged.
The practical implementation of regulated power supply: The practical implementation of regulated power supply: The practical implementation of regulated power supply: The practical implementation of regulated power supply: To remove all the above limitation we can follow the
following scheme to design a regulated power supply.
FiguFiguFiguFigure: 3.23re: 3.23re: 3.23re: 3.23
Introduction to Robotics with Revobot
Page 60
Kirchhoff's Kirchhoff's Kirchhoff's Kirchhoff's CurrentCurrentCurrentCurrent LawLawLawLaw
This fundamental law results from the conservation of charge. It
applies to a junction or node in a circuit -- a point in the circuit where
charge has several possible paths to travel.
In Figure 3.24, we see that IA is the
only current flowing into the node. However, there are three paths for
current to leave the node, and these current are represented by IB, IC, and ID.
Once charge has entered into the
node, it has no place to go except to leave (this is known as
conservation of charge). The total charge flowing into a node must be
the same as the the total charge flowing out of the node. So,
IIIIBBBB + I + I + I + ICCCC + I + I + I + IDDDD = I = I = I = IAAAA
Bringing everything to the left side of the above equation, we get
(I(I(I(IBBBB + I + I + I + ICCCC + I + I + I + IDDDD) ) ) ) ---- I I I IAAAA = 0 = 0 = 0 = 0
Figure: 3.24 Figure: 3.24 Figure: 3.24 Figure: 3.24
Possible node (or Possible node (or Possible node (or Possible node (or
junction) in a junction) in a junction) in a junction) in a
circuitcircuitcircuitcircuit
Introduction to Robotics with Revobot
Page 61
Then, the sum of all the currents is zero. This can be generalized as follows
Note the convention we have chosen here: currentcurrentcurrentcurrent
flowing into the node are taken to be negative, and currents flowing out of the node are positive. It should not really matter which you choose to be the positive or negative currentcurrentcurrentcurrent, as long as you stay consistent.
However, it may be a good idea to find out the convention used in your class.
Kirchhoff's Voltage LawKirchhoff's Voltage LawKirchhoff's Voltage LawKirchhoff's Voltage Law
Kirchhoff's Voltage Law (or
Kirchhoff's Loop Rule) is a result of the electrostatic field
being conservative. It states that the total voltage around
a closed loop must be zero. If this were not the case, then
when we travel around a closed loop, the voltages
would be indefinite. So
In Figure 3.24, the total
voltage around loop 1 should sum to zero, as does the total
voltage in loop2. Furthermore, the loop, which
consists of the outer part of the circuit (the path ABCD),
should also sum to zero.
We can adopt the convention that potential gains (i.e. going from lower to higher potential, such as with an emf source) is taken to be positive. Potential losses (such as across a resistor) will then be negative. However, as long
as you are consistent in doing your problems, you should be able to choose whichever convention you like. It is a
good idea to adopt the convention used in your class.
Figure: 3.24 Figure: 3.24 Figure: 3.24 Figure: 3.24 Around a
closed loop, the total
voltage should be zero
Introduction to Robotics with Revobot
Page 62
CHAPTER 4
Sensors and ActuatorsSensors and ActuatorsSensors and ActuatorsSensors and Actuators
4.1 Sensory Systems
In order for robots to interact with its surroundings, it
must collect information around it. Hence, generally all robots are equipped with a sensory system for acquiring
feedback from the environment. This chapter aims to give students and hobbyists a general view on what type of
sensory systems are used in robotics.
4.2 Rangefinders
Rangefinder sensors are usually devices that emit either light or sound energy to measure the distance from the
device to the target. There many techniques to measure the distance, but the most common method measures the
time required by the emitted beam to reflect back from the obstacle to estimate distance. Typically, distances
measured by rangefinders are retrieved in the form of analog voltage, current or digital signal such as PWM
(Pulse-Width Modulation). Rangefinders have a minimum and maximum range within which the sensor can measure
accurately. Hence, when selecting the type of rangefinders for particular application, one should take
the output signal representation and range factors into considerations.
4.2.14.2.14.2.14.2.1 Ultrasonic RangefinderUltrasonic RangefinderUltrasonic RangefinderUltrasonic Rangefinder
Ultrasonic rangefinder employs the use of ultrasound or sound waves above the normal audible range. They
measure the distance by evaluating the echo of the emitted wave produced. The typical directivity of the
ultrasonic sensor is seen below.
Introduction to Robotics with Revobot
Page 63
Shown below is a typical ultrasonic module. The module
consists of a piezoelectric transducer which
Transducer Detector
Converts electrical energy into ultrasonic waves. This wave propagates through a medium like as air and water.
When these waves hits a particular target such as an obstacle or wall, these sound wave bounce back resulting
in an echo. This echo is converted back into electrical energy by the piezoelectric. The distance is calculated by
computing the time interval between the emission of the signal and the echo received.
4.2.24.2.24.2.24.2.2 InfraInfraInfraInfra----RedRedRedRed Rangefinder Rangefinder Rangefinder Rangefinder
Infra-Red (IR) rangefinder works on similar principle to that of the ultrasonic rangefinder. The range of IR
rangefinder only provides a range, which is limited to the line of sight view. IR rangefinder is generally less
expensive compared to ultrasonic rangefinder. IR rangefinder emits an infrared beam instead of ultrasound
and detects the distance through the reflected beam. The IR rangefinder consists of both a transducer and detector
to emit and detect IR beam respectively.
Fig 4Fig 4Fig 4Fig 4....1111 Coverage of Coverage of Coverage of Coverage of Ultrasonic SensorUltrasonic SensorUltrasonic SensorUltrasonic Sensor
FigFigFigFig 4.2 4.2 4.2 4.2 Ultrasonic Ultrasonic Ultrasonic Ultrasonic RangefinderRangefinderRangefinderRangefinder
Introduction to Robotics with Revobot
Page 64
Transducer Detector
Infrared sensors are generally easy to use, implement, small and cheap. The main disadvantage is that the
reflectivity of the target would affect the distance measured and hence IR rangefinders are less accurate,
precise and reliable. Now a days IR rangers also use triangulation to estimate distance. This method is more
accurate as the sensing capability does not directly depend on the reflectivity of the surface of the target. In
triangulation method, the sensor measures the radius of the projection of the emitted beam using an array of IR
sensitive elements. The farther the target the larger the projection. Based on this information, the range of the target can be estimated.
4.2.34.2.34.2.34.2.3 Laser RangefinderLaser RangefinderLaser RangefinderLaser Rangefinder
Laser rangefinder provides high accuracy and precision distance measurement however; these devices are very
much more expensive in compare to ultrasonic and infrared rangefinder.
Laser rangefinder emits a beam of laser light to measure
the distance. Using a high quality laser sensor to track the
FigFigFigFig 4444....2222 Infra Infra Infra Infra----Red Red Red Red RangefinderRangefinderRangefinderRangefinder
FigFigFigFig 4444....3333 Laser Range Laser Range Laser Range Laser Rangefinderfinderfinderfinder
Introduction to Robotics with Revobot
Page 65
emitted laser beam, the distance in which the beam of laser traveled from the device to the target is recorded
also known as triangulation.
To illustrate the measuring principle, the two diagrams below shows how triangulation is done to measure the
distance.
Laser Sensor Laser Beam
As such, in compare to the previous two rangefinders,
laser rangefinder provides high accuracy and precision distance measurement as it does not employ the reflection method; reflection method is prone to
disturbance present in the medium the emitted energy travels through and reflectivity of the target’s surface.
4.3 Light Sensors
Light sensors are the detectors or measuring devices of
light energy, which are also called as photo detectors there are various types of sensors among which most
common ones are described in the following.
4.3.14.3.14.3.14.3.1 PhotoPhotoPhotoPhoto----ResistorsResistorsResistorsResistors
Photo resistors are Light Dependant Resistor (LDR),
photocells or photoconductors, which change resistance when subjected to varying light intensity. A symbol of
photo resistor used in circuitry diagram and practical photo of photo-register are shown below.
Fig Fig Fig Fig 4444....4444 Principle of Principle of Principle of Principle of TriangulationTriangulationTriangulationTriangulation
Introduction to Robotics with Revobot
Page 66
Photo resistors resistance varies wit light intensity, so photo-resistors are used as light measuring device, due to
this photo resistors are employed as a measuring unit in solar seeker also.
Note: Photo-Registers are widely used to redirect the
solar panels, according to the detection of incident light, to obtain higher efficiency. Multiple photo resistors can be
positioned in different angle or direction to determine where the amount of sunlight is most ample, using the
simple principle of the resistance variation with respect to light intensity. Likewise, a solar powered device can automatically adjust its solar panel to face the direction
that can harness the highest amount of energy available.
4.3.24.3.24.3.24.3.2 Photo DiodesPhoto DiodesPhoto DiodesPhoto Diodes
Like photo resistors, photo diodes also react to light in general. The photo diodes have high resistance when
place in darkness and allow less current to conduct and its internal resistance decreases when subjected to light
and hence conducts more current. The amount of current conducts is relative to the intensity of the incident light.
The symbol to represent a photo diode in electronic semantics is given below.
FigFigFigFig 4444....6666 Circuitry Symbol Of Photo Circuitry Symbol Of Photo Circuitry Symbol Of Photo Circuitry Symbol Of Photo----ResistorResistorResistorResistor
Fig Fig Fig Fig 4.74.74.74.7 Photo Photo Photo Photo----ResistorResistorResistorResistor
Fig Fig Fig Fig 4.74.74.74.7 Circuitry Circuitry Circuitry Circuitry
Symbol of PhotodiodeSymbol of PhotodiodeSymbol of PhotodiodeSymbol of Photodiode
Introduction to Robotics with Revobot
Page 67
The photo diodes can be operated under two configurations such as zero bias or reverse bias mode however, the principle and basis in which the photo diode
is used in these two modes are different. In zero bias mode when photodiode subjected to light and current
flows through, the diode becomes forwardly biased, in the zero bias modes. This principal is also known as the
photovoltaic effect, as under illuminated condition photodiode can induce a small amount of current if its two
terminals are connected by some resistance to make the circuit closed. However, in other case in reverse bias
mode whenever light falls on the reversely biased photodiode it starts conducting. In this case, also the
amount of current varies with the intensity of the incident light. The advantage to use this mode is the better
sensitive and faster response time. Below is a picture of a photo diode, which resembles that of Light Emitting Diode (LED).
4.3.34.3.34.3.34.3.3 PhotoPhotoPhotoPhoto----TransistorsTransistorsTransistorsTransistors
Phototransistor works similarly to the photodiodes but it offers higher sensitivity to the incident light, when
subjected to light. However comparing with the photodiode there is a minus point to use it, as it has a
slower response time with respect to photodiode. There are different types of phototransistors available
such as two-terminal or three-terminal types. However, both of them should be biased across the emitter and
collector and the amount of current flows through the emitter and collector can be determined by the intensity
of light incident on base emitter junction, in the two-terminal type. Below is the shown picture of the two
terminal phototransistor.
FigFigFigFig 4 4 4 4 .8 .8 .8 .8
PhotodiodePhotodiodePhotodiodePhotodiode
Introduction to Robotics with Revobot
Page 68
In the tree-terminal type, the additional terminal allows us to keep an electrical bias, to compensate the ambient
light. Both PNP and NPN phototransistors are available commercially, like the convention transistors.
Phototransistors can be used as conventional distance measurement applications. Below is the shown picture of
the symbols used in circuit diagrams.
4.3.44.3.44.3.44.3.4 InfraInfraInfraInfra----Red OptoRed OptoRed OptoRed Opto----CouplersCouplersCouplersCouplers
OPTO-COUPLERS are the combination of light emitter and the photodetectors the emitter may be typically a LED
and the detector may be a photodiode or phototransistor. Through a short optical transmission path, the light
transmitter transfers the electrical signal in optical form and the receiver in the other electrically isolated end
receives the optical signal and converts it again in electrical form. Thus, this combination is known as Opto-
Couplers or Opto-Isolators.
By considering the Infra-Red (IR) Opto-Coupler, IR is the optical medium used in the transmission. The
configuration of IR Opto-Couplers can be in two ways and they are as follows. Incase of reflective opto-coupler the optical signal is transmitted to the receiver through a
Fig Fig Fig Fig 4.104.104.104.10 Circuitry Symbol of Circuitry Symbol of Circuitry Symbol of Circuitry Symbol of
Photo TransistorPhoto TransistorPhoto TransistorPhoto Transistor
Fig Fig Fig Fig 4.94.94.94.9
PhototransistorPhototransistorPhototransistorPhototransistor
Introduction to Robotics with Revobot
Page 69
reflection as shown in the fig: 5.3.7, in the reflective configuration.
In the inline configuration, the transmitter is placed directly facing the receiver so, optical signal is directed
directly towards the receiver. There are some dual opto-couplers available, where one LED illuminates to identical
photodetectors to create a good matched opto-coupler. The following figure shows the simple configuration of an inline opto-coupler.
4.4 Color Sensor
Color Sensors are used for color detection and measurement for a variety of reasons. In robotics, color
sensors are mostly used for recognizing the environment or goal by mean of color-coding the objects. There are
several types of color sensors available commercially, like Charge Coupled Device (CCD) type, LED-LDR type etc.
The following Fig: 5.3.11 shows a scheme of implementing a LED-LDR type color sensors. The LED is
shown in Fig 4.13(a) having three different colours Red, Green and Blue (RGB) as shown in Fig 4.13(b). The LED in Fig 5.3.11 turned on one by one sequentially and for
each instance, the signal obtained from the LDR is measured. In each case (according to color of the glowing
LED), the output from the LDR is indicating the depth (intensity) of that color component of the reflecting
obstacle.
Fig Fig Fig Fig 4.114.114.114.11 Reflective IR Reflective IR Reflective IR Reflective IR
OPTOOPTOOPTOOPTO----COUPLERCOUPLERCOUPLERCOUPLER
Fig Fig Fig Fig 4.124.124.124.12
Inline IR OptoInline IR OptoInline IR OptoInline IR Opto----
CoupleCoupleCoupleCouplerrrr
Introduction to Robotics with Revobot
Page 70
4.5 Accelerometers
Accelerometers are the devices, which measure the force exerted on it due to its acceleration, as we know Force =
Mass x Acceleration. These acceleration forces may be static or dynamic means acceleration due to gravity
multiplied by its mass is a static force on the measuring device. Whereas any net acceleration of the
accelerometer will get a dynamic component of Force of (Net Acceleration x Mass). The following describes the working principle of commonly used Accelerometers. Note: Accelerometers are often used in robotics for several purposes.
Accelerometers can be used to measure the amount of acceleration forces and hence determines the way the robot is moving.
Accelerometers are employed to allow a better understanding of the environment thus, allowing the robot to compute and react accordingly.
Accelerometers can be used as a tilt sensor to measure the angle in which the device is inclined with respect to earth by measuring the amount of gravitational acceleration forces.
Fig 4.Fig 4.Fig 4.Fig 4.13131313(b)(b)(b)(b)
Diy Colour Sensor Diy Colour Sensor Diy Colour Sensor Diy Colour Sensor
Fig Fig Fig Fig 4.13(a)4.13(a)4.13(a)4.13(a) Diy Colour Sensor Diy Colour Sensor Diy Colour Sensor Diy Colour Sensor
Introduction to Robotics with Revobot
Page 71
4.5.14.5.14.5.14.5.1 Micro ElectroMicro ElectroMicro ElectroMicro Electro----Mechanical System (Mems)Mechanical System (Mems)Mechanical System (Mems)Mechanical System (Mems)
MEMS Accelerometers can be used to measured both
translational and rotational accelerations. MEMS accelerometer are often based on the use of a micro
machined oscillator which when subjected to acceleration will deflect its position. The deflection can be detect using
several method such as piezoelectric, piezoresistive and capacitive.
Note: One of the most common applications of MEMS accelerometers is in airbag deployment system in automobiles to detect whether a collision has occurred. 4.5.24.5.24.5.24.5.2 ThermalThermalThermalThermal Accelerometer Accelerometer Accelerometer Accelerometer
Thermal accelerometer is also a micro machined based
accelerometer. Instead of the conventional method of detection by micro mass or capacitive changes, thermal
accelerometer detects acceleration using temperature sensing.
Thermal accelerometers consist of a small volume of gas,
which is heated in the middle with surrounding tiny temperature sensors. When no acceleration is subjected,
there is no difference between the temperature sensors and hence no reading. When acceleration is imposed, the
tiny amount of gas is displaced by virtue of convection
Fig Fig Fig Fig 4.144.144.144.14
Mems AccelerometerMems AccelerometerMems AccelerometerMems Accelerometer
Fig Fig Fig Fig 4.154.154.154.15
Thermal AccelerometerThermal AccelerometerThermal AccelerometerThermal Accelerometer
Introduction to Robotics with Revobot
Page 72
resulting in a temperature difference between the sensors portraying the amount of acceleration.
4.6 Gyroscope
Gyroscope is a device based on the principle of conservation of angular momentum, used for measuring
or maintaining orientation.
It is often used to perform balancing act and keeping accurate direction of travel. Some typical applications are flying robots, soccer robots, micro mouse, humanoid
robots, digital camera etc.
Two common types of gyroscopes are
4.6.14.6.14.6.14.6.1 Piezoelectric GyroscopePiezoelectric GyroscopePiezoelectric GyroscopePiezoelectric Gyroscope
Piezoelectric gyroscopes use piezoelectric oscillators to capture the rotational movements of objects. They are
commonly used in digital cameras and R/C helicopters.
Fig Fig Fig Fig 4.164.164.164.16 Basic Structure of Piezoelectric Gyro Basic Structure of Piezoelectric Gyro Basic Structure of Piezoelectric Gyro Basic Structure of Piezoelectric Gyro
Fig Fig Fig Fig 4.174.174.174.17
Piezoelectric Gyro for R/C ToysPiezoelectric Gyro for R/C ToysPiezoelectric Gyro for R/C ToysPiezoelectric Gyro for R/C Toys
Introduction to Robotics with Revobot
Page 73
4.6.24.6.24.6.24.6.2 Mems GyroscopeMems GyroscopeMems GyroscopeMems Gyroscope
MEMS gyroscope are relatively cheaper than traditional
mechanical gyros and they can be easily fabricated in large volume on a tiny IC chip.
Shown in Fig is a design of MEMS Gyroscope under a microscope.
Gyroscope Selection Guidelines
PiezoelectricPiezoelectricPiezoelectricPiezoelectric MEMSMEMSMEMSMEMS
Size Big Small
Cost Fair Low
Availabilities Found in R/C Hobbies Shops
Found in Robotics Shops
Output PWM PWM, Analog
Accuracy Fair High
4.7 Rotation Sensors
As discussed earlier in Issue 4, wheeled robots are among one of the most common types locomotion used. In order
for these robots to navigate properly, feedbacks from the wheels are important to stay in control.
Hence, Rotation Sensors are used to collect feedback from the wheels.
Fig Fig Fig Fig 4.184.184.184.18
Mem Mem Mem Mems Gyroscope Designs Gyroscope Designs Gyroscope Designs Gyroscope Design
Introduction to Robotics with Revobot
Page 74
4 . 7 . 14 . 7 . 14 . 7 . 14 . 7 . 1 Op t i c a l E n c od e r sOp t i c a l E n c od e r sOp t i c a l E n c od e r sOp t i c a l E n c od e r s
The optical encoders are made up of a pair of optocouplers with a slot. A disc is mounted in the slot
between the transmitter and receiver pair of the optocouplers. When the disc spins with the wheel, the
output of optocouplers will start oscillating in-between two different voltages and a counter is used to count the
number of pulses per second the output of optocouplers generates and hence the frequency of the pulses indicate
the speed of the wheel it is indicating the rotational.
In Fig shown the internal construction of the optical encoder describe earlier.
The illustration in Fig is an example of now the encoder disc looks like. The source URL provides more details on
the optical encoder and how to construct one you.
Fig Fig Fig Fig 4.194.194.194.19 Optical Optical Optical Optical EncoderEncoderEncoderEncoder
Fig Fig Fig Fig 4.204.204.204.20 Optical Encoder Pattern Optical Encoder Pattern Optical Encoder Pattern Optical Encoder Pattern
Fig Fig Fig Fig 4.21 4.21 4.21 4.21 Ball MouseBall MouseBall MouseBall Mouse
Introduction to Robotics with Revobot
Page 75
The most common used of Optical encoders are in the computer ball mouse’s, which has been very much phased
out by better performance optical mouse’s.
4 . 7 . 24 . 7 . 24 . 7 . 24 . 7 . 2 Ro t a r y P o t en t i ome t e rR o t a r y P o t en t i ome t e rR o t a r y P o t en t i ome t e rR o t a r y P o t en t i ome t e r
These special potentiometers are capable of rotating 360o
continuously and with high linearity, it is best for
measuring angles.
The above figure shows a rotary potentiometer that is used as an angle transducer to translate angular motion into electrical signals.
Rotation Sensor Selection GuidelinesRotation Sensor Selection GuidelinesRotation Sensor Selection GuidelinesRotation Sensor Selection Guidelines
Optical EncoderOptical EncoderOptical EncoderOptical Encoder Rotary Rotary Rotary Rotary
PotentiometerPotentiometerPotentiometerPotentiometer
Rotary Rotary Rotary Rotary
SwitchSwitchSwitchSwitch
Size Tiny – Large Medium -
Large
Medium -
Large
Cost Low – High High Low –
Medium
Availabilities DIY – Robotics
Shops
Electronic
Stores
Electronic
Stores
Special Requirements
Counter
(Hardware/Software) ADC
Debouncing
system
Application Speed
Slow – High Slow – High Slow
Fig Fig Fig Fig 4.224.224.224.22 Angle Transducer Angle Transducer Angle Transducer Angle Transducer
Introduction to Robotics with Revobot
Page 76
4 . 7 . 34 . 7 . 34 . 7 . 34 . 7 . 3 Mu l t iMu l t iMu l t iMu l t i ---- C on t a c t Sw i t c he sCon t a c t Sw i t c he sCon t a c t Sw i t c he sCon t a c t Sw i t c he s
The use of rotary switch for high angular speed
applications is not recommended as it degrades the mechanic switch much faster than its practical usage time, besides that the switching speed is also limited by
the mechanical bouncing characteristic.
Common usage of these switches is in the speed selector of fans.
4.8 Contact and Proximity Sensor
As discussed in the introduction robots requires sensory system for its environmental awareness. In addition,
contact and proximity sensors are used to accomplish the task of allowing robots to detect physical obstacles.
Contact sensors provide “pain” feedbacks when
contracting the obstacles physically. Whereas proximity sensors are able detect obstacles without physically
“touching” them and it is commonly done by means of wave emissions (i.e. Electromagnetic; Sonic and Light).
4 . 8 . 14 . 8 . 14 . 8 . 14 . 8 . 1 Bumpe r Sw i t c h e sBumpe r Sw i t c h e sBumpe r Sw i t c h e sBumpe r Sw i t c h e s
This type of “pain” feedback sensor is usually mounted on the edges of the robot to sense any contact with
obstacles.
Fig Fig Fig Fig 4.234.234.234.23 Rotary Switch Rotary Switch Rotary Switch Rotary Switch
Introduction to Robotics with Revobot
Page 77
Some common used switches in the construction of a
bumper switch are the push button switch ( ) and the level switch (Error! Reference source not found.Error! Reference source not found.Error! Reference source not found.Error! Reference source not found.).
Fig Fig Fig Fig 4.4.4.4. 24 24 24 24 Bumper CarBumper CarBumper CarBumper Car
Fig Fig Fig Fig 4.244.244.244.24 Level Switch Level Switch Level Switch Level Switch
Fig Fig Fig Fig 4.254.254.254.25 Push Button Switch Push Button Switch Push Button Switch Push Button Switch
Introduction to Robotics with Revobot
Page 78
4 . 8 . 24 . 8 . 24 . 8 . 24 . 8 . 2 Tou ch Sw i t c h e sTou ch Sw i t c h e sTou ch Sw i t c h e sTou ch Sw i t c h e s
Touch switch used to sense human touches is one commonly used sensor in robot-human interaction. It is
normally implemented using resistive or capacitive technology.
4 . 8 . 34 . 8 . 34 . 8 . 34 . 8 . 3 Re s i s t i v e T ou ch SwRe s i s t i v e T ou ch SwRe s i s t i v e T ou ch SwRe s i s t i v e T ou ch Sw i t c h e si t c h e si t c h e si t c h e s
The human body is a good conductor, which has a good percentage of conducting fluid inside (similar to saline
water) covered with partially conducting skin (outer most dead skin is not a good conductor). Therefore, a close
circuit can be formed by simply placing a finger in between two conducting plates. This is a simple method
of detecting a touch but it cannot tell a human touch or just any conductor placed in between them.
Fig Fig Fig Fig 4.264.264.264.26 Bumper Bumper Bumper Bumper SwitchSwitchSwitchSwitch
Fig Fig Fig Fig 4.4.4.4. 27 27 27 27 Resistive Touch SwiResistive Touch SwiResistive Touch SwiResistive Touch Switchtchtchtch
Introduction to Robotics with Revobot
Page 79
4 . 8 . 44 . 8 . 44 . 8 . 44 . 8 . 4 Capa c i t i v e T ou ch Sw i t c he sCapa c i t i v e T ou ch Sw i t c he sCapa c i t i v e T ou ch Sw i t c he sCapa c i t i v e T ou ch Sw i t c he s
A capacitive touch switch consists of two conductive layers on opposite sides of an insulating material such as
glass or a printed-circuit board. The touch switch has conductive layers, which create a capacitance that
decreases when a layer is touched. Interface circuitry is used on a touch switch to convert the capacitance and
change into a usable switching action to drive logic systems or to switch analog signals.
4.9 Force Sensors
Transducers used to translate force in to electrical signals
are essential for robots that require high precision control. Commonly used in robotic grips ( ) and foot of humanoid
robots.
Fig Fig Fig Fig 4.284.284.284.28 Capacitive Touch Capacitive Touch Capacitive Touch Capacitive Touch SwitchSwitchSwitchSwitch
Fig Fig Fig Fig 4.294.294.294.29 Robotic Arm Robotic Arm Robotic Arm Robotic Arm
Introduction to Robotics with Revobot
Page 80
4.10 Magnetic Sensors
Magnetic sensors as the term itself suggest are sensors that are based on the principle of magnetism.
Hall Effect Sensors
The Hall EffectHall EffectHall EffectHall Effect1111 refers to the potential difference on the
opposite sides of an electrical conductor through which an
electric current is flowing, created by a magnetic field
applied perpendicular to the current. Edwin Hall discovered
this effect in 1879.
In the simple form, Hall Effect sensors are analog
transducers or solid-state device that output a small voltage in relative response to the magnitude of the
magnetic field if present. As the output signal is low, amplification is needed.
As amplification is needed for better usage of Hall Effect sensors, the commercial Hall Effect sensors sold
nowadays often consists of an amplifier device coupled with a Hall Effect device. In recent years, various Hall
Effect sensors comes in package consisting of Analog to Digital converter providing digital output or serial output
that can be connected directly to microprocessors.
Hall Effect sensors are used in various applications such as position, speed, direction sensing and current sensing.
One of the advantages of Hall Effect sensors is that it is immune to dust and dirt in position sensing in compare to
optical and electromechanical sensing. A unique application of Hall Effect sensor is currents sensing in
Fig Fig Fig Fig 4.304.304.304.30 Flexi Force Sensors Flexi Force Sensors Flexi Force Sensors Flexi Force Sensors
Fig Fig Fig Fig 4.314.314.314.31 Commercial Commercial Commercial Commercial Hall Effect SensorHall Effect SensorHall Effect SensorHall Effect Sensor
Introduction to Robotics with Revobot
Page 81
which there is non-contact between the sensor device and the conductor to measure.
4.10.14.10.14.10.14.10.1 MagnetometerMagnetometerMagnetometerMagnetometer
A magnetometer is a device when subject to the presence of magnetic field, can be used to measure the magnitude
and the direction of the magnetic field.
Magnetometer comes in two different type; scalar and vector. Scalar type measures the total magnitude of the
magnetic field present whereas vector type can determine the direction in which the magnetic field is there is
various type of magnetometer (scalar or vector) that works using different principle. However, this section,
primarily serves as an informative part for the readers.
Some of the type of magnetometers: • Proton Precession
• Nuclear Magnetic
Fig Fig Fig Fig 4.324.324.324.32 Hall Effect Current Hall Effect Current Hall Effect Current Hall Effect Current SensorSensorSensorSensor
Fig Fig Fig Fig 4.334.334.334.33 Magnetometer Magnetometer Magnetometer Magnetometer
Introduction to Robotics with Revobot
Page 82
• Fluxgate • Overhauser
• Cesium Vapor • Spin-Exchange-Relaxation-Free Atomic (SERF)
• Superconducting Quantum Interference Devices,
4.10.14.10.14.10.14.10.1 Electronic CompassElectronic CompassElectronic CompassElectronic Compass
Electronic compass is one of the sensors widely employed
in robotics as it gives the robot the information on its orientation.
An electronic compass can simply be made up of a
magnetometer with marking to determine the orientation. Electronic compass can also be made up of Hall Effect
sensors where multiple sensors are incorporate at different axis. Using trigonometry, the orientation is calculated and determined. In both cases, the common
principle of the electronic compass works by measuring the earth magnetic field.
Typically, electronic compass can be divided into two
type; digital or analog. In an analog compass, the output of the electronic compass usually comprise of two sine
wave signal, which interpolate each other giving information on the orientation. Digital compass gives
output digital signal by digitalization. Digital output compass usually give information by means of Pulse-
Width-Modulation (PWM) or serial information which allows direct connection to microprocessor.
Fig Fig Fig Fig 4.344.344.344.34 Digital Compass Digital Compass Digital Compass Digital Compass Cmps03Cmps03Cmps03Cmps03
Introduction to Robotics with Revobot
Page 83
Figure 6.2.4 shows a Devantech CMPS03 digital compass which is commonly used in robotics for its ease of use,
compact size, and simplicity.
In robotics, as mentioned, electronic compass allows the robot to obtain information on its orientation. As such,
electronic compass provide vital information on the surrounding which enable the robots to made intelligent
decision. However, one main disadvantage of electronic compass is its dependency on the earth magnetic field to
determine the orientation. For as such, the electronic compass is vulnerable to magnetic disturbances. Another
problem of electronic compass is the non-linearity measurement of the compass direction.
4.11 Thermal Sensors
Thermal sensors or heat sensors are devices that provide information or measurement of thermal energy or heat. Thermal sensors are particular useful in areas where
performance is dependent on temperature or for temperature control applications.
In robotics, thermal sensing plays a major role not only in terms of sensing thermal information but also in terms of
control such as current protection and regulating. Thermal sensors can be seen in smart home robots where
temperature measurement is required for various operations.
4.11.14.11.14.11.14.11.1 ThermistorThermistorThermistorThermistor
A Thermistor is an electric component that changes it resistance with varying temperature. The temperature and resistance relationship is non-linear however in
certain case; linear approximation can be used if it is over a small range of temperature.
Introduction to Robotics with Revobot
Page 84
Figure 6.3.2 above shows the electrical circuit symbol commonly used to represent the thermistor.
Thermistor is used in various applications such as
thermometer, current limiting, and over-heating protection circuit. As resistance increases with increase temperature, it can be used to limit current to the device
when the amount of heat generated by the current is over excess of what the circuit can dissipate.
One characteristic of thermistor is that when current flow
through the thermistor, it resulted in self heating causing the thermistor resistance to increase or decrease due not
only to the environment it is supposed to sense but also the self heating. Hence, correction of error in temperature
due to self-heating must be taken into consideration if the current flowing through the thermistor is could cause the
significant self-heating problem.
Fig Fig Fig Fig 4444 .35 .35 .35 .35 ThermistorThermistorThermistorThermistor
Fig Fig Fig Fig 4.364.364.364.36 Circuit Symbol For Circuit Symbol For Circuit Symbol For Circuit Symbol For ThermistorThermistorThermistorThermistor
Introduction to Robotics with Revobot
Page 85
4.11.24.11.24.11.24.11.2 Thermal CouplerThermal CouplerThermal CouplerThermal Coupler
Thermal coupler is device that measure thermal difference and convert it into an electrical potential different or
voltage.
A voltage is generated when a conductor is subjected to a thermal gradient known also as the Seebeck effect. As
such, when an additional conductor is connected to measure the voltage, a similar phenomenon occurs. When
a conductor of different material is connected to complete the circuit, a potential difference is generated that
correspond to the thermal gradient.
Thermal coupler devices are employed widely as
temperature sensors as they are inexpensive and can measure a wide range of temperature depending on the
type of metal used. However, thermal coupler does not possess high precision and cannot measure temperature
of typically less than one degree Celsius.
4.11.34.11.34.11.34.11.3 ThermostatThermostatThermostatThermostat
Thermostat are devices that acts as switches, turning on or off, heating or cooling to regulate the temperature of a
system. The thermostat is a control system that helps maintain the temperature at a desired set point.
Fig Fig Fig Fig 4.374.374.374.37 Thermocouple Thermocouple Thermocouple Thermocouple ThermometerThermometerThermometerThermometer
Fig Fig Fig Fig 4.384.384.384.38 Mechanical Thermostat Mechanical Thermostat Mechanical Thermostat Mechanical Thermostat
Introduction to Robotics with Revobot
Page 86
Thermostat can sense and control the temperature in various ways.
Sensing: • Bi-metallic strip (mechanical)
• Thermistor (electrical) • Thermocouple (electrical)
Controlling: • Mechanical (Direct Control)
• Electrical (Analog or Digital Output) Thermostats are widely employed in application such as
refrigerator, air-conditioning system, etc.
4.11.44.11.44.11.44.11.4 Thermal Array SensorThermal Array SensorThermal Array SensorThermal Array Sensor
Thermal array sensors are simply array of thermopiles
sensors which can measure several temperature points simultaneously. In simpler term, thermal array sensor is
like a thermal camera capable of measuring temperature from a distance.
A Thermopiles sensor consists of multiple thermocouples
in series or parallel as single thermocouples generates insufficient output. It is an analog transducer which
convert thermal energy into electrical energy and is capable of measuring thermal energy through radiation
absorption and hence the capability of measuring temperature from a distance.
In robotics, thermal array sensor is particularly useful in
the application of human recognition and detection. Other application includes robots’ ability to determine hotspot or
fire threat autonomously by measuring the location position and the amount of thermal energy in the
environment.
FIG FIG FIG FIG 4.394.394.394.39 THERMAL ARRAY THERMAL ARRAY THERMAL ARRAY THERMAL ARRAY SENSORSENSORSENSORSENSOR
Introduction to Robotics with Revobot
Page 87
4.12 Vision Sensors
Vision sensing is an information processing task of discovering what is present in the surrounding and their
position from an image. In Issue 5, sensors like the Rangefinders, Light sensors etc… usually only provide one
type feedback (i.e. Distance, colour). With advance image processing algorithm, vision sensors can provide more feedbacks with just one kind of sensor (i.e. Distance,
colour, shape, orientation, quantity)
The use of Visual Feedback seems to be very useful but it usually requires a fair bit of computation power for image
processing thus the selection of computation platform will become very important. Usually the Digital Signal
Processor (DSP) systems or Single Board Computer (SBC) are preferred.
Generally Vision Sensors are classified into two major
technologies; CMOS (Complimentary Metal-Oxide Semiconductor) and CCD (Charged Coupled Device). Each
of these technologies has their Pros and Cons and they are worth discussing to aid better vision sensor selection.
The basic use of the Vision Sensors is converting light (from real-world) into electrical signals (in digital-world). The main difference CMOS and CCD technology is the way
these electrical signals are read for further processing. CCD VS. CMOS
Illustrated in Fig , the CCDs photo generated charges
move from pixel to pixel to the side of the sensor before
Fig Fig Fig Fig 4.404.404.404.40 ElectronElectronElectronElectron----ToToToTo----Voltage Voltage Voltage Voltage
ConversionConversionConversionConversion
Introduction to Robotics with Revobot
Page 88
being converted into voltage. And for the CMOS sensor charges are converted into voltages within each pixel.
Because of this difference, the CMOS sensors tend to perform faster than the CCDs.
Shown in Fig , the CCDs most of the analog signal chain
and digital control are processed outside the sensor and the CMOS sensors have them integrated in it. Although
the CMOS may be faster but this difference reduced it light capturing area compare to the CCDs of the same
pixel size, resulting in less sensitivity and lower imaging quality.
In summary, CCDs generally provides better image quality but they are slower and consume a lot more
power. CMOS sensors are better in high speed and low power applications. Main applications of vision sensors are
listed below:
AutomotiveAutomotiveAutomotiveAutomotive • Traffic Registration
• Collision warning • Lane Following
• Driver surveillance • Vehicle/Driver Identification
Human Machine InterfaceHuman Machine InterfaceHuman Machine InterfaceHuman Machine Interface • Facial expressions
• Gesture recognition • Direction of Gaze
Surveillance & SecuritySurveillance & SecuritySurveillance & SecuritySurveillance & Security • Intrusion detection
• People tracking • Access Control
• Biometric (face, hand) • Home automation
Fig Fig Fig Fig 4.41 4.41 4.41 4.41 Sensors Sensors Sensors Sensors
FunctionalityFunctionalityFunctionalityFunctionality
Introduction to Robotics with Revobot
Page 89
Industrial ControlIndustrial ControlIndustrial ControlIndustrial Control • Mobile Robot Vision
• Visually guides actuators • Assembly alignment control
• Robot gripper sensors
Fig Fig Fig Fig 4.424.424.424.42 Nissan Pivo Nissan Pivo Nissan Pivo Nissan Pivo Concept Car With Papero Concept Car With Papero Concept Car With Papero Concept Car With Papero
ThThThThe Robotic Drivere Robotic Drivere Robotic Drivere Robotic Driver
Fig Fig Fig Fig 4.434.434.434.43 Lexus Driver Lexus Driver Lexus Driver Lexus Driver Monitoring SystemMonitoring SystemMonitoring SystemMonitoring System
Fig Fig Fig Fig 4.444.444.444.44
3d Face Recognition3d Face Recognition3d Face Recognition3d Face Recognition
Introduction to Robotics with Revobot
Page 90
4.13 Acoustic Sensors
Sound is another form of natural energy and acoustic sensors are use in robots to harvest this energy and
convert into signals that it can interpret. With the sensors robot can process the signals and determine the direction
of the subject of interest, directs and other characteristic of the subject depending of the complexity of the signal
processing algorithm.
The microphones are the most commonly used
transducers that convert sound energy into electrical signals. They are generally classified into two types;
Omni-directional and cardioids directional.
4.13.14.13.14.13.14.13.1 OmniOmniOmniOmni----Directional MicrophonesDirectional MicrophonesDirectional MicrophonesDirectional Microphones
These microphones are meant to pick up sounds from all directions. There are good for monitor an area of interest
(i.e. Security Purposes) or for general robot-human interactions.
Illustrated in Fig , shows the response of an Omni-
directional microphone.
4.13.24.13.24.13.24.13.2 Cardioid Directional MicrophonesCardioid Directional MicrophonesCardioid Directional MicrophonesCardioid Directional Microphones
These microphones are directional, and are more sensitive to sounds coming from a particular direction
(normally the front).
Fig Fig Fig Fig 4.4.4.4.45 45 45 45 OmniOmniOmniOmni----Directional Directional Directional Directional Microphone ResponseMicrophone ResponseMicrophone ResponseMicrophone Response
Introduction to Robotics with Revobot
Page 91
Illustrated in Fig , shows the response of a cardioids
directional microphone. Applications of acoustic sensors are listed below
• Intrusion detection
• Area Surveillance • Voice Surveillance
• Subject classification (i.e. Vehicle, Animal)
Shown in Fig , is a mini microphone that has in built amplifier suitable for surveillance and small robots.
4.14 Localization
Localization, in general, is the determination of the locality (location) of an object. In robotics application,
localization refers to the technique that a robot can determine or update its own location by analyzing of the
sensor data. The Global Position System (GPS) and the
Fig Fig Fig Fig 4.464.464.464.46 Cardioid Directional Cardioid Directional Cardioid Directional Cardioid Directional Microphone ResponseMicrophone ResponseMicrophone ResponseMicrophone Response
Fig Fig Fig Fig 4.474.474.474.47 Mini Microphone With Mini Microphone With Mini Microphone With Mini Microphone With AmplifierAmplifierAmplifierAmplifier
Introduction to Robotics with Revobot
Page 92
NorthStar Indoor Navigation System are two among the various localization sensor and systems.
4.14.14.14.14.14.14.14.1 Global Positioning System (Gps)Global Positioning System (Gps)Global Positioning System (Gps)Global Positioning System (Gps)
The GPS is originally a military project for various
navigation applications. Recently, GPS has been extended to the civilian industry and are commonly see in car
navigation systems.
In military applications, GPS allows soldiers to find the
objective in unfamiliar territory. In various military weapons, the GPS is used to track the potential target and engage the target accurately. In some of the rescue
mission, the victims can be located faster if they have a GPS receiver.
Many civilian applications benefit from GPS signals, such
as use GPS as surveying tool or as an aid to navigation. The ability of GPS in determining relative movement
enables a receiver to calculate local velocity and orientation; this is useful in vessel or observations of the
Earth.
4.14.24.14.24.14.24.14.2 The GPS satellite systemThe GPS satellite systemThe GPS satellite systemThe GPS satellite system
Figure Figure Figure Figure 4.484.484.484.48 Global Position System Global Position System Global Position System Global Position System DeviceDeviceDeviceDevice
Figure Figure Figure Figure 4.494.494.494.49 GPS Satellite GPS Satellite GPS Satellite GPS Satellite SystemSystemSystemSystem
Introduction to Robotics with Revobot
Page 93
The 24 satellites that make up the GPS space segment are orbiting the earth about 12,000 miles above us. The
GPS satellites are constantly moving and making two complete orbits in less than 24 hours. These satellites are
travelling at speeds of roughly 7,000 miles an hour.
GPS satellites are powered by solar energy. They have backup batteries onboard to keep them running in the
event of a solar eclipse, when there's no solar power. Small rocket boosters on each satellite keep them flying
in the correct path.
GPS satellites circle the earth twice a day in a very precise orbit and transmit signal information to earth.
GPS receivers take this information and use triangulation to calculate the user's exact location. Essentially, the GPS
receiver compares the time a signal was transmitted by a satellite with the time it was received. The time difference tells the GPS receiver how far away the satellite is. Now,
with distance measurements from a few more satellites, the receiver can determine the user's position and display
it on the unit's electronic map.
A GPS receiver must be locked on to the signal of at least three satellites to calculate a 2D position (latitude and
longitude) and track movement. With four or more satellites in view, the receiver can determine the user's
3D position (latitude, longitude and altitude). Once the user's position has been determined, the GPS unit can
calculate other information, such as speed, bearing, track, trip distance, distance to destination, sunrise and sunset
time and more.
4.15 Voltage and Current Sensor
Most of the sensors which are introduced previously will convert the various input signal to either continuous
voltage or continuous current output. These continuous signals need to be converted to the digital form to
facilitate the data processing by the digital controller or microcontroller. The conversion of the analog signal to the
digital form is performed by the device called Analog-to-Digital converter (ADC).
Introduction to Robotics with Revobot
Page 94
4.16 Analog-To-Digital Converter
ADC
000..11
:
111..10
The typical ADC specifications are the resolution and
sampling rate. The resolution refers to the number of the discrete values the ADC can produce over the range of
analog values, which always refers to number of bits. The number of discrete level is two to the power of number of bits. For example, for the 8 bits ADC, the number of
available discrete level is 28 = 256. The 256 discrete levels can be used to represent the unsigned number (0
to 255) or signed number (-128 to 127). In this 8 bits case, each discrete step represent Vref/256 Volt, where
Vref id the reference voltage given to the ADC.
The sampling rate is the maximum number of conversions can be done in one second. The rule of thumb to choose
the sampling rate is at least twice the maximum input signal frequencies. If the sampling rate is lower than the
input signal, the input signal cannot be recovered.
In robotic application, ADC is widely used to convert the
analog signal from the sensors. With all the digital data from ADC, the microcontroller in the robot can do the
calculation, do the decision and react accordingly. For example, in the line-tracing robot, the IR sensor in the
robot will output different voltage when dark or bright colour is detected. This voltage will be converted to digital
data by ADC and the microcontroller will process the data to determine whether the robot is still tracing the line and
do the necessary motion correction to ensure the robot is moving according to the line.
4.17 Other Sensors and Time Reference
This section covers the sensors, which are not come
under any specific categories listed in the former
chapters. This includes humidity sensors, biometric sensor
etc.
Figure Figure Figure Figure 4.504.504.504.50 Functional Functional Functional Functional of ADCof ADCof ADCof ADC
Introduction to Robotics with Revobot
Page 95
4.17.14.17.14.17.14.17.1 Humidity SensorHumidity SensorHumidity SensorHumidity Sensor
Humidity Sensor refers to the sensor to detect water vapor content in air or other gases. Humidity
measurements can be stated in a variety of terms and units. The three types of humidity sensors are Capacitive
Humidity Sensors, Resistive Sensors and Thermal Conductivity Humidity Sensor.
4.17.24.17.24.17.24.17.2 Capacitive Relative Humidity (RH) SensorsCapacitive Relative Humidity (RH) SensorsCapacitive Relative Humidity (RH) SensorsCapacitive Relative Humidity (RH) Sensors
Capacitive Relative Humidity (RH) Sensors are widely used in industrial, commercial, and weather telemetry
applications. The humidity of the surrounding is reflected by the capacitance change of the sensors. The
capacitance is increase as the relative humidity of the surrounding is increasing.
4.17.34.17.34.17.34.17.3 Resistive Humidity SeResistive Humidity SeResistive Humidity SeResistive Humidity Sensorsnsorsnsorsnsors
Resistive Humidity Sensors measure the change in
electrical impedance of a hygroscopic medium such as a conductive polymer, salt, or treated substrate. The
impedance changes of this kind of sensors are typically an
Figure Figure Figure Figure 4.514.514.514.51 Capacitive Relative Capacitive Relative Capacitive Relative Capacitive Relative Humidity SensorHumidity SensorHumidity SensorHumidity Sensor
Figure Figure Figure Figure 4.524.524.524.52 Resistive Resistive Resistive Resistive
Humidity SensorHumidity SensorHumidity SensorHumidity Sensor
Introduction to Robotics with Revobot
Page 96
inverse exponential relationship to humidity (impedance increase as the humidity decrease).
4.17.44.17.44.17.44.17.4 Thermal Conductivity Humidity SensorsThermal Conductivity Humidity SensorsThermal Conductivity Humidity SensorsThermal Conductivity Humidity Sensors
Thermal Conductivity Humidity Sensors measure the
absolute humidity by quantifying the difference between the thermal conductivity of dry air and that of air
containing water vapour. The example of this kind of sensor is shown in Figure 6.9.3 6.9.3 6.9.3 6.9.3
4.17.54.17.54.17.54.17.5 Barometric SensorBarometric SensorBarometric SensorBarometric Sensor
A Barometric Sensor is the sensor used to measure the weight of the atmosphere, or atmospheric pressure. The
barometric sensors determine atmospheric pressure by measuring resistance in an electrical current. Within the
sensor housing, there is a metal disc called a resistive strain gauge. On one side of the disc, the cylinder is
sealed and calibrated with a known pressure. The other side is open to the atmosphere. When atmospheric
Figure Figure Figure Figure 4.534.534.534.53 Thermal Conductiv Thermal Conductiv Thermal Conductiv Thermal Conductivity ity ity ity Humidity SensorsHumidity SensorsHumidity SensorsHumidity Sensors
Figure Figure Figure Figure 4.544.544.544.54 Barometric Sensor Barometric Sensor Barometric Sensor Barometric Sensor
Introduction to Robotics with Revobot
Page 97
pressure increases, it pushes on the disc creating an electrical signal. Thus, the electrical output, or voltage
from the strain gauge is proportionate to pressure being exerted on it. Changes in voltage create a signal which is
converted to a digital value using an analog-to-digital converter (ADC) and is processed by the digital-signal
processor (DSP).
4.17.64.17.64.17.64.17.6 Real Time ClockReal Time ClockReal Time ClockReal Time Clock (RTC) (RTC) (RTC) (RTC)
A real time clock (RTC) is a computer clock that mostly
appears in the integrated circuit (IC) form. It is used to keeps track the current time and is presented in the electronic devices which need to keep accurate time.
The RTC has advantage of low power consumption and
able to free the main system for time-critical tasks. One example for the advantages of the RTC is in the computer
main-board that keeps the time for the computer system so that the computer will be able to display the correct
time to the users. In some of robotic application, where the robot will need to perform certain routine task at
specific time, the RTC provide the solution to keep track the time while allow the robotic system to have very low stand-by power consumption.
Figure Figure Figure Figure 4.554.554.554.55 Real Real Real Real----time Clocktime Clocktime Clocktime Clock
Introduction to Robotics with Revobot
Page 98
CHAPTER 5
ActuatorsActuatorsActuatorsActuators
5.1 Mechanical movements
Actuators are an essential part of robotics, they are the plant that drives the robots; grating the robot the ability
to control and move its mechanical parts.
5.25.25.25.2 Types of ActuatorsTypes of ActuatorsTypes of ActuatorsTypes of Actuators
Generally, actuators can be classified into two category of movement; Linear and Rotary.
5.2.15.2.15.2.15.2.1 Linear Actuators Linear Actuators Linear Actuators Linear Actuators
These actuators generate linear displacements, normally in sliding motion.
Illustrated in Fig 5.1 is the movement of the linear actuator
5.2.25.2.25.2.25.2.2 Rotary Actuators Rotary Actuators Rotary Actuators Rotary Actuators
These actuators generate rotary displacements, normally
in spinning motion.
Fig Fig Fig Fig 5555....1111 Linear Linear Linear Linear ActuatorActuatorActuatorActuator
Fig Fig Fig Fig 5555....2222 Rotary Actuator Rotary Actuator Rotary Actuator Rotary Actuator
Introduction to Robotics with Revobot
Page 99
5.2.35.2.35.2.35.2.3 PneumaticPneumaticPneumaticPneumatic & Hydraulic Actuators & Hydraulic Actuators & Hydraulic Actuators & Hydraulic Actuators
These are fluid powered actuators that are commonly used in industrial robotic applications to handle varies
tasks from material handling to precision product manufacturing.
This section will provide an introduction of the actuators'
working principles, highlight some important areas of their application and do a comparison between the
actuators. 5.2.45.2.45.2.45.2.4 Pneumatic Actuators Pneumatic Actuators Pneumatic Actuators Pneumatic Actuators
Pneumatic Actuators uses compressed air to create movement.
Compressed air stored in storage cylinders or air compressors are pumped into the Pneumatic Actuator
thus creating movements.
The working property of the linear pneumatic actuator is illustrated in Fig 5.3 Pneumatic Actuator (Extended)Fig 5.3
and Fig 5.4
1. When compressed air is enters the pneumatic actuator from valve A.
2. It pushes the piston and hence extending the piston rod. 3. Air at valve B is vented into the atmosphere.
Fig Fig Fig Fig 5555....3333 Pneumatic Actuator Pneumatic Actuator Pneumatic Actuator Pneumatic Actuator (Extended)(Extended)(Extended)(Extended)
Introduction to Robotics with Revobot
Page 100
1. When compressed air enters the pneumatic actuator from valve B.
2. It retracts the piston rod. 3. Air at valve A is vented into the atmosphere.
These actuators are used for varies application such as
• Pneumatic drills, as they are lighter, faster, and simpler than an electric drill of the same power rating.
• Replacement of electric actuators where electric sparks (mines) and EMI (MRI scanners) can a safety hazards.
Fig Fig Fig Fig 5555....4444 Pneumatic Actuator Pneumatic Actuator Pneumatic Actuator Pneumatic Actuator (Retracted)(Retracted)(Retracted)(Retracted)
Fig Fig Fig Fig 5555....5555 Dentist Drill Dentist Drill Dentist Drill Dentist Drill
Fig Fig Fig Fig 5555....6666 Jackhammer Jackhammer Jackhammer Jackhammer
Introduction to Robotics with Revobot
Page 101
Shown in Error! Reference source not found.Error! Reference source not found.Error! Reference source not found.Error! Reference source not found. is a dentist drill employing a rotary pneumatic actuator and in Fig 5.6
is a jackhammer with a linear pneumatic actuator.
5.2.55.2.55.2.55.2.5 HydraulicHydraulicHydraulicHydraulic Actuators Actuators Actuators Actuators
Hydraulic actuators operates with incompressible liquid such as oil and water, they are normally used when large
amount of force is required in operation.
The most common hydraulic actuators design is the piston type (Linear) actuators.
The working property of a typical piston type hydraulic
actuator is illustrated in Fig 5.7.
1. Initially, when there is no hydraulic fluid pressure, the spring holds the piston fully extended 2. As fluid enters the actuator, pressure in the
actuator increases. When the hydraulic force is greater than the spring force, the piston retracts
3. When the fluid is drawn out of the actuator, hydraulic force release and hence the piston is extended
by the spring. 4. The fluid drawn from the actuator is returned back
to the hydraulic fluid reservoir. Hydraulic actuators are commonly used on heavy
machinery like Airplanes, Space Shuttles, Cranes, Bulldozers, Forklift, Vehicle jacks etc.
Fig Fig Fig Fig 5555....7777 Hydraulic Hydraulic Hydraulic Hydraulic ActuatorActuatorActuatorActuator
Introduction to Robotics with Revobot
Page 102
Shown in Fig5.8 is a hydraulic vehicle jack that is capable
of lifting up to 10 tons of load and in Fig 5.9 is a hydraulic landing gear of an airplane.
5.2.65.2.65.2.65.2.6 Electrical Actuators Electrical Actuators Electrical Actuators Electrical Actuators
These electromagnetic driven actuators are the most
commonly used actuators used in robotics application. Their application ranges from industrial robotics all the
way to hobbyist robotics. The advantage of using electrical actuators over fluid
powered one are • ease of interfacing to electronic circuitry (not signal
conversion is required) • available in very small form factors
• electricity drive both the control circuitry and actuators (no extra power source needed)
• easily and cheaply available • The working mechanism of the electrical actuators
will be covered in the next section when electromagnetism is introduced.
Fig Fig Fig Fig 5555....8888 Vehicle jack Vehicle jack Vehicle jack Vehicle jack
Fig Fig Fig Fig 5555....9999 Plane landing gear Plane landing gear Plane landing gear Plane landing gear
Introduction to Robotics with Revobot
Page 103
5.2.75.2.75.2.75.2.7 Guideline to Actuator selectionGuideline to Actuator selectionGuideline to Actuator selectionGuideline to Actuator selection
Here are some brief guidelines to the selection of actuators.
• Amount of power required? • Difference actuators type delivers difference among
of power • Ease of power generation and driving actuators?
• Hydraulic actuator requires fluid tank • Pneumatic actuator requires air compressor and
high pressure storage tanks • Electrical actuator requires batteries/electricity
supply • Size constraint?
• Is there a limit to the same of the actuator? • Availability?
• How easy is it to obtain the actuator? • Price? • How much does the actuator cost?
5.3 Electromagnetism
Electromagnetism is simply the physics of the electromagnetic field which is produced due to a changing
electric field traveling in a conductor.
Illustrated in Fig 5.10 is the relationship between electric
current and magnetic field following the Right hand rule.
These fields can be converted into forces that can drive actuators.
Fig Fig Fig Fig 5555....10101010 Right Hand Rule Right Hand Rule Right Hand Rule Right Hand Rule
Introduction to Robotics with Revobot
Page 104
The reverse is also true when a changing magnetic field cuttings across a conductor it actually generates
electricity!!!
5.3.15.3.15.3.15.3.1 ElectromagnetElectromagnetElectromagnetElectromagnet
The simplest form of electromagnetism at work is the electromagnet. It is simply made up of wire coils, and
when a changing electric current (AC) is passed through it, it turn into a magnet.
Shown in Fig 5.11 is a plain electromagnetic coil.
To produce a much stronger magnetic force, a ferromagnetic material (i.e. soft iron) can be use to as a
core which can concentrates the magnetic field that is stronger than that of the coil itself.
Shown in Fig 5.12 is a simple electromagnet that can be
easily constructed with a battery, long wire and an iron nail.
Fig Fig Fig Fig 5555....11111111 Electromagnetic CoilElectromagnetic CoilElectromagnetic CoilElectromagnetic Coil
Fig Fig Fig Fig 5555....12121212 Simple Simple Simple Simple ElectromagnetElectromagnetElectromagnetElectromagnet
Introduction to Robotics with Revobot
Page 105
5.3.25.3.25.3.25.3.2 ApplicApplicApplicApplications of Electromagnetsations of Electromagnetsations of Electromagnetsations of Electromagnets
They are widely used in common household, the tiny ones come in the form read/write head in the computer hard
disk, cassette tape recorder, VCR etc. and earphones, speakers in entertainment systems.
Illustrated in Fig 5.13 is the cross-sectional view of a speaker, the electromagnetic coil can be clearly seen at
the back of the speaker.
Illustrated in Fig 5.14 is a simplified magnetic tape head
commonly found in magnetic tape recorders.
The larger ones can be found in heavy industry, such as metal junk yards where cranes fixed with huge
electromagnets are use to transport scraped metal. High-
Fig Fig Fig Fig 5555....13131313 Speaker CrossSpeaker CrossSpeaker CrossSpeaker Cross----Sectional VSectional VSectional VSectional Viewiewiewiew
Fig Fig Fig Fig 5555....14141414 Magnetic Magnetic Magnetic Magnetic Tape HeadTape HeadTape HeadTape Head
Introduction to Robotics with Revobot
Page 106
speed bullet trains also made use of electromagnetism to levitate on the tracks to overcome the speed barrel due to
fractions on the track.
Shown in Fig 5.15 is the bullet trains that run on Japan’s Shinkansen route.
Shown in Fig 5.16 is a crane used in the metal junk yard,
mounted with a gigantic electromagnet that pick up large pieces of scraped metal.
5.3.35.3.35.3.35.3.3 Electromagnetic ActuatorsElectromagnetic ActuatorsElectromagnetic ActuatorsElectromagnetic Actuators
After discovering the basic working principal of electromagnetism, let’s look at how it can be applied to
actuators. There are mainly 2 types of Electromagnetic Actuators; Solenoids (Linear) and Electrical Motors (Rotary)
5.4 Solenoids
Fig Fig Fig Fig 5555....15151515 Shinkansen Shinkansen Shinkansen Shinkansen Bullet TrainsBullet TrainsBullet TrainsBullet Trains
Fig Fig Fig Fig 5555....16161616 Crane Crane Crane Crane Mounted With Mounted With Mounted With Mounted With ElectromagnetElectromagnetElectromagnetElectromagnet
Introduction to Robotics with Revobot
Page 107
Solenoids produce linear motion when electricity is applied to its coil the ferromagnetic core is pull or push
depending on the direction of the current flow, this is illustrated in Fig 5.17
5.5 Electrical Motors
DC motors are the most commonly used electrical motors
used in robots, various type of DC motors may difference in constructions but the basic working principal behind
them are generally the same.
Similar to the solenoid electric current is applied to the coils but instance of interacting with a ferromagnetic core,
DC motors interact with magnets.
5.6 Brushed Direct Current (DC) Motor
Brushed Direct Current (DC) Motor are rotary motor that
turns upon applying a significant voltage. The applied voltage determines the rotation speed where higher
voltage would relate to higher rotation speed.
Fig Fig Fig Fig 5555....17171717 Solenoi Solenoi Solenoi Solenoidddd
Introduction to Robotics with Revobot
Page 108
As the voltage increases, the current also increases resulting in the motor to heat up. The heat if exceed the
permissible range the motor’s material can tolerant, the motor becomes overheated and eventually burn out.
As such, all motors typically come with a voltage rating or
an operating voltage range to prevent such overheating. Voltage rating on a motor indicates the typical permissible
voltage that can be applied that the motor would operates continuously and normally without overheating.
In addition, the typical speed in which the motor can produce with the voltage is also given. The speed
indicates the number of turns the motor (revolution) would rotate per minute (rpm) without load.
The working property of a typical brushed DC motor is
illustrated in Fig 5.19
1. A simple rotary-brushed DC motor consists of a coil as the rotor3 and the permanent magnet (N – S) as the
stator4.
3 “Rotor”, Rotor, http://en.wikipedia.org/wiki/Rotor_%28electric%29
4 “Stator”, Stator, http://en.wikipedia.org/wiki/Stator
Fig Fig Fig Fig 5555....18181818 DC motorDC motorDC motorDC motor
Fig Fig Fig Fig 5555....19191919 How Brushed Dc How Brushed Dc How Brushed Dc How Brushed Dc Motor WorksMotor WorksMotor WorksMotor Works
Introduction to Robotics with Revobot
Page 109
2. An electric direct current passes through and energized the coil (rotor). The coil is connected to the via
contact points commonly known as brushes. 3. As the current flows through the wires, magnetic
fields are produced by these current-carrying wires using principle of the right-hand rule.
4. The interacting alignment configuration of the magnetic fields created by the wires and permanent
magnet, result in an upward force on the positive pole side and downward force on negative pole side. These
opposing forces created within result in a clockwise motion of the rotor as shown in fig 5.19
5. As the rotor rotates, the direction of the current through the coil is reversed; the magnetic field
subsequently produced by coil is also reversed resulting in a repeat of the sequences.
Brushed DC motor has it advantages as it is commercially
and easily available with various voltages and speed rating and typically less costly.
However, brushed DC motor are approximately 70-80%
efficient only and are subjected to the problem of contact irregularities of the brushes at high speed. As such,
brushed motor have typically lower maximum speed limit. Friction produced by the brushes also constitute to the
problem of wear and tear which need replacement and maintenance. In addition, DC motor is also subject to
electrical noise.
Overall, brushed motor are still widely use in robotics due to its easy of use and cost.
5.7 Brushless Direct Current (DC) Motor
A brushless DC motor electric motor is an actuator similar
to that of a brushed DC motor however with a totally different physical configuration.
Introduction to Robotics with Revobot
Page 110
In a brushless DC motor, the coils are the stators and the
permanent magnet is the rotor. In such a configuration, there is not a need to transfer a direct current to a
rotating armature and hence there are no brushes in a brushless motor.
Fig 5.21 show a typical conventional configuration of a brushless DC motor where 3 coils or stators surround the
rotor. By use of an electronic controller or logic circuits, a rotating magnetic fields created by the 3 coils such that the rotor can be directed in a particular direction. To
facilitate the directing, information on the rotor position is required and this is commonly achieved using Hall Effect5
sensors or rotary encoders6.
5 “Hall Effect”, Hall Effect, http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/hall.html
6 “Rotary Encoders”, Rotary Encoders, http://en.wikipedia.org/wiki/Rotary_encoder
Fig Fig Fig Fig 5555....20202020 A Typical Brushless Dc A Typical Brushless Dc A Typical Brushless Dc A Typical Brushless Dc MotorMotorMotorMotor
Fig Fig Fig Fig 5555....21212121 Config Config Config Configuration Of A uration Of A uration Of A uration Of A Brushless Dc MotorBrushless Dc MotorBrushless Dc MotorBrushless Dc Motor
Introduction to Robotics with Revobot
Page 111
Brushless DC motor has it advantages in term of its efficiency, reliability, reduced noise and longer lifetime
(no brush degradation).
However, brushless DC motors typically more costly and are more complex in its implementation. Additional logical
circuits and control are required for generating the rotating magnetic field.
Overall, brushless DC motors provide high performance
but are generally more costly and complex to implement which deter many robotics users.
5.8 Stepper Motor
A stepper motor is a brushless electric motor that can
rotate precisely to a particular angle in which the full rotation is divided into a number of steps. The angle
resolution is dependant on the number of steps. Typically, since stepper motors are used for positioning purpose,
stepper motors are rated using torque7 (holding force) and voltage.
Diff from the DC motor, stepper motor does no spin
continuously when potential is applied to the motor. Instead, stepper motor is used to precisely hold the rotor at a particular direction.
7 “Torque”, Torque, http://en.wikipedia.org/wiki/Torque
Fig Fig Fig Fig 5555....22222222 A Typical Stepper Motor A Typical Stepper Motor A Typical Stepper Motor A Typical Stepper Motor
Introduction to Robotics with Revobot
Page 112
In a stepper motor, the rotor is a gear with magnetic teeth as shown in Fig5.23
A simple explanation of how a stepper motor works is as follows
1. Each coil is magnetized one at a time attracting the
nearest few magnetic teeth to it. 2. The next coil to be magnetized is mounted at an
offset such that when it is magnetized, the gear rotates slightly to align itself.
3. When one coil turns off and the other on, the gear rotates towards the required direction. 4. Using the same principle, the rotor is hold by aligning
particular teeth of the gear to the coils Stepper motor in other words can be deemed as a
brushless DC motor coupled with a controller for position control. As such, stepper motor exhibit most of the
advantages to that of the brushless DC motor and can provide precise position control.
Its main disadvantages come as stepper motors are
subjected to slippages and are typically less power efficient and more bulky. Cost of stepper motors relate to
the precision of position control as the more precise the control, the more costly the motor is.
5.9 RC Servo Motor
RC Servo motors are DC motors coupled with logical
controllers that provide velocity or position control through the use of feedback information. Typically, RC
servo can provide only a limited degree of rotation
Fig Fig Fig Fig 5555....23232323 A Stepper Motor A Stepper Motor A Stepper Motor A Stepper Motor ConfigurationConfigurationConfigurationConfiguration
Introduction to Robotics with Revobot
Page 113
control. (140 - 270 degrees). Similar to stepper motor, RC servo are rated accordingly to their torque and
voltage.
By use of Pulse-Width Modulation8 (PWM), the position of the rotor is set accordingly. In recent years, new
generation servos uses serial data or daisy chain9 method as it reduces the need for multiple connecting wires.
A typical RC servo consists of the following parts; DC
motor (1), potentiometer(2), reduction gears(3) , actuator arm(4) and a digital controller as shown in
Figure 5.24
8 “Pulse Width Modulation”, PWM, http://en.wikipedia.org/wiki/ Pulse-width_modulation
9 “Daisy Chain”, Rotary Encoders, http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci1115470,00.html
Fig Fig Fig Fig 5555....24242424 Parts Of The Rc Servo Parts Of The Rc Servo Parts Of The Rc Servo Parts Of The Rc Servo
Fig Fig Fig Fig 5555....25252525 Circuitry Circuitry Circuitry Circuitry Of Of Of Of A Typical Rc ServoA Typical Rc ServoA Typical Rc ServoA Typical Rc Servo
Introduction to Robotics with Revobot
Page 114
A RC servo works as follows:
A PWM signal is send to the digital controller. Based on the PWM and reading from the
potentiometer (indicates position of actuator arm), the appropriate drive required is sent to the DC
motor. The DC motor rotates the actuator arms through
the reduction gear to provide more torque (reduction gear and torque would be discussed in
the section 3.3). The potentiometer updates the digital controller on
the new position of the actuator arm. Visit the following URL to find out more detail
information in the use and controlling of servo motors.
RC servo has it advantage over stepper motors in position precision control in terms of torque and response time. In
addition, it is easy to implement.
However new generation servos used in robotics are better performance and more information feedback but
are subjected to higher cost and more complexity.
5.10 Application of Electrical Rotary Motor in Robotics
Electrical rotary motor are vastly employed as actuators in robotics in various aspects. Below are examples of
these rotary motor discussed used in robots. Brushed DC Motors
Fig Fig Fig Fig 5555....26262626 Biomorph (Left) And Soccer Robot (Right) Employ The Biomorph (Left) And Soccer Robot (Right) Employ The Biomorph (Left) And Soccer Robot (Right) Employ The Biomorph (Left) And Soccer Robot (Right) Employ The
Use Of Brushed Dc MotorsUse Of Brushed Dc MotorsUse Of Brushed Dc MotorsUse Of Brushed Dc Motors
Introduction to Robotics with Revobot
Page 115
Brushless DC MotorBrushless DC MotorBrushless DC MotorBrushless DC Motor
Stepper MotorStepper MotorStepper MotorStepper Motor
RC ServoRC ServoRC ServoRC Servo
Fig Fig Fig Fig 5555....27272727 Omni Directional Omni Directional Omni Directional Omni Directional SocceSocceSocceSoccer Robot From r Robot From r Robot From r Robot From
Cornell University Employ Cornell University Employ Cornell University Employ Cornell University Employ The Use Of Brushless Dc The Use Of Brushless Dc The Use Of Brushless Dc The Use Of Brushless Dc Motors For Robocup Motors For Robocup Motors For Robocup Motors For Robocup
CompeitionCompeitionCompeitionCompeition
Fig Fig Fig Fig 5555....28282828 The M6 Robot Built The M6 Robot Built The M6 Robot Built The M6 Robot Built For Locomotion Test On For Locomotion Test On For Locomotion Test On For Locomotion Test On
Unstructured Environment Unstructured Environment Unstructured Environment Unstructured Environment Employs The Use Of Stepper Employs The Use Of Stepper Employs The Use Of Stepper Employs The Use Of Stepper
Motors In Each Of The Motors In Each Of The Motors In Each Of The Motors In Each Of The WheelsWheelsWheelsWheels
Introduction to Robotics with Revobot
Page 116
5.11 Guideline to Electrical Motor selection
Here are some brief guidelines to the selection of electrical rotary motors.
Type of electrical motor required? For rotation drive – brushed/ brushless DC motor,
stepper motor or hacked10 RC servos For position control – stepper motor or RC servos
Speed (RPM) and voltage rating required? Typically, higher speed motors required higher
voltage rating. Other considerations?
Cost Reliability
Efficiency Noise Immunity
Lifetime Implementation Availability
10 “Hacked RC Servo”, Servos that are hacked/ modified to provide full rotation control.
Fig Fig Fig Fig 5555....29292929 the humanoid robot the humanoid robot the humanoid robot the humanoid robot manusmanusmanusmanus----i uses rc servos ai uses rc servos ai uses rc servos ai uses rc servos as s s s
actuator for each of its joints.actuator for each of its joints.actuator for each of its joints.actuator for each of its joints.
Introduction to Robotics with Revobot
Page 117
5.12 Gears
A gear is a wheel with teeth around its circumference, the
purpose of the teeth being to mesh with similar teeth on another mechanical device -- possibly another gear wheel
-- so that force can be transmitted between the two devices in a direction tangential to their surfaces11.
Typically, gears are employed to increase or decrease torque and speed. Speed and torque are inversely related
as increase in speed would decrease torque and vice-versa. As such, gear is a very useful property especially
in robotics where mechanical advantage is needed. There are many type of gears used for mechanical
advantages. Different type of gear provides different efficiency, stepping up/down and also translates into
different mechanical direction.
11 “Gear”, Definition adopted from http://en.wikipedia.org
Fig Fig Fig Fig 5.305.305.305.30 Gear Gear Gear Gear
Introduction to Robotics with Revobot
Page 118
5.12.15.12.15.12.15.12.1 Spur GearsSpur GearsSpur GearsSpur Gears (~90% eff (~90% eff (~90% eff (~90% efficiency)iciency)iciency)iciency)
Spur gears are the most common type of gears. They have straight teeth, and are mounted on parallel shafts.
Sometimes, many spur gears are used at once to create very large gear reductions12.
5.12.25.12.25.12.25.12.2 Helical GearsHelical GearsHelical GearsHelical Gears (~80% efficiency) (~80% efficiency) (~80% efficiency) (~80% efficiency)
Helical gears are an improvised version of the spur gears
where the edges of the teeth are not parallel to the axis of rotation but set at an angle. In this configuration, the
teeth engage more often in compare to the spur gear resulting in a smoother and quieter run. Helical gear also has it advantage to provide cross coupling which changes
the mechanical axis of rotation as shown in Figure 5.32
12 “Spur Gear”, Definition adopted from http://auto.howstuffworks.com/gear2.htm
Fig Fig Fig Fig 5.315.315.315.31 Spur Gears Spur Gears Spur Gears Spur Gears
Fig Fig Fig Fig 5.325.325.325.32 Helical Gears Helical Gears Helical Gears Helical Gears
Introduction to Robotics with Revobot
Page 119
5.12.35.12.35.12.35.12.3 BeveBeveBeveBevel Gearsl Gearsl Gearsl Gears (~70% efficiency) (~70% efficiency) (~70% efficiency) (~70% efficiency)
Bevel gears are another form of gear which is used to provide the same cross coupling discussed earlier only.
Bevel gear changes the angle of operation and can be designed to operate at different cross coupling angle.
5.12.45.12.45.12.45.12.4 Worm gearsWorm gearsWorm gearsWorm gears (70% efficiency) (70% efficiency) (70% efficiency) (70% efficiency)
A worm gear is another type of helical gear that looks like a screw which can be coupled with a spur gear. Similarly,
this coupling provides the change in operating angle of the rotation axis. The main feature of such a gear is that
it is not back-drivable. Back drivable implies that worm (screw-looking) can drive the gear but not necessary the
vice-versa direction. This special property makes it ideal for driving large load without the need of holding torque.
Fig Fig Fig Fig 5.33 5.33 5.33 5.33 Bevel GearsBevel GearsBevel GearsBevel Gears
FigFigFigFig 5.34 5.34 5.34 5.34 Worm Gears Worm Gears Worm Gears Worm Gears
Introduction to Robotics with Revobot
Page 120
However, it efficiency is a disadvantage in compare to other type of gears.
5.12.55.12.55.12.55.12.5 Rack and Pinion GearsRack and Pinion GearsRack and Pinion GearsRack and Pinion Gears(~90% efficiency)(~90% efficiency)(~90% efficiency)(~90% efficiency)
A rack and pinion gear translates rotational motion into translation motion or vice-versa. This type of gear is
typically employed in steering in automobiles. 5.12.65.12.65.12.65.12.6 Gear RatiosGear RatiosGear RatiosGear Ratios
When two gears of different number of teeth are coupled, the speed and torque that the gears provide change.
When a gear with fewer teeth (pinion) drives another with
more teeth (wheel), the speed is reduce. Speed is reduced as when the pinion completes 1 revolution, the
wheel does not due to the teeth difference.
Similarly, in the same case, since there is a speed reduction, there is an increase in torque as the same
amount of force in the pinion moves a much lesser angle of rotation in the wheel. In other word, the wheel move with more torque.
As such, a unit of indication is used to calculate the
change and this unit is known as the gear ratio.
Gear ratio is a unit to indicate the resultant speed and torque when gears are employed and usually, the number
in the front is the gear where the power is applied.
Fig Fig Fig Fig 5.355.355.355.35 Rack And Pinion Rack And Pinion Rack And Pinion Rack And Pinion GearsGearsGearsGears
Introduction to Robotics with Revobot
Page 121
For an instance, when a gear is determined to be 3:1, this
indicates that the number of teeth of the gear in which the power is applied to is three time the number of teeth
of the resultant gear.
To calculate the resultant speed and torque, the following
formulas can be used. Gear ratio given A:B
Resultant Speed = Applied Speed * A/B
Resultant Torque = Applied Torque * B/A
5.12.75.12.75.12.75.12.7 Type of CouplingType of CouplingType of CouplingType of Coupling
Type of coupling indicates the type of method used in to
provide the gearing ratio. There are three methods:
Gear to gear, Belt driven, Rotary to Linear
5.12.85.12.85.12.85.12.8 Gear to gearGear to gearGear to gearGear to gear
Gear to gear is the most common type of coupling employed due to its simplicity. In areas of speed
reduction and torque increase, gear to gear is often
FIGFIGFIGFIG 5.36 5.36 5.36 5.36 GEARS RATIO GEARS RATIO GEARS RATIO GEARS RATIO 10 Teeth Power applied to 10 Teeth Power applied to 10 Teeth Power applied to 10 Teeth Power applied to
this gearthis gearthis gearthis gear
Fig Fig Fig Fig 5.375.375.375.37 Gears To Gears To Gears To Gears To Gear Gear Gear Gear
CouplingCouplingCouplingCoupling
Introduction to Robotics with Revobot
Page 122
employed. A point to note is that gear-to-gear gives a counter-rotation when even number of gears is employed.
5.12.95.12.95.12.95.12.9 Belt DrivenBelt DrivenBelt DrivenBelt Driven
Belt driven coupling uses a belt to drive the gears. In
instances, this belt can be seen as a chain that hooks the two gears up. In such a configuration, the rotation
direction is the same. An advantage of such a system is that the gears can be positioned apart with the need of
more mechanism. 5.12.105.12.105.12.105.12.10 Rotary to LinearRotary to LinearRotary to LinearRotary to Linear
Rotary to linear is one of the most common methods used when rotary actuators are used to provide linear motion.
Rack and pinion and worm gear are typically employed to provide such conversion.
5.12.115.12.115.12.115.12.11 Guideline to Gear SGuideline to Gear SGuideline to Gear SGuideline to Gear Selectionelectionelectionelection
Here are some brief guidelines to the selection of gear.
Type of gear?
Cross coupling or non-cross coupling required Efficiency
Size and space The required gear ratio?
Fig Fig Fig Fig 5 .385 .385 .385 .38 Belt Driven Belt Driven Belt Driven Belt Driven CouplingCouplingCouplingCoupling
Fig Fig Fig Fig 5.39 5.39 5.39 5.39 Rotary To LinearRotary To LinearRotary To LinearRotary To Linear
Introduction to Robotics with Revobot
Page 123
Using the formula determine the required gear ratio to obtained the necessary speed and torque
Multiple gears can be employed Speed and torque are trade-off of each other. High
speed-low torque and vice versa Type of coupling?
Gear to gear – Suitable for compact gear box Higher efficiency and less prone to slippage
Belt-driven – Suitable for long distance coupling Subject to slippage depending on the belt used
Rotary to linear- Suitable for steering and rotation to linear conversion
Material of gears Metal gears
Strong Need to be accurately coupled to reduce friction
Longer lifetime Less prone to slippage Heavy
Plastic gears Weaker
Wore out more easily Light
More prone to slippage
Introduction to Robotics with Revobot
Page 124
PART IIPART IIPART IIPART II
ROBOTICS WITH ROBOTICS WITH ROBOTICS WITH ROBOTICS WITH
REVEBOTREVEBOTREVEBOTREVEBOT
Introduction to Robotics with Revobot
Page 125
CHAPTER 6
Fundamentals of Robotics Fundamentals of Robotics Fundamentals of Robotics Fundamentals of Robotics
6.1 Robots
The world around us is changing in unprecedented ways and unimaginable speed. The robotic age only dreamed
about and depicted in science fiction novels and movies are becoming a reality.
Robots have a long history – from fictional characters (in
Isaac Asimov’s novels and in motion pictures), to industrial robots and mobile robots. Industrial robots
have taken a long stride and are well established, though newer application domains and research directions are
very much in the limelight.
Robotics are now taking the robots out of their fixed base (industrial robots) imparting mobility and intelligence -
and there are a number of mobile robots situated in real worlds.
6.26.26.26.2 The very first concept The very first concept The very first concept The very first concept –––– Robot and Robotics Robot and Robotics Robot and Robotics Robot and Robotics
The word "Robot" was first used in the 1921 play R.U.R.13 (Figure 6.1)14 by the Czech writer Karel Capek. The word
"Robot" was derived from a Czech word "robota", meaning, and “forced labor."
13 Rossum's Universal Robots – [http://jerz.setonhill.edu/resources/RUR/]
14 Image from Robot Museum – [http://www.the-robotman.com/nv_fs.html]
Figure 6.1: The robot from the 1921 playFigure 6.1: The robot from the 1921 playFigure 6.1: The robot from the 1921 playFigure 6.1: The robot from the 1921 play
R.U.R.R.U.R.R.U.R.R.U.R.
Introduction to Robotics with Revobot
Page 126
Robotics15 is the science and technology of robots, their
design, manufacture, and application. Robotics requires a working knowledge of electronics, mechanics, and
software. A person working in the field is a roboticistroboticistroboticistroboticist. The word "robotics" first appeared in the short story
"Runaround" (1942) by Isaac Asimov16 (6.3). This story was later included in Asimov's famous book "I, Robot."
The robot stories of Isaac Asimov also introduced the "three laws of robotics."
6.36.36.36.3 The three laws of roboticsThe three laws of roboticsThe three laws of roboticsThe three laws of robotics by Isaac Asimov: by Isaac Asimov: by Isaac Asimov: by Isaac Asimov:
A robot may not injure a human being, or through
inaction, allow a human being to come to harm;
A robot must obey the orders given it by human beings except where such orders would conflict with the First Law;
A robot must protect its own existence as long as
such protection does not conflict with the First or Second Laws.
Later, Asimov added the "zeroth" law:
A robot may not injure humanity, or, through
inaction, allow humanity to come to harm. 6.46.46.46.4 Early Industrial RobotsEarly Industrial RobotsEarly Industrial RobotsEarly Industrial Robots
In the early 1950’s and 60’s George Devol and Joe Engleberger created probably the first modern industrial
robot named the "Unimates."
"Unimation" is the first robotics company, started by Joe Engleberger (Fig 6.2) who is known as the "father of
robotics."
15 From Wikipedia, the free encyclopedia – [http://en.wikipedia.org/wiki/Robot]
16 From Robotics Society of America –
[http://www.robots.org/newslttr/news0497/met0497a.htm]
Introduction to Robotics with Revobot
Page 127
A Greek physicist Ctesibius of Alexandria made the first robot the clepsydra or water clock in 250 B.C. Nikola
Tesla built the earliest remote control vehicles in the 1890's. Grey Walter's "Elsie the tortoise17" (Fig 6.3) and
the Johns Hopkins "beast" are some of the early robots (1940's - 50's).
In the 1960’s the Stanford Research Institute developed a robot named "Shakey18" (Fig 6.3). Shakey moved on
wheels and was the first mobile robot to reason about its actions.
17 The Elsie the Tortoise – [http://cache.ucr.edu/~currie/roboadam.htm#Shakey]
18 Shakey – [http://www.sri.com/about/timeline/shakey.html]
Figure Figure Figure Figure 6.6.6.6.2222: : : : ISAAC ISAAC ISAAC ISAAC
ASIMOV and JOE ASIMOV and JOE ASIMOV and JOE ASIMOV and JOE
ENGLEBRGERENGLEBRGERENGLEBRGERENGLEBRGER
Figure Figure Figure Figure 6.36.36.36.3: : : : ELSI the ELSI the ELSI the ELSI the
TortoiseTortoiseTortoiseTortoise
Introduction to Robotics with Revobot
Page 128
6.56.56.56.5 Industrial RobotsIndustrial RobotsIndustrial RobotsIndustrial Robots::::
19 Walking Truck – [http://en.wikipedia.org/wiki/Walking_truck]
20
http://www.frc.ri.cmu.edu/~hpm/project.archive/Image.Archive/other.robots/Mosher.GE.walking.truck.jpg
In 1968, General Electric developed the walking truck19 (Figure 6.4)20 as an experimental quadruped robot.
Ralph Mosher designed the walking truck to help infantry carry equipment over rough terrain.
A human controlled the stepping of this robot by pushing pedals with his feet. A computer coordinated the robot leg
movements.
Figure Figure Figure Figure 6.46.46.46.4: : : : Walking truck by Walking truck by Walking truck by Walking truck by
General ElectricGeneral ElectricGeneral ElectricGeneral Electric
Figure Figure Figure Figure 6.56.56.56.5:::: Shakey by the Stanford Shakey by the Stanford Shakey by the Stanford Shakey by the Stanford
Research Institute (1960)Research Institute (1960)Research Institute (1960)Research Institute (1960)
Introduction to Robotics with Revobot
Page 129
Until lately, most of the robots installed worldwide have been used in manufacturing processes. Industrial robots
(Fig 6.6) are perfect to micro and nano levels of accuracy. Most of these robots operate from a fixed base in a very
structured environment.
Although the vast majority of robots today are used in
factories, advances in technology enable robots to automate many tasks in non-manufacturing industries,
such as agriculture, construction, health care and other services.
6.66.66.66.6 Mobile RobotMobile RobotMobile RobotMobile Robotssss
Mobile robots are utilized in industry, military and security
environments. There are several consumer products, for entertainment or to perform certain domestic tasks like
vacuuming. Autonomous robots with capabilities to reason and move about freely will be much in demand in
the coming decades. Designing autonomous mobile robots in any meaningful degree has become possible
only with the recent surge in computational, communications and sensing technologies.
Teams of smart micro-robots could do regular
maintenance in nuclear power plants and other hazardous environments. In the future they may fight our wars. Unmanned tanks through satellite control - that's the
equivalent of robot soccer setup (Fig 6.7).
Figure Figure Figure Figure 6.66.66.66.6:::: Industrial Robot Industrial Robot Industrial Robot Industrial Robots s s s
doing vehicle underbody doing vehicle underbody doing vehicle underbody doing vehicle underbody
Assembly (KUKA)Assembly (KUKA)Assembly (KUKA)Assembly (KUKA)
Introduction to Robotics with Revobot
Page 130
To assist the disabled (Fig 6.8)21 and like a secretary, the personal robots will change our life style altogether.
Artificial dogs or robot-pets with emotions can provide a smoothening feeling to many, especially to the children, the aged and the disabled. The Leonardo project22 (Fig
6.6) seamlessly merges the artistry of character, robotic technology, and artificial intelligence.
The moment robots are placed in real world
environments, several issues pop up – where am I (positional information), where should I go (situation
awareness and target identification), what should I do (target identification, object manipulation and reactive
capabilities), etc. are issues that should be addressed.
The Mars Exploration Rover (Fig 6.8) mission23 is part of NASA's Mars Exploration Program, a long-term effort of
robotic exploration of the red planet.
21 RoboWalker by Yobotics – [http://yobotics.com/robowalker/robowalker.html]
22 The Leonardo Project – [http://robotic.media.mit.edu/projects/Leonardo/Leo-intro.html]
23 Mars Rover by NASA – [http://marsrovers.nasa.gov/overview/]
Figure Figure Figure Figure 6.7: Leonardo 6.7: Leonardo 6.7: Leonardo 6.7: Leonardo ––––
Socially Intelligent RobotSocially Intelligent RobotSocially Intelligent RobotSocially Intelligent Robot
Figure Figure Figure Figure 6.8: Mars Rover6.8: Mars Rover6.8: Mars Rover6.8: Mars Rover
Introduction to Robotics with Revobot
Page 131
When it comes to real world operational conditions of mobile robots, what level of accuracy is desirable. The
most advanced species on this planet (the humans) perform well out there with less precision and accuracy.
Of course, it is desirable to have mobile robots that are capable of pinpoint accuracy, which will depend on the
application areas. Human capabilities along “tracking” and “following” are commendable, though precision and
accuracy are not major concerns as we are comfortable to adjust our actions in a continuous fashion. There is a long
way to go, to bring robots to the level of human like capabilities.
It is tough to identify a single advanced robot, as robots for specific tasks are advanced to their level of
operations. There are robotic surgeons24 (Fig 6.10), robotic capsules to explore our intestines, those capable
of catching a ball traveling at a speed of over 100 km per hour, etc.
24 Da Vinci Robotic Surgeon – [http://www.intuitivesurgical.com/]
Figure Figure Figure Figure 6.9: Robowalker by 6.9: Robowalker by 6.9: Robowalker by 6.9: Robowalker by
YevoboticsYevoboticsYevoboticsYevobotics
Figure Figure Figure Figure 6.10: Da Vinci 6.10: Da Vinci 6.10: Da Vinci 6.10: Da Vinci
Robotic SurgeonRobotic SurgeonRobotic SurgeonRobotic Surgeon
Introduction to Robotics with Revobot
Page 132
One of the best robots is Honda's ASIMO Humanoid (Fig 6.11). It can shake hand with humans (need to sense the
human-hand’s comfortable level), walk around, and climb steps.
6.76.76.76.7 HumanoidsHumanoidsHumanoidsHumanoids
We have built the environment (living space, apartments,
vehicles, etc.) that is suitable for two legged systems. It is predicted that robots will be with us in our daily life
sharing our space and resources (power, bandwidth and space). Nature has shown the way where the most
successful species on this planet has two legs. So the robots that may have to live with us in due course of time
should be two legged (Fig 6.11). Or should we redesign our living space suitable for wheeled robots?
The most challenging issue with humanoids (Fig 6.12) is
to balance on two legs. Humans are capable of doing all kinds of acrobatics with two legs. We have muscles
(assisting us along various activities) and the body is flexible. Research along material science (flexible body,
muscles, actuators), nano technology (smaller and lighter sensors and actuators), computational intelligence (fuzzy
logic, neural-networks, learning – genetic algorithms, evolutionary algorithms), etc. should be assimilated into and mastered to design better systems.
Figure Figure Figure Figure 6.11 Honda’s 6.11 Honda’s 6.11 Honda’s 6.11 Honda’s
Asimo HumanoidAsimo HumanoidAsimo HumanoidAsimo Humanoid
Introduction to Robotics with Revobot
Page 133
6.86.86.86.8 Cooperative RoboticsCooperative RoboticsCooperative RoboticsCooperative Robotics
Since the day humans started walking on this planet, they have come together for the benefit (selfishness!) of the
members to get control of various resources. Cooperation / coordination among members were so much the need of
the hour as they had to compete with other (hostile) communities.
Organizations like FIRA [www.fira.net] are pushing along
robot soccer (Fig 6.13) as a competitive platform to push technology. In robot soccer, teams have to coordinate and compete while chasing an indivisible resource (the
ball). Robot Soccer is thus a benchmark problem to study various issues along coordination / cooperation and
competition, giving insights into problems in social / life sciences.
Figure Figure Figure Figure 6.12 The GENUS 6.12 The GENUS 6.12 The GENUS 6.12 The GENUS
HumanoiHumanoiHumanoiHumanoid d d d
By Dr. Vadakkepat and By Dr. Vadakkepat and By Dr. Vadakkepat and By Dr. Vadakkepat and
StudentStudentStudentStudent
Introduction to Robotics with Revobot
Page 134
Lately, emphasize is more along imparting intelligence
and learning capabilities to robots. Through robot soccer and similar platforms, Roboticists are trying to appreciate
how to impart intelligence to react to changes in the environment. Of course, this can be done to some extend with simple if-then-else conditions as well. We have to
look beyond those to learn more along generalization capabilities.
We have set a target of 2050 (many of our kids will be
able to witness) where it is hoped to pitch a team of humanoids against humans to play the game of football.
Many of us are skeptical of this deadline as the technology is yet to reach the needed threshold for this to
materialize. However, deadlines help us to work towards and to push ourselves.
6.96.96.96.9 Robotic Design ApproachesRobotic Design ApproachesRobotic Design ApproachesRobotic Design Approaches
In the current design approaches the sensors, motors,
mechanical structure, etc, are designed and constructed individually. Nature always evolved systems as a whole. That is the beauty or rather the richness of all organisms
- for instance a bee can travel kilometers in search of pollen or nectar, and return back to base - so small it is -
but it is intelligent (expert) enough for what it is meant for. Another example is ant - it can carry several times its
weight. It has rugged body surface and though flimsy the legs are and it is capable of doing all kinds acrobatics for
its survival.
In conventional robotic engineering, the coordination of multiple limbs to generate motion for different
Figure Figure Figure Figure 6.13: Soccer 6.13: Soccer 6.13: Soccer 6.13: Soccer
RobotsRobotsRobotsRobots
Introduction to Robotics with Revobot
Page 135
environment settings and tasks have mostly been tackled from a control and systems approach, implemented with
different robotic architectures. This often requires a central processor, multiple sensory devices, a mechanical
structure and a program written explicitly for the job at hand. Such microprocessor-based technology is limited in
terms of size, cost and power efficiency. Many robotic builders also do not adhere to biological rules in their
mechanical robotic designs, often opting to treat the problem as two distinct areas: electronics and mechanics.
This method entails that the solution encoded in the CPU is delivered via electrical pathways to control a body such
that it can perform useful work, without regard to the optimization of the controller, body and environment.
Biological research since the mid 1910s have presented
clear evidence that the neural control of rhythmic movements are attributed to the presence of rhythmic central circuits found in the central nervous system.
These Central Pattern Generators (CPGs) are found to be responsible for a diverse range of biological functions like
respiration in animals, flight motor patterns in locusts and triphasic stomach motor patterns in lobsters. Central
pattern generators are capable of producing rhythmic activity without explicit timing information or sensory
feedback. These autonomous neural circuits form the basic elements in central pattern generating networks,
coordinating their activities to produce motor patterns. Often, such networks are vast, convoluted and complex
structures connected to neuro-modulators and sensory pathways in the body. In this regard, the biological study
of motion generating mechanisms in natural organisms is a slow and difficult endeavor.
Natural organisms embody efficient rules garnered through evolution and natural selection in moving about
their surroundings. Their biomechanical structure coupled with appropriate neural control networks behaves as a
whole, allowing for efficient locomotion in different environment settings. As such, CPG networks are of
paramount interest to roboticists, providing an alternative towards limbed coordination without the use of a central
program. This frees up processing power, reduces cost and response time.
Introduction to Robotics with Revobot
Page 136
6.106.106.106.10 NeuromorphicsNeuromorphicsNeuromorphicsNeuromorphics
Neuromorphic Engineering is a new interdisciplinary discipline that takes inspiration from biology, physics,
mathematics, computer science and engineering to design artificial neural systems, such as vision systems, head-
eye systems, auditory processors, and autonomous robots, whose physical architecture and design principles
are based on those of biological nervous systems. (Source: Wikipedia)
A key aspect of neuromorphic design is to understand
how the morphologymorphologymorphologymorphology of individual neurons, circuits, and overall architectures create desirable computations, affect
how information is represented, influences robustness to damage, incorporates learning and development, and
facilitates evolutionary change. 6.116.116.116.11 BBBBiomorphicsiomorphicsiomorphicsiomorphics
Biomorphic robotics is a sub-discipline of robotics focused
upon emulating the mechanics, sensor systems, computing structures and methodologies used by animals.
In short, it is building robots inspired by the principles of biological systems.
The biomorphic machines (Figure 6.13) do not have any
microprocessors and programming in it. This is not to say the lack of microprocessors makes something biomorphic
– quite the contrary. There is a huge amount of work be done implementing biological nervous and neural
networks into computing devices.
FIGURE 6.13: FOUR LEGGED, 5
DEGREES OF FREEDOM
BIOMORPH FROM FR.
Introduction to Robotics with Revobot
Page 137
Biomorphics use Mark Tilden’s Nervous Neurons - simple relaxation oscillators. The relaxation oscillator is a simple
differentiator and inverter which ‘react’ under excitatory inputs and ‘relaxes’ after prolonged exposure. This is
analogue equivalent of neuronal circuitry observed within centrally controlled vertebrates.
However, biomorphs lack task specific / goal centric
actions as of now. It is like millions of years ago when simple organisms started evolving. It will take time when
biomorphic machines will be able to reach some kind of maturity, bearing in mind that different topologies (wiring
among the actuators and sensors) result in variations in machine behaviours.
The difference between neuromorphics and biomorphics is
believed to be focusing on the control and sensor systems (neuromorphic) vs. the whole system (biomorphic).
6.126.126.126.12 Looking forwardLooking forwardLooking forwardLooking forward
It is anticipated that robots will be utilized in the 21st century for household applications as well. This will pave
the way for advanced robotic technology to dominate in the 21st century. It is expected that the personal robots
will be popular in the coming decades, like personal computers!
Points to ponderPoints to ponderPoints to ponderPoints to ponder: Was Einstein’s brain so different from the rest? There are
several acrobats out there, who have trained themselves to do extra ordinary things – are they very different from
the rest? Aren’t they capable of making use of their senses and body on a better footing than the rest? So what makes a superman?
Introduction to Robotics with Revobot
Page 138
How to incorporate nature into robots at a level useful to the robot? There is a difference between incorporating nature into robots and making robots more natural.
Robots are not nature and never will be. Cyborgs can
mean man-machine interface or man-clone interface. Prosthetics is an example of man-machine interface while
surgical implantation of an artificially grown ear is an example of man-clone interface.
Spectrum of artificiality
Industrial
robots
(Man made
artificiality)
clones
(Biological
artificiality)
cyborgs
(Physical fusion of
nature and artificiality)
more more man made
Neuro/biomorphsNeuro/biomorphsNeuro/biomorphsNeuro/biomorphs
(Morphological fusion of nature and artificiality)
Figure Figure Figure Figure 6.146.146.146.14
Introduction to Robotics with Revobot
Page 139
CHAPTER 7
Mechanical AssemblyMechanical AssemblyMechanical AssemblyMechanical Assembly
7.17.17.17.1 Nuts and BoltsNuts and BoltsNuts and BoltsNuts and Bolts
This chapter outlines how to assemble your Revobot without any error. Once you open the Revobot package,
you may find all Revobot components neatly placed on a robust buffer section 7.2 to will give you a clear idea about the mechanical parts required for assembling the
Revobot. Once you get familiar with all the different Revobot parts, you can start assembling the Revobot as
per the instructions given in section 7.3. Let us start building your first robot with Revobot.
7.27.27.27.2 Mechanical Parts of the RevobotMechanical Parts of the RevobotMechanical Parts of the RevobotMechanical Parts of the Revobot
In the following briefs the mechanical components
involved in the revoboard.
Figure Figure Figure Figure 7777.1.1.1.1
The Revobot The Revobot The Revobot The Revobot
ChassiChassiChassiChassissss
Introduction to Robotics with Revobot
Page 140
Nylon WheelsNylon WheelsNylon WheelsNylon Wheels
Assembly DiagramsAssembly DiagramsAssembly DiagramsAssembly Diagrams This section gives you the systematic assembly diagram
Figure 7.Figure 7.Figure 7.Figure 7.2222 Nylon Wheels and Nylon Wheels and Nylon Wheels and Nylon Wheels and
CastorCastorCastorCastor
Figure 7.Figure 7.Figure 7.Figure 7.3333
Screws Nuts Screws Nuts Screws Nuts Screws Nuts
and Spacesand Spacesand Spacesand Spaces
Introduction to Robotics with Revobot
Page 141
with clear explanation on assembling your Revobot
Step1: Step1: Step1: Step1:
DC motors on the Revobot comes with an inbuilt gearbox and has an external threading that can be used to attach a bolt. We use this design to attach the motors onto the
chassis of the Revobot. Step 2: Step 2: Step 2: Step 2:
Insert the shaft of a motor through the motor slot as
shown in the Chassis. Attach a nut from the other side of
the chassis, tighten it to fit snugly.
Figure 7.4Figure 7.4Figure 7.4Figure 7.4
Figure 7.Figure 7.Figure 7.Figure 7.5555
Introduction to Robotics with Revobot
Page 142
Step 3:Step 3:Step 3:Step 3:
Likewise, attach the second motor.
Step 4:Step 4:Step 4:Step 4:
Your chassis should look like this once you have attached both motors. Please ensure that the nut is sufficiently
tight, so there is no shake in the assembly.
Figure 7.Figure 7.Figure 7.Figure 7.6666
Figure 7.Figure 7.Figure 7.Figure 7.7777
Introduction to Robotics with Revobot
Page 143
StepStepStepStep 5:5:5:5:
Use the castor wheel, three nuts and three bolts to
assemble the castor to the chassis as shown above.
Step 6: Step 6: Step 6: Step 6:
Attach the nuts as shown. Tighten the bolt, so the castor
fits snugly, and does not shake. While handling the chassis, please make sure that undue force is not applied
on the chassis.
Figure 7.Figure 7.Figure 7.Figure 7.8888
Figure 7.Figure 7.Figure 7.Figure 7.9999
Introduction to Robotics with Revobot
Page 144
StepStepStepStep 7:7:7:7:
The assembly should look like the figure above.
StepStepStepStep 8 8 8 8::::
Connect the Wheels as shown in figure above. Do note
that the wheels have to fit snugly to the shaft of the motor.
Figure 7.Figure 7.Figure 7.Figure 7.10101010
Figure 7.11Figure 7.11Figure 7.11Figure 7.11
Introduction to Robotics with Revobot
Page 145
Step Step Step Step 9:9:9:9:
Now, let us assemble the wheels. Please attach the
wheels as shown in the figure above, making sure that undue forces are not applied on the chassis. Hold the
motor while pushing the wheel onto the shaft.
StepStepStepStep 10: 10: 10: 10:
The finished assembly after fixing the wheels will look like the figure above. Make sure that the shaft fits the wheels
snugly, and that the wheels do not have an angular orientation.
Figure 7.12Figure 7.12Figure 7.12Figure 7.12
Figure 7.13Figure 7.13Figure 7.13Figure 7.13
Introduction to Robotics with Revobot
Page 146
StepStepStepStep 11: 11: 11: 11:
Now that your chassis has both wheels and the castor attached, it is time to add the brains to your robot. Do
see that the breadboard on the Controller Board is aligned towards the back of the robot. Use Nuts, Bolts and
Spacers to attach the Controller board as shown above. Do support the nuts under the chassis as you screw the
bolts in place.
StepStepStepStep 12: 12: 12: 12:
The finished assembly should look something like this. We are almost there with the mechanical assembly, and the
Robot is starting to look a little like the finished robot – that’s, good news!
Figure 7.14Figure 7.14Figure 7.14Figure 7.14
Figure 7Figure 7Figure 7Figure 7.15.15.15.15
Introduction to Robotics with Revobot
Page 147
StepStepStepStep 13: 13: 13: 13:
Now we have the muscles and the brains in the robot. We need to attach the ears and eyes. Yes, its time to
assemble the sensors that will help the robot sense its surroundings. We will start by assembling two IR sensors.
IR sensors can help the robot detect an obstacle and do a desired action – for example, avoid it.
Use the IR sensors in the Revobot kit, nut, bot, and a
spacer to assemble them as shown in the figure above. We like to handle sensors with a little bit of care, so they
last longer. Make sure that the nut and not are no tighter that what is required to hold it in place.
StepStepStepStep 14: 14: 14: 14:
Figure 7.16Figure 7.16Figure 7.16Figure 7.16
Figure 7.17Figure 7.17Figure 7.17Figure 7.17
Introduction to Robotics with Revobot
Page 148
The finished assembly will look like the figure above. Congratulations, we are doing great.
StepStepStepStep 15: 15: 15: 15:
Let us give our robot more sensors. To make the robot
follow a black line, for example, we will need sensors pointing down, to see the surface on which it is moving.
Go ahead, and attach two sensors on the wings of the chassis as shown in the figure above. Please note the
alignment of the sensors, and the component sides of the sensors while attaching the sensors. You will need a set of nut and bolt, and spacer for each sensor.
Step Step Step Step 16:16:16:16:
The finished assembly should look like the figure above. Looks great, doesn’t it?
Figure 7.18Figure 7.18Figure 7.18Figure 7.18
Figure 7.19Figure 7.19Figure 7.19Figure 7.19
Introduction to Robotics with Revobot
Page 149
Step 1Step 1Step 1Step 17777::::
Please refer to Step 6 of the electrical assembly chapter to see how to connect the battery case to the Battery holder. Once this is done, the battery holder can be
connected to the chassis as shown above.
StepStepStepStep 11118:8:8:8:
We need calories to keep us going. Robots do too. Instead of food, they use batteries. Here we will be using a set of
8 1.5V dry cells to power our robot. You may also use rechargeable Nickel Metal Hydride (NiMH), or Lithium Ion
(Li-Ion) batteries. They can be recharged thousands of times depending on the manufacturer’s specifications, and
Figure 7.20 Figure 7.20 Figure 7.20 Figure 7.20
Figure 7.21Figure 7.21Figure 7.21Figure 7.21
Introduction to Robotics with Revobot
Page 150
would last a very long time. Dry cells would do just fine, but you will need to replace them when they run out.
In the battery casing provided in the Revobot kit, place
the batteries, and bolt them to the chassis as shown in figure above. Do note that the longer fins on the battery
case align towards the back of the Revobot.
Step Step Step Step 19:19:19:19:
That’s, much better. The Robot has almost all major
components now. In addition, the look is awesome!
Step Step Step Step 20202020::::
Figure 7.22Figure 7.22Figure 7.22Figure 7.22
Figure 7.23Figure 7.23Figure 7.23Figure 7.23
Introduction to Robotics with Revobot
Page 151
Do double check the assembly of the robot to see if all components are assembled properly.
Here is one more view. If all components and faces look
as shown above, we are doing great…
Introduction to Robotics with Revobot
Page 152
CHAPTER 8
Electrical AssemblyElectrical AssemblyElectrical AssemblyElectrical Assembly
8.18.18.18.1 Hooking it UPHooking it UPHooking it UPHooking it UP
This chapter outlines the electrical assembly of the
Revobot, such as how to turn on your Revobot, how to
select the different modes etc.
8.28.28.28.2 How to turn How to turn How to turn How to turn on yoon yoon yoon your Revobotur Revobotur Revobotur Revobot
Do note how Left, Right, Front and Rear are defined for
the Revobot. We will follow this direction for all instructions that follow.
In this chapter, we will learn to turn on and work with the
Revobot. To begin working with the Revobot, we have to first complete assembling it as discussed in the previous
chapter. The next part is to complete the electrical connections as described in the following steps.
The Revobot kit contains 4 main sensor connection wires.
3 of them, shorter in length, are Wire-Type-A as shown in the figure below, and the long one is Wire-Type-B
Introduction to Robotics with Revobot
Page 153
Legend:
1. Black wire or Red wire with black band is usually
used for indicating a “Ground” connection. 2. Orange or Red wire usually indicates +5V
connection. 3. Yellow wire or Red wire with yellow band usually
indicates an “output” connection.
All IR sensors need 3 wires for proper connection. Please ensure that all Ground, +5V and output connections are
proper for each sensor.
Step 1: Step 1: Step 1: Step 1: Connecting the Left Obstacle avoidance Sensor:Connecting the Left Obstacle avoidance Sensor:Connecting the Left Obstacle avoidance Sensor:Connecting the Left Obstacle avoidance Sensor:
Electrical connections have to be handled gently, so
please ensure that you do not use excess force while slotting the wire in.
Wire-Type -A
Wire-Type-B
Introduction to Robotics with Revobot
Page 154
Use one end of a Wire-Type A and connect the +5V (red), Ground (black) and output (yellow) to the IR sensor as
shown in the figure.
Connect the black connector on the other end of the Wire-Type-A onto the ground terminal on Revoboard as shown
below.
Connect the red connector to the +5V terminal as shown below.
Connect the yellow wire-end to the RE2 Pin as shown
below.
Introduction to Robotics with Revobot
Page 155
Step 2: Step 2: Step 2: Step 2: Connecting the Connecting the Connecting the Connecting the RightRightRightRight Obstacle avoidance Sensor: Obstacle avoidance Sensor: Obstacle avoidance Sensor: Obstacle avoidance Sensor:
Use one end of a Wire-Type A and connect the +5V (red),
Ground (black) and output (yellow) to the IR sensor as shown in the figure.
Connect the black connector on the other end of the Wire-
Type-A onto the ground terminal on Revoboard as shown below.
Introduction to Robotics with Revobot
Page 156
Connect the red connector to the +5V terminal as shown
below.
Connect the yellow wire-end to the RE1 Pin as shown below.
Introduction to Robotics with Revobot
Page 157
Step 3: Step 3: Step 3: Step 3: Connecting the Connecting the Connecting the Connecting the LeftLeftLeftLeft LineLineLineLine Sensor: Sensor: Sensor: Sensor:
Note: We will be using the longer Wire-Type-B for this
connection.
Use one end of a Wire-Type B and connect the +5V (red), Ground (black band) and output (yellow band) to the IR
sensor as shown in the figure.
Connect the black-banded connector on the other end of the Wire-Type-B onto the ground terminal on Revoboard
as shown below.
Introduction to Robotics with Revobot
Page 158
Connect the red connector to the +5V terminal as shown below.
Connect the yellow-banded connector at the other end of the Wire-Type-B to the RE0 Pin as shown below.
Step 4: Step 4: Step 4: Step 4: Connecting the Connecting the Connecting the Connecting the RightRightRightRight LineLineLineLine Sensor: Sensor: Sensor: Sensor:
Now, this is a tricky image below. The sensor you see is actually to the right of the castor wheel, taken from below
the robot. The Front of the Revobot lies to the right of the sensor below.
Use one end of a Wire-Type A and connect the +5V (red), Ground (black) and output (yellow) to the IR sensor as
shown in the figure.
Introduction to Robotics with Revobot
Page 159
Connect the black connector on the other end of the Wire-
Type-A onto the ground terminal on Revoboard as shown below.
Connect the red connector to the +5V terminal as shown
below.
Introduction to Robotics with Revobot
Page 160
Connect the yellow connector at the other end of the
Wire-Type-A to the RA5 Pin as shown below.
Step 5: Step 5: Step 5: Step 5: Connecting the Connecting the Connecting the Connecting the MotorsMotorsMotorsMotors::::
Connect the jack at the end of the Right motor wire to the Motor connector pins (M1) on the Revoboard as shown
below. Please note that the jack only aligns in one way on the connector pin.
Introduction to Robotics with Revobot
Page 161
Connect the jack at the end of the Right motor wire to the
Motor connector pins (M2) on the Revoboard as shown below.
Step 6: Step 6: Step 6: Step 6: Connecting the Connecting the Connecting the Connecting the BatteryBatteryBatteryBattery::::
Connect the battery connector heads as shown below to
the battery case. Once connected, insert the battery case into the battery holder as shown below. Note the way the
wings of the battery holder align with the battery case. The longer wings align away from wire connectors. The
battery holder is now ready to be connected to the chassis.
Introduction to Robotics with Revobot
Page 162
Now let insert the power jack into the power socket of the Revobot. To ensure the power jack has properly inserted,
check if the green LED lights up. Now to turn on the Revobot, slide the power switch to the on position. Now to
ensure the proper functioning of the electronic components, please check if the red LED has lit up.
8.3 Tuning the sensor modules
Before we can start working with the Revobot, we have to
tune the sensors. In the following steps we will explain how to tune the sensors for line sensing and obstacle
sensing.
8.3.18.3.18.3.18.3.1 For line sensingFor line sensingFor line sensingFor line sensing
• Firstly, check if the red LED on the sensor lights up on turning on the Revoboard.
• Now hold the sensor above a white surface and check if the yellow LED turns off. If it does not rotate the tuning screw until it just goes off.
• However, we should also ensure that the yellow LED lights up when the sensor is held above a black
surface at the same height.
8.3.28.3.28.3.28.3.2 For obstacle sensingFor obstacle sensingFor obstacle sensingFor obstacle sensing
• Firstly, check if the red LED on the sensor lights up on turning on the Revoboard.
• Now hold the sensor in the front of an obstacle and check if the yellow LED turns off, if it
does not rotate the tuning screw until it just goes off.
• However, we should also ensure that the yellow LED lights up when there is no obstacle in front of the sensor.
Introduction to Robotics with Revobot
Page 163
8.48.48.48.4 Mode SelectionMode SelectionMode SelectionMode Selection
L0L0L0L0 L1L1L1L1 L2L2L2L2 modemodemodemode ModesModesModesModes
offoffoffoff offoffoffoff offoffoffoff 0000
Line FollowingLine FollowingLine FollowingLine Following
offoffoffoff offoffoffoff onononon 1111
Obstacle avoidanceObstacle avoidanceObstacle avoidanceObstacle avoidance
offoffoffoff onononon offoffoffoff 2222
Sumo botSumo botSumo botSumo bot
offoffoffoff onononon onononon 3333
Left wall followingLeft wall followingLeft wall followingLeft wall following
Introduction to Robotics with Revobot
Page 164
Revoboard comes preprogrammed with eight different
modes for implementing different functionalities. Each of
onononon offoffoffoff offoffoffoff 4444
Right wall following Right wall following Right wall following Right wall following
onononon offoffoffoff onononon 5555
Line following Line following Line following Line following with 1 with 1 with 1 with 1 sensorsensorsensorsensor
onononon
onononon
offoffoffoff
6666
Pit avoidancePit avoidancePit avoidancePit avoidance
onononon onononon onononon 7777
Light followingLight followingLight followingLight following
Introduction to Robotics with Revobot
Page 165
the different modes can be selected by setting the mode selection switches in various configurations as explained
in the table below.
8.58.58.58.5 Enable/Disable the motorsEnable/Disable the motorsEnable/Disable the motorsEnable/Disable the motors
The Revoboard has dedicated switches for enabling and disabling of each motor independently.
Figure: Figure: Figure: Figure: DIP switch position when the DIP switch position when the DIP switch position when the DIP switch position when the MotorMotorMotorMotors are s are s are s are disdisdisdisabled abled abled abled Note: while programming motors have to be disabled 8.68.68.68.6 Reset the RevoboardReset the RevoboardReset the RevoboardReset the Revoboard
The Revoboard has a dedicated push button switch to reset the microcontroller. On depressing the reset
pushbutton switch, the microcontroller begins executing the program code from the starting point.
8.78.78.78.7 Turn off the Revoboard Turn off the Revoboard Turn off the Revoboard Turn off the Revoboard
The Revoboard can be turned off by simply sliding the
power switch to the off position as shown below.
ConclusionConclusionConclusionConclusion
Congratulations on setting up the Revoboard.
Introduction to Robotics with Revobot
Page 166
CHAPTER 9
Getting started with RevoGetting started with RevoGetting started with RevoGetting started with Revobotbotbotbot
9.19.19.19.1 Getting StartGetting StartGetting StartGetting Start
Revobot educational kit provides an inexpensive yet high
quality robotic platform to students, professionals and hobbyists. Revobot would facilitate to attain skills in microcontroller programming and debugging in the real
world. They will also be able to use this platform to educate others. Revobot is designed as practical and
realistic platform for students and hobbyists to appreciate robotics in a fun and interactive way.
The Revobot is built on a high-quality aluminum chassis
that provides a sturdy platform for the DC motors and printed circuit board. Mounting holes and slots may be
used to add custom robotic components like IR sensors, wheels etc. The programming board & PIC - 18F4550
may be removed to be used as your platform for other projects. The robot may be programmed to follow a line,
follow light, or roam autonomously. Once you have mastered the basics, you can keep experimenting and
expanding your Revobot robot's capabilities. Revobot educational kit exposes students to many facets
of microcontroller programming,microcontroller programming,microcontroller programming,microcontroller programming, along with the excitement of Robotics the students can exercise their
intelligence on actual hardwareactual hardwareactual hardwareactual hardware and see results, which can be exhilarating. The Revobot educational kit contains the
USB 2.0 compliantUSB 2.0 compliantUSB 2.0 compliantUSB 2.0 compliant PIC 18F4550 microcontroller; motors , sensors, wheels, breadboard, battery, wires, user manual
that would even teach a fifteen year old how to build and program their robot in less than 50 hours.
Armed with the knowledge gained from the articles and a
bit of creativity, you can have a lot of fun customizing the Revobot to suit your own need, making yourself a robot
that no one else have.
Introduction to Robotics with Revobot
Page 167
Features and CapabilitiesFeatures and CapabilitiesFeatures and CapabilitiesFeatures and Capabilities Revobot is a Differential Wheeled DriveDifferential Wheeled DriveDifferential Wheeled DriveDifferential Wheeled Drive robot that is capable of doing autonomous tasks like: • Obstacle Detection & Avoidance
• Line following Capability • Wall following Capability
• Pit detection Capability • Light following Capability
The user can select each of these modes by using the
mode selection switch. (Refer chapter 5 for more details on mode selection). Revobot make use of wheeled
locomotion to navigate on planar surface. It make used of differential steering as it is easy to implement, simple to
control and has the ability to change orientation on the spot.
The below sections will explain the features in details.
9.29.29.29.2 Obstacle Detection and AvoidanceObstacle Detection and AvoidanceObstacle Detection and AvoidanceObstacle Detection and Avoidance
Obstacle detection is achieved by using Infra Red (IR)
transmitters and receiver. The IR sensors are assembled on a separate Printed Circuit Board (PCB), which is
mounted on the front of the chassis as shown in Figure 9.1.
The working of the Revobot is as follows. At first, the
Revobot will move in the forward direction. At the same time it will scan for the presence of obstacle on its path
with the help of IR sensors i.e. IR LED on each of the sensor modules will keep on sending 38KHz modulated
Figure 9.1Figure 9.1Figure 9.1Figure 9.1
Introduction to Robotics with Revobot
Page 168
infra red rays and the IR receiver-TSOP 1738- present in corresponding module will detect the 38KHz signals once
it is reflected back from the obstacle and changes its output.
In the absence of obstacle the output of the receiver,
which is connected to the input pin of the microcontroller will be in logic high state. When the IR rays reflected from
the obstacle falls on the detector, the detector output changes to logic zero state. The microcontroller detects
this difference and the controller then gives the necessary control signals to the motors accordingly. If an obstacle is
detected in the left side, then the Revobot takes a right turn until it finds no obstacle in its path. Similarly, if the
right sensor detects an obstacle, the Revobot takes a left turn till it finds no obstacle in its path. If both sensors are
detect the obstacles then the Revobot will move backwards for a small amount of time until the left sensor avoids the obstacle and then turn to right to check for the
path and then moves forward and continues the process. Figure 9.2 shows the pictorial representation of the
trajectory followed by the Revobot while doing obstacle detection and avoidance.
Figure 9.2Figure 9.2Figure 9.2Figure 9.2
Introduction to Robotics with Revobot
Page 169
The forward motion is achieved by driving both the dc motors in the forward direction, reverse motion is
achieved by driving both the motors in the reverse direction. Right turn is achieved by driving the right motor
in reverse direction and left motor in forward direction. Similarly, left turn is achieved by driving the left motor in
Figure 9.3Figure 9.3Figure 9.3Figure 9.3
Introduction to Robotics with Revobot
Page 170
the reverse direction and right motor in the forward direction. Figure briefs the logic steps involved in obstacle
detection and avoidance process.
9.39.39.39.3 Line FollowerLine FollowerLine FollowerLine Follower The Revobot relies on two Infrared (IR) sensors, which are mounted on the bottom of the chassis to detect the
position of the black line on the course. The mounting of the IR sensor modules is shown in figure:
The width of the black track must be less than the
distance between IR sensors, so that both the IR emitters
will be facing towards the white surface. While the Revobot moves along the path, the IR Emitter emit light
beam towards the surface of the course and the IR Detector will detect the reflected infrared light beam.
Hence, both receiver outputs, which are connected to the input of PIC microcontroller, will be in logic zero and the
controller drives both the motors in the forward direction. When any of the IR emitter comes above the black track, the black surface absorbs the IR rays and hence no light
beams get reflected back to the receiver. In the absence of IR signal, the receiver output changes to logic high
state and the microcontroller sends the control signals to the motors based on these signal and the Revobot aligns
properly into the black track by turning accordingly. This scanning and aligning is done in a specific interval.
Because of this, the Revobot keep on following the black track.
Figure 9.4Figure 9.4Figure 9.4Figure 9.4
Revobot Revobot Revobot Revobot
configured for configured for configured for configured for
line followingline followingline followingline following
Introduction to Robotics with Revobot
Page 171
When both sensors receive reflected IR signal then the Revobot moves forward. This is achieved by driving both
the motors in the forward direction. When right sensor detects the absence of reflected IR beam, the Revobot
takes a right turn by reducing the right motor speed and keeping the left motor speed constant.
When left detector detects the absence of IR beam, the
Revobot takes a left turn by reducing the left motor speed and keeping right motor speed constant. This way the
Revobot aligns itself in the black trajectory and continues following the path. Figure 9.6 briefs the logic steps
involved in line following process.
Figure 9.5 Figure 9.5 Figure 9.5 Figure 9.5 Revobot performing Line followingRevobot performing Line followingRevobot performing Line followingRevobot performing Line following
Introduction to Robotics with Revobot
Page 172
Figure 9.6Figure 9.6Figure 9.6Figure 9.6 Flowchart for Line Follower Flowchart for Line Follower Flowchart for Line Follower Flowchart for Line Follower
Introduction to Robotics with Revobot
Page 173
9.49.49.49.4 Wall FollowerWall FollowerWall FollowerWall Follower In Wall following mode ((See chapter 10 for more details on selecting the already programmed modes), the Revobot will
move along the length of a wall. Before we can use Revobot as a wall follower, the sensors range should be set as
described in the program. The wall following mode works using two IR sensors. One of the sensors is pointed towards the wall so that when it detects the wall it moves away from
it and when it does not detect the wall, it moves towards it. The other sensor faces towards the front and is used to
avoid obstacles while performing wall following. This sensor also helps in navigating 90-degree bends in the wall. Figure 9.7 Shows how the Revobot performs wall following.
Hence, the revobot moves parallel to the wall maintaining a constant distance from it. The Figure 9.8 Shows algorithm
wall follower.
Figure 9.7 Figure 9.7 Figure 9.7 Figure 9.7 Revobot following a wallRevobot following a wallRevobot following a wallRevobot following a wall
Introduction to Robotics with Revobot
Page 174
9.59.59.59.5 Pit Pit Pit Pit avoidanceavoidanceavoidanceavoidance
In Revobot Pit detection is achieved by modifying the logic of line following. Here we make use of the two IR
If Sensor pointing
towardws wall detects
Wall ?
If Sensor pointing
towardws wall detects
no Wall ?
If Sensor pointing front
Doesn’t detect obstacle
?
If Sensor pointing front
detects obstacle ?
Turn
away
from
Move towards the
Wall
Do nothing
Turn sharply
Start
A
A
B
B
No
No
No
No
Yes
Yes
Yes
Yes
Figure 9.8 Figure 9.8 Figure 9.8 Figure 9.8 Flowchart for wall follower.Flowchart for wall follower.Flowchart for wall follower.Flowchart for wall follower.
Introduction to Robotics with Revobot
Page 175
sensors kept under the chassis. The IR emitter present in the sensor module keep on emitting 38KHz modulated IR
signal, so long as the reflected beam, from the surface where the Revobot is traveling, falls on the IR detector
the Revobot continues its motion. Whenever a pit comes on its way, the emitted IR rays never are reflected back
to the IR detector. Then the IR detector output changes and microcontroller gives the control signal to the motor
according to this.
When the Revobot detects a pit, it moves back to the
reverse direction, takes a turn and continues to move in the forward direction. The logic involved in Pit detection is
shown in Figure 9.10.
Figure 9.9 Figure 9.9 Figure 9.9 Figure 9.9 Pit avoidancePit avoidancePit avoidancePit avoidance
Introduction to Robotics with Revobot
Page 176
Figure 9.Figure 9.Figure 9.Figure 9.10 Flowchart for pit detection and 10 Flowchart for pit detection and 10 Flowchart for pit detection and 10 Flowchart for pit detection and avoidance.avoidance.avoidance.avoidance.
Introduction to Robotics with Revobot
Page 177
9.69.69.69.6 Light FollowerLight FollowerLight FollowerLight Follower When you operate the Revobot in Light Following mode (See chapter 10 for more details on selecting the already
programmed modes), the Revobot will follow a light beam. However, this time the user has to do some hands
on work for achieving this.
The Light follower makes use of Light Dependent Resister
(LDR). For example, the user can keep two LDR circuits for detecting light coming from front, right and left sides.
LDR has a property of varying its resistance according to the intensity of the light falling on it. So if we connect the
LDR circuit as shown in Figure 9.11 to the power supply, the output voltage (Vout) of the circuit will vary according
to the amount of light falling on the LDR.
Figure 9.Figure 9.Figure 9.Figure 9.11 LDR circuit11 LDR circuit11 LDR circuit11 LDR circuit
FigFigFigFigure 9.ure 9.ure 9.ure 9.12 Reference Voltage12 Reference Voltage12 Reference Voltage12 Reference Voltage
Introduction to Robotics with Revobot
Page 178
Vout must be connected to one of the analog input pins of the microcontroller, say RB0. Hence, the voltage coming
to pin RB0 will vary according to light falling on the LDR. Now the microcontroller can control the motor, upon
comparing the Vout connected to RB0 with a constant threshold voltage (which can be adjusted to detect the
light to be followed) arriving on another analog pin, say RB1. This way the user can assemble two circuits one for
another LDR and one for its threshold setting, which have to be connected to RB2 and RB3 respectively. The logic
steps involved in light following is shown in Figure 9.13.
Introduction to Robotics with Revobot
Page 179
Figure:Figure:Figure:Figure:9.9.9.9.13 Flowchart for light follower.13 Flowchart for light follower.13 Flowchart for light follower.13 Flowchart for light follower.
Introduction to Robotics with Revobot
Page 180
9.6.19.6.19.6.19.6.1 LDR Circuit Assembly LDR Circuit Assembly LDR Circuit Assembly LDR Circuit Assembly on the breadboardon the breadboardon the breadboardon the breadboard
The following section describes how to assemble the LDR circuit on your Revoboard.
Step 1Step 1Step 1Step 1 : : : : Place Place Place Place a 150 K a 150 K a 150 K a 150 K Ω resistor.Ω resistor.Ω resistor.Ω resistor.
Step Step Step Step 2 :2 :2 :2 : Place Place Place Place the second 150 the second 150 the second 150 the second 150 K K K K Ω resistorΩ resistorΩ resistorΩ resistor
Introduction to Robotics with Revobot
Page 181
Step Step Step Step 3 :3 :3 :3 : CoCoCoConnect the two points with a Vcc wire.nnect the two points with a Vcc wire.nnect the two points with a Vcc wire.nnect the two points with a Vcc wire.
Step Step Step Step 4 :4 :4 :4 : place another Vcc wire to connect to +5volt place another Vcc wire to connect to +5volt place another Vcc wire to connect to +5volt place another Vcc wire to connect to +5volt
Introduction to Robotics with Revobot
Page 182
Step Step Step Step 5 :5 :5 :5 : place a ground wire to connect to gnd terminal. place a ground wire to connect to gnd terminal. place a ground wire to connect to gnd terminal. place a ground wire to connect to gnd terminal.
Step Step Step Step 6 :6 :6 :6 : place another ground wire to connect the two place another ground wire to connect the two place another ground wire to connect the two place another ground wire to connect the two
popopopoints.ints.ints.ints.
Introduction to Robotics with Revobot
Page 183
Step Step Step Step 7:7:7:7: Place a potentiometerPlace a potentiometerPlace a potentiometerPlace a potentiometer
Step Step Step Step 8:8:8:8: place the second potentiometer. place the second potentiometer. place the second potentiometer. place the second potentiometer.
Step Step Step Step 9:9:9:9: place an output wire connecting the resistor to RB place an output wire connecting the resistor to RB place an output wire connecting the resistor to RB place an output wire connecting the resistor to RB
0 pin0 pin0 pin0 pin
Introduction to Robotics with Revobot
Page 184
Step Step Step Step 10:10:10:10: place an output wire connectinplace an output wire connectinplace an output wire connectinplace an output wire connecting the g the g the g the potentiometer to RB 1 pinpotentiometer to RB 1 pinpotentiometer to RB 1 pinpotentiometer to RB 1 pin
Step Step Step Step 11:11:11:11: place an output wire connecting the resistor to place an output wire connecting the resistor to place an output wire connecting the resistor to place an output wire connecting the resistor to
RB 2 pinRB 2 pinRB 2 pinRB 2 pin
Introduction to Robotics with Revobot
Page 185
Step Step Step Step 12:12:12:12: PPPPlace an output wire connecting the lace an output wire connecting the lace an output wire connecting the lace an output wire connecting the potentiometer to RB 3 pinpotentiometer to RB 3 pinpotentiometer to RB 3 pinpotentiometer to RB 3 pin
Step Step Step Step 13:13:13:13: place the left LDR .place the left LDR .place the left LDR .place the left LDR .
Step Step Step Step 14:14:14:14: place the right LDR .place the right LDR .place the right LDR .place the right LDR .
Introduction to Robotics with Revobot
Page 186
Step Step Step Step 11115555:::: Take both the LDRs to the front while Take both the LDRs to the front while Take both the LDRs to the front while Take both the LDRs to the front while maintaining connection on the breadboard as shown maintaining connection on the breadboard as shown maintaining connection on the breadboard as shown maintaining connection on the breadboard as shown
belowbelowbelowbelow
Figure 9.Figure 9.Figure 9.Figure 9.14141414
Revobot Revobot Revobot Revobot
following lightfollowing lightfollowing lightfollowing light
Introduction to Robotics with Revobot
Page 187
9.7 Revobot Projects
Besides the specific capabilities explained in the above sections, the Revobot can be programmed to perform
interesting games similar to Sumo Wrestling, Robo-Race, Mine Detector, Fire Extinguisher etc.
9.7.19.7.19.7.19.7.1 SumobotSumobotSumobotSumobot
This is a very interesting game for robotics enthusiasts. It
is similar to human sumo wrestling, in which two robots are used instead of sumo wrestlers in real life. In sumo
robotics, two robots of same class are required. Each of these competes against the other, on a white platform bounded by a black circular ring. Here the robots should
try to push its opponent outside the black ring. To perform this task, at first the user has to set the mode
selection switch as per chapter10.
For Sumo robotics we need to activate all four sensors. Among this, the two sensor modules mounted on top of
the chassis is used for detecting the opponent. Once the Revobot finds the opponent then it will try to push the
opponent out of the ring after following it. If the opponent is not in the vicinity then the Revobot, will continue
moving in random fashion till it finds it’s the opponent. If the Revobot drifts towards the edge of the ring, the two
sensor modules, placed on the bottom of the chassis detect the edge of the ring (black surface) and prevents going outside the ring. Figure: 9.15 shows two Revobots
playing Sumo Robotic game.
Figure 9.15 Figure 9.15 Figure 9.15 Figure 9.15 Revobots playing Sumo Robotic Revobots playing Sumo Robotic Revobots playing Sumo Robotic Revobots playing Sumo Robotic Game.Game.Game.Game.
Introduction to Robotics with Revobot
Page 188
9.7.29.7.29.7.29.7.2 RoboRoboRoboRobo----RaceRaceRaceRace
Robo race is a very interesting game. It is is similar to a
grand prix in which all the competing line following robots start in staggered fashion, but if the robot which starts
behind is faster than the one in front then it overtakes the slower robot and comes in front and comes back on track
after overtaking.
9.7.39.7.39.7.39.7.3 Mine hunterMine hunterMine hunterMine hunter
Mine hunter is a game based on mine detection, but instead of mines the contest uses metallic coins. The
arena consists of a grid of white lines on a black surface with a square sand pit at every intersection. The sand pits
may or may not contain a coin buried below the sand. The task of the competing robots is to follow the lines and detect the most number of mines in the stipulated time.
9.7.49.7.49.7.49.7.4 Fire ExtinguisherFire ExtinguisherFire ExtinguisherFire Extinguisher
Fire extinguisher is a game based on fire fighting. The
arena for this game consists of a maze. Somewhere within the maze, a candle is placed. The task of the robot
is to autonomously detect the candle using obstacle sensors or light sensors or temperature sensors or a
combination of sensors and put out the flame.
Introduction to Robotics with Revobot
Page 189
CHAPTER 10
Exploring the Revoboard and the Sensor Exploring the Revoboard and the Sensor Exploring the Revoboard and the Sensor Exploring the Revoboard and the Sensor
ModuleModuleModuleModule
10.110.110.110.1 RevoboardRevoboardRevoboardRevoboard
The Revoboard is a versatile board, which is ideal for
projects in robotics and embedded systems. The Revobot facilitates attaining advanced skills in embedded programming and educational research projects. The
Revoboard has been designed in a fashion that enables users to customize it according to their requirements. The
main features of the Revoboard include- 32kb flash memory
On board voltage regulator which can take an input
voltage from 7-18v
Independent switches to enable and disable motors Dedicated switches for mode selection
On board USB 2.0 driver dedicated for USB programming
Compatible with other microcontrollers that have pin layouts identical to PIC18F4550
Breadboard for custom circuit designing and testing
10.210.210.210.2 Microcontroller Microcontroller Microcontroller Microcontroller
The heart of the Revoboard is a PIC 18F4550 microcontroller. This is an industrial grade microcontroller
manufactured by Microchip technologies Inc. The PIC 18F4550 microcontroller has been specifically designed
for embedded C programming. The PIC 18F4550 microcontroller also has an integrated full speed USB 2.0
transreceiver, which has been configured for high speed USB programming of the Revoboard.
10.310.310.310.3 Motor and Motor Driver Motor and Motor Driver Motor and Motor Driver Motor and Motor Driver
The Revobot comes with two geared dc motors of 500 rpm. The motors have helical gears for higher efficiency
Introduction to Robotics with Revobot
Page 190
and lower noise. A single L293D motor driver IC drives the motors. The motor driver IC has a current rating of up
to 600mA per channel. The purpose of the motor driver IC is to convert the five or 0-volt signal generated by the
microcontroller to a level of 12 or 0 volt so that it can power the motor. Had the motors been directly connected
to the microcontroller, the voltage and current produce by it will be very low to dive the motor.
10.410.410.410.4 Mode selectionMode selectionMode selectionMode selection
The Revoboard has mode selection functionality inbuilt into the system. The mode selection system enables one to program the board with multiple functions for the
Revoboard and switch between them by configuring the mode selection switches, L0, L1, and L2. The Revobot
comes preprogrammed with eight different modes, which can be selected by configuring the mode selection
switches as shown in the table below.
10.510.510.510.5 Buzzer Buzzer Buzzer Buzzer
The Revoboard has an on board buzzer which is driven by a darligton* pair. When a voltage of 5 volts, 25mA is
given at the base terminal using the microcontroller, the darligton pair amplifies the current to drive the buzzer
making it sound. This buzzer can be used to sound an alarm for a particular purpose or during debugging of program code.
*Darlington pair is a configuration in which transistors are connected in a particular fashion as shown below to create a current gain in the system. A darlington pair takes very little input current and generates high output current.
Figure 10.Figure 10.Figure 10.Figure 10.1111
Introduction to Robotics with Revobot
Page 191
Figure 10.2 shows the complete Revoboard with all the
components
10.610.610.610.6 IR sensor moduleIR sensor moduleIR sensor moduleIR sensor module The Revobot comes with four IR sensors. These sensors
can be configured as line sensors or obstacle sensors. The sensors have a tuning screw to vary the range of sensing.
The sensors require a 5-volt supply voltage and can generate digital output of 5 or 0 volts when functioning
properly. The sensor module consists of the following components. Figure 10.3 shows the completely assembled
IR Sensor module. Each Revobot educational kit contains four pieces of sensor modules, which can be used to
implement the different features, such as line following, obstacle detection, etc.
Figure 10.2 Figure 10.2 Figure 10.2 Figure 10.2 Completely assembled RevoboardCompletely assembled RevoboardCompletely assembled RevoboardCompletely assembled Revoboard
Introduction to Robotics with Revobot
Page 192
10.6.110.6.110.6.110.6.1 TimerTimerTimerTimer
The sensor module comprises of a 555 timer IC that creates a square wave of 38 kHz and 50% duty cycle.
This is essential for the modulating the IR rays emitted by the IR LED. Hence, the IR led is powered by the square
wave generated by the 555 timer IC.
10.6.210.6.210.6.210.6.2 IR transmitterIR transmitterIR transmitterIR transmitter
The transmitter section of the sensor board comprises of an IR LED. This LED in conjunction with the 555 timer IC
generates a pulsating IR beam of 38 kHz. The sensor module can sense an obstacle or white surface by
detecting if the pulsating IR rays emitted by the IR LED are reflected back into the IR receiver.
10.6.310.6.310.6.310.6.3 IR receiverIR receiverIR receiverIR receiver
The receiver section of the sensor module consists of a TSOP 1738. The TSOP 1738 is an integrated module,
which can detect the presence of pulsating IR rays of 38 kHz only. Hence, this module is used to detect the
reflected IR beam emitted by the transmitter. Since the
Figure 10.3 Figure 10.3 Figure 10.3 Figure 10.3 Completely assembled IR Sensor module.Completely assembled IR Sensor module.Completely assembled IR Sensor module.Completely assembled IR Sensor module.
Introduction to Robotics with Revobot
Page 193
TSOP module only responds to pulsating IR rays of 38 kHz, it will not be confused by the presence of stray IR
rays present in the environment.
10.710.710.710.7 Power SupplyPower SupplyPower SupplyPower Supply
The Revobot consist of an 8* 1.5 V AA cell bundle. This pack can provide a supply voltage of 12 volts for the
Revobot. This battery pack can be easily mounted on the underbody of the chassis. The 7805 voltage regulator
onboard the Revoboard takes the 12volt as input and generates a regulated 5-volt supply required for the
electronic components onboard o Revoboard. The Revoboard can also be powered by drawing power from
the USB port during programming and testing of sensor modules. However, this is not suitable for driving the
motors. To power the Revoboard the jumper should be inserted as shown below.
Introduction to Robotics with Revobot
Page 194
PART III
PROGRAMMING
GUIDE
Introduction to Robotics with Revobot
Page 195
CHAPTER 11
IntroductionIntroductionIntroductionIntroduction
This is a systematic guide to loading the first program into the Revobot. The required software and hardware
tools are available in the kit. Software tools are provided along with this CD.
Preconditions for Revoboard programming
a) The Revoboard (Programming board) with PIC18F4550
b) A DC power supply (ideally 9V-12V) (In this case the supplied batteries)
c) USB cable d) Development tools:
o MPLAB IDE (Its freely available on Microchip’s
website) o C18 C Compiler (A free student’s version is
available on the Microchip’s website). The user can also choose to code in assembly or
use other commercially available compilers. o Microchip MCHPFSUSB v1.3 (Its freely
available on Microchip’s website)
11.111.111.111.1 Installation Procedure:Installation Procedure:Installation Procedure:Installation Procedure:
Now install all the above development tools on the PC and
get started.
a. First install MPLAB b. Then install C-18 tool suite. Check all the check
boxes during installation c. Finally install MCHPFSUSB v1.3
o Copy the file revobot.c from the CD-ROM and copy it at the location where the project has
to be saved or create a new C file at the same location.
o Copy the file revobot.h from the CD-ROM and
copy it at the location C:\MCC18\h\
Introduction to Robotics with Revobot
Page 196
o Copy the file named rm18f4550.lkr from C:\MCHPFSUSB\fw\Demo02\ and paste it at
the location C:\MCC18\lkr\
Introduction to Robotics with Revobot
Page 197
CHAPTER 12
Creating the workspace
12.112.112.112.1 MPLABMPLABMPLABMPLAB
MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the development of embedded applications employing Microchip's PIC® and dsPIC®
microcontrollers. To create any project we have to create a corresponding workspace. A workspace links up all the
associated files required for creating and debugging a project that has embedded software aspects. One can
create assembly language programs for Microchip's PIC® and dsPIC® microcontrollers using MPLAB. To create C
programs for the same task one has to use the C-18 tool suite along with MPLAB. Now let us see how to create a workspace in MPLAB.
Creating a Workspace in MPLABCreating a Workspace in MPLABCreating a Workspace in MPLABCreating a Workspace in MPLAB
1. Open MPLAB
2. Go to Project >> Project Wizard
3. Click on Next>>
Introduction to Robotics with Revobot
Page 198
4. Select 18F4550 from the drop down menu.
Introduction to Robotics with Revobot
Page 199
5. Press Next>>
6. Select the C18 C Compiler Tool Suite from the Active Toolsuite drop down list and click “Next >”
button
Introduction to Robotics with Revobot
Page 200
7. Give the project name and the location to save using the browse button (the same location as
revobot.c).
a. Select C: drive
Introduction to Robotics with Revobot
Page 201
b. Select Revobot folder
c. Type the project name and press Save button
Introduction to Robotics with Revobot
Page 202
d. Select “Next >” button
8. Add files : a. Select the C drive
Introduction to Robotics with Revobot
Page 203
9. Select the Revobot.C file from the Revobot Folder. If the C file with the program code has already been
created, add that C file (Instead of Revobot.c) to the workspace. For eg: Consider the file name is
Line_follower.c, Add Line_follower.c to the workspace as shown in the following screenshot. After selecting
the C file, Click the “Add >>” button to continue with next step.
10. Similarly add the following files to the workspace
a. C:\MCC18\h\Revobot.h b. C:\MCC18\lkr\rm18f4550.lkr
After adding the above files to the workspace click
on “Next >” Button
11. Finish.
Introduction to Robotics with Revobot
Page 204
12. Now close the workspace and open it from the location where it was saved.
13. Following are the necessary steps to add any
additional files a. Select the View->Project Option
Introduction to Robotics with Revobot
Page 205
b. Right click on the folder to which the files have to be added, and then select add files from the
pop up menu. (See the following Screenshot)
c. Select the file to be added to the workspace and click the “Open” button
Introduction to Robotics with Revobot
Page 206
d. The selected file will be shown on the workspace
14. The desired source file(C file) can be updated by double clicking on the file (with the extension of “.c”)
from the “Source Files” folder on the workspace. A new window will be opened with the contents of the
selected source file.
Introduction to Robotics with Revobot
Page 207
15. On clicking the “Build All” button MPLAB will generate the output file with the extension of “.hex” at
the project folder.
This hex file can be loaded in to the microcontroller as described in the section below.
12.212.212.212.2 USB Bootloading:USB Bootloading:USB Bootloading:USB Bootloading:
The PIC 18F4550 microcontroller that comes along with the Revoboard is pre-programmed with a bootloader program, which is essential for USB bootloading of
program code into the microcontroller’s flash memory. This bootloader code is available in hex form at
C:\MCHPFSUSB\fw\_factory_hex\picdemfsusb.hex
During bootloading, the Revoboard utilizes the
PIC18F4550's inbuilt full speed USB transceiver to load the compiled program code
Sample Program
Introduction to Robotics with Revobot
Page 208
Here is a sample program to activate the buzzer on the board. This code should be pasted in revobot.c.
(Similarly, any program can be created by editing revobot.c or a new C file has to be created and added as
a source file) #include<stdlib.h>
#include<p18f4550.h>
#include<delays.h>
//---------------------------------------------------------------------
//NOTE: This section is required to change the interrupt vector //to
a new point so as to //prevent the bootloader from being
//overwritten. This section should be included in every //program
code
//---------------------------------------------------------------------
#pragma udata
extern void _startup (void);
#pragma code _RESET_INTERRUPT_VECTOR = 0x000800
void _reset (void)
_asm goto _startup _endasm
#pragma code
#pragma code _HIGH_INTERRUPT_VECTOR = 0x000808
void _high_ISR (void)
;
#pragma code _LOW_INTERRUPT_VECTOR = 0x000818
void _low_ISR (void)
#pragma code
//---------------------------------------------------------------------
//The required program code corresponding functionality is to //
be entered below this point
//---------------------------------------------------------------------
//The following code implements the functionality of sounding
//the buzzer
void main(void)
TRISA=0;
PORTAbits.RA3=1; //Turn on the buzzer
Introduction to Robotics with Revobot
Page 209
CHAPTER 13
How to load a Program in to Revobot
13.113.113.113.1 Programming RevobotProgramming RevobotProgramming RevobotProgramming Revobot
A microcontroller in general has no intelligence of its own. Hence, we have to program the microcontroller to instruct
it, what task it has to perform. In simpler terms, we embed the microcontroller with intelligence. To do this we
have to write a program in C programming language with the required sequence of instructions that we want the
microcontroller to perform. When the microcontroller is used in a system like the Revobot, these instructions will
relate to actions performed by the Revobot. Now this C program is converted into binary language so that the
microcontroller can understand it. The program in binary language is represented as a hex file and this hex file has to be loaded into the microcontroller. This chapter
explains how a program can be loaded in to the microcontroller.
NOTE: You don’t need to supply power to the board; it will draw
power from the USB port
Precondition to load the program to micro controller
a. Connect the Revoboard to the USB port of the PC/LAPTOP.
b. Open PICDEMFS USB Tool (See the following Screenshot)
Introduction to Robotics with Revobot
Page 210
c. On the Revoboard hold down the BLD SWITCH,
push and release the RESET SWITCH once and then release the BLD switch. The board has now
entered the Bootload Mode.
NOTE: NOTE: NOTE: NOTE: Step “d” needs to be performed only the
first time the Revoboard is connected to the
PC/laptop
d. Windows will start detecting a new USB
unknown device.
13.213.213.213.2 Installing the PIC UInstalling the PIC UInstalling the PIC UInstalling the PIC USB driverSB driverSB driverSB driver ::::
After performing the step a, step b, step c, the Windows Operating System will pop up a window with the caption
of “Found New Hardware Wizard”. Then select the option “Install from a list of specific location (Advanced)” from
the window (See the following screenshot). Then select the next button to continue with the next step.
Introduction to Robotics with Revobot
Page 211
Select the option “Search for the best driver in these locations.” Then Select the driver path as “C:\MCHPFSUSB\Pc\MCHPUSB Driver\Release” using browse button (As shown in the following screen shot.) Then click on “Next >” button to continue to install the driver.
i. Then the Operating system will search
the best driver for the connected hardware. After finding the driver, the
Operating system will display a new window with the information
“completing the found new hardware wizard” like the following screenshot
Introduction to Robotics with Revobot
Page 212
13.313.313.313.3 Loading a new program via the USB BootloaderLoading a new program via the USB BootloaderLoading a new program via the USB BootloaderLoading a new program via the USB Bootloader::::
13.3.1 In the drop down menu select “PICDEM FS USB 0 (Boot)”
REFERENCE ADVANCED USERS:
We need to consider a few things before we can utilize
the USB bootloading facility.
We need to change the interrupt vectors of the PIC because
the default vectors are overtaken by the USB bootloader
program that now resides on the PIC (The code
corresponding to this action can be observed in the sample
code given above.)
We need to include a different Linker file (rm18f4550.lkr)
which can be located at the following destination:
C:\MCHPFSUSB\fw\Demo02\rm18f4550.lkr
Finally, we cannot assign the configuration bits as the
bootloading program already sets them.
Introduction to Robotics with Revobot
Page 213
13.3.2 Click on load hex file. Select the output hex file from location where the project was saved
Introduction to Robotics with Revobot
Page 214
13.3.3 Browse to locate the hex file. It will be present at the location where the workspace was
created.
13.3.4 Click on program device. When the screen
shows programming completed press reset on the Revoboard. Then remove the USB cable from the
board.
Congratulations! Your Revobot has been programmed with the required code
Introduction to Robotics with Revobot
Page 215
CHAPTER 14
How to write a C programming in MPLAB
using C-18
14.114.114.114.1 First ProgramFirst ProgramFirst ProgramFirst Program
C is a general-purpose, cross-platform, block
structured, procedural, imperative computer programming language developed in 1972 by Dennis
Ritchie at the Bell Telephone Laboratories. The language was initially designed to be used with the UNIX operating
system. Although C was created for implementing system software, it is also widely used for developing embedded
programs due to the large number of C compilers available. C has greatly influenced many other popular
programming languages, most notably C++, which originally began as an extension to C.
Probably the best way to start learning a programming language is by writing a program. Therefore, let us start
with a simple program:
Probably the best way to start learning a programming language is by writing a program. Therefore, let us start
with a simple program: 1. #include<revobot.h>
2. //-----------------------------------------------------
3. /*NOTE: This section is required to change the interrupt
vector to a new point. So as to prevent the bootloader from being
overwritten. This section should be included in every program
code */
4. //-----------------------------------------------------
5. #pragma udata
6. extern void _startup (void);
7. #pragma code _RESET_INTERRUPT_VECTOR = 0x000800
8. void _reset (void)
9.
10. _asm goto _startup _endasm
11.
12. #pragma code
13. #pragma code _HIGH_INTERRUPT_VECTOR = 0x000808
14. void _high_ISR (void)
15.
16. ;
17.
Introduction to Robotics with Revobot
Page 216
18. #pragma code _LOW_INTERRUPT_VECTOR = 0x000818
19. void _low_ISR (void)
20.
21.
22. #pragma code
23. //-----------------------------------------------------
24. /*The required program code corresponding
functionality is to be entered below this point*/
//-----------------------------------------------------
25. /*The following code implements the
functionality of sounding the buzzer*/
26. void main(void)
27.
28. TRISA=0b11110111;
29. initialize();
30. //Turn on the buzzer
31. PORTAbits.RA3=1;
32.
Lines 1, beginning with a hash sign (#) are directives for
the preprocessor. They are not regular code lines with expressions but indications for the compiler's preprocessor. In this case the directive #include <revobot.h>
tells the preprocessor to include the revobot.h standard file. This specific file (revobot.h) includes the declarations,
definitions and it is included because its functionality is going to be used later in the program
Line 2 to 4 is a comment line. All lines beginning with two slash signs (//) or between (/*) and (*/) are considered as
comments and do not have any effect on the behavior of the program. The programmer can use them to include short explanations or observations within the source code
itself. In this case, the line is a brief description of requirement of certain code lines.
Line 5 to 22 is required to change the interrupt vector to
a new point to prevent the bootloader from being overwritten each time a new program code is loaded into
the microcontroller. This section should be included in every program code for the above purpose. Amongst
these, all line beginning with hash sign (#) are also directive for the compiler’s preprocessor.
Line 26 to 32 is where the programming logic that has to
be implemented. These lines correspond to the definition of the main function. The main function is the point by
Introduction to Robotics with Revobot
Page 217
where all C programs start their execution, independently of its location within the source code. It does not matter
whether there are other functions with other names defined before or after it - the instructions contained
within this function's definition will always be the first ones to be executed in any C program. For that same
reason, it is essential that all C programs have a main function. The word main is followed in the code by a pair
of parentheses (()). In C syntax, what differentiate a function declaration from other types of expressions are
the parentheses that follow its name.
Optionally, these parentheses may enclose a list of parameters within them. Right after these parentheses we
can find the body of the main function enclosed in braces (). What is contained within these braces is what the
function does when it is executed. Within main ( ), line 30
is initialize () function which is used to maker all the input pins digital and simultaneously initialize the PWM modules. Line 29 is called TRIS instruction. This
instruction is used to set the pins of a particular port in a microcontroller as input or output pins. Let us consider
the case in which we are checking the status of an obstacle sensor and in accordance to it, sound a buzzer.
Both the obstacle sensor and the buzzer are connected to 0th and 3rd pin of PORTA respectively
The rest of the pins are set as input pins. Now considering
the obstacle sensor, we have to obtain data from the sensor into the microcontroller, so the pin corresponding
to it has to be made an input pin. However, considering the buzzer, we have to send data from the microcontroller
to switch it on or off. Hence, the pin corresponding to the buzzer is to be configured as an output pin. To set a particular pin in a particular port as input or output, then
its corresponding TRIS bit has to be made 1 or 0 respectively. So considering our example the instruction
to set the TRIS bit of PORTA we have to write the following instruction,
Introduction to Robotics with Revobot
Page 218
A microcontroller comprises of a number of pins dedicated
for input/output .From a hardware point of view a microcontroller communicates with other devices via
these pins, which are electrically connected. Hence, from a programming perspective we only deal with each of the
pins to read the output of a device or send an input into a device because each device is physically connected to a
pin. For example, the first pin of PORTB is represented as PORTBbits.RB0. If an obstacle sensor is connected to this particular pin, then to check the status of the sensor, we
check the status of the pin. The Revobot obstacle sensors give an output of 0 volt when it detects an obstacle;
otherwise, its output is 5 volt. In programming terminology, 0 and 5 volts are represented as 0 and 1
respectively. Hence, to check if the obstacle sensor has detected an obstacle, we will write the following code,
if( PORTBbits.RB0==0 )
For starters handling sensors in such a fashion will be a bit out of reach. To deal with this problem the C language
has two tools:-
• Macros • Functions
Introduction to Robotics with Revobot
Page 219
Now using the above tools, we can represent
PORTBbits.RB0 as obstaclesensor and zero as obstacle. This makes the code in a more digestible form as shown
below,
if( obstaclesensor == obstacle)
Similarly, we represent number of actual parameters by their corresponding macros as shown below,
MACROMACROMACROMACRO APPLICATION APPLICATION APPLICATION APPLICATION
PARAMETERPARAMETERPARAMETERPARAMETER DEVICE APPLICABLEDEVICE APPLICABLEDEVICE APPLICABLEDEVICE APPLICABLE
Ws 0 Status of sensor on encountering a white surface
Bs 1 Status of sensor while encountering a black surface
Ob 0 Status of sensor while encountering an obstacle
Nob 1 Status of sensor while encountering no obstacle
Cw 0
Direction parameter in speedirr(int r,int dir) function to rotate rightmotor clockwise
Aw 1
Direction parameter in speedirr(int r,int dir) function to rotate rightmotor anticlockwise
Wall 0 Status of sensor while encountering a wall
Nowall 1 Status of sensor while encountering no wall
Light 1
Status of rightldr or leftldr while LDR is encountering light above threshold value
Nolight 0
Status of rightldr or leftldr while LDR is encountering light below threshold value
l0 PORTAbits.RA0 Status of 0th pin of PORTA
l1 PORTAbits.RA1 Status of 1st pin of PORTA
l2 PORTAbits.RA2 Status of 2nd pin of PORTA
Introduction to Robotics with Revobot
Page 220
Mode (PORTA&0b00001
11)
Status of l0,l1,l2 together
LLLL2222 L1L1L1L1 LLLL0000 ValueValueValueValue
of Mode of Mode of Mode of Mode
off Off Off 0
off Off On 1
off On Off 2
off On On 3
on Off Off 4
on Off On 5
on On Off 6
on On On 7
Rightlse
nsor PORTAbits.RA5 Output of right line sensor
Leftlsen
sor PORTEbits.RE0 Output of left line sensor
Rightos
ensor PORTEbits.RE1 Output of right obstacle sensor
leftosen
sor PORTEbits.RE2 Output of right obstacle sensor
Bld PORTBbits.RB4 Status of bootload switch
Buzzer PORTAbits.RA3 Represents buzzer
Motorra PORTCbits.RC1 Right motor positive
Motorrb PORTDbits.RD0 Right motor negative
Motorla PORTCbits.RC2 Left motor positive
Motorlb PORTCbits.RC0 Left motor negative
motor_r
_fwd
PORTCbits.RC1=1
;
PORTDbits.RD0=0
Right motor forward at full speed
motor_r
_bwd
PORTCbits.RC1=0
;
PORTDbits.RD0=1
Right motor backward at full speed
motor_r
_stp
PORTCbits.RC1=0
;
PORTDbits.RD0=0
Right motor stop
motor_l
_fwd
PORTCbits.RC2=1
;
PORTCbits.RC0=0
Left motor forward at full speed
motor_lmotor_lmotor_lmotor_l
_bwd_bwd_bwd_bwd
PORTCbits.RC2=0PORTCbits.RC2=0PORTCbits.RC2=0PORTCbits.RC2=0
;;;;
PORTCbits.RC0=1PORTCbits.RC0=1PORTCbits.RC0=1PORTCbits.RC0=1
Left motor backward at full speed
Introduction to Robotics with Revobot
Page 221
FUNCTION FUNCTION
PARAMETER
DEVICE DEVICE DEVICE DEVICE
APPLICABLEAPPLICABLEAPPLICABLEAPPLICABLE
Speedirr(r,
dir)
r can be replaced by
any value from 0-
1023 or by any
variable containing
a similar value
which decides the
speed, dir can be
replaced by cw or
aw which
determines the
direction of rotation
Right motor speed and direction control
Speedirr(r,
dir)
r can be replaced by
any value from 0-
1023 or by any
variable containing
a similar value
which decides the
speed, dir can be
replaced by cw or
aw which
determines the
direction of rotation
Right motor speed and direction control
Speedirl(l
,dir)
l can be replaced by
any value from 0-
1023 or by any
variable containing
a similar value
which decides the
speed , dir can be
replaced by cw or
aw which
determines the the
direction of rotation
Left motor speed and direction controll
convert2di
gital(chann
el)
Channel can be
replaced with any
value from 0-12 or
any variable which
contains a value
from 0-12.This
determines which
ADC channel
voltage is being
converted. The
function will return
an integer value
corresponding to
the analog voltage
present at the
corresponding ADC
channel
Analog to digital conversion
Introduction to Robotics with Revobot
Page 222
initialize()
Initializes the PWM modules and makes all input pins digital
acquire_ldr
_digital_val
ues()
Convert the LDR values to digital logic output
Now let us consider writing a C program to implement the functionality of a line follower using the macros and
functions listed above. However, before starting with the program one has to figure out the algorithm for
implementing the corresponding functionality. This can be done by creating a flowchart for the same as shown
below.
Now let us start writing the program code for Line following
Code for line followingCode for line followingCode for line followingCode for line following
// Code for line following
//-----------------------------------------------------------------
// header file for Revoboard
#include<revobot.h>
void main(void)
//setting PORTA as inputs except PA3
TRISA=0b11110111;
//setting PORTB as outputs
TRISB=0b00000000;
//setting PORTC as outputs
TRISC=0b00000000;
//setting PORTD as outputs
TRISD=0b00000000;
//setting PORTE as outputs
TRISE=0b11111111;
//Making the buzzer off
buzzer=0;
/*Initializing adc, pwm modules and setting PA0, PA1, PA2
AND PA3 pins as analog.*/
initialize();
// loop to perform line follower using 2 sensors
while(1)
// if line is between 2 sensors
if(rightlsensor==ws && leftlsensor==ws)
// then move forward
speedirr(512,cw);
speedirl(512,cw);
Introduction to Robotics with Revobot
Page 223
// if the bot has drifted to the left of the line
if(rightlsensor==bs && leftlsensor==ws)
// Then move the bot to the right
speedirr(512,aw);
speedirl(512,cw);
// if the bot has drifted to the right of the line
if(rightlsensor==ws && leftlsensor==bs)
// then move the bot to the left
speedirr(512,cw);
speedirl(512,aw);
/* if the bot has encountered a black line or surface
orthogonal to its path */
if(rightlsensor==bs && leftlsensor==bs)
speedirr(0,cw);
// Then move stop
speedirl(0,cw);
//-----------------------------------------------------------------
Tips to improve performance: o Analyze the track before programming.
o Check for sharp turns, smooth turns and long straights
o For sharp turns implement a logic in which
the wheel to the outer side rotates at full speed and the wheels towards the inner
side rotates in the opposite direction. The speed of the inner wheels while rotating
backwards should be set according to the curvature of the turn.
o For smooth turns implement a logic in which the outer side rotates at full speed
and the wheels towards the inner side rotates in the same direction at reduced
speed. The speed of the inner wheels while rotating should be set according to the
curvature of the turn. o If the layout of the track is known program
the Revobot may be programmed in
Introduction to Robotics with Revobot
Page 224
manner to go at high speed (method for smooth turns) in sectors with smooth turns
and straights and at low speed (method for sharp turns) in sectors with twists and
bends. This will enable the Revobot to follow the line at maximum speed without
overshooting it.
Introduction to Robotics with Revobot
Page 225
CHAPTER 15
Sample C ProgramsSample C ProgramsSample C ProgramsSample C Programs
15.1 More Programs
Code for obstacle avoidanceCode for obstacle avoidanceCode for obstacle avoidanceCode for obstacle avoidance
// Code for obstacle avoidance
//---------------------------------------------------------------------
#include<revobot.h>
// Header file for Revoboard
void main(void)
// Setting PORTA as inputs except PA3
TRISA=0b11110111;
// Setting PORTB as outputs
TRISB=0b00000000;
// Setting PORTC as outputs
TRISC=0b00000000;
// setting PORTD as outputs
TRISD=0b00000000;
// setting PORTE as outputs
TRISE=0b11111111;
// making the buzzer off
buzzer =0;
// initializing adc, pwm modules and setting PA0,PA1,PA2 AND
PA3 pins as analog
initialize();
// loop to perform obstacle avoidance
while(1)
// if the bot has encountered an obstacle normally
if(rightosensor == ob && leftosensor == ob)
// first move the bot backwards
speedirr(1000,aw);
speedirl(1000,aw);
// for a small amount of time
Delay10KTCYx(2);
// Until the left sensor avoids the obstacle
while(leftosensor==0)
// turn to the the right to check for a path
speedirr(1000,aw);
speedirl(1000,cw);
Introduction to Robotics with Revobot
Page 226
// if the left sensor detects an obstacle
if(rightosensor==nob && leftosensor==ob)
// then turn to the right to avoid it
speedirr(1000,aw);
speedirl(1000,cw);
// if the right sensor detects an obstacle
if(rightosensor==ob && leftosensor==nob)
// then turn to the left to avoid it
speedirr(1000,cw);
speedirl(1000,aw);
// if both sensors dont detect any obstacle
if(rightosensor==nob && leftosensor==nob)
// then move forward
speedirr(1000,cw);
speedirl(1000,cw);
Tips to improve performance:
• Analyze the colour and texture of obstacles
before programming.
• If the colour of obstacles is dark or their have a rough texture then the reflectivity for
infrared rays decreases. Hence, range for a tuned obstacle sensor will be less for a darker
coloured or rough textured obstacle compared to a lighter coloured or smooth textured
obstacle. • The forward speed of the Revobot should be
set in such a manner that if an obstacle is detected it should be able to steer away from
it. If the forward speed is programmed to be very high then, though the sensors may detect
the obstacle, the Revobot may collide with the it. This is because there is a small delay for the motor to respond. Another factor may be the
lack of traction the wheels can generate from the floor surface.
Introduction to Robotics with Revobot
Page 227
• Introduce fail-safe logic concepts like, when the Revobot detects an obstacle on it right and
steers to left during which it checks if there are any obstacles on its left. If there is an obstacle
on its left also, then it rotates back to the right till it can avoid the obstacle it detected first or
move back and steer off in another direction
Code for sumo wrestlingCode for sumo wrestlingCode for sumo wrestlingCode for sumo wrestling
// Code for sumo wrestling
//---------------------------------------------------------------------
// header file for revoboard
#include<revobot.h>
void main(void)
// setting PORTA as inputs except PA3
TRISA=0b11110111;
// setting PORTB as outputs
TRISB=0b00000000;
// setting PORTC as outputs
TRISC=0b00000000;
// setting PORTD as outputs
TRISD=0b00000000;
// setting PORTE as outputs
TRISE=0b11111111;
// makin the buzzer off
initialize();
// initializing adc,pwm modules and setting PA0,PA1,PA2
//AND PA3 pins as analog
buzzer =0;
// loop to perform sumobot
while(1)
// if bot is drifting out of the ring normally
if(rightlsensor == bs && leftlsensor == bs)
// then move backwards
speedirl(512,aw);
speedirr(1000,aw);
// for sometime
Delay10KTCYx(800);
// then turn right
speedirr(512,aw);
speedirl(512,cw);
// for sometime
Delay10TCYx(2);
Introduction to Robotics with Revobot
Page 228
// if the bot is drifting towards the left and out of the ring
if(rightlsensor == ws && leftlsensor == bs)
// then move backwards
speedirr(512,aw);
speedirl(512,aw);
// for sometime
Delay10KTCYx(2);
// then turn right
speedirr(0,aw);
speedirl(512,cw);
// for sometime
Delay10TCYx(2);
// if the bot is drifting towards the right and out of the ring
if(rightlsensor==bs && leftlsensor==ws)
// then move backwards
speedirr(512,aw);
speedirl(512,aw);
// for sometime
Delay10KTCYx(2);
// then turn left
speedirr(512,cw);
speedirl(0,cw);
// for sometime
Delay10TCYx(2);
/* if the bot is somewhere inside the ring then.....track down the
opponent*/
if(rightlsensor==ws && leftlsensor==ws)
// if opponent is straight in front
if(rightosensor ==ob && leftosensor == ob)
// go forward to push the opponent out of the ring
speedirr(512,cw);
speedirl(512,cw);
// if opponent is on the bots left
if(rightosensor==nob && leftosensor==ob)
// then turn left
speedirr(512,cw);
speedirl(512,aw);
// if opponent is on the bots right
if(rightosensor==ob && leftosensor==nob)
// then turn right
Introduction to Robotics with Revobot
Page 229
speedirr(512,aw);
speedirl(512,cw);
// if the opponent is not vicinity start search
if(rightosensor==nob && leftosensor==nob)
// rotate right
speedirr(512,aw);
speedirl(512,cw);
// for a random period of time
Delay10KTCYx(rand());
// move forward
speedirr(512,cw);
speedirl(512,cw);
// for a random period of time
Delay10KTCYx(rand());
15.2 Tips to improve performance:
Analyze the diameter of the ring0020and limit the
range to it to prevent detecting obstacles outside the ring.
Implement better scanning logic to track your opponents quicker.
Code for pit avoidanceCode for pit avoidanceCode for pit avoidanceCode for pit avoidance
// Code for pit avoidance
//---------------------------------------------------------------------
#include<revobot.h>
// header file for revoboard
void main(void)
// setting PORTA as inputs except PA3
TRISA=0b11110111;
// setting PORTB as outputs
TRISB=0b00000000;
// setting PORTC as outputs
TRISC=0b00000000;
// setting PORTD as outputs
TRISD=0b00000000;
// setting PORTE as outputs
TRISE=0b11111111;
// making the buzzer off
buzzer = 0;
// initializing adc, pwm modules and setting PA0,PA1,PA2
// AND PA3 pins as analog
Introduction to Robotics with Revobot
Page 230
initialize();
// loop to perform pit avoidance using 2 sensors
while(1)
// if no pit is detected by 2 sensors
if(rightlsensor==nopit && leftlsensor==nopit)
// then move forward
speedirr(512,cw);
speedirl(512,cw);
/* if the bot has detected a pit on the left then move back and
turn to the right*/
if(rightlsensor==pit && leftlsensor==nopit)
speedirr(200,aw);
speedirl(1000,aw);
Delay10KTCYx(700);
Delay10KTCYx(700);
Delay10KTCYx(700);
speedirr(512,cw);
speedirl(512,aw);
/* if the bot has detected a pit on the right then move back and
turn to the left */
if(rightlsensor == nopit && leftlsensor == pit)
speedirr(700,aw);
speedirl(512,aw);
Delay10KTCYx(700);
Delay10KTCYx(700);
Delay10KTCYx(700);
speedirr(512,aw);
speedirl(512,cw);
// if the bot has encountered a pit in front of the robot
if(rightlsensor==pit && leftlsensor==pit)
// then move back takin a small turn
speedirr(400,aw);
speedirl(1000,aw);
Delay10KTCYx(700);
Delay10KTCYx(700);
Code for lefCode for lefCode for lefCode for left wall followingt wall followingt wall followingt wall following
// Code for left wall following
//---------------------------------------------------------------------
// header file for Revoboard
Introduction to Robotics with Revobot
Page 231
#include<revobot.h>
void main(void)
// Setting PORTA as inputs except PA3 Setting
TRISA=0b11110111;
// PORTB as outputs
TRISB=0b00000000;
// Setting PORTC as outputs
TRISC=0b00000000;
// Setting PORTD as outputs
TRISD=0b00000000;
// Setting PORTE as outputs
TRISE=0b11111111;
// Making the buzzer off
buzzer =0;
/* Initializing adc, pwm modules and setting PA0,PA1,PA2
AND PA3 pins as analog*/
initialize();
// loop to perform wall following with wall on left
while(1)
/* Note :keep the left sensor facing to the left and right sensor
facing the front*/
// if the only left sensor detects no wall
if(leftosensor==nowall )
// Then move towards wall
speedirr(512,cw);
speedirl(211,cw);
// if the right sensor detects a wall
while( rightosensor==wall )
/* Then turn sharply towards the right to avoid the 90 degree
bend in the wall*/
speedirr(512,aw);
speedirl(512,cw);
// if the bot drifts towards the wall
if(leftosensor==wall )
// then turn away from the wall
speedirr(211,cw);
speedirl(512,cw);
Code for right wall followingCode for right wall followingCode for right wall followingCode for right wall following
Introduction to Robotics with Revobot
Page 232
// Code for right wall following
//---------------------------------------------------------------------
// header file for Revoboard
#include<revobot.h>
void main(void)
// Setting PORTA as inputs except PA3
TRISA=0b11110111;
// Setting PORTB as outputs
TRISB=0b00000000;
// Setting PORTC as outputs
TRISC=0b00000000;
// Setting PORTD as outputs
TRISD=0b00000000;
// Setting PORTE as outputs
TRISE=0b11111111;
// Making the buzzer off
buzzer =0;
/* initializing adc, pwm modules and setting PA0,PA1,PA2
AND PA3 pins as analog*/
initialize();
// loop to perform wall following with wall on right
while(1)
/* Note: please keep the right sensor facing the right and left
sensor facing the front */
// if the right sensor detects no wall
if(rightosensor==nowall )
// then move towards the wall
speedirr(211,cw);
speedirl(512,cw);
// if the left sensor detects a wall
while(leftosensor==wall )
/* then turn sharply towards the left to avoid the 90 degree bend
in the wall */
speedirr(512,cw);
speedirl(512,aw);
// if the bot drifts towards the wall
if(rightosensor==wall )
// then turn away from the wall
speedirr(512,cw);
speedirl(211,cw);
Introduction to Robotics with Revobot
Page 233
Code for line following with one sensorCode for line following with one sensorCode for line following with one sensorCode for line following with one sensor
// Code for line following with one sensor
//---------------------------------------------------------------------
// header file for revoboard
#include<revobot.h>
void main(void)
// setting PORTA as inputs except PA3
TRISA=0b11110111;
// setting PORTB as outputs
TRISB=0b00000000;
// setting PORTC as outputs
TRISC=0b00000000;
// setting PORTD as outputs
TRISD=0b00000000;
// setting PORTE as outputs
TRISE=0b11111111;
// making the buzzer off
buzzer =0;
// initializing adc,pwm modules and making all inputs digital
initialize();
// loop to perform line follower using 1 sensors
while(1)
// note: here the bot tries to follow the interface between the
black line and the white surface
// if the right sensor detects a black surface
if(rightlsensor==bs )
// then turn towards the right
speedirr(0,aw);
speedirl(512,cw);
// if the right sensor detects a white surface
if(rightlsensor == ws )
// then turn towards the left
speedirr(512,cw);
speedirl(0,aw);
Introduction to Robotics with Revobot
Page 234
Code for light followingCode for light followingCode for light followingCode for light following
// Code for light following
//---------------------------------------------------------------------
// header file for revoboard
#include<revobot.h>
void main(void)
// setting PORTA as inputs except PA3
TRISA=0b11110111;
// setting PORTB as outputs
TRISB=0b00000000;
// setting PORTD as outputs
TRISC=0b00000000;
// setting PORTC as outputs
// setting PORTD as outputs
TRISD=0b00000000;
// setting PORTE as outputs
TRISE=0b11111111;
// making the buzzer off
buzzer =0;
// initializing adc,pwm modules and making all pins digital
initialize();
// loop to perform light follower
while(1)
/*compare the ldr values with threshold setting potentiometers to
generate digital output*/
acquire_ldr_digital_values() ;
// if light is detected in front of the bot then move forward
if(rightldr==light && leftldr==light)
speedirr(512,cw);
speedirl(512,cw);
// if light is detected on the left of the bot
if(rightldr==nolight && leftldr==light)
// then turn to the left to follow the light
speedirr(512,cw);
speedirl(512,aw);
// if light is detected on the right of the bot
if(rightldr==light && leftldr==nolight)
// then turn to the right
speedirr(512,aw);
speedirl(512,cw);
Introduction to Robotics with Revobot
Page 235
// if no light is detected in the vicinity of the bot
// then keep turning till light is detected in the bots vicinity
if(rightldr==nolight && leftldr==nolight)
speedirl(512,cw);
speedirr(512,aw);
Code for multifunctionality using mode selection switchesCode for multifunctionality using mode selection switchesCode for multifunctionality using mode selection switchesCode for multifunctionality using mode selection switches
Code for multifunctionality using mode selection switches
#include<revobot.h>
void main(void)
// setting PORTA as inputs except PA3
TRISA=0b11110111;
// setting PORTC as outputs
TRISB=0b00000000;
// setting PORTB as outputs
// setting PORTC as outputs
TRISC=0b00000000;
// setting PORTD as outputs
TRISD=0b00000000;
// setting PORTE as outputs
TRISE=0b11111111;
// making the buzzer off
buzzer =0;
//initialize the PWM modules with frequency of 2.930KHz
initialize( );
// infinite loop
while(1)
// loop to perform line follower using 2 sensors
while(mode==0)
// if line is between 2 sensors then move forward
if(rightlsensor==ws && leftlsensor==ws)
speedirr(512,cw);
speedirl(512,cw);
/* if the bot has drifted to the left of the line then move the bot to
the right */
if(rightlsensor==bs && leftlsensor==ws)
speedirr(512,aw);
speedirl(512,cw);
Introduction to Robotics with Revobot
Page 236
/* if the bot has drifted to the right of the line then move the bot
to the left */
if(rightlsensor==ws && leftlsensor==bs)
speedirr(512,cw);
speedirl(512,aw);
/* if the bot has encountered a black line or surface orthogonal to
its path then stop*/
if(rightlsensor==bs && leftlsensor==bs)
speedirr(0,cw);
speedirl(0,cw);
if(mode!=0)
break;
// loop to perform obstacle avoidance
while(mode==1)
/* if the bot has encountered an obstacle normally first move the
bot backwards*/
if(rightosensor==ob && leftosensor==ob)
speedirr(1000,aw);
speedirl(1000,aw);
// for a small amount of time
Delay10KTCYx(2);
// until the left sensor avoids the obstacle
while(leftosensor==0)
// turn to the the right to check for a path
speedirr(1000,aw);
speedirl(1000,cw);
/* if the left sensor detects an obstacle then turn to the right to
avoid it*/
if(rightosensor==nob && leftosensor==ob)
speedirr(1000,aw);
speedirl(1000,cw);
/* if the right sensor detects an obstacle then turn to the left to
avoid it*/
if(rightosensor==ob && leftosensor==nob)
speedirr(1000,cw);
speedirl(1000,aw);
// if both sensors dont detect any obstacle then move forward
if(rightosensor==nob && leftosensor==nob)
Introduction to Robotics with Revobot
Page 237
speedirr(1000,cw);
speedirl(1000,cw);
if(mode!=1)
break;
// loop to perform sumobot
while(mode==2)
// if bot is drifting out of the ring normally then move backwards
if(rightlsensor==ws && leftlsensor==ws)
speedirr(1000,aw);
speedirl(512,aw);
// for sometime
Delay10KTCYx(800);
// then turn right
speedirr(512,aw);
speedirl(512,cw);
// for sometime
Delay10TCYx(2);
/*if the bot is drifting towards the left and out of the ring then
move backwards*/
if(rightlsensor==bs && leftlsensor==ws)
speedirr(512,aw);
speedirl(512,aw);
// for sometime
Delay10KTCYx(2);
// then turn right
speedirr(0,aw);
speedirl(512,cw);
// for sometime
Delay10TCYx(2);
// if the bot is drifting towards the right and out of the ring
if(rightlsensor==ws && leftlsensor==bs)
// then move backwards
speedirr(512,aw);
speedirl(512,aw);
// for sometime
Delay10KTCYx(2);
// then turn left
speedirr(512,cw);
speedirl(0,cw);
// for sometime
Delay10TCYx(2);
/* if the bot is somewhere inside the ring then.....track down the
opponent*/
Introduction to Robotics with Revobot
Page 238
if(rightlsensor==bs && leftlsensor==bs)
/*if opponent is straight in front go forward to push the opponent
out of the ring*/
if(rightosensor==ob && leftosensor==ob)
speedirr(512,cw);
speedirl(512,cw);
// if opponent is on the bots left then turn left
if(rightosensor==nob && leftosensor==ob)
speedirr(512,cw);
speedirl(512,aw);
// if opponent is on the bots right then turn right
if(rightosensor==ob && leftosensor==nob)
// rotate right
speedirr(512,aw);
speedirl(512,cw);
// if the opponent is not vicinity start search
if(rightosensor==nob && leftosensor==nob)
// rotate right
speedirr(512,aw);
speedirl(512,cw);
// for a random period of time
Delay10KTCYx(rand());
// move forward
speedirr(512,cw);
speedirl(512,cw);
// for a random period of time
Delay10KTCYx(rand());
if(mode!=2)
break;
// loop to perform pit avoidance using 2 sensors
while(mode==3)
// if no pit is detected by 2 sensors then move forward
if(rightlsensor==nopit && leftlsensor==nopit)
speedirr(512,cw);
speedirl(512,cw);
Introduction to Robotics with Revobot
Page 239
/* if the bot has detected a pit on the right then move back and
turn to the left*/
if(rightlsensor==pit && leftlsensor==nopit)
speedirr(200,aw);
speedirl(1000,aw);
Delay10KTCYx(700);
speedirr(512,cw);
speedirl(512,aw);
/* if the bot has detected a pit on the left then move back and
turn to the right */
if(rightlsensor==nopit && leftlsensor==pit)
speedirr(700,aw);
speedirl(512,aw);
Delay10KTCYx(700);
speedirr(512,aw);
speedirl(512,cw);
/* if the bot has encountered a pit in front of the robot then move
back taking a small turn */
if(rightlsensor==pit && leftlsensor==pit)
speedirr(400,aw);
speedirl(1000,aw);
if(mode!=3)
break;
// loop to perform wall following with wall on left
while(mode==4)
// note:please keep the left sensor facing to the left and right
sensor facing the front
// if the only left sensor detects no wall
if(leftosensor==nowall )
// then move towards wall
speedirr(512,cw);
speedirl(211,cw);
while( rightosensor==wall )
// then turn sharply towards the right to avoid the 90 degree
bend in the wall
speedirr(512,aw);
speedirl(512,cw);
Introduction to Robotics with Revobot
Page 240
// if the bot drifts towards the wall then turn away from the wall
if(leftosensor==wall )
speedirr(211,cw);
speedirl(512,cw);
if(mode!=4)
break;
// loop to perform wall following with wall on right
// note: please keep the right sensor facing the right and left
sensor facing the front
while(mode==5)
// if the right sensor detects no wall then move towards the wall
if(rightosensor==nowall )
speedirr(211,cw);
speedirl(512,cw);
/* if the left sensor detects a wall then turn sharply towards the
left to avoid the 90 degree bend in the wall */
while(leftosensor==wall )
speedirr(512,cw);
speedirl(512,aw);
// if the bot drifts towards the wall then turn away from the wall
if(rightosensor==wall )
speedirr(512,cw);
speedirl(211,cw);
if(mode!=5)
break;
// loop to perform line follower using 1 sensors
/*note: here the bot tries to follow the interface between the black
line and the white surface*/
while(mode==6)
/* if the right sensor detects a black surface then turn towards
the right */
if(rightlsensor==bs )
speedirr(0,aw);
speedirl(512,cw);
/* if the right sensor detects a white surface then turn towards
the left */
if(rightlsensor==ws )
Introduction to Robotics with Revobot
Page 241
speedirr(512,cw);
speedirl(0,aw);
if(mode!=6)
break;
// loop to perform lightfollower
while(mode==7)
/*compare the ldr values with threshold setting potentiometers to
generate digital output*/
acquire_ldr_digital_values() ;
// if light is detected in front of the bot then move forward
if(rightldr==light && leftldr==light)
speedirr(512,cw);
speedirl(512,cw);
/* if light is detected on the left of the bot then turn to the left to
follow the light*/
if(rightldr==nolight && leftldr==light)
speedirr(512,cw);
speedirl(512,aw);
if(rightldr==light && leftldr==nolight)
// if light is detected on the right of the bot then turn to the right
speedirr(512,aw);
speedirl(512,cw);
/* if no light is detected in the vicinity of the bot then keep turning
till light is detected in the bots vicinity*/
if(rightldr==nolight && leftldr==nolight)
speedirr(512,aw);
speedirl(512,cw);
if(mode!=7)
break;
Introduction to Robotics with Revobot
Page 242
CHAPTER 16
SupportSupportSupportSupport
Detailed troubleshooting guides are update on the
Revobot website.
Please visit http://www.revobot.in/support to obtain the latest copy of our trouble-shooting guide.
Robhatah also provides phone and email support for the
Revobot. Please call our support personnel at +91 80 4092 9235 or email at [email protected] to get in
touch with our Support personnel.
Introduction to Robotics with Revobot
Page 243
INDEX
AC, 46
AC., 47
ActiveActiveActiveActive, 25
Active and Passive
Components, 25
Active componentsActive componentsActive componentsActive components, 25, 38
Actuators, 98
Alternating Current. See
AC
anode, 9
Bevel GBevel GBevel GBevel Gearsearsearsears, 119
Biomorphics, 136
Bipolar Junction
Transistor, 39
BLD SWITCHBLD SWITCHBLD SWITCHBLD SWITCH, 210
Breakdown voltage, 32
BRIDGE RECTIFIERS, 52
Brushless DC MotorBrushless DC MotorBrushless DC MotorBrushless DC Motor, 115
Capacitors, 30, 31
Capacitors in parallel, 35
Capacitors in seriesCapacitors in seriesCapacitors in seriesCapacitors in series, 34
cathode, 9
CENTER-TAPPED
transformer, 49
circuit, 27
color codes, 26
Conductance, 16
Cooperative Robotics, 133
CouplingCouplingCouplingCoupling, 121
Current, 13
current splitting, 15
DC, 46
Diodes, 37
Direct Current. See DC
Domestic Power socketDomestic Power socketDomestic Power socketDomestic Power socket, 48
Domestic Power socket: Domestic Power socket: Domestic Power socket: Domestic Power socket:
BodyBodyBodyBody, 48
dopant, 30
dry cells, 11
Electric Current, 13
Electric Power, 23
Electrical circuit, 43
Electrical Potential
Difference, 9
Electrical resistance, 16
Electrical Resistance, 16
Electrolytic Capacitors, 33
ElectromagnetElectromagnetElectromagnetElectromagnet, 104
Eliminator, 49
Introduction to Robotics with Revobot
Page 244
FILTER CIRCUITSFILTER CIRCUITSFILTER CIRCUITSFILTER CIRCUITS, 55
FULL-WAVE RECTIFIER,
52
FULL-WAVE RECTIFIERS,
52
Gear RatiosGear RatiosGear RatiosGear Ratios, 120
Gears, 117
Ground, 46
GYROSCOPEGYROSCOPEGYROSCOPEGYROSCOPE, 72
half cycle, 54
Half-Wave Rectifier. See RECTIFIER
Helical GearsHelical GearsHelical GearsHelical Gears, 118
Humanoids, 132
Humidity SensorsHumidity SensorsHumidity SensorsHumidity Sensors, 96
HydraulicHydraulicHydraulicHydraulic, 101
Inductor, 35
Industrial Robots, 128
INFRAINFRAINFRAINFRA----REDREDREDRED, 63
Kirchhoff's Current Law, 60
Kirchhoff's Voltage Law, 61
Laws of Robotics, 126
Light Dependent Resistor, 30
Light emitting diode, 38
Mobile Robots, 129
Motors, 107
Neuromorphics, 136
Ohm’s Law, 20
Op-amps, 42
operational amplifieroperational amplifieroperational amplifieroperational amplifier, 41
parallel, 12
Parallel Connection, 29
PassivePassivePassivePassive, 25
Passive componentsPassive componentsPassive componentsPassive components, 25
peak value, 55
photo resistor, 30
PICDEMFS USB ToolPICDEMFS USB ToolPICDEMFS USB ToolPICDEMFS USB Tool, 209
PneumaticPneumaticPneumaticPneumatic, 99
potential, 9
potential divider, 13
Power, 23
POWER TRANSFORMER,
49
PULSATING DC, 52
Rangefinder, 62
reactive, 43
Rectifier, 50
RECTIFIER, 50
resistance, 16
Resistance, 16
Resistance values, 26
ResistorsResistorsResistorsResistors, 26
roboticistroboticistroboticistroboticist., 126
Introduction to Robotics with Revobot
Page 245
Series connection, 12, 29
servo motors., 114
Short circuit, 15
Solenoids, 106
Spur GearsSpur GearsSpur GearsSpur Gears, 118
STEP-DOWN transformer, 49
Stepper Motor, 111
STEP-UP transformer, 49
switching regulator, 13
Tantalum Capacitors, 34
Thermistors, 30
Torque, 121
transistortransistortransistortransistor, 38
Variable capacitance
diode, 38
Voltage, 9
Voltage regulation diode, 37
voltage regulator, 13
Worm gearsWorm gearsWorm gearsWorm gears, 119
Zener Diode, 37
zeroth law, 126