Monday, June 17, 2024

CAN Bus Designing and CAN Bus Circuitry

 

Introduction

The Controller Area Network (CAN) is a robust vehicle bus standard designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer. It was initially developed by Robert Bosch GmbH for the automotive industry in the 1980s and has since become a widely adopted standard in various industrial applications due to its simplicity, reliability, and cost-effectiveness.

The CAN bus is a multi-master serial bus that uses a twisted-pair cable for data transmission. It operates on a message-based protocol, where all nodes on the network receive the same messages, and each node decides whether to process or discard the message based on its identifier. This design allows for efficient and reliable communication, making it ideal for real-time control systems and distributed systems.

In this article, we will delve into the intricacies of CAN bus designing and CAN bus circuitry, covering topics such as CAN bus topology, signal transmission, bus termination, and fault protection mechanisms. We will also explore the various components required for implementing a CAN bus system and provide insights into the design considerations and best practices.

CAN Bus Topology

The CAN bus employs a linear bus topology, where all nodes are connected to a single twisted-pair cable. The twisted-pair cable consists of two wires, CAN High (CAN_H) and CAN Low (CAN_L), which transmit the differential signals.

Bus Length and Baud Rate

The maximum bus length and the achievable baud rate (data transfer rate) are inversely proportional to each other. As the bus length increases, the maximum baud rate decreases due to the increased propagation delay and signal distortion caused by the cable capacitance and resistance. The table below illustrates the typical relationship between bus length and baud rate:

Bus Length (m)Baud Rate (kbps)
401000
115500
200250
500125
100050

It is important to note that these values are approximate and may vary depending on the cable characteristics, termination, and other factors.

Bus Termination

To ensure proper signal transmission and minimize reflections, the CAN bus must be correctly terminated at both ends of the cable. Termination resistors, typically 120 ohms, are connected between CAN_H and CAN_L at each end of the bus.

Proper termination is crucial for the following reasons:

  1. It matches the cable impedance, minimizing signal reflections.
  2. It provides a known voltage level for the bus when no node is transmitting.
  3. It helps prevent signal distortion and ensures reliable communication.

CAN Bus Signal Transmission



The CAN bus uses a differential signaling scheme, where the CAN_H and CAN_L lines transmit complementary signals. This approach provides improved noise immunity and tolerance to common-mode interference.

Bit Representation

In the CAN bus, bits are represented by the voltage difference between CAN_H and CAN_L:

  • Dominant Bit (logic 0): CAN_H is at a higher voltage level than CAN_L.
  • Recessive Bit (logic 1): CAN_H is at a lower voltage level than CAN_L.

The voltages used for dominant and recessive bits are defined by the CAN bus specification and vary based on the protocol version (e.g., CAN 2.0A, CAN 2.0B, CAN FD).

Arbitration and Message Priority

One of the key features of the CAN bus is its non-destructive arbitration mechanism. When two or more nodes attempt to transmit simultaneously, the node with the higher-priority message (lower-value identifier) will win the arbitration and continue transmitting, while the other nodes will automatically stop transmitting and wait for the bus to become free.

This arbitration process is performed on a bit-by-bit basis, ensuring that the highest-priority message is always transmitted first, preventing message collisions and data corruption.

CAN Bus Circuitry

To implement a CAN bus system, various components and circuits are required. Let's explore the essential components and their functions.

CAN Transceiver

The CAN transceiver is a critical component that interfaces between the microcontroller or CAN controller and the CAN bus cable. It performs the following functions:

  1. Signal Level Conversion: The transceiver converts the logic levels from the microcontroller to the appropriate voltage levels for the CAN bus (e.g., 3.3V to CAN bus levels).
  2. Bus Termination: The transceiver may include integrated termination resistors or provide terminals for external termination resistors.
  3. Fault Protection: Transceivers often incorporate protection mechanisms against short circuits, overvoltage, and other faults.

Some popular CAN transceiver ICs include the Microchip MCP2551, Texas Instruments SN65HVD23x series, and NXP TJA1050.

Power Supply

The CAN bus system requires a stable power supply to operate correctly. The power supply must provide the appropriate voltage levels for the microcontroller, CAN transceiver, and any other peripheral components.

In automotive applications, the power supply is typically derived from the vehicle's battery, with appropriate voltage regulation and filtering circuits.

Microcontroller or CAN Controller

The microcontroller or CAN controller is responsible for generating and processing CAN messages. It interfaces with the CAN transceiver to transmit and receive data on the CAN bus.

Many modern microcontrollers, such as those from Microchip, NXP, and STMicroelectronics, have integrated CAN controllers, simplifying the design and reducing component count.

Bus Protection Circuits



To protect the CAN bus from faults and ensure reliable operation, various protection circuits may be implemented:

  1. Transient Voltage Suppression (TVS) Diodes: These diodes protect against voltage spikes and electrostatic discharge (ESD) events.
  2. Current-Limiting Resistors: These resistors limit the current flow in case of short circuits or overloads, preventing damage to the transceiver and other components.
  3. Common-Mode Chokes: These inductive components help filter out common-mode noise and interference.

CAN Bus Cable

The CAN bus cable is a twisted-pair cable that carries the CAN_H and CAN_L signals. It is designed to minimize electromagnetic interference (EMI) and signal distortion.

The cable should be shielded and have a characteristic impedance of 120 ohms to match the termination resistors.

Design Considerations and Best Practices

When designing a CAN bus system, several factors should be considered to ensure reliable and robust operation:

  1. Proper Bus Termination: Ensure that the bus is correctly terminated at both ends with the appropriate termination resistors.
  2. Cable Selection: Choose a high-quality, shielded twisted-pair cable with the correct impedance and wire gauge for the desired bus length and baud rate.
  3. Power Supply Decoupling: Implement proper decoupling capacitors and filtering circuits to ensure a clean and stable power supply for the CAN bus components.
  4. Grounding and Shielding: Implement proper grounding and shielding techniques to minimize electromagnetic interference (EMI) and ground loops.
  5. Node Placement: Place the nodes along the bus in a way that minimizes cable lengths and ensures even distribution of node loads.
  6. Fault Protection: Incorporate appropriate protection circuits, such as TVS diodes and current-limiting resistors, to safeguard against faults and transient events.
  7. Compliance: Ensure that the CAN bus design complies with the relevant industry standards and regulations, such as ISO 11898 and automotive specifications.

Frequently Asked Questions (FAQ)

  1. What is the maximum number of nodes allowed on a CAN bus? The maximum number of nodes on a CAN bus is not strictly defined, as it depends on various factors such as bus length, baud rate, and node loading. However, a typical recommendation is to limit the number of nodes to around 30-50 for optimal performance and reliability.
  2. Can different baud rates be used on the same CAN bus? No, all nodes on a CAN bus must operate at the same baud rate. If different baud rates are required, separate CAN bus segments or gateways must be used.
  3. What is the maximum data rate of the CAN bus? The maximum data rate of the CAN bus depends on the specific protocol version. For CAN 2.0A and CAN 2.0B, the maximum data rate is 1 Mbps. For CAN FD, the maximum data rate can reach up to 8 Mbps (in

No comments:

Post a Comment

Popular Post

Why customers prefer RayMing's PCB assembly service?

If you are looking for dedicated  PCB assembly  and prototyping services, consider the expertise and professionalism of high-end technician...