As we all know, data transmission is a very important part of industrial control. The stability of data transmission directly affects the reliability of products. Therefore, how to improve the reliability and stability of data transmission has become an issue that engineers have to face. The following is an example of the problems that occurred during the implementation of the led billboard display project. Explain the issues to be noted when using RS-485 as a long-distance data communication method.
The LED billboard display in this project is a billboard installed on the production floor to display the actual output and the target output. The six displays with the same specifications are distributed in six workshops. The cable length between adjacent workshops is approximately 150~200m. The length of the distance plus the interference of the motor running in the workshop make the LED billboard display communication abnormal, which often causes garbled characters.
After careful analysis and many tests, we have started from many aspects: improvement of the hardware circuit, improvement of the upper computer and lower computer communication protocol, and finally successfully solved this problem. The following will be the final analysis of the key points of the problem for detailed analysis and description.
1. The attenuation of a signal during transmission is not difficult to understand. No matter what media the signal is transmitted through, it will be attenuated during transmission. We can think of the RS-485 transmission cable as an equivalent circuit composed of several resistors, inductors, and capacitors, as shown in Figure 1.
Wire resistance 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 loss of the signal is mainly due to the LC low-pass filter consisting of the distributed capacitance and distributed inductance of the cable. The higher the baud rate, the greater the signal attenuation. The attenuation coefficient of conventional cables is shown in Table 1.
Therefore, in the case where the amount of data to be transmitted is not large and the transmission rate requirement is not very high, we usually use a baud rate of 9600 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 causes of signal reflection on the RS-485 bus.
1 Impedance mismatch. Impedance mismatch is mainly due to impedance mismatch between the 485 chip and the communication line. The reason why the reflection is caused is that when the communication line is idle, the entire communication line signal is disorderly. Once such a reflection signal triggers the comparator of the 485 chip input terminal, an erroneous signal will be generated. Our usual solution is to add the bias resistors of the resistance values ​​A and B of the RS-485 bus line to pull up and pull down respectively so that no unpredictable clutter signal will appear.
2 impedance is not continuous. As the name suggests, the reflection caused by light entering from one medium to another medium is similar. At the end of the transmission line, the signal suddenly encounters little or no cable impedance, and the signal causes reflections at this point. The most common method to eliminate this reflection is to connect a termination resistor of the same size as the characteristic impedance of the cable at the end of the cable so that the impedance of the cable is continuous. Since the transmission of signals on the cable is bidirectional, a termination resistor of the same size must also be connected across the other end of the communication cable, as shown in Figure 2.
By this method, the influence of signal reflection can be weakened to some extent. However, in practical applications, since the characteristic impedance of the transmission cable is related to the application environment such as communication baud rate, the characteristic impedance cannot be completely equal to the termination resistance, so we cannot completely avoid the occurrence of signal reflection.
3. Effect of Distributed Capacitance on Transmission Performance of RS-485 Bus RS-485 transmission cables are usually mostly twisted pairs. Capacitance is generated between two parallel wires of a twisted pair. At the same time, similar capacitances exist between the cable and the earth. Since the signal transmitted on the RS-485 bus is composed of numerous “1†and “0†bits, when a special byte such as 0x01 is encountered, the level “0†allows the distributed capacitor to be charged for a sufficient time. When the level "1" suddenly comes, the accumulated charge of the capacitor cannot be released within a short time, thus resulting in the deformation of the signal bit, thereby affecting the quality of the entire data transmission.
Therefore, on the one hand, we should try to use cables with smaller distributed capacitance, ie better quality, as the communication line. On the other hand, we should reduce the baud rate of communication as much as possible and discharge the capacitor with sufficient time.
4, the development of simple and reliable RS-485 communication protocol When the communication distance is short, the application of environmental interference is small, we sometimes only need a simple one-way communication to achieve all the project's functions, but most of the application environment is not so ideal . Whether the pre-project integrated cabling is professional (such as maintaining a certain distance between the signal line and the power line), the indetermination of the communication distance, the degree of interference around the communication line, whether the communication line adopts twisted-pair shielded cable, etc. These factors are all given to the system. Normal communications have a great impact. Therefore, it is especially important to formulate a complete communication protocol.
The specific method is to packetize and transmit the data. The data is packaged by adding the header and end of the packet to the data of each packet. One byte is reserved at the end of the frame as the check byte. The lower machine compares the check byte calculated by itself with the check byte transmitted from the upper computer, thereby giving an instruction to the upper computer. In the end, it is to re-send the data of the packet or the data of the next packet. A pack of hair is sent out and a packet is sent until it is finished. With such a check retransmission mechanism, we can eliminate the possibility of errors and allow the communication system to operate normally.
5. Conclusion During the entire project rectification process, the following measures were adopted: As the distance between the communication line and the power supply line is very close, and the communication line is not shielded, we replaced all communication cables; the upper computer and the lower computer Both machines set the baud rate of the communication to be adjustable, so that appropriate values ​​can be selected according to the specific conditions during the debugging process; the communication protocol is optimized, and 120Ω terminating resistors are added to both ends of the communication cable.
The LED billboard display in this project is a billboard installed on the production floor to display the actual output and the target output. The six displays with the same specifications are distributed in six workshops. The cable length between adjacent workshops is approximately 150~200m. The length of the distance plus the interference of the motor running in the workshop make the LED billboard display communication abnormal, which often causes garbled characters.
After careful analysis and many tests, we have started from many aspects: improvement of the hardware circuit, improvement of the upper computer and lower computer communication protocol, and finally successfully solved this problem. The following will be the final analysis of the key points of the problem for detailed analysis and description.
1. The attenuation of a signal during transmission is not difficult to understand. No matter what media the signal is transmitted through, it will be attenuated during transmission. We can think of the RS-485 transmission cable as an equivalent circuit composed of several resistors, inductors, and capacitors, as shown in Figure 1.
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 causes of signal reflection on the RS-485 bus.
1 Impedance mismatch. Impedance mismatch is mainly due to impedance mismatch between the 485 chip and the communication line. The reason why the reflection is caused is that when the communication line is idle, the entire communication line signal is disorderly. Once such a reflection signal triggers the comparator of the 485 chip input terminal, an erroneous signal will be generated. Our usual solution is to add the bias resistors of the resistance values ​​A and B of the RS-485 bus line to pull up and pull down respectively so that no unpredictable clutter signal will appear.
2 impedance is not continuous. As the name suggests, the reflection caused by light entering from one medium to another medium is similar. At the end of the transmission line, the signal suddenly encounters little or no cable impedance, and the signal causes reflections at this point. The most common method to eliminate this reflection is to connect a termination resistor of the same size as the characteristic impedance of the cable at the end of the cable so that the impedance of the cable is continuous. Since the transmission of signals on the cable is bidirectional, a termination resistor of the same size must also be connected across the other end of the communication cable, as shown in Figure 2.
3. Effect of Distributed Capacitance on Transmission Performance of RS-485 Bus RS-485 transmission cables are usually mostly twisted pairs. Capacitance is generated between two parallel wires of a twisted pair. At the same time, similar capacitances exist between the cable and the earth. Since the signal transmitted on the RS-485 bus is composed of numerous “1†and “0†bits, when a special byte such as 0x01 is encountered, the level “0†allows the distributed capacitor to be charged for a sufficient time. When the level "1" suddenly comes, the accumulated charge of the capacitor cannot be released within a short time, thus resulting in the deformation of the signal bit, thereby affecting the quality of the entire data transmission.
Therefore, on the one hand, we should try to use cables with smaller distributed capacitance, ie better quality, as the communication line. On the other hand, we should reduce the baud rate of communication as much as possible and discharge the capacitor with sufficient time.
4, the development of simple and reliable RS-485 communication protocol When the communication distance is short, the application of environmental interference is small, we sometimes only need a simple one-way communication to achieve all the project's functions, but most of the application environment is not so ideal . Whether the pre-project integrated cabling is professional (such as maintaining a certain distance between the signal line and the power line), the indetermination of the communication distance, the degree of interference around the communication line, whether the communication line adopts twisted-pair shielded cable, etc. These factors are all given to the system. Normal communications have a great impact. Therefore, it is especially important to formulate a complete communication protocol.
The specific method is to packetize and transmit the data. The data is packaged by adding the header and end of the packet to the data of each packet. One byte is reserved at the end of the frame as the check byte. The lower machine compares the check byte calculated by itself with the check byte transmitted from the upper computer, thereby giving an instruction to the upper computer. In the end, it is to re-send the data of the packet or the data of the next packet. A pack of hair is sent out and a packet is sent until it is finished. With such a check retransmission mechanism, we can eliminate the possibility of errors and allow the communication system to operate normally.
5. Conclusion During the entire project rectification process, the following measures were adopted: As the distance between the communication line and the power supply line is very close, and the communication line is not shielded, we replaced all communication cables; the upper computer and the lower computer Both machines set the baud rate of the communication to be adjustable, so that appropriate values ​​can be selected according to the specific conditions during the debugging process; the communication protocol is optimized, and 120Ω terminating resistors are added to both ends of the communication cable.
Brass Stop Cocks,Brass Shut Off Valve Garden Hose,Brass Stop Valve With Drain,Brass Shut Off Valve For Garden Hose
AS-SUR INDUSTRIAL VALVE CO., LTD. , https://www.assur-valve.com