EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: Vindhyachal.takniki on April 13, 2017, 02:20:52 am

Title: Rs485 common ground or not
Post by: Vindhyachal.takniki on April 13, 2017, 02:20:52 am
I had a confusion on whether in RS485 common ground is required or not?
I have a slave side & a master side.
As far as I understand when master & slave communicate, there is no reference to ground of each other. They communicate with referene to A&B.


Communication is:
Slave(with gnd1)->SN65HVD70(RS485)  ----    SN65HVD70(RS485)<-Master(with gnd2)


1. I think there will be no connection between gnd1 & gnd2. Or there is any relation? 
2. Infact I had made a system some 3-4 years ago, I had communication like above between two devices. Both devices have their own ground, no reference with each other. They were communicating with each other on A/B signals only.
Title: Re: Rs485 common ground or not
Post by: james_s on April 13, 2017, 02:25:22 am
RS-485 uses differential signaling, so neither side should be referenced to a common ground.
Title: Re: Rs485 common ground or not
Post by: digsys on April 13, 2017, 02:43:51 am
While I tentatively agree with that, it depends on the distance and how "close" the 0V points are between the 2 devices.
If they are close, same cabinet etc, I always connect them. That guarantees any pull up/down, termination resistors keep the same reference.
Medium distance ~20M ish, I go either way. Depends if they are on the same power circuit. If not, float 0V.
However, if you go between buidings, and there is a chance of large GND shifts (assuming 0V is tied to GND by some path), or distances are 2Km+, I use opto-repeaters.
There is only so much the Inputs can tolerate.
Title: Re: Rs485 common ground or not
Post by: BrianHG on April 13, 2017, 03:11:01 am
As stated above, connecting the GND add a degree of safety between devices if they have a large floating voltage offset due to how they get their power.  For example, one of the 2 devices may have switching supplies leaking almost a ma, where one is connected to the opposite 120v AC phase.
Title: Re: Rs485 common ground or not
Post by: David Hess on April 13, 2017, 03:17:15 am
RS485 has a common ground whether it is included in the wiring or not unless it is galvanically isolated.  Exceeding the common mode input range of the receiver will cause malfunctions and in extreme cases damage.
Title: Re: Rs485 common ground or not
Post by: T3sl4co1l on April 13, 2017, 04:33:04 am
Definitely, absolutely, positively, grounded.

RS-485 uses differential signaling, so neither side should be referenced to a common ground.

Please read a book.

Tim
Title: Re: Rs485 common ground or not
Post by: aandrew on April 13, 2017, 04:59:07 am
RS-485 uses differential signaling, so neither side should be referenced to a common ground.

Differential signalling has nothing to do with needing a common reference point.
Title: Re: Rs485 common ground or not
Post by: retrolefty on April 13, 2017, 05:28:34 am
Next someone will ask if a 'one-wire' device requires a common ground connection.   

Just tell them that the marketing department invented the name, not the engineering department.

 :-DD

Title: Re: Rs485 common ground or not
Post by: james_s on April 13, 2017, 05:57:10 am
I see now that there is some ambiguity in my statement. When I read the original question I interpreted it as asking if one side of the pair should be tied to ground on each end, in which case it would not be a differential pair.
Title: Re: Rs485 common ground or not
Post by: T3sl4co1l on April 13, 2017, 05:59:49 am
I see now that there is some ambiguity in my statement. When I read the original question I interpreted it as asking if one side of the pair should be tied to ground on each end, in which case it would not be a differential pair.

Ah, gotcha.  That would indeed be a weird thing to do. :)

Tim
Title: Re: Rs485 common ground or not
Post by: casinada on April 13, 2017, 06:02:20 am
Only if the cable is shielded, connect it only to the ground on one side. :)
Title: Re: Rs485 common ground or not
Post by: T3sl4co1l on April 13, 2017, 06:07:21 am
Only if the cable is shielded, connect it only to the ground on one side. :)

Oh now come on.  You please read a book.

Tim
Title: Re: Rs485 common ground or not
Post by: james_s on April 13, 2017, 06:10:45 am
Doesn't that apply to balanced audio mic cables? I'm not an audio guy, I've never dealt with balanced audio cables and there are other things I'd rather read books about but I could swear I read something like that somewhere. Hey if it's on the internet it must be true too.
Title: Re: Rs485 common ground or not
Post by: casinada on April 13, 2017, 06:41:54 am
This is what I'm referring to:
I don't claim to be an expert but I have worked with RS-485 in industrial environments and this is the way we did it.  :)
Title: Re: Rs485 common ground or not
Post by: Zucca on April 13, 2017, 06:43:30 am
http://www.valvewizard.co.uk/Grounding.pdf (http://www.valvewizard.co.uk/Grounding.pdf)

http://web.mit.edu/jhawk/tmp/p/EST016_Ground_Loops_handout.pdf (http://web.mit.edu/jhawk/tmp/p/EST016_Ground_Loops_handout.pdf)

Read, Forrest, Read!
Title: Re: Rs485 common ground or not
Post by: T3sl4co1l on April 13, 2017, 06:50:31 am
Any unterminated shield is an open invitation to EMI.

Back in the toob days, nothing cared about EMI (not fast enough, or high enough gain, to care), and electrostatic shielding was more important than electromagnetic shielding anyway (higher signal impedances), so this practice was tolerable, particularly for short runs inside the chassis where electrostatic shielding was the only need.

In audio systems, a closed ground can cause ground loop.  In that case, lifting the signal ground breaks the ground loop, but opens up the signal path for all the other noise induced in that loop: indeed, the ground loop voltage never goes away in this case, and on top of that, the maximum possible amount of EMI and RFI is sent into the system.

A poorly designed amplifier will rectify all that RF noise, making things massively worse.  (And I can't count how many systems I've seen that amplified a nearby radiotransmitter, even without taking steps to encourage it!)

The correct way to design a safety-grounded audio input: allow ground voltage to float, at low frequencies (well under 100kHz), and use a differential amplifier to sense the signal voltage with respect to its ground.  Bypass signal-ground to chassis-ground with a capacitor (or several), so that RF shielding is preserved.  (Finally, filter the signal, too, so it isn't bringing RF into the circuit.  And maybe some ESD diodes, those are always nice to have.)

Tim
Title: Re: Rs485 common ground or not
Post by: T3sl4co1l on April 13, 2017, 07:03:55 am
This is what I'm referring to:
I don't claim to be an expert but I have worked with RS-485 in industrial environments and this is the way we did it.  :)

Without knowing what the "Network Devices" are, it's impossible to tell.

A lot of industrial devices have isolated RS-485 transceivers, so the common mode range is extraordinary.

If this is the case, you're damn well off to begin with, but, you're shooting yourself in the foot by not connecting the shield -- without the shield, you're at the mercy of the device's line input CMRR, which probably isn't terrific.  Presumably, its shield terminal would connect to the isolated section's ground, multiplying its CMRR massively.  This would be critical in a "high" bitrate (up to 20Mbaud) application.

Likewise if the device is powered by an isolated source, like a wall-wart, and has no common ground connections around it (e.g., it's a lone sensor, just power in and data out).

Connecting the shield, to a common ground, of a grounded power system (AC or DC), would invite ground loop, and in that case you would consider lifting the shield: but only if you can't solve it another way, and only if the device's CMRR is good enough on its own.

Sad part: a lot of devices don't document these things good enough, so you can't tell (during the design phase) whether you're okay or not.

On the upside, communications isolators are plentiful (if not necessarily cheap).  This would be the preferred option when you don't have a good choice, from the above.

And failing even that, the sheer fact that RS-485 has as much CMR as it does (+12/-7V) is fantastic for many environments -- on the shop floor, the noise level might be a droning 5Vpk, where radios are useless -- but not peaking much above that, your CMR is more or less safe.  There is good reason why they chose that margin in the original design!

Tim
Title: Re: Rs485 common ground or not
Post by: mikeselectricstuff on April 13, 2017, 08:02:47 am
Although it is differential, the receiver has a finite tolerance to common-mode voltage. If you have full control over this in your system, then it may be OK to not connect the ground.
If you don't have good control over what is connected, then probably the only bulletproof option is to use an isolator.
e.g. if the tx and rx both run off PSUs that are connected to a local mains earth, differences between those earths caused by local loads etc. can cause major problems, and your ground can form an earth loop.
You also need to take care that your ground doesn't become a power supply return if, say, the negative lead comes off a PSU at one end, which could potentially cause a cable fire.

If there is a reason that you don't want to connect the grounds, you should probably be using isolation.
Where grounds are connected I'd suggest putting a few ohms in series at all nodes, to at least avoid the "data cable on fire" issue.
Title: Re: Rs485 common ground or not
Post by: Jeroen3 on April 13, 2017, 09:27:44 am
I've put up a large multi panel CAN network with 3 wires and shield. CAN is electrically similar to 485.
Connection is as follows, all nodes are isolated.
- CAN GND, L and H to each node.
- Shield to earth at the first device each panel.

Bus is running fine for a few years now. Each panel has a VFD and many relays that do not crash the bus.
Some relays do mess up one message. But CAN is designed for that. Total length is approximately 70 meter. Of which 30 meters between floors next to unshielded VFD output cable.(yes I know)
Title: Re: Rs485 common ground or not
Post by: Vindhyachal.takniki on April 14, 2017, 04:43:59 am
attached find the ckt. This is for reference only, not complete.

I think it can solve below points. Please check it below poitns can be resolved.
1. I think it will have immunity of RS485.
2. Would be full duplex so can communicate with bq34z100-g1 i2c protocol also via SC18IM700.

One issue on which I am not yet clear:
1. When one or both of mosfet gets off i.e there is no connection between BAT- & Pack-, then can communication happen?
On master side either the MCU is powered from Pack+/Pack- or external supply. Communication should happen in both cases.
Title: Re: Rs485 common ground or not
Post by: igeorge on April 14, 2017, 11:17:12 pm
From my industrial experience in the automotive assembly plants:
I ground SHIELD of the cable to the metal body of the machine, which is not the BOARD ground. I do it only in one end and leave the other end disconnected.
I run a ground wire (drain of the shielded cable) to each board GND in series with a 10 ohms resistor.
It does work for me even in the welding department where i have robots(AKA motors) and ARC welders.
Title: Re: Rs485 common ground or not
Post by: janoc on April 14, 2017, 11:30:25 pm
Doesn't that apply to balanced audio mic cables? I'm not an audio guy, I've never dealt with balanced audio cables and there are other things I'd rather read books about but I could swear I read something like that somewhere. Hey if it's on the internet it must be true too.

It does and not only. The idea is to ground the shielding only "at one end" (i.e. tie it to the signal ground only in one place) because otherwise you are very likely to introduce ground loops through the shielding.

OTOH, differential audio wiring expects that the hw is at more or less similar ground potential and you are only battling ground loops introducing 50Hz hum into the signal. That probably doesn't apply with wiring between buildings or in a long distance cable - there you will want a galvanic isolation, as said above by others.

Title: Re: Rs485 common ground or not
Post by: Vindhyachal.takniki on April 15, 2017, 09:44:55 am
I got this point of common mode voltage range of RS485. Suppose RS485 IC has +-7V of common mode voltage range.
As far as I understand, this means that even though there is communication through A & B wires of IC, the value of voltage on A,B on both master & slave should not cross +-7V wrt to ground of any RS485 IC.


Gnd1->Master_A/Master_B  -----  Slave_A/Slave_B<-Gnd2
1. If I put voltmeter :
   +ve lead : At any pin Master_A/Master_B/Slave_A/Slave_B
   -ve lead:  Gnd1
   
   The voltage should be range of +-7V at any pin of +ve lead.
   
2. Similarly If I put voltmeter :
   +ve lead : At any pin Master_A/Master_B/Slave_A/Slave_B
   -ve lead:  Gnd2
   
   The voltage should be range of +-7V at any pin of +ve lead.

Is this correct?



But I dont understand, I had made a project, in which master & slave had two different supplies, completetly isolated from each other, one had a smps based supply & other was battery operated.
Both were communicating thourgh only two signals A & B. There was no common ground or any other point. Just 2 wires A & B.
This was working perfectly fine.
Why was that so?
Title: Re: Rs485 common ground or not
Post by: T3sl4co1l on April 15, 2017, 09:55:39 am
With no other ground return path, the pull-down resistors on the receiver input pins will center it around 0V.

This doesn't work very well at AC, which is a good reason to apply filtering with respect to circuit ground.

Tim
Title: Re: Rs485 common ground or not
Post by: Vindhyachal.takniki on April 24, 2017, 04:52:53 am
Hi,

1. Attached fine the current2.pdf. It contains the actual board which I am using currently.
a)Q1 & Q2 are required in ckt as they protect the battery from charge & discharge error.
b)R1 is sense resitor for measuring current flowing in/out of circuit.
c)Bq34z100-g1 is powered by 3.3V. SO I2C signals are 3.3V.
d) Usage of Q3/Q5 & Q4/Q6 is explained in page 2 of current2.pdf
e) Communication breaks in following cases:
   i) Q1 discharge fet off:  Q3/Q5 fets off also
   ii) Q2 charge fet off: Q4/Q6 fets off also
   iii)Q1/Q2 both gets off: Q3/Q5/Q4/Q6 all gets off
f) Reasons for turning off of Q1 or Q2:
   i) Q1 off: Battery gets over discharged
   ii) Q2 off: Battery gets over charged 
   iii) Q1 & Q2 both off: Some short circuit in circuit.


2. Now I want that:
a) This problem off communication break do not occur
b) Convert I2C to differential communication RS485/CAN
c) Preferable as hardware asic based
d) As low power as possible, since circuit is battery powered.


3. I have attached a circuit CAN_BUS.pdf.
a) Fets in Communication line are removed.
b) I have used P82B96 & SN65HVD231 for convert I2C to CAN
C) On receiver side, CAN to I2C conversion is done
d) SN65HVD231 has CMR of -2V to 7V, I will select a device with CMR -7V to +7V.
e) On host/receiver side, communication ckt can be either powered from pack+/pack-  or external supply.
f) But all return path for communication will be referenced to pack- only.



4. Can this circuit work?


5. Biggest problem will be:
a) When Q1 or Q2 or both gets, there will be no voltage between pack+ & pack-. & suppose receiver side is powered from external supply whose return path is reference to pack-.
In that case, can communication happen?

I think it can, as  there is differential communication, moreover CAN IC has CMR of -7Vto+7V, while CAN IC are powered by only +3.3V, so I can be in limits


b) By connecting this circuit, there should be no path between BAT- & Pack-, which can let the current flow through them in case of Q1/Q2 gets off.  Otherwise there will be error in batteries or it may get damaged.



6. If this circuit cannot work, then I have to use CAN isolator like ISO1050.
Only problem is creating a low power isolated supply of +5V for ISO1050, I will look into it, if above circuit cannot work.
Any low power isolated power supply IC?





 



 







Title: Re: Rs485 common ground or not
Post by: Vindhyachal.takniki on April 25, 2017, 04:59:53 pm
Any comments/suggestions on ckts attached using CAN bus.
Title: Re: Rs485 common ground or not
Post by: ebclr on April 27, 2017, 04:02:59 am
Here the book to be read

http://www.analog.com/media/en/technical-documentation/application-notes/AN-960.pdf (http://www.analog.com/media/en/technical-documentation/application-notes/AN-960.pdf)