FB_CTRL_STEP_PID

FB_CTRL_STEP_PID 1:

The function block controls a digitally manipulated variable for the integration of actuators. It is based on a standard PID controller with an additional binary output signal in conjunction with the analog output and works without a precise position feedback signal.

The position feedback signal required to calculate the controller output is estimated using the limiting values and the time required to reach these limits. The function block then generates pulses that are required to drive the actuator as a servomotor.

FB_CTRL_STEP_PID 2: VAR_INPUT

VAR_INPUT
fSetpointValue        : LREAL;
fActualValue          : LREAL;
bLimitSwitchPos       : BOOL;
bLimitSwitchNeg       : BOOL;
bAutoReset            : BOOL;
nSensorType           : E_CTRL_STEP_SENSORTYPES;
fDisturbanceValue     : REAL;
bManualDigitalPos     : BOOL;
bManualDigitalNeg     : BOOL;
eMode                 : E_CTRL_MODE;
END_VAR

Name

Type

Description

fSetpointValue

LREAL

Setpoint of the controlled variable

fActualValue

LREAL

Actual value of the control value

bLimitSwitchPos

BOOL

Limit switch, becomes TRUE when the upper stop is reached.

bLimitSwitchNeg

BOOL

Limit switch, becomes TRUE when the lower stop is reached.

bAutoReset

BOOL

If the variable is TRUE, it resets the controller to initial conditions.

nSensorType

E_CTRL_STEP_
SENSORTYPES

Enables the selection of the correct thermocouple type.

fDisturbance
Value

REAL

Actual value of the disturbance variable

bManualDigital
Pos

BOOL

If the variable is TRUE, the motor is manually set to the positive direction

bManualDigital
Neg

BOOL

If TRUE, the motor is manually set to the negative direction

eMode

E_CTRL_MODE

Input specifying the operation mode of the controller

FB_CTRL_STEP_PID 3: VAR_OUTPUT

VAR_OUTPUT
bCtrlDigitalPos   : BOOL;
bCtrlDigitalNeg   : BOOL;
fCtrlAnalog       : LREAL;
eState            : E_CTRL_STATE;
eErrorId          : E_CTRL_ERRORCODES;
bError            : BOOL;
bBusy             : BOOL;
bMinLimitNeg      : BOOL;
bMinLimitPos      : BOOL;
bARWActive        : BOOL;
END_VAR

Name

Type

Description

bCtrlDigitalPos

BOOL

Output required to run the motor in a positive direction.

bCtrlDigitalNeg

BOOL

Output required to run the motor in a negative direction.

fCtrlAnalog

LREAL

Analog output of the controller

eState

E_CTRL_STATE

Actual state of the controller

eErrorId

E_CTRL_ERRORCODES

Returns the error number if bError is TRUE.

bError

BOOL

TRUE if an error occurs in the function block.

bBusy

BOOL

TRUE when the function block is active.

bMinLimitNeg

BOOL

TRUE at this output indicates that the controller has reached its minimum limit value.

bMinLimitPos

BOOL

TRUE at this output indicates that the controller has reached its maximum limit value.

bARWActive

BOOL

TRUE at this output indicates that the controller is currently restricted.

VAR_IN_OUT

VAR_IN_OUT
stCtrlParams : ST_CTRL_STEP_PID_PARAMS;
END_VAR

Name

Type

Description

stCtrlParams

ST_CTRL_STEP_PID_PARAMS

Parameter structure of the controller.

stCtrlParams consists of the following elements:

TYPE ST_CTRL_STEP_PID_PARAMS:
STRUCT
tCtrlCycleTime     : TIME;
tTaskCycleTime     : TIME;
fKp                : REAL;
fTn                : REAL;
fTv                : REAL;
fTd                : REAL;
fTM                : REAL;
fDeadBandWidth     : REAL;
tMinimumPulseTime  : TIME;
tFilterTime        : TIME;
fWmax              : REAL;
fWmin              : REAL;
fYMax              : REAL;
fYMin              : REAL;
END_STRUCT
END_TYPE

Name

Type

Description

tCtrlCycleTime

TIME

Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input value for internal calculation to determine whether the state and output values have been updated in the current cycle.

tTaskCycleTime

TIME

Cycle time with which the function block is called. If the function block is called in every cycle, this corresponds to the task cycle time of the calling task.

fKp

REAL

Controller gain or proportional gain

fTn

REAL

Integral action time: The I component is disabled if this parameter is zero.

fTv

REAL

Derivative action time; the D component is disabled if this parameter is zero.

fTd

REAL

Damping time

fTM

REAL

Digital valve actuation time in seconds

fDeadBandWidth

REAL

Permissible width of the controller deviation

tMinimumPulse
Time

TIME

Minimum pulse time for pulse generator

tFilterTime

TIME

Filter time for actual value filter

fWmax

REAL

Maximum setpoint in °C

fWmin

REAL

Minimum setpoint in °C

fYMax

REAL

Maximum value of the controller output

fYMin

REAL

Minimum value of controller output