PD (FB)¶
FUNCTION_BLOCK PD
Represents a PD controller
A PD controller continuously calculates an error value e(t) as the difference between a desired set point and a measured process variable. The PD controller applies a correction based on proportional and derivative terms (sometimes denoted P and D respectively) which give their name to the controller type.
Y_OFFSET, Y_MIN and Y_MAX are used for the transformation of the manipulated variable
within a prescribed range. MANUAL can be used to switch on and off manual operation. RESET serves to reset the
controller. In normal operation ( MANUAL = RESET = LIMITS_ACTIVE = FALSE) the controller calculates
the controller error e as difference SET_POINT – ACTUAL, generates the derivation with respect
to time \(\frac{\delta e}{\delta t}\) and stores these values internally.
The output, that is the manipulated variable Y, is calculated as follows:
\(Y = KP \cdot (e + TV \frac{\delta e}{\delta t}) + Y_{OFFSET}\)
So besides the P-part also the current change of the controller error (D-part) influences the
manipulated variable. Additionally Y is limited on a range prescribed by Y_MIN and Y_MAX. If Y exceeds these limits,
LIMITS_ACTIVE will get TRUE. If no limitation of the manipulated variable is desired, Y_MIN and Y_MAX
have to be set to 0. As long as MANUAL=TRUE, Y_MANUAL will be written to Y.
A P controller can be easily created by setting TV=0.
For more information see: PID.
- InOut:
Scope
Name
Type
Initial
Comment
Input
ACTUALREALActual value, process variable
SET_POINTREALSpecified value, set point
KPREALProportionality constant P
TVREALRate time, derivative time D [sec]. If set to 0, than it works a P controller
Y_MANUALREALYis set to this value as long asMANUAL=TRUEY_OFFSETREALOffset for manipulated variable
Y_MINREALMinimum value for manipulated variable. If no limitation is desired, it must be be set to 0
Y_MAXREALMaximum value for manipulated variable. If no limitation is desired, it must be be set to 0
MANUALBOOLTRUE: Manual:Yis not influenced by controllerFALSE: Controller determinesYRESETBOOLTRUE: SetYoutput toY_OFFSETOutput
YREALManipulated variable, set value
LIMITS_ACTIVEBOOLFALSE
TRUE:Yhas exceeded the given limitsY_MIN,Y_MAXand is limited to these values