FB_CTRL_SERVO_MOTOR_OUT

FB_CTRL_SERVO_MOTOR_OUT 1:

This function block generates pulses with which a servomotor can be driven to a defined position.

Behavior of the output

FB_CTRL_SERVO_MOTOR_OUT 2:

FB_CTRL_SERVO_MOTOR_OUT 3: VAR_INPUT

VAR_INPUT
    fIn                : FLOAT;
    bUpperLimitSwitch  : BOOL;
    bLowerLimitSwitch  : BOOL;
    fManSyncValue      : FLOAT;
    bSync              : BOOL;
    eMode              : E_CTRL_MODE;
END_VAR

Name

Type

Description

fIn

FLOAT

Control value of the controller over the range
fCtrlOutMin ... fCtrlOutMax] (controller output).

bUpperLimit
Switch

BOOL

Limit switch: TRUE if the upper stop has been reached.

bLowerLimit
Switch

BOOL

Limit switch: TRUE if the lower stop has been reached.

fManSyncValue

FLOAT

Input with which the internal state of the current motor setting can be adjusted, or whose value is adopted in manual mode.

bSync

BOOL

With a rising edge at this input the internal motor position, which must correspond to the actual motor position, is set to the value "fManSyncValue".

eMode

E_CTRL_
MODE

Input that specifies the operation mode of the function block.

FB_CTRL_SERVO_MOTOR_OUT 4:

For synchronization with the current valve position, this function block has the mode eCTRL_MODE_SYNC_MOVEMENT. In this mode, the output for closing the valve is set until the valve is closed safely. The function block is then synchronized with this valve position.

Once the synchronization process is completed, eCTRL_STATE_ACTIVE mode is automatically activated.

FB_CTRL_SERVO_MOTOR_OUT 5: VAR_OUTPUT

VAR_OUTPUT
    bOutBitPos     : BOOL;
    bOutBitNeg     : BOOL;
    fActualState   : FLOAT;
    eState         : E_CTRL_STATE;
    eErrorId       : E_CTRL_ERRORCODES;
    bError         : BOOL;
END_VAR

Name

Type

Description

bOutBitPos

BOOL

Output required to drive the motor in a positive direction.

bOutBitNeg

BOOL

Output required to drive the motor in a negative direction.

fActualState

FLOAT

Current motor position in the range
[fCtrlOutMin ... fCtrlOutMax] in which the motor is currently located.

eState

E_CTRL_STATE

State of the function block

eErrorId

E_CTRL_ERRORCODES

Supplies the error number when the output bError is set.

bError

BOOL

Becomes TRUE, as soon as an error occurs.

VAR_IN_OUT

VAR_IN_OUT
    stParams    : ST_CTRL_SERVO_MOTOR_OUT_PARAMS;
END_VAR

Name

Type

Description

stParams

ST_CTRL_
SERVO_MOTOR_OUT_PARAMS

Parameter structure of the function block

stParams consists of the following elements:

TYPE ST_CTRL_SERVO_MOTOR_OUT_PARAMS:
STRUCT
    tCtrlCycleTime                               : TIME := T#0ms;
    tTaskCycleTime                               : TIME := T#0ms;
    tMovingTime                                  : TIME;
    tSignalExtension                             : TIME;
    tAdditionalMoveTimeAtLimits                  : TIME;
    tMinWaitTimeBetweenDirectionChange           : TIME;
    tMinimumPulseTime                            : TIME;
    bMoveOnLimitSwitch                           : BOOL;
    bStopAdditionalMoveTimeIfInputValueIsChanged : BOOL;
    fCtrlOutMax                                  : FLOAT := 100.0;
    fCtrlOutMin                                  : FLOAT := 0.0;    
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 to calculate internally whether the state and the output values have to be 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.

tMovingTime

TIME

The time required to move the actuator from one stop to the other.

tSignalExtension

TIME

Signal extension by which each output pulse is extended in order to compensate for the dead time.

tAdditionalMoveTimeAtLimits

TIME

Supplementary signal extension, output to reliably reach the limits when the actuator is to be driven to +/-100%. Only effective if bMoveOnLimitSwitch is FALSE.

tMinWaitTime
Between
DirectionChange

TIME

Minimum waiting time between positive and negative output pulses

tMinimumPulse
Time

TIME

Minimum length of an output pulse

bMoveOnLimit
Switch

BOOL

If TRUE, then when the control value is either fCtrlOutMin or fCtrlOutMax a signal will continue to be output until the corresponding limit switch is reached.

bStopAdditionalMoveTimeIf
InputValueIs
Changed

BOOL

If this flag is TRUE, movement of the valve to the end position, which is triggered by "Additional Moving Time At Limits", is stopped, if an input value is specified that does not match the end position. If this flag is FALSE and the input value matches an end position, the valve always safely moves to the end position first, before it can move to a different valve position.

fCtrlOutMax

FLOAT

Control value for which the valve will be driven to 100%.

fCtrlOutMin

FLOAT

Control value for which the valve will be driven to 0%.