Velocity Acceleration Limited Spline

In this spline type, the velocity and acceleration limits of each commanded axis is specified using the VelAccLimitedSplineCommand class.

This spline type executes the spline trajectory as fast as possible while keeping the velocity and acceleration of each axis below the specified limits. This spline type works well with a wide range of point data.

The velocity acceleration limited spline requires the velocity and acceleration along the spline trajectory to be specified. In addition, the velocity limit, the acceleration limit, or both can be specified for each commanded axis.

As with profile type splines, the sampleMultiplier parameter can be increased to improve the accuracy and granularity of the generated velocity and acceleration profile. The sampleMultiplier should be especially increased for point data with a relatively small number of points and a large distance between points. Increasing the sampleMultiplier will not change the shape of the spline trajectory.

The following sample code executes the spline in the above example with axis 0 having a velocity limit of 4000 user units per second and an acceleration limit of 40000 user units per second^2 and axis 1 having a velocity limit of 3000 user units per second and an acceleration limit of 30000 user units per second^2.

//Create the spline channel buffer
wmxlib_AdvancedMotion->advMotion->CreateSplineBuffer(0, 200);
        
//Set the spline command options
AdvMotion::VelAccLimitedSplineCommand spl;

spl.dimensionCount = 2;
spl.axis[0] = 0;
spl.axis[1] = 1;
spl.velLimit[0] = 4000;
spl.velLimit[1] = 3000;
spl.accLimit[0] = 40000;
spl.accLimit[1] = 30000;
spl.compositeVel = 10000;
spl.compositeAcc = 100000;
spl.sampleMultiplier = 20;

//Set the spline point data
AdvMotion::SplinePoint pt[9];

pt[0].pos[0] = 0;
pt[0].pos[1] = 0;

pt[1].pos[0] = 1000;
pt[1].pos[1] = 0;

pt[2].pos[0] = 500;
pt[2].pos[1] = 500;

pt[3].pos[0] = 1000;
pt[3].pos[1] = 1000;

pt[4].pos[0] = 1000;
pt[4].pos[1] = 1500;

pt[5].pos[0] = 0;
pt[5].pos[1] = 1500;

pt[6].pos[0] = 0;
pt[6].pos[1] = 1000;

pt[7].pos[0] = 500;
pt[7].pos[1] = 500;

pt[8].pos[0] = 0;
pt[8].pos[1] = 0;

//Execute the spline command
wmxlib_AdvancedMotion->advMotion->StartCSplinePos(0, &spl, 9, pt);

//Wait for the spline motion to complete
AxisSelection axes;
axes.axisCount = 2;
axes.axis[0] = 0;
axes.axis[1] = 1;
wmxlib_CoreMotion->motion->Wait(&axes);

//Free the spline buffer (normally, the buffer should only be freed at the end of the application)
wmxlib_AdvancedMotion->advMotion->FreeSplineBuffer(0);

The following plots show the two-dimensional trajectory and the velocity and acceleration of each axis when the above sequence is executed from position (0, 0). The specified points are shown in the position plot using black dots.

../_images/WMXDOC_FUNC_SPL_SEC1_image5.png