0% found this document useful (0 votes)
12 views95 pages

CNC Programming & Machining 2

The document outlines the course EMEMM 2210 for the academic year 2017-2018, emphasizing the importance of practical work and the need for instructors to provide additional exercises. It includes a comprehensive list of G-Codes and M-Codes used in CNC programming, detailing their functions and applications. Additionally, it covers various turning cycles and tool diameter compensation techniques necessary for effective CNC machining.

Uploaded by

bayanahmed2751
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)
12 views95 pages

CNC Programming & Machining 2

The document outlines the course EMEMM 2210 for the academic year 2017-2018, emphasizing the importance of practical work and the need for instructors to provide additional exercises. It includes a comprehensive list of G-Codes and M-Codes used in CNC programming, detailing their functions and applications. Additionally, it covers various turning cycles and tool diameter compensation techniques necessary for effective CNC machining.

Uploaded by

bayanahmed2751
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/ 95

EMEMM 2210

Academic Year 2017-2018


R E M A R K S

 This is an indicative course.

 The instructor must ensure that


there is always association with the
practical work.

 The instructor must add all the


information that he considers
necessary for the good progress of
the session without exceeding the
pre-established limits.

 Applications and exercises

CNC Programming & Machining II


contained in this course are
indicative.

 The instructor in charge must give


the students other applications and
exercises.

www.manpower.gov.om -7-
Turning Cycles

Part A
CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

1- Reminder:

1-1- G-Code list:


STANDARD G CODE FUNCTION
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW
G04 Dwell
G09 Exact stop
G10 Programmable data input
G20 Input in inch
G21 Input in mm
G22 Stored stroke checks function ON
G23 Stored stroke check function OFF
G27 Reference position return check
G28 Return to reference position
G32 Thread cutting
G40 Tool nose radius compensation cancel
G41 Tool nose radius compensation left
G42 Tool nose radius compensation right
G70 Finish machining cycle
G71 Turning cycle
G72 Facing cycle
G73 Pattern repeating cycle
G74 Peck drilling cycle
G75 Grooving cycle
G76 Threading cycle
G92 Coordinate system setting or max. spindle speed setting
G94 Feed Per Minute
G95 Feed Per Revolution
G96 Constant surface speed control
G97 Constant surface speed control cancel

www.manpower.gov.om Chapter 1 -9-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

1-2- M-Code list:


STANDARD M CODE FUNCTION
M00 Program stop
M01 Optional program stop
M02 End of program
M03 Spindle start forward CW
M04 Spindle start reverse CCW
M05 Spindle stop
M08 Coolant ON
M09 Coolant OFF
M29 Rigid tap mode
M30 End of program reset
M40 Spindle gear at middle
M41 Low Gear Select
M42 High Gear Select
M68 Hydraulic chuck close
M69 Hydraulic chuck open
M78 Tailstock advancing
M79 Tailstock reversing
M94 Mirror image cancel
M95 Mirror image of X axis
M98 Subprogram call
M99 End of subprogram

www.manpower.gov.om Chapter 1 -10-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Function Address Meaning of address


Program number O(EIA)/(ISO) Program number
Block sequence N Sequence number
number
Preparatory function G Specify a motion mode (Linear, arc, etc)
Dimension word X, Z Command of moving position (absolute type) of
each axis
U, W Instruction of moving distance and direction
(incremental type)
I, K Ingredient of each axis and chamfering volume of
circulate center
R Radius of circle, corner R, edge R
Feed function F, E Designation of feed rate and thread lead
Auxiliary function M Command of ON/OFF for operating parts of
machine
Spindle speed S Designation of speed of main spindle or rotation
function time of main spindle
Function (Tool) T Designation of tool number and tool compensation
number
Dwell P, U, X Designation of dwell time
Designation of P Designation of calling number of auxiliary
program number program
Designation of P, Q Calling of compound repeat cycle, end number
sequence No
Number of L Repeat time of auxiliary program
repetitions
Parameters A, D, I, K Parameter at fixed cycle

One block
N G XY F S T M ;
Sequence Preparation Dimension Feed Spindle Tool Function end-
Auxiliary function word function Speed function auxiliary of-
No. function block
(EOB)

www.manpower.gov.om Chapter 1 -11-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

2- G00(Positioning):

Each axes moves as much as commanded data in rapid feed rate.

G00 X (U….) Z (W….) ;


G00 X150.0 Z100.0;
X200.0 Z200.0;

Or

G00 U150.0 W100.0;


U50.0 W100.0;

www.manpower.gov.om Chapter 1 -12-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

3- G01(Linear interpolation):
Each axes moves straightly as much as commanded data in commanded rate.

G01 X (U….) Z (W….) F… ;


G01 X150.0 Z100.0
F0.2;
X200.0 Z200.0;

Or

G00 U150.0 W100.0


F0.2;
U50.0 W100.0;

www.manpower.gov.om Chapter 1 -13-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

4- G02, G03(Circular interpolation):


Each axis interpolates circularly to the commanded coordinate in instructed speed.
Meaning
Conditions Instruction Right hand Left hand
coordinate coordinate
1 Rotation direction G02 CW CCW
G03 CCW CW
2 Location of end point X, Z Location X, Z of commanded point from
coordinate
Distance to the end U, W Distance from start point to commanded
point point
Distance between start I, K Distance from start point to the center of
point and the center and arc with sign, radius value (I always
point designates the radius)
3 Arc radius with no sign R Radius of circumference
radius of circumference

G02 X … (U …) Z … (W …) R … F … ;
G01 X30.0 Z60.0 F0.3 ;
Z35.0 ;
G02 X40.0 Z30.0 I5.0 ;
(G02 U10.0 W-5.0 I5.0)
G01 X50.0 ;
Z0 ;

G03 X … (U …) Z … (W …) R … F … ;

www.manpower.gov.om Chapter 1 -14-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

G01 X40.0 Z60.0 F0.3 ;


G03 X50.0 Z55.0 K-5.0 ;

www.manpower.gov.om Chapter 1 -15-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

N10 G90 ;
N20 G50 S2000 T0300 ;
N30 G96 S200 M03 ;
N40 G00 X0 Z3.0 T0303 M08 ;
N50 G42 G01 Z0 F0.2 ;
N60 G03 X20.0 Z-10.0 R10.0 ;
N70 G01 Z-50.0 ;

www.manpower.gov.om Chapter 1 -16-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

N80 G02 X100.0 Z-74.385 I40.0 K20.615 ; (G02 X100.0 Z-74.385 R45.0)
N90 G01 Z-125.0 ;
N100 G40 U2.0 W1.0 ;
N110 G00 X200.0 Z200.0 M09 T0300 ;
N120 M30 ;

www.manpower.gov.om Chapter 1 -17-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

N10 G90 ;
N20 G50 S2000 T0300 ;
N30 G96 S200 M03 ;
N40 G42 G00 X35.0 Z5.0 T0303 M08 ;
N50 G01 Z-20.0 F0.2 ;
N60 G02 X67.0 Z-36.0 R16.0 ; (G02 X67.0 Z-36.0 I16.0 K0)
N60 G01 X68.0 ;
N70 G03 X100.0 Z-52.0 R16.0 ; (G02 X100.0 Z-52.0 I0 K-16.0)
N80 G01 Z-82.0 ;
N100 G40 G00 X200.0 Z200.0 M09 T0300 ;
N110 M30 ;

www.manpower.gov.om Chapter 1 -18-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

O0000 ;
N10 (ø30 DRILL)
N20 G50 T0200 ;
N30 G97 S250 M03 ;
N40 G00 X0 Z5.0 T0202 M08 ;
N50 G01 Z-5.0 F0.07 ;
N60 W1.0 ;
N70 Z-40.0 F0.25 ;
N80 G00 Z5.0 ;
N90 Z-39.0 ;
N100 G01 Z-60.0 ;
N110 G00 Z10.0 ;
N120 X200.0 Z200.0 T0200 ;
N130 M01 ;
N140 (Outside diameter stock removal)
N150 G50 S1500 T0100 ;
N160 G96 S180 M03 ;
N170 G00 X94.0 Z5.0 T0101 M08 ;
N180 G01 Z-14.8 F0.27 ;
N190 G00 U2.0 Z0.5 ;
N200 G01 X28.0 F0.23 ;
N210 G00 X87.0 W1.0 ;
N220 G01 Z-14.8 F0.27 ;
N230 G00 U2.0 Z1.0 ;

www.manpower.gov.om Chapter 1 -19-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

N240 X80.5 ;
N250 G01 Z-14.1 ;
N260 G02 X81.9 Z-14.8 R0.7 ;
N270 G00 X100.5 W1.0
N280 G01 Z-29.8
N290 G00 U2.0 Z-1.0 ;
N300 G01 X60.5 F0.23 ;
N310 G00 X82.0 W1.0 ;
N320 Z-2.4 ;
N330 G01 X60.5 ;
N340 X72.9 ;
N350 G03 X80.5 Z-6.2 R3.8 ;
N360 G00 U2.0 Z5.0 ;
N370 X200.0 Z200.0 T0100 ;
N380 M01 ;
N390 (Inside diameter stock removal)
N400 G50 S1500 T0400 ;
N410 G96 S180 M03 ;
N420 G00 X34.5 Z3.0 T0404 M08 ;
N430 G01 Z-41.8 F0.27 ;
N440 G00 U-0.5 Z1.0 ;
N450 X39.5 ;
N460 G01 Z-15.0 ;
N470X34.5 Z-24.3 ;
N480 G00 Z10.0 ;
N490 X200.0 Z200.0 T0400 ;
N500 M01 ;
N510 (Out diameter finishing)
N520 G50 S1800 T0500 ;
N530 G96 S200 M03 ;
N540 G00 X63.0 Z5.0 T0505 M08 ;
N550 Z0 ;
N560 G01 X38.0 F0.2 ;
N570 G00 X60.0 Z3.0 ;
N580 G42 Z1.0 ;
N590 G01 Z-2.5 F0.2 ;

www.manpower.gov.om Chapter 1 -20-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

N600 X74.0 ;
N610 G03 X80.0 Z-5.5 R3.0 ;
N620 G01 Z-13.5 ;
N630 G02 X83.0 Z-15.0 R1.5 ;
N640 G01 X100.0 ;
N650 Z-30.0 ;
N660 X103.0 ;
N670 G40 G00 U2.0 W1.0 ;
N680 G00 Z10.0 ;
N690 X200.0 Z200.0 T0500 ;
N700 M01 ;
N710 (Inside diameter finishing)
N720 G50 S1800 T0600 ;
N730 G96 S200 M03 ;
N740 G00 X40.0 Z5.0 T0606 M08 ;
N750 G41 Z1.0 ;
N760 G01 Z-15.0 F0.2 ;
N770 X35.0 Z-24.33 ;
N780 Z-42.0 ;
N790 X29.0 ;
N800 G40 G00 Z10.0 ;
N810 X200.0 Z200.0 T0600 M09 ;
N820 M30 ;

www.manpower.gov.om Chapter 1 -21-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

5- Tool diameter compensation:


G40 : R compensation cancel
G41 : When located on the left side of material based on the progressing direction,
G42 : When located on the right side of material based on the progressing direction,

What is Tool diameter compensation?


If R is on the end of the tool edge, parts which are not impensated only by tool
position OFFSET are occurred during the taper cutting or circular cutting. Therefore,
impensating this error automatically is namely R compensation. (During the tool
diameter compensation, add the R and T- direction in the R compensation column of
OFFSET PAGE.

Example 1:
When not using tool diameter compensation (R compensation a and b should be
calculated)?

G01 X25.0 Z0 F0.2 ;


X30.0 Z-2.5 ;
G00 U1.0 Z1.0 ;
G28 UO WO ;
M30 ;

www.manpower.gov.om Chapter 1 -22-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 2:
When using tool diameter compensation?
 You do not have to calculate R compensation a and b.
 If a position and b position are given on the program, the tool performs
automatically R compensation and moves to the next progressing
direction.

G42 X26.0 Z0 F0.2 ;


G01 X30.0 Z-2.0 ;
Z-30.0 ;
G00 U1.0 Z1.0 ;
G28 UO WO ;
M30 ;

Presentation (1) Presentation (2)


In case of no compensation In case of compensation

5-1- Direction of imaginary (In case of right hand coordinate):

Direction of imaginary seen from the center of radius is decided by the cutting
direction of tool during the cutting. Therefore, it should be set as much as compensation
volume.
Direction and number of imaginary are decided among the following eight types.

www.manpower.gov.om Chapter 1 -23-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

www.manpower.gov.om Chapter 1 -24-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

5-2- Compensation setting of

OFFSET No X Z R TOOL DIRECTION


01 0.75 -0.93 0.4 3
02 -1.234 10.987 0.8 2
… … … … …
16 … … … …

www.manpower.gov.om Chapter 1 -25-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

www.manpower.gov.om Chapter 1 -26-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

6- G71 (Stock Removal In Turning):


G71 U ( ¡ d) R (e) ;
G71 P Q U ( ¡ u) W ( ¡ w) F ;

P : Start sequence no.


Q : Final sequence no.
U( ¡ d) : Cut volume of one
time(Designate the radius.
R(e) : Escape volume(Always 45)
escape
U( ¡ u) : Finishing tolerance in X
axis
W( ¡ w) : Finishing tolerance in Z
axis
F(f) : Cutting feed rate

www.manpower.gov.om Chapter 1 -27-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 1:

www.manpower.gov.om Chapter 1 -28-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

(G70, G71)
N10 G50 S1500 T0101 ;
N20 G96 S180 M03 ;
N30 G00 X85.0 Z5.0 M08 ;
N40 Z0 ;
N50 G01 X-1.6 F0.25 ;
N60 G00 X83.0 Z2.0 ;
N70 NG71 U3.0 R1.0 ;
N80 G71 P20 Q30 U0.5 W0.1 F0.27 ;
N90 G42 G00 X30.0 ; G71 CYCLE CUTTING FEED
N100 G01 Z-20.0 F0.17 ;
G70 CYCLE CUTTING FEED
N110 X40.0 Z-40.0 ;
N120 Z-60.0 ;
N130 X50.0 Z-70.0 ;
N140 150 Z-90.0 ;
N150 X60.0 Z-110.0 ;
N160 Z-140.0 ;
N170 X80.0 ;
N180 G40 ;
N190 G70 P20 Q30 ; (When using the same bite)
N200 G00 X200.0 Z200.0 T0100 ;
N210 M30 ;

When finishing, if a different bite is used

N220 G00 X200.0 Z200.0 T0100 ;


N230 M01 ;
N240 G50 S2000 T0303 ;
N250 G96 S200 M03 ;
N260 G00 X83.0 Z2.0 M08 ;
N270 G70 P20 Q30 ;
N280 G00 X200.0 Z200.0 T0300 ;
N290 M30 ;

www.manpower.gov.om Chapter 1 -29-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 2:
Stock Removal in Turning(G71) (Type I)

(Diameter designation, metric input)


N010 G00 X200.0 Z100.0 ;
N020 G00 X160.0 Z10.0 ;
N030 G71 U7.0 R1.0 ;
N040 G71 P014 Q021 U4.0 W2.0 F0.3 S550 ;
N050 G00 G42 X40.0 S700 ;
N060 G01 W-40.0 F0.15 ;
N070 X60.0 W-30.0 ;
N080 W-20.0 ;
N090 X100.0 W-10.0 ;
N100 W-20.0 ;
N110 X140.0 W-20.0 ;
N120 G40 U2.0 ;
N130 G70 P014 Q021 ;
N140 G00 X200.0 Z100.0 ;
N150 M30 ;

www.manpower.gov.om Chapter 1 -30-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

7- G72 (Stock Removal In Facing):

G72 W ( ¡ d) R(e) ;
G72 P_ Q_ U( ¡ u) W( ¡ w) F ;

U( ¡ d) : Cut volume of one time


R (e) : Escape volume
P : Start sequence No.
Q : Final sequence No.
U ( ¡ u) : Finishing in clearance X axis
(Diameter command)
W ( ¡ w) : Finishing in clearance Z axis
F (f) : Cutting feed rate

Example 1:

www.manpower.gov.om Chapter 1 -31-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

N10 G50 S2000 T0100 ;


N20 G96 S180 M03 ;
N30 G00 X85.0 Z5.0 T0101 ;
N40 Z0 ;
N50 G01 X-1.6 F0.2 ;
N60 G00 X85.0 Z1.0 ;
N70 G72 W2.0 R1.0 ;
N80 G72 P12 Q14 U0.5 W0.2 F0.25 ;
N90 G00 G41 Z-51.0 ;
N100 G01 X80.0 F0.2 ;
N110 X78.0 W1.0 ;
N120 X60.0 ;
N130 Z-45.0 ;
N140 X40.0 Z-15.0 ;
N150 X30.0 ;
N160 Z-1.0 ;
N170 X26.0 Z1.0 ;
N180 G40 ;
N190 G70 P12 Q14 ;
N200 G00 X200.0 Z200.0 T0100 ;
N210 M30 ;

(When finishing with a different tool)

N220 G00 X200.0 Z200.0 T0100 ;


N230 M01 ;
N240 G50 S2500 T0300 ;
N250 G96 S200 M03 ;
N260 G00 X85.0 Z5.0 T0303 ;
N270 G70 P12 Q14 ;
N280 G00 X200.0 Z200.0 T0300 ;
N290 M30 ;

www.manpower.gov.om Chapter 1 -32-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 2:
Stock Removal in Pacing(G72)

(Diameter designation, metric input)


N010 G00 X220.0 Z60.0 ;
N020 G00 X176.0 Z2.0 ;
N030 G72 W7.0 R1.0 ;
N040 G72 P014 Q021 U4.0 W2.0 F0.3 S550 ;
N050 G00 G41 Z-70.0 S700 ;
N060 X160.0 ;
N070 G01 X120.0 Z-60.0 F0.15 ;
N080 W10.0 ;
N090 X80.0 W10.0 ;
N100 W20.0 ;
N120 X36.0 W22.0 ;
N130 G40 ;
N140 G70 P014 Q021 ;
N150 G00 X220.0 Z60.0 ;
N160 M30 ;

www.manpower.gov.om Chapter 1 -33-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

8- G73 (Patten Repeating):


G73 U ( ¡ i) R (d) W ( ¡ k) ;
G73 P Q U ( ¡ u) W ( ¡ w) F ;
U( ¡ i) : Escape distance and direction in X
axis (Designated the radius)
W( ¡ k) : Escape distance and direction in Z
axis
R(d) : Repeating time (It is connected with
the cut volume of each time)
P : Start sequence No.
Q : Final sequence No. U( ¡ u) ; Finishing in
clearance X axis (Radius designated)
W( ¡ w) : Finishing in clearance Z axis
F(f) : Cutting feed rate
Example 1:

N10 G50 S2000 T0300 ;


N20 G96 S200 M03 ;
N30 G00 X35.0 Z5.0 T0303 ;
N40 Z0 ;
N50 G01 X-1.6 F0.2 ;
N60 G00 X70.0 Z10.0 ;
N70 G73 U3.0 W2.0 R2 ;
N80 G73 P12 Q16 U0.5 W0.1 F0.25 ;

www.manpower.gov.om Chapter 1 -34-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

N90 N12 G00 G42 X20.0 Z2.0 ;


N100 G01 Z-10.0 F0.15 ;
N110 G02 X40.0 Z-20.0 R10.0 ;
N120 G01 Z-30.0 ;
N130 X60.0 Z-50.0 ;
N140 G40 U1.0 ;
N150 G70 P12 Q16 ;
N160 G00 X200.0 Z200.0 T0300 ;
N170 M30 ;

Example 2:
Pattern Repeating(G73)

(Diameter designation, metric input) N070 X120.0 W-10.0 ;


N010 G00 X260.0 Z80.0 ; N080 W-20.0 S0400 ;
N020 G00 X220.0 Z40.0 ; N090 G02 X160.0 W-20.0 R20.0 ;
N030 G73 U14.0 W14.0 R3 ; N100 G01 X180.0 W-10.0 S0280 ;
N040 G73 P014 Q020 U4.0 W2.0 F0.3 N120 G40 ;
S0180 ; N130 G70 P014 Q020 ;
N050 G00 G42 X80.0 Z2.0 ; N140 G00 X260.0 Z80.0 ;
N060 G01 W-20.0 F0.15 S0600 ; N150 M30 ;

www.manpower.gov.om Chapter 1 -35-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

9- G74 (Peck Drilling In Z Axis Direction):


G74 R (e) ;
G74 Z (w) Q ( ¡ k) F ;

R(e) : Retreat volume


Z(w) : Final cutting depth
Q( ¡ k) : One time cutting
depth (1000=1mm)
F : Cutting feed rate

www.manpower.gov.om Chapter 1 -36-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

10- G75 (X direction grooving; Peck drill cycle in turning):


G75 R(e) ;
G75 X(u) Z(w) P( ¡ i) Q( ¡ k) R( ¡ d) F ;

R(e) : Retreat volume(Modal command)


X(u) : Composition of X axis
Z(w) : Composition of Z axis
Q(k) : Moving volume in Z
axis(Designate without symbol).
P(i) : Cut volume or X axis(Designate the
radius)
R(d) : Escape volume at the end point of
X axis process (Designate the symbol
according to escape direction).
F : Cutting feed rate

www.manpower.gov.om Chapter 1 -37-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example :

N10 G50 S500 T0100 ;


N20 G97 S 80 M03 ;
N30 G00 X90.0 Z1.0 T0101 ;
N40 X82.0 Z-60.0 ;
N50 G75 R1.0 ;
N60 G75 X60.0 Z-20.0 P3000 Q20000 F0.1 ;
N70 G00 X90.0
N80 X200.0 Z200.0 T0100 ;
N90 M30 ;

While it has the same function with G74, X and Z are exchanged. If there is one
groove, values of Z and P can be omitted at the same time.

www.manpower.gov.om Chapter 1 -38-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

11- G76 (Thread Cutting Cycle):


By G76 command, thread cutting cycle is possible.

www.manpower.gov.om Chapter 1 -39-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 1:

Example 2:

N10 G97 S1000 M03 ;


N20 T0100 ;
N30 G00 X50.0 Z5.0 T0101 ;
N40 G76 P021060 Q100 R100 ;
N50 G76 X28.2 Z-32.0 P900 Q500 F1.5 ;
N60 G00 X200.0 Z200.0 T0100 ;
N70 M30 ;

Example 3:

N10 G97 S800 M03 ;


N20 T0300 ;
N30 G00 X30.0 Z5.0 T0303 ;
N40 G76 P021060 Q100 R100 ;
N50 G76 X18.2 Z-20.0 P900 Q500 F1.5 ;
N60 G00 X50.0 Z-20.0 G76 P021060 Q100 R100
G76 ; N70 X38.2 Z-52.0 P900 Q500 F1.5 ;
N80 G00 X200.0 Z200.0 T0300 ;
N90 M30 ;

www.manpower.gov.om Chapter 1 -40-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

12- G90 Fixed cycle:

www.manpower.gov.om Chapter 1 -41-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

www.manpower.gov.om Chapter 1 -42-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 1:

G30 U0 W0 ;
G50 S2000 T0100 ;
G96 S200 M03 ;
G00 X61.0 Z2.0 T0101 M8 ;
G90 X55.0 W–42.0 F0.25 ;
X50.0 ;
X45.0 ;
X40.0 ;
Z-12.0 R-1.75 ;
Z-26.0 R-3.5 ;
Z-40 R-5.25 ;
G30 U0 W0 ;
M30 ;

Example 2:

G30 U0 W0 ;
G50 S2000 T0100 ;
G96 S200 M03 ;
G00 X56.0 Z2.0 T0101 M08
;
G90 X51.0 W-32.0 F0.25 ;
X46.0 ;
X41.0 ;
X36.0 ;
X31.0 ;
X30.0 ;
G30 U0 W0 ;
M30 ;

www.manpower.gov.om Chapter 1 -43-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 3:

N10 G50 S2000 ;


G96 S180 M03 ;
T0100 ;
G00 X65.0 Z3.0 T0101 ;
G90 X55.0 Z-20.0 F0.25 ;
X50.0 ;
X45.0 ;
X40.0 ;
X35.0 ;
X30.0 ;
X25.0 ;
X20.5 ;
X20.0 ;
G00 X200.0 Z200.0 T0100 ;
M30 ;
Example 4:

N10 G50 S2000 ;


G96 S180 M3 ;
T0100 ;
G0 X60.0 Z5.0 T0101 M8 ;
G90 X50.0 Z-40.0 F0.25 ;
X45.0 Z-20.0 ;
X40.0 ;
X35.0 ;
X30.0 ;
X25.0 ;
X20.0 ;
G00 X200.0 Z200.0 T0100 ;
M30 ;

www.manpower.gov.om Chapter 1 -44-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

13- G92 Fixed cycle:

Examples 1:
G30 U0 W0 ;
G50 S1000 T0100 ;
G97 S1000 M03 ;
G00 X70.0 Z5.0
T0101 M08 ;
G92 X49.4 Z–32.0 R–
6.166 F1.5 ;
X49.0 ;
X48.7 ;
X48.5 ;
-
G30 U0 W0 ;
M30 ;

www.manpower.gov.om Chapter 1 -45-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 2:
G30 U0 W0 ;
G50 S1000 T0100 ;
G97 S1000 M03 ;
G00 X60.0 Z5.0 T0101
M08 ;
G92 X49.5 Z–30.0 F1.5 ;
X49.2 ;
X48.9 ;
X48.7 ;
-
-
G30 U0 W0 ;
M30 ;

Example 3:
N10 G97 S1500 M03 ;
T0300 ;
G00 X30.0 Z5.0 T0303 ;
G92 X19.5 Z-15.0 F2.0 ;
X19.2 ;
X18.9 ;
X18.6 ;
X18.4 ;
G00 X50.0 ;
Z-25.0 S1000 ;
G92 X39.5 Z-50.0 F2.0 ;
X39.2 ;
X38.9 ;
X38.6 ;
X38.4 ;
G00 X200.0 Z200.0 T0300 ;
M30 ;

www.manpower.gov.om Chapter 1 -46-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 4:

N10 G97 S1000 M03 ;


T0300 ;
G00 X35.0 Z5.0 T0303 ;
G92 X29.5 Z-32.0 F1.5 ;
X29.2 ;
X28.9 ;
X28.7 ;
G00 X200.0 Z200.0 T0300 ;
M30 ;

14- G94 (Stock removal cycle in facing):

www.manpower.gov.om Chapter 1 -47-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

www.manpower.gov.om Chapter 1 -48-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 1:
G30 U0 W0 ;
G50 S2000 T0100 ;
G96 S200 M03 ;
G00 X85.0 Z2.0 T0101
M08 ;
G94 X40.0 Z–2.0 F0.2
Z–4.0 ;
Z–6.0 ;
Z–8.0 ;
Z–10.0 ;
Z–12.0 ;
Z–14.0 ;
Z–16.0 ;
Z–18.0 ;
Z-19.7 ;
Z–20.0 ;
G30 U0 W0 ;
M30 ;
Example 2:
N10 G50 S2500 ;
G96 S180 M03 ;
T0100 ;
G00 X55.0 Z2.0 T0101 ;
G94 X15.0 Z-2.0 F0.2 ;
Z-4.0 ;
Z-6.0 ;
Z-8.0 ;
G00 X200.0 Z200.0 T0100 ;
M30 ;

www.manpower.gov.om Chapter 1 -49-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

Example 3:

N10 G50 S2500 ;


G96 S180 M03 ;
T0300 ;
G00 X85.0 Z2.0 T0303 ;
G94 X12.0 Z-2.0 F0.2 ;
Z-4.0 ;
Z-6.0 ;
Z-7.0 ;
G00 X85.0 Z-5.0 ;
G94 X40.0 Z-9.0 F0.2 ;
Z-11.0 ;
Z-13.0 ;
Z-15.0 ;
Z-17.0 ;
G00 X200.0 Z200.0 T0300 ;
M30 ;

15- G96, G97 (Constant travelling speed control ON, OFF):

G Constant travelling speed


Meaning Unit
Code control
G 96 ON To control the travelling speed m/min
constantly
G 97 OFF Designate the rotating time of rpm
main spindle

Example:
G96 S100 ;
Cutting speed is 100m/min
G97 S100 ;
Rotating time of main spindle is 100rpm

www.manpower.gov.om Chapter 1 -50-


CNC PROGRAMMING & MACHINING II
PART A : TURNING CYCLES

16- G98, G99 (Feed rate selection):

G GODE Meaning Unit


G 98 Feed rate per minute mm/min
G 97 Feed rate per rotation mm/rev

Example:
G98 G01 Z100.0 F50.0 ;
Feed rate of tool is 50mm per minute.
G97 G01 Z10.0 F0.3 ;
Feed rate of tool is 0.3mm per rotation of main spindle.

www.manpower.gov.om Chapter 1 -51-


CNC Programming & Machining II
ACTIVITY
Write the adequate program using cycles:

Example 1:

CNC Programming & Machining II

www.manpower.gov.om Chapter 1 -52-


CNC Programming & Machining II

Example 2:
ACTIVITY

www.manpower.gov.om
Chapter 1
-53-
CNC Programming & Machining II
CNC Programming & Machining II

Example 3:

www.manpower.gov.om
Chapter 1
ACTIVITY

-54-
CNC Programming & Machining II
CNC Programming & Machining II

Example 4:
ACTIVITY

www.manpower.gov.om
Chapter 1
-55-
CNC Programming & Machining II
CNC Programming & Machining II

Example 5:

www.manpower.gov.om
Chapter 1
ACTIVITY

-56-
CNC Programming & Machining II
CNC Programming & Machining II

Example 6:
ACTIVITY

www.manpower.gov.om
Chapter 1
-57-
CNC Programming & Machining II
CNC Programming & Machining II

Example 7:

www.manpower.gov.om
Chapter 1
ACTIVITY

-58-
CNC Programming & Machining II
CNC Programming & Machining II

Example 8:
ACTIVITY

www.manpower.gov.om
Chapter 1
-59-
CNC Programming & Machining II
CNC Programming & Machining II

Example 9:

www.manpower.gov.om
Chapter 1
ACTIVITY

-60-
CNC Programming & Machining II
CNC Programming & Machining II

Example 10:
ACTIVITY

www.manpower.gov.om
Chapter 1
-61-
CNC Programming & Machining II
CNC Programming & Machining II

Example 11:

www.manpower.gov.om
Chapter 1
ACTIVITY

-62-
CNC Programming & Machining II
CNC Programming & Machining II

Example 12:
ACTIVITY

www.manpower.gov.om
Chapter 1
-63-
CNC Programming & Machining II
CNC Programming & Machining II

Example 13:

www.manpower.gov.om
Chapter 1
ACTIVITY

-64-
CNC Programming & Machining II
CNC Programming & Machining II

Example 14:
ACTIVITY

www.manpower.gov.om
Chapter 1
-65-
CNC Programming & Machining II
CNC Programming & Machining II

www.manpower.gov.om
Chapter 1
Technical Guide
ACTIVITY

-66-
CNC Programming & Machining II
CNC Programming & Machining II

Cutting Conditions:
ACTIVITY

www.manpower.gov.om
Chapter 1
-67-
CNC Programming & Machining II
CNC Programming & Machining II
ACTIVITY

Cutting time of thread process (For thread processing with the S 45 C):

CNC Programming & Machining II

www.manpower.gov.om Chapter 1 -68-


Milling Cycles

Part B
CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

1- Reminder:
1-1- G-Code list:
STANDARD G CODE FUNCTION
G00 Rapid Linear Positioning
G01 Linear Feed Interpolation
G02 CW Circular Interpolation
G03 CCW Circular Interpolation
G04 Dwell
G12 CW Circular Pock Milling (Yasnac)
G13 CCW Circular Pock Milling (Yasnac)
G17 XY Plane Selection
G18 ZX Plane Selection
G19 YZ plane Selection
G20 Input In Inches
G21 Input In Millimeters
G22 Stored Stroke Limit ON
G23 Stored Stroke Limit OFF
G27 Reference Point Return Check
G28 Return To Reference Point
G29 Return From Reference Point
G30 Return To 2nd, 3rd and 4th Ref. Point
G31 Skip Cutting
G33 Thread Cutting
G40 Cutter Compensation Cancel
G41 Cutter Compensation Left
G42 Cutter Compensation Right
G43 Tool Length Compensation + Direction
G44 Tool Length Compensation - Direction
G45 Tool Offset Increase
G46 Tool Offset Double
G47 Tool Offset Double Increase
G48 Tool Offset Double Decrease
G49 Tool Length Compensation Cancel

www.manpower.gov.om Chapter 2 -70-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

STANDARD G CODE FUNCTION


G50 Scaling Off
G51 Scaling On
G52 Local Coordinate System Setting
G54 Work Coordinate System 1 Selection
G55 Work Coordinate System 2 Selection
G56 Work Coordinate System 3 Selection
G57 Work Coordinate System 4 Selection
G58 Work Coordinate System 5 Selection
G59 Work Coordinate System 6 Selection
G60 Single Direction Positioning
G61 Exact Stop Mode
G6 Cutting Mode
G65 Custom Macro Simple Call
G66 Custom Macro Modal Call
G67 Custom Macro Modal Call Cancel
G68 Coordinate System Rotation ON
G69 Coordinate System Rotation OFF
G73 Peck Drilling Cycle
G74 Counter Tapping Cycle
G76 Fine Boring
G80 Canned Cycle Cancel
G81 Drilling Cycle, Spot Boring
G82 Drilling Cycle, Counter Boring
G83 Peck Drilling Cycle
G84 Tapping Cycle
G85 Boring Cycle
G86 Boring Cycle
G87 Back Boring Cycle
G88 Boing Cycle
G89 Boring Cycle
G90 Absolute Programming

www.manpower.gov.om Chapter 2 -71-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

STANDARD G CODE FUNCTION


G91 Incremental Programming
G92 Programming Of Absolute Zero
G94 Feed Per Minute
G95 Feed Per Revolution
G96 Constant Surface Speed Control
G97 Constant Surface Speed Control Cancel
G98 Return To Initial Point In Canned Cycles
G99 Return To R Point In Canned Cycles

1-2- M-Code list:


STANDARD M CODE FUNCTION
M00 Program stop
M01 Optional program stop
M02 End of program
M03 Spindle start forward CW
M04 Spindle start reverse CCW
M05 Spindle Stop
M06 Tool Change
M07 Mist Coolant ON
M08 Flood Coolant ON
M09 Coolant OFF
M19 Spindle Orientation ON
M20 Spindle Orientation OFF
M21 Tool Magazine Right
M22 Tool Magazine Left
M23 Tool Magazine Up
M24 Tool Magazine Down
M25 Tool Clamp
M26 Tool Unclamp
M27 Clutch Neutral ON
M28 Clutch Neutral OFF

www.manpower.gov.om Chapter 2 -72-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

STANDARD M CODE FUNCTION


M30 End Program, Stop and Rewind
M98 Call Sub Program
M99 End Sub Program

2- G90 (Activate Absolute Dimensions):

Absolute Dimensioning:
In the absolute system all
dimensions refer to the origin (zero
point) of the coordinate system, which
is also called the dimensioning
reference point.

Example:

N085 G90 ;
N090 G00 X+30. Y+30. Z+2. ;
N095 G01 Z-6. ;
N100 G01 X+110. Y+75. ;

www.manpower.gov.om Chapter 2 -73-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

3- G91 (Activate Incremental Dimensions):

Incremental Dimensioning:
Contrary to the absolute system,
the incremental dimensioning system
is based on specifying the distance
between a current point and its
preceding point on an axis. Because in
this system a sequence of additive
dimensions is produced, it is called
incremental.

Example:

N085 G00 X+30. Y+30. Z+2. ;


N090 G91 ;
N095 G01 Z-8. ;
N100 G01 X+80. Y+45. ;

www.manpower.gov.om Chapter 2 -74-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

4- G00 (Rapid traverse):

Rapid traverse:

The cutter moves from its current


position (starting point) to the
programmed target position (end point).

Examples:

Programming Example for Absolute


Dimensioning:

N090 G00 X+30. Y+65. Z+12. ;


N095 G90 ;
N100 G00 X+105. Y+35. Z+2. ;

Programming Example for Incremental


Dimensioning:

N090 G00 X+30. Y+65. Z+12. ;


N095 G91 ;
N100 G00 X+75. Y-30. Z-10. ;

www.manpower.gov.om Chapter 2 -75-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

5- G01 (Linear Interpolation):

Linear Interpolation in Three Axes:

The tool moves at the specified


feed rate from its current position
(starting point) to the programmed target
point.

Examples:

Programming Example for Absolute


Dimensioning:

N085 G90 ;
N090 G00 X+30. Y+30. Z+2. ;
N095 G01 Z-6. ;
N100 G01 X+110. Y+75. ;

Programming Example for Incremental


Dimensioning:

N085 G00 X+30. Y+30. Z+2. ;


N090 G91 ;
N095 G01 Z-8. ;
N100 G01 X+80. Y+45. ;

www.manpower.gov.om Chapter 2 -76-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

6- G94 (Feed rate F in mm per minute):


Programming Example: N100 G94 F120.

7- G95 (Feed rate F in mm per revolution):


Programming Example: N100 G95 F0.2

8- S (Spindle speed in RPM):


Programming Example: N100 ... S1500 ...

9- Selection of machining planes G17-G18-G19:


A work part can be machined in each of the three possible planes (X Y, Z X or Y
Z). The respective third axis is the feed axis and therefore also the tool axis. The G
commands G17, G18 and G19 serve to select a machining plane for circular
interpolation, tool radius compensation, coordinate rotation or for hole drilling.

For a 3-axis milling machine with vertical spindle position the standard
machining plane is the XY-plane. In the below table the G-commands are listed with
their corresponding machining planes and down feed axes.

Plane Selection Coordinate Plane Feed Axis


(G-Command) (Machining Plane) Tool Axis
G17 XY - Plane Z
G18 ZX - Plane Y
G19 YZ - Plane X

www.manpower.gov.om Chapter 2 -77-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

10- G02 (Circular Interpolation Clockwise):


The tool will move at the
programmed feed rate clockwise on a
circular arc to the target position as
defined by the coordinates in X and Y.

These coordinates may either be


programmed in the absolute system
(G90) or in the incremental system
(G91).

Examples:

Programming Example with Absolute


Coordinates:

N085 G90 ;
N090 G00 X+55. Y+35. Z+2. ;
N095 G01 Z-5. ;
N100 G02 X+95. Y+75. I+30. J+10. ;

Programming Example with Incremental


Coordinates:

N085 G00 X+55. Y+35. Z+2. ;


N090 G91 ;
N095 G01 Z-7. ;
N100 G02 X+40. Y+40. I+30. J+10. ;

www.manpower.gov.om Chapter 2 -78-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

11- G03 (Circular Interpolation Counter-Clockwise):

The tool will move at the


programmed feed rate counter-clockwise
on a circular arc to the target position as
defined by the coordinates in X and Y.

Examples:

Programming Example with Absolute


Coordinates:

N085 G90 ;
N090 G00 X+55. Y+25. Z+2.;
N095 G01 Z-5.;
N100 G03 X+100. Y+70. I+15. J+30.;

Programming Example with Incremental


Coordinates:

N085 G00 X+55. Y+25. Z+2. ;


N090 G91 ;
N095 G01 Z-7. ;
N100 G03 X+45. Y+45. I+15. J+30. ;

www.manpower.gov.om Chapter 2 -79-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

12- G81 (Drilling cycle):

Format
G81 X_ Y_ Z_ R_ L_ F_
F: Feed rate in inches (or mm) per minute
L: Number of holes to drill if G91 (Incremental Mode) is used
R: Position of the R plane (position above the part)
X: X-axis motion command
Y: Y-axis motion command
Z: Position of the Z-axis at the bottom of hole

Example:

www.manpower.gov.om Chapter 2 -80-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

O60810 (Drilling grid plate 3x3 holes) ;

(G54 X0 Y0 is at the top-left of part) ;

(Z0 is at the top of the part) ;

(T1 is a drill) ;

(BEGIN PREPARATION BLOCKS) ;

T1 M06 (Select tool 1) ;

G00 G90 G40 G49 G54 (Safe startup) ;

G00 G54 X1.0 Y-1.0 (Rapid to 1st position) ;

S1000 M03 (Spindle on CW) ;

G43 H01 Z0.1 (Activate tool offset 1) ;

M08 (Coolant on) ;

(BEGIN CUTTING BLOCKS) ;

G81 Z-1.5 F15. R.1 (Begin G81 & drill 1st hole) ;

G91 X1.0 L2 (Drill 1st row of holes) ;

G90 Y-2.0 (1st hole of 2nd row) ;

G91 X-1.0 L2 (2nd row of holes) ;

G90 Y-3.0 (1st hole of 3rd row) ;

G91 X1.0 L2 (3rd row of holes) ;

(BEGIN COMPLETION BLOCKS) ;

G00 Z0.1 M09 (Rapid retract, Coolant off) ;

G53 G49 Z0 M05 (Z home, Spindle off) ;

G53 Y0 (Y home) ;

M30 (End program) ;

www.manpower.gov.om Chapter 2 -81-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

13- G82 (Spot Drill Canned Cycle):

Format
G81 X_ Y_ Z_ R_ P_ L_ F_
F: Feed rate in inches (or mm) per minute
L: Number of holes if G91 (Incremental Mode) is used
P: The dwell time at the bottom of the hole
R: Position of the R plane (position above the part)
X: X-axis location of hole
Y: Y-axis location of hole
Z: Position of bottom of hole

Example:
Program Example Description
%
O1234 (Sample program)
T1 M06; (Tool #1 is a 0.5” x 90-degree spot drill)
G90 G54 G00 X.565 Y-1.875 S1275 M03;
G43 H01 Z0.1 M08;
G82 Z-0.175 P.3 R0.1 F10. ; (90-degree spot drill; the depth is)
X1.115 Y-2.750 ; (half of the chamfer diameter)
X3.365 Y-2.875 ;
X4.188 Y-3.313 ;
X5.0 Y-4.0 ;
G80 G00 Z1.0 M09 ;

www.manpower.gov.om Chapter 2 -82-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

14- G83 (Normal Peck Drilling Canned Cycle):

Format
G83 X_ Y_ Z_ R_ P_ Q_ L _ I_ J_ K_ F_
F: Feed rate in inches (or mm) per minute
I: Size of first cutting depth
J: Amount to reduce cutting depth each pass
K: Minimum depth of cut
L: Number of holes if G91 (Incremental Mode) is used
P: Pause at end of last peck, in seconds (Dwell)
Q: Cut depth, always incremental
R: Position of the R plane (position above the part)
X: X-axis location of hole
Y: Y-axis location of hole
Z: Position of the Z-axis at the bottom of hole

Example:
Program Example Description
T2 M06 ; (Tool #2 is a 0.3125” stub drill)
G90 G54 G00 X0.565 Y-1.875 S2500 M03 ;
G43 H02 Z0.1 M08 ;
G83 Z-0.720 Q0.175 R0.1 F15. ; (Drill point is 1/3 of the drill diameter)
X1.115 Y-2.750 ;
X3.365 Y-2.875 ;
X4.188 Y-3.313 ;
X5.0 Y-4.0 ;
G80 G00 Z1.0 M09 ;

www.manpower.gov.om Chapter 2 -83-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

15- G84 (Tapping Canned Cycle):

Format
G84 X_ Y_ Z_ R_ L _ J_ F_
F: Feed rate in inches (or mm) per minute
J: Retract Multiple (Example: J2 will retract twice as fast as the cutting speed)
L: Number of holes if G91 (Incremental Mode) is used
R: Position of the R plane (Position above the part)
X: X-axis location of hole
Y: Y-axis location of hole
Z: Position of the Z-axis at the bottom of hole

Example:
Program Example
T3 M06 ; (Tool #3 is a 3/8-16 tap)
G90 G54 G00 X0.565 Y-1.875 S900 M03 ;
G43 H03 Z0.2 M08 ;
G84 Z-0.600 R0.2 F56.25 ; (900 rpm divided by 16 tpi = 56.25 ipm)
X1.115 Y-2.750 ;
X3.365 Y-2.875 ;
X4.188 Y-3.313 ;
X5.0 Y-4.0 ;
G80 G00 Z1.0 M09 ;
G28 G91 Y0 Z0 ;
M30 ;
%

www.manpower.gov.om Chapter 2 -84-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

16- G85 (Boring Canned Cycle):

Format
G85 X_ Y_ Z_ R_ L _ F_
F : Feed rate in inches (or mm) per minute
L : Number of holes if G91 (Incremental Mode) is used
R : Position of the R plane (position above the part)
X : X-axis location of holes
Y : Y-axis location of holes
Z : Position of the Z-axis at the bottom of hole

17- G12/G13 (Circular Pocket Milling CW/CCW):

www.manpower.gov.om Chapter 2 -85-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

Format
G12/G13 I_ K_ Q_ F_ Z_ D_
D: Tool radius or diameter selection
I: Radius of first circle (or finish if no K). I value must be greater than Tool Radius,
but less than K value.
K: Radius of finished circle (if specified)
L: Loop count for repeating deeper cuts
Q: Radius increment, or step over (must be used with K)
F: Feed rate in inches (mm) per minute
Z: Depth of cut or increment

Example 1:

O00098 (SAMPLE G12 AND G13)


(OFFSET D01 SET TO APPROX. TOOL SIZE)
(TOOL MUST BE MORE THAN Q IN DIAM.)
T1 M06 ;
G54 G00 G90 X0 Y0 ; (Move to center of G54)
G43 Z0.1 H01 ;
S2000 M03 ;
G12 I1.5 F10. Z-1.2 D01 ; (Finish pocket clockwise)
G00 Z0.1 ;
G55 X0 Y0 ; (Move to center of G55)
G12 I0.3 K1.5 Q0.3 F10. Z-1.2 D01 ; (Rough and finish clockwise)
G00 Z0.1 ;
G56 X0 Y0 ; (Move to center of G56)
G13 I1.5 F10. Z-1.2 D01 ; (Finish pocket counterclockwise)
G00 Z0.1 ;
G57 X0 Y0 ; (Move to center of G57)
G13 I0.3 K1.5 Q0.3 F10. Z-1.2 D01 ; (Rough and finish counterclockwise)
G00 Z0.1 ;
G28 ;
M30 ;

www.manpower.gov.om Chapter 2 -86-


CNC PROGRAMMING & MACHINING II
PART B : MILLING CYCLES

Example 2: (multiple-pass)

Description
O4000 (0.500 entered in the Radius/Diameter offset column)
T1 M06 ; (Tool #1 is a 0.500” diameter end mill)
G00 G90 G54 X0 Y0 S4000 M03 ;
G43 H01 Z.1 M08 ;
G01 Z0 F30.;
G13 G91 Z-.5 I.400 K2.0 Q.400 L4 ;
D01 F20. ;
G00 G90 Z1.0 M09 ;
G28 G91 Y0 Z0 ;
M30 ;

www.manpower.gov.om Chapter 2 -87-


CNC PROGRAMMING & MACHINING II
ACTIVITY
Write the adequate program using cycles:

Example 1:

Example 2:

CNC PROGRAMMING & MACHINING II

www.manpower.gov.om Chapter 3 -88-


CNC PROGRAMMING & MACHINING II
ACTIVITY

Example 3:

Example 4:
CNC PROGRAMMING & MACHINING II

www.manpower.gov.om Chapter 3 -89-


CNC PROGRAMMING & MACHINING II

Example 5:

www.manpower.gov.om
Chapter 3
ACTIVITY

-90-
CNC PROGRAMMING & MACHINING II
CNC PROGRAMMING & MACHINING II

Example 6:
ACTIVITY

www.manpower.gov.om
Chapter 3
-91-
CNC PROGRAMMING & MACHINING II
CNC PROGRAMMING & MACHINING II

Example 7:

www.manpower.gov.om
Chapter 3
ACTIVITY

-92-
CNC PROGRAMMING & MACHINING II
CNC PROGRAMMING & MACHINING II

Example 8:
ACTIVITY

www.manpower.gov.om
Chapter 3
-93-
CNC PROGRAMMING & MACHINING II
CNC PROGRAMMING & MACHINING II
ACTIVITY
Example 9:

Example 10:

CNC PROGRAMMING & MACHINING II

www.manpower.gov.om Chapter 3 -94-


CNC PROGRAMMING & MACHINING II
ACTIVITY

ANSWER KEY
Example 1:

POINT A B C D
X 20 20 60 60
Y 15 35 35 15

O100

N10 G90 ;

N20 G71 ;

N30 X-5 Y-5 Z25 ;

N40 X20 Y15 Z2 ;

N50 M03 S1500 ;

N60 G81 Z-10 F125 ;

N70 X20 Y35 ;

N80 G81 Z-10 F125 ;

N90 X60 Y35 ;

N100 G81 Z-10 F125 ;


CNC PROGRAMMING & MACHINING II

N110 X60 Y15 ;

N120 G81 Z-10 F125 ;

N130 M05 X-5 Y-5 Z25 ;

N140 M30 ;

www.manpower.gov.om Chapter 3 -95-


CNC PROGRAMMING & MACHINING II
ACTIVITY
Example 2:

O200

N10 G90 ;

N20 G71 ;

N30 X-5 Y-5 Z25 ;

N40 X1 Y54 Z2 ;

N50 M03 S1500 ;

N60 G01 Z-2 F125 ;

N70 G01 Y-5 F125 ;

N80 X79 Y-5 Z2 ;

N90 G01 Z-2 F125 ;

N100 G01 Y55 F125 ;

N110 M05 X-5 Y-5 Z25 ;

N120 M06 I2 J 6 ;

N130 X20 Y15 Z2 ;

CNC PROGRAMMING & MACHINING II


N140 M03 S1500 ;

N150 G81 Z-17 F125 ;

N160 X20 Y35 ;

N170 G81 Z-17 F125 ;

N180 X60 Y35 ;

N190 G81 Z-17 F125 ;

N200 X60 Y15 ;

N210 G81 Z-17 F125 ;

www.manpower.gov.om Chapter 3 -96-


CNC PROGRAMMING & MACHINING II
ACTIVITY

N220 M05 X-5 Y-5 Z25 ;

N230 M06 I2 J10 ;

N240 X40 Y25 Z2 ;

N250 M03 S1500 ;

N260 G89 X30 Y0 Z5 J3 F125 ;

N270 M05 X-5 Y-5 Z25 ;

N280 M30 ;
CNC PROGRAMMING & MACHINING II

www.manpower.gov.om Chapter 3 -97-


CNC PROGRAMMING & MACHINING II
ACTIVITY
Example 4:

O400

N10 G90 ;

N20 G71 ;

N30 X0 Y0 Z25 ;

N40 M03 X40 Y25 Z2 S2000 ;

N50 G86 X6 Z5 I0 J20 F80 ;

N60 M05 X0 Y0 Z25 ;

N70 M06 I2 J5 ;

N80 M03 X40 Y25 Z2 S2000 ;

N90 G87 X30 Y10 Z5 I0 J5 F80 ;

N100 G87 X30 Y10 Z5 I1 J5 F80 ;

N110 M05 X0 Y0 Z25 ;

N120 M30 ;

CNC PROGRAMMING & MACHINING II

www.manpower.gov.om Chapter 3 -98-


CNC PROGRAMMING & MACHINING II
ACTIVITY

Example 5:

……
N10 T10 D10 ;
N20 G00 G90 G43 Z25 S1000 M03 M08 M41 ;
N30 G81 G98 X15 Y15 Z2 I-20 F200 ;
N40 X85 ;
N50 Y85 ;
N60 X15 ;
N70 X50 Y75 ;
N80 G93 I50 J50 ;
N90 G91 Q-45 N3 ;
N100 G80 ;
N110 G00 G90 G44 Z30 ;
N120 M30 ;

Example 6:
……
N10 T06 D06 ;
N20 G00 G90 G43 Z25 S1800 M03 M08 M41 ;
CNC PROGRAMMING & MACHINING II

N30 G82 G99 X-30 Y-50 Z2 I-3 k150 F200 ;


N40 G91 X12 Y20 N5 ;
N50 G90 G82 G99 X50 Y50 Z-13 I-18 K150 ;
N60 G98 Y-50 ;
N70 G99 X-50 ;
N80 G98 Y50 ;
N90 G80 ;
N100 G00 G90 G44 Z30 ;
N110 M30 ;

www.manpower.gov.om Chapter 3 -99-


CNC PROGRAMMING & MACHINING II
ACTIVITY
Example 7:
……
N10 T10 D10 ;
N20 G00 G90 G43 Z25 S1000 M03 M41 ;
N30 G83 G99 X-50 Y50 Z2 I-15 J3 F200 ;
N40 X50 ;
N50 Y-50 ;
N60 X-50 ;
N70 G93 I-60 J-60 ;
N80 R80 Q30 ;
N90 Q70 ;
N100 G80 ;
N110 G00 G90 G44 Z30 ;
N120 M30 ;

Example 8:
……
N10 T12 D12 ;
N20 G00 G90 G43 Z25 S300 M03 M08 M41 ;
N30 G93 I0 J0 ;
N40 G84 G99 R30 Q180 Z10 I-20 K150 F450 ;
N50 G91 Q120 N2 ;

CNC PROGRAMMING & MACHINING II


N60 G90 G98 G84 X50 Y0 Z-5 I-35 K150 ;
N70 X0 Y50 ;
N80 X-50 Y0 ;
N90 X0 Y-50 ;
N100 G80 ;
N110 G00 G90 G44 Z30 ;
N120 M30 ;

www.manpower.gov.om Chapter 3 -100-

You might also like