Relative circular move

The way Relative moves an axis group is "distance." You decide how far your group moves. The starting point is the group's current position, and the distance is how far your group moves. Since it's a circular move, your group is moving along a circular path.

Functions

MoveCircularRelative: moves an axis group a specified distance 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.

MoveCircularRelative

MoveCircularRelative moves an axis group from the starting point along a circular path. The group stops after it travels the specified distance.

Starting point: this is where your group is now.

Auxpoint: the point that defines a circular path.

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

Endpoint: the target position your group will reach.

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 mcCenter to make a circular move. In GroupMotion.cpp, add the following code:

Copy

MoveCircularRelative

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

    const int LENGTH = 3;   //The length of the Position array.
    double AuxPoints[LENGTH] = { 0, 0, 600 };
    double EndPoints[LENGTH] = { 600, 0, 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 relCircMove = WaitForCommand(30, TRUE, MoveCircularRelative(Group, mcCenter,
        LENGTH, AuxPoints, EndPoints, mcShortPath, 360, 3600, 3600, 360000, mcAxisCoordSystem,
        mcAborting, mcNone, NULL));
    if (relCircMove.Error)
        RtPrintf("MoveCircularRelative failed: %d\n\n", relCircMove.ErrorId);

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

 

Output: