Blend movements

When you're moving a robot arm, cutting a workpiece or performing a task that requires continuous movements, you need to blend each move so the tool can use a stable velocity to move in a smooth path. In this section, we introduce how to blend velocity and path using the blending and transition modes.

Blending modes

A blending mode is a way to blend velocity. There are four modes to blend the velocity of movements: BlendingLow, BlendingHigh, BlendingPrevious, BlendingNext.

Name Meaning
mcBlendingLow The velocity is blended with the lower velocity of the two functions or function blocks.
mcBlendingHigh The velocity is blended with the higher velocity of the two functions or function blocks.
mcBlendingPrevious The velocity is blended with the velocity of the first function or function block.
mcBlendingNext The velocity is blended with the velocity of the second function or function block.

You can find these in the McBufferMode type. In a motion command, these values are used for the BufferMode parameter.

In a sequence of motion commands, the blending mode set in the first command doesn't affect anything, because blending is about how to blend the current move with the previous move. Since there is no command before the first, it doesn't matter what blending mode you set in the first command. For example, MoveAxisAbsolute is the first motion command. For the BufferMode parameter, setting it to mcBlendingHigh, mcBlendingNext, mcAborting or another value does not affect MoveAxisAbsolute. However, the first command is affected by the blending mode set in the second command. If the MoveAxisRelative is the second command, and its blending mode is mcBlendingNext, the blending velocity will be MoveAxisRelative's velocity.

When blending, it is important to keep the following in mind:

  1. The blending mode in the first command doesn't affect anything.
  2. The blending mode in the next command affects the previous command.

Look-ahead

KINGSTAR links velocity and path using the concept of "look-ahead," which means while a motion command is running, it takes into account all of the motion commands' velocity and paths (paths are for multiple axes) at the same time, enabling continuous and steady movements. For example, if you send five motion commands, while the first command is running, it evaluates these five motion command's motion parameters to generate motion profiles featuring smooth transitions in velocity and path between commands.

KINGSTAR supports 511-block look-ahead.

Transition modes

When a transition mode is used, a transition curve blends the paths of two movements.

Transition modes Meaning
mcNone No transition.
mcCornerDistance Transition with the given corner distance.

You can find these in the McTransitionMode type. In a motion command, these values are used for the TransitionMode parameter. Different transition mode uses different transition parameter.

Currently, KINGSTAR supports only CornerDistance.

CornerDistance

CornerDistance uses an n-degree curve to link the paths of two movements. The figure below shows the blending path starts from E1 and ends at S2. Without blending, the positions of E1 and S2 are the same. To link two paths, we must give the axis some distance to transition from Path One to Path Two. This distance is d. The length of the d is affected by the hardware you use, the motion profile of the axis, the precision of the cutting materials, the position of the obstacle, the application you're developing, and many other factors. You need to consider all factors and write an applicable value for d. When d is used, the axis starts to move along the inserted curve after it has traveled certain distance. For example, if the entire distance (one path) the axis travels is 1000, and d is 50, the axis will start to move on the transition path after it has traveled 950 units. d can't be less than zero or greater than the entire distance the axis travels. Therefore, in this example, d can't be greater than 1000.

S1: Starting point 1.

S2: Starting point 2.

E1: End point 1.

E2: End point 2.

d: Distance of the blending path.

1: Path One.

2: Path Two.

Single axis

For a single axis, velocity needs to be linked between two movements. When there is no blending, you can use MoveAxisContinuousAbsolute or MoveAxisContinuousRelative plus another motion command to move the axis continuously, such as MoveAxisContinuousAbsolute + MoveAxisRelative. This way, the blending velocity is always "BlendingNext," because you can't decide how the velocity is blended. If you want to blend the velocity flexibly, blending modes are necessary.

Functions that support velocity blending

The table below lists the RT and Win32 functions that support velocity blending. The functions in other interfaces work the same.

Name Meaning
MoveAxisAbsolute Commands a controlled motion to a specified absolute position.
MoveAxisAdditive Adds a relative distance based on the last commanded position in the Discrete Motion state. The definition of a commanded position can be found in McSource.
MoveAxisRelative Commands a controlled motion of a specified distance relative to the current set position. The relative distance is added to the current set position at the time this command is called.
MoveAxisVelocity Commands a never-ending controlled motion at a specified velocity.

Using blending modes

To use blending modes, fill in BufferMode with one of the blending mode values. For example:

MoveAxisAbsolute(0, 360, 360, 360 * 10, 360 * 10, 360 * 1000, mcPositiveDirection, mcAborting);
MoveAxisAbsolute(0, 360 * 2, 360 * 2, 360 * 10, 360 * 10, 360 * 1000, mcPositiveDirection, mcBlendingLow);

First MoveAxisAbsolute: notice that BufferMode is mcAborting. Since it is the first command, its BufferMode value doesn't affect the command itself or others. You can set it to mcAborting, mcBuffered, mcCancel, mcBlendingNext or any other value in the McBufferMode type.

Second MoveAxisAbsolute: BufferMode is mcBlendingLow. While the first MoveAxisAbsolute is transitioning to the second MoveAxisAbsolute, the blending velocity is 720.

For further details about how to use a blending mode, see Example in MoveAxisAbsolute.

Multiple axes

For multiple axes, velocity and paths need to be linked between two movements. The way to link velocity works the same as that of a single axis. The way to link paths is path blending, which needs to apply a transition mode and transition parameter.

Functions that support velocity and path blending

The following table lists the RT and Win32 functions that support velocity and path blending. The functions in other interfaces work the same.

Notice that the MoveCircular functions supports only velocity blending in KINGSTAR 4.2.

Name Meaning
MoveLinearAbsolute Commands an interpolated linear movement on an axis group from the current position of the tool center point to an absolute position in the specified coordinate system.
MoveLinearAdditive Commands an interpolated linear movement on an axis group from the current position of the tool center point to a relative position in the specified coordinate system. The relative distance is added to the current set position at the time of the execution.
MoveLinearRelative Commands an interpolated linear movement on an axis group from the current position of the tool center point to a relative position in the specified coordinate system. The relative distance is added to the current set position at the time of the execution.
MoveCircularAbsolute

Commands an interpolated circular movement on an axis group from the current position of the tool center point. The end point and the auxiliary point (the meaning of both points depends on the CircMode mode you select) are defined absolutely in the specified coordinate system.

NOTE:  Supports only velocity blending in KINGSTAR 4.2.

MoveCircularAdditive

Commands an interpolated circular movement on an axis group from the current position of the tool center point. The end point and the auxiliary point (the meaning of both points depends on the CircMode mode you select) are defined in the specified coordinate system relative to the starting point. The specified relative distance is added to the set position at the time of the execution.

NOTE:  Supports only velocity blending in KINGSTAR 4.2.

MoveCircularRelative

Commands an interpolated circular movement on an axis group from the current position of the tool center point. The end point and the auxiliary point (the meaning of both points depends on the CircMode mode you select) are defined in the specified coordinate system relative to the starting point.

NOTE:  Supports only velocity blending in KINGSTAR 4.2.

MoveCircular use cases

Since MoveCircular functions supports only velocity blending, we suggest you use the blending mode only when the circular path is tangential to another path. The table below shows two uses of a circular path.

Use case 1 Use case 2

Path 1: MoveLinearAbsolute

Path 2: MoveCircularAbsolute

S1: Starting point 1.

S2: Starting point 2.

E1: End point 1.

E2: End point 2.

Path 1: MoveCircularAbsolute

Path 2: MoveLinearAbsolute

S1: Starting point 1.

S2: Starting point 2.

E1: End point 1.

E2: End point 2.

Using blending and transition modes

To use blending and transition modes, fill in BufferMode with one of the blending mode values and TransitionMode with mcCornerDistance. For example:

PositionArray[0] = 1000;
PositionArray[1] = 0;
PositionArray[2] = 0;
MoveLinearAbsolute(1, 3, PositionArray, 5000, 5000 * 10, 5000 * 10, 5000 * 1000,
   mcAxisCoordSystem, mcAborting, mcNone, NULL);

PositionArray[0] = 1000;
PositionArray[1] = 1000;
PositionArray[2] = 0;
TransitionParam = 200;
MoveLinearAbsolute(1, 3, PositionArray, 3000, 5000 * 10, 5000 * 10, 5000 * 1000,
   mcAxisCoordSystem, mcBlendingLow, mcCornerDistance, &TransitionParam);

First MoveLinearAbsolute: notice that BufferMode is mcAborting. Since it is the first command, its BufferMode value doesn't affect the command itself. You can set it to mcAborting, mcBuffered, mcCancel, mcBlendingNext or any other value in the McBufferMode type. TransitionMode works the same way. TransitionParameter can be any value.

Second MoveLinearAbsolute: BufferMode is mcBlendingLow, TransitionMode is mcCornerDistance, and TransitionParameter is 200. While the first MoveLinearAbsolute is transitioning to the second MoveLinearAbsolute, the blending velocity is 3000. The length of the transition path is 200.

For further details about how to use a blending and transition modes, see Example in MoveLinearAbsolute.