IE360 - Lecture 13 - Manual Part Programming-3
IE360 - Lecture 13 - Manual Part Programming-3
➢ CNC M-Codes
➢ Examples
➢ Exercises
Objectives
➢ To understand the part programming for CNC
lathe.
➢ To be able to write part programs for cylindrical
components using necessary G-codes.
Turning
➢ The major difference is that only two axis X axis is the displacement of
are present X and Z. the tool
axis are only called axis if we can control the velocity and position of axis
additional axises “ we name them W and U”
rotation of table “W “
tilting of table
➢ For absolute motions i.e. with respect to program zero CAPITAL X and Z
letters are used. Whereas for incremental movement, u and w are used
instead to describe motions along X and Z-axes.
N100 X60 W-30 i.e. X = 60 with axis move 30 units with respect to previous
Z location. respect to program zero while along Z
Example
N1 M06 T01
N2 S500 M03
N3 G01 X0 Z0 G95 F0.3 feed rate
N4 X25 for turning we take diameter on X axis only
N5 Z-7.5
N6 X40 Z-15
N7 Z-25
N8 X60 Z-35
Canned cycles for lathe
G70: Profile finishing cycle (turning)
Format: N_ finshing
G70 P_ Q_F _
P: Start block, Q: End block, and F: Feedrate
G71: Profile roughing cycle for turning and boring
Format: N_ G71 U… R….
N_ G71 P_ Q_ U_ W_ F _ S _
roughing
➢ G71 turning cycle is used for rough (Stock)
material removal from a CNC lathe component in
turning mode. G71 turning cycle makes large
diameter cutting easy.
➢ Through G71 turning cycle parameters CNC
machinists can control
• Depth of cut.
• Retract height.
• Finishing allowance in x-axis and z-axis.
• Cycle cutting-feed, spindle speed.
➢ Often followed by the finishing cycle G70
Canned cycles for lathe
G71: Profile roughing cycle for turning and boring
Format: G71 U... R...
G71 P... Q... U... W... F... S...
Parameters description:
First block
U = Depth of cut. R = Retract height.
Second block
P = Contour start block number, Q = Contour end block number, U = Finishing
allowance in x-axis, W = Finishing allowance in z-axis, F = Feedrate during
G71 cycle, S = Spindle speed during G71 cycle
U
U
100
82
64
60
75
Video link
• https://www.youtube.com/watch?v=0zqbN5cu1Es
• https://www.youtube.com/watch?v=PmGxFI2DwZE
Canned cycles for lathe
G71: Example-1
N70 G71 P80 Q120 U0.5 W0.2 F200 S1200 they come in a bundle,
First U is Depth of cut,
N80 G00 X40 Z0 U in the second line
W: incremental means a x coordinate
N90 G01 Z-30 Z: absolute allowance
Parameters description:
First block
W = Depth of cut. R = Retract height.
Second block
P = Contour start block number,
Q = Contour end block number,
U = Finishing allowance in x-axis,
W = Finishing allowance in z-axis,
F = Feedrate during G72 cycle,
S = Spindle speed during G72 cycle
Program
N5 G00 X65 Z42 (safe location)
N6 G72 W2 R2
N7 G72 P8 Q9 U0 W0 F0.3
N8 G00 Z30 N8 G01 G41 X60 Z30
N9 X20
N9 G01 X20 N10 G40 G80
Canned cycles for lathe
G72: Profile roughing cycle for facing
(Graphical illustration)
W W W
60
40
Video link
• https://www.youtube.com/watch?v=o9vXeH8lCjQ
• https://www.youtube.com/watch?v=_QTEY9v9iD4
Canned cycles for lathe
G72: Example-2
Program
N010 G00 X220.0 Z60.0
N011 G00 X176.0 Z2.0
N012 G72 W7.0 R1.0
N013 G72 P014 Q021 U4.0 W2.0 F0.3 S550
N014 G00 G41 Z-70.0 S700
N015 X160.0
N016 G01 X120.0 Z-60.0 F0.15
N017 W10.0
N018 X80.0 W10.0
N019 W20.0
N020 X36.0 W22.0
N021 G40
N022 G70 P014 Q021
N023 G00 X220.0 Z60.0
N024 M30
Canned cycles for lathe
G74: Peck drilling cycle along the z axis
Format: N_ G74 R…
N_ G74 X0 Z_ K_ F_
➢ R: Retract plane, X0: X always 0
because center drilling, Z: Total depth,
K: Peck depth, and F: Feed rate
Z
➢ The G74 command executes a peck
drilling cycle with automatic retracts
and incremental depths of cut.
➢ During a peck drilling cycle, the tool Example:
feeds in to the peck distance or depth of N10 G74 R 0.25
cut, then retracts up to a pre-determined N20 G74 X0 Z-1.0 K0.125 F0.015
distance, which is the chip-breaking In this example, a hole is peck drilled
process, and then feeds to the next peck, to a total depth of 1 in, using 0.125
which takes the tool deeper. This inch for the depth of each peck. After
process is repeated until the final Z every peck tool will retract to Z= 0.25
depth is reached.
Canned cycles for lathe
G74: Example
Program
N10 T5
N20 G97 S500 M03
N30 G00 X0 Z2
N40 G74 R1
N50 G74 Z-55 k11 F0.1
N60 G00 X100 Z100
N70 M30
Exercise
Write a part program using the necessary G-codes to machine the part shown below on a
turning center. All dimensions are all in millimeters. Use the following machining parameters
and tools:
1. Tool T01 for Roughing – spindle speed of 400 rpm and feedrate of 0.4 mm/rev.
2. Tool T02 for finishing – spindle speed of 600 rpm and feedrate of 0.2 mm/rev.
The depth of cut for each roughing pass is 2 mm and the amount of stock to be left for
finishing on the X and Z axes are 0.3 and 0.5 mm, respectively. Coolant must be ON for all
cutting operations. Tool initial position is at (X=10, Z=50).
R10
X
(0,0)
Z
R10
CNC M-Codes
➢The coolant should be shut off prior to tool changes or when tool is
rapidly moved over long distances.
Detailed description of M codes
M10:Clamps or chuck on Format: N_ M10
M11: Clamps or chuck off Format: N_ M11
X0 Y0 10 30 30 10
-
Solution
N01 G90 G17 G54
N02 G21
N03 M06 T01
N04 M08 G42 D01
N05 G00 X0 Y0 Z2 M03 S500
N06 G01 Z-10 F350
N07 X100
N08 Y60
N09 X70
N10 G02 X30 Y60 R20 F350
N11 G01 X0
N12 Y0
N13 Z2
N14 G40
N15 M05
N16 M09
N15 G28 X0 Y0 Z10 M06 T02
N16 G43 H02 G29 X10 Y30 Z5
N17 M03 S500
N18 M08
N20 G99 G83 X10 Y30 Z-10 R 2.5 Q2.5 F350
N21 X90
N22 G80
N23 G00 X-80 Y0 Z20
N24 G49
N25 M30 or M02
Examples
➢Example 2: Write a part program to machine the part shown below. The
dimensions are all in inches. Use the following machining parameters and
tools:
1. Roughing – spindle speed of 500 rpm and feedrate of 0.012 ipr, T02
2. Finishing – spindle speed of 700 rpm and feedrate of 0.006 ipr, T03
3. Drilling – drill speed of 400 rpm and a feedrate of 0.004 ipr, T04
The depth of cut for each roughing pass is 0.0625 inch and the amount of stock
to be left for finishing on the X and Z axes are 0.05 and 0.004 inches,
respectively. The hole is peck drilled to a total depth of 1.5 inch using 0.25 inch
for the depth of each peck.
Examples
Solution
• N05 G54 G20 G95 G97
• N10 T02 M06
• N15 S500 M03
• N20 G00 X0.5 Z0.25
• N25 G01 Z0 F0.012
• N30 G71 U0.0625 R0.1
• N35 G71 P40 Q65 U0.05 W0.004 F0.012 S500
• N40 G01 X0.5 Z-0.75 M08
• N45 G02 X1 Z-1.0 R0.25
• N50 G01 Z-2.0
Examples
• N55 G02 X1.5 Z-2.25 R0.25
• N60 G01 X2.0
• N65 Z-3.0
• N70 M09
• N75 G28 X4.0 Z2.0 T03 M06
• N80 G43 H03 G29 X0.5 Z0.25
• N85 S700 M03
• N90 M08
• N95 G70 P40 Q65 F0.006
• N100 M09
• N105 G28 X4.0 Z2.0 T04 M06
• N110 G43 H04 G29 X0 Z0.25 S400 M03
Examples
• N115 M08
• N120 G74 X0.0 Z-1.5 K0.25 R0.2 F0.004
• N125 G00 X4.0 Z2.0 M09
• N130 G49
• N135 M30
Exercises
Exercise 1: Write a part program manually to mill the edge of the
plate shown below. The dimensions are in millimeters. Assume
that the raw material, a rectangular plate, has a thickness of 15
mm and that its bottom face has the z coordinate of 0. Assume
that the tool, named T03, diameter is 10 mm, the machining feed
rate is 250 mm/min, the rapid traverse feed rate is 850 mm/min,
and the spindle speed rate is 700 rpm. The coolant should be on.
(55,30)
y
(35, 5) (80, 5)
x
Start point (0, 0)
Exercises
Exercise 2: Write a part program manually to mill the edge of the
plate shown below. The tool, named T03, diameter is 1.0 inch and
the suggested cutting conditions are 6 ipm for the machining feed
rate and 600 rpm for the spindle speed. The dimensions are all in
inches.
Exercises
Exercise 3: Write a part program manually to machine the part shown below.
The dimensions are all in inches and the tool start position is at the point (X2,
Z3). Use the following machining parameters and tools:
1. Roughing – spindle speed of 500 rpm and feedrate of 0.012 ipr, T02
2. Finishing – spindle speed of 700 rpm and feedrate of 0.006 ipr, T03
3. Drilling – drill speed of 500 rpm and a feedrate of 0.004 ipr, T04
The depth of cut for each roughing pass is 0.0625 inch and the amount of stock
to be left for finishing on the X and Z axes are 0.05 and 0.004 inches,
respectively. The hole is peck drilled to a total depth of 1 inch using 0.125 inch
for the depth of each peck. X axis
R = 0.5
R = 0.25
1.0
1.5
2.5