Robotics: Real World Sensors
Robotics: Sensors: Real World Sensors Template:Merge
This section covers the topics on sensor inperfection and how these components behave in the real world.
There is no such thing as a "distance sensor". period. Those components commonly called "distance sensor" or similar names measure something and extract distance information out of that. This extraction works pretty good in particular circumstances, but are worthless in many others. The key to successfuly measuring e.g. a distance, is knowing, exactly, what your sensors measures and how external factors influence the measurement. This doesn't mean you just need to know how accurate the sensor is, it means you need to know what part of physics is used, and what the laws of physics say about that.
I'll cover some of the most commonly used sensors and what laws of physics apply to those. I'm not going very deep into explaining physics, there are better sources for that (a wiki physics book for example), just enough to give you the idea of what problems you may expect and where to look for a solution.
Light Based Sensors
Reflection: short range sensors
This type of sensor detects objects at a range up to a few centimeter. These sensors are quite simple. They consist of a light source, usually an IR diode which signal can be modulated and a light detector, which can be as simple as a light sensitive diode or transistor with an amplification circuit or a more complex IC complete with filters and TTL level outputs.
These sensors work by detecting the reflection of the emitted light. The range at which an object is detected depends on a number of properties of the object:
- reflectivity/color: how well does the object reflect IR-light? Every object has a color. A green object means that it reflects light with wavelengths that we interpret as the color green. This can be a pretty large range. IR is also a color. Like any other color, some objects reflect IR, and other objects absorb IR.
- surface smoothness: A very smooth surface (like a mirror) reflects more light than a rough surface. (For example, a photograph of a black billiards ball usually shows a white spot caused by w:specular reflection).
- Angle: The more the surface is turned away from the sensor the more light is going to be reflected away from the sensor.
- Lightsources: Other lightsources like light bulbs or the sun emit IR light as well. Especially the sun can prevent an IR based sensor to operate.
Reflection: medium range sensors
Medium range sensors are a bit more complicated than short range sensors. These sensors consist of an IR emitting diode which signal is modulated, the receiver has a lens to focus the reflected light onto a light sensitive strip. Moving the sensor back and forward towarts an object moves the reflection beam along the light sensitive strip. What the resistance of the strip is depends on where the light hits the strip.
Its range has the same limiting factors as short range sensors.
Reflection: Large range sensors
Large range sensors use the time a laser pulse takes to travel from the emiter to the object and back. Since the speed of light is so high this type of sensor is only useful for larger ranges.
Its range is also limited in the same way as the previous IR sensors. Another thing than can limit is haze, smoke and other particles on the air.
Camera
Cameras used in robotics are commonly build around a image Sensor. These cameras are sensitive to IR-light and usualy have a IR-filter in front of the lens. Cheap webcams may not contain such a filter, which makes them very sensitive to sunlight.
stereo vision
These sensors consist of (at least) 2 cameras mounted some fixed distance from each other.
This is rarely used because solving the correspondence problem is difficult.
See also Robotics: Sensors: Computer Vision.
Sound Based Sensors
Some points on sound
What is sound?
Sound is in essence vibrations and pressure differences in the air. These vibrations are split into 3 groups by their frequency. The first group, called infrasone has a frequency below 20Hz. The second group, called ultrasone, has a frequency above 20Khz and an upperbound of 2Mhz in air or 30Mhz in water. The last group is what is commonly called sound. This groups range lays between 20Hz and 20Khz and can be heard. Although only newborn babies can really hear all the way up to 20Khz. The older you get the less frequencies you can hear.
Most sensors use ultrasone sound, usually around 40Khz. Such a signal can't be heard, while it's still easy to use (generate, detect,...).
Doppler effect
If both the source as the receiver are motionless relative to each other, the receiver will hear same frequency as the source emitted. However if one or both of them move, the receiver will detect a different frequency. This change in frequency is called the Doppler Effect. Most people know this effect from the sirens of passing police cars or amulances. When they pass you'll hear one sound as they move closer and a somewhat different one after they move away.
Calculating what frequency the receiver will hear is quite easy:
With:
= The frequency the receiver hears
= the frequency the source emits
= the speed of sound
= the speed of the receiver
= the speed of the source
Speed of sound
The speed of sound depends on the medium it traverse through and its temperature. For air this is approximately 330m/s at 0°C. Ofcourse most of the time the temperature is a bit higher than this. Calculating the actual speed is fairly easy:
with:
= the actual speed at the current temperature.
= the speed of sound at 0°C: 330m/s.
= the current temperature in Kelvin.
= 273,15 K (this is 0°C in Kelvin)
Reflection
Resonance
Diffraction
Ultrasonic Distance sensors
These sensors are pretty simple. In theory that is. In practice these sensors can be a real pain in the pinky. In this section I'll cover some of the troubles you may run into when trying to get them to work.
Ultrasonic distance sensors consist of 3 major parts: A transmitter, a receiver and a timer. To measure a distance the timer triggers the transmitter which emits a series of pulses, then the timer waits until the receiver detects the reflection of the pulses and stops the timer. The time measured is then divided by 2 and multiplied with the speed of sound. The result is the distance between the sensor and the object in front of it. The transmitter send out a stream of pulses on a carrier frequency. The maximum frequency humans can hear is about 20 KHz. A frequency higher than that is picked to avoid annoying humans with the constant beep -- 40KHz is a common value.
The receiver triggers when it receives a signal with that particular frequency. This is not necessary the signal the transmitter sended. If more than one ultrasonic sensor with the same carrier frequency are used, they can detect each others signals.
Sound doesn't move in a straight line, but rather as a 3D expanding wave. When the wave reaches an object part of it bounces back and moves again as a 3D expanding wave in the opposite direction. Such a wave can easily bounce multiple times before dissappearing. So it is very possible that you receive pulses that have travel a much larger traject than just to and back from the object in front of the sensor. While some part of this problem can be solved by letting the sensor wait some time before starting another measurement, other situation can produce incorrect measurements which are fairly tough to correct. For example moving through a doorway can fail because the sensors emitted pulses bounce from the walls back to the sensor and so giving a measurement that indicates an object in front of the sensor. One way of correcting this is using another sensor, for example a IR distance sensor to see if there really is an object. However such solution pose another problem: which sensor to believe? 3 sensors allow you to go with the majority, but then things become quite complicated in constructing and interfacing such systems, not to mention what it does to the power consumption.
Magnetism Based Sensors
Compass sensors
These sensors are used to measure the orientation of the robot relative to the magnetic north. It is important to remember that the magnetic north is not exactly the same as the geographical north. They differ several degrees.
The magnetic field of Earth is quite weak. This makes that these sensors will not operate well along other magnetic fields. E.g. speakers would mess up the reading. If you use these sensors it is best to mount them as far away from your motors as possible. While you can't shield them without making them useless, paying attentions to where you mount them can make a considerable difference in reliability.
other distance sensors
- (How do those "stud sensors" detect the lumber in the walls behind the sheetrock?)
further reading
- the sensor wiki http://sensorwiki.org/
- ultrasonics
- Robot Sensors
- "Migrating from x86 to PowerPC, Part 9: Sensors, sensors, sensors!" recommends using a optocoupler for isolation for all sensors.