APIs, concepts, guides, and more
PT Streaming Motion

PT motion is the simplest streaming motion requiring only Positions and Time deltas arrays.

🔹 What is PT Motion?

PT motion is the simplest streaming motion to use because it only requires an array of Positions and Time deltas. The controller is responsible for figuring out the velocity, and acceleration for each motion segment. MovePT currently supports two types of interpolation: SimplePT and BSpline. Other types of motion interpolation are Bessel, Spline, and BSpline2 which can be added by request.

Simple PT Interpolation Output Example

The PT algorithm is good for very closely spaced points or low accelerations. It is a very simple algorithm, requiring very few calculations; therefore, it is fast. It works well with low performance motion systems. If the points are spaced too far apart, the motion will be rough like shown in the example below. The acceleration between each point is instantaneous. It is best to keep the point spacing within a few samples.

Trapezoidal move example:

p1[0] = 050; t1[0] = 1.0;

p1[1] = 400; t1[1] = 3.5;

p1[2] = 450; t1[2] = 1.0;

Note: The Position array is direction sensitive meaning you must put a (-) sign on negative numbers.

BSpline Interpolation Output Example

BSpline is an interpolation is our recommended technique to blend transitions between segments. Use BSpline for smooth paths or systems with poor acceleration response.

Trapezoidal move example:

p[0] = 050; t[0] = 1.0;

p[1] = 400; t[1] = 3.5;

p[2] = 450; t[2] = 1.0;

Note: The Position array is direction sensitive meaning you must put a (-) sign on negative numbers.

🔹 MultiAxis PT Motion

All motion streaming methods can be used for coordinated motion on multiaxis objects. It is important that you setup your arrays appropriately for a multiaxis object. See the examples below on how to structure your arrays for Multi-Axis PT Motion.

Example 1: Three Axis Multi-Axis XYZ with MovePT

The position data for all three axes are combined into the array. The time array is shared for all axes. This is why you need 3x as many position points than you need time points. See the example below:

p[0] = 050; t[0] = 1;
p[1] = 025;
p[2] = 012.5;

p[3] = 400; t[1] = 3.5;
p[4] = 200;
p[5] = 100;

p[6] = 450; t[2] = 1;
p[7] = 225;
p[8] = 112.5;

1st Segment 2nd Segment 3rd Segment Resulting Motion Plot
AxisX p[0] = 050;
[0] = 1;
p[2] = 400;
t[1] = 3.5;
p[4] = 450;
t[2] = 1;
Image
AxisY p[1] = 025;
t[0] = 1;
p[3] = 200;
t[1] = 3.5;
p[5] = 225;
t[2] = 1;
Image
AxisZ p[2] = 012.5;
t[0] = 1;
p[5] = 100;
t[1] = 3.5;
p[8] = 112.5;
t[2] = 1;
Image

📜 Sample Code

Basic Streaming PT Motion

  • C#

    int points = 3; // Specify the total number of streamed points.
    int emptyCount = 2; // E-stop generated if there are this number or fewer frames loaded. (Typically for PT motion there are two frames per PT point)
    double[] positions = { 1.0, 0.5, 0.75 }; // Specify the positions that you want to reach. (it can be n number)
    double[] times = { 0.2, 0.3, 0.1 }; // Specify the times in which you want to reach each position. (velocity and acceleration is calculated by the RMP)
    axis.MovePT(RSIMotionType.RSIMotionTypePT, // Specify the type of PT Motion that you want to perform. (RSIMotionType.RSIMotionTypePT, RSIMotionType.RSIMotionTypeBSPLINE, RSIMotionType.RSIMotionTypeBSPLINE2)
    positions, // Specify the positions that you want to reach. (it can be n number)
    times, // Specify the times in which you want to reach each position. (velocity and acceleration is calculated by the RMP)
    points, // Specify the total number of streamed points.
    emptyCount, // E-stop generated if there are this number or fewer frames loaded. (Typically for PT motion there are two frames per PT point)
    false, // Specify whether points are kept, or are not kept.
    true); // Specify if this is the last MovePT. (If True, this is the final point. If False, more points expected.)
    axis.MotionDoneWait(); // Wait for motion to be completed.

Stopping Streaming PT Motion

This code demonstrates that different actions that you can take after stopping a PT Streaming motion.

  • C#

    const int points = 3; // Specify how many points per streaming motion method call.
    const int emptyCount = 2; // E-stop generated if there aren't at least this many points loaded.
    double[] first = { 0.1, 0.2, 0.3 }; // specify the array with position(s) that will go in the first MovePT call.
    double[] second = { 0.4, 0.5, 0.6 }; // specify the array with position(s) that will go in the second MovePT call
    double[] third = { 0.7, 0.8, 0.9 }; // specify the array with position(s) that will go in the third MovePT call
    double[] time1 = { 0.3, 0.3, 0.3 }; // specify the array with time(s) that will go in the first MovePT call.
    double[] time2 = { 0.2, 0.2, 0.2 }; // specify the array with time(s) that will go in the second MovePT call.
    double[] time3 = { 0.25, 0.25, 0.25 }; // specify the array with time(s) that will go in the third MovePT call.
    axis.MovePT(RSIMotionType.RSIMotionTypePT, first, time1, points, emptyCount, false, false); // Start motion and stream a point.
    axis.MovePT(RSIMotionType.RSIMotionTypePT, second, time2, points, emptyCount, false, false); // Append a point.
    // After you Stop() a streaming motion, you can do 2 things.
    // 1. You can either RESUME motion and continue to append.
    // 2. Or you can DISCARD the points before the stop and start new motion.
    axis.Stop(); // Calling Stop() after streaming motion will put you in an STOPPED state.
    //axis.EStop(); // Calling EStop() after streaming motion will put you in an ERROR state.
    // Therefore, you must ClearFaults() before taking any action.
    //axis.Abort(); // Calling Abort() after streaming motion will put you in an ERROR state and trigger an AmpEnable(false).
    // Therefore, you must call AmpEnable(true) before taking action.
    axis.MotionDoneWait(); // Wait for axis to come to a stop.
    axis.Resume(); // Resume() is the key here.
    // If you include Resume() you will append all next streaming points to the old ones.
    // If you do not include Resume() you will discard all previous points and start with new motion with the new points.
    axis.MovePT(RSIMotionType.RSIMotionTypePT, third, time3, points, emptyCount, false, true); // Depending on whether you include Resume() or not this point will be appended or will be starting motion.