Relative helical 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 helical move, your group is moving along a helical path.

Functions

MoveHelicalRelative: moves an axis group a specified distance along a helical path.

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

MoveHelicalRelative

MoveHelicalRelative moves an axis group from the starting point along a helical path. The group stops after it reaches the specified height.

In a helix, two axes keeps drawing the same circle and one axis rises up. Auxpoint and Endpoint are used to define a circular path, so Endpoint is not the target position the group will reach. The target position is determined by Depth.

After you send a helical command, the group sets out from Starting point. Two of them keeps drawing the same circle according to Auxpoint and Endpoint. Another one rises up until Depth is reached. If Starting point is (0, 0, 0), Depth is 60, and the axis moves along Y-axis, the target position is (0, 60, 0).

 

Starting point: where your group is now.

Auxpoint: the point that defines a circular path. When you define Auxpoint, you need to set the distance between Starting point and Auxpoint, not Auxpoint's position. For more information about position and distance, see Frequently asked questions -> I can't use MoveCircularRelative or MoveCircularAdditive to get the correct result.

Endpoint: the point that defines the end of a circular path. After reaching this point, the group starts drawing the same circle again, until the specified depth is reached. When you define Endpoint, you need to set the distance between Starting point and Endpoint, not Endpoint's position. For more information about position and distance, see Frequently asked questions -> I can't use MoveCircularRelative or MoveCircularAdditive to get the correct result.

 

Notice the following parameters:

Code

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

Copy
MoveHelicalRelative
VOID MoveHelicalRelativeGroup(int Group)
{
    RtPrintf("Make helical relative group move.\n\n");

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

    /*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.*/

    /*When you use HelicalMove, you may need to give the move more time to complete because
      drawing helices takes more time.*/

    KsCommandStatus relHelMove = WaitForCommand(60, TRUE, MoveHelicalRelative(Group, mcRadius,
        LENGTH, AuxPoints, EndPoints, mcShortPath, 60, 10, 360, 3600, 3600, 360000,
        mcAxisCoordSystem, mcAborting, mcNone, NULL));
    if (relHelMove.Error)
        RtPrintf("MoveHelicalRelative failed: %d\n\n", relHelMove.ErrorId);

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

 

Output:

Helical traces: two axes keeps drawing the same circle (sine waves) and one axis makes a linear move (helix's depth). If you didn't give the axes enough time to draw helices, the axes will stop before they travel the specified distance.