Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
14 views56 pages

05 CNC Manual Part Programming

Uploaded by

SRIHARI MUNNURI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views56 pages

05 CNC Manual Part Programming

Uploaded by

SRIHARI MUNNURI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Dr. Y.

Ravi Kumar
Professor & Head, MED, NITW
— Understand the fundamentals of part programming in terms of
the various steps needed to be taken for completing a successful
CNC part program.
— Comprehend the elements of manual part programming methods
using word address format and the ISO G-coding systems.
— Learn the part programming fundamentals related to the use of
various word addresses.
— Appreciate different preparatory (‘G’ codes) and miscellaneous
functions (‘M’ codes) as used in CNC part programs.
— Write and prove sample part programs for CNC machining centres
in planar milling operations using the word address format.
— Understand the concept of canned or fixed cycles for the hole
making operations
— Learn the use of cutter diameter and length compensation while
using with multiple cutting tools.
22 August 2025 2
Study part print

Machine
Identify machine tool
tool
database

Capability Identify operations


of cutting and tooling
tools Cutting
tool
database
Determine feeds,
speeds, depths, power

Machina-
Prepare set-up sheet bility
with work setting and database
tooling assembly

Develop part program

Simulate tool path

Dry run

Cut the first part

22 August 2025 Inspect the part 3


Proven part
— Process planning
— Axes selection
— Tool selection
— Cutting process parameters planning
— Job and tool setup planning
— Machining path planning
— Part program writing
— Part program proving

22 August 2025 4
choice of the machine tool used depends upon the operations required, accuracy requirements, machine-tool
capability and availability, cutting-tool availability and the shop practices. A careful choice of various options
at this stage helps in deciding the final cost of manufacture of the part. A typical process plan is shown in
Table 13.1 for the part to be machined as shown in Fig. 13.2.

15 15

20

10
Ø6

10
R5

40
10
40

20
100
5

8
15

Fig. 13.2 A typical component for NC machining

Table 13.1 Process plan for the component shown in Fig. 13.2
Op. no. Description Tools

10 End mill the top face, 100 × 100 mm Shell end mill, f60 mm
20 End mill the steps, 20 × 100 × 5 mm Shell end mill, f60 mm
30 Mill pocket, 40 × 40 × 8 mm HSS end mill, f10 mm
22 August 2025
40 Drill the six holes, f6 × 15 mm HSS twist drill, f6 mm 5
354 CAD/CAM: Principles and Applications

Y Y
35 100
70

50
Ø6 20
Ø6

10
30
20
R5 R5

100
X
40

80
40

60
50
40
20
X
15
50 30
85
Z Z

X X

5
8

15
Fig. 13.4 Same part as in Fig. 13.3 but with
Fig. 13.3 Part for NC machining shown with
axes system at the bottom-left corner
axes system at the centre

centre of22the tool.


August As a result, an end mill should always approach the workpiece from the side while
2025 6 the slot
drill can approach from the side or from the top.
22 August 2025 7
22 August 2025 8
22 August 2025 9
(in case of paper tapes) or beginning of a program if direct comput
DNC mode. A part program consists of a large number of blocks (si
Vice
senting an operation to be carried out in the machining of a part.
Fig.
ays starts — 13.7
with
ISO a Set-up
block
standards sheet
number
for codingusedforasa machining
identification centre
and
to program directly the numbers with decimal point. In this book, all the is part
programm
be programmed
Co-ordinate
point— deviating at thefunction
from beginning
the standard, butof every
followingblock. As per ISO
the industry 2539,
practice.
N009, N028.
r dataSince
—to be
Feed However,
eachinput
function
functioninsome
the
is controlby
form
indicated ofmanufacturers,
numerical
its notably
digits
address character, Fanuc
theisorder
preco
ir case, — Speed
only function
phabet. Forthose
important except blocks
example, that thewhich
letter N
N105 are to be come
should
means specifically
thatright addressed
N isinthe
the beginning
address as pe
an
f
d need — Tool
to
placed be
wherefunction
given
the ainformation
block number. for thatOther
block blocks can do
is completed. away
Fanuc with
uses theth
e
erytreat
easily
— G and
Codes quickly process all the data entered in this
M space the ‘Carriage
in the Return’
controller and ‘Line
where Feed’
the part as End of are
programs Block (EOB). In this
stored.
look as
block Mfollows:
— for Codes
easy understanding, though this is not required to be punched in
have one or more of the word addresses as explained above in a sequ
In
N115the variable
G81 block format,
X120.5 Y55.0 the number
Z-12.0 of R2.0
words F150
and characters
M3 are
s shown below:
required in any block then it need not be written and also if the value of an
nextN5 G2 X±53
operation thenY±53
it needZ±53 U..V..W..I..J..K..F5
not be repeated in the block.S4The T4following
M2 * exa
s for Coding
pical sequence
N110 G01inX-312.55
which the Y14.5 word addresses
Z12.565 shouldT1103
F200 S1500 occurM03in the
* bloc
hese addresses
N115 Y187.0
development should
of Z0
22 August 2025
*be presentcontrol,
numerical in each ofstandardisation
the blocks or the has
10
sequenbe
occurIninthe
anyblock
sequence.
for the operation number 110, the value of functions G, X
— A Angular dimension around X axis
— B Angular dimension around Y axis
— C Angular dimension around Z axis
— F Feed function
— G Preparatory function
— H Unassigned
— I Distance to arc centre or thread lead parallel to X
— J Distance to arc centre or thread lead parallel to Y
— K Distance to arc centre or thread lead parallel to Z
— M Miscellaneous function
— N Sequence number
— O Reference rewind stop
— S Spindle speed function
— T Tool function
— U Secondary motion dimension parallel to X*
— V Secondary motion dimension parallel to Y*
— W Secondary motion dimension parallel to Z*
— X Primary X motion dimension
— Y Primary Y motion dimension
— Z Primary Z motion dimension
22 August 2025 11
— G00 Point-to-point positioning, rapid traverse
— G01 Line interpolation
— G02 Circular interpolation, clockwise (WC)
— G03 Circular interpolation, anti-clockwise (CCW)
— G04 Dwell
— G13-G16 Axis designation
— G17 XY plane designation
— G18 ZX plane designation
— G19 YZ plane designation
— G33 Thread cutting, constant lead
— G34 Thread cutting, linearly increasing lead
— G35 Thread cutting, linearly decreasing lead
— G40 Cutter compensation-cancels to zero
— G41 Cutter radius compensation-offset left
— G42 Cutter radius compensation-offset right
— G43 Cutter compensation-positive
— G44 Cutter compensation-negative
22 August 2025 12
— G53 Deletion of zero offset
— G54-G59 Datum point/zero shift
— G63 Tapping cycle
— G64 Change in feed rate or speed
— G70 Dimensioning in inch units/G20 (FANUC)
— G71 Dimensioning in metric units/G21 (FANUC)
— G80 Canned cycle cancelled
— G81-G89 Canned drilling and boring cycles
— G90 Specifies absolute input dimensions
— G91 Specifies incremental input dimensions
— G92 Programmed reference point shift
— G94 Feed rate/min (inch units when combined with G70)
— G95 Feed rate/rev (metric units when combined with G71)
— G96 Spindle feed rate for constant surface feed
— G97 Spindle speed in revolutions per minute
22 August 2025 13
original default settings. Hence care has to be taken by the programmer to understa
operation. This is also mentioned along with the G code description.
A few of the usual preparatory functions which are generally present in all ma
uniformly followed by all controller manufacturers are given below:
Motion group
* G00 Rapid positioning
G01 Linear interpolation
G02 Circular interpolation clockwise
G03 Circular interpolation counter-clockwise
Dwell
G04 Dwell
CNC Programming
369

N045 G04 X3.0 This calls for a stoppage of the control for a period of 3 seconds.
N045 G04 P3000 This calls for a stoppage of the control for a period of 3 seconds. No decimal point
programming with P word address in Fanuc controls.

13.4 MISCELLANEOUS FUNCTIONS, M

These functions actually operate some controls on the machine tool and thus affect the running of the machine.
Generally, only one-M code is supposed to be given in a single block. However, some controllers allow for
two or 22more
AugustM codes to be given in a block, provided these are not mutually exclusive, e.g., coolant
2025 14 ON
(M07) and OFF (M09) cannot be given in one block.
CNC Progra

Active plane selection group


* G17 XY plane selection
G18 XZ plane selection
G19 YZ plane selection
Cutter compensation group
* G40 Cutter compensation, cancel
G41 Cutter radius compensation left
G42 Cutter radius compensation right
Units group
* G70 Inch units
G71 Metric units
Hole-making canned cycle group
* G80 Canned cycle cancel
G81–G89 Canned cycles definition and ON
Coordinate system group
* G90 Absolute coordinate system
G91 Incremental coordinate system
Pre-set
G92 Absolute pre-set, change the datum position
22 August 2025The * sign indicates the generally accepted default or turn-on code in operation.
15 However, s

manufacturers allow this to be modified to whatever suits them. The above is only a possible in
e pre-set, change the datum position
ted default or turn-on code in operation. However, some control
whatever suits them. The above is only a possible indication but

on of the way to use these G codes.

90 and G91 N007 G90 G01 X5.0 Y10.0


n be Y N008 X25.0 Y15.0
eme- N009 X35.0 Y5.0
90 is
olute N007 G91 G01 X5.0 Y10.0
ct to N008 X20.0 Y5.0
er. It N009 X10.0 Y-10.0
d by
B
gram 15
Fig. A
10
C
5
, the
ition 0 X
5 25 35
B-C.
Fig. 13.8 Absolute (G90) and incremental (G91) systems
22 August 2025 16
on
e tocan
be be
Preset, done. Also,
G92
specified the errors in the
in a separate
that does
-axis not happen
machine, the in the case of an
working
bed earlier, each of the machine tools has a
e perpendicular to the spindle
X
machine
selectionreference point. However, this point is
for horizontal-axis
Fig.datum XY plane
13.10 for Fig. 13.11
selection XZ plane selection for horizontal-axis
for horizontal-axis
onvenient to
n in Fig. 13.10. use as a coordinate the milling machines
milling machines
nnterpreted.
of
This NCG70
theallows stands
machine
the for programming
tools
working allow for a ‘floating
to
one
be fixed
lane (Fig. anywhere
13.11). In thein the
casemachining Zenvelope of the machine
Z Z
nits
aresult,
given the programmer
block only X and can Z choose a convenient position on
orth
sified whilewhich
datum, the Y coordinates
may be referred to as ‘program zero point’.
hen
arate block.to be communicated to the NC controller as datum. Y
will
ing have Y G 19 Y
This allows the working to
e of the datum as explained earlier is to suit either the setting
ane (Fig.or
mponent 13.12).
to In the case
simplify the coordinate calculations.
G1
its,
a given block only Y and Z 8
ecessary
ified whilein
one thethe beginning to make the system understand
X coordinates
G17
nits
nate block.
arate datum position of the part, which is different from the
71
eference point. To do this, we make use of the G92 code. The
h was pre machined, is clamped at a suitable position on the
able. A machine
of the known tool
toolsorhas
a setting
a mandrel of known diameter isX
X
emachine
point. However, this
spindle. point
This is is then brought to a known position
tool
her Fig. 13.11 XZ plane selection for horizontal-axis X
nasthe
a coordinate
Fig. 13.9 datum
workpiece XYblank,for called
plane the
selectiontheforset point.
millingThe same is then
machines
the tools allow for
ine a ‘floating milling
vertical-axis
med
The in the part program
machines
using the G92 code. For example, in Fig. 13.12 YZ plane selection for
re in the machining envelope of the machine horizontal-axis milling
, the workpiece of dimensions 200 × 170 × Z30 mm is located
ammer can choose a convenient position on
chine bed with the longer edge along the X-axis. The tip of machines
may be referred to as ‘program zero point’.
ommunicated22toAugust
the NC
2025 controller as datum. G 19 Y 17
explained earlier is to suit either the setting
CNC Programming
365

ing plane

lt turn-on Y
out in the
machines
achines, in X Z
G1
e specified 7
a separate
working
he spindle
ontal-axis
22 August 2025 18
Fig. 13.10 XY plane selection for horizontal-axis
e point A, i.e.,
entered is
N015 G92 X200.0 Y170.0 Z50.0
dinate can be
he workpiece.
op surface by

rogrammable
ositions on the
e controller as
can be simply
This is also be
ch are located
by G53, G54,
22 August 2025 19
Fig. 13.13 Setting the workpiece on
the machine table
This is also be
ch are located
by G53, G54,
Fig. 13.13 Setting the workpiece on
the machine table
N105 G90 G00 X150.0 Y30.0

art Y
A
st.

he
ble
es
he 45° B
C
is
30
A
ny X
20
on 150
he 22 August 2025 20

s). Fig. 13.14 Positioning, preparatory function G00


CNC Programming
367

A to B
0 Y45.0 ZAbsolute
40.0 Programming A to B 367
CNC Programming
70.0 N110 G90 G00 X50.0 Y45.0 Z40.0 Z
ng A to BN120 X90.0 Y90.0 Z70.0
Absolute programming A to B
N110 G90 G00 X50.0 Y45.0 Z 40.0
0 Y45.0 ZIncremental
40.0X90.0 Y90.0
N120 Programming
Z70.0 A to B Z
A
Y
5.0 Z30.0 N110 G90programming
Incremental G00 X50.0 Y45.0A to B Z40.0
ng B to AN120N110 G91G90 X40.0 Y45.0
G00 X50.0 Z30.0
Y45.0 Z 40.0

70
A
Y
N120 G91 X40.0 Y45.0 Z30.0 B

40
0 Y90.0 Z 70.0

70
Incremental programming B to A
B
45.0 Z-30.0

40
N110 G90 G00 X90.0 Y90.0 Z 70.0
nterpolation,N120G01 This code
G91 X-40.0 Y-45.0isZ-30.0
generally 50
45
is to beLinear
cut using a feed
or Straight line rate. When the
Interpolation, G01 This code is generally
90 50 90 45
used line
a straight whenatthea material
given feedis to be cut using
rate, this a feed rate. When the 90 90

odal. If motion
afunction
cut hasis desired along a straight line at a given feed rate, this
to be made from D to E
is used. It is modal. If a cut has to be made from D to E X
e of 250 mm per2025 X
(Fig.2213.16)
August atminute, then
a feed rate themm
of 250 block
per minute, then the block 21

would be Fig. 13.15 Positioning, preparatory


Fig. 13.15 Positioning, preparatory
0 Z-30.0
rpolation, G01 This code is generally 50
45
o be cut using a feed rate. When the 90 90
traight line at a given feed rate, this
. If a cut has to be made from D to E X
f 250 mm per minute, then the block
If a cutPositioning,
Fig. 13.15 has to bepreparatory
made from D to E
X110.0 Y30.0 F250
N115 function
G01 X110.0G00 inY30.0 F250
3 dimensions

r moves all the three Y D


he resultant velocity
e programmed feed

command shown in
100

E
B
30

45.0 Z 40.0
X
Z70.0 F350 20

A to B 110
45.0 Z 40.0
Fig. 13.16 Linear interpolation,
(c) TMH, New Delhi, CAD/CAMpreparatory
Principles function G01
45.0 Z30.0 22F350
August 2025 and Applications by P N Rao, 3rd Ed 22

B to A
100

E
30

When the
X motion is from F to G
N125 G02 X65.0 Y60.0 I35.0 J-10.0 F250
20

110

13.16 When
Linear interpolation, preparatory theG01
function motion is from G to F
N130 G03 X15.0 Y30.0 I-15.0 J-40.0 F250
Y

o be
ed if G
wise F
axis
30

when
20

gram X
15
R3
5

50
22 August 2025 23
e 65
XZ plane. In such cases, it becomes necessary to specify the plane t

Z
Z

Y
A

22 August 2025 Fig. 13.18 Circular interpolation in 24 Fig.


XY plane using G17 plane
cular slot in the XY-plane which can be machined using a slot drill in a
will be the most common form of usage. However, sometimes it may
ofiles in other planes as well. An example is shown in Fig. 13.19 for the
necessary to specify the plane to be used with G17, G18 or G19 codes.

Y
Y A

X 22 August 2025
X 25

ation in Fig. 13.19 Circular interpolation in


— M00 Program stop, spindle and coolant off
— M01 Optional programmable stop
— M02 End of program-often interchangeable with M30
— M03 Spindle on, CW
— M04 Spindle on, CCW
— M05 Spindle stop
— M06 Tool change
— M07 Coolant supply No. 1 on
— M08 Coolant supply No. 2 on
— M09 Coolant off
— M13 Spindle on, CW + coolant on
— M14 Spindle on, CCW + coolant on
— M19 Spindle stop at specified angular position
— M30 Program stop at end tape + tape rewind
22 August 2025 26
CAD/CAM: Principles and Applications

The graphical simulation of the above is shown in Fig.


on the machine tool.

The component to be machined is Y


125
shown in Fig. 13.20. It is assumed
that the pocket is through and
hence only outside is to be 5
R3
machined as a finish cut of the C R1
0
D

pocket. The tool to be used is a 20

100
mm diameter slot drill. If an end 0
R1

75
mill is to be used the program R E

50
should be modified with a hole to

25
be drilled at B first before the end A
mill is used. The setting is done X
25
with point A as reference (0, 0, 0) 65
Z
and the reference axes are along
X
X and Y directions. 10

Slot Drilling Vs. End Milling: Fig. 13.20 Example 13.1 Fig.
https://www.youtube.com/watch
?v=KVP-WZbDyA0
22 August 2025 27

Example 13.2 The component to be machined is sh


Y
125

5
C R1 D R3
0

100
0
R1
75

R E
50
25

A
X
25
65
Z

10 X

N001 G92 X0 Y0 Z0 (absolute presetting at A)


N002 G90 Fig. 13.20 Example 13.1 (absolute
Fig. programming)
13.21 Simulation of the above part program
for the component shown in Fig. 13.20
N003 G00 X25.0 Y25.0 Z2.0 T01 S3000 M03 (tool brought rapidly at B, 2mm above XY plane)
N004 G01 Z-12.0 F120 (tool: 20mm slot drill goes down to full depth)
Example 13.2 The component to be machined is shown in Fig. 13.22. The outer profile needs to be
N005 Y75.0 machined using a slot drill of f16 (proceeds
mm. to C)
N006 X65.0 (proceeds towards right to D)
N007 G02 Y25.0 I0 100
J-25.0 (cuts curved profile till E)
N008 G01
10
X25.0 (proceeds to B)
N009 Z2.0 50
(tool moves 2 mm above the XY plane)
N010 G00 Z50.0 M05 2 holes 8f (spindle stops and
Y
rapidly
98 moves up)
N011 X0 Y0 (rapid move to start position 0,0)
20

N012 M30 50 100


(end of program and tape rewind) 28
machined using a slot drill of f16 mm.
N080 M02 (End of program)
50 100 Y Y
DX
2 holes 8f The reader would have98noticed that the tool
10 20
has been moved along a path which is offset Cutter centre path
50

R
from the originalY contour by a value equal to
2 holes 8f 98
50 100 the radius of the 20cutter. Further, it became R
50 100
necessary to calculate the new intersection

DY
points which sometimes require the use of

a
Y1
R10 trigonometry. For example, see the path taken98

18.757
R10 80 98 Part contour
by a cutter80of radius R as shown in Fig. 13.24.

Y2
18.757
12

To calculate the actual cutter path, it is nec-


10

10 10 10
essary to evaluate the DX and DY using the X1
X
X X
12 following formulae. 18.757 20
20 X2
12 Z 18.757 2
80
&(
Z 2
a
80 __
( ) X #
12
12 DY = R tan
2 X  " =
Fig. 13.24 Offset Tool path for machining
! "#$ $
contours
!
that
5
5 % !
are not parallel to the principal axes
"
90 – a
Fig. 13.22 Component for Example 13.2 DX =Tool
Fig. 13.23 R tan ______
path for machining the
5 ( ) & "#  ) #
N010 G71 G92 X0 Y0 Z0 (Dimensions in ‘mm’, Set point) (" = ! $%& $
component
2 Example 13.22
for !
3.22 Component for Example 13.2 Fig. possibleTool
It is13.23 path for machining
formulaethe % ! "
N015 G90 (Absolute
to derive
component
situations as well.
similar
for of
Further, most
programming)
Example
for other contour
the new 13.22
controllers are pro-
N020 T01 S500 M06 (Tool:
vided with cutter radius 16mm options.
compensation slot drill change
In such cases, speed setting)
N025 G00 Z2.0 M03 (Rapid move to clearance plane)
it is not necessary to calculate such intersection values. The
details are given later.
N030 G01 Z-5.0 F100 (Feedoftothethe
The graphical simulation aboverequired depth)
is shown in Fig. 13.25,
N035 Y80.0 F120 (Cut along
simulating the material-removal straight
process line) tool. Fig. 13.25 Simulation of the above part
on the machine
N040 G02 X20.0 Y98.0 R20.0 F100(Circular move) program for the component
shown in Fig. 13.22
N045 G01 X98.0 (Cut along straight line)
N050 Y20 (Cut along straight line)
N055 G02 X80.0 Y2.0 R18.0 (Circular move)
N060 G01 X18.757 (Straight line to the intersection point)
N065 X2.0 Y18.757 (Straight line to the intersection point)
N070 Z2.0 M05 (Feed to clearance plane Stop spindle)
N075 G0 X0 Y0 Z0 (Rapid to set point)
N080 M02 (End of program)
h the single tool. However, in cases where there is more than one tool,
e, if the programmer has to take care of the individual tool lengths for the
374 CAD/CAM: Principles and Applications
h in each case.
easured in the Z 13.6 TOOL-LENGTH COMPENSATION Tool
1 2 3 4
er as explained In the programs discussed so far, only one tool was used to perform the machining function. Henc
workpiece setting is performed with the single tool. However, in cases where there is more than one
is always kept programming becomes cumbersome, if the programmer has to take care of the individual tool lengths f
being used, the purpose of programming the Z depth in each case.

L2
In NC practice, all tools are measured in the Z Tool
he pre-setting 1 2 3 4

L4
assembled state using a tool pre-setter as explained
entered and in Chapter 11, and this information is always kept
up to date (Fig. 13.26). For the tools being used, the
ber. Whenever L3

L2
difference in length, with respect to the pre-setting

L4
tool, is recorded and is manually entered and
y programmed stored with the associated tool number. Whenever L3
sation values these tools are called into action by programmed
X
instruction, the respective compensation values
n into account are activated and automatically taken into account
wing program in the tool motion. The following program
example explains how tool-length compensation
compensation is automatically taken care of.
Fig. 13.26 Tool-length compensation
______________
Fig.
N003 M06 T01 Tool-length compensation
13.26
______________
______________
N006 M06 T02
______________
22 August 2025 30
______________
In these program blocks, M06 refers to tool change and T01, T02, ... refer to the tools to be lo
— Canned cycle or fixed cycles are the G-codes used to
combine a number of common motions that are used
with some types of operations such as drilling of
holes.

22 August 2025 31
derived in using the canned cycles can be gauged by looking at the pa
shown in Fig. 13.28.

N G81 X Y Z R

B
Rap
id
70
Clearance plane 50
35

Rapid
depth
Hole

Feed
A

25
Z
Breakthrough
distance

22 August 2025 32
Fig. 13.27 Typical motions embedded in Fig. 13.28
CNC Programming

such as drilling, reaming, tapping, etc. The advantages to be


ged by looking at the part programs below for the component

Y Without canned cycle:


100 N010 G00 X25.0 Y35.0 Z2 *
N015 G01 Z-18.0 F125 *
N020 G00 Z2 *
D
N025 X55.0 Y50.0 *
C N035 G01 Z-18.0 F125 *
B
f1
0
100 N040 G00 Z2 *
70 N045 X75.0 Y70.0 *
50 N050 G01 Z-18.0 F125 *
35
N055 G00 Z2.0 *
A
X
N065 X0 Y0 Z50 *
25
Z 55
75 With canned cycle:
X N010 G81 X25.0 Y35.0 Z-18.0 R2.0 F125*
N015 X55.0 Y50.0 *
15

N020 X75.0 Y70.0 *


Fig. 13.28 Example for canned cycles N025 G80 X0 Y0 Z50 *
22 August 2025 33

NC program for drilling the three holes without using canned


Canned Feed from At programmed depth (end Used for
cycle surface of feed point)
number Dwell Spindle Spindle
speed return
motion
G80 Off -- Stop -- Cancel canned cycle
G81 Constant -- -- Rapid Drilling, centre drilling
G82 Constant Yes -- Rapid Counter sinking, Counter boring
G83 Intermittent -- -- Rapid Deep hole drilling
G84 Constant -- Reverse Feed Tapping
G85 Constant -- -- Feed Reaming
G86 Constant -- Stop Rapid Boring
G87 Constant -- Stop Manual Multiple Boring
G88 Constant Yes Stop Manual Boring
G89 Constant Yes -- Feed Boring

22 August 2025 34
G88 Constant Yes N045
StopT02 S800 M06 Manual (Finish drill the f 20 hole)
Boring
N050 G81 X25 Y25 Z-13 R2 F125 M03
G89 Constant Yes — Feed Boring
le 13.3 The component to be machined is shown in Fig. 13.29. Write a program using canned
N055 G80 X-50 Y0 Z50 M05 CNC Pro
N060 T03 S800 M06 (Finish Drill the f 10 377
holes)
cycles to drill all the holes shown in Fig 13.29.
N065 G81 X25 Y75 Z-13 R2 F125 M03
CNC Programming

G81 is a canned cycle, which is modal. As 2a×result, for any point specified
2 × Ø 10 50
when G81 is in force the drilling
mm dia holes 10
% Ø 10 mm dia holes
action will be repeated. As a result, to cancel theN070 cannedX75 Y25
cycle, it is necessary to use the code G80. The 50 effect 10
N075 G80 X-50 Y-50 Z50 M05
1303
of G80 is to cancel the existing canned cycle inN080 force and make G00 operational. Any coordinates to which
T00 M05
the spindle should move can be programmed in N090 the G80M02 block.
010 G71 G92 X0 Y0 Z50
There are a number of canned cycles identified by
The graphical
100
ISO in this
simulation category.
of the Example 13.3Theistypical
shown inmotions embedded in
015 G90
various canned cycles as per ISO are shown Fig. 13.30, simulating the material-removal
in Table 13.2. Ø 20 process on the
machine tool.
020 T01 S800 M06 100 50
Example 13.3 The component to beExamplemachined 13.4is shown in Fig.to13.29.
The component be machinedWrite a program
is shown
Ø 20using canned
025 G82 X25 Y25 Z-5 R2 P2 F125 M03 (Centre drill all holes)
cycles to drill all the holes shown incanned in Fig. 13.31. Write a program using
Fig 13.29.
cycles
100 to drill all the holes shown
030 X25 Y75
% in Fig 13.31. All dimensions in mm 50
Fig. 13.30 Simulation of the program
% 13.29 Component for NC program in Example 13.3 for Example 13.3
035 X75 Y25
O1303 Fig.
O1303
N010 G71 G92 X0 Y0 Z50 N045 T02 S800 M06
040 G80 X-50 Y0 Z50 M05 N010 G71 G92 X0 Y0 Z50
(Finish drill the f 20 hole)
N050 G81 X25 Y25 Z-13 R2 F125 M03 100
N015 G90 N015
N055 G80 X-50 Y0 G90
Z50 M05
N020 T01 S800 M06
N060 T03 S800 M06 (Finish Drill the f 10 holes) All dimensions in mm
N020 T01 S800 M06
N025
N065 G81 X25 Y75 Z-13G82 X15 M03
R2 F125 Y15 Z-5 R2 P2 F125 M03 (Centre drill all holes)
N025 G82 X25 Y25 Z-5 R2 P2 F125 M03 (Centre
N070 X75 Y25 N030 X135 Y15 drill Fig.
all 13.29
holes) Component for NC program in Example 13.3
N075 G80 X-50 Y-50
N035Z50X75
M05Y50
N030 X25 Y75 N080 T00 M05 N045 T02 S800 M06 (Finish drill the f 20 hole)
N035 X75 Y25 N090 M02
The graphical simulation ofN050 G81 13.3
the Example X25is Y25
shownZ-13
in R2 F125 M03
N040 G80 X-50 Y0 Z50Fig.
M05 13.30, simulating the material-removal
N055 G80 X-50 processY0
on Z50
the M05
machine tool.
N060 T03 S800 M06 (Finish Drill the f 10 holes)
Example 13.4 The component to be machined is shown
N065Write
in Fig. 13.31. G81aX25 Y75using
program Z-13 R2 F125 M03
canned cycles to drill all the holes shown
N070 X75 Y25
in Fig 13.31. Fig. 13.30 Simulation of the program
% N075 G80 X-50 Y-50 Z50 M05 for Example 13.3
O1303
N080 T00 M05
N010 G71 G92 X0 Y0 Z50
22 August 2025 35
N015 G90 N090 M02
N020 T01 S800 M06
The graphical simulation of the Example 13.3 is shown in
M02
N065 G81 X25 Y75 Z-13 R2 F125 M03
al simulation of the Example 13.4 is shown in Fig. 13.32, simulating the material-removal
N070 X75 Y25
e machine tool. 4 × Ø 10 mm
13.4 N075
The G80
component to be machined is shown
X-50 Y-50 Z50 M05 75
dia holes
4 × Ø 10 mm 15 Ø 20
in Fig.
N080 T00 13.31. Write a program using
M05dia holes
75
canned
N090 M02Ø 20cycles to drill all the holes shown
The graphical
in Figsimulation
13.31. of the Example 13.3 is shown in Fig. 13.30 Simulation of the progra
Fig. 13.30, simulating the material-removal process on the
machine tool.
100 for Example 13.3
3Example 13.4 The component to be machined is shown
G71 G92 X0 Y0in Z50 Fig. 13.31. Write a program using
378 CAD/CAM: Principles and Applications
15
canned cycles to drill all the holes shown 150
G90 150
in inFig
All dimensions mm13.31.
All dimensions in mm
Fig. 13.30 Simulation of the program
% N030 X135 Y85 Fig. for Example 13.3 for NC program
T01
.31 S800
Component
in Example
M06
for
13.4
NC program Fig. 13.32 Simulation of the program
N035 X15
for Example 13.4Y85
13.31 Component
in Example 13.4
Fi
O1303
G82 X15
N010 Y15
G71 Z-5
G92 X0 R2
Y0 P2
Z50 F125 M03 (Centre
N040 G80 X-50 Y0drill
3.5 The component to be machined is shown in Fig. 13.33. All the hole-making operations
Z50 M05 all holes)
N045 T02 S800 M06Example 13.5 The component to be
(Finish drill themachined
20 hole)is shown in
X135 N015
are toY15 G90
be machined using the tools specified.
N050 G81 X75 Y50 Z-13 R2 F125 M03
are to be machined using the tools specifi
be noted in the above component is that the top surface is at three different levels as such,
N020 T01 S800 M06 The point to be noted in the above component is that the top
X75
plane willY50
be different for each of these planes. Hence, the part
N025
unt while using theG82 X15 Y15
appropriate Z-5 cycle.
canned R2 P2TheF125
N055
M03part program
following
G80will
program
(Centre
X-50
haveY0toZ50
the
drill all
machines the
takeM05
clearance plane will be different for each of these planes.
holes)
part
N060 T03 S800 M06 (Finish
this into account while using drill the 10canned
the appropriate holes)cycle. Th
N030 X135 Y15 N065 G81 X15 Y15completely.
Z-13 R2 F125 M03
N035 X75 Y50 N070 X135 Y15
N035 X135 Y85
N030 X15 Y85
N075 G80 X-50 Y-50 Z50 M05
22 August 2025
N080 T00 M05 36
N090 M02
20
84N180 X20 Y84 84
Y 115 40
N185 G80 95
X95 Y16 Ø6 60
N190
34 G84 X95 Y16 Z-23 R-6 F300
80 40
N195 Y84 16
Fig. 13.33 Component
N200 X115 X
20
N205 Y16 %
84 40 84
N210 G80 Z2 M05 O1245
Ø660 60

34
N215 T00 M06 40 N010 tool:
G71 G92 X0 Y0 Z50
8 Cutting
N220 G0 Z50 20 16
X 10 1. N015
CenterG90
drill
N225 40 X0 Y0 2. Twist drill Ø 6 mm
20 N020 T01 S800 M06
3. Twist drill Ø 8.5 mm
40
N230 60
M02 4. N025 G82 X20 Y34 Z-5 R2 F125 M03
Top M10
The graphical 20simulation 8 of the above is shown in Fig. 13.34 Simulation
Cutting tool:
1. Center drill
N030 X20of the
Y84above part program for
10
Fig. 13.34,
40 simulating Fig. the
13.33 Component for
material-removal NC
2.process
Twist drillprogram
Ø 6 mm in Example
for the13.5
component shown in Fig. 13.33
3. Twist drill Ø 8.5 mm N035 G80 X60 Y16
on the machine tool. 4. Top M10
N040 G82 X60 Y16 Z-25 R18 F125
% Fig. 13.33 Component for NC program in Example 13.5
N045 Y40
O1245 CUTTER-RADIUS COMPENSATION
13.8 N050 Y60
%
O1245N010 G71 G92 X0 Y0 Z50
In contouring operations, it becomes necessary to calculate the toolN055 path Y84
for preparing the program by
N015 G90
N010 G71 G92 X0 Y0 Z50
N06013.35
G80 Z6
offsetting
N015 G90 the contour by an amount equal to the radius of the cutter. Figure shows the part contour and
N020
theT01
N020 tool T01
S800path
S800 M06
M06 for a typical component. (Centre drillApart from(Centre
all holes) the problem drill all holes) N065one
of calculating, G82should
X95 Y16 Z-13that
realise R6 F125
whenever
N025 N025
theG82 X20 G82
cutter Y34 X20
Z-5
size R2 Y34M03
F125
changes, Z-5the
R2program
F125 M03 would need editing. However, if aN070 compensation
Y84 equal to the radius of
N030 X20 Y84
theN030
cutterX20
N035 G80 X60 Y16
Y84
is entered and stored in the control system, then the programN075 could be written for the component
X115
profile
N040 N035
G82 X60and
Y16 thus
G80 X60
Z-25 R18no
Y16 change in program would be required. It is as if the
F125 program is written with a cutter of
N080 Y84
zero
N045 Y40radius.
N04022 G82August 2025
X60 Y16 Z-25 R18 F125 37
N050 Y60 N085 G80 Z2 M05
N045 Y40
N055 Y84
N125 G81 X20 Y34 Z-15 R2 F125 M03
N090 T02 S800 M06 N130 X20drill
(Finish Y84the f 6 holes)
N095 G81 X60 Y16 Z-43 R18 F125 N135 G80 X95 Y16
N100 Y40 N140 G81 X95 Y16 Z-23 R-6 F125
N105 Y60 N145 Y84
N110 Y84 N150 X115
N115 G80 Z2 M05
N155 Y16
N120 T03 S800 M06 (Pre-drill the tapped holes)
N160 G80 Z2 M05
N125 G81 X20 Y34 Z-15 R2 F125 M03
N165 T04 S200 M06 (Tap all the h
N130 X20 Y84
N135 G80 X95 Y16
N175 G84 X20 Y34 Z-15 R2 F300 M03
N140 G81 X95 Y16 Z-23 R-6 F125 N180 X20 Y84
N145 Y84 N185 G80 X95 Y16
N150 X115 N190 G84 X95 Y16 Z-23 R-6 F300
N155 Y16 N195 Y84
N160 G80 Z2 M05 N200 X115
N165 T04 S200 M06 (Tap Y16
N205 all the holes)
N175 G84 X20 Y34 Z-15 R2 F300 M03 N210 G80 Z2 M05
N180 X20 Y84 N215 T00 M06
N185 G80 X95 Y16
N220 G0 Z50
N190 G84 X95 Y16 Z-23 R-6 F300
N225 X0 Y0
N19522Y84
August 2025 38
N230 M02
N200 X115
G40: Compensation ‘OFF’
G41: Cutter is on the left of the programmed path
381
G42: Cutter is right on the programmed path CNC Programming

10 30 12 70 90
0

10

20
Programmed R28
path
72
40
Offset path
of cutter

R3 31
60

40
80 74

22 August 2025 39
Fig. 13.35 Cutter radius compensation
382 CAD/CAM: Principles and Applications

Set point
Y A
1 G42
2

110 G40
6

90

140

X
60
3
4

N030
Fig. 13.36G42 G00showing
Example X110theY140 (Start-up
cutter-radius compensation usingcommand
the G codes G42A-1)

During N035 G01


the start-up moveX0 (A F120 (Move
– 1), the tool is actually positioned 1 – which
at a point 2) is normal to the next
N040
move, shown in Fig.Y0
13.36 as 1. This move is called the ramp-on (Move 2 –
move. Similarly,3)when the compensation is
cancelled, the tool will be positioned at a point normal to the previous move shown as 6 in Fig. 13.36. This is
termed theN045
ramp-offX60
move. (Move 3 – 4)
Example N05013.6 X110 Y50program will illustrate the use(Move
The following 4 – 5) functions. Figure 13.33
of these preparatory
N055 Y140 (Movesurface
shows the top view and the top of the component 5 – is6)taken as Z = 0.
%
N060
N010 G71 G92 X0G40
Y0 Z50.0G00 X160(AbsoluteY170 (Cancel
pre-set at A, 50 mm compensation,
above work surface) 6 – A)
N020 G90 (Absolute programming)
cancelled, the tool will be positioned at a point normal to the previous move shown as 6 in Fig. 13.36. This is
K
termed the ramp-off move.

Example 13.6 The following program will illustrate the use of these preparatory functions. Figure
L 13.33
f 42
shows the top view and the top of the2 component surface is taken as Z = 0.
CNC Programmi
0
% 100
A
N010 G71 G92 X0 Y0 Z50.0 (Absolute pre-set at A, 50 mm above work surface) 200
N020 G90 (Absolute programming) 60 41
F
N030 T01 M06 G
B C
N040 G00 Z2 M03 S600 (Rapid plane positioning)
N050 G41 G01 X100 Y-60 F100 (cutter compensation ON; tool moves 1 20 the path left of the
along
K
f
programmed contour) f2 42 L
0
N055 Z-5.0 (Move to required depth) 200
N060 X300.0 E D
N070 Y-260.0 J f1
20

N080 X100.0 H
E D
N090 Y-60.0 200 J
N100 G40 G00 X0 Y0 (cutter radius compensation OFF) H
200
Fig.T013.37
N110 Z50.0 M05 Example showing
(compensation value the cutter
for tool radius
T1 cancelled) compensation using the G codes G41 and G4
Fig. 13.37 Example showing the cutter radius compensation using the G codes G41 and G4
N120 M06 T02 (Second tool for internal profile)
N130 X200.0 Y-120.0 Z2.0 S600 M03
N130 X200.0 Y-120.0 Z2.0 S600 M03 N140 G01 Z-5.0 F100
N150 G42 Y-100.0 (cutter compensation ON; tool path right of programmed contou
N140 G01 Z-5.0 F100 N160 G02 I0 J-60.0
N170 G00 Z50.0
N150 G42 Y-100.0 (cutter compensation ON; tool path right of programmed contou
N180 G40 X0 Y0 M05
N190 T0 M06
N160 G02 I0 J-60.0 N200 M02
In the block N050, the programmed position is B, but the cutter centre comes to the position
N170 G00 Z50.0 that BF is perpendicular to the next move BC (Block N060), programmed in the next block. AF is som
called ‘ramp-on-move’ in view of its shape. Similarly, in the block N150, the programmed position
N180 G40 X0 Y0 M05 the cutter centre attains the position M, such that LM is perpendicular to the direction of the nex
i.e., tangent to the circle (Block N160). In the block N100, the compensation is deactivated by t
G40, which is entered after the programmed position B. The cutter stops at K, such that KB is perp
N190 T0 M06 lar to the direction of the previous move, i.e., EB. KA is called `ramp-off move’.
In the blocks N110 and N180, T0 causes cancellation of the compensation values for the tool in
N200 M02 at that time. Radius compensation is also used when similar profiles are to be cut with different de
cut, e.g., rough cut and finish cut. When a rough cut is made, a compensation equal to the thicknes
in the register against the identifier 03. R10
70.432
mple 13.7 A complete part program using the 84.574
ISO codes for the following component for the
external contour for the component is shown in Fig. 13.38 using the cutter radius
compensation. 20
46.642 91.645
70.432 R10 120 77.503
R15
84.574 R10 R15
39.471 33
25.607
20 15 22.5 10
46.642
4.393 120
N020 T01 M06
91.645
77.503
R15 53.713 R15 N025 G42 G00 X0 Y0 Z2 D1
R10
39.471 124.85333
25.607
15 22.5
N030 G01 Z-10 F120 M03
134.799
10
4.393 N035 G01 Y15
10
53.713
N040 G02 X4.393 Y25.607 R15
124.853
134.799 N045 G01 X70.432 Y91.645
Fig. 13.38 Example for contour programming using the cutter-radius compensation
10N050 G02 X 84.574 Y77.503 R10

% N055 G01 X46.642 Y39.571


Fig. 13.38 Example for contour programming using the cutter-radius compensation
N010 G71 G92 X-100 Y-100 Z50 N060 G03 X53.713 Y22.5 R10CNC Programming
385
% N015 G90 N065 G1 X120
N020
N010 G71 G92 T01Y-100
X-100 M06Z50 N070 G02 X134.8 Y10 R15
N015 G90 N025 G42 G00 X0 Y0 Z2 D1
N075 G01 X124.853 Y0
N030 G01 Z-10 F120 M03
N080 X0 Y0
N035 G01 Y15
N040 G02 X4.393 Y25.607 R15 N085 Z2
Fig. 13.39
N045 G01 X70.432 Y91.645 N090 G40 G00 X-100 Y-100 Z50 M05
N050 G02 X 84.574 Y77.503 R10 N095 T00 M06
22 August 2025 42
N055 G01 X46.642 Y39.571 N100 M02
N060 G03 X53.713 Y22.5 R10
practice.

Example 13.8 A complete part program using the ISO codes for the following component for the
different holes present in the component is shown in Fig. 13.40. The cutting speed to
be used is 50 m/min and the feed rate is 0.08 mm/rev. Use the lower left-hand corner of the part as the
datum.

Drill Ø 7 mm thru
counterbore Ø 10 × 7 mm deep Drill Ø 5 mm thru
(2) places Bore Ø 5.5 mm thru
Ream Ø 6 + 0.00 thru
A + 0.005

37.5
386 CAD/CAM: Principles and Applications
Y
12.5
X
The part requires multiple
12.5
operations basedAon the information given in the part drawing. The operations
18.75
and tools required are the following:
62.5

Op. no Description Tooldrawing


Fig. 13.40 Part requiredfor Example 13.8 Spindle, RPM Feed, mm/min

10 Drill two holes Twist drill 7 mm dia 2200 175


20 Counterbore two holes End mill 10 mm dia 1590 125
30 Drill two holes Twist drill 5 mm dia 3180 250
40 Bore the two holes Boring bar 5.5 mm dia 2890 230
50 Ream two holes Reamer 6 mm dia 2650 210

Given V = 50 m/min and f = 0.08 mm/rev


1000 V 1000 × 50
Spindle speed, N = ______ = _________ = 2273.64 rpm
pD p×7
Feed22toAugust
be used
2025= 0.080 × 2200 = 176 mm/min 43
Similar calculations can be done for all other tools and the values are filled in the above table which are
used for writing the part program as shown below: Here, a number of examples for CNC programs from simple to a little more complex are giv
O1308 (Ppractice.
N Rao)
%
N010
O1308
G71 G92 X0 Y0 Z50 (September 22, 2008)
(P N Rao)Example 13.8 A complete part program using the ISO codes for the following component
N015
N010 G90
G71 G92 X0 Y0 Z50 (Stock 22,
(September 75 x2008)
50different
x 20 mm)
holes present in the component is shown in Fig. 13.40. The cutting sp
be used is 50 m/min and the feed rate is 0.08 mm/rev. Use the lower left-hand corner of the part
N020
N015 T01
G90 S2200 M06 (Stock(Drill
75 x750
datum. mm diameter)
x 20 mm)
N025
N020 G81 X12.5M06
T01 S2200 Y37.5 Z-22.0 R2.0 F175 M03 (Drill(Start
7 mm drilling)
diameter) Drill Ø 7 mm thru
counterbore Ø 10 × 7 mm deep Drill Ø 5 mm thru
N030
N025 X62.5 Y12.5
G81 X12.5 Y37.5 Z-22.0 R2.0 F175 M03 (Start drilling) (2) places Bore Ø 5.5 mm thru
Ream Ø 6 + 0.00 thru
+ 0.005
N030 G80
N035 X62.5X-50.0
Y12.5 Z50.0 (End of cycle) A

N035 T02
N040 G80 X-50.0
S1590 Z50.0
M06 (End(End
of cycle)
mill 10 mm diameter)
N040 G82
N045 T02 S1590
X12.5M06
Y37.5 Z-7.0 P1.0 R2.0 F125 (End mill 10 mm diameter)
N045 X62.5
N050 G82 X12.5 Y37.5 Z-7.0 P1.0 R2.0 F125
Y12.5 386 37.5CAD/CAM: Principles and Applications
N050 X62.5 Y12.5
N055 G80 X-50.0 Z50.0 (End of cycle) Y
N055 G80 X-50.0 Z50.0 (End of cycle) 12.5
N060 T03 S3180 M06 (Drill 5 mmThe
diameter)
part requires
X multiple operations based on the informat
N060 T03 S3180 M06 (Drill 5 mm diameter) 12.5 A
N065 G81 X12.5 Y12.5 Z-22.0 R2.0 F250 and tools required are
62.5 the following:
18.75
N065 G81 X12.5 Y12.5 Z-22.0 R2.0 F250
N070
N070 X62.5 Y37.5
X62.5 Y37.5
Op. no Description Tool
Fig. 13.40 Part drawing for Example required
13.8

N075
N075 G80 X-50.0Z50.0
G80 X-50.0 Z50.0 (End(End of cycle)
of cycle) 10 Drill two holes Twist drill 7 mm dia
N080
N080 T04 S2890M06
T04 S2890 M06 (Bore(Bore 5.5diameter)
5.5 mm mm20 diameter)
Counterbore two holes End mill 10 mm dia
N085
N085 G86 X12.5Y12.5
G86 X12.5 Y12.5Z-22.0
Z-22.0 R2.0
R2.0 F230
F230 (Boring
(Boring cycle)cycle)
30 Drill two holes Twist drill 5 mm dia
N090 X62.5
N090 X62.5 Y37.5
Y37.5 40 Bore the two holes Boring bar 5.5 mm dia
N095 G80
G80 X-50.0 50 Ream two holes Reamer 6 mm dia
N095 X-50.0Z50.0
Z50.0 (End(End
of cycle)
of cycle)
N100 T05
N100 T05 S2650
S2650M06
M06 (Reamer 6 mm6diameter)
(Reamer mm diameter)
Given V = 50 m/min and f = 0.08 mm/rev
N105 G85
N105 G85 X12.5
X12.5Y12.5
Y12.5Z-22.0 R2.0
Z-22.0 F210
R2.0 F210 (Reaming cycle)
(Reaming cycle) CNC Programming
387
1000 V 1000 × 50
N110 X62.5 Y37.5
N110 X62.5 Y37.5 Spindle speed, N = ______ = _________ = 2273.64 rpm
pD p×7
N115 G80 X-50.0 Z50.0 M05 (End of cycle)
Feed to be used = 0.080 × 2200 = 176 mm/min
N120 G00 X-50.0 Y-50.0 Similar calculations can be done for all other tools and the
22 August 2025 for writing the part program as shown44below:
N130 M02 (End ofused
program)
The graphical simulation of the Example 13.8 is shown in %
f cycle) machine tool.
mill 8 mm 13.9
Example diameter)
A complete part program using the ISO Drill Ø 5 mm thru
Example 13.9
codes A following
for the completecomponent
part program
for theusing the ISO and tap M6
codes foris the
different holes present in the component following
shown component for the
in Fig. 13.42. A 12.5
(3) equally spaced holes
f The
cycle) 28.2843 28.2843 R40
partdifferent holes present
requires multipleR52.5 in the
operations component
based R52.5 is shown in Fig. 13.42.
on the information
5given
mmindiameter)
theThe
partpart requires
drawing. multiple operations
The operations and tools based on
required arethe information
45° 45° 12.5
given below.
R12.5 R12.5 12.5
given in the part drawing. The operations and toolsFig. required
13.41 are
Simulation of the program
given below. A 16 16
for Example 13.8 Simulation of the program
A Fig. 13.41 28.2843
R52.5
Op. no Description SECTION A-A ToolSECTION
required A-A for Example 13.8
Drill Ø 5 mm thru Drill Ø 5 mm thru
Op. no counter × counter
Ø 8Description
borehole bore Ø 8 × 10 mm deep
10 mm deep 45°
mm diaTool required 12.5
f cycle) 10 Drill one Twist drill 5 R12.5
20 Counter bore one hole End mill 8 mm dia
A 16
achine tap) Fig.10
13.42 Fig. 13.42
Part drawing Parthole
drawing
for Example
Drill one 388 for
13.9 Example 13.9 Twist drill 5 mm dia
CAD/CAM: Principles and Applications
30 Drill three holes Twist drill 5 mm dia SECTION A-A
20 Counter Drill Ø 5 mm thru
40 Tapping the three holes bore one hole Machine tap M6 End mill 8 mm dia
tumChoose
as the the datum
centre of as the centre of the bottom
30the bottom left-hand hole.
Drill
left-hand hole.
three holes
counter bore Ø 8 × 10 mm deep
Twist drill 5 mm dia
N025 M03
% Part drawing for Example
40 Tapping the three holes N030 G81 X0 Y0 Z-20.0
Drill Ø 5 mm thru
Fig.
R2.013.42
Machine tap M6
F80 (Start drilling) 13.9
O1309 (P N Rao)
and tap M6
(P N Rao)
N035 G80 X-50.0 Z50.0 (End of cycle)
f cycle) N010
71 G92 X0 Y0 Z50 G71 G92 X0 Y0 Z50 (3) equally (September
spacedChoose
holes
(September 22, 2008) N040 T02 S800 M0622,
the 2008)
datum as the c entre of the bottom left-hand hole.
A 12.5
Drill Ø 5 mm thru (End mill 8 mm diameter)
90 N015 G90 (Stock 65R40 x 65 x 16(Stock
mm) 65%x 65 x 16 mm)
and tapN045M6G82 X0 Y0 Z-10 P1 R2 F80
N020 T01 S800 M06 (Drill 7 O1309
mm (P N Rao)
f program)
1 S800 M06 (Drill
A
7 mm
12.5
diameter) (3) N050diameter)
equally spaced holesZ50.0
G80 X-50.0 (End of cycle)
N010 G71 G92 X0 Y0 Z50
R40 (September 22, 2008)
wn in N055 T03 S800 M06 (Drill 5 mm diameter)
N015 G90 (Stock 65 x 65 x 16 mm)
the 28.2843 N060 G81 X40 Y0 Z-20.0 R2.0 F80
R52.5 N020 T01 S800 M06 (Drill 7 mm diameter)
N065 X28.284 Y28.284
R12.5
45° 12.5 N070 X0 Y40.0
28.2843
N075 G80 X-50.0 Z50.0 (End of cycle)
R52.5 16
ISO A
N080 T04 S200 M06 (M6 Machine tap)
r the Drill Ø 5 mm thru 45°
SECTION A-A
N085 G84 X40 Y0 Z-16.0 R2.0 F200
R12.5counter bore Ø 8 × 10 mm deep 12.5
44. N090 X28.284 Y28.284
A 16
ation Fig. 13.42 Part drawing for Example N095
13.9X0 Y40.0
SECTION A-A
d are Drill Ø 5 mmN100
thru G80 X-50.0 Z50.0 M05 (End of cycle)
Choose the datum as the centre of the bottom left-hand hole.boreN110
counter Ø 8 ×G00
10 mm deep
X-50.0 Y-50.0
22 August 2025 45
% N120 M02 (End of program)
O1309 Fig. 13.42 Part drawing for Example 13.9
(P N Rao)
Example 13.10
machine tool.
A complete part program using the ISO 12.5
Drill Ø7 mm thru Section A-A
codes for the following component for the Counterbore Ø10 mmx 7 mm deep

17.6777
different Example 13.10
holes present in the component
A complete shown
partin program
Fig. 13.44.using the ISO 389
(4) equally spaced holes
CNC Programming
codes for
The part requires multiple operations the on
based following component for the
the information A DrillFig.
Ø513.44
for M6 Part drawing for Example 13.10
tap (4) places
given indifferent
the part drawing. The operations
holes present and tools required
in the component shown inareFig. 13.44. 80

17.6777
given below The part requires multiple operations based on the information N025 G81 X17.678 Y17.678 Z-16.0 R2.0 F80 (Start drilling)
Drill Ø5 for M6 Ø50
Op. no given in the part drawing. The
Description A
operations
Tool requiredand
tap (4) tools
places required are 17.6777 N030 X-17.678 Y17.678 1
Fig. 13.43 Simulation ofX-17.678
N035 the program
Y-17.678 Ø62.5
given below
10 Drill four holes Twist drill 7 mm dia for Example 13.9
N040 X17.678 Y-17.678
17.6777 Ø50
20 Op. no Description
Counter bore four holes End mill 10 mmTooldia
required N045 G80 X-50.0 Z50.0 Fig. 13.45 Simulation of the program for
(End of cycle) F
Ø62.5 Fig. 13.43 Simulation of the program Example 13.10
30 Drill four holes Twist drill 5 mm dia N050 T02 S800 M06 (End mill 10 mm diameter)
10 Drill four holes Twist drill 7 mm dia A
for Example 13.9 Ø37.5 Given V = 30 m/min and f = 0.08 mm/rev
40 Tapping the four holes Machine tap M6 N055 G82 X17.678 Y17.678 Z-7 P1 R2 F80 1000 V 1000 × 30
20 Counter bore four holes End mill 10 mm dia Spindle speed, N = ______ = _________ = 1591 rpm
pD p × 12
Ø37.5 N060 X-17.678 Y17.678
30datum as the
Choose the Drillcentre
four holes
A of the circle in view Twist
of thedrill 5 mm dia
symmetry of the geometry.
N065The coordinates
X-17.678 Y-17.678
Feed
12.5
to be used = 0.080 × 1590 = 127 mm/min
Similar calculations can be done for all other tools an
can then be40 Tapping
easily calculated the they
since four holes Machine
are all symmetrical tapthe
about M6datum. Drill Ø7 mm thru Section A-A
used for writing the part program as shown below:
N070 X17.678 Y-17.678
Counterbore Ø10 mmx 7 mm deep
12.5 Op. no Description Tool required
% Drill Ø7 mm thru Section A-A N075 G80 X-50.0 spaced
(4) equally Z50.0 holes (End of cycle)
10 Mill the pocket End mill 6 mm dia
Choose the datum as the centre
O1310 of the
Counterbore Ø10circle
mmx 7 inmm
(P Nview
deepof the symmetry of
Rao) theT03
N080 geometry.
S800 M06 The coordinates 20 (Drill Drill5fivemm
holes diameter) Twist drill 12 mm d
can then (4) equally spaced holes Fig. 13.44 Part drawing for Example 13.10
G71 be
G92easily
X0 Y0calculated since they are all(September
symmetrical22,about2008)the datum.
30 Drill twenty holes Twist drill 3 mm di
N010 Z50 N085 G81 X0 Y18.75 Z-16.0 R2.0 F80
N015 G90%M03 Fig. 13.44 Part drawing for (StockExample x 65 x 12.5 mm) N090 X0 Y18.75
6513.10
N020 T01O1310
S800 M06 N025
(DrillG81
7 mmX17.678 Y17.678N095
(P N Rao)
diameter)
X-18.75
Z-16.0 R2.0Y0 F80 (Start drilling)
N100 X0 Y-18.75
N025 G81N010
X17.678
G71Y17.678
G92 X0 Z-16.0
Y0 Z50R2.0 F80 (StartX-17.678
N030 drilling)(September
Y17.678 22,N105
2008)
X18.75 Y0
N030 X-17.678 Y17.678
N015 G90 M03 (Stock 65 x 65N110
x 12.5
N035 X-17.678 Y-17.678 G80 mm)
X-50.0 Z50.0 (End of cycle)
N035 X-17.678 Y-17.678
N020 T01 S800 M06 N040 X17.678(Drill 7 mm diameter)
Y-17.678 N115 T04 S300 M06 (M6 Machine tap)
N040 X17.678 Y-17.678
N045 G80 X-50.0 Z50.0 N120 G84 X0 Y18.75 Z-16.0 R2.0 (EndF80of cycle)
N045 G80 X-50.0 Z50.0 (End of cycle) N125 X0 Y18.75
N050 T02 S800 M06 (End mill 10 mm diameter)
N050 T02 S800 M06 (End mill 10 mm diameter) N130 X-18.75 Y0
N055 G82 X17.678 Y17.678 390 CAD/CAM:
Z-7X0P1Principles
R2 F80and Applications
N055 G82 X17.678 Y17.678 Z-7 P1 R2 F80 N135 Y-18.75
N060 X-17.678 Y17.678 N060 X-17.678 Y17.678 N140 X18.75 Y0
N065 X-17.678 Y-17.678 N065 X-17.678 Y-17.678 N145 G80 X-50.0 Z50.0 M05 (End of cycle)
N150 G00 X-50.0 Y-50.0
N070 X17.678 Y-17.678 N070 X17.678 Y-17.678
N160 M02 (End of program)
N075 G80 X-50.0 Z50.0 (End of
N075 cycle)
G80 X-50.0 Z50.0 (End of cycle)
The graphical simulation of Example 13.10 is shown in Fig. 13.45, simulating t
N080 T03 S800 M06 (Drill 5 mm diameter)
N080 T03 S800 M06process on the machine tool. (Drill 5 mm diameter)
N085 G81 X0 Y18.75 Z-16.0 R2.0 F80
N085 G81 X0 Y18.75 Z-16.0 R2.0 F80
N090 X022Y18.75
August 2025 Example 13.11 A complete part program using the ISO codes 46 for the following
N090 X0 Y18.75 external contour for the component is shown in Fig. 13.46. The
N095 X-18.75 Y0
N095 X-18.75 Y0 used is 30 m/min and the feed rate is 0.08 mm/rev. Use the lower left-hand corne
process on the machine tool.

Example 13.11 A complete part program using the ISO codes for the following component for the
external contour for the component is shown in Fig. 13.46. The cutting speed to be
used is 30 m/min and the feed rate is 0.08 mm/rev. Use the lower left-hand corner of the part as the
datum.
393
Taking datum at the left-hand bottom part of the part, all the dimensions where the cutter has to move
CNC Programming
in order to generate the part are shown in Fig. 13.47. Based on these dimensions, the part program is
CNC Progra
developed with three tools, the details of which are given in the program.
80
80
27.5 67.5
6 526
Y 3 46
40
40 3 34
28
6
48, 80

Ø3 Ø12 25

12
R3 1
30 9.5
ISO 80All dimensions in mm
AISI 1045 steel 68
65
to Fig. 13.45 Simulation of the program for Ø3
Fig. 13.46 Part drawing for Example 13.11 Ø12 62
Example 13.10 40
Given V = 30 m/min and f = 0.08 mm/rev 12 25
R3
Fig. 13.48
Spindle Simulation
1000 1000 × 30 of the program
V _________
speed, N = ______ = = 1591 rpm
X 1
9.5
pD p × 12 30
for Example 13.11
Feed to be used = 0.080 × 1590 = 127 mm/min
Fig.
Similar calculations can be done for all other tools and the values are 13.47
filled Parttable
in the tool drawing
which shown
are with cutter for Example 13.11
used for writing the part program as shown below:
Op. no Description Tool required N10 (P N Rao 22 September
Spindle, RPM 2008)
Feed, mm/min

10
8Mill the pocket N20 (USE 80 x1590
End mill 6 mm dia 80 x 10 mm AISI 1045
125 steel)
20 Drill five holes Twist drill 12 mm dia (INITIALIZE
N30 800STOCK TO X=0, Y=0,
65 Z=0)
30 Drill twenty holes Twist drill 3 mm dia 3180 250
N40 (T1 IS A 6 mm END MILL)
CAD/CAM: Principles and Applications
N420 G81 G99 Z-6.0 R1.0 F250.0
N10 (P N Rao 22 September 2008) N230 Y68.0 N430 X34.0 Y68.0
N20 (USE 80 x 80 x 10 mm AISI 1045 steel) N240 X28.0 N440 X40.0 Y68.0
N30 (INITIALIZE STOCK TO X=0, Y=0, Z=0) N250 Y62.0
N260 G0 Z2.0 M05 (Retract)
N450 X46.0 Y68.0
N40 (T1 IS A 6 mm END MILL)
N50 (T2 IS A 12 mm twist drill) N270 M06 T02 (Tool change 12 mm twist drill) N460 X52.0 Y68.0
N60 (T3 IS A 3 mm twist drill) N280 (Drill 5 holes) N470 X52.0 Y62.0
N70 G71 G90 N290 S800.00 M03 N480 X46.0 Y62.0
N300 G0 X12.5 Y15.0
N80 M06 T01 (Tool Change 6 mm End Mill) N490 X40.0 Y62.0
N310 G81 G99 Z-14.0 R1.0 F65.0
N90 (Pocket milling Operation, Contour 1)
N320 X67.5 Y15.0 N500 X34.0 Y62.0
N100 M3 S1590.0
N330 X40.0 Y 40.0 N510 X28.0 Y62.0
N110 G0 Z10.0 (Retract)
N340 X67.5 Y65.0 N520 X28.0 Y18.0
N120 G0 X28.0 Y12.0
N350 X12.5 Y 65.0
N130 G0 Z2.0 (Retract) N530 X34.0 Y18.0
N360 G80
N140 G1 Z-1.0 F125.0 (Plunge) N370 G0 Z10.0 (Retract) N540 X40.0 Y18.0
N150 G1 X52.0 F125.0 N380 M06 T03 (Tool change 3 mm twist drill) CNC N550 X46.0 391
Y18.0
Programming
N160 Y18.0 N390 (Drill 20 holes)80 N560 X52.0 Y18.0
N170 X28.0 N400 S3180.00 67.5

N180 Y12.0
52 N570 X52.0 Y12.0
N410 G0Y X28.040Y68.0
46

N190 G0 Z2.0 (Retract) N420 G81 G9934Z-6.0 R1.0 F250.0 N580 X46.0 Y12.0
28
N200 G0 Y62.0 (Position for the second contour)
N430 X34.0 Y68.0 6 N590 X40.0 Y12.0
N210 G1 Z-1.0 F100.0 (Plunge) N440 X40.0 Y68.0 N600 X34.0 Y12.0
N220 G1 X52.0 F200.0 N450 X46.0 Y68.0
N610 X28.0 Y12.0
N460 X52.0 Y68.0
80
N470 X52.0 Y62.0 68 N620 G80 M05
65 Ø12 62
Ø3
N48040X46.0 Y62.0 N630 G0 Z10.0 (Retract)
N490 X40.0
12
Y62.0 25 N640 M02 (END OF FILE)
R3
N500 X34.0 Y62.0 X 1
30 The
9.5graphical simulation of Example 13.1
(c) TMH, New Delhi, CAD/CAM Principles
22 August 2025 and Applications by P N Rao, 3rd Ed 49
(c) TMH, New Delhi, CAD/CAM Principles
22 August 2025 and Applications by P N Rao, 3rd Ed 50
(c) TMH, New Delhi, CAD/CAM Principles
22 August 2025 and Applications by P N Rao, 3rd Ed 51
(c) TMH, New Delhi, CAD/CAM Principles
22 August 2025 and Applications by P N Rao, 3rd Ed 52
(c) TMH, New Delhi, CAD/CAM Principles
22 August 2025 and Applications by P N Rao, 3rd Ed 53
(c) TMH, New Delhi, CAD/CAM Principles
22 August 2025 and Applications by P N Rao, 3rd Ed 54
— Part programming is a systematic activity and following
the steps in proper sequence will help in developing
efficient part programs
— Selection of the part coordinate axes system with respect
to the part geometry help in reducing the mathematical
calculations that are needed to write the part program
— ISO standard for part programming utilises all the 26
characters of English alphabet as word addresses in a part
program.
— Preparatory functions or G-codes control the geometrical
nature of the data input as well as operation of some of
the data in a program. A large number of these codes are
standardised by ISO.
22 August 2025 55
— Motion commands are the most important part of the G-
codes used to control the motion in rapid (G00), linear
interpolation (G01) and Circular interpolation (G02 and G03).
— Miscellaneous functions or M-codes are used to specify the
machine tool functions in the program. Less number of codes
are standardised in view of these being machine specific.
— For programs involving multiple tools, tool length
compensation can be activated by the use of tool offset
registers.
— Canned or fixed cycles offer the facility to reduce the bulk of
program by canning the often repeated command into a
single G-code. Examples are for the drilling of holes (G81).
— In milling of contours large amount of complex calculations
are often required to take multiple cuts. This can be reduced
by the use of cutter diameter compensation (G41 and G42).
22 August 2025 56

You might also like