Skip to main content

Buffering and Blending of Movements

Movement commands can be buffered with CODESYS SoftMotion. Blending of the path between the buffered movements is possible. The commanded path is adjusted by rounding the corners so that the path can be traveled without stopping. Whether or not a movement is buffered, and how it is done, can be configured by means of the BufferMode input of the movement block (for example, MC_MoveDirectAbsolute or MC_MoveCircularRelative). The TransitionMode and TransitionParameter inputs determine how corners are rounded.

Tip

Blending between two movements starts at the earliest halfway through the first movement and ends at the latest halfway through the second movement.

If the first movement has already been planned too far, then blending may no longer be possible with the set parameters. Then the blending area is reduced or blending is not possible anymore. In order to guarantee a successful blending, both movements should be commanded in the same cycle.

Supported values for BufferMode:

Aborting (0)

The movement is executed immediately and is not buffered. All previously commanded movements are aborted.

Buffered (1)

The function block starts as soon as the last commanded movement is finished. The TransitionMode has no effect.

Movements with the Buffered buffer mode always start at the beginning of a cycle. The only exception is when the movement follows an SMC_GroupWait. Then the movement starts exactly after the set wait time.

BlendingLow (2)

In the blending range between the two movements, the smaller value of the velocity, acceleration, and jerk limits of both movements is used.

BlendingPrevious (3)

In the blending range between the two movements, the velocity, acceleration, and jerk limits of the first movement are used.

BlendingNext (4)

In the blending range between the two movements, the velocity, acceleration, and jerk limits of the second movement are used.

BlendingHigh (5)

In the blending range between the two movements, the larger value of the velocity, acceleration, and jerk limits of both movements is used.

In blending modes, the TransitionMode must not be equal to TMNone.

Supports the following values for TransitionMode and TransitionParameter:

TMNone (0)

No blending; corners in the path are not rounded. The movement is stopped at the corners, even if BufferMode is one of the blending modes.

TMStartVelocity (1)

Velocity-based blending. The blending path is defined by both points A' and B'.

_sm_img_blending.png

The calculation of the blending points is based on an idealized velocity curve, which can deviate from the actual velocity curve. At this time, a deceleration ramp is simulated on the original path towards the blending point and an acceleration ramp and away from the blending point. The minimum from both the programmed path velocity and the estimated maximum path velocity resulting from the axis limits is used as the target velocity.

In addition, when blending between straight lines, the angle between them is taken into account. A minimum curvature radius for the blending element results from the desired path velocity and the estimated dynamics limits. The points A' and B' result in turn from this radius and the angle between the straight lines.

_sm_img_start_velocity_cp.png

TransitionParameter[0] acts again as a factor, however not in time, but in relation to the path length. A value of 1 means the start of the deceleration ramp and the end of the acceleration ramp. A value of 0.5 means exactly halfway in between.

TMCornerDistance (2)

Position-based blending. The TransitionParameter[0] is a radius of a sphere around the end point of the first movement or the starting point of the second movement. The blending movement begins at the (first) intersection of the first movement with the sphere and ends at the (first) intersection of the second movement with the sphere.

_sm_img_corner_distance.png

For more information, see: Function Blocks for Movements

Path dynamics when blending

If blending is performed between CP movements (between linear and circular segments), then it should be noted that the maximum path acceleration and the maximum path jerk may be exceeded during the blending. The shorter the blending range is, the more prominent this effect will be. However, the limits of the axes (the maximum axis acceleration and the maximum axis jerk) are always maintained.

Therefore, if the maximum path acceleration is low and the maximum axis acceleration is high, then accelerations which are too high can occur when blending. This can be counteracted by means of the AccFactor input of the motion blocks, for example, by reducing the maximum axis acceleration for a movement.