4 - The University of Texas at Austin

Download Report

Transcript 4 - The University of Texas at Austin

CS 546: Intelligent Embedded
Systems
Gaurav S. Sukhatme
Robotic Embedded Systems Lab
Center for Robotics and Embedded Systems
Computer Science Department
University of Southern California
[email protected]
http://robotics.usc.edu/~gaurav/CS546
Last Time
•
•
•
•
Overview of the ENS box
TinyOS tutorial
Homework #2
No homework assigned today, nothing
due next week
Today
Energy supply
2/21: Energy management
4/18: Cyclops
External
communication
1/31: Networking
Memory
Processor
Interface
Sensor and
actuator suite
1/24, 4/18: Cyclops
Figure adapted from [Pottie and Kaiser 2005]
•Platform
•OS and SW architecture
•Tools
•User interface
•Application
2/7,14 and 28:
Time synch, localization and
data management
3/21,28 and 4/11:
Environmental monitoring
Sensors
•
•
•
•
Basic principles
Noise and figures of merit
Types of sensors
Calibration
Sensing Architecture
Physical signal
at source
Physical signal
at transducer
Signal
channel
Transducer
A/D conversion
Analog signal
procesing
Digital signal
processing
Feedback
transducer
network
Output
signal
Sources of Noise
Physical signal
at source
Physical signal
at transducer
Signal
channel
Transducer
A/D conversion
Analog signal
procesing
Digital signal
processing
Feedback
transducer
network
Output
signal
Figures of Merit
• Responsivity:
output signal/input signal
• Sensitivity:
(output signal without input)/(responsivity)
• Drift: slow change in output due to lowfrequency noise
• Cross talk
Types of Sensors
• Environmental
– Pressure, gas phase composition, automotive exhaust gas
oxygen,
• Motion and force
– Accelerometers, rotation and rotation rate, piezoresistive
strain, microphone, capacitative position
• Electromagnetic transducers
– Antennas, magnetometers, digital cameras. laser
rangefinders
• Chemical and biochemical
– Oxygen, nitrate (amperometric)
• Time
– GPS
Transduction Principles
• Pressure – capacitance change
• Gas – absorption changes conductivity
• Accelerometer and rate gyros – proof mass
displacement changes
• Microphone – diaphragm displacement changes
resistance
• Piezoelectric – force changes polarization charge
• Magetometer – motion wrt coil induces a current
• Camera – photodetectors and CCD arrays
• Nitrate – use microfluidics to reduce an electrode and
measure current
Types of Sensors
• Sensors range from simple to complex
in the amount of information they
provide
– simple: an on/off switch (1 bit of input)
– complex: the human retina (> 100 million
photosensitive elements!)
• A sensor provides “raw” information,
which usually needs to be processed
Sensor Complexity
• The output of a simple sensor can be
used directly, without processing (e.g., if
switch closed, stop, else go)
• The output of a complex sensor must
be processed
• We can ask: “Given the sensory reading
I am getting, what was the world like to
make the sensor give me this reading?”
=> reconstruction
Signals -> Symbols (State)
• Sensors do not provide state/symbols,
just signals
• A great deal of computation may be
required to convert the signal from a
sensor into useful state for the robot
• This process bridges the areas of
electronics, signal processing, and
computation
Levels of Processing
• to find out if a switch is open or closed, we
need to measure voltage going through the
circuit => electronics
• using a microphone to separate voice from
noise and recognize => signal processing
• using a surveillance camera, find people in the
image and recognize criminals, perhaps by
comparing them to a large database =>
computation
Example: detecting people
• temperature: pyro-electric sensors
detect special temperature ranges
• movement: if everything else is static or
slower/faster
• color: if people wear uniquely colored
clothing in your environment
• shape: now you need to do complex
vision processing
Example: measuring distance
• ultrasound sensors (sonar) give you distance
directly (time of flight)
• infra red provides return signal intensity
• two cameras (i.e., stereo) can give you
distance/depth
• use perspective projection with 1 camera
• use a laser and a camera, triangulate
• use structured light; overlying grid patterns
on the world
• ...
Sensor Fusion
• A powerful strategy is to combine
different sensors => Sensor Fusion
• Sensor fusion is complex because
sensors have:
– different characteristics
– different accuracy
– different complexity
• Computation is necessary to com-bine
them effectively (in real-time)
Simple Sensors
• Can be used without much processing
• Still require electronics (and connectors)
• The basic electronics laws to know:
– Ohm’s law
– combining resistance
– dividing voltage
Switch Sensors
• Switches are perhaps the simplest
sensors of all
• They work without processing, at the
electronics (circuit) level
• When a switch is open, no current can
flow; when a switch is closed, current
can flow (and be measured)
• This simple principle can (and is) used
in a wide variety of ways
Uses of Switches
• Contact sensors: detect contact with
another object (e.g., triggers when a robot hits a
wall or grabs an object, whiskers, etc.)
• Limit sensors: detect when a mechanism
has moved to the end of its range (e.g.,
triggers when a gripper is as open as it can be)
• Shaft encoder sensors: detect how many
times a shaft turns (e.g., a switch clicks at every
turn, clicks are counted)
Light Sensors
• Switches measure physical contact; light
sensors measure the amount of light
impacting a photocell
• Photocells are resistive sensors: the amount
of light effects the amount of generated
resistance
• Resistance is low when it is very light, high
when it is dark
• Light sensors are really dark sensors!
Polarized Light
• Light waves traveling from a source
emanate in all directions (with respect to
the horizon)
• Polarized light waves travel only in a
specific direction
• “Normal” light can be polarized by putting
a filter in front of a light source
• The filter lets only the light waves of a
given orientation (the characteristic plane)
pass through
Polarized Light Sensors
• Filters can be combined to select various
directions and amounts of light
• Polarized light can be used by placing
polarizing filters:
– at the output of a light source (emitter)
– at the input of a photocell (receiver)
• Depending on whether the filters add (pass
through) or subtract (block) the light,
various effects can be achieved
Resistive Position Sensors
• Photocells are resistive devices, responding
to light intensity
• Resistive devices can respond to various
physical properties
• Bending is one such property, detected by
resistive position sensors
• Originally developed for video game
control (e.g., Nintendo Powerglove)
• Bending wears sensors out; less robust
than other sensors
Potentiometers
• Potentiometers (a.k.a. pots) are
everywhere
• Used for manual tuning of dials (radios,
stereos, shaft encoders, etc.)
• The tuning adjusts the level of resistance
in the circuit
• The device is a movable tap along two
fixed ends (with fixed resistance). As the
tap moves, resistance changes between
the two extremes.
Active vs. Passive Sensors
• Passive sensors measure a physical
property in the environment
• Active sensors provide their own
signal/stimulus (and thus the associated
source of energy)
– reflectance
– break-beam
– infra red (IR)
– ultrasound (sonar)
– ...
Reflective Optosensors
• The sensor consists of an emitter and a
detector; two arrangements:
• Reflectance: emitter and detector are
next to each other, separated by a
barrier; light is reflected from objects
back to the receiver
• Break-beam: emitter and detector face
each other; objects interrupt the light
from the emitter
Emitters and Detectors
• Emitters are usually made using lightemitting diodes (LEDs)
• Detectors are usually
photodiodes/phototransistors
• Optosensors are not the same technology
as resistive sensors
• Resistive sensors are simple but slow
• Optosensors are much faster
Reflectivity Properties
• Reflectivity depends on the color and
other properties of a surface
• Lighter colors reflect better
• Black may not reflect at all (appears
invisible)
• Lighter objects farther away seem
closer than darker objects close by
• => The world is partially observable
Light Interference
• Ambient / background light can interfere
with the sensor measurement
• It is best to subtract the ambient light
level from the sensor measurement
• This is how: take two (or more, for increased
accuracy) readings of the detector, one with
the emitter on, one with it off, then
subtract them
• This gives the ambient light level...
Sensor Calibration
• This process is called sensor calibration
• It provides the ambient light value to be
subtracted from future sensor readings, to
get the real measurement
• Of course ambient value can change, so
calibration has to be repeated
Calibration
•
•
•
•
•
Compare measurements to a reference
Performed while manufacturing
Tuning parameters (say a resistor)
Need calibration methods in situ
Usually non-linear interpolation
Break-Beam Sensors
• Any pair of compatible emitter-detector
devices can be used to make a breakbeam sensor
• Examples:
– Incandescent flashlight bulb and photocell
– Red LEDs and visible-light-sensitive phototransistors
– IR emitters and detectors
Shaft Encoders
• Shaft encoders measure the angular
rotation of an axle
• They provide position and/or velocity
• Examples:
– a speedometer measures the speed of the
wheels
– an odometer measures the number of
rotations of the wheels
Disks for Counting Rotation
• To detect rotation, the turning element
must somehow be marked
• Usually a round disk is attached to the
shaft
• The disk has one or more notches cut in it
• A break-beam arrangement is set up: an
emitter on one side of the disk, detector
on the other
Counting Revolutions
• As a notch in the disk passes between
the break-beam sensor, a rotation is
detected and counted
• If the disk has only one notch, only
complete rotations can be counted
• The more notches, the higher the
resolution of the encoder
• If the shaft turns quickly, it is better to
have higher resolution because...
Uses of Higher Resolution
• More notches allow for:
– faster measurement
– more accurate measurement (if there is
noise/error)
• How else could we achieve shaft
encoding without cutting notches?
Color-Based Encoders
• Instead of cutting notches, we can color
the disk into alternating black and white
wedges
• Then, instead of a break-beam
mechanism, we need to set up a
reflectance sensor:
• The emitter and detector are on the
same side of the disk
• Black wedges absorb light, white reflect
it => reflections are counted
General Encoder Properties
• Any encoder is an active sensor
• It produces and measures a wave
function of light intensity
• The wave peaks are counted to
compute the speed of the shaft
• Encoders measure position and
rotational velocity (by subtracting the
difference in the position after each reading)
• Where can encoders be used?
Signal De/Modulation
• We mentioned that ambient light is a
source of interference in sensing
• Idea: emit modulated light (emitter is
pulsed rapidly on and off)
• Use a demodulator to detect the signal at
the particular pulse frequency
• The demodulator detector needs to
measure several on-off flashes in a row to
measure the frequency
Infra Red (IR) Sensors
• Infra red sensors work at a particular
frequency of light (IR frequency)
• They are used in the same ways as the
visible light sensors, but more robustly, to
detect:
– presence of objects
– distance to objects
• Modulated IR is commonly used (e.g.,
remote controls)
Networking
• Often wireless, though not always
• Bluetooth, WiFi, adhoc variants,
proprietary networking protocols
• Scaling based on logical and physical
clustering
Network Self-Organization
• For large-scale embedded systems
– Connectivity (topology) discovery – which
links are possible, and which are desirable
based on energy constraints
– Channel assignments to avoid conflicts,
subject to efficiency criteria
– Connectivity maintanence
Topology Discovery
• Usually by hand shaking
– One node issues an invitation on a
predefined channel
– Other nodes respond
• In wired networks – no energy
constraint – receiver always on
Channel Assignments &
Connectivity
• If some node knows the total number
of nodes on the network, it can
broadcast channel assignment
• In wireless networks – not clear if
global connectivity is always possible
given peak power constraints
Connectivity
• 100 node network – each node needs
7-9 neighbors to be fully connected
• Sharp transition from connected to not
connected
• Control is via transmit power
Connectivity
• Issue invitations at max power
– Listen to responses
– Resolve contentions
– Later abandon links during routing phase when
shorter paths are discovered
• Issue invitations at low power
– Capture ‘low-energy’ links
– Grow as needed (vary duty cycle of invitation and
response)
Routing
• Flooding
– Never used globally, only local
– Assumes links to neighbors are known
• Fixed directory
– Brittle, efficient
– Usually add redundancy for robustness
• Adaptive
– Link-state: select short paths to update routes
– Distance-vector: limit update packets to changes
to a local routing table
Routing
• Shortest path: use shortest routes
• Demand driven: compute paths as
needed
• Hierarchical: different methods at
different levels (eg within cluster)
• Overlapping spanning trees
• Directed diffusion: flooding, response,
reinforcement
Next time
• Time synchronization
• Read and critique papers before coming
to class