Motion PT – TML Instructions and Data

Parameters

MASTERID        Contains the axis ID of the host/master where the drive/motor must send the PT messages. It must be set before starting the PT 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 PT messages to be sent via RS-232

PVTBUFBEGINSpecifies the start address of the PT buffer
PVTBUFLENSpecifies the PT buffer length expressed in PT points

PVTPOS0        Specifies for absolute mode, the initial position from which to start computing the distance to move up to the first PT point. An alternate option is to consider TPOS as initial position. Selection between these 2 options is done at PT initialization via TML command SETPT. The default value of PVTPOS0 is 0.

PVTSENDOFF        When set to 1, disables transmission of messages during PT mode. By default is set to 0 and the transmission is enabled

 

Variables

PVTSTS        Contains the PT motion mode status.

PVTSTS bit description

PVTSTSDescription_2

PVTMODEPVT operation mode as was set with the SETPT command
TPOSTarget load position – position reference computed by the reference generator at each slow loop sampling period. Measured in position units
TSPDTarget load speed – speed reference computed by the reference generator at each slow loop sampling period. Measured in speed units
TACCTarget load acceleration – acceleration/deceleration reference computed by the reference generator at each slow loop sampling period. Measured in acceleration units

APOS_LD        Actual load position. Measured in position units. Alternate name: APOS

ASPD_LD        Actual load speed – measured in speed units

APOS_MT        Actual motor position. Measured in motor position units.

ASPD_MTActual motor speed. Measured in motor speed units. Alternate name: ASPD

 

Instructions

SETPT        value        Set PT operation as specified by value:

PT operation mode (a copy of value is saved in the TML variable PVTMODE)

SETPVTDescription_2

CPR                PT mode is relative

CPA                PT mode is absolute

MODE PT        Set PT motion mode.

TUM1Target Update Mode 1 (TUM1). Generates new trajectory starting from the actual values of position and speed reference (i.e. don’t update the reference values with load/motor position and speed)
TUM0Target Update Mode 0 (TUM0). Generates new trajectory starting from the actual values of load/motor position and speed (i.e. update the reference values with load/motor position and speed)

PTP Position, Time, Counter        Defines a PT point, where:

Position – is the PT point position, measured in position units. In absolute mode, it is the position to reach. In relative mode, it is the position increment from the previous PT point. The position value is a 32-bit long integer.

Time – is the PT point time measured in time units. The time value is a 16-bit unsigned integer

Counter – is the PVT point integrity counter. It is a 7-bit unsigned integer with values between 0 and 127.

UPD        Update motion parameters and start new motion mode

STOP        Stop motion

Remarks:

When a PT sequence of points is executed from a TML program, the first PTP commands are processed one after the other, until the PT buffer fills up. At this point the TML program stops until the PT buffer starts to empty. Therefore, the next PTP commands are processed in the cadence of the PT points execution. At the end of the sequence, the PT 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 points in the PT buffer waiting to be executed. In order to avoid this situation, it is mandatory to end the PVT sequence with an event on motion complete and wait until this event occurs.
In order to activate the TUM1 mode, execute the TML instruction TUM1 AFTER the MODE PT command and BEFORE the UPD command. When MODE PT is executed, it automatically sets TUM0 mode. However, as the new motion mode becomes effective only after the UPD command, a TUM1 command will overwrite the TUM0 mode
Under TUM0 mode, at the UPD command TPOS=APOS_LD and TSPD=ASPD_LD. In open loop control of steppers, TUM0 is ignored as there is no position and/or speed feedback
In setup configurations where there is no transmission ratio between the motor and the load, it is supposed that these are directly connected. In these cases: APOS_MT=APOS_LD and ASPD_MT=ASPD_LD

 

Programming Example

// PT sequence. Position feedback: 500 lines incremental

// encoder (2000 counts/rev)

SETPVT 0xC000; //Clear PT buffer, disable counter check

                  //Don’t change counter & buffer low condition        

MODE PT; // Set PT Mode

TUM1;//Start from actual value of position reference

CPR;

PTP 2000L, 100U, 0; //PT(1[rot], 0.1[s])

UPD; //Execute immediate

PTP 0L, 100U, 0; //PT(1[rot],0.2[s])

PTP -2000L, 100U, 0; //PT(0[rot],0.3[s])

!MC; WAIT!; //wait for completion

See also:

PT – TML Programming Details

TML Description