Читать книгу Engineering Autonomous Vehicles and Robots - Shaoshan Liu - Страница 30

2.2 CAN

Оглавление

A CAN bus is a high-integrity serial bus system for networking intelligent devices. CAN buses and devices are common components in automotive and industrial systems. Using a CAN interface device, applications can be developed to communicate with a CAN network [1,2].

In the past few decades, the need for improvements in automotive technology caused increased usage of electronic control systems for functions such as engine timing, anti-lock brake systems, and distributor-less ignition. Originally, point-to-point wiring systems connected electronic devices in vehicles. As more and more electronics in vehicles resulted in bulky wire harnesses that were heavy and expensive, point-to-point wiring was no longer scalable.

To eliminate point-to-point wiring, automotive manufacturers replaced dedicated wiring with in-vehicle networks, which reduced wiring cost, complexity, and weight. In 1985, Bosch developed the CAN, which has emerged as the standard in-vehicle network.


Figure 2.1 Modular design architecture.

CAN provides a cheap, durable network that allows the devices to communicate through the ECUs. CAN allows the ECUs to have one CAN interface rather than analog inputs to every device in the system. This decreases overall cost and weight in automobiles. Each of the devices on the network has a CAN controller chip and is therefore intelligent. All transmitted messages are seen by all devices on the network. Each device can decide if the message is relevant or if it can be filtered.

As CAN implementations increased in the automotive industry, CAN (high speed) was standardized internationally as ISO 11898. Later, low-speed CAN was introduced for car body electronics. Finally, single-wire CAN was introduced for some body and comfort devices. Major semiconductor manufacturers, such as Intel, Motorola, and Philips, developed CAN chips. By the mid-1990s, CAN was the basis of many industrial device networking protocols, including DeviceNet and CANOpen.

As shown in Figure 2.2, CAN specifies the media access control (MAC) and physical layer signaling (PLS) as it applies to layers 1 and 2 of the OSI model. MAC is accomplished using a technique called nondestructive bit-wise arbitration. As stations apply their unique identifiers to the network, they observe if their data are being faithfully produced.

If it is not, the station assumes that a higher priority message is being sent and, therefore, halts transmission and reverts to receiving mode. The highest priority message gets through and the lower priority messages are resent at another time. The advantage of this approach is that collisions on the network do not destroy data and eventually all stations gain access to the network. The problem with this approach is that the arbitration is done on a bit-by-bit basis requiring all stations to hear one another within a bit time (actually less than a bit time).


Figure 2.2 CAN protocol layers.

At a 500 kbps bit rate, a bit time is 2000 ns which does not allow much time for transceiver and cable delays. The result is that CAN networks are usually quite short and frequently less than 100 m at higher speeds. To increase this distance either the data rate is decreased or additional equipment is required.

CAN transmissions operate using the producer/consumer model. When data are transmitted by a CAN device, no other devices are addressed. Instead, the content of the message is designated by an identifier field. This identifier field, which must be unique within the network, not only provides content but the priority of the message as well. All other CAN devices listen to the sender and accept only those messages of interest.

This filtering of the data is accomplished using an acceptance filter which is an integral component of the CAN controller chip. Messages which fail the acceptance criteria are rejected. Therefore, receiving devices consume only the messages of interest from the producer. As Figure 2.3 shows, a CAN frame consists mainly of an identifier field, a control field, and a data field. The control field is 6 bits long, the data field is 0–8 bytes long and the identifier field is 11 bits long for standard frames (CAN specification 2.0A) or 29 bits long for extended frames (CAN specification 2.0B). Source and destination node addresses have no meaning using the CAN data link layer protocol.

Bus arbitration is accomplished using a nondestructive bit-wise arbitration scheme. It is possible that more than one device may begin transmitting a message at the same time. Using a “wired AND” mechanism, a dominant state (logic 0) overwrites the recessive state (logic 1). As the various transmitters send their data out on the bus, they simultaneously listen for the faithful transmission of their data on a bit-by-bit basis until it is discovered that someone's dominant bit overwrote their recessive bit. This indicates that a device with a higher priority message, one with an identifier of lower binary value, is present and the loser of the arbitration immediately reverts to receiving mode and completes the reception of the message. With this approach no data are destroyed and, therefore, throughput is enhanced. The losers simply try again during their next opportunity. The problem with this scheme is that all devices must assert their data within the same bit time and before the sampling point otherwise data will be falsely received or even destroyed. Therefore, a timing constraint has been introduced that impacts cabling distance.


Figure 2.3 CAN message format.

Engineering Autonomous Vehicles and Robots

Подняться наверх