Design of Multi-ECU Communication Platform Based on CAN Bus

Abstract: This paper introduces CAN bus and its communication protocol J1939, and designs the hardware structure of multi-ECN communication platform based on CAN bus. It expounds the software design method of node ECN communication and realizes the function of data communication under the condition of simulation test. Tests show that the platform is stable and reliable.

introduction

With the wide application of integrated circuits and single-chip microcomputers in automobiles, the number of electronic controllers on modern automobiles is increasing. Common electronic fuel injection devices, anti-lock braking devices (ABS), and airbag devices are common. , electric door and window device, active suspension, etc. Although the increase of the electronic control system improves the power, economy and comfort of the car, the complicated circuit that is added also reduces the reliability of the car and increases the difficulty of maintenance. From the perspective of wiring, traditional electronic gas systems mostly use point-to-point single communication methods, which have little connection with each other, which inevitably leads to a pet wiring system. Therefore, a new concept - the electronic controller area network CAN on the car, came into being. In order for parts produced by different manufacturers to work in coordination on the same vehicle, standards must be established. According to the relevant ISO standards, the topology of CAN is bus type, so it is called CAN bus. The CAN bus is designed to communicate as a microcontroller in an automotive environment, exchange information between the in-vehicle electronic control devices ECN, and exchange information between the in-vehicle electronic control devices ECN to form an automotive electronic control network.

Controller Area Network CAN (Controller Area Network) is a multi-master serial communication bus. The basic design specification requires high bit rate, high immunity to electromagnetic interference, and can detect any errors generated. The application of CAN in automobiles has many industry standards or international standards, such as ISO11992, ISO11783 of the International Organization for Standardization (ISO) and SAE J1939 of the Society of AutomoTIve Engigeers. The CAN bus has been included in the vehicle design of the car as a standard device for automobiles.

figure 1

1 CAN bus characteristics and communication protocol

1.1 Introduction to CAN Bus

The CAN communication protocol specifies four different frame formats, namely data frames, remote frames, error frames, and overload frames. Communication coordination based on the following basic rules: bus access, arbitration, encoding/decoding, error labeling, and over-routing. The CAN follows the OSI model. According to the OSI benchmark model, there are only three layers: the physical layer, the data link layer, and the warning layer, but the application layer still needs to be defined by the user. As a serial communication network that effectively supports distributed control or real-time control, CAN bus can be applied from high-speed networks to low-cost multi-line networks. For example, CAN can achieve bit rates of up to 1 Mbps in applications such as engine control components, ABS, and anti-slip systems in automobiles. At the same time, it can be used inexpensively in traffic vehicle electrical systems, such as electrical windows, beaming, seat adjustment, etc., to replace the required hardware connections. The transmission is sanctioned as a twisted pair, the communication rate is up to 1Mbps/40m, the direct transmission distance is up to 10km/5kbps, and the number of attached devices can be up to 110. CAN is a multi-master working mode with flexible communication mode, no node information such as station address, and non-destructive bus arbitration technology to meet real-time requirements. In addition, CAN uses short frame structure to transmit signals, with short transmission time and strong anti-interference ability.

There are two main differences between the CAN bus and other communication protocols. One is that the message transmission does not contain the target address. It is based on the whole network broadcast, and each receiving station filters the message according to the identifier reflecting the nature of the data in the message. It is characterized by online access to the Internet, plug-and-play and multi-station reception; another aspect is to specifically enhance data security and meet the needs of control systems and other higher data requirements systems.

1.2 J1939 Communication Protocol

The J1939 protocol implements the application layer on the CAN bus communication protocol 2.0B (29 identifier). It is the communication protocol developed by SAE for heavy-duty trucks and buses. Based on CAN 2.0B, the physical layer standard is compatible with ISO11898. And use the CAN controller and transceiver in line with this specification. The J1939 protocol divides the CAN identifier into the following parts: priority (P), data page (PGN), protocol data unit (PDU) format, PDU specific domain (PS), and source address (SA). The J1939/71 application layer document defines the PGN for various parameters and commands of the vehicle control.

It can be seen that the difference between J1939 and CAN communication protocol is 29-bit identifier (ID), and the data field is the same. J1939 has a detailed physical definition of the 29-bit identifier (or identification) of CAN. The CAN standard format is encapsulated into the J1939 protocol format by the PDU. The PDU information frame is composed of the priority P, the reserved bit R, the data page DP, the protocol data unit PF, the extension unit PS, the source address SA, and the data field DATA, that is, the 29-bit identifier of the CAN plus the data.

2 overall design

2.1 Automotive electronic control network structure

The main difference between the data transmission characteristics between the ECUs in the car is the data transmission frequency. For example, when the engine is running at high speed, high-frequency data transmission is performed, and it is transmitted once every few ms. At low-speed operation, low-frequency data is performed. Transmission is transmitted once every few tens of ms or even hundreds of ms. However, in order to meet the real-time requirements, each control unit in the vehicle is required to realize the public data sharing of the vehicle as much as possible, but the real-time requirement of each control unit is different because the data update rate and the control period are different. This requires its data exchange network to be based on a priority competition model. And it has a high communication rate itself. The CAN bus is designed to meet these requirements. CAN has international standards, namely ISO11898 for high speed applications and ISO11519-3 for low speed applications.

The usual car network structure uses multiple buses of different speeds to connect different types of nodes, and uses a gateway server to realize information sharing and network management of the entire vehicle. According to the American Society of Automotive Engineers (SAE) Vehicle Network Committee standard SAE J2057, the car data transmission network is divided into three categories. This can be briefly illustrated by Figure 1. The gateway is the core of the internal communication of the car. It can realize the sharing of information on the CAN bus and realize the network management and fault diagnosis functions inside the car. The information on each data bus is fed back to the display on the instrument panel assembly. The driver can know whether the electronic control devices are working normally through the information on the dashboard.

2.2 Communication platform hardware design

In the design, the main control chip CPU selects 51 series of single-chip microcomputers. The CAN communication controller implements the complete CAN protocol and completes the communication functions, including information buffering and receiving filtering. Therefore, the CAN controller uses Philips' SJA1000. PCA82C250 is used as the transceiver of CAN bus. PCA82C250 is the interface between CAN protocol controller and physical bus. It has anti-transient, anti-radio and anti-electromagnetic interference performance in the operating environment. The internal current limiting circuit has short circuit when it is shorted. The function of transmitting the output stage for protection. The transmission medium adopts the shielding electricity fee, and an optocoupler circuit is added between the measurement and control node and the medium to improve the anti-interference ability of the bus interface. Figure 2 is a hardware block diagram of the communication platform, and Figure 3 is a connection interface between the controller and the transceiver.

In order to further improve the reliability of the system, it is necessary to consider the redundant design of the system. Due to the harsh environment of the automobile and many interference factors, two capacitors are connected in parallel between the CAN_H and CAN_L signal lines and the ground line to filter out noise and make the signal transmission stable. Two sets of double-shielded electricity charges can be set for simultaneous information transmission on two sets of media. The receiver uses only one medium to perform bus switching at the connection critical point of the redundant and non-redundant segments.

2.3 Software Design

Simply put, the function to be realized by this communication platform is to enable each node (ECU) to communicate with each other through the CAN bus, send and receive commands, information, etc., and realize data sharing, thereby improving respective control performance and operational efficiency. Each node (ECU) of the CAN data bus on the car has its own address and name. The ECU address indicates the destination of the data transfer, and its name identifies the basic function of the ECN. The nodes continuously monitor various data sent on the bus. When the received data address value matches its own address, the node obtains the token. In the communication protocol, the only node that obtains the token has the right to send data to prevent two or more nodes from transmitting data at the same time causing confusion. At the same time, each node has the opportunity to get the token and complete the data transmission.

The software design is based on the Keil C language. The program is mainly composed of a main module, an interrupt processing module, and a data communication module, as shown in FIG.

Figure 4

The main module completes hardware initialization, register configuration, SJA1000 initialization, etc.; the interrupt processing module includes data interrupt transmission, reception, error processing, and alarm processing; the data communication module completes data request, transmission, reception, and the like.

When one node A sends a data request message (remote frame) and requests a message (response frame) to another node B, after receiving the request, the node B passes the discrimination and then transmits the data (response frame). Since the data request has no data field, the relative data frame length is much smaller. After the analysis and verification, the data received by the Node B is the same, and the request data program is verified.

Conclusion

In the design of modern cars, CAN bus has become a trend to build automotive networks; while the automotive network is directly connected to the various ECUs inside the car and is responsible for the transmission of commands, the transmission and sharing of data, and its reliability and stability. The performance of the car is closely related. The design and development of this paper is a simulation platform built under experimental conditions. The communication between nodes is carried out through peer-to-peer CAN communication nodes. The test shows that its running performance is stable and reliable, but further research and improvement are still needed for practical use, and the communication processing capability, error correction and fault tolerance of the program need to be further improved.

Coaxial Cable

Digital Coaxial Cable ,Coaxial Cable Types ,Dual Dvi Cable ,Coaxial Digital Audio Cable

Electric Wire & Cable Co., Ltd. , http://www.nbcables.com