Delta Tau GEO BRICK LV 사용자 설명서

다운로드
페이지 440
Turbo PMAC User Manual 
Writing and Executing Motion Programs
 
335
 
M02 – End of Program 
Since PMAC automatically recognizes the end of a program, and resets the program pointer back to the 
top of the program, the routine for this code could be empty (RETURN statement only).  However, in 
many systems, a lot of variables and modes get set to default values here.  A typical end-of-program 
routine might be: 
N02000 M55=0 
; Turn off spindle 
M7=0 
; Turn off coolant 
M2=0 
; Turn off conveyor 
DWELL 0 
; Execute pending synchronous M-vars 
LINEAR 
; Make sure not in circular mode 
RETURN 
M03 – Spindle On Clockwise 
M04 – Spindle On Counterclockwise 
M05 – Spindle Stop 
If the spindle is simply doing constant speed moves, these routines can simply issue jog commands.  For 
instance: 
N03000 CMD "#4J+" 
RET 
N04000 CMD "#4J-" 
RET 
N05000 CMD "#4J/" 
RET 
This assumes, of course, that motor #4 on Turbo PMAC is the spindle motor and that the counting-up 
direction is clockwise.  Spindle speed already will have been determined in other routines by setting I422 
(motor #4 jog speed). 
If Turbo PMAC is controlling the spindle with an open loop voltage, these routines would put a voltage 
on an otherwise-unused analog output by writing to a DAC register.  For example: 
N03000 M402=P97*P9 
RETURN 
N04000 M402=-P97*P9 
RETURN 
N05000 M402=0 
RETURN 
This sample assumes M402 is assigned to the DAC4 register (Y:$07800A,8,16,S), P97 is the desired 
spindle speed in RPM, and P9 is the scale factor relating RPM to DAC bits (3,276.7 DAC bits/volt).  See 
the Spindle Programs section for more details. 
If fancier tasks such as constant surface speed are desired, a separate motion program for the spindle will 
be required, as demonstrated in an above example.  If these M-codes were to interface with this example, 
they would be: 
N03000 M55=1 
; Flag for clockwise spindle 
CMD "&2B1010R" 
; Start the spindle program 
RET 
N04000 M55=-1 
; Flag for counterclockwise spindle 
CMD "&2B1010R" 
; Start the spindle program 
RET 
N05000 M55=0 
; Flag for spindle off 
RET ;