The LED display screen in this project is installed in the production workshop to display the actual output and target output. Six display screens with the same specifications are distributed in six workshops. The length of the cable between adjacent workshops is about 150~200 meters. The long distance and the interference of the motors running in the workshop make the LED display screen communication abnormal, resulting in frequent garbled characters.
After careful analysis and multiple tests, we started from many aspects: improving the hardware circuit, improving the communication protocol between the host and slave computers, and finally solved the problem successfully. The key points of the final solution to the problem are analyzed and explained in detail below.
1. Signal attenuation during transmission
It is not difficult to understand that no matter what medium the signal is transmitted through, it will be attenuated during the transmission process. We can regard the RS-485 transmission cable as an equivalent circuit composed of several resistors, inductors and capacitors, as shown in Figure 1.
The resistance of the wire has little effect on the signal and can be ignored. The distributed capacitance C of the cable is mainly generated by the two parallel wires of the twisted pair. The signal loss is mainly due to the LC low-pass filter composed of the distributed capacitance and distributed inductance of the cable. The higher the communication baud rate, the greater the signal attenuation. The attenuation coefficient of conventional cables is shown in Table 1.
Therefore, when the amount of data to be transmitted is not very large and the transmission rate requirement is not very high, we usually use a baud rate of 9,600 bps.
2. Signal reflection in communication lines
In addition to signal attenuation, another factor that affects signal transmission is signal reflection. Impedance mismatch and impedance discontinuity are the two main reasons for signal reflection in the RS-485 bus.
① Impedance mismatch. Impedance mismatch mainly refers to the impedance mismatch between the 485 chip and the communication line. The reflection is caused because when the communication line is idle, the signal of the entire communication line is chaotic. Once such a reflected signal triggers the comparator at the input end of the 485 chip, an erroneous signal will be generated. Our usual solution is to add a bias resistor of a certain resistance to the A and B lines of the RS-485 bus, pull them up and down respectively, so that there will be no unpredictable chaotic signals.
② Impedance discontinuity, as the name implies, is similar to the reflection caused when light enters another medium from one medium. The signal suddenly encounters a small or even no cable impedance at the end of the transmission line, and the signal will cause reflection at this place. The most common method to eliminate this reflection is to connect a terminal resistor of the same size as the characteristic impedance of the cable at the end of the cable to make the impedance of the cable continuous. Since the transmission of the signal on the cable is bidirectional, a terminal resistor of the same size should also be connected at the other end of the communication cable, as shown in Figure 2.
This method can reduce the impact of signal reflection to a certain extent. However, in practical applications, since the characteristic impedance of the transmission cable is related to the application environment such as the communication baud rate, the characteristic impedance cannot be completely equal to the terminal resistance, so we cannot completely avoid the occurrence of signal reflection.
3. Impact of distributed capacitance on RS-485 bus transmission performance
RS-485 transmission cables are usually twisted pairs, and capacitance is generated between the two parallel conductors of the twisted pair. At the same time, there is also a similar small capacitance between the cable and the ground. Since the signal transmitted on the RS-485 bus is composed of countless "1" and "0" bits, when encountering special bytes such as 0x01, the level "0" allows the distributed capacitor to get enough time to charge, and when the level "1" suddenly comes, the charge accumulated in the capacitor cannot be discharged in a short time, thus causing the signal bit to be deformed, thereby affecting the quality of the entire data transmission.
Therefore, on the one hand, we should try to use cables with smaller distributed capacitance, that is, better quality, as communication lines. On the other hand, we should try to reduce the baud rate of communication to give the capacitor enough time to discharge.
4. Develop a simple and reliable RS-485 communication protocol
When the communication distance is short and the application environment has little interference, we sometimes only need simple one-way communication to realize all the functions of the project, but most application environments are not so ideal. Whether the early stage of the project's integrated wiring is professional (for example, the signal line and the power line must maintain a certain distance), the uncertainty of the communication distance, the degree of interference around the communication line, whether the communication line uses a twisted pair shielded line, etc., these factors have a great impact on the normal communication of the system. Therefore, it is particularly important to formulate a complete communication protocol.
The specific method is to transmit data in packets, and pack the data by adding a frame header and a frame tail to each packet of data, with a byte left at the end of the frame as a check byte. The lower computer compares the check byte calculated by itself with the check byte transmitted by the upper computer, and then issues an instruction to the upper computer, whether to resend the previous packet of data or continue to send the next packet of data, and then send the next packet after sending one packet until all are sent. Through such a check and retransmission mechanism, we can eliminate the probability of error and make the communication system operate normally.
5. Conclusion
During the entire project rectification process, we successively adopted the following measures: Since the distance between the communication line and the power supply line is very close and the communication line has no shielding layer, we replaced all communication cables; the communication baud rate of both the upper and lower computers was set to adjustable, so that the appropriate value can be selected according to the specific situation during the debugging process; the communication protocol was optimized; and 120 Ω terminal resistors were added to both ends of the communication cable.
Previous article:Application fields of LED display
Next article:Research and design of high-power LED drive circuit
Recommended ReadingLatest update time:2024-11-16 15:49
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Using ESP's rtc memory in mpy
- Linux serial communication 1——96-N-8-1 format
- [STM32WB55 Review] Summary
- I need help with the simplest program to control 12864 with keys
- TUSB9261 -- USB3.0 to SATA interface bridge chip programming guide
- 【Video】Bluetooth Low Energy Mesh Training Video
- How to upgrade the program of msp430 microcontroller
- EEWORLD University Hall----Using buck-boost converter chips to extend the battery life of true wireless or hearing aid systems
- What does FPGA mean (how to use FPGA)
- F28335 clock + hardware parameters