Yarmouk University
CNC programing- Turning process
IE 462 : CAD/CAM
Dr. Aiman Ziout
Department of Industrial Engineering
Hijjawi Faculty for Engineering Technology
Yarmouk University
2025- Winter
1
Lecture’s objectives
Know the following G codes
G00: Rapid positioning
G01: Linear interpolation
G02: Circular interpolation (clockwise)
G03: Circular interpolation (counter clockwise)
G20: Inch units
G21: Metric units
G28: Automatic return to the reference point
Know the concept of canned cycle in CNC programing
G74: Peck drilling cycle along the z axis
G80: Fixed cycles – cancel
Write a program to Perform profile cutting in turning process using
G71: Profile roughing cycle for turning and boring
G72: Profile roughing cycle for facing
G70: Profile finishing cycle (turning)
The concept of
Canned cycle
Repetitive actions stored in one “can”
The concept of Canned cycle
• Canned cycle is similar to Function in some
computer programming languages.
• It dose a repetitive actions, without a need
to program these actions.
• Canned cycles have format, and require
inputs through its parameters
Profile roughing cycle for turning and
boring
• An example of canned cycle is turning a
profile.
• Canned cycle called
G71 can be used to do
this job without need to
program the motion of
the cutter pass by pass.
G71: Profile roughing cycle for turning and boring
Format: N_ G71 U_ R_
N_ G71 P_ Q_ U_ W_ F _ S _
G71 turning cycle is used for rough-material removal from
a CNC lathe component in turning mode. G71 turning cycle
makes large diameter cutting easy.
Through G71 turning cycle parameters, the following can be
controlled:
• Depth of cut.
• Retract height.
• Finishing allowance in x-axis and z-axis.
• Cycle cutting-feed, spindle speed.
• The profile that the tool has to follow.
Often followed by the finishing cycle G70
G71: Profile roughing cycle for turning and boring
Format: N_ G71 U_ R_
N_ G71 P_ Q_ U_ W_ F _ S _
Parameters description:
First block: G71 U... R...
U = Depth of cut during the cycle (D in the figure).
R = Retract height for each completed cut..
Second block: G71 P... Q... U... W... F... S...
P = profile start block number,
Q = profile 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
G70: Profile finishing cycle (turning)
Format: N_ G70 P_ Q_ F _
Parameter description:
P: Start block,
Q: End block, and
F: Feed rate
G71: Example
0.2
X110, Z10
Example-2
O0004
.
.
.
G00 X110 Z10 M3 S800
G71 U2 R1
G71 P80 Q120 U0.5 W0.2 F200
N80 G01 X40 Z0 S1200 (Starting point )
N90 Z-30 F100
N100 X60 W-30
N110 W-20
N120 X100 W-10 (End point)
G70 P80 Q120
.
.
.
M30
Finishing allowance (u/2) in X = 0.5
Finishing allowance (W) in Z = 0.2
G71: Profile roughing cycle for turning and boring
Sequence of operations during G71 turing cycle
First-cut
1. Tool will move in x-axis U (depth of cut) deep with programmed feed from
starting-point.
2. Tool will travel with feed in z-axis (destination point in z-axis is given in P
Q blocks )
3. Tool rapidly retracts R amount in both x-axis and z-axis (at 45 degrees).
4. Tool rapidly travel in z-axis to start-point
Later-cuts
5. Tool rapidly moves to last cut depth.
6. Tool moves with feed in x-axis U deep (first-block U depth of cut).
7. Tool with feed moves in z-axis (destination point given in P Q blocks).
8. Tool rapidly retracts in x-axis and z-axis R amount (45 degrees).
9. Tool rapidly moves to start-point only in z-axis.
10. This whole sequence of operation keep on going, until the destination point
in x-axis is met
If finishing allowance is given tool will not make the exact diameter and
length given in P Q blocks but will leave that much allowance. This
finishing allowance can be later machined by calling G70 finishing cycle.
Class work
Example of Canned cycle G71
For rough cutting, use depth of cut of 0.5, feed rate of 0.2 mm/ rev and retract
distance of 1 mm.
Finishing allowance in x-axis is 0.1 mm and in z-axis is 0.05 mm
For finishing pass, use depth of cut of 0.1 mm/rev
Ø36
Ø28
Ø20
Ø18
Example of Canned cycle G71
36
Ø36
28
Ø28
6
5
Ø20
Ø18
4
3
2
1
POSITION
1
2
3
4
5
6
7
X
18
20
20
28
28
36
U
Z
0
-4
-16
-20
-30
-38
I
K
0
-4
O303 (MULTIPLE TURNING)
N1 G21 G90 G94
N2 G28 U0 W0
N3 M06 T01
N4 M03 S1500
N5 G00 X36.0 Z5.0
N6 G71 U0.5 R1
N7 G71 P9 Q13 U0.1 W0.05 F0.2
N8 G01 X18.0 Z0.0
N9 X20.0 Z-4.0
N10 X20.0 Z-16.0
N11 G03 X28.0 Z-20.0 R4.0
N12 G01 Z-30.0
N13 G01 X36.0 Z-38.0
N14 G70 P9 Q13 F0.1
N15 G28 U0 W0
N16 M05
N17 M30
G72: Profile roughing cycle for facing
Format: N_ G72 W… R….
N_ G72 P_ Q_ U_ W_ F _ S _
Parameters description:
First block: G72 W... R...
W = Depth of cut.
R = Retract height.
Second block: G72 P... Q... U... W... F... S...
P = profile start block number,
Q = profile 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
Facing
Exercise at home
Example of Canned cycle G71
Notice:
• Don’t forget to program in diameters and double the radii to calculate diameter positions
• The front finished face is Z0.
• Note that when programming fillets and radii for turning, most of the time it is easier to do so
incrementally (U and W).
POSITION
1
2
3
4
5
6
7
8
9
10
X
0
0.250
0.375
0.375
0.500
0.625
0.625
1.125
1.375
1.375
U
0.0625
Z
0
0
-0.0625
-0.3125
-0.375
-0.4375
-1.250
-1.500
-1.625
-2.000
W
-
I
-
K
-
-0.0625
0
-0.0625
0.0625
0
0
-0.0625
0.25
0
0
-0.125
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
G74: Peck drilling cycle along the z axis
The G74 command executes a
peck drilling cycle with automatic
retracts and incremental depths of
cut.
During a peck drilling cycle, the
tool feeds in to the peck distance or
depth of cut, then retracts up to a
pre-determined distance, which is
the chip-breaking process, and then
feeds to the next peck, which takes
the tool deeper. This process is
repeated until the final Z depth is
reached.
Z
Example:
N10 G74 R 0.25
N20 G74 X0 Z-1.0 K0.125 F0.015
In this example, a hole is peck
drilled to a total depth of 1 in,
using 0.125 inch for the depth of
each peck. After every peck tool
will retract to Z= 0.25
Example of Canned cycle G74
O1201
G21 G 98
G28 U0 W0
M06 T01
M03 S1500
G00 X0 Z5
G74 R2
G74 X0 Z-24 K5 F100
G28 U0 W0
M05
M30
G76 Threading Cycle in turning
G76 Threading Cycle can be used for:
•Internal Threading.
•External Threading.
•Taper Threading.
Threading cycle is optional
G76 Threading Cycle
In Turning Process
G76 Threading Cycle Flexibility
With G76 Threading Cycle you can control
Number of Finishing Passes .
In-feed Angle
Run-out angle
Depth of Normal Cuts
Depth of Finish Cut
Depth of First Cut
G76 Threading Cycle Format
N5 G76 P013060 Q100 R0.05
N6 G76 X30
Z-20 P1024 Q200
F2
First block of the G76 Threading cycle
G76 : G code for threading cycle.
P : P consists of three values which control the thread behavior,
•01 : Number of passes for finishing cuts.
•30: Flank angle or In-feed angle
•60: Thread run out at 60 degree
Q : Depth of normal cut ( these values are given in hundreds, so the depth of
cut will be 0.1mm ).
R : Depth left for Finish cut
Second block of the G76 Threading cycle
G76 : G code of the threading cycle.
X : The minor diameter in x-axis.
Z : threaded length in z-axis.
P : Thread depth ( as radius value ).
Q : Depth of first cut.
F : Thread Pitch
Example
Cut the bolt shown in the figure below, the
bolt is M20x2.5, the length of the threaded
part is 35 mm.
Given: depth = 0.641* pitch
d
The end