Delta Tau GEO BRICK LV User Manual

Page of 440
 
Turbo PMAC User Manual 
362
 
Synchronizing Turbo PMAC to External Events
 
Using the Position-Compare Feature on Turbo PMAC 
The Turbo PMAC has powerful position compare functions built into its Servo ICs, particularly with the 
PMAC2-style DSPGATE1 Servo ICs.  The position-compare feature provides a fast and accurate digital 
output based on the actual position counter – when the hardware counter in the IC becomes equal to the 
compare register, the output toggles immediately.  Often, this output is used to trigger a measurement 
device or to fire a laser. 
Because the triggering of the compare output is a pure hardware function (although the setup is done in 
software), there are no software delays to affect the accuracy.  The compare output is accurate to the exact 
count at any speed.   
The position-compare function is implemented in software-configurable hardware registers in the Servo 
ICs.  The software configuration gives the function its flexibility; the hardware circuitry gives the 
function its speed.   
The individual hardware used determines where the position-compare outputs are brought out, and the 
nature of the driver circuit.  Consult the Hardware Reference manual for your product.  In some cases, the 
driver IC is socketed, so you have a choice of circuits to use. 
These outputs, typically labeled EQUn, can be used to drive external hardware, such as the triggers for 
scanning and measurement equipment. 
Scaling and Offset of Position-Compare Registers 
The position-compare registers are scaled in hardware encoder counts.  A hardware count is defined by 
the channel Encoder Decode I-variable I7mn0, typically with 4 counts per cycle or line.  The compare 
registers are always referenced to the position at the most recent power-up or reset, called Encoder Zero.  
This reference does not change with motor homing, which changes Motor Zero, or axis offsets, which 
change Axis Zero.  See the Converting from Motor and Axis Coordinates section below for more details. 
The position-compare registers, like the hardware encoder counters, are 24-bit values that can, and often 
do, roll over in the normal course of operation.  You must keep track of any rollover effects.  Note, 
however, that by assigning a 24-bit M-variable to a compare register, the act of writing to this M-variable 
automatically truncates a longer value properly to this word length. 
Setup on a PMAC-Style Servo IC 
Each encoder counter in the PMAC-style “DSPGATE” Servo IC has a position-compare function.  On the 
Turbo PMAC-PC and the Turbo PMAC-PCI, several of the position-compare outputs may be used to 
interrupt the host computer over the backplane bus.  Note that if the dual-ported RAM ASCII 
communications interrupt function is enabled (I56=1 and I58=1), the compare output for the board’s 
Channel 1 is used for this interrupt, and so cannot be used for true position compare functions. 
The position-compare circuitry for each channel has a 24-bit compare register, three control bits, and one 
status bit.  The compare register contains the position count value at which the output is to be toggled.  
Note that this is a write-only register; if the same address is read; the captured position value is read.   
Compare Control Bits 
The control bits for a PMAC-style Servo IC channel are: 
1.  Compare output-enable bit: This must be set to 1 to get the compare signal output from the IC.  (The 
internal status bit always works). 
2.  Compare flag latch control bit: If this bit is set to 0, the output is transparent – it is on only for the 
single count when the position counter equals the value in the compare register.  If this bit is set to 1, 
the output is latched – it turns on when the counter becomes equal to the compare value, and stays on 
until this latch bit is cleared.  This is the more common mode of use.