Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

Republic of the Philippines

Technological University of the Philippines


COLLEGE OF INDUSTRIAL TECHNOLOGY
MECHANICAL ENGINEERING TECHNOLOGY DEPARTMENT

Name : Agdamag, John Christian A.


Course/Yr/Sec. : BET-MECT 2A
Subject : CNC Applications
PHOTO Professor : Mr. David C. Reyes
Semester : 2nd Semester
School Year : 2021-2022
Date: : 03/22/2022

Main Topic: CNC Machining Process

Sub-Topic #1: Complete list of G-codes commands for Milling Operation, its category,
description/function, and Corollary Info:
Content:

Code Category Description Corollary info


G00 Motion Rapid positioning On 2- or 3-axis moves, G00
(unlike G01) traditionally does
not necessarily move in a single
straight line between start point
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). This matters because it
may yield a dog-leg or hockey-
stick motion, which the
programmer needs to consider
depending on what obstacles are
nearby, to avoid a crash. Some
machines offer interpolated
rapids as a feature for ease of
programming (safe to assume a
straight line).
G01 Motion Linear The most common workhorse
interpolation 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 that will
yield a straight line (hence
“linear“). The control then
calculates the angular velocities
at which to turn the
axis leadscrews via their
servomotors or stepper motors.
The computer performs
thousands of calculations per
second, and the motors react
quickly to each input. Thus the
actual toolpath of the machining
takes place with the given
feedrate on a path that is
accurately linear to within very
small limits.
GO2 Motion Circular Very similar in concept to G01.
interpolation, Again, the control interpolates
clockwise intermediate points and
commands the servo- or stepper
motors to rotate the amount
needed for the leadscrew to
translate the motion to the
correct tool tip positioning. This
process repeated thousands of
times per minute generates the
desired toolpath. In the case of
G02, the interpolation generates
a circle rather than a line. As with
G01, the actual toolpath of the
machining takes place with the
given feedrate on a path that
accurately matches the ideal (in
G02’s case, a circle) to within
very small limits. In fact, the
interpolation is so precise (when
all conditions are correct) that
milling an interpolated circle can
obviate operations such as
drilling, and often even fine
boring. On most controls you
cannot start G41 or G42 in G02
or G03 modes. You must already
have compensated in an earlier
G01 block. Often a short linear
lead-in movement will be
programmed, merely to allow
cutter compensation before the
main event, the circle-cutting,
begins.
G03 Motion Circular Same corollary info as for G02.
interpolation,
counter clockwise
G04 Motion Dwell Takes an address for dwell period
(may be X, U, or P). The dwell
period is specified in the
controllers parameter, typically
milliseconds.
G05P 10000 Motion High-precision Uses a deep look-
contour control ahead buffer and simulation
(HPCC) processing to provide better axis
movement acceleration and
deceleration during contour
milling
G05 .1 Q1. Motion AI Nano contour Uses a deep look-
control ahead buffer and simulation
processing to provide better axis
movement acceleration and
deceleration during contour
milling
G06.1 Motion Non Uniform Activates Non-Uniform Rational B
Rational B Spline Spline for complex curve and
Machining waveform machining (this code is
confirmed in Mazatrol 640M ISO
Programming)
G07 Motion Imaginary axis
designation
G09 Motion Exact stop check
G10 Compensation Programmable
data input
G11 Compensation Data write cancel
G12 Coordinate Full-circle Fixed cycle for ease of
interpolation, programming 360° circular
clockwise interpolation with blend-radius
lead-in and lead-out. Not
standard on Fanuc controls.
G13 Coordinate Full-circle Fixed cycle for ease of
interpolation, programming 360° circular
counter clockwise interpolation with blend-radius
lead-in and lead-out. Not
standard on Fanuc controls.
G17 Coordinate XY plane selection
G18 Coordinate ZX plane selection On most CNC lathes (built 1960s
to 2000s), ZX is the only available
plane, so no G17 to G19 codes
are used. This is now changing as
the era begins in which live
tooling, multitask/multifunction,
and mill-turn/turn-mill gradually
become the “new normal”. But
the simpler, traditional form
factor will probably not
disappear—just move over to
make room for the newer
configurations. See
also V address.
G19 Coordinate YZ plane selection
G20 Coordinate Programming in Somewhat uncommon except in
inches 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
minimum increment in G20 is
one ten-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.
G21 Coordinate Programming in Prevalent worldwide. However,
millimeters (mm) in the global marketplace,
competence with both G20 and
G21 always stands some chance
of being necessary at any time.
G28 Motion Return to home Takes X Y Z addresses which
position (machine define the intermediate point
zero, aka machine that the tool tip will pass through
reference point) on its way home to machine
zero. They are in terms of part
zero (aka program zero), NOT
machine zero.
G30 Motion Return to Takes a P address
secondary home specifying which machine zero
position (machine point is desired, if the machine
zero, aka machine has several secondary points (P1
reference point) to P4). Takes X Y Z addresses
which define the intermediate
point that the tool tip will pass
through on its way home to
machine zero. They are in terms
of part zero (aka program zero),
NOT machine zero.
G31 Motion Skip function (used
for probes and tool
length
measurement
systems)
G32 Canned Single-point Similar to G01 linear
threading, interpolation, except with
longhand style (if automatic spindle
not using a cycle, synchronization for single-point
e.g., G76) threading.
G33 Canned Constant-pitch
threading
G33 Canned Single-point Some lathe controls assign this
threading, mode to G33 rather than G32.
longhand style (if
not using a cycle,
e.g., G76)
G34 Canned Variable-pitch
threading
G40 Compensation Tool radius Cancels G41 or G42.
compensation off
G41 Compensation Tool radius Milling: Given righthand-helix
compensation left cutter and M03 spindle direction,
G41 corresponds to climb milling
(down milling). Takes an address
(D or H) that calls an offset
register value for
radius.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.)G41 and G42 for
milling has become less
frequently used since CAM
programming has become more
common. CAM systems allow the
user to program as if with a zero-
diameter cutter. The
fundamental concept of cutter
radius compensation is still in
play (i.e., that the surface
produced will be distance R away
from the cutter center), but the
programming mindset is
different; the human does not
choreograph the toolpath with
conscious, painstaking attention
to G41, G42, and G40, because
the CAM software takes care of
it.
G42 Compensation Tool radius Similar corollary info as for G41.
compensation Given righthand-helix cutter and
right M03 spindle direction, G42
corresponds to conventional
milling (up milling).See also the
comments for G41.
G43 Compensation Tool height offset Takes an address, usually H, to
compensation call the tool length offset register
negative value. The value
is negative because it will
be added to the gauge line
position. G43 is the commonly
used version (vs G44).
G44 Compensation Tool height offset Takes an address, usually H, to
compensation call the tool length offset register
positive value. The value
is positive because it will
be subtracted from the gauge
line position. G44 is the seldom-
used version (vs G43).
G45 Compensation Axis offset single
increase
G46 Compensation Axis offset single
decrease
G47 Compensation Axis offset double
increase
G48 Compensation Axis offset double
decrease
G49 Compensation Tool length offset Cancels G43 or G44.
compensation
cancel
G50 Compensation Define the Takes an S address integer which
maximum spindle is interpreted as rpm. Without
speed this feature, G96 mode (CSS)
would rev the spindle to “wide
open throttle” when closely
approaching the axis of rotation.
G50 Compensation Scaling function
cancel
G50 Compensation Position register Position register is one of the
(programming of original methods to relate the
vector from part part (program) coordinate
zero to tool tip) system to the tool position,
which indirectly relates it to the
machine coordinate system, the
only position the control really
“knows”. Not commonly
programmed anymore
because G54 to G59 (WCSs) are a
better, newer method. 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.
G52 Coordinate Local coordinate Temporarily shifts program zero
system (LCS) to a new location. This simplifies
programming in some cases.
G53 Coordinate Machine Takes absolute coordinates
coordinate system (X,Y,Z,A,B,C) with reference to
machine zero rather than
program zero. Can be helpful for
tool changes. Nonmodal and
absolute only. Subsequent blocks
are interpreted as “back to G54”
even if it is not explicitly
programmed.
G54  to  G59 Coordinate Work coordinate Have largely replaced position
systems (WCSs) register (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.
G54.1  P1 to Coordinate Extended work Up to 48 more WCSs besides the
P48 coordinate systems 6 provided as standard by G54 to
G59. Note floating-point
extension of G-code data type
(formerly all integers). Other
examples have also evolved
(e.g., G84.2). Modern controls
have the hardware to handle it.
G70 Canned Fixed cycle,
multiple repetitive
cycle, for finishing
(including
contours)
G71 Canned Fixed cycle,
multiple repetitive
cycle, for roughing
(Z-axis emphasis)
G72 Canned Fixed cycle,
multiple repetitive
cycle, for roughing
(X-axis emphasis)
G73 Canned Fixed cycle,
multiple repetitive
cycle, for roughing,
with pattern
repetition
G73 Canned Peck drilling cycle Retracts only as far as a clearance
for milling – high- increment (system parameter).
speed (NO full For when chip breaking is the
retraction from main concern, but chip clogging
pecks) of flutes is not.
G74 Canned Peck drilling cycle
for turning
G74 Canned Tapping cycle for
milling, lefthand
thread, M04
spindle direction
G75 Canned Peck grooving
cycle for turning
G76 Canned Fine boring cycle
for milling
G76 Canned Threading cycle for
turning, multiple
repetitive cycle
G80 Canned Cancel canned Milling: Cancels all cycles such
cycle as G73, G83, G88, etc. Z-axis
returns either to Z-initial level or
R-level, as programmed
(G98 or G99, respectively).
Turning: Usually not needed on
lathes, because a new group-1 G
address (G00 to G03) cancels
whatever cycle was active.
G81 Canned Simple drilling No dwell built in
cycle
G82 Canned Drilling cycle with Dwells at hole bottom (Z-depth)
dwell for the number
of milliseconds specified by
the P address. Good for when
hole bottom finish matters.
G83 Canned Peck drilling cycle Returns to R-level after each
(full retraction peck. Good for clearing flutes
from pecks) of chips.
G84 Canned Tapping cycle,
righthand thread,
M03 spindle
direction
G84.2 Canned Tapping cycle,
righthand thread,
M03 spindle
direction, rigid
toolholder
G90 Coordinate Absolute Positioning defined with
programming reference to part zero.
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 instead a fixed cycle address
for roughing.
G90 Coordinate Fixed cycle, simple When not serving for absolute
cycle, for roughing programming (above)
(Z-axis emphasis)
G91 Coordinate Incremental Positioning defined with
programming reference to 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.
G92 Coordinate Position register Same corollary info as
(programming of at G50 position register.
vector from part Milling: Always as above.
zero to tool tip) Turning: Sometimes as above
(Fanuc group type B and similarly
designed), but on most lathes
(Fanuc group type A and similarly
designed), position register
is G50.
G92 Coordinate Threading cycle,
simple cycle
G94 Motion Feedrate per On group type A lathes, feedrate
minute per minute is G98.
G94 Motion Fixed cycle, simple When not serving for feedrate
cycle, for roughing per minute (above)
(X-axis emphasis)
G95 Motion Feedrate per On group type A lathes, feedrate
revolution per revolution is G99.
G96 Motion Constant surface Varies spindle speed
speed (CSS) automatically to achieve a
constant surface speed.
See speeds and feeds. Takes
an S address integer, which is
interpreted as sfm in G20 mode
or as m/min in G21 mode.
G97 Motion Constant spindle Takes an S address integer, which
speed is interpreted as rev/min (rpm).
The default speed mode per
system parameter if no mode is
programmed.
G98 Canned Return to initial Z
level in canned
cycle
G98 Canned Feedrate per Feedrate per minute is G94 on
minute (group type group type B.
A)
G99 Canned Return to R level in
canned cycle
G99 Canned Feedrate per Feedrate per revolution is G95 on
revolution (group group type B.
type A)

Sub-Topic #2:  Complete List of M-codes and its description/function.


Content:
Code Function
M00 Program Stop (non-optional)
M01 Optional Stop: Operator Selected to Enable
M02 End of Program
M03 Spindle ON (CW Rotation)
M04 Spindle ON (CW Rotation)
M05 Spindle Stop
M06 Tool Change
M07 Mist Coolant ON
M08 Flood Coolant ON
M09 Coolant OFF
M17 FADAL subroutine return
M29 Rigid Tapping Mode on Fanuc Controls
M30 End of Program, Rewind and Reset Modes
M97 Haas-Style Subprogram Call
M98 Subprogram Call
M99 Return from Subprogram

Sub-Topic #3:  What and how Modal Group Codes functions


Content:

 Many G and M codes cause the system to switch modes, and the mode remains active until
another command, implicitly or explicitly, changes it. Such commands are referred to as "modal."
Modal commands are organized into "modal groups," which are collections of commands. At any
given time, only one member of a modal group can be active. A modal group is a collection of
commands for which it is logically impossible for two members to be active at the same time.
The difference between measuring in inches and millimeters is modal. A machine tool can be in
multiple modes at once, with one mode from each group active.

{G0, G1, G2, G3, G80, G81, G82, G83, G84, G85,
Group 1
G86, G87, G88, G89} - motion
Group 2 {G17, G18, G19} - plane selection
Group 3 {G90, G91} - distance mode
Group 5 {G93, G94} - spindle speed mode
Group 6 {G20, G21} - units
Group 7 {G40, G41, G42} - cutter diameter compensation
Group 8 {G43, G49} - tool length offset
Group 10 {G98, G99} - return mode in canned cycles
{G54, G55, G56, G57, G58, G59, G59.1, G59.2,
Group 12
G59.3} coordinate system selection
Group 2 {M26, M27} - axis clamping
Group 4 {M0, M1, M2, M30, M60} - stopping
Group 6 {M6} - tool change
Group 7 {M3, M4, M5} - spindle turning
Group 8 {M7, M8, M9} - coolant
Group 9 {M48, M49} - feed and speed override bypass

Sub-Topic #4:  Letter Address Codes A-Z (Variable, Description, Definitions) 


Content:

Variable Description Definitions


A,B,C – 4th/5th Axis Rotary Motion

Absolute or incremental position of Rotation about the X, Y or Z-axis


A
Axis (rotational axis around X axis) respectively. The angle is in degrees and
up to three decimal places precision.
G01 A45.325B90.
Absolute or incremental position of
B B axis (rotational axis around Y Same as A
axis)
Absolute or incremental position of
C C axis (rotational axis around Z Same as B
axis)
Used to compensate for tool diameter
wear and deflection is accompanied by an
integer that is the same as the tool number
(T5 uses D5, etc). No decimal point is
used. Itis always used in conjunction with
Defines diameter or radial offset
D G41 or G42 and a XY move (never an
used for cutter compensation
arc). When called, the control reads the
register and offsets the tool path left
(G41) or right (G42) by the value in the
register.
G01 G41 X2. D1
Precision feed rate for threading on
E
lathes
Sets the feed rate when machining lines,
arcs or drill cycles. Feed rate can be in
Inches per Minute (G94 mode) or Inverse
F Defines feed rate Time (G93 mode). Feed rates can be up to
three decimal places accuracy (for tap
cycles) and require a decimal point.
G01 X2.Y0. F30.
G commands often tell the control what
kind of motion is wanted (e.g., rapid
positioning, linear feed, circular feed,
fixed cycle) or what offset value to use.
G Address for preparatory commands
G02 X2.Y2.I.50J0.

This code calls a tool length offset (TLO)


Defines tool length offset. register on the control. The control
combines the TLO and Fixture Offset Z
Incremental axis corresponding to values to know where the tool is in
H
C relation to the part datum. It is always
accompanied by an integer (H1, H2,etc),
axis (e.g., on a turn-mill) G43, and Z coordinate.
G43 H1 Z2.
For arc moves (G2/G3), this is the
Defines arc size in X axis for G02 incremental X-distance from the arc start
or G03 arc commands. point to the arc center. Certain drill cycles
I also use I as an optional parameter.
Also used as a parameter within G02 X.5 Y2. 500I0.J0.250
some fixed cycles.

J Defines arc size in Y axis for G02 For arc moves (G2/G3), this is the
or G03 arc commands. incremental Y-distance from the arc start
point to the arc center. Certain drill cycles
also use J as an optional parameter.
Also used as a parameter within G02 X.5 Y2.500 I0.J0.250
some fixed cycles.

For an arcmove (G2/G3) this is the


incremental Z-distance from the arc start
Defines arc size in Z axis for G02
point to the arc center. In the G17 plane,
or G03 arc commands.
this is the incremental Z-distance for
K helical moves. Certain drill cycles also
Also used as a parameter within use J as an optional parameter.
some fixed cycles, equal to L
G18 G03 X.3 Z2.500 I0.K0.250
address.

Fixed cycle loop count: Defines number


of repetitions (“loops”) of a fixed cycle
at each position. Assumed to be 1 unless
programmed with another integer.
Fixed cycle loop count; Sometimes the K address is used instead
of L. With incremental positioning (G91),
L
Specification of what register to a series of equally spaced holes can be
edit using G10 programmed as a loop rather than as
individual positions.G10 use:
Specification of what register to edit
(work offsets, tool radius offsets, tool
length offsets, etc.).
Always accompanied by an integer that
determines its meaning. Only one M-code
is allowed in each block of code.
M Miscellaneous function
Expanded definitions of M-codes appear
later in this chapter.
M08
Block numbers can make the CNC
program easier to read. They are seldom
required for CAD/CAM generated
programs with no subprograms. Because
Line (block) number in program. they take up controlmemorymost 3D
programs do not use block numbers.
N
System parameter number to be Block numbers are integers up to five
changed using G10 characters long with no decimal point.
They cannot appear before the tape
start/end character (%) and usually do not
appear before a comment only block.
N100 T02 M06
Programs are stored on the control by
their program number. This is an integer
that is preceded by the letter O and has no
O Program name decimal places.
O1234 (Exercise 1)

P Serves as parameter address for Dwell (delay) in seconds. Accompanied


various G and M codes by G4 unless used within certain drill
cycles.
G4 P.1

The incremental feed distance per pass in


a peck drill cycle.
G83 X2.000 Y2.000 Z-.625 F20.R.2 Q.2
Q Peck increment in canned cycles
P9.

Arcs can be defined using the arc radius R


or I,J,Kvectors. IJK’s are more reliable
than R’s so itis recommended to use them
Defines size of arc radius or
instead. R is also used by drill cycles as
R defines retract height in canned
the return plane Z value.
cycles
G83 Z-.625 F20.R.2 Q.2 P9.

Spindle speed in revolutions per minute


(RPM). It is an integer value with no
decimal, and always used in conjunction
Defines speed, either spindle speed
with M03 (Spindle on CW) or M04
S or surface speed depending on
(Spindle on CCW).
mode
S2500M03

Selects tool. It is an integer value always


T Tool selection accompanied by M6 (tool change code).
T01 M06
In these controls, X and U obviate G90
and G91, respectively. On these lathes,
Incremental axis corresponding to G90 is instead a fixed cycle address for
X axis (typically only lathe group A roughing.
controls)
U
Also defines dwell time on some
machines.

Until the 2000s, the V address was very


rarely used, because most lathes that used
U and W didn’t have a Y-axis, so they
didn’t use V. (Green et al 1996 did not
Incremental axis corresponding to even list V in their table of addresses.)
V
Y axis That is still often the case, although the
proliferation of live lathe tooling and
turn-mill machining has made V address
usage less rare than it used to be
(Smid2008 shows an example).
W Incremental axis corresponding to In these controls, Z and W obviate G90
Z axis (typically only lathe group A and G91, respectively. On these lathes,
controls) G90 is instead a fixed cycle address for
roughing.
Coordinate data for the X-axis. Up to four
places after the decimal are allowed and
trailing zeros are not used. Coordinates
Absolute or incremental position of
X are modal, so there is no need to repeat
X axis.
them in subsequent blocks if they do not
change.
G01 X2.250F20.
Coordinate data for the Y-axis.
Absolute or incremental position of
Y
Y axis
G01 Y2.250 F20.
Absolute or incremental position of
Z Coordinate data for the Z-axis.
Z axis

Sub-Topic #5:   Special Character Code Definition


Content:

Definitions of special character codes

The following is a list of commonly used special characters, along with their definitions, applications, and
limitations.

 % – Program Start or End

All programs start and end with a single percent on a single block. A tape rewind character is the name of
this code (a holdover from the days when programs were loaded using paper tapes).

 ( )– Comments

All comments to the operator must be written in capital letters and wrapped in brackets. A comment can
be up to 40 characters long, with all characters capitalized.

(T02: MILL END 5/8)

 / – Block Delete 

If the Block Delete switch on the control is turned on, codes after this character are ignored.

M00/

 ; – End of block

When reading the CNC program in a text editor (carriage return), this character is not visible, but it
appears at the conclusion of every block of code when the program is presented on the machine control.
N8 Z0.750 ;

You might also like