Contoured Moves

NI-Motion

Contoured Moves

A contoured move moves an axis or a coordinate space of axes in a pattern that you define. The trajectory generator on the motion controller is not used during a contoured move. The controller takes position data in the form of an array, and splines the data before outputting it to the DACs or stepper outputs, as shown in the following figure.

Contoured moves are useful when you want to generate a trajectory that cannot be constructed from straight lines and arcs. To ensure that the motion is smooth with minimum jerk, the motion controller creates intermediate points using a cubic spline algorithm.

The move constraints commonly used to limit other types of moves, such as maximum velocity, maximum acceleration, maximum deceleration, and maximum jerk, have no effect on contoured moves. However, the NI Motion Assistant prototyping tool can remap a user-defined trajectory based on specified move constraints, preserving move characteristics and move geometry.

Contoured Move Algorithm

The following figure shows a generic contoured move algorithm applicable to both C/C++ and LabVIEW code.

All contoured moves are relative, meaning motion starts from the position of the axis or axes at the time the contouring move starts. This behavior is similar to the way arc moves work. Depending on the operation mode you use, you can load absolute positions in the array or relative positions, which imply incremental position differences between contouring points.

Absolute versus Relative Contouring

All positions in a contouring buffer are relative to the current position when starting. There is an assumed 0 point that the firmware adds to the front of the buffer of points. For example, if the contour buffer is [10, 20, 30, 40], the positions are [0, 10, 20, 30, 40] in the firmware.

When a contour move starts it takes a snap shot of the current position according to the following equation:

StartPosition = currentPosition.

The start position is added to each point in the buffer to get the actual position to move through according to the following equation:

Point = StartPosition + bufferPosition[n].

If the current position is 100, and the buffer is [10, 20, 30, 40], the contour move follows these points: [100, 110, 120, 130, 140].

The difference between absolute contouring and relative contouring is how the points in the buffer are treated. The previous example was of an absolute contour move. A relative contour move treats the points as deltas according to the following formula:

Point[n] = Point[n-1] + bufferPosition[n]

For a relative contour move that starts at position 100 and includes a buffer with the following values: [10, 20, 30, 40], the points the contour move follows are [100, 110, 130, 160, 200].

For contoured moves, no two consecutive points can differ by more than 215 – 1. For absolute position mode, the first position in the array passed to the controller must be less than 215 – 1, and any two consecutive points must be less than 215 – 1. For relative position mode, no point passed to the controller can be greater than 215 – 1.

Absolute versus Relative Contouring Example

If an axis starts at position 0 and uses either of the following sets of contouring points, the axis ends up at position 28. If the axis starts at position 10, it ends up at position 38 in both cases.

1 3 6 10 14 18 22 25 27 28

1 2 3 4 4 4 4 3 2 1