User's Manual

PMAC User Manual
206 Writing Programs for PMAC
G91 — Incremental Move Mode
Typically, this code is implemented in PMAC through use of the INC command. The INC command
without a list of axes puts all axes in the coordinate system in incremental move mode. The typical
implementation would be G91000 INC RET. If the G-Code dialect has G90 and G91 also affecting
the mode of circle-move center vectors (non-standard), an INC (R) command should be added to this
routine.
G92 — Position Set (Preload) Command
If this code is used just to set axis positions, the implementation is very simple: G92000 PSET RET.
With the return statement on the same line, the program would jump back to the calling line and use the
values there (e.g. X10 Y20) as arguments for the PSET command. However, if the code is used for
other things as well, such as setting maximum spindle speed, the subroutine will need to be longer and do
the setting inside the routine.
For example, if G92 is used to preload positions on the X, Y, and Z axes, set the maximum spindle speed (S
argument), and define the distance from tool tip to spindle center (R argument), the subroutine could be:
N92000 READ(X,Y,Z,S,R)
IF (Q100 & 8388608 > 0) PSET X(Q124) ; X axis preload
IF (Q100 & 16777216 > 0) PSET Y(Q125) ; Y axis preload
IF (Q100 & 33554432 > 0) PSET Z(Q126) ; Z axis preload
IF (Q100 & 262144 > 0) P92=Q119 ; Store S value
IF (Q100 & 131072 > 0) P98=M165-Q118 ; Store R value
RET
The purpose of the condition in each line is to see if that argument has been sent to the subroutine in the
subroutine call — if it has not, nothing will be done with that parameter (see the previous Passing
Arguments to Subroutines section). In the case of the S argument, the value is stored for later use by
other routines, so that a commanded spindle speed will not exceed the limit specified here. In the case of
the R argument, the routine calculates the difference between the current commanded X-axis position
(M165) and the declared radial position (R argument: Q118) to get an offset value (P98). This offset
value can be used by the spindle program to calculate a real-time radial position.
G94 — Inches (Millimeters) per Minute Mode
This code sets up the program so that F-values (feedrate) are interpreted to mean length units (inches or
mm) per minute. In PMAC, F-values are interpreted to mean a speed (length per time) where the length
units are set by the axis definition statements, and the time units are set by the coordinate system variable
Ix90. Since the units of Ix90 are milliseconds, this routine should set Ix90 to 60,000. Also, because G94
is used usually to cancel G95, which interprets F-values as inches (mm) per spindle revolution by using
the spindle encoder as an external time base source, this routine should return the coordinate system to
internal time base. A typical routine would be:
N94000 I190=60000 ; Feedrate is per minute
I193=2054 ; Use internal time base
RET
G95 — Inches (Millimeters) per Revolution Mode
This code sets up the program so that F-values (feedrate) are interpreted to mean length units (inches or
mm) per spindle revolution. In PMAC, this requires that the time base for the coordinate system be
controlled by the spindle encoder. Feedrate is still interpreted as length per time, but with external time
base, time is interpreted as proportional to input frequency, and hence, spindle revolutions, giving an
effective length per revolutions feedrate.