Vous êtes sur la page 1sur 196

Contents Introduction Overview of Blocks Application of Modular Control Using Fuzzy Control Description of the Function Blocks Technical

Data

Modular PID and Fuzzy Control


Manual
C79000-G8576-C901-02

Examples
Index

Remarks f=orm

Contenfs

Contents

l l 1.2 1.3 1.4


2

Introduction 1-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 Configuration list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 Modular control ...................................................... 1-1 Fuzzy control ........................................................1-3 Overview of Blocks

..........................................................

....................................................2-1
............................................ ...................................................

3 3.1 3.2 3.2.1 3.2.2 3.2.2.1 3.2.2.1.1 3.2.2.1.2 3.2.2.2 3.3 3.3.1 3.3.2 3.4 3.5 3.5.1 3.5.2
4

Application of Modular Control 3-1 Principle of modular control 3-1 System frame software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3 Tasks and structure 3-3 Data organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6 DB "ODAT" ........................ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Clock distribution 3-6 Basic data of the control loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7 DB "INTER" .........................................................3-11 Simplified system frame software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 Tasks and structure .................................................. 3-14 DB "INTER" - Organizational data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 Flags. times. counters. system data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 Terms used in modular control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-17 Restart modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 . Operator entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-18

..........................................
. . .

......................................................

4.1 4.2 4.3

Using Fuzzy Control 4-1 Principle of control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Call structure and data organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-3 Configuring with SIFLOC S5 4-5

....................................................

.............................................

Description of the Function Blocks 5-1 Organizational function blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1 FB 38/FB 39: Savelrestore flag area ("RETTENILADEN") . . . . . . . . . . . . . . . . . . . . 5-1 FB 63: Restart ("ANLAUF") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2 FB 69: Organization ("ORGAN1") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-3 FB 20: Restart Mini ("ANL-MINI") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4 FB 23: Organization Mini ("ORG-MINIn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 Control blocks 5-6 FB 14: Mathematical block ("MATHE") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 FB 61 : Filter element ("GLAETTEN") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 FB 62: PID controller ("PID-REGn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 FB 78: Analog input ("ANEI") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16 FB 79: Analog output ("ANAU") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20 FB 84: Single-input filter ("EINFGLAT") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-21 FB 95: High-speed analog input ("ANES") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23 FB 96: Setpoint adjuster ("SOSTELL") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-26 FB 98: Comparison point ("VERGLEI") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30 FB 99: Summing point ("ADDITION") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31 FB 104: Derivative-action element ("DIFF-GL") . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33 FB 111 Setpoint output for BCD displays ("BCD-AUSG") . . . . . . . . . . . . . . . . . . 5-35

.......................................

........................................................

Contents 1

FB 112: High-low value selection ("EXTRAUSW") ......................... FB 114: Limit monitor ("GRENZSIG") ................................... FB 115: One-out-of-two channel selector ("K-AUSW ") . . . . . . . . . . . . . . . . . . . .

FB 117: Polygon generator ("POLYGON") FB 118: Time scheduler ("ZEITPLAN") .................................. FB 119: High-speed analog output ("ANAS") ............................ FB 174: Dead band ("TORONE") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 176: PID controller ("IPD-REGn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 177: Pulse output ( " IMP-AUSG") .................................... FB 178: Coefficient element ( " KOEFFIZ") ............................... FB 179: Integral-action element ("I-GLIEDn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 188: Dead time element ("TOTZEIT") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 189: Time average ("ZEITMWTn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fuzzy blocks FB 113: Fuzzification ( " FUZ:FUZn) FB 116: Defuzzification ("FUZ:DFUZW)

...............................

........................................................ ..................................... ..................................

Technical Data 6-1 Programming data 6-1 Characteristics of some temperature sensors .............................. 6-4 Typical calculation of execution time and memory requirements . . . . . . . . . . . . . 6-11

........................................................
....................................................

Examples 7-1 Single-loop control with setpoint adjuster. PID controller and pulse output (3-level int operation) .................................. 7-1 Single-loop control with PID controller and pulse output (3-level proportional operation) 7-10 Multivariable control (burner control) .................................... 7-16 Control with PD component in forward branch and PD component in reverse branch 7-30 Status control with l component and reduced observer . . . . . . . . . . . . . . . . . . . . . 7-37 Using fuzzy control for adapting the gain of a PID controller . . . . . . . . . . . . . . . . . 7-46 Model of the controlled system ......................................... 7-46 Defining the control structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49 Membership functions and set of rules of the fuzzy controller . . . . . . . . . . . . . . . 7-50 Defining the parameters of the modular control blocks . . . . . . . . . . . . . . . . . . . . . 7-51 Defining interconnection structure and data storage system . . . . . . . . . . . . . . . . 7-52 Closed-loop controller blocks 7-52 7-57 System blocks Interface between closed-loop controller and controlled system . . . . . . . . . . . . . . 7-59 Data block parameter setting .......................................... 7-59 Controller blocks ..................................................... 7-59 Blocks for system simulation ........................................... 7-61 Call structure of restan and cyclic operation .simplified system frame 7-62 software ........................................................... Commissioning ...................................................... 7-63 Simulation results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-63

............................................................. .
........................................
.......................................

.......................................... .......................................................

Index

.............................................................8-1

Contents 2

1
1.1

Introduction
Overview

Fuzzy control is a supplement to conventional modular control. The standard function block "Modular PID and fuzzy control" contains the fuzzy control function and the previous "Modular control package" The original diskette contains the following files: REG155STS5D REG135ST.S5D REG115ST.S5D REGBSPST.S5D FUZBSPST.S5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R Modular PID and fuzzy control for CPUs 922*, 928* * " , 928B Modular PID and fuzzy control for CPU 945 Example of PID control for CPUs 9461947, 948 Example of fuzzy control for CPUs 9461947, 948

1.2
CPU

Configuration list
In PLC In S5-135U or S5-155U In SS-135U or S5-155U In S5-135U or S5-155U In S5-115U or SS-1 55U In S5-155U In S5-155U In S5-155H

CPU 922' CPU 928'* CPU 928B CPU 945 CPU 9461947 CPU 948 CPU 946R1947Rxa *

Except fuzzy blocks and simplified system frame software

'* Up to 6ES5 928-3UA11; except fuuy blocks and simplified system frame software

"*

H-related functions may not be used when FB 78 is used for reading analog values

1.3

Modular control

In many control tasks the classical PID controller is not the only prevailing process-controlling element, as much higher requirements are placed upon signal processing. Additional variables must frequently be taken into account to achieve optimization (feedforward control or adapted computation of reference variables, for example). In addition there is the requirement for combining binary and analog processing in order to influence the controller (by program-controlled parameter adaptation, for example) andtor the actuator. A set of standard function blocks is available to solve such complex and extensive tasks. Each function block stands for a specific function (such as closed-loop controller, setpoint adjuster, extreme value selection, dead time etc.). These function blocks may b e combined as required and can so be adapted to different user-related tasks.

Modular control Any control structure that has been set up with these standard function blocks only is a pure software control function. Consequently, setting up a closed-loop control circuit does not require specific modules to be employed. The link to the process is established via digital and analog input and output modules. The controllers that can be implemented with these SlMATlC S5 standard function blocks are always digital sampling controllers (DDC=direct digital control). A DDC controller is time-controlled; this means that it executes at equal time intervals (sampling interval TA). The sampling interval depends on the controlled system. The following is valid for the control algorithms used here: TA 5 112 time constant of the closed-loop control circuit

The system frame software of the closed-loop control function provides selectable sampling intervals from 0.1 seconds onwards. This permits controlled systems with a minimum time constant of 0.2 seconds to be handled. The system has been expanded by a new simplified system frame software that permits sampling intervals from 10 ms onwards. Consequently, modular control is used in process engineering (such as pressure, temperature, and fill level control) and in drive engineering. The control types that may be implemented include Fixed setpoint control Servo control Ratio control Cascaded control Adaptive control Substitutional control Observer structures The standard function blocks of modular control are provided in three different files. Blocks from these files may neither be mixed nor confused. Use the library number to decide whether you have loaded the correct function block. The library numbers of function blocks from the REG135ST.S5D file always begin with a '9' and contain the code letter 'A' or 'B' (example: P71200-S9014-A-1; P71200-S9038-B-1). The library numbers of function blocks from the REG155ST.S5D file always begin with a '6' and contain the code letter 'B' (example: P71200-S6038-B-1) or with a '9' and contain the code letter 'A' (example: P71200-S9078-A-2). The library numbers of function blocks from the REG115ST.S5D file always begin with a '3' and contain the code letter 'B' (example: P71200-S3014-B-1)

Fuzzy Control

The original diskette also contains the REGBSPST.S5D file that contains the typical application described in Chapter 7.1. The standard function blocks must additionally be loaded.
1.4

Fuuy control

Fuzzy control additionally contributes to the solution of complex control tasks. Conventional controllers (PID, state controllers, etc.) are not able to satisfactorily handle processes with a problematical mathematical description, whose theoretical model can either not be established at all or requires an excessive amount of time. Existing empirical knowledge of a plant operator that can be formulated as an IF-THEN rule permits a fuzzy controller to be set up for solving the problem. This is advantageous for non-linear or time-invariant processes, and in multi-variable control. A fuzzy controller may be used for replacing or enhancing conventional controller functions. The standard function package contains the blocks that are required for implementing fuzzy control. Fuzzification and defuzzification each employ a standard function block. This permits module configuration of the fuzzy controller to be performed. The modular control blocks can be used for interconnecting the inputs and outputs. The SIFLOC S5 tool is available for configuring fuzzy controllers. It permits user-friendly configuration, analysis, and operator communication and visualization functions to be performed. The standard function blocks are stored in the REG135ST.S5D, REG115ST.S5D, and REG155ST.S5D files. The REGBSPST.S5D file contains a typical application that shows the integration into the modular control system frame software (see Chapter 1. l ) . The standard function blocks must additionally be loaded.

Overview of Blocks

Overview of Blocks

K%k,
ADDITION ANAS

%%$er

Brief description
This function block contains three inputs which are multiplied by factors and then added. This function block allows the output of analo values to process via the foliowlng analog output modu%s:

99
119

8E28 8$8:1k811

ANAU

79

This function block allows the output of analog values to the process via the following analog input moduies: 6ES5 470-4U. 11 6ES5 475-.AA1 1 6ES5 476-.3AA12 This function block allows analog values to be read in from the process via the following analog lnput modules: 6ES5 46.-5AA.1 6ES5 46.-411.11 6ES5 465-3AA12 This function block allows analog values to be read in from the process via the following analog input moduies: 6ES5 243-1AA11 6ES5 243-1AB11 Organizational function block. R must be called in organization blocks OB 20. OB 21 and 06 22. Organization function block: It must be called in organization blocks OB 20. OB 21 and OB 22 (to be used with ORG-MINI). This function block assigns the setpoint to up to 4 digital dis lays BCD four-digit without sign via a 16-bit data bus outpuPword) +he sktpoint c& be adapted the physical unit for display by means of a physical programmable factor.

ANEl

78

ANES

95

ANLAUF ANL-MINI BCD-AUSG

63

20
111

40

DIFF-GL EINFGLAT EXTRAUSW FUZ:FUZ FUZ:DFUZ GLAETEN


113 116 61

This function block differentiates arbitrary input functions according to the trapezoid rule.

84

This function block filters arbitrary Input values. It acts as a lag element of the flrst order. This function block determines the rninlmum or maximum value from four input values. Fuuification of an input variable. Defuuification of an input variable. This function block filters arbitr input values. It acts as a iag element of the fvst order anyhas feedback capability. This functlon block checks an input value for four selectable limits. This function block converts the manipulated variable, output from a controller block to actuating pulses and then issues them to the process via binar); outputs. Controller block; this function block optionally operates with the PID positionin algorithm or the PID rate algorithm. The PID modular desi n. The components (P. I, D) controller is can be deactivated individuh. A new controller structure PD component in the feedback loop) is selectable. The function f,lock additionally has a disturbance variable input and a manual input.

GRENZSIG IMP-AUSG

114 177

IPD-REG

176

07

I-GLIED

179

This function block integrates a r b i t r y input functions according e to the trapezoid ~ l and has feedbac capability.

Overview of Blocks

Block

name
GLAETEN GRENZSlG IMP-AUSG

Block 61 114 177

number

Brief description This function block fllters arbltr input values. It acts as a lag element of the flrst order anyhas feedback capability. This function block checks an Input value for four selectable limits.

Thls function block converts the manipulated variable output from a controller block, to actuating pulses and then issue& them to the process via binary outputs. Controller block; this function block optionally o erates with the PID posttionln algorithm or the PlD rate algorit!rn. The PID controller is o? modular desl n. The components (P, I. D) can be deactivated lndividuafy. A new controller structure PD component in the feedback loop) Is selectable. The function lock addiiionally has a disturbance variable input and a manual input.

76

I-GLIED KOEFFIZ

79

This function block Integrates arbltr input functions according to the trapezoid rule and has f e e d b z capabillty. The input value of the function block is muRlplied by a selectable factor. The value obtained can be assigned an optlonal upper and or violations can be Indicated. lower lim~t, only l~mlt W ~ t h function block for '1-of-2 channel selection" one of the two input values can be applied to one of two outputs'as a function of two control signals. p r anizational function block: it writes the data saved by the R ~ T T E N "FB back to their original addresses. This function block contalns various mathematical functions, selectable via a functlon number. Organizational function block; R must be called with the lOOrns clock rate.
Organization function block; R can be called with the 100 rns clock rate.

178

K-AUSW LADEN MATHE ORGAN1 ORG-MINI PID-REG

115

39 14 69 23 62

Controller block; this function block re resents a PID controller of modular arran ement. The cornpone& (P, I, D) can be deactivated ln%ividually. A new controller structure (PD component in the feedback loop) is selectable. This functlon block can adapt an analog value via a characteristic (polygon function).

REmN

38
96

Organizational function block; flag words 200 to 254 are saved in a selectable data block. This functlon block serves t o convert a set oint step-change to a ramp functlon required for various actuagrs.
U to three dead times can be Implemented In a control loop wgh this functlon block. The dead times have a common input.

88

TOTZONE

174

A dead zone range can be lm lemented with this function block. As long as the lnput v&e of the block Is within this zone or band, the output value remans constant. This function block forms the difference between its two input values.

VERGLEl ZEITMWT ZEITPLAN 189 118

This function block forms the mean value from a number of values acquired at the time of sampling. Operatln curves can be generated and executed with this function %lock.

Principle of Modular Control

3
3.1

Application of Modular Control


Principle of modular control

The principle of modular control is to interconnect individual control functions to form a control loop or complex control structure. The user can thus adapt his control system to the task in question, and can implement functions which would not be possible with compact controllers.

Setpoint adjuster

Set
D

Analog input module

Actual

Controller

Man. var.
D

Analog output module

Figure 3-1 Simple control structure (control loop)

Every control function is implemented with a function block. Since they must communicate with each other, e.g. to transfer the setpoint, actual value or manipulated variable, there is a need for interfaces which must be defined during creation of the control system. With modular control, the interfaces are data words whose addresses must be entered as actual parameters during creation of the control system. Example:

JU
NAME: ANEl

FBnANEI"

Analog input module

Output

JU FB"PIDn NAME: RLG:PID

Controller

IST

:DD100

Actual value input

In addition to the transfer values between the blocks, there are parameters such as the controller parameters comprising gain, integration time constant and derivative-action time constant. These constitute the intedaces between the user and the control blocks. Since the user is free to choose the functions to be executed, the number and type of parameters are not known beforehand. Their addresses must therefore be defined by means of actual parameters when generating the control structures.

Principle of Modular Control Example: JU FBnPIDn NAME :PID-REG STEW :DW97 SOLL :DD98 IST :DD100 XA : DD102 OBXA : DD104 UBXA :DD106

Parameter Transfer value Transfer value Transfer value Parameter Parameter

Control byte Setpoint input Actual value input Output (value of manip. variable) Upper limit of XA Lower limit of XA

In addition to the transfer values and parameters, there are historical and internal arithmetic values of some function blocks, which are managed independently by the system, and organizational data. The latter include, in turn, the sampling intervals, the basic data of the individual control loops and purely internal housekeeping data. The arrangement of the various data in the data blocks is explained in Section 3.3.

Parameters

t
old ) values Setpoint adjuster

+t

S e
P

Parameters

t -

f
+
Controller

M a
i

Parameters

f
Analog output module

n-

Analog input module

A c t I

t
Old values Organizational

Figure 3-2

Simple control structure (control loop) with all the corresponding data

3.2

System frame software

In addition to the system frame software available up to now there is now a simplified system frame software available (cf. Section 3.3). 3.2.1 Tasks and structure

The main task of the system frame software is to call all control blocks according to their clock times, and provide them with the storage space required for the historical and internal values. The system frame software additionally informs the blocks of the programmable controller status (type of restart, cyclic operation). This information is needed for the initialization of various control functions. There are therefore two function blocks which carry out the tasks of the system frame software: FB 63 FB 69 ANLAUF(Restart) ORGAN1 must be invoked for all types of restart must be invoked in cyclic operation

The user is free to generate his control system by calling the control blocks and assigning parameters accordingly. In order to ensure smooth operation, however, certain declarations must be made. To implement a control structure, the standard function blocks are grouped in program blocks, called successively and assigned parameters. The program is therefore clearly arranged and can be tested in a modular manner. In industrial process or similar controlled systems, there is no need to measure the deviation at short intervals and input it to the controller for processing, because the controlled system cannot follow a rapid change in the manipulated variable. It is therefore sufficient to measure the deviation at greater intervals (= sampling interval) and process it further in the controller. However, there are also control functions which must be processed successively and as rapidly as possible to achieve sufficient accuracy. An example of this is pulse output. To allow sufficiently precise positioning of the actuator, the minimum pulse duration or control increment must be small. To meet the requirements of both types of control functions, the user must distribute the functions of his control loop over two program blocks: PB" 100ms" Program block processed at the 100ms clock rate; all function blocks to be processed at short intervals must be incorporated in it.

PBWAbtast" Program block processed at the sampling rate; all function blocks which must only be processed at the sampling times must be incorporated in it. The effectiveness of the programmable controller is additionally increased by splitting the program into a part which must be processed at the 1OOms rate, and a part which is processed at the sampling instants. Programs with short sampling intervals severely load the central processor of the programmable controller. For this reason, only functions requiring a short sampling interval are incorporated in the "1OOmsn PB, whilst all other functions are incorporated in the "Sampling" PB. This leaves the central processor sufficient time to process other tasks.

System Frame Software Example:


1)

Setpoint adjuster

Set
1)

Controller Analog input module


1)

Man. var.
D

Actual

Pulse output module

2)

Called In the "Sampling" PE Called In the "100 rns' PB Figure 3-3 Simple control structure (control loop)

Both program blocks must be generated by the user. The program block numbers are freely selectable between 0 and 255. For the system frame software, the result is the following program structure: A control loop comprises a "Sampling" PB and a "100ms" PB. Two or more control loops can be incorporated in an organizational frame (1,2,. .) All " 100ms" PBs are called at the 100ms rate and all "Sampling" PBs at the clock rate programmed for them. The user-defined DB "INTER" is then automatically valid in PB "sampling" and PB " 100rns".

. .

Note:

If user-specific data blocks are opened in the "100ms" or "Sampling7' PB, the corresponding DB "INTER" must be declared valid at the latest when the "Modular Control" standard function block call is reached.

,OB 20121122

/C JU FB "RESTART"

,FB "RESTARTn DB "INTER"

I-,

l PB "Sampling"

System Frame Software

\
,OB "100ms" JU FB "SAVE" "ORGANI"

C DB "INTER"

"SAVEn

-2

PB "Sam ling"

n
DB "ODAT"

c l
PB "Sam ling"

\
JU FB "RESTORE"

PB "Sampling" C DB "INTER"

FB "RESTORE"

D
DB "INTER"

Figure 3-4 System frame software: Calling structure

The user must program the function block calls for FB "RESTART" and FB "ORGANI". The JU FB "SAVEn and JU FB "RESTORE" calls (cf. 5.1 . l ) are only needed if other prograns can be interrupted by the time interrupt-driven control program. If the control program, in turn, is interrupted by interrupt-driven programs, the calls for saving and restoring the flags must also be included in them. In the various restart routines, some control blocks must run through initialization routines. FB "Restart" must therefore be included in the appropriate organization blocks. It calls all initialized program blocks with the control blocks and informs them of the type of restart. The time-driven part of the program must be called in an organization block which is processed by the operating system at the looms rate. FB "ORGANI" manages all organizational data and calls all "Sampling" and " 100ms" PBs.

System Frame Software All standard function blocks are only needed once in the programmable controller. The various control structures are created by the different interconnections (sequence of calls in the program blocks and data interfacing) and the various data blocks assigned to the control loops.

3.2.2

Data organization

All data needed by the program are located in two data blocks: DB "ODAT" and DB "INTER". DB "ODAT* contains purely organizational data. DB "INTER" contains organizational data as well as transfer values, parameters and historical values of the control blocks.
3.2.2.1
DB "ODAT"

DB "ODAT" comprises four parts. The first and fourth parts are reserved for the organizational function blocks. The user can program the various sampling intervals in the second part (clock distribution). All control loops to be processed must be assigned parameters in the third pan (basic data of the control loops). DBnODAT"
Data Description Housekeeping data (entered by the system) Clock distribution (to be assigned parameters by the user) DW29 DW255 DW256 DW n Basic data of the control loops (to be assigned parameters by the user) Housekeeping data (entered by the system)

3.2.2.1 .l Clock distribution

The system frame software can manage up to eight freely selectable sampling intervals. They must merely be multiples of 100 ms, with a maximum of 3276.7s. The system frame software internally creates for each sampling interval a timer which is incremented with each program run until it reaches the value of the sampling interval. DB"ODATn
Data DD13 DD15 DD17 DD19 DD21 DD23 DD25 2 7 Format Description

I
I

KG KG

I
I

Sampling interval 1 Sampling interval 2 Sampling interval 3 Sampling interval 4 Sampling interval 5 Sampling interval 6

CSJ

cs~
C S ~
CSI CSI
CSJ

KG
KG KG KG

1-

KG KG

Sampling Interval 7 Sampling interval 8

cs~ cs~

System Frame Software The user can generate his own optimum clock distribution system by entering the desired sampling intervals in a closed sequence from DD13 to DD27. The greatest time desired must normally be entered as sampling interval 1 (DD13) (see 4.1.2); otherwise the sequence is arbitrary. If all eight sampling intervals are not required, KG 0 should be entered after the last valid sampling interval for runtime reasons. Example:
Format
Description

DD15 DD17

+8000000+01

KG

+4000000+01

CS]

3.2.2.1.2

Basic data of the control loops

The basic data of a control loop are the Number of the "Sampling" PB
a

Number of the " 100 ms" PB Clock number Shift time Number of the "INTER" DB

Up to 75 control loops can be programmed. If more control loops are needed, an additional system frame must be generated. Clock number and shift time: The sampling intervals are numbered from 1 to 8. One of these sampling intervals can be assigned to each control loop by means of the clock number. Each control loop can thus be adapted to the corresponding process. The entire control system (all control loops) is adapted to the programmable controller by means of the shift times, i.e. an attempt is made to achieve optimum time loading of the CPU. The shift time indicates the value of the selected timer at which PB "Sampling" is to be called (unit for timers: 1OOms) .

System Frame Software


Example:

Two control loops have been programmed. Both operate with a 0.2s sampling interval and shift time of 0. This means that the maximum program runtime is given by the runtimes for the system frame software (FB 69), PB " 100ms" of the first control loop, PB "Sampling" of the first control loop PB " 100ms" of the second control loop and PB "Sampling" of the second control loop. If shift time 0 is selected for control loop 1 and shift time 1 for control loop 2, PB "Sampling" of control loop 1 continues to be called when the timer contains the value 0. PB "Sampling" of control loop 2, however, is called when the timer has the value 1 (i.e. 100 ms later). The maximum program runtime is given by the following runtimes: Runtime for the system frame software (FB 69) Runtime for PB " 100ms" of the first control loop Runtime for PB " 1OOmsn of the second control loop Runtime of either PB "Samplingn 1 or PB "Sampling" 2 In the second case, the PB "Sampling" 1 and PB "Sampling" 2 program blocks are alternately processed by the CPU. Thus only the runtime of one PB "Sampling" is taken into account in the calculation, i.e. the maximum program runtime becomes considerably shorter (most control blocks can or must be incorporated in PB "Sampling "). The purpose of the clock distribution is to process the least possible number (1 is the optimum) of "Sampling" PBs during one run of the 1OOms basic clock. This can only be ensured if all programmed sampling times meet the following condition: TAm = TArnin n where m = 1 ...8 n=1,2,4,8,..

System Frame Software In the following example, five control loops are programmed in various cycles (blank boxes: possible calling times; filled boxes: calling times used):

TVE R=4

0.5

1.5

2.0

dsf

Number of the "INTER" DB


A DB "INTER" must be assigned to each control loop. The rule is as follows: Two or more independent control loops may have a common DB "INTER" or different ones. If, however, control loops are interconnected to form a control structure, a common DB "INTER" must be assigned to them.

System Frame Software The following table shows the arrangement of basic data of the control loops in DB "ODAT"

DB "ODAT"
Data DW29 DW30 DW31

I Left data byte


KF

Description
I

Right data byte

Address of last control loop Shift time for Initialization PB"100rns" 1 Clock number for initialization PB"Samplingn 1

KY
KY

DW32

I DW33 I DW35 I DW36

1 I I I I

KY

Shift time DB'INTER'

KY

I
I I

1 I 1 I

Clock number Input bit (Bit 0)

1 I I
(

KY

Shift time DB'INTER"

Clock number Input bit (Bit 0)

KY

I DW38 I
I DW39
DW253 DW254 DW255 Figure 3-5

KY KY

I
I

S h i i time DB"INTERW

I
I

Clock number Input bit (Bit 0)

KY
KY KY

PB" 100msW 75 Shift time DB'INTER'

PB" Sampling" 75 Clock number Input bit (Bit 0)

Basic data of control loops in DB 'ODAT"

Initialization: The sampling interval and shift time of a control loop can be changed during operation zs follows: Enter the new clock number and shift time in DW 30
m Set

the input bit (bit 0) in the relevant control loop

The system then transfers the data from DW 30 to the basic data of the control loop and provides the control blocks programmed in it with the initialization information. In general, the control loops accept their parameters again, including the sampling interval (the precise reactions of individual blocks can be found in the corresponding subsections of Section 5). The initialization entry in the basic data of the control loop is reset by the system.

Address of the last control loop:


The basic data of the control loops must be entered successively in DB "ODAT" from DW 31 onward. The number of the data word containing the program block numbers for the last control loop must be entered in DW 29.

System Frame Software


Length of DB "ODAT":

Ensure that DB "ODATn is available in sufficient length. The rule is as follows: Length of DBnODAT" = 256

+ 2 . number

of control loops (without preheader)

3.2.2.2

DB "INTER"

DB "INTER" can be subdivided into three data areas. The first part is reserved for organizational data. The user must implement the interconnection and parameter assignments of the control blocks in the second part. The control blocks store their previous values and auxiliary data in the third part.

Data

I
I

Format

Description

I
1

organizational data (entered by the system)

IDW16

KF

Starting address of previous values (= n+l ) fto be entered bv the user)

n: m: Figure 3-6

Defined by user by Interconnecting the blocks Depends on control blocks used

Structure of DB "INTER'

Organizational data:

This area is used by the system for interchanging organizational data. It must not be written to by the user.
Interfaces and parameters:

The user is entirely responsible for this data area. He must implement the interconnection of the control blocks and their parameter assignment here. The user himself defines the assignments of this area by presetting the actual operands with the control block calls.

Example:

JU FB "PID" NAME :RLG:PID STEW :DW23 SOLL :DD24 IST :DD26 XA : DD28 OBXA : DD30 UBXA : DD32

Control word Setpoint input Actual value input Output (value of man. var.) HIGH limit of XA LOW limit of XA

DB "INTER"
Data D O W Organizational data (entered by the system) DWl S DW16 DD17 Format Description

KF KG

Starting address of previous values (n+l) +0000000+00

DD21 DW23

KG KM

Scratchpad word for unused outputs Control word

DD24

KG

I
I

Setpoint input Actual value input

DD28 DD30

KG KG

Output

HIGH limit of XA

DD32

KG

LOW limit of XA

Experience has shown that it is often advantageous to assign data words DW 17 to D 22 as shown. W In this way, 0 or 1 can be preset for inputs or parameters (e.g. with the summing element or mathematical block) without reserving a memory location each time. The length of the area for interfaces and parameters is determined by the number and type of interconnections of control blocks. It ends at the latest, however, with DW 255. If the control loops in a programmable controller require more storage space for interfaces and parameters, an attempt must be made to relocate some of them to a second system frame.

System Frame Software Starting address of historical values: The number of the first data word which does not pertain to the area for interfaces and parameters must be entered (256 maximum). Historical values and auxiliary data: This area is reserved for the control blocks. It is managed independently by them and FB 69. It may be located, either partly or fully, above the limit for DW 255. Length of DBMINTER": The length of DB "INTER" is determined by the size of the interface and parameter area and by the number of historical values of the control blocks. The sum of the historical values can be determined by means of Table 1 in the "Technical Data" section. Example:

SOSTELL

Setpoint PID-REG Actual


D

Man. var.
D

ANAU

ANEI

Number of old values (155U PC) Setpoint adjusters Analog inputs PID controllers Analog outputs Total Note: Data which is evaluated in each cycle and recalculated is stored in both DB "ODAT" and DB "INTER" (e.g. timers in DB "ODAT" and previous values in DB "INTER"). When presetting new parameters during operation, therefore, make sure that only the memory locations reserved for the purpose are written to. With AG 155 H it should be noted that only data blocks can be loaded in the CPU which have been entered with the aid of the COM 155 H in the planning data block DX 1, i.e. released (cf. Manual for Programmer Unit Software COM 155H, Cap. 3.2 Transfer data). 10 12 0

22

Simplified System Frame Software

3.3

Simplified system frame software

3.3.1 Tasks and structure The simplified system frame can be used if only a few closed-loop control circuits are to be created. Integration is not restricted to the 100-ms level. Sampling intervals as short as 1 ms (CPU 945) for high-speed control processes can be achieved. The simplified system frame software consists of the standard function blocks "ANL-MINI" and " ORG-MINI " . The simplified system frame software has the following program structure: OB 20121122 (AG 135U, 155U) OB 21/22 (CPU 945) FB " ANL-MINI "
PB "Sampling"

DB "INTER"

OB 10...18 (AG 135U, 155U) OB 10


SPA

1
FB "ORG-MINI" PB "ABTAST"

...13 (CPU 945)

Fig. 3-7 Simplified system frame software; call structure

I
FB 'ANL-MINI"

Each call of the "ORG-MINI" function block permits only one control loop to be processed. The clock rate of the organization block that contains the "ORG-MINI" function block is used for calling the control loop. The function block calls are no longer subdivided into a fast cycle and a sampling cycle.

1 Time 0 8

Selected sampling intervals in seconds1

Sampling intervals of the individual organization blocks with fixed clock cycles (CPU 928, 9288)

Simplified System Frame Software Apart from the following points, handling is the same as in the conventional system frame software:
8

The "RESTART" and "ORGANI" function blocks are replaced with the "ANL-MINI" and "ORG-MINI" function blocks. Each call of the "ORG-MINIn function block permits only one control loop to be implemented. "Sampling" is the only program block. It is used for calling the individual function blocks.

The sampling interval TA is entered in the "ANL-MINI" startup function block. It corresponds to the clock rate of the time-controlled organization block that contains the call of the "ORG-MINI" function block. You must enter the new sampling interval (20 S) in the "ANL-MINI" startup function block if you wish to set the sampling interval parameter to a multiple of these base cycles (e.g. 20 seconds). A reduction (factor 4) must additionally be programmed in the time-controlled organization block (OB 18, 5 s in CPUs 928, 928B). The "ODAT" data block no longer exists. The simplified system frame software cannot be used for processing blocks that may only be called in the "100 ms" program block. These blocks include:

- IMP-AUSG

- SOSTELL in 100 ms mode - ZEITPLAN


3.3.2 DB "INTER"

- Organizational data

System frame software and control blocks jointly use the area of organizational data for exchanging global data. The control blocks store their internal data in the area of the history and auxiliary variables. The system frame administers this data. The user may not write data to these areas. In order to provide better understanding of the simplified system frame software's method of operation, the system areas of the "INTER" data block will also be discussed here.
8

DWO-DW4: Global data of some standard function blocks In conjunction with the standard function blocks, the DWO through DW4 data words do not have a task allocated. Some standard function blocks, however, use these data words for storing 'global' information.
DW5: Old value offset for the "Sampling" program block The offset points to the point in the "Sampling" program block where the old values begin in the "INTERn data block.

Simplified System Frame Software DW6: Old value offset for the "100 ms" program block The offset points to the point in the "100 ms" program block where the old values begin in the "INTER" data block. DW7: Number of the "ODAT" data block DW8: Number of the "INTER" data block DW9: Number of the "100 ms" program block DD10: Sampling interval Specify sampling interval in floating point format and seconds.
m DW12: Startup type, PLC ID, operator input

D12.0: Operator input bit The operator input bit is set in all time-dependent blocks after the sampling interval has been altered. D12.3: Sampling flag The sampling flag is only set after the "Sampling" program block has been called. D12.6, 7: PLC ID

D12.6, 7: D12.6, 7: D12.6, 7:

0.1 1 .O
X, X

CPU 922 = 1 CPU 928 = 2 33-155, CPU 945 = any

D12.8: Cold restart bit D12.8 = 1 upon a cold restart; otherwise it is 0. D12.9: Manual restart The D12.9 data bit must be set to 1 if a manual restart is performed. D12.10: Restart after a power failure The D12.9 data bit must be set to 1 if a restart is performed after a power failure. DW13 (SS-135U), DD13 (SS-155U, CPU 945): Address of the "INTER" data block The "ORGANI" function block updates the address of the "INTER" data block. DW15: History value offset The individual function blocks increase the offset by the required memory area, and enter the current offset in DW 15. The subsequent block encounters the correct offset of its history values. DWn+l-DW1: History values and auxiliary variables for function blocks from the "Sampling" program block DWI+l-DWm: History values and auxiliary variables for function blocks from the "100 ms" program block

Flags, Times, Counters, System Data Organizational data

Data item DWO DW4 DW5 DW6

Name Global data of some standard function blocks Old value offset for "Sampling" PB (n+l) Old value offset for "100 ms" (n+l)

I I I I I

DW7 DW8 DW9 DW10 DW12 DW* 13 DW14 DW15

I 1 I 1 1

Number of the "ODAT" DB Number of the "INTER" DB Number of the "100 ms" P B Sampling interval Restart type, PLC ID, operator input Address of the "INTER" DB Offset of history values

I I I I 1

DWn+l

History values and auxiliary variables for FBs from the "Sampling" PB History values and auxiliary variables for FBs from the " 100 ms" PB

n: Userdefined by block interconnection I, m: Depends on the control blocks used

Figure 3-8 Organlzatlonal data I the 'INTER' data block n

3.4 Flags, times, counters, system data The standard function blocks utilize the flag area from F 200 to FW 254. If the user also wishes to W use this area in the cyclic user program, he must save the data of this flag area at the stan of the control program (FB "SAVE") and restore them at the end (FB "RESTORE"). The contents of the flag area (FW 200 to FW254) must also be saved in interrupt-driven programs. Timers and counters are not reserved. System data word RS 60 and RS 61 is used in the CPU 922 (R processor) and CPU 92819288. if the program is interrupted at a statement boundary and this location is used, its contents must be saved and written back in again at the end.

3.5 Terms used in modular control For a better understanding of the following chapter, a number of terms used in modular control are explained overleaf.

Terms Used In Modular Control

3.5.1

Restart modes

The modular control is in the warm restart mode when the operating system of the programmable controller (CPU) processes organization blocks 0820, 0821 or OB22 and the FB "Restart" invoked in these OBs is executed. The control is in the cold restart mode when the programmable controller (CPU) processes 0820 (OB 21 with programmable controller CPU 945), i.e. a cold restart mode is equivalent to the term.

3.5.2

Operator entry

The user can choose between two different operator entry modes:

Setting the operator entry (operator entry bit 0 in DB "ODAT", see pp. 3-9, 3-10). Not only are the clock number and shift time updated, but also all variables of all standard function blocks in the control loop whose values are transferred with SBED=l. An operator entry is therefore valid loopwide.

- Local operator entry via SBED.


Only the variables of one standard function block are transferred. The user can decide whether this is to take place dynamically, i.e. always, or adaptively, i.e. pulse-edge triggered. The user must program the latter himself.

Principle of Control

4
4.1

Using Fuzzy Control


Principle of control

First of all, the analog input signals must be converted into linguistic values. A linguistic value is a colloquial variable (such as 'small', 'large', 'hot', 'cold', etc.). Covering the entire range of an input signal usually requires several linguistic values whose validity ranges typically overlap. The number of values depends on the application. Possible are, for example: icy, cold, cool, tepid, warm, hot; or low, medium, high. Converting the input variable into several linguistic values is known as fuzzification. A 'degree of membership' between 0.0 and 1 .O is used internally to show how much an input variable corresponds to a linguistic value. The degree of membership is 0.0 if the current input variable cannot be allocated to the linguistic value at all. An input variable that fully corresponds to the linguistic value obtains the degree of membership of 1.0. Any intermediate value is possible. Conversion is performed by 'membership functions'. Each linguistic value requires a membership function. Typically, the membership functions are in the shape of a trapezoid (see Fig. 4.1). Degree of membership

l Input Px4 X
Figure 4.1 General membership function

The trapezoid is defined by its four corners PI, P2, P3, and P4. The Y coordinates of these points are fixed: P l y = 0.0; P2y = 1 .o; P3y = 1 .o;

P4y = 0.0;

Only the X coordinates can consequently alter the shape of the trapezoid. The following restrictions applies to the X coordinates: Plx c= P2x c= P3x <= P4x;

Special trapezoid shapes are produced (see Fig. 4.2) if X coordinates have the same value.

'

P l x = P2x <= P3x <= P4x

Plx = P2x = P3x <= P4x

P l x = P2x <= P3x = P4x

Plx

<= P2x = P3x <= P4x

Figure 4.2 Special shapes of membership functions

The degrees of membership are combined in a 'set of rules'. Like in binary logic, practical IF-THEN rules are formed by AND, OR, and NOT functions. The AND function corresponds to the minimum value function; the ORfunction to the maximum value function; and the NOT function results from the formula NOT (true) = 1.0 - true.

A defuzzification stage converts the result of the set of rules (again membership degrees) into an analog value. Defuzzification is also performed by conversion via membership functions. Each output variable of the set of rules requires a membership function to exist. A subarea is produced in the membership function that depends on the size of the degree of membership. In the MAX-MIN inference method, this subarea is again in the shape of a trapezoid. This produces two new corner points with the X coordinates X2 and X3 (see Fig. 4.3).

true -- --

Pxl

X2

Px2

Px3

Figure 4.3 Subarea of the trapezoid

Each output variable of the set of rules yields a subarea. The subareas of all membership functions of an output variable are grouped together. To produce the output signal, the system calculates the center of gravity of the total area. The X coordinate of the center of gravity indicates the output signal value (see Figure 4.4).
.

I -

Output signal correcting range

I
4.2

Area center of gravity = current output variable

Figure 4.4 Area center of gravity

Call structure and data organization

An "Sampling" program block combines the function block calls of each control loop. The fuzzy application block FUZ:APP is also called here. The data for the fuzzy inputs and outputs must be transferred before and after the call. For example: :L DD "Data double word inside "INTER" DB" :A DB.. :T DD 1 Input 1

...
:L DD "Data double word inside "INTER" DB" :A DB.. :T DD 1 Input n :SPA FB.. NAME :FUZ:APP :A DB.. :L DD 4 Output 1 :A DB Number of "INTER" DB :T DD "Data double word inside "INTER" DB"

...
:A :L :A :T DB.. DD 4 Output n DB Number of "INTERn DB DD "Data double word inside "INTER" DB"

The user defines the block number

Call Structure a n d Data Oruanization

T h e fuzzy application block may also b e called outside t h e program block. It is not tied to a system frame. Within the FUZ:APP fuzzy application block, the FBI 1 3 FUZ:FUZ.standard function block is called for each input variable. The set of rules i executed by a user-related FUZ:RULE function block. The s FBI 16 FUZ:DFUZ standard function block is called for each output variable (see Fig. 4.5).

FUZ:APP
Input variable l

FBxx

NW7
m m m

DBxx

DBxx W1
BIIG I' FFUZ:DFUZ

-AND

-variable

OR
. i
.I

xx: the user d e f i n e s the block number


Figure 4-5 Modular block concept of the fuzzy controller

All fuzzy control data items and parameters are stored in data blocks. A data block of sufficient length must b e created for each FUZ:FUZ and FUZ:DFUZ call (see Chapter 5.3). An additional data block for storing internal data of the s e t of rules is created when the FUZ:RULE function block is generated via the SIFLOC S5 fuzzy parameter assigning software.

Confiaurina with SlFLOC S5


4.3

Configuring with SIFLOC S5

The SIFLOC S5 program is used for parameter assigning, analyzing, and enabling operator communication and visualization of a fuzzy controller. Graphic input of membership functions and a table-oriented editor that permits textual input of the rules are only two examples of a host of SIFLOC S5 benefits. The following items are generated automatically: Fuzzy application block FUZ:APP Fuzzy set-of-rules block FUZ:RULE and the associated data block All data blocks required for fuzzification and defuzzification Downloading blocks into the programmable controller in on line mode is possible.

Organizational Funcfion Blocks

5
5.1 5.1.1

Description of t h e Function Blocks


Organizational function blocks FB 381FB 39: Savelrestore flag area ("RETTENILADEN")

If a cyclic program is interrupted by the time-driven control program, there is a risk that data of the cyclic user program stored in the "scratchpad flag area" (FW 200 to FW 254) may be overwritten. FB "SAVE" saves the data of this memory area by transferring it to data words. It must be called at the beginning of the control program and therefore saves the data of the cyclic program. FB 39 must be called at the end of the time-driven program section. It restores the saved data in the scratchpad flag area. Function blocks FB 38 and FB 39 must always be used in pairs and must be programmed with the same data block.
CPU 948, CPU 9461947, CPU 946R1947R:

The function blocks can be called at a maximum of 16 different interrupt levels; they save the scratchpad area in a stack (parameter assignment data block). This means that these function blocks must also be assigned parameters in various interrupt levels with the same data block. The data block must have a length of 817 data words (without preheader); (DW 0 to DW 81 6). In the event of an error, the CPU enters the STOP mode. The following are possible errors (error numbers in accumulator 1): F001 F002 F003 DB SavelRestore not available

2 2

Flag stack overflow DB SaveJRestore too short

The following actions are possible: F001: Transfer D0 SaveIRestore to the programmable controller F002: Always use FB 38/39 in pairs. FB 38 and FB 39 must be called at the beginning and end, respectively, of the interrupting OB. The 0B must not be previously terminated with BEC. F003: Load DB SaveIRestore with a length of 817.
CPU 945, CPU 928B, CPU 928, loop processor (CPU 922):

The blocks for these units have the same tasks as those described above. There is, however, a significant difference. Although the blocks for the AG 155U always save the contents of the scratchpad flag area in the same data block, even at different interrupt levels, a separate data block must be selected here for each call for the FB pair. Normally, this means that a data block with a length of 28 words (without preheader) is required for each interrupt level.

Organizational Funcfion Blocks Formal 0 ~ e r a n d list Name

PurposeiDescription
Data block to which the data of the scratchpad flag area is transferred

Param. Data type type

IDB I
5.1.2

I B / - I

FB 63: Restart

("ANLAUF")

The "Restart" function block must be called in the following organization blocks: OB 20 Cold restan OB 21 - Manual warm restart OB 22 - Restart after power failure The calls must inform the block of the restart mode, as follows:

OB 20 OB 21 0 6 22

. . . Cold restart ........................... ART = 0


... ...
Manual warm restart Restart after power failure

.................... ART = 1 ............... ART = 2

In the case of a manual cold restart, for the CPU 945 there are Restart program processings in the 0 6 21 and OB 22 in the case of an automatic cold restart following the automatic restart after power failure, if the CPU was in the mode of operation RUN. The calls must inform the block of the restart mode, as follows: OB 21 Manual cold restart ART = 0 ART = 2 OB 22 Automatic cold restan after power failure FB "Restart" still requires a preset identifier of the programmable controller. The assignments are as follows:

PC 1 2

Programmable controller/CPU Loop processor (CPU 922) CPU 928, CPU 928B

This parameter is insignificant for the program package of the PC 155U and CPU 945. Any value can be entered. The "Restartn standard function block performs the following tasks: Marking the restart mode in all "INTER" DBs Entering the type of programmable controller in all "INTER" DBs (for cold restart) Calling all "Samplingn PBs and " 1OOmsn PBs (for cold restart) Determining the storage requirement of the "Sampling" PBs and "lOOmsn PBs for old values (for cold restart) Checking the length of DB "ODATn and all DB "INTER" (on cold restart only). If a DB is too short, the PC will stop with F002 in the accumulator. It can be seen from the USTACK which D6 is too short. Before initiating a restart, the user must check the blocks following the block concerned in the PC memory.

Organizational Function Blocks If a warm restart takes place, the control blocks are not called by FB "Restart" itself. Instead, the restan mode is marked in all "INTER" DBs and is only deleted when the sampling interval specified in DD 13 has elapsed. This ensures that all control blocks can run through their corresponding routines when the greatest sampling interval is entered in DD 13.

Formal operand list Name


AG

Purpose/Description
Identifier of programmable controller
Restart mode

Param. type

Data type
KF KF

D
D

ART

ODAT

Number of DB 'ODAT"

KF

5.1.3

FB 69: Organization ("ORGANI")

Some of the tasks of FB "ORGANI" have already been explained in Section 3. They are as follows:
m Management of timers

m Management of the storage area for historical and internal values


m Transfer of input identifier to DB "INTER"

Transfer of sampling interval to DB "INTER"


m Opening DB "INTER"

Calling PB "Sampling"
m Calling PB "lOOmsn

FB "ORGANI" ensures that each control loop finds the organizational data valid for it (e.g. sampling interval) in DB "INTER" and calls this data in the programmed order. It takes into account the sampling and shift times applying to F5 "Sampling". FB "ORGANI" has two formal parameters. They must both agree with those of FB "Restart".

Formal 0~erand list Name


ODAT

Purpose/Description
Number of DB "ODATw

I 1 l
Param type Data type KF

Organizational Function Blocks


5.1.4

FB 20: Restart Mini ("ANL-MINI")

The "ANL-MINI" function block is a part of the simplified system frame software. In S5-135U or S5-155U, this function block must be called in the organization blocks OB 20 (cold restart), OB 21 (manual warm restart), or OB 22 (restart after power failure). In the calls, the following code is used to notify the block of the restart type: OB 20 OB 21 OB 22

... Cold restart ............................ ART = 0 ... Manual warm restart ..................... ART = 1 ... Restart after power failure . . . . . . . . . . . . . . . . ART = 2

Provided that the CPU has been in RUN mode, the startup program executions in O 21 (for a manual B cold restart) and in OB 22 (for an automatic cold restart after power failure) exist for CPU 945. In the calls, the following code is used to notify the block of the restart type: OB 21 OB 22 Manual cold restart Automatic cold restart after power failure ART = 0 ART = 2

The "ANL-MINI" function block itself does not call the control blocks in the event of a warm restart. Instead, the restart type is marked in the "INTER" data block such that all control blocks are able to execute their program routines. The DBNR and PBNR formal operands are used for telling the system frame the data block number of the "INTER" data block and the program block number of the "Sampling" program block. The "ODAT" data has been omitted. Formal operands list

1
I

Name
ART

Purpose/Description
Startup type

l
1
I
1

Param. type
D

I
I

Data type
KF

DBNR PBNR

1 Number of the "INTER" data block


Number of the "Sampling" program block

1 KFI
I KFI

l
1

D D

K F /

TA

l Sampling interval

The "ANL-MINI" function block has the following tasks: Marking the restart type in the "INTER" data block Calling the "Sampling" program block during a cold restart Determining the memory requirements of the "Sampling" program block for old values (in a cold restart only) Checking the length of the "INTER" data block (in a cold restart only). The PLC will go to STOP (accumulator contents = F002) if the data block is too small. The number of the data block can be read from the USTACK. Before a new start is performed, the user must check whether the blocks that follow the DB concerned in the PLC memory are correct.

Organizational Function Blocks

5.1.5
18).

FB 23: Organization Mini ("ORG-MINI")

The "ORG-MINI" function block is called in one of the watchdog alarm organization blocks (OB 10 . .. The DBNR and PBNR formal operands are used for telling the system frame software the data block number of the "INTERn data block and the program block number of the "Sampling" program block. The "ODAT" data block has been omitted. Formal operands list

Name
DBNR PBNR

Purpose/Description
Number of the "INTER" data block Number of the "Sampling" program block

Param. type
D D

Data Vpe
KF KF

The "ORG-MINI" function block has the following tasks: Administering the memory areas for history and internal values Opening the "INTERN" data block Calling the "Sampling" program block

Control Blocks
5.2 5.2.1

Control blocks
FB 14: Mathematical block ("MATHE")

FB 14

I
FNR 1

MATHE
SFEHL SPOS SNEG SANBO SANBU

XE1
X E2

MATH

SXA

STEB : XE1 : XE2 : FNR :

....... ....... ....... .......


7
SFEHL

XA : OBXA : UBXA :

.......

....... .......

STEB
6 5 4 3
0
SBAlE

SANBU SANBO SPOS SNEG

Function block FB "MATHE" contains several mathematical functions which can be selected by means of function number FNR. Limiting of the output to limits OBXA and UBXA can be activated and disabled by means of control bit SBAIE. Whenever a limit is reached, this is flagged wiih bits SANBO and SANBU. Error message bit SFEHL is set and latched in the following cases: Wrong function number Division by 0; the output remains unchanged Radicand less than 0; the root of the absolute value is extracted.

Control Blocks
The following mathematical functions can b e

selected:

7
8

I XEl I

. XE2 . XE2

Absolute value with scaling Root with

scaling

For reciprocation, input XE2 Formal Name STEB

is irrelevant. A dummy address can b e preset.


l

a erand list
Data type Control and signalling byte Bit No.0 : SBAIE Bit N0.3 : SNEG Bit No.4 : SPOS Bit No.5 : SANBO

=0

=1 =1 =1 =1
=1 =1

Limit OFF Limit ON Result negative Resuit positlve Indication: XA at high limit Indication: XA at low limit Error: Division by 0 or root of a negative number or illegal FNR

Bit N0.6 : SANBU


Bit N0.7 : SFEHL

I I
I
I

XE1

Input 1 Input 2 Function number: value range: 1 to 8


-

Output High limit of XA Value range: UBXA to t 10000

Low limit of XA Value range: -1 0000 to OBXA

Control Biocks
5.2.2

FB 61 : Filter element ("GLAETTEN") FB 61


ERU

GLAETTEN

qli:
E l

TI A(O)

E 2

A A2 A1

N E3

El E2 NE3 A2 A1

: : : : :

....... ....... .......

A(0) T1

....... .......

ERU
A STEB

: : :

....... ....... ....... ........ : .......

STEB
7

The "Filter element" function block acts as a lag element of the first order. It smooths arbitrary input values using the Pade approximation of the first order (trapezoid rule). The smoothing quality is adjustable using constant T1.

Figure 5 -1 Step response of the filter element

The derivative of output A is available at output A l . This can be advantageous in status control systems. The filter element can be configured with feedback, using output A2. Additionally, the factor situated between output A2 and input N E 3 must be assigned to input ERU, i.e. ERU = 1 for direct feedback to

NE3.
if there is no feedback, ERU must be set to 0.

Control Blocks Example:

without with feedback

Figure 5-2

Filter element with feedback

If output A2 is to start at a particular value, this can be achieved with control bit SA2. If SA2 is set to 1 , A2 receives the value A(0) to be specified by the user. Output A contains the corresponding value computed according to the trapezoid rule. The filter element can be started from the first actual value read in, for example. Dynamic and adaptive presetting of values: The filter time constant T1 and sampling interval TA can be preset both dynamically and adaptively. They are passed again if SBED = 1. With dynamic presetting, SBED must be continuously 1. With adaptive presetting, SBED must only be set to 1 if the parameters are to be accepted. After the parameters have been passed, the user must enter SBED = 0. Operator entry: In the "Operator entry" mode in "ODATw DB, all outputs remain unchanged. The internal values are recomputed, i.e. T1 and TA are passed as new parameters again. Restart modes: On initial start, the initial value A(0) is assigned to output A2; output A receives the corresponding value calculated according to the trapezoid rule. The outputs remain unchanged in the "Restart after power failure" and "Manual warm restart" modes.

Formal 0~erand list Name


El
E2

PurposolDescription
Input interpreted as positive Input interpreted as positive

Param. type
I I

NE3

I
I

Input interpreted as negative

A1

Derivative of output A

A2 A(O)

OutpYt of flip-flop to be used for feedback Initial value of output A2

T1

Filter time constant Value range: T1>

ERU

input for feedback: it must be asslgned the factor with which A2 acts on NE3 Output of the filter element

STEB

Control byte Bit No. 6 SA2 Bit No. 7

=l

A(0) is assigned to A2

SBED = l

T1 and TA are passed

5.2.3

FB 62: PID controller ("PID-REG")

FB 62

I
KiTD T1

PID-REG

L,
KOIP

SDE/A
a

; k " 4
SVOR SPElA

U
Krrl 40) SlElA

+a+
=
-

OBXA

XA

S~NBO SANBU
P

STEW : SOLL : IST : XA : OBXA : UBXA : KOlP :


STEW
15 14

........ ........

........ ........
........ ........ ........

KIT1 A(0) KITD T1

P
I D

........ ........ :........ ......... ......... .........


:

.........
7 6 S

1 2 1 1 SXA SAN

1 SD

8 SlST

SANBO SANBU

SlNST

SBED SALG SVOR SRUK SDEIA SlElA SPEIA SAlE

Function block FB 62 represents a PID controller which operates according to the Pade approximation (trapezoid rule). The sampling interval can therefore be selected to approximately half the dominating time constant of the controlled system:
TA

5 '1,

. dominating system time constant

The PID controller is of modular design. The components can be deactivated individually and the PD component (SRUK = 1, SVOR = 0) or only the D component (SRUK = 1, SVOR = I ) can be located in the feedback loop (see Example 6.4). This results in the following advantages: If the P and D components are located in the feedback branch control becomes "bumpless" with the same rate of correction of disturbance variables. It is usually possible to dispense with a setpoint integrator for avoiding step changes in the setpoint.

Confrol Blocks The transfer function of the closed control loop has a constant counter, irrespective of the values of the controller parameters; the reference step response therefore exhibits minimum overshoot. The transfer function of the PID controller can be represented in both additive form and multiplicative form.

Additive form:

KI : Integral action coefficient

KD: Derivative action coefficient KO : P component gain


where TN =

KO 7

Multiplicative form:

KP :Gain TN :integral-action time constant


TV :Derivative action time constant

T1 :Damping time constant


P :Laplace operator

The following restriction applies to the damping time constant: T 1


TA 2 7

The user has a choice of transferring the values for the multiplicativeform (e.g. values from the Bode diagram) or the additive form (more modern design procedure). Make sure that this condition is also fulfilled for multiplicative presetting of the controller characteristics.
D component:

The manipulated variable of the PID controller can be falsified by limiting output XA to limits UBXA and OBXA. This particularly affects the D component because, in the event of a change in input variable, it reacts with an output signal which is only present for one sampling interval (when T1 = TA/2). If the P and I components are very great during this sampling interval, the effect of the D component is lost, i.e. it is falsified. The component which could not act on the output i therefore repeated in the following sampling s intervals if the user sets SD=O.

Control Blocks The D component also has a damping time constant. if the control response becomes unstable because of the D component, an improvement can be achieved by increasing the damping time constants (cf. 5.2.1 1)

I component: The I component is stopped when a limiting value is exceeded (anti-windup response).

There are two cases in which the I component continues in spite of limiting effects: The upper limit OBXA is reached but the I component moves in the negative direction. The lower limit UBXA is reached but the I component moves in the positive direction. When there is no dead time in the controlled system, the special "Do not stop I component" function (SINST) can be of advantage. In this case, the I component is not stopped when an output limit is reached. If the controller is switched on with SAIE = 1, the old value (value before switching off) or XA = A (0) is used (SANL). The corresponding identifier and SRUK (PD component in the feedback branch) must be defined before switching on the controller, i.e. the restart response cannot be affected simultaneously with the setting of SAIE. Operator entry: As long as the "Operator entryn mode is set, output XA remains unchanged. The internal factors, i.e. KOIP, KIT!, KITD, T1 and TA are recomputed. Restart modes: During the first run, the I component is set to X(0) and output XA is set to 0.The internal factors are computed. For "Restart after power failure" and "Manual warm restart", output XA remains unchanged. Dynamic and adaptive presetting of values: Controller characteristics KOIP, KITI, KITD, T1 and TA can be preset dynamically or adaptively. They are only accepted if SBED = 1. With dynamic presetting, SBED remains continuously 1. With adaptive presetting, SBED must only be set to 1 if the values are to be passed. After passing the values, the user must enter SBED = 0. Example: The PID controller should be preset as follows: P and D components in the feedback loop I component is stopped when a limit is reached The characteristics are preset for the multiplicative form of the transfer function P component ON I component ON D component ON A D component which was not fully output (because of a limit) is repeated Restart takes place with A (0) XA should be 0 when the controller is switched off

--D --

-SD
.-

,RK SU SVOR SlST SINST

= 1 =0

=0 =0

SALG = SPEIA = SIEIA = SDE/A=

0
0 0

=O

SANL = 0 SXA = 1.

Control Blocks

FB 62

(
WTD
T1

PID-REG
SD

SDEIA
a

-t

KOIP SVOR
a

1
SPEIA OBXA

+
Km A(O) SlElA
A

SANBO SANBU

STEW : SOLL :

IST
XA OBXA UBXA KOIP

........ ........ :........ :........ :........ :........ :........

KIT1 A(0) KlTD T1 P I


D

........ :........
:

:........
:
.... . S

........ .........
.........

STEW
15
14 12 11 10

X = 1 , if the characteristics are to be accepted and there is no operator entry.

Control Blocks
Formal o p e r a n d list Name
STEW Control word Bit No. 0 : SAIE

Pararn type
= 0 Controller OFF = l Controller ON

Data type
W

Bit No. l : SPEIA = 1 P component OFF Bit No. 2 : SIEIA Bit No. 4 : SRUK

= 1 l component OFF
= 0 PID controller has normal structure

Bit No. 3 : SDEIA = 1 D component OFF

= 1 P and D components In feedback branch:


P component can be relocated in the forward branch with SVOR = 1.

B t No. 5 : SVOR = 0 and SRUK = 1: P and D components are i


in feedback branch

= 1 and SRUK = 1: only the D component is in


feedback branch Bit No. 6 : SALG = 0 Multiplicative form of the algorithm = 1 Additive form of the algorithm Bit No. 7 : SBED Bit No. 8 : SlST
l

= 1 Values KOIP, KITi, KITD, T1 and TA


are accepted

= 0 I component is stopped when a limit


is reached

= 1 I component Is only stopped if the limit i also reached without D component s


Bit NO. 9 : SINST = 1 DO not stop I component Bit No. 10 : SD

= 0 D component was not fully output and


is repeated

= 1 D component is not repeated


Bit No. 11 : SANL Bit No. 12 : SXA

= 0 Restart with XA = A(0)

= 1 Restart with old value

I Bit No. 14 : SANBU = 1


input, setpoint Value range: -10000 to IST Input, actual value Value range: -10000 to

= 0 and SAlE = 0: hold at old value = 1 and SAIE = 0: XA = 0


Indication: XA at low limit

Bit No. 15 : SANBO = 1 Indication: XA at high limit

+ 10000
+ 10000
i

Output of PID controller = Value of manipulated variable Value range: UBXA to OBXA High limit of XA Value range: UBXA to

+ 10000

Low limit of XA Value range: -10000 to OBXA

Control Blocks Formal operand list

Name
KOIP

Purpose/Description
PID controller gain Additive form of algorithm: KO Multiplicative form of algorithm: KP

F
Pararrl. Data

l l
I
A(0)

Integral-action coefficient or time constant Additive form of algorithm: K1 C S -'l Muitlpiicative form of algorithm: TN Csl

Initial value of I component Derivative coefficient or time Additive form of algorithm: KD Csl Muttlpiicative form of algorithm: TV

l !
IT1 I
P I

CS]

Damping time constant; lag time constant of D component CS] Value range: T 2 TA12 l Value of P component Value of I component Value of D component

5.2.4

FB 78: Analog input ("ANEI")

FB 78
PBER

I
BG KNBT
NA SER

ANEl

XA SF9 SBU

,ER

STEB : PBER : BG : KN : BT :

....... ....... .......

....... .......

NA ER XA

: : :

....... ....... .......

STEB
7
6

SFB
L

S W

SER

Analog values from various analog input modules (see Table) can be read in with the "Analog input" function block. The modules can belong to both the standard and extended I10 areas. The function block allows for the special features of the various analog input modules, and carries out scaling to 0 .. . 10000 for unipolar modules and to -1 0000 to +l 0000 for bipolar modules. Complementary measured value representation is assumed for bipolar modules. Presetting of substitute value: In the "Substitute value" mode (SER = 1) no value is read in from the analog input module; instead, the value at input ER is accepted. A range violation of more than 5 % is signalled at output BU, according to the preset module type BT (unipolar or bipolar): SBU = 1 for

ER < 0 or E > 10500 with unipolar module type R ER < -1 0500 or ER > 10500 with bipolar module type

Zero alignment: The output value XA can be corrected by means of the zero alignment to compensate for zero errors of the sensor. Example: The value +l200 is output for the physical zero at output XA. This value is then programmed at input NA for zero correction. The block then reads in a 0 for the physical zero of the sensor. Signals SBU and SFB are issued in accordance with the modules, for open circuit or range violation of more than 5 %.

Control Blocks

BT
0

Physical nom. range


0 t o 50 rnV 4 t o 20 m A P T 100
P T 100 P T 100

Module
460-5AAl l 461-5AA11 462-SAA11 465-5AAl l 465-3AAl2

Internal scaling

Signals
SBU = 1 if XA < 0 or XA > 10500 SFB=DBR bit of the mod.

0 to 10000

:
0 to rnaxC 0 to 10000 -10000 to +l 0000

SBU = 1 if XA<O or XA > 10500 SFB = viol. bit of mod. SBU = l i f X A < O or XA > 10500 SFB=Error bit of the mod.
SBU

P T 100 PT 100

L 50rnV/ L 500rnVI L 1V t 10V/ L 20rnA

>i
1
}

460-4UA11 465-4UA11

465-5AA11 465-3AA12

= 1 if XA < -1 0500 or XA > 10500

L SOmV/& 500mVl L 1V t 5 V l t 1OVI t 20mA

460-4UA11 4654UA11

-10000 t o +IOOOO

SBU = 1 if XA < -10500 or XA > 10500

-0.05 t o 1V/-0.5 to 10 V -1 t o 20 rnA

463-4UA11 (463-4UBll

to 10000

SBU = 1 if XA<O or XA > 10500 SBU = l i f X A < O or XA > 10500 SFB = 1 if XA

4 t o 20 m A

460-4UA11 463-4UA11 463-413811 465-4UA11 460-5"" 460-SA431

0 to 10000

+ YA < -625
= 3mA

t 1V/ L lOV/ ; 2OmA t

-10000 t o +l0000

SBU = 1 if XA < -10500 or XA > 10500

BT = Module (board) type Figure 5-2 Assignment of analog input modules t o module types and signals

Output XA is not limited beyond the nominal range. XA = 0 for SFB= 1

Formal operand list Name


STEB

PurporelDescription
Control byte Bit No. 0 : SER Bit No. 6 : SBU Bit No. 7 : SFB

aram. Data h y p e type


I BY

= 0 Value is read in from the module


= 1 Reset substitute value

= 1 Signal: Range violation = 1 Signal: Error

PBER

I10 area:

PBER = NP: Analog input module Is In the standard 10 area 1 = EP: Analog input module is in the extended 10 area 1

BG

Starting address of module: Permissible values for PBER = NP: BG = EP: BG

> 128 >0

BY

KN
BT

Channel number of analog input module Module type Value range: 0 to 7 Zero alignment: XA = Value read in (scaled) Value range: -10000 to +l0000

l IBY
I

NA

- NA

ER

Substitute value: is passed in "Substitute value' mode instead of value of the analog input module Value range: 0 to 10000 or -1 0000 to +l0000

Output of the function block Value range: 0 to 10000 or -10000 to +l0000

Control Blocks

5.2.5

FB 79: Analog output ("ANAU") FB 79

I
SBF PBER

ANAU

BG

KN

BT -

XE

C +
....... .......
BG KN
BT : : :

STEB : XE : PBER :
STEB

.......

....... ....... .......


l

SBF
i

Analog signals can be output to the process via analog output modules with the "Analog output" function block. The function block processes values over the range 0 to 10000 or -10000 to +l0000 for specific modules. Lower or higher input values are limited. The user need only preset parameter BT according to the module used.
BT
0

Modules
475-3AAl l 475-5AAl l 476-3AAl l 476-5AA1 l 470-4UA11 470-4UB11 470-4UC11

Permissible input value


-10000 to +10000

0 to 10000

-10000 to +10000

0 to 10000

BT: Module (board) type

The signals can be output via the standard or the extended 110s. Transfer to the analog output module is blocked by setting parameter SBF. Operator entry, restart modes: The analog 110s are not addressed.

Control Blocks Formal c ,erand list

I
STEB Control byte Bit No. 1 : SBF

Data type
= 0 Normal operation; 110s are addressed
= 1 Output inhibit: 110s are not addressed

Input (= analog value to be output) Value range 0 to 10000 or -10000 to +l0000 110 area: PBER = NP: The analog output module is in the standard 110 area = EP: The analog output module is in the extended 110 area Starting address of the module: permissible values for PBER = NP: B 0 > 128 = EP: BG > 0 Channel number on the analog output module Module type Value range: 0 to 3
p P P

I
I

5.2.6

FB 84: Single-input filter ("EINFGLAT")

FB 84

EINFGLAT

IF
T1

......
a......

.......

1")

i.......
......m

STEB
7

6
SA

SBED

The "Single-input filter" function block acts as a lag element of the first order. It smooths random input values using the Pade approximation of the first order (trapezoid rule). The smoothing quality is adjustable via time constant T1. The internal structure of the block is the same as that of FB 61.

Control Blocks

Figure 5-4 Step response of the single-input filter

If filtering is to begin with a particular output value, this can be achieved with control bit SA. If SA is set to 1, the internal value brought out as A2 with the "Filter element" (FB 61) is assigned the value A(0) to be specified by the user. Output XA contains the corresponding value computed according to the trapezoid rule. The filter element can be staned from the first actual value read in, for example. Dynamic and adaptive presetting of values: Filter time constant T1 and the sampling interval TA can be preset dynamically as well as adaptiveiy. They are passed again if SBED = 1. With dynamic presetting, SBED must always be 1. With adaptive presetting, SBED should only be set to 1 if the parameters are to be accepted. After the parameters have been passed, the user must enter SBED = 0. Operator entry: In the "Operator entryn mode, all outputs remain unchanged. The internal values are recomputed, i.e. T1 and TA are passed as new parameters. Restart modes: The first run is as for SA = 1. In the "Restan after power failure" and "Manual warm restart" modes the outputs remain unchanged. Formal 0~erand list Name Purpose/Description
Control byte Bit No. 6 SA Bit No. 7 SBED

Param. type
XA is computed from A (0)

Data type

STEB

=l
=l

T1 and TA are passed

T 1

Filter time constant Value range: T1 1 Initial value of A2


-

A(O) XA

l
Q

D
D

Output of the filter element

Control Blocks
5.2.7 FB 95: High-speed analog input ("ANES")

FB 95

I
PEER
BG

KN
VEER

SLOG SSTR
V W NA

ANES

SER

XA ER
S8 U

STEB : PBER : BG : KN : VBER : VMAX:

....... ....... ....... ....... ....... .......

NA ER XA

: :

....... ....... .......

SBU

SSTR

SLOG

SER

Analog values from the intelligent 110 modules 6ES5 243-1AA11 6ES5 243-1 AB1 1 can be read in with the "High-speed analog input" function block. By means of input VBER, the user f informs the function block o the voltage range he has selected on the module. The assignments are a s follows: VBER
0
1

Voltage range
OV to 10V -5V to t5V
-1 0V to +l 0V

For the bipolar modules the internal number range is -1 0000 to +l 0000, and for the unipolar modules 0 to 10000. Scaling is based on a presettable maximum voltage VMAX, i.e. the value +l0000 is assigned to +VMAX. Substitute value presetting: In the "Substitute valuen mode (SER = 1) , the value at input ER is output unchanged. Range violations of more than 5 % are flagged. SBU = 1 for ER < 0 or ER > 10500 if VBER = 0 ER < -1 0500 or E > 10500 if VBER = l or 2 R

Control Blocks

Zero alignment:
Output value XA can be corrected by means of the zero alignment to compensate for zero errors of the sensor.

Example:
Supposing the sensor voltage at the physical zero is -1 00 mV. The nominal range of the ADC is +/-l 0 V and VMAX = 8 V. In this case for NA = 0,function block ANES reads in the value XA = -122. This value is programmed at input NA for zero correction of the input signal. The function block then outputs XA = 0 at the physical zero. The zero alignment also causes displacement of the rated input voltage range. Example: VBER = 2 VMAX = 9.6V
C/-

VNENN = +/-9.6V if NA = 0

for NA = 855mV therefore: +VNENN = +9.6V + 855mV = 10.455V -VNENN = -9.6V + 855mV = -8.745V To reach the internal maximum value of +10000,the module must be able to read in +l 0.455V.The real voltage range, however, is limited to +/-l0 V for VBER = 2. Output XA of the "High-speed analog input" function block is monitored for range violations of 5%, but not limited. VMAX must therefore be 5 9.52 V (for NA = 0) if a range violation signal SBU is to appear in voltage range VBER = 2. The "High-speed analog input" function block also makes use of parameters SLOG and SSTR. These parameters correspond to input signals LOG and STR of the analog input module and serve to control the comparators of the module. They can be used to initiate an interrupt when a setpoint is violated in either direction (for further details, see the instruction manual of the analog modules). The "Highspeed analog input" function block does not interpret the interrupt. If this is desired, the user must implement this function himself. The following applies in normal operation: SLOG = 0 SSTR = 0.

r
VBER

Control Blocks

list Formal 0~erand Purpose/Description


Control byte Bit No. 0 : SER

Param. Data type type

= 0 Value is read in from the module = 1 Presetting of substitute value

Bit No. 3 : SLOG Si nal to change over the gate logic; information for comparators on input rnodule 6ESS 243-1AA11 t o generate interrupts; normal case: SLOG = 0 Bit No. 4 : SSTR

=. 0 Interrupt disabled (normal case) = 1 Interrupt enabled


The standard function blocks do not interpret the interrupts.

Strobe for comparator gate logic interrupt

Bit No. 5 : SBU 110 area:

= 1 Message: Range violation

PBER = NP The analog input module is in the standard I10 area = EP The analog input module is in the extended 110 area

Starting address of the rnodule: Permissible values for PBER = NP: 128 < BGS 248 = EP: 0 5 BGS 248 Channel number on the input module: 0 <KN S 7
I
I

BY BY

Voltage range preset on the input card: 0 to 2

Max. of scaled input voltage range in volts: it is converted to the maximum of the internally scaled numeric range (=10000).
Zero alignment: XA = value read In (scaled) Value range: -10000 to +l0000

- NA

Substitute value: Value range: -10000 to tlOOOO or 0 to 10000 Output of the function block Value range: -10000 to +l0000 or 0 to 10000

Control Blocks 5.2.8


FB 96: Setpoint adjuster ("SOSTELL")

FB 96
TlAN TlAB

I
SAlH A(O)
Ramp

SOSTELL
T11
SXA2

SHAUF

SHZU

4
l

-SE

1 -

1='qc0-=~P
SXAl
SB 0

SBU
SSINK SSTEl

SE SXA1 SXA2 TlAN TIAB


STEW

: : : : :

....... ....... .......


....... .......

T1 : STEW : A(0) : OBSO : UBSO :

....... ....... ....... ....... .......


6 5 4 3 2 1 0

1
SBU

SSNK SSTEI

SBO SBED SANF SGRST SPB SHZU SHAUF SA/H SA/=


J

The "Setpoint adjuster" function block serves to convert a setpoint step change to a ramp function zt output SXAl needed for various actuators. If a smooth transition is required, output SXA2 can be used. In contrast to SXA1, it is additionally fed via a lag element with presettable time constant T1, producing a smooth step response. Example:

Figure 5-5 Transient response of outputs SXAl and SXA2

The slope of the ramp function can be preset separately for absolute value-related setpoint increase and reduction. The output of the setpoint adjuster runs through 10000 internal units during time TlAN andlor TIAB.

Note: If the setpoint is adjusted beyond the zero point and TIAN is not equal to TIAB, the correcting rate changes at the zero point. SI The setpoint adjuster can be switched on with control bit SAIE. In the OFF position ( AE = 0) , either "On or the value of A(0) is output, depending on control bit SGRST. The setpoint adjuster is switched on with SAIE = 1. "0" or the value of A(0) can be set as the initial value with control bit SANF. The automatic or manual modes of the setpoint adjuster can be selected with control bit SA/H. In the automatic mode, the value at input SE applies. The outputs assume this value in accordance with their step responses. In the manual mode, the value at input SE is not valid. The setpoint can then be adjusted with control bits SHAUF and SHZU. If they are both the same, the setpoint does not change. The correcting rate (slope of the ramp) is the same as for the automatic mode. Output SXA2 is still subjected to lag

Example: The steady state has been reached in a control system equipped with a setpoint adjuster: SE = SXAl = SXA2. If the actual value is then manually changed to another value, an apparent setpoint step change takes place upon switching back to the automatic mode. This can be avoided with control bit SA/E of the setpoint adjuster. The setpoint adjuster must be switched off in the MANUAL mode of the controller (SAIE = 0). The setpoint corresponding to the current actual value is then assigned to A(0). Control bits SGRST (initial state) and SANF (initial value) are set (SGRST = 1, SANF = 1). The setpoint adjuster then outputs the setpoint corresponding to the actual value. The controller can be placed in the AUTOMATIC mode without a setpoint step change being produced. The setpoint adjuster is then switched on. It starts with setpoint A(0) and adjusts it to the value of SE.

Caution: If SGRST = 1 and SANF = 0, a setpoint step-change from A(0) to 0 takes place upon switching on.

Operator entry: If the "Operator entry" mode is selected, the outputs remain unchanged. Adaptive and dynamic presetting of values: Both dynamic and adaptive presetting of 11, TIAN, TIAB and TA can be implemented with control bit SBED. The values are only accepted if SBED = 1. With dynamic presetting, SBED remains at 1; with adaptive presetting, SBED should only be set to 1 if the parameters are to be passed. When the values have been accepted, the user resets SBED.

Control Blocks

Restart modes:
" 0 " or the adjustable value of A(0) is preset for the outputs for the first run. As long as the identification bit for "Restart after power failure" or "Manual warm restart" is set, the outputs remain unchanged.

Incorporation in the system frame software:


The setpoint adjuster can be incorporated in both PB "Sampling" and PB " 100ms". Control bit SPB is used to inform the block of the program block from which it is started. Particularly in the case of PB "lOOmsn, it should be noted that the limit of computing accuracy of the programmable controller decreases with increasing lag time T1. This manifests itself in the fact that the output of the lag element falls short of the input value. It remains "locked up" at lower values (with positive input step changes).

Control Blocks
Formal operand list Name
SE

Purpose/Description
Input of setpoint adjuster in automatic mode Value range: -10000 to +l0000 Output of setpoint adjuster; the value follows a ramp with respect to the value of SE. Value range: UBSO to OBSO Output of the setpoint adjuster; this output lags behind SXAl by the time constant T1. Value range: UBSO to OBSO Tlme dsf in which SW41 runs through 10000 internal units with absolute value-related increase of the setpoint T i A N = n TA; n = 1 , 2, 3

Param, data type type


l D

SXA1

SXA2

TlAN

...

TlAB

Time dsf in which SXAl runs through 10000 Internal units with absolute value-related reduction of the setpoint T I A B = n . TA; n = l, 3 ... 2, Lag time constant dsf T 1 2 TA12 Control word: Bit No. 0 : SAIE Bit No. 1 : SAIH

T1

STEW

= 0 Setpoint adjuster OFF = 1 Setpoint adjuster ON


= 0 Automatic mode = 1 Manual mode = 1 Reduce setpoint in manual mode

Bit No. 2 : SHAUF = 1 Increase setpoint in manual mode Bit No. 3 : SHZU Bit No. 4 : SPB

= 0 Call in PB "Sampling"
= l Call in PB "100msW

Bit No. 5 : SGRST = 0 0 is output if SAIE = 0 = 1 A(0) becomes initial value if SAlE = 0 Bit No. 6 : SANF Bit No. 7 : SBED Bit No. 8 : SBO Bit No. 9 : SBU

= 0 Restart with 0 as initial value


= 1 Restart value with A(0) as initial value

= 1 Values T1, TIAN.TIAB and TA are passed


as new parameters

= 1 Indication: Setpoint at high limit = 1 Indication: Setpoint at low limit = 1 indication: Setpoint rising = l Indication: Setpoint dropping
I
I

Bii No. 10 : SSTEI


Bit No. 11 : SSiNK A(O) OBSO UBSO

initial state; initial value High limit of setpoint Low limit of setpoint

D D D

Control Blocks
5.2.9

FB 98: Comparison point ("VERGLEI")


FB 98

VERGLEI

,El

XW

NE 2

El : NE2 :

.......

.......

XW

.......

The "Comparison point" function block subtracts the value of input NE2 from the value of input E l and presents the result at output XW. This allows, for example, the system deviation to be affected before it is transferred to the controller. Formal operand list Name PurposeIDescription Param. type Data type

El
NE2

( Input interpreted as positive


Input interpreted as negative

l ' l D l
I
D

XW

Output: XW = E l

- NE2

Control Blocks
5.2.10

FB 99: Summing point ("ADDITION")

FB 99
.El

SUMMING

E2

XA,

STEB El E2 E3

....... ....... : ....... : .......


:
:

KP1 KP2 KP3 XA

: : :

....... ....... : .......

.......

STEB
7

The "Summing point" function block multiplies the values of Inputs E l , E2 and E3 by selectable factors KPl, KP2 and KP3 and subsequently summates them:

Dynamic and adaptive presetting of values:

Gain values KP1, KP2 and KP3 can be preset dynamically or adaptively. They are only passed as new paramters if SBED = 1. With dynamic presetting, SBED remains at 1 ; with adaptive presetting SBED should only be set to 1 if the values are to be accepted. After the parameters have been passed, the user must set SBED = 0 again.
Initial run, Operator entry:

The values of KP1, KP2 and KP3 are input for the initial run and the "Operator entry" mode. Advantage and applications of the summing point The "Summing point" function block is used when assembling observer structures. The gain factors of the individual inputs are particularly advantageous because function block calls can be dispensed with by judiciously relocating the coefficient elements to the summing points (cf. 7.5).

Control Blocks Another application of the summing element is the conversion of physical measuring ranges to scaled ranges:

A C = 0 or -10000

Physical measuring range Scaled measuring range

D = 10000

The physical measuring range is first multiplied by a scaling factor so that it has exactly the width of the scaled range. The scaling factor F is calculated as follows: F=

D-C
B-A

The resulting range must then be displaced so that its initial value is A' = C and its final value is B' = D. The required subtrahend S is obtained as follows: S=A'-C=B'-D. All operands of the formula to be programmed are therefore known: XA=XE F-S

FB 99 can be assigned its parameters as follows:

Formal o~erand list Name


STEB

PurposelDescription
Control byte: Bit No. 7 : SBED

Param. type
I

Data type
BY

= 1 Values KP1, KP2 and KP3 will be input

El
E2

Input 1 Input 2 input 3 Gain factor for input 1 Gain factor for input 2 Gain factor for input 3
I

D D

I I
I

E3
KP1

D
D
D

KP2
KP3
XA

I I
l
I

D
D

Output of the summing point

Control Blocks
5.2.11

F5 104: Derivative-action element ("DIFF-GL") FB 104

I
TD T 1

DIFF-GL

XE

-L
: : : :

SANBU SANBO XA

XE XA

TD
T1

....... .......

....... .......

OBXA : UBXA : STEB :

....... ....... .......

STEB
7

SEED SNACH

SANBU SANBO

The "Derivative-action element" function block forms the time-related derivative of any input signal using the Pade approximation (trapezoid rule). With control bit SNACH the user can define whether that part of an output signal which was suppressed because of limiting effects is to be 'made up' in the following sampling cycles. Lag time T1 has a damping effect. It may be a minimum of TA/2, In this case, the step response of the D element consists of a pulse of width TA (if there is no compensation for the part of the output value suppressed by limiting action). If T1 > TA/2, the D element is delayed; the output value decreases to 0 with a delay. Example:
input step change 0 Limiting t 10000

-> 2000

Curve 1: Curve 2: Curve3:

T1 = 0.5s T1 = 0.5s T1 = 2 s

Limiting error is compensated Limiting error is not compensated Limiting error is compensated

Figure 5-6 Step responses of the D element

Control Blocks Operator entry: Output XA remains unchanged in the "Operator entry" mode. The parameters are passed as new parameters. Restart modes: The value "0" is assigned to output XA in the initial run. For "Restart after power failure" and "Manual warm restart" XA remains unchanged. Dynamic and adaptive presetting of values: Controller characteristics TD, T1 and TA can be preset dynamically or adaptively. They are passed as new parameters if SBED = 1. SBED must be continuously 1 for dynamic presetting; with adaptive presetting, SBED should only be set to 1 if the values are to be accepted. After the parameters have been passed, the user must enter SBED = 0. Formal operand list Name
XE

Purpose/Description
Input of the D element Value range: -10000 to +l0000 Output of the D element Value range: UBXA to OBXA Derivative-action time constant I s 1

Param Data type type


I

XA

TD

1
[S]

Tl
OBXA

Lag time constant (damping time constant) High limiting value of XA Value range: UBXA to +l0000

L
l

D D

l
STEB

Low limiting value of XA Value range: - 0000 to OBXA 1 Control byte Bit No. 0: SANBO = 1 Indication: XA at high limit Bit No. 1: SANBU = l Indication: XA at low lirnit Bit No. 6: SNACH = 0 Error resulting from limiting effects is compensated = 1 Error resulting from limiting effects is not compensated Bit No. 7 SBED

= 1 Values TD, T and TA are passed 1

Control Blocks
5.2.1 2
FB 111: Setpoint output for BCD displays ("BCD-AUSG")

FB 111

ZW

PIQ

I BCD-AUSG F1 F2 F3F4 AW

W1

W2

W3 .W4
binalylBCD

BS
4x1611~16 bit

W 1 W2 W3 W4 ZW F1

: : : : :

....... .......

....... ....... ....... .......

F2 F3 F4 PIQ AW BS

:....... : ....... : ....... : ....... : .......

.......

The function block for "Setpoint output for BCD displayswprovides up to four digital displays (BCD, 4 digits, no sign) with the relevant setpoint via a 16-bit data bus (output word). The preset value (W1 to W4) can be adapted from internal representationto the unit of the display by a factor (F1 to F4), e.g. percent or degrees Celsius. The display relating to the input value is selected via a control bus (4 binary outputs). With parameter BS, the user presets the first bit of the control bus, to which the following three bits also pertain. The arrangement is as follows:
W1 W2 W3 W4

--> --> --> -->

BS BS+1 BS+2 BS+3

( I st control bit) (2nd control bit) (3rd control bit) (4th control bit)

Example: Number of setpoints ZW = 4 BS = A 4.1

Incorporation in the system frame software:


FB 111 can be incorporated in PB "1 OOmsn or PB "Sampling" as required. It should be noted that the PC cycle is more severely loaded when incorporating in PB " 100ms".

The block operates on the multiplex principle. Each value displayed is updated at the latest after ZW X AZ (operating cycle; either looms or TA).

Control Blocks

Figure 5-7 Update cycle for four displays; the control outputs are low

If only one of the four setpoints changes, it is updated immediately. The block then again follows the above procedure.
The following, for example, can be connected:
LED display 48 X 48 Control voltage 24VComplete field, Order No. M88969-.

..

Formal 0 ~ e r a n d list Name

PurpooelDescription
1st setpoint Value range: 0 2nd setpoint Value range: 0 3rd setpoint Value range: 0 4th setpoint Value range: 0

l
W2

Param type

Data type

... t9999 ... +g999


... t9999 ... t9999

W3

w4

I
l I I

ZW
F1
F2

lI
I I I

Number of setpoints to be ouptut: 1 to 4

Adaption factor for setpoint W1

Adaption factor for setpoint W2

F3

Adaption factor for setpoint W3 Adaption factor for setpoint W4 110 area for output word 1 PIQ = P: Standard 10 area = Q: extended 110 area Output word ("data busn)

~4 PIQ

AW

Control Blocks
5.2.1 3 FB 112: High-low value selection ("EXTRAUSW")

FB 112

EXTRAUSW

SMIMAi

XE1 X E2 XE3 .X E4

<
....... .......
.......

S>

SXEl SXE2 SXE3 SXE4 X A-

STEB : XEI : XE2 :

XE3 XE4 XA

: :
:

.......

....... .......

STEB

SXE4

SXE3

S X E 2 SXEl

SMlM

The function block for "High-low value selection" determines the extreme value from four input values; the block can be used for minimum or maximum selection. Control input SMiMA is used for switching over from max. to min. The four signalling bits SXEl to SXE4 indicate the input to which the output corresponds.

Note:
1

All inputs must be assigned. If there are less than four input values, one of the input signals should be applied to the free inputs to avoid errors.

SMIMAi

XEl

SXEl

Figure 5-8 Connections for less than four inputs

Control Blocks

Formal operand list Name


STEB

PurposelDescription
Control and message byte Bit No. 0 : SMlMA Bit No. 4 : SXEl
Bit No. 5 : SXE2

Param. Data type type


I

BY

=0 =1 =1 =1 =1
=1

Minimum selection Maximum selection Message: XA = XE1 Message: XA = XE2 Message: XA = XE3 Message: XA = XE4

Bit No. 6 : SXE3


Bit No. 7 : SXE4

XE1 XE2 XE3 XE4 XA

Input 1 Input 2 Input 3 Input 4 Output

1 1 1

D D

D
D

5.2.1 4

FB 114: Limit monitor ("GRENZSIG") FB 114

I
HYS GW02 GWO1GW1G W -

GRENZSIG

GA02 GAOl GAOO GAUl GAU2

XE

P
....... ....... ....... .......
4

XE : STEB : HYS : GW02 :


STEB

GWO1: GWU1: GWU2:

.......

....... .......
1

7
SBED

G A U GAUl

GAOO GAOl GA02

Hysteresis

C ----t

- - a

GWUl

. . . . . .--. --. .

4--.-

. . . .

. . .

-------\

1 .

GAOl

Figure 5-9 Function diagram of the limit monitor

The "Limit monitor" function block checks the input value for four presettable limits. The block outputs a corresponding signal for the value range in which input value XE is located. The following must be observed when presetting the limits: GW02

2 GWOl > GWUl 2 GWU2

The limit monitors can also be provided with hysteresis (see function diagram on previous page). Adaptive value presetting: The hysteresis and limits can be preset adaptively. They are passed as new parameters if SBED = 1 . After the parameters have been passed, the user must enter SBED = 0. On restart, operator entry or local operator control (SBED = l ) , the hysteresis is not processed.

Formal operand list Name


Input STEB Control and message byte
Bit No.0

Param. Data type

: GA02

=1
= l

Limit signal: XE

>

GW02

BitNo.1 Bit No.2 Bit N0.4 Bit No.7

:GAO1
: GAOO : GAU2
: SBED

Limltsignal:XE> GWOl Limit signal: XE

= 1 Umit signal: XE in middle range =1

Bit No.3 : GAU1

<

GWU1

=1

Umit signal: XE c GWU2

= 1 The limits and hysteresis a r e lnput

HYS
p p p

Hysteresis
~

I
I
I

I D I
D

GW02 GWOI GWUl GWU2

Uppermost limit First upper limit First lower limit Lowest limit

D D
D

I I

5.2.15

F6 115: One-out-of-two channel selector ("K-AUSW")


FB 115

K-AUSW

S E

STA

XE1 XE2

XA2

STEB : XEl : XE2 :

.......

....... .......

XA1 XA2

: :

.......

.......
1
STA

STEB

0
STE

With the "One-out-of-two channel selectorn function block, o n e of the two input values X E l , XE2 can be switched to one of two outputs XA1 and XA2, depending on control signals STE and STA. The input can b e selected with control bit STE, and the output with STA. Formal 0 ~ e r a n d list Name
STEB

Purpose/Description
Control byte: Bit No.0 : STE Bit No.1 : STA

Param. Data type type


I

BY

=0 =1

Read In XE1 Read in XE2 Output to X A l Output t o XA2

=0 =1

XE1 XE2 XA1 XA2

Input 1 Input 2 Output 1 Output 2

I
Q Q

D
D
D

5.2.16

F6 117: Polygon generator ("POLYGON")


FB 117

POLYGON

DB-P
XE

1
XA,

XA

= f (XE)

XE : DB-P :

.......

.......

XA

.......

With the "Polygon generator" function block a value, e.g. t h e analog value of a thermocouple, can b e adapted via a specified characteristic (polygon function). The "Polygon generator" function block h a s three modes: Cold restart Operator input m Operation

Control Blocks The user presets the polygon generator in the selectable data block DB-P by entering the values of the interpolation points. He must ensure that the X coordinates are preset in a strictly monotonic slope. The number of interpolation points must also be entered in DW 6. A cold restart must then be executed. If an illegal value is entered as the number, FB 117 sets error bit FAN2 in DW 0. No value is output. To eliminate the error, the value must be corrected and a cold restart must be executed again. Individual interpolation points can be changed during operation. The relevant interpolation point number is entered in DW 1 of DB-P. DD 2 must be programmed with the new X coordinate and DD 4 with the new y coordinate of the interpolation point. Input bit BED of DB-P is then set. The "Polygon generatorn FB accepts the new values, resets the input bit and continues with normal operation. If the user presets an illegal interpolation point number, FB 117 sets error bit FNR, If the monotonic nature of the X coordinate is disturbed, error bit FMON is set. With both types of error, operation continues with the old values and BED is not reset. If the input value is between two interpolation points, linear interpolation takes place. If the input value is outside the range defined in the polygon generator, the function block extrapolates according to the last straight section. DB-P must be created with a length of 208 data words including DB preheader.
Note:

Section 6 ("Technical Data") contains in tabular form the characteristics of the PT 100 and the most common resistance thermometers. Since the maximum length of the polygon curve is limited to 33 interpolation points, the values chosen should be such that the characteristic is simulated as accurately as possible in the operating range, i.e. the interpolation points should be closer to each other in the region of the operating point than in the boundary regions. The polygon function is usually located in the actual value branch, and assigns the corresponding temperature value to the current resistance value or thermal e.m.f. applied.

Control Blocks

DB-P

l
Format KM

Data
DWO

I
1

Description B N o 1 : F W Z = 1 illegal number of R interpolation points Bit No. 2 : FNR

= 1 illegal interpolation point


number for Input

Bit No. 3 : FMON = 1 New interpolation point violates rnonotonic nature of the X-coord~nate Bit No. 7 : BED

= 1 New interpolation point


is accepted

DW1

KF

lnterpolation point number for input Value range: 1 to 33

DD2 DD4 DW6

I l

KG KG KF

1
(

X value of the point to be changed (input)

I
/
I

Y value of the point to be changed (input)


Number of lnterpolation points Value range: 2 to 33

I
1

1 DD7
I DD9
DD1l 3

KG

X vabe of the l interpolation point st Y value of the 1st interpolation point X value of the 2nd interpolation point
-

KG KG

1 /
I

KO

I I
I

Y value of the 2nd interpoiation point

DD135

KG KG

X value of the 33rd interpolation point Y value of the 33rd interpolation point

1DDl37

DW202

. . .

internal values

Formal o~erand list


Name DB-P PurposelDescription Param. Data type type

I Data block for the lnterpolation points and slopes


Input Output

I
I
Q

- I
D
D

XE XA

Confrol Blocks 5.2.17


FB 118: Time scheduler ("ZEITPLAN")

FB 118

I TIME SCHEDULE
MELD DBZP

XA

= f(t)

XA

DBZP : MELD :

....... .......

.......

MELD
6

The time scheduler primarily serves as a setpoint generator for a controller. It can, however, be used for other similar tasks. It has the following operating states: Normal operation In normal operation, values are output according to the time schedule at one second intervals. When the last value is reached, the time scheduler remains at that value and issues a message. Hold state Normal operation is interrupted for the duration of the hold signal, i.e. the time scheduler remains at the current point of the time schedule. Output continues after removal of the hold signal. Continuing The following possibilities can be selected for continuing: -Continue from the hold point -Continue from an internally presettable continuation point -Continue from an externally presettable continuation point -Approach the next interpolation point at selectable speed. The "Time scheduler" standard function block requires a data block DBZP. This serves - as an interface for the input/output signals; as a memory for the time schedule data; - to select the mode of operation.

Control Blocks The time scheduler is controlled via inputs FREl and HALT. After enabling with the FREI signal, output values are transferred to XA at a one-second rate, according to a time schedule. Each transfer is signalled by setting NEUW in message byte MELD (DB "INTER") and NEUWl in data block DBZP. These messages must be reset by the user. The time schedule is preset in the form of a polygon function with a maximum of 64 sections. The current section is indicated via outputs ABSl ... 64 a s a binary signal, and via output ABSNR a s a digital value in binary code, in DBZP. s Output i stopped with the HALT signal. When the HALT signal has been removed, other values are output according t o the preset continuation mode. After removal of the halt signal and output of the next value, the FORT message appears. This is cancelled with the next hold signal or if the enable signal is removed. When the end of the time schedule is reached, the ENDE message is output. This is cancelled when t h e enable signal i removed. s Incorrect settings or illegal continuation values a r e reported with FEHL112.
Example:
FREI HALT FORT ENDE

XA

. . .

'

t(s)

NEUW

nnnnn
@
Hold point

n n n~
Continuation point

0
Messages NEUW and NEUW1 a r e latched.

Parameter

Bit No. 2 : NEUWl = 1 Message: Value output

The time schedule serving a s a basis for the output of values must be defined in the form of a polygon function.

The following specifications must be entered in data block DBZP: -Timebase: All time specifications can be made in seconds or minutes (optional), but must be uniform. -Number of sections -Starting value, i.e. the value with which output is to begin -Section coordinates: X coordinate: Time value ZW for a section Output value AW at the interpolation point Y coordinate:

Abs 3

Legend:
Abs. Section X

Time value

ZW for section 2

Parameters

Control Blocks

Continuing after hold After removal of the hold signal, output can continue as follows: Continue from hold point Continue from an internally presettable continuation point Continue from an externally presettable continuation point
m

Approach the next interpolation point at selectable speed

The continuation mode must be set via function identifiers FK.F1/2/3/4. Depending on the continuation mode, additional specifications may be required. If no continuation mode is set when the time scheduler is enabled, continuation mode 1 is selected automatically and message FEHL2 is output. Continuation mode 1: Continue from hold point Output of the time schedule continues from the hold point, after removal of the hold signal. The user need only set continuation type 1: FK.Fl = 1.

Parameter
Data
DW2 XA
Time schedule

Format
KM

Description
Bit No. 1 : FK.Fl

= 1 Continuation type 1 selected


Hold point Continuation point

XA Output value

Figure 5-10

Continuing from the hold point

Continuation mode 2: Continue from an internally presettable continuation point After removal of the hold signal, output continues from an arbitrary, internally presenable point of the time schedule. The continuation point is selectable via the section number ABSNR and remaining time ABSRS. The remaining time denotes the time which is to elapse until the next interpolation point is reached. Continuation mode 2 is selected with FK.F2 = 1. Parameters ABSNR and ABSRS must be assigned at the latest before removal of the hold signal.

Control Blocks Parameters Data


DW2 DW3 DW4

Format
KM KF KF

Description
Bit No. 2 : FK.F2 = 1 Continuation mode 2 selected ABSNR: Section number Value range: 1 to ANZ * ) ABSRZ: Remainin time for section ~ Value range: A B S <= ZW * * )

* ) ANZ Number of actual sections


")

ZWx Time value of the section in which output Is continued

XA

Hold point Continuation point Permissible region XA Output value

Figure 5-1 l Principle of operation

Continuation mode 3: Continue from an externally preset continuation point After removal of the hold signal, output continues from an externally preset point. The continuation value is first read in under the specified address, and is then searched for on the time schedule curve from the hold point. Output continues when the value has been found. Parameters Data
DW2 DW3

Format
KM KY

Description

B No.3 : FK.F3 i t
Address: Value range:

= 1 Continuation mode 3 selected

DBNo. l to 255

., 0

DWNo. to 255

Continuation mode 4: Approach the next interpolation point After removal of the hold signal, the next interpolation point is approached from an arbitrary value at a selectable speed, and output of the time schedule then continues. The user must preset continuation mode 4: FK.F4 = 1 and must assign parameters FW:(continuationvalue) and FSTEI: (continuation slope) at the latest before removal of the hold signal. Continuation value FW is arbitrary within the permissible value range. The continuation slope FSTEI must be positive if FW is smaller than XA and negative if XA is smaller than FW. It must be specified in 0.01 units per timebase (seconds or minutes).

Control Blocks Parameters Data


DW2 DW3 DW4

Format
KM KF KF

Description
Bit No.4 : FK.F4 = 1 Continuation mode 4 selected

FW: Continuation value Value range: -9999 to t9999


FSTEI: Continuation slope Value range: 1.. .g999

XA

@
Time

Hold point Continuation point XA Output value

Figure 5-12

Principle of operation

Assignment of parameters to inputs and outputs

Assignment to inputs Data bits in data block DBZP serve as inputs. Signal FREl (D 1.8) Output of the time schedule is enabled with signal FREl = 1. Signal HALT (D 1.9) Output of the time schedule is stopped for the duration of signal HALT = 1 . Assignment to outputs Data bits or a data word in data block DBZP serve as outputs. Message NEUWl (D 1.2) The transfer of a new value to the destination data block is reported with NEUWl and latched. The message must be reset by the user program after evaluation. Message FORT (D 1.3) The transfer of the first value to the destination data block after removal of the hold signal is reported with FORT. The message is reset with the next hold signal or removal of the enable signal. Message ENDE (D 1 .O) Reaching of the end of the time schedule is reported with ENDE. The message is removed when the enable signal is removed. Message FEHLl (D 1.l ) The FEHL 1 message reports violation of a parameter limit in the schedule curve: Continuation mode 2: - if ABSNR > number of all sections - if ABSRZ > time value of the section selected

Control Blocks Continuation mode 3:

- preset value not found in schedule in the past


- FW > 9999; FW < - 9999 - FSTEI > 9999; FSTEl < 1
The FEHL 1 message interrupts output, and must be reset by the user before the scheduler can be enabled again.
W

- User DB No. = 0

Continuation mode 4:

Message FEHL2 (D 1.4) An error message FEHL2 is issued if no continuation mode (FK.F1/2/3/4 = 0) has been set. Binary indicators ABSl 64 (D819111/l 2.0 15) Each section of the time schedule is assigned an indicator bit ABSx. This is 1 during output of the relevant section. Digital display ABSNR (DW 141) The number of the section currently being processed is displayed in binary code via display ANBSNR.

...

...

Restart: During the various types of restart (initial run, manual warm restart, warm restart after power failure), the time scheduler does not output any values. When the restart operation has ended, the time scheduler continues with the previous settings. Incorporation in the system frame software: The time scheduler must be called in PB "100 ms".

Control Blocks DBZP Data Format Descri~tion


Bit No.0 : ENDE Bit No.1 : FEHLI Bit No.2 : NEUWl Bit No.3 : FORT Bit No.4 : FEHL2 Bit No.8 : FREl

= 1 Message: Output ended

= 1 Message: Error
= 1 Message: Value output = 1 Message: Continue after
hold

= 1 Message: Setting for continuation mode missing

= 1 Enable time scheduier = 1 Stop output = 0 Timebase, seconds

B No.9 : HALT i t
Bit No.0 : FK.ZR Bit No.1 : FK.Fl Bit N0.2 : FK.F2 Bit N0.3 : FK.F3 Bit No.4 : FK.F4 when D 2.2 = 1: when D 2.3 = 1:

= 1 Timebase, minutes
= 1 Continuation mode 1 selected = 1 Continuation mode 2 selected = 1 Continuation mode 3 selected

D W ~

KF

= 1 Continuation mode 4 selected


ABSNR: Section number Value range: 1 to 64 FADR: Address of continuation value DBNo. , DWNo. 1 to 255 , 0 to 255

I lKYl
7 -

when D 2.4 = l: FW: Continuation value Value range: -9999 to t9999

when D 2.2 = 1:

ABSRZ; Remaining section time in slrn~n when D 2.4 = l: FSTEI: Continuation slope Value range: 1 to 9999 ANZ: Number of sections Value range: 1 to 64

r
ABSx

Indications: Current section (=I )


15

11111111111111

ABS49

I I

DBZP

Data
~ ~

I I

Format
1
KF 2

P-

Description
XAO: stating point, output value Value range: -9999 to +g999

DW13 DW14

KF KF

ZW1: Interpolation point P1: time Value range: S : 1 to 9999 rnin : 1 to 9999 XA1: interpolation point P1: output vai. Value range: -9999 to +g999 ZW2: Interpolation point P2: time Value range: S : 1 to 9999 rnin : 1 to 9999 XA2: Interpolation point P2: output val. Value range: -9999 to +g999

Int. pt. 1

Int. pt. 2

DW15

KF

.
ZW64: Interpol, point P64: out ut val. Value range: s : Ito 9 9 9 f min : 1 to 9999 XA64: Interpol. point P64: output val. Value range: -9999 to +g999 DW141 KF ABSNR: Section number in binary code Value range: 1 to 64

j
Int. pt. 64
1

Formal operand list Name Purpose/Description


DB time scheduler Message byte Bit No.6: NEUW = 1: New output value transferred Output

Param. Data type type


B

1 1
MELD XA

DBZP

Control Blocks
5.2.18 FB 1 19: High-speed analog output ("ANAS")

FB 119

I
SBF SUS PBER BG KN-

ANAS

XE

)U ;

-J
: :
SUS

SRS

STEB :
XE

PBER : .......

....... .......

BG KN

.......

.......

STEB

SBF

Analog values can b e output t o t h e process via analog output modules using the "High-speed analog outputn function block. The following boards are accepted: 6ES5 6ES5 243-1 AA1 l 243-1 ACl l

Input values over the range -1 0000 ... +l 0000 or 0 ... 10000 are possible, depending on the channel number selected. Lower or greater values a r e limited in the "Rapid analog output" function block. Ch. DAC on the board
0
1
2

Value range of XE
-1 0000 ... + 0000 l
-10000 ... +10000 0 ... 10000

1
2

The values c a n b e output via the standard or extended I10 areas (optional). Transfer t o t h e analog output module i disabled by setting control bit SBF. s Operation entry: The analog 110s a r e not addressed in the "Operation entry" mode.

Control Blocks
Restart modes:

The procedure for the "Initial run", "Manual warm restartwand "Warm restart after power failure" is the same as for the "Operator entry" mode. For the "Initial run" and "Warm restart after power failure", the controller inhibit output SRS is additionally set to 0. Otherwise SRS = 1 is output. SRS can thus be used to disable a following analog controller, for example, in the restart modes mentioned. This is expedient because, in these cases, the DACs of Channels 1 and 2 are preassigned 9.9951 V and the analog controller or connected actuator would receive a voltage pulse. Formal operand list Name
STEB

Purpose/Description
Control byte Bit No. 1 : SBF Output disable = 0 Normal operation, 110s are addressed = 1 110s are not addressed Controller inhibit output: = 0 for 'initial run" or "warm restart" after power failure = 1 in all other cases

Param, Data type type


I

BY

Bit No. 2 : SRS

XE

Input (= analog value to be output) Value range: 0 to 10000 or -10000 to +l0000


1 0 area 1

PBER

PBER = NP:

= EP:

Analog output module is in the standard 110 area Analog output module is in the extended I10 area I

BG

Starting address of the module

BY

Permissible values 1285 BGS 248 for PBER = NP OS BGS 248 for PBER = EP
KN

Channel number (KN + 1 = DAC on the module)

BY

5.2.19

FB 174: Dead band ("TOTZONE")

FB 174

DEAD BAND

X.
, ~ ' " ~ , ,

X*.

'

-1

I+:
;

STEB: .......
XE

: :

.......

.......

B XA

...... ......

Control Blocks
STEB
7

SBED

The dead band function suppresses a selectable range for the input value. This can b e expedient, for example, when small fluctuations of a measured variable around a certain point a r e to be disregarded. The midpoint of this band can be defined with parameter 0 and the width with parameter B. If the input value is within the dead band or zone, parameter 0 is output a s the output value. If the input value leaves the dead band, the output value rises in proponion to the input value. This results in the invalidation of the input signal also outside the dead band, but this has to b e accepted to avoid step changes at the limits of the dead band. The invalidation corresponds to the value B and is therefore easy to monitor. Operator entry: Parameters 0 and B a r e input again. Adaptive and dynamic presetting of values: Parameters 0 and B can b e preset dynamically or adaptively. They a r e passed a s new parameters if SBED = 1. SBED must always be 1 for dynamic presetting. With adaptive presetting, SBED should only be set to 1 if the values are to be accepted. When they have been passed, the user must enter SBED = 0. Formal ooerand list Name
sTEB

Purpose/Description
Control word:

II

Bit No. 7 : S B E D = 1 : Values 0 and B will be acquired

l l 1I 1 II B y II
Param. Data ltype type
I

P P

P P

--

p p

0
B

Midpoint of dead band Width of dead band

D
D

Control Blocks
5.2.20

FB 176: PID controller ("IPD-REG")

FB 176

PID controller

D
D element

MANUAL

P
SANTZ
+

can be disabled

STEW RSP SOLL IST XA OBXA UBXA ABTZ ANTZ KOlP KIT1
STEW
15

: : : : : :

........ ........ ........ ........ ........ ........ :........ :........ :........


: :

........

A(0) K/TD T1 TM THLG HAND ZElN I P

........
1 2 1 1 1 0

:........ :........ ......... :........ :........ :........ :........ ......... ......... .........
7 6 5 4 3 2 1

14

9
SD

SHAND S A M Z

SANF SHLGA SHLGE SANBUSANBO

SlNST SDEIA SlElA SPEIA SALG

SSlG SSTR

RSP

14

13

12

11

10

4
RE0

0
RAlE

RTPD RABG RTAlE RlSNE RISPO RSTR

RAIH RBED REALTREA(0)

RAALT RAA(0) RA0

Function block FB 176 represents a PID controller which operates with a Pade approximation (trapezoid controller). The sampling interval can therefore be up to half the dominating system time constant:
TA

1 ' l 2 . dominating system time

constant

Control Blocks The PID controller is of modular design. The components can be deactivated individually. The structure of the controller can be modified by locating the PD component (SSTR = 1, RSTR = 0) or only the D component (SSTR = 1, RSTR = 1) in the feedback branch (see Example 6.4). The advantages are as follows: If the P and D components are located in the feedback branch, the control behaviour becomes "bumpless" with the same rate of correction of disturbance variables. It is usually possible to dispense with the use of a setpoint integrator for avoiding step changes in the setpoint. The transfer function of the closed control loop has a constant counter, irrespective of the values of the controller parameters; the reference step response therefore exhibits minimum overshoot. If the I component is disabled (SIE/A=l) and the controller is selected in the feedback branch (SSTR=1, RSTR=l/), the P component is automatically located in the forward branch. In addition to the setpoint and actual value inputs, the PID controller has feedforward control and a MANUAL input, i.e. manual operation is possible. The PID controller can operate as a positioning controller or as a speed controller. The speed algorithm can be used with an integrating actuator. A step controller can be implemented by connecting the pulse output (FB177) in series. The transfer function of the PID controller can be represented in both multiplicative form and in additive form: Additive form:
$a=

1 P K O + K I . p +KD.l+p.T1

K1 : Integral-action time constant KD: Derivative-action time constant KO : Gain of the P component

Multiplicative form:

FRm= KP

(l

+ p . TN) . (1 t p TV) .TN . (l + p . T 1 )

where TN >> TV

KP :Gain TN :Integral-action time constant TV :Derivative-action time constant T1 :Damping time constant P :Laplace operator

Control Blocks The following restriction applies to the damping time constant:

The user has a choice of transferring the values for the multiplicative form (e.g. values from the Bode diagram) or the additive form (more modern design procedure). Make sure that this condition is also fulfilled for multiplicative presetting of the controller characteristics.
D component:

The manipulated variable of the PID controller can be falsified by limiting output XA to limits UBXA and OBXA. This particularly affects the D component because, in the event of a change in input variable, it reacts with an output signal which is only output for one sampling interval (when T1 = T A l 2 ) . If the P and l components are very great during this sampling interval, the effect of the D component is lost, i.e. it is falsified. The component which could not act on the output is therefore repeated in the following sampling intervals (with SD = 0). Particularly in the case of rapid processes and activated D component, unacceptable ripple can develop. In this case, an improvement to the control response with the damping integrated in the D component is often possible. A small T1 is generally sufficient to achieve success.
I component:

The following conditions result in stopping of the l component: Upper limit OBXA is exceeded; DI is positive and anti-windup response (external and internal controller limiting) is desired (SINST = 0). Lower limit UBXA is violated; value DI is negative and anti-windup response is desired (SINST = 0). The sign of DI is positive and the I component has been disabled by the user in the positive direction via control input RiSPO = 1 . The sign of D is negative and the I component has been disabled by the user in the negative 1 direction via control input RlSNE = 1. If the user disables the I component for one direction, he must ensure that the I component does not run to a limit and become "lockedn because of the disabled condition. In a control system, the special function "Do not stop I component" (SINST = 1) can be advantageous when there is no dead time in the process. In this case, the 1 component is not stopped when an output limit is reached. At the "speed controller" setting, it is not the output which is required but its derivative: this is represented by output DI. Dead band: The system deviation can be applied to the I component with RTA/E = 1 via a dead band with hysteresis. The dead band is set via the parameters for the upper response threshold ABTZ and lower response threshold ANTZ.

ABTZ ANTZ XET XAT

: XAT = XET becomes XAT = 0

with an absolute-value drop of XET

: XAT = 0

becomes XAT = XET with an absolute-value increase of XET

: Input of the dead band


: Output of the dead band

The dead band for the P and D components can be activated by bit RTPD. D element: To create a speed controller, the individual components of the positioning controller must be differentiated. This is achieved with a D element for the P and D components. The I component is not applied via the D element because output DI of the I component already forms the derivative of I. DI is added to the other two components after their differentiation. To avoid errors caused by limiting effects, the limit has been relocated to the D element. Since, however, output XA of the controller is to be limited to the range of values between UBXA and OBXA, the output of the D element must be restricted to UBXA-DI and OBXA-DI. Limited D elements are usually (SD = 0) repeated in the following sampling cycles. In some cases this can lead to the controller remaining in the limit for a period of time. This behaviour can be switched off with SD = 1. For the derivative-action time constant TM, the time constant of the integrating system component (actuator) must be preset. Ramp function generator: In the "Manual" controller mode (RA/H = l ) , the preset value can be controlled via the ramp-function generator. This is required when, for example, no step changes may be applied to the actuator. The ramp-function generator produces ramps from the step changes and the manual input. The ramp slopes are specified by the user by presetting parameter THLG. 10000 internal units are run through during this time. "Manual" controller mode with positioning controller: RAlH = 1; SSIG = 0 In the "Manual" controller mode, the value at the manual input is applied as a manipulated variable to the controlled system that follows. A ramp-function generator is integrated in the controller for smooth transfer from "Automatic" to "Manualn and to avoid step changes in the setpoint when making manual changes: SHLGA = 1 The ramp-function generator is always switched off. The manual value is output directly as a manipulated variable. Smooth transfer from "Automatic" to "Manual" is no longer ensured; step changes at the manual input are passed on to the actuator. SHLGA = 0; SHLGE = 0 The ramp-function generator is only operational for a smooth transfer from "Automatic" to "Manual". The manual value is output directly in the "Manual" controller mode. SHLGA = 0; SHLGE = 1 The ramp-function generator is always on. The manual value is applied via the ramp-function generator, i.e. step changes in manipulated variable after changes at the manual input are avoided.

Control Blocks "Manual" controller mode for speed controller: RAlH = 1, SSlG = 1 The user has the following choices: SHAND = 1 The manual value is output directly as the manipulated variable. Control bit SHLGE has no effect, i.e. manual presetting with a ramp-function generator is not possible in this case. It should be noted that a continuously applied signal at input HAND will bring the integrating system component to the limit. SHAND = 0; SHLGA = 1 The manual value is applied via the D element to the actuator. If time constant TM of the D element corresponds to the time constant of the integrating system component (actuator), a change in manual value results in the same scaled change of the analog actuating signal. SHAND = 0; SHLGA = 0; SHLGE = 0 The manual value is applied via the D element; the ramp-function generator is switched on for the transfer instant from "Automatic" to "Manual". SHAND = 0; SHLGA = 0; SHLGE = 1 The manual value is applied via the ramp-function generator and the D element. Output XA is limited by applying the ramp (in accordance with the slope of the ramp and TM). This corresponds to a limiting of the adjusting rate of the integrating system component (actuator). Since the speed controller does not know the state of the integrating system component (actuator) at the instant of transfer from "Automaticn to "Manual", a particular initial value must be defined: SANF = 0 At the instant of transfer, the controller assumes that the manual value currently applied corresponds to the state of the integrating system component (actuator) and uses it as the initial value for the ramp-function generator and D element. XA therefore goes to 0, i.e. if an integrating actuator is used, it stops. Only when the manual value is changed does a corresponding change take place at the actuator. SANF = 1 At the instant of transfer, 0 is assumed as the initial value. If an integrating actuator is used, it is adjusted by the value applied at input HAND at the instant of transfer. If the change in the integrating system component (actuator) does not correspond to the specified manual change, a check should be made to establish whether the derivative-action coefficient TM agrees with the integral-action time constant of the system (actuator). Transfer to the "Automatic" controller mode: If all controller components are in the forward branch, there are two possible alignment methods to compensate for the system deviation occurring on transfer to automatic mode: RABG = 0 When changing from one mode to the other, the system deviation is compensated for like a normal step change in the setpoint. If the D and P components are in the feedback branch, the mode change is burnpless with minimum overshoot.

Control Blocks
If all controller components are in the forward branch, severe overshoot can occur.

RABG = 1 A special alignment is carried out to produce the same behaviour as though the P and D components were in the feedback branch. Controller modes "Off", "On": The "Controller OFFnfunction has priority over all other controller modes. It can be used as a protective function. The response when the positioning controller is switched off (RAIE = 0) and on (RAIE = 1) can be determined by means of control bits: RAIE = 0; controller

OFF:

RA0 = 1 XA = 0 is output as the manipulated variable. RAA (0) = 1 XA = A(0) is output as the manipulated variable. A(0) must be preset by the user. RAALT = 1 The manipulated variable which was output before the controller was switched off, is retained. RAIE = 1; controller ON: RE0 = 1 The I component of the controller starts with "On as the initial value. REA(0) = 1 The I component starts with A(0). REALT = 1 The I component of the controller begins with the value which was present prior to switching on the controller.

"0" is always output when the speed controller is switched off. When the controller is switched on, the individual components are automatically adjusted, except for the I component, so that unacceptably high step changes do not occur. The system deviation is corrected. Operator entry: All factors needed for the algorithms are recomputed, i.e. new controller parameters are entered. The positioning controller retains the previous manipulated variables; the speed controller has " 0 " output during operator entry; no control action takes place.

Initial run: The positioning controller outputs the programmed initial value. The ramp-function generator is also aligned to this value. All internal factors are recomputed and the controller parameters are entered. The speed controller outputs XA = 0. Otherwise the procedure is as for the positioning controller.

Warm restart after power failure; manual warm restart: The historical value of the I component of the positioning controller is reduced by the factor corresponding to the drop in actual value: I(K) = current actual value old actual value !(K-l)

If the following cycle is still a restart cycle, the procedure is the same. The controller thus responds immediately after removal of the restart mode. The speed controller outputs XA = 0 during restart. Adaptive and dynamic presetting of values: Controller characteristics KO/P, K/TI, K/TD, T1, THLG, TM and TA can be preset dynamically or adaptively. They are entered if RBED = 1. With dynamic presetting, RBED must always be 1. With adaptive presetting, RBED should only be set to 1 if the values are to be input. After the parameters have been passed, the user must enter RBED = 0. Example: The PID controller should be set as follows:

P, D components in the feedback loop

SSTR = 1 RSTR = 0

Speed controller The characteristics are preset for the multiplicative form of the transfer function. All controller components are switched on.

SALG = 0 SPEIA = 0 SIE/A = 0 SDEIA = 0

The I component is stopped when a limit is reached

Any limit error is compensated for in the D element The ramp-function generator should be permanently on. When switching from Automatic to Manual, the position of the actuator corresponds to the manual value. In manual operation, the manual value is applied via the D element If the controller is switched off, XA = 0. When it is switched on, automatic calibration takes place.

SHLGE = 1 SHLGA = 0

SANF = 0

SHAND= 0

Control Blocks

Automztic operation
Dead band deactivated

RAIH

=0

RTA/E = 0

FB 176

PID CONTROLLER D
D element

MANUAL

KlTD

T 1

P
SAN=

= can be deactivated

STEW RSP SOLL IST XA OBXA UBXA ABTZ ANTZ KOlP KIT1

: : : : : : : :

........ ........

........ ........ :........ :........


:

........ ........ ........ ........

A(0) KlTD T1 TM THLG HAND ZElN I P

:........
:

......... :........ :........ :........ :........

........

........

......... ......... .........

STEW

RSP

X = 1 , if the parameters are to be entered and there Is no operator entry

Formal Name STEW

operand list
1

PurposelDescription Control word Bit No.0 :SSTR

Param. type

Data type

=0
=1

PID controller has normal structure P and D components in feedback branch; P component can be relocated In forward branch with RSTR = 1.

Bit No.1

:SSIG :SALG :SPEIA :SIE/A :SDE/A :SINST :SD

= 0 Positioning controller = 1 Speed controller


=0 =1 =1
Multiplicatlve form of algorithm Additive form of algorithm P component OFF I component OFF D component OFF

Bt N0.2 i
Bit N0.3 Bit No.4 Bit No.5 Bit No.6 Bit No.7

=1
=1

= 1 Do not stop I component =0


Part of D component that was not fully output Is repeated D component is not repeated
Indication: XA at upper limit Indication: XA at lower limit Ramp generator permanently on Ramp generator always off

=1
Bit No.8 Bit No.9 :SANE0 :SANBU

Bit No.10 :SHLGE Bit No.1 l :SHLGA

=1 =1 =1 =1

SHLGE = 0 und SHLGA = 0: Ramp generator is only switched on for transfer from Automatic to Manual. Bit No.12 : SANF

=0

Evaluation for speed controller; on transfer from Auto to Manual it is assumed that 'Value of actuator' = HAND -> XA = 0. 0 is assumed as initial value of actuator -> on transfer from Auto to Manual it Is adjusted in accordance with the manual value. Indication: System deviation within dead band Evaluation for speed controller: value of HAND Is applied via D element. HAND value is output direct as manipulated variable.

=1

B No.14 : SANTZ i B No.15 : SHAND i

=1 =0 =1

RSP

Counter word Bit No.0 : RAlE

=0 =1 =1

Controller OFF Controller ON and RAlE = 0

I Bii

I
(

No.1 : R40

--> XA = 0

Bit No.2 : RAA(0)

= 1 and RAIE = 0 --> XA = A(O)


=1 =1
and RAIE = 0

I Bit No.3 : RAALT


Bit N0.4 : RE0

--> XA = XA(0LD)

II

l
I

Restart with I = 0

1I

Control Blocks Formal operand list Name PurposefDescription Param Data type type
Restart with I = A[O) Restart with I = IA2 (old) Values KOIP, KITI, KITD, T1, THLG. TM and TA are entered Automatic mode Manual mode and SSTR = 1: P and D components are In feedback branch. and SSTR = 1: only D component in feedback branch. I component disabled for positive direction I component disabled for negative direction Dead band OFF Dead band ON On transfer from manual to auto. procedure Is as for a normal setpoint step change. Transfer also takes place for P, D components In forward branch as for P. D components in return branch. Only I component with dead zone P and D components also pass through dead zone

I l

I I

Bit No.5 : REA(0) Bit No.6 : REALT Bit No.? : RBED Bit N0.8 : RAIH Bit No.9 : RSTR

=1
=1

=1
=0 =1

=0
=1

I Bit No.10: RlSPO


Bit No. ll: RlSNE Bit No.12: RTAIE Bit No. 13: RABG

=1
=1 =0 =1 =0

=1

B No. 14: RTPD i t

=0 =1

SOLL

IST

I
5

Setpoint input Value range: -10000 to Actual value input

t l 0000

XA

Output of PID controller Value range: UBXA to OBXA

l l
OBXA UBXA

High limit of XA Value range: UBXA to +l 0000 Low limit of XA Value range: -10000 to OBXA

I l
ABTz

Upper threshold of dead band Value range: 0 to ANTZ

ANTZ
KOlP

Lower threshold of dead band Value range: ABTZ to 10000 Gain of PID controller Additive form of algorithm :K O Multiplicative form of algorithm : KP

Formal operand list

Name

Purpose/Description
Integral-action coefficient or integration time constant : KI C s - l J Additive form of algorithm Multiplicative form of algorithm : TN Initial value of I component Derivative-action coefficient or time Additive form of algorithm Mutiplicative form of algorithm

Param Data

type
I

type

: KD C S - ~ I : TV C S ]

Damping time constant, lag time constant of D component Csl Value range: T1> TA12 Time constant of D component Csl Should be the same as the time constant of the analog I element (actuator) Time constant of ramp-function generator C S l 10000 internal units are run through in time THLG. HAND Manual value input Evaluated in 'MANUAL" controller mode Value range: -10000 ... +l0000 Disturbance variable input Value of I component (positioningalgorithm) Value of P component Value of D component I I
D

ZElN I

D
D

Q Q Q

P
D

D
D

5.2.21

FB 177: Pulse output ("IMP-AUSG")

FB 177

IMP-AUSG

lL]

Computation of pulse duration TI

rrT
Pulse generation

llvlpH~

Control Blocks
S W 0 11

10

0
7

SPBM2 SPBMl SDPSP SDPSl

SS-SP SRMALSRMZL SAPE SA/

The "Pulse output" function block converts the manipulated variable at the output of a controller block to actuating pulses, and then emits them via binary outputs. It is not tied to a controller block. Input signal XE is limited to -1 0000 to +l0000 or 0 to 10000, according to the mode. The corresponding controller should also have these scale ranges. Otherwise an adaptation operation must be carried out. The pulses are only output in the enabled state (SA/E = 1). The user can adjust the minimum pulse duration and interval via parameter TMIN. It must be an integer multiple of 0.1s. Three-level operation; SDPSI = 1 Three-level signal for integral actuators Three-level operation is used for an integrating actuator; the controller block works with a speed algorithm. The pulses for "Actuator higher" (with positive actuating values) are output at binary output IMPH, and the pulses for "Actuator lower" (with negative actuating values) at binary output IMPT. The pulses are output as a multiple of 0.1s. Parts of pulses that cannot be output, or pulses of duration TI < TMIN, are added to the next pulse. If B TI B > TA-TMIN for the pulse duration, a pulse of duration TA is output. The excessive pulse length output is deducted from the next pulse.
If the integrating actuator is at the lower or upper limit, the user can inform the function block of these states via control inputs SRMZU (SRMZU = 0) and SRMAU (SRMAU = 0). Pulse output is then suppressed in the corresponding direction until the actuator leaves the limit.

Note: If there is no checkback signal, control bits SRMAU and SRMZU must be set to 1. Three-level operation: SDPSP = 1 Three-level signal for proportional actuators Three positioning states can be implemented in this mode in the case of temperature control, for example: IMPH = 0 IMPH = 1 IMPH = 0 IMPT = 0 + IMPT = 0 + IMPT = 1 + off heat cool

Positive actuating signals are output at IMPH and negative actuating signals at IMPT. In this case, the controller works with a positioning algorithm.

Control Blocks If the computed pulse duration to be output is Tl < TMIN, no pulse is output. However, Tl is added to the next pulse. Summating is disabled by setting the control bit for the summating disable SS-SP = 1 . If B TI B 2 TA-TMIN, a pulse of duration TA is output. The following relationship between XE and TI applies to three-level integral and proportional operation:

TI

IMPT

Figure 5 -13 Relationship between input value and pulse duration in three-level integral and proportional operation.

Very short pulses (at XE


PBM operation:

0) and intervals (at XE fir .c 10000) can be suppressed by means of TMIN.

Pulse-width modulated signal for actuators with only one input. Pulses are emitted via binary output IMPH. The negated output signal is available at IMPT. A pulse duty ratio of 1:1 can be output to the actuator for setting its operating point, by setting control bit SAPE. If the sampling interval of the controller is an odd multiple of 1OOms, the block alternately generates pulses of duration TI = 0.5 TA t 0.05 s and TI = 0.5 TA - 0.05s.
a

If TI < TMIN no pulse is output. If TI 2 TA-TMIN a pulse of duration TA is output.

There are two types of PWM operation: PBM1 operation

PBM2 operation

TA

TA-TMIN

TMlN

+ 10000

*
XE

incorporation i n the system frame software: The "Pulse output" function block must be processed at the 1OOms rate, i.e. it must be incorporated in PB "lOOmsn. Operator entry: Pulse output is inhibited during the time elapsing until the next controller run.

Restart modes: Pulse output is disabled for "Initial run", "Manual warm restart" and "Restart after power failure " .
C79000-68576-C901-02

69

Control Blocks

Formal operand list I I Purpose/Description Name

Param. Data type type

1 l1
I I

Minimum pulse duration TMlN must be a multiple of 0.1 S. Value range: 0.1 S < TMIN < TA12 Control word Bit No.0 : SAIE Bit No. l : SAPE

= 0 Pulse output OFF

= 1 Pulse output ON = 0 Normal operation


= 1 Only effective for PWM operation Pulse duty factor = 1:l

Blt No.2 : SRMZU

= 0 Checkback: final CLOSED pos. reached


(only In 3-level lnt. operation)

+ no pulse output at lMPT


=1
Bit No.3 : SRMAU Normal operatlon (only in 3-level Int. operation)

= 0 Checkbaok: final OPEN pos. reached -+ no pulse output at IMPH


=1
Normal operation

Bit No.4 : SS-SP

= 0 Normal operation = 1 Summating disable only in 3-level


prop. operation) ; summing of pulses with T1 c TMIN is disabled.

I l

I it No.9 : SDPSP I Bit No.10: SPBMl

Bit No.8 : SDPSl

= 1 3-level int. operation

I
lMPH

= I 3-level prop. operation = 1 PBMl operation


= 1 PBM2 operation

Bit No. ll: SPBM2

I l

lMPT

l I

3-level int. and prop. operation: positive actuating pulses PWM operation: pulse output

3-level int and prop. operation: negative actuating pulses PBM operation: negated pulse output

I B l

Control Blocks
5.2.22
FB 178: Coefficient element ("KOEFFIZ") FB 178

KOEFFIZ

OB
SXAGR

=l

UBXA

XA

XE : KP : OBXA :

.......
.......
m,..

UBXA : STEB : XA :

....... ....... .......

STEB
SEED SBAfE SANBO SANBU
SXAGR SXAO

In normal operation (SXAGR = 1, SXAO = l ) , the "Coefficient element" function block multiplies input value XE by the factor KP. The result can be limited to programmable values UBXA and OBXA with control bit SBAIE. Violation of the limits is indicated with bits SANBU and SANBO. Zeroing of XA: If SXAO = 0 is preset, the function block output XA is 0. The limit indications are affected.
XA = set limit

The following can be achieved with SXAGR = 0: If both limits are positive or negative, XA receives the value of the limit which is closer to zero, i.e. OBXA > UBXA > 0 --> XA = UBXA UBXA < OBXA C 0 --> XA = OBXA. If OBXA and UBXA have different signs, output XA is 0.

Note: This is only permissible if SBAIE = 1. The limit indicators are not set. It is not permissible to specify SXAO = 0 and SXAGR = 0 simultaneously. Operator entry: The new factor KP is entered. Initial run: The new factor KP is entered. Adaptive and dynamic presetting of values: Parameter KP can be preset dynamically or adaptively. It is re-acquired if SBED = 1. SBED must be continuously 1 for dynamic presetting. For adaptive presetting, SBED should only be set to 1 if new parameters are to be entered. After this, SBED = 0 must be entered. The coefficient element can be used as follows, for example: As a pure P controller For assembling observer structures Formal operand list

Gain factor Upper limit of XA Value range: UBXA to +IOOO Lower limit of XA Value range: -10000 to OBXA Control byte Bit No.0 : SXAO Bit No.1 : SXAGR

I i IDI

OBXA

I] IDI
I

I
=Q
=1 =0

lBY

--> XA = 0
Normal operation OBXA > UBXA > 0 --> XA UBXA < OBXA < 0 -> XA OBXA > 0 > UBXA --> XA only allowed with SBAlE = Normal operation XA at low limit XA at high lirnit Umiting deactivated Limiting activated Parameter KP Is entered

= UBXA = OBXA =0
1 and SXAO

=1
Bit No.3 : SANBU Bit No.4 : SANBO Bit No.6 : SBAlE Bit No.7 : SBED

=1

=1 =0
=1 =1

Control Blocks
5.2.23
FB 179: Integral-action element ("I-GLIED")

STEW
9 8 7

SANBUSANSO SBED

SA0 SAA(0) SAALT SEA2 SEA(0) SAlE

The "Integral-action" function block integrates arbitrary input functions using the trapezoid rule.

Figure 5-14 Step response of the I element

Output A1 is presented by the "integration element". It forms the derivative of output A. This can be advantageous in status control systems. The I element can be configured with feedback. Output A2 must be used to implement the feedback loop. Input ERU must additionally b e assigned t h e factor located between output A2 and the input used (NE3 or NE4). If positive feedback is to be implemented, the negative feedback factor must be assigned t o input ERU.

Control Blocks Example:

- ERU
El

H: Feedback factor
Figure 5-15 1 element with feedback loop

With negative feedback (NE3, NE4) of the I element, the step response exhibited is in the form of Curve 1; positive feedback (El, E2) results in a step response in the form of Curve 2 .

Figure 5-16 Step response of the l element with positive and negative feedback

Output A2 i limited t o t h e value range UBA2 t o OBA2. Since A2 i used t o compute A, the limits must s s still b e preset if A2 is not evaluated. Output A contains the corresponding value calculated according to the trapezoid rule. Responses with t h e integration element deactivated: With various control bits, the user can determine the value to b e output with the I element deactivated. Depending on SAALT, SAA(0) and SAO, Output A is assigned the old value (value before deactivation), or A(0) or "On. Response when t h e integral action element is activated: Depending on control bits SEA(0) and SEA2, the initial value of the I element is A(0) or A2. Operator entry: All outputs remain unchanged. Parameters TI and T A are entered a s new parameters.

Initial run: Output A2 i s e t to the initial value A(O), and output A to 0. Parameters TI and TA a r e input. s Warm restart after power failure; manual warm restart:
All outputs remain unchanged.

Adaptive a n d dynamic presetting of values: Parameters TI and TA can be preset dynamically or adaptively. They a r e entered a s new parameters if SBED = 1. SBED must be continuously 1 for dynamic presetting. For adaptive presetting, S B E D should only b e s e t to 1 if the values a r e to b e entered. The user must then enter SBED = 0.

Formal operand list Name


El E2 NE3
I

PurposeiDescription
Input interpreted as positive Input interpreted as positive Input interpreted as negative Input interpreted as negative

Param Data lVPe type


I I
1 I

1 I
D

D
D

NE4
l

D
D

A1

Derivative of output A l-o&ut of flip-flop: to be used for feedback

- - -

A(0) TI

Initial vahe of output A2 Integration time constant: Value range: Tl _> TA12 Input for feedback: must be assigned the factor with which A2 acts on the input. Output of the integral-action element High limit of A2 Value range: UBA2 to +l0000 Low limit of A2 Value range: -70000 to OBA2 I

ERU

D D D

Q
I

OBM

STEW

Control word Bit No.0 : SAlE Bit Bit Bit Bit Bit Bit Bit Bit No.1 No.2 No.3 No.4 N0.5 N0.7 No.8 No.9 Integral-action element deactivated Integral-action element activated Restart with A(0) Restart with A2 (old) and SAIE = 0 --> A = A (OLD) and SAlE = 0 --> A = A(0) and SAlE = 0 --> A = 0 Parameters TI and TA will be input Indication: A2 at high limit Indication: A2 at low limit

: SEA(0) : SEA2 : SAALT : SAA(0) : SA0 : SBED : SANBO : SANBO

Control Blocks

5.2.24

FB 188: Dead time element ("TOTZEIT")


--

FB 188

DEAD TIME

DB-T STEB A(O)

XA1

XE

E x
T3 1

XA2

XA3

DB-T XE

:
:

STEB T1 T2

....... : ....... : ....... : .......


....ss.

T3 A(())

a 1 m 2 m 3

....... ....... : .......


:
:

....... :.......
:

STEB
7

SEED

SEIA3

SEIA2

SEIA1

SAA

SEA(0)

Up to three dead times can be implemented in a control loop with the "Dead time element" function block; their variables can be preset adaptively. The maximum magnitude of a dead time is:

Tfmax= 125. TA.


The dead times are programmed by specifying the factors. If the factor preset for a dead time is too great, it is limited to 125. All three dead times have a common input XE. This means that a value present at XE at instant t will be output at XA1 at instant t + T l , at XA2 at instant t + T2 and at XA3 at instant t + T3. All three dead times can be activated and deactivated independently of each other. This is achieved by clearing (ON) and setting (OFF)control bits SE/Al, SE/A2 and SE/A3. If a dead time is deactivated and control bit SAA = 0, there is no transfer to the output. If SAA = 1, control bit SEA(0) is decisive as to whether 0 (SEA(0) = 0) or A(0) (SEA(0) = 1) is output. The storage space required to implement the dead times must be made available in data block DB-T by the user. The length of the data block must be 261 DWs including the DB preheader.

Control Blocks Restart, Operator entry: The dead times are initialized. If control bit SEA(0) is reset, the value 0 is emitted at the outputs until the corresponding dead time has elapsed. The procedure is analogous for SEA(0) = 1. Instead of the value 0, however, the programmable value A(0) is output. Adaptive and dynamic presetting of values: Dead times T1, T2 and T3 can be preset dynamically or adaptively. They are entered as new parameters if SBED = 1. SBED must be continuously 1 for dynamic presetting. For adaptive presetting, SBED should only be set to 1 if the dead times are to be set again. The user must then enter SBED = 0.
A dead time may only be extended if a duration equal to the new dead time has elapsed since the last initialization.

Formal operand list Name


DB-T XE

Purpose/Description
Data block Input

Param. Data type type


B
I

STEB

Control byte Bit No.0 : SEA(0) Restart, operator entry or SElA = 1 and SAA = 1: =O XA. =O = l XA. = A(0)

BY

Bit No.1 : SAA

= 0 and SEIA = 1: No transfer to XA = 1 and SEIA = 1: XA depending on SEA(0) = 1 Dead time 1 OFF = 1 Dead time 2 OFF

I
I

Bit No.2 : SElAl Bit N0.3 : SEIA2 Bit No.4 : SElA3 Bit ~ 0 . 7 sBED :

= 1 Dead time 3 OFF = 1 The factors for the dead times are
entered as new parameters

IT1 l
lT2 l
lT3 I
I

Factor for generating dead time l: Dead time 1 = T1 Value range: 0 S T l S 125 Factor for generating dead time 2: Dead time 2 = T2 Value range: 0 S T2 S 125 Factor for generating dead time 3: Dead time 3 = T3 Value range: 0 5 T3 S 125 Initial value of outputs XA

- TA
TA

1 IBY
I

1 lBy1
I lBYl
I
l

. TA

40)

I /

xA1

Output of dead time 1 Output of dead time 2 Output of dead time 3

XA2 XA3

I 1

I / D / I Q Dl

Control Blocks
5.2.25 FB 189: Time average ("ZEITMWT")
FB 189
SEIA

ZEITMWT

ERMI

,XE

!T - 2
I
I I I
X

SERSX

XE : STEB : N :

.......

....... .......

ERMI : A(0) :
X A :

....... ....... .......

STEB
-

SEED

SERS SA(0)

SA0

SElA

The "Time average" function block forms the average value from a number of values, determined with Parameter N, acquired at time T i X TA (i = 1,2,3, .). The maximum number of values is 10.

..

Initialization: The block requires an initialization phase to collect sufficient historical values. During this time, no average value can be formed from the preset number of values. The user can select the value to be output during this phase:
m

0, if SA0 = 1 Programmable value A(0) if SA(0) = 1 The average value formed from the historical values currently present (SA0 = SA(0) = 0)

The average value element can be bypassed with control bit SEIA. In this case, XA = XE. Control bit SERS can be used to initiate output by the block of the programmable substitute average value ERMI.

Restart:
The block branches to the intialization phase as described above.

Control Blocks Adaptive value presetting: The number of values used for average value formation can be changed adaptively. This is done by setting input bit SBED. Since the initialization phase described above is initiated in this cycle, SBED must be reset by the user.

list Formal 0 ~ e r a n d

Name
XE STEB

Purpose/Description
Input Control and signal byte Bit No.0 Bit No.1 BitNo.2
: SEIA

Param. Data type type


I D

: SA0

=0 =1 =1

XA = XE Average value fornation Restart with XA = 0 Restart with XA = A(0) Restart with XA = average value from old values currently present and SElA = 1: XA = ERMl Number N Is entered as new parameter; The initialization phase is initiated on removal of SBED l
BY

:SA(O) = l SA0 = SA(0) = 0

Bit No.7 : SEED

=1

Number of historical values

ERMl

Substitute average value Restart value Output

D D D

I
Q

5.3

Fuzzy blocks FB l 13: Fuuification ("FUZ:FUZW)

5.3.1

DBNR

:.....

l
The "FUZ:FUZWfunction block is used for fuzzifying an analog value. Specify a selectable data block (DB or DX block) when you call FUZ:FUZ. The DBNR parameter has been set up in KY format for this purpose. Specify in the H byte whether a DB or a DX block will be used. '0' in the H byte specifies a DB block, and '1 ' means DX. Enter the block number of the DB or DX block in the L byte. Before, you must have entered the number of samples of the membership function in the data block. The samples of a membership function must rise in exact monotony. Membership functions may overlap. Before calling, the application program must copy the current analog value into the DBIDX. After FUZ:FUZ has been executed, the membership degrees of the membership function are available in normal and negated form in the DBIDX. The 'error' bit (bit 8 of data word 0) will be set if an error has occurred during execution (insufficient DB length).

Caution: The FUZ:FUZ data block modifies the contents of BS 60 and BS 61.

il
l

Fuzzy Blocks

DB-FUZ

Formal parameter: Name DBNR Purpose/Description Data block with fuzzification parameters Param. type D Data type
KY

5.3.2

FB 116: Defuuification ("FUZ: DFUZ")

The "FUZ:DFUZWfunction block permits an analog value to be defuzzified from a number of membership degrees. The DBNR parameter Specify a selectable data block (DB or DX block) when you call "FUZ:DFUZW. has been set up in KY format for this purpose. Specify in the H byte whether a DB or a DX block will be used. '0' in the H byte specifies a DB block, and '1 ' means DX. Enter the block number of the DB or DX in the L byte. Before, you must have entered the number of samples of the membership function in the data block. The samples of a membership function must rise in exact monotony. Membership functions may overlap. Select the defuuification method in data word 1. Two different methods are possible: The MIN-MAX inference method and the faster MAX-DOT or MAX-PROD method. METHODE = 2 employs the MINMAX method for computation. Any other entry uses the MAX-DOT method. The MAX-DOT method requires the 'operator input' (BIT 15) of data word 0 to be set before the first call and upon each alteration of the membership functions. FUZ:DFUZ resets the 'operator input' bit. The entry 'implicit zero rule' permits a degree of membership to be used as an implicit zero rule. The effect of the implicit zero rule is, in good approximation, such as if a rule had been established for this degree of membership that addresses any elements of the rule matrix that have not explicitly been addressed. 'Implicit zero rule' = 0 means no implicit zero rule. The 'HA' bit in data word 0 (bit 9) toggles between a manual value that must be entered in the data double word 2, and the computed analog variable 'Aus'. 'HA' bit = 1 means using the manual value. Before calling, the application program must copy the current analog value into the DBIDX. After FUZ:DFUZ has been executed, the 'Aus' analog variable is available in the data double word 4 of DBIDX. In addition, the 'Diff-Aus' output variable is available in the data double word 6. 'Diff-Aus' reflects the variation of 'Aus' since the last execution.

Fuzzy Blocks

The 'error bit' (bit 8 of data word 0) will be set if an error has occurred during execution (insufficient DB length)
Caution:

The FUZ:DFUZ data block modifies the contents of BS 60 and BS 61.


1

l
l

l
l

DB-DFUZ

Data
I

Format

Description
I

DW 0 DW 1 DD 2

IKY
l

Operator inputlHAlerror, quantity


I

KY KG

Method, implicit zero rule Manual value

/
DD 6 DW 8

AUS:

output value

KG

Diff-Aus: Difference of output value

lnternal values DW 18
1

DD 23 DD 25

KG

/ /

p 2 [l] : 2nd sample ~ p 3 [l] : 3rd sample ~ p4x [ l ] : 4th sample W [ l ]: Degree of membership
l st membership function

KG KG

DD 27

1
1

I
!
l

1
1

[l] : Weighting factor

1
DD 37

Internal values 11 1

i
l

/ I

2nd function

I membership

DB-DFUZ
Data item
DD 19+ (n-1)*18 DD21+ (n-1)*18 DD 23 (n-1)*18 DD 25+ (n-1) * 18 DD 27+ (n-1)*18 DD 29+ (n-1)"18 DW 31+ (n-1)*18 Internal values [nl DW 36+ (n-1)*18 Formal parameter: Name DB Purpose/Description Data block with defuzzification parameters Param. type D Data type
W

Format
KG

Description
p1X [n] : lst sample p2x [n] : 2nd sample

KG

p3x In] : 3rd sample p4x [n]: 4th sample ~ [ n ] Degree of membership : Gew, [n]: Weighting factor nth members hip function

KG
KG

KG

Programming Data

6
6.1

Technical Data
Programming data

I
Biock nirmber 14 20 23 38 Block name MATHE ANL-MINI 249 89
44

CPU 948,CPU 946(R)1947(R)


Library number P71 200-S 9014-A-. . 6020-A-. 6023-A-. 6038-B-. 6039-B-. 6061-B-.. 6062-B-.. 6063-B-.. 6069-B-. 9078-A-. 9079-A-. 6084-3-.

I
249 90
45

CPU 945
Library number ~71200-S 3014-B-. . 3020-B-. Assignment for previous values *

I
-

Block length '

Assignment for Block previous values ' length '

ORG-MINI
RETTEN LADEN GLAETTEN PID-REG ANLAUF ORGAN1 ANEl ANAU EINFGLAT

107 98 132 370 198 353 238 128 101

39 61 62 63 69 78 79 84

. . . .
1

3023-B-. . 3038-B-. . 3039-B-. . 3061-B-. 3062-B-. 3063-B-. 3069-B-. 3079-B-. 3084-B-.

49 49 132 371 201 355 238 128 102

12

1
. . . .

. . . . . .

12

3078-B-. .

Words

Programming Data

CPU 928B, CPU 928, CPU 922

KOEFFIZ TOTZElT
7 89

314 235

9188-A-. . 9189-B-..

ZElTMWT

Words * * Values in brackets apply to CPU 922

Programming Data

Block number

CPU 948
0.16 ms 0.03 ms 0.03 ms 0.12 ms 0.12 ms 0.10 ms 0.22 ms (0.03i0.06 ms (0.03+0.06 rns 0.06 ms 0.05 rns 0.08 ms 0.09 ms 0.16 ms 0.02 ms 0.07 ms 0.09 ms 0.13 ms 0.04 ms 0.14 m * * * 0.06 m 0.02 ms 0.34 ms*** 0.10 ms* 0.15 ms" 0.07 mS (in the first run 0.25 ms) 0.05 ms 0.05 ms 0.26 ms 0.10 ms 0.05 ms 0.10 ms 0.09 rns 0.06 ms
k) k)

CPU 9461947
0.54 ms 0.12 ms 0.11 ms 0.18 ms 0.34 ms 0.34 ms 0.66 ms (0.45+0.23 ms (0.42i0.2 ms 0.18 ms 0.13 ms 0.25 ms 0.21 ms 0.58 ms 0.04 ms 0.21 ms 0.3 ms 0.68 ms 0.1 ms 0.42 m " s* 0.2 ms 0.03 ms 1.05 m * * * 0.5 ms* 0.8 ms" 0.88 m 0.16 ms 0.12 ms 0.76 ms 0.38 ms 0.18 ms 0.37 ms 0.34 ms 0.19 ms
k)
k)

CPU 945
0.05 ms 0.05 ms 0.01 ms 0.07 ms 0.07 ms 0.03 ms 0.07 rns (0.06+0.02 rns (0.05i0.03 ms 0.03 ms 0.02 ms 0.03 ms 0.06 ms 0.04 ms 0.01 ms 0.02 ms 0.02 ms 0.1 ms 0.01 ms 0.05 m * * * 0.02 m 0.01 ms 0.11 ms"* 0.04 ms* 0.12 ms" 0.05 ms (in the f r t run is 0.11 ms) 0.02 ms 0.02 ms 0.09 ms 0.04 ms 0.02 ms 0.04 ms 0.03 ms 0.02 ms
k)
k)

CPU 928B
0.49 ms 0.05 ms 0.03 ms 0.13 ms 0.13 ms 0.7 ms 0.6 ms (0.3t0.4- k) ms (0.2i0.3. k) ms 0.16 ms 0.16 ms 0.65 ms 0.18 ms 0.45 ms 0.03 ms 0.33 ms 0.52 ms 0.62 ms 0.1 ms 0.6 m * * * 0.3 ms 0.09 ms 1.1 rns4**

CPU 928
3 rns 0.53 rns 0.3 ms 0.64 ms 0.63 ms 2.1 ms 4.8 ms (1.1i1.97 ms (2t1.53 k) rns 1.59 ms 1.24 ms
l .57 ms
k)

CPU 922
4.63 rns

14 20 23 38 39 61 62 63 69 78 79
84

0.75 rns 0.72 ms 3.17 rns 7.8 ms (1.4i2.5 rns


k) k)
l

'
I
l

(12.16t2.15 rns 2.25 rns 1.67 rns 2.53 rns 2.5 rns 5.6 rns 0.38 rns 2.36 rns 2.62 ms 7.95 rns 1 ms

95 96 98 99 104 111 112 113 114 115 116 117 'l8 119 174 176 i n 178 179 188 189

1.66 ms 3.53 ms 0.28 ms 1.46 ms 1.6 ms 5.72 ms 0.7 ms 3.5 m*** 2 ms 0.21 ms 6.1 rns"* 3.5 ms* 4.96 ms*' 4.8 ms 1.37 ms 1 ms 6.25 ms 2.5 rns 0.9 ms 2.13 rns 2.9 rns 1.76 rns

I
I

3.2 ms 0.29 rns

0'4
0.19-0.86 rns (in the f r t run is 2.3 ms) 0.16 ms 0.33 ms 0.83 ms 0.52 ms 0.21 ms 0.75 ms 0.22 ms 0.75 ms

6.2 ms* 8.1 ms** 8.4 rns l .B ms 1.42 rns 10.1 rns 4 rns 1.34 rns 3.25 rns 3.9 rns 2.66 ms

1
1
I

1
I

...

without control k: Number of control loops with control for 7 match functions respectively; for DFUZ MAX-PROD methods and without 'implicit zero rule'

Characteristics of Some Temperature Sensors

6.2

Characteristics of some temperature sensors

Platinum resistance thermometer (Pt 100) according to DIN 43760

Characteristics o f Some T e m ~ e f a t ~ f e Sensors


Copper-constantan thermocouple (Cu-CuNi) according to DIN IEC 584 Part 1

Characteristics of Some Temperature Sensors

iron-constantan thermocouple (Fe-CuNi) according to DIN IEC 584 Part 1

Characteristics of Some Tem~erature Sensors


Nickel-chrome-nickel thermocouple (NiCr-Ni) to DIN IEC 584 Part 1

Characteristics of Some Temperature Sensors

Nickel-chrome-nickel thermocouple (NiCr-Ni) to DIN IEC 584 Part 2

Characterisf;cs of Some Temperature Sensors


Platinum-10% rhodiumlpiatinum thermocouple (Pt-RhPt) according to DIN 584 IEC Part 1

Characteristics of Some Temperature Sensors


Platinum-10% rhodiumfplatinum thermocouple (Pt-RhPt) according to DIN 584 IEC Part 2

Typical Calculation of Execution Time and Memory Requirements


6.3

Typical calculation of execution time and memory requirements

T h e following is an execution time calculation for modular control in S5-155U with CPU 9461947:

Execution time in " 100 ms" organization block: SPA FB "SAVE" SPA FB "ORGANI" for system frame software
0.18 ms

See Technical data, Chapter 6.1


k = number of control loops in the

+ 0.42 ms +k ' 0.20 ms

system frame software

Execution time of the FBs in " 100 m s n PB SPA FB " RESTORE"

+ ... ms

+ 0.18 ms

... ms

Every 100 m s Depends on scan rate and displacement time per 100 ms (see Table below)

Execution time of the FBs

+ ... ms

FB No.

TA
0.18 0.18 0.76 0.13

2 *TA

3 'TA

4 * TA
0.18 0.18 0.76 0.13

5 *TA

TA=100ms
1s t control loop

li
I

78 78 176 79

1
0.18 0.18 0.76 0.13

I
l

TA = 300 m s TV=Oms

/l/
I

1
I

78 78 176
79 78 78 176 79 0.18 0.18 0.76 0.13 2.5

0.18 0.18 0.76 0.13 0.18 0.18 0.76 0.13 1.25 1.25 1.25

l 2nd control loop

TA = 300 m s TV = 0 m s
3rd control loop
TA = 300 m s

1
l
I

!
I

! I i!

0.18 0.76 0.13 2.5

TV=Oms Every 100 m s


jj

'

l
i

Taia

i1

Typical Calculation of Execution Time and Memory Requiremenfs

The following is a memory requirement caIculation for modular control in S5-155U with CPU
9461947:
1 * length of 08 20:

Header a n d block end "RESTART" FB call once per system frame software As for OB 20 As for OB 20 Header a n d block end "SAVEw FB call "ORGANI" FB call once per system frame software "LADEN" FB call

1 * length of 05 21: 1 * length of OB 22:


1 * length of OB 13:

1 * length of DB:

Saving t h e scratchpad flags Once per system frame software k = number of control loops

1 * length

o "ODAT" DB: f

k * length of "INTER" DB:

Organizational data Start a d d r e s s of history values Interface and parameters of t h e FBs called History values and auxiliary variables of the FBs

k * length of " 100 m s n PB


k * length of "Sampling" PB 1 1 1 1 l 1
* *

For k control loops For k control loops Once length o FBs called f See Technical data in Chapter 6.1

* * *

length length length length length length

of "RESTART" FB:

o "RESTART" FB: f of "RESTART" FB:


of "RESTART" FB: of "RESTART" FB: o " .........." FB: f

Typical Calculation o f Execution Time and Memory Requirements

The following is a n execution time calculation for fuzzy control in S5-135U with CPU 9288: ANZ-EING ' execution time of "FUZ:FUZW FB: ANZ-EING * 0.6 ms ANZ-AUSG ' execution time of ANZ-AUSG ' l . l ms "FUZ:DFUZn FB: Number of inputs with 7 membership functions Number of outputs with 7 membership functions, MAX-PROD method, and without implicit zero rule Constant paR Number of ANDIOR operations Number of parentheses pairs

l ' execution time of "FUZ:RULEn FB:

0.012 ms ms ANZ-KLAMMERPAAR *0.007 ms

+ ANZ-UNDIODER ' 0.008


=

... ms

1 ' execution time of "FUZ:APPW:

+ ANZ-EING + ANZ-AUSG

0.009 rns * 0.005 ms * 0.005 ms

Constant part Number of inputs Number of outputs

... ms

Typical Calculation of Execution Time and Memory Requirements

The following is a memory requirement calculation for fuzzy control in SS-135U with CPU 9281928
B:

Length of one "FUZn DB:

+ ZF-EING

9 DW * 12 DW

=
ANZ-EING

' length of one "FUZ" DB

... DW ... DW
24 DW

Constant pan Number of membership functions per input

Number of inputs Constant part Number of membership functions per output

Length of one "FUZn DB:

+ ZF-AUSG ' 18 DW
=
ANZ-AUSG " length of one "FUZ" DB Length of the "RULE" DB: + EFF-MAX-KLAMMERTIEFE

... DW ... DW
5 DW ' 2 DW

Number of outputs Constant part Effective (=after optimization) maximum nesting depth

=
1 ' length of "FUZ:FUZn FB 1 " length of "FUZ:DFUZ" FB
1 * length of "FUZ:APPn FB

... DW
137 DW 395 DW

Once length of FBs called See Technical data in Chapter 6.1 Constant part Number of inputs Number of outputs

13 D W +ANZ-EING * 3 DW +ANZ-AUSG ' 3 DW

=
If DB. blocks are used: . 1 * length of the "FUZ:RULEn FB

... DW
Constant part Number of rules Number of ANDiOR operations Number of parentheses pairs

11 DW +ANZ-REGELN ' 5 DW +ANZ-UNDIODER ' 5 DW +ANZ-KLAMMERPAAR ' 4 DW

--

=
If DX blocks are used: 1 ' length of the "FUZ:RULEn FB

... DW
Constant part Number of rules Number of ANDlOR operations Number of parentheses pairs

11 DW +ANZ-REGELN ' 7 DW +ANZ-UNDIODER * 7 DW +ANZ-KLAMMERPAAR * 6 DW

Single-Loop Confrol (3-Level Int. Operation)

Examples
All examples described are for the CPU 9461947 and 948. If the examples run on the CPU 928, 9288 the following adaptations should be made:

m For flags savelload data blocks are to be used for each level. r The number of the 0 8 is to selected in accordance with the required sampling interval.
If the examples run on the CPU 945, process simulation must be carried out using the blocks from modular PID and fuzzy control. Note: The process simulation package is no longer available for the CPU 945.

Likewise the interface block must be replaced by a self-written program.


7.1

Single-loop control with setpoint adjuster, PID controller and pulse output (3-level int. operation) Slide valve Controlled system Sensor

Transducer

Programmable controller

Figure 7-1 Process diagram

The following are assumed as ideal: Slide valve with motor actuator : Integral action, TI = 1s Controlled system Sensor and transducer : Proportional action : Proportional action with delay KS = 2

For the test, the controlled system is simulated with the program for software process simulation (FB 64 - FB 66). A time extension factor of 10 is introduced to improve the observability of the control response.

Single-Loop Control (3-Level Int. Operation) This results in the following values:

"

TI = 10s

KS = 2

T1

= 20s
ACTUAL

h -

Figure 7-2 Structure of the controlled system

The following function blbck is used to link the controller with the controlled system simulation program:

Network 1 NAME : Schnitt

:= D 27.7 :L DD134 :L KG+1600000+05 ::G :L KG+5000000+00 :-G :L KG+2000000+05 :XG :C DBlO :T DD44 :BE
Solution:

Conversion of transfer and simulated actual value

1 Definition of the control structure; since the process is simulated by software, an analog input can be dispensed with. The setpoint is applied via the setpoint adjuster. Standard function block IPD-REG is chosen as the controller (speed algorithm). The actuating signals are output via the pulse output module (3-level integral-action operation). The PID controller and pulse output module thus constitute a step controller. The real sampling interval should be 0.5s. TA = 5s will be selected because of the time extension.

Single-Loop Control (3-Level Int. Operation)

SET Setpolnt setter


'

lMPH PID speed controller

r Pulse output
module

~MPT

ACT

a
Simulated controlled system

2 Defining t h e interconnections (data interfacing)


, -

FB 176

I IPD-REG
D
SANBO FB 177 SANBU '

FB 96

l SOSTELL
SXA2

HAND

ZElN

IMP-AUSG

IST

XA XE

SHAUF SHZU

IMPH SXAl SOLL I IMPT


P

SE
SANfZ

SE SXAl SXA2 TIAN TlAB

: DD23 : DD25 : DD27 : DD29 : DD31

IST XA T1 : DD33 OBXA STEW : DW35 UBXA A(0) : DD36 A N R OBSO: DD38 @,p UBSO : DD40 KJTI

: DD44 : DD46 : DD48 : DD50 DD52 : DD54 :~ ~ : DD58

TM THLG HAND ZElN I P D 5 6

: DD66 : DD68 : DD70 : DD72 : DD74 XE : DD46 I M P H : M1O.O : DD76 TMlN : DD80 IMPT : M10.1 : DD78 STWO : DW82

Single-Loop Control (3-Level Int. Operation)

DB"INTERn

Single-Loop Control (3-Le vel Int. Opera tion) 3 Defining the data blocks: Data block to save the scratchpad flag area: DB 15 DB"ODATn: DB 5 Length of DBwODAT"= 256 + 2 1 DB"INTERn: DB 10 The length of DB "INTER" is determined by the choice of function blocks and actual operands. When entering the actual operands in the configuration diagrams, it is advisable to simultaneously draw up an I/Q/F reference list of DB "INTER" to avoid illegal double assignments (see Step 2).

In this case, the result is: Organizational data and interface and parameter area Old values of setpoint adjuster (FB 96) Old values of PID controller (FB 176) Old values of pulse output (FB 177) Total

83 10 23 3

DWs DWs DWs DWs

119 DWs (without preheader)

4 Transfer of all required blocks to the programmable controller The following blocks must then be located in the programmable controller memory:

DB 5 DB 10 DB 15

OB 13 OB 20 (OB 21) (OB 22)

FB FB FB FB

38 39 63 69

FB 96 FB 176 FB 177

(without controlled system simulation

5 Developing the system frame software according to Section 3 (for test purposes, it may be advantageous to store the system frame software separately on floppy disk). PBn1O0ms" = PB10 PBnAbtast" = PB11

Data DD13 DD15 DW29 DW31 DW32 DW33

Format

Description Sampling interval 1 Sampling interval 2 Address of last control loop PB"100ms". PB 'Sampling" Shift time, clock number DB"INTER"

Value

KG KG KF KY KY KY

+ 5000000+01 + 0000000+00

+ 00031

. input bit (bit 0)

. 011 000 . 001 010 . 000


010

Single-Loop Control (3-Level Int. Operation)

OB 20121122
JU FB63 Name : RESTART KF+O AG : ART : KF+O ODAT: KF+5

FB "RESTART"

OB"1OOmsn

i
FB "SAVEn

PB"100m~"

JUFB38 Name : SAVE DBNR: DB15

_ U PBWSamling"

r-l

JU FB69 Name : ORGAN1 ODAT: KF+5

FB "RESTORE"

Figure 7-3 System software

Single-Loop Control (3-Level Inf. Operation)


6 Incorporating the required control block in the program blocks

PBlO Network 1 :JU FBI77 NAME :IMP-AUSG XE : DD46 TMIN : DD80 STWO : DW82 IMPH : M 10.0 IMPT : M 10.1 :BE PB11 Network 1 :JU FB96 NAME :SOSTELL SE : DD23 SXAl : DD25 SXA2 : DD27 TlAN : DD29 TlAB : DD31 T1 : DD33 STEW : DW35 A(0) : DD36 OBSO : DD38 DD40 UBSO : :JU FBI76 NAME :IPD-REG STEW : DW42 RSP : DW43 DD25 SOLL : IST : DD44 XA : DD46 DD48 OBXA : UBXA : DD50 ABTZ : DD52 DD54 ANTZ : KOIP : DD56 KIT1 : DD58 A(0) : DD60 KlTD : DD62 T1 : DD64 TM : DD66 THLG: DD68 DD70 HAND : ZElN : DD72 I : DD74

PB "100ms" Pulse output call

PB "Sampling"

PID controller call

Single-Loop Control (3-Level Int. Operation)


7 Parameter assignment for the control blocks (entering the parameters, e.g. gain, integral-action time constant, etc. in DB "INTER")

DB" INTER"
Data DD23 DD25 DD27 DD29 DD31 DD33 DW35 DD36 DD38 DD40 DW42 DW43 DD44 DD46 DD48 DD50 DD52 DD54 DD56 DD58 DD60 DD62 DD64 DD66 DD66 DD70 DD72 DD74 DD76 DD78 DD80 DW82 Format KG KG KG KG KG KG KM KG KG KG KM KM KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG KM Designation SE SXAllSOLL SXA2 TiAN TlAB T1 STEW

FB
SOSTELL SOSTELLIIPD-REG SOSTELL SOSTELL SOSTELL SOSTELL SOSTELL SOSTELL SOSTELL SOSTELL IPD-REG IPD-REG IPD-REG IPD-REGIIMP-AUSG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IMP-AUSG IMP-AUSG

Value

+ 2000000+02

+ 2000000+02 + 3000000+01
00000000 10000001 0000000+00 +1000000+05

NO)
OBSO UBSO STEW RSP IST XAlXE OBXA UBXA ABTZ ANTZ KOlP KIT1 AN) KITD T1 TM THLG HAND ZElN I P D TMlN STWO

- 1000000+05
00001000 001 00010 00000000 l0010011

+1000000+05

- 1000000+05
+ 2000000+01

+ 2000000t02
+ 0000000+00 + 2000000+02

+ 2000000+01
+ 1000000+00

+ 1000000+00
00000001 00001 101

For the test, the programs for controlled system simulation and the interface (FB 200) must be transferred to the programmable controller. The blocks must be incorporated in O 20 and OB 13 and B then assigned their parameters.

Single-Loop Control (3-Level Int. Operation) 0820 NETWORK 1 :JU FB63 NAME :ANLAUF AG : KF+O ART : KF+O ODAT : KF+5 :JU FB65 NAME :NEUSTART DB-S : DBlOO DB-P: DBlOl DB-T : DB103 :BE

Restart program: Modular control

Restart program: Software process simulation

OB13 NETWORK 1 :JU FB38 NAME :RETTEN DBNR : DB15 :JU FB69 NAME :ORGAN1 ODAT : KF+5 :JU FB64 :PROCESS : DBl 00 : DBI 01 : DB102 : DB103

Save flags

Control

Software controlled system simulation

NAME DB-S DB-P DB-Q DB-T

:JU FB 200 NAME :SCHNITT :JU FB39 NAME :LADEN DBNR : DB15 :BE

Interface

Restore flags

The control response can be monitored via programmer function FORCE VAR or by plotting the setpoint, value of the manipulated variable and actual value curves.

Single-Loop Control (3-Level int. Operation)


7.2

Single-loop control with PID controller and pulse output (3-level proportional operation)

The task is to control a furnace with three functions: HEAT, OFF, COOL.

""""F1 Actuator Furnace r'--" COOL = IMPT The controlled system is simulated again. Characteristics of the controller:

------------

Figure 7-4 Schematic representation of the controlled system

n The controller is to be operated with the PD component i the feedback loop.


Pulse output: TMIN = 0.1
S

Single-Loop Control (3-Level lnt. Operation)

The controlled system is simulated for the test. The following modified FB 200 (cf. 6.1) is used as the interface program: FB200 NETWORK 1 NAME : SCHNITT :A DBlOO :UN M 5.0 : SPB =M001 :L KG+l000000+01 :T DD25 :JU =M002 M001 :UN M 5 . 1 :SPB =M003 :L KG+0000000+00 :T DD25 : JU =M002 M003 : L KG+5000000+00 :T DD25 M002 : L DD134 :L KG+1600000+05 ::G :L KG+5000000+00 :-G :L KG+2000000+05 :XG :A DB10 :T DD26 : BE Solution: 1 Defining the control structure

, M5.1 M5.0

Transfer of correcting signals: to simulate a proportional actuator for three-point signals, the following assignments are made:

= 1 --> lnput value, controlled system =l =0 M5.0 = 0 --> lnput value, controlled system =O
M5.1 = 1 M5.0 = 0 --> lnput value, controlled system =0.5 M5.1 = 0

Conversion and transfer of the simulated actual value

Simulated process

2 Defining the configuration structure

Single-Loop Control (3-Level Int. Operation)

FE 62

PID-REG
FB 177
D
XA XE

IMP-AUSG

I ST

SANBO SANBU

IMPH IMPT

-SRMAU
S 0 LL STEW : DW23 SOLL : DD24 IST : DD26 XA : DD28 OBXA : DD30 UBXA : DD32 KOlP : DD34 WTI A(0) K/TD P 1 D
: DD36 : DD38 : DD40 : DD42 : DD44 : DD& : DD48

SRMZU

XE : DD28 TMlN : DD50 S W 0 : DW52

IMPH : M 5 . 0 IMPT : M 5.1

Single-Loop Control (3-Level Int. Operation)


3 Defining the data blocks

Data block to save the scratchpad flag area: DB 15 DB"ODATn: DB 5 Length of DBwODAT" = 256 + 2 1 *DB"INTERn: DB 10 Length of DB "INTER" Organizational data and interface and parameter area 53 DWs Old values of PID controller (FB 62) 12 DWs Old values of pulse output module (FB 177) 3 DWs Total 68 DWs (without preheader)

4 Transfer of all required blocks to the programmable controller

The following blocks must then be located in the programmable controller memory: DB 5 DB l 0 DB 15 OB 13 OB 20 (OB 21) (OB 22) FB FB FB FB 38 39 63 69 FB 62 FB 177

5 Creating the system frame software (or loading the system frame software stored on floppy disk)
PB"lOOmsn =PB10 PB"SamplingV = PBI 1 DB " ODAT"
Data DD13 DD15 DW29 DW31 DW32 DW33 Format Description Sampling interval 1 Sampling interval 2 Address of last control loop Value

KG
KG KF

+ 5000000+01

+ 0000000+00
+ 00031
010 , 011 000 , 001 010 , 000

KY

PB" 100msW.PBWSampling" Shift time, clock number DBWINTER", input bit (Bit 0)

KY
KY

Single-Loop Control (3-Level Int. Operafion)

6 Incorporating the required control blocks in the system frame software PBl 0 Network 1 :JU FBI77 NAME :IMP-AUSG : DD28 XE TMlN : DD50 STWO : DW52 IMPH : M 5.0 IMPT : M 5.1 :BE PBl l Network 1 :JU FB62 NAME :PlD-REG STEW : DW23 SOLL : DD24 : DD26 IST : DD28 XA DD30 OBXA : UBXA : DD32 KO/P : DD34 KIT1 : DD36 A(0) : DD38 KITD : DD40 T1 : DD42 P : DD44 I : DD46 D : DD48 :BE PB "100ms" Pulse output call

PB "Sampling" PID controller call

Sinale-LOOD Control (3-Level Int. Ooeration)


7 Parameter assignment for control blocks (entering of parameters, e.g. gain, integral-action time constant, etc. in DB "INTER"). DB" INTER "
Data DW23 DD24 DD26 DD28 DD30 DD32 DD34 DD36 DD38 DD40 DD42 DD44 DD46 DD48 DD50 DW52

Format
KM KG KG KG KG KG KG KG KG KG KG KG KG KG KG KM

Designation STEW SOLL IST XAlXE OBXA UBXA KOlP KlTl A(O) KlTD T1 P I D TMlN

FB PID PID PID PlDllMP PID PID PID PID PID PID PID PID PID PID IMP IMP

Value
00010000 01010001
-

1000000+05 1000000+05 4300000+00 2040000-01 1000000+05 1750000+02 2500000+01

1000000+00 00000010 00000001

SW0

') This value is chosen because the process begins with internally scaled value 0 after a cold start. This value corresponds to -10000 scaled units of the control system (see interface program). For the test, the programs for process simulation and interface (FB 200) must be transferred to the programmable controller. The blocks must be incorporated in OB 20 and OB 13.

OB20 NETWORK 1 :JU FB63 NAME :ANLAUF AG : KF+O ART : KF+O ODAT: KF+5

Restart program: Modular control

Restan program: Software controlled system simulation NAME :NEUSTART DB-S : DB100 DB-P : DB101 DB-T : DB103 :BE 0813 NETWORK 1 :JU FB38 NAME :RETTEN DB : DB15

Save flags

Single-Loop Control (3-Level int. Operation)

:JU FB69 NAME :ORGAN1 ODAT: KF+5 :JU FB64 NAME :STRECKE DB-S : DBlOO DB-P: DBlOl DB-Q : DB102 DB-T : DB103 :JU FB200 NAME :SCHNIlT :JU FB39 NAME :LADEN

Control

Software process simulation

Interface

Restore flags

7.3

Multivariable control (burner control)

The task is to control the burner of a smelting furnace by controlling the gas and air supply via integrating-action actuators.

Actuator Gas OFF

Gas supply lCombustlon process

----------+Y

I I I I

r---------- 7
Furnace
I

I I I I I

l
Air ON Air OFF

1 l I L .I I I I

---------- J

I I

L
Legend: XG Actual value, gas XL Actual value, air X Actual value, temperature

, , - , , , , , - , , J

Figure 7-5 Schematic representation of the controlled system

Single-Loop Control (3-Level Int. Operation) Controlled system data: Actuator, gas : TIG = Gas supply : KPG = Actuator, air : TIL = : KPL = Air supply Furnace : TU =

100s 0.75 100s


1 29 min

TG = 92 min

KPO = 10

Polygon function: XA = f(XE)

Figure 7-6 Relationship between gas-air ration and heating The controlled system is simulated and time compression with a factor of 10 is implemented. The result is: TIG = KPG = TIL = KPL = TU = KPO= 10s 0.75 10s 1 175s TG = 550s 10

Single-Loop Control (3- Level Int. Operation)

Solution:
1 Defining the control structure SET S E T > P I D ACT
PID controller controller

ACT* Speed

-algorithm -

SET

F
2
XL X

PID , controller
&orkhm

AC S eed

Controlled system simulation

,Gas OFF Gas ON L ~ f OFF t 1~ut-t ON

VF XG XL X

: : : :

Ratio factor Actual value, gas Actual value, air Actual value, temperature

Single-Loop Control (3-Level Int. Operafion)

2 Defining t h e configuration structure

FB 62

PID-REG

FB 176

IPD-REG
D

<X>
HAND

ZEIN
D

FB 177
SANBO SANBU-

IMP-AUSG

<y>
IMPH

X4 IST

SOLL

XA XE

SAN30 SANBU IST

I P SANTZ

IMPT

P
I

STEW
STEW SOLL IST XA OBXA UBXA KOIP

: DW23 : DD24
: DD26 : DD28 : DD30 : DD32 :DD34

Krrl A(0) KTD

T1
P I D

: DD36 : DD38 : DD40 : DD42 : DD44


: DD46 :DD48

RSP SOU. IST


OBXA UBXA ABTZ ANTZ KOIP

: DWSO : DW51 : DD28 : DD52 : DD54 : DD56 : DD58 : DD60


: DD62 : DD64 : DD66

A(0) K m T1 TM

lHLG

HAND
ZElN I P D

~m

: DD68 : DD70 : DD72 : DD74 : DD76 : DD78 : DD80 : DD82 : DD84 : DD86

SRMAU
SRMZU

XE
TMlN

: DD54 IMPH : DD88 IMPT

: A 5.0 : A 5.7

S W 0 : DWSO

XL

FB 176

IPD-REG
D

HAND

FB 178

KOEFFIZ

ZElN SANBO SANBU

FB 177

SANBO SANBU

IMP-AUSG

IST
,

XA XE
I

IMPH.

XE
XA SOLL

IMP7

STEW RSP SOU IST OBXA UBWI XE


KP

: DW100 A(0) : DD118 T


: DWlOl : DD98 : DD102 : DD1W : DD106 : DD108 Z: DD110 : DD112 : DD114

SANTZ

SRMAU

: DD52
: DD91 : DDS3

UBXA STEJ
XA

: DD95
: DR97

O3XA

: DD98

YAP

KAD T1 TM THLG HAND ZElN I P D

: DD120 : D D 1 2 SRMZU : DD124 : DD126 : DD128 : DD130 :DDlW : ~ ~ 1 3 XE 2 : DD134 TMlN : DD138 : DD136 S W 0 : DW140

IMPH : A 5 . 6 IMPT : A 5.7

Single-Loop Control (3-Level Int. Operation)


DB"INTERn

IPD air
IPD air IMP air DW90
KM

IMP air

DD91

COEF gas

Single-Loop Control (3-Level Int. Operation)

DB"INTERn

DD132

IPD gas

DD136

A memory location was reserved for all parameters, because this is a test program and possibilities of variation must be available. If there is a need to save storage space in a system, the parameters not required can be grouped at preset locations. The outputs not required are assigned a common scratchpad (DW 17 .. D W 22).

Single-Loop Control (3-Level Inf. Operation)

3 Defining the data blocks


Data block to save the scratchpad flag area: DB 15 DB"ODATn: DB 5 The overall control structure comprises three control loops which include the following: -PID-REG (temperature) -1PD-REG, IMP-AUSG (air) -KOEFFIZ, IPD-REG, IMP-AUSG (gas) The length of DBwODAT"istherefore as follows: Length of DB"ODATn = 256 + 2 3.
m

Since the three control loops are to be interconnected, a common DB "INTER" is assigned to them. Length of DB "INTER": Organizational data and interface and parameter area Old values of the PID controller (FB 62) Old values of the PID controller (FB176) . 2 Old values of the coefficient element Old values of pulse output module (FB 177) Total 141 12 46 2 2 6 DWs DWs DWs DWs DWs

207 DWs (without preheader)

4 Transfer of all blocks required to the programmable controller. The following blocks must then be located in the programmable controller memory:

DB 5 DB 10 DB 15

OB 13 OB 20 (OB 21) (OB 22)

FB FB FB FB

38 39 63 69

FB 62 FB 176 FB 177 FB 178

Sinale-Looo Control (3-Level Int. O~erafion)

5 Developing the system frame software 6 program blocks are required for the three control loops.
Temperature control loop: TA = 2s Shift time = 0 PB*lOOmsn = P B 1 0 PB "Sampling " = PB 11 Air control loop: TA = 0.5s PB"lOOmsU = PB 15 PB "Sampling" = PB 16 Gas control loop: TA = 0.5
S

Shift time = 1

Shift time = 2

The sampling interval and shift times are chosen so that only one controller must be processed with one run of OB 13.

Data DD13 DD15 DD17 DW29 DW31 DW32 DW33 DW34 DW35 DW36 DW37

Forrnat

Description Sampling interval 1 Sampling interval 2 Sampling interval 3 Address of last control loop PB" 100ms" , PB"SamplingW (temp. )

Value

KG
KG

+ 2000000+01

+ 5000000+00 + 0000000+00
+ 00037
010 , 011 000 , 001 010 , 000 015

KG

KF
KY

KY
KY
KY

Shi time, clock number


DBWINTER", input bit (Bit 0) PB" 100msW,PB"Sarnp1ing' (air) Shift time, clock number DB"INTERW, input bit (Bit 0) PB"lOOms", PB"Samp1ing' (gas) Shift time, clock number DB'INTER" , Input bit (Bit 0)

. 016

KY
KY

001 , 002 010 , 000 020 , 021 002 , 002 010 , 000

KY
KY KY

DW38 DW39

Single-Loop Control (3-Level Int. Operafion)

OB 20121122
JU F063 Name : ANLAUF AG : KF+O ART KF+O ODATI KF+5

FB" RESTART" Temp. PB" l o o m s "

PBWSamling"

\
/
PB"100ms"

PBWSamling"

PBW100ms"

PB"lOOmsn
JU FB38 Name : RETTEN DBNR: DB15

FB "SAVE"

-FB" ORGANI" Temp.


JU F069 Name : ORGANI ODAT: KF+5

PB"100ms"

PBnlOOms"

/
F0 "RESTORE"
Name : LADEN DB15 DBNR :

PBnlOOms"

Figure 7-7 System frame software

Single-Loop Control (3-Level Inf. Operation) 6 Incorporating the required control blocks in the system frame software Temperature control loop: PBl l Network 1 :JU FB62 NAME :PID-REG STEW : DW23 SOLL : DD24 DD26 IST : : DD28 XA OBXA : DD30 UBXA : DD32 KOlP : DD34 KlTl : DD36 A(0) : DD38 KlTD : DD40 : DD42 Tl P : DD44 I DD46 : DD48 D :BE PB10 NETWORK 1 :BE PB "Sampling" of temperature control loop PID controller call

PB "1OOmsn of temperature control loop

Single-Loop Control (3-Level Int. Operation) Air control loop: PB16 Network 1 :JU FBI76 NAME :IPD-REG STEW : DW50 RSP : DW51 SOLL : DD28 IST : DD52 XA : DD54 OBXA : DD56 UBXA : DD58 DD60 ABTZ : DD62 ANTZ : KOIP : DD64 KKl : DD66 A(0) : DD68 KKD : DD70 T1 DD72 TM : DD74 THLG : DD76 HAND : DD78 ZElN : DD80 I DD82 P DD84 D DD86 :BE PB15 Network 1 :JU FBI77 NAME :IMP-AUSG XE : DD54 TMlN : DD88 S W 0: DW90 IMPH : A 5.0 IMPT : A 5.1 :BE PB "Sampling" of air control loop IPD controller call

P% " 100ms" of air control loop

Pulse output call

Single-Loop Control (3-Level lnf. Operation) Gas control loop: PB21 Network 1 :JU FBI78 NAME :KOEFFIZ XE : DD52 KP : DD91 OBXA : DD93 UBXA : DD95 DR97 STEB : XA : DD98 :JU FBI76 :IPD-REG : DW100 : DW101 : DD98 : DD102 : DD104 : DD106 : DD108 : DD110 : DD112 : DD114 : DD116 : DD118 : DD120 DD122 : DD124 : DD126 DD128 : DD130 DD132 DD134 DD136 :BE PB "Samplingn of gas control loop Coefficient element call

IPD controller call

NAME STEW RSP SOLL IST XA OBXA UBXA ABTZ ANTZ KOIP KIT1 A(0) KITD T1 TM THLG HAND ZElN l P D

PB20 Network 1 :JU FBI77 NAME :IMP-AUSG : DD104 XE TMlN : DD138 SW0 : DW140 IMPH : A 5.6 IMPT : A 5.7 :BE

PB "1 00ms" of gas control loop Pulse output call

Single-Loop Control (3-Level Int. Operation)


7 Parameter assignment of control blocks

DB "INTER"
Data DW23 DD24 DD26 DD28 DD30 DD32 DD34 DD36 DD38 DD40 DD42 DD44 DD46 DD48 DWSO DW5l DD52 DD54 DD56 DD58 DD60 DD62 DD64 DD66 DD68 DD70 DD72 DD74 DD76 DD78 DD80 DD82 DD84 Format KM KG KG KG KG KG KG KG KG KG KG KG KG KG KM KM KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG KG Designation STEW SOLL IST ( X ) XA/SOLL OBXA UBXA KO/P KIT1 A(O) KlTD T1 P I D STEW RSP ISTIXE (XL) XAIXE OBXA UBXA ABTZ ANT2 KOlP KIT1 A(O) KlTD T1 FB PID temp. PID temp. PID temp. PID temp. IPD air PID temp. PID temp. PID temp. PID temp. PID temp. PID temp. PID temp. PID temp. PID temp. PID temp. IPD air IPD air IPD air COEF gas IPD air IMP air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air IPD air
t

Value
00000000 00000001

1000000+05

- 1000000+05
+
+
+ +
5000000+00 2100000+03
OOOOOOO+OO

1000000+03 1000000+02

00001000 00100010 00000000 l1001001

+ -

1000000+05 1000000+05

+ +

7000000t00

+ 4000000t01
0000000+00

TM
THLG HAND ZElN
1

1000000t02

Single-Loop Control (3-Level Int. Operation)


DB " INTER"
Data
DD86 DD88 DW90 DD91 DD93 DD95 DW97 DD98 DW100 DW101 DD102 DD104 DD1 06 DD1 08 DD110 DD1 12 DD1 14 DD116 DD118 DD120 DD122

Format
KG KG K M KG KG KG K M KG KM

Designation
D TMlN SW0 KP OBXA UBXA

FB IPD air IMP air IMP air COEF gas COEF gas COEF gas

Value

+ +

1000000+00 00000001 00001 101 6666666-01 10000000+05

- 10000000t05
1100001 1

STEB

COEF gas COEF gas IPD gas IPD gas IPD gas IPD gas IPD gas IMP gas IPD gas IPD gas IPD gas IPD gas IPD gas IPD gas IPD gas IPD gas IPD gas

XAISOLL STEW RSP IST (XG) XAIXE OBXA UBXA ABTZ ANT2 KO/ P KIT1

00000000 001 0001 0 00000000 l1001001

KM
KG K G K G K G KG K G K G K G K G K G K G

1000000+05 1000000+05

+
+

1000000+01 1000000+01 O O O OO OOO+O


OOOOOOO+OO

NO)
KITD T1

O O O OO OOO+O
+

~ ~ 1 2 4 KG DD126 DD128 DD130 DD1 32 DD134 DD136 DD138 DW140 K G KG KG KG KG K G K G

TM
THLG HAND ZEIN I P D TMlN SW0

IPD gas
IPD gas IPD gas IPD gas IPD gas IPD gas

15ooooo+o2

IPD gas
IPD gas IPD gas

1000000+00 O O O O 00001101 OOOl

KM

Control with PD Component


7.4

Control with PD component in forward branch and PD component in reverse branch

A s a n example of a system that is more difficultto control, a double integral-action controlled system with a lag element of the first order is chosen. A disturbance variable acts on the input of the first I element.

Figure 7-8 Schematic representation of the controlled system

Process values:

T1 = 0.5 s Tll=ls T12= l S

Solution: 1 Defining the control structure

Analog input

PI D controller

Analo outpup

2 Defining the configuration structure


FB 62

PID-REG

FB 95

ANES

MD5

XA IST
L

XA ANBO ANBU

XE

ER
RS

SBU
,SOLL STEW : DW37 SOLL : DD38 IST :~ ~ XA :~ ~ OBXA: DD42 UBXA : DD44 KOIP : DD46 WTI A(0) WTD 3 2 ~1 0 4 P

M D9 MD1

STEB : DR34 PBER : DW23 BG : DL24 KN : DR24 VEER : DL25

VMAX NA ER XA

: DD26 : DD28 : DD30 : DD32

I
D

: DD48 : DD50 :~ ~ 5 2 : DD54 . : DD56 STEB : DR34 : DD40 : DD58 XE : DD60 PBER: DW35

BG : DL36 KN : DR36

Control with PD Component


DB"INTERn

DD54 DD56 DD58 DD60

KG
KG

T1

PID PID PID PID

P I

KG KG

The control bytes of the input (ANES) and output (ANAS) are combined. This is possible because the control bits with all inputloutput blocks have been distributed so that control bits of the same type and same name are located over each other, whilst bits of different types are located side by side.lf the control bytes of all inputloutput functions were combined, the pattern would be as follows:

SFB

SBU

SBU

SSTR

SLOG

SUS

SBF

SER A

Transfer to the 110s is disabled for block ANAU and for block ANAS by setting bit 1.

Control with PD Component


. .

3 Defining the data blocks


Data block for saving the scratchpad flag area: DB 15 DBnODAT": DB 5 Length of DB"ODATn = 256 DBnINTER": DB 10 Length of DB "INTER": Organizational data and interface and parameter area Old values of rapid analog input (FB 95) Old values of PID controller (FB 62) Old values of rapid analog output (FB 119)
- -

+2

1.

61 DWs 0 DWs 12 DWs 0 DWs

Total

73 DWs (without preheader)

4 Transfer of all blocks required to the programmable controller

The following blocks must then be located in the programmable controller memory: DB 5 DB 10 DB 15 OB 13 OB 20 (OB 21) (OB 22)

5 Developing the system frame software with TA = 0.2s PBnlOOms" = P B 1 0 PB"Samplingn = PB 11.

Control with PD Comoonent 6 Incorporating the required control blocks in the system frame PBlO NETWORK 1 :BE PB11 Network 1 :JU FB95 NAME :ANES DR34 STEB : PBER : DW23 BG : DL24 : DR24 KN DL25 VBER : VMAX: DD26 NA : DD28 ER : DD30 : DD32 XA :JU FB62 NAME :PID-REG STEW: DW37 SOLL : DD38 DD32 IST : : DD40 XA OBXA: DD42 UBXA : DD44 KOfP : DD46 K/TI : DD48 A(0) : DD50 K/TD : DD52 T1 : DD54 P : DD56 : DD58 I : DD60 D :JU FBI19 NAME :ANAS STEB : DR34 XE : DD40 DW35 PBER : BG : DL36 : DR36 KN PB "Sampling " READ IN ACTUAL VALUE

COMPUTE MANIPULATED VARIABLE

OUTPUT MANIPULATED VARIABLE

Control with PD Component


7 Parameter assignment of control blocks

The following controller parameters are set: K = 0.0723s-I 1 K = 0.3472 O KD = 0.8333 S T1 = 0.1 S DB "INTER"
Data DW23 DW24 DW25 DD26 DD28 DD30 DD32 DW34 DW35 DW36 DW37 DD38 DD40 DD42 DD44 DD46 DD48 DD50 DD52 DD54 DD56 DD58 DD60 Format KC Designation PBER BG VBER VMAX KN FB ANES ANES ANES ANES ANES ANES ANESIPID STEB PBER BG STEW SOLL XAIXE OBXA UBXA KOlP KIT1 A(O) KITD T1 P KN ANESIANAS ANAS ANAS PID PID PlDlANAS PID PID PID PID PID PID PID PID PID PID 0,O NP 144 , 1 00010100 01000001

Value
NP 144 , 0 2,O

KY KY
KG KG KG KG KM KC

1000000+02
OOOOOOO+OO OOOOOOO+OO

NA
ER XAllST

KY
KM KG KG KG KG KG KG KG KG KG KG KG KG

1000000t05 1000000+05 3472000+00 7230000-01 0000000+00

+ +
+

8333000+00 1000000+00

I
D

The controller is first programmed so that all controller components are located in the forward branch, i.e. SRUK = 0

Control with PD Component

SET-

--K*L
+L
l

L
Figure 7-9

Controlled system -,,,,',----' ,,,,,,-----J

P and D components in the forward branch

The structure of the controller is changed by setting control bit SRUK = 1. The P and D components are now located in the feedback loop.

L,---,---,,,-,----,------I
Figure 7-10

process

P and D components In the feedback loop

In the case of a step change in reference variable, overshoot can be greatly reduced by relocating the controller components in the feed back loop. The disturbance variable responses remain the same.

Confrol with PD Component


ACTUAL

Curve 1 : P and D components in the forward branch Curve 2 : P and D components in the feedback branch
Figure 7-1 1 Control response to a step change In reference variable

ACTUAL

Curve 1 : Disturbance variable Curve 2 : Actual value with P and D components in the forward or feedback branch
Figure 7-12 Control response to a step change In disturbance variable

Control with I Component and Reduced Observer


7.5

Status control with I component and reduced observer

Implementing status control of the system of Section 6.4. It is assumed that the value X2 cannot be measured and must therefore be simulated by means of a reduced observer. Controlled system values: T1 = 0.5 s TI1 = 1 S T2 = 1 s 1 Controller characteristics: TI = K = 1 K2 = h1 = TIB = TA = 13.824 0.347
S

0.833
0.416 1S

0.2 S

Solution:
1 Defining the control structure

SET- I POINT

Status controller W/ I component I-----------l I TI

r------C-----------1

Controlled system Tl

TI1

T12

I
I l

I I

I I

TIB

I I

I I
I

Control with IComponent and Reduced Observer 2 Defining the interconnection structure The reduced observer is implemented by means of the I element with feedback capability. Since output A2 must be used for feedback, the I element must be configured as follows:

X3

- El
=
L

I element
A A2

ERU

, NE3

I
To controller To controller

Control with I Component and Reduced Observer

The

interconnection plan

is then as follows:

FB 95

ANES

FB 119
XA

ANAS

ER

SBU

XE

RS

S T E B : DL26 PEER: DW25 E G : DL28 KN : DR28 VEER: DL29

VMAX: DD30 NA : DD32

ER
XA

: DD34 : DD62

STEE: DR61 XE : DD78 PBER: DW80

BG KN

: DL8: : DR81

FB 99
A
E2

ADDITION

NE3 NE4
: DD62 : DD17 NE3 : DD66 NE4 : DD17 A1 : DD23 A2 : DD23 A ( 0 ) : DD17

SANE0 SANBU A2 A1

E2

XA

E3

El

TI

E2

ERU

: DD44 : DD17 A : DD68 OBA2 : DD19 UBA2 : DD21 STEW:D W 4 6


L

STEB: DL61 ~1 : DD68 E2 : DD66 E3 : DD76

W1 : DD55 Kp2 : DD57

KP3 : DD59 XA : DD78

FB 179

I ELEMEN" FB 99
ADDITION

- El E2

A SANBO SANBU
A2

_,.NE3 .NE4 El E2 NE3 NE4 VBER: D K 9


: DD64

,.

El E3

3-

A1
: DD47 ERU : DD53 A : DD74 OEA2 : DD19 UBA2 : DD21 STEW: DW49

TI

: DD17 : DD72 : DD17 A1 : DD23 A2 : DD70 A ( 0 ) : DD17

STEB: DRM EI : DD66

W 1 : DD53 : DD55
KP3 : DD17 XA : DD76

E2 E3

: DD74 : DD17

FB 95
ER

ANES

FB 99

ADDITION

XA

El
E3

2 -

S E E: DK7 PEER: DW25 BG : D K 8 KN : DR27 VBER: 3L29

V W : DD30 NA : DD40 ER : DD42 XA : DD66

STEB: DL50 El

W 1 : DD51
KP2 : DD53

E2 E3

: DD66 : DD70 : DD17

KP3 : D317 XA : DD72

Control with I Component and Reduced Observer DB"INTERn

3 Defining the data blocks (Saving of flags is omitted) DBnODAT": DB 50 Length of DBnODATn= 256 DB"INTERn: DB 51
Length of DB "INTERn

+2

l.

Organizational data and interface and parameter area Old values of the rapid analog input (FB 95) 3 Old values of the I element (FB179) . 2 Old values of the summing element (FB99) . 3 Old values of the rapid analog output module (FB 119)

82 0 8 12 0

DWs DWs DWs DWs DWs

Total

102 DWs (without preheader)

4 Transfer of all blocks required to the programmable controller The following blocks must then be located in the programmable controller memory:

DB 50 DB 51

OB 13 OB 20 (OB 21) (OB 22)

FB FB

63 69

FB 95 FB 99 FB 119 FB 179

5 Creating the system frame software PBnlOOms" = PB 60 PB"Samplingn = PB 61

6 Incorporation of the control blocks required in the system frame software. It should be noted that value NE3 must be calculated before the I element call in the observer.

PB60 Network 1 :BE PB61 Network 1 F895 :JU NAME :ANES STEB : DL26 PBER : DW25 BG : DL28 KN : DR28 DL29 VBER : DD30 VMAX : : DD32 NA ER : DD34 : DD62 XA :JU FB95 NAME :ANES PB "Sampling" READ IN PROCESS VALUES READ IN SETPOINT

READ IN X3

Control with I Component and Reduced Observer

STEB : PBER : : BG : KN VBER : VMAX : : NA ER : : XA

DR26 DW25 DL28 DR29 DL29 DD30 DD36 DD38 DD64

0
READ IN X1

:JU FB95 NAME :ANES STEB : DL27 PBER : DW25 : DL28 BG KN : DR27 DL29 VBER : VMAX : DD30 : DD40 NA : DD42 ER : DD66 XA

***

Network 2 FBI79 :JU NAME :I-GLIED E : DD62 E2 : DD17 DD66 NE3 : NE4 : DD17 A1 : DD23 : DD23 A2 A(0) : DD17 TI : DD44 DD17 ERU : A : DD68 DD19 OBA2 : DD21 UBA2 : STEW : DW46

COMPUTE I COMPONENT

:*

**

Network 3 :JU FB99 NAME :ADDITION STEB : DL50 El : DD66 : DD70 E2 : DD17 E3 KP1 : DD51 KP2 : DD53 DD17 KP3 : XA : DD72

COMPUTE X2; REDUCED OBSERVER COMPUTE NE3

Control with I Component and Reduced Observer


:JU FBI79 NAME :I-GLIED : DD64 El : DD17 E2 NE3 : DD72 NE4 : DD17 A1 : DD23 : DD70 A2 A(0) : DD17 TI : DD47 ERU : DD53 A : DD74 DD19 OBA2 : UBAP : DD21 DW49 STEW : FB99 :JU NAME :ADDITION DR50 STEB : El : DD66 E2 : DD74 : DD17 E3 KP1 : DD53 KP2 : DD55 KP3 : DD17 XA : DD76

:* * *

Network 4 :JU FB99 NAME :ADDITION DL61 STEB : El : DD68 : DD66 E2 : DD76 E3 KP1 : DD55 KP2 : DD57 DD59 KP3 : : DD78 XA FBI19 :JU NAME :ANAS STEB : DR61 XE : DD78 DW80 PBER : BG : DL81 : DR81 KN

MANIPULATED VARIABLE COMPUTE MANIPULATED VARIABLE

OUTPUT MANIPULATED VARIABLE

Control with I Component and Reduced Observer


7 Parameter assignment for control blocks

Data DD17 DD19 DD21 DD23 DW25 DW26 DW27 DW28 DW29 DD30 DD32 DD34 DD36 DD38 DD40 DD42 DD44 DW46 DD47 DW49 DW50 DD51 DD53 DD55 DD57 DD59 DW61 DD62 DD64 DD66 DD68 DD70 DD72 DD74

Format KG KG KG KH KS KM KY KY KY KG KG KG KG KG KG KG KG KM KG KM KM KG KG KG KG KG KM KG KG KG KG KG KG KG

Deslgnatlon Value: 0 Value: 10000 Value: -10000 Scratchpad location PBER STEB STEB BG VBER VMAX NA ER NA ER NA ER T1 STEW TI STEW STEB KP1 KP2lERUIKP1 KP2IKP1 KP2 KP3 STEB XAIEI XAIE1 XAINE3lE1 /E1 /E2 AIE1 E2lA2 XAlNE3 AIE2 STEB STEB KN

FB

Value 0000000+00

1000000+05 1000000+05

ANES1, 2, 3 ANESl 1 2 ANES3 ANES1, 2. 3 ANES1, 2, 3 ANES1. 2. 3 ANESl ANESI ANES2 ANES2 ANES3 ANES3 I-GL1 I-GL1 I-GL2 I-GL2 ADD1 lADD2 ADD1 ADD1 l l-GL2 ADD2 ADDPIADD3 ADD3

NP 00000000 00000000 0,2 144, 0 2,1

("A\ES

1 KN (A~JES 2

1000000+02 0000000+00 0000000+00 0000000+00

OOOOOOO+OO
0000000+00 0000000+00

+ +

1382400+02 00000000 00100011 1000000+01 00000000 0010001l 00000000 00000000

+
+

1736111+00 4166666+00 1000000+01 3472222100 8333333~00 00000000 00000000

ADD3

STEB

ADD3 / ANAS ANES111-GL1 ANES2II-GL2 ANESSII-GLl ADDl /ADD21 ADD3 1-GL 1lADD3 ADD111-GL2 ADD1/I-GL2 1-GL2tADD2

Control with I Component and Reduced Observer


DB1'INTER"
Data DD74 DD76 DD78 DW80 DW81 Format KG KG KG KS KY Desigation AIE2 XAlE3 XAIXE PBER BG KN FB I-GL2lADD2 ADDPIADD3 ADD3lANAS ANAS ANAS Value

NP
144. 0

IST

Curve 1 : Disturbance variable Curve 2 : Process output; x2 measured Curve 3 : Process output; x2 observed
Figure 7-13 Comparison between x2 measured and x2 observed

Using Fuzzy Control for Adapting the Gain of 7.6

a PID Controller

Using fuzzy control for adapting the gain of a PID controller

The following example gives a detailed description of: Implementing a fuzzy controller in conjunction with module control blocks Using the simplified system frame software for high-speed control actions The typical application is stored in the FUZBSPST.SSD file on the diskette. The parameter data of the fuzzy controller required by the SlFLOC S5 configuration tool is stored in the FUZBSP.FUZ file that is supplied together with the configuration tool.
7.6.1

Model of the controlled system

f Many processes contain time-invariant non-linearities in the form o non-linear transfer characteristic. Typical applications are the characteristic curves o servo valves or measuring sensors, f or the titration curve of a specific acid, etc. The user frequently does not know the exact shape o the transfer characteristic. Merely the records taken during measurement permit emf pirical statements to be made about the areas in which the controller gain must be adjusted. To stimulate the controlled system, the following values are applied to the EINFGLAT and POLYGON blocks:

. .
Manipulated variable

EINFGLAT

I ir I r /
! I / -

EINFGLAT

EINFGLAT

POLYGON

Controlled variable

Figure 7-14 Structure of the controlled system

The gain o the delay elements is 1. The non-linear characteristic curve is represented by 20 f samples, and is o the shape shown in Figure 7-15. Data block DB 15 contains the exact data. f

Figure 7-1 5 Non-linear transfer characteristic

Using

FUZZY

Control for Adapting the Gain of a PID C ~ n t r ~ l l e r

KM = 00000000 00000000; K = +00000; F KG = +0000000+00; KG = +0000000+00; K = +00020; F KG = +0000000+00; KG = +7500000+03; KG = +0000000+00; KG = +7500000+03; KG = +5000000+03; KG = +8000001+03; KG = +1500000+04; KG = +1300000+04; KG = +2000000+04; KG = +1400000+04; KG = +2250000+04; KG = + 700000+04; l KG = +2400000+04; KG = +2000000+04; KG = +2600000+04; KG = +3300000+04; KG = +2800000+04; KG = +4400002+04; KG = +3200000+04; KG = +4900002+04; KG = +3600000+04; KG = +5300002+04; KG = +4500000+04; KG = +5500000+04; KG = +5000000+04; KG = +6300000+04; KG = +5300000+04; KG = +7800000+04; KG = +6000000+04; KG = +9000000+04; KG = +6500000+04; KG = +9500000+04; KG = +7000000+04; KG = +9700000+04; KG = +8500000+04; KG = +9900000+04; KG = +9000000+04; KG = +1000000+05; KG = +1000000+05; KG = +1000000+05; KG = +0000000+00; KG = +0000000+00; KG = +0000000+00; KG = +0000000+00; KG = +0000000+00; KG = +0000000+00; KG = +0000000+00;

'

Number of samples l st X value l st Y value etc.

10th X value 1 t Y value 0h

2 t X value 0h 20th Y value

Using Fuzzy Control for Adapting the Gain of a PID Controller

30th X value 30th Y value

Internal values

Using Fuzzy Control for Adapting the Gain of a PID Controller


7.6.2

Defining the control structure

To control a process, a fuzzy controller is combined with a PID controller (Figure 7-16). The fuzzy controller interprets the controlled variable and its gradients, and adjusts the gain KP of the PID controller. The PID controller output is connected to the process (here: system stimulation).

FUZ: L=

DIFF-GL

Gain KP

Setpoint

Ip D - R EG

l lI

Value of manipulated variable

4
Figure 7-1 6 Control structure

li
1

Simulated control system

The IPD-REG block is used as a PID controller. The DIFF-GL derivative block is used for computing the gradients. The FUZ:APP block calls the fuzzy controller. It is automatically generated by the SIFLOC S5 fuzzy parameter setting tool, and loaded in the programmable controller. The FUZ:FUZ and FUZ:DFUZ standard blocks are called for each input and output. The FUZ:RULE block contains the algorithm of the set of rules. It is automatically generated by SIFLOC S5 and loaded in the programmable controller.

Using Fuzzy Control for Adapting the Gain of a PID Controller 7.6.3 Membership functions and set of rules of the fuzzy controller

The controlled variable fuzzy input (INPUT 1) is subdivided into 5 different areas that correspond to the quasi-linear sections of the transfer characteristic. If an explicit transfer characteristic does not exist, individual areas of different amplification response must be deducted from the record taken during measurement. The standard ranges from 'negative large' via 'zero' through 'positive large' are selected for the gradients of the controlled variable (INPUT 2) (see Figure 7-1 7)

AREA 2

lI

INPUT 1
AREA 4

INPUT 2

CONTROUED-VARIABLE

10000

-1000

GRADIENT

1000

OUTPUT 1
Meaning

NL : Negative large NK : Negative small

VS

S L VL

0.3
P1 P2 P3 P4 ZF1 0 30 0'30 0130 0.63

KP-ADAPTATION

2.0 ZF4 1.70 2.00 2.00 2.00

ZF2 0 30 0'60 0:60 0.31

ZF3 0 63 0'90 0:90


1.21

0 PS PL

: Zero

: Posltlve small : Positive large

: : : :

Very small Small Large Very large

MFn : n-th membership function Sn : n-th sample of the rnembership function

Figure 7-17 Membership functions of the fuzzy Inputsloutputs

An IF-THEN rule is formulated for each output membership function. Large KP values are chosen for flat areas of the transfer characteristic, and small KP values for steep areas. The gradient information is used for further improving the control response during transition from one area to the next. The following set of rules has improved control quality: Rule No. 1: IF CONTROLLED-VARIABLE = AREA1 AND GRADIENT = PL OR CONTROLLED-VARIABLE = AREA2 OR CONTROLLED-VARIABLE = AREA3 AND GRADIENT = NL THEN KP-ADAPTATION = VS IF CONTROLLED-VARIABLE = AREA1 AND GRADIENT = PS OR CONTROLLED-VARIABLE = AREA3 AND GRADIENT = PL OR CONTROLLED-VARIABLE = AREA4 OR CONTROLLED-VARIABLE = AREA5 AND GRADIENT = NL THEN KP-ADAPTATION = S

Rule No. 2:

Using Fuzzy Control for Adapting the Gain of a PID Controller Rule No. 3: IF CONTROLLED-VARIABLE = AREA1 AND [GRADIENT = NL O GRADIENT = NS R OR GRADIENT = 0 ] OR CONTROLLED VARIABLE = AREA5 AND [GRADIENT = NS OR GRADIENT = 0 OR GRADIENT = PS OR GRADIENT = PL ] THEN KP-ADAPTATION = L IF CONTROLLED-VARIABLE = OR GRADIENT = OR GRADIENT = THEN KP-ADAPTATION = AREA3 AND [GRADIENT = NS 0 PS ] VL

Rule No. 4:

MAX-DOT inference with approximated center-of-gravity computation has been selected as the inference method. All weighting factors remain 1. 7.6.4 Defining the parameters of the modular control blocks

The parameters of the PID controller are set according to the adjustment rules of the SIEPIDS5 controller commissioning tool. The following values result for the IPD-REG block: KP = 0.3

- 2.0

: is adapted by the fuzzy controller

Determining the gradient of the controlled variable is the only task of the derivative-action element. The DIFF-GL block has the standard values assigned.

Using Fuzzy Control for Adapting the Gain of a PID Controller 7.6.5 7.6.5.1 Defining interconnection structure and data storage system Closed-loop controller blocks

All function block calls for the controller are combined inside a program block (PB 20). Derivative-action, fuzzy application, and PID controller blocks are sequentially called (Figure 7-1 8). The FUZ:APP application block calls the FUZ:FUZ and FUZ:DFUZ standard function blocks and the application-related FUZ:RULE set-of-rules block.

PB20'

I
l

CLOSED-LOOP CONTROLLERS
FUZ:APP FBI76 IPD-REG FUZ:FUZ

1i
l

FBl13

HAND

D
SANBO SANBU

jl

i
i

DB : DB41'

p
STEW RSP SOLL IST
XA

OBXA

UBXA
ABTZ ANT2 KOlP

KlTl
L

: DD23 : DD24 : DD25 : DD27 : DD29 : DD31 : DD33 : DD35 : DD37 : DD39 : DD41

: DD43 : DD45 : DD47 TM : DD49 THLG : DD51 HAND : C D 5 3 ZElN : C D 5 5 I : DD57 P : DD59 D : DD61
A(0)

WTD T1

':The u s e r defines t h e blcck number

Figure 7-1 8 Interconnection structure of the closed loop controller

The user must specify the block numbers of PB 20, FB 40, 49 and DB 41-43, 49. The others are standard function blocks. The SIFLOC S5 configuration tool generates the blocks FB 40, 49, and DB 41-43, 49 and loads them into the programmable controller. The data of the modular control blocks may be stored in one single data block (DB 20). Figure 7-19 shows the exact storage of the PID controller data and the derivative-action element data.

Using Fuzzy Control for Adapting the Gain of a PID Controller

Data

Format

Designation

FB
IPD-REG IPD-REG IPD-REG IPD-REG

DW23 DW24 DD25 DD27

KM KM KG KG KG KG KG KG KG

STEW RS P SOLL IIST

/ DD29 I I DD31 I / DD33 I


DD35 DD37
~

1 I

XA OBXA UBXA ABTZ ANTZ


~

1
1
1

1 1 1

IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG

! 1 1
I

1
1 1 1 1 1

IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG

1
l

DD41

KG KG KG KG KG
-

KIT1 A(0) K/TD

1 DD43 1 DD45 / DD47 I DD49


r---

I I I I

I 1 I 1

1
1 !

TI
TM THLG HAND ZElN I

DD51 DD53 DD55 DD57

KG KG KG KG

/ /

DD59 ~ ~ ~ ~

I KG I 6KG 1
KG 6 3 KG KG KG KG KG

/ 1

P D XE
XA TD T1 OBXA

1 1

IPD-REG IPD-REG DIFF-GL DIFF-GL DIFF-GL DIFF-GL DIFF-GL

DD65 DD67 DD69 DD71

1 DD73 I
1
~ ~

KM 5 7

I I

UBXA

STEB

I 1

DIFF-GL

DIFF-GL

Figure 7-19 Data storage in the controller data block

Several data blocks a r e assigned f o r t h e fuzzy controller data. Each input or output requires o n e data block. T h e FUZ:RULE function b l o c k also requires a data block. Fuzzy Fuzzy Fuzzy Fuzzy input CONTROLLED-VARIABLE input GRADIENT KP-ADAPTATION set-of-rule d a t a

: DB 41 : DB 42 : DB 43 : DB 49

Using

Fuzzy Control for Adapting the Gain of a PID Controller

INPUT ZF1 P1 ZF1 P2 ZFl P3 ZF1 P4 W1 NW1 ZF2 P1 ZF2 P2 ZF2 P3 ZF2 P4 W2 NW2 ZF3 P1 ZF3 P2 ZF3 P3 ZF3 P4 W3 NW3 ZF4 P1 ZF4 P2 ZF4 P3 ZF4 P4 W4 NW4 ZF5 P1 ZF5 P2 ZF5 P3 ZF5 P4 W5 NW5

INPUT

Using Fuzzy Control for Adapting the Gain of a PID Controller

Using Fuzzy Control for Adapting the Gain of a PID Controller

The user must program the data exchange between fuzzy and PID controller. Data transfer between the data blocks is performed before and after the fuzzy application block has been called inside of PB 20.

Using Fuzzy Control for Adapting the Gain of a PID Controller

. a .

0000 :SPA FB 104 0001 NAME :DIFF-GL

...

OO OA : OO O B :L DD 27 OOOC :A DB 41 OO O D :T DD 1 OO O E :A DB 20 OO O F :L DD 65 0010 :A DB 42 0011 :TDD 1 0012 :SPA FB 40 :FUZ:APP 0013 NAME 0014 :A DB 43 0015 :L DD 4 0016 :A DB 20 0017 :T DD 39 0018 : 0019 : OOlA :SPA FB 176 001B NAME :IPD-REG
. . a

Controlled variable

Gradient Fuzzy controller KP gain

Each fuzzy input and fuzzy output has its fixed storage format inside a data block. The input variables are written to the DD 1 data double word of the data block selected. The outputs are read from the DD 4 data double word.

7.6.5.2

System blocks

The function blocks required for simulating the controlled system are stored in the PB 10 program block. Figure 7-20 shows the interconnection structure of the system. The sample data of the non-linear characteristic curve (Figure 7-15) has been stored in DB 15.

Using Fuzzy Control for Adapting the Gain of a PID Controller

PB10'

I STRECKE
I EINFGUT
FBU
EINFGLAT

DB-P : D015 : DD42

': The user defines the blo=k number

Figure 7-20 Interconnection structure of the controlled system

The user may specify the block number of the PB "Sampling" program block (PB 10). The system parameters are stored in the D5 10 data block (see Figure 7-21). Data Format Designation

/ DW23 /
DD24 DD26

KM KG KG KG KG KM KG KG KG KM

I
l

I
I

FB
ElNFGLATl

STEB XE Tl NO. .) XAIXE STEB T1 XAIXE XAIXE

I I

I
I

1
I

, DD28

I EINFGLATI l I L I
I

EINFGLATI

/ /

DD30 DW32

EINFGLATlfEINFGLAT2 EINFGLAT2 EINFGLAT2 EINFGLATPfPOLYGON POLYGONlElNFGLAT3

i DD33
DD37

I DD39 1 DW41 I

STEB

EINFGLAT3

Figure 7-21 Data storage structure of the system parameters

Using Fuzzy Control for Adapting the Gain of a PID Controller

7.6.5.3

interface between closed-loop controller and controlled system

Data transfer between closed-loop controller and controlled system is performed in the FB 30 function block. It is called in the same watchdog alarm block (OB 10) as the controlled system. The block is stored in the FUZBSPST.S5D file. FB 30 NETWORK 1 NAME 0005 0006 0007 0008 0009 OO OA OO OB 0000 SCHNlll :A DB 10 :L DD 46 :A DB 20
:L DD 29 :A DB 10 :T DD 24 :BE

Controlled variable

Manipulated variable

oooc

OO OD

7.6.6 7.6.6.1

Data block parameter setting Controller blocks

The data of the modular control blocks DIFF-GL and IPD-REG is stored in the DB 20 controller data block ("INTERn DB). Organizational data Interface and parameter area Old values DW 0...22 DW 23.. .75 DW 76..104

Using Fuzzy Control for Adapting the Gain of a PID Controller Figure 7-22 shows the entire DB 20 structure.

Data DWO DW15 DD17 DD19 DW23 DW24 DD25 DD27 DD29 DD31 DD33 DD35 DD37
p p

Format

Designation
System area

FE

Value 0000 0000

KH KH

1 D W I ~ 1 KF

/ KG
I KG
KM KM KG

o l d value offset
Default 0 Default l

/
IPD-REG IPD-REG IPD-REG

t76 +OOOOOOO+OO +1000000+01 00000000 00000000 00000000 10000001 +8500000+04

STEW RSP SOLL

1 KG I KG
KG KG

I I
/ I

IST XA OBXA U BXA ABTZ

/ 1
(

IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG IPD-REG

1 1 I I I

+0000000+00 +0000000+00 +1000000+05 +0000000+00 +0000000t00 +0000000+00 +4000000+00 +7400000+00 +0000000+00 +1900000+00 t5000000-01 +0000000+00

1 1
I

/ /

KG KG
-

I
1

DD39 DD41 DD43 DD45 DD47 DD49 DD51 DD55 DD57 DD61 DD63

KG KG

ANT2
KOiP K/TI A(0) K/TD T1

I
I

1
1
1

I KG
KG KG KG

IPD-REG IPD-REG IPD-REG IPD-REG

1
1

TM

' DD53

I KG
KG KG KG

I
1 I 1 / /

THLG HAND ZElN

IPD-REG IPD-REG IPD-REG IPD-REG

+0000000+00 +0000000+00 +0000000+00 +0000000t00

I P
D XE XA TD

I DD59 I KG
/

I
I I / /

IPD-REG IPD-REG DIFF-GL DIFF-GL DIFF-GL

1
/

+0000000+00 +0000000+00 +0000000+00 +0000000t00 +1000000+01


+IOOOOOO~OI

/
I

I DD65 / DD67
DD~I
DD73 DW75

I I KG I KG
p p p

KG KG

1 /

DDBS [ K G

T1
OBXA
UBXA

DIFF-GL DIFF-GL
DIFF-GL DIFF-GL

1 1
,

KG
KG KM KH
--

+1000000T05 -1000000+05 00000000 00000000 0000 0000

STEB

1 /

DW76

DW1041 KH

p -

Old value memory area

Figure 7-22 "INTER" DB of controller data

Using Fuzzy Control for Adapting the Gain of a PID Controller


The fuzzy controller data is entered via SIFLOC S5. The data blocks of the membership functions DB 41, DB 42, and DB 43 are automatically generated and loaded into the programmable controller. The rule basis is stored in the FB 49 function block and the DB 49 data block.

7.6.6.2

Blocks for system simulation

The data of the modular control blocks "EINFGLAT" and "POLYGON" is stored in the DB 10 system data block ("INTER" DB). Organizational data Interface and parameter area Old values
DW 0.. .22 DW23.. .47 DW48.. .59

Data

Format

Designation
System area

FB

Value

1
I

DWO DW16 DD17 DD19 DD21 DW23 DD24 DD26 DD28 DD30 DW32

KH

0000
Oid value offset
Default 0 Default 1 Scratchpad flags

D ~ I S KH

1
/
/
/

KF
KG

1
1

0000 +48 +0000000+00 +OOODOOO+OO +0000000+00 00000000 00000000 +0000000+00 +5000000+00


+OOOOOOO+OO

KG
KG KM KG KG KG

/
/
EINFGLATI EINFGLAT1 EINFGLATI ElNFGLATl EINFGLATIIEINFGLAT2 EINFGLAT2

STEB XE

1
1
/

1
)

T1
XAIXE STEB

KG
KM

+0000000+00 00000000 00000000

DD37 DD39

KG KG

XAlXE XAlXE

EINFGLAT2lPOLYGON POLYGONIEINFGLATS

/
1
/

+0000000+00 +0000000+00 00000000 00000000

h 4 1 - 1 KM

STEB

EINFGLAT3

DW48 6 i 5 o

KH

KH

Old value memory area

Figure 7-23

"INTER" DB of system data

Using Fuzzy Control for Adapting the Gain of a

PID Controller

7.6.7

Call structure of restart and cyclic operation

- simplified system frame software

The simplified system frame is used for implementing the call of the entire control procedure. Figure 7-24 shows the structure. 08 20/21/22 Fa20 PBIO
Name Type DBNR PBNR
: ANL-MINI

: 01112: +10 : 410

C
FB20
PB20

::item

simulation

SPA FE20

PBNR : 120 : +2000000-01

Controller structure call

...

.:0

for

OB 20: c o l d r e s t a r t ; 1 for OB 2 : m a n u a l w m r e s t a r t ; 2 for OB 22: r e s t a r t a f t e r p o w e r f a i l u r e 1

S a v e flag area
DB-P
: D3 11

SPA Fa23 Name : ORG-MINI DBNR : + l 0 PBNR : + l 0


Name

lime-controlled s y s t e m simulation call

DB-P

SPA FB39 : LADEN : Da H

Load flag area Controllerlsystem interface

Name DB-P

SPA F038 : RETTEN : DB H

Save flag area

SPA FB23 Name : ORG-MINI DBNR : t20 PBNR : +PO


SPA FB39 : LADEN : DB 11

...

P820

Time-controlled controller structure call

Name DB-P

Load flag area

Figure 7-24 Structure

The system is processed in a 100-ms cycle, and the controller in a 200-ms cycle. The sampling interval is entered in the "ANL-MINI" restart block FB 20. Specifying the numbers of the program block for "Sampling" PB and of the data block for "INTER" DB s e t s all parameters of the system frame software. Note: This example has been implemented in a 100-ms cycle in order to improve the possibility of monitoring it in SIFLOC S5. The simplified system frame software also permits faster levels to be used (the 10-ms level for example).

Using Fuzzy Control for Adapting the Gain of a PID Controller

7.6.8

Commissioning

First of all, the PID controller itself is commissioned. The controller gain is set to a constant 0.4 value. The transmission of the KP value is suppressed in the PB 20 program block, and set to constant 0.4 value. Subsequently, the fuzzy controller is connected.
7.6.9

Simulation results

Figure 7-25 shows the response of setpoint and controlled variable with and without fuzzy control. The transient recovery times of the system with a fuzzy controller are significantly shorter, and the controlled variable does not overshoot.

3 min

PID controller

Fuzzy + PID controller

l-W: setpoint 2-X: Controlled variable

Figure 7-25 Simulation results

Index

lndex
Adaptive control . . . . . . . . . . . . . . . . . . . . 1-2 Analog input FB 78 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16 High.speed. FB 95 . . . . . . . . . . . . . . . . 5-23 Analog output FB 79 ........................... 5-20 High.speed. FB 119 . . . . . . . . . . . . . . . 5-53 Average Time. FB 189 . . . . . . . . . . . . . . . . . . . .5-78

Control with PD component Example . . . . . . . . . . . . . . . . . . . . . . . . 7-30 Controller mode FB 176 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-59 Controller parameters . . . . . . . . . . . . . . . . 3-1 CPU 922 . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 CPU 928 . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 CPU 928B . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 CPU 945 . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 . . CPU 946, 947 . . . . . . . . . . . . . . . . . . . . . . 6-3 CPU 948 . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3

6-1 Block length Block name ........................ 6-1 Block number Function block . . . . . . . . . . . . . . . . . . . . 2-1

........................

Cascaded control . . . . . . . . . . . . . . . . . . . 1-2 Channel selector 0ne.out.of.two. FB 115 5-40 Characteristics 6-4 Temperature sensors Clock distribution .................... 3-6 3-7 Clock distribution system Clock number 3-7 Coefficient element 5-71 FB 178 Comparison point FB 98 5-30 Control 3-1 Modular Principle 4.1. 4-2 3-3 Control block Parameter assignment (Example) 7-8 Control loop 3-4 Address of last control loop 3-1 0 Basic data ........................ 3-7 Clock number 3-7 DB "ODATn ...................... 3-10 Example ......................... 3-8 4-3 Function block call Initialization 3-1 0 "INTER" DB 3-9 Sampling interval ................. 3-1 0 Shift time ................... 3.7. 3-1 0 Time constant ..................... 1-2 Control program Interrupt-driven .................... 3-5 Time-driven . . . . . . . . . . . . . . . . . . . . . . . 5-1 Control type ........................ 1-2 Adaptive control ................... 1-2 Cascaded control . . . . . . . . . . . . . . . . . . 1-2 Fixed setpoint control .............. 1-2 1-2 Observer structures Ratio control ...................... 1-2 Servo control ..................... 1-2

........... ............... ............. ...................... .......................... ........................... .......................... ...................... ....................... .... ........................ ........ .....................

................. ...................... .......................

Data block Fuzzy control . . . . . . . . . . . . . . . . . . . . . 4-4 Data organization . . . . . . . . . . . . . . . . . . . 3-6 DB "INTER" . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Data area . . . . . . . . . . . . . . . . . . . . . . . 3-11 Example . . . . . . . . . . . . . . . . . . . . . . . .3-12 FB 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 FB 63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 FB 69 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 Interface . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Length . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13 Number . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Organizational data . . . . . . . . . . 3-11 3-17 Parameters . . . . . . . . . . . . . . . . . . . . . . 3-11 Structure . . . . . . . . . . . . . . . . . . . . . . . . 3-11 DB "ODAT" . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Basic data . . . . . . . . . . . . . . . . . . . 3.6. 3-10 Example . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 FB 63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 FB 69 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 Length . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Sampling interval . . . . . . . . . . . . . . . . . 3-10 DDC controller . . . . . . . . . . . . . . . . . . . . . . 1-2 Dead band FB 174 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-54 FB 176 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-58 Dead time element . . . . . . . . . . . . . . . . . . . . . . FB 188 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-76 Def uuification FB 116 . . . . . . . . . . . . . . . . . . . . . . . . . .5-82 Derivative-action element

. .

PI

................

Example Control with PD component 7-30 Fuzzv control .................... 7-46 iulti;ariable control . . . . . . . . . . . . . . . 7-1 6 PID controller . . . . . . . . . . . . . . . . 7.1. 7-10 Single-loop control . . . . . . . . . . . . 7-1 7-10 Status control 7-37 Execution time calculation . . . . . . 6-1 1 6-13 Execution times CPU 922 ......................... 6-3 CPU 928 ......................... 6-3 CPU 928B 6-3 CPU 9461947 ...................... 6-3 CPU 948 ......................... 6-3

........

....................

........................

FB "ADDITION" .................... 5-31 FB "ANAS" ....................... 5-53 FB "ANAU" 5-20 FB "ANEI" 5-16 FB "ANES" ....................... 5-23 FB "ANL-MINI" 3-1 5. 5-4 FB "ANLAUF" (Restart) . 3.5. 3.15. 5.2. 5-3 FB "BCD-AUSG" 5-35 FB "DIFF-GL" ...................... 5-33 FB "EINFGLAT" .................... 5-21 FB "EXTRAUSW 5-37 FB FUZ: DFUZ" 5-82 FB "FUZ:FUZS 5-80 FB GLAETTEN 5-8 FB "GRENZSIG" .................... 5-38 FB "I-GLIED" ...................... 5-73 FB "IMP-AUSG" .................... 5-66 FB "IPD-REG" 5-56 FB "K-AUSW" 5-40 FB "KOEFFIZn 5-71 FB "LADEN" 5-1 FB "MATHE" 5-6 FB "ORG-MINI" 3.14. 3.15. 5-5 FB "ORGANI" 3.5. 3-1 5. 5-3 FB "PID-REG 5-1 1 FB "POLYGON" 5-41 FB RETTEN........................ 5- 1 FB "SOSTELLw..................... 5-26 FB "TOTZEIT" 5-76 FB "TOTZONE ..................... 5-54 FB "VERGLEI" ..................... 5-30 FB "ZEITMWT 5-78 FB "ZEITPLAN 5-44 FB 104 Derivative-action element 5-33 FB 111 Setpoint output for BCD displays 5-35 FB 112 High-low value selection 5-37 FB 113 Fuztification ................ 5-80 5-38 FB 114 Limit monitor FB 115 One-out-of-two channel selector ................... 5-40 FB 116 Defuzzification . . . . . . . . . . . . . . 5-82 FB 117 Polygon generator ........... 5-41 FB 118 Time scheduler 5-44 FB 119 High-speed analog output . . . . . 5-53 5-6 FB 14 Mathematical block FB 174 Dead band ................. 5-54

F6 176 PID controller 5-56 FB 177 Pulse output ................ 5-66 FB 178 Coefficient element . . . . . . . . . . 5-71 FB 179 Integral-action element ....... 5-73 FB 188 Dead time element . . . . . . . . . . 5-76 F6 189 Time average . . . . . . . . . . . . . . . 5-78 F6 20 Restart Mini . . . . . . . . . . . . . . . . . . . 5-4 FB 23 Organization Mini . . . . . . . . . . . . . . 5-5 F6 38 Save flag area . . . . . . . . . . . . . . . . 5-1 F6 39 Restore flag area . . . . . . . . . . . . . . 5-1 F6 61 Filter element . . . . . . . . . . . . . . . . . 5-8 F6 62 PID controller ................ 5-11 FB 63 Restart ....................... 5-2 F6 69 Organization .................. 5-3 F6 78 Analog input 5-16 FB 79 Analog output 5-20 FB 84 Single-input filter . . . . . . . . . . . . . 5-21 FB 95 High-speed analog input . . . . . . . 5-23 FB 96 Setpoint adjuster . . . . . . . . . . . . . 5-26 F6 98 Comparison point . . . . . . . . . . . . . 5-30 FB 99 Summine. point . . . . . . . . . . . . . . 5-31 . File BSP135ST.S5D FUZ135ST.S5D FUZBSP.FUZ

...............

................. ................

..

....................... ....................... ................. ...................

. . . . .

. .

.................... .................... ..................... .....................

..................... ..................... ..................... ....................... ....................... ........... .............. ...................... ....................


.....................

..................... ..................... ..... .......................... ...... ...............

Filter element FB 61 ............................ 5-8 Fixed setpoint control . . . . . . . . . . . . . . . . 1-2 Flag area . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 Restore, FB 39 . . . . . . . . . . . . . . . . . . . . 5-1 Save, FB 38 . . . . . . . . . . . . . . . . . . . . . . 5-1 Function block Block length . . . . . . . . . . . . . . . . . . . . . . 6-1 Block name . . . . . . . . . . . . . . . . . . . . . . . 6-1 Block number . . . . . . . . . . . . . . . . . . . . . 2-1 Brief description ................... 2-1 Library number . . . . . . . . . . . . . . . . . . . . 1-2 Fuzzification F6 113 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-80 Fuzzy application block . . . . . . . . . . . . . . 4-4 Fuzzy control . . . . . . . . . . . . . . . . . . . . . . . 1-3 Data block ........................ 4-4 Example ........................ 7-46 Execution time calculation . . . . . . . . . . 6-13 Memory requirement calculation . . . . 6-14 Parameter ........................ 4-4 Principle . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Fuzzy controller Parameter assigning . . . . . . . . . . . . . . . 4-5 Fuzzy set-of-rules block .............. 4-5

.............. ............

High-low value selection FB 112 .......................... 5-37 High-speed analog input FB 95 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23 Historical value . . . . . . . . . . . . . . . . . . . . . 3-2 Starting address . . . . . . . . . . . . . . . . . 3-13 Hold point FB 118 .......................... 5-47

Index
Parameter assignment Fuzzy controller . . . . . . . . . . . . . . . . . . . 4-5 PB " 100 ms" . . . . . . . . . . . . . . . . . . . . . . . 3-3 FB 63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 FB 69 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 PB "Sampling" . . . . . . . . . . . . . . . . . 3.3. 5-4 FB 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 FB 63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 FB 69 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 PID controller . . . . . . . . . . . . . . . . . . . . . . . 1-1 Example . . . . . . . . . . . . . . . . . . . . . . . . 7-10 FB 62 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 PID controller Example . . . . . . . . . . . . . . . . . . . . 5.62. 7-1 FB 176 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-56 Platinum resistance thermometer . . . . . . 6-4 Polygon generator FB 117 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-41 Program block . . . . . . . . . . . . . . . . . . . . . . 3-3 Program block numbers . . . . . . . . . . . . . . 3-4 Program structure Simplified system frame software . . . 3-14 Programmable controller identifier F6 63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Pulse output . . . . . . . . . . . . . . . . . . . . . . . . 3-3 FB 177 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-66

Integral-action element FB 179 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-73 Interrupt levels . . . . . . . . . . . . . . . . . . . . . . 5-1

Library number . . . . . . . . . . . . . . . . . . . . . 1-2 Limit monitor FB 114 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38

Mathematical block FB 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 Maximum value function .............. 4-2 Membership degree . . . . . . . . . . . . . . . . . 4-2 Membership function . . . . . . . . . . . . . . . . . 4-1 Memory requirement calculation . . . . . . . . . . . . . . . . . . . 6-12. 6-14 Minimum pulse duration .............. 3-3 Minimum value function . . . . . . . . . . . . . . 4-2 Mode "Operator entry" .................. 5-9 Model of the controlled system . . . . . . . 7-46 Modular control . . . . . . . . . . . . . . . . . 1.1. 3-1 Actual parameters . . . . . . . . . . . . . . . . . 3-1 Calling structure . . . . . . . . . . . . . . . . . . . 3-5 Clock distribution . . . . . . . . . . . . . . . . . . 3-6 Data structure 3-6 Execution time calculation .......... 6-1 1 Function block 3-1 Historical value .................... 3-2 Interface 3-1 internal arithmetic value . . . . . . . . . . . . 3-2 Memory requirement calculation 6-12 Operator entry modes . . . . . . . . . . . . . 3-18 Principle . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 System frame software ............. 3-3 Warm restart mode . . . . . . . . . . . . . . . 3-1 8 Multivariable control Example . . . . . . . . . . . . . . . . . . . . . . . . 7-1 6

.................... .................... ......................... ....

Ratio control . . . . . . . . . . . . . . . . . . . . . . . 1-2 Restart FB 63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Restart mode FB 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 FB 104 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34 FB 119 . . . . . . . . . . . . . . . . . . . . . . . . . . 5-54 Restart routine . . . . . . . . . . . . . . . . . . . . . . 3-5

OB 20 Cold restart . . . . . . . . . . . . . . . . . . 5-2 0 6 21 Manual warm restart ........... 5-2 0 6 22 Restart after power failure ...... 5-2 Observer structures ................. 1-2 Organization FB 69 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 Organizational data "INTER" data block . . . . . . . . . . . . . . . 3-15 Organizational Mini FB 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 Output variable Set of rules . . . . . . . . . . . . . . . . . . . . . . . 4-3 Overview of blocks 2.1. 2-2

..............

Pade approximation . . . . . . . . . . . . . . . . . . 5-8

Sampling controllers. digital . . . . . . . . . . . 1-2 Sampling interval . . . . . . . . 1.2. 3.6. 3.7. 5-3 Scratchpad flag area . . . . . . . . . . . . . . . . 5-1 Servo control . . . . . . . . . . . . . . . . . . . . . . . 1-2 Setpoint adjuster FB 96 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:26 Setpoint output for BCD. FB 111 . . . . . . . . . . . . . . . . . . 5-35 Shift time . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 SIFLOC S5 ................ 1.3. 4.5. 7-46 Simplified system frame software . . . . . 3-14 Program structure . . . . . . . . . . . . . . . . 3-14 Single-input filter FB 84 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21 Single-loop control Example . . . . . . . . . . . . . . . . . . . . 7.1. 7-10 Standard function block . . . . . . 1.2. 3.3. 3-5 Restart Mini FB 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 Status control Example . . . . . . . . . . . . . . . . . . . . . . . . 7-37 Storage space . . . . . . . . . . . . . . . . . . . . . . 3-3 Substitution control . . . . . . . . . . . . . . . . . . 1-2 Summing point FB 99 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31 System frame software Calling structure . . . . . . . . . . . . . . . . . . . 3-5 Clock distribution . . . . . . . . . . . . . . . . . . 3-6

Index

Control block ..................... 3-3 Modular control ................... 3-3 Program block .................... 3-3 Programmable controller status ...... 3-3 Sampling interval .................. 3-6 Simplified system frame software .................... 1.2. 3-1 4 Standard function block ............. 3-3

Temperature sensors Characteristics .................... 6-4 Thermocouple Copper-constantan ................. 6-5 Iron-constantan .................... 6-6 Nickel-chrome-nickel ............... 6-7 Platinum-10% rhodiumlplatinum ...... 6-9 Time average FB 189 .......................... 5-78 Time constant Control loop ...................... 1-2 Time scheduler FB 118 .......................... 5-44

U
USTACK

........................... .................

5-2

Warm restart mode

3-18