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.

Behaviour of the output:

FB_CTRL_SERVO_MOTOR_OUT 2:

VAR_INPUT

VAR_INPUT
    fIn         : FLOAT; (* controller output = SERVO_MOTOR_OUT input [ fCtrlOutMin ... fCtrlOutMax ] *)
    bUpperLimitSwitch       : BOOL;
    bLowerLimitSwitch       : BOOL;
    fManSyncValue   : FLOAT;
    bSync       : BOOL;
    eMode       : E_CTRL_MODE;
END_VAR

fIn : control value of the controller in the interval [ fCtrlOutMin ... fCtrlOutMax ] (controller output).

bUpperLimitSwitch : limit switch: TRUE if the upper stop is reached.

bLowerLimitSwitch : limit switch: TRUE if the lower stop is reached.

fManSyncValue : input with which the internal state of the current motor position can be adjusted, or whose value is adopted in manual mode.

bSync : a rising edge at this input sets the internal motor position, which must correspond to the actual position, to the value fManSyncValue.

eMode : input that specifies the operation mode of the function block.

FB_CTRL_SERVO_MOTOR_OUT 3:

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; (* PWM output bit *)
    bOutBitNeg      : BOOL; (* PWM output bit *)
    fActualState    : FLOAT; (* Actual state of the motor [ 0% ... 100%] *)
    eState      : E_CTRL_STATE;
    eErrorId        : E_CTRL_ERRORCODES;
    bError      : BOOL;
END_VAR

bOutBitPos : Output required to drive the motor in a positive direction.

bOutBitNeg : Output required to drive the motor in a negative direction.

fActualState : Current motor setting over the range [ fCtrlOutMin ... fCtrlOutMax ] in which the motor is currently positioned.

eState : State of the function block.

eErrorId : Supplies the error number when the bError output is set.

bError : Becomes TRUE, as soon as an error occurs.

VAR_IN_OUT

VAR_IN_OUT
    stParams        : ST_CTRL_SERVO_MOTOR_OUT_PARAMS;
END_VAR

stParams : Parameter structure of the function block. This consists of the following elements:

TYPE
ST_CTRL_SERVO_MOTOR_OUT_PARAMS:
STRUCT
    tCtrlCycleTime            : TIME     := T#0ms;    
(* controller cycle time [TIME] *)
    tTaskCycleTime            : TIME     := T#0ms;    
(* task cycle time [TIME] *)
    tMovingTime               : TIME;         
(* time to move from closed (e.g. 0%) to open (e.g. 100%)*)
    tSignalExtension          : TIME;         
(* output signal extension time *)
    tAdditionalMoveTimeAtLimits       : TIME;         
(* add these moving time to ensure that the limits are
reached*)
    tMinWaitTimeBetweenDirectionChange: TIME;         
(* wait time between pos and neg output pulses and vice versa
*) 
    tMinimumPulseTime         : TIME;         
(* minimum output pulse length *)
    bMoveOnLimitSwitch        : BOOL;
    bStopAdditionalMoveTimeIfInputValueIsChanged : BOOL;      
(* if an additional move on the limits is active, this will be
stopped if the input value is changed *)
    fCtrlOutMax               : FLOAT := 100.0;       
(* controller output to move to the max limit *)
    fCtrlOutMin               : FLOAT := 0.0;     
(* controller output to move to the min limit *)
END_STRUCT
END_TYPE

tCtrlCycleTime : 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 : 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 : The time required to move the actuator from one stop to the other.

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

tAdditionalMovingTimeAtLimits : Signal extension, which is additionally output for safe reaching of the limits, if the actuator is to be moved to +/-100%. Only effective if bMoveOnLimitSwitch is FALSE.

tMinWaitTimeBetweenDirectionChange : Minimum waiting time between positive and negative output pulses.

tMinimumPulseTime : Minimum length of an output pulse.

bMoveOnLimitSwitch : 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.

bStopAdditionalMoveTimeIfInputValueIsChanged : 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 : Control value for which the valve will be driven to 100%.

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

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v2.8

PC (i386)

TcControllerToolbox.lib

TwinCAT v2.9 from Build 947

BC

TcControllerToolbox.lb6

TwinCAT v2.9 from Build 956

BX

TcControllerToolbox.lbx