Notes
Notes
Module Description:
Module Code: CSEU 08105
Module Name: Robotics and Intelligent Systems
Number of Credits: 9
Academic year: 2013/14
Semester: ONE
Class: BEng 11 Co
Lecturer: Mr. H. Fimbombaya (BEng, MSc.), email: fimbombaya@[Link]
Sub-Enabling Outcomes:
Define robots
Classify robots.
Describe basic robotic elements.
Identify suitable robotic applications.
Identify basic robotic element and suitable robotic applications
Determine the usage of robots in industrial production
Program a robotic system.
Draw robotic block diagrams
Prerequisite Module:
Microprocessor - CSEU 07302, Industrial Automation- CSEU 07403
Learning context:
Learning Materials:
References
Table of Contents
1. Introduction to Robotics. .................................................................................................................. 3
1.1 What is Robotics? ...................................................................................................................... 3
2. Basic Robotic Elements .................................................................................................................... 6
2.1 Sensors............................................................................................................................................ 6
2.2 Effectors ....................................................................................................................................... 18
2.3 Actuators...................................................................................................................................... 22
2.4 Controllers .................................................................................................................................... 26
2.5 Arms ............................................................................................................................................ 31
2.6 Artificial Intelligence................................................................................................................... 33
2.7 Mobility ........................................................................................................................................ 35
3 Types of Robotics and its Applications .......................................................................................... 39
4. Programming a Robotic System ..................................................................................................... 42
4.1 Hardware Requirement ................................................................................................................. 42
4.1.1 Robot Brains .......................................................................................................................... 42
4.1.2 Motors.................................................................................................................................... 43
4.1.3 Sensors................................................................................................................................... 45
4.1.4 BodyWork ............................................................................................................................. 46
4.2 Programming Introduction ........................................................................................................... 47
4.2.1 Programming Variables ......................................................................................................... 48
4.2.2 Programming Loops and Conditions ..................................................................................... 49
4.3 Controlling DC Motors................................................................................................................. 52
5. Discussion Questions...................................................................................................................... 57
Robotics develop man-made mechanical devices that can move by themselves, whose motion must
be modeled, planned, sensed, actuated and controlled, and whose motion behaviour can be
influenced by “programming”. Robots are called “intelligent” if they succeed in moving in safe
interaction with an unstructured environment, while autonomously achieving their specified tasks.
This definition implies that a device can only be called a “robot” if it contains a movable
mechanism, influenced by sensing, planning, actuation and control components. It does not imply
that a minimum number of these components must be implemented in software, or be changeable
by the “consumer” who uses the device; for example, the motion behaviour can have been hard-
wired into the device by the manufacturer.
So, the presented definition covers not just “pure” robotics or only “intelligent” robots, but rather
the somewhat broader domain of robotics and automation. This includes “dumb” robots such as:
metal and woodworking machines, “intelligent” washing machines, dish washers and pool cleaning
robots, etc. These examples all have sensing, planning and control, but often not in individually
separated components. For example, the sensing and planning behaviour of the pool cleaning robot
have been integrated into the mechanical design of the device, by the intelligence of the human
developer.
Robotics is, to a very large extent, all about system integration, achieving a task by an actuated
mechanical device, via an “intelligent” integration of components, many of which it shares with
other domains, such as systems and control, computer science, character animation, machine
design, computer vision, artificial intelligence, cognitive science, biomechanics, etc. In addition,
the boundaries of robotics cannot be clearly defined, since also its “core” ideas, concepts and
algorithms are being applied in an ever increasing number of “external” applications, and, vice
versa, core technology from other domains (vision, biology, cognitive science or biomechanics, for
example) are becoming crucial components in more and more modern robotic systems.
This figure 1 depicts the components that are part of all robotic systems. The purpose of this
Section is to describe the semantics of the terminology used: “sensing”, “planning”, “modeling”,
The real robot is some mechanical device (“mechanism”) that moves around in the environment,
and, in doing so, physically interacts with this environment. This interaction involves the exchange
of physical energy, in some form or another. Both the robot mechanism and the environment can be
the “cause” of the physical interaction through “Actuation”, or experience the “effect” of the
interaction, which can be measured through “Sensing”.
Sensing and actuation are the physical ports through which the “Controller” of the robot determines
the interaction of its mechanical body with the physical world. As mentioned already before, the
controller can, in one extreme, consist of software only, but in the other extreme everything can
also be implemented in hardware.
Modeling. The input-output relationships of all control components can (but need not) be derived
from information that is stored in a model. This model can have many forms: analytical formulas,
empirical look-up tables, fuzzy rules, neural networks, etc.
The name “model” often gives rise to heated discussions among different research “schools”. In
this notes the keyword “model” is to be understood with its minimal semantics: “any information
that is used to determine or influence the input-output relationships of components in the
Controller.”
The other components discussed below can all have models inside. A “System model” can be used
to tie multiple components together, but it is clear that not all robots use a System model. The
“Sensing model” and “Actuation model” contain the information with which to transform raw
physical data into task-dependent information for the controller, and vice versa.
Planning. This is the activity that predicts the outcome of potential actions, and selects the “best”
Regulation. This component processes the outputs of the sensing and planning components, to
generate an actuation set point. Again, this regulation activity could or could not rely on some sort
of (system) model.
The term “control” is often used instead of “regulation”, but it is impossible to clearly identify the
domains that use one term or the other.
Mechanical scale. The physical volume of the robot determines to a large extent the limits of what
can be done with it. Roughly speaking, a large-scale robot (such as an autonomous container crane
or a space shuttle) has different capabilities and control problems than a macro robot (such as an
industrial robot arm), a desktop robot (such as those “sumo” robots popular with hobbyists),
or milli, micro or nano robots.
Spatial scale. There are large differences between robots that act in 1D, 2D, 3D, or 6D (three
positions and three orientations).
Time scale. There are large differences between robots that must react within hours, seconds,
milliseconds, or microseconds.
Power density scale. A robot must be actuated in order to move, but actuators need space as well
as energy, so the ratio between both determines some capabilities of the robot.
System complexity scale. The complexity of a robot system increases with the number of
interactions between independent sub-systems, and the control components must adapt to this
complexity.
Obviously, these scale parameters never apply completely independently to the same system. For
example, a system that must react at microseconds time scale can not be of macro mechanical scale
or involve a high number of communication interactions with subsystems.
Background sensitivity
Robotics has, roughly speaking, two faces: (i) the mathematical and engineering face, which is
quite “standardized” in the sense that a large consensus exists about the tools and theories to use
(“systems theory”), and (ii) the AI face, which is rather poorly standardized, not because of a lack
of interest or research efforts, but because of the inherent complexity of “intelligent behaviour.”
Research in engineering robotics follows the bottom-up approach: existing and working systems
Many other robots also have Artificial Intelligence and effectors that help it achieve Mobility.
2.1 Sensors
Most robots of today are nearly deaf and blind. Sensors can provide some limited feedback to the
robot so it can do its job. Compared to the senses and abilities of even the simplest living things,
robots have a very long way to go.
The sensor sends information, in the form of electronic signals back to the controller. Sensors also
give the robot controller information about its surroundings and lets it know the exact position of
the arm, or the state of the world around it.
Sight, sound, touch, taste, and smell are the kinds of information we get from our world. Robots
can be designed and programmed to get specific information that is beyond what our 5 senses can
tell us. For instance, a robot sensor might "see" in the dark, detect tiny amounts of invisible
radiation or measure movement that is too small or fast for the human eye to see.
Rotation Encoders
Magnetism Compasses
Smell Chemical
Altitude Altimeters
Sensors can be made simple and complex, depending on how much information needs to be
stored. A switch is a simple on/off sensor used for turning the robot on and off. A human retina is
a complex sensor that uses more than a hundred million photosensitive elements (rods and cones).
Sensors provide information to the robots brain, which can be treated in various ways. For
example, we can simply react to the sensor output: if the switch is open, if the switch is closed, go.
Levels of Processing
Switch Sensors
Switches are the simplest sensors of all. They work without processing, at the electronics (circuit)
level. Their general underlying principle is that of an open vs. closed circuit. If a switch is open,
no current can flow; if it is closed, current can flow and be detected. This simple principle can (and
is) used in a wide variety of ways.
contact sensors: detect when the sensor has contacted another object (e.g., triggers when a
robot hits a wall or grabs an object; these can even be whiskers)
limit sensors: detect when a mechanism has moved to the end of its range
shaft encoder sensors: detects how many times a shaft turns by having a switch click
(open/close) every time the shaft turns (e.g., triggers for each turn, allowing for counting
rotations)
There are many common switches: button switches, mouse switches, key board keys, phone keys,
and others. Depending on how a switch is wired, it can be normally open or normally closed. This
would of course depend on your robot's electronics, mechanics, and its task. The simplest yet
extremely useful sensor for a robot is a "bump switch" that tells it when it's bumped into something,
so it can back up and turns away. Even for such a simple idea, there are many different ways of
Light Sensors
Switches measure physical contact and light sensors measure the amount of light impacting a
photocell, which is basically a resistive sensor. The resistance of a photocell is low when it is
brightly illuminated, i.e., when it is very light; it is high when it is dark. In that sense, a light sensor
is really a "dark" sensor. In setting up a photocell sensor, you will end up using the equations we
learned above, because you will need to deal with the relationship of the photocell resistance photo,
and the resistance and voltage in your electronics sensor circuit. Of course since you will be
building the electronics and writing the program to measure and use the output of the light sensor,
you can always manipulate it to make it simpler and more intuitive. What surrounds a light sensor
affects its properties. The sensor can be shielded and positioned in various ways. Multiple sensors
can be arranged in useful configurations and isolate them from each other with shields.
Just like switches, light sensors can be used in many different ways:
Their position and directionality on a robot can make a great deal of difference and impact
Polarized light
"Normal" light emanating from a source is non-polarized, which means it travels at all orientations
with respect to the horizon. However, if there is a polarizing filter in front of a light source, only
the light waves of a given orientation of the filter will pass through. This is useful because now we
can manipulate this remaining light with other filters; if we put it through another filter with the
same characteristic plane, almost all of it will get through. But, if we use a perpendicular filter (one
We said earlier that a photocell is a resistive device. We can also sense resistance in response to
other physical properties, such as bending. The resistance of the device increases with the amount
it is bent. These bend sensors were originally developed for video game control (for example,
Nintendo Powerglove), and are generally quite useful. Notice that repeated bending will wear out
the sensor. Not surprisingly, a bend sensor is much less robust than light sensors, although they use
the same underlying resistive principle.
Potentiometers
These devices are very common for manual tuning; you have probably seen them in some
controls (such as volume and tone on stereos). Typically called pots, they allow the user to
manually adjust the resistance. The general idea is that the device consists of a movable tap along
two fixed ends. As the tap is moved, the resistance changes. As you can imagine, the resistance
between the two ends is fixed, but the resistance between the movable part and either end varies as
the part is moved. In robotics, pots are commonly used to sense and tune position for sliding and
rotating mechanisms.
Biological Analogs
Touch/contact sensors with much more precision and complexity in all species
Reflective Optosensors
We mentioned that if we use a light bulb in combination with a photocell, we can make a break-
beam sensor. This idea is the underlying principle in reflective optosensors: the sensor consists of
an emitter and a detector. Depending of the arrangement of those two relative to each other, we can
get two types of sensors:
reflectance sensors (the emitter and the detector are next to each other, separated by
a barrier; objects are detected when the light is reflected off them and back into the
detector)
break-beam sensors (the emitter and the detector face each other; objects are
detected if they interrupt the beam of light between the emitter and the detector)
The emitter is usually made out of a light-emitting diode (an LED), and the detector is usually a
photodiode/phototransistor.
What can you do with this simple idea of light reflectivity? Quite a lot of useful things:
wall/boundary tracking
rotational shaft encoding (using encoder wheels with ridges or black & white
color)
Note, however, that light reflectivity depends on the color (and other properties) of a surface. A
light surface will reflect light better than a dark one, and a black surface may not reflect it at all,
thus appearing invisible to a light sensor. Therefore, it may be harder (less reliable) to detect darker
objects this way than lighter ones. In the case of object distance, lighter objects that are farther
away will seem closer than darker objects that are not as far away. This gives you an idea of how
the physical world is partially-observable. Even though we have useful sensors, we do not have
complete and completely accurate information.
Another source of noise in light sensors is ambient light. The best thing to do is subtract the
ambient light level out of the sensor reading, in order to detect the actual change in the reflected
light, not the ambient light. How is that done? By taking two (or more, for higher accuracy)
readings of the detector, one with the emitter on, and one with it off, and subtracting the two values
from each other. The result is the ambient light level, which can then be subtracted from future
readings. This process is called sensor calibration. Of course, remember that ambient light levels
can change, so the sensors may need to be calibrated repeatedly.
Break-beam Sensors
We already talked about the idea of break-beam sensors. In general, any pair of compatible
emitter-detector devices can be used to produce such a sensors:
Shaft Encoding
Shaft encoders measure the angular rotation of an axle providing position and/or velocity info. For
example, a speedometer measures how fast the wheels of a vehicle are turning, while an odometer
In order to detect a complete or partial rotation, we have to somehow mark the turning element.
This is usually done by attaching a round disk to the shaft, and cutting notches into it. A light
emitter and detector are placed on each side of the disk, so that as the notch passes between them,
the light passes, and is detected; where there is no notch in the disk, no light passes.
If there is only one notch in the disk, then a rotation is detected as it happens. This is not a very
good idea, since it allows only a low level of resolution for measuring speed: the smallest unit that
can be measured is a full rotation. Besides, some rotations might be missed due to noise.
Usually, many notches are cut into the disk, and the light hits impacting the detector are counted.
(You can see that it is important to have a fast sensor here, if the shaft turns very quickly.)
An alternative to cutting notches in the disk is to paint the disk with black (absorbing, non-
reflecting) and white (highly reflecting) wedges, and measure the reflectance. In this case, the
emitter and the detector are on the same side of the disk.
In either case, the output of the sensor is going to be a wave function of the light intensity. This can
then be processes to produce the speed, by counting the peaks of the waves.
Note that shaft encoding measures both position and rotational velocity, by subtracting the
difference in the position readings after each time interval. Velocity, on the other hand, tells us how
fast a robot is moving, or if it is moving at all. There are multiple ways to use this measure:
use a passive wheel that is dragged by the robot (measure forward progress)
We can combine the position and velocity information to do more sophisticated things:
Note, however, that doing such things is quite difficult, because wheels tend to slip (effector noise
and error) and slide and there is usually some slop and backlash in the gearing mechanism. Shaft
encoders can provide feedback to correct the errors, but having some error is unavoidable.
So far, we've talked about detecting position and velocity, but did not talk about direction of
rotation. Suppose the wheel suddenly changes the direction of rotation; it would be useful for the
robot to detect that.
An example of a common system that needs to measure position, velocity, and direction is a
computer mouse. Without a measure of direction, a mouse is pretty useless. How is direction of
rotation measured?
Quadrature shaft encoding is an elaboration of the basic break-beam idea; instead of using only one
Other uses of quadrature shaft encoding are in robot arms with complex joints (such as rotary/ball
joints; think of your knee or shoulder), Cartesian robots (and large printers) where an arm/rack
moves back and forth along an axis/gear.
We mentioned that ambient light is a problem because it interferes with the emitted light from a
light sensor. One way to get around this problem is to emit modulated light, i.e., to rapidly turn the
emitter on and off. Such a signal is much easier and more reliably detected by a demodulator,
which is tuned to the particular frequency of the modulated light. Not surprisingly, a detector needs
to sense several on-flashes in a row in order to detect a signal, i.e., to detect its frequency. This is a
small point, but it is important in writing demodulator code.
The idea of modulated IR light is commonly used; for example in household remote controls.
Modulated light sensors are generally more reliable than basic light sensors. They can be used for
the same purposes: detecting the presence of an object measuring the distance to a nearby object
(clever electronics required, see your course notes)
IR Communication
Modulated infra red can be used as a serial line for transmitting messages. This is fact how IR
modems work. Two basic methods exist:
bit frames (sampled in the middle of each bit; assumes all bits take the same amount of time
to transmit)
bit intervals (more common in commercial use; sampled at the falling edge, duration of
interval between sampling determines whether it's a 0 or 1)
As we mentioned before, ultrasound sensing is based on the time-of-flight principle. The emitter
produces a sonar "chirp" of sound, which travels away from the source, and, if it encounters
barriers, reflects from them and returns to the receiver (microphone). The amount of time it takes
for the sound beam to come back is tracked (by starting a timer when the "chirp" is produced, and
stopping it when the reflected sound returns), and is used to compute the distance the sound
traveled. This is possible (and quite easy) because we know how fast sound travels; this is a
constant, which varies slightly based on ambient temperature.
At room temperature, sound travels at 1.12 feet per millisecond. Another way to put it that sound
travels at 0.89 milliseconds per foot. This is a useful constant to remember.
The process of finding one's location based on sonar is called echolocation. The inspiration for
ultrasound sensing comes from nature; bats use ultrasound instead of vision (this makes sense; they
live in very dark caves where vision would be largely useless). Bat sonars are extremely
sophisticated compared to artificial sonars; they involve numerous different frequencies, used for
finding even the tiniest fast-flying prey, and for avoiding hundreds of other bats, and
communicating for finding mates.
Specular Reflection
In summary, long sonar readings can be very inaccurate, as they may result from false rather than
accurate reflections. This must be taken into account when programming robots, or a robot may
produce very undesirable and unsafe behavior. For example, a robot approaching a wall at a steep
angle may not see the wall at all, and collide with it!
Nonetheless, sonar sensors have been successfully used for very sophisticated robotics applications,
including terrain and indoor mapping, and remain a very popular sensor choice in mobile robotics.
The first commercial ultrasonic sensor was produced by Polaroid, and used to automatically
measure the distance to the nearest object (presumably which is being photographed). These simple
Polaroid sensors still remain the most popular off-the-shelf sonars (they come with a processor
board that deals with the analog electronics). Their standard properties include:
32-foot range
Polaroid sensors can be combined into phased arrays to create more sophisticated and more
accurate sensors.
One can find ultrasound used in a variety of other applications; the best known one is ranging in
submarines. The sonars there have much more focused and have longer-range beams. Simpler and
more mundane applications involve automated "tape-measures", height measures, burglar alarms,
etc.
Machine Vision
So far, we have talked about relatively simple sensors. They were simple in terms of processing of
the information they returned. Now we turn to machine vision, i.e., to cameras as sensors.
Cameras, of course, model biological eyes. Needless to say, all biological eyes are more complex
than any camera we know today, but, as you will see, the cameras and machine vision systems that
process their perceptual information, are not simple at all! In fact, machine vision is such a
challenging topic that it has historically been a separate branch of Artificial Intelligence.
The general principle of a camera is that of light, scattered from objects in the environment (those
are called the scene), goes through an opening ("iris", in the simplest case a pin hole, in the more
sophisticated case a lens), and impinging on what is called the image plane. In biological systems,
the image plane is the retina, which is attached to numerous rods and cones (photosensitive
elements) which, in turn, are attached to nerves which perform so-called "early vision", and then
In cameras, instead of having photosensitive rhodopsin and rods and cones, we use silver halides on
photographic film, or silicon circuits in charge-coupled devices (CCD) cameras. In all cases, some
information about the incoming light (e.g., intensity, color) is detected by these photosensitive
elements on the image plane.
In machine vision, the computer must make sense out of the information it gets on the image plane.
If the camera is very simple, and uses a tiny pin hole, then some computation is required to
compute the projection of the objects from the environment onto the image plane (note, they will be
inverted). If a lens is involved (as in vertebrate eyes and real cameras), then more light can get in,
but at the price of being focused; only objects a particular range of distances from the lens will be
in focus. This range of distances is called the camera's depth of field.
The image plane is usually subdivided into equal parts, called pixels, typically arranged in a
rectangular grid. In a typical camera there are 512 by 512 pixels on the image plane (for
comparison, there are 120 x 10^6 rods and 6 x 10^6 cones in the eye, arranged hexagonally). Let's
call the projection on the image plane the image.
The brightness of each pixel in the image is proportional to the amount of light directed toward the
camera by the surface patch of the object that projects to that pixel. (This of course depends on the
reflectance properties of the surface patch, the position and distribution of the light sources in the
environment, and the amount of light reflected from other objects in the scene onto the surface
patch.) As it turns out, brightness of a patch depends on two kinds of reflections, one being specular
(off the surface, as we saw before), and the other being diffuse (light that penetrates into the object,
is absorbed, and then re-emitted). To correctly model light reflection, as well as reconstruct the
scene, all these properties are necessary.
Let us suppose that we are dealing with a black and white camera with a 512 x 512 pixel image
plane. Now we have an image, which is a collection of those pixels, each of which is intensity
between white and black. To find an object in that image (if there is one, we of course don't know a
priori), the typical first step ("early vision") is to do edge detection, i.e., find all the edges. How do
we recognize them? We define edges as curves in the image plane across which there is significant
change in the brightness.
A simple approach would be to look for sharp brightness changes by differentiating the image and
look for areas where the magnitude of the derivative is large. This almost works, but unfortunately
it produces all sorts of spurious peaks, i.e., noise. Also, we cannot inherently distinguish changes in
intensities due to shadows from those due to physical objects. But let's forget that for now and think
about noise. How do we deal with noise?
We do smoothing, i.e., we apply a mathematical procedure called convolution, which finds and
eliminates the isolated peaks. Convolution, in effect, applies a filter to the image. In fact, in order to
find arbitrary edges in the image, we need to convolve the image with many filters with different
orientations. Fortunately, the relatively complicated mathematics involved in edge detection has
been well studied, and by now there are standard and preferred approaches to edge detection.
16 CSEU 08105 – Robotics and Intelligent Systems. Prepared by H. Fimbombaya
Once we have edges, the next thing to do is try to find objects among all those
edges. Segmentation is the process of dividing up or organizing the image into parts that correspond
to continuous objects. But how do we know which lines correspond to which objects, and what
makes an object? There are several cues we can use to detect objects:
1. We can have stored models of line-drawings of objects (from many possible angles, and at
many different possible scales!), and then compare those with all possible combinations of
edges in the image. Notice that this is a very computationally intensive and expensive
process. This general approach, which has been studied extensively, is called model-based
vision.
2. We can take advantage of motion. If we look at an image at two consecutive time-steps, and
we move the camera in between, each continuous solid objects (which obeys physical laws)
will move as one, i.e., its brightness properties will be conserved. This gives us a hint for
finding objects, by subtracting two images from each other. But notice that this also
depends on knowing well how we moved the camera relative to the scene (direction,
distance), and that nothing was moving in the scene at the time. This general approach,
which has also been studied extensively, is called motion vision.
3. We can use stereo (i.e., binocular stereopsis, two eyes/cameras/points of view). Just like with
motion vision above, but without having to actually move, we get two images, which we
can subtract from each other, if we know what the disparity between them should be, i.e., if
we know how the two cameras are organized/positioned relative to each other.
4. We can use texture. Patches that have uniform texture are consistent, and have almost
identical brightness, so we can assume they come from the same object. By extracting those
we can get a hint about what parts may belong to the same object in the scene.
5. We can also use shading and contours in a similar fashion. And there are many other
methods, involving object shape and projective invariants, etc.
Note that all of the above strategies are employed in biological vision. It's hard to recognize
unexpected objects or totally novel ones (because we don't have the models at all or not at the
ready). Movement helps catch our attention. Stereo, i.e., two eyes, is critical, and all carnivores use
it (they have two eyes pointing in the same direction, unlike herbivores). The brain does an
excellent job of quickly extracting the information we need for the scene.
Machine vision has the same task of doing real-time vision. But this is, as we have seen, a very
difficult task. Often, an alternative to trying to do all of the steps above in order to do object
recognition, it is possible to simplify the vision problem in various ways:
1. Use color; look for specifically and uniquely colored objects, and recognize them that way
(such as stop signs, for example)
2. Use a small image plane; instead of a full 512 x 512 pixel array, we can reduce our view to
much less, for example just a line (that's called a linear CCD). Of course there is much less
information in the image, but if we are clever, and know what to expect, we can process
what we see quickly and usefully.
4. Use information about the environment; if you know you will be driving on the road which
has white lines, look specifically for those lines at the right places in the image. This is how
first and still fastest road and highway robotic driving is done.
Those and many other clever techniques have to be employed when we consider how important it is
to "see" in real-time. Consider highway driving as an important and growing application of robotics
and AI. Everything is moving so quickly, that the system must perceive and act in time to react
protectively and safely, as well as intelligently.
Now that you know how complex vision is, you can see why it was not used on the first robots, and
it is still not used for all applications, and definitely not on simple robots. A robot can be extremely
useful without vision, but some tasks demand it. As always, it is critical to think about the proper
match between the robot's sensors and the task.
2.2 Effectors
An Effector is any device that affects the environment. Robots control their effectors, which are
also known as end effectors. Effectors include legs, wheels, arms, fingers, wings and fins.
Controllers cause the effectors to produce desired effects on the environment.
An actuator is the actual mechanism that enables the effector to execute an action. Actuators
In general, a free body in space as 6 DOF: three for translation (x,y,z), and three for
orientation/rotation (roll, pitch, and yaw). We'll go back to DOF in a bit. You need to know, for a
given effector (and actuator/s), how many DOF are available to the robot, as well as how many
total DOF any given robot has. If there is an actuator for every DOF, then all of the DOF are
controllable. Usually not all DOF are controllable, which makes robot control harder. A car has 3
DOF: position (x,y) and orientation (theta). But only 2 DOF are controllable: driving: through the
gas pedal and the forward-reverse gear; steering: through the steering wheel. Since there are more
DOF than are controllable, there are motions that cannot be done, like moving sideways (that's why
parallel parking is hard). We need to make a distinction between what an actuator does (e.g.,
pushing the gas pedal) and what the robot does as a result (moving forward). A car can get to any
2D position but it may have to follow a very complicated trajectory. Parallel parking requires a
discontinuous trajectory w.r.t. velocity, i.e., the car has to stop and go. When the number of
controllable DOF is equal to the total number of DOF on a robot, it is holonomic (for more
information about holonomic). If the number of controllable DOF is smaller than total DOF, the
robot is non-holonomic. If the number of controllable DOF is larger than the total DOF, the robot is
redundant. A human arm has 7 DOF (3 in the shoulder, 1 in the elbow, 3 in the wrist), all of which
can be controlled. A free object in 3D space (e.g., the hand, the finger tip) can have at most 6 DOF
So there are redundant ways of putting the hand at a particular position in 3D space. This is the core
of why manipulations are very hard.
mobile robotics
manipulator robotics
Mobility end effectors are discussed in more detail in the mobility section of these notes.
In contrast to locomotion, where the body of the robot is moved to get to a particular position and
orientation, a manipulator moves itself typically to get the end effector (e.g., the hand, the finger,
the fingertip) to the desired 3D position and orientation. So imagine having to touch a specific point
3D space with the tip of your index finger; that's what a typical manipulator has to do. Of course,
largely manipulators need to grasp and move objects, but those tasks are extensions of the basic
reaching above. The challenge is to get there efficiently and safely. Because the end effector is
attached to the whole arm, we have to worry about the whole arm; the arm must move so that it
does not try to violate its ownjoint limits and it must not hit itself or the rest of the robot, or any
other obstacles in the environment. Thus, doing autonomous manipulation is very challenging.
Manipulation was first used in tele-operation, where human operators would move artificial arms to
handle hazardous materials. It turned out that it was quite difficult for human operators to learn
how to tele-operate complicated arms (such as duplicates of human arms, with 7 DOF). One
alternative today is to put the human arm into an exo-skeleton, in order to make the control more
direct. Using joy-sticks, for example, is much harder for high DOF. Why is this so hard? Because
even as we saw with locomotion, there is typically no direct and obvious link between what the
effector needs to do in physical space and what the actuator does to move it. In general, the
correspondence between actuator motion and the resulting effector motion is called kinematics. In
order to control a manipulator, we have to know its kinematics (what is attached to what, how
many joints there are, how many DOF for each joint, etc.). We can formalize all of this
mathematically, and get an equation which will tell us how to convert from, say, angles in each of
the joints, to the Cartesian positions of the end effector/point. This conversion from one to the other
is called computing the manipulator kinematics andinverse kinematics.
The process of converting the Cartesian (x,y,z) position into a set of joint angles for the arm
(thetas) is called inverse kinematics. Kinematics are the rules of what is attached to what, the body
structure. Inverse kinematics is computationally intense. And the problem is even harder if the
manipulator (the arm) is redundant.
Manipulation involves
inverse dynamics
Manipulators are effectors. Joints connect parts of manipulators. The most common joint types
are:
These joints provide the DOF for an effector, so they are planned carefully.
Robot manipulators can have one or more of each of those joints. Now recall that any free body has
6 DOF; that means in order to get the robot's end effector to an arbitrary position and orientation,
the robot requires a minimum of 6 joints. As it turns out, the human arm (not counting the hand!)
has 7 DOF. That's sufficient for reaching any point with the hand, and it is also redundant, meaning
that there are multiple ways in which any point can be reached. This is good news and bad news;
the fact that there are multiple solutions means that there is a larger space to search through to find
the best solution. Now consider end effectors. They can be simple pointers (i.e., a stick), simple 2D
grippers, screwdrivers for attaching tools (like welding guns, sprayer, etc.), or can be as complex as
the human hand, with variable numbers of fingers and joints in the fingers. Problems like reaching
and grasping in manipulation constitute entire sub areas of robotics and AI. Issues include: finding
grasp-points (COG, friction, etc.); force/strength of grasp; compliance (e.g., in sliding, maintaining
contact with a surface); dynamic tasks (e.g., juggling, catching). Other types of manipulation, such
as carefully controlling force, as in grasping fragile objects and maintaining contact with a surface
(so-called compliant motion), are also being actively researched. Finally, dynamic manipulation
tasks, such as juggling, throwing, catching, etc., are already being demonstrated on robot arms.
Having talked about navigation and manipulation, think about what types of sensors (external
and proprioceptive) would be useful for these general robotic tasks. Proprioceptive sensors sense
the robot's actuators (e.g., shaft encoders, joint angle sensors, etc.); they sense the robot's own
movements. You can think of them as perceiving internal state instead of external state. External
sensors are helpful but not necessary or as commonly used.
Actuators, also known as drives, are mechanisms for getting robots to move. Most actuators are
powered by pneumatics (air pressure), hydraulics (fluid pressure), or motors (electric current). Most
actuation uses electromagnetic motors and gears but there have been frequent uses of other forms of
actuation including NiTinOL"muscle-wires" and inexpensive Radio Control servos. To get a motor
under computer control, different motor types and actuator types are used. Some of the motor types
are Synchronous, Stepper, AC servo, Brushless DC servo, and Brushed DC servo. Radio Control
servos for model airplanes, cars and other vehicles are light, rugged, cheap and fairly easy to
interface. Some of the units can provide very high torque speed. A Radio Control servo can be
controlled from a parallel port. With one of the PC’s internal timers cranked up, it is possible to
control eight servos from a common parallel port with nothing but a simple interrupt service routine
and a cable. In fact, power can be pulled from the disk drive power connector and the PC can run all
servos directly with no additional hardware. The only down side is that the PC wastes some
processing power servicing the interrupt handler.
DC Motors
The most common actuator you will use (and the most common in mobile robotics in general) is
thedirect current (DC) motor. They are simple, cheap, and easy to use. Also, they come in a great
variety of sizes, to accommodate different robots and tasks. DC motors convert electrical into
mechanical [Link] consist of permanent magnets and loops of wire inside. When current is
applied, the wire loops generate a magnetic field, which reacts against the outside field of the static
magnets. The interaction of the fields produces the movement of the shaft/armature. Thus,
electromagnetic energy becomes motion. As with any physical system, DC motors are not
perfectly efficient, meaning that the energy is not converted perfectly, without any waste. Some
The reason is the resistance to the motor motion introduced by the wall. If the resistance is very
high (i.e., the wall just won't move no matter how much the robot pushes against it), the motor
draws a maximum amount of power, and stalls. This is defined as the stall current of the motor: the
most current it can draw at its specified voltage. Within a motor's operating current range, the
more current is used, the more torque or rotational force is produced at the shaft. In general, the
strengths of the magnetic field generated in the wire loops is directly proportional to the applied
current and thus the produced torque at the shaft. Besides stall current, a motor also has its stall
torque, the amount of rotational force produced when the motor is stalled at its operating voltage.
Finally, the amount of power a motor generates is the product of its shaft's rotational velocity and
its torque. If there is no load on the shaft, i.e., the motor is spinning freely, then the rotational
velocity is the highest, but the torque is 0, since no mechanism is being driven by the motor. The
output power, then, is 0 also. In contrast, when the motor is stalled, it is producing maximum
torque, but the rotational velocity is 0, so the output power is 0 again.
Between free spinning and stalling, the motor does useful work, and the produced power has a
characteristic parabolic relationship demonstrating that the motor produces the most power in the
middle of its performance range. Most DC motors have unloaded speeds in the range of 3,000 to
9,000 RPM (revolutions per minute), or 50 to 150 RPS (revolutions per second). That turns out to
put them in the high-speed but low-torque category (compared to some other alternatives). For
example, how often do you need to drive something very light that rotates very fast (besides a fan)?
Yet that is what DC motors are naturally best at. In contrast, robots need to pull loads (i.e., move
their bodies and manipulators, all of which have significant mass), thus requiring more torque and
less speed. As a result, the performance of a DC motor typically needs to be adjusted in that
direction, through the use of gears.
Gearing
The force generated at the edge of a gear is equal to the product of the radius of the gear and its
torque (F = r t), in the line tangential to its circumference. By combining gears with different radii,
we can manipulate the amount of force/torque the mechanism generates. The relationship between
the radii and the resulting torque is well defined, as follows: Suppose Gear1 with radius r1 turns
with torque t1, generating a force of t1/r1 perpendicular to its circumference. Now if we mesh it
with Gear2, with r2, which generates t2/r2, then t1/r1 = t2/r2. To get the torque generated by
Gear2, we get: t2 = t1 r2/r1. Intuitively, this means: the torque generated at the output gear is
If the output gear is larger than the input gear, the torque increases. If the output gear is smaller
than the input gear, the torque decreases. Besides the change in torque that takes place when gears
are combined, there is also a corresponding change in speed. To measure speed we are interested in
the circumference of the gear, C= 2 * pi * r. Simply put, if the circumference of Gear1 is twice that
of Gear2, then Gear2 must turn twice for each full rotation of Gear1. If the output gear is larger
than the input gear, the speed decreases. If the output gear is smaller than the input gear, the speed
increases. In summary, when a small gear drives a large one, torque is increased and speed is
decreased. Analogously, when a large gear drives a small one, torque is decreased and speed is
increased. Thus, gears are used in DC motors (which we said are fast and low torque) to trade off
extra speed for additional torque. Gears are combined using their teeth. The number of teeth is not
arbitrary, since it is the key means of proper reduction. Gear teeth require special design so that
they mesh properly. If there is any looseness between meshing gears, this is called backlash, the
ability for a mechanism to move back \& forth within the teeth, without turning the whole gear.
Reducing backlash requires tight meshing between the gear teeth, but that, in turn, increases
friction. As you can imagine, proper gear design and manufacturing is complicated. To achieve
"three to one gear reduction (3:1)", we apply power to a small gear (say one with 8-teeth) meshed
with a large one (with 3 * 8 = 24 teeth). As a result, we have slowed down the large gear by 3 and
have tripled its torque. Gears can be organized in series ("ganged"), in order to multiply their
effect. For example, 2 3:1 gears in series result in a 9:1 reduction. This requires a clever
arrangement of gears. Or three 3:1 gears in series can produce a 27:1 reduction. This method of
multiplying reduction is the underlying mechanism that makes DC motors useful and ubiquitous.
It should come as no surprise that motors require more battery power (i.e., more current) than
electronics (e.g., 5 milliamps for the 68HC11 processor v. 100 milliamps - 1 amp for a small DC
motor). Typically, specialized circuitry is required. You need to learn about H-bridges and pulse-
width modulation there.
Servo Motors
It is sometimes necessary to be able to move a motor to a specific position. If you consider your
basic DC motor, it is not built for this purpose. Motors that can turn to a specific position are
called servo motors and are in fact constructed out of basic DC motors, by adding:
A regular DC motor can be used for continuous rotation. Furthermore, servo motors can also be
retrofitted to provide continuous rotation (remember, they only to 180 otherwise), like this:
Research into shape memory alloys, polymer gels and micro-mechanism devices is ongoing and
changing often. Nickel-titanium alloys were first discovered by the Naval Ordinance Laboratory
decades ago and the material was termed NiTinOL. These materials have the intriguing property
that they provide actuation through cycling of current through the materials. It undergoes a ‘phase
change’ exhibited as force and motion in the wire. At room temperature Muscle Wires are easily
stretched by a small force. However, when conducting an electric current, the wire heats and
changes to a much harder form that returns to the "unstretched" shape -- the wire shortens in length
with a usable amount of force. NiTinOL can be stretched by up to eight percent of their length and
will recover fully, but only for a few cycles. However when used in the three to five percent range,
Muscle Wires can run for millions of cycles with very consistent and reliable performance.
The robot connects to a computer, which keeps the pieces of the arm working together. This
computer is the controller. The controller functions as the "brain" of the robot. The controller can
also network to other systems, so that the robot may work together with other machines, processes,
or robots.
Given that the robot arm movement is appropriate to its application, that the arm strength and
rigidity meet the payload needs and that servo drives provide the necessary speed of response and
resolution, a robot controller is required to manage the arm articulations, its End Effector, and the
interface with the workplace. The simplest type of control, still widely used, is "record-playback,"
or "lead-through". An operator positions arm articulations to desired configurations. At each
desired location the articulation encoder positions are recorded in memory. Step by step, an entire
work-cycle sequence is recorded. Then in playback mode the sequence is observed and modified.
As applications become more challenging, some jobs require continuous path control of an End
Effector. For this action all articulations must be programmed in speeds appropriate to the
particular task. This requires programming for the control of the robot. Robots today have
controllers run by programs -- sets of instructions written in code. The program sets limits on what
the robot can do. These requirements call into play sophisticated computer-based controllers and
so-called robot languages. These languages permit a kind of robot control known as hierarchical
control, in which decision making by the robot takes place on several levels. These levels are
interconnected by feedback mechanisms that inform the next higher level of the status of previous
actions. The advantage of a general-purpose robot arm is that it can be programmed to do many
jobs. The disadvantage is that the programming tends to be a job for highly paid engineers. Even
when a factory robot can perform a task more efficiently than a person, the job of programming it
and setting up its workplace can be more trouble than it worth. Commotion Systems, a new
California firm, is developing easier ways to program robots using pre-designed software modules.
For now though, the job of "training" robots is still one of the main reasons that they are not used
more. In the future, controllers with Artificial Intelligence could allow robots to think on their own,
even program themselves. This could make robots more self-reliant and independent. Angelus
Feedback control is a means of getting a system (in our case a robot) to achieve and maintain a
desired state by continuously comparing its current and desired state. The desired state is also
called the goal state of the system. Note that it can be an external or internal state: for example, a
thermostat monitors and controls external state (the temperature of the house), while a robot can
control its internal state (e.g., battery power, by recharging at proper times) or external state (e.g.,
distance from a wall). If the current and desired states are the same, the control system does not
need to do anything. But if they are not, how does it decide what to do? That is what the design of
the controller is all about. A control system must first find the difference between the current and
desired states. This difference is called the error, and the goal of any control system is to minimize
that error. In some systems, the only information available about the error is whether it is 0 or non-
0, i.e., whether the current and desired states are the same. This is very little information to work
with, but it is still a basis for control and can be exploited in interesting ways. Additional
information about the error would be its magnitude, i.e., how "far" the current state is from the
desired state. Finally, the last part of the error information is itsdirection, i.e., is the current state too
close or too far from the desires state (in whatever space it may be). Control is easiest if we have
frequent feedback providing error magnitude and direction. Notice that the behavior of a feedback
system oscillates around the desired state. In the case of a thermostat, the temperature oscillates
around the set point, the desired setting. Similarly, the robot's movement will oscillate around the
desired state, which is the optimal distance from the wall. How can we decrease this oscillation?
We can use a smoother/larger turning angle, and we can also use a range instead of aset
point distance as the goal state. Now what happens when you have sensor error in your system?
What if your sensor incorrectly tells you that the robot is far from a wall, but in fact it is not? What
about vice versa? How might you address these issues? Feedback control is also called closed loop
controlbecause it closes the loop between the input and the output, i.e., it provides the system with
a measure of "progress."
The alternative to closed loop control is open loop control. This type of control does not require
the use of sensors, since state is not fed back into the system. Such systems can operate (perform
repetitive, state-independent tasks) only if they are extremely well calibrated and their environment
does not change in a way that affects their performance. We have talked about feedback control so
far, but there is also an important notion of feed forward control. In such a system, the controller
determines set points and sub-goals for itself ahead of time, without looking at actual state data.
Reactive control is based on a tight loop connecting the robot's sensors with its effectors. Purely
reactive systems do not use any internal representations of the environment, and do not look ahead:
they reactto the current sensory information. Thus, reactive systems use a direct mapping between
sensors and effectors, and minimal, if any, state information. They consist of collections of rules
that map specific situations to specific actions. If a reactive system divides its perceptual world
into mutually exclusive or unique situations, then only one of those situations can be triggered by
any sensory input at any one time, and only one action will be activated as a result. This is the
simplest form of a reactive control system. It is often too difficult to split up all possible situations
this way, or it may require unnecessary encoding. Consider the case of multiple sensors: to have
mutually-exclusive sensory inputs, the controller must encode rules for all possible sensory
combinations. There is an exponential number of those. This is, in fact, the robot's entire sensory
space (as we defined earlier in the semester). This space then needs to be mapped to all possible
actions (the action space), resulting in the complete control space for that robot. Although this
mapping is done while the system is being designed, i.e., not at run-time, it can be very tedious, and
it results in a large look up table which takes space to encode/store in a robot, and can take time to
search, unless some clever parallel look up technique is used. In general, this complete mapping is
not used in hand-designed reactive systems. Instead, specific situations trigger appropriate actions,
and default actions are used to cover all other cases. Human designers can effectively reduce the
sensory space to only the inputs/situations that matter, map those to the appropriate actions, and
thus greatly simplify the control system. If the rules are not triggered by mutually-exclusive
conditions, more than one rule can be triggered in parallel, resulting in two or more different
actions being output by the system. Deciding among multiple actions or behaviors is
called arbitration, and is in general a difficult problem. Arbitration can be done based on
learning (process priorities may be initialized or not, and are learned at run-time, once or
repeatedly/dynamically)
If a reactive system needs to support parallelism, i.e., the ability to execute multiple rules at
once, the underlying programming language must have the ability to multi-task, i.e., execute several
processes/pieces of code in parallel. The ability to multi-task is critical in reactive systems: if a
system cannot monitor its sensors in parallel, but must go from one to another in sequence, it may
miss some event, or at least the onset of an event, thus failing to react in time. Now that we
understand the building blocks of a reactive system (reactive rules coupling sensors and effectors,
i.e., situations and actions), we need to consider principled ways of organizing reactive controllers.
We will start with the best known reactive control architecture, the Subsumption Architecture,
introduced by Rod Brooks at MIT in 1985.
4. Components are organized in layers, from the bottom up lowest layers handle most basic
tasks
6. Each component provides and does not disrupt a tight coupling between sensing and action
7. There is no need for internal models: "the world is its own best model"
assume that the 0th layer is constructed, debugged, and installed first. As layer 1 is added, layer
0 continues to function, but may be influenced by layer 1, and so on up. If layer 1 fails, layer 0 is
unaffected. When layer 1 is designed, layer 0 is taken into consideration and utilized, i.e., its
existence is subsumed, thus the name of the architecture. Layer 1 can inhibit the outputs of layer 0
or suppress its inputs. Subsumption systems grow from the bottom up, and layers can keep being
added, depending on the tasks of the robot. How exactly layers are split up depends on the specifics
of the robot, the environment, and the task. There is no strict recipe, but some solutions are better
than others, and most are derived empirically. The inspiration behind the Subsumption
Architecture is the evolutionary process, which introduces new competencies based on the existing
ones. Complete creatures are not thrown out and new ones created from scratch; instead, solid,
useful substrates are used to build up to more complex capabilities.
Behavior-based systems (BBS) use behaviors as the underlying module of the system, i.e., they
use a behavioral decomposition. Behaviors can vary greatly from one BBS to another, but typically
have the following properties:
5. Behaviors can directly connect sensors and effectors (i.e., take inputs from sensors and send
outputs to effectors)
6. Behaviors can also take inputs from other behaviors and send outputs to other behaviors (this
allows for building networks)
7. Behaviors are typically higher-level than actions (go-home rather than turn-left-by-37.5-
degrees)
9. When assembled into distributed representations, behaviors can be used to look ahead but at a
time-scale comparable with the rest of the behavior-based system
Behavior-based systems are not limited in the ways that reactive systems are. As a result, behavior-
based systems have the following key properties:
2. The ability to use representations to generate efficient (not only reactive) behavior
3. The ability to use a uniform structure and representation throughout the system (so no
intermediate layer)
The key challenge is in how representation (i.e., any form of world model) can be
effectivelydistributed over the behavior structure. In order to avoid the pitfalls of deliberative
systems, the representation must be able to act on a time-scale that is close if not the same as the
real-time parts of the system. Similarly, to avoid the pitfalls of the hybrid systems approach, the
representation needs to use the same underlying behavior structure as the rest of the system. Note
that behavior-based systems can have reactive components to them, i.e., not every part of a
behavior-based system needs to be involved with representational computation. In fact, many
behavior-based systems did not use complex representations at all. As long as they use behaviors
(not just rules), they are BBS.
2.5 Arms
The robot arm comes in all shapes and sizes and is the single most important part in robotic
architecture. The arm is the part of the robot that positions the End Effector and Sensors to do their
Many robots resemble human arms, and have shoulders, elbows, wrists, even fingers. This gives a
robot lot of options for moving, and helps it do things in place of a human arm. In order to reach
any possible point in space within its work envelope, a robot uses a total of 7 degrees of freedom.
Each direction a joint can go gives an arm 1 degree. So, a simple robot arm with 3 degrees of
freedom could move in 3 ways: up and down, left and right, forward and backward. Many robots of
today are designed to move with these 7 degrees of freedom.
The human arm is an amazing design. It allows us to place our all-purpose end effector, the hand,
where it is needed. Jointed arm robots mimic the ability of human arms to be flexible, precise, and
ready for a wide variety of tasks. The jointed-arm robot has six degrees of freedom, which enable it
to perform jobs that require versatility and dexterity. The design of a jointed-arm robot is similar to
a human arm, but not exactly the same.
The robotic arm is very similar to the human arm in that it has the capability of having 7 and not
6 degrees of movement, as previously thought. Out of the 7 degrees of movement, your shoulder
has 3 of the arm’s 7 degrees of freedom. The easiest way to explain the movement of the robotic
arm is to use your own arm as an example. Hold out your arm and follow along . . .
The term "artificial intelligence" is defined as systems that combine sophisticated hardware and
software with elaborate databases and knowledge-based processing models to demonstrate
characteristics of effective human decision making. The criteria for artificial systems include the
following: 1) functional: the system must be capable of performing the function for which it has
been designed; 2) able to manufacture: the system must be capable of being manufactured by
existing manufacturing processes; 3) designable: the design of the system must be imaginable by
designers working in their cultural context; and 4) marketable: the system must be perceived to
Robotics is one field within artificial intelligence. It involves mechanical, usually computer-
controlled, devices to perform tasks that require extreme precision or tedious or hazardous work by
people. Traditional Robotics uses Artificial Intelligence planning techniques to program robot
behaviors and works toward robots as technical devices that have to be developed and controlled by
a human engineer. The Autonomous Robotics approach suggests that robots could develop and
control themselves autonomously. These robots are able to adapt to both uncertain and incomplete
information in constantly changing environments. This is possible by imitating the learning process
of a single natural organism or through Evolutionary Robotics, which is to apply selective
reproduction on populations of robots. It lets a simulated evolution process develop adaptive
robots.
The artificial intelligence concept of the "expert system" is highly developed. This describes robot
programmer’s ability to anticipate situations and provide the robot with a set of "if-then" rules. For
example, if encountering a stairwell, stop and retreat. The more sophisticated concept is to give the
robot the ability to "learn" from experience. A neural network brain equipped onto a robot will
allow the robot to sample its world at random. Basically, the robot would be given some life-style
goals, and, as it experimented, the actions resulting in success would be reinforced in the brain.
This results in the robot devising its own rules. This is appealing to researchers and the community
as it parallels human learning in lots of ways.
Artificial intelligence dramatically reduces or eliminates the risk to humans in many applications.
Powerful artificial intelligence software helps to fully develop the high-precision machine
capabilities of robots, often freeing them from direct human control and vastly improving their
productivity. When a robot interacts with a richly populated and variable world, it uses it senses to
gather data and then compare the sensate inputs with expectations that are imbedded in its world
model. Therefore the effectiveness of the robot is limited by the accuracy to which its programming
models the real world.
Industrial robots are rarely mobile. Work is generally brought to the robot. A few industrial robots
are mounted on tracks and are mobile within their work station. Service robots are virtually the
only kind of robots that travel autonomously. Research on robot mobility is extensive. The goal of
the research is usually to have the robot navigate in unstructured environments while encountering
unforeseen obstacles. Some projects raise the technical barriers by insisting that the locomotion
involve walking, either on two appendages, like humans, or on many, like insects. Most projects,
however, use wheels or tractor mechanisms. Many kinds of effectors and actuators can be used to
move a robot around. Some categories are:
Wheels
Wheels are the locomotion effector of choice. Wheeled robots (as well as almost all wheeled
mechanical devices, such as cars) are built to be statically stable. It is important to remember that
wheels can be constructed with as much variety and innovative flair as legs: wheels can vary in size
and shape, can consist of simple tires, or complex tire patterns, or tracks, or wheels within cylinders
within other wheels spinning in different directions to provide different types of locomotion
properties. So wheels need not be simple, but typically they are, because even simple wheels are
quite efficient. Having wheels does not imply holonomicity. 2 or 4-wheeled robots are not usually
holonomic. A popular and efficient design involves 2 differentially-steerable wheels and a passive
caster. Differential steering means that the two (or more) wheels can be steered separately
Legs
While most animals use legs to get around, legged locomotion is a very difficult robotic problem,
especially when compared to wheeled locomotion. First, any robot needs to be stable (i.e., not
wobble and fall over easily). There are two kinds of stability: static and dynamic. A statically
stable robot can stand still without falling over. This is a useful feature, but a difficult one to
achieve: it requires that there be enough legs/wheels on the robot to provide sufficient static points
of support. For example, people are not statically stable. In order to stand up, which appears
effortless to us, we are actually using active control of our balance, though nerves and muscles and
tendons. This balancing is largely unconscious, but must be learned, so that's why it takes babies a
while to get it right, and certain injuries can make it difficult or impossible. With more legs, static
stability becomes quite simple. In order to remain stable, the robot's center of gravity (COG) must
fall under its polygon of support. This polygon is basically the projection between all of its support
points onto the surface. So in a two-legged robot, the polygon is really a line, and the COG cannot
be stably aligned with a point on that line to keep the robot upright. However, a three-legged robot,
with its legs in a tripod organization, and its body above, produces a stable polygon of support, and
is thus statically stable. But what happens when a statically stable robot lifts a leg and tries to
move. Does its COG stay within the polygon of support? It may or may not, depending on the
geometry. For certain robot geometries, it is possible (with various numbers of legs) to always stay
statically stable while walking. This is very safe, but it is also very slow and energy inefficient. A
basic assumption of the static gait (statically stable gait) is that the weight of a leg is negligible
compared to that of the body, so that the total center of gravity (COG) of the robot is not affected
by the leg swing. Based on this assumption, the conventional static gait is designed so as to
maintain the COG of the robot inside of the support polygon, which is outlined by each support
leg's tip position. The alternative to static stability is dynamic stability which allows a robot (or
animal) to be stable while moving. For example, one-legged hopping robots are dynamically stable:
they can hop in place or to various destinations, and not fall over. But they cannot stop and stay
standing (this is an inverse pendulum balancing problem).
A statically stable robot can use dynamically-stable walking patterns, to be fast, or it can use
statically stable walking. A simple way to think about this is by how many legs are up in the air
during the robot's movement (i.e., gait). 6 legs is the most popular number as they allow for a very
stable walking gait, the tripod gait . If the same three legs move at a time, this is called the
alternating tripod gait. if the legs vary, it is called the ripple gait. A rectangular 6-legged robot can
lift three legs at a time to move forward, and still retain static stability. How does it do that? It uses
the so-called alternating tripod gait, a biologically common walking pattern for 6 or more legs. In
this gait, one middle leg on one side and two non-adjacent legs on the other side of the body lift and
move forward at the same time, while the other 3 legs remain on the ground and keep the robot
statically stable. Roaches move this way, and can do so very quickly. Insects with more than 6 legs
(e.g., centipedes and millipedes), use the ripple gate. However, when they run really fast, they
switch gates to actually become airborne (and thus not statically stable) for brief periods of time.
Statically stable walking is very energy inefficient. As an alternative, dynamic stability enables a
In solving problems, the Spider is aided by the spring quality of its 1 mm steel wire legs. Hold one
of its feet in place relative to the body and the mechanism keeps turning, the obstructed motor
consuming less than 40 mA while it bends the leg. Let go and the leg springs back into shape. As I
write this, the Spider is scrambling up and over my keyboard. Some of its feet get temporarily stuck
between keys, springing loose again as others push down. It has no trouble whatsoever with this
obstacle, nor with any of the others on my cluttered desk - even though it is still utterly brainless.
As the feet rise to a maximum of 2 cm off the floor, a cassette box is about the tallest vertical
obstacle that the Spider is able to step onto. Another limitation is slope. When asked to sustain a
climb angle of more than about 20 degrees, the Spider rolls over backwards. And even this fairly
modest angle (extremely steep for a car, by the way) requires careful gait control, making sure
that both rear legs do not lift at the same time. Improvements are certainly possible. Increasing step
size would require a longer body (more distance between the legs) and thus a different gear train. A
better choice might be more legs, like 10 or 12 on a longer body, but with the same size gear
wheels. That would give better traction and climbing ability. And if a third motor is allowed, one
might construct a horizontal hinge in the `backbone'. Make a gear shaft the center of a nice, tight
hinge joint. Then the drive train will function as before. Using the third motor and a suitable
mechanism, the robot could raise its front part to step onto a tall obstacle, somewhat like a
caterpillar. But turning on the spot becomes difficult.
Ask a number of people to describe a robot and most of them will answer they look like a human.
Interestingly a robot that looks like a human is probably the most difficult robot to make. It is usually
a waste of time and not the most sensible thing to model a robot after a human being. A robot needs to
be above all functional and designed with qualities that suit its primary tasks. It depends on the task at
hand whether the robot is big, small, and able to move or nailed to the ground. Each and every task
means different qualities, form and function; a robot needs to be designed with the task in mind.
Mobile Robots
Stationary Robots
Robots are not only used to explore areas or imitate a human being.
Most robots perform repeating tasks without ever moving an inch.
Most robots are ‘working’ in industry settings. Especially dull and
repeating tasks are suitable for robots. A robot never grows tired; it
will perform its duty day and night without ever complaining. In
case the tasks at hand are done, the robots will be reprogrammed to
perform other tasks.
Autonomous Robots
Remote-control Robots
Virtual Robots
Virtual robots don’t exits in real life. Virtual robots are just programs, building blocks of software
inside a computer. A virtual robot can simulate a real robot or just perform a repeating task. A special
kind of robot is a robot that searches the world wide web. The internet has countless robots crawling
from site to site. These WebCrawler’s collect information on websites and send this information to the
search engines.
Another popular virtual robot is the chatterbot. These robots simulate conversations with users of
the internet. One of the first chatterbots was ELIZA. There are many varieties of chatterbots now,
including E.L.V.I.S.
BEAM Robots
Biology
Robots are often modeled after nature. A lot of BEAM robots look remarkably like insects. Insects
are easy to build in mechanical form. Not just the mechanics are in inspiration also the limited
behavior can easily be programmed in a limited amount of memory and processing power.
Like all robots they also contain electronics. Without electronic circuits the engines cannot be
controlled. Lots of Beam Robots also use solar power as their main source of energy.
Aesthetics
A BEAM Robot should look nice and attractive. BEAM robots have no printed circuits with some
parts but an appealing and original appearance.
Mechanics
In contrast with expensive big robots BEAM robots are cheap, simple, built out of recycled material
and running on solar energy.
Building robots is great fun, but just imagine a robot that can 'think' for its self. Adding a brain to
your robot need not be a hard process, and will allow your robot to follow instructions and rules.
Basically, robot brains come in two forms, analogue and digital.
Analogue Brains
It is possible to control your robots actuators (motors etc) using 'hard wired' circuits. By making
circuits from capacitors, transistors and resistors you can make robots that can follow simple rules.
For example, if they hit a wall a simple switch positioned on the front of the robot would be pressed
in and the robot would be able to reverse and turn, hopefully avoiding the obstacle on its next pass.
Analogue brains have their disadvantages though. They require quite a good knowledge of
electronics to design, and once they are built are very difficult to change. If you want to change the
behavior of your design you will probably need to totally rebuild your analogue brain.
Analogue circuits are generally not recommended for beginners in electronics or robotics, there is
another option: Digital Brains
Digital Brains
Devices called microcontrollers make perfect 'brains' for robots. They are small computers on a
single chip, containing their own memory and processor, and can be programmed by a PC to
control your robot in any way you can imagine.
What makes micro controllers so good is that they can be re programmed again and again with just
Programming these chips is fairly easy to learn, but may take a bit of patience to fully understand.
Learning to program by sticking your head in a textbook and trying to memorize programs is a very
slow and boring way to learn. By far the easiest way to master programming is to have a go, work
through a few tutorials and try out some examples. By playing about and trying ideas you'll soon
get an understanding of how programs work, and how you can write your own.
4.1.2 Motors
Motors are one of the most common methods used to move robots around. They can be connected
to gears and wheels and are a perfect way of adding mobility to your robot. There are many types
of motor, and this tutorial will cover the main ones useful for robotics.
DC Motors:
These are the most common and easy to use motor available. They are connected to a power supply
by two wires. The direction of the motor shaft rotates can be changed by reversing the polarity
(swap the positive and negative wires) of the motor supply voltage.
Unfortunately motors use quite a bit of current, so you can’t just plug them straight into your
processor and expect them to work; the processor won't be able to supply the motor with enough
current. We need to find a way of turning the motors on and off using the processor. This can be
done by many methods, including transistors, relays or a motor driver chip. The Robocore contains
two motor driver chips that can control up to 4 DC motors simultaneously. Connecting motors to
the Robocore couldn't be simpler. Just connect the 2 wires of each motor to one of the motor
outputs on the Robocore and your ready to go. The motor is controlled by 2 output pins on the
processor, lets say pin 1 and pin 2. The motors direction can be changed by different outputs of the
pins. See table below
On Off Clockwise
Off On Anti-Clockwise
For help programming the chip to do this have a look at the motor programming guide.
Servo motors are perfect control motors, They can be told to rotate to a
specific position, making them ideal for anything that requires precision
movement. Most servo motors can rotate through about 90 to 180
degrees, some rotate through a full 360 degrees. Servo's however, are
unable to continually rotate, meaning they can't be used for driving
wheels, but their precision movement makes them ideal for powering
legs, controlling rack and pinion steering and much more.
If you want to learn more about servo motors take a look at the intermediate section of the tutorials.
Stepper Motors:
Stepper motors work in a similar way to dc motors, but where dc motors have 1 electromagnetic
coil to produce movement, stepper motors contain many. Stepper motors are controlled by turning
each coil on and off in a sequence. Every time a new coil is energized, the motor rotates a few
degrees, called the step angle. Repeating the sequence causes the motor to move a few more
degrees and so on, resulting in a constant rotation of the motor shaft. For example, a stepper motor
with a step angle of 7.5 degrees requires 48 pulses for a complete revolution, or 96 pulses for 2
complete revolutions.
The diagram below shows how a stepper motor works. The magnet in the middle of the
arrangement is connected to the motor shaft and produces the rotation. The 4 magnets around the
outside represent each coil of the stepper motor. As different coils are energized the central magnet
is pulled in different directions. By applying the correct sequence of pulses to the coils the motor
can be made to rotate.
4.1.3 Sensors
The world we live in is a complex place. We have many senses to help us to understand our
surroundings. In order to safely move around robots also need some way of understanding their
world. The easiest way of doing this is to add simple sensors to you robot.
Bump Sensor:
So, you've fitted some motors to your robot and its happily driving around but it probably keeps
colliding with obstacles and getting stuck. You need a way for your robot to detect collisions and
move around objects. Enter the humble bump sensor:
A bump sensor is probably one of the easiest ways of letting your robot know it's collided with
something. The simplest way to do this is to fix a micro switch to the front of your robot in a way
so that when it collides the switch will get pushed in, making an electrical connection. Normally the
switch will be held open by an internal spring.
Micro switches are easy to connect to micro controllers because they are either off or on, making
them digital. All micro controllers are digital, so this is a match made in heaven. Micro switch
'bump' sensors are easily connected to the Robocore, simply plug them into any free digital socket
and away you go.
Light Sensor:
Light sensors are perfect for making your robot more interesting. With some light sensors you can
make your robot follow a light, hide in the dark or even turn on some funky headlights if the light
level got a bit low (under a table for example).
Light sensors are basically resistors that change their value according to how much light is shining
onto them.
They are easy to connect to the Robocore, with a simple circuit they can be plugged straight into a
free analogue socket. Getting results from them can't be simpler. Get the processor to take a reading
from the socket that the sensors connected to. A high value means not much light is falling on the
sensor; a low value means a lot of light is falling on the sensor.
4.1.4 BodyWork
So now you've learned about how to use some electronics to make a thinking control station for
your robot but you've still got the problem of building a platform to carry all of your bits around on.
A great way of building a robot chassis is to hit the garage. Find any scrap you can and get
building. It's amazing what you can do with a bit of imagination and some of the stuff you've
probably got lying about. I made one of my favorite robots out of an old hard drive cage. With a bit
of chopping and sawing I screwed on a couple of motors and gearboxes, fixed some wheels from an
old toy car and I had a great chassis.
Another good material for building robots is the famous Lego brick. It may not be the strongest
material but it gives you the freedom to totally dismantle your robot and build something new.
Electronics and batteries can be attached quite easily with elastic bands.
1) Lets start by connecting your Robocore to the power supply and the serial port of your computer,
and loading up the BasicX software.
2) When this is loaded, click on the Monitor Port menu and select the COM port that the Robocore
is connected to (probably COM1). The Download Port menu should be set to the same COM port.
3) Click the editor button. A window should open asking for a filename. Just type a name for your
first program, let’s say Demo_prog. It will tell you that the file does not exist, so do you want to
create it. Click yes.
To test that the BasicX is working, we will make it send a message back to your computer. This is
done using the [Link] command.
Type the following program into the editor window (or copy and paste it). The first and last lines
should already be present, if they are just copy the middle line.
Sub main()
End Sub
Before we can download to the BasicX we need to set the chip preferences. This basically tells the
chip what we want to be doing with each pin (input, output etc). To do this click on the project
menu, followed by chip (or the F7 shortcut). We can leave everything as it is for now so just click
on OK.
Now click on the Compile menu and select Compile and Run (keyboard shortcut F5) This will send
the code to the Robocore. Going back to the main BasicX window, you should see the text '
Robocore test: Everything is working ' appear on the screen.
The Sub main() and End Sub commands tell the Robocore where the program begins and ends.
The [Link] command is very useful for telling us what the Robocore is doing, in the next case
we will see more of its capabilities.
Now we will make the Robocore solve an equation for us. To do this we will need a variable. This
is a value stored under a name in the memory of the Robocore. We will give this variable the name
' answer '.
End Sub
Run the program as before and you should get the computer telling you the answer.
This program shows that you can print values from your program to the screen using [Link]
just by adding a semi-colon and the variable name after the "text", this is very handy for example
when testing sensors.
The program also uses comments, these have no effect on the program but allow us to add
information about each line of the program. The computer ignores everything written on the line
after an apostrophe (').
This program has also introduced us to variables, the topic for the next tutorial in the programming
series
Variables are values stored in computer memory. We need to use them for almost every program to
allow the Robocore to remember things. There are various different types of values, for example
strings, which are text values, and integers, which are whole number values.
The computer needs you to tell it what type of value you want to use, otherwise it will get
confused.
Each type of variable has its uses and limitations, which is why there are simple methods for
switching between variable types. This was shown in the last tutorial, lets look at that program
again line by line.
Sub main()
Dim answerI As integer ' declaring
Dim answer As string ' variables
Here the integer variable is used, this is because mathematical functions can be performed using it
such as multiplication
Using the CStr statement the integer value held in answerI is converted into a string and held in
answer, this is a text variable allowing the answer to be printed to the screen using [Link].
Variables can have nearly any name, but you cannot use words that are otherwise used in the
programming language, and it is best to keep them simple, either a single letter, or a word
describing what the variable does.
Other types of variables are available. One of the types used commonly in robotics is the Boolean
variable. This provides us with a true or false value.
For example a bump sensor will either be pressed or not pressed, so the Boolean variable for it will
either be true (pressed) or false.
Boolean logic is commonly used with conditional statements, these are covered in the next section.
There is also the Single variable type, which allows floating point numbers e.g 2.43 or -0.66, this is
occasionally useful in robotics when more maths is necessary.
Until now our programming has been limited to running through the code once, and then the
program stops functioning. This is clearly not suitable for a robot, which must be able to follow it's
commands continuously for the length of time it is switched on. To do this we use loops.
We also want our robots to make decisions based on data from its sensors, for this we need
conditional statements. Loops themselves contain conditional statements in order to tell them when
There are several different loop commands, letting us control the function of the robot in a variety
of ways.
Do Loops:
The simple Do loop can be used to enclose your whole program, when it reaches the end of the
code it returns to the beginning and starts again. We can apply this to our program used in the
introduction.
Sub main()
Dim answer As string
Dim answerI As integer
Do 'start of loop
answerI = 5*5
answer=Cstr(answerI)
[Link] "The answer is "; answer
As you will see when you run this program, the statement is no longer displayed once, but
continues to print as long as the program runs (you should press the reset button to stop it)
Now for something slightly more useful. We can add a conditional statement to the do loop by
using a ' while ' statement. This lets us tell the Robocore when to stop looping.
Sub main()
End Sub
Using the conditional statement ' while ' and a new integer variable i we have made the
50 CSEU 08105 – Robotics and Intelligent Systems. Prepared by H. Fimbombaya
Robocore loop only 10 times (note that as 10 is not less than 10 the program will stop
after the I = 9 loop)
For Loop:
We can set up the same loop using the for statement remove the Do while, Loop and i=i+1 lines
and replace them with:
Loop Next
The loop runs from 1 to 10 stepping up 1 each loop, this removes the need for the line I=I+1.
Now for something a little more complex, instead of just doing one sum, we can automate the
Robocore to do 10 different sums for us by changing the equation to
AnswerI = I*5
Now the Robocore takes the number of loops completed and multiplies it by five. When you run
this program you should now get the answers 5,10,15 up to 50.
If Statement:
We can run a conditional statement without using a loop with an if statement. These are used as
follows
if (GetPin(switch)=1) then
[Link]"switch pressed"
call sleep(0.15)
end if
Loop
End Sub
The best way to learn is to experiment, make your own program with what you've learnt and you'll
soon feel more confident
The principles of DC motors are covered in the earlier sections of these notes. This section will
cover the electronics needed to interface them to a BasicX microcontoller or other digital chip.
The easiest way of controlling motors is using the Robocore. This board contains the driver
electronics to control up to 4 DC motors or 2 stepper motors, and features direction LED's for easy
debugging of circuits.
However, if you want to build your own motor drivers to use in custom projects there are various
methods that you can use.
A circuit called an H bridge circuit will give you direction control of your DC motor. Below is the
circuit diagram.
Transistors are electronic switches, they allow you to turn on large voltages (the motor power
supply) using a very small current (like the output pin of the Basic X). Each pair of transistors is
connected to a pin on the micro controller and control the polarity of the current supplied to the
motor. The actual components required would depend on the size of the motors that you want to
use.
The diodes in the circuit are very important and are called fly back diodes. They are there to
prevent voltage spikes from the motors from destroying the transistors. When a motor rotates and
changes direction the coils of wire inside it act as a generator and produce a current. This current is
called the back electro motive force, or back E.M.F. for short. This current travels back through the
The diodes job is to protect the transistor. It allows this back E.M.F. to bypass the transistor and
travel safely back to the battery.
The circuit can be powered using whatever voltage is suitable for your motors. If you are using two
power supplies, one to power your Basic X and another to power your motors, you must connect
the ground of each supply together or your circuit may not work properly.
If you're looking for specific components to build the circuit the following will handle most motors
up to about 12 volts.
Diodes: IN4002
This tutorial will look at how you can use feedback to control and regulate the speed of motors (or
anything else that rotates). Let's say that you want your robot to travel at a steady speed that uses
60% power to the motors. This constant power supply would work fine on flat ground but what
would happen if it encountered a hill, would it have enough power to handle a steep incline or
would it slow to a crawling speed.
This problem could be overcome with feedback. If you could somehow sense the rotational speed
of the wheels you could deliver more power to the motors if they slow down (climbing a hill or
overcoming an object) or apply some breaking if they
are rotating too fast (travelling downhill), but always
maintaining a steady speed.
For a perfect example of how shaft encoders work take a look inside your mouse. You will see a
disk with holes around the edges. On either side of the disk are an infra red emitter and infra red
Shaft encoders for robots use exactly the same principle. A card disk similar to
the one on the right can attached to the drive shaft of the wheel and used to break
an IR beam between the emitter and detector.
The diagram below shows how to connect the shaft encoder available in the
components section of the Robologic shop to the Robocore. The disk rotates
through the 'U' of the sensor and creates an electrical pulse at the signal line every time the IR beam
is made of broken. The only external component needed is a 330 ohm resistor.
A good feature of using shaft encoders to monitor wheel movement is that they are totally friction
free, meaning that there is no loss of drive power when they are used.
If the pre-moulded 'U' design does not fit your specifications then the sensor can be constructed
from separate emitter and detector components wired in the same was as above and mounted on
your own design. The emitter and detector may need to be shielded with some black card or
something similar to prevent them from detecting any ambient infra red.
Programming Techniques
As your projects gain complexity it may use many different sensors and actuators. You will need a
way to effectively use all this information to produce reliable results.
There are two types of algorithm that can be used to do this. The first is called sensor fusion. This
approach uses information from all of the sensors simultaneously to create a constant world model
of its surroundings.
This sort of model is very difficult to program and requires massive amounts of computational
power, and so is not really suited to the world of hobby robots.
For this example lets say that you have built a robot that is going to follow light around the room
using LDR sensors. The robot also has an ultrasound proximity sensor and bump micro switches to
detect obstacles.
The bump sensor takes the highest priority, which makes sense, if your robot is stuck against a wall
you don't want to be worrying about following a light source.
Cruise has the lowest priority, its basically saying drive forwards until you find a light to follow (or
an obstacle to avoid).
The ultrasound sensor has a lower priority than the bump sensor because you ideally want to avoid
objects before you collide with them.
Multitasking
One of the most powerful features of the BasicX operating system is its ability to multitask. This
means it can run several tasks at the same time. It's possible to divide large programs into smaller
manageable tasks that can communicate with each other.
There is more information in the BasicX documentation about multitasking, this is a brief tutorial
that aims to outline a simple implementation of multitasking and not re write the BasicX manual.
The following sample of code simply turns the onboard red and green led's on and off but hopefully
demonstrates how multitasking is implemented in the BasicX programming language.
Task 2 switches a global variable, led, between 0 and 1. Task 1 looks at the global variable and
toggles the red and green led's according to its value.
Processing time is given to other functions by calling the sleep command. We use the main
procedure to call the tasks using the call task command, and then we enter an infinite loop which
sub main()
calltask "task1", Stacktask1
calltask "task2", Stacktask2
do
call sleep(2.0) 'do nothing and give all time to other tasks
loop
end sub
sub task1()
do
call sleep(0.0) 'allow other tasks to run
if(led=0)then
call putpin(25,0)
call putpin(26,1)
end if
loop
end sub
sub task2()
do 'Set global variable LED
call sleep(1.0)
led=1
call sleep(1.0)
led=0
loop
end sub
Multitasking has some draw backs to sequential programming; mainly multitasking software
generally uses more memory as each process is allocated its own stack. Also, because the processor
is frequently switching tasks software can run slightly slower. However these are small limitations
when compared to the powerful system of multitasking.
Detailed Questions
1. Explain in robot programming development process and requirements in detail. Give at least
five points. (10 Marks)
2. Write a PLC ladder logic program to control the robot arm. The robot is supposed to pick ten
cubes from the box and place on the table where it will be snapped and then placed in the
conveyor belt, if detected by the camera. If the camera does not detect the cube in 30 seconds
all the process should be stopped. Else if ten cubes are finished the system should sound alarm
and stop. (10 Marks)
3. What are the common robot errors and the sources of hazards in robotics? Give a detailed
explanation. (10 marks)
4. (a) Why do robots need sensors? Give at least five points. (4 marks)
(b) Describe your idea of using a GPS sensor in a mobile robot. Discuss accurately, how connected.
What application of the robot?(6 marks)
5. Draw the block diagram of the basic robotic systems and explain the basic components of a robot. (10
marks)