Additive helical 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 helical move, your group is moving along a helical path.
Functions
MoveHelicalAdditive: moves an axis group a specified distance from the last commanded 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.
MoveHelicalAdditive
MoveHelicalAdditive: moves an axis group from the last commanded position. 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 point1. Two of them keeps drawing the same circle according to Auxpoint1 and Endpoint1. 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), which is also Starting point2.
Next, the group starts the additional move from Starting point2, (0, 60, 0). The additional move works the same as the previous move, but the circle it draws and the depth it reaches may be different, depending on how you define Auxpoint2, Endpoint2, Additive Depth, and Pitch.
Starting point1: where your group is now.
Auxpoint1 and Auxpoint2: the points that define circular paths. 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.
Starting point2: it is the starting position of the additive command and the target position of the previous command. This is where MoveHelicalAdditive starts.
Endpoint1 and Endpoint2: the points that define the end of circular paths. 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.
NOTE: Endpoint1 is not the same as Starting point2. Endpoint1 is used to define the end of the first circle. Starting point2 is the starting position of the additive command and the target position of the previous command.
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 positions that define a helical path for each axis in the group. It is an array. For further details, see Circular motion modes.
- EndPoint: the distance for each axis in the group to travel. 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 MoveHelicalAdditiveGroup(int Group)
{
RtPrintf("Make helical additive group move.\n\n");
const int LENGTH = 3; //The length of the Points array.
double AuxPoints[LENGTH] = { 0, 400, 0 };
double EndPoints[LENGTH] = { 400, 0, 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.*/
/*When you use HelicalMove, you may need to give the move more time to complete because
drawing helices takes more time.*/
KsCommandStatus addHelMove = WaitForCommand(60, TRUE, MoveHelicalAdditive(Group, mcRadius,
LENGTH, AuxPoints, EndPoints, mcShortPath, 60, 10, 360, 3600, 3600, 360000,
mcAxisCoordSystem, mcAborting, mcNone, NULL));
if (addHelMove.Error)
RtPrintf("MoveHelicalAdditive failed: %d\n\n", addHelMove.ErrorId);
//Display the end positions.
RtPrintf("End positions:\n\n");
GetAGroupPosition(Group);
}
Output:
AuxPoints = { 0, 400, 0 }
EndPoints = { 400, 0, 400 }
Depth: 60
Pitch: 10
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.
Output:
MoveHelicalRelative + MoveHelicalAdditive
AuxPoints = { -300, 0, 0 }
EndPoints = { 0, -300, 300 }
Depth: 60
Pitch: 10
AuxPoints = { -400, 0, 0 }
EndPoints = { 0, -400, 400 }
Depth: 60
Pitch: 10