Delta Tau GEO BRICK LV User Manual

Page of 440
 
Turbo PMAC User Manual 
364
 
Synchronizing Turbo PMAC to External Events
 
In addition, there is a memory-mapped status bit for the output that Turbo PMAC software can access 
with M-variables for its own use. 
If the Servo IC is on a Turbo PMAC, or directly connected to it, the registers and control/status bits are 
accessed with user-defined M-variables.  If the Servo IC is on a MACRO Station, these registers and bits 
are accessed with pre-defined Station node-specific MI-variables for the MACRO node matched to this 
interface channel. 
Compare Registers 
The position compare circuitry for each channel is based on three memory-mapped registers: 
• 
Compare A (Turbo suggested M-variable Mxx08; MACRO Station MS{node},MI925
• 
Compare B (Turbo suggested M-variable Mxx09; MACRO Station MS{node},MI926
• 
Compare Auto-Increment (Turbo suggested M-variable Mxx10; MACRO Station 
MS{node},MI922
When the encoder counter value matches the value in either the channel’s Compare A Register or 
Compare B Register, the compare output is toggled from the existing state; either from 0 to 1, or from 1 
to 0.  The toggling occurs on the transition from equal to not-equal in either direction.  For instance, if the 
compare register contains 100, the toggling of the output would occur on the transition from 100 to 101 
counts in the positive direction, or on the transition from 100 to 99 counts in the negative direction. 
In addition, when the output is toggled by one of the compare registers, the other register is incremented 
immediately by the amount in the auto-increment register.  If the output is toggled by moving in the 
positive direction, the value in the auto-increment register is added to the other compare register.  If the 
output is toggled by moving in the negative direction, the value in the auto-increment register is 
subtracted from the other compare register. 
If the auto-increment register is non-zero, all of the compare edges should be at least two counts apart.  
This means that the Compare A and Compare B registers should not be less than two counts apart, and the 
minimum non-zero value for the auto-increment register should be 4. 
Compare Control Bits 
There are three control bits for each channel on a PMAC2-style Servo IC. They are: 
1.  Compare Channel Select Bit: (Turbo I-variable I7mn1; MACRO Station MS{node},MI911)  This 
control bit determines whether the compare circuitry for the channel acts on the encoder for that 
channel, or the encoder for Channel 1 of this Servo IC.  (Note that this bit does nothing for Channel 
1.)  This control bit has been assigned an I-variable – I7mn1 for Servo IC m Channel n.  Note that 
when multiple compare circuits have been assigned to Channel 1 of a Servo IC, the compare output 
for the first channel is the logical OR of all of the compare logical outputs assigned to Channel 1. 
2.  Compare Direct-Write (Initial State) Value: (Turbo suggested M-variable Mxx12; MACRO Station 
MS{node},MI929)  This control bit allows you to set the state of the compare output for the channel 
directly, either as an initial state for a compare sequence, or to use the output for general-purpose use, 
or for a software-driven interrupt.  A 1 here will force a high voltage on the output of the Servo IC; a 0 
will force a low voltage.  (Depending on the output driver used, this may be inverted on the output of 
the controller itself.)  It is the user’s responsibility to determine whether he is in his desired 0 region or 
the “1” region when he uses the direct-write feature.  Writing to this bit alone does not set the output; 
this does not happen until the write is enabled, using the next control bit. 
3.  Compare Direct-Write Enable: (Turbo suggested M-variable Mxx11; MACRO Station 
MS{node},MI928)  Writing a 1 to this bit forces the value of the direct-write bit onto the compare 
output line.  As soon as the output state is set, this bit automatically sets itself back to 0.