Absolute helical 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 helical move, an axis group is moving along a helical path.
Functions
MoveHelicalAbsolute: moves an axis group to an absolute position 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.
MoveHelicalAbsolute
MoveHelicalAbsolute moves an axis group from the starting point to end 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.
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.
Notice the following parameters:
- CircMode: specifies the meaning of the input signal AuxPoint. See the McCircMode type.
- Length: the length of the AuxPoint and EndPoint arrays.
- AuxPoint: the absolute positions that define a circular path for each axis in the group. It is an array. For further details, see Circular motion modes.
- EndPoint: the absolute target positions (end points) for each axis in the group. It is an array.
- PathChoice: choice of path. See the McCircPathChoice type. For more information about the short and long paths, see Circular motion modes -> mcRadius.
- Depth: the height of the helix.
- Pitch: the height of one full helix turn.
- BufferMode: defines how to blend the velocity of two functions. MoveHelical can be buffered but doesn't support blending. See the McBufferMode type. For details, see Chapter 5: Single-Axis Motion > Motion states -> Common parameters.
- TransitionMode: inserts a transition curve to blend the path. If you want to perform a sequence of movements smoothly, you need to use this parameter. Currently MoveHelical doesn't support transition curves. See the McTransitionMode type.
Code
In this sample, we use mcRadius
to make a helical move. In GroupMotion.cpp
, add the following code:
VOID MoveHelicalAbsoluteGroup(int Group)
{
RtPrintf("Make helical absolute group move.\n\n");
const int LENGTH = 3; //The length of the Points array.
double AuxPoints[LENGTH] = { 0, 0, 300 };
double EndPoints[LENGTH] = { 300, 300, 0 };
/*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 absHelMove = WaitForCommand(60, TRUE, MoveHelicalAbsolute(Group, mcRadius,
LENGTH, AuxPoints, EndPoints, mcShortPath, 60, 10, 360, 3600, 3600, 360000,
mcAxisCoordSystem, mcAborting, mcNone, NULL));
if (absHelMove.Error)
RtPrintf("MoveHelicalAbsolute failed: %d\n\n", absHelMove.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 reach the specified position.