Вы находитесь на странице: 1из 8

Controller Area

Network
(CAN)

Contents
1

Objective......................................................................................................... 3

Introduction..................................................................................................... 3

The CAN Standard........................................................................................... 3

Communication............................................................................................... 4

4.1

Communication protocol...........................................................................4

4.2

Message arbitration.................................................................................. 4

4.3

Message frames........................................................................................ 5

4.4

Error detection.......................................................................................... 5

The CAN Bus.................................................................................................... 6


5.1

Bus length vs communication speed.........................................................6

Advantages and Disadvantages......................................................................6

Application Examples...................................................................................... 7

Conclusion....................................................................................................... 7

References....................................................................................................... 7

1 Objective
Objective of this section is to explain Controller Area Network (CAN)
fundamentals along with communication protocols, Message frames and its
characteristics.

2 Introduction
Control Area Network (CAN) is an International Standardization Organization
(ISO) defined serial communications bus originally developed for the automotive
industry to replace the complex wiring harness with a two-wire bus. The CAN bus
was originally developed by German equipment manufacture ROBERT BOSCH in
1995. In the beginning CAN mainly use by the automotive industry, but
nowadays it is used in a variety of applications, like industrial automation,
medical, transportation and so on.
CAN is multi master, message broadcast system that specifies a maximum
signalling rate of 1 megabit per second (bps). In a CAN network, many short
messages like temperature or RPM are broadcast to the entire network, which
provides for data consistency in every node of the system. CAN provide an
inexpensive durable network that helps multiple CAN devices communicate with
one another. CAN not only provides the physical media for the communication, it
also provides all other mechanisms necessary for addressing data packets
(messages), avoiding data collisions, detecting failures in the transmitted data,
automatic repetition of disturbed messages and ensuring data consistency over
all nodes in a network.
In this report CAN standard, fundamentals, operating principles, applications and
the benefit will be discussed in detailed. (1)(4)

3 The CAN Standard


Many network protocols are described using the seven layer Open System
Interconnection (OSI) model, as shown in Figure 1. The CAN communications
protocol, ISO-11898: 2003, describes how information is passed between devices
on a network and conforms to the Open Systems Interconnection (OSI) model.
CAN protocol defines the data link layer and part of the physical layer in the OSI
model. The remaining layers are not defined by the CAN specification. These
other layers can either be defined by the system designer, or they can be
implemented using existing non-proprietary Higher Layer Protocols (HLPs) and
physical layers

Figure 1: CAN and the OSI Model

4 Communication
4.1 Communication protocol
The CAN communication protocol is a carrier-sense, multiple-access protocol with
collision detection and arbitration on message priority (CSMA/CD+AMP). CSMA
means that each node on a bus must wait for a prescribed period of inactivity
before attempting to send a message. CD+AMP means that collisions are
resolved through a bit-wise arbitration, based on a pre-programmed priority of
each message in the identifier field of a message. The higher priority identifier
always wins bus access.(1)

4.2 Message arbitration


CAN node can communicate with any other node in half-duplex mode. Every
node in the bus can transmit and receive data. However, the message with
highest priority is transmitted first. A message consists of an identifier (ID),
which represents the priority of the message with respect to collision avoidance
and up to eight data bytes. It is transmitted serially over the bus and received by
the all the other nodes in the bus. If the bus is free, any node may began to
transmit. If two or more nodes begin sending messages at the same time, the
message with the higher priority will be transmitted first. The message with
lower binary identifier number has higher priority. An identifier consisting all zero
bits is the highest priority message on a network. An identifier consisting
entirely of zeros is the highest priority message on a network because it holds
the bus dominant the longest. Therefore, if two nodes begin to transmit
simultaneously, the node that sends a last identifier bit as a zero (dominant)
while the other nodes send a one (recessive) retains control of the CAN bus and
goes on to complete its message. A dominant bit always overwrites a recessive

bit on a CAN bus. This mechanism is referred to as priority-based bus arbitration.


(1)(4)
The allocation of message priority is done by the designer base on the
significance of certain message agreed by the industry group. For example, a
manufacturer of motor drives may specify that message 0010 is a winding
current feedback signal from a motor on a CAN network and that 0011 is the
tachometer speed. Because 0010 has the lowest binary identifier, messages
relating to current values always have a higher priority on the bus than those
concerned with tachometer readings
.

4.3 Message frames


CAN bus messages are organised as frames. The most commonly use message
frame comprises the Arbitration Field, the Data Field, the CRC Field, and the Acknowledgment Field
as shown in the Figure 3 and Figure 4.

Figure 1: Standard CAN frame format

Figure 1: Extended CAN frame format


In general CAN frame consists of the following sections:

SOF (Start Of frame) indicates the beginning of a message with a dominant (logic 0)
bit, and is used to
Identifier - The Standard CAN 11-bit identifier (29 bit identifier for extended CAN) indicate the
message priority. The lower the binary value, the higher its priority
RTR (Remote Transmission Request) serves to differentiate a remote frame from a
data frame. A dominant (logic 0) RTR bit indicates a data frame. A recessive (logic 1)
RTR bit indicates a remote frame.

IDE (Identifier Extension) allows differentiation between standard and extended frame
r0Reserved bit (for possible use by future standard amendment)
DLC (Data Length Code)The 4-bit data length code (DLC) contains the number of bytes of
data being transmitted.
Data contains 0 to 8 bytes of data.
CRC (cyclic redundancy check) The 16-bit (15 bits plus delimiter) contains the checksum for
error detection
ACKEvery node receiving an accurate message overwrites this recessive bit in the original
message with a dominate bit, indicating an error-free message has been sent. Should a
receiving node detect an error and leave this bit recessive, it discards the message and the
sending node repeats the message after rearbitration. In this way, each node acknowledges
(ACK) the integrity of its data. ACK is 2 bits, one is the acknowledgment bit and the second is
a delimiter.

EOF (End-Of-Frame )7-bit field marks the end of a CAN frame


IFS (Inter Frame Space) This 7-bit contains the time required by the controller to move a
correctly received frame to its proper position in a message buffer area.

4.4 Error detection


There are five different error checking method used by CAN protocol. There are
three message level error checking and two bit level error checking. If error is
detected at the receiving node error frame is generated at receiving node and
this force transmitting node to resend the message. CRC and ACK in the message
frame use for message level error checking.

5 The CAN Bus


The high speed ISO 11898-2 CAN standard defines a single line of twisted-pair
cable as the network topology as shown in the figure 6. CAN bus does not
support star or even a multi star topologies. Each node are connected to the
main bus by un-terminated drop lines. The bus line are terminated at both ends
with 120-ohm termination resistors which match the characteristic impedance of
the line. Termination resistor prevent signal reflection on the bus. Signal
reflections on the bus causes significant ringing and error rate.

Figure 1: Details of a CAN Bus

Each node consists of transceiver, can controller and microcontroller or DSP as


shown in the Figure 6. Nodes are connected to CAN bus through transceiver
enable them to communicate each other. Node can be added or removed from
the bus any time even while network is in operation. That mean nodes are hot
pluggable.

5.1 Bus length vs communication speed


The High-Speed CAN allow maximum signalling rate of 1 Mbps with a bus length of 40 m with a
maximum of 30 nodes. It also recommends a maximum unterminated stub length of 0.3 m.

6 Advantages and Disadvantages


Advantages

More reliably, e.g., fewer plug-in connectors that might cause errors.
6

Wiring less complicated, more economic.


Easy to implement, changes, too.
Additional elements (e.g., control units) are easy to integrate.
Installation place exchangeable without electric problems.
Wire may be diagnosed.

Disadvantage

High software expenditure.


Undesirable interaction more probable.
Danger of incomplete technology for the customer.

7 Application Examples

Vehicles
Industrial Machineries
Railway systems
Building Automation
Marine
Medical

8 Conclusion
CAN is ideally suited in applications requiring a large number of short messages
with high reliability in rugged operating environments. Because CAN is message
based and not address based, it is especially well suited when data is needed by
more than one location and system-wide data consistency is mandatory.
Fault confinement is also a major benefit of CAN. Faulty nodes are automatically
dropped from the bus, which prevents any single node from bringing a network
down, and ensures that bandwidth is always available for critical message
transmission. This error containment also allows nodes to be added to a bus
while the system is in operation, otherwise known as hot-plugging.
The many features of the CAN transceivers make them ideally suited for the
many rugged applications to which the CAN protocol is being adapted. Among
the applications finding solutions with CAN are automobiles, trucks, motorcycles,
snowmobiles trains, buses, airplanes, agriculture, construction, mining, and
marine vehicles.

9 References
1. Anon, (2015). [online] Available at:
http://www.ti.com/lit/an/sloa101a/sloa101a.pdf [Accessed 6 Aug. 2015].
2. Ni.com, (2015). Controller Area Network (CAN) Overview - National
Instruments. [online] Available at: http://www.ni.com/white-paper/2732/en/
[Accessed 6 Aug. 2015].
3. Anon, (2015). [online] Available at: https://www.cs.standrews.ac.uk/files/2007-8-1%20Lecture3.pdf [Accessed 6 Aug. 201
4. Esd-electronics-usa.com, (2015). Controller Area Network (CAN) Introduction. [online] Available at: http://www.esd-electronics-

usa.com/Controller-Area-Network-CAN-Introduction.html [Accessed 9 Aug.


2015].
5. Anon, (2015). [online] Available at:
http://ww1.microchip.com/downloads/en/AppNotes/00228a.pdf [Accessed
9 Aug. 2015].

Вам также может понравиться