Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs...

196
Contents Introduction Modular PID and Fuzzy Control Manual C79000-G8576-C901-02 Overview of Blocks Application of Modular Control Using Fuzzy Control Description of the Function Blocks Technical Data Examples Index Remarks f=orm

Transcript of Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs...

Page 1: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Contents

Introduction

Modular PID and Fuzzy Control

Manual C79000-G8576-C901-02

Overview of Blocks

Application of Modular Control

Using Fuzzy Control

Description of the Function Blocks

Technical Data

Examples

Index

Remarks f=orm

Page 2: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Contenfs

Contents

l Introduction .......................................................... 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . l . l Overview 1-1

1.2 Configuration list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.3 Modular control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.4 Fuzzy control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3

2 Overview of Blocks .................................................... 2-1

3 Application of Modular Control .......................................... 3-1 3.1 Principle of modular control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 3.2 System frame software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.2.1 Tasks and structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.2.2 Data organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.2.2.1 DB "ODAT" . . . . . . . . . . . . . . . . . . . . . . . . ... .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.2.2.1.1 Clock distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.2.2.1.2 Basic data of the control loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 3.2.2.2 DB "INTER" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 3.3 Simplified system frame software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 3.3.1 Tasks and structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 3.3.2 DB "INTER" - Organizational data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 3.4 Flags. times. counters. system data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 3.5 Terms used in modular control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 3.5.1 Restart modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 3.5.2 Operator entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18

4 Using Fuzzy Control .................................................... 4-1 4.1 Principle of control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 4.2 Call structure and data organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 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 11 1 Setpoint output for BCD displays ("BCD-AUSG") . . . . . . . . . . . . . . . . . . 5-35

Contents 1

Page 3: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

FB 112: High-low value selection ("EXTRAUSW") . . . . . . . . . . . . . . . . . . . . . . . . . FB 1 14: Limit monitor ("GRENZSIG") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 1 15: One-out-of-two channel selector ("K-AUSW ") . . . . . . . . . . . . . . . . . . . . FB 1 17: Polygon generator ("POLYGON") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 11 8: Time scheduler ("ZEITPLAN") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 119: High-speed analog output ("ANAS") . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 174: Dead band ("TORONE") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 176: PID controller ("IPD-REGn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 1 77: 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 1 13: Fuzzification (" FUZ:FUZn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FB 1 16: 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 System blocks ....................................................... 7-57 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 software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-62 Commissioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-63

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulation results 7-63

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

Contents 2

Page 4: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

1 Introduction

1.1 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 Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R

REG135ST.S5D Modular PID and fuzzy control for CPUs 922*, 928* * " , 928B

REG115ST.S5D Modular PID and fuzzy control for CPU 945

REGBSPST.S5D Example of PID control for CPUs 9461947, 948

FUZBSPST.S5D Example of fuzzy control for CPUs 9461947, 948

1.2 Configuration list

CPU In PLC

CPU 922' In S5-135U or S5-155U CPU 928'* In SS-135U or S5-155U CPU 928B In S5-135U or S5-155U

CPU 945 In S5-115U or SS-1 55U

CPU 9461947 In S5-155U CPU 948 In S5-155U

/ CPU 946R1947Rx a * In S5-155H i 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 be combined as required and can so be adapted to different user-related tasks.

Page 5: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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: P71 200-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: P71 200-S3014-B-1) .

Page 6: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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. 0 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.

Page 7: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Overview of Blocks

2 Overview of Blocks

K%k, ADDITION

ANAS

AN AU

ANEl

ANES

ANLAUF

ANL-MINI

BCD-AUSG

DIFF-GL

EINFGLAT

EXTRAUSW

FUZ:FUZ

FUZ:DFUZ

GLAETEN

GRENZSIG

IMP-AUSG

IPD-REG

I-GLIED

%%$er

99

119

79

78

95

63

20

111

84

113

116

61

114

1 77

176

179

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:

8E28 8$8:1k811 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 40 the physical unit for display by means of a physical programmable factor.

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

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 controller is 07 modular desi n. The components (P. I, D) 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.

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

Page 8: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Overview of Blocks

Block name

GLAETEN

GRENZSlG

IMP-AUSG

I-GLIED

KOEFFIZ

K-AUSW

LADEN

MATHE

ORGAN1

ORG-MINI

PID-REG

R E m N

TOTZONE

VERGLEl

ZEITMWT

ZEITPLAN

Block number

61

114

177

76

79

178

1 15

39

14

69

23

62

38

96

88

174

189

118

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 b lock addiiionally has a disturbance variable input and a manual

input.

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 lower lim~t, or only l~mlt violations can be Indicated.

W~th the function block for '1-of-2 channel selection" one of 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~TTEN" 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.

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).

Organizational function block; flag words 200 to 254 are saved in a selectable data block.

This functlon block serves to 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.

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.

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.

Page 9: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Principle of Modular Control

3 Application of Modular Control

3.1 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.

Figure 3-1 Simple control structure (control loop)

Setpoint adjuster

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 con- trol, the interfaces are data words whose addresses must be entered as actual parameters during creation of the control system.

Example:

-

JU FBnANEI" NAME: ANEl

Set Man.

D

* Actual

JU FB"PIDn NAME: RLG:PID

IST :DD100

Controller

Analog input module

Output

Analog input

module

Controller

var. . D

-

Actual value input

Analog output module

In addition to the transfer values between the blocks, there are parameters such as the con- troller parameters comprising gain, integration time constant and derivative-action time con- stant. 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 pa- rameters are not known beforehand. Their addresses must therefore be defined by means of actual parameters when generating the control structures.

Page 10: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Principle of Modular Control

Example:

JU FBnPIDn NAME : PID-REG

Parameter STEW : DW97 Control byte Transfer value SOLL : DD98 Setpoint input Transfer value IST :DD100 Actual value input Transfer value XA : DD102 Output (value of manip. variable) Parameter OBXA : DD1 04 Upper limit of XA Parameter UBXA : DD1 06 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 organ- izational 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.

Organizational

Parameters

t

Figure 3-2 Simple control structure (control loop) with all the corresponding data

old values

Setpoint adjuster

-)

4

+

+

Controller

S e

P t -

Analog input

module

t -

Analog output module

values

A , c t

n- - t I

f - f Parameters

M a

i

Old

Parameters

Page 11: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 ANLAUF(Restart) must be invoked for all types of restart FB 69 ORGAN1 must be invoked in cyclic operation

The user is free to generate his control system by calling the control blocks and assigning parame- ters 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" 1 00ms" 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 "1 OOmsn PB, whilst all other functions are incorporated in the "Sampling" PB. This leaves the central processor sufficient time to process other tasks.

Page 12: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

System Frame Software

Example:

Called In the "Sampling" PE Called In the "100 rns' PB

1) Setpoint adjuster

Figure 3-3 Simple control structure (control loop)

Set

Both program blocks must be generated by the user. The program block numbers are freely selec- table 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 1 00ms 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".

D

1 Note:

1)

Controller

Man. var.

D

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

1)

2) Pulse output module Actual

Analog input

module

.

Page 13: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

System Frame Software

PB "Sam ling" ,OB 20121122 ,FB "RESTARTn I-, l p , / C DB "INTER" A

JU FB "RESTART"

,OB "100ms" "SAVEn , JU FB "SAVE"

\

"ORGANI"

PB "Sam ling" cl

C DB "INTER"

PB "Sam ling"

1 -2

DB "ODAT" n \

DB "INTER"

D FB "RESTORE"

JU FB "RESTORE"

C DB "INTER"

Figure 3-4 System frame software: Calling structure

The user must program the function block calls for FB "RESTART" and FB "ORGANI".

PB "Sampling"

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.

1

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.

2

In the various restart routines, some control blocks must run through initialization routines. FB "Re- start" 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.

Page 14: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

System Frame Software

All standard function blocks are only needed once in the programmable controller. The various con- trol 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 func- tion blocks. The user can program the various sampling intervals in the second part (clock distribu- tion). All control loops to be processed must be assigned parameters in the third pan (basic data of the control loops).

Housekeeping data (entered by the system)

Clock distribution (to be assigned parameters by the user)

DBnODAT" Data

3.2.2.1 .l Clock distribution

Description

DW29 DW255

DW256 DW n

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.

Basic data of the control loops (to be assigned parameters by the user)

Housekeeping data (entered by the system)

DB"ODATn Data

DD15

DD19

DD21

2 7 1- KG Sampling interval 8 c s ~

DD13 I KG I Sampling interval 1 CSJ

Format

DD17 I KG I Sampling interval 3 C S ~

KG

DD23

DD25

Description

Sampling interval 2 c s ~

KG

KG

Sampling interval 4 CSI

Sampling interval 5 CSI

KG Sampling interval 6 CSJ

KG 1 Sampling Interval 7 c s ~

Page 15: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 +8000000+01

DD17 KG +4000000+01 C S ]

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: 1 OOms) .

Page 16: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 " 1 00ms" of the first control loop

Runtime for PB " 1 OOmsn 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 proc- essed by the CPU. Thus only the runtime of one PB "Sampling" is taken into account in the calcula- tion, 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 1 OOms 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 , . .

Page 17: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

I l 1 1 I t

0 0.5 1 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 independ- ent 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.

Page 18: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

System Frame Software

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

DB "ODAT" Data I I Left data byte Description

I Right data byte

] DW32 1 KY 1 Shift time 1 Clock number 1

DW29

DW30

DW31

I DW33 I KY I DB'INTER' I Input bit (Bit 0) I

I DW35 I KY I Shift time 1 Clock number I

KF

KY

KY

I DW36 I KY I DB'INTER" I Input bit (Bit 0) (

I DW38 I KY I S h i i time I Clock number I

Address of last control loop

I DW39 I KY I DB"INTERW I Input bit (Bit 0) I

Shift time for Initialization

PB"100rns" 1

Clock number for initialization

PB"Samplingn 1

Figure 3-5 Basic data of control loops in DB 'ODAT"

DW253

DW254

DW255

Initialization:

The sampling interval and shift time of a control loop can be changed during operation zs follows:

KY

KY

KY

Enter the new clock number and shift time in DW 30

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

PB" 1 00msW 75

Shift time

DB'INTER'

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.

PB" Sampling" 75

Clock number

Input bit (Bit 0)

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.

Page 19: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

l Data I Format I Description I organizational data (entered by the system)

I D W 1 6 I KF Starting address of previous values (= n+l ) fto be entered bv the user) 1

n: Defined by user by Interconnecting the blocks m: Depends on control blocks used

Figure 3-6 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.

Page 20: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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. HIGH limit of XA LOW limit of XA

var.)

DWO

DWl S

DB "INTER"

Organizational data (entered by the system)

Description Data Format

DW16

DD17

DD21

I DD24 I KG I Setpoint input I

KF

KG

DW23

Actual value input

Starting address of previous values (n+l )

+0000000+00

KG Scratchpad word for unused outputs

I

KM

l DD32 I KG I LOW limit of XA l

Control word

DD28

DD30

Experience has shown that it is often advantageous to assign data words DW 17 to DW 22 as shown. In this way, 0 or 1 can be preset for inputs or parameters (e.g. with the summing element or mathe- matical 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 inter- connections 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.

KG

KG

Output

HIGH limit of XA

Page 21: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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:

Number of old values (155U PC)

SOSTELL

Setpoint adjusters 10 Analog inputs 0 PID controllers 12 Analog outputs 0

Total 22

-

Note:

Data which is evaluated in each cycle and recalculated is stored in both DB "ODAT" and DB "IN- TER" (e.g. timers in DB "ODAT" and previous values in DB "INTER"). When presetting new pa- rameters 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).

Set- point

ANAU D

Actual

ANEI

PID-REG Man. var.

D

Page 22: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 20121 122 (AG 135U, 155U)

OB 21/22 (CPU 945) FB " ANL-MINI " PB "Sampling"

DB "INTER"

I

SPA FB 'ANL-MINI" I OB 10 ... 18

(AG 135U, 155U) 1 OB 10 ... 13 (CPU 945) FB "ORG-MINI" PB "ABTAST"

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

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)

Page 23: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

8 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).

8 The "ODAT" data block no longer exists.

8 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.

8 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.

Page 24: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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. D1 2.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: 0.1 CPU 922 = 1 D12.6, 7: 1 .O CPU 928 = 2 D12.6, 7: X, X 33-155, CPU 945 = any

D12.8: Cold restart bit D12.8 = 1 upon a cold restart; otherwise it is 0.

D1 2.9: Manual restart The D12.9 data bit must be set to 1 if a manual restart is performed.

D1 2.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

Page 25: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Flags, Times, Counters, System Data

Organizational data

I Data item / Name 1

I DW7 I Number of the "ODAT" DB I

DWO

DW4

DW5

DW6

I DW8 1 Number of the "INTER" DB I

Global data of some standard function blocks

Old value offset for "Sampling" PB (n+l)

Old value offset for "100 ms" (n+l)

I DW9 I Number of the "100 ms" PB I I DW10 1 Sampling interval I I DW12 1 Restart type, PLC ID, operator input 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

DW* 13

DW14

DW15

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

Address of the "INTER" DB

Offset of history values

Figure 3-8 Organlzatlonal data In the 'INTER' data block

3.4 Flags, times, counters, system data

The standard function blocks utilize the flag area from FW 200 to FW 254. If the user also wishes to 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.

Page 26: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

Page 27: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Principle of Control

4 Using Fuzzy Control

4.1 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:

Ply = 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.

Page 28: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

' Plx = P2x <= P3x <= P4x I Plx = P2x = P3x <= P4x I P l x = P2x <= P3x = P4x

I P lx <= 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 - - - -

I Pxl X2 Px2 Px3

Figure 4.3 Subarea of the trapezoid

Page 29: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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).

- .

Y

I- Output signal correcting range

I Area center of gravity = current output variable

Figure 4.4 Area center of gravity

4.2 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 DB.. :L DD 4 Output n :A DB Number of "INTERn DB :T DD "Data double word inside "INTER" DB"

. The user defines the block number

Page 30: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Call Structure and Data Oruanization

T h e fuzzy application block may also be called outside the program block. It is not tied to a system frame.

Within the FUZ:APP fuzzy application block, the FBI 13 FUZ:FUZ.standard function block is called for each input variable. The set of rules is executed by a user-related FUZ:RULE function block. The FBI 16 FUZ:DFUZ standard function block is called for each output variable (see Fig. 4.5) .

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

Figure 4-5 Modular block concept of the fuzzy controller

FBxx FUZ:APP

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

- DBxx

Input -

DBxx variable l - W1

' F B I I G -- I FUZ:DFUZ

NW7

AND -variable 1

m m m .i

OR .I m

Page 31: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

Page 32: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Organizational Funcfion Blocks

5 Description of t h e Function Blocks

5.1 Organizational function blocks

5.1.1 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 DB SavelRestore not available

F002 2 Flag stack overflow

F003 2 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.

Page 33: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Organizational Funcfion Blocks

Formal 0~erand list

I Name ( PurposeiDescription Param. Data l type l type l

IDB I Data block to which the data of the scratchpad flag area is transferred I B / - I

5.1.2 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 . . . Cold restart . . . . . . . . . . . . . . . . . . . . . . . . . . . ART = 0 OB 21 . . . Manual warm restart . . . . . . . . . . . . . . . . . . . . ART = 1 0 6 22 ... Restart after power failure . . . . . . . . . . . . . . . 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 OB 22 Automatic cold restan after power failure ART = 2

FB "Restart" still requires a preset identifier of the programmable controller. The assignments are as follows:

This parameter is insignificant for the program package of the PC 155U and CPU 945. Any value can be entered.

PC

1

2

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 " 1 OOmsn 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.

Programmable controller/CPU

Loop processor (CPU 922)

CPU 928, CPU 928B

Page 34: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

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:

Data type

KF

KF

KF

Name

AG

ART

ODAT

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 sam- pling and shift times applying to F5 "Sampling". FB "ORGANI" has two formal parameters. They must both agree with those of FB "Restart".

Purpose/Description

Identifier of programmable controller

Restart mode

Number of DB 'ODAT"

Formal 0~erand list

Param. type

D

D

D

I Name I Purpose/Description Param Data I type 1 type l ODAT Number of DB "ODATw D KF

Page 35: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 ... Cold restart ART = 0 OB 21 ... Manual warm restart . . . . . . . . . . . . . . . . . . . . . ART = 1 OB 22 ... Restart after power failure . . . . . . . . . . . . . . . . ART = 2

Provided that the CPU has been in RUN mode, the startup program executions in OB 21 (for a manual 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 Manual cold restart ART = 0 OB 22 Automatic cold restart after power failure 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 Name 1 Purpose/Description Param. Data l type I type l

PBNR Number of the "Sampling" program block 1 D I K F / 1

ART

I

l TA l Sampling interval I D I K F I

The "ANL-MINI" function block has the following tasks:

Startup type

Marking the restart type in the "INTER" data block

D 1 K F I DBNR 1 Number of 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)

D

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.

KF 1

Page 36: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Organizational Function Blocks

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

The "ORG-MINI" function block is called in one of the watchdog alarm organization blocks (OB 10 . . . 1 8).

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

The "ORG-MINI" function block has the following tasks:

DBNR

PBNR

Administering the memory areas for history and internal values

Opening the "INTERN" data block

Calling the "Sampling" program block

Purpose/Description

Number of the "INTER" data block

Number of the "Sampling" program block

Param. type

Data Vpe

D KF

D KF

Page 37: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2 Control blocks

5.2.1 FB 14: Mathematical block ("MATHE")

STEB

FB 14 I MATHE

SFEHL

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.

SPOS

SNEG

SANBO FNR 1

7 6 5 4 3 0

Error message bit SFEHL is set and latched in the following cases:

XE1

Wrong function number

Division by 0; the output remains unchanged

Radicand less than 0; the root of the absolute value is extracted.

-

SBAlE

SANBU MATH

SFEHL

-

SANBO SANBU

- X E2

SPOS

-

SNEG

SXA

STEB : ....... XE1 : ....... XE2 : ....... FNR : .......

....... XA : ....... OBXA :

....... UBXA :

Page 38: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

The following mathematical functions can b e selected:

For reciprocation, input XE2 is irrelevant. A dummy address can b e preset.

7

8

Formal a

Name

STEB

XE1

erand list l

I XEl I . XE2

. XE2

Control and signalling byte

Absolute value with scaling

Root with scaling

Bit No.0 : SBAIE = 0 Limit OFF = 1 Limit ON

Bit N0.3 : SNEG = 1 Result negative

Bit No.4 : SPOS = 1 Resuit positlve I Bit No.5 : SANBO = 1 Indication: XA at high limit I Bit N0.6 : SANBU = 1 Indication: XA at low limit I Bit N0.7 : SFEHL = 1 Error: Division by 0 or root of a

negative number or illegal FNR

Input 1

Function number: value range: 1 to 8 I I

I

Input 2 I

High limit of XA Value range: UBXA to t 10000

-

Output

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

Q

Data type

Page 39: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Biocks

5.2.2 FB 61 : Filter element ("GLAETTEN")

STEB 7 6

FB 61 1 GLAETTEN

ERU TI

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.

El

Figure 5 -1 Step response of the filter element

A(O)

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.

qli: + E2 + -

A

A2 A1

N E3

E l : ....... E2 : ....... NE3 : ....... A2 : ....... A1 : .......

A(0) : ....... T1 : ....... ERU : ....... A ........ STEB : .......

Page 40: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Example:

without

with feedback

t

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.

Page 41: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Formal 0~erand list

Name I PurposolDescription Param. I type

NE3 I Input interpreted as negative

E l

E2

A2 I OutpYt of flip-flop to be used for feedback

Input interpreted as positive

Input interpreted as positive

A1

I

I

Derivative of output A

A(O) Initial value of output A2

T1

Q

Filter time constant Value range: T1>

ERU

D

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

A Output of the filter element

STEB Control byte Bit No. 6 SA2 =l A(0) is assigned to A2

Bit No. 7 SBED = l T1 and TA are passed

Page 42: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

STEW 15 14 1 2 1 1 1 0 9 8 7 6 S 4 3 2 1 0

FB 62 I PID-REG

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 dominat- ing time constant of the controlled system:

D

KiTD T1

TA 5 '1, . dominating system time constant

L,

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.

SDE/A

a

SANBO

+

OBXA

KOIP 1

SlNST SRUK

SVOR

SlElA SDEIA SANBU

a ;"k4 +a+ = - U Krrl

SPElA

SlST

X A

S ~ N B O SANBU

SPEIA SXA SAlE SBED

4 0 )

SlElA

S A N

P

SALG SD SVOR

A I -

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

KIT1 : ........ A(0) : ........ KITD : ........

......... T1 P ......... I ......... D .........

Page 43: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

KO where TN = 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:

TA T1 2 7

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 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 is therefore repeated in the following sampling intervals if the user sets SD=O.

Page 44: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 simultane- ously 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 ,SRUK = 1

SVOR = 0 I component is stopped when a limit is reached - SlST = 0

SINST = 0 The characteristics are preset for the multiplicative form of the transfer function - SALG = 0 P component ON ----D SPEIA = 0 I component ON SIEIA = 0 D component ON SDE/A= 0 A D component which was not fully output (because of a limit) is repeated -SD = O

Restart takes place with A (0) - SANL = 0 XA should be 0 when the controller is switched off .- SXA = 1.

Page 45: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

STEW 15 14 12 11 10 9 8 7 6 5 4 3 2 1 0

FB 62 ( PID-REG

SD

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

WTD T1

SDEIA

a v

D

KOIP 1

-t

SVOR SPEIA OBXA

a

a + SANBO

v K m SANBU A(O)

SlElA P

A I

STEW : ........ SOLL : ........

........ IST : XA : ........ OBXA : ........ UBXA : ........ KOIP : ........

KIT1 : ........ A(0) :. ....... KlTD : ........ T1 : ........ P .......S.

I ......... D .........

Page 46: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal operand list

Name

STEW Control word

Bit No. 0 : SAIE = 0 Controller OFF = l Controller ON

Bit No. l : SPEIA = 1 P component OFF

Bit No. 2 : SIEIA = 1 l component OFF

Bit No. 3 : SDEIA = 1 D component OFF

Bit No. 4 : SRUK = 0 PID controller has normal structure = 1 P and D components In feedback branch:

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

Bit No. 5 : SVOR = 0 and SRUK = 1: P and D components are 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 = 1 Values KOIP, KITi, KITD, T1 and TA are accepted

Bit No. 8 : SlST = 0 I component is stopped when a limit is reached

l

1 = 1 I component Is only stopped if the limit

1 is also reached without D component

1 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 = 0 Restart with XA = A(0) = 1 Restart with old value

Bit No. 12 : SXA = 0 and SAlE = 0: hold at old value = 1 and SAIE = 0: XA = 0

I I Bit No. 14 : SANBU = 1 Indication: XA at low limit I

Pararn type

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

input, setpoint Value range: -10000 to + 10000

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

IST

High limit of XA Value range: UBXA to + 10000

Input, actual value i Value range: -10000 to + 10000

Low limit of XA Value range: -10000 to OBXA

Data type

W

Page 47: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal operand list

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

Name

KOIP

I A(0) I Initial value of I component

Purpose/Description

PID controller gain Additive form of algorithm: KO Multiplicative form of algorithm: KP

l ! Derivative coefficient or time Additive form of algorithm: KD Csl Muttlpiicative form of algorithm: TV C S ]

I T 1 I Damping time constant; lag time constant of D component C S ] Value range: Tl 2 TA12

P

5.2.4 FB 78: Analog input ("ANEI")

Value of P component

I

D

Value of I component

Value of D component

STEB 7 6

FB 78 I ANEl

PBER - BG - KN- BT - NA -

SER - X A

,ER SF9 SBU

STEB : ....... PBER : ....... BG : ....... KN : ....... BT : .......

Pararrl. Data F

NA : ....... ER : ....... XA : .......

SER SFB L

S W

Page 48: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 meas- ured 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 ER > 10500 with unipolar module type 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 %.

Page 49: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

BT = Module (board) type

Figure 5-2 Assignment of analog input modules t o module types and signals

BT

0

1

2

3

4

5

6

7

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

Physical nom. range

0 t o 50 rnV 4 t o 20 m A PT 100

PT 100 PT 100

PT 100 PT 100

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

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

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

4 t o 20 m A

t 1V/ L lOV/ ;t 2OmA

Module

460-5AAl l 461 -5AA11 462-SAA11

465-5AAl l 465-3AAl2

460-4UA11 465-4UA11

i 465-5AA11 465-3AA12

460-4UA11 4654UA11

463-4UA11 (463-4UBll

i 460-4UA11 463-4UA11 463-41381 1 465-4UA11

460-5"" 460-SA431

Internal scaling

0 to 10000

:: 0 to rnax°C 0 to 10000

-10000 to +l 0000

-10000 to +IOOOO

to 10000

0 to 10000

-10000 to +l0000

Signals

SBU = 1 if XA < 0 or XA > 10500

SFB=DBR bit of the mod.

SBU = 1 if XA<O or XA > 10500

SFB = viol. bit of mod.

SBU = l i fXA<O or XA > 10500

SFB=Error bit of the mod.

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

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

SBU = 1 if XA<O or XA > 10500

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

SFB = 1 if XA + YA < -625 = 3mA

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

Page 50: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Formal operand list

Name I PurporelDescription aram. Data

h y p e I type

STEB

PBER

KN I Channel number of analog input module l I I B Y

Control byte

Bit No. 0 : SER = 0 Value is read in from the module = 1 Reset substitute value

Bit No. 6 : SBU = 1 Signal: Range violation

Bit No. 7 : SFB = 1 Signal: Error

I10 area: PBER = NP: Analog input module Is In the standard 110 area

= EP: Analog input module is in the extended 110 area

BG

BT Module type Value range: 0 to 7

NA Zero alignment: XA = Value read in (scaled) - NA Value range: -10000 to +l0000

I

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

BY

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

1

ER

BY

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

Page 51: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.5 FB 79: Analog output ("ANAU")

STEB l

FB 79 I ANAU

SBF - PBER - BG - KN - BT -

X E

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 accord- ing to the module used.

C+

i

SBF

BT: Module (board) type

STEB : ....... XE : ....... PBER : .......

BT

0

1

2

3

The signals can be output via the standard or the extended 110s.

Transfer to the analog output module is blocked by setting parameter SBF.

BG : ....... KN : ....... BT : .......

Operator entry, restart modes:

Modules

475-3AAl l 475-5AAl l

476-3AAl l 476-5AA1 l

470-4UA11 470-4UB11

470-4UC11

The analog 110s are not addressed.

Permissible input value

-10000 to +10000

0 to 10000

-10000 to +10000

0 to 10000

Page 52: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal c I

STEB

,erand list

Control byte

Bit No. 1 : SBF = 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

Starting address of the module: permissible values for PBER = NP: B 0 > 128

= EP: BG > 0

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

Channel number on the analog output module I I

I

Data type

Module type Value range: 0 to 3

p- -P- P

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

I

FB 84 I EINFGLAT

IF . . . . . . 1"") i....... 1 a...... . . . . . .m

T1 : .......

STEB 7 6

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.

SBED SA

Page 53: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

STEB

Purpose/Description

Control byte Bit No. 6 SA =l XA is computed from A (0)

Bit No. 7 SBED =l T1 and TA are passed

T1

A(O)

Param. type

Filter time constant Value range: T1 1

Initial value of A2

X A

Data type

Q

- - -

Output of the filter element

I

l

D

D

D

Page 54: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

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

- FB 95 I ANES

PEER - BG - KN -

VEER - SLOG - SSTR -

V W - N A -

SER - X A

ER S8 U

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 informs the function block of the voltage range he has selected on the module. The assignments are a s follows:

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

SBU

NA : ....... ER : ....... XA : .......

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.

SSTR

VBER

0

1

2

Substitute value presetting:

Voltage range

OV to 10V

-5V to t5V

-1 0V to +l 0V

In the "Substitute valuen mode (SER = 1 ) , the value at input ER is output unchanged. Range violations of more than 5 % are flagged.

SLOG

SBU = 1 for ER < 0 or ER > 10500 if VBER = 0 ER < -1 0500 or ER > 10500 if VBER = l or 2

SER

Page 55: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 "High- speed 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.

Page 56: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal r 1

VBER

0~erand list

Control byte

Purpose/Description

Bit No. 0 : SER = 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 to generate interrupts; normal case: SLOG = 0

Param. type

Bit No. 4 : SSTR Strobe for comparator gate logic interrupt =. 0 Interrupt disabled (normal case) = 1 Interrupt enabled The standard function blocks do not interpret the interrupts.

Data type

Bit No. 5 : SBU = 1 Message: Range violation

110 area: 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

Max. of scaled input voltage range in volts: it is converted to the maximum of the internally scaled numeric range (=10000).

Channel number on the input module: 0 <KN S 7

Voltage range preset on the input card: 0 to 2

Zero alignment: XA = value read In (scaled) - NA Value range: -10000 to +l0000

Substitute value: Value range: -10000 to tlOOOO or 0 to 10000

I

I

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

BY

BY

Page 57: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.8 FB 96: Setpoint adjuster ("SOSTELL")

FB 96 I SOSTELL

TlAN TlAB

SAlH A(O) T 1 1 T

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:

STEW l 1 1 0 9 8 7 6 5 4 3 2 1 0

Figure 5-5 Transient response of outputs SXAl and SXA2

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.

SHAUF L

l

S H Z U 4 -SE

SA/= J

1='qc0-=~P- SXAl

SB 0

SBU SSINK SSTEl

Ramp

1 P

SE : ....... SXA1 : ....... SXA2 : ....... TlAN : ....... TIAB : .......

SHAUF

-

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

....... UBSO :

SA/H SPB SHZU SANF SSNK SGRST SBO SBED SSTEI SBU

Page 58: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

The setpoint adjuster can be switched on with control bit SAIE. In the OFF position (SAIE = 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.

l 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.

Page 59: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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).

Page 60: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal operand list

Name

SE

SXA1

SXA2

TlAN

TlAB

T1

STEW

A(O)

OBSO

UBSO

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 iAN=n TA; n = 1 , 2, 3 ...

Time dsf in which SXAl runs through 10000 Internal units with absolute value-related reduction of the setpoint T IAB=n . TA; n = l, 2, 3 ...

Lag time constant dsf T12 TA12

Control word: Bit No. 0 : SAIE = 0 Setpoint adjuster OFF

= 1 Setpoint adjuster ON

Bit No. 1 : SAIH = 0 Automatic mode = 1 Manual mode

Bit No. 2 : SHAUF = 1 Increase setpoint in manual mode

Bit No. 3 : SHZU = 1 Reduce setpoint in manual mode

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 = 0 Restart with 0 as initial value = 1 Restart value with A(0) as initial value

Bit No. 7 : SBED = 1 Values T1, TIAN.TIAB and TA are passed as new parameters

Bit No. 8 : SBO = 1 Indication: Setpoint at high limit

Bit No. 9 : SBU = 1 Indication: Setpoint at low limit

Bii No. 10 : SSTEI = 1 indication: Setpoint rising

Bit No. 11 : SSiNK = l Indication: Setpoint dropping

initial state; initial value

High limit of setpoint

Low limit of setpoint

Param, type

l

Q

Q

I

i

I

1

I

I

I

data type

D

D

D

D

D

D

W

D

D

D

Page 61: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.9 FB 98: Comparison point ("VERGLEI")

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.

FB 98 I VERGLEI

,El XW +

N E2

Formal operand list

E l : ....... NE2 : ....... XW : .......

I E l ( Input interpreted as positive l ' l D l

Name PurposeIDescription

NE2

XW

Param. type

Input interpreted as negative

Output: XW = E l - NE2

Data type

I

Q

D

D

Page 62: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.10 FB 99: Summing point ("ADDITION")

STEB 7

FB 99 I SUMMING

.El

E2 XA,

+

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:

STEB : ....... El : ....... E2 : ....... E3 : .......

Dynamic and adaptive presetting of values:

KP1 : ....... KP2 : ....... KP3 : ....... XA : .......

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).

Page 63: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

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

A Physical measuring range

C = 0 or -10000 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

El

PurposelDescription

E2

E3

Control byte: Bit No. 7 : SBED = 1 Values KP1, KP2 and KP3 will be input

Input 1

Param. type

Input 2

input 3

KP1

KP2

KP3

Data type

I

I

I

I

Gain factor for input 1

Gain factor for input 2

X A

BY

D

I

I

D

D

I l I

Gain factor for input 3

D

D

Output of the summing point

I D

Q D

Page 64: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

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

STEB 7 6

FB 104 I DIFF-GL

TD T1

XE -L SANBU SANBO

X A

XE : ....... XA : ....... TD : ....... T1 : .......

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 sup- pressed 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 de- creases to 0 with a delay.

OBXA : ....... UBXA : ....... STEB : .......

Example: input step change 0 -> 2000 Limiting t 10000

SEED

Curve 1 : T1 = 0.5s Limiting error is compensated Curve 2: T1 = 0.5s Limiting error is not compensated Curve3: T1 =2s Limiting error is compensated

SANBU SNACH

Figure 5-6 Step responses of the D element

SANBO

Page 65: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

Data type

XE

I Tl I Lag time constant (damping time constant) [S] L l D I

Param type Name

X A

T D

Purpose/Description

Input of the D element Value range: -10000 to +l0000

l I Low limiting value of XA Value range: -1 0000 to OBXA

Output of the D element Value range: UBXA to OBXA

Derivative-action time constant I s 1

OBXA

STEB

I

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, T1 and TA are passed

D

Q

1

High limiting value of XA Value range: UBXA to +l0000

D

D

l D

Page 66: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.1 2 FB 11 1: Setpoint output for BCD displays ("BCD-AUSG")

The function block for "Setpoint output for BCD displaysw provides 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 R

FB 111 I BCD-AUSG ZW - F1 - F2 - F3- F4 -

PIQ - W1

W2 AW

W3 BS .W4

4x1611~16 bit binalylBCD

W4) can be adapted from internal representation to 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:

W 1 : ....... W2 : ....... W3 : ....... W4 : ....... ZW : ....... F1 : .......

W1 --> BS ( I st control bit) W2 --> BS+1 (2nd control bit) W3 --> BS+2 (3rd control bit) W4 --> BS+3 (4th control bit)

F2 : ....... F3 :....... F4 : ....... PIQ : ....... AW : ....... BS : .......

Example: Number of setpoints ZW = 4

BS = A 4.1

Incorporation in the system frame software:

FB 11 1 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).

Page 67: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 24V- Complete field, Order No. M88969-. . .

Formal 0 ~ e r a n d list

l Name I PurpooelDescription Param Data l type / type

l 1st setpoint Value range: 0 . . . t9999

W2 l 2nd setpoint Value range: 0 . . . +g999

W3 l 3rd setpoint Value range: 0 . . . t9999

w4 l 4th setpoint Value range: 0 . . . t9999

I ZW I Number of setpoints to be ouptut: 1 to 4

F1

l F3 I Adaption factor for setpoint W3

F2

I ~4 I Adaption factor for setpoint W4

Adaption factor for setpoint W1

PIQ 110 area for output word PIQ = P: Standard 110 area

= Q: extended 110 area

Adaption factor for setpoint W2

I AW I Output word ("data busn)

l

I I D

D

Page 68: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.1 3 FB 11 2: High-low value selection ("EXTRAUSW")

STEB

FB 112 I EXTRAUSW

S M I M A i

SXE4 SXE3 SXE2 SXEl SMlM

XE1

X E2

XE3

.X E4

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.

I

Note:

< S >

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.

SXEl SXE2 SXE3 SXE4

X A-

....... STEB : XEI : ....... XE2 : .......

....... XE3 : XE4 : ....... XA : .......

Figure 5-8 Connections for less than four inputs

S M I M A i

XEl I SXEl

Page 69: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal operand list

5.2.1 4 FB 1 14: Limit monitor ("GRENZSIG")

Name

STEB

XE1

XE2

XE3

XE4

X A

STEB

PurposelDescription

Control and message byte

Bit No. 0 : SMlMA = 0 Minimum selection = 1 Maximum selection

Bit No. 4 : SXEl = 1 Message: XA = XE1

Bit No. 5 : SXE2 = 1 Message: XA = XE2

Bit No. 6 : SXE3 = 1 Message: XA = XE3

Bit No. 7 : SXE4 = 1 Message: XA = XE4

Input 1

Input 2

Input 3

Input 4

Output

Param. type

I

1

1

1

I

Q

FB 114 I GRENZSIG

HYS - GW02 - GWO1- G W 1 - G W -

Data type

BY

D

D

D

D

D

GA02

GAOl GAOO GAUl GAU2

XE

7 4 3 2 1 0

P

SBED

XE : ....... STEB : .......

....... HYS : ....... GW02 :

GWO1: ....... GWU1: ....... ....... GWU2:

G A U GAUl GA02 GAOO GAOl

Page 70: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

C Hysteresis - - - -

-t

. . . . . . . . - - a - - . - - - 4--.- - - - - - - - - . . . .

GWUl . . . . \ 1 .

GAOl r

Figure 5-9 Function diagram of the limit monitor

The "Limit monitor" function block checks the input value for four presettable limits. The block out- puts 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.

Page 71: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Formal operand list

Name

STEB

Input

Control and message byte

Bit No.0 : GA02 = 1 Limit signal: XE > GW02

BitNo.1 :GAO1 = l Limltsignal:XE> GWOl

Bit No.2 : GAOO = 1 Umit signal: XE in middle range

Bit No.3 : GAU1 = 1 Limit signal: XE < GWU1

Bit N0.4 : GAU2 = 1 Umit signal: XE c GWU2

Bit No.7 : SBED = 1 The limits and hysteresis a r e lnput

Param. Data type

HYS Hysteresis I I I D I -pp-p

GW02

GWOI

GWUl

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

~

Uppermost limit

GWU2

First upper limit

First lower limit

STEB

I

Lowest limit

FB 115 I K-AUSW

S E STA

XE1

XE2 I XA2

D

I

I

STEB : ....... XEl : ....... XE2 : .......

D

D

I

XA1 : ....... XA2 : .......

1 0

D

STA STE

Page 72: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

With the "One-out-of-two channel selectorn function block, one 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

5.2.16 F6 11 7: Polygon generator ("POLYGON")

Name

STEB

XE1

XE2

XA1

XA2

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

Purpose/Description

Control byte:

Bit No.0 : STE = 0 Read In XE1 = 1 Read in XE2

Bit No.1 : STA = 0 Output to XAl = 1 Output to XA2

Input 1

Input 2

Output 1

Output 2

FB 117 I POLYGON

DB-P 1

X E

Param. type

I

I

I

Q

Q

Data type

BY

D

D

D

D

XA = f (XE) XA,

XE : ....... DB-P : ....... XA : .......

Page 73: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 num- ber 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 corre- sponding temperature value to the current resistance value or thermal e.m.f. applied.

Page 74: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

DB-P I l l

l DWO I KM I BR N o 1 : FWZ = 1 illegal number of interpolation points

Data

Bit No. 2 : FNR = 1 illegal interpolation point number for Input

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

Format Description

1

l DD2 I KG 1 X value of the point to be changed (input) I

Bit No. 7 : BED = 1 New interpolation point is accepted

DW1

I DD4 1 KG I Y value of the point to be changed (input) I

KF

1 DD7 ( KG / X vabe of the l st interpolation point

lnterpolation point number for input Value range: 1 to 33

DW6

I DD9 I KG I Y value of the 1st interpolation point 1 l DD1 l 1 KG I X value of the 2nd interpolation point

KF

-

3 / KO I Y value of the 2nd interpoiation point

Number of lnterpolation points Value range: 2 to 33

I DD135 I KG I X value of the 33rd interpolation point I 1DDl37 I KG / Y value of the 33rd interpolation point I

Formal o~erand list

. . . DW202

internal values

DB-P I Data block for the lnterpolation points and slopes I - I

Name PurposelDescript ion

XE

X A

Param. type

Input

Output

Data type

I

Q

D

D

Page 75: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Confrol Blocks

5.2.17 FB 118: Time scheduler ("ZEITPLAN")

MELD 6

FB 118 I TIME SCHEDULE

MELD DBZP

The time scheduler primarily serves as a setpoint generator for a controller. It can, however, be used for other similar tasks.

X A = f ( t )

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.

X A

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.

DBZP : ....... MELD : ....... U : .......

Page 76: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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. Output is stopped with the HALT signal. When the HALT signal has been removed, other values are output according to 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 i f 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 is removed. Incorrect settings or illegal continuation values a re reported with FEHL112.

Example:

FREI

HALT

FORT

ENDE XA

U , , , . . . 4 m . , 0 a , 0 , , , a ' 8 , t ( s )

NEUW n n n n n n n n~ n m n @ Hold point 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.

Page 77: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 Y coordinate: Output value AW at the interpolation point

Abs 3 Legend: Abs. Section X

Time value ZW for section 2

Parameters

Page 78: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 continu- ation 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

X A @ Hold point Time schedule Continuation point

XA Output value

Data

D W 2

Figure 5-10 Continuing from the hold point

Continuation mode 2: Continue from an internally presettable continuation point

Format

KM

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.

Description

Bit No. 1 : FK.Fl = 1 Continuation type 1 selected

Page 79: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Parameters

* ) ANZ Number of actual sections ") ZWx Time value of the section in which output Is continued

Data

DW2

DW3

DW4

X A @ Hold point

Continuation point Permissible region

XA Output value

t

Figure 5-1 l Principle of operation

Format

KM

KF

KF

Continuation mode 3: Continue from an externally preset continuation point

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 * * )

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

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 continu- ation mode 4: FK.F4 = 1 and must assign parameters FW: (continuation value) and FSTEI: (continu- ation slope) at the latest before removal of the hold signal.

Description

Bit No.3 : FK.F3 = 1 Continuation mode 3 selected

Address: DBNo. , DWNo. Value range: l to 255 . 0 to 255

i

Data

DW2

DW3

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).

Format

KM

KY

Page 80: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Parameters

X A @ Hold point

Continuation point

Time XA Output value

Data

DW2

DW3

DW4

Figure 5-12 Principle of operation

Assignment of parameters to inputs and outputs

Format

KM

KF

KF

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.

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

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 re- ported 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

Page 81: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Continuation mode 3: - User DB No. = 0 - preset value not found in schedule in the past Continuation mode 4: - 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 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 (D81911 1 /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 fail- ure), 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".

Page 82: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Bit No.0 : ENDE = 1 Message: Output ended

DBZP

Bit No.1 : FEHLI = 1 Message: Error

Data

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

Bit No.3 : FORT = 1 Message: Continue after hold

Format

Bit No.4 : FEHL2 = 1 Message: Setting for continu- ation mode missing

Descri~tion

Bit No.8 : FREl = 1 Enable time scheduier

Bit No.9 : HALT = 1 Stop output

Bit No.0 : FK.ZR = 0 Timebase, seconds = 1 Timebase, minutes

Bit No.1 : FK.Fl = 1 Continuation mode 1 selected

Bit N0.2 : FK.F2 = 1 Continuation mode 2 selected

Bit N0.3 : FK.F3 = 1 Continuation mode 3 selected

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

1 D W ~ I KF I when D 2.2 = 1: ABSNR: Section number Value range: 1 to 64 I

I l K Y l when D 2.3 = 1: FADR: Address of continuation value DBNo. , DWNo. 1 to 255 , 0 to 255

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

15 0 ABSx 1 1 1 1 1 1 1 1 1 1 1 1 1 1

ABS49

7 - r Indications: Current section (=I )

Page 83: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

DBZP - P- I Data I Format l Description

I ~ ~ 1 2 I KF I XAO: stating point, output value Value range: -9999 to +g999

DW13

XA2: Interpolation point P2: output val. Value range: -9999 to +g999

DW14

DW15

. ZW64: Interpol, point P64: out ut val. Value range: s : I to 999f

min : 1 to 9999

KF

XA64: Interpol. point P64: output val. Value range: -9999 to +g999

KF

KF

j Int. pt. 64

ZW1: Interpolation point P1 : time Value range: S : 1 to 9999

rnin : 1 to 9999

Int. pt. 1

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

Formal operand list I 1

Int. pt. 2

DW141

1 MELD 1 Message byte Bit No.6: NEUW = 1: New output value transferred

KF

Name

DBZP

ABSNR: Section number in binary code Value range: 1 to 64

Purpose/Description

DB time scheduler

X A

Param. type

B

Output

Data type

-

Q D

Page 84: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

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

STEB

FB 119 I ANAS

SBF - SUS -

PBER - BG - K N -

Analog values can b e output to the process via analog output modules using the "High-speed analog outputn function block. The following boards are accepted:

SRS , XE

SUS

6ES5 243-1 AA1 l 6ES5 243-1 ACl l

);U -

SBF

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.

J

STEB : ....... XE : ....... PBER : .......

The values c a n b e output via the standard or extended I10 areas (optional).

BG : ....... KN : .......

Transfer t o t h e analog output module is disabled by setting control bit SBF.

Value range of XE

... -1 0000 +l 0000

... -10000 +10000

... 0 10000

Ch.

0

1

2

Operation entry:

DAC on the board

1

2

3

The analog 110s are not addressed in the "Operation entry" mode.

Page 85: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Restart modes:

The procedure for the "Initial run", "Manual warm restartw and "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

5.2.19 FB 174: Dead band ("TOTZONE")

Name

STEB

XE

PBER

BG

KN

Purpose/Description

Control byte

Bit No. 1 : SBF Output disable = 0 Normal operation, 110s are

addressed = 1 110s are not addressed

Bit No . 2 : SRS Controller inhibit output: = 0 for 'initial run" or "warm restart"

after power failure = 1 in all other cases

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

110 area

PBER = NP: Analog output module is in the standard 110 area

= EP: Analog output module is in the extended I10 area

Starting address of the module

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

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

FB 174 I DEAD BAND

X.

Param, type

I

I

i

I

l

Data type

BY

D

W

BY

BY

,,~"'~,

' -1 B I+-

X*.

STEB: ....... ....... XE : 0 : .......

B : ...... ...... XA ;

Page 86: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 re to be disre- garded. 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 be accepted to avoid s tep 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 re input again.

Adaptive and dynamic presetting of values:

Parameters 0 and B can be 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 1 Purpose/Description Param. Data ltype l type l

s T E B I Control word: 1 1 I B y I I Bit No. 7 : SBED = 1 : Values 0 and B will be acquired I I I

0

B

I

I

P P P-P - P - - P - pp

Midpoint of dead band

Width of dead band

D

D

Page 87: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

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

FB 176 I PID controller D

D element

MANUAL

I

P SANTZ

+ can be disabled

Function block FB 176 represents a PID controller which operates with a Pade approximation (trape- zoid controller). The sampling interval can therefore be up to half the dominating system time con- stant:

STEW : ........ RSP : ........ SOLL : ........ IST : ........ XA : ........ OBXA : ........ UBXA :. ....... ABTZ : ........ ANTZ : ........ KOlP : ........ KIT1 : ........

STEW

15 14 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0

TA 1 ' l2 . dominating system time constant

A(0) :. ....... K/TD : ........ ......... T1 TM : ........ THLG :. ....... HAND : ........ ZElN : ........

......... I

......... P

......... D

SSTR SALG

RSP

14 13 12 11 10 9 8 7 6 S 4 3 2 1 0

SSlG SlElA SDEIA SPEIA

RAlE

SHLGE SHAND SANF S A M Z

RAA(0)

SANBUSANBO SHLGA

RA0 RE0 REALTREA(0) RAALT RTPD

SD

RISPO

SlNST

RABG RSTR RTAlE RAIH RlSNE RBED

Page 88: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

The PID controller is of modular design. The components can be deactivated individually. The struc- ture 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:

1 P $a= 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:

( l + p . TN) . (1 t p TV) FRm= KP where TN >> TV

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

KP :Gain TN : Integral-action time constant

TV :Derivative-action time constant

T1 :Damping time constant P :Laplace operator

Page 89: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 D1 is negative and the I component has been disabled by the user in the negative 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 advanta- geous 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 hys- teresis. The dead band is set via the parameters for the upper response threshold ABTZ and lower response threshold ANTZ.

Page 90: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

ABTZ : XAT = XET becomes XAT = 0 with an absolute-value drop of XET

ANTZ : XAT = 0 becomes XAT = XET with an absolute-value increase of XET

XET : Input of the dead band

XAT : 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 differ- entiated. 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 ma- nipulated 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 "Man- ual". 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 gen- erator, i.e. step changes in manipulated variable after changes at the manual input are avoided.

Page 91: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 corre- sponds 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 actua- tor 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 mini- mum overshoot.

Page 92: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 compo- nents were in the feedback branch.

Controller modes "Off", "On":

The "Controller OFFn function has priority over all other controller modes. It can be used as a protec- tive 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 unaccept- ably 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.

Page 93: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Warm restart after power failure; manual warm restart:

The historical value of the I component of the positioning controller is reduced by the factor corre- sponding to the drop in actual value:

current actual value I(K) = !(K-l)

old actual value

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

Speed controller

The characteristics are preset for the multiplicative form of the transfer function.

All controller components are switched on.

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.

SSTR = 1 RSTR = 0

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

- SHLGE = 1 SHLGA = 0

When switching from Automatic to Manual, the position of the actuator corresponds to the SANF = 0 manual value.

In manual operation, the manual value is applied via the D element SHAND= 0

If the controller is switched off, XA = 0. When it is switched on, automatic calibration takes place.

Page 94: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Automztic operation RAIH = 0

Dead band deactivated RTA/E = 0

STEW

FB 176 I PID CONTROLLER D

D element

MANUAL

KlTD T1

P

SAN= = can be deactivated

RSP

STEW : ........ RSP : ........ SOLL : ........

........ IST : XA : ........ OBXA : ........

........ UBXA : ABTZ : ........ ANTZ : ........ KOlP : ........ KIT1 : ........

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

A(0) :. ....... KlTD : ........

......... T1 TM : ........ THLG : ........ HAND : ........ ZElN : ........ I ......... P .........

......... D

Page 95: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Formal

N a m e

STEW

RSP

operand list 1 I l

Control word

PurposelDescript ion

Bit No.0 :SSTR = 0 PID controller has normal structure = 1 P and D components in feedback

branch; P component can be relocated In forward branch with RSTR = 1.

Bit No.1 :SSIG = 0 Positioning controller = 1 Speed controller

Param. type

Bit N0.2 :SALG = 0 Multiplicatlve form of algorithm = 1 Additive form of algorithm

Data type

Bit N0.3 :SPEIA = 1 P component OFF

Bit No.4 :SIE/A = 1 I component OFF

Bit No.5 :SDE/A = 1 D component OFF

Bit No.6 :SINST = 1 Do not stop I component

Bit No.7 :SD = 0 Part of D component that was not fully output Is repeated

= 1 D component is not repeated

Bit No.8 :SANE0 = 1 Indication: XA at upper limit

Bit No.9 :SANBU = 1 Indication: XA at lower limit

Bit No.10 :SHLGE = 1 Ramp generator permanently on

Bit No.1 l :SHLGA = 1 Ramp generator always off

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.

= 1 0 is assumed as initial value of actuator -> on transfer from Auto to Manual it Is adjusted in accordance with the manual value.

Bi No.14 : SANTZ = 1 Indication: System deviation within dead band

Bi No.15 : SHAND = 0 Evaluation for speed controller: value of HAND Is applied via D element.

= 1 HAND value is output direct as manipulated variable.

I Bii No.1 : R40 = 1 and RAlE = 0 --> XA = 0 I l l

Counter word

Bit No.0 : RAlE = 0 Controller OFF = 1 Controller ON

I Bit No.2 : RAA(0) = 1 and RAIE = 0 --> XA = A(O) I 1 I Bit No.3 : RAALT = 1 and RAIE = 0 --> XA = XA(0LD) I I I

I

( Bit N0.4 : RE0 = 1 Restart with I = 0 I l l

W

Page 96: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal operand list

I I Bit No.5 : REA(0) = 1 Restart with I = A[O)

Name

Bit No.6 : REALT = 1 Restart with I = IA2 (old)

Bit No.? : RBED = 1 Values KOIP, KITI, KITD, T1, THLG. TM and TA are entered

PurposefDescription

l I Bit N0.8 : RAIH = 0 Automatic mode = 1 Manual mode

Bit No.9 : RSTR = 0 and SSTR = 1: P and D components are In feedback branch.

= 1 and SSTR = 1: only D component in feedback branch.

I Bit No.10: RlSPO = 1 I component disabled for positive direction

Bit No. l l : RlSNE = 1 I component disabled for negative direction

Bit No.12: RTAIE = 0 Dead band OFF = 1 Dead band ON

Bit No. 13: RABG = 0 On transfer from manual to auto. procedure Is as for a normal setpoint step change.

= 1 Transfer also takes place for P, D components In forward branch as for P. D components in return branch.

Bit No. 14: RTPD = 0 Only I component with dead zone = 1 P and D components also pass

through dead zone

I IST I Actual value input

SOLL Setpoint input Value range: -10000 to tl 0000

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

X A Output of PID controller Value range: UBXA to OBXA

I ABTz l Upper threshold of dead band Value range: 0 to ANTZ

5

I ANTZ I Lower threshold of dead band Value range: ABTZ to 10000

UBXA Low limit of XA Value range: -10000 to OBXA

Param type

KOlP

Data type

Gain of PID controller Additive form of algorithm : KO Multiplicative form of algorithm : KP

Page 97: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Formal operand list

Name

Initial value of I component

Integral-action coefficient or integration time constant Additive form of algorithm : KI Cs- l J Multiplicative form of algorithm : TN

Derivative-action coefficient or time Additive form of algorithm : KD C S - ~ I

Mutiplicative form of algorithm : TV C S ]

Purpose/Description

Damping time constant, lag time constant of D component Csl Value range: T1> TA12

I

Time constant of D component Csl I D Should be the same as the time constant of the analog I element (actuator)

Param type

D

Time constant of ramp-function generator C S l 10000 internal units are run through in time THLG.

Data type

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

HAND

ZElN

I

P

D

lL] Computation of I

Manual value input Evaluated in 'MANUAL" controller mode

... Value range: -10000 +l0000

Disturbance variable input

Value of I component (positioning algorithm)

Value of P component

Value of D component

FB 177

pulse duration TI

IMP-AUSG

r r T Pulse generation llvlpH~

I

I

Q

Q

Q

D

D

D

D

D

Page 98: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

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.

S W 0

11 10 9 8 4 3 2 1 0

Input signal XE is limited to -1 0000 to +l 0000 or 0 to 10000, according to the mode. The correspond- ing controller should also have these scale ranges. Otherwise an adaptation operation must be car- ried out.

SPBM2

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

SPBMl

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.

SDPSP

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 sup- pressed in the corresponding direction until the actuator leaves the limit.

SDPSl

Note: If there is no checkback signal, control bits SRMAU and SRMZU must be set to 1.

Three-level operation: SDPSP = 1

SS-SP

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 IMPT = 0 + off IMPH = 1 IMPT = 0 + heat IMPH = 0 IMPT = 1 + cool

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

7

SA/€ SRMALSRMZL SAPE

Page 99: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 f IMPT

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

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

PBM operation:

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 1 OOms, the block alternately generates pulses of duration TI = 0.5 a TA t 0.05 s and TI = 0.5 . TA - 0.05s.

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

Page 100: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

There are two types of PWM operation: PBM1 operation

PBM2 operation

TA - TA-TMIN -

TMlN - 1 *

0 + 10000 XE

incorporation in 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 5 - 69

Page 101: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Formal operand list I I

1 l Minimum pulse duration TMlN must be a multiple of 0.1 S.

Value range: 0.1 S < TMIN < TA12

Name

1 Control word

Purpose/Description

I I Bit No.0 : SAIE = 0 Pulse output OFF = 1 Pulse output ON

Bit No. l : SAPE = 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 Normal operatlon

Bit No.3 : SRMAU = 0 Checkbaok: final OPEN pos. reached (only in 3-level Int. operation) -+ 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 I Bit No.8 : SDPSl = 1 3-level int. operation

I I it No.9 : SDPSP = I 3-level prop. operation

l I Bit No.10: SPBMl = 1 PBMl operation

I I Bit No. l l : SPBM2 = 1 PBM2 operation

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

Param. Data type type

l lMPT I 3-level int . and prop. operation: negative actuating pulses PBM operation: negated pulse output I A I B l I

Page 102: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.22 FB 178: Coefficient element ("KOEFFIZ")

STEB

FB 178 I KOEFFIZ

OB

SXAGR = l UBXA - XA

XE : ....... KP : ....... OBXA : m,.....

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.

UBXA : ....... STEB : ....... XA : .......

Zeroing of XA:

SXAO SEED

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:

SBAfE

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.

SANBO SANBU SXAGR

Page 103: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 I i I D I I OBXA Upper limit of XA

Value range: UBXA to +IOOO I ] I D I Control byte I I l B Y Lower limit of XA Value range: -10000 to OBXA

Bit No.0 : SXAO = Q --> XA = 0 = 1 Normal operation

Bit No.1 : SXAGR = 0 OBXA > UBXA > 0 --> XA = UBXA UBXA < OBXA < 0 -> XA = OBXA OBXA > 0 > UBXA --> XA = 0 only allowed with SBAlE = 1 and SXAO

= 1 Normal operation

I

Bit No.3 : SANBU = 1 XA at low limit I I

D

Bit No.4 : SANBO = 1 XA at high lirnit

Bit No.6 : SBAlE = 0 Umiting deactivated = 1 Limiting activated

Bit No.7 : SBED = 1 Parameter KP Is entered

Page 104: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

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

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

STEW 9 8 7 5 4 3 2 1 0

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 the 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 to input ERU.

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

Page 105: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

Example:

- ERU E l

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 is limited t o the value range UBA2 to OBA2. Since A2 is used to compute A, the limits must still b e preset if A2 is not evaluated. Output A contains the corresponding value calculated according to the trapezoid rule.

Responses with the integration element deactivated:

With various control bits, the user can determine the value to b e output with the I element deacti- vated. 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 TA are entered a s new parameters.

Page 106: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Initial run:

Output A2 is se t to the initial value A(O), and output A to 0. Parameters TI and TA a re input.

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 re 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 be se t to 1 if the values a re to be entered. The user must then enter SBED = 0.

Formal operand list , l Name I PurposeiDescription Param Data

lVPe 1 type I E l

E2

NE3 I

l - o & u t of flip-flop: to be used for feedback

Input interpreted as positive

Input interpreted as positive

Input interpreted as negative

l

- - -

/ A(0) I Initial vahe of output A2

D

I

I

1

I NE4

A1

D

D

D

Input interpreted as negative

Q Derivative of output A

TI

ERU

A

STEW

D

OBM

Low limit of A2 Value range: -70000 to OBA2

Control word

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

Bit No.0 : SAlE

High limit of A2 Value range: UBA2 to +l0000

Bit No.1 : SEA(0) Bit No.2 : SEA2 Bit No.3 : SAALT Bit No.4 : SAA(0) Bit N0.5 : SA0 Bit N0.7 : SBED Bit No.8 : SANBO Bit No.9 : SANBO

I

I

Q

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

D

D

D

I D

Page 107: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.24 FB 188: Dead time element ("TOTZEIT")

--

STEB 7

FB 188 DEAD TIME

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:

SEED

Tfmax= 125. TA.

DB-T STEB A(O)

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.

XE

SEIA3

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 deacti- vated 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.

T3 1

. E x

SEIA2

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.

XA1

XA2

XA3

DB-T : ....ss.

XE : ....... STEB : ....... T1 : ....... T2 : .......

T3 : ....... A(()) : ....... a 1 : ....... m 2 : ....... m 3 :.......

SEIA1 SAA SEA(0)

Page 108: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 parame- ters 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

Bit No.0 : SEA(0) Restart, operator entry or SElA = 1 and SAA = 1 :

=O XA. =O = l XA. = A(0)

DB-T

XE

STEB

Bit No.1 : SAA = 0 and SEIA = 1: No transfer to XA = 1 and SEIA = 1: XA depending on SEA(0)

Name Param. type Purpose/Description

Data block

Input

Control byte

I Bit N0.3 : SEIA2 = 1 Dead time 2 OFF

Data type

I I Bit No.2 : SElAl = 1 Dead time 1 OFF I I

I Bit No.4 : SElA3 = 1 Dead time 3 OFF

B

I

I

1

I Bit ~ 0 . 7 : sBED = 1 The factors for the dead times are entered as new parameters

-

D

BY

I T 1 l Factor for generating dead time l: Dead time 1 = T1 - TA Value range: 0 S T l S 125 1 I B Y

l T 2 l Factor for generating dead time 2: Dead time 2 = T2 TA Value range: 0 S T2 S 125 1 l B y 1

l T 3 I Factor for generating dead time 3: Dead time 3 = T3 . TA Value range: 0 5 T3 S 125 I I l B Y l

I xA1 I Output of dead time 1

I I l

I XA2 I Output of dead time 2 I / D / / XA3 1 Output of dead time 3 I Q D l

D 1 4 0 ) Initial value of outputs XA

Page 109: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control Blocks

5.2.25 FB 189: Time average ("ZEITMWT")

STEB

FB 189 1 ZEITMWT

SEIA

ERMI

I I I !-T2 SERS ,XE I X X

XE : ....... STEB : ....... N : .......

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.

ERMI : ....... A(0) : ....... X A : .......

-

Initialization:

SEED

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

SERS

m 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.

SA(0)

Control bit SERS can be used to initiate output by the block of the programmable substitute average value ERMI.

Restart:

SA0

The block branches to the intialization phase as described above.

SElA

Page 110: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

Formal 0~erand list

STEB Control and signal byte

Bit No.0 : SEIA = 0 = 1

Bit No.1 : SA0 = 1

BitNo.2 :SA(O) = l SA0 = SA(0) = 0

Name

XE

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

Param. type

I

Purpose/Description

Input

Bit No.7 : SEED = 1 Number N Is entered as new parameter; The initialization phase is initiated on removal of SBED

Data type

D

ERMl I Substitute average value I 1 1 D /

N Number of historical values

Restart value

Output

l

I

Q

BY

D

D

Page 111: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

5.3 Fuzzy blocks

5.3.1 FB l 1 3: Fuuification ("FUZ :FUZW)

1 DBNR :..... l

The "FUZ:FUZW function 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:

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

!

l

Page 112: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Fuzzy Blocks

DB-FUZ

Formal parameter:

Name

DBNR

Purpose/Description

Data block with fuzzification parameters

Param. type

D

Data type

KY

Page 113: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

5.3.2 FB 11 6: Defuuification ("FUZ: DFUZ")

The "FUZ:DFUZW function block permits an analog value to be defuzzified from a number of membership degrees.

Specify a selectable data block (DB or DX block) when you call "FUZ:DFUZW. 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 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 MIN- MAX 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.

Page 114: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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. l l

l 1 l

DB-DFUZ

I Data Format 1 Description

I DW 0 I K Y

l

/ AUS: output value

I Operator inputlHAlerror, quantity

I

DW 1

DD 2

KY

KG

DD 6 / KG

DW 8

/ p 2 ~ [l] : 2nd sample

Method, implicit zero rule

Manual value

Diff-Aus: Difference of output value

DW 18

lnternal values

1

1 [l] : Weighting factor ! l

1 1 Internal values 11 1

l st

DD 23 KG / p 3 ~ [l] : 3rd sample

DD 37 / 2nd I membership

i I function l 1

DD 25 1 KG p4x [ l ] : 4th sample

1 DD 27 KG I membership

W [ l ] : Degree of membership function 1 1

Page 115: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

DB-DFUZ

Formal parameter:

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

DW 36+ (n-1)*18

Format

KG

KG

KG

KG

KG

Description

p1 X [n] : l st sample

p2x [n] : 2nd sample

p3x In] : 3rd sample

p4x [n]: 4th sample

~ [ n ] : Degree of membership

Gew, [n]: Weighting factor

Internal values [nl

Data type

W

nth members hip function

Param. type

D

Name

DB

Purpose/Description

Data block with defuzzification parameters

Page 116: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Programming Data

6 Technical Data

6.1 Programming data

* Words

I CPU 948, CPU 946(R)1947(R) I CPU 945 I Biock nirmber

14

20

Block name

MATHE

ANL-MINI

23

38

l 39 6 1

62

63

69

78

79

84

Block length '

249

89

ORG-MINI

RETTEN

LADEN

GLAETTEN

PID-REG

ANLAUF

ORGAN1

ANEl

ANAU

EINFGLAT

Block length '

249

90

44

107

98

132

370

198

353

238

128

101

45

49

49

132

371

201

355

238

128

102

Library number P71 200-S

9014-A-. . 6020-A-. .

Library number ~71200-S

3014-B-. . 3020-B-. .

Assignment for previous values '

- -

6023-A-. . 6038-B-. . 6039-B-. .

Assignment for previous values *

- -

3023-B-. .

3038-B-. .

3039-B-. .

3061-B-. . 3062-B-. . 3063-B-. . 3069-B-. . 3078-B-. .

3079-B-. . 3084-B-. .

- - -

- - - 4

12

- - - - 4

6061-B-.. 1 4

6062-B-.. 1 12

6063-B-.. 1 - 6069-B-. . 9078-A-. . 9079-A-. . 6084-3-. .

- - - 4

Page 117: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Programming Data

CPU 928B, CPU 928, CPU 922

KOEFFIZ

TOTZElT 314 91 88-A-. .

7 89 ZElTMWT 235 9189-B-. . ,

Words * * Values in brackets apply to CPU 922

Page 118: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Programming Data

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

CPU 922

4.63 rns - -

0.75 rns

0.72 ms l

3.17 rns

7.8 ms

(1.4i2.5 k) ' rns

(12.16t2.15 k) rns

2.25 rns I 1.67 rns l 2.53 rns

2.5 rns I 5.6 rns

0.38 rns

2.36 rns I

2.62 ms I

7.95 rns I

1 ms

- 3.2 ms

0.29 rns -

6.2 ms* 8.1 ms** 1 8.4 rns

l .B ms

1.42 rns 1 10.1 rns I

4 rns

1.34 rns 1 3.25 rns

3.9 rns

2.66 ms I

l

Block number

14

20

23

38

39

61

62

63

69

78

79

84

95

96

98

99

104

111

112

113

114

11 5

116

117

'l8

119

174

176

i n

178

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 k) ms

(0.42i0.2 k) 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 ms"*

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

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 k) ms

(0.03+0.06 k) 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

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 k) rns

(0.05i0.03 k) 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 first run

0.11 ms)

0.02 ms

0.02 ms

0.09 ms

0.04 ms

0.02 ms

179

188

189

0.04 ms

0.03 ms

0.02 ms

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**

0'4

0.19-0.86 rns (in the first run

2.3 ms) 0.16 ms

0.33 ms

0.83 ms

0.52 ms

0.21 ms

0.10 ms

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 k) ms

(2t1.53 k) rns

1.59 ms

1.24 ms

l .57 ms

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

0.75 ms

0.22 ms

0.75 ms

0.37 ms 2.13 rns

2.9 rns

1.76 rns

0.09 rns

0.06 ms

0.34 ms

0.19 ms

Page 119: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Characteristics of Some Temperature Sensors

6.2 Characteristics of some temperature sensors

Platinum resistance thermometer (Pt 100) according to DIN 43760

Page 120: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

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

Page 121: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Characteristics of Some Temperature Sensors

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

Page 122: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Characteristics of Some Tem~erature Sensors

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

Page 123: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Characteristics of Some Temperature Sensors

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

Page 124: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Characterisf;cs of Some Temperature Sensors

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

Page 125: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Characteristics of Some Temperature Sensors

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

Page 126: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Typical Calculation of Execution Time and Memory Requirements

6.3 Typical calculation of execution time and memory requirements

The 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" 0.18 ms See Technical data, Chapter 6.1

SPA FB "ORGANI" + 0.42 ms k = number of control loops in the for system frame software +k ' 0.20 ms system frame software

Execution time of the FBs in " 100 msn PB + . . . ms

SPA FB " RESTORE" + 0.18 ms

Execution time of the FBs

= ... ms Every 100 ms

+ ... ms Depends on scan rate and displacement

time per 100 ms (see Table below)

I 78 0.18 0.18 0.18 3rd control loop i 78 0.18 0.18

176 0.76 0.76 0.76 TA = 300 m s

79 0.13 0.13 0.13 T V = O m s ' /

l j j Taia 2.5 1.25 1.25 1.25 2.5 Every 100 m s

i i 1

2 *TA

0.18 0.18

0.76

0.13

1 TA

0.18

0.18

0.76

0.13

FB No.

l i

78

78

176

3 'TA

I 79

/ l 78 I / 78

1 176

79

T A = 1 0 0 m s

1 s t control loop

TA = 300 m s

l i

i I

4 * TA

0.18

0.18

0.76

0.13 1 I T V = O m s l

0.18 l 2nd control loop 0.18 1

5 *TA

0.76

0.13

l ! TA = 300 ms I ! ! i

I I TV = 0 m s l

Page 127: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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:

1 * length of 05 21:

1 * length of OB 22:

1 * length of OB 13:

1 * length of DB:

1 * length of "ODAT" DB:

k * length of "INTER" DB:

k * length of " 100 m s n PB

k * length of "Sampling" PB

1 * length of "RESTART" FB: 1 * length of "RESTART" FB: 1 * length of "RESTART" FB: 1 * length of "RESTART" FB: l * length of "RESTART" FB: 1 * length of " .........." FB:

Header and block end "RESTART" FB call once per system frame software

As for OB 20

As for OB 20

Header and block end "SAVEw FB call "ORGANI" FB call once per system frame software "LADEN" FB call

Saving t h e scratchpad flags

Once per system frame software k = number of control loops

Organizational data

Start address of history values

Interface and parameters of the FBs called

History values and auxiliary variables of the FBs

For k control loops

For k control loops

Once length of FBs called See Technical data in Chapter 6.1

Page 128: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Typical Calculation of Execution Time and Memory Requirements

The following is an 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 "FUZ:DFUZn FB: ANZ-AUSG ' l . l ms

l ' execution time of "FUZ:RULEn FB: 0.012 ms + ANZ-UNDIODER ' 0.008 ms

+ ANZ-KLAMMERPAAR *0.007 ms -

= ... ms

1 ' execution time of "FUZ:APPW: 0.009 rns + ANZ-EING * 0.005 ms

+ ANZ-AUSG * 0.005 ms

= ... ms

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

Constant part Number of inputs Number of outputs

Page 129: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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: 9 DW Constant pan + ZF-EING * 12 DW Number of membership functions per

input = ... DW

ANZ-EING ' length of one "FUZ" DB .. . DW Number of inputs

Length of one "FUZn DB: 24 DW Constant part + ZF-AUSG ' 18 DW Number of membership functions per

output = ... DW

ANZ-AUSG " length of one "FUZ" DB ... DW Number of outputs

Length of the "RULE" DB: 5 DW Constant part + EFF-MAX-KLAMMERTIEFE ' 2 DW Effective (=after optimization)

maximum nesting depth = ... DW

1 ' length of "FUZ:FUZn FB 137 DW Once length of FBs called 1 " length of "FUZ:DFUZ" FB 395 DW See Technical data in Chapter 6.1

1 * length of "FUZ:APPn FB 13 DW Constant part +ANZ-EING * 3 DW Number of inputs

+ANZ-AUSG ' 3 DW Number of outputs

= ... DW

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

11 DW Constant part +ANZ-REGELN ' 5 DW Number of rules

+ANZ-UNDIODER ' 5 DW Number of ANDiOR operations +ANZ-KLAMMERPAAR ' 4 DW Number of parentheses pairs

-- = ... DW

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

11 DW Constant part +ANZ-REGELN ' 7 DW Number of rules

+ANZ-UNDIODER * 7 DW Number of ANDlOR operations +ANZ-KLAMMERPAAR * 6 DW Number of parentheses pairs

Page 130: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 08 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)

Figure 7-1 Process diagram

Slide valve Controlled system

Sensor

Transducer

The following are assumed as ideal:

-

Programmable controller

Slide valve with motor actuator : Integral action, TI = 1s

Controlled system : Proportional action KS = 2

Sensor and transducer : Proportional action with delay

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.

Page 131: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

This results in the following values:

Figure 7-2 Structure of the controlled system

The following function blbck is used to link the controller with the controlled system simulation pro- gram:

TI = 10s KS = 2 T1 = 20s

Network 1 NAME : Schnitt

:= D 27.7 :L DD134 :L KG+1600000+05 ::G :L KG+5000000+00 Conversion of :-G transfer and :L KG+2000000+05 simulated actual value

: XG :C DBlO :T DD44 :BE

ACTUAL

Solution:

1 Definition of the control structure; since the process is simulated by software, an analog input can be dispensed with.

h- " v

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.

,

Page 132: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

2 Defining the interconnections (data interfacing)

Setpolnt setter SET

' D

PID speed

controller ACT ,

P

Simulated controlled system

FB 96 l SOSTELL

SXA2

SHAUF

SHZU SXAl SE

a

*

,- FB 176 I IPD-REG

D

HAND ZElN SANBO

SANBU

I ST XA

SOLL I

FB 177

lMPH

~MPT r

IMP-AUSG

P

SANfZ

Pulse output module

'

XE

IMPH

IMPT

SE : DD23 SXAl : DD25 SXA2 : DD27 TIAN : DD29 TlAB : DD31

IST : DD44 XA : DD46 OBXA : DD48 UBXA : DD50

DD52 A N R : DD54 @,p : ~ ~ 5 6 KJTI : DD58

T1 : DD33 STEW : DW35 A(0) : DD36 OBSO: DD38 UBSO : DD40

T M : DD66 THLG : DD68 HAND : DD70 ZElN : DD72 I : DD74 P : DD76 D : DD78

XE : DD46 TMlN : DD80 STWO : DW82

IMPH : M1O.O IMPT : M10.1

Page 133: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

DB"INTERn

Page 134: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 83 DWs Old values of setpoint adjuster (FB 96) 10 DWs Old values of PID controller (FB 176) 23 DWs Old values of pulse output (FB 177) 3 DWs

Total 1 19 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 OB 13 FB 38 FB 96 DB 10 OB 20 FB 39 FB 176 DB 15 (OB 21) FB 63 FB 177

(OB 22) FB 69

(without controlled system simulation

5 Developing the system frame software according to Section 3 (for test purposes, it may be ad- vantageous to store the system frame software separately on floppy disk).

PBn1O0ms" = PB10 PBnAbtast" = PB11

0

Data

DD13

DD15

DW29

DW31

DW32

DW33

Format

K G

K G

KF

KY

KY

KY

Description

Sampling interval 1

Sampling interval 2

Address of last control loop

PB"100ms". PB 'Sampling"

Shift time, clock number

DB"INTER" . input bit (bit 0)

Value

+ 5000000+01

+ 0000000+00

+ 00031

010 . 011

000 . 001

010 . 000

Page 135: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

OB" 1 OOmsn FB "SAVEn

OB 20121 122 FB "RESTART" A

/ J U F B 3 8

Name : SAVE I DBNR: DB15 I _U

PB"100m~"

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

PBWSam ling" r-l

i JU FB69

Name : ORGAN1 ODAT: KF+5

FB "RESTORE"

Figure 7-3 System software

Page 136: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Single-Loop Control (3-Level In f. Operation)

6 Incorporating the required control block in the program blocks

PBlO PB "100ms" Network 1

:JU FBI77 Pulse output call 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 UBSO : DD40

PB "Sampling"

:JU FBI76 NAME :IPD-REG STEW : DW42 RSP : DW43 SOLL : DD25 IST : DD44 XA : DD46 OBXA : DD48 UBXA : DD50 ABTZ : DD52 ANTZ : DD54 KOIP : DD56 KIT1 : DD58 A(0) : DD60 KlTD : DD62 T1 : DD64 TM : DD66 T H L G : DD68 HAND : DD70 ZElN : DD72 I : DD74

PID controller call

Page 137: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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"

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 OB 20 and OB 13 and then assigned their parameters.

-

Data

DD23

DD25

DD27

DD29

DD31

DD33

DW35

Designation

SE

SXAllSOLL

SXA2

TiAN

Tl AB

T1

STEW

Format

KG

KG

KG

KG

KG

KG

KM

FB

SOSTELL

SOSTELLIIPD-REG

SOSTELL

SOSTELL

SOSTELL

SOSTELL

SOSTELL

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

Value

+ 2000000+02

+ 2000000+02

+ 3000000+01

00000000 10000001

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

0000000+00

+1000000+05

- 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

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

N O ) OBSO

UBSO

STEW

RSP

IST

XAlXE

OBXA

UBXA

ABTZ

ANTZ

KOlP

KIT1

A N )

KITD

T1

TM

THLG

HAND

ZElN

I

P

D

TMlN

STWO

Page 138: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

OB13 NETWORK 1

:JU FB38 NAME :RETTEN DBNR : DB15

:JU FB69 NAME :ORGAN1 ODAT : KF+5

:JU FB64 NAME :PROCESS DB-S : DBl 00 DB-P : DBI 01 DB-Q : DB102 DB-T : DB103

:JU FB 200 NAME :SCHNITT

:JU FB39 NAME :LADEN DBNR : DB15

:BE

Restart program: Modular control

Restart program: Software process simulation

Save flags

Control

Software controlled system simulation

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.

Page 139: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

Actuator """"F1 COOL = IMPT -

Figure 7-4 Schematic representation

Furnace r ' - - " - - - - - - - - - - - -

of the controlled system

The controlled system is simulated again.

Characteristics of the controller:

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

Pulse output:

TMIN = 0.1 S

Page 140: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 M5 .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

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

, M5.0 = 1 --> lnput value, controlled system =l M5.1 = 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

2 Defining the configuration structure

Simulated

process

Page 141: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

FE 62 PID-REG

D

XA

SANBO I ST SANBU

P -

FB 177 IMP-AUSG

S 0 LL SRMZU

XE

IMPH

SRMAU IMPT

STEW : DW23 SOLL : DD24 IST : DD26 XA : DD28 OBXA : DD30 UBXA : DD32 KOlP : DD34

WTI : DD36 A(0) : DD38 K/TD : DD40

: DD42 P : DD44 1 : DD& D : DD48

XE : DD28 TMlN : DD50 S W 0 : DW52

IMPH : M 5.0 IMPT : M 5.1

Page 142: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 OB 13 FB 38 FB 62 DB l 0 OB 20 FB 39 FB 177 DB 15 (OB 21) FB 63

(OB 22) FB 69

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"

Value

+ 5000000+01

+ 0000000+00

+ 00031

010 , 011

000 , 001

010 , 000

Data

DD13

DD15

DW29

DW31

DW32

DW33

Format

KG

KG

KF

KY

KY

KY

Description

Sampling interval 1

Sampling interval 2

Address of last control loop

PB" 1 00msW. PBWSampling"

Shift time, clock number

DBWINTER" , input bit (Bit 0)

Page 143: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 XE : DD28 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 IST : DD26 XA : DD28 OBXA : DD30 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

Page 144: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 "

') 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.

0 OB20 NETWORK 1

:JU FB63 NAME :ANLAUF AG : KF+O ART : KF+O

Data

DW23

DD24

DD26

DD28

DD30

DD32

DD34

DD36

DD38

DD40

DD42

DD44

DD46

DD48

DD50

DW52

ODAT: KF+5

FB

PID

PID

PI D

PlDllMP

PI D

PID

PID

PID

PID

PID

PID

PI D

PID

PI D

IMP

IMP

NAME :NEUSTART DB-S : DB100 DB-P : DB101 DB-T : DB103

:BE

Value

00010000 01010001 -

+ 1000000+05

- 1000000+05

+ 4300000+00

+ 2040000-01

- 1000000+05

- 1750000+02

+ 2500000+01

+ 1000000+00

00000010 00000001

Format

KM

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KM

Restart program: Modular control

Designation

STEW

SOLL

IST

XAlXE

OBXA

UBXA

KOlP

KlTl

A(O)

KlTD

T1

P

I

D

TMlN

S W 0

Restan program: Software controlled system

simulation

081 3 NETWORK 1

:JU FB38 NAME :RETTEN DB : DB15

Save flags

Page 145: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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.

r - - - - - - - - - - - 1 r - - - - - - - - - - 7 Actuator Gas supply lCombustlon process I I Furnace I

I I I

Gas OFF

I + Y I 1 l I I I L - - - - - - - - - - J I . I I I l I

Air ON I

Air OFF I I

L ,,,,--,,,,, J

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

Figure 7-5 Schematic representation of the controlled system

Page 146: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

Controlled system data:

Actuator, gas : TIG = 100s Gas supply : KPG = 0.75 Actuator, air : TIL = 100s Air supply : KPL = 1 Furnace : TU = 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 = 10s KPG = 0.75 TIL = 10s KPL = 1 TU = 175s TG = 550s KPO= 10

Page 147: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

Solution: 1 Defining the control structure

VF : Ratio factor XG : Actual value, gas XL : Actual value, air X : Actual value, temperature

SET

ACT *

S E T > P I D controller

Speed algorithm -

PID controller ACT *

,

SET - ,

AC

PID controller

S eed F &orkhm

,Gas OFF Gas ON L ~ f t OFF

1~u t - t ON

2 XL

X Controlled system simulation

Page 148: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Single-Loop Control (3-Level Int. Opera fion)

2 Defining t h e configuration s t ruc tu re

FB 62 PID-REG FB 176

= XL

IPD-REG

FB 177

D

X 4 IST

SAN30

SANBU

P I

IMP-AUSG

STEW : DW23 SOLL : DD24 IST : DD26 XA : DD28 OBXA : DD30 UBXA : DD32 KOIP :DD34

FB 176

<X> D

HAND

ZEIN SANBO

SANBU-

SOLL XA

I

IST P

SANTZ

Krr l : DD36 A(0) : DD38 K T D : DD40 T1 : DD42 P : DD44 I : DD46 D :DD48

IPD-REG

FB 177

STEW : DWSO RSP : DW51 SOU. : DD28 IST : DD52

: DD54 OBXA : DD56 UBXA : DD58 ABTZ : DD60 ANTZ : DD62 KOIP : DD64 ~m : DD66

<y>

XE IMPH

IMPT

SRMAU

SRMZU

IMP-AUSG

A(0) : DD68 K m : DD70 T1 : DD72 TM : DD74 l H L G : DD76 HAND : DD78 ZElN : DD80 I : DD82 P : DD84 D : DD86

XE : DD54

TMlN : DD88

S W 0 : DWSO

D HAND

IMPH : A 5.0

IMPT : A 5.7

FB 178

a XE IMPH.

IMP7

SRMAU

SRMZU

XE :DD lW

TMlN : DD138

S W 0 : DW140

KOEFFIZ

IMPH : A5 .6

IMPT : A 5.7

,

ZElN

SANBO

SANBU

XE

XA

SANBO

SANBU

IST XA

I SOLL

P

SANTZ

XE : DD52

KP : DD91

O3XA : DDS3

STEW : DW100 RSP : DWlOl SOU : DD98 IST : DD102

: DD1W OBXA : DD106 UBWI : DD108 ~ T Z : DD110

: DD112 : DD114 YAP :

UBXA : DD95

STEJ : DR97

XA : DD98

- A(0) : DD118 K A D : DD120 T1 : DD12 TM : DD124 THLG : DD126 HAND : DD128 ZElN : DD130 I : ~ ~ 1 3 2 P : DD134 D : DD136

Page 149: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

DB"INTERn

IPD air

IPD air

IMP air DW90 KM IMP air

DD91 COEF gas

Page 150: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

DB"INTERn

DD1 32 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).

Page 151: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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"is therefore as follows: Length of DB"ODATn = 256 + 2 m 3.

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 141 DWs Old values of the PID controller (FB 62) 12 DWs Old values of the PID controller (FB176) . 2 46 DWs Old values of the coefficient element 2 DWs Old values of pulse output module (FB 177) . 2 6 DWs

Total 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 OB 13 FB 38 FB 62 DB 10 OB 20 FB 39 FB 176 DB 15 (OB 21) FB 63 FB 177

(OB 22) FB 69 FB 178

Page 152: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 =PB10 PB "Sampling " = PB 1 1

Air control loop: TA = 0.5s Shift time = 1

PB"lOOmsU = PB 15 PB "Sampling" = PB 1 6

Gas control loop: TA = 0.5 S 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

DW38

DW39

Description

Sampling interval 1

Sampling interval 2

Sampling interval 3

Address of last control loop

PB" 100ms" , PB"SamplingW (temp. )

Shi time, clock number

DBWINTER" , input bit (Bit 0)

PB" 1 00msW, 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)

Forrnat

KG

KG

KG

KF

KY

KY

KY

KY

KY

KY

KY

KY

KY

Value

+ 2000000+01

+ 5000000+00

+ 0000000+00

+ 00037

010 , 011

000 , 001

010 , 000

015 . 016

001 , 002

010 , 000

020 , 021

002 , 002

010 , 000

Page 153: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

OB 20121122

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

-

Figure 7-7 System frame software

PB"lOOmsn

JU FB38 Name : RETTEN DBNR: DB15

JU F069 Name : ORGANI ODAT: KF+5

FB" RESTART"

FB "SAVE"

-FB" ORGANI" Temp.

/ PB"100ms"

PBnlOOms"

/ PBnlOOms"

Temp.

PB" looms"

PBWSam ling"

\

/ PB"100ms"

PBWSam ling"

PBW100ms"

F0 "RESTORE"

Name : LADEN DBNR : DB15

Page 154: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 IST : DD26 XA : DD28 OBXA : DD30 UBXA : DD32 KOlP : DD34 KlTl : DD36 A(0) : DD38 KlTD : DD40 T l : DD42 P : DD44 I DD46 D : DD48

:BE

PB10 NETWORK 1

:BE

PB "Sampling" of temperature control loop

PID controller call

PB "1 OOmsn of temperature control loop

Page 155: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 ABTZ : DD60 ANTZ : DD62 KOIP : DD64 KK l : 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

Page 156: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 STEB : DR97 XA : DD98

:JU FBI76 NAME :IPD-REG STEW : DW100 RSP : DW101 SOLL : DD98 IST : DD1 02 XA : DD1 04 OBXA : DD1 06 UBXA : DD1 08 ABTZ : DD1 10 ANTZ : DD1 12 KOIP : DD1 14 KIT1 : DD116 A(0) : DD118 KITD : DD1 20 T1 DD1 22 TM : DD1 24 THLG : DD1 26 HAND DD1 28 ZElN : DD1 30 l DD1 32 P DD1 34 D DD1 36

:BE

PB20 Network 1

:JU FBI77 NAME :IMP-AUSG XE : DD1 04 TMlN : DD1 38 S W 0 : DW140 IMPH : A 5.6 IMPT : A 5.7

:BE

PB "Samplingn of gas control loop

Coefficient element call

IPD controller call

PB "1 00ms" of gas control loop

Pulse output call

Page 157: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

7 Parameter assignment of control blocks

DB "INTER"

-

Value

00000000 00000001

+ 1000000+05

- 1000000+05

+ 5000000+00

+ 2100000+03

+ OOOOOOO+OO

+ 1000000+03

+ 1000000+02

00001000 0010001 0

00000000 l1001001

+ 1000000+05

- 1000000+05

+ 7000000t00

+ 4000000t01

+ 0000000+00

t 1000000t02

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)

K lTD

T 1

P

I

D

STEW

RSP

ISTIXE (XL)

XAIXE

OBXA

UBXA

ABTZ

ANT2

KOlP

KIT1

A(O)

KlTD

T1

TM

THLG

HAND

ZElN

1

P

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

Page 158: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

~ ~ 1 2 4

DD126

DD128

DD130

DD1 32

DD134

DD136

DD138

DW140

Format

KG

KG

KM

KG

KG

KG

KM

KG

KM

KM

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KM

Designation

D

TMlN

S W 0

KP

OBXA

UBXA

I STEB

XAISOLL

STEW

RSP

IST (XG)

XAIXE

OBXA

UBXA

ABTZ

ANT2

KO/ P

KIT1

N O )

KITD

T1

TM

THLG

HAND

ZEIN

I

P

D

TMlN

S W 0

FB

IPD air

IMP air

IMP air

COEF gas

COEF gas

COEF gas

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

IPD gas

IPD gas

IPD gas

IPD gas

IPD gas

IPD gas

IPD gas

IPD gas

IPD gas

Value

+ 1000000+00

00000001 00001 101

+ 6666666-01

+ 10000000+05

- 10000000t05

1100001 1

00000000 001 0001 0

00000000 l1001001

+ 1000000+05

- 1000000+05

+ 1000000+01

+ 1000000+01

OOOOOOO+OO

OOOOOOO+OO

OOOOOOO+OO

+ 15ooooo+o2

+ 1000000+00

OOOOOOOl 00001101

Page 159: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with PD Component

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

A s an example of a system that is more difficult to 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 T l l = l s T 1 2 = l S

Solution:

1 Defining the control structure

2 Defining the configuration structure

- Analog input

FB 95

FB 62

ANES

PID-REG

PI D controller

XA L ER

SBU

Analo outpup

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

M D5

IST XA

ANBO ANBU

M D9 MD1

,SOLL

VMAX : DD26 NA : DD28 ER : DD30 XA : DD32

STEW : DW37 SOLL : DD38 IST : ~ ~ 3 2 XA : ~ ~ 4 0 OBXA: DD42 UBXA : DD44 KOIP : DD46

XE

RS

WTI : DD48 A(0) : DD50 WTD : ~ ~ 5 2 ~1 : DD54 P : DD56 I : DD58 D : DD60

. STEB : DR34 XE : DD40 PBER: DW35

BG : DL36 KN : DR36

Page 160: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with PD Component

DB"INTERn

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:

DD54

DD56

DD58

DD60

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

KG

KG

KG

KG

SFB

T1

P

I

D

SBF

PID

PID

PID

PID

SBU SER A

SBU SSTR SLOG SUS

Page 161: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 + 2 m 1.

DBnINTER": DB 10

Length of DB "INTER":

Organizational data and interface and parameter area 61 DWs Old values of rapid analog input (FB 95) 0 DWs Old values of PID controller (FB 62) 12 DWs Old values of rapid analog output (FB 119) 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 OB 13 DB 10 OB 20 DB 15 (OB 21)

(OB 22)

5 Developing the system frame software with TA = 0.2s

PBnlOOms" = P B 1 0 PB"Samplingn = PB 11.

Page 162: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 STEB : DR34 PBER : DW23 BG : DL24 KN : DR24 VBER : DL25 VMAX: DD26 NA : DD28 ER : DD30 XA : DD32

:JU FB62 NAME :PID-REG STEW: DW37 SOLL : DD38 IST : DD32 XA : DD40 OBXA: DD42 UBXA : DD44 KOfP : DD46 K/TI : DD48 A(0) : DD50 K/TD : DD52 T1 : DD54 P : DD56 I : DD58 D : DD60

:JU FBI19 NAME :ANAS STEB : DR34 XE : DD40 PBER : DW35 BG : DL36 KN : DR36

PB "Sampling "

READ IN ACTUAL VALUE

COMPUTE MANIPULATED VARIABLE

OUTPUT MANIPULATED VARIABLE

Page 163: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with PD Component

7 Parameter assignment of control blocks

The following controller parameters are set:

K1 = 0.0723s-I KO = 0.3472 KD = 0.8333 S

T1 = 0.1 S

DB "INTER"

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

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

KY

KY

KG

KG

KG

KG

KM

KC

KY

KM

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

KG

Designation

PBER

FB

ANES

ANES

ANES

ANES

ANES

ANES

ANESIPID

ANESIANAS

ANAS

ANAS

PID

PID

PlDlANAS

PID

PI D

PI D

PI D

PI D

PID

PI D

PID

PID

PI D

BG

VBER

Value

NP

144 , 0

2 , O

+ 1000000+02

OOOOOOO+OO

OOOOOOO+OO

0 , O

NP

144 , 1

00010100 01000001

+ 1000000t05

- 1000000+05

+ 3472000+00

+ 7230000-01

0000000+00

+ 8333000+00

+ 1000000+00

KN

VMAX

N A

ER

XAllST

STEB

PBER

BG KN

STEW

SOLL

XAIXE

OBXA

UBXA

KOlP

KIT1

A(O)

KITD

T1

P

I

D

Page 164: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with PD Component

I L Controlled system Z I -,,,,,,,,,',,---------'J

SET-

--K-

Figure 7-9 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

l process z I L , - - - , - - - , , , - , - - - - , - - - - - - I

+L l

Figure 7-10 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.

Page 165: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

Page 166: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

T12 = 1 s

Controller characteristics:

TI = 13.824 S

K1 = 0.347 K2 = 0.833 h1 = 0.416 TIB = 1 S

TA = 0.2 S

Solution:

1 Defining the control structure

Controlled Status controller W/ I component system I - - - - - - - - - - - - l r - - - - - - C - - - - - - - - - - - - l I TI I 1 T l , TI1 T12 I

SET- I POINT

+ I

I I l I

I TIB I I I

I I I I

Page 167: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with I Component 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:

I element ERU A -

X3 , E l + - = NE3 A2

L

I To controller To controller

Page 168: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with I Component and Reduced Observer

The interconnection plan is then as follows:

FB 95 FB 119 ANES ANAS

ER XA XE R S

SBU -

STEB: DL26 PEER: DW25 E G : DL28 KN : DR28 VEER: DL29

VMAX: DD30 NA : DD32 ER : DD34 XA : DD62

FB 99 ADDITION

STEE: DR61

XE : DD78

PBER: DW80

BG : DL8:

KN : DR81

A E2 S A N E 0

NE3 SANBU - - - -

E2 XA

E3 A2 NE4 A1

FB 179 I ELEMEN"

- E l - A

E2 SANBO

_,.NE3 SANBU A2

.NE4 A1

E l : DD64 TI : DD47 E2 : DD17 ERU : DD53 NE3 : DD72 A : DD74 NE4 : DD17 OEA2 : DD19 A1 : DD23 UBA2 : DD21 A2 : DD70 STEW: DW49

VBER: D K 9 A(0) : DD17

STEB: DL61 ~1 : DD68

E2 : DD66 E3 : DD76

L

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

,.

FB 99

W1 : DD55 Kp2 : DD57

KP3 : DD59 XA : DD78

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

ADDITION

ER XA I El 2-

E3

FB 95

r

ANES

El 3-

E3

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

STEB: DRM

EI : DD66

E2 : DD74 E3 : DD17

STEB: DL50

E l : DD66 E2 : DD70 E3 : DD17

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

W 1 : DD53 : DD55

KP3 : DD17 XA : DD76

W 1 : DD51

KP2 : DD53 KP3 : D317 XA : DD72

FB 99 ADDITION

Page 169: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with I Component and Reduced Observer

DB"INTERn

Page 170: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

3 Defining the data blocks (Saving of flags is omitted)

DBnODAT": DB 50 Length of DBnODATn = 256 + 2 l. DB"INTERn: DB 51

Length of DB "INTERn

Organizational data and interface and parameter area 82 DWs Old values of the rapid analog input (FB 95) . 3 0 DWs Old values of the I element (FB179) . 2 8 DWs Old values of the summing element (FB99) . 3 12 DWs Old values of the rapid analog output module (FB 11 9) 0 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 OB 13 FB 63 FB 95 DB 51 OB 20 FB 69 FB 99

(OB 21) FB 119 (OB 22) 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.

0 PB60 Network 1

:BE

PB61 PB "Sampling" Network 1 READ IN PROCESS VALUES

:JU F895 READ IN SETPOINT NAME :ANES STEB : DL26 PBER : DW25 BG : DL28 KN : DR28 VBER : DL29 VMAX : DD30 NA : DD32 ER : DD34 XA : DD62

:JU FB95 NAME :ANES

READ IN X3

Page 171: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with I Component and Reduced Observer

STEB : DR26 PBER : DW25 BG : DL28 KN : DR29 VBER : DL29 VMAX : DD30 NA : DD36 ER : DD38 XA : DD64

0

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

* * * Network 2

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

:* * * Network 3 COMPUTE X2; REDUCED OBSERVER

:JU FB99 COMPUTE NE3 NAME :ADDITION STEB : DL50 E l : DD66 E2 : DD70 E3 : DD1 7 KP1 : DD51 KP2 : DD53 KP3 : DD1 7 XA : DD72

COMPUTE I COMPONENT

Page 172: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with I Component and Reduced Observer

:JU FBI79 NAME :I-GLIED E l : DD64 E2 : DD1 7 NE3 : DD72 NE4 : DD1 7 A1 : DD23 A2 : DD70 A(0) : DD1 7 TI : DD47 ERU : DD53 A : DD74 OBA2 : DD1 9 UBAP : DD21 STEW : DW49

:JU FB99 NAME :ADDITION STEB : DR50 E l : DD66 E2 : DD74 E3 : DD1 7 KP1 : DD53 KP2 : DD55 KP3 : DD1 7 XA : DD76

:* * * Network 4

:JU FB99 NAME :ADDITION STEB : DL61 E l : DD68

E2 : DD66 E3 : DD76 KP1 : DD55

KP2 : DD57 KP3 : DD59 XA : DD78

:JU FBI19 NAME :ANAS

STEB : DR61 XE : DD78 PBER : DW80

BG : DL81 KN : DR81

MANIPULATED VARIABLE COMPUTE MANIPULATED VARIABLE

OUTPUT MANIPULATED VARIABLE

Page 173: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

FB

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 l ADD2

ADD1

ADD1 l l-GL2 ADD2

ADDPIADD3

ADD3

ADD3

ADD3 / ANAS

ANES111-GL1

ANES2II-GL2

ANESSII-GLl ADDl /ADD21 ADD3

1-GL 1 lADD3

ADD1 11-GL2

ADD1 /I-GL2

1-GL2tADD2

STEB

STEB

BG

VBER

Value

0000000+00

+ 1000000+05

- 1000000+05

NP

00000000 00000000

0 , 2

144 , 0

2 , 1

+ 1000000+02

0000000+00

0000000+00

0000000+00

OOOOOOO+OO

0000000+00

0000000+00

+ 1382400+02

00000000 001 0001 1

+ 1000000+01

00000000 001 0001 l

00000000 00000000

+ 1736111+00

+ 4166666+00

+ 1000000+01

- 3472222100

- 8333333~00

00000000 00000000

STEB

KN

("A\ES 1

(A~JES 2 KN

VM AX

N A

ER

N A

E R

N A

ER

T1

STEW

TI

STEW

STEB STEB

KP1

KP2lERUIKP1

KP2IKP1

KP2

KP3

STEB I STEB

XAIEI

XAIE1

XAINE3lE1 /E1 /E2

AIE1

E2lA2

XAlNE3

AIE2

Page 174: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Control with I Component and Reduced Observer

DB1'INTER"

IST

Curve 1 : Disturbance variable Curve 2 : Process output; x2 measured Curve 3 : Process output; x2 observed

Value

N P

1 4 4 . 0

Data

DD74

DD76

DD78

DW80

DW81

Figure 7-13 Comparison between x2 measured and x2 observed

Format

KG

KG

KG

KS

KY

FB

I-GL2lADD2

ADDPIADD3

ADD3lANAS

ANAS

AN AS

Desigation

AIE2

XAlE3

XAIXE

PBER

BG KN

Page 175: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

7.6 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

Many processes contain time-invariant non-linearities in the form of non-linear transfer charac- teristic. Typical applications are the characteristic curves of servo valves or measuring sensors, or the titration curve of a specific acid, etc. The user frequently does not know the exact shape of the transfer characteristic. Merely the records taken during measurement permit em- 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 POLY- GON blocks:

I! I / -

EINFGLAT EINFGLAT POLYGON EINFGLAT

. .

Figure 7-14 Structure of the controlled system

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

Figure 7-1 5 Non-linear transfer characteristic

- Manipulated variable , Controlled

variable - Ir ir I/

Page 176: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

KM = 00000000 00000000; ' KF = +00000; KG = +0000000+00; KG = +0000000+00; KF = +00020; 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 = +l 700000+04; 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 10th Y value

20th X value 20th Y value

Page 177: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

30th X value 30th Y value

Internal values

Page 178: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 stimula- tion).

FUZ: L=

DIFF-GL

1 I- Gain KP

l I Value of Setpoint manipulated

I p D - R EG variable l-

4 l l i

Simulated control I I 1

system

Figure 7-1 6 Control structure

The IPD-REG block is used as a PID controller. The DIFF-GL derivative block is used for com- puting 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.

Page 179: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 corre- spond to the quasi-linear sections of the transfer characteristic. If an explicit transfer character- istic 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) .

INPUT 1 INPUT 2

AREA 2 l I AREA 4

O CONTROUED-VARIABLE 10000 -1000 GRADIENT 1000

OUTPUT 1

Meaning ,

NL : Negative large VS : Very small NK : Negative small S : Small

0.3 KP-ADAPTATION 2.0 0 : Zero L : Large PS : Posltlve small VL : Very large

ZF1 ZF2 ZF3 ZF4 PL : Positive large

P1 0 30 0 30 0 63 1.70 P2 0'30 0'60 0'90 2.00 MFn : n-th membership function P3 0130 0:60 0:90 2.00 P4 0.63 0.31 1.21 2.00 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 cho- sen for flat areas of the transfer characteristic, and small KP values for steep areas. The gradi- ent 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

Rule No. 2: 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

Page 180: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

Rule No. 3: IF CONTROLLED-VARIABLE = AREA1 AND [GRADIENT = NL OR GRADIENT = NS 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 = AREA3 AND [GRADIENT = NS OR GRADIENT = 0 OR GRADIENT = PS ]

THEN KP-ADAPTATION = 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 ele- ment. The DIFF-GL block has the standard values assigned.

Page 181: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

7.6.5 Defining interconnection structure and data storage system

7.6.5.1 Closed-loop controller blocks

All function block calls for the controller are combined inside a program block (PB 20). Derivati- ve-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 CLOSED-LOOP CONTROLLERS 1 l i

FUZ:APP F B I 7 6 IPD-REG l

F B l 1 3 FUZ:FUZ HAND D j 1 S A N B O

l

SANBU i i

DB : DB41' p

S T E W : D D 2 3 A(0) : D D 4 3 R S P : D D 2 4 WTD : D D 4 5 S O L L : D D 2 5 T 1 : D D 4 7 IST : D D 2 7 TM : D D 4 9 XA : D D 2 9 THLG : DD51 OBXA : D D 3 1 HAND : C D 5 3 UBXA : D D 3 3 ZElN : C D 5 5 ABTZ : D D 3 5 I : D D 5 7 A N T 2 : D D 3 7 P : D D 5 9 KOlP : D D 3 9 D : DD61 K l T l : D D 4 1

L l

':The u s e r def ines 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.

Page 182: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

/ DD29 I KG 1 XA 1 IPD-REG !

Data

DW23

DW24

DD25

DD27

I DD31 I KG I OBXA 1 IPD-REG 1 / DD33 I KG UBXA 1 IPD-REG 1

Format

KM

KM

KG

~ ~ ~ 0 1 ~ 1 IPD-REG 1 / DD41 I KG 1 KIT1 1 IPD-REG l

l

Designation / FB

DD35

DD37

1 DD43 I KG I A(0) 1 IPD-REG 1

STEW

RS P

SOLL

KG I I S T

1 DD45 I KG 1 K/TD 1 IPD-REG 1

IPD-REG

IPD-REG

IPD-REG

IPD-REG

KG 1 ABTZ

KG 1 ANTZ

/ DD47 I KG I TI 1 IPD-REG 1

IPD-REG

IPD-REG I

I DD49 I KG 1 TM 1 IPD-REG !

/ DD59 I KG / P 1 IPD-REG 1

r---

DD51

DD53

DD55

DD57

/ ~ ~ 6 1 I KG 1 D 1 IPD-REG 1

1 DD73 I KG I UBXA I DIFF-GL

IPD-REG

IPD-REG

IPD-REG

IPD-REG

-

KG

KG

KG

KG

~ ~ 6 3

DD65

DD67

DD69

DD71

1 ~ ~ 7 5 KM I STEB 1 DIFF-GL i

THLG

HAND

ZElN

I

Figure 7-19 Data storage in the controller data block

KG / XE / DIFF-GL

Several data b locks a r e assigned fo r t he fuzzy controller data. Each input or output requires o n e data block. The FUZ:RULE function b lock a lso requires a data block.

KG

KG

KG

KG

Fuzzy input CONTROLLED-VARIABLE : DB 41 Fuzzy input GRADIENT : DB 42 Fuzzy KP-ADAPTATION : DB 43 Fuzzy set-of-rule da ta : DB 49

X A

TD

T 1

OBXA

DIFF-GL

DIFF-GL

DIFF-GL

DIFF-GL

Page 183: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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

Page 184: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

Page 185: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 be- tween the data blocks is performed before and after the fuzzy application block has been called inside of PB 20.

Page 186: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

. a .

0000 :SPA FB 104 0001 NAME :DIFF-GL . . . OOOA : OOOB :L DD 27 OOOC :A DB 41 OOOD :T DD 1 OOOE :A DB 20 OOOF :L DD 65 0010 :A DB 42 0011 :T DD 1 0012 :SPA FB 40 0013 NAME :FUZ:APP 0014 :A DB 43 0015 :L DD 4 0016 :A DB 20 0017 :T DD 39 0018 : 0019 : OOlA :SPA FB 176 001 B 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 pro- gram block.

Figure 7-20 shows the interconnection structure of the system. The sample data of the non-li- near characteristic curve (Figure 7-15) has been stored in DB 15.

Page 187: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

I PB10' I STRECKE 1

I EINFGUT F B U EINFGLAT

DB-P : D015 : DD42

L l

': 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).

/ DW23 / KM I

I STEB I ElNFGLATl I

l

Data

l I I I

DD24 I KG I XE I EINFGLATI l

Format

, l I l . . / DD30 I KG I XAIXE I EINFGLATlfEINFGLAT2

DD26

DD28

Designation FB 1

KG

KG

/ DW32

i DD33

1 DW41 I KM I STEB 1 EINFGLAT3 1

Figure 7-21 Data storage structure of the system parameters

T l

NO)

KM

KG

EINFGLATPfPOLYGON

POLYGONlElNFGLAT3

DD37

I DD39

L I

EINFGLATI 1

STEB

T1

KG

KG

EINFGLAT2

EINFGLAT2

XAIXE

XAIXE

Page 188: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 0000

NAME 0005 0006 0007 0008 0009 OOOA OOOB oooc OOOD

SCHNlll :A DB 10 Controlled variable :L DD 46 :A DB 20

:L DD 29 Manipulated variable :A DB 10 :T DD 24 :BE

7.6.6 Data block parameter setting

7.6.6.1 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 DW 0...22

Interface and parameter area DW 23.. .75

Old values DW 76..104

Page 189: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Using Fuzzy Control for Adapting the Gain of a PID Controller

1 D W I ~ 1 KF / o l d value offset 1 t 7 6 1

Figure 7-22 shows the entire DB 20 structure.

Data

DWO

DW15

DD19 I KG I Default l 1 +1000000+01

DD17 / KG

Format Designat ion

Default 0 / +OOOOOOO+OO

DD27 1 KG I IST / IPD-REG 1 +0000000+00 1

DW23

DW24

DD25

DD29 I KG I XA 1 IPD-REG 1 +0000000+00 1

FE Va lue

KM

KM

KG

DD35 / KG / ABTZ ( IPD-REG I +0000000t00 I

0000

0000

KH

KH

DD31

DD33

DD37 / KG I ANT2 I IPD-REG I +0000000+00 1 1

System area

STEW

RSP

SOLL

KG

KG

DD43 I KG I A(0) I IPD-REG I +0000000+00 1 1

IPD-REG

IPD-REG

IPD-REG

- pp

DD39

DD41

00000000 00000000

00000000 10000001

+8500000+04

OBXA

U BXA

DD51 I KG 1 THLG I IPD-REG 1 +0000000+00 1

-

KG / KOiP

KG I K/TI

DD45

DD47

DD49

IPD-REG

IPD-REG

I DD59 I KG 1 P I IPD-REG 1 +0000000+00 /

+1000000+05 I

+0000000+00 l

IPD-REG

IPD-REG

KG

KG

KG

' DD53

DD55

DD57

DD61 / KG I D I IPD-REG / +0000000+00 DD63 I KG 1 XE I DIFF-GL / +0000000+00 I

+4000000+00 1 +7400000+00

1 1

I DD65 I KG / XA / DIFF-GL 1 +0000000t00 1

K/TD

T 1

TM

/ DD67 I KG / TD / DIFF-GL / +1000000+01 1

KG I HAND

IPD-REG

IPD-REG

IPD-REG

IPD-REG

IPD-REG

IPD-REG

KG

KG

+1900000+00 1 t5000000-01 1

+0000000+00

+0000000+00

+0000000+00

+0000000t00

ZElN

I

DW76 KH Old value memory area

0000 1 DW1041 KH 1 0000

DIFF-GL / + I O O O O O O ~ O I ,

DIFF-GL 1 +1000000T05 j

pp-p

DDBS [ K G

D D ~ I / KG

DD73

DW75

-p- --

Figure 7-22 "INTER" DB of controller data

T 1

OBXA

KG

KM

UBXA

STEB

DIFF-GL 1 -1000000+05

DIFF-GL / 00000000 00000000

Page 190: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 func- tions 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 DW 0.. .22

Interface and parameter area DW23.. .47

Old values DW48.. .59

I I

DWO KH 0000 System area

D ~ I S KH 0000

Data

DW16 1 KF

DD17 / KG

1

FB I Value 1 Format

Oid value offset 1 +48

Default 0 1 +0000000+00

DD19 / KG

DD21 / KG

Designation

Default 1 / +OOODOOO+OO

Scratchpad flags / +0000000+00

DW23

DD24

DD26 1 KG

DD28 ) KG

KM

KG

DD30

DW32

h 4 1 - 1 KM I STEB I EINFGLAT3 / 00000000 00000000 /

T 1

DD37

DD39

DW48 KH

6 i 5 o 1 KH 1 Old value memory area

STEB

X E

KG

KM

Figure 7-23 "INTER" DB of system data

EINFGLATI

ElNFGLATl

KG

KG

EINFGLATI 1 00000000 00000000

+5000000+00 1 +OOOOOOO+OO 1

XAIXE

STEB

EINFGLAT1

EINFGLATIIEINFGLAT2 1 +0000000+00

EINFGLAT2 / 00000000 00000000

XAlXE

XAlXE

+0000000+00

EINFGLAT2lPOLYGON / +0000000+00

POLYGONIEINFGLATS 1 +0000000+00

Page 191: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 : ANL-MINI C ::item simulation Type : 01112- DBNR : +10 PBNR : 410

SPA FE20 FB20 PB20

Controller structure PBNR : 120 call

: +2000000-01 ... .: 0 for OB 20: c o l d r e s t a r t ; 1 for OB 21: 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

DB-P : D3 11

SPA Fa23 Name : ORG-MINI DBNR : + l 0 PBNR : + l 0

SPA FB39 Name : LADEN DB-P : Da H

SPA F038 Name : RETTEN DB-P : DB H

... SPA FB23

Name : ORG-MINI DBNR : t20 PBNR : +PO

SPA FB39 Name : LADEN DB-P : DB 11

Save flag area

lime-controlled \ sys t em simulation call

Load flag area

Controllerlsystem interface

Save flag area

P820

\ Time-controlled controller structure call

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 sam- pling 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 se ts 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).

Page 192: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 con- trol. The transient recovery times of the system with a fuzzy controller are significantly shorter, and the controlled variable does not overshoot.

0 1 2 3 min

PID controller

Fuzzy + PID controller

l-W: setpoint

2-X: Controlled variable

Figure 7-25 Simulation results

Page 193: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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 1 19 . . . . . . . . . . . . . . . 5-53

Average Time. FB 189 . . . . . . . . . . . . . . . . . . . . 5-78

Block length ........................ 6-1 Block name . . . . . . . . . . . . . . . . . . . . . . . . 6-1 Block number

Function block . . . . . . . . . . . . . . . . . . . . 2-1

Cascaded control . . . . . . . . . . . . . . . . . . . 1-2 Channel selector

0ne.out.of.two. FB 1 15 . . . . . . . . . . . 5-40 Characteristics

Temperature sensors . . . . . . . . . . . . . . . 6-4 Clock distribution . . . . . . . . . . . . . . . . . . . . 3-6 Clock distribution system ............. 3-7 Clock number . . . . . . . . . . . . . . . . . . . . . . 3-7 Coefficient element

FB 178 .......................... 5-71 Comparison point

FB 98 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30 Control

Modular . ......................... 3-1 Principle ...................... 4.1. 4-2

Control block . . . . . . . . . . . . . . . . . . . . . . . 3-3 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 Function block call . . . . . . . . . . . . . . . . . 4-3 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 Observer structures . . . . . . . . . . . . . . . . 1-2 Ratio control . . . . . . . . . . . . . . . . . . . . . . 1-2 Servo control . . . . . . . . . . . . . . . . . . . . . 1-2

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

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

Page 194: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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-1 3 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 11 1 Setpoint output for BCD .......................... displays 5-35

. . . . . . FB 11 2 High-low value selection 5-37 . . . . . . . . . . . . . . . . FB 1 13 Fuztification 5-80 . . . . . . . . . . . . . . . FB 1 14 Limit monitor 5-38

FB 1 15 One-out-of-two . . . . . . . . . . . . . . . . . . . channel selector 5-40

. . . . . . . . . . . . . . FB 1 16 Defuzzification 5-82 ........... FB 1 17 Polygon generator 5-41 . . . . . . . . . . . . . . FB 1 18 Time scheduler 5-44

. . . . . FB 119 High-speed analog output 5-53 FB 14 Mathematical block ............ 5-6

. . . . . . . . . . . . . . . . . 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 1 18 5-47

Page 195: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

Index

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-1 2. 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

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-1 5 Organizational Mini

FB 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 Output variable

. . . . . . . . . . . . . . . . . . . . . . . Set of rules 4-3 Overview of blocks . . . . . . . . . . . . . . 2.1. 2-2

Pade approximation . . . . . . . . . . . . . . . . . . 5-8

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

. . . . . . . . . . . . . . . . . . . . . . . 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

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 11 1 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

Page 196: Modular PID and Fuzzy Control - Siemens AG · REG155STS5D Modular PID and fuzzy control for CPUs 9461947, 948, 946Rl947R REG135ST.S5D Modular PID and fuzzy control for CPUs 922*,

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