Class CompPID
Version 1.0
Modified 18-MAY-2006 14:49:40.40
Code rt_plc_bcomp.c
 PID Controller.

 The function of this object is similar to pwrb:PID.

Object graph

Plc coding
 For plc coding the function object CompPID_Fo is used.
 Create a function object in the plc editor and connect it to the current
 object with the connect function.

See also



RtBody attributes pwr_sClass_CompPID
String104 Description   Optional description.
Float32 ProcVal   Process value.
Float32 SetVal   Specifies the set point value. This input is in general
connected to the corresponding output of a Mode object.
Float32 Bias   Specifies the feed forward value.
Float32 ForcVal   Specifies which value is to be used when Force is TRUE.
When Force is TRUE OutVal is equal to ForcVal. This
input is in general connected to the corresponding
output of a Mode object.
Boolean Force   Specifies whether forced or MANUAL control is selected
or not. FALSE means none; TRUE means that either forced
or MANUAL control has been selected. This input is in
general connected to the corresponding output of a Mode
object.
Boolean IntOff   Specifies whether to enable or disable the integration.
FALSE means that the integration is on; TRUE switches
the integration off.

The value may be changed in the more info form of the
Pid object.
Float32 OutVal   The controller's control signal. The value is based
either on the algorithm's current result, a value set
by the operator in MANUAL mode, or a forced value.
Float32 OutChange   Changes in the control signal between two consecutive
scans; i.e. OutVal(t) - OutVal(t-1).
Float32 ControlDiff   Control error (= ProcVal - SetVal).
Boolean EndMax   Specifies if OutVal at this scanning has been limited
against any of the limit values in the interval {
MinOut, MaxOut } or not. If a limitation is done
against

-- MinOut, then EndMin is set TRUE
-- MaxOut, then EndMax is set TRUE
else they are FALSE.

EndMin /EndMax can only be set in AUTO or CASCADE
control mode, i.e. not in MANUAL mode for example. See
also EndHys below.
Boolean EndMin  
PidAlgEnum PidAlg   The PID control algorithm
Float32 Gain   Specifies the proportional control factor; >= 0.
The value may be changed in the more info form of the
Pid object.
Float32 IntTime   Specifies the integral action time in seconds.
The value may be changed in the more info form of the
Pid object.
Float32 DerTime   Specifies the derivative time in seconds; see p. 3-258.
Normally DerTime is greater than ScanTime and
1.0 <= DerGain < DerTime/ScanTime
Float32 DerGain   Factor to specify the first order lag filter used in
filtering of the derivative contribution.

1.0 <= DerGain < DerTime/ScanTime, otherwise no filtering

DerGain is normally in the size of 3 to 4.
The value may be changed in the more info form of the
Pid object.
Boolean Inverse   Specifies whether the control action should be inverted
or not. FALSE means that a spontaneous increasing
process value, in a control with fixed set point, is
met by an increasing control signal, i.e. reverse
control action. TRUE is the normal case, where a
spontaneous increasing process value is met by a
decreasing control signal.
Float32 BiasGain   Specifies the feed forward gain; this factor may be
negative.

The values may be changed in the more info form of the
Pid object.
Boolean PDAbsFlag   Flag to force no offset after amnual mode. Will cause an output jump
when switching from manual to Auto. Not Bumpless transfer
WindupMaskEnum WindupMask   WindupMask
The possible values are as follows:

1 -- I Only the I-part is limited in OutWindup
2 -- BI Bias and I are limited in OutWindup
4 -- BPI Bias, P and I are limited in OutWindup
8 -- BPID All parts of the controller are limited in OutWindup
Float32 MinWindup   At AUTO and CASCADE control, for controllers with an I-part,
the control signal OutWindup is supposed to be
in the interval { MinWindup, MaxWindup }.
The EndMin / EndMax flags are used to signal if any
limitation has ocurred.
If OutWindup is greater than MaxWindup, or less than MinWindup,
OutWindup is limited to the value at the end of the interval.
If MinWindup >= MaxWindup no limitation will occur.

After addition of the absolute part,
OutVal is limited to the interval { MinOut, MaxOut }.
If MinOut >= MaxOut no limitation will occur.
Float32 MaxWindup  
Float32 MinOut  
Float32 MaxOut  
Float32 EndHys   Specifies the hysteresis on MinOut and MaxOut in
connection with the handling of EndMin/EndMax.
Float32 SetMinShow   The lower respectively upper limit in the graph at
presentation of ProcVal and SetVal in the Pid object
display. The values may be changed in the more info
form of the Pid object.
Float32 SetMaxShow  
String16 SetEngUnit   Specifies the engineering unit of SetVal / SetMinShow /
SetMaxShow, e.g. meter. Used in the Pid object display.
FloatPrecisionEnum SetPrecision   Specifies the number of characters displayed after the decimal point
for set value and process value in the object graph.
Float32 OutMinShow   The lower respectively upper limit in the graph at
presentation of the control signal OutVal in the Pid
object display. The values may be changed in the more
info form of the Pid object.
Float32 OutMaxShow  
String16 OutEngUnit   Specifies the engineering unit of OutVal / OutMinShow /
OutMaxShow, e.g., %. Used in the in the Pid object
display.
FloatPrecisionEnum OutPrecision   Specifies the number of characters displayed after the decimal point
for output value in the object graph.
Float32 TrendTimeRange   Specifies time range for the trends in the object graph.
Int32 AccGain   The operator's authorities to change Gain respectively
IntTime.
0 -- Changes not allowed.
= 0 -- Changes allowed.
Int32 AccInt  
Int32 AccDer   The operator's authorities to change DerTime.
0 -- Changes not allowed.
= 0 -- Changes allowed.
Int32 AccDGain   The operator's authorities to change DerGain.
0 -- Changes not allowed.
= 0 -- Changes allowed.
Int32 AccBias  
Int32 AccBGain  
Float32 MinGain   The minimum and maximum allowed value of Gain at
changes made by an operator.
Float32 MaxGain  
Float32 MinInt   The minimum and maximum allowed value of IntTim at
changes made by an operator.
Float32 MaxInt  
Float32 MinDer   The minimum and maximum allowed value of DerTim at
changes made by an operator.
Float32 MaxDer  
Float32 MinDGain   The minimum and maximum allowed value of DerGain at
changes made by an operator.
Float32 MaxDGain  
Float32 MinBias   The minimum and maximum allowed value of Gain at
changes made by an operator.
Float32 MaxBias  
Float32 MinBGain   The minimum and maximum allowed value of BiasGain at
changes made by an operator.
Float32 MaxBGain  
AttrRef ModeObjDid   Specifies the complete name of the Mode object
associated to this Pid object. The attribute makes it
possible to start the object display of the associated
Mode object from a button in the object display of the
Pid object.
Float32 FiltDer   Filtered derivative is saved to the next program cycle.
Float32 PDManOffset   Offset for P / PD-Controller after switching from
manual to auto mode.
Float64 OutWindup   Output that is limited with MinWindup and MaxWindup
Float64 AbsOut   The absolute part of the output. (contrary to OutWindup)
AttrRef PlcConnect   The plc function object connected to this object.


Template Object
PidAlg 3
Gain 1.000000e+00
IntTime 1.200000e+02
DerGain 3.000000e+00
Inverse 1
BiasGain 1.000000e+00
WindupMask 4
MaxWindup 1.000000e+02
MaxOut 1.000000e+02
SetMaxShow 1.000000e+02
SetEngUnit %
SetPrecision 1
OutMaxShow 1.000000e+02
OutEngUnit %
OutPrecision 1
TrendTimeRange 1.000000e+02
AccGain 15
AccInt 15
AccDer 15
AccBias 15
AccBGain 15
MinGain 1.000000e-01
MaxGain 1.000000e+01
MinInt 1.000000e+01
MaxInt 6.000000e+02
MaxDer 2.000000e+01
MaxBias 1.000000e+02
MinBGain -1.000000e+02
MaxBGain 1.000000e+02


Attributes detail


Description Attribute
Class Attribute
Type String104
Flags
Body RtBody
Optional description.


ProcVal Attribute
Class Attribute
Type Float32
Flags ReduTransfer|State|Noedit
Body RtBody
 Process value.

SetVal Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Specifies the set point value. This input is in general
 connected to the corresponding output of a Mode object.

Bias Attribute
Class Attribute
Type Float32
Flags ReduTransfer|State|Noedit
Body RtBody
 Specifies the feed forward value.

ForcVal Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Specifies which value is to be used when Force is TRUE.
 When Force is TRUE OutVal is equal to ForcVal. This
 input is in general connected to the corresponding
 output of a Mode object.

Force Attribute
Class Attribute
Type Boolean
Flags ReduTransfer
Body RtBody
 Specifies whether forced or MANUAL control is selected
 or not. FALSE means none; TRUE means that either forced
 or MANUAL control has been selected. This input is in
 general connected to the corresponding output of a Mode
 object.

IntOff Attribute
Class Attribute
Type Boolean
Flags ReduTransfer|State|Noedit
Body RtBody
 Specifies whether to enable or disable the integration.
 FALSE means that the integration is on; TRUE switches
 the integration off.

 The value may be changed in the more info form of the
 Pid object.

OutVal Attribute
Class Attribute
Type Float32
Flags ReduTransfer|State|Noedit
Body RtBody
 The controller's control signal. The value is based
 either on the algorithm's current result, a value set
 by the operator in MANUAL mode, or a forced value.

OutChange Attribute
Class Attribute
Type Float32
Flags ReduTransfer|State|Noedit
Body RtBody
 Changes in the control signal between two consecutive
 scans; i.e. OutVal(t)  - OutVal(t-1).

ControlDiff Attribute
Class Attribute
Type Float32
Flags ReduTransfer|State|Noedit
Body RtBody
 Control error (= ProcVal - SetVal).

EndMax Attribute
Class Attribute
Type Boolean
Flags ReduTransfer|State|Noedit
Body RtBody
 Specifies if OutVal at this scanning has been limited
 against any of the limit values in the interval {
 MinOut, MaxOut } or not. If a limitation is done
 against

 --  MinOut, then EndMin is set TRUE
 --  MaxOut, then EndMax is set TRUE
 else they are FALSE.

 EndMin /EndMax can only be set in AUTO or CASCADE
 control mode, i.e. not in MANUAL mode for example. See
 also EndHys below.

EndMin Attribute
Class Attribute
Type Boolean
Flags ReduTransfer|State|Noedit
Body RtBody

PidAlg Attribute
Class Attribute
Type PidAlgEnum
Flags
Body RtBody
 There are several variations of the PID control
 algorithm. PidAlg specifies the current choice. The
 possible values are as follows:

 1   -- I     Integral controller. Gain is not used.

 3   -- I+P   Integral controller with proportional
              control action. The P-term is based on the
              the process value.

 6   -- P     Proportional Controller.

 7   -- PI    Proportional Integral Controller. The
              P-term is based on the control error.

 11  -- I+PD Integral controller with proportional
             derivative control action. Both the P- and
             D-term are based on the process value.

 14  -- P+D  Proportional Controller with derivative
             control action. P is based on the control error,
             D on the process value.

 15  -- PI+D Proportional Integral Controller with
             derivative control action. P is based on
             the control error, D on the process value.

 30  -- PD   Proportional Derivative Controller. Both
             the P- and D-term are based on the control
             error.

 31  -- PID  Proportional Integral Derivative
             Controller. Both the P- and D-term are
             based on the control error.

Gain Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Specifies the proportional control factor; >= 0.
 The value may be changed in the more info form of the
 Pid object.

IntTime Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Specifies the integral action time in seconds.
 The value may be changed in the more info form of the
 Pid object.

DerTime Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Specifies the derivative time in seconds; see p. 3-258.
 Normally DerTime is greater than ScanTime and
    1.0 <=  DerGain < DerTime/ScanTime

DerGain Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Factor to specify the first order lag filter used in
 filtering of the derivative contribution.

 1.0 <= DerGain < DerTime/ScanTime, otherwise no filtering

 DerGain is normally in the size of 3 to 4.
 The value may be changed in the more info form of the
 Pid object.

Inverse Attribute
Class Attribute
Type Boolean
Flags ReduTransfer
Body RtBody
 Specifies whether the control action should be inverted
 or not. FALSE means that a spontaneous increasing
 process value, in a control with fixed set point, is
 met by an increasing control signal, i.e. reverse
 control action. TRUE is the normal case, where a
 spontaneous increasing process value is met by a
 decreasing control signal.

BiasGain Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Specifies the feed forward gain; this factor may be
 negative.

 The values may be changed in the more info form of the
 Pid object.

PDAbsFlag Attribute
Class Attribute
Type Boolean
Flags ReduTransfer
Body RtBody
Flag to force no offset after amnual mode. Will cause an output jump
when switching from manual to Auto. Not Bumpless transfer

WindupMask Attribute
Class Attribute
Type WindupMaskEnum
Flags
Body RtBody
WindupMask
The possible values are as follows:

1  -- I      Only the I-part is limited in OutWindup
2  -- BI    Bias and I are limited in OutWindup
4  -- BPI  Bias, P and I are limited in OutWindup
8  -- BPID All parts of the controller are limited in OutWindup

MinWindup Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
At AUTO and CASCADE control, for controllers with an I-part,
the control signal OutWindup is supposed to be
in the interval { MinWindup, MaxWindup }.
The EndMin / EndMax flags are used to signal if any
limitation has ocurred.
If OutWindup is greater than MaxWindup, or less than MinWindup,
OutWindup is limited to the value at the end of the interval.
If MinWindup >= MaxWindup no limitation will occur.

After addition of the absolute part,
OutVal is limited to the interval { MinOut, MaxOut }.
If MinOut >= MaxOut no limitation will occur.


MaxWindup Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody

MinOut Attribute
Class Attribute
Type Float32
Flags
Body RtBody


MaxOut Attribute
Class Attribute
Type Float32
Flags
Body RtBody

EndHys Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 Specifies the hysteresis on MinOut and MaxOut in
 connection with the handling of EndMin/EndMax.

SetMinShow Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 The lower respectively upper limit in the graph at
 presentation of ProcVal and SetVal in the Pid object
 display. The values may be changed in the more info
 form of the Pid object.

SetMaxShow Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody

SetEngUnit Attribute
Class Attribute
Type String16
Flags
Body RtBody
 Specifies the engineering unit of SetVal / SetMinShow /
 SetMaxShow, e.g. meter. Used in the Pid object display.

SetPrecision Attribute
Class Attribute
Type FloatPrecisionEnum
Flags
Body RtBody
 Specifies the number of characters displayed after the decimal point
 for set value and process value in the object graph.

OutMinShow Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody
 The lower respectively upper limit in the graph at
 presentation of the control signal OutVal in the Pid
 object display. The values may be changed in the more
 info form of the Pid object.

OutMaxShow Attribute
Class Attribute
Type Float32
Flags ReduTransfer
Body RtBody

OutEngUnit Attribute
Class Attribute
Type String16
Flags
Body RtBody
 Specifies the engineering unit of OutVal / OutMinShow /
 OutMaxShow, e.g., %. Used in the in the Pid object
 display.

OutPrecision Attribute
Class Attribute
Type FloatPrecisionEnum
Flags
Body RtBody
 Specifies the number of characters displayed after the decimal point
 for output value in the object graph.

TrendTimeRange Attribute
Class Attribute
Type Float32
Flags
Body RtBody
 Specifies time range for the trends in the object graph.

AccGain Attribute
Class Attribute
Type Int32
Flags
Body RtBody
 The operator's authorities to change Gain respectively
 IntTime.
   0   -- Changes not allowed.
   = 0 -- Changes allowed.

AccInt Attribute
Class Attribute
Type Int32
Flags
Body RtBody

AccDer Attribute
Class Attribute
Type Int32
Flags
Body RtBody
 The operator's authorities to change DerTime.
   0   -- Changes not allowed.
   = 0 -- Changes allowed.

AccDGain Attribute
Class Attribute
Type Int32
Flags
Body RtBody
 The operator's authorities to change DerGain.
   0   -- Changes not allowed.
   = 0 -- Changes allowed.

AccBias Attribute
Class Attribute
Type Int32
Flags
Body RtBody

AccBGain Attribute
Class Attribute
Type Int32
Flags
Body RtBody

MinGain Attribute
Class Attribute
Type Float32
Flags
Body RtBody
 The minimum and maximum allowed value of Gain at
 changes made by an operator.

MaxGain Attribute
Class Attribute
Type Float32
Flags
Body RtBody

MinInt Attribute
Class Attribute
Type Float32
Flags
Body RtBody
 The minimum and maximum allowed value of IntTim at
 changes made by an operator.

MaxInt Attribute
Class Attribute
Type Float32
Flags
Body RtBody

MinDer Attribute
Class Attribute
Type Float32
Flags
Body RtBody
 The minimum and maximum allowed value of DerTim at
 changes made by an operator.

MaxDer Attribute
Class Attribute
Type Float32
Flags
Body RtBody

MinDGain Attribute
Class Attribute
Type Float32
Flags
Body RtBody
 The minimum and maximum allowed value of DerGain at
 changes made by an operator.

MaxDGain Attribute
Class Attribute
Type Float32
Flags
Body RtBody

MinBias Attribute
Class Attribute
Type Float32
Flags
Body RtBody
 The minimum and maximum allowed value of Gain at
 changes made by an operator.

MaxBias Attribute
Class Attribute
Type Float32
Flags
Body RtBody

MinBGain Attribute
Class Attribute
Type Float32
Flags
Body RtBody
 The minimum and maximum allowed value of BiasGain at
 changes made by an operator.

MaxBGain Attribute
Class Attribute
Type Float32
Flags
Body RtBody

ModeObjDid Attribute
Class Attribute
Type AttrRef
Flags
Body RtBody
 Specifies the complete name of the Mode object
 associated to this Pid object. The attribute makes it
 possible to start the object display of the associated
 Mode object from a button in the object display of the
 Pid object.

FiltDer Attribute
Class Attribute
Type Float32
Flags ReduTransfer|State|Noedit
Body RtBody
 Filtered derivative is saved to the next program cycle.

PDManOffset Attribute
Class Attribute
Type Float32
Flags ReduTransfer|State|Noedit
Body RtBody
Offset for P / PD-Controller after switching from
manual to auto mode.


OutWindup Attribute
Class Attribute
Type Float64
Flags ReduTransfer|State|Noedit
Body RtBody
Output that is limited with MinWindup and MaxWindup


AbsOut Attribute
Class Attribute
Type Float64
Flags ReduTransfer|State|Noedit
Body RtBody
The absolute part of the output. (contrary to OutWindup)

PlcConnect Attribute
Class Attribute
Type AttrRef
Flags
Body RtBody
 The plc function object connected to this object.
 This attribute is set when the function object is connected from
 the plc editor by the connect function.