56
Signals, Instruments, and Systems – W7 Introduction to Embedded Systems – Computing, Sensing, Communicating 1

Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Signals, Instruments, and Systems – W7

Introduction to Embedded Systems – Computing,

Sensing, Communicating

1

Page 2: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Outline• Embedded system terminology and

key concepts • Examples of embedded systems• Perception• Communication

• Wired• Wireless• Power

2

Page 3: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Motivation from Week 1 Lecture

3

Sensing

Processing Communication

Processing

Mobility

In-situ instrument

Visualization

Storing

Transportation channel Base station

Highlighted blocks are those mainly leveraging the content of this lecture.

3

Page 4: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

General Concepts for Embedded Systems

4

Page 5: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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. Examples of properties of typically embedded computers when compared with general-purpose counterparts are low power consumption, small size, rugged operating ranges, and low per-unit cost.

5

Page 6: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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. 6

Page 7: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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.]

7

Page 8: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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)

8

Page 9: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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)

9

Page 10: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Examples of Embedded Systems

10

Page 11: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Consumer Market Devices

Digital Watch

Weather station

Digital video camera

Digital camera

11

Page 12: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Niche Market – Scientific Equipment Commercially Available

Mica-Z

Handheld Airborne Mapping System

Sensorscope station

12

Page 13: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Example for Sensorscope Stations

• What is measured:– temperature– humidity– precipitation– wind speed/direction– solar radiation– soil moisture

Pictures: courtesy of SwissExperiment13

Page 14: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Perception

14

Page 15: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

4a - Perception - Sensors4a15 Classification of Typical Sensors

[From Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]15

Page 16: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

4a - Perception - Sensors4a16

[From Introduction to Autonomous Mobile Robots, Siegwart R. and Nourbakhsh I. R.]

Classification of Typical Sensors

16

Page 17: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

4a - Perception - Sensors4a17

– 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.]17

Page 18: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

4a - Perception - Sensors4a18

– 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

18

Page 19: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

4a - Perception - Sensors4a19

– 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

19

Page 20: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

4a - Perception - Sensors4a20 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.]20

Page 21: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

4a - Perception - Sensors4a21 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

21

Page 22: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Wired Communication

22

Page 23: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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• …

23

Page 24: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Communication Model

Transmitterchannel

Receiver

24

Page 25: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Communication Model

Transmitterchannel

Receiver

Noise

DistortionFilteringFrequency shift...

ModulationCoding(Compression)

DemodulationDecoding(Decompression)

25

Page 26: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

A Seminal Example: The RS-232 (serial port)

• Hardware:– 3 wires: TxD, RxD, Ground

RxD

Transceiver1

Transceiver2

TxD

Ground

TxD

RxD

Ground

Transceiver = Transmitter + Receiver26

Page 27: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

RS-232 (serial port)

• Signal: between RxD/TxD and Ground

RxD

Transceiver1

Transceiver2

TxD

Ground

TxD

RxD

Ground

27

Page 28: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

RS-232 Modulation

28

Page 29: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

RS-232 Demodulation

29

Page 30: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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)

30

Page 31: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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

31

Page 32: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Wireless Communication

32

Page 33: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Transmitterchannel =

ElectroMagneticwaves in air

Receiver

Noise

ReflectionsFadingInterferenceOther EM sources...

Communication Model

33

Page 34: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Communication Model

Transmitterchannel =

ElectroMagneticwaves in air

Receiver

Noise

ReflectionsFadingInterferenceOther EM sources...

Channel estimationAdvanced modulation typesCoding and error correction

34

Page 35: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Sharing the Medium

2

1

3

35

Page 36: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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

36

Page 37: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Sharing the Medium

• FDMA– Frequency-Division MA– e.g. FM radio channels– Frequency regulation

• OFCOM (CH)

1 2 3

frequencyallocated by OFCOM

bandwidth

37

Page 38: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

AM/FM Modulation

From A. S. Willsky, Signals and Systems Course, MIT 38

Page 39: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Frequency Domain Multiplexing

From A. S. Willsky, Signals and Systems Course, MIT 39

Page 40: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Frequency Domain Multiplexing

From A. S. Willsky, Signals and Systems Course, MIT 40

See also FT property “modulation”, W4 slides

Page 41: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Frequency Domain Multiplexing

From A. S. Willsky, Signals and Systems Course, MIT 41

See also FT property “translation” (demodulation), W4 slides

Page 42: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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)i.e. 10 log(0.5) = -3dB-3dB = 70% amplitude (spectral amplitude)i.e. 20 log(0.7) = -3dB 42

Page 43: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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] ↑

43

Page 44: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Bandwidth

44

Page 45: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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 demodulation45

Page 46: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Throughput (bits/s)

• TDMA, FDMA, CDMA can be combined• Total throughput is shared

TDMA

CDMA

FDMA

46

Page 47: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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”

47

Page 48: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Power

• Increased power– higher throughput– higher range– mobile systems: shorter battery life– increased health risk (?)

• Regulation– CH: OFCOM– e.g. WLAN: 100 mW

48

Page 49: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Power

• Unit: W (Watt)– Often written in dBm (decibels to 1 mW)

• Gain / loss: factors– Often written in dB (decibels)

49

Page 50: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

PdBm

• 1mW → 10 log(1mW/1mW) → 10 log(1) = 10*0 = 0dBm• 2mW → 10 log(2mW/1mW) → 10 log(2) ≈10*0.3=3dBm• 10mW → 10 log(10mW/1mW) → 10 log(10) = 10*1=10dBm• 100mW → 10 log(100mW/1mW) → 10 log(100) = 10*2=20dBm

=

mW1log10 W

dBmPP )log()log()*log( yxyx +=

50

Page 51: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Link Budget

TX powerTX lossesTX antenna gainFree space path lossRX antenna gainRX losses

RX power

RX sensitivity

100 mW*0.5*1.6*1.0106*10-8

*1.6*0.5

20 dBm-3 dB+2 dB-80 dB+2 dB-3 dB

-85 dBm

-62 dBm

Margin 23 dB200

Typical WLAN link budget (100 m, dipole antennas):

0.00000064 mW

0.000000003 mW

51

Page 52: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Free Space Path Loss (Friis Law)

• Signal power decay in air:

• Proportional to the square of the distance d• Proportional to the square of the frequency f

– high frequency = high loss– low frequency = low bandwidth

52

Page 53: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Ex.: Mica-Z vs. TinyNode

Mica-Z (Crossbow)•Microcontroller:

• ATmega128L• TinyOs

• Transceiver:• Chipcon CC2420• 2.4 GHz carrier• Throughput: up to 250k bps• Range: up to 75 m

TinyNode (Shockfish)• Microcontroller:

• TI MSP430• TinyOs

• Transceiver: • Semtech XE 1205• 868 and 915 MHz carriers• Throughput: up to 153k bps• Range: up to 2 km

Sensorscope data logger

53

Page 54: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Conclusion

54

Page 55: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

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 – Proprioceptive/exteroceptive, active/passive, etc.– Bandwidth, real throughput, TDMA, FDMA, CDMA …– Transmitted/received power and corresponding losses 55

Page 56: Signals, Instruments, and Systems – W7 Introduction to ... · What is an Embedded System? From Wikipedia: An . embedded system. is a special-purpose computer system designed to

Additional Literature – Week 7Pointers: • 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/ • 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.56