Linear Interpolation – Related TML Instructions and Data

Parameters

MASTERIDContains the axis ID of the host/master where the motion controller must send the messages related to segment buffer. It must be set before starting the Linear Interpolation mode. The MASTERID value must be set as: host ID << 4 + 1, where host ID is a number between 1 and 255 representing the host ID. By default, after power-on the host ID is set equal with the drive address causing all the messages to be sent via RS-232
SEGBUFBEGINSpecifies the start address of the segment buffer
SEGBUFLENSpecifies the segment buffer length expressed in segments

RESRATIOX, RESRATIOY, RESRATIONZ Defines the position feedback resolution for each axis. The motion controller will use the best resolution for computing the segments in PVT points.

VSPD – vector speed for current segment. Measured in speed units

VACC – vector acceleration for current segment. Measured in acceleration units

 

 

Variables

SEGBUFSTS        Contains the status of segment buffer.

SEGBUFSTS bit description

SEGBUFSTSDescription

MACOMMANDLinear Interpolation operation mode as was set with the SETMODE command
VTPOSVector target load position – position reference computed by the reference generator at each slow loop sampling period. Measured in position units

 

Instructions

SETMODE        value        Set Linear Interpolation operation as specified by value:

Linear Interpolation operation mode (a copy of value is saved in the TML variable MACOMMAND)

SETMODEdescription

LPLANE        (X_axis, Y_axis, Z_axis) Set the coordinate system for 2D/3D move.

MODE LI        Set Linear Interpolation motion mode.

LPOS1 (X_inc, Y_inc, Z_inc) LPOS2 (X_inc, Y_inc, Z_inc) Describes a linear segment.

UPD        Update motion parameters and start new motion mode

STOP        Stop the motion

Remarks:

When a sequence of segments is executed from a TML program they are processed one after the other, until the segment buffer fills up. At this point the TML program stops until the buffer starts to empty. Therefore, the next segment is processed in the cadence of the segments execution. At the end of the sequence, the buffer starts to empty and next TML instructions start to execute. This may lead to incorrect operation if for example a new motion mode is set while there are still segments in the buffer waiting to be executed. In order to avoid this situation, it is mandatory to end the segments sequence with an event on motion complete and wait until this event occurs.
The motion complete event is set when all the slave axes signal the end of their movement.

 

Programming Example

// Linear Interpolation sequence executed from non-volatile

// memory of the drive. All slave execute a linear movement and

// have the feedback resolution identical (2000 counts/rev)

 SETMODE 0xCF00; //Clear buffer

 LPLANE (A, B, D); //Axes A, B and D define the coordinate

//system of the movement

 RESRATIOX=0u;        // All axes have the same feedback resolution

 RESRATIOY=0u;        // therefore the resolution ratio is 0

 RESRATIOZ=0u;

 MODE LI; // Set Linear Interpolation Mode

 VACC = 0.0002; // Vector Acceleration = 0.5[m/s^2]

 VSPD = 1.2732; // Vector Speed = 4[m/s]

 // Increment position with (X, Y, Z) = (1e+002[mm], 3e+001[mm], 3e+001[mm])

 LPOS1 32L, 10L, 11L; LPOS2 32L, 10L, 11L;

 UPD; //Execute immediate

 // Increment position with (X, Y, Z) = (3e+001[mm], 3e+001[mm], 1e+002[mm])

 LPOS1 10L, 8L, 32L; LPOS2 10L, 8L, 32L;

 // Insert End Segment

 LPOS1 0L, 0L, 0L; LPOS2 0L, 0L, 0L;

See also:

Linear Intepolation Mode– TML Programming Details

TML Description