Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Signals, Instruments, and Systems – W4
Introduction to Embedded Systems – Computing,
Sensing, Communicating
1
Outline• Embedded system terminology and
key concepts • Examples of embedded systems• The Mica-z as example of
embedded system• Perception• Communication
• Wired• Wireless
2
General Concepts for Embedded Systems
3
What is an Embedded System?
From Wikipedia: An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions often with real-time computing constraints. It is usually embedded as part of a complete device including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal computer, can do many different tasks depending on programming.
4
What is Challenging in Designing Embedded Systems?
• Computation is subject to physical and resource constraintssuch as timing, deadlines, memory restrictions, and power consumption requirements.
• The traditional abstraction of separating software from the hardware is more difficult. Hardware and software are integrally intertwined.
• But: hardware components are becoming more and more flexible, cheap, small, and standardized. The design complexity is shifting to software!
• Your role as Environmental/Civil Engineers: get enough background to contribute to the software side with your domain knowledge and collaborate with electrical/computer/mechanical/mechatronic engineers. 5
Perception - Sensors• Proprioceptive (“body”) vs. exteroceptive
(“environment”)– Ex. proprioceptive: motor speed/robot arm joint angle,
battery voltage, acceleration– Ex. exteroceptive: distance measurement, light
intensity, sound amplitude, temperature, wind speed
• Passive (“measure ambient energy”) vs. active (“emit energy in the environment and measure the environmental reaction”)– Ex. passive: temperature probes, microphones, cameras– Ex. active: laser range finder (LIDAR), IR proximity
sensors, ultrasound sonars, ultrasound anemometers[Adapted from Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]
6
Computation• Usually microcontroller-based• Microcontrollers are all-in-one computer chips.
They contain a processing core, memory, and integrated peripherals (e.g., ADC, motor control PWM generator, bus controller).
• Capable of Analog-to-Digital Conversion (e.g., ADC) and Digital-to-Analog Conversion (e.g., PWM generator)
7
Communication• Different physical channels: wired (e.g., RS232, CAN,
USB) and wireless (e.g., radio, infrared, ultrasound, sound)
• Internal or external to the device: buses connecting different components; external (e.g., node-to-node or node-to-basestation)
• Asymmetric (one way) or symmetric (bidirectional) link• Direct (explicit) or indirect (implicit): direct implies
dedicated hardware and software components for intentional, targeted information sharing; indirect, implies anonymous, broadcasting forms (e.g., visual signs)
8
Examples of Embedded Systems
9
Consumer Market Devices
Digital Watch
Weather station
Digital video camera
Digital camera
10
Niche Market – Scientific Equipment Commercially Available
Mica-Z
Handheld Airborne Mapping System
Sensorscope station
11
Example for Sensorscope Stations
• What is measured:– temperature– humidity– precipitation– wind speed/direction– solar radiation– soil moisture
Pictures: courtesy of SwissExperiment12
MicaZ – An Example of Embedded System
13
MICA mote family
• designed in EECS at UCBerkeley• manufactured/marketed by Crossbow
– several thousand produced– used by several hundred research groups– about CHF 250/piece
• variety of available sensors
14
MICAz
• Atmel ATmega128L– 8 bit microcontroller, ~8MHz– 128kB program memory, 4kB SRAM– 512kB external flash (data logger)
• Chipcon CC2420– 802.15.4 (Zigbee)
• 2 AA batteries– about 5 days active (15-20 mA)– about 20 years sleeping (15-20 µA)
• TinyOS15
Perception - Sensor Board
• MTS 300 CA– Light (Clairex CL94L)– Temp (Panasonic ERT-J1VR103J)– Acoustic (WM-62A Microphone)– Sounder (4 kHz Resonator)
16
Computation - Operating System An operating system (OS) is an interface between
hardware and user applications. It is responsible for the management and
coordination of tasks and the sharing of the limited resources of the computer system.
A typical OS can be decomposed into the following entities: Scheduler, which is responsible for the sharing of the
processing unit (microprocessor or microcontroller) Device drivers, which are low-level programs that
manage the various devices (sensors, actuators, secondary memory storage devices, etc.).
Memory management unit, which is responsible for the sharing of the memory (virtual memory).
Optional: Graphical User Interface, File System, Security, etc.
Most “OS” for embedded systems include these two
entities only!
17
Computation - TinyOS• Minimal OS designed for Sensor Networks• Event-driven execution• Programming language: nesC (C-like syntax
but supports TinyOS concurrency model)• Widespread usage on motes
– MICA (ATmega128L)– TELOS (TI MSP430)
• Provided simulator: TosSim18
Communication - 802.15.4 / Zigbee• Emerging standard for low-power
wireless monitoring and control– 2.4 GHz ISM band (84 channels), 250
kbps data rate
• Chipcon/Ember CC2420: Single-chip transceiver– 1.8V supply
• 19.7 mA receiving• 17.4 mA transmitting
– Easy to integrate: Open source drivers– O-QPSK modulation (Code Division
Multiple Access, CDMA); “plays nice” with 802.11 and Bluetooth 19
Communication - Standards
20
Perception
21
4a - Perception - Sensors4a22 Classification of Typical Sensors
[From Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]22
4a - Perception - Sensors4a23
[From Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]
Classification of Typical Sensors
23
4a - Perception - Sensors4a24
– Range• Upper limit
– Dynamic range• ratio between lower and upper limits, usually in decibels
(dB for power and amplitude)• e.g. voltage measurement from 1 mV to 20 V
• e.g. power measurement from 1 mW to 20 W
General Sensor Performance
21 UR
IUP =⋅=
Note: see also the example of wireless transmission power in this lecture
Note: similar to the acoustic amplitude
[Adapted from Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]24
4a - Perception - Sensors4a25
– Resolution• minimum difference between two values• usually: lower limit of dynamic range = resolution• for digital sensors it is usually the A/D resolution.
– e.g. 5V / 255 (8 bit)
– Linearity• variation of output signal as function of the input signal• linearity is less important when signal is treated with a
computer
)()(
yfyxfx
→→
)()()(?
yfxfyxfyx ⋅+⋅=⋅+⋅→⋅+⋅ βαβαβα
[From Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]
General Sensor Performance
25
4a - Perception - Sensors4a26
– Bandwidth or Frequency• the speed with which a sensor can provide a stream
of readings• usually there is an upper limit depending on the
sensor and the sampling rate• lower limit is also possible, e.g. acceleration sensor• frequency response (see signal processing lecture,
filter part): phase (delay) of the signal and amplitude might be influenced
[Adapted from Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]
General Sensor Performance
26
4a - Perception - Sensors4a27 In Situ Sensor Performance
Characteristics that are especially relevant for real world environments• Sensitivity
– ratio of output change to input change– however, in real world environment, the sensor has very often high
sensitivity to other environmental changes, e.g. illumination
• Cross-sensitivity (and cross-talk)– sensitivity to other environmental parameters– influence of other active sensors
• Error / Accuracy– difference between the sensor’s output and the true value
m = measured valuev = true value
error
[Adapted from Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]27
4a - Perception - Sensors4a28 In Situ Sensor Performance
Characteristics that are especially relevant for real world environments
• Systematic error -> deterministic errors– caused by factors that can (in theory) be modeled -> prediction– e.g. calibration of a laser sensor or of the distortion cause by the optic
of a camera
• Random error -> non-deterministic– no deterministic prediction possible– however, they can be described probabilistically – e.g. gaussian noise on a distance sensor, black level noise of camera
• Precision (different from accuracy!)– reproducibility of sensor results
[From Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]
σ = standard dev of the sensor noise
28
Wired Communication
29
Where?
• Within embedded systems (from sensor to microcontroller, from microcontroller to microcontroller, etc.)
• From an embedded system to another• From an embedded system to a PC• …
30
Communication Model
Transmitterchannel
Receiver
31
Communication Model
Transmitterchannel
Receiver
Noise
DistortionFilteringFrequency shift...
ModulationCoding(Compression)
DemodulationDecoding(Decompression)
32
A Seminal Example: The RS-232 (serial port)
• Hardware:– 3 wires: TxD, RxD, Ground
RxD
Transceiver1
Transceiver2
TxD
Ground
TxD
RxD
Ground
Transceiver = Transmitter + Receiver33
RS-232 (serial port)
• Signal: between RxD/TxD and Ground
RxD
Transceiver1
Transceiver2
TxD
Ground
TxD
RxD
Ground
34
RS-232 Modulation
35
RS-232 Demodulation
36
RS-232 Delay
• Packet-based– 1 byte (i.e. 8 bits)/ packet– 8 data bits + 2 control bits (start/stop) = 10 bits
• Transmission speed– max. 115'200 bits/s (bps)
• Propagation speed:– approx. c (speed of light)
37
RS-232 Delay
• Transmission delay– 10 bits / 115'200 bps = 86.8 μs
• Signal propagation delay (2 m cable)– 2 m / c = 6.6712819 ns
• Processing delay:– ~ 1 us (modulation, demodulation, processing)
• Total: ~ 90 μs = 0.09 ms
38
Wireless Communication
39
Transmitterchannel =
ElectroMagneticwaves in air
Receiver
Noise
ReflectionsFadingInterferenceOther EM sources...
Communication Model
40
Communication Model
Transmitterchannel =
ElectroMagneticwaves in air
Receiver
Noise
ReflectionsFadingInterferenceOther EM sources...
Channel estimationAdvanced modulation typesCoding and error correction
41
Sharing the Medium
2
1
3
42
Sharing the Medium
• TDMA– Time-Division Multiple Access– “You shut up while I talk“– Time allocation
• Fixed, synchronizede.g. mobile phones (GSM)
• Dynamic (check if channel is free)e.g. Wireless LAN (802.11b/g/n)
1 2 3 2 3 time
43
Sharing the Medium
• FDMA– Frequency-Division MA– e.g. FM radio channels– Frequency regulation
• OFCOM (CH)
1 2 3
frequencyallocated by OFCOM
bandwidth
44
Bandwidth • Can be defined by the OFCOM for multiple channels
for a given purpose (in the overall spectrum)• Can be defined for a single channel as follow:
• B = bandwidth • f0 = carrier (channel) frequency• fL = low cut-off frequency (typically defined at -3dB)
• fH = high cut-off frequency (typically defined at -3dB)
-3dB = 50% power (spectral density)-3dB = 70% amplitude (spectral amplitude)
45
Bandwidth
• FM station broadcasting at 106,4 MHz→ actually occupies 106,3 MHz – 106,5 MHz→ Bandwidth = 200 kHz
• Mobile phone (GSM): 200 kHz (around 900 MHz)• WLAN/WiFi: 5 MHz (around 2,4 GHz)• Analog TV station: 6 MHz (around 180 MHz)
What does the bandwidth depend on?Bandwidth [Hz] ↑ → Data rate (Throughput) [bits/s] ↑
46
Bandwidth
47
Sharing the Medium
• CDMA (spread spectrum)– Code-Division MA– Using different transmission codes– e.g. GPS, Wifi, 3G cell phones,
Zigbee– Interesting properties
• Wide channels (less fading)• Concurrent communication
– More complex demodulation48
Throughput (bits/s)
• TDMA, FDMA, CDMA can be combined• Total throughput is shared
TDMA
CDMA
FDMA
49
Shannon-Hartley Limit
• Hard theoretical limit on throughput– More bandwidth = higher throughput– More power (SNR) = higher throughput
C: capacity (throughput)B: bandwidthS: signal power (W)N: noise power (W)
Bit energy to noise-power spectral density ~ S/N
Ban
dwid
th “
dilu
tion”
50
Conclusion
51
Take Home Messages• Embedded system: specific purpose, equipped for interfacing
discrete/digital and continuous/analog world, microcontroller-based design, often real-time constraints
• Main modules of an embedded system: perception, computation, communication
• Several examples of embedded systems in our daily life and for research/education purposes (e.g. Mica-z, Sensorscope stations)
• Perception and communication are two key features of embedded systems
• Some key concepts in sensing and communication systems – Propioceptive/exteroceptive, active/passive, etc.– Bandwidth, real throughput, TDMA, FDMA, CDMA …
52
Additional Literature – Week 4Pointers: • Permasense http://www.permasense.ch • GITWES – the German Indonesian Tsunami Early Warning System
http://www.gitews.deftp://ftp.cordis.europa.eu/pub/fp7/ict/docs/sustainable-growth/workshops/workshop-20070531-jwachter_en.pdf
• Sensorscope http://www.sensorscope.ch/ • TinyOS: http://www.tinyos.net/• Com systems: http://www.ce-mag.com/archive/2000/sepoct/flintoft.html• Com systems: http://www.umtsworld.com/technology/cdmabasics.htm
Books• Siegwart R., Nourbakhsh I. R., and D. Scaramuzza, “Introduction to
Autonomous Mobile Robots”, Second edition, MIT Press, 2011. • Everett, H. R., “Sensors for Mobile Robots, Theory and Application”, A. K.
Peters, Ltd., 1995. 53