User's Manual

PMAC User Manual
44 Input/Output: Connecting PMAC to the Machine
E35 ON gives it one-fourth the frequency; E36 one-eighth; and E37 one-sixteenth. Setting E38 ON
provides an external SCLK signal (on CHC4 and CHC4/ inputs). The SCLK frequency used sets the
upper limit on the possible count rate; in actual use, the maximum count rate should be considered about
20% lower, allowing for imperfections in the input signals.
Digital Delay Filter
Each encoder has a digital delay filter consisting of three cascaded D-flip-flops on each line, with a best
two-of-three voting scheme on the outputs of the flip-flops. The flip-flops are clocked by the SCLK
signal. This filter does not pass through a state change that only lasts for one SCLK cycle; any change
this narrow should be a noise spike. In doing this, the filter delays actual transitions by two SCLK.
CH A
DQ DQ DQ DQ
DQ DQ DQ DQ
2 of 3
Vo t i n g
2 of 3
Vo t i n g
C B
Figure 3 Encoder Digital Delay Filter
Frequency Tradeoffs
The lower the SCLK frequency, the wider the noise spike that can be rejected, but the lower the
maximum count frequency. These aspects must be balanced in the system. In general, SCLK should be
set to the lowest frequency that permits PMAC to keep up the maximum possible count frequency from
the encoder.
Bypassing the Filter
This delay filter may be bypassed by setting the Encoder I-Variable 1 (I901, I906, etc.) to 1. Bypassing
this filter will probably be done only by those with parallel sub-count interpolation for which the delay
could cause transition errors. Refer to the Feedback Features section of this manual.
Error Detection
Count-Error Flag
If an illegal encoder transition (both channels changing on the same SCLK cycle) does get through (or
around, if bypassed) the delay filter, and to the decoder, a count-error flag is set, noting a loss of position
information. This flag is bit 18 of the encoder status/control word (X:$C000 for Encoder 1, X:$C004 for
Encoder 2, etc.). Suggested M-variable definitions M118, M218, etc., can be used to access these bits.
Once-per-Rev Check
In addition, it is possible to use the third channel of the encoder to do a once-around position check using
the PMAC position-capture feature to detect any loss of count. Refer to the Position-Capture description
in the Synchronizing PMAC to External Events section of this manual, and program example
PLCMOD.PMC for more details.