FBLOCK
pid Pid controller:
Pid controller has basically two operating modes:
MANUAL and AUTOMATIC; refer to 'ma', 'mac' and
'amc' In manual control mode the value of the 'con'
output can be operated from the control room.
In automatic control mode the output value is
calculated on the basis of pid algorithm, measured
value 'me' and selected setpoint sp1, sp2 or sp3.
Control calculation:
Error 'e' is calculated from the formula e = sp -
me (sp :: active setpoint, me :: measured value)
(NOTE!! In Damatic Classic: e = me - sp !!).
Controller operating directions:
Direct => sign of output change is the same as
the sign of error value (e.g., negative
error => negative output change)
Reversed => sign of output change is opposite
from the sign of error value (e.g.,
negative error => positive output change)
The control algorithm can be affected with
configuration parameters 'pu', 'squ', 'iu', 'deu'
and 'ffu'. Control direction is defined with the
'condir' parameter. In addition, either absolute
or incremental control mode can be selected with
the 'cmode' parameter. The algorithm tuning values
(inputs 'kp', 'ti', 'td', 'tdf' and 'kff') are
scaled internally so that they correspond to the
function block's execution interval; this is done
by setting the 'parch' input which activates the
scaling calculation.
The placing of new values is also affected by the
'parx' parameter which defines whether the jump in
the output caused by parameter change will be
embedded in the controller's internal integrator.
Setpoints:
The setpoints to be used are selected with the
'spu2' and 'spu3' parameters. ('sp1' is always
used) The 'track1', 'track2', 'track3',
'cha1', 'cha2' and 'cha3' parameters define the
behaviour of the setpoint when changing from
MANUAL to AUTO, in AUTO mode after forced control,
and when changing the active setpoint. The actual
setpoint is selected through the 'isp' input.
Alarms:
Alarms are selectable for measured value, error
value or output value with the 'meau', 'eau' and
'coau' parameters. Four alarms and limits can be
defined for measured value: 'mehha' ('mehh'),
'meha' ('meh'), 'mela' ('mel') and 'mella'
('mell'). Error and output have two alarms and
limits each: 'eha' ('eh'), 'ela' ('el') and 'coha'
('coh'), 'cola' ('col'). All alarms have a common
alarm hysteresis, <% of range>, which is defined
with the 'ahys' parameter.
Function block allows crossing the alarm limits
(Damatic XD version 6.0 and up), when all alarms can be on
simultaneously. With a parameter in cpu-configuration file
(hook -classic_pid_alarms) the function can be returned back
to what it was before, when crossing the alarm limits is forbidden
i.e. function block turns the limits back to right order.
Forced control:
The available forced control modes include forced
manual control (the 'fm' input) and forced control
(the 'fc' and 'fcin' inputs). The operation of
these controls is defined with the 'aftfm' and
'aftfc' parameters. The effect of measured value
'me' fault bits can be as follows:
a) no effect
b) forced manual
c) forced control
The selection of the desired effect is made with
the 'fbact' parameter.
Limit situations:
Measured values and setpoints are internally
limited between 'memi' and 'mema'; for instance,
the error value is calculated from limited values.
The 'con' output is limited 1) internally between
'comi' and 'coma', and 2) externally through
the 'colmi' and 'colma' inputs.
In addition, the rate of change of the output is
limited with the 'conch' parameter in incremental
control mode. The following situations are applied
in output limitation:
1) at limit due to p + i terms; withdrawing from
the limit will then begin when changes in integral
action drive the output off from the limit
2) at limit due to d term; in this case the
withdrawal from the limit is actually slowed down
so that the unrealized control (limit exceeded)
caused by the d term will be compensated in the
other direction also.
pu= bool8 1
P-term in use.
Pid as P-controller (iu = 0)
When switching from manual to automatic control mode,
output 'con' is calculated from the formula
con = kp * (sp-me) + bias with the speed of input 'ti'.
If output scale (coma - comi) is 100%, the output change
amount is 100 / ti.
When error value is zero, ti = 1 and module is in 1 second
execution cycle, con = bias within one execution cycle.
If cha1 = 1 (example here is sp1), and setpoint is changed,
output 'con' goes with the speed of 'ti' to the final value,
into which it directly jumps, if cha1= 0.
If one desires P-control type of function without bias-effect
in M/A mode change and setpoint change:
define pid to be PI (iu = 1) and passivate integration with
input 'ion' (ion = 0). (By this way pid can be also be used as
dummy user interface controller).
squ= bool8 0
Squaring of P-term in use
iu= bool8 1
I-term in use
deu= bool8 0
D-term in use
ffu= bool8 0
Feedforward channel ('mff') in use
parx= bool8 1
Parameter exchange; effect of parameter
change is sunk in integrator
cmode= uns8 0
Control mode:
0 = ABSOLUTE CONTROL MODE
1 = INCREMENTAL CONTROL MODE
2 = ABSOLUTE CONTROL MODE + fail-safe behaviour,
when 'conb' has faultbits
3 = INCREMENTAL CONTROL MODE + fail-safe behaviour,
when 'conb' has faultbits
4 = ABSOLUTE CONTROL MODE where the absolute value
of 'mansp' is set to output 'con'
6 = ABSOLUTE CONTROL MODE which has the features of
both mode 2 and mode 4
Fail-safe behaviour means that when the controller goes
to forced manual because there are effective faultbits on
in 'conb' (i.e. DER, OLD, INV or EXT) in modes 2 and 3
faultbit INV is added to output 'con', which causes the
FBC not to send the control to outputs.
This function causes, that output is not controllable when
'conb' has effective faultbits on, output 'outctrl' is set
to zero and control room is notified that output is not
controllable with output 'mansp'.
When effective faultbits disappear, value of 'conb' is
copied to 'con'. Controller can also go to forced manual
bacause of the faultbits in measurement. In this case
function always happens according to modes 0 and 1.
If controller is in forced manual caused by input 'fm'
function is allways as in cmode 0 and 1 except if at the
same time there is also active forced manual caused by
faultbits in 'conb'. Then faultbit INV is added to
output 'con' and when the fault goes off the value
of 'conb' is copied to 'con'.
Using 'cmode' 2, 3 and 6 also requires the setting of
input 'actconb', see help text of 'actconb'.
In manual control (cmode 0 and 2) controller functions so,
that when forming the value of output 'con' the change
in 'mansp' is used instead of it's absolute value. OPS
calculates the change of 'mansp' from the value of input
'pos'. This causes an erroneous function in case where
there is difference between output 'con' and input 'pos'
for example derived from ramp and the controller is
working in absolute control mode with actconb=0.
When cmode is 4 then in manual control
the absolute value of manual setpoint is set output 'con'
cmode 4 should be used as absolute mode, when the 'pos'
-input shown in control room is connected through
ramp-connention to output 'con' or if output card has ramp.
In this case also pidn in OPS must be configured to function
in ramp-mode. In cmode 4 the value of 'mansp' can be set
with diagnostic station. In automatic control the function
of cmode 4 does not differ from cmode 0.
When 'cmode' is set to value 6, controller works as
cmodes 2 and 4 combined.
When this function block is used with function blocks mca
and vlv modes 1 and 2 must be used.
condir= int8 -1
Control direction:
+1 = direct (negative error => negative output
change)
-1 = reversed (negative error => positive
output change)
aftfm= bool8 1
Operation after forced manual control (fm):
0 = controller to MANUAL; 'ma' input also
forced to MANUAL while forced manual
control is on
1 = controller to the status determined by
'ma'; does not affect the 'ma' input while
forced manual control is on
aftfc= uns8 1
Operation after forced control (fc):
0 = controller to MANUAL; 'ma' input also
forced to MANUAL while forced control
is on
1 = controller to the status determined by
'ma'; does not affect the 'ma' input
while forced control is on
When ma = AUTO and forced control ends,
the measured value is copied as setpoint
if track# = TRUE.
2 = as case 1, but setpoint value is kept
while forced control is on.
When ma = AUTO and forced control ends,
the measured value is not copied as setpoint.
3 = as case 1, but measured value is copied
as setpoint while forced control is on.
When ma = AUTO and forced control ends,
the measured value is copied as setpoint.
fbact= uns8 2
Action of measured value fault bits:
0 = NO EFFECT
1 = FORCED CONTROL
2 = FORCED MANUAL CONTROL
For effective fault bits, see 'fbmask'. Setting
of measurement input fault bits will always set
'wd' and 'wdd' correspondingly, except fail bits
ovf, dis and sex, which are effective only
if they are not masked out by 'fbmask'.
fbmask= uns16 140
Measurement input fault bits mask:
If 'fbact' defines any actions for the
measurement input fault bits, 'fbmask' specifies
those fault bits that are not taken into account,
i.e., the fault bits that are masked. The values
corresponding to individual fault bits are as
follows:
2 = 'ext'
4 = 'ovf'
8 = 'dis'
16 = 'inv'
32 = 'old'
64 = 'der'
128 = 'sex'
The mask value is derived by summing the values
corresponding to the bits to be masked.
memi= float 0.0
Measurement scale minimum:
The 'memi' (minimum) and 'mema' (maximum) values
must be correctly defined, so that 'mema' is
greater than 'memi'.
mema= float 1.0
Measurement scale maximum:
The 'memi' (minimum) and 'mema' (maximum) values
must be correctly defined, so that 'mema' is
greater than 'memi'.
ffmi= float 0.0
Feedforward channel scale minimum:
The 'ffmi' (minimum) and 'ffma' (maximum) values
must be correctly defined, so that 'ffma' is
greater than 'ffmi'.
ffma= float 1.0
Feedforward channel scale maximum:
The 'ffmi' (minimum) and 'ffma' (maximum) values
must be correctly defined, so that 'ffma' is
greater than 'ffmi'.
comi= float 0.0
Control (output) scale minimum:
The 'comi' (minimum) and 'coma' (maximum) values
must be correctly defined, so that 'coma' is
greater than 'comi'.
coma= float 100.0
Control (output) scale maximum:
The 'comi' (minimum) and 'coma' (maximum) values
must be correctly defined, so that 'coma' is
greater than 'comi'.
bias= float 0.0
Output bias, when error = 0
conch= float 1.0
Maximum rate of change of output in
incremental control mode <1/s>
slow= int16 1
Control calculation slowing rate <times>
Permissible values are >= 1
sp2u= bool8 0
Setpoint 2 used
sp3u= bool8 0
Setpoint 3 used
track1= bool8 1
Setpoint 1 tracking:
Measured value copied to setpoint input in manual
mode, or when switching to setpoint 1
track2= bool8 0
Setpoint 2 tracking:
The same as 'track1'
track3= bool8 1
Setpoint 3 tracking:
The same as 'track1'
cha1= bool8 1
Setpoint 1 change parameter:
Elimination, with integrator, of jumps caused by
changes in setpoint 1.
NOTE! Meant for setpoint changes that occur
rarely. If changes occur in each execution cycle,
control will not function correctly.
cha2= bool8 0
Setpoint 2 change parameter:
The same as cha1
cha3= bool8 0
Setpoint 3 change parameter:
The same as 'cha1'
mau= bool8 1
Measured value alarms in use
eau= bool8 0
Error value alarms in use
coau= bool8 0
Control (output) alarms in use
ahys= float 1.0
Alarm hysteresis <% of range>
Positive values higher than 0.1 <%> are
permissible. NOTE! Values higher than 100.0 will
have the effect that alarm cannot be deactivated
without special actions.
kp< ana 0 0.0
P-term gain:
A factor independent of measurement
and output range ('memi', 'mema', 'comi', 'coma');
new value of the factor can be activated
by setting 'parch' = ON (1)
ti< ana 0 0.0
Integral action time constant <s>
1) Normal time constant if 'iu' = 1
2) If 'iu' = 0, 'ti' gives the rate of change
in the 'con' output after MANUAL-to-AUTO
switchover to remove the initial error
<s/output range>
A factor independent of measurement
and output range ('memi', 'mema', 'comi',
'coma'); new value of the factor can be activated
by setting 'parch' = ON (1)
td< ana 0 0.0
Derivative action time constant <s>
A factor independent of measurement
and output range ('memi', 'mema', 'comi',
'coma'); new value of the factor can be activated
by setting 'parch' = TOSI (1)
tdf< ana 0 0.0
Derivative action low-pass filter time
constant <s>
1. stage low-pass filtering is performed on the D
term at time constant 'tdf'.
A factor independent of measurement
and output range ('memi', 'mema', 'comi',
'coma'); new value of the factor can be activated
by setting 'parch' = ON (1)
kff< ana 0 0.0
Feedforward channel gain
'kff' is a factor independent of the
feedforward channel and output range
('ffmi', 'ffma', 'comi', 'coma');
its new value can be activated by
setting 'parch' = ON (1)
me< ana 0 0.0
Measured value input
The lower limit of measured value scale is
defined by the 'memi' parameter, and the upper
limit by the 'mema' parameter.
mff< ana 0 0.0
Feedforward channel
The lower limit of feedforward channel scale is
defined by the 'ffmi' parameter, and the upper
limit by the 'ffma' parameter.
sp1< ana 0 0.0
Setpoint 1 (LOCAL)
All setpoints are identical from the PID
controller's viewpoint, but it is useful to
identify the setpoints as follows:
'sp1' = LOCAL setpoint
'sp2' = REMOTE setpoint
'sp3' = COMPUTER setpoint
To provide more than 3 setpoints for the
controller, 'sp3' can be used to connect them.
When external setpoint selection index is then
applied to the 'isp' input, the functions
defined with 'track3' and 'cha3' are given to
setpoint 3 when changing setpoints. Internally
selected setpoint is limited between 'memi' and
'mema'. In addition, if other than 'ovf', 'dis'
or 'sex' of the selected setpoint's fault bits
are on, the value 'spa' will be used. When fault
bits are reset, the operation is the same as when
switching on the setpoint in question.
sp2< ana 0 0.0
Setpoint 2 (REMOTE)
Refer to 'sp1'
sp3< ana 0 0.0
Setpoint 3 (COMPUTER)
Refer to 'sp1'
conb< ana 0 0.0
Control output read back:
'conb' serves as initial value for the 'con'
output in all changeover situations. In
incremental control mode the output is calculated
on the basis of the change and the value read
back ('con' = change + 'conb'). Actuator faults
and local control actions are interpreted from
the 'conb' fault bits. In most cases 'conb' is
connected to I/O module's readback value. In
connection with the 'vlv' function block, 'conb'
is connected to the 'idpos' output of the block.
Also refer to 'cmode', 'con', 'pos', 'wd' and
'wdd'.
colmi< ana 0 0.0
Minimum limit of control output
If not connected, give the desired constant
value: normally (0,'comi').
The 'colmi:a' and 'colma:a' values must be
correctly defined, so that 'colma:a' is greater
than 'colmi:a'. If the value of 'colmi' is
changed through external connection, this must
be taken into account.
colma< ana 0 100.0
Maximum limit of control output
If not connected, give the desired constant
value: normally (0,'coma').
The 'colmi:a' and 'colma:a' values must be
correctly defined, so that 'colma:a' is greater
than 'colmi:a'. If the value of 'colma' is
changed through external connection, this must
be taken into account.
isp< ints 0 1
Setpoint selection index
Also refer to 'sp2u', 'sp3u', 'sp1', 'sp2' and
'sp3'
ma< bin 0
Manual/auto control mode
0 = MANUAL
1 = AUTO
parch< bin 0
Parameter change activation
This input is used to activate the scaling of new
values for the 'kp', 'ti', 'td' and 'kff' input
parameters and 'ahys' configuration parameter.
Just changing these parameters does not affect
the operation of the controller. After scaling
the 'parch' input is set at OFF (= 0)
amc< bin 1
Auto-to-manual change allowed
mac< bin 1
Manual-to-auto change allowed
ion< bin 1
Integral action on:
0 = INTEGRAL ACTION OFF
1 = INTEGRAL ACTION ON
fm< bin 0
Forced manual control
See also 'aftfm'.
fc< bin 0
Forced control
When the value of the 'fc' input is 1, the value
of the 'fcin' input is copied to the 'con' output.
See also 'aftfc'.
fcin< ana 0 0.0
Forced control input
See also 'fc'
pos< ana 0 0.0
Actuator position
For the control room; does not affect the
operation of the function block, but is
displayed in control room. In most cases it
is useful to connect 'pos' to the same data
as 'conb'.
mehh< float 0.0
Higher high alarm limit for measured value
Function block allows crossing the alarm limits
(Damatic XD version 6.0 and up), when all alarms can be on
simultaneously. With a parameter in cpu-configuration file
(hook -classic_pid_alarms) the function can be returned back
to what it was before, when crossing the alarm limits is forbidden
i.e. function block turns the limits back to right order.
meh< float 0.0
High alarm limit for measured value
Checking of the limits, see member 'mehh'.
mel< float 0.0
Low alarm limit for measured value
Checking of the limits, see member 'mehh'.
mell< float 0.0
Lower low alarm limit for measured value
Checking of the limits, see member 'mehh'.
eh< float 0.0
High alarm limit for error value
Checking of the limits, see member 'mehh'.
el< float 0.0
Low alarm limit for error value
Checking of the limits, see member 'mehh'.
coh< float 0.0
High alarm limit for control output value
Checking of the limits, see member 'mehh'.
col< float 0.0
Low alarm limit for control output value
Checking of the limits, see member 'mehh'.
spa> ana 48 0.0
Active setpoint value
Displayed in control room. Limited to measurement
range (memi ... mema); value 'sp1', 'sp2' or
'sp3' according to setpoint selection index 'isp'.
The active setpoint seen by the controller
e> ana 48 0.0
Error
Calculation formula: 'e:a' = 'spa:a' - 'me:a'
con> ana 48 0.0
Control
The low limit of the control output scale is
defined with the parameter 'comi', and the high
limit with the parameter 'coma'. Also refer to
'conb' and 'pos'
colmista> bin 48
Control output minimum limitation status.
NOTE! When force control situation is on, output is not
limited and 'colmista' is not updated.
In normal situation (no force control) 'colmista' is updated
when the limit-state changes.
colmasta> bin 48
Control output maximum limitation status.
NOTE! When force control situation is on, output is not
limited and 'colmasta' is not updated.
In normal situation (no force control) 'colmasta' is updated
when the limit-state changes.
mehha> bin 48
Measured value higher high limit alarm
meha> bin 48
Measured value high limit alarm
mela> bin 48
Measured value low limit alarm
mella> bin 48
Measured value lower low limit alarm
eha> bin 48
Error value high limit alarm
ela> bin 48
Error value low limit alarm
coha> bin 48
Control output high limit alarm
cola> bin 48
Control output low limit alarm
outctrl> bin 48
Output controllability with mansp
wd> bin 48
Watchdog
'wd' normally indicates a control failure, which
is specified in more detail by 'wdd'.
Values:
0 = NO DISTURBANCES
1 = DISTURBANCE
wdd> ints 48 0
Watchdog data
Bit encoded data, whose values ('wdd:s') are as
follows:
b0 = IN LOCAL CONTROL MODE
b1 = ACTUATOR FAULT + FM
b2 = SETPOINT FAULTY
b3 = MEASURED VALUE FAULTY
b4 = MEASURED VALUE FAULTY + FC
b5 = MEASURED VALUE FAULTY + FM
'wdd' stays at the same value
although 'wd' turns back to NO DISTURBANCES
until the next disturbance situation, when
'wdd' changes to the value, that corresponds
the disturbance situation.
actconb< bin 1
Activate conb when ma = MANUAL and
cmode = 0 or 4:
0 = the value for the output 'con:a' is
calculated form the previous output
value and the operation change
1 = the value for the ouput 'con:a' is
calculated from the input value 'conb:a'
and the operation change, except if
cmode = 4, then the value of 'con:a' is
the absolute value set by the operator
When ma = MANUAL and cmode = 2, 3 or 6
'actconb' is used to select the faultbits in 'conb'
which allow the fail-safe behaviour in case of
faultbits in 'conb'.
Even values = the value of 'con:a' is formed based on
the value of previous cycle and operator change.
Odd values = the value of 'con:a' is formed based on
the value of input 'conb:a' and operator change,
except if cmode = 6 in which case the value of 'con:a'
is the absolute value set by the operator.
0 as 0, no faultbit in 'conb' allowes
cmode 2, 3 and 6 function
1 as 1, no faultbit in 'conb' allowes
cmode 2, 3 and 6 function
2 as 0, EXT bit in 'conb' allowes cmode 2,
3 and 6 functions
3 as 1, EXT bit in 'conb' allowes cmode
2, 3 and 6 functions
4 as 0, OVF bit in 'conb' allowes cmode
2, 3 and 6 functions
5 as 1, OVF bit in 'conb' allowes cmode
2, 3 and 6 functions
8 as 0, DIS bit in 'conb' allowes cmode
2, 3 and 6 functions
9 as 1, DIS bit in 'conb' allowes cmode
2, 3 and 6 functions
16 as 0, INV bit in 'conb' allowes cmode
2, 3 and 6 functions
17 as 1, INV bit in 'conb' allowes cmode
2, 3 and 6 functions
32 as 0, OLD bit in 'conb' allowes cmode
2, 3 and 6 functions
33 as 1, OLD bit in 'conb' allowes cmode
2, 3 and 6 functions
64 as 0, DER bit in 'conb' allowes cmode
2, 3 and 6 functions
65 as 1, DER bit in 'conb' allowes cmode
2, 3 and 6 functions
128 as 0, SEX bit in 'conb' allowes cmode
2, 3 and 6 functions
129 as 1, SEX bit in 'conb' allowes cmode
2, 3 and 6 functions
Several faultbits can be set to allow behaviour
according to modes 2, 3 and 6 by adding their values
(for example. 96 and 97 requires OLD or DER ,with 255
and 254 any faultbit will be enough).