Delta Tau GEO BRICK LV User Manual

Page of 440
Turbo PMAC User Manual 
Synchronizing Turbo PMAC to External Events
 
365
 
The single status bit is the compare output status, which reflects the state of the output at any instant.  A 1 
here indicates a high voltage out of the Servo IC; a 0 indicates a low voltage.  Depending on the output 
driver used in a particular configuration, the voltage sense may be inverted out of the control card. 
There are no firmware functions for the automatic use of the position-compare circuitry.  The user’s 
application software must deal with the compare registers and control/status bits directly.  Usually, these 
are accessed with M-variables (or MACRO Station setup MI-variables), and the file of suggested M-
variables includes these definitions.  For the first channel of a Turbo PMAC2 (Servo IC 0 Channel 1), 
these definitions are: 
M101->Y:$078001,0,24,S   
; Hardware position value (counts) 
M108->Y:$078007,0,24,S   
; Position compare A value (counts) 
M109->X:$078007,0,24,S   
; Position compare B value (counts) 
M110->X:$078006,0,24,S   
; Auto-increment value (counts) 
M111->X:$078005,11 
 
; Position compare write enable 
M112->X:$078005,12 
 
; Position compare direct-write (initial-state) value 
M113->X:$078000,9  
 
; Position compare output status 
Refer to the Suggested M-variable list in the Software Reference Manual for equivalent definitions for 
other channels. 
Setting Up for a Single Pulse Output 
If just a single compare pulse is desired (not using the auto-increment feature), take the following steps: 
• 
Write the encoder value at the front edge into the Compare A register 
• 
Write the encoder value at the back edge into the Compare B register 
• 
Set the Auto-Increment register to zero 
• 
Set the initial state with the direct-write feature in a two-step process: 
• 
Write a value to the initial state bit 
• 
Write a 1 to the direct-write enable bit (this is self-clearing to 0) 
• 
Start the move that will cause the compare function 
Example: With the axis sitting still at about encoder position 100, and a 1 value of position compare 
desired between encoder positions 1000 and 1010, the following code could be used: 
M108=1000 
; Set front end compare in A 
M109=1010 
; Set back end compare in B 
M110=0 
; No auto-increment 
M112=0 
; Prepare initial value of 0 
M111=1 
; Enable direct write (resets immediately to 0) 
{Command to start the move} 
Setting Up for Multiple Pulse Outputs 
By using the auto-increment feature, it is possible to create multiple compare pulses with a single 
software setup operation.  When the auto-increment register is a non-zero value, its value is automatically 
added to or subtracted from one compare register’s value when the other compare value is matched.  
PMAC keeps track of the direction of incrementing, so only positive values should be used in the auto-
increment register, even if the encoder will be counting in the negative direction. 
The setup for multiple pulses is like the setup for a single pulse, except that a non-zero value must be 
entered into the auto-increment register, and the value entered for the back edge must be that of the first 
back edge minus the auto-increment if the move will be positive, or that of the first back edge plus the 
auto-increment value if the move will be negative.   
In other words, the starting values to the two compare registers must “bracket” the starting position.  
When either compare value is matched by the encoder counter, the other compare value is incremented in 
the direction of movement.