Delta Tau GEO BRICK LV User Manual

Page of 440
 
Turbo PMAC User Manual 
314
 
Writing and Executing Motion Programs 
Lookahead Length Parameter 
Variable Isx20 for the coordinate system tells the algorithm how many segments ahead in the program to 
look.  This value is a function of the number of segments that must always be correct in the lookahead 
buffer (SegmentsNeeded).  The formula is: 
eded
SegmentsNe
*
3
4
20
Isx
=
 
Setting Isx20 to a value larger than needed does not increase the computational load (although it does 
increase the time of heaviest computational load while the buffer is filling).  However, it does require 
more memory storage, and it does increase the delay in having the program react to any external 
conditions. 
Setting Isx20 to a value smaller than needed does not cause the limits to be violated.  However, it may 
cause Turbo PMAC to limit speeds more severely than the Ixx16 limits require in order to ensure that 
acceleration limits are not violated.  Also, a saw-tooth velocity profile may be observed. 
Defining the Lookahead Buffer 
In order to use the lookahead function in a Turbo PMAC coordinate system, a lookahead buffer must be 
defined for that coordinate system, reserving memory for the buffer.  This is done with the on-line 
coordinate-system-specific DEFINE LOOKAHEAD command.  Because lookahead buffers are not 
retained through a power down or reset, this command must be issued after every power-up or board 
reset. 
There are two values associated with the DEFINE LOOKAHEAD command.  The first determines the 
number of motion segments for each motor in the coordinate system that can be stored in the lookahead 
buffer.  At a minimum, this must be set equal to Isx20. 
If this value is set greater than Isx20, the lookahead buffer stores historical data.  This data can be used to 
reverse through the already executed trajectory.  If reversal is desired, the buffer should be sized to store 
enough back segments to cover the desired backup distance.  There is no penalty for reserving more 
memory for these synchronous M-variable assignments than is needed, other than the loss of this memory 
for other uses. 
The room reserved for the segment data in the lookahead buffer is dependent on the number of motors 
assigned to the coordinate system at the time of the DEFINE LOOKAHEAD command.  If the number of 
motors assigned to the coordinate system changes, the organization of the lookahead buffer will be 
wrong, and the program will abort with a run-time error on the next move after the coordinate system is 
changed. 
If the coordinate system must be changed during an application that uses lookahead, the lookahead buffer 
must first be deleted, then defined again after the change.  The following motion program code shows 
how this could be done: 
DWELL 10 
 
 
 
 
; Stop lookahead execution 
CMD "&1 DELETE LOOKAHEAD" 
 
; Delete buffer 
CMD "&1 #4->100C"  
 
 
; Assign new motor to C. S. 1 
CMD "&1 DEFINE LOOKAHEAD 1000,100"  ; Redefine buffer 
DWELL 10 
 
 
 
 
; Make sure commands execute 
The second value associated with the DEFINE LOOKAHEAD command determines the number of 
synchronous M-variable assignments (e.g. M1==1) for the coordinate system that can be stored in the 
lookahead buffer.  Synchronous M-variable assignments in the motion program delay the actual 
assignment of the value to the M-variable until the start of actual execution of the next move in the 
motion program.  Therefore, these actions must be held in a buffer pending execution.