Additive circular move

The way Additive moves an axis group is "distance." Just like Relative, you decide how far your group moves. The difference is that Additive adds a distance after the group reaches a position or travels a distance commanded by the previous function. Additive can be used independently or with Absolute or Relative. Since it's a circular move, your group is moving along a circular path.

Functions

MoveCircularAdditive: moves an axis group a specified distance from the last commanded position along a circular path.

GetAGroupPosition: gets and displays the set and actual positions of a group. For further details, see Get and set group values.

MoveCircularAdditive

MoveCircularAdditive moves an axis group from the last commanded position. The group stops after it travels the specified distance.

Starting point: this is where your group is now.

Auxpoint1 and Auxpoint2: the point that defines a circular path.

Relative distance: the distance your group travels. The distance is linear, but the group moves along a circular path.

Additive distance: the additional distance your group travels after it reaches a position or travels a distance commanded by the previous motion command. The distance is linear, but the group moves along a circular path.

Endpoint1: the target position your group reaches. This is where MoveCircularAdditive starts to move.

Endpoint2: the target position you group reaches after traveling the additional distance.

Notice the following parameters:

BufferMode and TransitionMode are relevant to blending. For more information about blending, see Blend movements.

Code

When you make circular moves, you can choose to use blending or not. We demonstrate this function without blending. For more information about a blending sample, see Blending for group motion.

In this sample, we use mcBorder to make a circular move. In GroupMotion.cpp, add the following code:

Copy

MoveCircularAdditive

VOID MoveCircularAdditiveGroup(int Group)
{
    RtPrintf("Make circular additive group move.\n\n");

    const int LENGTH = 3;   //The length of the Position array.
    double AuxPoints[LENGTH] = { 0, 300, 0 };
    double EndPoints[LENGTH] = { 0, 300, -600 };

    /*We lower the velocity to 360 because the distance is not far. If the velocity is high
      and the distance is short, the axis will brake sharply. This may damage the axis.*/
    KsCommandStatus addCircMove = WaitForCommand(30, TRUE, MoveCircularAdditive(Group, mcBorder,
        LENGTH, AuxPoints, EndPoints, mcShortPath, 360, 3600, 3600, 360000, mcAxisCoordSystem,
        mcAborting, mcNone, NULL));
    if (addCircMove.Error)
        RtPrintf("MoveCircularAdditive failed: %d\n\n", addCircMove.ErrorId);

    //Wait a few cycles to get the correct end positions.
    Sleep(5);

    //Display the end positions.
    RtPrintf("End positions:\n\n");
    GetAGroupPosition(Group);
}

 

Output: