User's Manual

PMAC User Manual
Synchronizing PMAC to External Events 221
Real-Time Input Frequency
The PMAC method for doing this leaves the language expressing position as a function of time, but
makes time proportional to the distance covered by the master. This is done by defining a real-time input
frequency (RTIF) from the master's position sensor, in units of counts per millisecond. For example, an
RTIF of 32 cts/msec is defined. Then, in time-base mode, when the program refers to a millisecond, what
it is really referring to is 32 counts of the master encoder, whatever physical distance that is. If move is
programmed in the slave program to take 2 seconds, it will really take 64,000 counts of the master
encoder to complete.
Constraints on Selection of RTIF
If PMAC had infinite resolution and infinite dynamic range in its time base calculations, the choice of
real-time input frequency would be entirely arbitrary. Any frequency can be selected as the RTIF, and a
motion program can be written for that RTIF. However, PMAC does its time-base calculations in integer
arithmetic, which limits the resolution, and in 24-bit registers, which limits the dynamic range.
These limitations lead to three restraints on the selection of the RTIF:
The time base scale factor (TBSF) derived from the RTIF must be an integer. The value that PMAC
needs for its calculations is not the frequency in cts/msec, but the inverse of the frequency in msec/ct.
In order for this number to be in the range of integer values, the rule is to multiply the frequency
inverse by 2
17
(131,072).
If a value of 100 cts/msec were chosen for RTIF, then the TBSF would be 131,072/100 = 131.072,
which is not an integer. PMAC could only accept the integer part of 131, and drift would occur.
A choice of real-time input frequency that is a power of 2 in cts/msec (e.g. 32, 64, 128) will always
produce an integer TBSF. In addition, RTIF values that are equal to a power of 2 divided by an
integer will work typically. For example, 204.8 cts/msec (=2048/10, = 2
10
/10) will yield a TBSF of
2
17
/2
10
*10 = 640.
The time base calculations will saturate at an input frequency (IF) where IF/RTIF equals the servo
update frrequency in kHz. At the default servo update frequency of 2.25 kHz and an RTIF of 32
cts/msec, the maximum input frequency that can be accepted without saturation is 32*2.25 = 72
cts/msec. If the system could operate to 100 cts/msec, the choice of RTIF=32 cts/msec would not be
acceptable, but a choice of RTIF=64 cts/msec would be acceptable (100/64=1.5625<2.25).
A choice of RTIF greater than the maximum input frequency is always acceptable.
If PVT or SPLINE mode moves are used, the segment times at the RTIF must be an integer number
of milliseconds. This means that the RTIF must be chosen so that the total cycle time at the RTIF is
an integer number of milliseconds.
Sometimes this will not be possible unless the resolution of the master encoder is a power of 2. For
this reason, it is suggested that the master encoder resolution be selected as a power of 2 (e.g. 1024
lines/rev instead of 1000 lines/rev).
For example, with a 1000 line/rev encoder (4000 cts/rev) on a spindle motor, an RTIF of 200 cts/msec
corresponds to a speed of 50 revs/sec (3000 rpm), or exactly 20 msec/rev. However, it yields a TBSF
of 655.36, which is not an integer.
With this encoder, an RTIF that yields an integer TBSF (256 cts/msec yields 512, or 204.8 cts/msec
yields 640) corresponds to a cycle time that is not an integer.
However, with a 1024 line/rev encoder (4096 cts/rev), an RTIF of 204.8 cts/msec corresponds to a
speed of 50 rps (3000 rpm) for a revolution time of 20 msec, and it yields a time-base scale factor of
exactly 640. In this case, the time base function stays locked, and a SPLINE or PVT sequence can be
written that corresponds to an exact number of spindle revolutions.