Delta Tau GEO BRICK LV User Manual

Page of 440
 
Turbo PMAC User Manual 
334
 
Writing and Executing Motion Programs 
Open-Loop Spindle 
If using the open loop spindle, write directly to an otherwise unused DAC output register by using a M-
variable.  For instance, the definition M425->Y:$C00A,8,16,S matches the variable M425 to the 
DAC4 output register.  Any value given to this M-variable will cause a corresponding voltage on the 
DAC4 output line.  In this method, a spindle-on command (see M03M04) could be M425=P10 or 
M425=-P10, where P10 has been set previously by an S-code.  The spindle-off command (see M05
could be M425=0
Switching Between Spindle and Positioning 
There are cases in which the spindle motor is sometimes used as a regular axis, doing position moves 
instead of steady velocity, and sometimes as a regular spindle.  In this case, the spindle motor will be 
made an axis in the main coordinate system so it can do coordinated moves.  When real spindle operation 
is desired, a pseudo-open-loop mode can be created by setting the motor’s proportional gain to zero and 
writing to the output offset register (Ixx29).  In this method Ixx29 would be treated just as M425 was in 
the above paragraph.  Of course, a velocity-loop (tachometer) amplifier would be required for this mode 
of operation.  See the example OPENCLOS.PMC for more details.   
Constant-Surface-Speed Spindle 
If you wish the spindle to be able to perform constant surface speed (CSS) mode, you must write a motion 
program, because the speed must vary as a function of another axis position.  The suggested method – 
shown in the example SPINDLE.PMC – is to break the move into small time slices, with the commanded 
distance for each slice dependent on the system conditions at the time – including commanded speed, 
mode, and tool radial position. 
If the spindle is to be controlled in open-loop fashion in CSS mode, it would be best to have a PLC 
program modifying the output command (Mxx25 or Ixx29) as a function of tool radial position.  The 
structure of the PLC program would be much like that of the closed-loop motion program example 
SPINDLE.PMC, except no actual move command would be needed; once the math was processed, the 
value would be assigned to the appropriate variable. 
Standard M-Codes 
The sections below detail what is involved in implementing the standard M-codes.  It is important to 
realize the difference between an M-code in a program and an M-variable.  To be interpreted as an M-
variable, it must be used in an equation or expression.  For instance, M01=1 refers to M- variable number 
1 (usually this sets Machine Output 1), whereas M01 by itself is the M-code number 1. 
M-codes are treated as subprogram calls to the appropriate line label of motion program 1001. 
M00 – Programmed Stop 
The routine to execute this code simply needs to contain the STOP command.  This code is looking for 
the line label N0 of PROG 1001, and the beginning of any program is always implicitly N0, so this must 
be at the very top of PROG 1001.  The part of the file to implement this could be: 
CLOSE 
OPEN PROG 1001 
; Buffer control command 
CLEAR 
; To erase old when sending new 
STOP 
; First line of actual program 
RETURN 
; Will jump back when restarted 
M01 – Optional Stop 
Typically, this code is used to do a stop if the "Optional Stop" switch on the operator’s panel is set.  
Assuming this switch is wired into PMAC’s Machine Input 1, and variable M11 has been assigned to this 
input (this is the default), then the routine to execute this code could be: 
N01000 IF (M11=1) STOP 
RETURN