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)
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:
Figure 2 CAN bus circuit equivalent diagram
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:
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:
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
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
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Help download the source code of an encryption algorithm Hmac sha1
- Calculating the common-mode inductance of a switching power supply is actually not difficult!
- EEWORLD University - IC design process that even grandmas can understand
- Bear Pai Hongmeng Development Board Review - [Hardware Composition]
- Chip failure analysis
- MSP430 LaunchPAD Learning Notes
- Ask for answers
- Which sensor is suitable for an automatic disinfectant machine to provide a liquid shortage reminder?
- Power supply circuit guidance
- TI chip strange labeling