CAN bus

The CAN bus (Controller Area Network ) is a serial bus system and belongs to the fieldbuses.

Order in vehicles to reduce the wiring harnesses ( up to 2 km) and thus saving weight, the CAN bus was developed in 1983 by Bosch for the networking of control units in automobiles and in 1987 presented together with Intel. CAN is a standardized internationally as ISO 11898, and defines the Layer 1 ( physical layer ) and 2 ( data link layer ) in the ISO / OSI reference model. The two most common implementations of the physical layer according to ISO 11898-2 ( CAN High Speed ​​) and ISO 11898-3 ( low-speed CAN ) differ not only in the data rate in other properties and therefore are not compatible with each other.

  • 2.1 data frame
  • 2.2 Remote Frame
  • 2.3 Error Frame
  • 2.4 Overload Frame

Function

Transmission method

The CAN bus uses the CSMA / CR (Carrier Sense Multiple Access / Collision Resolution) method ( not to be confused with CSMA / CD as Ethernet). In the literature, the method is called, for historical reasons CSMA / CA. In this case, collisions are resolved by the bus access arbitration or arbitration bit ( see below). The data is NRZ coded. Furthermore, the data backup is the cyclic redundancy check ( CRC Sheet for Cyclic Redundancy Check) is used. For continuous synchronization of bus users is bit stuffing ( bit stuffing ) is used ( see below). The bus is performed with either copper wires or fiber optics. The CAN bus operates on the " multi-master principle ": multiple equal control units ( = bus nodes) are connected by a topological arrangement (see below) connected with each other.

In the case of copper wires of the CAN bus (see below) with differential signals operate at higher data rates. The difference signals are usually carried out with two or three lines: CAN_HIGH, CAN_LOW and optional CAN_GND (ground). CAN_LOW contains the complementary level of CAN_HIGH compared to a resting tension of about 2.5 V for the high-speed CAN. The difference voltage with a dominant bit is at least 2 V. This common mode noise can be suppressed, since the difference remains the same.

When low-speed CAN be the calm tensions and recessive voltages 5 V and 0 V, the dominant voltages around 1.4 V ( CAN_LOW ) and 3.6 V ( CAN_HIGH ). If one of the two lines, the voltage of the other wire to earth can be evaluated. For slower buses (, comfort bus ', for example, for operating elements by the user) can therefore submit a single wire to the car body as a ground. In practice, it is mostly still performed as a two- wire system, but used in case of failure of a wire break the single-wire mode as fallback in order to continue the operation can, this is then called " limp home mode" ( " after - home - limp mode"). To avoid interference, it is always twisted.

The transfer of data is such that a bit - depending on the state - has either dominant or recessive on the bus lines. A dominant overwrites a recessive bit.

Transfer rate and cable length

A distinction is made between a high-speed and low-speed a bus. For a high-speed bus, the maximum data transfer rate is 1 Mbit / s, at low speed 125 kbit / s

The maximum (theoretical) line length is, for example, at 1 Mbit / s to 40 m at 500 kbit / s to 100 m and at 125 kbit / s 500 m. These maximum values ​​are based on the time a signal is present on the bus ( bit time, bits / second) is the shorter, the higher is the transmission rate. With increasing cable length but increases the time required for a signal until it has arrived at the other end of the bus ( propagation speed). Therefore, the time elapsing, the A signal on the bus, not be shorter than the time it takes for a signal to propagate. Note that the signal not only propagates but must respond to the channel within the signal period of the receiver (see ACK). The transmitter must turn the possible Buspegeländerung of / noticed the receiver (see also arbitration). Therefore, the max. To calculate line length slightly more complex. It must be taken into account delays in the cable, of the transceiver ( transmitter and receiver), the controller ( transmitter and receiver), the oscillator tolerances and sample time, the set (transmitter and receiver). The formula for calculating the literature and further information are removed.

As a bus medium are recommended with a characteristic impedance of 108-132 ohms according to ISO 11898-2 (High-Speed ​​Medium Access Unit) from 1993 twisted-pair cable. In the currently valid edition of ISO 11898-2 in 2003, the tolerance is specified with 95-140 ohm (Section 7.5.1, Table 9).

The maximum number of participants on a physical level depends on the used Bustreiberbausteinen (transceiver, physical connection to the bus ) from. With popular modules are 32, 64 or up to 110 ( with limitations to 128) participants per line (for expansion via repeaters or bridges ).

Topology

The CAN network is configured with a line structure. Stubs are permitted in limited circumstances. Also a star type bus (eg for the central locking in the car ) is possible. However, these variants have compared to the linear bus disadvantages:

  • The star- type bus is mostly controlled by a central computer, since this must happen all the information, with the result that in case of failure of the central computer information can not be forwarded. In case of failure of a single control unit of the bus continues to function.
  • For spurs and star- shaped bus architecture of the characteristic impedance is a bit more complicated to determine. The number of stubs and their total length is estimated by empirical formulas straightening. The linear bus has the advantage that all control devices are in parallel with a central line. Only if this fails, the bus no longer functions. This topology is commonly used in motor vehicles.

At each end of the cable with a terminating resistor of 120 ohms should be. For a single CAN -Bus devices on a stub, this works as a single 60 -ohm resistor is inserted at the point of diversion. This value is the impedance of a central star architecture.

Object identifier

The object identifier identifies the content of the message, not the device. For example, may be assigned to each is a separate identifier in a measurement system to the parameters temperature, voltage and pressure. It can be combined under one identifier as long as the sum of the data does not exceed the maximum possible length of the data field several parameters. The receivers use the identifier if the message is relevant to them or not.

In addition, the object identifier is also used to prioritize the messages.

The specification defines two different identifier formats:

A participant may be the receiver and transmitter of messages with any number of identifiers, but conversely, it may give an identifier only a maximum of one transmitter, so that the arbitration works.

The CAN standard requires that an implementation must accept the " base frame format ," on the other hand can accept "Extended frame format", but it must at least tolerate.

Arbitration priority

The bus access is lossless resolved by means of the bit-wise arbitration on the basis of the identifiers of the messages to be sent. For this, each station monitors the bus while it is transmitting the identifier. Send two participants at a time, so overwrites the first dominant bit of either the recessive according to the other, which recognizes this and its transmission attempt ended. Use both participants have the same identifier is not an immediate error frame is generated ( see Frame structure), but only when a collision within the remaining bits, which should be excluded by the arbitration. Therefore, the standard recommends that an identifier is to be used only by a maximum of one participant.

By this method, a hierarchy of messages among themselves is given. The message with the lowest identifier must always be transmitted. For the transmission of time-critical messages so a high priority identifier ( ID = low, eg 0x001, 0x000 for network management - NMT) will be awarded to grant them as a priority in the transmission. Nevertheless, the transmission time, even with high-priority messages in time not be accurately determined in advance, since it is precisely while in transit messages can not be interrupted and can delay the start time of a program as to the maximum message length ( non-deterministic behavior). Only the maximum transmission delay for the highest priority message can be calculated for a known maximum message length. For low-priority messages generally no indication of the time of transmission is possible.

If a participant continuously send messages with a high priority, this can lead to blockage of the bus, because the messages of the other participants each lose the arbitration. This behavior is described as a babbling idiot. If this behavior on a malfunction based it can only by additional hardware (called bus guardians ) are dissolved.

Frame construction

The communication takes place by means of telegrams. Within a telegram there are control bits and payload bits (red area ). The standardized structure of such a telegram frame is called a frame.

There are four different types of frames:

  • Data frame is used to transport up to 8 bytes of data
  • Remote frame, is used to request a data frame from another subscriber
  • Error frame, all participants signaled a detected error condition in the transmission
  • Overload frame, serves as a forced break between data and remote frames

Data frame

A data frame is constructed logically as follows:

  • Start of Frame (SOF ) = a dominant bit
  • Arbitration field, consisting of an identifier segment ( 11-bit or 29 2 bits) plus a RTR bit (Remote Transmission Request, see below)
  • Control panel (CTRL) = 6 bits Identifier extension (IDE) = 1 bit
  • Reserved = 1 bit
  • Data Length Code (DLC ) = 4bit (number of bytes in the data field )

Remote Frame

A set RTR bit (Remote Transmission Request) indicates a remote frame ( recessive). With the help of a remote frame, a participant may invite another to transmit its data.

In case of an "Extended Identifiers" ( see above), the RTR bit by bit SRR (Substitute Remote Request ) is replaced and also sent recessive. In this case, the following IDE bit is also sent recessive, creating a " extended identifier " is indicated. Subsequently, the remaining 18 bits of the identifier and then the actual RTR bit to be sent. The IDE bit counts logically to the " Arbitration field ", where the control panel but still consists of 6 bits.

The data length must be set according to the expected data length (Error source: Many developers use the data length = 0 - this is wrong, or if they CAN controller on the market that can send what RTR frames with data length 0). Object identifier is the same as that of the requested message.

Error Frame

The error frame consists of two fields:

The first field is determined by the superposition of the error flag which may be generated by the various stations. The following field is the ERROR DELIMITER (8 recessive bits ).

There are two types of error flags:

Overload Frame

The Overload Frame is a forced break between data and remote frames.

ACK slot

The Acknowledge slot is used to acknowledge the receipt of a proper CAN frames. Each receiver could not detect any error, sets a dominant level at the location of the ACK slot and thus overwrites the recessive level of the transmitter. In the case of a negative acknowledgment ( recessive level ) of the error-detecting node error flag must hang up after the ACK delimiter, so that, first, the transmitter is set by the transmission errors in knowledge and secondly to ensure network-wide data consistency. If the recessive level by a receiver overwritten by a dominant, but the sender can not assume that the telegram was received from all other receivers.

Bit stuffing

Bit strings with more than five identical bits in the CAN protocol for control purposes eg "End of Frame". It may therefore not more than five bits with the same level occur consecutively within the CAN frames. To prevent this, after five bits of the same level, a bit having the inverse level is inserted. This bit is called " stuffing bits " or "stuff bit ". The picture shows the same CAN frame before and after the insertion of stuff bits. The stuffing bits are colored purple. Bit stuffing ( bit stuffing ), the physical length of a frame to enlarge. The CAN bus which provides bit stuffing after five homopolar bits for the insertion of a complementary bits ( the so-called stuffing ) in the bitstream. Bit stuffing acts on Start of frame ( SOF) up to and including checksum ( CRC) of data and remote frames and serves the dubbing of the participants within a frame.

Synchronization and time quanta

A bit is divided into so-called time quanta. They correspond to a multiple of the controller clock. In each time quantum is scanned only once. An edge is detected if the sample before the time quantum has a different value than the value afterwards. The dubbing thus synchronized on a time constant, and not on the edge.

Backup

Detects a receiver an error condition, it sends an error frame and causes all stations to discard the frame. If other participants did not recognize this error condition, they in turn send directly following another error frame. This represents an additional safety feature of the CAN protocol is possible. To avoid that individual participants by erroneously detected error conditions permanently block the message transport, each participant error counters. These counters allow according to the rules of the specification, to separate a malfunctioning participants in two stages of the operating state of the bus when it detects repeated mistake not to recognize that other participants or repeatedly sent erroneous frames. The states error active (normal), error passive ( participants may have only passive - that is recessive - Send error frames ) call themselves and bus off (participant must not send ).

The transmitter repeats after the error frame its data transmission. And the transmitter can be separated by the above-mentioned error count from the bus if the data transmission fails continuously. Various error conditions lead to different size increase of the error counter.

Standards

  • ISO 11898-1:2003 Road vehicles - Controller area network - Part 1: Data link layer and physical signaling
  • ISO 11898-2:2003 Road vehicles - Controller area network - Part 2: High-speed medium access unit
  • ISO 11898-3:2006 Road vehicles - Controller area network - Part 3: Low-speed, fault-tolerant, medium dependent interface
  • ISO 11898-4:2004 Road vehicles - Controller area network - Part 4: Time -triggered communication
  • ISO 11898-5:2007 Road vehicles - Controller area network - Part 5: High-speed medium access unit with low-power mode
  • ISO / NP 11898-6 Road vehicles - Controller area network - Part 6: High-speed medium access unit with selective wake-up functionality

Development

2012, a proposal to increase the available bandwidth called CAN FD ( Flexible Data Rate) was introduced by Bosch. This is achieved by shortening the bit times of the data phase and enlargement of the data field to 64 bytes. Overall, it promises at the time by the "improved CAN" method mentioned an up to 8 -fold higher data throughput. Changes to the CRC protection, data security increased compared to the Classic CAN at a Hamming distance of 6

Applications

CAN protocols have been established in various, especially security-related areas, which require high data security. Examples:

  • Automotive industry ( networking of various control devices, sensor units and even multimedia units)
  • Automation technology ( time-sensitive sensors in the field, monitoring technical facilities )
  • The lift equipment ( networking of control with various sensors, actuators, and elevator systems with each other within an elevator group )
  • Medical technology ( magnetic resonance and computed tomography, blood collection equipment, laboratory equipment, electric wheelchairs, heart lung machines )
  • Aircraft technology (networking within the cabin and flight guidance systems )
  • Space technology (increased use in parallel bus architectures )
  • PA System (used for the control of digital amplifiers)
  • Rail vehicles
  • Shipbuilding ( The GMRS can be installed in the new generation of its rescue boat bus systems. )

Higher-level protocols

CANopen

CANopen is a CAN-based layer 7 communications protocol that was initially used in automation technology, but is now used mainly in embedded systems.

CANopen was initiated mainly by German small and medium-sized companies and developed through a process ESPRIT project headed by Bosch. Since 1995 it is maintained by the CAN in Automation and is now standardized as a European Standard EN 50325-4. It is used primarily in Europe, followed by Asia.

DeviceNet

DeviceNet is a CAN-based layer 7 communications protocol which is mainly used in automation technology.

DeviceNet is mainly used in America. It was built by Allen- Bradley ( Rockwell Automation is one ) develops and later passed as an open standard to the ODVA ( Open DeviceNet Vendor Association ).

J1939 and NMEA2000 extensions and ISOBUS

J1939 is a CAN-based protocol in the commercial vehicle sector. It is maintained by the Society of Automotive Engineers (SAE ). An Introduction to J1939 can be found in Application Note Introduction J1939

NMEA 2000 is an extension of SAE J1939 for the maritime sector. The minutes of the NMEA organization is spreading increasingly. Predecessor is NMEA 0183rd

In agriculture and municipal engineering of the ISOBUS ( ISO 11783 ), which is an extension of the J1939 comes to control and monitor the use of attachments.

CleANopen

A working group of CAN in Automation, CANopen Special Interest Group (SIG ) " Municipal Vehicles", developed the CANopen application profile for refuse collection vehicles ( CleANopen ).

CANopen-Lift

A working group was founded in 2001, the CAN in Automation, CANopen Special Interest Group (SIG ) " Lift Control ", developed the CANopen application profile (CANopen CiA 417) for lifts (CANopen -Lift ). The first version was released in summer 2003. Version 2.0 was adopted as a draft standard and is freely available. Currently (2013 ) working on version 2.2.

SafetyBUS p

SafetyBUS p is a CAN-based secure communication protocol which is mainly used in automation technology for the transmission of safety-related data. All bus nodes are 2 - or even built 3 -channel and check the data integrity. The transmission medium itself is not sure that safety is achieved by the p SafetyBUS own data protocol. The SafetyBUS p can be used up to SIL3.

TTCAN

Time-Triggered Communication on CAN is based on the CAN bus and allows higher protocol layers on a real-time control.

CANaerospace

CANaerospace is an open source communication protocol, which was designed in 1998 especially for use in the aviation industry with their particular reliability and performance requirements. In 2000, the American NASA CANaerospace has adopted as its own standard. CANaerospace is used in numerous research aircraft in the world and has become the de facto standard in military flight simulation technology.

ARINC 825

ARINC 825 is an international aviation communication standard, which was (consisting of several aerospace companies, including Boeing and Airbus) developed in a Technical Working Group on the basis of CANaerospace.

EnergyBus

EnergyBus is a communications and power transmission bus and associated connector system for light electric vehicles like Pedelecs and e-bikes. EnergyBus specified by a registered association, the EnergyBus eV based in Tanna, together with the CAN in Automation eV. Members are both individuals as well as a manufacturer of connectors, batteries, controllers and power units ( including Bosch, Panasonic, Sanyo, German Bahn AG, Philips and Varta ).

The communication protocol is defined in the CANopen application profile 454 "energy management systems".

FireCAN

FireCAN was established through cooperation of Austrian and German firefighters bodybuilder in 2006 and is now available as a standard DIN 14700. Originally FireCAN was as free agreement of the major manufacturers on the market, the editing of the common specification is thereby exercised by the company Rosenbauer. The presentation took place during the meeting of the Committee DIN NA 031-02-02 AA "Electrical Equipment " on October 29, 2009 in Berlin. This Datenbusfestlegung based on a simplified CANopen standard and regulates both the physical properties (plug, wires, pinning ), the type and number of participants, as well as the data formats used and data content. As an important predecessor of the successfully introduced in agriculture ISOBUS is to understand.

Unified Diagnostic Services

In passenger cars is very common now Unified Diagnostic Services in accordance with the ISO 14229th many manufacturers used in older models own standards, often based on the ultimately non-standard norm for KWP on CAN ( draft standard ISO / DIS 15765 ).

161619
de