FB_CTRL_SERVO_MOTOR_OUT
This function block generates pulses with which a servomotor can be driven to a defined position.
Behavior of the output
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 |
bUpperLimit | BOOL | Limit switch: TRUE if the upper stop has been reached. |
bLowerLimit | 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_ | Input that specifies the operation mode of the function block. |
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. |
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 |
eState | E_CTRL_STATE | State of the function block |
eErrorId | E_CTRL_ERRORCODES | Supplies the error number when the output |
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_ | 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 |
tMinWaitTime | TIME | Minimum waiting time between positive and negative output pulses |
tMinimumPulse | TIME | Minimum length of an output pulse |
bMoveOnLimit | BOOL | If TRUE, then when the control value is either |
bStopAdditionalMoveTimeIf | 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%. |