That's a good question; I'm sure there must be a compare & contrast
article somewhere, but I don't know of one of the top of my head. So
I'll wing it based on what I know, and hopefully others will chime in.
IR is nice and simple (I recommend the Sharp GP2Y0A21YK, available from
Junun.org among elsewhere); it simply gives you an analog signal that
corresponds to the distance of something in front of the sensor. It's a
continuous reading, and you can have as many of these on your bot as you
like, mounted in pretty much any fashion, and they will not interfere.
(Or at least, I've never heard of such a problem.) They are quite
reliable and not much affected by ambient light levels, color of the
objects, etc., though when the robot they're on is in motion, they tend
to work better mounted vertically than mounted horizontally.
Ultrasonic distance sensors (i.e. sonar) are generally for
longer-distance sensing. I haven't actually used these yet, but I think
they tend to work up to 5 meters or so. These have to be "pinged", and
they can interfere, so if you have multiple such sensors on your bot you
ping them one at a time in succession. That's no big deal; a bigger
problem is if you're in a room (or arena) with other bots also using
sonar, then the bots may pick up each other's pings and get rather
confused. FIRST LEGO League discourages the use of the ultrasonic range
sensor for this reason. (Why in the world LEGO doesn't include an IR
distance sensor in the standard kit, I can't imagine.)
Hope this gets you started -- use your google-fu to find out more; there
is a lot of information on these sensors out there.
Sorry to bother you again, but I just thought of some other issue. To
measure the distance to an object in 3 D, would using 1 sensor be
sufficient? Also, do we have to place a sensor at each link to ensure
that the robot will sense any obstacle?
I was wondering how many sensors would we need to know the location of
an object in 3D space, so we would know when to avoid colliding with
it for instance. Is there an optimal location of sensors on the
Joe - I'm afraid you're not entirely correct about this. I've found
that the classic sharp IR sensors are *quite* dependent on color and
type of object. I did an experiment where I graphed the output voltage
of an IR sensor looking at a white piece of paper, and at a black
piece of paper, at varying lengths, and the two plots were
substantially different from each other. Both had a fairly smooth
curve though. I found similar results by changing the texture of the
object being looked at.
That's interesting. I wonder if the sensor you tested is different from
the newer ones. AIUI, older sensors worked based on the (IR) brightness
of a reflected spot, whereas new ones work based on the *position* of
the reflected spot, just like a laser range finder (but of course these
inexpensive sensors are not using a laser). The position isn't much
affected by the reflectance or texture of the object -- except in an
extreme case, of course, where the spot is so absorbed that it can't be
reliably detected at all.
But, this is an understanding gleaned in typical human fashion from many
different sources, whose details are now lost, and may be all wet.
I used a new GP2Y0A02YK.
I thought it was an interesting result as well, since the sensor uses
a PSD, and PSDs are supposed to not be sensitive to the brightness of
the reflected spot. However, the results were verified by other people
with other parts. My suspicion was that some materials reflected the
light better than others, with the scattered light messing up
All PSD devices are suspectible to misreadings with high ambient light,
which can definitely occur when comparing an all-white object to an
all-black one. These sensors tend to be used in applications where the
reflective medium is known -- if it's a high-speed paper printer, for
example, it will be calibrated for white reflectivity. If it's for
automatic toilet flushing, it may be calibrated to an 18% gray (or some
other standard), approximating average clothing color tones. An
automatic sink faucet may be calibrated somewhat differently. These are
not meant as universal proximity/ranging sensors, though we in amateur
robotics often try to use them as such.
This is one why sensor fusion is so important. If you have 2-3 different
ranging technologies, and compare/constrast the outputs, you are more
likely to be able to determine a valid value. Some things, like thick
black velvet, will continue to be a difficult object to measure using
any non-contact sensor. Nothing -- even high-end vision systems, which
can also be fooled -- will ever be perfect.
Actually it's a good idea to use both (as well as other means, such as
mechanical limit switches). So-called sensor fusion helps to overcome
the peculiarities and limitations in each technology. It's rarely a good
idea to settle on just one type of sensor.
Isn't there any problem arise of using both types? From Joe's post it
seems like IR is mostly used for short-distance sensing and pretty
accurate. What kind of limitation are they beside the interference of
other sensors? If using both of them, do we have to configure them in
such a way that they are communicating with each other? How do the
switches help to over the limitations?
There are no absolutes because different sensors have different
behaviors. You have to look at the specific sensors. They are pretty
well documented, and test cases exist on their use. Use Google or Yahoo
to dig these up.
Apart from space and possible power considerations, there is no
"interference" between different types of sensors -- infrared light
doesn't affect ultrasonic sound, and vice versa.
Finally, the use of limit switches should be pretty obvious: it's the
same as the sense of touch.
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.