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 and stores these values internally.

The output, that is the manipulated variable Y, is calculated as follows:

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

ACTUAL

REAL

 

Actual value, process variable

SET_POINT

REAL

 

Specified value, set point

KP

REAL

 

Proportionality constant P

TV

REAL

 

Rate time, derivative time D [sec]. If set to 0, than it works a P controller

Y_MANUAL

REAL

 

Y is set to this value as long as MANUAL = TRUE

Y_OFFSET

REAL

 

Offset for manipulated variable

Y_MIN

REAL

 

Minimum value for manipulated variable. If no limitation is desired, it must be be set to 0

Y_MAX

REAL

 

Maximum value for manipulated variable. If no limitation is desired, it must be be set to 0

MANUAL

BOOL

 

TRUE: Manual: Y is not influenced by controller

FALSE: Controller determines Y

RESET

BOOL

 

TRUE: Set Y output to Y_OFFSET

Output

Y

REAL

 

Manipulated variable, set value

LIMITS_ACTIVE

BOOL

FALSE

TRUE: Y has exceeded the given limits Y_MIN, Y_MAX and is limited to these values