Automation Systems Discrete Event Control Systems and Networked Automation Systems Additional Slides (informative) Application Automotive Networks (LIN, CAN, FlexRay, MOST)
Vorlesungstitel Vehicle Bus System: Motivation, Benefits AT 3 Circumstance and Trend in the evolution of automotive Current luxury class vehicles have: 100 servo drives (actuators) >100 sensors > 50 controllers > 2 km cables Up to 5 bus systems Increasing electronic devices and communication between them. Advantages of bus systems in automotive area Costs reduce Improved Communication (faster, more reliable) 404
Vehicle Bus System: Common Technologies Modern motor vehicles exhibit a multiplicity of different serial Bus systems. Common used techniques including CAN, LIN, MOST and FlexRay (recently) Based on different characteristics, they have different application areas. Cross-link between different Buses. 405
Vorlesungstitel Common Technologies AT 3 Application sub-areas: CAN ( Controller Area Network ) Applied in actuation, motor, comfort Normally several CAN-Buses exist LIN ( Local Interconnect Network ) Slow, small Used as a sub-network of a CAN bus to integrate sensor/actuator Most ( Media Oriented Systems Transport ) for interconnecting multimedia components (CD, Navi, Telephone) FleyRay High performance (high data rates, redundancy, safety and fault tolerance ) safety-critical sub systems (Break, Airbag) 406
CAN CAN-BUS (Controller Area Network) Originally developed in the 1986 by Robert Bosch GmbH / INTEL. Is a high-integrity serial data communications bus for real-time applications Operates at data rates of up to 1 Megabits per second Has excellent error detection and confinement capabilities Is an international standard: ISO 11898 Application in automotive: Begin of 1990s. Is now being used in many other industrial automation and control applications 407
Vorlesungstitel CAN AT 3 Motivation Connecting and sharing data among ECUs (Electronic Control Units) Number of ECUs in a today s upper class car approx. 70 ECUs (constantly rising) 408
CAN: Key Characteristics Multi-Master, Broadcast BUS (Producer-consumer principle) All nodes have control over bus line All nodes read all network messages CSMA / CR medium access protocol Carrier Sense Multiple Access / Collision Resolution Line structure topology Real-Time capable Message based priorities Highest priority messages always arrive on time Two speed modes Low speed CAN: 125 kbit/s High speed CAN: 1MBit /s Bus length from 40m to 1 km with up to 32 nodes Plain custom data length Up to 8 bytes Robust in electromagnetically noisy environments 409
CAN: Physical Layer CAN Controller CAN Controller Transceiver Transceiver CAN_H CAN_H 120 Ω CAN_L U CAN_L 120 Ω Terminating resistor: Avoid reflections on the bus line Bit value (differential voltage: U > 1V 0 (dominant) U <= 1V 1 (recessive) 410
Start of Frame (SOF) Identifier-Field (ID) Remote Transmission Request (RTR) Identifier Extension Bit (IDE) Reserved Data Length Field (DLF) Data Field (DATA) CRC Sum (CRC) CRC Sum Delimiter Acknowledgment Bit (ACK) Acknowledgment Delimiter End of Frame (EOF) Intermission Frame Space Vorlesungstitel CAN: Data Frame 1/3 AT 3 1 11 1 1 1 4 0..64 15 1 1 1 7 3 SOF Arbitration Field Control Field Data Field CRC Field Acknowledgment Field EOF IFS Total message length: 47 to 111 bits Overhead in CAN Of interest: Ratio between data length and total message length Worst ID (11 Bits) + 0 bytes payload 1-11/47 = 76,6 % overhead Best ID (11 Bits) + 8 bytes payload 1 75/111 = 32,4 % overhead 411
Start of Frame (SOF) Identifier-Field (ID) Remote Transmission Request (RTR) Identifier Extension Bit (IDE) Reserved Data Length Field (DLF) Data Field (DATA) CRC Sum (CRC) CRC Sum Delimiter Acknowledgment Bit (ACK) Acknowledgment Delimiter End of Frame (EOF) Intermission Frame Space Vorlesungstitel CAN: Data Frame 2/3 AT 3 1 11 1 1 1 4 0..64 15 1 1 1 7 3 SOF Arbitration Field Control Field Data Field CRC Field Acknowledgment Field EOF IFS Arbitration Field Message Identifier (what kind of information is transmitted) Resolution of conflicts Control Field IDE: Bit to switch between ordinary (shown above) and extended frame DLF: number of Bytes stored in Data Field (0.. 8 Bytes) Data Field The actual data stored in the in the frame CRC Field Check sum to verify integrity of data received 412
Start of Frame (SOF) Identifier-Field (ID) Remote Transmission Request (RTR) Identifier Extension Bit (IDE) Reserved Data Length Field (DLF) Data Field (DATA) CRC Sum (CRC) CRC Sum Delimiter Acknowledgment Bit (ACK) Acknowledgment Delimiter End of Frame (EOF) Intermission Frame Space Vorlesungstitel CAN: Data Frame 3/3 AT 3 1 11 1 1 1 4 0..64 15 1 1 1 7 3 SOF Arbitration Field Control Field Data Field CRC Field Acknowledgment Field EOF IFS Acknowlegdment Field Based on the CRC checksum calculation nodes confirm correct reception of messages All nodes acknowledge a correctly received frame (ACK Bit) Sender sends recessive bit value Nodes correctly receiving message set dominant bit value Nodes detecting transmission error set recessive bit value Receiving nodes set acknowledgment bit in frame of sender node If sender detects dominant value, at least one node received message correctly Nodes detecting an error, send special error frame as next message 413
CAN: Medium Access CAN uses CSMA As in Ethernet all sending nodes sense the bus at the same time For collision handling Collision Resolution is used In contrast to Collision Detection (e.g. Ethernet) one network message will win the conflict and will be transmitted Conflict occur, but conflict is resolved (one node wins) CR is based on bitwise arbitration on the bus line One bit value (usually 0 ) is dominant compared to its inversed (recessive) value (usually 1 ), i.e. when 0 and 1 are written on the bus line the dominant value transcribes the recessive value When two or more nodes are sending at the same time, nodes that are writing recessive bits on bus line when at least one other node is writing a dominant bit will see a collision and will stop sending. The node sending the dominant bit will continue. The collision is resolved! CR in CAN In CAN CR is based on the arbitration field Message identifier encodes information type and message priority Message with ID 00000000000 has highest priority! 414
CAN: CSMA / CR example Collision Resolution Example 0..dominant 1..recessive 1. Node 1,2 and 3 start transmitting simultaneously. 2. Node 2 sense a dominant level on bus, stop transmitting 3. Node 1 sense a dominant level on bus, stop transmitting 4. End of arbitration phase, only node 3 continues to transmit. 415
CAN: Cyclic Redundancy Check (CRC) CRC is based on modulo polynomial division Basic idea 1. Interpret data as gains of a polynomial e.g. 00101001: 2. Determine a special purpose generator polynomial e.g. 1011: x x 1 3. Multiply data polynomial by x r with r is grade of generator polynomial Extended polynomial: 3 x 1 4. Perform modulo polynomial division with extended and generator polynomials ( x 8 x 6 x 3 5. Remainder of division (100 ) 2 x is checksum for data Sender and Receiver use same generator polynomial Sender transmits his result in the CRC field 5 )%( x 3 x 3 x 8 x 1) x 6 x Receiver performs calculation on data field and CRC field (remainder 0 OK) 3 101001000 1011 ---- 0001010 1011 ---- 000100 416
CAN: Cyclic Redundancy Check (CRC) Receiver calculation Shifted data field: x Remainder: ( x 8 x 6 x x 3 2 x 2 8 x 6 )%( x x 3 3 x 1) 101001100 1011 ---- 0001011 1011 ---- 000000 If data is transmitted and received correctly, remainder is 0 CRC in CAN Generator polynomial used in CAN x 15 + x 14 + x 10 + x + x + x Polynomial is especially designed to detect the following errors Single bit errors Burst errors (bit errors in a row) 8 7 4 + x 3 +1 417
LIN LIN-Bus (Local Interconnect Network) Is a bus-system used within current automotive network architectures. Released in 1999 by LIN-consortium Small, slow, low costs sub-network to CAN Integrate intelligent sensors and actuators Single master/multiple slave (Max.16) Broadcast network, no collision detect mechanism, no arbitration Communication based on SCI (UART) data format. Speed up to 20Kbit/s (limited for EMI-reasons) Low cost silicon implementation based on common UART interface hardware which means that almost any microcontroller has necessary hardware on chip 418
LIN Communication concept All nodes include a slave communication task that is split in a transmit and a receive task Master node includes an additional master transmit task Communication is initialed by the master task master sends out a message header which comprises of the synchronization break, the synchronization byte, and the message identifier Exactly one slave task is activated upon reception and filtering of the identifier and starts the transmission of the message response The response comprises two, four, or eight data bytes and one checksum byte The header and the response part form one message frame 419
Vorlesungstitel MOST AT 3 MOST (Media Oriented Systems Transport ) Motivation Mordern automobiles have a variety of sophisticated information systems that need to communicate and interact with each other and with a human user Devices developed by different vendors. Digital interoperability will be required. 420
MOST Features Multimedia fiber-optic network optimized for automotive applications Suitable for delivering streaming data Ease of use, simple connectors, Plug-n-Play with auto initialization Transmision rates from a few kbps up to 24.8Mbps Support up to 64 devices simultaneous transmission of multiple data streams High degree of data integrity with low jitter Support of asynchronous and synchronous data transfer variable arbitration mechanisms Synergy with Consumer and PC Industry Low Implementation Cost MOST150 bietet Ethernet im Auto Die MOST Cooperation hat den neuen Multimedia-Standard für Automobile vorgestellt. Er erlaubt Datentransfer mit 150 MBit/s, unterstützt komplexe Videoanwendungen und enthält einen Ethernet-Kanal. Der Ethernet-Kanal überträgt unmodifizierte Ethernet-Datenblöcke, so dass sich Software- Stacks und Anwendungen aus dem Consumer- und IT-Bereich nahtlos in Fahrzeuge einbinden lassen. MOST150 ist damit einsatzbereit als Physical Layer für Ethernet im Auto. 421
MOST Applications Analog Audio Interface Analog Video Interface Digital Video Display 422
Vorlesungstitel FlexRay AT 3 FlexRay is a future automotive network communications protocol under development by the FlexRay Consortium FlexRay complements existing automotive networks such as CAN and LIN 423
FlexRay Flexibility Scalable Architectures free choice of bus topology (nodes,connections) definable data rates, message priorities and identifiers extendable for new or rearranged systems Optimal Behavior in Failure Modes neutral behavior of non supplied or defective nodes quick self-healing after temporary disturbances failure localization and analysis Combined Event- and Time-triggered Communication Efficiency Optimal Cost Architectures Optimized standards without overengineering Short Development Times Available chips, protocols and tools Reusable Systems Off-the-shelf for rapid deployment across multiple platforms Top-Quality Excellent Test Coverage including automation-driven verification 424
Vorlesungstitel FlexRay AT 3 Typical FlexRay Topologie FlexRay Communication cycle (fixed time slot and variable time slot) 425
FlexRay High performance Message exchange service that provides deterministic cycle based message transport (deterministic delay) Synchronization service that provides a common time base to all nodes (Clock synchronization) Startup service that provides an autonomous startup procedure Error management service that provides error handling and error signaling Wakeup service that addresses the power management needs Clock synchronization FlexRay system has time triggered behavior Each ECU (electronic control units ) has its own independent clock Clock drift must be no more than 0.15% from the reference clock Fault-tolerant clock synchronization is used to ensure time difference between nodes stay within the precision Both offset (phase)-correction and rate (frequency)-correction are employed. 426
Vorlesungstitel FlexRay AT 3 The first production vehicle with FlexRay is the 2006 BMW X5, the technology is applied for the pneumatic damping system. 427
Summary (11 th Lecture) This lecture gave an introduction to Application Automotive Networks What you should know now: The major applied vehicle BUS systems Their major properties and application sub-areas 428