signals, instruments, and systems – w4 introduction to

53
Signals, Instruments, and Systems – W4 Introduction to Embedded Systems – Computing, Sensing, Communicating 1

Upload: others

Post on 18-Apr-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Signals, Instruments, and Systems – W4 Introduction to

Signals, Instruments, and Systems – W4

Introduction to Embedded Systems – Computing,

Sensing, Communicating

1

Page 2: Signals, Instruments, and Systems – W4 Introduction to

Outline• Embedded system terminology and

key concepts • Examples of embedded systems• The Mica-z as example of

embedded system• Perception• Communication

• Wired• Wireless

2

Page 3: Signals, Instruments, and Systems – W4 Introduction to

General Concepts for Embedded Systems

3

Page 4: Signals, Instruments, and Systems – W4 Introduction 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. In contrast, a general-purpose computer, such as a personal computer, can do many different tasks depending on programming.

4

Page 5: Signals, Instruments, and Systems – W4 Introduction 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. 5

Page 6: Signals, Instruments, and Systems – W4 Introduction 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.]

6

Page 7: Signals, Instruments, and Systems – W4 Introduction 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)

7

Page 8: Signals, Instruments, and Systems – W4 Introduction 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)

8

Page 9: Signals, Instruments, and Systems – W4 Introduction to

Examples of Embedded Systems

9

Page 10: Signals, Instruments, and Systems – W4 Introduction to

Consumer Market Devices

Digital Watch

Weather station

Digital video camera

Digital camera

10

Page 11: Signals, Instruments, and Systems – W4 Introduction to

Niche Market – Scientific Equipment Commercially Available

Mica-Z

Handheld Airborne Mapping System

Sensorscope station

11

Page 12: Signals, Instruments, and Systems – W4 Introduction to

Example for Sensorscope Stations

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

Pictures: courtesy of SwissExperiment12

Page 13: Signals, Instruments, and Systems – W4 Introduction to

MicaZ – An Example of Embedded System

13

Page 14: Signals, Instruments, and Systems – W4 Introduction to

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

Page 15: Signals, Instruments, and Systems – W4 Introduction to

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

Page 16: Signals, Instruments, and Systems – W4 Introduction to

Perception - Sensor Board

• MTS 300 CA– Light (Clairex CL94L)– Temp (Panasonic ERT-J1VR103J)– Acoustic (WM-62A Microphone)– Sounder (4 kHz Resonator)

16

Page 17: Signals, Instruments, and Systems – W4 Introduction to

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

Page 18: Signals, Instruments, and Systems – W4 Introduction to

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

Page 19: Signals, Instruments, and Systems – W4 Introduction to

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

Page 20: Signals, Instruments, and Systems – W4 Introduction to

Communication - Standards

20

Page 21: Signals, Instruments, and Systems – W4 Introduction to

Perception

21

Page 22: Signals, Instruments, and Systems – W4 Introduction to

4a - Perception - Sensors4a22 Classification of Typical Sensors

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

Page 23: Signals, Instruments, and Systems – W4 Introduction to

4a - Perception - Sensors4a23

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

Classification of Typical Sensors

23

Page 24: Signals, Instruments, and Systems – W4 Introduction to

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

Page 25: Signals, Instruments, and Systems – W4 Introduction to

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

Page 26: Signals, Instruments, and Systems – W4 Introduction to

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

Page 27: Signals, Instruments, and Systems – W4 Introduction to

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

Page 28: Signals, Instruments, and Systems – W4 Introduction to

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

Page 29: Signals, Instruments, and Systems – W4 Introduction to

Wired Communication

29

Page 30: Signals, Instruments, and Systems – W4 Introduction 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• …

30

Page 31: Signals, Instruments, and Systems – W4 Introduction to

Communication Model

Transmitterchannel

Receiver

31

Page 32: Signals, Instruments, and Systems – W4 Introduction to

Communication Model

Transmitterchannel

Receiver

Noise

DistortionFilteringFrequency shift...

ModulationCoding(Compression)

DemodulationDecoding(Decompression)

32

Page 33: Signals, Instruments, and Systems – W4 Introduction 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 + Receiver33

Page 34: Signals, Instruments, and Systems – W4 Introduction to

RS-232 (serial port)

• Signal: between RxD/TxD and Ground

RxD

Transceiver1

Transceiver2

TxD

Ground

TxD

RxD

Ground

34

Page 35: Signals, Instruments, and Systems – W4 Introduction to

RS-232 Modulation

35

Page 36: Signals, Instruments, and Systems – W4 Introduction to

RS-232 Demodulation

36

Page 37: Signals, Instruments, and Systems – W4 Introduction 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)

37

Page 38: Signals, Instruments, and Systems – W4 Introduction 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

38

Page 39: Signals, Instruments, and Systems – W4 Introduction to

Wireless Communication

39

Page 40: Signals, Instruments, and Systems – W4 Introduction to

Transmitterchannel =

ElectroMagneticwaves in air

Receiver

Noise

ReflectionsFadingInterferenceOther EM sources...

Communication Model

40

Page 41: Signals, Instruments, and Systems – W4 Introduction to

Communication Model

Transmitterchannel =

ElectroMagneticwaves in air

Receiver

Noise

ReflectionsFadingInterferenceOther EM sources...

Channel estimationAdvanced modulation typesCoding and error correction

41

Page 42: Signals, Instruments, and Systems – W4 Introduction to

Sharing the Medium

2

1

3

42

Page 43: Signals, Instruments, and Systems – W4 Introduction 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

43

Page 44: Signals, Instruments, and Systems – W4 Introduction to

Sharing the Medium

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

• OFCOM (CH)

1 2 3

frequencyallocated by OFCOM

bandwidth

44

Page 45: Signals, Instruments, and Systems – W4 Introduction 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)-3dB = 70% amplitude (spectral amplitude)

45

Page 46: Signals, Instruments, and Systems – W4 Introduction 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] ↑

46

Page 47: Signals, Instruments, and Systems – W4 Introduction to

Bandwidth

47

Page 48: Signals, Instruments, and Systems – W4 Introduction 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 demodulation48

Page 49: Signals, Instruments, and Systems – W4 Introduction to

Throughput (bits/s)

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

TDMA

CDMA

FDMA

49

Page 50: Signals, Instruments, and Systems – W4 Introduction 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”

50

Page 51: Signals, Instruments, and Systems – W4 Introduction to

Conclusion

51

Page 52: Signals, Instruments, and Systems – W4 Introduction 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 – Propioceptive/exteroceptive, active/passive, etc.– Bandwidth, real throughput, TDMA, FDMA, CDMA …

52

Page 53: Signals, Instruments, and Systems – W4 Introduction to

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