TB_MasterEngine

Representation in FBD

General Information

This function module can be used to generate a new virtual master. Any user units (Unit) can be used; it is thus possible to present the machinery in mm or °. In addition, any period can be specified, that can be 360° for example, to generate a rotary movement.

Recommended task: EVENT
Libraries used: MOTION_MULTI_AXIS_xxbd00 or greater
ARITHMETIC_30bd00 or greater
MOTION_TYPES_xxbd07 or greater
TECH_TOOLS_30bd00 or greater
Additional data type definitions: ...
Use of Static-Variables: ...

Functionality

InOut Parameter

none

Input Parameter

Marking: Data type: Default: Data range: Description:
x_Enable BOOL ... ... When the input x_Enable = TRUE, the module is initialized. If the initialization was successful, this is indicated when the output x_Active = TRUE.
x_Start BOOL ... ... The virtual master axis is started when x_Start = TRUE. To be able to start, x_Active must be TRUE and x_StopRapid must be FALSE. If the master axis is to stop at a certain position, it must be connected to ud_StopPos and then x_Start must be set to FALSE. Deceleration occurs with the stop deceleration ud_DecStop_s. The successful start of the virtual master axis is indicated when x_Motion = TRUE.
x_StopRapid BOOL ... ... The input x_StopRapid must be FALSE to be able to start the master axis. When x_StopRapid = TRUE, the master axis is stopped immediately. Deceleration occurs with the stop deceleration ud_DecRapid_s.
di_Vel_s DINT ... ... The setpoint velocity in Unit/s is connected to input di_Vel_s. To reach the velocity, acceleration/deceleration is carried out with ud_Acc_s/ud_Dec_s in Unit/s2.
ud_Acc_s UDINT ... ... Acceleration in Unit/s².
ud_Dec_s UDINT ... ... Deceleration in Unit/s².
If the input is not occupied, ud_Acc_s is used.
ud_AccStart_s UDINT ... ... Acceleration in Unit/s² with which the master axis accelerates when x_Start = TRUE. ud_Acc_s is used once the setpoint velocity is reached for the first time. The acceleration therefore only has an effect during the first acceleration after the rising edge of x_Start.
If the input is not occupied, ud_Acc_s is used.
ud_DecStop_s UDINT ... ... Deceleration in Unit/s² with which the master axis is braked when x_Start = FALSE. The indicated brake time ud_TimeStop_ms refers to this deceleration.
If the input is not occupied, ud_Dec_s is used.
ud_DecRapid_s UDINT ... ... Deceleration in Unit/s² with which the master axis is braked when x_StopRapid = TRUE, x_Enable = FALSE or in case of an error. The indicated brake time ud_TimeStop_ms is based on this deceleration.
If the input is not occupied, ud_Dec_s is used.
ud_StopPos UDINT ... ... When x_Start = FALSE, positioning to ud_StopPos occurs. If the position is reached, the output x_StopPosReached = TRUE. If the position cannot be reached, e.g. because it is located behind the current position or the braking path is longer than the distance to the stop position, braking occurs immediately. The output x_StopPosReached remains FALSE, however.
ud_StartPos UDINT ... ... If x_Enable = TRUE, ud_MasterPos is initialized with the start position ud_StartPos.
ud_Period UDINT ... ... The resolution of the master axis is specified with ud_Period. Any resolution can be chosen, e.g. 360000 for 360,000° or 735500 for 735,000 mm or 5000 for 50.00 inches.
i_T_Cycle INT ... ... Call interval of the event task in which TB_MasterEngine is called up; in ms. Valid values are 1 ms, 2 ms, 4 ms and 8 ms.
ud_Units UDINT ... ... If you would like to use the virtual master axis to couple Motion Control function modules such as MC_GearIn or MC_CamIn, you must specify a resolution to create the reference of user units per revolution of the motor or per MC_Periode. This resolution is also specified as a break in units/MC_Perioden, whereby ud_Units is the numerator and u_MC_Periode the denominator. If MC_GearIn or MC_CamIn is not to be used with the created master axis, the inputs should not be connected.
u_MC_Periode UINT ... ... see ud_Units!
_Master AXIS_REF ... ... Motion Control axis variable at the calculated master axis position. This axis variable can be used at the cam disk or the electronic gear as a master (master input) (if a resolution has been specified). The master axis position and velocity can still be read out in Unit or Unit/Ts, respectively, with the TB_MasterEncoder function module (no resolution is necessary here).

Output Parameter

Marking: Data type: Description:
x_Active BOOL The x_Active output indicates successful initialization of TB_MasterEngine.
x_Motion BOOL The x_Motion output indicates the active virtual master axis. x_Motion is not FALSE until a standstill has been reached.
ud_MasterPos UDINT Current master position of the virtual master axis in Unit. The position is set to ud_StartPos with a rising edge of x_Enable.
di_MasterVel DINT Current velocity of the virtual master axis in Unit/Ts.
di_MasterAcc DINT Current acceleration of the virtual master axis in Unit/Ts².
di_MaVelSet_s DINT Setpoint velocity of the virtual master axis in Unit/s.
di_MaVelAct_s DINT Current velocity of the virtual master axis in Unit/s.
ud_TimeStop_ms UDINT Time in ms required to stop from the current velocity when x_Start = FALSE. The braking path could thus be calculated using the TB_TimeToTravel function module.
ud_TimeAcc_ms UDINT Time in ms still required to reach the setpoint velocity. The value can be used for the TB_CamSwitch function module, for example, so that the acceleration can be taken into account with the dead time compensation.
i_SegNr INT 0: Virtual master axis at standstill
1: Virtual master axis accelerated
2: Virtual master axis braked
3: Virtual master axis has reached setpoint velocity
x_StopPosReached BOOL The x_StopPosReached output is TRUE when the stop position has been reached. The stop position is not reached if the stop position is located behind the current position or the braking path is greater than the differential distance from the current position to the stop position.
x_Standstill BOOL The output x_Standstill = TRUE when the virtual master axis is at a standstill.
x_Error BOOL If an error occurs, the error bit is set and an error number is read out.
If a warning occurs, only an error number is output. The error bit is not set.
i_Error INT see below
_Master AXIS_REF Motion Control axis variable at the calculated master axis position. This axis variable can be used at the cam disk or the electronic gear as a master (master input) (if a resolution has been specified). The master axis position and velocity can still be read out in Unit or Unit/Ts, respectively, with the TB_MasterEncoder function module (no resolution is necessary here).

i_Error Description:
1 Invalid value for i_T_Cycle, 1, 2, 4, 8 ms are valid.
2 Start position >= period.
3 Stop position >= period.
10 Warning: Specified acceleration ud_Acc too small and therefore not presentable in Unit/Ts²; 1 is used internally.
11 Warning: Specified acceleration ud_AccStart too small and therefore not presentable in Unit/Ts²; 1 is used internally.
12 Warning: Specified deceleration ud_Dec too small and therefore not presentable in Unit/Ts²; 1 is used internally.
13 Warning: Specified deceleration ud_DecStop too small and therefore not presentable in Unit/Ts²; 1 is used internally.
14 Warning: Specified deceleration ud_DecRapid too small and therefore not presentable in Unit/Ts²; 1 is used internally.