Two solutions to the CAN bus transmission distance problem

Publisher:科技火箭Latest update time:2015-01-19 Source: e-works Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction to CAN bus

  1.1 Overview of CAN Bus Development

  The CAN network was originally developed by the German company Bosch for the European automotive market, hoping that this technology would replace the expensive automotive wiring. The CAN network has the characteristics of high reliability and is used in real-time processing situations, such as automotive anti-lock systems, airbags, etc. Today, this communication protocol has been widely used, and its characteristics are not only in the automotive industry, but also in other fields of industrial control. The CAN bus has been developed in China for 20 to 30 years, and many CAN-related products have been developed and widely used, such as: substations, airports, sewage treatment plants, etc.

  1.2 Problems with CAN bus

  Although the CAN bus has many advantages, the following two points restrict its development, namely: the bottleneck problem of the CAN bus.

  (1) The maximum transmission distance can only reach 10 km, and it is not a truly reliable transmission;

  (2) The maximum number of nodes is 110.

  The following is a detailed discussion of the CAN bus bottleneck problem (1).

2. Solutions to the CAN bus transmission distance problem

  2.1 CAN bus structure

  The general connection structure of the CAN bus system is shown in the figure (taking the chip 82C250 as an example), R=120Ω. (Note: The figure only shows one smart device, and in reality there can be up to 110 smart devices)

Click to enlarge image

Figure 1 CAN bus system structure diagram

  CAN bus is generally used in harsh environments where the control room is far from the site. When the bus distance reaches more than 8 km, its unidirectional line resistance will reach 100Ω, and the terminal resistance at both ends is 120Ω (ignoring the resistance of the smart device itself, which is considered to be infinite). Its equivalent circuit is shown in Figure 2:

Click to enlarge image

Figure 2 CAN bus circuit equivalent diagram

    Click to enlarge image

  For a CAN receiver, the voltage that can be recognized must be greater than 0.8V, generally above 0.9V. [page]

  2.2 Attempts to solve the transmission distance problem

  From the above circuit diagram and data analysis, we can see that when the distance is far, the bus line voltage is already in a critical recognition state, and its data is difficult to receive normally (no reliability at all). For this reason, we tried to use the following solutions to conduct experiments.

  2.2.1 Add two transmitting chips directly in the line

  This solution is to directly add two transmitter chips (using 82C250 as an example) [3] to the bus line, and connect the TXD and RXD pins of the transmitter chip. The connection circuit is as follows:

Click to enlarge image

Figure 3 Transmitter chip connection circuit diagram

  The whole circuit seems normal, transferring the data on the left to the right and the data on the right to the left. In fact, this circuit cannot be used. After this circuit is connected to the bus, as long as there is a dominant level on the bus, the whole circuit will always show a dominant level. The reason is that there is a delay in each period (although it is only a few ns delay). Assuming that a dominant level is received from the left side of the circuit, it is transmitted to the right CAN bus after a delay of Tns by the two 82C250 chips on the left and right. In addition, the 82C250 chip itself has the function of sending and receiving at the same time. Then the 82C250 chip on the right simultaneously transmits the dominant level of the right CAN bus to the left, thus forming a loop, making the bus always in a dominant state.

  2.2.2 Adding logic control circuit for isolation

  As can be seen from the above, when sending data, data retransmission should be prevented from forming a loop. For this reason, we have made the following regulations: when there is a dominant level, only one direction can be transmitted (which direction is opened by the dominant level coming first, and if they come at the same time, either direction can be opened); after the dominant level of the sending end ends, all directions stop for T1 time (Tns 

  The above logic can be easily realized by using CPLD. Using this solution, the circuit is first connected to the bus at 10 km, and a receiving device is connected not far away from 10 km. The experiment can receive normally, and the bus voltage difference at the receiving end is 1.32V, which is 1.55 times the receiving voltage difference of a single-connected device.

  2.2.3 Adding CAN card in the middle of the line to realize long-distance data transmission (repeater)

  When the distance reaches 10km, the reason why the received data is abnormal is because the bus voltage difference is small. Therefore, it is not realistic to use boost and buck circuits, because each receiver must add a conditioning circuit, and the cost is obviously increased. In addition, even if the voltage is boosted, since the CAN bus sends according to arbitration, it will always encounter the problem of forming a closed loop due to the delay bus mentioned in solution 2.

  In order to achieve long-distance transmission, a repeater can be added in the middle, which is equivalent to shortening the bus distance by half. The structure of the repeater is as follows:

Click to enlarge image

Figure 4 Schematic diagram of repeater structure

  The purpose of using two 8031 ​​microcontrollers is to process the data on the CAN bus in a timely manner, making the design simpler and eliminating the need to consider data transmission conflicts on both sides of the CAN bus. As long as each microcontroller has a 1K cache, it will be fine.

  Specific implementation ideas: The microcontroller receives CAN bus data, caches the data, transmits the data to another microcontroller in the idle phase (the two communicate through the SPI protocol), and sends out the data transmitted from the other microcontroller at the same time.

  In actual projects, we use this solution to achieve long-distance transmission. The main reason is that it can meet the reliability of data transmission. We have tested the circuit of this solution with a number of nodes reaching 100. Its performance is normal and reliable and can meet actual needs.

3. Summary

  The innovation of this article is to propose feasible solutions to solve the long-distance transmission problem of CAN bus. The first one (adding logic circuit) is relatively simple and does not need to consider data storage. It is just a hardware implementation. The second one (repeater) needs to consider data storage, judging when to send, etc. It is relatively complex, but the reliability is better. The two solutions have similar load bearing capabilities.

  As a new type of bus technology, CAN bus technology has become one of the most promising buses because of its good fault isolation capability, real-time response capability of the network and good transmission error-proofing design.

references

  [1] Yang Xianhui. Fieldbus Technology and Its Applications. Beijing: Tsinghua University Press, 1999.

  [2] Wu Kuanming. CAN bus principle and application system design. Beijing: Beijing University of Aeronautics and Astronautics Press, 1996.

  [3] Guo Zhan, Song Cunyi, Li Hai, Safety Monitoring System of Coal Silo in Thermal Power Plant Based on CAN Bus, Microcomputer Information, 2005.9 (2) P5~7

Reference address:Two solutions to the CAN bus transmission distance problem

Previous article:CAN bus technology and its application based on 51 single chip microcomputer
Next article:Design of multi-node communication network based on CAN bus technology of C8051F040

Latest Microcontroller 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号