User's Manual

PMAC User Manual
Writing Programs for PMAC 213
I16 Restarts Interrupts
Variable I16 controls where BREQ gets set again as the executing program in the rotary buffer catches up
to the last loaded lines. If after execution of a line, there are less than I16 lines ahead in the rotary buffer,
BREQ is set high. This can be used to signal the host that more program lines need to be sent.
By using these two variables and the BREQ line for interrupts, an extremely fast and efficient system for
downloading programs in real time from the PC is created.
If the Buffer Runs Out
If the program calculation catches up with the load point of the rotary buffer, there is no error; program
operation will suspend until more lines are entered into the rotary buffer. Technically, the program is still
running; a Q or A command must be given to truly stop the program.
If PMAC is in segmentation mode (I13>0) and is executing the last line in the rotary buffer, as long as a
new line is entered before the start of deceleration to stop, PMAC will blend into the new move without
stopping.
Closing and Deleting Buffers
The CLOSE command closes the rotary buffers just as it does for other types of buffers. Closing the
rotary buffers does not affect the execution of the buffer programs; it just prevents new buffered
commands from being entered into the buffers until they are reopened.
DELETE ROT erases the rotary buffer for the addressed coordinate system and de-allocates the memory
that had been reserved for it.
How PMAC Executes a Motion Program
It can be important to know how PMAC works its way through a motion program. A motion program
differs fundamentally from a typical high-level computer program in that it has statements (moves,
DWELLs, and DELAYs) that take time; there is an important difference between the calculation time and
the execution time.
A PMAC program exists to pass data to the trajectory generator routines that compute the series of
commanded positions for the motors every servo cycle. The motion program must be working ahead of
the actual commanded move to keep the trajectory generators fed with data. If the program fails to keep
ahead, and the time for the next move comes without the proper data in place for the trajectory generators,
PMAC will abort the program and bring all motors in the coordinate system to a stop.
Calculating Ahead
PMAC processes program lines either one or two moves (including DWELLs and DELAYs) ahead.
Calculating one move ahead is necessary in order to be able to blend moves together; calculating a second
move ahead is necessary if proper acceleration and velocity limiting is to be done, or a three-point spline
is to be calculated (SPLINE mode). For linear blended moves with I13 (move segmentation time) equal
to zero (disabled), PMAC calculates two moves ahead, because the velocity and acceleration limits are
enabled here. In all other cases, PMAC is calculating one move ahead.
Note:
No velocity- or acceleration-limiting done on the fly can be entirely foolproof.
The more moves that an on-the-fly algorithm looks ahead, the more likely it is to
be successful in catching all cases, but to be certain, the entire move sequence must
be evaluated ahead of time.