Circular Interpolation Commands

Circular interpolation commands can be added to the path like linear interpolation commands.

There are five supported methods of defining circular interpolation commands in two dimensions (CenterAndLengthCircular, CenterAndEndCircular, ThroughAndEndCircular, LengthAndEndCircular, and RadiusAndEndCircular ), and one supported method of defining circular interpolation commands in three dimensions (ThroughAndEnd3DCircular).

Path with Circular Interpolation Example

The following sample code executes a path interpolation containing circular interpolations.

//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 = 4000;
conf.sampleDistance = 50;

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::ThroughAndEndCircular;
path.point[0].data.throughAndEndCircular.axis[0] = 0;
path.point[0].data.throughAndEndCircular.axis[1] = 1;
path.point[0].data.throughAndEndCircular.throughPos[0] = 500;
path.point[0].data.throughAndEndCircular.throughPos[1] = 500;
path.point[0].data.throughAndEndCircular.endPos[0] = 1000;
path.point[0].data.throughAndEndCircular.endPos[1] = 0;

path.point[1].type = AdvMotion::PathIntplLookaheadSegmentType::ThroughAndEndCircular;
path.point[1].data.throughAndEndCircular.axis[0] = 0;
path.point[1].data.throughAndEndCircular.axis[1] = 1;
path.point[1].data.throughAndEndCircular.throughPos[0] = 500;
path.point[1].data.throughAndEndCircular.throughPos[1] = -500;
path.point[1].data.throughAndEndCircular.endPos[0] = 0;
path.point[1].data.throughAndEndCircular.endPos[1] = 0;

path.point[2].type = AdvMotion::PathIntplLookaheadSegmentType::ThroughAndEndCircular;
path.point[2].data.throughAndEndCircular.axis[0] = 0;
path.point[2].data.throughAndEndCircular.axis[1] = 1;
path.point[2].data.throughAndEndCircular.throughPos[0] = -500;
path.point[2].data.throughAndEndCircular.throughPos[1] = 500;
path.point[2].data.throughAndEndCircular.endPos[0] = -1000;
path.point[2].data.throughAndEndCircular.endPos[1] = 0;

path.point[3].type = AdvMotion::PathIntplLookaheadSegmentType::ThroughAndEndCircular;
path.point[3].data.throughAndEndCircular.axis[0] = 0;
path.point[3].data.throughAndEndCircular.axis[1] = 1;
path.point[3].data.throughAndEndCircular.throughPos[0] = -500;
path.point[3].data.throughAndEndCircular.throughPos[1] = -500;
path.point[3].data.throughAndEndCircular.endPos[0] = 0;
path.point[3].data.throughAndEndCircular.endPos[1] = 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 two-dimensional trajectory and the velocity of each axis when the above sequence is executed from position (0, 0).

../_images/WMXDOC_FUNC_PLA_SEC1_image9.png

Parameters for Circular Interpolation

All PathIntplLookaheadConfiguration parameters that affect linear interpolation commands also affect circular interpolation commands. (The smoothRadius only affects linear interpolations.)

The following sample code executes the same path interpolation, but with the velocityLimit of axis 1 set to 500 user units per second.

//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 = 4000;
conf.sampleDistance = 50;
conf.velocityLimit[1] = 500;

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::ThroughAndEndCircular;
path.point[0].data.throughAndEndCircular.axis[0] = 0;
path.point[0].data.throughAndEndCircular.axis[1] = 1;
path.point[0].data.throughAndEndCircular.throughPos[0] = 500;
path.point[0].data.throughAndEndCircular.throughPos[1] = 500;
path.point[0].data.throughAndEndCircular.endPos[0] = 1000;
path.point[0].data.throughAndEndCircular.endPos[1] = 0;

path.point[1].type = AdvMotion::PathIntplLookaheadSegmentType::ThroughAndEndCircular;
path.point[1].data.throughAndEndCircular.axis[0] = 0;
path.point[1].data.throughAndEndCircular.axis[1] = 1;
path.point[1].data.throughAndEndCircular.throughPos[0] = 500;
path.point[1].data.throughAndEndCircular.throughPos[1] = -500;
path.point[1].data.throughAndEndCircular.endPos[0] = 0;
path.point[1].data.throughAndEndCircular.endPos[1] = 0;

path.point[2].type = AdvMotion::PathIntplLookaheadSegmentType::ThroughAndEndCircular;
path.point[2].data.throughAndEndCircular.axis[0] = 0;
path.point[2].data.throughAndEndCircular.axis[1] = 1;
path.point[2].data.throughAndEndCircular.throughPos[0] = -500;
path.point[2].data.throughAndEndCircular.throughPos[1] = 500;
path.point[2].data.throughAndEndCircular.endPos[0] = -1000;
path.point[2].data.throughAndEndCircular.endPos[1] = 0;

path.point[3].type = AdvMotion::PathIntplLookaheadSegmentType::ThroughAndEndCircular;
path.point[3].data.throughAndEndCircular.axis[0] = 0;
path.point[3].data.throughAndEndCircular.axis[1] = 1;
path.point[3].data.throughAndEndCircular.throughPos[0] = -500;
path.point[3].data.throughAndEndCircular.throughPos[1] = -500;
path.point[3].data.throughAndEndCircular.endPos[0] = 0;
path.point[3].data.throughAndEndCircular.endPos[1] = 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 two-dimensional trajectory and the velocity of each axis when the above sequence is executed from position (0, 0).

../_images/WMXDOC_FUNC_PLA_SEC1_image10.png