18
2/8/2016 1 PROFIBUS Profibus Profibus is world’s most successful fieldbus PROFIBUS DP (Decentralized Peripherals) Operate sensors and actuators via a centralized controller. Data rates up to 12 Mbit/s on twisted pair cables and/or fiber optics are possible.

profibus theory solution

Embed Size (px)

Citation preview

Page 1: profibus theory solution

2/8/2016

1

PROFIBUS

Profibus

• Profibus is world’s most successful fieldbus– PROFIBUS DP (Decentralized Peripherals)

• Operate sensors and actuators via a centralized controller.

• Data rates up to 12 Mbit/s on twisted pair cables and/or fiber optics arepossible.

Page 2: profibus theory solution

2/8/2016

2

WWW.PROFIBUS.COM

• Manufacturing Automation

Car manufacturing

Bottling systems

Storage systems

• Building Automation

Heating, air-conditioning

• Process Automation

Purification plants

Chemical and petrochemical plants

Paper and textile industries

• Power industry and power distribution

Power plants

Switchgear

Pipelines

Polymer Storage

GlueProduction

Breweries

Car manufacturing, at GeneralMotors, BMW, Ford, FIAT....

Waste Water Purification

Bottling Plants

Food Production

Nearly 1,000,000 applications are operational

Building Automation

Bus media access control

WWW.PROFIBUS.COM

Passive Devices (Slaves)

Active Devices (Masters)

PLCPLC PC

It uses deterministic MAC MethodCommunication Between Active <-> Passive devices: master-slave

PROFIBUS

Page 3: profibus theory solution

2/8/2016

3

Master Slave Method

• An active station (the master) controls the media access by– explicitly giving a timely limited transmission right to the other stations

(the slaves).

• This means that the slaves cannot access the bus bythemselves, but only if they receive a request from the master.

• Thus, cyclical polling with a predictable response time can beeasily implemented.

Token Passing Method• Coordination between the active stations (master devices) can be achieved

by– a token-message (special data frame) is passed on from one active station to the next

(in order of the ascending addresses).– The active station, which possesses the token at the moment, has the right to access

the bus and to communicate with passive stations (slaves) or with other activestations.

– When it has finished its communication tasks, it passes on the token to the nextstation.

• In order to guarantee that each station can send data in any case after amaximum period of time– It is necessary to set a maximum period of time during which the token must have

completely passed once through the logical ring.– For this purpose, the target rotation time TTR is set during the configuration of the

bus system.– When a station receives the token, it compares the target rotation time with the

measured real rotation time TRR.– The station is allowed to send messages as long as the target rotation time is not

exceeded.– In any case the station has the right to send one message with high priority.

Page 4: profibus theory solution

2/8/2016

4

Message passing

Algorithm

Structure of data frames and data services

• In order to increase the security of the transmission,– PROFIBUS uses the data representation of the UART standard, i.e. one

information byte is transmitted with 11 bit:

– ST: start bit (always logical “0”)

– 20- 27 : information- bytes

– P: parity bit

– SP: stop bit (always logical “1”)

Page 5: profibus theory solution

2/8/2016

5

Structure of data frames and data services

• 4 data frames are used in PROFIBUS

PROFIBUS Services

• Two services to transmit the data between master and slavedevices.– SDN service (Send Data with No acknowledge)

• The master can send data to the slave without waiting for a response

– The SRD service (Send and Request Data with reply)

• is used to request data from a slave

• The request frame can either contain data to be send to the slave or a dataframe without data field can be used if data should be polled only.

Page 6: profibus theory solution

2/8/2016

6

Bus length and baud rate:

• The maximum value of the permissible bus length of thePROFIBUS depends on the chosen baud rate:

baud rate [kbit/s] 9.6 – 93.75 500 1500 12000 max. bus length [m] 1200 400 200 100

Question: Profibus

• A Profibus system shall be used for communication in a baggage

transportation system of an airport. The system shall be centrally controlled

from a control room. Starting form the control room, the system is extended

500 m in one direction and 200 m into the other direction. 50 Industrial PCs

are connected to the Profibus. Each IPC controls a section of the baggage

transportation system. A 32 Byte long status message is to be transferred

from each IPC each 100 ms to the control room. The SRD service is to be

used.

• Estimate the bus load and explain whether the system willwork as desired or not.

Page 7: profibus theory solution

2/8/2016

7

Solution

• Bus length ca. 700 m

• Resulting maximum baud rate: 93,75 kBit/s (see exercises)

• SRD-service (Ignoring the processing time at the slave):– Request message: Telegram without data field: LReq = 6 Byte = 66 Bit

(UART Coding)

– Reply: 32 Byte: Using the telegram with variable data field length

– Telegram length: LRep = 32 Byte data + 9 Byte header = 41 Byte = 451Bit

– TSRD = (LReq + LRep) / baud rate = 517 Bit / 93,75 kBit/s = 0,0055 s

– Tmsg = 50 * TSRD > 100 ms

• The bus is overloaded.

Exercise

• An industrial packaging plant shall be automated. Your task is the engineering of the fieldbus

system. For this purpose a PROFIBUS shall be used. The packaging plant consists of eight

identically constructed packing cells. Two packing robots work in each cell. Each robot is

accomplishing a different packing step. Each robot has 4 actuators (drives) and 12 sensors for tool

guidance. Figure 1 shows the ground plan of the plant and contains data concerning the physical

extents. Your colleague already drew the planned layout of the PROFIBUS into the sketch of the

ground plan.

• The packaging plant is controlled from a central control room. Two PLCs and a PC-based

visualization station are located in the control room. Due to the high software license costs the

visualization station is not taken into operation at first.

• According to the manufacturer, the PLCs of the type DualAutomatus 5000 are very powerful.

Therefore only PLC1 is used for the automation of the plant

Page 8: profibus theory solution

2/8/2016

8

Bus Configuration

In the first step, the basic parameters of the bus system are to bedetermined.

Question 1.1

Estimate the length of the PROFIBUS. What is the maximumdata transmission rate? Justify your answer.

– Ans: The bus is longer than 400 m and shorter than 1200 m. Themaximum transmission rate is BR = 93.75 kbit/s.

Question 1.2

The maximum transmission time of a message on the bus shallnot exceed 30 ms independent of the used telegram format. Is thispossible with the previously determined maximum transmissionrate? Justify your answer.

Page 9: profibus theory solution

2/8/2016

9

Solution 1.2

• The worst case has to be assessed. The longest data frame isthe data frame with variable data field.The length of the data frame in bits can be calculated as follows: LT,max =(NData + NOverhead) · 11 Bit

= (246 + 9) · 11 Bit

= 2805 Bit

– The duratoin of the transmission is calculated as follows:

• TT,max = LT,max/BR=(2805/93750)s=29.92 ms <30ms

• The maximum transmission time is fulfilled for the data framewith variable data field length. Therefore it is fulfilled for allother data frames.

Message format In the second step, the PROFIBUS messages are to be specified in more detail. The data frameformats have to be specified.

The 16 robots are queried cyclically by the control. First, each robot is requested by means of a SRDservice message to send its sensor values. An answer of the robot, which contains the current sensorvalues, follows this inquiry. A sensor value can be coded by means of 11 bytes. The sensor values areprocessed by the control and afterwards the robots receive current control signals by means of a SDNservice message. For each drive, 2 bytes are needed for the control signal.

Question 1.3

a) Which data frame formats are applicable for the individual messages? Justify your answer.

b) Indicate the telegram length resulting in each case in bytes and bits.

Hint: Pay attention with the choice of the data frame formats in order to cause minimum bus load.

Question 1.4

a) Draw in a sequence diagram the course of the communication with a single robot.

b) Calculate for each message the required transmission time.

c) How long does the complete communication cycle with a single robot take?

Hint: In Question 1.4 neglect all times that are needed for processing of messages in the PLC and therobots.

Page 10: profibus theory solution

2/8/2016

10

Solution 1.3The selection of the correct data frame format depends on the amount of datato be transferred.

SRD-Service:

1. Transmission request, Control → Robot

It is a transmission request without data communication. Therefore the dataframe without data field is best suited.

LTSRD1 = 6 Bytes = 66 Bit

2. Transmission of sensor values, Robot → ControlEach robot has 12 sensors. For each sensor value 11 Bytes are required for coding. In total 132 Bytes arerequired. Therfore the data frame with variable data length is best suited for this message type.

LTSRD2 = (9 + 132) Byte

= (9 + 132) · 11 Bit

= 1551 Bit

3. Transmission of control signals, Control → Robot

Each robot has got 4 drives. For each drive 2 Bytes are required for coding thecontrol signal. In total 8 Bytes are required. Therefore the telegram with fixeddata length is best suited for this message.

LTSDN = (6 + 8) Byte = (6 + 8) · 11 Bit = 154 Bit

Solution 1.4

a)

Page 11: profibus theory solution

2/8/2016

11

Monomaster Operation

• At first, the cells are controlled by PLC1 in monomaster-operation mode.For the processing of each message, an overhead of LOR=300 bit times isneeded in each robot. The treatment of messages in the PLC requires anoverhead of LOC=100 bit times.

Question 1.5

a) Is it possible to hold the demanded maximum response time of Tmax=800ms in the monomaster operation mode?

b) What is the maximum possible slot time TSL? Evaluate the result.

Hint: The slot time is a defined time interval that the active station waits forthe response of the passive station. When this time interval is expired, thetransmission is considered to be failed and the message is sent again (at mosttwice).

Solution 1.5

Page 12: profibus theory solution

2/8/2016

12

Multi-master operation

After an initial test phase in the mono master operation, many malfunctions are

experienced in the operation of cells 7 and 8. An expert from the PLC supplier

is consulted. He states that overload situations occur in PLC1, which cause the

malfunctions. He recommends including the existing PLC2 into the controlling

of the packaging plant. As compensation for the additional expenditure, he

provides a modern visualization software for the visualization station. The

visualization station is likewise attached to the PROFIBUS.

Due to your experience, you decide to configure the systems in the control

room as active stations. PLC1 is to control cells 1 to 4 and PLC2 is to control

cells 5 to 8. Figure 2 shows the resulting bus topology.

Page 13: profibus theory solution

2/8/2016

13

The PLCs communicate with the visualization after one control cycle (4 cells). For thecommunication with the visualization computer, the SRD service is used. The messageshave a data length of 127 bytes and low priority. The receipt of the message isconfirmed by the visualization without data communication.

The communication with the robots takes place as before. Messages forcommunicating actuator values have high priority in relation to messages forcommunicating sensor values.

The time required for transmitting and managing the token in the active stations isassumed to be constant and equal to 0.5 ms.

Multi-master operation

Question 1.6

a) Describe in catchwords the handling of the token in the active stations.

b) On which parameters does the transmission of messages depend when an

active station possesses the token?

Question 1.7

a) On which criteria does the choice of the maximum token target rotation time

TTR depend? Consider the demanded response time of the system, as well as

the processing of messages when possessing the token.

b) The token target rotation time is set to TTR=500 ms. How do you rate this

value? Justify your answer by calculations!

Page 14: profibus theory solution

2/8/2016

14

Solution 1.6

Solution 1.7

a) The token target rotation time depends on the required response time of thesystem. In particular the response time to high priority messages plays animportant role. This messages are sent also after running off the token targetscan time.

b) The following consideration is done for estimating TTR:

The calculation of the complete communication cycle of the overallsystems requires the following times to be taken into account:

TPLC1 Time for the communication of PLC1 with cells 1 to 4

TVis1 Time for the communication between PLC1 and the visualisation(SRD-service)

TToken Time for transmitting the token-message (the token is transmitted 3times in each complete communication cycle)

TPLC2 Time for the communication of PLC2 with cells 5 to 8

TVis2 Time for the communication between PLC2 and the visualisation(=TVis1)

Page 15: profibus theory solution

2/8/2016

15

Conveyor Belt System Exercise 2

• A conveyor belt system (cf. Figure 1a) shall be automatedusing a PROFIBUS system. The topology of the bus system isrepresented in Figure 1b.

• The 8 slave devices are polled cyclically. The SRD (Send andRequest Data with reply) service is used to poll the slaves. Therequest frame as well as the response frame are data frameswith fixed data field length (8 bytes). The baud rate of the busis BR = 500 kbit/s. For simplification, the overhead formonitoring the bus and processing of the message by the slaveis modelled with a constant time of LO = 500 bit-times. Inorder to guarantee a precise and safe control of the system, amaximum reaction time of the system of Tmax = 50 ms isrequired.

Page 16: profibus theory solution

2/8/2016

16

Page 17: profibus theory solution

2/8/2016

17

Questions 2.1

a) Calculate the length of a single data frame in number of bytes and bits.How long does it take to completely process one SRD service operation?

b) Calculate the minimal bus-cycle time that is required to poll all slavedevices one time. Is the limit for the maximal reaction time (Tmax = 50ms) exceeded?

c) The master waits a given period of time (slot time TSL) for the response ofthe slave. When this period is expired, the transmission is considered to befailed and the message is sent again (at most twice). How must the slottime TSL be chosen to guarantee the reaction time Tmax even in the worstcase (worst case: transmission failed twice, correct transmission at thethird attempt)?

d) The conveyor belt shall be enlarged to a total length of 1000 m. Whichproblem arises concerning the bus system?

Mono Master Operation

Page 18: profibus theory solution

2/8/2016

18

Two control devices (masters) are connected to 2 or 3 I/O devices(slaves) respectively – as represented in Figure 2. The controldevices cyclically poll the I/O devices using the SRD service. Allmessages have high priority. The time to check, manage and passon the token is assumed to be constant and equal to TTok = 1 msper token transmission.

Give the resulting sequence of messages on the bus. Calculate thereal rotation time TRR of the token. (The time for one SRD-service operation is assumed to be TSRD = 1,6 ms).