Blending Override

The Blending interpolation override type will execute both the current interpolation and the override interpolation, and calculate the command position based on the combined motion of the two interpolations.

If the current interpolation and the override interpolation move in the same direction, the velocity may increase to up to the sum of the commanded velocities of the two interpolations.

This interpolation override type is shown in the following figure.

../_images/WMXDOC_FUNC_INT_OVERRIDE_image9.png

Blending Override Example

The following plots show the positions and velocities of a simple two-dimensional Blending type linear interpolation override. The first linear interpolation has a target position of (30000, 0), and the second linear interpolation has a target position of (30000, 30000).

../_images/WMXDOC_FUNC_INT_OVERRIDE_image0.png

Overridding an Interpolation with Longer Remaining Time

Blending type linear interpolation overrides will not start while the remaining time of the overridden interpolation is greater than the time taken to complete the override interpolation command.

The following code executes two linear interpolation commands without any delay between them, but the override linear interpolation is much shorter than the first linear interpolation. In this case, the override will start near the end of the first linear interpolation.

Motion::LinearIntplCommand lin;

lin.axisCount = 2;
lin.axis[0] = 0;
lin.axis[1] = 1;
        
lin.profile.type = ProfileType::Trapezoidal;
lin.profile.velocity = 10000;
lin.profile.acc = 10000;
lin.profile.dec = 10000;

lin.target[0] = 30000;
lin.target[1] = 0;
        
wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin);

lin.target[0] = 30000;
lin.target[1] = 5000;

wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin);

The following plots show the positions and velocities when the above code is executed.

../_images/WMXDOC_FUNC_INT_OVERRIDE_image1.png

Trigger Motion Interpolation Overrides

Trigger motion interpolations can be used to time the execution of the override command. The following code uses trigger motion to start the override interpolation when the remaining distance of the first linear interpolation is 5000.

Motion::LinearIntplCommand lin;
Trigger trig;

lin.axisCount = 2;
lin.axis[0] = 0;
lin.axis[1] = 1;
        
lin.profile.type = ProfileType::Trapezoidal;
lin.profile.velocity = 10000;
lin.profile.acc = 10000;
lin.profile.dec = 10000;

lin.target[0] = 30000;
lin.target[1] = 0;
        
wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin);

lin.target[0] = 30000;
lin.target[1] = 30000;

trig.triggerAxis = 0;
trig.triggerType = TriggerType::RemainingDistance;
trig.triggerValue = 5000;

wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin, &trig);

The following plots show the positions and velocities when the above code is executed.

../_images/WMXDOC_FUNC_INT_OVERRIDE_image2.png

Circular Interpolation Overrides

Circular interpolations, like linear interpolations, can override and be overridden by other linear or circular interpolations. The following code overrides a circular interpolation with another circular interpolation.

Motion::RadiusAndEndCircularIntplCommand cir;
Trigger trig;

cir.axis[0] = 0;
cir.axis[1] = 1;
        
cir.profile.type = ProfileType::Trapezoidal;
cir.profile.velocity = 10000;
cir.profile.acc = 10000;
cir.profile.dec = 10000;
        
cir.endPos[0] = 10000;
cir.endPos[1] = 0;

cir.radius = 5000;
cir.clockwise = 1;

wmxlib_CoreMotion->motion->StartCircularIntplPos(&cir);

cir.endPos[0] = 20000;
cir.endPos[1] = 0;

trig.triggerAxis = 0;
trig.triggerType = TriggerType::RemainingDistance;
trig.triggerValue = 5000;

wmxlib_CoreMotion->motion->StartCircularIntplPos(&cir, &trig);

The following plots show the positions and velocities when the above code is executed.

../_images/WMXDOC_FUNC_INT_OVERRIDE_image3.png

Timing When the Next Override is Possible

After executing an interpolation override, the next interpolation override cannot be executed until the original interpolation completes. To check whether another interpolation override can be executed, verify that the Detail Op State status is not Intpl_OverrideSetup or Intpl_OverrideSmoothing. Alternatively, verify that the Command Ready status is TRUE.

The following code checks the Command Ready status to execute a sequence of linear interpolation overrides. Note that all except the first linear interpolation are triggered linear interpolations, which means that the override timings are precise to the communication cycle, and are not affected by the timings at which the StartLinearIntplPos functions are called.

CoreMotionStatus st;
Motion::LinearIntplCommand lin;
Trigger trig;

lin.axisCount = 2;
lin.axis[0] = 0;
lin.axis[1] = 1;

lin.profile.type = ProfileType::Trapezoidal;
lin.profile.velocity = 10000;
lin.profile.acc = 10000;
lin.profile.dec = 10000;

lin.target[0] = 10000;
lin.target[1] = 10000;

wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin);

lin.target[0] = 20000;
lin.target[1] = 0;

trig.triggerAxis = 0;
trig.triggerType = TriggerType::RemainingDistance;
trig.triggerValue = 3000;

wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin, &trig);

//Wait until the first interpolation completes before setting trigger for third interpolation
do {
    wmxlib_CoreMotion->GetStatus(&st);
} while (st.axesStatus[0].commandReady == 0);

lin.target[0] = 30000;
lin.target[1] = 10000;

wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin, &trig);

//Wait until the second interpolation completes before setting trigger for fourth interpolation
do {
    wmxlib_CoreMotion->GetStatus(&st);
} while (st.axesStatus[0].commandReady == 0);

lin.target[0] = 40000;
lin.target[1] = 0;

wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin, &trig);

//Wait until the third interpolation completes before setting trigger for fifth interpolation
do {
    wmxlib_CoreMotion->GetStatus(&st);
} while (st.axesStatus[0].commandReady == 0);

lin.target[0] = 50000;
lin.target[1] = 10000;

wmxlib_CoreMotion->motion->StartLinearIntplPos(&lin, &trig);

The following plots show the positions and velocities when the above code is executed.

../_images/WMXDOC_FUNC_INT_OVERRIDE_image4.png