Representation in FBD

General Information

Generates the actual mechanical position in user units from increment position of a connected encoder and outputs this as a Motion Control axis. With this module, a mechanical encoder can be used as a master encoder for synchronous movements. For this purpose, the 32-bit angle position (in increments) of the encoder is available as a cyclical value.

When x_Enable = TRUE, the module is activated. Successful activation is signaled with TRUE at the x_Active output. From this point, the angle changes of the connected encoder are detected, converted into user units, output, added to the position variable connected to di_Pos and saved in the _Master axis. The position should be set once by the user. The master axis can be used directly in Motion Control. The di_Pos position is available for using technology modules (SyncLin, SyncRot etc.).

If you would like to use the real 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 MC_Periode. This resolution is specified per break, e.g. in 360°/1 MC_Periode or 54,554 mm/1,000 MC_Periods. If you use the virtual master axis with function modules from the technology library, such as TB_SyncLin or TB_SyncRot, you do not need to specify the resolution, as these function modules work with user units.

With the TB_MasterEncoder function module, a unique master position for each individual technology axis is generated from the _Master (AXIS_REF) structure occupied by the TB_PhysicalEncoder function module. For this purpose, see "Application Manual Encoder Concept".

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

InOut Parameter


Input Parameter

Marking: Data type: Default: Data range: Description:
x_Enable BOOL ... ... TRUE: Enabling of the module. The position is changed based on the velocity of the connected axis. Setting of the position does not occur, however.
d_Encoder DWORD ... ... Angle position of the encoder in increments. 232 increments correspond to one revolution of the encoder.
ud_Units UDINT ... ... Number of user units for the specified motor revolutions (u_Revolution).
u_Revolution UINT ... ... The internal processing precision of the master axis depends on u_Revolution. The smaller the u_Revolution, the greater the resolution: u_Revolution          Resolution of the master axis
         1                                                 30 bits
         >= 2                                            29 bits
         >= 4                                            28 bits
         >= 8                                            27 bits
         >= 16                                          26 bits
         >= 32                                          25 bits
         >= 2^x                                         32-(x+2) bits = 30-x bits
         >= 4,096                                     18 bits
         >= 8,192                                     17 bits
         >= 16,384                                   16 bits
         >= 32,768                                   15 bits
         0 = 65,536                                  14 bits
i_T_Cycle INT ... ... Configured cycle time of setpoint event task in ms. 1, 2, 4 or 8 ms is possible.
us_Filter USINT ... ... Filter parameter for the angle change. Zero means filter inactive. The larger the value, the greater the filter effect.
ud_Units_1 UDINT ... ... Number of user units for the specified Motion Control periods (u_MC_Periode).
u_MC_Periode UINT ... ... Number of Motion Control periods for the specified user units (ud_Units_1).
di_Pos DINT ... ... Mechanical position of the encoder in user units.
_Master AXIS_REF ... ... Motion Control master axis.

Output Parameter

Marking: Data type: Description:
x_Active BOOL TRUE: Module active; positional changes of master axis cause positional changes at di_MasterPos.
di_Vel_s DINT Output of the current velocity in user units/Ts. Ts is the configured cycle time of the setpoint event task.
di_Vel_Ts DINT Output of the current velocity in user units/s.
di_Pos DINT Position of the axis in user units
_Master AXIS_REF Motion Control master axis