User's Manual

PMAC User Manual
224 Synchronizing PMAC to External Events
Step 5: Writing the Program
When writing the program that is to be under external time-base control, simply write it as if the input
signal were always at the real-time frequency. When run, the program will execute at a rate proportional
to the input frequency. There is full floating-point resolution on the move times and feedrates specified.
Remember that DWELL commands always execute in real time, regardless of the input frequency. If you
want pauses in your program that are proportional to an input frequency, use the DELAY command, not
DWELL.
Time-Base Example
There is a web of material moving at a nominal speed of 50 inches per second. There is an encoder on the
web that gives 500 lines per inch. There is a crosscutting axis under PMAC control. When the web is
moving at nominal speed you want to make a cutting move in 0.75 seconds and be ready to start another
move 2.50 seconds later. The web encoder is attached to Encoder 2 input lines.
Step 1: Signal Decoding
Since the web encoder is Encoder 2, I905 controls the decode. For maximum resolution, set I905 to 3 or
7 for 4x decode. Try 3 first. Looking in the list of suggested M-variables in the manual, notice that the
encoder position M-variable for this encoder is M201. Make the definition for M201 and query its value
repeatedly (probably using the Executive program Watch window) while turning the web encoder in the
direction it will be going in the application. If the value increases as the encoder is turned, I905 is set
properly. If it decreases, change I905 to 7. (If it does not change, check the connections.)
Step 2: Interpolation
Next look at the current set-up of he encoder conversion table. The easiest way to do this is through the
Configuration menu of the PMAC Executive program. If this is not available, command PMAC with
RHY:$720,16, which causes PMAC to report the contents of addresses Y:$720 to Y:$72F — the set-up
data for the table. We get back something like this:
00C000 00C004 00C008 00C00C 00C010 00C014 00C018
00C01C 400723 000295 000000 000000 000000 000000
000000 000000
(The values shown here are the default values for the table.) The second value returned (from address
Y:$721) shows a 1/T conversion of Encoder 2, which occupies registers $C004 to $C007 (49156 to
49159). This gives us our desired sub-count data for smoothness. We do not have to change anything
here. However, if the entry read C0C004, we could change it by commanding
secm
counts
100
sec
counts
000,100
cycle
counts
4
inch
cycles
500
sec
inches
50
=
=
WY:$721,$00C004.
Step 3: Time-Base Calculation
Now set up an entry in the table to convert the interpolated position to time base format. Looking at the
values reported above, notice that the ninth entry (from address Y:$728),400723, is a time-base
conversion. However, its source is address $723, which is the interpolated position from Encoder 4, not
Encoder 2 as it should be. To change it, command WY:$728,$400721.
Now compute the scaling factor. Look at the nominal speed of 50 inches/sec, the resolution of 500
cycles/inch, and the 4x decode, and calculate: