RS-485 Bus problem

Go To Last Post
26 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

There is a building in which there are 5 floors. Each of them contains about 20 rooms (so there are about 100 rooms). I had to develope a small control device that can communicate through a bus cable.
I choosed the RS-485 interface. The transceiver is the LTC2856-2 IC from Linear Technologies.
The controller I've designed has a DC supply input (12-35V DC). It is used for the complete logical part power supply through a DC-DC converter and a LDO regulator. And the input supply is used as the controller output voltage through some MOSFETS.
The maximum current a module can supply (and so also sink from the power supply) is 3A (not dependent on the DC voltage). That's why I have to use a separate power supply for each of the devices. (Too much current for more devices connected together and the longer the distance between the modules, the thickest the wire I would need for small voltage drop).
The problem is with the RS-485 interface. The datasheet says that the common mode voltage on the RS-485 lines (A and B) has to be between -7 and +12 VDC. How can I achieve/ensure this, if I use separate power supplies for each of the modules? I think then they are just like batteries or a simple transformer, floating supplies.
The only connection between the modules should be the bus-cable, which is a shielded 2-wire twisted-pair cable.

Can anyone help me with this?

Thank you for your help in advance.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Put protection devices on the data lines...

Data + >----+--------+------------> Data +
            |        |
            Z        |
            |        |
Data - >----+------- | -------+---> Data -
                     |        |
                     Z        Z
                     |        |
                    ---      ---
                    GND      GND

Place like circuitry at the source, as well as each destination.

I believe they are called "TranZorbs "

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This show, how typically a connection is made:

http://www.bb-elec.com/tech_arti...

It includes a "ground" connection. This usually
keeps "common-mode" within bounds.

This shows, how a typical interface looks like:

http://www.kmitl.ac.th/~kswichit...

See the protection devices. Without the GND connection
resistors R9 and R12 fix the "common-mode" level on
the receiver side. But then its much easier for
external faults to result in common-mode noise.

I remember that I once wrote the software (PIC)
for some RS485 device. It included an optical
isolation + isolating-DC/DC converter for
each RS485 connection.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

Thank You for Your reply!
I'm not sure, this will help me. If I'm not mistaken the transorb is a kind of overvoltage protection devices. It is used to protect from spikes (mostly lightning protection).

I think I sould ensure that the voltage difference between the GND of the panels is between -7 and +12 Volts. So If I would connect the GNDs of all panels together, this would help. The problem with this solution is that one more cable is needed. I think that cable should have also a low impedance to ensure the low voltage drop.
I don't know if the PE line of the mains could be connected to the GND input of the panels.
Or the shield of the bus cable could be used to solve my problem is any way. (I think it should be connected to the PE at only one point).

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The mains earth connection will not work, Even though they all connect to the same point in the building, they could be at vastly different potentials at different points in the building.

The ground connection you use, must run the same path as the data, this way it experiences the same offset. Little or no current will run through the ground connection, it is there as a reference only. Pacing a low ohmage series resistor on each of the data lines, will also limit the amount of current that can travel through the loop. You can use the same type of wire as your data runs through.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

FWIW, the Modbus spec *requires* using shielded cable with the shield bonded at both ends when using RS485 for the physical layer. I presume (although they don't specifically say) it is to help control the common mode voltage.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ossi wrote:
This show, how typically a connection is made:

http://www.bb-elec.com/tech_arti...

It includes a "ground" connection. This usually
keeps "common-mode" within bounds.

This shows, how a typical interface looks like:

http://www.kmitl.ac.th/~kswichit...

See the protection devices. Without the GND connection
resistors R9 and R12 fix the "common-mode" level on
the receiver side. But then its much easier for
external faults to result in common-mode noise.

I remember that I once wrote the software (PIC)
for some RS485 device. It included an optical
isolation + isolating-DC/DC converter for
each RS485 connection.

Thank You ossi!

You mentioned Ground Loop. I also thought this, but it uses an extra cable. I think, this will be the final solution.
Or would be the two resistors be enough? I think they would not solve the problem.
Transils only ensure that the signals are between +-7 Volts referenced to the local ground.

Does anyone have some ideas with the PE lines I mentioned before?

Thank You once more!

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

glitch wrote:
The mains earth connection will not work, Even though they all connect to the same point in the building, they could be at vastly different potentials at different points in the building.

The ground connection you use, must run the same path as the data, this way it experiences the same offset. Little or no current will run through the ground connection, it is there as a reference only. Pacing a low ohmage series resistor on each of the data lines, will also limit the amount of current that can travel through the loop. You can use the same type of wire as your data runs through.

Thanks glitch!

PE line forgotten!

If I don't mistake, I could use eg. FTP cable for the bus. One twisted pair for the date lines and any other wire for ground connection.

Am I right?

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if your cable has 2 conductors and a shield you might be able to use the shield. If the shield is just foil, it may not work, but often the shield is coupled with a bare conductor, in this case the bare conductor should work fine for the ground connection.

If your cable has more than one twisted pair, you can use any other wire, or pair in the cable to carry the ground.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've heard there is a limit on RS485 fanout.... about 32 'unit loads'... but if you get strong transmitters and hi impedance receivers, it goes up. It would be a real bummer to run cable to 100 rooms then the darn thing doesnt work.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The only PIC project I ever did was:
a RS485 repeater
(I got enough money for it...)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Personally, I'd be running separate busses to each floor and have a RS485 hub to combine them. You don't want a failure on one floor to kill the others. I'd also be running a separate 0v connection in the cable with the shield earthed at both ends. You also want to make sure you have adequate protection for the RS485 tranceivers - as mentioned, tranzorbs do a good job. I also put polyswitches in series to limit the current in case someone puts DC down the RS485 bus - otherwise the tranzorbs go up in smoke and damage the pcb.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree separate busses for each floor is a great idea.

I do have a question, as this sounds an awful like a nurse call system. What is the functionality of each node? If it's literally just a call switch, I would suggest having all the switches for each floor attach to a single node, and then have the nodes for each floor communicate together via RS-485, or even ethernet.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Bob Gardner wrote about 32 loads, I would like to expand as well.

The RS-485 communications system is techinically a physical layer standard where you can communicate anyway you want as long as the physical layer is not altered from a linear twisted pair with 120 ohm terminators at the ends of the bus. The IEEE standard was modified to accomodate 64 loads by use of a single repeater that is responsible for regenerating the signals in both directions.

To use Glitch's idea if the floors can be separated, then a dedicated micro for each floor that can communicate to a central host on a poll/response is ideal. This separates the individual floors, makes communications easier/more robust.

Sounds like a great project, keep us in the loop

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you everyone for the responses!

I think all of your replies helped me a lot!

The RS-485 standard allows 32 transmitters on each line, but the LTC chip I mentioned has the proper impedance to allow 256 transceivers on the bus.

The device I made is a remotely controllable thermostat.
We made a HVAC control in two buildings on the site with National Instruments devices and LabView.
The problem we encountered was that the rooms not only had an air conditioning system (with heating and cooling), but fancoils in all romms as well.
The fancoils had a separate thermostat for each of the rooms. The building is an office building.
The owner of the building let the rooms and floors for other companies. The renters had to pay a fixed amount for every month. But the employees in the building set all the thermostats to the maximum value, so the bill of the heating was a lot more for the ownere than the monthly rental.
Another problem was, that when the fancoils were set to the maximum, the HVAC system smoked a too warm air, so it blew in a cooler air..... and so on...

The solution that have been made up: a thermostat that is only remotely programmable. It has to be connected to a bus cable and has to control the fancoils in the room.

To do this with NI devices would cost a fortune.
That's why I had to develop a low-cost device (of course with an AVR :D ).

The project is very cost-sensitive, so the protection devices have been left on the bus side, because the IC I mentioned has ESD, current, and temperature protection.

The hub for each floors also seems to be a very good idea. I'm sure we will use this!

I'm not sure we can use the shield to connect all the GND of the modules', because the two end of the shield has to be connected to the PE.

I don't have too much possibilities to modify the circuit, because I will receive the PCB prototype on tuesday, and the manufacturing should be started right after the first successful test as shortly as possible.

Another idea I thought is to separate the power supply input for the digital part and for the outputs, so I could use only one PSU for all of the devices on the floor. The digital part sinks only a few tens on mA-s, so the voltage drop on the GND line connecting all devices to the PSU would be not much.

The problem with this idea is also the need of PCB redesign...
But it may be useful in the next generation of the device.

Thanks to all of you for your recommendations once more!

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the cable already run to every room, and you are trying to use it as it is? I'm not clear about the PE signal yet... the wire has rs485 +, -, gnd, and I suppose power comes from a wall wart somewhere, but whats the PE signal?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PE is Power Earth, aka the 3rd prong in your AC mains plug.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

peter_smith wrote:

I'm not sure we can use the shield to connect all the GND of the modules', because the two end of the shield has to be connected to the PE.

What's the reasoning for running PE through the shield? This is normally NOT what you want to do, for safety reasons. (It may actually violate your local electrical code) The PE points are already connected together, via their common connection back at the breaker panel. Adding an additional connection will create a ground loop, which could result in high currents flowing through your shield, if it has a lower impedance back to the panel, than the PE line at a particular point in the building. The result will be your wire burning up, as it it won't be designed to carry the higher current, like the PE line is meant to.

In terms of the RS-485 that should still be okay, as the important thing is that the GND's are connected together, along the same path. What I would do is couple the DC ground to PE through a cap at both ends, and have the DC ground run over the shield.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

glitch wrote:
peter_smith wrote:

I'm not sure we can use the shield to connect all the GND of the modules', because the two end of the shield has to be connected to the PE.

What's the reasoning for running PE through the shield? This is normally NOT what you want to do, for safety reasons. (It may actually violate your local electrical code) The PE points are already connected together, via their common connection back at the breaker panel. Adding an additional connection will create a ground loop, which could result in high currents flowing through your shield, if it has a lower impedance back to the panel, than the PE line at a particular point in the building. The result will be your wire burning up, as it it won't be designed to carry the higher current, like the PE line is meant to.

In terms of the RS-485 that should still be okay, as the important thing is that the GND's are connected together, along the same path. What I would do is couple the DC ground to PE through a cap at both ends, and have the DC ground run over the shield.

There is no reason to run PE through the shield.
Usually we connect every shielded cable's shield (which cable go to actuators or sensors and used for transmitting analog signals) to the PE on one end. RS-485 standard says, that if the distance between the connection is longer than xxx meters, than both ends of the shield should be connected.

BUT if you say that the shield SHOULD NOT be connected to the PE at no ends (or at only one end), than I could use the shield to connect the modules GND together.

The reason why I don't understand this is that the purpose of the shield is to protect from noise coming from the environment, and connection to the PE is to target any coupled noise to the PE. Do I get wrong?

glitch wrote:

In terms of the RS-485 that should still be okay, as the important thing is that the GND's are connected together, along the same path. What I would do is couple the DC ground to PE through a cap at both ends, and have the DC ground run over the shield.

I don't understand why should the PE line coupled to the DC GND point of the PCB.
And do you mean "both ends" as the first and last device on the bus, or at both ends between all the neighbour devices?

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
Is the cable already run to every room, and you are trying to use it as it is? I'm not clear about the PE signal yet... the wire has rs485 +, -, gnd, and I suppose power comes from a wall wart somewhere, but whats the PE signal?

There is still no cabling. We are in the fortunate situation, that we are doing the complete cabling of the whole building.

The only problem with the cabling is the cost sensitivity of the HVAC project's this part. So we have to use as slight cable as possible.

The only thing that is ready now is the pipes for the cables in the walls and in the flooring.
And the flooring boxes for the relay panels of the fancoils.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Peter said,

Quote:
The only problem with the cabling is the cost sensitivity of the HVAC project's this part. So we have to use as slight cable as possible.

Age old problem. Never enough money to do it right the first time, but somehow money is always available to do it over.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you have an opportunity to make the whole building HVAC and energy management and security run off a single building network. Sounds like a job for ethernet... a mature inexpensive and reliable and well understood technology. Got to be some cost savings in just having one network for all that stuff. All the thermostats and fancoils would use a little avr ethernet controller.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
So you have an opportunity to make the whole building HVAC and energy management and security run off a single building network. Sounds like a job for ethernet... a mature inexpensive and reliable and well understood technology. Got to be some cost savings in just having one network for all that stuff. All the thermostats and fancoils would use a little avr ethernet controller.

All other devices use ethernet for communication, but those are National Instruments products. To develope an AVR device with ethernet is a bit more time-consuming stuff, than a device with a simple serial interface.
I never used ethernet with 8-bit AVR, only with AT32AP7000.

Currently we have no time to spend on development. The building has to be ready in about 3-4 weeks.

For the next generation of the board it may be implemented. It would be a lot easier to use the device later.

Thanks for the suggestion!

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could use a cots AVR board and a Digi/Lantronix Xport 10/100 ethernet to serial converter.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Instead of controlling the units through RS485, all the way from control room, you can divide them into groups either at floor level or at your convenience and each group is connected to the control center through a Ethernet to RS485 converter. You can place converter central to each group and connect it to the building network. Relives you the hassle of issues associated with RS485 communication over a wide area.

I am doing this way to collect data from BTU and energy meters and it never failed me so far.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobgardner wrote:
You could use a cots AVR board and a Digi/Lantronix Xport 10/100 ethernet to serial converter.

Xport is a good device but costs a lot....
The other thing is that I don!t have the time right now to experience with it.

simma wrote:

Instead of controlling the units through RS485, all the way from control room, you can divide them into groups either at floor level or at your convenience and each group is connected to the control center through a Ethernet to RS485 converter. You can place converter central to each group and connect it to the building network. Relives you the hassle of issues associated with RS485 communication over a wide area.

I am doing this way to collect data from BTU and energy meters and it never failed me so far.

Sounds fine! I think this will be made! One RS-485 bus for each of the floors, the same number of Ethernet to RS-485 converters and a simple Ethernet switch in the center.

Thank you!

Peter