Constant Profile Mode
The motion profile of a path interpolation command can be specified once for the entire path or for each individual linear or circular segment in the path.
Specifying the Motion Profile for the Entire Path
If the enableConstProfile parameter is set to 1, the motion profile is specified for the entire path. The profile is specified in the first index of the profile array (values in other indices are ignored).
The advantage of this mode is that the velocity along the path is constant. In the other mode, the profile is recalculated at the beginning of each segment, so even if the same velocity is specified for each segment, the final velocity may slightly change throughout the path, especially during short segments (see Velocity Adjustment from Extra Pulses).
When the direction of the path suddenly changes (such as at the intersection of two linear interpolations), the velocities of the individual interpolating axes may suddenly change. To prevent this, the enableAutoSmooth parameter can be set to 1 to eliminate corners in the path (see Auto Smooth Mode ). Alternatively, circular interpolations can be manually added to connect two linear interpolations.
The following code executes a path interpolation with a single motion profile for the entire path.
AdvMotion::PathIntplCommand path;
path.axis[0] = 0;
path.axis[1] = 1;
//Specify one motion profile for entire path
path.enableConstProfile = 1;
//Define the motion profile
path.profile[0].type = ProfileType::Trapezoidal;
path.profile[0].velocity = 10000;
path.profile[0].acc = 10000;
path.profile[0].dec = 10000;
//Define linear and circular segments
path.numPoints = 8;
path.type[0] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][0] = 10000;
path.target[1][0] = 0;
path.type[1] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][1] = 15000;
path.target[1][1] = 5000;
path.centerPos[0][1] = 10000;
path.centerPos[1][1] = 5000;
path.direction[1] = 1;
path.type[2] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][2] = 15000;
path.target[1][2] = 10000;
path.type[3] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][3] = 10000;
path.target[1][3] = 15000;
path.centerPos[0][3] = 10000;
path.centerPos[1][3] = 10000;
path.direction[3] = 1;
path.type[4] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][4] = 0;
path.target[1][4] = 15000;
path.type[5] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][5] = -5000;
path.target[1][5] = 10000;
path.centerPos[0][5] = 0;
path.centerPos[1][5] = 10000;
path.direction[5] = 1;
path.type[6] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][6] = -5000;
path.target[1][6] = 5000;
path.type[7] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][7] = 0;
path.target[1][7] = 0;
path.centerPos[0][7] = 0;
path.centerPos[1][7] = 5000;
path.direction[7] = 1;
wmxlib_AdvancedMotion->advMotion->StartPathIntplPos(&path);
The following plots show the positions and velocities when the above code is executed.

Specifying the Motion Profile for Each Segment
If the enableConstProfile parameter is set to 0, the motion profile is specified for each individual linear or circular segment. The profile for each segment is specified in the profile array. The advantage of this mode is that the velocity (and other profile parameters) can be adjusted for parts of the path.
The following code executes a path interpolation with a different velocity for each segment.
AdvMotion::PathIntplCommand path;
path.axis[0] = 0;
path.axis[1] = 1;
//Specify motion profile for each segment
path.enableConstProfile = 0;
//Define linear and circular segments
path.numPoints = 8;
path.type[0] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][0] = 10000;
path.target[1][0] = 0;
path.profile[0].type = ProfileType::Trapezoidal;
path.profile[0].velocity = 10000;
path.profile[0].acc = 10000;
path.profile[0].dec = 10000;
path.type[1] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][1] = 15000;
path.target[1][1] = 5000;
path.centerPos[0][1] = 10000;
path.centerPos[1][1] = 5000;
path.direction[1] = 1;
path.profile[1].type = ProfileType::Trapezoidal;
path.profile[1].velocity = 9000;
path.profile[1].acc = 10000;
path.profile[1].dec = 10000;
path.type[2] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][2] = 15000;
path.target[1][2] = 10000;
path.profile[2].type = ProfileType::Trapezoidal;
path.profile[2].velocity = 8000;
path.profile[2].acc = 10000;
path.profile[2].dec = 10000;
path.type[3] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][3] = 10000;
path.target[1][3] = 15000;
path.centerPos[0][3] = 10000;
path.centerPos[1][3] = 10000;
path.direction[3] = 1;
path.profile[3].type = ProfileType::Trapezoidal;
path.profile[3].velocity = 7000;
path.profile[3].acc = 10000;
path.profile[3].dec = 10000;
path.type[4] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][4] = 0;
path.target[1][4] = 15000;
path.profile[4].type = ProfileType::Trapezoidal;
path.profile[4].velocity = 6000;
path.profile[4].acc = 10000;
path.profile[4].dec = 10000;
path.type[5] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][5] = -5000;
path.target[1][5] = 10000;
path.centerPos[0][5] = 0;
path.centerPos[1][5] = 10000;
path.direction[5] = 1;
path.profile[5].type = ProfileType::Trapezoidal;
path.profile[5].velocity = 7000;
path.profile[5].acc = 10000;
path.profile[5].dec = 10000;
path.type[6] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][6] = -5000;
path.target[1][6] = 5000;
path.profile[6].type = ProfileType::Trapezoidal;
path.profile[6].velocity = 8000;
path.profile[6].acc = 10000;
path.profile[6].dec = 10000;
path.type[7] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][7] = 0;
path.target[1][7] = 0;
path.centerPos[0][7] = 0;
path.centerPos[1][7] = 5000;
path.direction[7] = 1;
path.profile[7].type = ProfileType::Trapezoidal;
path.profile[7].velocity = 9000;
path.profile[7].acc = 10000;
path.profile[7].dec = 10000;
wmxlib_AdvancedMotion->advMotion->StartPathIntplPos(&path);
The following plots show the positions and velocities when the above code is executed.

Setting the Segment End Velocity
Even if the enableConstProfile parameter is set to 0, it is possible to execute the path without dropping the velocity to 0 at the end of each segment. To do so, for each segment except the last segment, set the end velocity equal to the profile velocity.
The following code executes a path interpolation that does not drop the velocity to 0 at the end of each segment.
AdvMotion::PathIntplCommand path;
path.axis[0] = 0;
path.axis[1] = 1;
//Specify motion profile for each segment
path.enableConstProfile = 0;
//Define linear and circular segments
path.numPoints = 8;
path.type[0] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][0] = 10000;
path.target[1][0] = 0;
path.profile[0].type = ProfileType::Trapezoidal;
path.profile[0].velocity = 10000;
path.profile[0].acc = 10000;
path.profile[0].dec = 10000;
path.profile[0].endVelocity = 10000;
path.type[1] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][1] = 15000;
path.target[1][1] = 5000;
path.centerPos[0][1] = 10000;
path.centerPos[1][1] = 5000;
path.direction[1] = 1;
path.profile[1].type = ProfileType::Trapezoidal;
path.profile[1].velocity = 9000;
path.profile[1].acc = 10000;
path.profile[1].dec = 10000;
path.profile[1].endVelocity = 9000;
path.type[2] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][2] = 15000;
path.target[1][2] = 10000;
path.profile[2].type = ProfileType::Trapezoidal;
path.profile[2].velocity = 8000;
path.profile[2].acc = 10000;
path.profile[2].dec = 10000;
path.profile[2].endVelocity = 8000;
path.type[3] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][3] = 10000;
path.target[1][3] = 15000;
path.centerPos[0][3] = 10000;
path.centerPos[1][3] = 10000;
path.direction[3] = 1;
path.profile[3].type = ProfileType::Trapezoidal;
path.profile[3].velocity = 7000;
path.profile[3].acc = 10000;
path.profile[3].dec = 10000;
path.profile[3].endVelocity = 7000;
path.type[4] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][4] = 0;
path.target[1][4] = 15000;
path.profile[4].type = ProfileType::Trapezoidal;
path.profile[4].velocity = 6000;
path.profile[4].acc = 10000;
path.profile[4].dec = 10000;
path.profile[4].endVelocity = 6000;
path.type[5] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][5] = -5000;
path.target[1][5] = 10000;
path.centerPos[0][5] = 0;
path.centerPos[1][5] = 10000;
path.direction[5] = 1;
path.profile[5].type = ProfileType::Trapezoidal;
path.profile[5].velocity = 7000;
path.profile[5].acc = 10000;
path.profile[5].dec = 10000;
path.profile[5].endVelocity = 7000;
path.type[6] = AdvMotion::PathIntplSegmentType::Linear;
path.target[0][6] = -5000;
path.target[1][6] = 5000;
path.profile[6].type = ProfileType::Trapezoidal;
path.profile[6].velocity = 8000;
path.profile[6].acc = 10000;
path.profile[6].dec = 10000;
path.profile[6].endVelocity = 8000;
path.type[7] = AdvMotion::PathIntplSegmentType::Circular;
path.target[0][7] = 0;
path.target[1][7] = 0;
path.centerPos[0][7] = 0;
path.centerPos[1][7] = 5000;
path.direction[7] = 1;
path.profile[7].type = ProfileType::Trapezoidal;
path.profile[7].velocity = 9000;
path.profile[7].acc = 10000;
path.profile[7].dec = 10000;
wmxlib_AdvancedMotion->advMotion->StartPathIntplPos(&path);
The following plots show the positions and velocities when the above code is executed.
