Improve RS485 bus reliability and troubleshooting methods

Apr 22, 2025 Leave a message

In the long-distance communication between MCUs in a number of programs, RS485 due to simple hardware design, easy to control, low cost and other advantages are widely used in factory automation, industrial control, community monitoring, water conservancy automatic reporting and other fields. However, RS485 bus in the anti-interference, self-adaptation, communication efficiency and other aspects of the defects still exist, some of the details of the improper handling will often lead to communication failures or even system paralysis and other failures, so to improve the other more power-saving matching program is RC matching using a capacitor C


The use of a capacitor C to isolate the DC component, you can save most of the power, but the value of capacitance C is a difficult point, you need to make a compromise between power consumption and matching quality. In addition to the above two there is a diode matching program, this program does not achieve true matching, but it uses the clamping effect of the diode, quickly weaken the reflected signal to improve the signal quality, energy saving effect is significant.


(2) RO and DI terminal configuration pull-up resistor


Asynchronous communication data is transmitted in the form of bytes, and before each byte is transmitted, a handshake is realized by a low-level start bit. To prevent interfering signals from mistakenly triggering RO (receiver output) to generate negative jumps, so that the MCU at the receiving end enters the receiving state, it is recommended that RO be connected to an external 10kΩ pull-up resistor.


(3) Ensure that the system is powered on the RS485 chip in the receiving input state


For the transceiver control terminal TC is recommended to use the MCU pin through the inverter for control, it is not advisable to use the MCU pin directly for control, in order to prevent interference with the bus when the MCU is powered on, as shown in Figure 4.


(4) Bus isolation


RS485 bus for parallel two-wire interface, once a chip failure may be the bus "pull dead", so the two-wire port VA, VB and the bus should be isolated. Usually in the VA, VB and the bus between each series of a 4 ~ 10Ω PTC resistor, at the same time with the ground across the 5V TVS diode to eliminate line surge interference. If there is no PTC resistor and TVS diode, can be replaced by an ordinary resistor and voltage regulator.


(5) Reasonable choice of chips


For example, in order to prevent strong electromagnetic (lightning) impact on external equipment, it is recommended to use TI's 75LBC184 lightning strike chip, the number of nodes required for a larger number of optional SIPEX SP485R.


2.RS485 network configuration


(1) The number of network nodes

The number of network nodes and the selected RS485 chip drive capability and the receiver's input impedance, such as 75LBC184 nominal maximum value of 64 points, SP485R nominal maximum value of 400 points. When used in practice, due to cable length, wire diameter, network distribution, transmission rate is different, the actual number of nodes are not up to the theoretical value. For example, if the 75LBC184 is used in a RS485 network with a distribution of 500m and the number of nodes exceeds 50 or the rate is greater than 9.6kb/s, the reliability of the work decreases significantly. Usually recommended number of nodes according to the RS485 chip maximum value of 70% of the selection, the transmission rate of 1200 ~ 9600b / s between the selection. Communication distance of 1km or less, from the communication efficiency, the number of nodes, communication distance and other comprehensive consideration of the selection of 4800b / s best. When the communication distance is more than 1km, it should be considered to improve the reliability of data transmission by increasing the relay module or reducing the rate.


(2) Node and trunk distance

Theoretically, the distance between the RS485 node and the trunk (T-header, also known as the lead-in line) the shorter the better.T-header less than 10m nodes using T-type, the connection does not have much impact on the network matching, can be assured that the use of the node, but for the node spacing is very small (less than 1m, such as the LED module combination screen) should be used to connect the star, if the T-type or bead-type connection can not function properly.RS485 is a RS485 is a half-duplex structure of the communication bus, mostly used for a pair of multi-point communication system, so the host (PC) should be placed at one end, do not put in the middle and the formation of the trunk of the T-shaped distribution.


3. Improve RS485 communication efficiency


RS485 is usually used in a pair of multi-point master-slave response communication system, compared to full-duplex buses such as RS232 efficiency is much lower, so it is very important to choose the appropriate communication protocol and control mode.


(1) bus steady-state control (handshake signal)

Most users choose to send data before 1ms will send and receive control terminal TC set to a high level, so that the bus into a stable sending state before sending data; data sent and then delayed 1ms after the TC terminal set to a low level, so that the reliable sending is completed before transferring to the receiving state. According to the author to use the TC side of the delay has been 4 machine cycles to meet the requirements.


(2) In order to ensure the quality of data transmission, each byte should be checked while minimizing the characteristics of the word and parity word.

The customary packet format consists of bootstrap code, length code, address code, command code, data, check code, and tail code, and the length of each packet reaches 20-30 bytes. In the RS485 system such a protocol is not very concise. Recommended that users use MODBUS protocol, the protocol has been widely used in water conservancy, hydrology, electric power and other industry equipment and systems in the international standard.


4.RS485 interface circuit power supply, grounding


For the measurement and control network formed by the MCU combined with RS485 microsystems, priority should be given to the use of microsystems independent power supply program, it is best not to use a large power supply to the microsystems in parallel power supply, at the same time, the power line (AC and DC) can not share the same multi-core cable with the RS485 signal line. RS485 signal line should be used to select the cross-sectional area of 0.75mm2 or more twisted pair of wires instead of flat straight lines. For each small-capacity DC power supply selection of linear power supply LM7805 than the selection of switching power supply is more appropriate, of course, should pay attention to the protection of LM7805.

(1) LM7805 input and ground should be connected across the 220 ~ 1000μF electrolytic capacitors.

(2) LM7805 input and output reverse 1N4007 diode; (2) LM7805 input and output reverse 1N4007 diode.

(3) LM7805 output and ground should be connected across the 470 ~ 1000μF electrolytic capacitors and 104pF monolithic capacitors and reverse 1N4007 diode;

(4) input voltage of 8 ~ 10V is preferred, the maximum allowable range of 6.5 ~ 24V. TI's PT5100 can be used to replace the LM7805, in order to achieve 9 ~ 38V ultra-wide voltage input.


5. Optical isolation


In some areas of industrial control, due to the complexity of the scene, there is a high common mode voltage between the nodes. Although the RS485 interface is a differential transmission method, with a certain degree of resistance to common-mode interference, but when the common-mode voltage exceeds the limit of the RS485 receiver receiving voltage, that is, greater than +12V or less than -7V, the receiver can no longer work properly, and in serious cases will even burn the chip and instrumentation.

The solution to such problems is to isolate the system power supply and RS485 transceiver power supply through DC-DC; signal isolation through optocoupler to completely eliminate the effect of common mode voltage. The way to realize this program can be divided into:

(1) use optocoupler, DC-DC with isolation, RS485 chip to construct the circuit;.

(2) using secondary integrated chips, such as PS1480, MAX1480, etc..


6.RS485 system of common failures and processing methods


RS485 is a low-cost, easy-to-operate communication system, but the stability of the weak at the same time interlocking strong, there is usually a node failure will lead to the system as a whole or local paralysis, and it is difficult to judge. Therefore, the reader is introduced to some of the common methods of maintaining RS485.

(1) If the system is completely paralyzed, mostly because of a node chip VA, VB was power breakdown, the use of a multimeter to measure the VA, VB between the differential mode voltage is zero, and the common mode voltage to ground is greater than 3V, at this time you can measure the size of the common-mode voltage to troubleshooting, the greater the common-mode voltage indicates that the closer the point of failure, and vice versa, the farther away.

(2) bus several consecutive nodes can not work properly. Generally caused by one of the node failure. A node failure will lead to the neighboring 2 to 3 nodes (generally subsequent) can not communicate, so it will be detached from the bus one by one, such as a node detached from the bus can return to normal, indicating that the node failure.

(3) centralized power supply RS485 system in the power-up often appear part of the node is not normal, but each time is not exactly the same. This is due to the RS485 transceiver control terminal TC design is not reasonable, resulting in microsystem power-up node transceiver state confusion thus leading to bus blockage. Improvement method is to add the microsystem power switch and then powered on separately.

(4) The system is basically normal but communication failure occurs occasionally. Generally due to the network construction is not reasonable, resulting in system reliability is in a critical state, it is best to change the alignment or increase the relay module. One of the contingency methods is to replace the node that fails with a chip with better performance.

(5) Due to the MCU failure caused by the TC side of the long hair state and pull the bus dead a piece. Remind the reader not to forget to check the TC side, although the RS485 provides a differential mode voltage greater than 200mV that can work properly. But the actual measurement: a well-run system of differential mode voltage is generally around 1.2V (due to network distribution, rate differences may make the differential mode voltage in the range of 0.8 ~ 1.5V).

Send Inquiry

whatsapp

Phone

E-mail

Inquiry