Basics Of Industrial Instrumentation and Process Control.

This blog aims at providing the Aspiring Minds or Professionals to have answers to their questions relating Instrumentation and Process controls.All questions relating the topics would be answered. Bring it ON......

Saturday, 21 October 2017

All about Profibus....

Overview

PROFIBUS is an open, vendor-independent protocol that became part of the international standard IEC 61158 in 2000. Profibus or Process Field Bus is a standard within field bus communications in the automation industry. A network for industrial computers made to withstand high amounts of noise. The two wire Profibus cable makes different network topologies possible, like the star, the tree and the line or a combination.
Profibus comes in four variants, each with a different purpose:
  • PROFIBUS DP (Decentralized Peripherals) used to drive sensors and actuators via a central controller. Dataspeed up to 12 Mbit/s with twisted pair cables and fiber optic cables are an option.
  • PROFIBUS PA (Process Automation) is used to monitor measuring equipment via a process control system. This Profibus variant is ideal for use in explosive areas (Ex-zone 0 and 1). In the cables flows namely a weak current through the bus lines in an intrinsically safe circuit so that sparks do not occur, even at fault. The con. about this variant is the slow dataspeed at 31,25 kbit/s.
  • PROFIsafe used for safety applications, usually with safety PLC’s.
  • PROFIdrive used in motion control.
The standards for the Profibus networking are IEC 61158 (Field Busses) and IEC 61784-1 and -2 (previously EN 50170).

1. PROFIBUS

PROFIBUS extensions have always been developed to ensure backward compatibility. Figure 1 lists the extensions that have been standardized in the past few years.
Figure 1. PROFIBUS DP Extensions
PROFIBUS DPV0 is the foundation for PROFIBUS and was the first version after FMS (Field Message Specification). DPV0 came from optimizations to FMS, the original PROFIBUS protocol, to support fast I/O data exchange.
PROFIBUS DPV1 added extensions that allowed run-time reading/writing of parameters for more sophisticated devices such as intelligent drives, for example, and PROFIBUS PA field instruments, such as valve positioners, pressure transmitters, and so on.
PROFIBUS DPV2 primarily added extensions, so that you can perform motion control applications directly across PROFIBUS rather than requiring a secondary motion control bus.

2. Master/Slave Concept

PROFIBUS DP (Decentralized Peripherals) is a network that is made up of two types of devices connected to the bus: master devices and slave devices. It is a bidirectional network, meaning that one device, a master, sends a request to a slave, and the slave responds to that request. Thus, bus contention is not a problem because only one master can control the bus at any time, and a slave device must respond immediately to a request from a master.
Because a request from a master to a slave device is heard by all devices attached to the bus, some mechanism must exist for a slave device to recognize that a message is designated for it and then respond to the sender. Hence, each device on a PROFIBUS network must have an assigned address. For specifying the address, most devices have either rotary switches (decimal or hexadecimal) or DIP switches. A few devices require that their addresses be set across the bus using a configuration tool.
The PROFIBUS protocol supports addresses from 0 to 127. However, addresses 126 and 127 have special uses and may not be assigned to operational devices. Address 0 has become something of a default address that vendors assign to network configuration and/or programming tools attached to the bus.
Thus, the addresses you can use for operational devices are 1 to 125.


3. Device and System Startup

You specify which slave devices the master should find on the bus as well as which information should be transferred from the master to each slave during this startup phase. All of the information that the master must know to start up the bus comes from a configuration database file that is generated by a PROFIBUS configuration tool. Each vendor of PROFIBUS master devices offers a configuration tool for generating the database file for their masters. However, once you have learned how to apply any of these tools, it is generally quite easy to transfer this knowledge to another tool because all PROFIBUS configuration tools must share certain common functionality. A configuration tool for cyclic I/O operation must be able to do the following:
  • Process GSD (device description) files and maintain a hardware catalog of devices to be configured on the bus.
  • Allow the PROFIBUS device address to be specified.
  • Allow the specification of the input and output data to be transferred between master and slave.
  • Allow certain startup parameters to be selected to activate specific operating modes or features of the device.
  • Allow selection of the system baud rate.
  • Generate the database file so it can be used by the master.
At the same time a vendor develops a slave device, it must develop a device description (GSD) file. This file completely describes the PROFIBUS functionality of the device, such as baud rates supported, possible input/output data configurations, startup parameter choices, and so on.
You can typically download these GSD files via the Internet either from www.profibus.com or from an individual vendor’s Website. Once a user "installs" the GSD file for a device into the PROFIBUS configuration tool, it appears in the tool's hardware catalog, so it can be configured for bus operation.
The installation process varies for different configuration tools, but it is extremely simple. Once you have installed all of the appropriate GSD files in the configuration tool, you can define a bus configuration.  
First pick the appropriate master from the master device list in the hardware catalog and assign a PROFIBUS address. You repeat the following steps until the entire bus configuration has been described: select a slave device, assign the PROFIBUS address, specify the I/O to be exchanged, and select the appropriate parameters for the desired operation of the device. You then save this bus configuration and generate the configuration database. You can now load this configuration database into the master device.
After download, the master has the information necessary to start up all the devices in its configuration. This information is stored in retentive memory. The master must now determine if the devices at the assigned addresses contained within the configuration database are physically on the bus and initialize them for "operational" or "data exchange" mode. To get the devices into this mode, a PROFIBUS master undergoes a well-defined sequence of interactions with each of the slave devices in its bus configuration. For instance, if the master device experiences a power loss, when it powers back up, it uses the configuration database in retentive memory to go through the startup sequence with each device in its configuration to get all devices back into operational mode. If a slave device fails and must be replaced, the master recognizes that a replacement device of the same type and with the same PROFIBUS address has been attached to the bus. When it does, it goes through this same startup sequence and automatically brings the device into operational mode.

4. Cyclic I/O Data Exchange

After the bus system has been powered and initialized, the normal interaction between a master and each of its assigned slaves is to exchange I/O data. The master, a PXI PROFIBUS interface, for example, sends output data to a slave device in its configuration. The addressed slave immediately responds with its input data. This cyclic (repeated) I/O data exchange takes place asynchronously to the control logic scan and is repeated as quickly as possible. Data exchange takes place every cycle for every slave in a master's configuration. At the most commonly used baud rate of 1,500kbits/s, data exchange cycles are normally repeated many times during a single control logic scan.
Although 85 percent or more of PROFIBUS installations are single-master systems, multimaster systems work quite well, too. In such a system, each master is given control of the bus for a short time, and, during this time, it exchanges I/O data with each of its assigned slaves. It then passes control to the next master on the bus, via a short message called a "token," and that master exchanges I/O data with each of its slaves. Only the master holding the token is allowed to initiate communication to its slaves. When the last master in the "logical token ring" has gone through its data exchange cycle, it passes control back to the first master, and the overall operation starts again.

5. Device Diagnostic Reporting

The PROFIBUS protocol offers extensive diagnostic capabilities that device vendors can design into their products. PROFIBUS provides the capability to diagnose an operations problem all the way down to, for example, an overvoltage on an analog input or a broken wire on an output.
During a data exchange cycle, a PROFIBUS slave device can indicate to the master that it has detected a diagnostic condition. In the next data exchange cycle, the master fetches the diagnostic information from the slave. A device can report diagnostic information in four different formats: standard diagnostics, device-related diagnostics, module-related diagnostics, and channel-related diagnostics.
Any PROFIBUS master must save any diagnostic data from a slave for your control program to access it. The standard diagnostics (six bytes) that every slave device is required to report contain information that is generally related to startup problems. For example, if the I/O configuration that was set up in the configuration tool does not match what the slave expects, it reports a "configuration fault." If you have configured a slave device in your configuration file, but the slave actually found on the bus at that address is different, the device reports a "parameterization fault." The six standard diagnostic bytes are used to report faults that are common across all slave devices.
A vendor can use the device-related diagnostics format to report information that may be specific to the particular device or application area and that cannot be reported using the standard module-related or channel-related diagnostic formats. The format of this type of diagnostic information is defined by the vendor, and its detailed structure is not covered in the PROFIBUS standard. Therefore, you must check the device's documentation to determine the exact format. Module-related diagnostics are used to report diagnostics for a modular slave, which is a slave that consists of an "intelligent" head module plus plug-in modules. This format gives the head module the capability to report that a particular plug-in module has a diagnostic. It does not communicate what the diagnostic is – just that a particular module has a problem. The format for module-related diagnostic information is defined in the PROFIBUS standard.
The last type of diagnostic block is used to report channel-related diagnostics. A device can use this format to report that an individual channel of a specific module has a problem, for example, short circuit, wire break, overvoltage, and so on. This makes it very easy to diagnose the problem right down to the wire level. The format for this type of diagnostic information is also defined in the PROFIBUS standard.
Frequently Asked Questions

1. What is the PIN assignment of the DF PROFI II Sub D9 plug?

Pin
Signal
Function
1
---
Shielding
3
RxD/TxD-P
Data+ (input/output)
5
0V
Bus termination supply (input)
6
5V
Bus termination supply (output)
8
RxD/TxD-N
Data- (input/output)

2. What is the DF PROFI II LED configuration?

PXI and PCI PROFIBUS Interfaces
LED
State
Function
Green
OFF
Firmware not loaded
ON
Firmware successfully loaded
Yellow
OFF
PROFIBUS stopped
ON
PROFIBUS started
Red
OFF
NO Failure on PROFIBUS
ON
Failure on PROFIBUS


3. Why is termination important?

Termination prevents reflections that can disturb the data communication. The higher the baud rate and the longer the cable, the more important termination becomes. Termination should be activated/placed at both ends of every bus segment. With PROFIBUS DP, the termination is powered to provide an idle level when nobody is sending data.
You may be aware that termination has to be powered and placed at both ends of the cable, but you may not know that you have to place the termination again when you are using repeaters, OLMs (Optical Link Modules) or ProfiHubs. Every segment has to be terminated. This often slips in when you are using a lot of fiber-optic cable and there is only a short length of copper cable in the cabinets. But even this short cable has to be terminated at both ends.

4.   What are some basic tips for installing a PROFIBUS DP?

  • Always use PROFIBUS cable and connectors.
  • Do not exceed 32 devices per segment (including repeaters, OLMs, and couplers).
  • Make sure the segment length is in contrast with the baud rate.
  • Make sure every segment has powered termination on both ends.
  • Avoid spur lines.
  • Avoid swapping the wires (A=green, B=red).
  • Mark how long the cables really are and update the drawings.
  • After installation you should test your work:
  •   Are the addresses correctly set?
  •   No short circuit or break in the cable?
  •   Can you communicate with the devices?

5.    What is the minimum distance between two devices on PROFIBUS DP?

When the transmission speed is 1.5 Mbits/s or higher, it is highly recommended to have at least 1 m of cable between 2 devices. The cable compensates for the input capacitance of both devices to preserve the common impedance. When the devices are very close together, there is a large chance that reflections in the data communication (small short circuits) can be caused by the input capacitance. The effect is much less common at transmission speeds lower than 1.5 Mbits/s.

6.    How many DP slaves can I configure in a network?

Most people say 126, but this is NOT true. The total number of DP slaves that you can incorporate in a data exchange is 124 because the master uses an address and there are reserved addresses, 0 and 126 (these are blocked by the configuration tool).
Be careful:
  • Address 2 could also be blocked for slaves.
  • The master itself can have a limit.

7. How can I control the outputs of one slave with two masters (PLCs)?

This is not possible. Only one master has the right to control the outputs of each specific slave (safety feature). The second master can only READ the inputs/outputs.

The Profibus Cable: How To Make Your Own
Making Profibus cables is done with very little effort. The connections are fairly simple since the cable only has two wires and a shield. But you should be careful. Even though it may look simple, connecting the wires correct is not only important. No mistakes can be made here. Wrong connection will not break any of the components. But I can guarantee that the network will not function if the wires are connected wrong.
The Cable
For Profibus networks a shielded AWG 22 or 0.34 mm² twisted pair cable is used. The standard isolation color of a Profibus DP cable is purple, and the two wires in the twisted pair are usually green and red. But the colors of the cable are not important. At least not as important as the specifications of the Profibus cable. It is essential to use the right cables when installing a Profibus network, and to help you with that, the official Profibus organization has published a set of Profibus cable specifications:
  • Twisted pair with shielding braid.
  • Wire gauge: 0.34 mm² or AWG 22.
  • Resistance at max 110 Ω/km.
  • Capacity at least 30 pF per meter.
  • Impedance from 35 to 165 Ω at frequencies from 3 to 20 Mhz.
The Connectors
Usually, 9-pin D-sub connectors are used in the end of the cables to connect to the devices (recommended in EN 50170). The 9-pin D-sub connectors are the default Profibus connectors on most components. And personally, I have never seen any other connectors than the 9-pin D-sub and in rare cases the  Profibus M12 connector. Here is an overview of the 9 pins in a 9-pin D-sub connector:
9-pin D-sub connector male and female
Making your own Profibus cables are surprisingly easy. With just a few tools you can cut down the price of your Profibus cables with a significant amount, because pre-made Profibus cables are quite expensive. You can make your own Profibus cable in the exact length you need. But when you are making your own cables, you have to be aware of some important things, though.

1. Remove The Isolation With A Profibus Stripping Tool

The first thing to do is to remove the isolation of your Profibus cable. You can use a special Profibus stripping tool or if you are used to work with cables, you can use a knife or a wire cutter. The Profibus stripping tool is worth the money, because it will give you a sharp and perfect stripping of the Profibus cable needed for the connectors. It can be difficult to strip the cables correctly with a knife, so that both the shield and the two wires inside are visible.
PROFIBUS cable stripping tool

2. Connecting The Profibus Cable And Connectors

The next thing to do is to lay the Profibus cable in the Profibus connector so that the shield and the wires are connected correct. At this point we need to know what pins we need to use. As described before the connectors has 9 pins, but we will only be using some of them. Anyway, we can start by taking a look at how Profibus uses the different pins in the 9-pin D-sub connector:
Pin #
Function
Description
1
Shield
Shield and functional earth
2
NC
Not in use
3
RxD/TxD-P
Data recieve and transmit (positive)
4
CNTR-P
Control signal to repeater (positive)
5
DGND
Reference potential for +5 volt and data
6
VP
+5 volt for terminating resistors (active termination)
7
NC
Not in use
8
RxD/TxD-N
Data recieve and transmit (negative)
9
CNTR-N
Control signal to repeater (negative)
At first, this might look a bit confusing. It seems like the Profibus uses 7 out of 9 pins in the D-sub connectors. But how is that possible when the Profibus cable only has two wires and a shield?
The answer is that we do not always use all the pins. Not even all 7 pins. For most purposes we will only be using pin 3, 5, 6 and 8. So these are the four pins we will begin with.

2 Pins For Data Transmisstion

Pin 3 and pin 8 are used for the data transmission. This is where you will connect the green and the red wire. The green wire is usually the positive or channel A. So, when you are connecting the Profibus cable you should be connecting the green wire to pin 3. The red wire is considered the negative or channel B. Pin 8 is for the green wire.
You can connect the two wires the opposite way or use your own wire colors. As long as you use the same colors in each end of the cables and are consistent. Most Profibus connectors though has a green indicator for where channel A goes and a red indicator for where channel B goes. Using different colors or switching the green and red can cause a lot of confusion.

2 Pins For Active Termination

Then we have pin 5 and pin 6. They are used for termination. More on termination of the cables later.
Now, let’s have a look at the standard Profibus connectors. The ones made specially for Profibus. This is how they usually look like:
Profibus D-sub connectors for Profibus cable

In And Out Of Profibus Connectors

As you can see it is not only clear where channel A and B should be connected. Most of them have two connections for IN and two connections for OUT.
The OUT is where your network will start. When you are building your network topology you should always begin the network from the OUT or output of the first connector. The OUT is also where the network continues. If you have a station connected to the master in a network and you want the network connected to a new slave you should use OUT.
The IN or the input of the connector is where the “network line” ends. So except from the master, all cables should be connected to IN. When extending the “network line” you should use OUT. Here is how it should look:
PROFIBUS connectors and cabling IN and OUT
Connecting the Profibus cable to the connector should be done with extra caution. Remember, that it is very important not only to connect the wires correct, but also to connect the shield correct and even to strip the wire correct.
The next thing to consider is the termination of the cables.
Termination Of Profibus Cables
To minimize signal reflections the Profibus cable has to be terminated in the end. Signal reflection occurs when in a signal transmitted by a transmission media, such as copper cable or an optical fiber, some of the signal energy may be reflected back, instead of being passed all the way along the cable to the second end. Just like grounding this is such an issue that wrong termination of the Profibus cables will prevent the bus from working.
A Profibus termination is done by inserting a 220 Ω resistor in each end of the Profibus line. So, you insert a 220 Ω resistor in the first and one in the last station. The reason for using a 220 Ω resistor is that the two 220 Ω resistors are connected parallel to each other.  The parallel connection of the two resistors make a total resistance of 110 Ω. The loop resistance of the standard Profibus DP cable is 110 Ω/km. Be aware that a standard Profibus PA cable has a loop resistance of 44 Ω/km.
Most Profibus connectors has a termination option. This means that you don’t have to connect your own resistor manually. You can activate or deactivate termination in the connector by flipping the switch, usually placed at the top of the connector. This is useful in two ways. First of all it makes termination very easy, since you can make all your connections and then flip the switches where you need to terminate the Profibus cable. The second reason this is smart is that troubleshooting becomes easier. Without disconnecting anything you can check if the termination is done correct.
The most common errors when installing a bus network like Profibus is termination.
Active Termination In Bus Networks
Profibus uses an extended way of terminating called active termination. This is needed when you have very long communication cables. Active termination can be used to increase the line voltage of the bus.
The only difference between normal termination and active termination is that besides the 220 Ω resistor you also have to connect 5V to the termination (between VP(6) and DGND(5)). This will create a defined ground signal when non of the stations are active. You can make active terminations in three ways:
  • In the connector
  • In the station
  • With a seperate terminator
The reason we call this an active termination is that we use the +5 volt in the termination. Usually active termination happens when the termination switch on the connector is flipped. To make that more clear, let us take a look at a scheme for a Profibus connector:
Profibus cable active termination in connector
When the microswitch for termination is switched on the connection to pin 5 and 6 will be made. Now you have an active termination. If you want to read more about active termination or electrical termination you should read the article about voltage regulation on Wikipedia. Because active termination is a voltage regulator that makes sure that we have a constant voltage over the terminating resistor.

Profibus And Grounding

The connection of the shield is crucial to avoid noise. In fact your Profibus will not even work if you connect the shields incorrect. In addition to the shield, it is also important to connect all stations to ground. In machinery sold in the European Union the grounding wire has to be at least a 16 mm² wire. The simple reason for grounding is to make sure all the stations in out installations works (IEC 60204-1). Another reason is to avoid potential differences between stations in our installation. Normally we wouls use different power supplies in each station, and this alone can create a potential difference. If the shield is connected to two stations with a difference in their potential, a current will flow in the shield and that will make noise. No current should run in our shield and that is why we be absolutely sure that our ground connections are sufficient.

Profibus Adressing

Before powering on the Profibus network you have to assign an address to each of the stations. The addresses go from 0 til 125. You can set the address of a station in several ways depending on the specifications of the station:
  • Via a DIP-switch or digit wheel
  • Via. the display
  • In the software by using master class 2.
  • 1 or 3 (micro switch)
  • 1 or 2 (microswitch)
Stucture of the Profibus addresses (unwritten rules of addressing)
  1. Low addresses are reserved for Master Class 1 & 2 (addresses: 0,1,2) often default addresses.
  2. Do not use the addresses 124 & 125, since some slaves uses these as default addresses.
  3. The address 126 is reserved for service.
  4. New addresses are only in use after a reboot of the system (OFF/ON). This does not apply to addressing via. Master Class 2)!

What Is The Transmission Speed Or Baudrate In Profibus?

The baudrate or the transmission speed is the speed of the whole network. All the stations in a Profibus network has to run at the same transmission speed to be able to communicate. The default baudrate for your Profibus network is set in Master Class 1 and can be between 9.6kbit/s and 12Mbit/s. You may initially think that the faster the speed, the better. But this is not always true, since the speed of your Profibus will influence how long your cables can be. Some stations may even run a a maximum baudrate of 9.6kbit/s. This means that the used baudrate in your Profibus network can only be at maximum 9.6kbit/s.
The baudrate can be set in the following ways:
  • DIP-switch on the station
  • In a display
  • Autoselect
Faster transmission speed also shortens the lenght of your cables or segments. A segment is defined as the stations or devices between two Profibus repeaters. Profibus repeaters works by strengthening the signal, so you can expand the network. Up to 32 (31 and a repeater) stations can be in one segment. After 32 stations you would need another repeater to continue the bus line. One Profibus network can have a maximum of 126 stations.
When using repeater you have to terminate two times. You have to terminate the Profibus cable going into (IN) the repeater. But you also have to terminate at the beginning of the continuing Profibus cable going out of the repeater (OUT).

No comments:

Post a Comment

Powered by Blogger.