Design method and implementation of CAN bus remote transmission reliability

Publisher:SparklingSunLatest update time:2010-06-29 Source: 电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

Fieldbus can meet the needs of process control and manufacturing automation at the same time, and has become one of the most active technologies in the field of industrial data bus. CAN (Controller Area Network) fieldbus is widely used in various low-cost, high-anti-interference multi-machine remote monitoring systems due to its multi-master mode, automatic message filtering and retransmission, extremely low bit error rate and high communication rate.

CAN bus is a bus-type serial communication network with synchronization bits. Due to the use of many new technologies and unique designs, compared with general communication buses, CAN bus has outstanding reliability, real-time and flexibility in long-distance data communication. The direct communication distance of CAN can reach up to 10km (communication rate below 5Kbps), and the communication rate can reach up to 1Mbps (communication distance up to 40m). However, in the actual long-distance transmission process, the communication data is affected by many factors, resulting in distortion of the transmitted waveform and failure to achieve the expected effect. This paper designs and analyzes the reliability of CAN bus long-distance transmission.

1 Main factors affecting the reliability of remote CAN bus transmission

(1) The impact of electromagnetic interference in the working environment.
(2) The impact of distributed capacitance and resistance of the transmission medium.
(3) The impact of impedance mismatch between the far and near ends.
(4) The impact of phase change and amplitude change at the receiving synchronization end.
(5) The impact of the transmission baud rate bit clock design.
(6) The impact of leakage in the high impedance state between nodes that do not send or receive frames on the CAN bus.
(7) The impact on the bus short circuit and open circuit monitoring processing.

2 Design method of remote CAN bus transmission reliability

The system operates in a complex electromagnetic space, with various external electromagnetic field changes and electromagnetic interference between various components within the system. In particular, the electromagnetic field environment at the work site is the most likely to interfere with the reliability of the system. Therefore, the system data transmission process uses shielded twisted pair cables, which combine the advantages of both shielded cables and twisted pair cables and are ideal signal transmission cables. They can suppress both electrostatic interference and electromagnetic induction interference, thereby improving the reliability of the system.

Components are the foundation of the system. It is particularly important to select electronic components with high integration, strong anti-interference ability and low power consumption. Selecting a suitable MCU is the key to the successful design of the CAN bus control system. After comprehensively comparing several popular MCUs in the industry, the 8-bit C8051F040 microcontroller from Silicon Laboratories was finally selected as the control core of the CAN bus control system.

The C8051F040 (hereinafter referred to as F040) microcontroller is a fully integrated mixed signal system-level chip with an instruction core that is fully compatible with MCS-51. Due to the use of pipeline processing technology, the efficiency of instruction execution is greatly improved. F040 also uses Flash ROM technology and integrates JTAG to achieve true online programming and on-chip debugging. It has better reliability and high integration than external CAN bus controllers such as SJAl000. The CAN controller of F040 is fully hardware-based, which solves the competition contradiction between CPU and CAN bus controller.

In the host CAN node, as shown in Figure 1, the USB to UART bridge chip CP2101 from Silicon Laboratories is selected, which has a built-in 512B transceiver buffer, further solving the problem of data conflict from the chip itself. It also has a baud rate range of 300bps to 921.6Kbps, which meets the requirements of high-speed communication, and the peripheral circuit is very simple; in addition, CP2101 also integrates a 5V to 3V voltage regulator, which can be powered by the USB bus to the entire host node, so that the entire circuit only needs a USB connection to communicate with the PC, without the need for additional power supply, plug and play, very convenient.

Figure 1 Hardware connection diagram of the host CAN node (see next page)

ADuM1201 is an isolator produced by ADI. It adopts patented planar magnetic field isolation technology and eliminates the photoelectric conversion process in the optocoupler. Therefore, ADuM1201 has advantages over optoelectronic isolators: higher speed (maximum rate reaches 25 Mbps), lower power consumption (minimum operating current is 0.8mA), higher performance, smaller size, cheaper price, and more flexible application (multi-channel digital isolators can provide sending and receiving channels in the same chip). ADuM1201 is selected to realize electrical isolation between CAN controller and CAN driver, enhance system stability, and improve system anti-interference ability.

In order to further improve the remote communication reliability of the system, the chip SN65HVD251 produced by TI is selected as the CAN bus transceiver. SN65HVD251 can provide differential transmission function to the bus at a speed of up to 1Mbps, as well as differential reception function to the CAN controller. It has differential transceiver capability, high anti-electromagnetic interference, ultra-small package, and low power consumption. When used with F040, the peripheral circuit can be more concise, as shown in Figure 2.


The CAN transceiver SN65HVD251 connects a resistor in parallel between the CANH and CANL output pins as the terminal resistor of the CAN bus. When this node is used as the terminal node of the CAN bus, close the jumper JP1 to make the terminal resistor work. The terminal resistor value R6 is equal to the characteristic impedance of the transmission cable. The general value of 120Ω is discussed in detail in the literature, which solves the influence of the mismatch of the near and far end impedance. The Rs pin of SN65HVD25l is the slope resistor input pin, which can change the working mode of the transceiver. Resistors R2 and R3 are connected in series on CANH and CANL to limit the current, and then a group of pull-up and pull-down resistors R4 and R5 are used to effectively suppress the interference of reflected waves. When the bus is kept in a high-impedance state, the receiving end always receives the "1" level, which increases the amplitude of the signal and reduces the bit error rate. In addition, a pair of transient diodes Dl and D2 in opposite directions are connected in parallel between CANH and NCANL to prevent lightning strikes and transient interference on other buses.

3 Overall system design

Based on the above devices, a reliable CAN bus remote control system network platform is built. This system consists of a host CAN node connected to the host PC through a USB interface. The main node is connected to the following functional nodes using a bus, as shown in Figure 3. The host CAN node is mainly used to send remote control broadcast commands, collect data from all nodes, and upload it to the host computer software for identification, classification and statistics. It realizes bus listening, network monitoring and host computer interface functions. The bottom node controls the bottom device in the system, sends 8-byte data CAN bus messages containing node information, listens to the network broadcast instructions of the host node, and adjusts the node function.

Figure 3 CAN bus control system multi-machine test platform

4 Experimental analysis

4.1 Analysis of communication results at different kilometres

Connect the system bus to a simulated 1km to 5km remote network. In order to better analyze the reliability of the CAN bus and enable the oscilloscope to better observe the message waveform, connect the two ends of the oscilloscope CH1 to the 0km distance from the master node, and connect the two ends of CH2 to the 5km distance from the master node, as shown in Figure 4. In this way, the communication message waveforms of the near end (CH1) and the far end (CH2) of the 5km communication relative to the host CAN node can be observed.

The waveform tested by CH1 is at the top, and the waveform tested by CH2 is at the bottom. The waveform marked as 1 at the CH1 end is the message sent by the master node, 2 is the message received by the bottom node at the CH2 end, 4 is the data message sent by the bottom node, and 3 is the data received by the host CAN node. 1 and 2, 3 and 4 are called a group of messages. The last bit of each frame of data is the response bit. There is a time gap between every two frames of messages, one of which is the time for the host CAN node and the upper PC to process data, and the other is the time for the bottom measurement node to process data.

After observation, the amplitude of message 1 sent by the near end is attenuated after traveling 5 kilometers to message 2 received by the far end; similarly, message 3 received by the near end is also attenuated based on the amplitude of message 4 received by the far end. By testing the waveforms of communication from 1 km to 4 km respectively, it can be found that the longer the communication distance, the greater the amplitude attenuation.

When other conditions remain unchanged, experiments were conducted for 1 km to 5 km respectively. It was found that the change of long-distance communication distance would have an impact on the message transmission rate, but it was very small. The obtained data is tabulated as shown in Table 1

As shown in Table 1, the transmission rate is the highest at 1 km, with 13.2972 frames transmitted per second, that is, one frame of data is transmitted in 0.0752 seconds. The so-called one frame is actually sent once and received once, which is actually 2 frames for the CAN bus. As the transmission distance increases, the transmission rate tends to decrease slightly, indicating that there is a certain network delay in long-distance transmission, but it has little effect at low baud rates.

4.2 Communication results at different test points with the same mileage

Next, taking the communication distance of 5 kilometers as an example, we observe that the two ends of CH1 are connected to the test point at 0 kilometers, and the two ends of CH2 are connected to the test points at 1 kilometers, 2 kilometers, 3 kilometers, 4 kilometers, and 5 kilometers. It can be seen that the amplitude of the message waveform has changed accordingly. After 1 kilometer of attenuation, the amplitude of the same group of messages is reduced by about 0.2V; the communication at a distance of 2 kilometers will cause the amplitude of the same group of messages to change by about 0.4V; similarly, the amplitude of the same group of messages transmitted at 3 kilometers, 4 kilometers, and 5 kilometers will be attenuated by 0.6V, 0.8V, and 1V respectively. Therefore, it can be concluded that the amplitude of the message signal will attenuate by 0.2V every time the same group of messages communicates at a distance of 1 kilometer.

4.3 Influence of the operating voltage of CAN transceiver SN65FIVD251

During the experiment, it was observed that the size of the SN65HVD251 working voltage VCC has a great influence on the transmission distance. After a large number of experiments, the critical voltage value of VCC for successful communication at a distance of 1-5 kilometers (accurate to 0.1V) was obtained. The so-called critical voltage value is the minimum value for normal data transmission within a certain distance. As shown in Table 2.

From the table, it can be concluded that the premise of ensuring successful communication over a distance of 1 km is that the voltage at the VCC terminal is greater than or equal to 3.6V. The higher the voltage at the VCC terminal, the longer the communication distance can be. In the 1-5 km experiment, the voltage at the VCC terminal increases by about 0.3V for every additional kilometer. The maximum VCC cannot be higher than the maximum operating voltage of SN65HVD251, which is 7V.

The long-distance communication distance has a relatively large impact on the amplitude of the message signal, which is attenuated by about 0.2V per kilometer. At the same time, the input voltage of the CAN transceiver SN65HVD251 has a certain impact on the long-distance communication distance. Ensuring high voltage input within the normal voltage range can increase the long-distance communication distance of the system. Every 0.3V increase in power supply voltage can extend 1 kilometer, and an increase of 1 kilometer will cause a loss of 0.2V, and the remaining 0.1V is consumed by the driver chip.

5 Performance summary of CAN bus remote control network

After the working voltage of the driver chip and the transmission baud rate are determined, the transmission distance of the CAN bus is mainly determined by the following two factors: (1) the level difference between the implicit voltage of the response bit of the transmitter and the level difference when the receiver converts the implicit voltage into the explicit level and then transmits it to the transmitter; (2) the phase change of the bit when the response bit sent by the transmitter is confirmed by the receiver and then sent back to the transmitter. The level difference of the former is 0.6V, and the latter cannot lag behind half of the time of each bit. The 0.6V level difference is much larger than the 100mv difference between RS485 and RS422 to identify "1" and "0". This means that under the same transmission conditions, RS485 has a longer transmission distance than the CAN bus. Similarly, RS485 and RS422 are susceptible to interference due to their small thresholds. In addition, other performances of the CAN bus are superior to RS485 and RS422, such as CRC hardening, multi-master communication mechanism, and multiple layers of hardened upper layer protocols. The bit error rate of RS485 is 10-7, and the bit error rate of the CAN bus can reach 2×10-11. Therefore, the following methods can be used to improve the reliability of remote transmission:

(1) Increase the operating voltage of the driver chip.
(2) Reduce the baud rate of transmission to reduce the impact of phase lag.
(3) Use thicker twisted pair cables to reduce the resistance of the communication wires, thereby reducing transmission losses.
(4) Use two driver chips in parallel to reduce the internal resistance of the driver chip and increase the driving current, that is, reduce the internal loss of 0.1V.
(5) Use twisted pair cables with smaller distributed capacitance to reduce the impact of distributed capacitance on the synchronization phase.

In general, the CAN bus control system designed in this paper has achieved good results in terms of reliability and other performance indicators, and it is responsible for data acquisition and communication in the slope monitoring system of Laxiwa Hydropower Station.

Reference address:Design method and implementation of CAN bus remote transmission reliability

Previous article:Research on Network Temperature and Humidity Monitoring System
Next article:Design and implementation of cognitive radio solution based on carrier detection

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号