Controller Area Network (CAN Bus)

Slides:



Advertisements
Similar presentations
Contents Overview Data Information Frame Format Protocol
Advertisements

Introduction to CAN.
Introduction to CANBUS
Setha Pan-ngum. History of CAN [1] It was created in mid-1980s for automotive applications by Robert Bosch. Design goal was to make automobiles more reliable,
Slide 1 Industrial Automation - Customer View - Training PhW - CANopen_en 02/ 2002 CANopen QUIZ CANopen QUIZ.
Networking Theory (Part 1). Introduction Overview of the basic concepts of networking Also discusses essential topics of networking theory.
OSI Model.
EE 4272Spring, 2003 Chapter 14 LAN Systems Ethernet (CSMA/CD)  ALOHA  Slotted ALOHA  CSMA  CSMA/CD Token Ring /FDDI Fiber Channel  Fiber Channel Protocol.
Host Data Layer 7 Application Interacts with software requiring network communications; identifies partners, resources and synchronization Layer 6 Presentation.
Dave Mills CANbus: A brief introduction Incorporating: The Fujitsu status Dave Mills Queen Mary, University of London.
CS335 Networking & Network Administration Tuesday, April 13, 2010.
Module 6 Chapter 5. Ethernet Ethernet is now the dominant LAN technology in the world. Ethernet is not one technology but a family of LAN technologies.
COMPUTER NETWORKS.
 What is a Controller Area Network?  History of CAN  CAN communication protocol  Physical layer  ISO  CiA  CANopen  DeviceNet  Applying.
EECS 373 Controller Area Networks Samuel Haberl Russell Kuczwara Senyuan Zhong.
SERIAL BUS COMMUNICATION PROTOCOLS
ECE 371 Controller Area Network (CAN) Overview. Controller Area Network The development of CAN began when more and more electronic devices were implemented.
Internet Addresses. Universal Identifiers Universal Communication Service - Communication system which allows any host to communicate with any other host.
Copyright CCNA 1 Chapter 5 Ethernet Fundamentals By Your Name.
1 Layer 2: Concepts Honolulu Community College Cisco Academy Training Center Semester 1 Version
ECGR 6185 Advanced Embedded Systems Controller Area Network University Of North Carolina Charlotte Bipin Suryadevara.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Access to Shared Media - Media Access Control protocols RD-CSY10171.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This training course provides an overview of Message Frames.
Cisco 3 - Switching Perrine. J Page 16/4/2016 Chapter 4 Switches The performance of shared-medium Ethernet is affected by several factors: data frame broadcast.
Section 3 - Slide 1/19 P&T - GPS - Formation PhW - CANopen_lev1_en - 01/2004 History CANopen and the ISO model Physical layer Link layer Application layer.
Chapter 9 Hardware Addressing and Frame Type Identification 1.Delivering and sending packets 2.Hardware addressing: specifying a destination 3. Broadcasting.
Prepared by Engr.Jawad Ali BSc(Hons)Computer Systems Engineering University of Engineering and Technology Peshawar.
Network Protocols and Standards (Part 2). The OSI Model In 1984, the International Organization for Standardization (ISO) defined a standard, or set of.
Data Link Layer and Ethernet COM211 Communications and Networks CDA College Theodoros Christophides
Controller Area Network (CAN) is a broadcast, differential serial bus standard, originally developed in the 1980s by Intel and Robert Bosch GmbH, for.
IEEE 802.X Standards The Institute of Electrical and Electronics Engineers (IEEE) has developed a series of networking standards to ensure that networking.
An Introduction to CAN CAN Basics 2 Renesas Interactive
1 Copyright © 2014 Tata Consultancy Services Limited Controller Area Network (CAN) By Renukacharya A. Thakare.
TCP/IP Protocol Suite Suresh Kr Sharma 1 The OSI Model and the TCP/IP Protocol Suite Established in 1947, the International Standards Organization (ISO)
IEEE Wireless LAN. Wireless LANs: Characteristics Types –Infrastructure based –Ad-hoc Advantages –Flexible deployment –Minimal wiring difficulties.
Controller Area Network
CAN Controller Area Network 29BIT ID
OSI Model OSI MODEL. Communication Architecture Strategy for connecting host computers and other communicating equipment. Defines necessary elements for.
OSI Model OSI MODEL.
CAN CANopen.
Introduction to Networks v6.0
Environment Temperature Monitor
Instructor Materials Chapter 5: Ethernet
Lab 7 – CSMA/CD (Data Link Layer Layer)
Networking Devices.
Click to edit Master subtitle style
Chap. 2 Network Models.
Chapter 11: Inter-Integrated Circuit (I2C) Interface
Lecture 27 WLAN Part II Dr. Ghalib A. Shah
Layered Architectures
(Inter-IC bus) By Tejaswini Gadicherla
Ct1403 Lecture#2: DATA LINK LAYER
IOS Network Model 2nd semester
Subject Name: Computer Communication Networks Subject Code: 10EC71
Layer 1 of the TCP/IP protocol stack: Network Access Layer (NAL)
Ethernet and Token Ring LAN Networks
Chapter 3: Open Systems Interconnection (OSI) Model
Learning Objectives After interacting with this Learning Object, the learner will be able to: Explain the process of collision detection in CSMA/CD.
شبکه محلی کنترلر Controller Area Network (CAN)
Protocol layering and data
CCNA 1 Chapter 5 Ethernet Fundamentals
Data Communication Networks
Business Data Communications, 4e
OSI Model OSI MODEL.
Controller Area Networks (CAN)
Data Link Layer 2019/2/19.
Protocol layering and data
Ethernet and Token Ring LAN Networks
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Controller Area Network (CAN Bus) And MilCAN

Origins / background of CAN Architecture , Layers and mapping to OSI Overview Origins / background of CAN Architecture , Layers and mapping to OSI CAN protocol, and Framing Multi-master and arbitration MilCAN overview Deterministic vs Non deterministic networks Network Technology Richard Anthony The University of Greenwich

Controller Area Network (CAN) - Origins / background Developed by Robert Bosch GmbH, specifically for Automotive control systems (now also used in e.g. industrial automation and medical equipment). CAN was designed to enable vehicle components such as engine management, power-train, brakes, steering, lights and indicators, climate control, security systems etc. to be interconnected by a network bus – enabling the Electronic Control Units (ECU) to communicate with each other. The CAN 1.2 protocol was released in 1986 ( ‘Standard’). CAN controller chips, produced by Intel and Philips, introduced in 1987. The CAN 2.0 specification was published in 1991 ( ‘Extended’). CAN has some specific features: It is fault-tolerant It allows message prioritisation It operates in multicast manner It uses message-filtering in place of traditional addressing It uses very short messages which are well-suited to sensing and control applications but not suited to data-intensive applications. Network Technology Richard Anthony The University of Greenwich

CAN bus concept – automotive example The CAN network connects the various subsystems in a larger system. The subsystems are usually embedded microcontrollers with specific sensing / control applications In a CAN network there is no requirement to have a central, or coordinating computer. Network Technology Richard Anthony The University of Greenwich

CAN is a non-deterministic (see later) serial communication system. CAN basic details CAN is a non-deterministic (see later) serial communication system. CAN networks have a bus configuration. CAN operates with bitrates up to 1Mbit/S (bus length below 40 meters), Longer network distances can be achieved at lower bit rates (e.g., 500 m at 125 kbit/s). The CAN data link layer protocol is standardized in ISO 11898-1 (2003). describes mainly the data link layer (LLC sublayer and MAC sublayer) and some aspects of the physical layer of the OSI reference model. The other protocol layers are selected by the network designer. There are two CAN modes of operation: Standard – uses 11-bit Identifier Extended – uses 29-bit Identifier CAN is a three-layer technology - {Object, Transfer, Physical} layers. Network Technology Richard Anthony The University of Greenwich

CAN Architecture CAN’s three layers are equivalent to the Physical and Data-Link layers of the OSI model. The Application layer sits above the CAN Object layer. The Application layer can be hardware and software that comprise a specific component (usually an embedded system) within the wider network. The main role of the CAN Object layer is message filtering which determines which messages are passed up to the Application layer and which messages are ignored. The CAN Transfer layer is the core of the CAN protocol. It performs MAC functions such as message framing, conflict detection and arbitration, and error detection. The CAN Physical layer is not defined as part of the CAN protocol specification – this allows the transmission medium and signal levels to be optimised for particular implementations. Network Technology Richard Anthony The University of Greenwich

CAN mapped onto ISO OSI 7-layer model CAN Object layer Message filtering Message and status handling Logical Link Control (LLC) Sub-Layer OSI Data Link Layer CAN Transfer layer Fault confinement Error detection and signalling Message validation Acknowledgement Arbitration Message Framing Transfer rate and timing Media Access Control (MAC) Sub-Layer CAN Physical layer Signal level and bit representation Transmission medium OSI Physical Layer Network Technology Richard Anthony The University of Greenwich

Frame Types and Fields and Spacing - Overview Frames contain an Identifier Data Frame – Carries data from a transmitter to a receiver. Remote Frame – transmitted to request a Data Frame The remote Frame and subsequent Data Frame contain the same Identifier. Error Frame – Transmitted by any unit on detecting a bus error. Overload Frame – Provides an extra spacing between preceding and succeeding Data Frames or Remote Frames. Data Frames and Remote Frames are separated from preceding frames by an Interframe Space. Network Technology Richard Anthony The University of Greenwich

The CAN protocol Information is sent in the form of a number of different formats (Frames). When the bus is detected to be free, any connected unit can start to transmit a message. The sender must monitor the bus whilst it sends, one bit at a time – error detection due to a conflict is immediate, based on a single bit difference between what is transmitted and what is heard on the bus. The detection of conflicts only occurs during the ‘arbitration field’. A node that looses arbitration (see later) stops transmitting, the winner continues to transmit its message. The message is NOT corrupted during a bus conflict. Network Technology Richard Anthony The University of Greenwich

The CAN protocol – Bit Timing and propagation on the bus The CAN bus operates at up to 1Mbit/S at bus lengths of up to 40 meters. Key timing requirement: A single bit must propagate the entire length of the bus in less than a single bit time, to ensure that a single bit difference is detected by any transmitting node, within the duration of the transmission of that bit. Propagation speed of a signal in the bus is 2 * 108 meters per second. Time required to propagate 1 meter is 1 / (2 *108) S = 0.5 *10-8 S Time required to propagate 40 meters is 40 * 0.5 *10-8 S = 20 *10-8 S = 2 * 10-7 S One bit-time is 1/1,000,000 S = 1 * 10-6 S ( = 10 * 10-7 S) → The signal propagation time is equivalent to 1/5 of a bit-time (given from 10 * 10-7 S / 2 * 10-7 S = 5) Network Technology Richard Anthony The University of Greenwich

CAN does not use station addresses to route information Information Routing CAN does not use station addresses to route information All messages are sent in a Multicast manner: The content of a message is named by an Identifier. This is a means of describing the type or meaning of the data. It does not indicate the destination of the message. A message is sent, using its Identifier as a means of filtering at receiving nodes. Only nodes interested in the Identifier act upon the message. Effectively this is a publish-subscribe network → Nodes can be added to the system without changing the existing configuration of software or hardware. Network Technology Richard Anthony The University of Greenwich

Transmission scheme (1) The CAN bus is a single bi-directional channel. It can be configured in either a Wired-AND configuration or a Wired-OR configuration. Wired-AND The bus is pulled high (1) by a pull up resistor – the quiescent state. Each station uses an open-collector transistor gate to drive the bus low (0). A station leaves its transistor off to transmit a ‘1’ – i.e. No drive is needed. Thus a ‘0’ is dominant over a ‘1’. When no station transmits a ‘0’ the bus is at a ‘1’ state. Truth table Station Bus value 2 0 0 0 0 1 0 0 0 1 1 1 Gnd (0V) Pull-up resistor Tx Rx +Vcc Data bus Bus unit 1 Bus unit n Network Technology Richard Anthony The University of Greenwich

Transmission scheme (2) Wired-OR The bus is pulled low (0) by a pull down resistor – the quiescent state. Each station uses an open-collector transistor gate to drive the bus high (1). A station leaves its transistor off to transmit a ‘0’ – i.e. No drive is needed. Thus a ‘1’ is dominant over a ‘0’. When no station transmits a ‘1’ the bus is at a ‘0’ state. dominant vs recessive bits Wired-AND Wired-OR When a bus is driven the bit is dominant 0 1 When a bus floats (not driven), the bit is recessive 1 0 Truth table Station Bus value 2 0 0 0 0 1 1 0 1 1 1 1 Gnd (0V) Pull-down resistor Tx Rx +Vcc Data bus Bus unit 1 Bus unit n Network Technology Richard Anthony The University of Greenwich

SOF Identifier RTR IDE r0 DLC Data CRC ACK CAN DATA Frame format Standard Mode Extended Mode SOF Identifier RTR IDE r0 DLC Data CRC ACK d 11 bits d 4 bits 0–8 bytes Arbitration field Control field Arbitration field Control field SOF Identifier SRR IDE Identifier RTR r1 r0 DLC Data CRC ACK d 11 bits r r 18 bits 4 bits 0–8 bytes Key: SOF = Start Of Frame, always ‘d’ RTR = Remote Transmission Request, ‘d’ in DATA frame, ‘r’ in REMOTE frame IDE = IDentifier Extension, ‘d’ in Standard frame, ‘r’ in Extended frame DLC = Data Length Code r0, r1 = Reserved bits SRR = Substitute Remote Request (always ‘r’ to ensure that a Standard frame wins arbitration) Network Technology Richard Anthony The University of Greenwich

Message filter accepts Message sequences - Scenario 1 Bus unit 1 sends a message “Engine Temperature” Identifier 00100001100 Value 00100011 01100110 (2 bytes of data). A DATA frame message is sent by bus unit 1. Other bus units perform Message filtering based on the identifier. Bus units 3 and 4 are interested in this message. Application layer Object layer Transfer layer Physical layer Bus unit 1 Sends data frame Bus unit 2 Message filter blocks Data Frame Bus unit 3 Message filter accepts Bus unit 4 Network Technology Richard Anthony The University of Greenwich

Message filter accepts Message sequences - Scenario 2 Bus unit 4 requests the value of “Throttle Position” Identifier 00101101101 A Remote frame message is sent. Bus unit 2 has the required data value – sends a DATA frame Other bus units perform Message filtering based on the identifier. Bus units 3 and 4 are interested in this message. Application layer Object layer Transfer layer Physical layer Bus unit 1 Message filter blocks Data Frame Bus unit 4 Requests data Remote Frame Bus unit 2 Responds with Data Bus unit 3 Message filter accepts Network Technology Richard Anthony The University of Greenwich

Message sequences - Scenario 3 Bus unit 1 sends a message “Engine RPM”, Identifier 00010001000, DATA frame sent. At the same time Bus unit 4 sends a message “Oil pressure”, Identifier 00000011100, DATA frame sent. An access conflict occurs – arbitration is performed using the Identifier. In Wired-AND configuration, the lowest Identifier has the highest priority (i.e. Oil Pressure reading is more important than Engine speed value) Bus unit 4 wins the arbitration in this case, Bus unit 2 is interested in the message. Bus unit 2 Responds with Data Bus unit 3 Message filter accepts Application layer Object layer Transfer layer Physical layer Bus unit 1 Message filter blocks Data Frame (Lowest Identifier) Wins arbitration – transmission succeeds Bus unit 4 Requests data Data Frame (Highest Identifier) Looses arbitration – transmission stopped Network Technology Richard Anthony The University of Greenwich

The arbitration scheme ensures: Bus Arbitration (1) The CAN bus is designed such that any bus unit can take control of the bus (i.e. Transmit) at any time that the bus is free (Idle). The multi-bus-master approach is implemented as a contention scheme in which a bus unit listens to the bus before transmitting and only transmits when the bus is determined to be Idle (similar to CSMA/CD as used in Ethernet). The transmitting node listens while transmitting, on a bit-by-bit basis and can thus detect any bit-errors that occur during the transmission of its message. The arbitration scheme ensures: No data is lost – in the highest priority message, No time is lost – the highest priority message is transmitted with the same timing regardless of conflict. Network Technology Richard Anthony The University of Greenwich

Bus Arbitration (2) - Arbitration in operation (two Data Frames) Arbitration is based on the dominant (d) vs recessive (r) bit values in the Identifier For Wired-AND d = 0 (drives the bus low - strong) r = 1 (passive, allows the pull-up resistor to pull the bus high – weak) Consider the messages: “Engine RPM”, Identifier 00010001000 = dddrdddrddd and “Oil pressure”, Identifier 00000011100 = ddddddrrrdd Assume both messages are sent as Data Frames, and that Standard Mode CAN is used Message SOF 11-bit Identifier RTR IDE ... Engine RPM d d d d r d d d r d d d d d ... Oil pressure d d d d d d d r r r d d d d ... Resultant d d d d d d d r r r d d d d ... Bit values 0 0 0 0 0 0 0 1 1 1 0 0 0 0 ... MSB transmitted first Remaining bits NOT transmitted Transmission direction Arbitration lost Arbitration field Network Technology Richard Anthony The University of Greenwich

Bus Arbitration (3) - operation (Data Frame and Remote Frame) One bus unit sends a Data Frame “Engine RPM” whilst at the same time another bus unit sends a Remote Frame requesting the same data. “Engine RPM”, Identifier 00010001000 = dddrdddrddd (for Wired-AND) Message SOF 11-bit Identifier RTR IDE ... Data Frame d d d d r d d d r d d d d d ... Remote Frame d d d d r d d d r d d d r d ... Resultant d d d d r d d d r d d d d d ... Bit values 0 0 0 0 1 0 0 0 1 0 0 0 0 0 ... dominant for data Frame recessive for Remote Frame Standard Mode CAN MSB transmitted first Transmission direction Remaining bits NOT transmitted Arbitration field Arbitration lost Network Technology Richard Anthony The University of Greenwich

Power saving – CAN node’s Sleep mode A CAN bus unit can be put into sleep mode to reduce power consumption – for example when the functionality managed by the unit is not needed. In this mode the device has no internal activity and its bus driver is disabled. Sleeping units are woken up by any bus activity or by internal conditions of the unit (e.g. A timer expires). When one unit needs to wake-up another unit that is required to re-join communication activities, it uses a special wake up message with a special dedicated Identifier, rrr rrrd rrrr , this is the lowest priority identifier. For wired-AND the pattern is 111 1110 1111 Network Technology Richard Anthony The University of Greenwich

MilCAN

Deterministic means predictable in terms of: Overview of MilCAN MilCAN is a Deterministic protocol that can be applied to Controller Area Network (CAN) technology (a Higher Layer Protocol that can be applied above CAN). Deterministic means predictable in terms of: access to media without conflict (ability to transmit) timing (transmit at known intervals or slots) transmission success rate MilCAN is specified by ISO 11898. MilCAN was originally developed for use in military vehicles to provide deterministic (predictable ) communications between a range of real-time and high importance (safety-critical, mission critical) applications. MilCAN is available for use beyond Military applications – it can be applied wherever deterministic data transfer is required. Network Technology Richard Anthony The University of Greenwich

(synchronisation slots are numbered 0 to 1023, then start again at 0). MilCAN Operation In MilCAN, the Bus-time is divided into 1024 fixed position sync slots. (synchronisation slots are numbered 0 to 1023, then start again at 0). A periodic Sync frame is used to inform all nodes of the current sync slot number. Making it Deterministic Nodes access the bus and transmit messages according to a pre-defined message schedule which is based on the 1024 sync slot cycle. The total number of messages that may be transmitted in each slot can be calculated and a schedule created that bounds the latency of each message, so: * no conflicts occur, * all messages are transmitted successfully, and at predictable times. Network Technology Richard Anthony The University of Greenwich

ECU / Embedded control systems Message Allocated Sync Slot Engine temperature 1 Oil Pressure 3 Oil Temperature 4 MilCAN node Sensors / actuators ECU / Embedded control systems T Bus with terminators Engine temperature Oil Pressure Oil Temperature Example scenario – Engine management 0 1 2 3 4 ... Slot Possible message transmission sequence on the bus Possible message slot allocations Network Technology Richard Anthony The University of Greenwich

MilCAN robustness A specific node (sync frame master node) is responsible for sending the Sync Frames, and thus synchronising the whole network. A Sync Frame Arbitration protocol is used during network start-up to automatically select the sync frame master node. During network operation, if any node detects that absence of Sync Frames, the Sync Frame Arbitration protocol is used to automatically elect a new sync frame master node. No more than one message (identified by a unique message ID) is transmitted in any particular slot. Transient bus-fault conditions could temporarily cause violation of this – e.g. An electrical fault. Network Technology Richard Anthony The University of Greenwich

MilCAN A uses 29 bit Identifiers Applied on top of extended mode CAN. MilCAN variants MilCAN A uses 29 bit Identifiers Applied on top of extended mode CAN. Both periodic and event driven data can be transmitted via the bus. Supports 1Mbit and 250Kbit Baud rates. MilCAN B uses 11 bit Identifiers. Applied on top of standard mode CAN. Allows only periodic data to be transmitted via the bus. Supports a range of data rates from 10 kbps to 1 Mbps. Network Technology Richard Anthony The University of Greenwich