Z Axis Parameters
The Z axis is an additional axis that may be optionally commanded in a path interpolation with rotation sequence. Compared to the X and Y axes, the Z axis will only linearly interpolate with the motion along the path and is not affected by the motion of the rotational axis.
The following figure shows an example mechanism including a Z axis.

Enabling the Z Axis
To enable the Z axis, set the enableZAxis parameter to 1. The axis number of the Z axis is specified with the zAxis parameter. By default, the Z axis is disabled and these parameters do not need to be set if the Z axis will not be used.
When the Z axis is enabled, each segment point must have a Z axis target position specified in zAxisTarget.
The profile parameters (velocity, acceleration, etc.) specified for the path interpolation with rotation apply to the motion in the XY plane. These profile parameters do not affect the motion of the Z axis.
The following sample code executes a path containing linear and circular segments and with the Z axis enabled. Constant profile mode is enabled to travel along the path at a constant velocity and allow changes to the Z axis velocity to become easier to see.
//Create the path interpolation with rotation buffer
wmxlib_AdvancedMotion->advMotion->CreatePathIntplWithRotationBuffer(0, 1000);
//Configure the path interpolation with rotation channel
AdvMotion::PathIntplWithRotationConfiguration conf;
conf.axis[0] = 0; //X axis
conf.axis[1] = 1; //Y axis
conf.rotationalAxis = 2; //Rotational axis
conf.centerOfRotation[0] = 750; //X axis center of rotation position
conf.centerOfRotation[1] = 750; //Y axis center of rotation position
conf.enableConstProfile = 1; //Enable constant profile
conf.angleCorrectionMinimumAngle = 0.01; //Prevent stop from occurring at very small angles
conf.enableZAxis = 1; //Enable Z axis
conf.zAxis = 3; //Z axis
//Rotational axis angle correction motion profile parameters
conf.angleCorrectionProfile.type = ProfileType::Trapezoidal;
conf.angleCorrectionProfile.velocity = 90;
conf.angleCorrectionProfile.acc = 180;
conf.angleCorrectionProfile.dec = 180;
wmxlib_AdvancedMotion->advMotion->SetPathIntplWithRotationConfiguration(0, &conf);
//Add the path interpolation with rotation commands
AdvMotion::PathIntplWithRotationCommand path;
path.numPoints = 7;
path.point[0].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[0].profile.type = ProfileType::Trapezoidal;
path.point[0].profile.velocity = 1000;
path.point[0].profile.acc = 2000;
path.point[0].profile.dec = 2000;
path.point[0].target[0] = 1000;
path.point[0].target[1] = 0;
path.point[0].zAxisTarget = 250;
path.point[1].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[1].direction = 1;
path.point[1].centerPos[0] = 1000;
path.point[1].centerPos[1] = 500;
path.point[1].target[0] = 1500;
path.point[1].target[1] = 500;
path.point[1].zAxisTarget = 500;
path.point[2].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[2].target[0] = 1500;
path.point[2].target[1] = 1000;
path.point[2].zAxisTarget = 750;
path.point[3].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[3].direction = 1;
path.point[3].centerPos[0] = 1000;
path.point[3].centerPos[1] = 1000;
path.point[3].target[0] = 1000;
path.point[3].target[1] = 1500;
path.point[3].zAxisTarget = 1000;
path.point[4].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[4].target[0] = 500;
path.point[4].target[1] = 1500;
path.point[4].zAxisTarget = 1250;
path.point[5].type = AdvMotion::PathIntplSegmentType::Circular;
path.point[5].direction = 1;
path.point[5].centerPos[0] = 500;
path.point[5].centerPos[1] = 1000;
path.point[5].target[0] = 0;
path.point[5].target[1] = 1000;
path.point[5].zAxisTarget = 1500;
path.point[6].type = AdvMotion::PathIntplSegmentType::Linear;
path.point[6].target[0] = 0;
path.point[6].target[1] = 0;
path.point[6].zAxisTarget = 1750;
wmxlib_AdvancedMotion->advMotion->AddPathIntplWithRotationCommand(0, &path);
//Execute path interpolation with rotation
wmxlib_AdvancedMotion->advMotion->StartPathIntplWithRotation(0);
//Wait until the path interpolation with rotation is in Idle state
AdvMotion::PathIntplWithRotationStatus pathStatus;
wmxlib_AdvancedMotion->advMotion->GetPathIntplWithRotationStatus(0, &pathStatus);
while(pathStatus.state != AdvMotion::PathIntplWithRotationState::Idle) {
Sleep(10);
wmxlib_AdvancedMotion->advMotion->GetPathIntplWithRotationStatus(0, &pathStatus);
}
//Free the path interpolation with rotation buffer (normally, the buffer should only be freed at the end of the application)
wmxlib_AdvancedMotion->advMotion->FreePathIntplWithRotationBuffer(0);
The following plots show the two-dimensional trajectory of the X and Y axes, the positions of the X, Y, Z, and rotational axes vs. time, and the velocities of the X, Y, Z, and rotational axes vs. time. Both the case when the XY rotational motion is enabled and disabled (conf.disableXYRotationalMotion = 1; is added to the code) are plotted.

Z Axis with Auto Smoothing
When enableAutoSmooth is set, parts of linear segments in the path may be replaced by cirular segments. If this occurs, the Z axis will interpolate over the shortened linear segment and will not move while executing the circular segment.