Upload
deepumesh
View
219
Download
0
Embed Size (px)
Citation preview
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 1/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar 1
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 2/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar 2
Objective:
To understand
Development of CAN
Basic Concept of CAN Frame Formats - Overview Error detection - Overview
CAN Protocol Typical CAN Implementations
CAN – User Benefits
CAN – Application Examples
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 3/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar 3
Implementation of more and more electronic devices in modern motor vehicles
for More safety and comfort for the driver, Reduction of Fuel Consumption,Exhaust Emission
Development of CAN
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 4/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar 4
These different control systems & their controls were connected point to point by wiring.
The requirement for information exchange grown to such an extent thata cable network with a length of up to several miles and many connectors were required
Problems --- Increased material cost, Production time and reliability
Development of CAN
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 5/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar 5
Solution: Connection of control systems with serial bus system. This bus system has tofulfill some special requirement due to its use in vehicle
With the use of CAN, point to point wiring is replaced by one serial bus system connectingall control systems. This is accomplished by adding some CAN- specific hardware to eachcontrol unit that provides the “rules” or the protocols for transmitting and receivinginformation via the bus.
Development of CAN
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 6/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
6
Advanced serial bus system to efficiently supports distributed control systems. Initially developed by Robert Bosch GmBH, Germany in late 1980. Holds license for CAN CAN is internationally standardized by ISO and SAE
CAN protocol uses Data Link Layer and Physical Layer in ISO_OSI model There are also higher level of protocols are availableWidely used in Automotive and Industrial market segment There are about 140 million nodes are in use by 2000
Overview of CAN
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 7/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
7
Multi-master bus with Open, linear structure with one logic bus lineNumber of nodes not limited by protocol
Bus Nodes do not have specific address, instead address information is contained inidentifiers of transmitted messages, indicating the message content and priority of message No. of nodes may be changed dynamically without disturbing communication of other nodes Multicasting and broadcasting capability
Basic Concept of CAN
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 8/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
8
Provides sophisticated error detection and error handling mechanism viz. CRC Checkand high immunity against electromagnetic interference. Erroneous messages areautomatically retransmitted. Temporary errors are recovered. Permanent errors are followedby automatic switch-off of defective nodes
CAN protocol uses Non – Return to Zero or NRZ bit coding CAN protocol uses bit stuffing for synchronization High data transfer rate of 1000kbps for max bus length of 40m using twisted wire pairs Message length is short with 8 data bytes per message. Bus access is handled via advanced serial communications protocol Carrier SenseMultiple Access/Collision Detection (CSMA/CD) with non destructive arbitration. Collision of message is avoided by bitwise arbitration without loss of time
Basic Concept of CAN
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 9/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
9
Two Bus states – Dominant and Recessive Bus logic uses WIRED AND mechanism Dominant bits (equivalent to logic level zero) overwrites the recessive bits (equivalent tothe logic level one)
CAN Bus Characteristics – Wired AND
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 10/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
10
Only if all nodes transmits recessive bits(ones), the bus is in recessive state
CAN Bus Characteristics – Wired AND
As soon as one node transmits dominantbit (zero), the bus is in dominant state
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 11/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
11
Carrier Sense Multiple Access with Arbitration on message priority Arbitration avoids the collision of messages whose transmission was started by more than
one node simultaneously and makes sure that the most important message is sent firstwithout time loss. It is not permitted for different nodes to send messages with same identifier as arbitrationcould fail leading to collisions and errors.
Bus Access and Arbitration – CSMA/CD w/AMP
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 12/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
12
Frame Formats - Overview
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 13/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
13
Frame Formats – Data Frame
Generated by CAN when node wishes to transmit the data Start of Frame used for Hard synchronization of all nodes 11 bit identifier field reflects the contents and priority of the messages Remote Transmission Request (RTR) is used to distinguish the Data Frame
(RTR=Dominant) from Remote fram (RTR=Recessive) Control Field 6 bits 1st bit IDE (Identifier Extension) at dominant state to specify the standard frame Next bit is reserved and is in dominant state Next 4 bits are Data Length Code (DLC) used to specify the number of bytesdata contained in message (0-8 bytes)
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 14/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
14
Frame Formats – Data Frame
Data Field contains the data to be sent Cyclic Redundancy Field (CRC) consists of 15 bits CRC sequence and 1 bit recessiveCRC Delimiter. It is used to detect possible transmission errors
Acknowledge Field contains ACK slot – transmitting node sends out a recessive bit. Anynode that has received the error free frame acknowledges the correct reception of the frameby sending back the dominant bit. Recessive acknowledge delimiter completes the acknowledge slot and may not beoverwritten by dominant bit. 7 recessive bits (End of Frame) ends the Data Frame
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 15/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
15
Frame Formats – Remote Frame
In general data transmission, data source node (e.g. Sensor) send out the data frame. It is also possible that the destination node can request data from the source by sendingthe remote frame. Differences ---
1. RTR frame is transmitted as dominant in Data frame 2. There is no Data field in remote frame. Data frame and Remote frame with the same identifier being transmitted at the sametime, the data frame wins the arbitration due to the dominant RTR field following theidentifier. So node that transmits remote frame received the desire data immediately.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 16/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
16
Frame Formats – Error Frame
Generated by any node which detects bus error Two fields = Error flag field followed by Error Delimiter field Error delimiter consists of 8 recessive bits, allows bus node to restart the bus
communication cleanly after an error. Error Flag field has 2 forms, depends upon the error status of node that detects the error. Error Active node detects a bus error, interrupts transmission of the current message bygenerating the active error flag. Error Passive node detects a bus error, transmits a passive error flag followed by errordelimiter field.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 17/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
17
Frame Formats – Overload Frame
Generated only during the interframe space. Two fields = Overload flag field followed by Overload Delimiter field Overload frame can be generated by a node if the due to internal conditions, the node is
not yet able to start reception of the next message. A node may generate maximum of two sequential Overload frames to delay the start ofthe next message.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 18/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
18
Frame Formats – Interframe space
Interframe space separates a preceding frame from following data or remote frame. It consists of 3 recessive bits called as intermission field. This time is provided to allow the nodes, time for internal processing before the start of the
next message.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 19/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
19
Error detection - Overview
CAN protocol provides sophisticated error detection mechanism.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 20/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
20
Error detection – Cyclic Redundancy Check (CRC)
If node detects the mismatch betweenthe calculated and the received CRCsequence, then CRC error has occurred.
Node B discards the message andtransmits an error frame to requestretransmission of garbled frame.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 21/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
21
Error detection – Acknowledge Check
With Acknowledge check, the transmitter checks in the Acknowledge Field of a messageto determine if the acknowledge slot, which is sent out as recessive bit, contain dominant
bit. If this is the case, other node had received the frame successfully. If not, the acknowledge error has occurred and message has to be repeated. No error frame has generated.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 22/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
22
Error detection – Frame Check
If transmitter detects a dominant bit in one of the four
segments, CRC delimiter, Acknowledge delimiter, End of Frame,Interframe space Then a form error has occurred and a error frame isgenerated. Message will then be repeated
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 23/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
23
Error detection – Bit Monitoring
All nodes perform bit monitoring. If transmitter sends a dominant bit but detectsrecessive bit on a bus or vice versa, an error frame isgenerated and message is repeated.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 24/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
24
Error detection – Bit Stuffing
If six consecutive bits with the same polarity are detected between start of frame andCRC delimiter, the bit stuffing rule has been violated. Stuff error occurs and error frame is generated and message is repeated.
Undetected errors – Example
To understand the error detection capabilities of CAN, imagine a vehicle equipped withCAN running 2000 hrs per year at a CAN bus speed of 500kbps with 25% bus load This will result in 1 undetected error every 1000 years
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 25/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
25
CAN Protocol versions
The original CAN specifications (V1.0, 1.2 and 2.0A) specify 11 bit identifier. Also known as Standard CAN With this 2048 different messages (identifier = 0 – 2047) can be identified.
16 messages with lowest priority (2032-2047) are reserved. CAN Version 2.0B adopted to remove the message number limitation and to meet the SAE J1939std for the use of CAN in trucks CAN 2.0B is also called as Extended CAN Contains 29 bit identifier which allows over 536 millions message identifier. 29 bit identifier consists of 11 bit identifier (BASE ID) and 18 bit extended identifier (ID Extension)
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 26/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
26
CAN Protocol Message Coding
CAN Protocol uses Non-Return-To-Zero or NRZ bit coding
Signal is constant for one whole bit time and only one time segment is need to represent one bit
Zero corresponds to dominant bit, placing the bus in dominant state.
One corresponds to recessive bit, placing the bus in recessive state.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 27/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
27
Relation Between Baud Rate and Bus Length
Max CAN Bus speed is 1MBaud, can be achieved using bus Length of up to 40m
For Bus length longer than 40m, Bus speed must be reduced.
For bus length more than 1000m, special drivers should be used.
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 28/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
28
ISO Physical Layer
For CAN bus line, medium must be chosen that is able to transmit two possible bit statesi.e. dominant and recessive
Most Common and cheapest – Twisted wire pair
Bus lines are then called as CAN_H and CAN_L
Alternate – Optical Fiber Recessive state will be represented by the signal Light off and Dominant state will be represented by the signal Light on
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 29/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
29
Typical CAN Implementations
Application itself is controlled by a microcontroller e.g. Siemens SAB 80C166
For communication, microcontroller has to be connected with CAN controllere.g. Siemens Full Controller 81C90/91
To meet the requirements of ISO 11898 CAN standard, a CAN transceiver chiphas to be used to connect the node to the CAN bus line
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 30/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
30
CAN – User Benefits
Low Cost - Serial Bus with two wire – good price/performance ratio
Reliable - Sophisticated Error handling & detection mechanism - high reliability transmission
Real Time - Short Message length ( 0 – 8 data bytes /message)- Low latency between transmission request and actual start of the transmission- Inherent Arbitration on Message Priority (AMP)
Flexible - CAN nodes can be easily connected or disconnected (i.e. plug and play)- No limitation of number of nodes
Fast - Max data rate is 1Mbit/s @ 40m bus length
Broadcast capability
- Message can be sent to single / multiple nodes- All nodes simultaneously receive the common data
Standardization- ISO - DIS 11898 (High Speed Applications)- ISO - DIS 11519-2 (low Speed Applications)
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 31/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
31
CAN – Application Examples
Motor vehicles (Cars, Buses, Trucks)
- Enables communication between ECUs like engine management system,anti-skid braking, gear control, active suspension
Utility vehicles- Construction vehicles, forklifts, tractors- CAN used for power trains and hydraulic control
Trains - High need of data exchange between electronic subsystem control units- i.e. acceleration, braking, door control, error messages etc,
Industrial automation- For connecting all kinds of automation equipments
(control units, sensors, actuators)- Machine controls
Medical Equipment- Computer tomographs, X-ray machines, dentist and wheel chairs
Building automation- heating, air-conditioning, lighting, surveillance etc.- Elevator and escalator control
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 32/33
CONTROLLER AREA NETWORK (CAN)
Umesh Mangalekar
32
References
http://www.mjschofield.com, 2009, Homepage for Controller Network Area
http://www.can-cia.org, 2009, Homepage for organization CAN in Automationhttp://www.s3.kth.se, 2009, Paper on Vehicle Applications of CAN
8/4/2019 Presentation CAN
http://slidepdf.com/reader/full/presentation-can 33/33
CONTROLLER AREA NETWORK (CAN)
33