Weird waveforms on RS485 bus

Thread Starter

kralg

Joined Aug 13, 2017
37
I hope I am knocking on the right door here. I have a small RS485 network with a master and two slaves that has been running for more than a year now. I recently replaced a seemingly unrelated power supply and started to experience communication failures. I checked the bus using a differential probe at slave 1, as seen on the images.

The bus is running at 9600 bps, using one pair of wires in a Cat5 unshielded cable (the other pairs of wires are unused). The terminations and fail-safe bias locations are shown. The master is continuously polling the slaves for statuses. While the master signals are looking very good to me, the slave responses are awful. A very low voltage difference starts opening up with the same extent in both positive and negative voltages. All units are using the same RS485 transceivers with the same circuits (except the additional fail-safe resistors at the master).

I have never checked the bus before, probably it was (almost) the same bad from the beginning, but it worked so I have not checked. I do not think the replaced power supply has anything to do with it. (It is not the 5V power supply that is powering the units, maybe a little extra noise?)

I do not have too much experience, but when the bus is released (seen when the master fails to receive the message and timeouts) the line looks fine, (only the failsafe bias pulls it to positive), so I do not think the problem is related to noise.

Any idea what could cause this? Any clue is appreciated that gives me a hint where to start...
 

Attachments

dendad

Joined Feb 20, 2016
4,116
It looks like you have a common 0V line between the nodes.
This is needed to prevent common mode voltages being exceeded.
I assume the RS485 is referenced to the supply.
Another thing you may try is to use Mornsun isolated RS485 drivers.

Just a thought, can you put the scope on the slave supply lines to see if it is stable?
Also, what does the waveform look like at the slave end?
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,656
+1
My guess is that the old supply(s) referred 0V to Earth through a 3 prong plug and the new one(s) don’t. I’ve seen it happen when a desktop host was replaced by a battery powered laptop. The common ground reference in that case had been provided by the chassis earth plug connection and the 5V node supplies referred to that. You can test it by scabbing in a common ground between the host and nodes as a test.
Good luck!
 

Sensacell

Joined Jun 19, 2012
2,985
People get into trouble assuming RS-485 is a 2-wire interface- its not.

You must enforce a minimal potential difference between tx and rx nodes- else you can exceed the common mode voltage range and things start failing.
 

Thread Starter

kralg

Joined Aug 13, 2017
37
It looks like you have a common 0V line between the nodes.
This is needed to prevent common mode voltages being exceeded.
I assume the RS485 is referenced to the supply.
Another thing you may try is to use Mornsun isolated RS485 drivers.

Just a thought, can you put the scope on the slave supply lines to see if it is stable?
Also, what does the waveform look like at the slave end?
Thank You for the response. Yes, I checked the power also and I could see a little ripple on it and a slight voltage drop (like 0.3V) probably as the result of the long cable, but otherwise it was stable. I will check that again though because I also think that it must be something to do with the power. I have other units loading this 5V at the remote locations, so ground could be shifted, but the problem looks to be much more severe, so I do not know what to think.

My plan is to temporarily provide a separate 5V to the units at the remote locations (leaving the ground connected) which case I will have much less current flowing in the GND line.
 

dendad

Joined Feb 20, 2016
4,116
If you are going to send power down the line from just one end, use maby 24V and have local 24V to 5V regulators at each node.
Don't try to send a 5V supply along a long cable.
 

Thread Starter

kralg

Joined Aug 13, 2017
37
People get into trouble assuming RS-485 is a 2-wire interface- its not.

You must enforce a minimal potential difference between tx and rx nodes- else you can exceed the common mode voltage range and things start failing.
As seen on the layout, I am powering the units with the same supply, so in theory they have the same ground. In practice, they have like 0.5V off thanks to the current flowing in the GND line, but that does not explain what I see on the line so far.
 

Sensacell

Joined Jun 19, 2012
2,985
Try lifting the ground at ONE END, (but connect it to the cable shield or drain wire)

This would help to eliminate a ground loop.

Edit- forget this- i thought you had a psu at both ends.
 

dendad

Joined Feb 20, 2016
4,116
What size are the local electrolytic caps at each node?
If small, try making them bigger, like 2200uF, so each node will have a solid supply if you are just using one 5V supply at one end.
 

Thread Starter

kralg

Joined Aug 13, 2017
37
+1
My guess is that the old supply(s) referred 0V to Earth through a 3 prong plug and the new one(s) don’t. I’ve seen it happen when a desktop host was replaced by a battery powered laptop. The common ground reference in that case had been provided by the chassis earth plug connection and the 5V node supplies referred to that. You can test it by scabbing in a common ground between the host and nodes as a test.
Good luck!
The replaced power supply was a 12V adapter and it has only the 0V output in common to the 5V supply. Your guess is right, I temporarily put to a wall plug adapter in place, but I clearly know that the previous supply also did not connect the 0V to the chassis ground, it only used the chassis ground to connect the line filtering capacitors. So earth ground is and was completely isolated from the supply.
 

Thread Starter

kralg

Joined Aug 13, 2017
37
What size are the local electrolytic caps at each node?
If small, try making them bigger, like 2200uF, so each node will have a solid supply if you are just using one 5V supply at one end.
The master _locally_ has a 100uF capacitor, slave1 has a 470uF, slave2 has 100uF. But the power supply near the master must have at least 470uF. Also there are other loads that may have infuence, so I will try that.
(I am in doubt though because I should see much bigger excursions or variations in the supply voltage to get such a catasthrophic result on the line.)
 

Thread Starter

kralg

Joined Aug 13, 2017
37
If you are going to send power down the line from just one end, use maby 24V and have local 24V to 5V regulators at each node.
Don't try to send a 5V supply along a long cable.
I know it is a bad practice, but I do not have not much load remotely, so it looked convenient to just take the 5V on a separate, much thicker cable (1mm² or AWG17).

Anyway I will try playing now with the supply and be back with the results.
 

Thread Starter

kralg

Joined Aug 13, 2017
37
OK, a little embarrassing, but after experimenting a bit I need to admit that I "forgot" to mention that not only the 5V supply is sent to remote locations, but also the 12V supply (that I recently replaced). Even though the 12V supply is not connected to these units and it has also a separate GND wire in the cable, the two GND is connected at both sides in other units, as seen on the attached modified layout...

So first I put a 2200µF capacitor on the input of Slave1, which seemingly made no difference, so I decided to disconnect the 5V and add an external 5V to Slave1 only, see the result attached. Slave1 now gave stronger pulses than the master. (Of course Slave2 did not respond.)

Then I reconnected the 5V and disconnected the 12V supply, see the result attached. The weakness of the 5V rail is clearly seen, but at least the signals are stable. So it is the 12V supply that is causing the main issue.

Now I added the 2200µF capacitor. It barely helped Slave1 (a couple of tenth of volts stronger, which fades out soon), and I can almost see no change at Slave2.

I attached the power supply images too. On the 5V I really can see only a small ripple (and the drop to 4,5V), but I cannot see the results of the load change, so I think it is correctly bypassed. It is just a transceiver that is very sensitive to the voltage drop.

The main issue is probably the 12V supply, which has a low frequency ripple of 1 Vpp, no idea how a switching mode power supply can do it. It is also unclear to me how it gets on the transceivers. Even if it makes the shared GND line to move, I think I should see that when checking the 5V, right? Or is it a common mode shift that only affects the remote slaves, but not the master? I am confused....
 

Attachments

iggnator

Joined Jan 30, 2019
15
I didn't see anywhere the discussion of the RS485 output from driven to open state between the masters and slaves when they swap from listening to talking. It could be bus contention where a driver is left in it's low impedance state as some other bus user talks. If you changed power supplies, did they die, but as part of that failure, overvoltage and damaged the bus transceivers? Just what is controlling the bus direction of the masters and slaves?
 

Ian0

Joined Aug 7, 2020
4,899
OK, a little embarrassing, but after experimenting a bit I need to admit that I "forgot" to mention that not only the 5V supply is sent to remote locations, but also the 12V supply (that I recently replaced). Even though the 12V supply is not connected to these units and it has also a separate GND wire in the cable, the two GND is connected at both sides in other units, as seen on the attached modified layout...

So first I put a 2200µF capacitor on the input of Slave1, which seemingly made no difference, so I decided to disconnect the 5V and add an external 5V to Slave1 only, see the result attached. Slave1 now gave stronger pulses than the master. (Of course Slave2 did not respond.)

Then I reconnected the 5V and disconnected the 12V supply, see the result attached. The weakness of the 5V rail is clearly seen, but at least the signals are stable. So it is the 12V supply that is causing the main issue.

Now I added the 2200µF capacitor. It barely helped Slave1 (a couple of tenth of volts stronger, which fades out soon), and I can almost see no change at Slave2.

I attached the power supply images too. On the 5V I really can see only a small ripple (and the drop to 4,5V), but I cannot see the results of the load change, so I think it is correctly bypassed. It is just a transceiver that is very sensitive to the voltage drop.

The main issue is probably the 12V supply, which has a low frequency ripple of 1 Vpp, no idea how a switching mode power supply can do it. It is also unclear to me how it gets on the transceivers. Even if it makes the shared GND line to move, I think I should see that when checking the 5V, right? Or is it a common mode shift that only affects the remote slaves, but not the master? I am confused....
I use CAN (which is very similar to RS485 in voltage terms) and it can find a signal that is smaller than the common mode ripple. If I look on the CAN+ and CAN- lines, all I can see is 50Hz, and if I look at the RX output, there is my CAN signal.

My suggestion would be to send the 12V power supply, then generate the 5V supply from the 12V locally, using a linear regulator if the power requirement is not large or a switcher for higher current.

Has the mains side smoothing cap failed on your 12V switched-mode? Or are there a lot of circulating currents due to the 0V being earthed in several different places?
 

Thread Starter

kralg

Joined Aug 13, 2017
37
Thanks for your suggestion, good to know CAN may give better results in these situations. For this system it will be all right as soon I will replace the 12V supply. This supply is a wall-adapter with 1A capability. Since my overall load is pretty close to 1A, I think it has some kind of regulation issues at these higher currents. (Maybe because the mains side filter cap is drying out. I will check as soon I get fixed the original supply, just for curiosity.)

What I am more interested in is still the result of this effect. If I have the GND line changing because the additional currents flowing from the 12V supply, I should see that when checking against the 5V line (because the same current is not flowing in the 5V wire). So I would expect to see the 5V fluctuating like that and that would perfectly explain what happens. But for some reason the 5V looks fine... I am probably missing some concept here.
 

Thread Starter

kralg

Joined Aug 13, 2017
37
I didn't see anywhere the discussion of the RS485 output from driven to open state between the masters and slaves when they swap from listening to talking. It could be bus contention where a driver is left in it's low impedance state as some other bus user talks. If you changed power supplies, did they die, but as part of that failure, overvoltage and damaged the bus transceivers? Just what is controlling the bus direction of the masters and slaves?
You can see the bus released when it gets back to a +0.4V or similar between the messages, as the result of the fail-safe bias. I did not replace the power supply of the master and slaves, I replaced a power supply for different purposes. And though I see that the new power supply is causing my trouble I just do not understand why.
 

Ian0

Joined Aug 7, 2020
4,899
RS485 should give similar results to CAN. CAN won’t be any better, maybe not as good as it has only half the voltage swing.
if you have voltage drop on the 0V cabling, then it becomes much more significant on a 5V supply. Regulate the 5V locally.
 
Top