Professional Documents
Culture Documents
Umesh Mangalekar
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
Umesh Mangalekar
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
Umesh Mangalekar
These different control systems & their controls were connected point to point by wiring.
Umesh Mangalekar
Solution:
Connection of control systems with serial bus system. This bus system has to fulfill 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 connecting
all control systems. This is accomplished by adding some CAN- specific hardware to each control unit that provides the rules or the protocols for transmitting and receiving information via the bus.
5
Umesh Mangalekar
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 available Widely used in Automotive and Industrial market segment There are about 140 million nodes are in use by 2000
6
Umesh Mangalekar
Multi-master bus with Open, linear structure with one logic bus line Number of nodes not limited by protocol Bus Nodes do not have specific address, instead address information
is contained in identifiers 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
Umesh Mangalekar
Provides sophisticated error detection and error handling mechanism viz. CRC Check and high immunity against electromagnetic interference. Erroneous messages are automatically retransmitted. Temporary errors are recovered. Permanent errors are followed by 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 Sense Multiple Access/Collision Detection (CSMA/CD) with non destructive arbitration. Collision of message is avoided by bitwise arbitration without loss of time Umesh Mangalekar
Two Bus states Dominant and Recessive Bus logic uses WIRED AND mechanism Dominant bits (equivalent to logic level zero) overwrites the recessive bits (equivalent to the logic level one)
9
Umesh Mangalekar
Only
if all nodes transmits recessive bits (ones), the bus is in recessive state
10
Umesh Mangalekar
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 first without time loss. It is not permitted for different nodes to send messages with same identifier as arbitration could fail leading to collisions and errors.
11
Umesh Mangalekar
12
Umesh Mangalekar
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
(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 bytes
data contained in message (0-8 bytes)
Umesh Mangalekar
13
Data Field contains the data to be sent Cyclic Redundancy Field (CRC) consists
of 15 bits CRC sequence and 1 bit recessive CRC Delimiter. It is used to detect possible transmission errors Acknowledge Field contains ACK slot transmitting node sends out a recessive bit. Any node that has received the error free frame acknowledges the correct reception of the frame by sending back the dominant bit. Recessive acknowledge delimiter completes the acknowledge slot and may not be overwritten by dominant bit. 7 recessive bits (End of Frame) ends the Data Frame
14
Umesh Mangalekar
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 sending
the 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 same time, the data frame wins the arbitration due to the dominant RTR field following the identifier. So node that transmits remote frame received the desire data immediately.
15
Umesh Mangalekar
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
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 by generating the active error flag. Error Passive node detects a bus error, transmits a passive error flag followed by error delimiter field.
16
Umesh Mangalekar
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 of the next message.
17
Umesh Mangalekar
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.
18
Umesh Mangalekar
19
Umesh Mangalekar
If
node detects the mismatch between the calculated and the received CRC sequence, then CRC error has occurred. Node B discards the message and transmits an error frame to request retransmission of garbled frame.
20
Umesh Mangalekar
With Acknowledge check, the transmitter checks in the Acknowledge Field of a message
to 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.
21
Umesh Mangalekar
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 is generated. Message will then be repeated
22
Umesh Mangalekar
bit but detects recessive bit on a bus or vice versa, an error frame is generated and message is repeated.
23
Umesh Mangalekar
If
six consecutive bits with the same polarity are detected between start of frame and CRC delimiter, the bit stuffing rule has been violated. Stuff error occurs and error frame is generated and message is repeated.
To understand the error detection capabilities of CAN, imagine a vehicle equipped with
CAN 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
24
Umesh Mangalekar
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 J1939
std 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)
25
Umesh Mangalekar
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
26
Umesh Mangalekar
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.
27
Umesh Mangalekar
For CAN bus line, medium must be chosen that is able to transmit two possible bit states
i.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
28
Umesh Mangalekar
For
communication, microcontroller has to be connected with CAN controller e.g. Siemens Full Controller 81C90/91
To meet the requirements of ISO 11898 CAN standard, a CAN transceiver chip
has to be used to connect the node to the CAN bus line
29
Umesh Mangalekar
- Sophisticated Error handling & detection mechanism - high reliability transmission bytes /message) - Low latency between transmission request and actual start of the - Inherent Arbitration on Message Priority (AMP)
transmission
Flexible Fast
- CAN nodes can be easily connected or disconnected (i.e. plug and play) - No limitation of number of nodes - 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)
30
Umesh Mangalekar
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
31
Umesh Mangalekar
32
Umesh Mangalekar
33
Umesh Mangalekar