Vous êtes sur la page 1sur 10

List of G-codes commonly found on Fanuc and similarly designed controls

Sources: Smid[1]; Green et al.[2]

Milling Turning
Code Description Corollary info
(M) (T)
On 2- or 3-axis moves, G00 (unlike
G01) does not necessarily move in a
single straight line between start point
G00 Rapid positioning M T and end point. It moves each axis at its
max speed until its vector is achieved.
Shorter vector usually finishes first
(given similar axis speeds).
The most common workhorse code for
feeding during a cut. The program specs
the start and end points, and the control
automatically calculates (interpolates)
the intermediate points to pass through
G01 Linear interpolation M T
that will yield a straight line (hence
"linear"). The control then calculates the
angular velocities at which to turn the
axis leadscrews. The computer performs
thousands of calculations per second.
Circular Cannot start G41 or G42 in G02 or G03
G02 interpolation, M T modes. Must already be compensated in
clockwise earlier G01 block.
Circular Cannot start G41 or G42 in G02 or G03
G03 interpolation, M T modes. Must already be compensated in
counterclockwise earlier G01 block.
Takes an address for dwell period (may
G04 Dwell M T
be X, U, or P)
G05
HPCC M
P10000
G05.1 Ai Nano contour
M
Q1. control
Imaginary axis
G07 M
designation
G09 Exact stop check M T
Programmable data
G10 M T
input
G11 Data write cancel M T
G12 Full-circle M Fixed cycle for ease of programming
360° circular interpolation with blend-
interpolation,
radius lead-in and lead-out. Not standard
clockwise
on Fanuc controls.
Fixed cycle for ease of programming
Full-circle
360° circular interpolation with blend-
G13 interpolation, M
radius lead-in and lead-out. Not standard
counterclockwise
on Fanuc controls.
G17 XY plane selection M
On most lathes, ZX is the only available
G18 ZX plane selection M T
plane, so no G17-G19 are used.
G19 YZ plane selection M
Somewhat uncommon except in USA
and (to lesser extent) Canada and UK.
However, in the global marketplace,
competence with both G20 and G21
always stands some chance of being
necessary at any time. The usual
Programming in minimum increment in G20 is one ten-
G20 M T
inches thousandth of an inch (0.0001"), which
is a larger distance than the usual
minimum increment in G21 (one
thousandth of a millimeter, .001 mm,
that is, one micrometre). This physical
difference sometimes favors G21
programming.
Prevalent worldwide. However, in the
Programming in global marketplace, competence with
G21 M T
millimeters (mm) both G20 and G21 always stands some
chance of being necessary at any time.
Takes X Y Z addresses which define the
Return to home intermediate point that the tool tip will
position (machine pass through on its way home to
G28 M T
zero, aka machine machine zero. They are in terms of part
reference point) zero (aka program zero), NOT machine
zero.
Takes a P address specifying which
machine zero point is desired, if the
Return to secondary machine has several secondary points
home position (P1 to P4). Takes X Y Z addresses which
G30 (machine zero, aka M T define the intermediate point that the tool
machine reference tip will pass through on its way home to
point) machine zero. They are in terms of part
zero (aka program zero), NOT machine
zero.
Skip function (used
for probes and tool
G31 M
length measurement
systems)
Single-point Similar to G01 linear interpolation,
threading, longhand except with automatic spindle
G32 T
style (if not using a synchronization for single-point
cycle, e.g., G76) threading.
Constant pitch
G33 M
threading
Single-point
threading, longhand Some lathe controls assign this mode to
G33 T
style (if not using a G33 rather than G32.
cycle, e.g., G76)
Variable pitch
G34 M
threading
Tool radius
G40 M T Kills G41 or G42.
compensation off
Milling: Given righthand-helix cutter
and M03 spindle direction, G41
corresponds to climb milling (down
milling). Takes an address (D or H) that
Tool radius calls an offset register value for radius.
G41 M T
compensation left Turning: Often needs no D or H address
on lathes, because whatever tool is active
automatically calls its geometry offsets
with it. (Each turret station is bound to
its geometry offset register.)
Similar corollary info as for G41. Given
Tool radius righthand-helix cutter and M03 spindle
G42 M T
compensation right direction, G42 corresponds to
conventional milling (up milling).
Takes an address, usually H, to call the
Tool height offset tool length offset register value. The
G43 compensation M value is negative because it will be
negative added to the gauge line position. G43 is
the commonly used version (vs G44).
Takes an address, usually H, to call the
tool length offset register value. The
Tool height offset
value is positive because it will be
G44 compensation M
subtracted from the gauge line position.
positive
G44 is the seldom-used version (vs
G43).
Axis offset single
G45 M
increase
Axis offset single
G46 M
decrease
Axis offset double
G47 M
increase
Axis offset double
G48 M
decrease
Tool length offset
G49 M Kills G43 or G44.
compensation cancel
Takes an S address integer which is
interpreted as rpm. Without this feature,
Define the maximum
G50 T G96 mode (CSS) would rev the spindle
spindle speed
to "wide open throttle" when closely
approaching the axis of rotation.
Scaling function
G50 M
cancel
Position register is one of the original
methods to relate the part (program)
coordinate system to the tool position,
which indirectly relates it to the machine
coordinate system, the only position the
Position register
control really "knows". Not commonly
(programming of
G50 T programmed anymore because G54-G59
vector from part zero
(WCSs) are a better, newer method.
to tool tip)
Called via G50 for turning, G92 for
milling. Those G addresses also have
alternate meanings (which see). Position
register can still be useful for datum shift
programming.
Temporarily shifts program zero to a
Local coordinate
G52 M new location. This simplifies
system (LCS)
programming in some cases.
Takes absolute coordinates
(X,Y,Z,A,B,C) with reference to
machine zero rather than program zero.
Machine coordinate Can be helpful for tool changes.
G53 M T
system Nonmodal and absolute only.
Subsequent blocks are interpreted as
"back to G54" even if it is not explicitly
programmed.
G54 to Work coordinate M T Have largely replaced position register
G59 systems (WCSs) (G50 and G92). Each tuple of axis
offsets relates program zero directly to
machine zero. Standard is 6 tuples (G54
to G59), with optional extensibility to 48
more via G54.1 P1 to P48.
Up to 48 more WCSs besides the 6
provided as standard by G54 to G59.
G54.1 Note floating-point extension of G-code
Extended work
P1 to M T data type (formerly all integers). Other
coordinate systems
P48 examples have also evolved (e.g.,
G84.2). Modern controls have the
hardware to handle it.
Fixed cycle, multiple
repetitive cycle, for
G70 T
finishing (including
contours)
Fixed cycle, multiple
repetitive cycle, for
G71 T
roughing (Z-axis
emphasis)
Fixed cycle, multiple
repetitive cycle, for
G72 T
roughing (X-axis
emphasis)
Fixed cycle, multiple
repetitive cycle, for
G73 T
roughing, with
pattern repetition
Peck drilling cycle
Retracts only as far as a clearance
for milling - high-
increment (system parameter). For when
G73 speed (NO full M
chipbreaking is the main concern, but
retraction from
chip clogging of flutes is not.
pecks)
Peck drilling cycle
G74 T
for turning
Tapping cycle for
milling, lefthand
G74 M
thread, M04 spindle
direction
Peck grooving cycle
G75 T
for turning
Fine boring cycle for
G76 M
milling
G76 Threading cycle for T
turning, multiple
repetitive cycle
Milling: Kills all cycles such as G73,
G83, G88, etc. Z-axis returns either to Z-
initial level or R-level, as programmed
G80 Cancel canned cycle M T (G98 or G99, respectively).
Turning: Usually not needed on lathes,
because a new group-1 G address (G00-
G03) cancels whatever cycle was active.
G81 Simple drilling cycle M No dwell built in
Dwells at hole bottom (Z-depth) for the
Drilling cycle with number of milliseconds specified by the
G82 M
dwell P address. Good for when hole bottom
finish matters.
Peck drilling cycle
Returns to R-level after each peck. Good
G83 (full retraction from M
for clearing flutes of chips.
pecks)
Tapping cycle,
righthand thread,
G84 M
M03 spindle
direction
Tapping cycle,
righthand thread,
G84.2 M03 spindle M
direction, rigid
toolholder
Positioning defined with reference to
part zero.
Milling: Always as above.
Turning: Sometimes as above (Fanuc
group type B and similarly designed),
Absolute but on most lathes (Fanuc group type A
G90 M T (B)
programming and similarly designed), G90/G91 are
not used for absolute/incremental modes.
Instead, U and W are the incremental
addresses and X and Z are the absolute
addresses. On these lathes, G90 is a
fixed cycle address for roughing.
Fixed cycle, simple
When not serving for absolute
G90 cycle, for roughing T (A)
programming (above)
(Z-axis emphasis)
G91 Incremental M T (B) Positioning defined with reference to
programming previous position.
Milling: Always as above.
Turning: Sometimes as above (Fanuc
group type B and similarly designed),
but on most lathes (Fanuc group type A
and similarly designed), G90/G91 are
not used for absolute/incremental modes.
Instead, U and W are the incremental
addresses and X and Z are the absolute
addresses. On these lathes, G90 is a
fixed cycle address for roughing.
Same corollary info as at G50 position
register.
Position register Milling: Always as above.
(programming of Turning: Sometimes as above (Fanuc
G92 M T (B)
vector from part zero group type B and similarly designed),
to tool tip) but on most lathes (Fanuc group type A
and similarly designed), position register
is G50.
Threading cycle,
G92 T (A)
simple cycle
On group type A lathes, feedrate per
G94 Feedrate per minute M T (B)
minute is G98.
Fixed cycle, simple
When not serving for feedrate per minute
G94 cycle, for roughing T (A)
(above)
(X-axis emphasis)
Feedrate per On group type A lathes, feedrate per
G95 M T (B)
revolution revolution is G99.
Varies spindle speed automatically to
achieve a constant surface speed. See
Constant surface
G96 T speeds and feeds. Takes an S address
speed (CSS)
integer, which is interpreted as sfm in
G20 mode or as m/min in G21 mode.
Takes an S address integer, which is
Constant spindle interpreted as rev/min (rpm). The default
G97 M T
speed speed mode per system parameter if no
mode is programmed.
Return to initial Z
G98 M
level in canned cycle
Feedrate per minute Feedrate per minute is G94 on group
G98 T (A)
(group type A) type B.
Return to R level in
G99 M
canned cycle
G99 Feedrate per T (A) Feedrate per revolution is G95 on group
revolution (group
type B.
type A)

[edit] List of M-codes commonly found on Fanuc and similarly designed


controls

Sources: Smid[1]; Green et al.[2]

Milling Turning
Code Description Corollary info
(M) (T)
Non-optional—machine will always stop
M00 Compulsory stop M T upon reaching M00 in the program
execution.
Machine will only stop at M01 if
M01 Optional stop M T operator has pushed the optional stop
button.
No return to program top; may or may
M02 End of program M T
not reset register values.
Spindle on
M03 M T
(clockwise rotation)
Spindle on
M04 (counterclockwise M T
rotation)
M05 Spindle stop M T
Many lathes do not use M06 because the
T address itself indexes the turret.
To understand how the T address works
and how it interacts (or not) with M06,
one must study the various methods,
Automatic tool T (some- such as lathe turret programming, ATC
M06 M
change (ATC) times) fixed tool selection, ATC random
memory tool selection, the concept of
"next tool waiting", and empty tools.
Programming on any particular machine
tool requires knowing which method that
machine uses.
M07 Coolant on (mist) M T
M08 Coolant on (flood) M T
M09 Coolant off M T
M10 Pallet clamp on M For machining centers with pallet
changers
For machining centers with pallet
M11 Pallet clamp off M
changers
This one M-code does the work of both
Spindle on (clockwise M03 and M08. It is not unusual for
M13 rotation) and coolant M specific machine models to have such
on (flood) combined commands, which make for
shorter, more quickly written programs.
Spindle orientation is more often called
within cycles (automatically) or during
setup (manually), but it is also available
M19 Spindle orientation M T under program control via M19. The
abbreviation OSS (oriented spindle stop)
may be seen in reference to an oriented
stop within cycles.
M21 Mirror, X-axis M
M21 Tailstock forward T
M22 Mirror, Y-axis M
M22 Tailstock backward T
M23 Mirror OFF M
Thread gradual
M23 T
pullout ON
Thread gradual
M24 T
pullout OFF
End of program with
M30 return to program M T
top
M41 Gear select - gear 1 T
M42 Gear select - gear 2 T
M43 Gear select - gear 3 T
M44 Gear select - gear 4 T
Feedrate override
M48 M T
allowed
This rule is also called (automatically)
within tapping cycles or single-point
Feedrate override
M49 M T threading cycles, where feed is precisely
NOT allowed
correlated to speed. Same with spindle
speed override and feed hold button.
Automatic pallet For machining centers with pallet
M60 M
change (APC) changers
Takes an address P to specify which
M98 Subprogram call M T subprogram to call, for example, "M98
P8979" calls subprogram O8979.
Usually placed at end of subprogram,
where it returns execution control to the
main program. The default is that control
returns to the block following the M98
call in the main program. Return to a
M99 Subprogram end M T
different block number can be specified
by a P address. M99 can also be used in
main program with block skip for endless
loop of main program on bar work on
lathes (until operator toggles block skip).

Centres d'intérêt liés