User's Manual

PMAC User Manual
Synchronizing PMAC to External Events 225
Since the math works out more easily if this number is a power of two, declare the real-timecount rate to
be 128 counts/msec. Then calculate the scale factor as 131,072 / 128 = 1024. Enter the scale factor by
commanding WY:$729,1024 (note that the value can be entered as a decimal number by omitting the
dollar sign).
Step 4: Using the Time-Base Calculation
Since working in Coordinate System 1, assign I193 to $729 (1833 decimal) to point to this time base
value. Set I194 to the maximum value of 8,388,607 so we do not lose synchronicity on rapid changes.
Step 5: Writing the Program
In writing the program, work at the real-timeinput frequency, which differs from the nominal speed that
was started with, in this case, it is exactly 28% faster. Therefore, any programmed speeds would be 28%
higher; any programmed times would be 28% less. Take the nominal cut time of 750 msec (0.75 sec) and
multiply it by 100/128 to get exactly 585.9375 msec. The 2500 msec return is similarly scaled to
1953.125 msec. (If these numbers do not come out exactly in the program, put the math directly in the
program; PMAC calculates with 48-bit floating-point precision.) There will be a main program loop
something like this:
WHILE (M11=1) ; Cut as long as input is true
TM 585.9375 ; Cut move time
X10000 ; Actual cut move
DELAY 500 ; Hold; part of 1953.125 msec return
TM 953.125 ; Return time; part of 1953.125 msec
X0 ; Actual return move
DELAY 500 ; Hold; part of 1953.125 msec return
ENDWHILE
Triggered Time Base
The time-base techniques discussed so far keep the slave coordinate system locked perfectly to the master,
but they do not provide a way of synchronizing automatically to a particular point on the master. Thus, the
slave cycle can be out of phase with the master cycle, and some special technique, usually involving
position capture from a registration mark, must be used to bring the cycles in phase with each other.
Many time-base applications do not require the master and slave cycles to be in phase with each other (for
instance, cutting blank sheets of paper to length rather than printed pages), and others have to be
continually re-registered due to stretching, slippage, or uneven spacing. These types of applications can
use the standard time base function.
However, applications that do need to be in phase with the master, and in which a registration procedure
to do this is difficult or impossible, can use the triggered time base feature of the conversion table. This
technique permits perfect synchronization to the position of the master that is captured by a trigger, by
freezing the time base until the trigger is received, then starting the time base referenced to the position
that was captured by that trigger.
The triggered time-base entry in the conversion table is similar to the standard time-base entry. It is a
two-line entry, with the first line specifying the process and the source address for the master encoder
data, and the second line specifying the time-base scale factor. There are two important differences
between the triggered time-base entry and the standard time base entry. First, the value specifying the
process is different, and it is changed during the process of triggering ($90, $A0, and $B0, versus the $40
for standard time-base). Second, the source address is that of the actual master encoder counter registers,
not the processed encoder data in the conversion table. The scale factor is the same as for the standard
time-base. The rules for this entry are discussed in detail in the instructions for the conversion table.