Defining the Path Segments
The motion of a path interpolation with rotation is defined using linear and circular interpolation segments. The coordinates for the segments are defined using the X and Y axis positions when the rotational axis is at the starting position.
One method for obtaining the coordinates for the segments is to move the rotational axis to the starting position, and then move the X and Y axes to the start and end positions of each segment. If the X and Y axes cannot be physically moved to certain positions on the path without moving the rotational axis from the starting position, the coordinates should be calculated from the length of the segment and the direction that the X and Y axes move in while traversing that segment.
The starting position of the rotational axis is its position at the beginning of the path. After the path interpolation with rotation motion is executed, the rotational axis moves whenever there is a curve or corner along the path and the direction of travel (on the X-Y plane) changes.
Linear segments are simply defined by the target position of the segment. The starting position of a linear segment is set equal to the target position of the preceding segment (or the starting position if the linear segment is the first segment of the path).
Circular segments are defined by the target position of the segment, the center point of the circle, and the direction of rotation (counterclockwise or clockwise). If the positive X direction points right and the positive Y direction points up, the direction of rotation should be set to 0 or 1 for counterclockwise motion and -1 for clockwise motion.
Example of Path Segments
The following figure shows an example of coordinates collected along the path.

Following the above, the example coordinates are expressed in code as follows:
AdvMotion::PathIntplWithRotationCommand path;
path.numPoints = 8;
path.point[0].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[0].profile.type = ProfileType::Trapezoidal;
path.point[0].profile.velocity = 5;
path.point[0].profile.acc = 5;
path.point[0].profile.dec = 5;
path.point[0].target[0] = 15;
path.point[0].target[1] = 0;
path.point[1].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[1].profile.type = ProfileType::Trapezoidal;
path.point[1].profile.velocity = 5;
path.point[1].profile.acc = 5;
path.point[1].profile.dec = 5;
path.point[1].target[0] = 20;
path.point[1].target[1] = 5;
path.point[1].direction = 1;
path.point[1].centerPos[0] = 15;
path.point[1].centerPos[1] = 5;
path.point[2].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[2].profile.type = ProfileType::Trapezoidal;
path.point[2].profile.velocity = 5;
path.point[2].profile.acc = 5;
path.point[2].profile.dec = 5;
path.point[2].target[0] = 20;
path.point[2].target[1] = 15;
path.point[3].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[3].profile.type = ProfileType::Trapezoidal;
path.point[3].profile.velocity = 5;
path.point[3].profile.acc = 5;
path.point[3].profile.dec = 5;
path.point[3].target[0] = 15;
path.point[3].target[1] = 20;
path.point[3].direction = 1;
path.point[3].centerPos[0] = 15;
path.point[3].centerPos[1] = 15;
path.point[4].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[4].profile.type = ProfileType::Trapezoidal;
path.point[4].profile.velocity = 5;
path.point[4].profile.acc = 5;
path.point[4].profile.dec = 5;
path.point[4].target[0] = 5;
path.point[4].target[1] = 20;
path.point[5].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[5].profile.type = ProfileType::Trapezoidal;
path.point[5].profile.velocity = 5;
path.point[5].profile.acc = 5;
path.point[5].profile.dec = 5;
path.point[5].target[0] = 0;
path.point[5].target[1] = 15;
path.point[5].direction = 1;
path.point[5].centerPos[0] = 5;
path.point[5].centerPos[1] = 15;
path.point[6].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[6].profile.type = ProfileType::Trapezoidal;
path.point[6].profile.velocity = 5;
path.point[6].profile.acc = 5;
path.point[6].profile.dec = 5;
path.point[6].target[0] = 0;
path.point[6].target[1] = 5;
path.point[7].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[7].profile.type = ProfileType::Trapezoidal;
path.point[7].profile.velocity = 5;
path.point[7].profile.acc = 5;
path.point[7].profile.dec = 5;
path.point[7].target[0] = 5;
path.point[7].target[1] = 0;
path.point[7].direction = 1;
path.point[7].centerPos[0] = 5;
path.point[7].centerPos[1] = 5;
Clockwise Example
Because the example path starts and ends at the same point, the path can be traversed in the clockwise direction. If the motion is in the clockwise direction, the code changes as follows. Note the change in the direction parameter of the circular segments.

AdvMotion::PathIntplWithRotationCommand path;
path.numPoints = 8;
path.point[0].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[0].profile.type = ProfileType::Trapezoidal;
path.point[0].profile.velocity = 5;
path.point[0].profile.acc = 5;
path.point[0].profile.dec = 5;
path.point[0].target[0] = 0;
path.point[0].target[1] = 5;
path.point[0].direction = -1;
path.point[0].centerPos[0] = 5;
path.point[0].centerPos[1] = 5;
path.point[1].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[1].profile.type = ProfileType::Trapezoidal;
path.point[1].profile.velocity = 5;
path.point[1].profile.acc = 5;
path.point[1].profile.dec = 5;
path.point[1].target[0] = 0;
path.point[1].target[1] = 15;
path.point[2].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[2].profile.type = ProfileType::Trapezoidal;
path.point[2].profile.velocity = 5;
path.point[2].profile.acc = 5;
path.point[2].profile.dec = 5;
path.point[2].target[0] = 5;
path.point[2].target[1] = 20;
path.point[2].direction = -1;
path.point[2].centerPos[0] = 5;
path.point[2].centerPos[1] = 15;
path.point[3].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[3].profile.type = ProfileType::Trapezoidal;
path.point[3].profile.velocity = 5;
path.point[3].profile.acc = 5;
path.point[3].profile.dec = 5;
path.point[3].target[0] = 15;
path.point[3].target[1] = 20;
path.point[4].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[4].profile.type = ProfileType::Trapezoidal;
path.point[4].profile.velocity = 5;
path.point[4].profile.acc = 5;
path.point[4].profile.dec = 5;
path.point[4].target[0] = 20;
path.point[4].target[1] = 15;
path.point[4].direction = -1;
path.point[4].centerPos[0] = 15;
path.point[4].centerPos[1] = 15;
path.point[5].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[5].profile.type = ProfileType::Trapezoidal;
path.point[5].profile.velocity = 5;
path.point[5].profile.acc = 5;
path.point[5].profile.dec = 5;
path.point[5].target[0] = 20;
path.point[5].target[1] = 5;
path.point[6].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[6].profile.type = ProfileType::Trapezoidal;
path.point[6].profile.velocity = 5;
path.point[6].profile.acc = 5;
path.point[6].profile.dec = 5;
path.point[6].target[0] = 15;
path.point[6].target[1] = 0;
path.point[6].direction = -1;
path.point[6].centerPos[0] = 15;
path.point[6].centerPos[1] = 5;
path.point[7].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[7].profile.type = ProfileType::Trapezoidal;
path.point[7].profile.velocity = 5;
path.point[7].profile.acc = 5;
path.point[7].profile.dec = 5;
path.point[7].target[0] = 5;
path.point[7].target[1] = 0;
Direction of Rotation
The direction of rotation for circular segments should be reversed if the positive X direction points left or the positive Y direction points down, but not both. If the positive X direction points left and the positive Y direction points down, the direction of rotation can be the same as if the positive X direction points right and the positive Y direction points up.
For example, if the coordinates were as shown in the following figure, with the positive X direction pointing left, the direction of rotation for the counterclockwise circular segments should be set to -1 instead of 1.

Similarly, if the coordinates were as shown in the following figure, with the positive Y direction pointing down, the direction of rotation for the counterclockwise circular segments should be set to -1 instead of 1.
