Delta Tau GEO BRICK LV User Manual

Page of 440
Turbo PMAC User Manual 
Executing Individual Motor Moves 
 
231 
  ENDWHILE 
  WHILE (M333=0)   
;Waits for home motion to complete 
  ENDWHILE 
ENDIF 
I323=-10  
 
; Home speed 10 cts/msec negative direction 
I326=0   ; No home offset 
I7232=3     ; Capture on rising flag and rising index 
I7233=0     ; Use Home3 as flag 
CMD"#3HM"  
 
; Do actual homing move 
WHILE (M345=1) 
 
; Waits for home search to start 
ENDWHILE 
WHILE (M333=0) 
 
; Waits for home motion to complete 
ENDWHILE 
DIS PLC12 
 
 
; Disables PLC once home is found 
CLOSE 
   ; End of program 
Storing the Home Position 
Turbo PMAC automatically stores the encoder position that was captured during the latest homing search 
move for the motor.  This value is kept in the Motor Encoder Home Capture register [Y:$CE (Motor 1), 
Y:$14E (Motor 2), etc., suggested M-variable Mxx73], which is set to zero on power-up/reset for motors 
without absolute power-on position.  If the position reference is obtained by reading an absolute sensor 
(Ixx10>0) such as from a resolver, this register holds the negative of the absolute position read.  In either 
case, it contains the difference between the encoder-counter zero position (power-on position) and the 
motor zero (home) position, scaled in counts.   
There are two main uses for this register.  First, it provides a reference for using the encoder position-
capture and position-compare registers.  These registers are referenced to the encoder zero position, which 
is the power-up position, not the home (motor zero) position.  This register holds the difference between 
the two positions.  This value should be subtracted from encoder position (usually from position capture) 
to get motor position, or added to motor position to get encoder position (usually for position compare). 
Example: To move an axis until a trigger is found, then convert the captured encoder position to a motor 
position, you can use the following M-variable definitions: 
M103->X:$078003,24,S 
; Servo IC 0 Channel 1 position-capture register 
M117->X:$078000,17 
; Servo IC 0 Channel 1 position-capture flag 
M125->Y:$0000CE,24,S 
; Motor 1 encoder position offset register 
Now you can use a motion program segment like the following: 
INC 
 
; Incremental moves 
TM10 TA10 
 
; Move segment time 10 msec 
WHILE (M117=0) 
 
; While no trigger to capture position 
  X0.2 
 
; Command next move segment 
ENDWHILE 
P103=M103-M125 
 
; Read captured position; subtract offset to 
 
 
; get motor position at trigger 
The second use for this register is to determine whether the encoder counter has lost any counts.  This can 
be done by performing a second homing search move after an operation, and comparing the contents of 
the register after the second homing search move to the contents after the first homing search move. 
Jog-Until-Trigger Moves 
The jog-until-trigger function permits a jog move to be interrupted by a trigger and terminated by a move 
relative to the position at the time of the trigger.  It is similar to a homing search move, except that the 
motor zero position is not altered, and there is a specific destination in the absence of a trigger.