Synchronization with a Moving Coordinate System
The integrated tracking function allows programming of motions relative to a moving coordinate system. A typical use case is picking up a product from a conveyor belt and placing it on a different conveyor belt. After defining a dynamic coordinate system for each belt, the user can simply provide target positions for movements that are relative to these coordinate system. CODESYS SoftMotion takes care of superposing the commanded movement of the axis group and the movement of the belt.
A typical tracking motion consists of three phases:
Tracking in: Moving from another coordinate system into the dynamic coordinate system. After the target position has been reached, the axis group will follow the motion of the dynamic coordinate system.
Tracking movement: Moving to a different position inside the same dynamic coordinate system. The commanded movement and the motion of the dynamic coordinate system will be superposed.
Tracking out: Moving from the dynamic coordinate system to a different coordinate system. After the target position has been reached, the motion of the axis group will no longer be influenced by the motion of the dynamic coordinate system.
Defining a dynamic coordinate system
The first step of implementing a dynamic tracking application is defining a dynamic coordinate system. CODESYS SoftMotion provides four function blocks for defining dynamic coordinate systems:
MC_TrackConveyorBelt
: An easy-to-use function block for the common use case of tracking a conveyor belt. A reference to the actual belt is provided via theConveyorBelt
input, which expects a SoftMotion axis of typeAXIS_REF_SM3
.MC_TrackRotaryTable
: An easy-to-use function block for the common use case of tracking a rotary table. A reference to the actual rotary table is provided via theRotaryTable
input, which expects a SoftMotion axis of typeAXIS_REF_SM3
.MC_SetDynCoordTransform
: The function block works similar toMC_TrackConveyorBelt
andMC_TrackRotaryTable
, but, instead of being controlled by a single axis, is controlled by a full axis group. This allows implementing a dynamic coordinate systems with up to six degrees of freedom.SMC_SetDynCoordTransformEx
: The function block allows implementing a completely custom dynamic coordinate system.
Each of the four function blocks has a CoordSystem
input that essentially allows giving the coordinate system a name, either PCS_1
or PCS_2
. When commanding a movement, the coordinate system is referenced by this name.
Commanding a movement to a position in a dynamic coordinate system
After having defined a dynamic coordinate system, commanding a movement to a position in this coordinate system is easy. Each movement function block, for example MC_MoveLinearAbsolute
, has a CoordSystem
input. This input has to be set to the name (PCS_1
or PCS_2
) given to the dynamic coordinate system. The Position
input can then be set to the desired position relative to the origin of the dynamic coordinate system. Executing the movement function block will lead to a movement to the position inside the moving coordinate system. Once the target position has been reached, the axis group will follow the dynamic coordinate system while staying at this relative position.
The "InUse" output of dynamic coordinate system function blocks
Each dynamic coordinate system function block (MC_TrackConveyorBelt
, MC_TrackRotaryTable
, MC_SetDynCoordTransform
, and SMC_SetDynCoordTransformEx
) has an InUse
output. Restarting a function block while the coordinate system is still in use is not allowed and will result in the error SMC_AXIS_GROUP_PCS_STILL_IN_USE
. A dynamic coordinate system will become in use as soon as a movement to a position in the coordinate system is commanded. It will remain in use until a target position in a different coordinate system has been reached.
Axis limits for tracking movements
The axis limits have to account for both the motion of the coordinate system as well as the commanded movement relative to the coordinate system. If high axis dynamics are required in order to follow the coordinate system, the movement relative to the coordinate system might be slow or not possible at all. If the axis group is close to a singularity of the kinematics, this can even happen with a relatively slow moving coordinate system.
For more information, see: Tab: General
Path dynamics of CP movements while tracking
Special consideration has to be given to the path dynamics of CP movements. This includes the Velocity
, Acceleration
, Deceleration
, and Jerk
inputs of MC_MoveLinearAbsolute
, MC_MoveLinearRelative
, MC_MoveCircularAbsolute
, and MC_MoveCircularRelative
. If start and target position are in the same dynamic coordinate system, the path dynamics will be relative to this coordinate system. However, if start and end position are in different coordinate systems the path dynamics are blended from dynamics relative to the first coordinate system to dynamics relative to the second coordinate system. It is important that the path dynamics are set higher than the absolute value of the difference in dynamics between the two coordinate systems. In particular, when moving from a static to a dynamic coordinate system, the path dynamics should be set higher than the absolute value of the dynamics of the coordinate system.
Important
The path velocity cannot be monitored with SMC_GroupReadPathDynamics
when moving between coordinate systems (tracking in, out or between different dynamic coordinate systems).
SMC_GroupReadPathDynamics
calculates the path dynamics relative to a specified coordinate system. In the case of tracking in or out or moving between dynamic coordinate systems, this is a movement that depends on two coordinate systems (start and destination coordinate systems differ). As a result, the SMC_GroupReadPathDynamics
function block is not suitable to calculate the path dynamics for these cases.
Avoid the errors SMC_AXIS_GROUP_MAX_AXIS_LAG_EXCEEDED, SMC_AXIS_GROUP_MAX_POSITION_LAG_EXCEEDED, or SMC_AXIS_GROUP_MAX_ORIENTATION_LAG_EXCEEDED.
The errors SMC_AXIS_GROUP_MAX_AXIS_LAG_EXCEEDED
, SMC_AXIS_GROUP_MAX_POSITION_LAG_EXCEEDED
, or SMC_AXIS_GROUP_MAX_ORIENTATION_LAG_EXCEEDED
are reported if it is not possible to follow the commanded path without violating the configured axis limits or path dynamics. If this error occurs, it should first be checked whether the axis limits and path dynamics are configured according to the previous two sections. The path deviation can be monitored with the outputs PositionLag
and OrientationLag
of the MC_GroupReadStatus
function block.
Possible solutions are as follows:
Increase the axis limits.
Increase the path dynamics of CP movements when tracking into a dynamic coordinate system.
Reduce the dynamics of the coordinate system.
Avoid movements close to a singularity of the kinematics, for example by repositioning the robot.
If the dynamic coordinate system is controlled by the output of a noisy encoder, then it might help to filter the encoder signal using a Logical Axis. For more information, see: Tab: Logical Axes.
An acceptable tolerance for the position and orientation lag can be configured using the SMC_GroupSetPathTolerance
function block.