ComputersEquipment

RS-485: connection and control

RS-485 is a standard that was first adopted by the Electronics Industry Association. To date, this standard addresses the electrical characteristics of all kinds of receivers and transmitters used in various balanced digital systems.

What is he like?

Among specialists, RS-485 is the name of a rather popular interface that is actively used in various industrial process control systems to connect multiple controllers, as well as many other devices among themselves. The main difference of this interface from no less common RS-232 is that it provides for the simultaneous combination of several types of equipment.

With the help of RS-485, high-speed information exchange is possible between several devices via a single two-wire communication line in half-duplex mode. It is widely used in modern industry in the process of forming an automated process control system.

Range and speed

With the help of this standard, broadcasting of information at a speed of up to 10 Mbps is achieved, while the maximum possible range will directly depend on the speed with which the data is broadcast. Thus, to ensure the maximum speed, data can be transmitted no further than 120 meters, while at a speed of 100 kbit / s the information is broadcasted by more than 1200 meters.

Number of devices to be connected

The number of devices that can combine the RS-485 interface will depend directly on which transceivers are used in the device. Each transmitter is designed for simultaneous control of 32 standard receivers, but it should be understood that there are receivers whose input impedance is 50%, 25% or even an even smaller fraction of the standard receiver, and if such equipment is used, the total number of devices will increase accordingly.

Connectors and Protocols

The RS-485 cable does not standardize any specific format of information frames or the protocol of exchange. In most cases, the same frames that use RS-232, i.e., data bits, stop and start bits, and the parity bit, if applicable, are used for data transmission .

The operation of the exchange protocols in most modern systems is carried out by the principle of "master-slave", that is, some device in the network is the leader and takes the initiative to exchange the sending of requests between all the slave devices that differ among themselves at logical addresses. The most popular protocol to date is Modbus RTU.

It should be noted that the RS-485 cable also does not have any specific type of connectors or wiring, that is, terminal connectors, DB9 and others can be found.

Connectivity

Most often with the use of this interface, there is a local network that combines several transceivers at the same time.

When connecting RS-485, it is necessary to combine the signal circuits, usually called A and B, with each other. In this case, the reverse polarity is not so terrible, simply connected devices will not work.

Helpful Tips

Using the RS-485 interface, you should consider several features of its operation:

  • The most optimal medium for signal transmission is a twisted-pair cable.
  • The ends of the cable must be damped by means of specialized terminal resistors.
  • A network using standard or USB RS-485 should be laid without any branching of the bus topology.
  • The devices must be connected to the cable with wires as short as possible.

In this case, the most optimal solution for laying the RS-485 interface is a twisted pair, since it has minimal parasitic radiation of the signal, and also has a very good protection against interference. If the equipment will work in conditions of excessive external interference, it is better to use cables with shielded twisted pair, while the shield of the cable is combined with a protective earth.

Harmonization

With the help of terminal resistors, standard or USB RS-485 provides full matching of the open end of the cable with the subsequent line, completely eliminating the possibility of reflection of the signal.

The nominal resistance of the resistors is equal to the wave impedance of the cable and for those cables that are based on the twisted pair, in the majority of cases it is approximately 100-120 ohms. For example, the rather popular UTP-5 cable, which is actively used in the process of Ethernet laying, has a resistance of 100 Ohm. For other cable options, some other rating may be used.

Resistors, if necessary, can be sealed at the terminals of the cable connectors already in the end devices. Rarely the resistors are installed in the device itself, so that the jumpers must be installed to connect the resistor. In this case, if the device is turned off, the line is completely mismatched. And in order to ensure the normal operation of the rest of the system, you need to connect a matching plug.

Signal levels

The RS-485 port uses a balanced data transmission scheme, that is, the voltage levels on the signal circuits A and B will change in antiphase.

The sensor should provide a signal level of 1.5 V at maximum load, and no more than 6 V in the event that the device is idling. The voltage level is measured differentially, each signal line relative to the other.

Where the receiver is located, the minimum level of the received signal in any case should be at a level of not less than 200 mV.

Bias

In the event that there is no signal on the signal circuits, there is a slight bias, which ensures the protection of the receiver from false alarms.

Experts recommend a displacement of slightly more than 200 mV, since this value is corresponding to the zone of unreliability of the input signal according to the standard. In this case, the chain A is pulled to the positive pole of the source, while the circuit B is pulled to the common.

Example

In accordance with the necessary displacement and voltage of the power supply, the calculation of the resistor values is carried out . For example, if you want to obtain a bias at 250 mV using terminal resistors R T = 120 Ohm, with the source having a voltage of 12 V. Considering that in this case the two resistors are connected in parallel to each other and do not take into account at all Load on the receiver side, the bias current is 0.0042 A, while the total resistance of the bias circuit is 2857 ohms. R cm in this case will be approximately 1400 Ohm, so you need to choose some closest denomination.

As an example, a 1.5 kΩ resistor intended for bias will be used, as well as an external 12 volt resistor. In addition, in our system there is a decoupled output of the power supply unit of the controller, which is the leading link in its segment of the circuit.

Of course, there are a lot of other variants of the bias implementation, in which the RS-485 converter and other elements are used, but in any case, when placing the bias circuits, it is necessary to take into account the fact that the node that will provide it will periodically turn off or even eventually Can be completely removed from the network.

If there is an offset, then the potential of chain A at idle is positive with respect to circuit B, which is a guideline if a new device is connected to the cable without marking the wires.

Incorrect wiring and distortion

Implementation of the above recommendations makes it possible to achieve the normal transmission of electrical signals to various points of the network, if the RS-485 protocol is used as the basis. If any of the requirements are not met, signal distortions will occur. The most noticeable distortions begin to appear when the data transfer rate exceeds 1 Mbit / s, but in fact, even in the case of lower speeds, it is highly recommended not to neglect these recommendations, even if the network "is working properly".

How to program?

In the process of programming various applications that work with devices that use an RS-485 splitter and other devices with this interface, several important points need to be considered. We list them:

  • Before the delivery of the parcel starts, you must activate the transmitter without fail. Despite the fact that according to certain sources, the issuance can be carried out immediately after inclusion, some experts recommend initially to withstand a pause, which in time will be equal to the rate of transmission of one frame. In this case, the correct reception program will have time to completely determine the errors of the transient process, will carry out the normalization procedure and will prepare for the subsequent reception of data.
  • After the last data byte is issued, it is also recommended to pause before disconnecting the RS-485 device. In particular, this is due to the fact that two registers are often present in the serial port controller, the first of which is a parallel input and is intended for receiving data, while the second is a shift output and is used for sequential output. Any interrupt transfers by the controller are generated when the input register is emptied when the information has already been provided to the shift register, but has not yet been issued. It is for this reason that after the broadcast is interrupted, it is necessary to sustain a certain pause before disconnecting the transmitter, which should be approximately 0.5 bit longer than the frame. For more accurate calculations it is recommended to study in detail the technical documentation of the serial port controller used.
  • Since the transmitter, receiver and, possibly, the RS-485 converter are connected to a single line, the own receiver will also perceive the transmission carried out by its own transmitter. Often happens when in systems characterized by random access to the line, this feature is used in the process of checking for the absence of a collision between two transmitters. In standard systems operating in accordance with the principle of "master-slave", it is recommended to completely close the interrupts from the receiver during the transmission.

Configuration of the "bus" format

This interface provides the ability to combine devices by the "bus" format, when all devices are combined with a single pair of wires. In this case, the communication line must necessarily be coordinated by the end resistors of the two ends.

To ensure matching, resistors with a characteristic impedance of 620 ohms are installed in this case. They are always set on the first and last device connected to the line. In the majority of modern devices there is also built-in matching resistance, which, if necessary, can be included in the line by installing a special jumper on the device board.

Since the jumpers are initially installed in the delivery state, you must first remove them from all devices, respectively, except the first and last, connected to the line. In converter-repeaters of model С2000-ПИ for each separate output, the matching resistance is switched on by means of a switch, while the С2000-КС devices as well as С2000-К are characterized by built-in matching impedance, as a result of which there is no jumper necessary for its connection.

In order to provide a longer communication line, it is recommended to use specialized repeater repeaters equipped with fully automatic transmission direction switching.

The configuration of the star format

Any branch in the RS-485 line is undesirable, because in this case a strong signal distortion appears, but from a practical point of view, they can be tolerated if there is a short branch length. In this case, it is not necessary to install termination resistors on separate branches.

In the RS-485 distribution system, which is controlled from the console, if the latter and the devices are connected to the same line but are powered from different sources, it will be necessary to combine the 0 V circuits of all devices and the console in order to equalize their potentials. If this requirement is not met, then the console may have unstable communication with the devices. If a cable with several twisted pairs of wires is used, then in the case of a potential equalization circuit, a completely free pair can be used if necessary. Among other things, it is also possible to use a shielded twisted pair in the event that there is no shield ground.

What do you need to consider?

In the majority of cases, the current that passes through the equipotential bonding wire is small enough, but in the event that 0 V devices or the power supplies themselves are connected to several local ground buses, the potential difference between the various 0 V circuits can be several units, And in some cases even tens of volts, while the current flowing through the equipotential bonding circuit can be quite significant. This is the frequent reason that there is an unstable connection between the console and the devices, so they can even fail.

For this reason, it is necessary to exclude the possibility of grounding the 0 V circuit or, as a maximum, to ground this circuit at some particular point. It is also necessary to take into account the possibility of a relationship between 0 V and the protective earth circuit present in the equipment used in the OPS system.

At sites for which a fairly heavy electromagnetic environment is typical, it is envisaged that this network can be connected via a shielded twisted pair cable. In this case, there may be a smaller limiting range, since the cable capacity is higher.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.