Interpolation in Three to Six Dimensions

All path interpolation with look ahead functions are supported for three dimensional paths. Many path interpolation with look ahead functions are supported in up to six dimensions, but some core functions such as smoothing are only supported for three dimensional paths (smoothing is supported in a path with six dimensions, as long as only three dimensions are moved at any time).

Interpolation in Three Dimensions Example

The following sample code executes a three-dimensional path with an acceleration limit specified for each axis.

//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 = 3;
conf.axis[0] = 0;
conf.axis[1] = 1;
conf.axis[2] = 2;
conf.compositeVel = 1000;
conf.compositeAcc = 2000;
conf.sampleDistance = 10;
conf.accLimit[0] = 300;
conf.accLimit[1] = 600;
conf.accLimit[2] = 900;

wmxlib_AdvancedMotion->advMotion->SetPathIntplLookaheadConfiguration(0, &conf);

//Add the path interpolation with look ahead commands
AdvMotion::PathIntplLookaheadCommand path;

path.numPoints = 3;

path.point[0].type = AdvMotion::PathIntplLookaheadSegmentType::Linear;
path.point[0].data.linear.axisCount = 3;
path.point[0].data.linear.axis[0] = 0;
path.point[0].data.linear.axis[1] = 1;
path.point[0].data.linear.axis[2] = 2;
path.point[0].data.linear.target[0] = 400;
path.point[0].data.linear.target[1] = 600;
path.point[0].data.linear.target[2] = 700;
path.point[0].data.linear.smoothRadius = 300;

path.point[1].type = AdvMotion::PathIntplLookaheadSegmentType::Linear;
path.point[1].data.linear.axisCount = 3;
path.point[1].data.linear.axis[0] = 0;
path.point[1].data.linear.axis[1] = 1;
path.point[1].data.linear.axis[2] = 2;
path.point[1].data.linear.target[0] = 300;
path.point[1].data.linear.target[1] = 200;
path.point[1].data.linear.target[2] = 1200;
path.point[1].data.linear.smoothRadius = 300;

path.point[2].type = AdvMotion::PathIntplLookaheadSegmentType::Linear;
path.point[2].data.linear.axisCount = 3;
path.point[2].data.linear.axis[0] = 0;
path.point[2].data.linear.axis[1] = 1;
path.point[2].data.linear.axis[2] = 2;
path.point[2].data.linear.target[0] = 0;
path.point[2].data.linear.target[1] = 0;
path.point[2].data.linear.target[2] = 0;

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 position, velocity, and acceleration of each axis when the above sequence is executed from position (0, 0).

../_images/WMXDOC_FUNC_PLA_SEC1_image15.png

The acceleration plot shows that the acceleration is limited to 300 user units per second^2 for the first axis, 600 for the second axis, and 900 for the third axis.