distributed embedded systems - kth · distributed embedded systems - characteristics, ... auxiliary...

24
1 1 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042 Distributed embedded systems - characteristics, examples, trends and challenges Martin Törngren Embedded Control Systems group Mechatronics KTH 2 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042 Outline Recap – why, what and how of distributed systems Characteristics, Advantages, Problems Design issues for distributed embedded systems Systems and application examples Trends and research

Upload: lamthien

Post on 22-Apr-2018

249 views

Category:

Documents


4 download

TRANSCRIPT

1

1 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Distributed embedded systems - characteristics, examples,

trends and challenges

Martin Törngren

Embedded Control Systems group

Mechatronics KTH

2 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Outline

• Recap – why, what and how of distributed systems Characteristics, Advantages, Problems

• Design issues for distributed embedded

systems • Systems and application examples • Trends and research

2

3 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Trailer

7-pole15-pole

AUS

Audio system

ACC

Automatic climate control

WTA

Auxiliary heater system water-to-air

CTS Clock and timer system

CSS

Crash safety system

ACS 2

Articulation control system

BMS

Brake management system

GMS Gearbox management system

EMS1 Engine management system

COO1 Coordinator system

BWS

Body work system

APS

Air prosessing system

VIS 1

Visibility system

TCO

Tachograph system

ICL1

Instrument cluster system

AWD

All wheel drive system

BCS2

Body chassis system

LAS

Locking and alarm system

SMS

Suspension management

t

SMSSuspensionmanagement system

RTG Road transport informatics gateway

RTI Road transport informatics system

EEC Exhaust Emission Control

SMD

Suspension management dolly

t

SMSSuspensionmanagement system

ATA

Auxiliary heater system air-to-air

Green bus

Red bus

Yellow bus

ISO11992/3

ISO11992/2

Diagnostic bus

Body Builder Bus

Body Builder Truck

Courtesy of Scania

Why? What? How? Challenges?

4 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

What Is A Distributed System? • A set of nodes connected by the network,

cooperating to achieve a common goal Node: a C +I/O + communication interface One or multiple networks: wired, wireless

Comm. Interf.

Node 1

Node n

Network

3

5 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Analogy

• Setup phase: Communication model/pattern Physical level; logical level; reliability Broadcast vs. Point-to-point mode

• Design and implementation Functions ~ the phrases

oAllocated to hardware elements – ”nodes” Timing and global clock Access to the same com. network/scheduling Application control logic - centralized

6 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Communication models

OSI model oriented RT model General purpose Dedicated Little apriori knowledge Often static Point to point Multicast

logical connection Sender & receiver Source

addressing addressing Positive ack Datagram

retransmission E.g. TCP/IP! E.g. CAN!

4

7 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Views of distributed systems

• Software allocation and roles of nodes • Application program view • Driver view • Logical topology • Physical layout • Cables and wires • Physical vs. Logical communication Protocols

8 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

The mapping problem Vehicle stability DiagnosticsSuspension Driver in the loop

Sensor Actuator Sensor Sensor Actuator

Local control function

Local control function

Sensor(s)

Actuator(s)

Signal cond.

Drive unitComputerhardware&software

Sensor(s)

Actuator(s)

Signal cond.

Drive unitComputerhardware&software

Sensor(s)

Actuator(s)

Signal cond.

Drive unitcircuitryComputer

hardwareandsoftware

GatewayVehicleMechanics

5

9 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Application programmer view

msg[0]=0; ... msg[6]=0; msg[7]=50; CANSendMsg( 0, 0x0cfe6cee, msg, 8, 0 ); delay_ms(1000); dip204_clear_display(); …

10 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Driver view illustrated through Coldfire CAN

Courtesy of Freescale

6

11 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Logical hardware topology: trains

Node Node Node

Vehicle bus Vehicle bus Vehicle bus

Train bus

Courtesy of Bombardier

12 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Physical layout

Courtesy of Kvaser

7

13 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Signal and cabling view

14 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Data transmission over CAN: Application, datalink and physical level views

And levels inbetween! - Driver software

1 0 1 1 0 0 1 0 1 1 000 1 0 ...

Diff. Transmission (Rs422)

Voltage

Time

CANSendMsg( 0, 0x0cfe6cee, msg, 8, 0 );

8

15 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Layering

16 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Views of distributed systems

• Software allocation and roles of nodes • Application program view • Driver view • Logical topology • Physical layout • Cables and wires • Physical vs. Logical communication Protocols

9

17 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Why distributed systems?

18 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Why not Analog Cabling? • Traditional method: a C is connected to

distributed sensors and actuators by dedicated analog cables

• An example: 1900 wires, 2.2km long

10

19 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Reducing Cables with Network • Digital signals – robustness against noise

• Increase data integrity • Reduce the cost of cables, connectors • Increase system reliability (fewer

connectors) • Shared resources and information:

• Sensors, actuators, computations, … • Modularity • Performance • Local intelligence

20 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

A Mechatronic Module • Scania diesel engine and controller

Interfaces: - Mechanical Connections - CAN

11

21 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Many advantages!!! What are the problems???

• (partial) failures • Delays • Consistency • Organizational challenges • How to deal with distributed functions? • How to verify?

22 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Distributed systems – failure modes

Nodes • Omission

Fail-silent Signalled failure

• Value Wrong data sent

• Timing E.g. too early, too late

• Interference ”Babbling idiot”

• Commission Unintended message

Network • Omission

Transient or permanent Permanent failure –

special case: Network becomes partitioned!

• Value Alteration of value

• Timing • Network failure causes

delay/different delays

• Interference • Commission

Attributes: Duration, Detectability, Symmetry

12

23 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Distributed state variables, {M1, M2, M3} => the system state; is it consistent?

Sensor(s)

Actuator(s)

Computerhardwareandsoftware

Signalconditioning

DrivecircuitryMessage M’

Com.controller

Sensor(s)

Actuator(s)

Computerhardwareandsoftware

Signalconditioning

Drivecircuitry

Com.controller

Sensor(s)

Actuator(s)Computerhardwareandsoftware

Signalconditioning

Drivecircuitry

Com.controller

M1

M2

M3

When is the state required to be consistent? Consistency in the precense of faults? Trade-offs --> compare voice vs. file transfer!

24 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Time delays in distributed systems

Application

Access Control

Comm. Interf.

Application

Access Control

Comm. Interf.

prep., send

wait

decode, retrieve

transmission

Sending Node Receiving Node

13

25 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Delays and event ordering • Incorrect event order possible

meas.& calculate

1ms cooling

fan

0.9ms Network

HMI Valve A Valve B

Open both

Close both

0,5 ms

26 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Clock synchronization Perfect clock

Reference time

Clock value

Clock x

Accuracy

Clock synchronization -Establishing an approximate global time within a system -Internal clock synchronization -> precision of the global clock Master/slave vs. distributed clock synchronization - Synchronization to an external time reference

Local unsynchronized clocks: - Granularity - Drift rate, e.g. 10-7s/s - Clock drift rate ~ temp. & voltage applied to the crystal resonator Free running clocks will drift apart

14

27 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Why are there so many types of networks, technologies and

protocols??

Controller area network

Ethernet, TCP/IP

Profibus, Foundation Fieldbus, Modbus, …

CanOpen, Volcano, J1939, …

MIL1553B

LIN, Most, Flexray

BACnet, Lonworks

Train Communication Network

Wireless, short range Cellular

28 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Outline

• Recap – why, what and how of distributed systems Characteristics, Advantages, Problems

• Design issues for distributed embedded

systems • Systems and application examples • Trends and research

15

29 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Design issues

• Centralized or distributed system? • Which type of distributed system? Logical topology and physical layout Decentralization of data, programs & control Which communication protocol

• How to design and dimension them? The importance of the system architecture! Cost vs. Reliability vs. Performance vs. ...

Delays, synchronization and failures Verification? Who does what?

30 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Distributed I/O

Output Input

Set Point Generation

Feedback Ctrl Feedback Ctrl Feedback Ctrl Level 1

Level 2

Network

• Common in process control • Additional time-delay in control loop • Care has to be taken to synchronize

sensor inputs and multiple outputs

16

31 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Decentralized local control

Output Input

Feedback Ctrl

Set-points and Coordination

Feedback Ctrl Feedback Ctrl Level 1

Level 2

Network

• Common in machine control and automotive

• Need for synchronization of level 1 loops with coordinator

32 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Controller Controller

Mode logic

Target attitude Estimated attitude Reactio

n wheels

Smart-1 dyna- mics

Planetary system and Smart-1 kinematics

Rate

Sun

Disturbances Hydrazine thruster From rate sensors

Reaction wheel speed

Attitude control system in the science mode of operation

Estimation

Sensors

Star tracker

17

33 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Smart-1 block diagram

Courtesy of Swedish Space Corporation

• One of a kind! • Robustness & fault tolerance • Space environment: radiation • Autonomy • Power • Mission critical • Real-time, slow time constants Control hierarchy

34 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

TCS695E single chip ERC32 processor, 20 MHz clock

EEPROM 2 Mbyte EDAC protected

SRAM 3 Mbytes EDAC protected, needs SW scrubbing cycle < 1 minute,

MassMemory 512 Mbyte, EDAC protected, HW scrubbing

CAN controllers, 2 kBytes FIFO in reception path Purchased VHDL code; radiation tolerant FPGA

Watchdog, 2 s timeout, can be disabled per pulse telecommand

JTAG I/F for EEPROM software upload and board HW checkout

Main on-board computer

18

35 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Vehicle yaw rate

Vehicle speed

Vehicle slipangle

Vehicle yaw rate

Vehicle speed

Vehicle slipangle

Example application: stability control

Source: ESC education - www.esceducation.org

36 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Disturbances

Engine dynamics

Vehicledynamics

Wheeldynamics

Enginecontroller

Brakecontroller

Yaw/slipcontroller

Driver

Disturbances Disturbances

Engine dynamics

Vehicledynamics

Wheeldynamics

Enginecontroller

Brakecontroller

Yaw/slipcontroller

Driver

Disturbances

Engine dynamics

Vehicledynamics

Wheeldynamics

Enginecontroller

Brakecontroller

Yaw/slipcontroller

Driver

Disturbances

Controller area network and vehicle computers

Example application: vehicle stability control

19

37 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

A view of a modern car

Courtesy of Volvo Car Which nodes are involved in vehicle stability control?

38 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Distributed systems perspective

• 70’s – Distributed control in process automation

• 80’s – Avionics • 90’s – Automotive • External connectivity and wireless

Telecom; cellular telephony Computer communication; Internet;

TCP/IP, wireless Short range wireless communication;

Bluetooth, Zigbee, ...

20

39 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Trends

• Connectivity • New (distributed) functions • Convergence • Standardized platforms Middleware – for example Autosar Protocols

• Product lines and model-based development Reuse of SW and HW components

• Evolving electronics; multicore

40 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Courtesy of Volvo car

21

41 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Autosar – Automotive SW architecture

Autosar also defines information exchange

42 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Benefits of wireless networking in industrial control

• Cost (wiring and installation)

• Flexibility Less physical design limitations More mobile equipment Faster commissioning and reconfiguration

• Reliability No cable wear and tear No connector failure

Courtesy of Karl-Henrik Johansson

22

43 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Barriers against wireless networking in industrial control

”Market pulse: Wireless in industrial systems: cautious enthusiasm”, Industrial Embedded Systems, Winter 2006

44 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Prototyping and different hardware

23

45 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Hardware in the loop simulation

ECU

46 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Concept – for a network test Central

unit

I/O-Unit engine

I/O-Unit ESP / xxx

I/O-Unit transmission

Overall model

I/O - program

Driving cockpit

Control computer

customer

24

47 Martin Törngren, Sept. 2010 – Distributed systems Embedded systems,course, MF2042

Summary

• Why, what & how of distributed systems Remember the exercise!

• Design issues for distributed embedded

systems • Architecture and verification

• Dealing with complexity • Trends:

• Increasing connectivity and convergence • Standardization