CAN / CAN FD
Controller Area Network (CAN) and CAN with Flexible Data Rate (CAN FD)
CAN FD has become very pervasive in the industry. It appears that CAN FD controllers — which all support classical CAN as well — will become more popular than just standard CAN controllers. We will focus this section on CAN FD, keeping in mind that classical CAN is also included.
For more than 40 years, CAN has been the dominant network in the automotive industry; it is hard to understate the impact it has had on in-vehicle networking and the automobile world as a whole. There are very good reasons why it has been so successful, and will likely continue to be so even with the introduction of Automotive Ethernet.
CAN has been around so long and is so well-known that many in the industry have become accustomed to its unique advantages and may even assume that these characteristics are inherent to every networking technology. But this is not the case, even though it may only become apparent when directly comparing CAN / CAN FD to other network types. Some of the key benefits of CAN / CAN FD include the following:
- CAN/CAN FD is a robust and proven network. For decades, CAN/CAN FD has been the primary network of choice for nearly every automobile manufacturer worldwide.
- CAN/CAN FD are open standards, and as a result, there is a large variety of controllers available from many manufacturers. This provides the flexibility to select the exact silicon that is needed for a given application.
- Because of its widespread availability and the competitive climate that results from its open status and longevity, CAN/CAN FD is one of the lowest-cost networks to implement in a vehicle.
- CAN/CAN FD is the closest thing in the automotive networking world to being “plug and play”. Nodes can be added or removed, at least within certain limits, without the need to change other nodes, software, or other network parameters.
- Tools are easy to use with CAN/CAN FD. Just like adding and removing a node, tools like the ValueCAN, neoVI FIRE and others can be connected to the network and immediately begin participating as a receiver—of all frames—or as a transmitter.
CAN uses a bus topology, one key difference between it and some other network types such as most modern Ethernet variants. A bus topology, also known as multi-drop, means that each node participating on the network is physically connected to all other nodes, with the resulting bus representing a shared access medium.
In a typical multi-node bus, each node is electronically connected to all the other nodes over the same twisted pair. It is possible to consider CAN/CAN FD as a multi-drop or linear bus, where each ECU can branch a small distance from the main trunk of the bus. As we will explain, this topology gives CAN/CAN FD some of its best qualities and some of its biggest drawbacks.
The good quality of this topology is that the wiring and interconnections between nodes are simple. Also, the order of the nodes on the network is not important, and as long as the maximum bus length is not exceeded, the network designer can wire the nodes together in any convenient way.
In a bus topology, however, it is not possible for multiple nodes to transmit at the same time without the potential for collisions, so some method is needed for nodes to avoid frame collisions, arbitrate in case of a collision, or provide some collision detection and retry mechanism. CAN supports a very clever non-destructive arbitration mechanism that we will explain shortly.
A further effect of a true bus network is that it is a shared medium; when any node transmits a frame, it is seen across the entire bus. Therefore, all nodes on a classical CAN bus combined have a total of only 1 Mb/s of theoretical throughput across the entire network. For CAN FD, the exact throughput is more complicated due to the data section of the frame optionally being able to have different baud rates—up to 8Mb/s—than the arbitration section. This is beyond the scope of this book.
For standard 1 Mb/s CAN, the ISO 11898 standard specifies a maximum bus length of 40 m, with a maximum of 30 nodes allowed, each with a stub length maximum of 0.3 m. More nodes can be supported if the network runs at a lower speed, and the bus can be made longer as well. For real-world production cars, the typical maximum data rate is 500 Kb/s for a high-speed bus, and 125 Kb/s or lower for a low-speed implementation that supports much more than 30 nodes. Low-speed CAN networks supporting 50 or more nodes are common.
Nodes on the network can be connected in any order, but a 120-Ohm terminator is necessary at each end. These terminators are generally built into the nodes that are designed to be at or near opposite ends of the network.