Professional Documents
Culture Documents
1.3 Measurement and Control: 1.3.1 CTRL - PID: PID Controller Block 1.3.1.1 CTRL - PID: Description
1.3 Measurement and Control: 1.3.1 CTRL - PID: PID Controller Block 1.3.1.1 CTRL - PID: Description
1.3 Measurement and Control: 1.3.1 CTRL - PID: PID Controller Block 1.3.1.1 CTRL - PID: Description
Function
CTRL_PID is a continuous PID control block used for setting up the following
standard controller circuits: fixed setpoint controls, cascade controls (single /
multiple cascades), ratio controls, synchro controls and proportional controls.
In addition to its actual controller functions, block provides the following processing
options:
• Modes: Manual mode, automatic or tracking
• Limit monitoring of the process variable and error signal as well as message
generation via the ALARM8_P block.
• Disturbance variable input
• Setpoint tracking (SP=PV_IN)
• Setpoint value and process variable range setting (physical normalization)
• Setting the range of values for manipulated variables (physical normalizing)
• Dead band (on threshold) in the error signal branch
• Proportional, integral and derivative action, which can be enabled and disabled
individually
• Proportional and derivative action in the feedback path.
• Operating point setting for P or PD controller mode
Calling OBs
The watchdog interrupt OB in which you install the block (for example OB32). It is
also installed in OB100 (see startup characteristics).
Operating principle
The block operates as (delayed derivative action) PID controller. Its step response
is shown below, with integrator functions according to the trapezoid rule.
LMN
LMN_HLM
GAIN * TV
TN
LMN_LLM
0 if t<0
Input jump ER(t) = {
1 if t>0
Note
The input parameter LMNR_IN is displayed in the faceplate (loop display) as the
manipulated variable. If there is no position feedback available from the process,
you can interconnect the manipulated variable output LMN with LMNR_IN in CFC
in order to display the manipulated variable in the loop display.
Setpoint generation
The setpoint SP can be obtained from three different sources, which are selected
via the inputs SP_TRK_ON and SPEXTSEL_OP in accordance with the following
table:
Internal setpoint
The internal setpoint SP_OP is controlled via OP_A_LIM or OP_A_RJC (range
SP_LLM - SP_HLM).
External Setpoint
The external setpoint SP_EXT can be interconnected and is limited to the range
(SPEXTLLM,SPEXTHLM).
Changes in the internal or external setpoint are limited to a maximum gradient
(SPDRLM, SPURLM), provided the setpoint ramp has been set (SPRAMPOF = 0).
Tracked setpoint
If SP_TRK_ON=1, the process variable PV_IN is used as the setpoint. tracking of
the setpoint to the process variable is enabled only in manual mode (for internal
setpoint and when SPBUMPON = 1), and is primarily used to provide an adequate
setpoint when switching from manual to auto mode.
ER
S P - P V _ IN
D EA DB _W
Physical normalization
The error signal ER is normalized from the physical measuring range of the
process variable (NM_PVHR, NM_PVLR) to a percentage.
ER
ERnormiert = * 100
NM _ PVHR − NM _ PVLR
After the PID algorithm has been executed, the manipulated variable is
denormalized from a percentage value to the physical measuring range of the
manipulated value (NM_LMNHR,NM_LMNLR).
LMN normiert
LMN = NM_LMNLR + * ( NM _ LMNHR − NM _ LMNLR )
100
• The changeover from manual to auto mode is carried out at the OS by setting
the parameter AUT_ON_OP, if LIOP_MAN_SEL=0.
• The change from manual to auto is carried out by means of interconnection in
the CFC by setting the parameter AUT_L, if LIOP_MAN_SEL=1.
• Tracking mode can be enabled only by means of an interconnection via the
parameter LMN_SEL. Tracking takes priority over manual and auto mode.
In auto mode, the normalized manipulated variable is generated according to the
following algorithm:
1 TV * s
LMN normiert = GAIN * 1 + + * ERnormiert
TN * s 1 + TM _ LAG * s
Manual mode
The manipulated variable is set by the operator at OS via the input MAN_OP. It is
operated and limited by means of OP_A_LIM or OP_A_RJC (range MAN_HLM –
MAN_LLM). The output values of QVHL and QVLL of OP_A_LIM or OP_A_RJC
are passed to the outputs QLMN_HLM and QLMN_LLM.
Automatic mode
The PID algorithm calculates the manipulated variable. The control parameters
GAIN, TN, TV and TM_LAG can not be interconnected by default. If they must be
interconnected for exceptional applications such as gain scheduling, the
corresponding system attribute s7_link must be modified. Note that parameter
changes during automatic operation may cause to a surge of the manipulated
variable.
• The controller direction of control can be reversed (rising error signal causes a
falling manipulated variable) by setting a negative proportional GAIN. The
proportional action can be disabled by setting P_SEL = 0, and the integral
action by setting TN=0. If the manipulated variable LMN is limited for auto
mode, the integrator is set to hold (anti-wind-up). The direction of action of the
integrator is reversed by inverting the sign at parameter TN.
• Operating point (input LMN_OFF): Sets the operating point at the input
LMN_OFF. In auto mode, this value replaces the disabled integral action of the
PID algorithm. The operating point is entered in the measuring range of the
manipulated variable.
• The derivative action is designed as a delaying derivative function. It can be
disabled by setting TV=0. The direction of action of the differentiator is reversed
by inverting the sign of the value at parameter TV.
• The delay constant TM_LAG should have a meaningful ratio to the derivative
action time TV. This ratio is also referred to as the "derivative gain" (maximum
of the unit step response of the derivative component). Its value usually lies
within the range 5 < TV/TM_LAG < 10.
• Setting proportional action in feedback path: When PFDB_SEL = TRUE, the
proportional action is set in the feedback. Hence, a control step does not affect
the proportional action, so that overshoot can be reduced or avoided when the
setpoint value changes, without changing the tracking characteristics. In auto
mode, a reset at PFDB_SEL will cause an extremely high surge of the
manipulated variables, i.e. the mode should be changed only in manual mode.
• Setting derivative action in feedback path: The derivative action is set in the
feedback by setting DFDB_SEL = TRUE. A control step therefore does not
affect the derivative action. The changeover of DFDB_SEL is not bumpless.
Tracking mode
In this state (LMN_SEL=1) the manipulated variable is fetched from the
interconnected tracked value LMN_TRK and set at the output. The outputs
QLMN_HLM and QLMN_LLM are set to FALSE. "Tracking" mode takes priority
over all other modes, which means that this input can be used to configure an
emergency-off circuit for the system.
External/Internal setpoint
The changeover is carried out by OS operation of the input SPEXTSEL_OP or by
interconnection of SPEXON_L. You must set the corresponding enable inputs
SPINT_EN, SPEXT_EN or the selection input LIOP_INT_SEL to enable the
changeover.
If SPBUMPON = 1, the effective setpoint is taken over to the internal setpoint in
order to allow a bumpless changeover from external or tracking mode to internal
mode.
1
FA LS E
SP IN T_E N Q S PIN TEN
0
SP_OP_ON
Manual/auto mode
The operator performs a changeover at the OS by setting input AUT_ON_OP or by
interconnecting AUT_L. You must set the corresponding enable inputs
MANOP_EN, AUTOP_EN or the selection input LIOP_MAN_SEL in order to
enable this changeover.
1
FALSE
AUTOP_EN QAUTOP
0
1
FALSE
MANOP_EN QMANOP
0
QAUTOP = TRUE: AUT_ON_OP can be set from FALSE (manual mode) to TRUE
(automatic mode).
QMANOP = TRUE: AUT_ON_OP can be reset from TRUE (automatic mode) to
FALSE (manual mode).
If appropriate, AUT_ON_OP is tracked or reset.
OP_A_LIM / OP_A_RJC
Error handling
The block algorithm handles the following events:
Startup characteristics
During CPU startup, the internal setpoint of the CTRL_PID is set in manual mode.
The block must be called from the startup OB accordingly. In CFC engineering this
is handled by the CFC. Using the basic STEP 7 tools, you must enter the call in the
startup OB.
After startup, the messages will be suppressed for the duration of the cycles set in
RUNUPCYC.
Time response
The block must be called in a watchdog interrupt OB. The sampling time of the
block is entered in the parameter SAMPLE_T.
Message characteristics
The CTRL_PID block uses the ALARM8_P block for generating messages.
Messages are triggered by
• The functions monitoring the limits of process variables and the error signals,
• The CSF signal which is referenced as a control system error by
interconnection.
Messages triggered as a result of the violation of limits can be suppressed
individually via the corresponding M_SUP_xx inputs. Process messages (not the
system control messages!) can be completely locked by setting MSG_LOCK.
QMSG_SUP is set if the RUNUPCYC cycles have not expired since the restart
when MSG_LOCK = TRUE or MSG_STAT = 21.
The table below lists message texts of the CTRL_PID block and their assignment
to the block parameters.
The first three of the auxiliary process values of the message block are assigned
SIMATIC BATCH data, the fourth is reserved for PV_IN, while the remaining value
(AUX_PRx) can be set user-specific.
Note
In order to print out the block diagram, select landscape format in the "Print" dialog
box. The diagram is then printed on two pages, which you can join if required.
LIOP_INT_SEL
1 QSPEXTON
SP_TRK_ON A
SPEXON_L N
SPBUMPON
D
SPEXTSEL_OP NOT QMAN_AUT O
0 R
LMN_SEL
SPEXTHLM
SPEXTLLM
QSP_HLM SPRAMPOF
QSP_LLM
SP_EXT
SPURLM
SPDRLM
SAMPLE_T
1 1 1
PV_IN
OP_A_LIM / OP_A_RJC
SP
0 0 0
SP_TRK_ON OR LINK_ON
QUPRLM
QDNRLM
V
SP LINK_U
SP_OP U QVHL QSP_HLM
SP_HLM U_HL QVLL QSP_LLM
SP_LLM U_LL
SPBUMPON BTRACK
PFDB_SEL
P_SEL
1
1
0
0.0
ER 0
DFDB_SEL
TV
NM_PVHR TM_LAG
DEADB_W NM_PVLR SAMPLE_T
1
phys
0
%
TN
INT_HPOS
INT_HNEG
GAIN SAMPLE_T
NM_PVHR
NM_PVLR 0
PV_IN
phys
PVH_ALM 1
%
PVH_WRN
PVL_WRN NM_LMNHR
PVL_ALM -1 NM_LMNLR
HYS
QPVH_ALM
QPVH_WRN phys
LMN_OFF
QPVL_WRN %
QPVL_ALM TN = 0
DISV LMN_SEL
NM_LMNHR LMN_HLM
NM_LMNLR LMN_LLM
QLMN_HLM
% QLMN_LLM
1 0
LMN
phys
0 1
LMN_TRK
LIOP_MAN_SEL
1
AUT_L
AUT_ON_OP QMAN_AUT
0
OP_A_LIM / OP_A_RJC
LINK_ON
V
LINK_U
Bit no.: 7 6 5 4 3 2 1 0
Parameter - - - QSPEXTON QMAN_AUT MSG_LOCK BA_EN OCCUPIED
Bit no.: 15 14 13 12 11 10 9 8
Parameter OOS QMSG_SUP LMN_SEL - - - - -
The 16-bit input USTATUS (data type WORD) uses the high bits (bit 16 - 31). The
user can use these freely.
All analog displays are created by means of the "AdvancedAnalogDisplay". The number format is set via the
block icon ("Format_InputValue" and "Format_OutputValue" properties).
The View has 2 "Permission" as objects for the input of setpoints and manipulated variables, since operator
authorizations for these variables depend upon various factors
The "Permission_Setpoint" object evaluates the WinCC authorization levels, as well as the
"Q_SP_OP = TRUE" parameter..
The "Permission_Manual" object evaluates the WinCC authorization levels, as well as the
"QLMNOP = TRUE" parameter.
@Level5 D Authorization
btAuto D Authorization
btManual D Authorization
btExtern D Authorization
btIntern D Operator control enable
Permission_Setpoint D Level_Source D Level_Target
Permission_Manual D Level_Source
Permission_Setpoint D Target_ Operator control enable
Setpoint_AnalogValue D Operator control enable
Permission_Manual D Target_ Operator control enable
Manual_AnalogValue D Operator control enable
Format D Format_InputValue
Setpoint_AnalogValue D Format
ProcessValue_AnalogValue D Format
Format D Format_OutputValue
Manual_AnalogValue D Format
Output_AnalogValue D Format
ParameterView
The process value "Error signal_AnalogValue" is set via the "AdvancedAnalogDisplay", the number format is
set via the block icon ("Format_InputValue" property).
All other analog displays show the conventional "Floating-point format" I/O field.
This setpoint bar graph shows the setpoint control limits, with reference to the bar graph limits.
Diagnosis View
Diagnosis view shows in addition the Interface description and-status .
The Parametervalues are not changeable.
Alarmview
The PID Controller-related Operation and alarm reports are shown in the Alarmview.
Informationview
Description of the Informationview see Systemdescription CEMAT.