MC_TrackConveyorBelt (FB)ΒΆ
FUNCTION_BLOCK MC_TrackConveyorBelt
This function block tracks a piece on a conveyor belt.
Based on the position and orientation of the conveyor belt and on the position and orientation of the piece relative to the conveyor belt, the tracking is performed using SMC_SetDynCoordTransformEx.
The position, velocity, etc. of the conveyor belt is given by a single axis.
This FB may be called with a new rising edge on Execute only after the
configured dynamic coordinate system is no longer in use by any movement,
otherwise error SMC_AXIS_GROUP_PCS_STILL_IN_USE will be returned.
See output InUse
.
Note
No dead time compensation is done. In case the axis is an encoder, it is recommended to use a logical axis to account for the dead time.
See also MC_TrackRotaryTable.
The function block SMC_SetDynCoordTransformEx provides a more general interface.
This FB does not start a movement (administrative FB). The movement is initiated by a command in PCS.
The following example demonstrates the usage of MC_TrackConveyorBelt
.
The task is to manipulate a workpiece, starting from a certain position P
(xPCS; yPCS; 0) on the workpiece.

The workpiece is lying on a conveyor belt (CB) which is moving with speed vCB. The workpiece is detected by a digital camera, which also provides the position (and orientation) of the workpiece relative to the conveyor belt.
At time t0, when the workpiece is detected by the camera,
MC_TrackConveyorBelt
is executed.At the same time, a movement to position P in PCS is started. The axis group starts to move from its waiting position W (MCS) towards P (PCS).
At time t1 the axis group has reached P. In the meantime the conveyor belt has moved by the distance dx0_1.
After P has been reached, the process can be started. All positions within the process have to be related to the PCS.
At time t2 the process is finished and the axis group moves back to its waiting position WMCS. A possible resulting trajectory of the TCP is shown in the picture below.

- InOut:
Scope
Name
Type
Comment
Inout
AxisGroup
Reference to the axis group.
ConveyorBelt
AXIS_REF_SM3
Reference to the axis of the conveyor belt. If
ConveyorBelt.bRegulatorOn
is set when the FB is started, the set values will be used. Otherwise the act values will be used.Input
Execute
BOOL
Start the action at rising edge
ConveyorBeltOrigin
Specifies the position and orientation of the conveyor belt in world coordinates (WCS). This defines a coordinate system of the conveyor belt in which the position of an object lying on the conveyor belt can be specified. The x-axis of the coordinate system of the conveyor belt has to point into the direction of movement of the conveyor belt.
InitialObjectPosition
Specifies the position and orientation of an object lying on the conveyor belt relative to the conveyor belt.
CoordSystem
Which PCS is to be set (PCS_1 or PCS_2)
Name
STRING
The name of the coordinate system.
Output
Done
BOOL
The transformation has been set successfully
Busy
BOOL
The FB is not finished
InUse
BOOL
Signals that the axis group still needs the referenced dynamic coordinate system. A new rising edge of
Execute
will lead to the errorSMC_AXIS_GROUP_PCS_STILL_IN_USE
. For this information to be up-to-date, the function block has to be called continuously (even if alreadyDone
). A dynamic coordinate system becomesInUse
when a movement to a position in the coordinate system is commanded. It remainsInUse
until the target position of a movement to a different coordinate system has been reached.Error
BOOL
Signals that an error has occurred within the function block
ErrorID
SMC_ERROR
Error identification