Velocities for Each Segment
Normally, the composite velocity along the entire path is set using the compositeVel parameter passed to SetPathIntplLookaheadConfiguration. This composite velocity can be overridden for part of the path so that the velocity is faster or slower when executing that part of the path. (The compositeVel parameter must be set to a nonzero value, even if the composite velocity will be overridden in every segment of the path.)
To override the composite velocity for a particular segment, set the setSegmentCompositeVel parameter of that segment to TRUE, and segmentCompositeVel to the override composite velocity value. Note that this is the composite velocity along the path, and not the individual velocities of any interpolating axis.
The actual velocity along the path may be lower than the specified value due to adjustment from factors such as the velocityLimit or accLimit of each axis.
The composite velocity will also be overridden for any smoothing segment that immediately follows.
Segment Velocity Example
The following sample code executes a path with composite velocities that are overridden in each segment.
//Create the path interpolation with look ahead buffer
wmxlib_AdvancedMotion->advMotion->CreatePathIntplLookaheadBuffer(0, 1000);
//Configure the path interpolation with look ahead channel
AdvMotion::PathIntplLookaheadConfiguration conf;
conf.axisCount = 2;
conf.axis[0] = 0;
conf.axis[1] = 1;
conf.compositeVel = 1000;
conf.compositeAcc = 2000;
conf.sampleDistance = 100;
wmxlib_AdvancedMotion->advMotion->SetPathIntplLookaheadConfiguration(0, &conf);
//Add the path interpolation with look ahead commands
AdvMotion::PathIntplLookaheadCommand path;
path.numPoints = 4;
path.point[0].type = AdvMotion::PathIntplLookaheadSegmentType::Linear;
path.point[0].data.linear.axisCount = 2;
path.point[0].data.linear.axis[0] = 0;
path.point[0].data.linear.axis[1] = 1;
path.point[0].data.linear.target[0] = 1000;
path.point[0].data.linear.target[1] = 0;
path.point[0].data.linear.smoothRadius = 300;
path.point[0].data.linear.setSegmentCompositeVel = 1;
path.point[0].data.linear.segmentCompositeVel = 900;
path.point[1].type = AdvMotion::PathIntplLookaheadSegmentType::Linear;
path.point[1].data.linear.axisCount = 2;
path.point[1].data.linear.axis[0] = 0;
path.point[1].data.linear.axis[1] = 1;
path.point[1].data.linear.target[0] = 1000;
path.point[1].data.linear.target[1] = 1000;
path.point[1].data.linear.smoothRadius = 300;
path.point[1].data.linear.setSegmentCompositeVel = 1;
path.point[1].data.linear.segmentCompositeVel = 700;
path.point[2].type = AdvMotion::PathIntplLookaheadSegmentType::Linear;
path.point[2].data.linear.axisCount = 2;
path.point[2].data.linear.axis[0] = 0;
path.point[2].data.linear.axis[1] = 1;
path.point[2].data.linear.target[0] = 0;
path.point[2].data.linear.target[1] = 1000;
path.point[2].data.linear.smoothRadius = 300;
path.point[2].data.linear.setSegmentCompositeVel = 1;
path.point[2].data.linear.segmentCompositeVel = 500;
path.point[3].type = AdvMotion::PathIntplLookaheadSegmentType::Linear;
path.point[3].data.linear.axisCount = 2;
path.point[3].data.linear.axis[0] = 0;
path.point[3].data.linear.axis[1] = 1;
path.point[3].data.linear.target[0] = 0;
path.point[3].data.linear.target[1] = 0;
path.point[3].data.linear.setSegmentCompositeVel = 1;
path.point[3].data.linear.segmentCompositeVel = 300;
wmxlib_AdvancedMotion->advMotion->AddPathIntplLookaheadCommand(0, &path);
//Execute path interpolation with look ahead
wmxlib_AdvancedMotion->advMotion->StartPathIntplLookahead(0);
//Wait for the path interpolation with look ahead to complete
AdvMotion::PathIntplLookaheadStatus pathStatus;
wmxlib_AdvancedMotion->advMotion->GetPathIntplLookaheadStatus(0, &pathStatus);
while(pathStatus.remainCommandCount > 0) {
Sleep(10);
wmxlib_AdvancedMotion->advMotion->GetPathIntplLookaheadStatus(0, &pathStatus);
}
//Move the axes to Idle state
wmxlib_AdvancedMotion->advMotion->StopPathIntplLookahead(0);
//Wait until the path interpolation with look ahead is in Stopped state
wmxlib_AdvancedMotion->advMotion->GetPathIntplLookaheadStatus(0, &pathStatus);
while(pathStatus.state != AdvMotion::PathIntplLookaheadState::Stopped) {
Sleep(10);
wmxlib_AdvancedMotion->advMotion->GetPathIntplLookaheadStatus(0, &pathStatus);
}
//Free the path interpolation with look ahead buffer (normally, the buffer should only be freed at the end of the application)
wmxlib_AdvancedMotion->advMotion->FreePathIntplLookaheadBuffer(0);
The following plots show the two-dimensional trajectory and the velocity of each axis when the above sequence is executed from position (0, 0).

The composite velocity along the path is adjusted to 900 user units per second for the first segment, 700 for the second, 500 for the third, and 300 for the fourth.