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_TrackConveyorBeltis 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
AxisGroupReference to the axis group.
ConveyorBeltAXIS_REF_SM3Reference to the axis of the conveyor belt. If
ConveyorBelt.bRegulatorOnis set when the FB is started, the set values will be used. Otherwise the act values will be used.Input
ExecuteBOOLStart the action at rising edge
ConveyorBeltOriginSpecifies 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.
InitialObjectPositionSpecifies the position and orientation of an object lying on the conveyor belt relative to the conveyor belt.
CoordSystemSMC_COORD_SYSTEMWhich PCS is to be set (PCS_1 or PCS_2)
NameSTRINGThe name of the coordinate system.
Output
DoneBOOLThe transformation has been set successfully
BusyBOOLThe FB is not finished
InUseBOOLSignals that the axis group still needs the referenced dynamic coordinate system. A new rising edge of
Executewill 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 becomesInUsewhen a movement to a position in the coordinate system is commanded. It remainsInUseuntil the target position of a movement to a different coordinate system has been reached.ErrorBOOLSignals that an error has occurred within the function block
ErrorIDSMC_ERRORError identification