X and Y Axis Parameters
The X and Y axes are two axes that constitute the plane in which the path interpolation with rotation is executed. These two axes are required for path interpolation with rotation to operate, and cannot be disabled.
Axis Coordinate Flip
If the axisCoordinateFlip[0] parameter is set to 1, all X positions (such as segment target positions and center of rotation) are flipped across the starting position (the position where the AddPathIntplWithRotationCommand function is first called when defining a new path). If the axisCoordinateFlip[1] parameter is set to 1, all Y positions are flipped across the starting position.
The effects of the axisCoordinateFlip parameter are shown in the following figure.

Coordinate Type
In the default configuration, all positions are specified in absolute coordinates. The coordinateType parameter can be set to specify positions in other coordinates.
When the coordinateType parameter is set to Absolute, positions are specified in absolute coordinates. This is the default configuration.
When the coordinateType parameter is set to RelativeFromStart, positions are specified relative to the starting position of the path. This is the position that the AddPathIntplWithRotationCommand function is first called when defining a new path.
When the coordinateType parameter is set to RelativeFromEnd, positions are specified relative to the end position of the path. This is the target position of the final segment added by the last call of the AddPathIntplWithRotationCommand function.
The positions affected by the coordinateType parameter include target, centerPos, zAxisTarget, and localCenterOfRotation.
Angle Correction
In the default configuration, the motion along the path will stop at the end of each segment and the angle of the rotational axis will be adjusted before motion along the path is continued. This angle correction motion is executed even if two segments connect in a straight line and the rotational axis does not need to be adjusted.
By setting the angleCorrectionMinimumAngle parameter, angle adjustments below this tolerance can be ignored and the motion along the path can continue to the next segment without stopping. If a nonzero angle adjustment is ignored this way, the rotational axis will move by the adjustment amount in one cycle (and the X and Y axes will also rotate around the center of rotation by that amount in one cycle).
This parameter can be set to a small nonzero value (such as 0.01 degrees) to prevent the motion along the path from stopping when two segments connect in a straight line. Even in this configuration, the motion along the path will stop after each segment unless enableConstProfile is set to 1 or the end velocity of the former segment is set to a nonzero value.
The motion profile used to move the rotational axis during angle correction motion is specified by the angleCorrectionProfile parameter.
Angle correction motion will never move the rotational axis by more than 180 degrees (the shorter direction will be taken).
Angle correction motion will also occur when executing a path interpolation with rotation for the first time after defining the path. The rotational axis will adjust to point in the direction of the first segment of the path before motion along the path begins. This angle correction motion will be executed regardless of the value of the angleCorrectionMinimumAngle.
The time used to execute angle correction motion is not counted for statuses such as Profile Total Milliseconds and Profile Remaining Milliseconds, and for output types such as RemainingTime and CompletedTime.
Local Center of Rotation
In the default configuration, the rotational axis continuously points in the direction of motion along the path. The enableLocalCenterOfRotation option can be set to 1 to define a point for each segment that the rotational axis will be perpendicular to while executing that segment.
The following figure shows an example of the rotational axis motion while executing a linear segment with a local center of rotation.

To define a local center of rotation for a segment, the useLocalCenterOfRotation parameter of that segment must be set to 1 (in addition to setting the enableLocalCenterOfRotation parameter for the entire path configuration to 1). The X and Y coordinates of the local center of rotation for the segment are specified in localCenterOfRotation.
For a given X and Y position and a local center of rotation, there are two perpendicular directions that the rotational axis could point. The localCenterOfRotationDirection parameter of a segment determines whether the rotational axis points in the counterclockwise or clockwise direction when seen from the local center of rotation. To point in the counterclockwise direction, specify 0 or 1 for this parameter. To point in the clockwise direction, specify -1 for this parameter.
The following figure shows an example of how the direction of the rotational axis is affected by localCenterOfRotationDirection.

The path may contain any combination of segments with different local centers of rotation and segments with no local center of rotation (for which the rotational axis points in the direction of the path). Angle correction will stop the motion along the path at any intersection between two segments where the rotational axis direction is not continuous, and then move the rotational angle before continuing motion along the path (the angleCorrectionMinimumAngle parameter can be set to modify this operation).
The following figure shows the motion of the rotational axis when enabling and disabling local center of rotation.

The following sample code executes a path interpolation with rotation sequence consisting of four linear interpolations with a different local center of rotation defined for each segment.
//Create the path interpolation with rotation buffer
wmxlib_AdvancedMotion->advMotion->CreatePathIntplWithRotationBuffer(0, 1000);
//Configure the path interpolation with rotation channel
AdvMotion::PathIntplWithRotationConfiguration conf;
conf.axis[0] = 0; //X axis
conf.axis[1] = 1; //Y axis
conf.rotationalAxis = 2; //Rotational axis
conf.centerOfRotation[0] = 500; //X axis center of rotation position
conf.centerOfRotation[1] = 500; //Y axis center of rotation position
//Rotational axis angle correction motion profile parameters
conf.angleCorrectionProfile.type = ProfileType::Trapezoidal;
conf.angleCorrectionProfile.velocity = 90;
conf.angleCorrectionProfile.acc = 180;
conf.angleCorrectionProfile.dec = 180;
//Enable local center of rotation
conf.enableLocalCenterOfRotation = 1;
wmxlib_AdvancedMotion->advMotion->SetPathIntplWithRotationConfiguration(0, &conf);
//Add the path interpolation with rotation commands
AdvMotion::PathIntplWithRotationCommand path;
path.numPoints = 4;
path.point[0].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[0].profile.type = ProfileType::Trapezoidal;
path.point[0].profile.velocity = 1000;
path.point[0].profile.acc = 2000;
path.point[0].profile.dec = 2000;
path.point[0].target[0] = 1000;
path.point[0].target[1] = 0;
path.point[0].useLocalCenterOfRotation = 1;
path.point[0].localCenterOfRotationDirection = 1;
path.point[0].localCenterOfRotation[0] = 500;
path.point[0].localCenterOfRotation[1] = 400;
path.point[1].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[1].profile.type = ProfileType::Trapezoidal;
path.point[1].profile.velocity = 1000;
path.point[1].profile.acc = 2000;
path.point[1].profile.dec = 2000;
path.point[1].target[0] = 1000;
path.point[1].target[1] = 1000;
path.point[1].useLocalCenterOfRotation = 1;
path.point[1].localCenterOfRotationDirection = 1;
path.point[1].localCenterOfRotation[0] = 600;
path.point[1].localCenterOfRotation[1] = 500;
path.point[2].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[2].profile.type = ProfileType::Trapezoidal;
path.point[2].profile.velocity = 1000;
path.point[2].profile.acc = 2000;
path.point[2].profile.dec = 2000;
path.point[2].target[0] = 0;
path.point[2].target[1] = 1000;
path.point[2].useLocalCenterOfRotation = 1;
path.point[2].localCenterOfRotationDirection = 1;
path.point[2].localCenterOfRotation[0] = 500;
path.point[2].localCenterOfRotation[1] = 600;
path.point[3].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[3].profile.type = ProfileType::Trapezoidal;
path.point[3].profile.velocity = 1000;
path.point[3].profile.acc = 2000;
path.point[3].profile.dec = 2000;
path.point[3].target[0] = 0;
path.point[3].target[1] = 0;
path.point[3].useLocalCenterOfRotation = 1;
path.point[3].localCenterOfRotationDirection = 1;
path.point[3].localCenterOfRotation[0] = 400;
path.point[3].localCenterOfRotation[1] = 500;
wmxlib_AdvancedMotion->advMotion->AddPathIntplWithRotationCommand(0, &path);
//Execute path interpolation with rotation
wmxlib_AdvancedMotion->advMotion->StartPathIntplWithRotation(0);
//Wait until the path interpolation with rotation is in Idle state
AdvMotion::PathIntplWithRotationStatus pathStatus;
wmxlib_AdvancedMotion->advMotion->GetPathIntplWithRotationStatus(0, &pathStatus);
while(pathStatus.state != AdvMotion::PathIntplWithRotationState::Idle) {
Sleep(10);
wmxlib_AdvancedMotion->advMotion->GetPathIntplWithRotationStatus(0, &pathStatus);
}
//Free the path interpolation with rotation buffer (normally, the buffer should only be freed at the end of the application)
wmxlib_AdvancedMotion->advMotion->FreePathIntplWithRotationBuffer(0);
The following plots show the two-dimensional trajectory of the X and Y axes, the positions of the X, Y, and rotational axes vs. time, and the velocities of the X, Y, and rotational axes vs. time. Both the case when the XY rotational motion is enabled and disabled (conf.disableXYRotationalMotion = 1; is added to the code) are plotted.
