Absolute circular move

The way Absolute moves an axis group is "position." You decide the position your group moves to. The starting point is the group's current position, and the end point is the target position. The target position is counted from the origin in the specified coordinate system. Since it is a circular move, an axis group is moving along a circular path.

Functions

MoveCircularAbsolute: moves an axis group to an absolute 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.

MoveCircularAbsolute

MoveCircularAbsolute moves an axis group from the starting point to end point along a circular path. The group stops after it reaches the end point.

Starting point: this is where your group is now.

Auxpoint: the point that defines 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 a circular move, 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 mcRadius to make a circular move. In GroupMotion.cpp, add the following code:

Copy

MoveCircularAbsolute

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

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

    /*We lower the velocity to 360 because the end positions are not far. If the velocity is high
      and the distance is short, the axis will brake sharply. This may damage the axis.*/
    KsCommandStatus absCircMove = WaitForCommand(30, TRUE, MoveCircularAbsolute(Group, mcRadius,
        LENGTH, AuxPoints, EndPoints, mcShortPath, 360, 3600, 3600, 360000, mcAxisCoordSystem,
        mcAborting, mcNone, NULL));
    if (absCircMove.Error)
        RtPrintf("MoveCircularAbsolute failed: %d\n\n", absCircMove.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: