Operating Systems, Concurrency and Time. real-time communication and CAN. Johan Lukkien

Similar documents
Additional Slides (informative)

Controller area network

The House Intelligent Switch Control Network based On CAN bus

Communication Networks for the Next-Generation Vehicles

Introduction to Controller Area Network (CAN)

Course Introduction. Purpose. Objectives. Content. Learning Time

Today. Last Time. Motivation. CAN Bus. More about CAN. What is CAN?

Systems. Roland Kammerer. 10. November Institute of Computer Engineering Vienna University of Technology. Communication Protocols for Embedded

FlexRay and Automotive Networking Future

Real-Time Communications. LS 12, TU Dortmund

Workshop on In Vehicle Network using CAN By

The Controller Area Network (CAN) Interface

BOSCH. CAN Specification. Version , Robert Bosch GmbH, Postfach , D Stuttgart

A Reliable Gateway for In-vehicle Networks

CAN-FD Flexible Data Rate CAN

Controller Area Network CAN. overview

SINAMICS S120. Communication. Communication 2/7. Overview

Figure 1. ECU Access to CAN bus

Communication (III) Kai Huang

CAN bus and NMEA2000 1

Lecture 2. Basics of networking in automotive systems: Network. topologies, communication principles and standardised protocols

Controller Area Network (CAN)

An Introduction to CAN by Peter Bagschik (I+ME ACTIA)

Serial Buses in Industrial and Automotive Applications

Controller Area Network

Simplify CAN and LIN In-vehicle Network Testing

A Framework Of Milk Dairy Automation Using CAN Protocol

Time Triggered CAN, Implementations, Development and Testing Tools

Digital communication technology for teaching automatic control: the level control case

An Introduction to FlexRay as an Industrial Network

DeviceNet - CIP on CAN Technology

Real-Time (Paradigms) (47)

PROFINET The leading communication system

CONTROLLER AREA NETWORK (CAN)

AUTOMOBILE APPLICATIONS USING CAN PROTOCOL

An Overview of the Controller Area Network

Probabilistic Worst-Case Response-Time Analysis for the Controller Area Network

(Controller Area Network)

Development of a CAN Slave Module with SystemC. Igor Sachs Shang Qihua

2. REAL-TIME CONTROL SYSTEM AND REAL-TIME NETWORKS

Overview. Data Link Technology. Role of the data-link layer. Role of the data-link layer. Function of the physical layer

Local Area Networks (LANs) SMU CSE 5344 /

Real-Time Systems. Real-Time Communication. Hermann Härtig, Jork Löser (following Kopetz, Liu, Almeida, Jon Currey, Schönberg)

Industrial Ethernet Comparison for Motion Control Applications

J1939 OVERVIEW. 1

Field buses (part 2): time triggered protocols

Data Link Layer Technologies

FOUNDATION Fieldbus Fieldbus Basics & its Benefits

The CAN Bus From its Early Days to CAN FD By Friedhelm Pickhard (ETAS/P)

Embedded Systems. 8. Communication

Medium Access Protocols

Reminder: Datalink Functions Computer Networking. Datalink Architectures

UNDERSTANDING THE CONTROLLER AREA NETWORK (CAN)

Module 5. Embedded Communications. Version 2 EE IIT, Kharagpur 1

Atacama: An Open Experimental Platform for Mixed-Criticality Networking on Top of Ethernet

ISO INTERNATIONAL STANDARD

Content. Deterministic Access Polling(1) Master-Slave principles: Introduction Layer 2: Media Access Control

CHAPTER 7 MAC LAYER PROTOCOLS. Dr. Bhargavi Goswami Associate Professor & Head Department of Computer Science Garden City College

8. Networks. Why networked embedded systems General network architecture. Networks. Internet-enabled embedded systems Sensor networks

Enhanced Error-Recovery CAN Bus System Using Reed-Solomon Codec

Accessing the shared! communication medium!! Media! Access! Conntrol!

Mittuniversitetet PROFIBUS PA

Summary of MAC protocols

Computer Networks. Today. Principles of datalink layer services Multiple access links Adresavimas, ARP LANs Wireless LANs VU MIF CS 1/48 2/48

Lecture 9: Bridging. CSE 123: Computer Networks Alex C. Snoeren

CAN Protocol Implementation

ISO INTERNATIONAL STANDARD

E Copyright VARAN BUS USER ORGANIZATION 06/2015. Real Time Ethernet VARAN Bus

Getting Connected (Chapter 2 Part 4) Networking CS 3470, Section 1 Sarah Diesburg

Design of Real-Time Software

CCNA Exploration1 Chapter 7: OSI Data Link Layer

ET4254 Communications and Networking 1

CAN FD with Dynamic Multi-PDU-to-Frame Mapping

Enhancing the efficiency of Controller Area Networks

DEFINITION AND IMPLEMENTATION OF AN ARCHITECTURAL CONCEPT FOR CONFIGURING A CAN NETWORK

Networked Control Systems for Manufacturing: Parameterization, Differentiation, Evaluation, and Application. Ling Wang

Rahman 1. Application

Computer Networks. Wireless LANs

IEEE Frame Replication and Elimination for Reliability. Franz-Josef Goetz, Member of IEEE TSN TG, Siemens AG

Lecture 11 Overview. Last Lecture. This Lecture. Next Lecture. Medium Access Control. Flow and error control Source: Sections , 23.

DISTRIBUTED REAL-TIME SYSTEMS

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

J1939-based application profiles

Chapter 12 Multiple Access 12.1

Grundlagen der Automatisierungstechnik. 10. Signale und Kommunikation in der Automatisierungstechnik

Direct Link Communication II: Wired Media. Multi-Access Communication

Introduction to LAN Protocols

Dr. Johan Åkerberg, ABB Corporate Research, Sweden, Communication in Industrial Automation

An Encapsulated Communication System for Integrated Architectures

Chapter 15 Local Area Network Overview

Debugging CAN, LIN, and FlexRay Automotive Buses with an Oscilloscope

Generic term for using the Ethernet standard in automation / industrial applications

SMS based Home Automation using CAN Protocol

Developing deterministic networking technology for railway applications using TTEthernet software-based end systems

ECE 333: Introduction to Communication Networks Fall Lecture 19: Medium Access Control VII

Ch 7. Network Interface

Local Area Network Overview

ISO INTERNATIONAL STANDARD. Road vehicles Controller area network (CAN) Part 3: Low-speed, fault-tolerant, medium-dependent interface

The Network Access Layer. In This Lecture. Network Access Layer. Hour 3

Lecture 16: QoS and "

Transcription:

Operating Systems, Concurrency and Time real-time communication and CAN Johan Lukkien (Courtesy: Damir Isovic, Reinder Bril)

Question Which requirements to communication arise from real-time systems? How does CAN as an example work? 2

Heterogeneous Networking in real-time context Distributed applications components even on different networks guarantees and admission tests online adaptation Open (more than before) embedded data available for (new) data oriented applications security for privacy and safety Data and Control: connecting the physical to the Cyber information about the physical world to higher layers ICT local sensors and actuators requirements of power use, throughput, latency, jitter 3

Fieldbus for distributed control intended for lowest layer in control system: connecting PLCs, sensors, actuators reduction of wires and complexity (replaces 4-20mA standard) high reliability, predictability; relatively low data rates and small messages Fieldbus technology Networking physically: bus, ring logically: bus (shared medium), mostly OSI model: focus on PHY, MAC (LLC) and application layer messages have application meaning ( commands ) not straightforward to integrate with other networks (or IP networks) PLCs might perform gateway functionality, or be integrated in IP from http://www.profibusaustralia.com.au/ Standards IEC 658, general fieldbus description AS-i, CAN, ETHERCAT, LON, PROFIBUS 4

Event-trigged communication Node Node 2 event Task C Task D Task E Task A Task B response Network Message from A to B 5

Time-trigged communication Node Node 2 Task C Task D Task E sampling Task A Task B control Network 6

Distributed real-time systems require robust realtime communication Non real-time systems Throughput Average response time Average latency Real-time systems Predictability Timing requirements on individual response times and latencies Require predictable communication network Analysis before the system is operating Challenge to construct computer systems that have at least reliability and safety that are at least as good as the (mechanical) systems they are replacing 7

Communication protocols (Old) Ethernet Addressed broadcast messages Collision Nodes resend after a random time Impossible to determine transmission times Not suitable for hard realtime systems Token ring Circulating token No collisions RT guarantees possible 8

Suitable for RT-communication TDMA Time-trigged (periodic) Predictable High testability Example: TTP-protocol Max waiting time = TDMA round Node Node 2 Node 3 Node 4 Node CSMA/CR (collision resolution) Priority based Online scheduled Flexible Example: CAN-protocol Node Node 2 Node 3 Collision resolution Highest prio sends Node 4 9

CAN Control Area Network Originally developed for automotive industry needs 983: BOSCH starts CAN development (Intel joins 985) 987: First CAN chip 990: First car with CAN (Mercedes S-class) 993: ISO standard Now used in industry applications as well Very common in machinery CAN-controllers developed by Philips, Intel, NEC, Siemens An implementation of CSMA/CR Priority based CR is the central mechanism Bitwise arbitration to resolve collisions 0

CAN Variants: ISO 898 ISO 898: physical and datalink layers 898- (2003): general architecture, PHY, DLL, LLC, MAC 898-2 (2006): High Speed ( Mps) 898-3 (2006): Fault tolerant, low speed (40K-25Kbps) PHY 898-4 (2004): Time Triggered CAN, TTCAN 898-5 (2007): extend 898-2 with low power 898-6 (203): extend -2 and -5 with configurable frames and wakeup 5765-2 (20): diagnostic messaging on CAN

Operation Synchronous serial communication A shared medium (cable) with connected nodes Broadcast data transmitted as frames can be picked up by all other attached nodes Mbit/s at 40m bus length Value of the bus is the logical and of values put on by stations 0 highest priority priority is derived from the identifier (= type or class or function) of a message not from source or destination (these are not part of the message) Node A Node B < 40m Mbit/s Node C Node D 2

Message format Data frames Used for data transmission e.g., sampling values from a sensor Standard CAN frame (CAN 2.0 A), bits identifier Extended CAN frame (CAN 2.0 B), 29 bits identifier Remote Frames Used for information requests. The transmitting node is asking for information of the type given by the identifier. Error frames Used for error signaling Overload Frames Used to delay the transmission of the next message frame The node sending the Overload Frame is not ready to receive additional messages at this time 3

CAN-frame (version 2.0 A, standard format) SOF ID RTR Control Data CRC CRC DEL ACK ACK DEL EOF IFS bit bits bit 6 bits 0-8 bytes 5 bits bit bit bit 7 bits min 3 bits SOF - Start of Frame, start bit (always 0), used for signaling that a frame will be sent (the bus must be free) ID - Identifier, identity for the frame and its priority RTR - Remote Transmission Request Control - indicates the length of the data field Data - message data CRC - Cyclic Redundancy Check, CRC DEL - CRC delimiter ACK - Acknowledgement ACK DEL - ACK delimiter EOF - End of Frame IFS - Inter Frame Space, resending wait time 4

Arbitration mechanism Example: Assume a simplified CAN-system with only three ID-bits and three functions, (identifiers A, B, C) mapped onto distinct nodes: A ID=00 B ID=00 C ID=0 000 highest priority lowest priority which gives: A-high prio, C-middle, B-low How does the arbitration look like if the nodes are sending simultaneously? Node A B C ID 00 00 0 Bit 0 Bit Bit 2 0 0 Bus value: 0 0 0 abort! (bit 0 bus value) Send the rest of the frame abort! (bit 2 bus value) 5

Acknowledgement and error signaling Error detection with check sum (CRC) If the frame is received correctly, the ACK-bit is set to 0 by a receiver Error signaling The node that detects an error puts instantly 000000 on the bus Because 0 is the dominant value, all nodes will detect the error rapidly Some CAN-systems have as the dominant bit bit-pattern for error signaling is Bit stuffing Patterns 000000 and must be avoided: insert extra bits at sender, reconstruct at receiver Original frame: Sender puts extra bits: 0000000000 0000000000 6

CAN and time CAN is time deterministic Possible to calculate how long time it takes to deliver a frame CAN acts as a non-preemptable resource, accessed under fixed priority: latency and response time can be predicted/computed How many bits are sent in a CAN-frame? SOF ID RTR Control Data CRC CRC DEL ACK ACK DEL EOF IFS bit bits bit 6 bits 0-8 bytes 5 bits bit bit bit 7 bits min 3 bits Sum = 47 + 8n (n = nr of data bytes) Bit stuffing leads to slightly larger messages (ignored here) 7

Literature R.I. Davis, A. Burns, R.J. Bril, and J.J. Lukkien, Controller Area Network (CAN) schedulability analysis: Refuted, revisited and revised, Real-Time Systems, ISSN 573-383 (online), http://www.springerlink.com/content/8n3272073787707/, January 30th, 2007, ISSN 0922-6443 (print), 35(3): 239-272, April 2007. 8

Exercises N. Consider a Mbps CAN with bit identifiers. How long does it take to transmit a 4 byte and a 0 byte payload respectively? N.2 Three periodic tasks T, T2 and T3 share a 250kbps CAN with bit identifiers. The tasks have periods of ms, 2ms and 3ms respectively, and transmit 4, 8 and 2 bytes respectively. T has the highest priority and T3 the lowest.. assign CAN identifiers to implement these priorities 2. what is the total transmission time per job of each task? 3. draw the timing diagram considering a phasing of 0 4. what is the utilization of this CAN? 9

Exercises N.3 Consider the diagram below: an arrow from X to Y means that function Y (i.e., the node(s) that execute Y) needs a message from X. Two nodes (ECU/CPU) execute the functions and there are two mappings. Mapping Mapping 2 ECU: { A, D } { A, B, C } ECU2: { B, C, E } { D, E} All functions send messages with the same period and same length. Determine, for the two alternatives, how many CAN messages are sent from one ECU to the other. A D B C E 20