Вы находитесь на странице: 1из 296

CNC PROGRAMMING

WORKBOOK

TEACHER KIT
D t f le
MILL AND LATHE

n
p

io
no m
tr r
ut
is o
Sa

By Matthew Manton and Duane Weidinger


ib
CNC Programming Teacher Kit
Published by
CamInstructor Incorporated
330 Chandos Crt.
Kitchener, Ontario
N2A 3C2
www.caminstructor.com

Date: June 1, 2013


Author: Matthew Manton and Duane Weidinger
ISBN: 978-1-897466-86-5

Copyright 2013 CamInstructor Inc. - All rights reserved.


This book is protected under the copyright laws of Canada and the United States. All rights are reserved. This
document may not, in whole or part, be copied, photocopied, reproduced, translated or reduced to any
electronic medium or machine-readable form without prior consent, in writing, from CamInstructor Inc.
D t f le
National Library of Canada Cataloguing in Publication

n
To order additional copies of the book contact:
CamInstructor Inc.
p
330 Chandos Crt, Kitchener, ON, N2A 3C2

io
Phone 1-877-873-6867
Fax 1-866-741-8421
no m

email sales@caminstructor.com
tr r
ut
is o
Limit of Liability/Disclaimer of Warranty: While the Publisher and Author have used their best efforts in
preparing this book, they make no representations or warranties with respect to the accuracy or
Sa

completeness of the contents of this book and specifically disclaim any implied warranties of
merchantability or fitness for a particular purpose. No warranty may be created or extended by
ib
representatives. The advice and strategies contained in this book may not be suitable for the readers or
users situation. Neither the publisher nor author shall be liable for any damage, loss or any other damages,
including but not limited to special, incidental, consequential, or other damages including personal.

Notice
CamInstructor Inc. reserves the right to make improvements to this book at any time and without notice.

Trademarks
All brands are the trademark of their respective owners.

Printed in Canada

Requirements
Use of the Multi-media CD/DVD requires a computer with speakers, and CD/DVD ROM.
June 18, 2013
How to Use The Programming Workbook
The CNC Programming Student Workbook includes a DVD with the following Videos and
support files on it.
1. Self-Learning Videos
2. Discriminator BackPlot Installation Software

To view whats on the DVD just follow the instructions below. We encourage you to take a few
moments to watch the Getting Started video on the DVD as it provides an overview of how the
system works.

Just pop the DVD into your computer, the autorun feature should display the AutoPlay window.
Click on the Run CNC-Mill.exe file as shown below. Note, if this window is not displayed after
putting the DVD into your computer, go to the file manager feature on your computer and select
the DVD drive and double click on the Run CNC-Mill.exe file.
D t f le

n
p

io
no m
tr r
ut
is o
The following Menu Screen should appear;
Sa

ib

How to Use The Programming Workbook Page - 1


The Menu is your easy access to the Instructional Videos that will guide you through the
content and provide you with all the information you need to get through this workbook. You
will notice that there are 10 Lessons and a Getting Started link. Each Lesson matches the
corresponding lesson in this workbook. Be sure to watch the video first, it will guide you to
information in the workbook.

Step 1: Watch the Getting Started Video. Dont worry about taking notes or filling out
anything in the workbook while you watch the Getting Started Video, it is just a preview of what
to expect.

Step 2: The second item on the DVD is the Discriminator installation file. We have provided
this to you free of charge so you can install Discriminator onto your computer. Discriminator
Software enables you to type in the CNC Code (G Code) and watch what it will do. It is a
handy tool to see if your CNC Programs are correct.

1. To access the Discriminator installation file put the DVD into your computer and locate the
Discriminator folder as shown below.
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
2. Double click on the Discriminator folder as shown above and then double click on the
Discriminator21017.exe file as shown below and follow the onscreen instructions.

How to Use This Guide Page - 2


TABLE OF CONTENTS-MILL

LESSON-1 ..ABSOLUTE & INCREMENTAL POSITIONING ........................................................1

EXERCISES 1 THROUGH 4 ABSOLUTE & INCREMENTAL ........................................... 2

LESSON-2 .. INTRODUCTION TO CNC CODES .......................................................................7

AUTOMATIC TOOL CHANGER STANDARD TOOL CAROUSEL ................................... 8

COMMONLY USED PREPARATORY G-CODES ........................................................... 9

COMMONLY USED MISCELLANEOUS M-CODES ...................................................... 10

EXAMPLE OF PROGRAM START-UP BLOCKS ............................................................ 11


D t f le
EXAMPLE OF PROGRAM END BLOCKS ..................................................................... 12

n
EXAMPLE OF PROGRAM TOOL CHANGE BLOCKS .................................................... 12
p

io
RAPID (G00) AND LINEAR (G01) INTERPOLATION ................................................... 13
no m

CNC PART #1 SPOT DRILLING SAMPLE PROGRAM ................................................ 15


tr r
ut
LESSON-3 .. CREATING CNC PROGRAMS - CNC PART #1.......................................................17
is o
Sa

CNC PART #1 SPOT AND DRILLING SAMPLE PROGRAM1 ..................................... 18


ib
LESSON-4 .. DRILLING USING CANNED CYCLES ....................................................................21

DRILLING CANNED CYCLES ....................................................................................... 22

CNC PART #1 SPOT AND DRILLING PROGRAM USING G81 ................................... 24

CNC PART #1 WHAT COULD GO WRONG?............................................................ 26


TABLE OF CONTENTS

LESSON-5 .. DRILLING USING CANNED CYCLES ....................................................................27

CNC PART #2 - SPOT AND DRILLING PROGRAM USING G81.................................... 28

CNC PART #2 - CREATE THE PROGRAM TO SPOT AND DRILL .................................. 30

CNC - PART #2 - TYPING UP YOUR PROGRAM USING WINDOWS NOTEPAD........... 32

CNC - PART #2 - BACKPLOTTING .............................................................................. 35

CNC - PART #3 - CREATE THE PROGRAM ................................................................. 37

CNC - PART #3 - BACKPLOTTING .............................................................................. 41


D t f le
CNC - PART #4 - CREATE THE PROGRAM ................................................................. 42

n
LESSON-6 .. STRAIGHT LINE MILLING LINEAR INTERPOLATION ..........................................47
p

io
EXERCISE #1 - ABSOLUTE & INCREMENTAL POSITIONING ...................................... 48
no m

CNC PART #5 STRAIGHT LINE MILLING SAMPLE PROGRAM ................................. 49


tr r
ut CNC PART #6 STRAIGHT LINE MILLING SAMPLE PROGRAM ................................. 52
is o
Sa

CNC PART #7 CREATE THE PROGRAM................................................................... 55


ib
CNC PART #8 CREATE THE PROGRAM................................................................... 58

LESSON-7 .. CIRCULAR INTERPOLATION ..............................................................................61

CIRCULAR INTERPOLATION EXERCISES .................................................................... 63

CIRCULAR INTERPOLATION SAMPLE PROGRAMS .................................................... 70

LESSON-8 .. CIRCULAR INTERPOLATION ..............................................................................75

CNC PART #9 CIRCULAR INTERPOLATION CREATE THE PROGRAM ...................... 76

CNC PART #10 - CIRCULAR INTERPOLATION CREATE THE PROGRAM ..................... 82

Table of Contents - 2
TABLE OF CONTENTS

LESSON-9 .. CIRCULAR INTERPOLATION ..............................................................................89

CNC PART #11 - CIRCULAR INTERPOLATION CREATE THE PROGRAM ..................... 90

CNC PART #12 - CIRCULAR INTERPOLATION CREATE THE PROGRAM ..................... 96

LESSON-10 CUTTER COMPENSATION.................................................................................103

INTRODUCTION TO CUTTER COMPENSATION ......................................................... 104

CNC PART #13 - CUTTER COMPENSATION CREATE THE PROGRAM ........................ 106

CNC PART #14 - CUTTER COMPENSATION CREATE THE PROGRAM ........................ 114
D t f le
APPENDIX ..........................................................................................................................123

n
EXTRA CNC PROGRAMMING EXERCISES .................................................................. 124
p

io
PREPATORY FUNCTIONS G-CODES........................................................................ 131
no m
tr r
MISCELLANEOUS FUNCTIONS M-CODES .............................................................. 134
ut
is o
STANDARD DRILL SIZES INCHES ............................................................................ 136
Sa

INCH TAP DRILL SIZES ............................................................................................... 137


ib
METRIC TAP DRILL SIZES .......................................................................................... 138

DISCRIMINATOR SOFTWARE INSTALLATION .......................................................... 139

Table of Contents - 3
Sa
no m
D t f le p
is o

Table of Contents - 4
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-1
ABSOLUTE & INCREMENTAL POSITIONING
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 1
LESSON-1 EXERCISE #1 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p

io
G90 ABSOLUTE PROGRAMMING
All axis motions are based on a fixed zero reference point, known as ABSOLUTE ZERO (part zero).
no m

Each coordinate is in relation to this absolute zero using Cartesian Co-ordinates.


tr r
utG91 INCREMENTAL PROGRAMMING
is o
All axis motions are based on the distance to the next location.
Each coordinate is based on how far the cutter is to move from start to finish.
Sa

STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND
ib
BACK TO THE POINT O USING G90 & G91

G90 X Y G91 X Y
O (Origin) 0 0 O1 3 3
1 3 3 12 0 2
2 3 5 23 2 2
3 5 7 34 -6 0
4 -1 7 45 -2 -3
5 -3 4 56 -3 -6
6 -6 -2 67 4 -3
7 -2 -5 78 6 -1
8 4 -6 89 3 3
9 7 -3 9O -7 3

Page 2 TK-Mill Lesson 1 - 2


LESSON-1 EXERCISE #2 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p

io
G90 ABSOLUTE PROGRAMMING
All axis motions are based on a fixed zero reference point, known as ABSOLUTE ZERO (part zero).
no m

Each coordinate is in relation to this absolute zero using Cartesian Co-ordinates.


tr r
ut
G91 INCREMENTAL PROGRAMMING
is o
All axis motions are based on the distance to the next location.
Each coordinate is based on how far the cutter is to move from start to finish.
Sa

STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND
ib
BACK TO THE POINT O USING G90 & G91
G90 X Y G91 X Y
O (Origin) 0 0 O1 3 -4
1 3 -4 12 -1 -3
2 2 -7 23 -6 0
3 -4 -7 34 3 5
4 -1 -2 45 -6 7
5 -7 5 56 6 -3
6 -1 2 67 4 0
7 3 2 78 4 5
8 7 7 89 0 -10
9 7 -3 9O -7 3

TK-Mill Lesson 1 - 3 Page 3


LESSON-1 EXERCISE #3 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p

io
G90 ABSOLUTE PROGRAMMING
All axis motions are based on a fixed zero reference point, known as ABSOLUTE ZERO (part zero).
Each coordinate is in relation to this absolute zero using Cartesian Co-ordinates.
no m
tr r
G91 INCREMENTAL PROGRAMMING
ut
is o
All axis motions are based on the distance to the next location.
Each coordinate is based on how far the cutter is to move from start to finish.
Sa

STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND
BACK TO THE POINT O USING G90 & G91
ib
G90 X Y G91 X Y
O (Origin) 0 0 O1 6 2
1 6 2 12 -7 2
2 -1 4 23 -2 3
3 -3 7 34 -2 -4
4 -5 3 45 -1 -6
5 -6 -3 56 4 -3
6 -2 -6 67 4 0
7 2 -6 78 4 5
8 6 -1 89 -3 -1
9 3 -2 9O -3 2

Page 4 TK-Mill Lesson 1 - 4


LESSON-1 EXERCISE #4 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p

io
no m
tr r
STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND
ut
is o
BACK TO THE POINT O USING G90 & G91
Sa

G90 X Y G91 X Y
O (Origin) 0 0 O1 0.750 0.500
ib
1 0.750 0.500 12 -0.200 1.875
2 0.550 2.375 23 0.400 -1.000
3 0.950 1.375 34 0.675 0.500
4 1.625 1.875 45 0.125 -1.125
5 1.750 0.750 56 0.700 0.500
6 2.450 1.250 67 0.550 -0.900
7 3.000 0.350 78 0.250 1.650
8 3.250 2.000 89 0.250 -1.050
9 3.500 0.950 9O -3.500 -0.950

TK-Mill Lesson 1 - 5 Page 5


Page 6
Sa
no m
D t f le p
is o

TK-Mill Lesson 1 - 6
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

CODE FUNCTION
Rapid traverse motion; This is used for non-cutting rapid moves of the machine axis, or
rapid retract moves after cuts have been completed.
G00
Maximum rapid motion (I.P.M.) of a CNC Machine will vary dependent on machine
model.
D t f le
Linear interpolation motion; Used for cutting in a straight line under a controlled
G01 feedrate. Maximum feed rate (I.P.M.) of a CNC Machine will vary depending on the

n
model of the machine.

G02 Circular Interpolation, Clockwise


p

io
G03 Circular Interpolation, Counterclockwise
G04 Dwell
no m
tr r
G17 Circular Motion XY Plane Selection
ut
is o
G20 Verify Inch Coordinate Positions
Sa

G21 Verify Metric Coordinate Positions


Machine Home (Rapid traverse) G91 is required for rapid move to the G28 reference
G28
ib
point.
G40 Cutter Compensation CANCEL

LESSON-2
INTRODUCTION TO CNC CODES
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 7
LESSON-2 - INTRODUCTION TO CNC CODES
AUTOMATIC TOOL CHANGER
STANDARD TOOL CAROUSEL

The CNC Machining Center used in this text is set-up with following tools.
All program examples and exercises in this workbook are using the tools and tool
numbers listed below.

Carousel # Tool Description

1 0.125 Diameter Flat End Mill


D t f le

n
2 0.250 Diameter Flat End Mill
p

io
3 0.375 Diameter Flat End Mill
no m
tr r
4 0.500 Diameter Flat End Mill
ut
is o
Sa

5 0.750 Diameter Flat End Mill


ib
6 0.375 Diameter Spot Drill

7 0.250 Diameter Drill

8 0.201 Diameter Drill Number 7 drill

9 0.25-20 UNC Tap

10 #4 Center Drill

Page 8 TK-Mill Lesson 2 - 2


COMMONLY USED PREPARATORY G CODES

CODE FUNCTION
Rapid traverse motion; This is used for non-cutting rapid moves of the machine axis, or
rapid retract moves after cuts have been completed.
G00
Maximum rapid motion (I.P.M.) of a CNC Machine will vary dependent on machine
model.
Linear interpolation motion; Used for cutting in a straight line under a controlled
G01 feedrate. Maximum feed rate (I.P.M.) of a CNC Machine will vary depending on the
model of the machine.

G02 Circular Interpolation, Clockwise


G03 Circular Interpolation, Counterclockwise
G04 Dwell
G17 Circular Motion XY Plane Selection
D t f le
G20 Verify Inch Coordinate Positions

n
G21 Verify Metric Coordinate Positions
p
Machine Home (Rapid traverse) G91 is required for rapid move to the G28 reference

io
G28
point.
G40 Cutter Compensation CANCEL
no m
tr r
G41 Cutter Compensation LEFT of the programmed path
G42 ut
Cutter Compensation RIGHT of the programmed path
is o
G43 Tool Length Compensation
Sa

G49 Tool Length Compensation CANCEL


ib
G53 Positions the machine axis relative to Machine Home. It is non modal.
G54 Work Coordinate #1 (Part zero offset location)
G80 Canned Cycle CANCEL
G81 Drill Canned Cycle
G82 Spot Drill Canned Cycle
G83 Peck Drill Canned Cycle
G84 Tapping Canned Cycle
G90 Absolute Programming Positioning
G91 Incremental Programming Positioning
G98 Canned Cycle Initial Point Return
G99 Canned Cycle Rapid (R) Plane Return

TK-Mill Lesson 2 - 3 Page 9


COMMONLY USED MISCELLANEOUS M CODES

CODE FUNCTION

The M00 code is used for a Program Stop. The spindle stops and the coolant is turned
M00 off.
Pressing CYCLE START again will continue the program.

The M01 code is used for an Optional Program Stop command.


Pressing the OPT STOP key on the control panel signals the machine to perform a stop
M01 command when the control reads an M01 command. It will then perform like an M00.
Optional stops are useful when machining the first part to allow for inspection of the
part as it is machined.

Starts the spindle CLOCKWISE used for most machining. Must have a spindle speed
D t f le
defined.
M03

n
The M03 is used to turn the spindle on at the beginning of program or after a tool
change.
p

io
M04 Starts the spindle COUNTERCLOCKWISE. Must have a spindle speed defined.
no m
tr r
STOPS the spindle.
M05 The M05 is used to turn the spindle off at the end of program or before a tool change.
ut
is o
If the coolant is on, the M05 will turn it off.
Sa

The tool change command along with a tool number will action a tool change. This
command will automatically stop the spindle, Z-axis will move up to the machine zero
ib
M06
position and the selected tool will be put in the spindle. The coolant pump will turn off
right before executing the tool change.

M08 Coolant ON command.

M09 Coolant OFF command.

M30 Program End and Reset to the beginning of program.

Note: Only one M code can be used per line. And the M-codes will be the last command to be executed in
a line, regardless of where it is located in that line.

Page 10 TK-Mill Lesson 2 - 4


EXAMPLE OF PROGRAM START-UP BLOCKS

Programs must begin and end with % depending


%
on the type of control.

Letter O and up to a five digit program number.


O00023 Blocks are always terminated by the ; symbol:
End of Block (EOB)

Nnn - Sequence Number


N10 G20
G20 - Verify Inch
Startup
G00 - Rapid Traverse Block
G17 - X, Y Circular Plane Selection (Machine
G40 - Cutter Compensation Cancel Default
N20 G00 G17 G40 G49 G80 G90
D t f le
G49 - Tool Length Compensation Cancel Setting)
G80 - Canned Cycle Cancel

n
G90 - Absolute Programming
p

io
T8 - Tool number #8 to be loaded into the spindle.
N30 T8 M06
M06 - Tool Change
no m
tr r
ut
is o
G00 - Rapid Traverse
G90 - Activates control to be in ABSOLUTE.
Sa

G54 - Selects work coordinate offset system No. 1


ib
N40 G00 G90 G54 X1.0 Y1.0 S4000 M03 X__ - Axis move to initial X position.
Y__ - Axis move to initial Y position.
S4000 - Spindle speed 4000 RPM for this tool.
M03 - Turns the spindle on in a clockwise direction

G43 - Tool Length Compensation: Recognizes the


tool length offset value stored in the Hnn code offset
display register in the offset length display.
H8 - Defines to the control the offset register the
N50 G43 H8 Z2. 0 tool offset value is stored in.
* Tool Length offset # = Tool #
Z2.0 - Informs the control to move from full spindle
retract to this Z value and apply the tool length
offset.

TK-Mill Lesson 2 - 5 Page 11


EXAMPLE OF PROGRAM END BLOCKS

G00 - Rapid Traverse


N200 G00 Z2.0
Z2.0 Retracts tool to 2.0 above part zero

N210 M05 M05 Turn off spindle

G91 - Incremental Programming


N220 G28 G91 Z0 Send to machine
G28 - Machine Zero Return
Z0 - Z axis in the up direction to zero Z-axis first to
* N220 G53 Z0 avoid any crash.
machine zero

*G53 is another way


N230 G28 X0 Y0 G28 - Machine Zero Return
to return to machine
X0 - X axis to machine zero
zero
D t f le
* N230 G53 X0 Y0 Y0 - Y axis to machine zero

n
N240 M30 M30 End of Program and Reset
p

io
no m

EXAMPLE OF PROGRAM TOOL CHANGE LINES


tr r
ut
is o
Rapid Traverse and Retracts tool to 2.0 above part
Sa

N100 G00 Z2.0


zero
ib
N110 M05 M05 Turn off spindle

N120 G28 G91 Z0 ; / *N120 G53 Z0 Machine Zero Return - Z axis Send to machine
zero Z-axis first to
N130 G28 X0 Y0 / *N130 G53 X0 Y0 Machine Zero Return - X, Y axis avoid any crash.

N140 M01 Optional Program Stop

N150 T9 M06 Tool Change - Tool # 9

N160 G00 G90 G54 X1.0 Y1.0 S4000 M03 Turn on the spindle and Rapid traverse to X1. Y1.

N170 G43 H9 Z2.0 Tool Length compensation for Tool #9 (H9)

*G53 - Positions the machine axis relative to Machine Home. It is non modal.

Page 12 TK-Mill Lesson 2 - 6


RAPID G00 AND LINEAR G01 INTERPOLATION

G00 RAPID TRAVERSE


This code is used for rapid motion of the cutter in air to traverse from one position to another as
fast as possible. This code will work for all axis motion up to three axes at once.
This G00 code is modal and causes all the following blocks to be in rapid motion until another
Group 01 code is specified. The actual rapid federate is dependent on the machine.
Generally, rapid motions "will not" be in a straight line. All the axes specified are moved at the
maximum speed and will not necessarily complete each axis move at the same time. It activates
each axis drive motor independently of each other and, as a result, the axis with the shortest move
will reach its destination first. So you need to be careful of any obstructions to avoid with this type
D t f le
of rapid move.

n
G00 is used when you are positioning the cutter in fresh air.
Retracting from a hole you have drilled.
p

io
Rapid traverse is not used when cutting the part.
Used incorrectly, rapid traverse will break a cutter very easily.
no m
tr r
ut
is o
G01 LINEAR INTERPOLATION
Sa

This G code provides for straight line (linear) motion with programmed feedrate for all axis motions
from point to point. Motion can occur up to three axes at once.
ib
All axes specified will start at the same time and proceed to their destination and arrive
simultaneously at the specified feedrate.
To program a feedrate, the F command is used. The F command is modal and may be specified in a
previous block.

G01 is used for


Drilling a hole
Machining a slot
Machining a profile

TK-Mill Lesson 2 - 7 Page 13


LESSON-2 - CNC - PART #1

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 14 TK-Mill Lesson 2 - 8


LESSON-2 - CNC - PART #1
WORK OUT THE X AND Y COORDIANTES FOR HOLES 1,2 AND 3
X0Y0 is at the centre of the part

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

G90 X Y
1 -1.0 -0.875
2 0 0
3 1.0 0.875

TK-Mill Lesson 2 - 9 Page 15


LESSON-2 - CNC - PART #1
PROGRAM TO SPOT DRILL THE THREE HOLES ONLY USING A COMBINATION OF
G00 AND G01 (CANNED CYCLE DRILL WILL BE USED LATER)
Below is the program to spot drill the three holes with an explanation of each block
Use a 0.375 diameter Spot Drill Tool # 6
Spindle Speed = 2750 Feed rate = 11 IPM
Spot Drill Depth = Z-0.150
X0Y0 is at the centre of the part
Z=0 is the top of the part.
Information inside the parenthesis ( ) is a comment.
The CNC control will ignore all text between the parenthesis

% (Program must begin and end with a %)


O1 ( Program #1 - CNC-PART-1-SPOT DRILLING ONLY )
N10 G20 (Inch programming)
D t f le
N20 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING)

n
N30 T06 M06 (T6-Select tool number 6 to be loaded M06-Activates the tool changer)
N40 G00 G90 G54 X-1.0 Y-0.875 S2750 M03 (Rapid to the X and Y position and turn on the spindle at
p
2750 RPM)

io
N50 G43 H06 Z0.1 (G43 - Activate the tool offset value stored in H06 and rapid to Z0.1)
N60 G01 Z-0.15 F11.0 (Hole #1 - Feed down to Z depth at 11 inches per minute)
no m
tr r
N70 G00 Z0.1 (G00- Retract out of hole #1 at rapid to 0.1 above the top of the work piece)
ut
is o
N80 X0 Y0 (G00 is modal - Move at rapid in the X and Y axis to hole #2)
Sa

N90 G01 Z-0.15 (Hole #2 - Feed down to Z depth at 11 inches per minute, Feed rate is modal)
N100 G00 Z0.1 (G00- Retract out of hole #2 at rapid to 0.1 above the top of the work piece)
ib
N110 X1.0 Y0.875 (G00 is modal - Move at rapid in the X and Y axis to hole #3)
N120 G01 Z-0.15 (Hole #3 - Feed down to Z depth at 11 inches per minute, Feed rate is modal)
N130 G53 G00 Z0 M05 (G53 Machine Zero positioning, non modal. Rapid to machine zero in Z, switch
spindle off)
N140 G53 X-15.0 Y0 (G53 Rapid in relation to machine zero X-15.0 and Y0)
N150 M30 (Program end rewind program to the beginning)
% (Program must begin and end with a %)

Page 16 TK-Mill Lesson 2 - 10


CNC PROGRAMMING
WORKBOOK
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-3
CREATING CNC PROGRAMS - CNC PART #1

Page 17
LESSON-3 - CNC - PART #1
PROGRAM TO SPOT AND DRILL THE THREE HOLES USING A COMBINATION OF
G00 AND G01 (CANNED CYCLE WILL BE USED LATER)
Below is the program to spot and drill the three holes with an explanation of each block
Use a 0.375 diameter Spot Drill Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
Use a 0.250 diameter Drill Tool # 7
0.250 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
Spot Drill Depth = Z-0.150
Drill Depth = Z-0.350
X0Y0 is at the centre of the part
Z=0 is the top of the part.

% (Program must begin and end with a %)


O2 ( Program #2 - CNC-PART-1-SPOT AND DRILLING )
D t f le
N10 G20 (Inch programming)
N20 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING)

n
(SPOT DRILL 0.25 HOLES)
p
N30 T06 M06 (T6-Select tool number 6 to be loaded M06-Activates the tool changer)

io
N40 G00 G90 G54 X-1.0 Y-0.875 S2750 M03 (Rapid to the X and Y position of Hole #1 and turn on the
spindle at 2750 RPM)
no m
tr r
N50 G43 H06 Z0.1 (G43 - Activate the tool offset value stored in H06 and rapid to Z0.1)

ut
N60 G01 Z-0.15 F11.0 (Hole #1 - Feed down to Z depth at 11 inches per minute)
is o
N70 G00 Z0.1 (G00- Retract out of hole #1 at rapid to 0.1 above the top of the work piece)
Sa

N80 X0 Y0 (G00 is modal - Move at rapid in the X and Y axis to Hole #2)
ib
N90 G01 Z-0.15 (Hole #2 - Feed down to Z depth at 11 inches per minute, Feed rate is modal)
N100 G00 Z0.1 (G00- Retract out of hole #2 at rapid to 0.1 above the top of the work piece)
N110 X1.0 Y0.875 (G00 is modal - Move at rapid in the X and Y axis to hole #3)
N120 G01 Z-0.15 (Hole #3 - Feed down to Z depth at 11 inches per minute, Feed rate is modal)
N130 G53 G00 Z0 M05 (G53 Machine Zero positioning, non modal. Rapid to machine zero in Z, switch
spindle off)
N140 G53 X-15.0 Y0 (G53 Rapid in relation to machine zero X-15.0 and Y0)
(DRILL 0.25 HOLES)
N160 T07 M06 (T7-Select tool number 7 to be loaded M06-Activates the tool changer)
N170 G00 G90 G54 X-1.0 Y-0.875 S4500 M03 (Rapid to the X and Y position of Hole #1 and turn on the
spindle at 4500 RPM)
N180 G43 H07 Z0.1 (G43 - Activate the tool offset value stored in H07 and rapid to Z0.1)
N190 G01 Z-0.35 F15.0 (Hole #1 - Feed down to Z depth at 15 inches per minute through part)
N200 G00 Z0.1 (G00- Retract out of hole #1 at rapid to 0.1 above the top of the work piece)

Page 18 TK-Mill Lesson 3 - 2


LESSON-3 - CNC - PART #1 - Continued

N210 X0 Y0 (G00 is modal - Move at rapid in the X and Y axis to hole #2)
N220 G01 Z-0.35 (Hole #2 - Feed down to Z depth, at 15 inches per minute, Feed rate is modal)
N230 G00 Z0.1 (G00- Retract out of hole #2 at rapid to 0.1 above the top of the work piece)
N240 X1.0 Y0.875 (G00 is modal - Move at rapid in the X and Y axis to hole #3)
N250 G01 Z-0.35 (Hole #3 - Feed down to Z depth at 15 inches per minute, Feed rate is modal)
N260 G53 G00 Z0 M05 (G53 Machine Zero positioning, non modal. Rapid to machine zero in Z, switch
spindle off)
N270 G53 X-15.0 Y0 (G53 Rapid in relation to machine zero X-15.0 and Y0)
D t f le
N270 M30 (Program end rewind program to the beginning)

n
% (Program must begin and end with a %)
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 3 - 3 Page 19


Page 20
Sa
no m
D t f le p
is o

TK-Mill Lesson 3 - 4
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-4
DRILLING USING CANNED CYCLES
LESSON-4 DRILL CANNED CYCLE G81

G80 CANCEL CANNED CYCLE


A canned cycle permits multiple function programming on one block.
A canned cycle is canceled with G80.

G81 CANNED CYCLE DRILL

Format: G99 G81 Z-0.625 R0.1 F10.


X Rapid X location (Optional)
Y Rapid Y location (Optional)
Z Z-depth (Feed to Z-depth starting from R Plane)
R R-Plane (Rapid point to start feeding)
F Feed rate in inches/min
D t f le

n
This G code permits the inclusion of multiple axis motions on one block of program. It is used to
reduce the length of program. The figure below shows the axis motions that are included with a
p

io
Canned Cycle Drill.
All Z axis motions are in ABSOLUTE with any other axis motions unaffected.
no m
tr r
In a canned cycle drill, the cutter moves at rapid to the X and Y, then to a height above the part at
ut
is o
rapid rate to the R Plane, which is a point above the work surface. From the R Plane the cutter feeds
Sa

to the Z-depth at the specified feedrate. When the cutter reaches the Z depth, it retracts at rapid
rate to the R Plane. G99 returns the tool to the R Plane after each hole, G98 returns the tool to the initial
ib
starting plane.

TK-Mill Lesson 4 - 2
DEEP HOLE PECK DRILL CANNED CYCLE G83

G83 DEEP HOLE PECK DRILL CANNED CYCLE


Format : G99 G83 Z-2.5 Q0.5 R0.1 F10. / G99 G83 Z-2.18 I0.5 J0.1 K0.2 R0.1 F9.
X* Rapid X-axis location
Y* Rapid Y-axis location
Z Z-depth (feed to Z-depth starting from R plane)
Q* Pecking equal incremental depth amount (if I, J and K are not used)
I* Size of first peck depth (if Q is not used)
J* Amount reducing each peck after first peck depth (if Q is not used)
K* Minimum peck depth (if Q is not used)
P Dwell time at Z-depth
R R-plane (rapid point to start feeding)
D t f le
F Feed rate in inches (mm) per minute
* Indicates optional

n
This G code is similar to G81 but is used for drilling when the tool must be withdrawn periodically
p

io
to allow chips to be removed from the hole.
no m

This cycle allows the tool to rapid to the R Plane, feeds towards the Z depth in increments
tr r
(traversing to the R Plane and back to the point where drilling was interrupted after each
ut
is o
increment) until the tool reaches the final Z depth.
Sa

ib

TK-Mill Lesson 4 - 3
LESSON-4 - CNC - PART #1
CREATE THE PROGRAM TO SPOT AND DRILL THE THREE HOLES USING CANNED
CYCLE G81
Use a 0.375 diameter Spot Drill Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
Use a 0.250 diameter Drill Tool # 7
0.250 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
Spot Drill Depth = Z-0.150
Drill Depth = Z-0.350
X0Y0 is at the centre of the part
Z=0 is the top of the part.

% (Program must begin and end with a %)


O3 ( Program #3 - CNC-PART-1-SPOT AND DRILLING USING CANNED CYCLE DRILL G81 )
N10 G20 (Inch programming)
D t f le
N20 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING)

n
N30 T06 M06 (T6-Select tool number 6 to be loaded M06-Activates the tool changer)
N40 G00 G90 G54 X-1.0 Y-0.875 S2750 M03 (Rapid to the X and Y position of Hole #1 and turn on the
spindle at 2750 RPM)
p

io
N50 G43 H06 Z0.1 (G43 - Activate the tool offset value stored in H06 and rapid to Z0.1)
N60 G99 G81 Z-0.15 R0.1 F11.0 (Hole #1 G81 - Feed down to Z depth at 11 inches per minute,
no m

and then retract at rapid to Z0.1, this is the R0.1 value.


tr r
G99 returns the drill tip to the R value after drilling each hole)
ut
N70 X0. Y0. (Hole #2 - Move at rapid in the X and Y axis to Hole #2. Feed down to Z depth at 11
is o
inches per minute and then retract at rapid to Z0.1)
Sa

N80 X1.0 Y.875 (Hole #3 - Move at rapid in the X and Y axis to Hole #3. Feed down to Z depth at 11
inches per minute and then retract at rapid to Z0.1)
ib
N90 G80 (Cancel Canned Cycle Drill)
N100 G53 G00 Z0 M05 (G53 Rapid to machine zero in Z, switch spindle off)
N110 G53 X-15.0 Y0 (G53 Rapid in relation to machine zero X-15.0 and Y0)
(DRILL 0.25 HOLES)
N120 T07 M06 (T7-Select tool number 7 to be loaded M06-Activates the tool changer)
N130 G00 G90 G54 X-1.0 Y-0.875 S4500 M03 (Rapid to the X and Y position of Hole #1 and turn on the
spindle at 4500 RPM)
N140 G43 H07 Z0.1 (G43 - Activate the tool offset value stored in H07 and rapid to Z0.1)

TK-Mill Lesson 4 - 4
LESSON-4 - CNC - PART #1 - Continued

N150 G99 G81 Z-0.35 R0.1 F15.0 (Hole #1 G81 - Feed down to Z depth at 15 inches per minute,
and then retract at rapid to Z0.1, this is the R0.1 value.
G99 returns the drill tip to the R value after drilling each hole)
N160 X0. Y0. (Hole #2 - Move at rapid in the X and Y axis to Hole #2. Feed down to Z depth at 15
inches per minute and then retract at rapid to Z0.1)
N170 X1.0 Y.875 (Hole #3 - Move at rapid in the X and Y axis to Hole #3. Feed down to Z depth at 15
inches per minute and then retract at rapid to Z0.1)
N180 G80 (Cancel Canned Cycle Drill)
N190 G53 G00 Z0 M05 (G53 Rapid to machine zero in Z, switch spindle off)
D t f le
N200 G53 X-15.0 Y0 (G53 Rapid in relation to machine zero X-15.0 and Y0)
N210 M30 (Program end rewind program to the beginning)

n
% (Program must begin and end with a %)
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 4 - 5
LESSON-4 WHAT COULD GO WRONG?
IDENTIFY SOME OF THE COMMON PROBLEMS THAT COULD RESULT IN A
SCRAPPED PART

Do you have X0 Y0 Z0 in the correct position?


Is the spindle switched on and off at the appropriate time
Did you use the correct X and Y coordinates for the holes?
Did you use the correct tool numbers?
Did you use the correct tool length offset number (H??) for the tool?
Did you cancel any canned cycles with G80?
Are the feed-rates correct?
Is the Z depth in the canned cycle block set to a negative value?
Is the R value in the canned cycle block set to a positive value?
What is the difference between Z2 and Z2.0? No decimal point???
What is the difference between F10 and F10.0? No decimal point???
What else?
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 4 - 6
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
LESSON-5
DRILLING USING CANNED CYCLES -
CONTINUED
NOTE: Teachers Solutions are in shaded cells throughout this book.
LESSON-5 - CNC - PART #2

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 5 - 2
LESSON-5 - CNC - PART #2
WORK OUT THE ABSOLUTE COORDINATES FOR THE NINE HOLES
X0Y0 is at the centre of the part

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
G90 X Y
1 0 0
2 0 1
3 -1 1
4 -1 0
5 -1 -1
6 0 -1
7 1 -1
8 1 0
9 1 1

TK-Mill Lesson 5 - 3
LESSON-5 - CNC - PART #2
CREATE THE PROGRAM TO SPOT AND DRILL THE NINE HOLES USING CANNED
CYCLE G81
Use a 0.375 diameter Spot Drill Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
Use a 0.250 diameter Drill Tool # 7
0.250 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
Spot Drill Depth = Z-0.150
Drill Depth = Z-0.350
X0Y0 is at the centre of the part
Z=0 is the top of the part.
Type up your program and check it for correctness using Discriminator

%
O4 ( Program #4 - CNC-PART-2-SPOT AND DRILLING USING CANNED CYCLE DRILL
G81 )
D t f le
N10 G20

n
N20 G00 G17 G40 G49 G80 G90
N30 T06 M06
p
N40 G00 G90 G54 X0 Y0 S2750 M03

io
N50 G43 H6 Z0.1
no m

N60 G99 G81 Z-0.15 R0.1 F11.0


tr r
N70 Y1.0
ut
is o
N80 X-1.0
N90 Y0
Sa

N100 Y-1.0
ib
N110 X0
N120 X1.0
N130 Y0
N140 Y1.0
N150 G80
N160 G53 G00 Z0 M05
N170 G53 X-15.0 Y0

TK-Mill Lesson 5 - 4
LESSON-5 - CNC - PART #2 - Continued

(DRILL 0.25 HOLES)


N180 T07 M06
N190 G00 G90 G54 X0 Y0 S4500 M03

N200 G43 H07 Z0.1


N210 G99 G81 Z-0.35 R0.1 F15.0
N220 Y1.0
N230 X-1.0
D t f le
N240 Y0
N250 Y-1.0

n
N260 X0
p
N270 X1.0

io
N280 Y0
N290 Y1.0
no m
tr r
N300 G80
ut
N310 G53 G00 Z0 M05
is o
N320 G53 X-15.0 Y0
Sa

N330 M30
%
ib

TK-Mill Lesson 5 - 5
LESSON-5 - CNC - PART #2 TYPING UP YOUR PROGRAM
USING WINDOWS NOTEPAD
Use Windows Notepad to type up your CNC program
1. Launch Windows Notepad Start>All Programs>Accessories>Notepad.

2. Select File Save As


D t f le

n
p

io
no m
tr r
3.
ut Browse to where you would like to save this file.
is o
4. Open up the Save as type drop down and change to All files.
5. Encoding should be set to ANSI.
Sa

6. In the File name section enter CNC-PART-2.NC This will give this file an extension of .NC
7. Click on the Save button
ib

8. Start typing your program, ALL CAPITALS for the CNC program codes. Please note on the second
line of this program O4 this is a letter O.

TK-Mill Lesson 5 - 6
LESSON-5 - CNC - PART #2 TYPING UP YOUR PROGRAM
USING WINDOWS NOTEPAD

9. When you have completed typing your program Save your file, File>Save or the shortcut Ctrl+S.

Now you can check for any Letter Os in your CNC program. Please Note there should not be
any letter Os in your CNC program, G00 is G Zero Zero not G Letter O!
D t f le
10. Select Edit>Find.

n
p

io
no m
tr r
ut
is o
Sa

ib
11. Type in the Letter O in the Find what: space. Now hit the Find Next button. There will be some
letter Os in your program, for example the Letter O in the program number at the start of the
program and any notes you have in your program enclosed by parenthesis ( ). But for the coding
no letter Os.

12. I f you do find any letter Os change them to a Zero.

TK-Mill Lesson 5 - 7
LESSON-5 - CNC - PART #2 TYPING UP YOUR PROGRAM
USING WINDOWS NOTEPAD
13. When you have checked your program select File>Save your file or the shortcut Ctrl+S.

14. You may require a print of your CNC program to do this select File>Print or the shortcut Ctrl+P.
15. Select which printer you wish to send the file to and then hit the Print button
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
16. To open your CNC program at a later date launch Windows Notepad.
Start>All Programs>Accessories>Notepad.
17. Select File>Open.

18. Change the Files of type: to All Files and browse for your CNC program.

TK-Mill Lesson 5 - 8
LESSON-5 - CNC - PART #2 - BACKPLOTTING
Use Discriminator Backplot Software to check for correctness
Note: If you do not have Discriminator installed on your computer please go to the last page of the
appendix for installation instructions.

1. After typing up your program in Notepad launch the Discriminator application by clicking on the
icon on your desktop or Start>All Programs>Discriminator> Discriminator

2. Click OK to any warnings you receive.


3. Click on File>Open and browse to your file location and select the CNC file to plot.
D t f le

n
p

io
4. After selecting the CNC file it opens up in a separate window.
no m
tr r
ut
is o
Sa

ib
5. Now click on the show graphics icon at the toolbar at the top of the screen to launch a plot
of your CNC file.

TK-Mill Lesson 5 - 9
6. When the plot screen opens up hit the Maximize button.

D t f le

n
p

io
7. On the top toolbar select the icon to View Fit.
no m
tr r
ut
is o
Sa

ib
8. You plot should appear as below. The point on the left of the screen shot below is the G53 X-15.0
Y0 movement in the program.

TK-Mill Lesson 5 - 10
9. Click the right mouse button on the main graphics plot screen and select Views>Front.

10. Return to a Top view by clicking the right mouse button on the main graphics plot screen and
select Views>Top.
11. Experiment with the various display functions at the top right of the screen.
D t f le

n
12. Review and experiment with the various toolbar options.
p

io
no m
tr r
13. You can use Discriminator instead of Windows Notepad to type up your CNC program. Select the
ut
New document icon to create a new file and type up your program in the new document window.
is o
Sa

ib

TK-Mill Lesson 5 - 11
LESSON-5 - CNC - PART #3
PART #3 IS SIMILAR TO PART #2 BUT HAS DIFFERENT DIMENSIONS FOR THE
HOLE CENTRES

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 5 - 12
LESSON-5 - CNC - PART #3
WORK OUT THE ABSOLUTE COORDINATES FOR THE NINE HOLES
X0Y0 is at the centre of the part

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
G90 X Y
1 0 0
2 0 1.000
3 -0.875 1.000
4 -0.875 0
5 -0.875 -1.000
6 0 -1.000
7 1.125 -1.000
8 1.125 0
9 1.125 1.000

TK-Mill Lesson 5 - 13
LESSON-5 - CNC - PART #3
CREATE THE PROGRAM TO SPOT AND DRILL THE NINE HOLES USING CANNED
CYCLE G81
Use a 0.375 diameter Spot Drill Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
Use a 0.250 diameter Drill Tool # 7
0.250 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
Spot Drill Depth = Z-0.150
Drill Depth = Z-0.350
X0Y0 is at the centre of the part
Z=0 is the top of the part.
Type up your program and check it for correctness using Backplot Software

%
O5(CNC-PART-3)
( T6 | 3/8 SPOTDRILL | H6 )
D t f le
( T7 | 1/4 DRILL | H7 )

n
N5 G20
N10 G0 G17 G40 G49 G80 G90
p
N15 T6 M6

io
N20 G0 G90 G54 X0 Y10 S2750 M3
no m

N25 G43 H6 Z2.


tr r
N30 Z.1
ut
is o
N35 G99 G81 Z-.15 R.1 F11.
N40 Y1.0
Sa

N45 X-0.875 Y1.0


ib
N50 Y0
N55 Y-1.0
N60 X0
N65 X1.125
N70 Y0
N75 Y1.0
N80 G80
N85 Z2.
N90 G53 G00 Z0 M05
N95 G53 X-15.0 Y0
N100 T7 M6
N105 G0 G90 G54 X0 Y0 S4500 M3
N110 G43 H7 Z2.
N115 Z.1
N120 G99 G81 Z-.35 R.1 F15.
TK-Mill Lesson 5 - 14
LESSON-5 - CNC - PART #3 - Continued

N125 Y1.0
N130 X-0.875 Y1.0
N135 Y0
N140 Y-1.0
N145 X0
N150 X1.125
N155 Y0
N160 Y1.0
D t f le
N165 G80
N170 Z2.

n
N175 G53 G00 Z0 M05
p
N180 G53 X-15.0 Y0

io
N185 M30
%
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 5 - 15
LESSON-5 - CNC - PART #3 - BACKPLOTTING
Use Discriminator to check for correctness
After typing up your program in Notepad launch the Discriminator application by clicking on the
icon on your desktop or Start>All Programs>Discriminator> Discriminator

Click OK to any warnings you receive.



D t f le Click on File>Open and browse to your file location and select the CNC file to plot.

n

p
After selecting the CNC file it opens up in a separate window.

io
no m
tr r
ut
is o
Sa

ib
Now click on the show graphics icon at the toolbar at the top of the screen to launch a plot
of your CNC file.
When the plot screen opens up hit the Maximize button and selects the icon to View Fit.
You plot should appear as below. The point on the left of the screen shot below is the G53 X-15.0
Y0 movement in the program.

TK-Mill Lesson 5 - 16
LESSON-5 - CNC - PART #4

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 5 - 17
LESSON-5 - CNC - PART #4
WORK OUT THE ABSOLUTE COORDINATES FOR THE ELEVEN HOLES
X0Y0 is at the centre of the part
Use Trigonometry to work out the center positions of the holes or draw the part up on a CAD
system and then identify the center positions of each hole.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
G90 X Y
1 0 0
2 1.000 0.000
3 0.809 0.5878
4 0.309 0.9511
5 -0.309 0.9511
6 -0.809 0.5878
7 -1.000 0.000
8 -0.809 -0.5878
9 -0.309 -0.9511
10 0.309 -0.9511
11 0.809 -0.5878

TK-Mill Lesson 5 - 18
LESSON-5 - CNC - PART #4
CREATE THE PROGRAM TO SPOT AND DRILL THE ELEVEN HOLES USING
CANNED CYCLE G81
Use a 0.375 diameter Spot Drill Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
Use a 0.250 diameter Drill Tool # 7
0.250 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
Spot Drill Depth = Z-0.150
Drill Depth = Z-0.350
X0Y0 is at the centre of the part
Z=0 is the top of the part.
Type up your program and check it for correctness using Backplot Software.

%
O99( CNC-TEXT-PART-4 )
( T6 | 3/8 SPOTDRILL | H6 )
D t f le
( T7 | 1/4 DRILL | H7 )

n
N5 G20
N10 G0 G17 G40 G49 G80 G90
p
N15 T6 M6

io
N20 G0 G90 G54 X0. Y0. A0. S2750 M3
no m

N25 G43 H6 Z.1


tr r
N30 G99 G81 Z-.15 R.1 F11.
ut
is o
N35 X1.
N40 X.809 Y.5878
Sa

N45 X.309 Y.9511


ib
N50 X-.309
N55 X-.809 Y.5878
N60 X-1. Y0.
N65 X-.809 Y-.5878
N70 X-.309 Y-.9511
N75 X.309

TK-Mill Lesson 5 - 19
LESSON-5 - CNC - PART #4 - Continued

N80 X.809 Y-.5878


N85 G80
N90 G53 G00 Z0 M05
N95 G53 X-15.0 Y0
N100 T7 M6
N105 G0 G90 G54 X0. Y0. A0. S4500 M3
N110 G43 H7 Z.1
D t f le
N115 G99 G81 Z-.35 R.1 F15.
N120 X1.

n
N125 X.809 Y.5878
N130 X.309 Y.9511
p

io
N135 X-.309
N140 X-.809 Y.5878
no m

N145 X-1. Y0.


tr r
N150 X-.809 Y-.5878
ut
is o
N155 X-.309 Y-.9511
Sa

N160 X.309
N165 X.809 Y-.5878
ib
N170 G80
N175 G53 G00 Z0 M05
N180 G53 X-15.0 Y0
N185 M30
%

TK-Mill Lesson 5 - 20
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-6
STRAIGHT LINE MILLING LINEAR
INTERPOLATION
NOTE: Teachers Solutions are in shaded cells throughout this book.
LESSON-6 STRAIGHT LINE MILLING
LESSON-6 EXERCISE #1 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p

io

no m

DIRECTION OF CUT CW
tr r
ut
is o
STARTING AT THE POINT O (ORIGIN), DESCRIBE THE ENDMILL PATH FROM O THROUGH ALL THE POINTS
Sa

AND BACK TO THE POINT O USING G90 & G91. CUTTER DIAMETER = 0.5 RADIUS = 0.25
ib
G90 X Y G91 X Y
O 0 0 O1 0.5 0.25
1 0.5 0.25 12 0 2.5
2 0.5 2.75 23 1.75 0
3 2.25 2.75 34 0 -1.0
4 2.25 1.75 45 0.5 0
5 2.75 1.75 56 0 -1.5
6 2.75 0.25 61 -2.25 0
1 0.5 0.25 1O -0.5 -0.25
O 0 0

TK-Mill Lesson 6 - 2
LESSON-6 - CNC - PART #5

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 6 - 3
LESSON-6 - CNC - PART #5
WORK OUT THE ABSOLUTE COORDINATES FOR POSITION 1, 2 AND 3
X0Y0 is at the lower left corner of the part
These X and Y coordinates will be used to machine the L shaped slot

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

G90 X Y
1 0.750 2.500
2 0.750 0.750
3 2.375 0.750

TK-Mill Lesson 6 - 4
LESSON-6 - CNC - PART #5
PROGRAM TO MACHINE THE L SHAPED SLOT
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
X0Y0 is at the lower left corner of the part
Z=0 is the top of the part.
The slot depth is 0.125
Enter the part at Position 1 and sink to depth using linear
interpolation G01
Then move to Position 2 and finally Position 3

% (Program must begin and end with a %)


O6 ( Program #6 Part #5 STRAIGHT LINE MILLING)
( T4 - 1/2 FLAT ENDMILL - H4 )
N10 G20 (Inch programming)
D t f le
N20 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING)

n
N30 T4 M6 (T4-Select tool number 4 to be loaded M06-Activates the tool changer)
N40 G00 G90 G54 X0.75 Y2.5 S3050 M3 (Rapid to the X and Y to Position #1 and turn on the spindle at
p
3050 RPM)

io
N50 G43 H04 Z0.1 (G43 - Activate the tool offset value stored in H04 and rapid to Z0.1)
N70 G1 Z-0.125 F10. (Position #1 - Feed down to Z depth at 10 inches per minute)
no m
tr r
N80 Y0.75 F20.0 (Move to Position #2 - at 20 inches per minute)
ut
is o
N90 X2.375 (Move to Position #3 - at 20 inches per minute)
N100 Z0.1 F10.0 (Retract out of the part at feedrate to 0.1 above the top of the work piece)
Sa

N120 M05 (Spindle off)


ib
N130 G00 G91 G28 Z0 (G28 Machine Zero positioning. Rapid to machine zero in Z)
N140 G28 X0 Y0 (G28 Rapid in relation to machine zero X0 and Y0)
N150 G90 (RETURN TO ABSOLUTE PROGRAMMING)
N160 M30 (Program end rewind program to the beginning)
% (Program must begin and end with a %)

In earlier programs we used G53 to return the machine to coordinates in relation to the Machine Zero
(home position). G28 is another code that will accomplish this. G28 is a more common way to send the
machine to machine zero, it will work on many different types of CNC machines.

As you can see above at block N130, G28 is activated in G91 incremental mode, and then at block N150 the
program is returned to G90 absolute mode.

TK-Mill Lesson 6 - 5
LESSON-6 - CNC - PART #6

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 6 - 6
LESSON-6 - CNC - PART #6
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE CONTOUR
X0Y0 is at the lower left corner of the part
Use a 0.5 diameter End Mill Tool # 4
Start at X-0.5 Y3.125 and machine the contour in a clockwise direction climb milling

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
G90 X Y
1 -0.5 3.125
2 1.375 3.125
3 1.375 1.750
4 1.500 1.750
5 1.500 3.125
6 2.875 3.125
7 2.875 1.750
8 3.125 1.750
9 3.125 0
10 0.125 0
11 0.125 3.375

TK-Mill Lesson 6 - 7
LESSON-6 - CNC - PART #6
PROGRAM TO MACHINE THE CONTOUR
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
X0Y0 is at the lower left corner of the part
Z=0 is the top of the part.
Machine the contour at a depth is 0.125

% (Program must begin and end with a %)


O8 ( Program #8 - CNC-PART-6 - STRAIGHT LINE MILLING)
( T4 - 1/2 FLAT ENDMILL - H4 )
N10 G20 (Inch programming)
N20 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING)
N30 T4 M6 (T4-Select tool number 4 to be loaded M06-Activates the tool changer)
D t f le
N40 G00 G90 G54 X-0.5 Y3. 125 S3050 M3 (Rapid to the X and Y to start Position #1 and turn on the

n
spindle at 3050 RPM)
N50 G43 H04 Z0.1 (G43 - Activate the tool offset value stored in H04 and rapid to Z0.1)
p

io
N60 G1 Z-0.125 F10. (Position #1 - Feed down to Z depth at 10 inches per minute)
N70 X1.375 F20.0 (Move to Position #2 - at 20 inches per minute)
no m
tr r
N80 Y1.75 (Move to Position #3)

ut
N90 X1.5 (Move to Position #4)
is o
N100 Y3.125 (Move to Position #5)
Sa

N110 X2.875 (Move to Position #6)


ib
N120 Y1.75 (Move to Position #7)
N130 X3.125 (Move to Position #8)
N140 Y0 (Move to Position #9)
N150 X0.125 (Move to Position #10)
N160 Y3.375 (Move to Position #11)
N170 Z0.1 F10.0 (Retract out of the part at feedrate to 0.1 above the top of the work piece)
N180 M05 (Spindle off)
N190 G00 G91 G28 Z0 (G28 Machine Zero positioning. Rapid to machine zero in Z)
N200 G28 X0 Y0 (G28 Rapid in relation to machine zero X0 and Y0)
N210 G90 (RETURN TO ABSOLUTE PROGRAMMING)
N220 M30 (Program end rewind program to the beginning)
% (Program must begin and end with a %)

TK-Mill Lesson 6 - 8
LESSON-6 - CNC - PART #7

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 6 - 9
LESSON-6 - CNC - PART #7
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE CONTOUR
X0Y0 is at the lower left corner of the part
Use a 0.5 diameter End Mill Tool # 4
Start at X-0.5 Y3.0 and machine the contour in a clockwise direction climb milling

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
G90 X Y
1 -0.5 3.0
2 1.250 3.0
3 1.250 2.0
4 1.375 2.0
5 1.375 3.0
6 2.875 3.0
7 2.875 1.250
8 3.125 1.250
9 3.125 0
10 0 0
11 0 3.375

TK-Mill Lesson 6 - 10
LESSON-6 - CNC - PART #7
CREATE THE PROGRAM TO MACHINE THE CONTOUR
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
X0Y0 is at the lower left corner of the part
Z=0 is the top of the part.
Machine the contour at a depth is 0.125
Start at X-0.5 Y3.0 and machine the contour in a clockwise
direction climb milling
Type up your program and check it for correctness using
Backplot software.

%
O9( CNC-PART-7 )
( T4 | 1/2 FLAT ENDMILL | H4 )
N5 G20
D t f le
N10 G0 G17 G40 G49 G80 G90

n
N15 T4 M6
N20 G0 G90 G54 X-.5 Y3. A0. S3050 M3
p

io
N25 G43 H4 Z.1
N30 G1 Z-.125 F20.
no m

N35 X0.
tr r
N40 X1.25
ut
is o
N45 Y2.
Sa

N50 X1.375
N55 Y3.
ib
N60 X2.875
N65 Y1.25
N70 X3.125
N75 Y0.
N80 X0.
N85 Y3.
N90 Y3.25
N95 G0 Z.1
N100 M5
N105 G91 G28 Z0.
N110 G28 X0. Y0. A0.
N115 M30
%

TK-Mill Lesson 6 - 11
LESSON-6 - CNC - PART #8

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 6 - 12
LESSON-6 - CNC - PART #8
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE CONTOUR
X0Y0 is at the lower left corner of the part
Use a 0.5 diameter End Mill Tool # 4
Start at X0 Y-0.375 and machine the contour in a clockwise direction climb milling

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
G90 X Y
1 0 -0.375
2 0 2.875
3 0.5 2.875
4 0.5 3.150
5 3.000 3.150
6 3.000 1.250
7 1.500 1.250
8 1.500 1.125
9 3.000 1.125
10 3.000 0.125
11 -0.375 0.125

TK-Mill Lesson 6 - 13
LESSON-6 - CNC - PART #8
CREATE THE PROGRAM TO MACHINE THE CONTOUR
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
X0Y0 is at the lower left corner of the part
Z=0 is the top of the part.
Machine the contour at a depth is 0.125
Start at X-0.5 Y3.0 and machine the contour in a clockwise direction
climb milling
Type up your program and check it for correctness using Backplot software.

%
O101( CNC-PART-8 )
( T4 | 1/2 FLAT ENDMILL | H4 )
N5 G20
N10 G0 G17 G40 G49 G80 G90
D t f le
N15 T4 M6

n
N20 G0 G90 G54 X-.5 Y3.15 A0. S3050 M3
N25 G43 H4 Z.1
p

io
N30 G1 Z-.125 F20.
N35 X.5
no m
tr r
N40 X3.
ut
N45 Y1.25
is o
N50 X1.5
Sa

N55 Y1.125
N60 X3.
ib
N65 Y.125
N70 X0.
N75 Y2.875
N80 X.5
N85 Y3.275
N90 G0 Z.1
N95 M5
N100 G91 G28 Z0.
N105 G28 X0. Y0. A0.
N110 M30
%

TK-Mill Lesson 6 - 14
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-7
CIRCULAR INTERPOLATION
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 61
LESSON-7 - CIRCULAR INTERPOLATION - G02 & G03
In the next series of circular interpolation exercises you will explore how to
machine arcs and complete circles.
G02 and G03 allow the machining of circles and arcs

When the machine is required to move in a straight line under a controlled federate, linear interpolation is
used G01. When it is necessary to machine in a circular motion in any plane (XY, YZ, XZ) circular interpolation
is used G02 and G03.

All circular interpolation moves are defined using three pieces of information.

1. DIRECTION OF TRAVEL: CLOCKWISE G02, COUNTER CLOCKWISE G03

2. PROGRAMMED END POINT OF THE ARC


D t f le
3. ARC CENTER: INCREMENTAL DISTANCE FROM START POINT TO ARC CENTER (I, J, K OR R
FOR RADIUS, I,J AND K ARE NOT USED)

n
When trying to figure out a circular interpolation move answer these three
p
questions:

io
I. What is the direction of travel, clockwise or counterclockwise G02 or G03?
II. Where is the programmed end point?
no m
tr r
III. What is the incremental distance from the start of the arc to the center of the arc being machined
I and J values?
ut
is o
Sa

ib

G02 X4.25 Y3. I 0. J-1.25


XY PLANE
G03 X2.25 Y1. I 0. J-.75

G02 & G03 Circular Interpolation Format

Page 62 TK-Mill Lesson 7 - 2


CIRCULAR INTERPOLATION - DIRECTION OF TRAVEL

G02 -Clockwise or G03 Counter Clockwise?

D t f le

n
p

io
no m
tr r
ut
What are the circular interpolation movements G02 or G03?
is o
1. A to B Circular Interpolation (CW) G02
Sa

2. A to C Circular Interpolation (CW) G02


ib
3. D to C Circular Interpolation (CCW) ? Solution - G03

4. D to B Circular Interpolation (CCW) ? Solution - G03

5. A to A Circular Interpolation (CW) ? Solution - G02

TK-Mill Lesson 7 - 3 Page 63


CIRCULAR INTERPOLATION - PROGRAMED END POINT

1.0 Diameter End Mill

Radius = 0.5

D t f le

n
p

io
no m
tr r
ut
is o
Sa

1. What are the coordinates at the center of the cutter for A, B, C, and D
ib
A: X 0 Y 3.0 B: X 3.0 Y 0

D: X -3.0 Y 0
C: X 0 Y-3.0

Page 64 TK-Mill Lesson 7 - 4


CIRCULAR INTERPOLATION - ARC CENTER
I , J and K Values are measured from the tool start to the center of the arc
I , J and K values are INCREMENTAL
I= X Axis J = Y Axis K= Z Axis

1.0 Diameter End Mill

Radius = 0.5

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
1. What are the incremental distances from the start of cut to the center of the programmed
arc?
I = The Incremental distance along the X axis from the start of the arc to the center of the
programmed arc
J = The Incremental distance along the Y axis from the start of the arc to the center of the
programmed arc

A to the centre of the circle: I 0 J-3.0 B to the centre of the circle: I -3.0 J 0

C to the centre of the circle: I 0 J3.0 D to the centre of the circle: I 3.0 J 0

TK-Mill Lesson 7 - 5 Page 65


LESSON-7 - CIRCULAR INTERPOLATION - G02 & G03
What does the block of code look like moving from D to B clockwise?
G02 X3.0 Y0 I3.0 J0
What does the block of code look like moving from A to D counterclockwise?
G03 X-3.0 Y0 I-3.0 J0

1.0 Diameter End Mill

Radius = 0.5
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
When trying to figure out a circular interpolation move answer these three
questions:
I. What is the direction of travel, clockwise or counterclockwise G02 or G03?
II. Where is the programmed end point?
III. What is the incremental distance from the start of the arc to the center of the arc being machined
I and J values?
Work out the following circular interpolation blocks
C to D Clockwise: G02 X-3.0 Y0 I0 J3.0 D to C Counterclockwise: G03 X0 Y-3.0 I-3.0 J0

A to A Clockwise: G02 X-3.0 Y0 I0 J-3.0 B to C Counterclockwise: G03 X0 Y-3.0 I-3.0 J0

Page 66 TK-Mill Lesson 7 - 6


LESSON-7 - CIRCULAR INTERPOLATION - G02 & G03
The center of the circle has now been changed to X5.0 Y5.0
What does the block of code look like moving from D to B clockwise?
G02 X8.0 Y5.0 I3.0 J0
What does the block of code look like moving from A to D counterclockwise?
G03 X2.0 Y5.0 I-3.0 J0
1.0 Diameter End Mill

Radius = 0.5
D t f le

n
p

io
X5.0 Y5.0
no m
tr r
ut
is o
Sa

ib
When trying to figure out a circular interpolation move answer these three
questions:
I. What is the direction of travel, clockwise or counterclockwise G02 or G03?
II. Where is the programmed end point?
III. What is the incremental distance from the start of the arc to the center of the arc being machined
I and J values?
Work out the following circular interpolation blocks
C to D Clockwise: G02 X2.0 Y5.0 I0 J3.0 D to C Counterclockwise: G02 X5.0 Y2.0 I3 J0

A to A Clockwise: G02 X-3.0 Y0 I0 J-3.0 B to C Counterclockwise: G03 X5.0 Y2.0 I-3.0 J0

To cut a complete circle of 360, you do not need to specify an end point X, Y, or Z. Just program I, J, or K to
define the centre of the circle.

TK-Mill Lesson 7 - 7 Page 67


LESSON-7 - CIRCULAR INTERPOLATION - G02 & G03
Work out the following circular interpolation blocks

PROGRAM CIRCULAR INTERPOLATION USING ABSOLUTE AND INCREMENTAL IN DIRECTION SHOWN

Y+ ABSOLUTE

X- X+ START POINT X -4.0 Y -2.0


(0, 0) END POINT X 0.0 Y -2.0
.
G02 X0.0 Y-2.0 I 2.0 J 0.0
R=2
INCREMENTAL

START POINT X -4.0 Y -2.0


START FINISH
END POINT X 4.0 Y 0.0
D t f le
Y-
.
G02 X 4.0 Y 0.0 I 2.0 J 0.0

n
.
Y+
ABSOLUTE (COUNTER CLOCKWISE DIRECTION)
p

io
X- START/ FINISH (-10, -5) X+
START POINT X -10.0 Y -5.0
END POINT X -10.0 Y -5.0
no m

ABSOLUTE INCREMENTAL .
tr r
G 03 X -10.0 Y -5.0 I0 J -10.0
ut .
is o
D=10
INCREMENTAL (CLOCKWISE DIRECTION)
Sa

START POINT X -10.0 Y -5.0


ib
END POINT X0 Y0
.
Y-
G 02 X0 Y0 I0 J -10.0
.
Y+
ABSOLUTE
FINISH
X- (5, 2) X+ START POINT X 5.0 Y 0.586
END POINT X 3.586 Y 2.0
.
G 03 X 3.586 Y 2.0 I -1.414 J0
.
R=1.414 INCREMENTAL

START POINT X 5.0 Y 0.586


START
END POINT X -1.414 Y 1.414
Y-
.
G 03 X -1.414 Y 1.414 I -1.414 J0
.

Page 68 TK-Mill Lesson 7 - 8


LESSON-7 CIRCULAR INTERPOLATION G02
Review the CNC program below that machines the contour.

The cutter being used is a 0.5 diameter end mill.


X0 Y0 is the lower left corner of the part.
Start position lower left corner, machines clockwise.
The blocks of CNC code are made up of G01 and a G02 moves.
Note that the G02 move to machine the 0.5 and 0.25 radius can use either I and J values or R for
the radius.

All circular interpolation moves are defined using three pieces of information.

1. DIRECTION OF TRAVEL: CLOCKWISE G02, COUNTER CLOCKWISE G03

2. ARC END POINT

3. ARC CENTER: INCREMENTAL DISTANCE FROM START POINT TO ARC CENTER (I, J, K)
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

N160 G1 X-.25 Y-.25 (start position) I = The Incremental distance along the X axis
N170 Y1.5 from the start of the arc to the center of the
N180 G2 X.5 Y2.25 I.75 J0. (OR R0.5) programmed arc
N190 G1 X2.75
N200 Y.25 J = The Incremental distance along the Y axis
N210 G2 X2.25 Y-.25 I-.5 J0. (OR R0.25) from the start of the arc to the center of the
N220 G1 X-.25 programmed arc

TK-Mill Lesson 7 - 9 Page 69


LESSON-7 CIRCULAR INTERPOLATION G02
Review the CNC program below that machines the contour.

The cutter being used is a 0.5 diameter end mill.


X0 Y0 is the center of the part.
Start position is the upper right, machines clockwise.
The blocks of CNC code are made up of G01 and a G02 moves.
Note that the G02 move to machine the radii can use either I and J values or R for the radius.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
Using I and J Values Using R for Radius Values

N160 G1 X1.5 Y1.0 (start position) N160 G1 X1.5 Y1.0 (start position)
N170 Y-.25 N170 Y-.25
N180 G2 X.25 Y-1.5 I-1.25 J0. N180 G2 X.25 Y-1.5 R1.25
N190 G1 X-.75 N190 G1 X-.75
N200 G2 X-1.5 Y-.75 I0. J.75 N200 G2 X-1.5 Y-.75 R.75
N210 G1 Y.875 N210 G1 Y.875
N220 G2 X-.875 Y1.5 I.625 J0. N220 G2 X-.875 Y1.5 R.625
N230 G1 X1. N230 G1 X1.
N240 G2 X1.5 Y1. I0. J-.5 N240 G2 X1.5 Y1. R.5
To cut a complete circle of 360, you do not need to specify an end point X, Y, or Z. Just program I, J, or K to
define the centre of the circle.

Page 70 TK-Mill Lesson 7 - 10


LESSON-7 CIRCULAR INTERPOLATION G03
Review the CNC program below that machines the contour around the inside of the pocket.

The cutter being used is a 0.5 diameter end mill.


X0 Y0 is the center of the part.
Start position is the upper right, machines contour counter clockwise.
The blocks of CNC code are made up of G01 and a G03 moves.
Note that the G03 move to machine the radii can use either I and J values or R for the radius.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
Using I and J Values Using R for Radius Values

N40 G0 G90 G54 X.75 Y1. A0. S2500 M3 N40 G0 G90 G54 X.75 Y1. A0. S2500 M3
N50 G43 H4 Z.35 N50 G43 H4 Z.35
N60 G1 Z.125 F15. N60 G1 Z.125 F15.
N70 X-.875 N70 X-.875
N80 G3 X-1. Y.875 I0. J-.125 (0.375 Radius) N80 G3 X-1. Y.875 R.125 (0.375 Radius)
N90 G1 Y-.75 N90 G1 Y-.75
N100 G3 X-.75 Y-1. I.25 J0. (0.5 Radius) N100 G3 X-.75 Y-1. R.25 (0.5 Radius)
N110 G1 X.25 N110 G1 X.25
N120 G3 X1. Y-.25 I0. J.75 (1.0 Radius) N120 G3 X1. Y-.25 R.75 (1.0 Radius)
N130 G1 Y.75 N130 G1 Y.75
N140 G3 X.75 Y1. I-.25 J0. (0.5 Radius) N140 G3 X.75 Y1. R.25 (0.5 Radius)
N150 G0 Z.35 N150 G0 Z.35

TK-Mill Lesson 7 - 11 Page 71


LESSON-7 CIRCULAR INTERPOLATION G02 & G03
Review the program to machine the contour shown below.

Material: Aluminum 6061


Surface Feet Minute= 400
ft/min

D t f le

n
p

io
Tool #4 (.500 Flat End Mill) Mill the profile
Spindle Speed RPM =
Feed Per Tooth (FPT) = 0.003 2 Flute Cutter
3.82xSFM/D= 3.82x400/0.5 =3056
no m

Feed Per Minute = FPT x 2 Flutes x RPM = 18.336


tr r
ut
Depth of Cut = Z-0.200 Start from the top left corner
is o
Sa

%
O11 ( G02-G03-EXAMPLE ) N60 X4.25
ib
N10 G20 N65 Y0.
N15 G0 G17 G40 G49 G80 G90 N70 G2 X3. Y-1.25 I-1.25 J0.
N20 T4 M6 N75 G1 X-.25
N25 G0 G90 G54 X-.25 Y.25 S3056 M3 N80 Y.25
N30 G43 H4 Z2. N85 G0 Z2.
N35 Z.1 N90 M5
N40 G1 Z-.2 F18. N95 G91 G28 Z0.
N45 X2.5 N100 G28 X0. Y0.
N50 G3 X2.75 Y.5 I0. J.25 N105 M30
N55 G1 Y1.75 %

Page 72 TK-Mill Lesson 7 - 12


LESSON-7 CIRCULAR INTERPOLATION G02 & G03
Create the program to machine the contour shown below.

D t f le

n
Material: Aluminum 6061
p
CS= 400 ft/min

io
no m

Tool #4 (.500 Flat End Mill) Mill the profile


tr r
Spindle Speed RPM =
ut Feed Per Tooth (FPT) = 0.003 2 Flute Cutter
is o
3.82xSFM/D= 3.82x400/0.5 =3056
Feed Per Minute = FPT x 2 Flutes x RPM = 18.336
Sa

Depth of Cut = Z-0.150 Start from the top right hand corner
ib

TK-Mill Lesson 7 - 13 Page 73


LESSON-7 CIRCULAR INTERPOLATION G02 & G03

%
N100 G20
N110 G0 G17 G40 G49 G80 G90
N120 T4 M6
N130 G0 G90 G54 X.25 Y.25 A0. S3056 M3
N140 G43 H239 Z.25
N150 Z.2
N160 G1 Z0. F6.4
N170 X0. F18.
N180 X-2.5
N190 G3 X-3.25 Y-.5 I0. J-.75
N200 G1 Y-2.75
D t f le
N210 G3 X-2.75 Y-3.25 I.5 J0.

n
N220 G1 X-1.
N230 G3 X.25 Y-2. I0. J1.25
p
N240 G1 Y0.

io
N250 G3 X0. Y.25 I-.25 J0.
no m

N260 G1 Z.2 F6.4


tr r
N270 G0 Z.25
ut
is o
N280 M5
N290 G91 G28 Z0.
Sa

N300 G28 X0. Y0. A0.


ib
N310 M30
%

Page 74 TK-Mill Lesson 7 - 14


CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

MILL-LESSON-8
CIRCULAR INTERPOLATION - CONTINUED
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 75
LESSON-8 - CNC - PART #9

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 76 TK-Mill Lesson 8 - 2


LESSON-8 - CNC - PART #9
The Machining Process
.500 Endmill - Tool # 4 - 3056 RPM Feedrate 18 IPM
Machine the 2.25 square with the 0.375 corner radii - 0.0625 depth
Machine the circular 2.25 and 1.25diameter circular profile - 0.125 depth
.125 Endmill - Tool # 1- 5000 RPM Feedrate 7 IPM
Drill the .125 holes through the part (4 places)
Note: The .125 Endmill is designed for center cutting machining. No center drilling or pilot hole is
required.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 8 - 3 Page 77


LESSON-8 - CNC - PART #9
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1
Climb mill the inside contours

D t f le

n
p

io
no m
tr r
ut
is o
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE FOUR HOLES
Sa

ib
G90 X Y
1 0 0.875
2 -0.875 0
3 0 -0.875
4 0.875 0

Page 78 TK-Mill Lesson 8 - 4


LESSON-8 - CNC - PART #9
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1
Climb mill

D t f le

n
p

io
no m
tr r
ut
is o
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
Sa

POSITIONS OF THE 0.5 DIAMETER END MILL


ib
G90 X Y
1 0 0.875
2 -0.750 0.875
3 -0.875 0.750
4 -0.875 -0.750
5 -0.750 -0.875
6 0.750 -0.875
7 0.875 -0.750
8 0.875 0.750
9 0.750 0.875
10 0 0.875
11 0 0.875

TK-Mill Lesson 8 - 5 Page 79


LESSON-8 - CNC - PART #9
CREATE THE PROGRAM TO MACHINE THE PART
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
Use a 0.125 diameter End Mill Tool # 1
Speed = 5000 Feed rate =7 IPM
X0Y0 is at the center of the part
Z=0 is the top of the part.
Climb mill
Type up your program and check it for correctness using Backplot software.

%
O4( CNC-PART-9 )
( T4 | 1/2 FLAT ENDMILL | H4 )
( T1 | 1/8 FLAT ENDMILL | H1 )
N5 G20
D t f le
N10 G0 G17 G40 G49 G80 G90

n
N15 T4 M6
N20 G0 G90 G54 X0. Y.875 S3050 M3
p

io
N25 G43 H4 Z.1
N30 G1 Z-.0625 F10.
no m

N35 X-.75 F20.


tr r
N40 G3 X-.875 Y.75 I0. J-.125
ut
is o
N45 G1 Y-.75
Sa

N50 G3 X-.75 Y-.875 I.125 J0.


N55 G1 X.75
ib
N60 G3 X.875 Y-.75 I0. J.125
N65 G1 Y.75
N70 G3 X.75 Y.875 I-.125 J0.
N75 G1 X0.
N80 Z.1 F10.
N85 Z-.125

Page 80 TK-Mill Lesson 8 - 6


LESSON-8 - CNC - PART #9 - Continued

N90 G3 X-.875 Y0. I0. J-.875 F20.


N95 X0. Y-.875 I.875 J0.
N100 X.875 Y0. I0. J.875
N105 X0. Y.875 I-.875 J0.
N110 G1 Z.1 F10.
N115 M5
N120 G91 G0 G28 Z0.
N125 T1 M6
D t f le
N130 G0 G90 G54 X0. Y.875 S5000 M3

n
N135 G43 H1 Z2.
N140 Z.1
p
N145 G99 G81 Z-.28 R.1 F7.

io
N150 X-.875 Y0.
N155 X0. Y-.875
no m
tr r
N160 X.875 Y0.
ut
N165 G80
is o
N170 Z2.
Sa

N175 M5
N180 G91 G28 Z0.
ib
N185 G28 X0. Y0.
N190 M30
%

TK-Mill Lesson 8 - 7 Page 81


LESSON-8 - CNC - PART #10

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 82 TK-Mill Lesson 8 - 8


LESSON-8 - CNC - PART #10
The Machining Process
.500 Endmill - Tool # 4 - 3056 RPM Feedrate 18 IPM
Machine the open slot with the 0.375 fillet radii - 0.125 depth
.125 Endmill - Tool # 1 - 5000 RPM Feedrate 7 IPM
Drill the .125 holes through the part (4 places)
Note: The .125 Endmill is designed for center cutting machining. No center drilling or pilot hole is
required.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 8 - 9 Page 83


LESSON-8 - CNC - PART #10
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1

D t f le

n
p

io
no m
tr r
ut
is o
Sa

WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE FOUR HOLES
ib
G90 X Y
1 0.7071 0.7071
2 -0.7071 0.7071
3 -0.7071 -0.7071
4 0.7071 -0.7071

Page 84 TK-Mill Lesson 8 - 10


LESSON-8 - CNC - PART #10
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1
Climb mill

D t f le

n
p

io
no m
tr r
ut
is o
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
Sa

POSITIONS OF THE 0.5 DIAMETER END MILL


G90 X Y
ib
1 -1.875 0.875
2 0.750 0.875
3 0.875 0.750
4 0.875 -0.750
5 0.750 -0.875
6 -1.875 -0.875
7 -1.875 -0.750
8 0 -0.750
9 0 0.875
10 -1.875 0.750

TK-Mill Lesson 8 - 11 Page 85


LESSON-8 - CNC - PART #10
CREATE THE PROGRAM TO MACHINE THE PART
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
Use a 0.125 diameter End Mill Tool # 1
Speed = 5000 Feed rate =7 IPM
X0Y0 is at the center of the part
Z=0 is the top of the part.
Climb mill
Type up your program and check it for correctness using Backplot software.

%
O303( CNC-PART-10 )
( T4 | 1/2 FLAT ENDMILL | H4 )
( T1 | 1/8 FLAT ENDMILL | H1 )
N5 G20
D t f le
N10 G0 G17 G40 G49 G80 G90

n
N15 T4 M6
N20 G0 G90 G54 X-1.875 Y.875 S3050 M3
p

io
N25 G43 H4 Z.1
N30 G1 Z-.125 F20.
no m

N35 X-1.5
tr r
N40 X.75
ut
is o
N45 G2 X.875 Y.75 I0. J-.125
Sa

N50 G1 Y-.75
N55 G2 X.75 Y-.875 I-.125 J0.
ib
N60 G1 X-1.875
N65 Y-.75
N70 X0.
N75 G3 X.75 Y0. I0. J.75
N80 G3 X0. Y.75 I-.75 J0.
N85 G1 X-1.5
N90 X-1.875
N95 G0 Z.1
N100 M5

Page 86 TK-Mill Lesson 8 - 12


LESSON-8 - CNC - PART #10

N105 G91 G28 Z0.


N110 T1 M6
N115 G0 G90 G54 X.7071 Y.7071 A0. S5000 M3
N120 G43 H1 Z.1
N125 G99 G81 Z-.28 R.1 F7.
N130 X-.7071
N135 Y-.7071
N140 X.7071
D t f le
N145 G80
N150 M5

n
N155 G91 G28 Z0.
p
N160 G28 X0. Y0.

io
N165 M30
%
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 8 - 13 Page 87


Page 88
Sa
no m
D t f le p
is o

TK-Mill Lesson 8 - 14
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-9
CIRCULAR INTERPOLATION - CONTINUED
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 89
LESSON-9 - CNC - PART #11

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 90 TK-Mill Lesson 9 - 2


LESSON-9 - CNC - PART #11
The Machining Process
.500 Endmill - Tool # 4
Machine the profile with the .125 radii at Z.125 deep 1 Cut
Machine the circular 2.5 diameter circular profile 1 Cut
.125 Endmill - Tool # 1
Drill the .125 holes through the part (4 places)
Note: The .125 Endmill is designed for center cutting machining. No center drilling or pilot hole is
required.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 9 - 3 Page 91


LESSON-9 - CNC - PART #11
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1

D t f le

n
p

io
no m
tr r
ut
is o
Sa

WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE FOUR HOLES
ib
G90 X Y
1 -1.125 1.125
2 1.125 1.125
3 1.125 -1.125
4 -1.125 -1.125

Page 92 TK-Mill Lesson 9 - 4


LESSON-9 - CNC - PART #11
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1
Climb mill

D t f le

n
p

io
no m
tr r
ut
is o
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS OF THE 0.5 DIAMETER END MILL
Sa

G90 X Y
ib
1 0 0.875
2 -0.750 0.875
3 -0.875 0.750
4 -0.875 -0.750
5 -0.750 -0.875
6 0.750 -0.875
7 0.875 -0.750
8 0.875 0.750
9 0.750 0.875
10 0 0.875

TK-Mill Lesson 9 - 5 Page 93


LESSON-9 - CNC - PART #11
CREATE THE PROGRAM TO MACHINE THE PART
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
Use a 0.125 diameter End Mill Tool # 1
Speed = 5000 Feed rate =7 IPM
X0Y0 is at the center of the part
Z=0 is the top of the part.
Climb mill
Type up your program and check it for correctness using Backplot software.

%
O6( CNC-PART-11 )
( T4 | 1/2 FLAT ENDMILL | H4 )
( T1 | 1/8 FLAT ENDMILL | H1 )
N5 G20
D t f le
N10 G0 G17 G40 G49 G80 G90

n
N15 T4 M6
N20 G0 G90 G54 X-1.875 Y1.5 S3050 M3
p

io
N25 G43 H4 Z.1
N30 G1 Z-.125 F20.
no m

N35 X-1.125
tr r
N40 X0.
ut
is o
N45 X1.125
Sa

N50 G2 X1.5 Y1.125 I0. J-.375


N55 G1 Y0.
ib
N60 Y-1.125
N65 G2 X1.125 Y-1.5 I-.375 J0.
N70 G1 X0.
N75 X-1.125
N80 G2 X-1.5 Y-1.125 I0. J.375
N85 G1 Y0.
N90 Y1.125
N95 G2 X-1.125 Y1.5 I.375 J0.
N100 G1 Z.1
N105 G0 X0.

Page 94 TK-Mill Lesson 9 - 6


LESSON-9 - CNC - PART #11 - Continued

N110 G1 Z-.0625
N115 G2 X1.5 Y0. I0. J-1.5
N120 X0. Y-1.5 I-1.5 J0.
N125 X-1.5 Y0. I0. J1.5
N130 X0. Y1.5 I1.5 J0.
N135 G1 Z.1
N140 M5
N145 G91 G0 G28 Z0.
D t f le
N150 T1 M6
N155 G0 G90 G54 X-1.125 Y1.125 S5000 M3

n
N160 G43 H1 Z.1
p
N165 G99 G81 Z-.28 R.1 F7.

io
N170 X1.125
N175 Y-1.125
no m
tr r
N180 X-1.125
ut
N185 G80
is o
N190 M5
Sa

N195 G91 G28 Z0.


N200 G28 X0. Y0.
ib
N205 M30
%

TK-Mill Lesson 9 - 7 Page 95


LESSON-9 - CNC - PART #12

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 96 TK-Mill Lesson 9 - 8


LESSON-9 - CNC - PART #12
The Machining Process
.500 Endmill - Tool # 4- 3050 RPM Feedrate 20 IPM
Machine the profiles with the .125 and .25 radii.
Machine the circular 0.625 diameter through hole. Sink to depth at center and use circular
interpolation to finish the bore.
.125 Endmill - Tool # 1- 5000 RPM Feedrate 7 IPM
Drill the .125 holes through the part (8 places)
Note: The .125 Endmill is designed for center cutting machining. No center drilling or pilot hole is
required.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 9 - 9 Page 97


LESSON-9 - CNC - PART #12
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1

D t f le

n
p

io
no m
tr r
ut WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE HOLES
is o
Sa

G90 X Y
1
ib
2 -1.065 1.0625
3 1.0625 1.0625
4 1.0625 -1.0625
5 -1.0625 -1.0625
6 -0.875 - 0.875
7 -0.875 0.875
8 0.875 0.875
9 0.875 -0.875

Page 98 TK-Mill Lesson 9 - 10


LESSON-9 - CNC - PART #12
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the center of the part
Use a 0.5 diameter End Mill Tool # 4 and a 0.125 diameter End Mill Tool # 1
Climb mill

D t f le

n
p

io
no m
tr r
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
utPOSITIONS OF THE 0.5 DIAMETER END MILL
is o
Sa

2.625 Square Coordinates 2.0 Square Coordinates


G90 X Y G90 X Y
ib
1 -1.875 1.5625 1 -1.875 1.250
2 1.0625 1.5625 2 0.875 1.250
3 1.5625 1.0625 3 1.250 0.875
4 1.5625 -1.0625 4 1.250 -0.875
5 1.0625 -1.5625 5 0.875 -1.250
6 -1.0625 -1.5625 6 -0.875 -1.250
7 1.5625 -1.0625 7 -1.250 -0.875
8 -1.5625 1.0625 8 -1.250 0.875
9 -1.0625 1.5625 9 -0.875 1.250

TK-Mill Lesson 9 - 11 Page 99


LESSON-9 - CNC - PART #12
CREATE THE PROGRAM TO MACHINE THE PART
Use a 0.5 diameter End Mill Tool # 4
Speed = 3050 Feed rate =20 IPM
Use a 0.125 diameter End Mill Tool # 1
Speed = 5000 Feed rate =7 IPM
X0Y0 is at the center of the part
Z=0 is the top of the part.
Climb mill
Type up your program and check it for correctness using Backplot software.

%
O999( CNC-PART-12 )
( T4 | 1/2 FLAT ENDMILL | H4 )
( T1 | 1/8 FLAT ENDMILL | H1 )
N5 G20
D t f le
N10 G0 G17 G40 G49 G80 G90

n
N15 T4 M6
N20 G0 G90 G54 X-1.875 Y1.5625 S3050 M3
p

io
N25 G43 H4 Z.1
N30 G1 Z-.125 F20.
no m

N35 X-1.0625
tr r
N40 X1.0625
ut
is o
N45 G2 X1.5625 Y1.0625 I0. J-.5
Sa

N50 G1 Y-1.0625
N55 G2 X1.0625 Y-1.5625 I-.5 J0.
ib
N60 G1 X-1.0625
N65 G2 X-1.5625 Y-1.0625 I0. J.5
N70 G1 Y1.0625
N75 G2 X-1.0625 Y1.5625 I.5 J0.
N80 G1 Z.1
N85 G0 X-1.875 Y1.25
N90 G1 Z-.0625
N95 X-.875
N100 X.875
N105 G2 X1.25 Y.875 I0. J-.375
N110 G1 Y-.875
N115 G2 X.875 Y-1.25 I-.375 J0.

Page 100 TK-Mill Lesson 9 - 12


LESSON-9 - CNC - PART #12 - Continued

N120 G1 X-.875
N125 G2 X-1.25 Y-.875 I0. J.375
N130 G1 Y.875
N135 G2 X-.875 Y1.25 I.375 J0.
N140 G1 Z.1
N145 G0 X0. Y0.
N150 G1 Z-.26 F10.
N155 Y.0625 F20.
D t f le
N160 G3 X-.0625 Y0. I0. J-.0625
N165 X0. Y-.0625 I.0625 J0.

n
N170 X.0625 Y0. I0. J.0625
p
N175 X0. Y.0625 I-.0625 J0.

io
N180 G1 Y0.
N185 G0 Z.1
no m
tr r
N190 M5
ut
N195 G91 G28 Z0.
is o
N200 T1 M6
Sa

N205 G0 G90 G54 X-1.0625 Y1.0625 S5000 M3


N210 G43 H1 Z.1
ib
N215 G99 G81 Z-.28 R.1 F7.
N220 X1.0625
N225 Y-1.0625
N230 X-1.0625
N235 X-.875 Y-.875
N240 Y.875
N245 X.875
N250 Y-.875
N255 G80
N260 M5
N265 G91 G28 Z0.
N270 G28 X0. Y0.
N275 M30
%

TK-Mill Lesson 9 - 13 Page 101


Page 102
Sa
no m
D t f le p
is o

TK-Mill Lesson 9 - 14
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-10
CUTTER COMPENSATION
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 103
LESSON-10 - G40, G41, & G42 CUTTER COMPENSATION

Cutter Compensation is used to offset the center of the cutter and move the cutter either to
the left or right the distance of the cutter radius. When cutting angled geometry, substantial
computations are required to determine the center of the cutter. Using Cutter Compensation, you
can program the part as if the center of the cutter will be travelling along the geometry.

G40 CUTTER COMPENSATION CANCEL

G40 will cancel the G41 or G42 cutter compensation commands.

G41 CUTTER COMPENSATION LEFT

G41 will action cutter compensation left. The tool is moved to the left of the programmed path to
D t f le
compensate for the radius of the tool. A Dnn must also be programmed to select the correct tool

n
size from the DIAMETER/RADIUS offset display register.
p

io
G42 CUTTER COMPENSATION RIGHT
no m

G42 will action cutter compensation right. The tool is moved to the right of the programmed path
tr r
to compensate for the size of the tool.
ut
is o
Sa

G41
ib

G41
G41 Left of the Line G42 Right of the Line

G41 : Tool is moved to the left of the profile (e.g. Outside Profile shown as above)
G42 : Tool is moved to the right of the profile (e.g. Inside Profile shown as above)

Page 104 TK-Mill Lesson 10 - 2


LESSON-10 - G40, G41, & G42 CUTTER COMPENSATION

D t f le

n
p

io
no m
tr r
Without Cutter Compensation Using Cutter Compensation
ut
is o
% %
O10011 O10012
Sa

N1 T12 M06 (3/4 Flat Endmill) N1 T12 M06 (3/4 Flat Endmill)
N2 G90 G54 G00 X-.575 Y-.200 S1500 M03 N2 G90 G54 G00 X-.575 Y-.200 S1500 M03
ib
N3 G43 H12 Z2. N3 G43 H12 Z2.
N4 Z.1 N4 Z.1
N5 G01 Z-.25 F10. N5 G01 Z-.25 F10.
N6 X-.375 (Point B) N6 G41 X0. D12 (Origin)
N7 Y?.???? (Point C) N7 Y1.0 (P1)
N8 X?.???? Y2.375 (Point D) N8 X1.732 Y2.0 (P2)
N9 X2.875 (Point E) N9 X2.875
N10 M05 N10 G40 M05
N11 G00 Z2. N11 G00 Z2.
N12 G91 G28 Z0. (Machine Home Z-Axis) N12 G91 G28 Z0. (Machine Home Z-Axis)
N13 G28 X0. Y0. (Machine Home X,Y-Axis) N13 G28 X0. Y0. (Machine Home X,Y-Axis)
N14 M30 N14 M30
% %

The Cutter Compensation (G41) will reflect the actual part geometry (O, P1, P2..) instead of Cutter
Centers (Point B,C,D & E)

TK-Mill Lesson 10 - 3 Page 105


LESSON-10 - CNC - PART #13

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 106 TK-Mill Lesson 10 - 4


LESSON-10 - CNC - PART #13
The Machining Process
.750 Endmill - Tool # 6
Machine the profile and pocket using cutter compensation
0.750 diameter end mill Spindle Speed = 2100 Feed rate = 25 IPM
.375 Spot Drill - Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
.201 Drill - Tool # 8
0.201 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
.25-20 UNC Tap - Tool # 9
0.250-20 UNC Tap Spindle Speed = 1000 Feed rate = 50 IPM
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 10 - 5 Page 107


LESSON-10 - CNC - PART #13
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the lower left corner of the part

D t f le

n
p

io
no m
tr r
ut
is o
Sa

WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE TWO HOLES
ib
G90 X Y
1 1.000 1.000
2 1.000 2.250

Page 108 TK-Mill Lesson 10 - 6


LESSON-10 - CNC - PART #13
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART - CONTOUR
X0Y0 is at the lower left of the part

D t f le

n
p

io
no m
tr r
ut
is o
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS OF THE 0.75 DIAMETER END MILL TO MACHINE THE CONTOUR
Sa

G90 X Y G90 X Y
ib
1 -0.650 -0.375 12 2.875 2.500
2 0.100 -0.375 13 2.875 0.500
3 0.100 1.000 14 2.625 0.250
4 0.100 1.000 15 1.000 0.250
5 0.100 1.500 16 0.100 0.750
6 0.100 1.750 17 -0.650 0.750
7 0.500 2.250
8 0.100 2.250
9 0.100 2.500
10 0.100 2.750
11 2.375 2.750

TK-Mill Lesson 10 - 7 Page 109


LESSON-10 - CNC - PART #13
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART - POCKET
X0Y0 is at the lower left of the part

D t f le

n
p

io
no m
tr r
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
ut POSITIONS OF THE 0.75 DIAMETER END MILL TO MACHINE THE POCKET
is o
G90 X Y
Sa

1 2.000 0.875
ib
2 2.000 1.500
3 2.000 2.500
4 1.875 2.500
5 1.375 2.000
6 1.375 1.000
7 1.875 0.500
8 2.125 0.500
9 2.625 1.000
10 2.625 2.000
11 2.125 2.500
12 1.875 2.500
13 2.000 2.000

Page 110 TK-Mill Lesson 10 - 8


LESSON-10 - CNC - PART #13
CREATE THE PROGRAM TO MACHINE THE PART
The Machining Process
.750 Endmill - Tool # 6
Machine the profile and pocket using cutter compensation
0.750 diameter end mill Spindle Speed = 2100 Feed rate = 25 IPM
.375 Spot Drill - Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
.201 Drill - Tool # 8
0.201 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
.25-20 UNC Tap - Tool # 9
0.201 diameter Drill Spindle Speed = 1000 Feed rate = 50 IPM
%
O888( PART-13-CUTTER-COMP )
N10 ( X0Y0 LOWER LEFT CORNER OF PART )
N15 ( Z ZERO TOP OF PART)
D t f le
N20 ( T5 | 3/4 FLAT ENDMILL | H5 | D5 | CONTROL COMP | TOOL DIA. - .75 )

n
N25 ( T6 | 3/8 SPOTDRILL | H6 )
N30 ( T8 | NO. 7 DRILL | H8 )
p

io
N35 ( T9 | 1/4-20 TAPRH | H9 )
N40 G20
no m

N45 G0 G17 G40 G49 G80 G90


tr r
N50 T5 M6
ut
is o
N55 G0 G90 G54 X-0.65 Y-0.375 S2100 M3
Sa

N60 G43 H5 Z0.1


N65 G1 Z-0.125 F25.0
ib
N70 G41 D5 X0.1
N75 Y1.0
N80 X0.5
N85 G3 X1.0 Y1.5 I0. J0.5
N90 G1 Y1.75
N95 G3 X0.5 Y2.25 I-0.5 J0.
N100 G1 X0.1
N105 Y2.5
N110 X1.0 Y2.75
N115 X2.375
N120 X2.875 Y2.5
N125 Y0.5
N130 G2 X2.625 Y0.25 I-0.25 J0.
N135 G1 X1.0

TK-Mill Lesson 10 - 9 Page 111


LESSON-10 - CNC - PART #13 - Continued
N140 X0.1 Y0.75
N145 G40 X-0.65
N150 G0 Z0.1
N155 (RAMP INTO POCKET)
N160 X2.0 Y0.875
N165 G1 Z0. F10.0
N170 Y1.5 Z-0.125
N175 G41 D5 Y2.5 F25.0
N180 X1.875
N185 G3 X1.375 Y2.0 I0. J-0.5
N190 G1 Y1.0
N195 G3 X1.875 Y0.5 I0.5 J0.
D t f le
N200 G1 X2.125

n
N205 G3 X2.625 Y1.0 I0. J0.5
N210 G1 Y2.0
p
N215 G3 X2.125 Y2.5 I-0.5 J0.

io
N220 G01 X1.875
no m

N225 G40 X2.0 Y2.0


tr r
N230 G0 Z0.1
ut
is o
N235 M5
N240 G91 G28 Z0.
Sa

N245 T6 M6
ib
N250 G0 G90 G54 X1.0 Y1.0 S2750 M3
N255 G43 H6 Z0.1
N260 G99 G81 Z-0.14 R0.1 F11.0
N265 Y2.25
N270 G80
N275 M5
N280 G91 G28 Z0.
N285 T8 M6
N290 G0 G90 G54 X1.0 Y2.25 S4500 M3
N295 G43 H8 Z0.1
N300 G99 G83 Z-0.35 R0.1 Q0.15 F15.0
N305 Y1.0
N310 G80

Page 112 TK-Mill Lesson 10 - 10


LESSON-10 - CNC - PART #13 - Continued
N315 M5
N320 G91 G28 Z0.
N325 T9 M6
N330 G0 G90 G54 X1.0 Y1.0 S1000 M3
N335 G43 H9 Z0.1
N340 G99 G84 Z-0.6 R0.1 F50.0
N345 Y2.25
N350 G80
N355 M5
N360 G91 G28 Z0.
N365 G28 X0. Y0.
N370 G90
D t f le
N375 M30
%

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 10 - 11 Page 113


LESSON-10 - CNC - PART #14

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 114 TK-Mill Lesson 10 - 12


LESSON-10 - CNC - PART #14
The Machining Process
.750 Endmill - Tool # 6
Machine the profile and pocket using cutter compensation
0.750 diameter end mill Spindle Speed = 2100 Feed rate = 25 IPM
.375 Spot Drill - Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
.201 Drill - Tool # 8
0.201 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
.25-20 UNC Tap - Tool # 9
0.201 diameter Drill Spindle Speed = 1000 Feed rate = 50 IPM
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Lesson 10 - 13 Page 115


LESSON-10 - CNC - PART #14
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART
X0Y0 is at the lower left of the part

D t f le

n
p

io
no m
tr r
ut
is o
Sa

WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE TWO HOLES
ib
G90 X Y
1 1.000 1.000
2 2.000 1.250

Page 116 TK-Mill Lesson 10 - 14


LESSON-10 - CNC - PART #14
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART - CONTOUR
X0Y0 is at the lower left of the part

D t f le

n
p

io
no m
tr r

utWORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
is o
POSITIONS OF THE 0.75 DIAMETER END MILL TO MACHINE CONTOUR
Sa

G90 X Y G90 X Y
1 -0.650 -0.375 12 2.875 2.375
ib
2 0.125 -0.375 13 2.875 0.500
3 0.125 2.250 14 2.500 0.250
4 0.625 2.750 15 0.750 0.250
5 1.125 2.750 16 0.125 0.500
6 1.125 2.500 17 -0.650 0.500
7 1.625 2.000
8 1.750 2.000
9 2.250 2.500
10 2.250 2.625
11 2.625 2.625

TK-Mill Lesson 10 - 15 Page 117


LESSON-10 - CNC - PART #14
WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
POSITIONS TO MACHINE THE PART - POCKET
X0Y0 is at the lower left of the part

D t f le

n
p

io
no m
tr r
ut WORK OUT THE ABSOLUTE X AND Y COORDINATES FOR THE VARIOUS
is o
POSITIONS OF THE 0.75 DIAMETER END MILL TO MACHINE POCKET
Sa

G90 X Y
1 1.000 1.125
ib
2 1.750 1.125
3 2.500 1.125
4 2.500 1.250
5 2.000 1.750
6 1.000 1.750
7 0.500 1.250
8 0.500 1.000
9 1.000 0.500
10 2.000 0.500
11 2.500 1.000
12 2.500 1.125
13 2.000 1.125

Page 118 TK-Mill Lesson 10 - 16


LESSON-10 - CNC - PART #14
CREATE THE PROGRAM TO MACHINE THE PART
The Machining Process
.750 Endmill - Tool # 6
Machine the profile and pocket using cutter compensation
0.750 diameter end mill Spindle Speed = 2100 Feed rate = 25 IPM
.375 Spot Drill - Tool # 6
Spot Drill Spindle Speed = 2750 Feed rate = 11 IPM
.201 Drill - Tool # 8
0.201 diameter Drill Spindle Speed = 4500 Feed rate = 15 IPM
.25-20 UNC Tap - Tool # 9
0.201 diameter Drill Spindle Speed = 1000 Feed rate = 50 IPM
%
O5643( CNC-PART-14 )
( T5 | 3/4 FLAT ENDMILL | H5 | D5 | CONTROL COMP | TOOL DIA. - .75 )
( T6 | 3/8 SPOTDRILL | H6 )
D t f le
( T8 | NO. 7 DRILL | H8 )

n
( T9 | 1/4-20 TAPRH | H9 )
N5 G20
p

io
N10 G0 G17 G40 G49 G80 G90
N15 T5 M6
no m

N20 G0 G90 G54 X-.65 Y-.375 S2100 M3


tr r
N25 G43 H5 Z.1
ut
is o
N30 G1 Z-.125 F25.
Sa

N35 X 0.125
N40 G41 D5 Y2.25
ib
N45 G2 X.625 Y2.75 I.5 J0.
N50 G1 X1.125
N55 Y2.5
N60 G3 X1.625 Y2. I.5 J0.
N65 G1 X1.75
N70 G3 X2.25 Y2.5 I0. J.5
N75 G1 Y2.625
N80 X2.625
N85 G2 X2.875 Y2.375 I0. J-.25
N90 G1 Y.5
N95 X2.5 Y.25
N100 X.75
N105 X.125 Y.5

TK-Mill Lesson 10 - 17 Page 119


LESSON-10 - CNC - PART #14 - Continued

N110 X-0.65 Y.5


N115 G40
N120 G0 Z.1
N125 X1.0 Y1.125
N130 G1 Z0
N135 X1.75 Y1.125 Z-0.125
N140 G41 D5 X2.5
N145 Y1.25
N150 G3 X2. Y1.75 I-.5 J0.
N155 G1 X1.
N160 G3 X.5 Y1.25 I0. J-.5
N165 G1 Y1.
D t f le
N170 G3 X1. Y.5 I.5 J0.

n
N175 G1 X2.
N180 G3 X2.5 Y1. I0. J.5
p
N185 G1 X2.5 Y1.125

io
N190 G1 X2.0 Y1.125
no m

N195 G00 Z.1


tr r
N200 G40
ut
is o
N205 M5
N210 G91 G28 Z0.
Sa

N215 T6 M6
ib
N220 G0 G90 G54 X2. Y1.25 S2750 M3
N225 G43 H6 Z.1
N230 G99 G81 Z-.14 R.1 F11.
N235 X1. Y1.
N240 G80
N245 M5
N250 G91 G28 Z0.
N255 T8 M6

Page 120 TK-Mill Lesson 10 - 18


LESSON-10 - CNC - PART #14

N260 G0 G90 G54 X1. Y1. S4500 M3


N265 G43 H8 Z.1
N270 G99 G83 Z-.35 R.1 Q.1 F15.
N275 X2. Y1.25
N280 G80
N285 M5
N290 G91 G28 Z0.
N295 T9 M6
N300 G0 G90 G54 X2. Y1.25 S1000 M3
N305 G43 H9 Z.1
N310 G99 G84 Z-.35 R.1 F50.
N315 X1. Y1.
D t f le
N320 G80

n
N325 M5
N330 G91 G28 Z0.
p

io
N335 G28 X0. Y0.
N340 M30
no m

%
tr r
ut
is o
Sa

ib

TK-Mill Lesson 10 - 19 Page 121


D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 122 TK-Mill Lesson 10 - 20


CNC PROGRAMMING
WORKBOOK - MILL

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

APPENDIX

Page 123
Appendix Extra CNC Programming Exercises
Exercise #1

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 124 TK-Mill Appendix - 2


Extra CNC Programming Exercise #2

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Appendix - 3 Page 125


Extra CNC Programming Exercise #3

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 126 TK-Mill Appendix - 4


Extra CNC Programming Exercise #4

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Appendix - 5 Page 127


Extra CNC Programming Exercise #5

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Page 128 TK-Mill Appendix - 6


Extra CNC Programming Exercise #6

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Mill Appendix - 7 Page 129


Extra CNC Programming Exercise #7

Instructions:
1. Create your own design.
2. The material size: 6 x 1.5 x .125 Aluminum
3. The part is held in the vise.
4. Locate the part flush with the left hand side of the vise jaw.
5. X0 Y0 is the top left hand corner of the material.
6. Z0 is the top of the material.
7. Center Drill is used as an engraving tool to machine the letters.
8. Spindle Speed: 5000 rpm
9. Feedrate: 12 in/min
10. Depth of Cut : -0.025
11. Center Drill 2 mounting holes using Canned Cycle
12. Depth of Cut: -0.25
D t f le
13. Minimum of five letters
14. You can use the suggested letter shapes & size or create your own lettering design.

n
p

io
Suggested Lettering:
no m
tr r
ut
is o
Sa

ib

Page 130 TK-Mill Appendix - 8


Appendix Preparatory Functions G-Codes

G00 RAPID POSITIONING MOTION

G01 LINEAR INTERPOLATION MOTION

G02 CIRCULAR INTERPOLATION MOTION - CLOCKWISE

G03 CIRCULAR INTERPOLATION MOTION - COUNTECLOCKWISE

G04 DWELL

G09 EXACT STOP

G10 PROGRAMMABLE OFFSET SETTING

G12 CW CIRCULAR POCKET MILLING


D t f le
G13 CCW CIRCULAR POCKET MILLING

n
G17 CIRCULAR MOTION XY PLANE SELECTION (G02 or G03)
p
G18 CIRCULAR MOTION ZX PLANE SELECTION (G02 or G03)

io
G19 CIRCULAR MOTION YZ PLANE SELECTION (G02 or G03)
no m
tr r
G20 VERIFY INCH COORDINATE POSITIONING

ut
is o
G21 VERIFY METRIC COORDINATE POSITIONING
Sa

G28 MACHINE ZERIO RETURN THRU REF. POINT


ib
G29 MOVE TO LOCATION THROUGH G28 REF. POINT

G31 FEED UNTIL SKIP FUNCTION

G35 AUTOMATIC TOOL DIAMETER MEASUREMENT

G36 AUTOMATIC WORK OFFSET MEASUREMENT

G37 AUTOMATIC TOOL LENGTH MEASUREMENT

G40 CUTTER COMPENSATION CANCEL G41/G42/G141

G41 2D CUTTER COMPENSATION, LEFT (X, Y, D)

G42 2D CUTTER COMPENSATION, RIGHT (X, Y, D)

G43 TOOL LENGTH COMPESATION POSITIVE (H, Z)

G44 TOOL LENGTH COMPENATION NEGATIVE (H, Z)

TK-Mill Appendix - 9 Page 131


Appendix Preparatory Functions G-Codes

G47 TEXT ENGRAVING (X, Y, Z, R, I, J, P, E, F)

G49 TOOL LENGTH COMPENSATION CANCEL G43/G44/G143)

G50 SCALING G51 CANCEL

G51 SCALING (X, Y, Z, P)

G52 WORK OFFSET COORDINATE POSITING

G52 GLOBAL WORK COORDINATE OFFSET SHIFT

G52 GLOBAL WORK COORDINATE OFFSET SHIFT

G53 MACHINE COORDAINTE POSITIONING, NON-MODAL (X, Y, Z, A, B)


D t f le
G54 WORK OFSET COORDIANTE POSITIONING #1

n
G55 WORK OFSET COORDIANTE POSITIONING #2
p
G56 WORK OFSET COORDIANTE POSITIONING #3

io
G57 WORK OFSET COORDIANTE POSITIONING #4
no m
tr r
G58 WORK OFSET COORDIANTE POSITIONING #5

ut
is o
G59 WORK OFSET COORDIANTE POSITIONING #6
Sa

G60 UNI-DIRECTIONAL POSITIONING (X, Y, Z, A, B)


ib
G61 EXACT STOP, MODAL (X, Y, Z, A, B)

G64 EXACT STOP G61 MODE CANCEL

G65 MACRO SUB-ROUTINE CALL

G68 ROATION (G17, G18, G19, X, Y, Z, R)

G69 ROTATION G68 CANCEL

G70 BOLT HOLE CIRCLE with a CANNED CYCLE (I, J, L)

Page 132 TK-Mill Appendix - 10


Appendix Preparatory Functions G-Codes

G71 BOLTHOLEARC with a CANNED CYCLE (I, J, K, L)

G72 BOLT HOLES ALONG AN ANGLE with a CANNED CYCLE (I, J, L)

G73 HIGH SPEED PECK DRILL CANNED CYCLE (X, Y, A, B, Z, I, J, K, Q, P, R, L, F)

G74 REVERSE TAPPING CANNED CYCLE (X, Y, A, B, Z, J, R, L, F)

G76 FINE BORING CANNED CYCLE (X, Y, A, B, Z, I, J, P, Q, R, L, F)

G77 BACK BORE CANNED CYCLE (X, Y, A, B, Z, I, J, Q, R, L, F)

G80 CANCEL CANNED CYCLE

G81 DRILL CANNED CYCLE (X, Y, A, B, Z, R, L, F)


D t f le
G82 SPOT DRILL/COUNTERBORE CANNED CYCLE (X, Y, A, B, Z, P, R, L, F)

n
G83 PECK DRILL CANNED CYCLE (X, Y, A, B, Z, I, J, K, Q, P, R, L, F)
p
G84 TAPPING CANNED CYCLE (X, Y, A, B, Z, J, R, L, F)

io
G85 BORE IN, BORE OUT CANNED CYCLE (X, Y, A, B, Z, R, L, F)
no m
tr r
G86 BORE IN, STOP, RAPID OUT CANNED CYCLE (X, Y, A, B, Z, R, L, F)

ut
is o
G87 BORE IN AND MANUAL RETRACT CANNED CYCLE (X, Y, A, B, Z, R, L, F)
Sa

G88 BORE IN, DWELL, MANUAL RETRACT CANNED CYCLE (X, Y, A, B, Z, P, R, L, F)


ib
G89 BORE IN, DWELL, BORE OUT (X, Y, A, B, Z, P, R, L, F)

G90 ABSOLUTE POSITIONING

G91 INCREMENTAL POSITIONING

G92 GLOBAL WORK COORDINATE SYSTEM SHIFT (FANUC) (HAAS)

G92 SET WORK COORDINATE VALUE (YA SNAC)

G93 INVERSE TIME FEED MODE ON

G94 INVERSE TIME FEED MODE OFF/FEED PER MINUTE ON

G98 CANNED CYCLE INITIAL POINT RETURN

G99 CANNED CYCLE R PLANE RETURN

TK-Mill Appendix - 11 Page 133


Appendix Miscellaneous Functions M-Codes

M00 PROGRAM STOP

M01 OPTIONAL PROGRAM STOP

M02 PROGRAM END

M03 SPINDLE ON CLOCKWISE

M04 SPINDLE ON COUTERCLOCKWISE

M05 SPINDLE STOP

M06 TOOL CHANGE

M08 COOLANT ON

M09 COOLANT OFF


D t f le
M19 ORIENT SPINDLE (P, R)

n
M21-M28 OPTIONAL USER M CODE INTERFACE WITH M-FIN SIGNAL
p
M30 PROGRAM END AN RESET

io
M31 CHIP AUGER FORWARD
no m
tr r
M32 CHIP AUGER REVERSE

ut
is o
M33 CHIP AUGER STOP
Sa

M34 COOLANT SPIGOT POSITION DOWN, INCREMENT

M35 COOLANT SPIGOT POSITION UP, DECREMENT


ib
M36 PALET PART READY

M39 ROTATE TOOL TURRET

M41 SPINDLE LOW GEAR OVERRIDE

M42 SPINDLE HIGH GEAR OVERRIDE

M50 EXECUTE PALLET CHANGE

Page 134 TK-Mill Appendix - 12


Appendix Miscellaneous Functions M-Codes

M51-M58 OPTIONAL USER M CODE SET

M59 OUTPUT RELAY SET (N)

M61-M68 OPTIONAL USER M CODE CLEAR

M69 OUTPUT RELAY CLEAR (N)

M75 SET G35 OR G136 REFERENCE POINT

M76 CONTROL DISPLAY INACTIVE

M77 CONTROL DISPLAY ACTIVE

M78 ALARM IF SKIP SIGNAL FOUND


D t f le
M79 ALARM IF SKIP SIGNAL NOT FOUND

n
M80 AUTOMATIC DOOR OPEN
p
M81 AUTOMATIC DOOR CLOSE

io
M82 TOOL UNCLAMP
no m
tr r
M83 AUTO AIR JET ON

ut
is o
M84 AUTO AIR JET OFF
Sa

M86 TOOL CLAMP


ib
M88 COOLANT THROUGH SPINDLE ON

M89 COOLANT THROUGH SPINDLE OFF

M93 AXIS POS CAPTURE START (P, Q)

M94 AXIS POS CAPTURE STOP

M95 SLEEP MODE

M96 JUMP IF NO SIGNAL (P, Q)

M97 LOCAL SUB-PROGRAM CALL (P, L)

M98 SUB-PROGRAM CALL (P, L)

M99 SUB-PROGRAM/ROUTINE RETURN OR LOOP

M109 INTERACTIVE USER INPUT (P)

TK-Mill Appendix - 13 Page 135


Standard Drill Sizes - Inches

Drill Decimal Drill Decimal Drill Decimal Drill Decimal


. . . . . . .
Size Equiv. Size Equiv. Size Equiv. Size Equiv.
80 = .0135 43 = .089 8 = .199 25/64 = .3906
79 = .0145 42 = .0935 7 = .201 X = .397
1/64 = .0156 3/32 = .0938 13/64 = .2031 Y = .404
78 = .016 41 = .096 6 = .204 13/32 = .4063
77 = .018 40 = .098 5 = .2055 Z = .413
76 = .020 39 = .0995 4 = .209 27/64 = .4219
75 = .021 38 = .1015 3 = .213 7/16 = .4375
74 = .0225 37 = .104 7/32 = .2188 29/64 = .4531
73 = .024 36 = .1065 2 = .221 15/32 = .4688
72 = .025 7/64 = .1094 1 = .228 31/64 = .4844
71 = .026 35 = .110 A = .234 1/2 = .500
70 = .028 34 = .111 15/64 = .2344 33/64 = .5156
69 = .0292 33 = .113 B = .238 17/32 = .5313
D t f le
68 = .031 32 = .116 C = .242 35/64 = .5469

n
1/32 = .0313 31 = .120 D = .246 9/16 = .5625
67 = .032 1/8 = .1250 1/4 (E) = .250 37/64 = .5781
p
66 = .033 30 = .1285 F = .257 19/32 = .5938

io
65 = .035 29 = .136 G = .261 39/64 = .6094
64 = .036 28 = .1405 17/64 = .2656 5/8 = .625
no m

63 = .037 9/64 = .1406 H = .266 41/64 = .6406


tr r
62 = .038 27 = .144 I = .272 21/32 = .6563
ut 61 = .039 26 = .147 J = .277 43/64 = .6719
is o
60 = .040 25 = .1495 K = .281 11/16 = .6875
Sa

59 = .041 24 = .152 9/32 = .2813 45/64 = .7031


58 = .042 23 = .154 L = .290 23/32 = .7188
ib
57 = .043 5/32 = .1563 M = .295 47/64 = .7344
56 = .0465 22 = .157 19/64 = .2969 3/4 = .750
3/64 = .0469 21 = .159 N = .302 49/64 = .7656
55 = .052 20 = .161 5/16 = .3125 25/32 = .7813
54 = .055 19 = .166 O = .316 51/64 = .7969
53 = .0595 18 = .1695 P = .323 13/16 = .8125
1/16 = .0625 11/64 = .1719 21/64 = .3281 53/64 = .8281
52 = .0635 17 = .173 Q = .332 27/32 = .8438
51 = .067 16 = .177 R = .339 55/64 = .8594
50 = .070 15 = .180 11/32 = .3438 7/8 = .875
49 = .073 14 = .182 S = .348 57/64 = .8906
48 = .076 13 = .185 T = .358 29/32 = .9063
5/64 = .0781 3/16 = .1875 23/64 = .3594 59/64 = .9219
47 = .0785 12 = .189 U = .368 15/16 = .9375
46 = .081 11 = .191 3/8 = .375 61/64 = .9531
45 = .082 10 = .1935 V = .377 31/32 = .9688
44 =.086 9 = .196 W = .386 63/64 = .9844

Page 136 TK-Mill Appendix - 14


Inch Tap Drill Sizes

INCH SIZES - NATIONAL COARSE INCH SIZES - NATIONAL FINE


UNC UNF
---------------------------- ----------------------------
TAP DRILL TAP DRILL
SIZE SIZE SIZE SIZE
---------------------------- ----------------------------
#1-64 #53 #0-80 3/64"
#2-56 #51 #1-72 #53
#3-48 5/64" #2-64 #50
#4-40 #43 #3-56 #46
#5-40 #39 #4-48 #42
#6-32 #36 #5-44 #37
#8-32 #29 #6-40 #33
#10-24 #25 #8-36 #29
#12-24 #17 #10-32 #21
D t f le
1/4-20 #7 #12-28 #15

n
5/16-18 F 1/4-28 #3
3/8-16 5/16 5/16-24 I
p
7/16-14 U 3/8-24 Q

io
1/2-13 27/64 7/16-20 W
9/16-12 31/64 1/2-20 29/64
no m

5/8-11 17/32 9/16-18 33/64


tr r
3/4-10 21/32 5/8-18 37/64
ut
is o
7/8-9 49/64 3/4-16 11/16
1"-8 7/8 7/8-14 13/16
Sa

1-1/8-7 63/64 1"-14 15/16


1-1/4-7 1-7/64 1-1/8-12 1-3/64
ib
1-1/2-6 1-11/32 1-1/4-12 1-11/64
1-3/4-5 1-35/64 1-1/2-12 1-27/64
2"-4-1/2 1-25/32 1-3/4-12 1-43/64
2"-12 1-59/64

TK-Mill Appendix - 15 Page 137


Metric Tap Drill Sizes

METRIC COARSE SIZES METRIC FINE SIZES


---------------------------- ----------------------------
TAP DRILL TAP DRILL
SIZE SIZE SIZE SIZE
---------------------------- ----------------------------
1mm x .25 .75mm 4 mm x .35 3.6mm
1.1 x .25 .85 4 x .5 3.5
1.2 x .25 .95 5 x .5 4.5
1.4 x .3 1.1 6 x .5 5.5
1.6 x .35 1.25 6 x .75 5.25
1.7 x .35 1.3 7 x .75 6.25
1.8 x .35 1.45 8 x .5 7.5
2 x .4 1.6 8 x .75 7.25
2.2 x .45 1.75 8x1 7
2.5 x .45 2.05 9x1 8
D t f le
3 x .5 2.5 10 x .75 9.25

n
3.5 x .6 2.9 10 x 1 9
4 x .7 3.3 10 x 1.25 8.8
p
4.5 x .75 3.7 11 x 1 10

io
5 x .8 4.2 12 x .75 11.25
6x1 5 12 x 1 11
no m

7x1 6 12 x 1.5 10.5


tr r
8 x 1.25 6.8 14 x 1 13
ut
is o
9 x 1.25 7.8 14 x 1.25 12.8
10 x 1.5 8.5 14 x 1.5 12.5
Sa

11 x 1.5 9.5 16 x 1 15
12 x 1.75 10.2 16 x 1.5 14.5
ib
14 x 2 12 18 x 1 17
16 x 2 14 18 x 2 16
18 x 2.5 15.5 20 x 1 19
20 x 2.5 17.5 20 x 1.5 18.5
22 x 2.5 19.5 20 x 2 18
24 x 3 21 22 x 1 21
27 x 3 24 22 x 1.5 20.5
30 x 3.5 26.5 22 x 2 20
24 x 1.5 22.5
24 x 2 22
26 x 1.5 24.5
27 x 1.5 25.5
27 x 2 25
28 x 1.5 26.5
30 x 1.5 28.5
30 x 2 28

Page 138 TK-Mill Appendix - 16


CENTER DRILLING

CENTER DRILLING

Before most drilling operations take place a starting drill must be programmed to make a small
hole for the larger drill that will follow. The tool used to make the starting hole is known as a
center drill, sizes of center drills vary and the use of the different sizes is governed by the size of the
drill that will be used after. The following is a chart that will assist in choosing the proper size of
the center drill and programming the correct Z depth.

D t f le

n
p

io
no m
tr r
ut DRILL POINT LENGTH
is o
Sa

On most engineering drawings the finished depth of the hole will be given from the front edge of
the part to the end of the parallel part of the hole (not including the drill point). This poses a
ib
programming problem because we program from the point of the drill so any Z depth we specify
has to include the length of the drill point. To do this we have a calculation to perform based on
the diameter of the drill and the angle of the drill point (usually 118). Quite simply the
calculation is as follows:
Drill Point Length = Diameter x Constant
Where DIA. refers to the drill diameter and the constant is stated in the following chart
DRILL ANGLE CONSTANTS
60= 0.866 110= 0.350
75= 0.652 118= 0.300
80= 0.596 120= 0.289
82= 0.575 135= 0.207
90= 0.500 150= 0.134
100= 0.420 180= 0.000

TK-Mill Appendix - 17 Page 139


Discriminator Installation Instructions

Installation Instructions for Workbook users:


1. Locate the DVD/CD that came with the workbook (fixed to the back cover).
2. Insert the disc into the DVD/CD ROM tray of your computer.
3. When the AutoPlay window is displayed select Open folder to view files as shown below:

D t f le

n
p

io
4. Double click or open the folder Discriminator_v1_2 as shown below:
no m
tr r
ut
is o
Sa

ib

Page 140 TK-Mill Appendix - 18


Discriminator Installation Instructions Continued
5. Double-click the Discriminator.exe file as shown below. This will start the installation process. Follow
the instructions on the screen to complete the installation.

D t f le

n
p
Installation Instructions for Online Course users:

io
1. Go to the Course Intro page of the Online Course as shown below:
no m
tr r
ut
is o
Sa

ib

2. Locate the What you need to complete this course section on this page and click on the
Discriminator link to download the Discriminator installation file. Make sure you save the file to a
place on the hard drive that you can be easily located.
3. Once the file has downloaded locate it and double-click the Discriminator.zip file to extract the
installation files onto your hard drive. Make sure you extract the files into a new folder on your hard
drive and remember where the folder is located.
4. Open the folder the files were extracted to and double click on Discriminator21017.exe.
5. Follow the instructions on the screen.

TK-Mill Appendix - 19 Page 141


Page 142
Sa
no m
D t f le p
is o
tr r
ib
ut
io
n
CNC PROGRAMMING
TEACHER KIT

LATHE
D t f le

n
p

io
no m
tr r
By Matthew Manton and Duane Weidinger
ut
is o
Sa

ib
Sa
no m
D t f le p
is o
tr r
ib
ut
io
n
TABLE OF CONTENTS-LATHE

LESSON-1 ..ABSOLUTE & INCREMENTAL POSITIONING ........................................................1

ABSOLUTE & INCREMENTAL POSITIONING - EXERCISE # 1..................................... 2

ABSOLUTE & INCREMENTAL POSITIONING - EXERCISE #2...................................... 3

ABSOLUTE & INCREMENTAL POSITIONING - EXERCISE #3...................................... 4

ABSOLUTE & INCREMENTAL POSITIONING - EXERCISE #4...................................... 5

ABSOLUTE & INCREMENTAL POSITIONING - EXERCISE #5...................................... 6

LESSON-2 ..INTRODUCTION TO CNC CODES ........................................................................7


D t f le
LATHE TOOLS .......................................................................................................... 8

n
COMMONLY USED PREPARATORY G CODES.......................................................... 9
p

io
COMMONLY USED MISCELLANEOUS M CODES ..................................................... 11
no m

RAPID G00 AND LINEAR G01 INTERPOLATION ........................................................ 12


tr r
ut EXAMPLE OF PROGRAM START-UP BLOCKS ............................................................ 13
is o
Sa

MOVING TO MACHINE ZERO G28 AND G53 ......................................................... 16


ib
G40, G41, & G42 TOOL NOSE COMPENSATION....................................................... 17

LESSON-3 ..DRILLING .........................................................................................................19

DRILLING ON CENTERLINE EXAMPLE .................................................................... 21

DRILLING CANNED CYCLES ....................................................................................... 22

DRILLING ON CENTERLINE EXERCISE #1................................................................ 25

LESSON-4 ..LINEAR INTERPOLATION ...................................................................................27

FACING EXAMPLE ..................................................................................................... 29

LINEAR INTERPOLATION - EXAMPLE ........................................................................ 31

LINEAR INTERPOLATION LESSON-4 EXERCISE #1 .................................................. 35


TABLE OF CONTENTS

LESSON-5 ..TURNING CANNED CYCLES ...............................................................................39

ROUGH TURNING CANNED CYCLE EXAMPLE ........................................................... 43

ROUGH BORING CANNED EXAMPLE ........................................................................ 46

LESSON-6 ..CIRCULAR INTERPOLATION...............................................................................49

CIRCULAR INTERPOLATION - EXERCISE #1 ............................................................... 51

CIRCULAR INTERPOLATION BORING - EXERCISE #2 ................................................. 53

CIRCULAR INTERPOLATION TURNING AND BORING -EXERCISE #3 ........................ 60


D t f le
CIRCULAR INTERPOLATION TURNING AND BORING -EXERCISE #4 ........................ 67

n
LESSON-7 ..TOOL NOSE COMPENSATION ............................................................................73
p

io
TOOL NOSE COMPENSATION (G40, G41, & G42) .................................................... 74
no m

CNC PROGRAMMING G42 EXAMPLE .................................................................... 76


tr r
ut
is o
CNC PROGRAMMING BORING EXAMPLE G41 ................................................... 77
Sa

LESSON-8 ..GROOVING/PARTING OFF ................................................................................79


ib
GROOVING EXAMPLE ............................................................................................... 80

PART-OFF EXAMPLE ................................................................................................. 81

GROOVING CYCLE-MULTIPLE PASS .......................................................................... 88

GROOVING CYCLE-SINGLE PASS FOR CUT-OFF ........................................................ 89

GROOVING & PART OFF EXERCISE # 1 ..................................................................... 95

TK-Table of Contents - 2
LESSON-9 THREADING ........................................................................................................101

HAAS-G76 O.D/I.D THREAD CUTTING CYCLE ........................................................... 102

HAAS-G92 THREAD CUTTING CYCLE ........................................................................ 103

HAAS-M24 THREAD CHAMFER OFF ......................................................................... 104

THREADING OVERVIEW ........................................................................................... 105

THREADING EXAMPLE DRAWING ............................................................................ 108

THREADING EXERCISE .............................................................................................. 116

APPENDIX ..........................................................................................................................121

EXTRA CNC PROGRAMMING EXERCISES .................................................................. 122


D t f le
PREPATORY FUNCTIONS G-CODES........................................................................ 131

n
MISCELLANEOUS FUNCTIONS M-CODES .............................................................. 135
p

io
STANDARD DRILL SIZES INCHES ............................................................................ 136
no m
tr r
INCH TAP DRILL SIZES ............................................................................................... 137
ut
is o
METRIC TAP DRILL SIZES .......................................................................................... 138
Sa

DISCRIMINATOR SOFTWARE INSTALLATION ........................................................... 139


ib

TK-Table of Contents - 3
Sa
no m
D t f le p
is o

TK-Table of Contents - 4
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
LESSON-1
ABSOLUTE AND INCREMENTAL
POSITIONING
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 1
LESSON-1 EXERCISE #1 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p
ABSOLUTE PROGRAMMING

io
All axis motions are based on a fixed zero reference point, known as ABSOLUTE ZERO (part zero).
Each coordinate is in relation to this absolute zero using Cartesian or Rectangular Co-ordinates.
no m
tr r
INCREMENTAL PROGRAMMING
All axis motions are based on the distance to the next location.
ut
is o
Each coordinate is based on how far the tool is to move from start to finish.
For an incremental move in X axis, we use U and for an incremental move in the Z axis we use W. G91 is not used.
Sa

STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND BACK
ib
TO THE POINT O USING ABSOLUTE & INCREMENTAL POSITIONING
ABSOLUTE X Z INCREMENTAL U W
O (Origin) 0 0 O1 3 3
1 3 3 12 2 0
2 5 3 23 2 2
3 7 5 34 0 -6
4 7 -1 45 -3 -2
5 4 -3 56 -6 -3
6 -2 -6 67 -3 4
7 -5 -2 78 -1 6
8 -6 4 89 3 3
9 -3 7 9O 3 -7

TK-Lathe Lesson 1 - 2
Page 2
LESSON-1 EXERCISE #2 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p
ABSOLUTE PROGRAMMING

io
All axis motions are based on a fixed zero reference point, known as ABSOLUTE ZERO (part zero).
Each coordinate is in relation to this absolute zero using Cartesian or Rectangular Co-ordinates.
no m
tr r
INCREMENTAL PROGRAMMING

ut
All axis motions are based on the distance to the next location.
is o
Each coordinate is based on how far the tool is to move from start to finish.
For an incremental move in X axis, we use U and for an incremental move in the Z axis, we use W. G91 is not used.
Sa

STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND BACK
ib
TO THE POINT O USING ABSOLUTE & INCREMENTAL POSITIONING
ABSOLUTE X Z INCREMENTAL U W
O (Origin) 0 0 O1 -4 3
1 -4 3 12 -3 -1
2 -7 2 23 0 -6
3 -7 -4 34 5 3
4 -2 -1 45 7 -6
5 5 -7 56 -3 6
6 2 -1 67 0 4
7 2 3 78 5 4
8 7 7 89 -10 0
9 -3 7 9O 3 7

TK-Lathe Lesson 1 - 3
Page 3
LESSON-1 EXERCISE #3 - ABSOLUTE & INCREMENTAL POSITIONING

D t f le

n
p

io
ABSOLUTE PROGRAMMING
no m

All axis motions are based on a fixed zero reference point, known as ABSOLUTE ZERO (part zero).
tr r
Each coordinate is in relation to this absolute zero using Cartesian Co-ordinates.
ut
is o
INCREMENTAL PROGRAMMING
All axis motions are based on the distance to the next location.
Sa

Each coordinate is based on how far the tool is to move from start to finish.
For an incremental move in X axis, we use U and for an incremental move in the Z axis, we use W. G91 is not used.
ib
STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND BACK
TO THE POINT O USING ABSOLUTE & INCREMENTAL POSITIONING
ABSOLUTE X Z INCREMENTAL U W
O (Origin) 0 0 O1 2 6
1 2 6 12 2 -7
2 4 -1 23 3 -2
3 7 -3 34 -4 -2
4 3 -5 45 -6 -1
5 -3 -6 56 -3 4
6 -6 -2 67 0 4
7 -6 2 78 5 4
8 -1 6 89 -1 -3
9 -2 3 9O 2 -3

TK-Lathe Lesson 1 - 4
Page 4
LESSON-1 EXERCISE #4 - ABSOLUTE & INCREMENTAL POSITIONING OD

D t f le

n
p

io
no m
tr r
ut
is o
STARTING AT THE POINT A (ORIGIN), DESCRIBE THE TOOLPATH THROUGH ALL THE POINTS USING
Sa

ABSOLUTE & INCREMENTAL POSITIONING


ib
ABSOLUTE X Z INCREMENTAL U W
A 0 0 AB 1.0 0.0
B 1.0 0 BC 0.5 -0.5
C 1.5 -0.5 CD 0 -1.5
D 1.5 -2.0 DE 2.0 0
E 3.5 -2.0 EF 0.5 -0.25
F 4.0 -2.25 FG 0 -2.5
G 4.0 -4.75 GH 0.75 0
H 4.75 -4.75 HI 0 -1.25
I 4.75 -6.0

TK-Lathe Lesson 1 - 5
Page 5
LESSON-1 EXERCISE #5 - ABSOLUTE & INCREMENTAL POSITIONING OD

D t f le

n
p

io
no m
tr r
BEGIN AT START POINT SP (X3.75, Z0.25), DESCRIBE THE PATH FROM SP THROUGH POINTS A-K AND
ut BACK TO POINT SP, USING ABSOLUTE & INCREMENTAL POSITIONING
is o
Sa

ABSOLUTE X Z INCREMENTAL U W
SP
3.75 0.25 SP A 0 -0.25
ib
(START POINT)
A 3.75 0 AB -3.75 0
B 0 0 BC 1.0 0
C 1.0 0 CD 0.5 -0.5
D 1.5 -0.5 DE 0 -1.5
E 1.5 -2.0 EF 0.75 0
F 2.25 0 FG 0.25 -0.25
G 2.5 -2.25 GH 0 -2.5
H 2.5 -4.75 HI 0.875 0
I 3.375 -4.75 IJ 0.125 -0.125
J 3.5 -4.875 JK 0 -1.125
K 3.5 -6.0 K SP 0.25 6.25
SP 3.75 0.25

TK-Lathe Lesson 1 - 6
Page 6
CNC PROGRAMMING
WORKBOOK
CODE FUNCTION

Rapid traverse motion; Used for non-cutting rapid moves of the machine axis to a
G00 location to be machined, or rapid retract moves after cuts have been completed.
Maximum rapid motion (I.P.M.) of a CNC Machine will vary on machine model.

Linear interpolation motion; Used for actual machining and metal removal.
G01 Governed by a programmed feedrate in inches (or mm) per minute. Maximum feed
rate (I.P.M.) of a CNC Machine will vary depending on the model of the machine.

G02 Circular Interpolation, Clockwise


D t f le
G03 Circular Interpolation, Counterclockwise

n
G04 Dwell- Used with an X value for time of dwell in seconds
p
G18 ZX Plane Selection

io
G20 Verify Inch Coordinate Positions
no m

G21 Verify Metric Coordinate Positions


tr r
G28 Machine Home (Rapid traverse)
ut
is o
G40 Tool Nose Radius Compensation CANCEL
Sa

G41 Tool Nose Radius Compensation LEFT of the programmed path


G42 Tool Nose Radius Compensation RIGHT of the programmed path
ib
G50 Max RPM Preset
G52 Local Coordinate system setting
G53 Machine Zero Positioning Coordinate Shift
G54-59 Select Coordinate System #1 - #6

LESSON-2
INTRODUCTION TO CNC CODES

Page 7
LESSON-2 INTRODUCTION TO CNC CODES
LATHE TOOLS

The CNC Lathe used in this text is set-up with following tools. All program examples
and exercises in this workbook are typically using the same tools.

Turret # Tool Description

1 O.D. Right Hand Roughing Tool 80

2 O.D. Right Hand Finishing Tool 55


D t f le

n
3 O.D. Profiling Tool 35
p

io
4 Right Hand Parting Tool Width 0.118
no m
tr r
5 O.D. Thread Tool
ut
is o
Sa

6 # 4 Centre Drill
ib
7 1/4 Diameter Drill

8 Boring Tool

TK-Lathe Lesson 2 - 2
Page 8
COMMONLY USED PREPARATORY G CODES
CODE FUNCTION
Rapid traverse motion; Used for non-cutting rapid moves of the machine axis to a
G00
location to be machined, or rapid retract moves after cuts have been completed.
Linear interpolation motion; Used for actual machining and metal removal.
G01
Governed by a programmed feedrate in inches (or mm) per minute.
G02 Circular Interpolation, Clockwise
G03 Circular Interpolation, Counterclockwise
G04 Dwell- Used with an X value for time of dwell in seconds
G18 ZX Plane Selection
G20 Verify Inch Coordinate Positions
G21 Verify Metric Coordinate Positions
G28 Machine Home (Rapid traverse)
D t f le
G40 Tool Nose Radius Compensation CANCEL

n
G41 Tool Nose Radius Compensation LEFT of the programmed path
G42 Tool Nose Radius Compensation RIGHT of the programmed path
p

io
G50 Max RPM Preset
G52 Local Coordinate system setting
no m
tr r
G53 Machine Zero Positioning Coordinate Shift

ut
G54-G59
is o
Select Coordinate System #1 - #6 (Part zero offset location)
G70 Profile Finish Turning fixed cycle
Sa

G71 Profile Rough Turning fixed cycle Z axis direction


ib
G72 Profile Rough Turning fixed cycle X axis direction
G73 Pattern Repetition cycle
G74 Drilling Cycle
G75 Grooving cycle
G76 Threading cycle

G80 Cancel Canned Cycle

G81 Drill Canned Cycle

G96 Constant Surface Speed (CSS)

G97 Direct RPM Input Mode (cancels CSS mode)


G98 Feed Rate per Minute
G99 Feed Rate per Revolution

TK-Lathe Lesson 2 - 3
Page 9
PROGRAMMING NOTE
As you may have noticed, there are no Incremental or Absolute modes included in the Preparatory
Commands (G codes). On a CNC turning center or Lathe, the mode is always set to Absolute and
diameter, if an Incremental movement is required the letters U or W are used for X or Z
respectively.

X OVERCUT
Most lathe tools have a radius on the front or cutting edge; it is referred to as Tool Nose Radius.
This radius must be compensated for in the calculation of the tool path much like the tool radius
offset in milling operations, this offset is known as Tool Nose Radius Compensation. We will discuss
this later on in this book but for now, know that when we program a facing operation we must
account for the radius in our final X position of the facing move to create a flat surface. This extra
D t f le
value that we program is sometimes referred to as overcut.

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 2 - 4
Page 10
COMMONLY USED MISCELLANEOUS M CODES

CODE FUNCTION
The M00 code is used for a Program Stop command on the machine.
It stops the spindle, turns off coolant and stops look-a-head processing.
M00
Pressing CYCLE START again will continue the program on the next block of the
program.
The M01 code is used for an Optional Program Stop command.
Pressing the OPT STOP key on the control panel signals the machine to perform a stop
M01 command when the control reads an M01 command. It will then perform like an M00.
Optional stops are useful when machining the first part to allow for inspection of the
part as it is machined.
Starts the spindle CLOCKWISE for most machining. Must have a spindle speed defined.
M03 The M03 is used to turn the spindle on at the beginning of program or after a tool
change.
M04 Starts the spindle COUNTERCLOCKWISE. Must have a spindle speed defined.
D t f le
M05 STOPS the spindle. If the coolant is on, the M05 will turn it off.

n
M08 Coolant ON command.
M09 Coolant OFF command.
p

io
M10 Open Chuck
M11 Close Chuck
no m
tr r
M12 Tailstock Quill IN

ut
is o
M13 Tailstock Quill OUT

M17 Turret Indexing Forward


Sa

M18 Turret Indexing Reverse


ib
M19 Spindle Orientation

M21 Tailstock Forward

M22 Tailstock Backward

M23 Thread Gradual pullout ON

M24 Thread Gradual pullout OFF

M30 Program End and Reset to the beginning of program.

M41 Low Gear selection


M42 Medium Gear selection 1
M43 Medium Gear selection 2
M44 High Gear selection
NOTE: On the Haas lathe only one "M" code can be used in each block. The "M" codes will be the last
command executed in a line, regardless of where it's located in that block.

TK-Lathe Lesson 2 - 5
Page 11
RAPID G00 AND LINEAR G01 INTERPOLATION

G00 RAPID TRAVERSE


This code is used for rapid motion of the tool in air to traverse from one position to another as fast
as possible. This code will work for both axis motions at once.
This G00 code is modal and causes all the following blocks to be in rapid (up to 1000 in./min.)
motion until another Group 01 code is specified, for example G01 linear interpolation.
Generally, rapid motions "will not" be in a straight line. All the axes specified are moved at the
maximum speed and will not necessarily complete each axis move at the same time. It activates
each axis drive motor independently of each other and, as a result, the axis with the shortest move
will reach its destination first. So you need to be careful of any obstructions to avoid with this type
of rapid move.
D t f le
G00 is used when you are positioning the tool in fresh air.

n
Retracting from a hole you have drilled.
Rapid traverse is not used when cutting the part.
p

io
Used incorrectly, rapid traverse will break a tool very easily and possibly remove the part
no m

from the chuck.


tr r
ut
is o
G01 LINEAR INTERPOLATION
Sa

This G code provides for straight line (linear) motion with programmed feedrate for all axis motions
ib
from point to point. Motion can occur with both axes at once.
All axes specified will start at the same time and proceed to their destination and arrive
simultaneously at the specified feedrate.
To program a feedrate, the F command is used. The F command is modal and may be specified in a
previous block.
G01 is used for
Drilling a hole
Turning a diameter
Machining a profile I.D and O.D.
Grooving I.D and O.D.

TK-Lathe Lesson 2 - 6
Page 12
EXAMPLE OF PROGRAM START-UP BLOCKS

N10 G18 G20 G40 G54 G80 G97 G99


Many programs have a G code default line or Safety Block at the beginning of the program, this is
to ensure the machine control is in a safe start condition before proceeding with the program. If
the previous program had failed to cancel certain function this Safety Block would help ensure
that the new program starts with the appropriate settings.

For example the G codes below would perform the following at the start of the program:

G18 - ZX Plane Selection


G20 - Inch Programming
G40 - Cancel Tool Nose Compensation
D t f le
G54 - Work Offset Command
G80 - Cancels Canned Cycles

n
G97 - Constant Non-Varying Spindle Speed
p
G99 - Feed Per Revolution

io
no m
tr r
MACHINE DEFAULTS
ut
is o
When the machine tool is powered on the control automatically recognizes a series of codes. On
Sa

the Haas lathe the G codes listed below are set when the lathe is powered up:
ib
G00 Rapid Traverse
G18 XZ Circular Plane Selection
G40 Cutter Compensation Cancel
G54 Work Coordinate Zero #1
G64 Exact Stop Cancel
G80 Canned Cycle Cancel
G97 Constant Surface Speed Cancel
G99 Feed Per Revolution

TK-Lathe Lesson 2 - 7
Page 13
EXAMPLE OF PROGRAM START-UP BLOCKS
% Programs must begin and end with %
(depending on the type of control.)
O00023 Letter O and up to a five digit program number.

Nnn - Sequence Number


G18 - ZX Plane Selection
N10 G18 G20 G40 G20 - Verify Inch
G40 Tool Nose Radius Compensation Safety
Cancel Startup
Block
G80 - Canned Cycle Cancel
G97 - Constant Non-Varying Spindle
N20 G80 G97 G99
Speed
D t f le
G99 - Feed Per Revolution

n
T0100 - Tool number #1 to be loaded into the
N30 T0100 M41 cutting position with no offset call.
p

io
M41 Select low gear if required

G97 - constant surface speed off / revolution per


no m
tr r
N40 G97 S500 M03 minute on spindle speed is set to 500 RPM
ut M03 - Starts the spindle in a clockwise direction
is o
Sa

G00 Rapid feed engagement.


G54 - Select Coordinate System #1
ib
G41 Tool nose radius compensation to the left of
the programmed tool path.
X2.0 Tool will rapid to a position of 1.0 units from
N50 G00 G54 G41 X2.0 Z0.3 T0101 M08 center line of part.
Z0.3 Tool will rapid to a position 0.3 units from
finished face of part (finished face of part is usually
set to Z0).
T0101 Confirms tool #1 and assigns offset #1
M08 Start coolant pump

G96 - Constant surface speed on. Spindle will turn


at S450 surface feet per minute. Surface speed is
N60 G96 S450 determined by adjusting the spindle speed based on
the radius of cut.
S450 - Cutting speed selection of 450 ft/min.

TK-Lathe Lesson 2 - 8
Page 14
EXAMPLE OF PROGRAM ENDING BLOCKS

G00 - Rapid Traverse


U0.05 Rapids tool 0.05 incrementally above last X position
N200 G00 U0.05 W0.05
W0.05 Rapids tool 0.05 incrementally away from last Z
position
N210 M05 M05 Turn off spindle

G28 - Machine Zero Return


N220 G28 U0.
U0 - X axis in the up direction to
Send to machine
machine zero
zero X-axis first to
avoid any crash.
G28 - Machine Zero Return
N230 G28 W0.
W0 - Z axis to machine zero
D t f le

n
N240 M30 M30 End of Program and Reset
p

io
no m
tr r
Note:
ut
Depending on the setup of the lathe and to avoid any crashes while returning to machine zero it is
is o
usually best to move to machine zero in only one axis first. You need to be aware of where the tool
Sa

is located and on its journey to machine zero, will it collide with anything?
ib

TK-Lathe Lesson 2 - 9
Page 15
MOVING TO MACHINE ZERO G28 and G53

G28 - FANUC RETURN TO MACHINE ZERO THROUGH REFERENCE POINT


The G28 code is used to return to the machine zero position on all axes. If you program G28 on its
own the machine will move in the X and Z axis simultaneously to machine zero.

To command only the turret to return to machine zero, and not the tailstock if one is being used,
program in G28 U0 W0 to send only the X and Z axes home and the tailstock will remain in place.

G00 G28 X3.00 Z2.00


The above command would position the tool from the current position to the absolute position of
X3.00 and Z2.00, and then to the X and Y axis machine zero point. This is a movement through an
absolute intermediate point. This can be used as a way to move to a clearance point and then
return to machine zero.
D t f le

n
Haas has a G53 program code that works similar to G28.
Example:
p
G53 G00 X-2.0 Z-4.0

io
The machine will move negative 2.0 inches from the machine zero position in the X axis, and
negative 4.0 inches from home position in the Z axis.
no m
tr r
ut
G53 G00 X0 Z0
is o
This block will send the turret to machine Zero.
Sa

ib

TK-Lathe Lesson 2 - 10
Page 16
G40, G41, & G42 TOOL NOSE COMPENSATION

When a program is created it is done so using the inserts command or reference point (see figure
below). Tool Nose Compensation is used to offset the tool by a distance that will bring the cutting
edge of the insert to the proper position in relation to the specific radius of the insert being used.
The radius of the tool must be input into the controller and it will calculate the proper offset known
as Tool Nose Compensation.

G40 TOOL COMPENSATION CANCEL

G40 will cancel the G41 or G42 tool compensation commands that are in effect at the time.

G41 TOOL COMPENSATION LEFT (BORING)


G41 will select tool compensation to the LEFT of the contouring direction; generally G41 is used for
boring. The tool is compensated for the radius of the tool tip. The value of the compensation (tool
D t f le
radius) must be entered in the controller registry during set-up.

n
G42 TOOL COMPENSATION RIGHT (TURNING)
p

io
G42 will select tool compensation to the RIGHT of the contouring direction; generally G42 is used
for turning. The tool is compensated for the radius of the tool tip. The value of the compensation
no m

(tool radius) must be entered in the controller registry during set-up.


tr r
ut
is o
Sa

ib

TK-Lathe Lesson 2 - 11
Page 17
Page 18
Sa
no m
D t f le p
is o

TK-Lathe Lesson 2 - 12
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-3
DRILLING
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 19
LESSON-3 CENTER DRILL & DRILLING

CENTER DRILLING

Before most drilling operations take place a starting drill must be programmed to make a small
hole for the larger drill that will follow. The tool used to make the starting hole is known as a
center drill, sizes of center drills vary and the use of the different sizes is governed by the size of the
drill that will be used after. The following is a chart that will assist in choosing the proper size of
the center drill and programming the correct Z depth.

D t f le

n
p

io
no m
tr r
ut DRILL POINT LENGTH
is o
Sa

On most engineering drawings the finished depth of the hole will be given from the front edge of
the part to the end of the parallel part of the hole (not including the drill point). This poses a
ib
programming problem because we program from the point of the drill so any Z depth we specify
has to include the length of the drill point. To do this we have a calculation to perform based on
the diameter of the drill and the angle of the drill point (usually 118). Quite simply the
calculation is as follows:
Drill Point Length = Diameter x Constant
Where DIA. refers to the drill diameter and the constant is stated in the following chart
DRILL ANGLE CONSTANTS
60= 0.866 110= 0.350
75= 0.652 118= 0.300
80= 0.596 120= 0.289
82= 0.575 135= 0.207
90= 0.500 150= 0.134
100= 0.420 180= 0.000

TK-Lathe Lesson 3 - 2
Page 20
DRILLING ON CENTRELINE EXAMPLE

D t f le
Material: Al. 6061
CS= 700 ft/min

n
Tool #8 (#4 CENTRE DRILL) FACE MUST BE CENTRE DRILLED BEFORE DRILLING
p
Tool #11 ( 0.25 DRILL) DRILL HOLE 0.75 DEEP Z ZERO RIGHT FACE OF PART

io
Spindle Speed RPM = 4xCS/D= Feed = in/min
%
no m
tr r
O00084 (PROGRAM NAME, CENTRE DRILL AND DRILLING EXERCISE)
N3G18 G20 G40 G54 G80 G97 G99 (SAFETY BLOCK)
ut
is o
N5T0800 M41 (C/DRILL TOOL CALL NO OFFSETS AND GEAR RANGE)
N9S2500 M03 (START SPINDLE, CLOCKWISE ROTATION)
Sa

N11G00 X0 Z1.0 T0808 M08 (X CENTRE OF PART, Z SAFE DISTANCE FROM FRONT FACE OF PART)
N13Z0.05 (RAPID TO 0.05 FROM FRONT FACE OF THE PART, NON-CUTTING MOVE)
N15G98 (FEEDRATE PER MINUTE)
ib
N17G01 Z- 0.269 F15.0 (FEED TOOL TO C'DRILL DEPTH, FEEDRATE=15.0" / MIN.)
N19G00 Z.1 (RAPID RETRACT)
N21G00 X0 Z1.0 (T0800 RAPID TO ORIGINAL START POSITION)
N23G28 U0 M09 (SEND TOOL TO HOME POSITION IN X AXIS)
N25G28 W0 (SEND TOOL TO HOME POSITION IN Z AXIS)
N27M01 (OPTIONAL STOP)
N29T1100 M41 (0.25 DRILL TOOL CALL NO OFFSETS AND GEAR RANGE)
N33S2000 M03 (START SPINDLE,CLOCKWISE ROTATION)
N35G00 X0 Z1.0 T1111 M08 (X CENTRE OF PART, Z SAFE DISTANCE FROM FRONT FACE)
N37Z0.05 (RAPID TO 0.05 FROM FRONT FACE OF THE PART, NON-CUTTING MOVE)
N39G01 Z-0.375 F15.0 (1st PECK FEED TOOL TO DRILL DEPTH, FEEDRATE=15.0" / MIN. )
N41G00 Z.05 (RAPID RETRACT TO CLEAR CHIPS)
N43Z-.35 (RAPID BACK INTO HOLE)
N45G01 Z-0.825 (2nd PECK FEED TOOL TO DRILL DEPTH)
N47G00 Z.05 (RAPID RETRACT OUT OF HOLE)
N49 G00 X0 Z1.0 T1111 (RAPID TO ORIGINAL START POSITION)
N51G28 U0. (SEND TOOL TO HOME POSITION IN X AXIS)
N53G28 W0. (SEND TOOL TO HOME POSITION IN Z AXIS)
N55M30 (PROGRAM END)
%

TK-Lathe Lesson 3 - 3
Page 21
LESSON-3 DRILL CANNED CYCLE G81

G80 CANCEL CANNED CYCLE


A canned cycle permits multiple function programming on one block.
A canned cycle is canceled with G80.

G81 CANNED CYCLE DRILL

Format: G81 X0 Z-0.625 R0.1 F10.


X Rapid X location (Optional)
Z Z-depth (Optional - Feed to Z-depth starting from R Plane)
R R-Plane (Rapid point to start feeding)
F Feed rate
D t f le
This G code permits the inclusion of multiple axis motions on one block of program. It is used to

n
reduce the length of program.
p
All Z axis motions are in ABSOLUTE with any other axis motions unaffected.

io
In a canned cycle drill, the cutter moves at rapid to the X and Z axis specified, then to a Z value in
no m

front of the hole at rapid rate to the R Plane, which is a point clear of the work piece. From the R
tr r
ut
Plane the drill feeds to the Z-depth at the specified feedrate. When the cutter reaches the Z depth, it
is o
retracts at rapid rate to the R Plane.
Sa

Example of G81:
ib
%
O00187 (G81 Drilling)
N1 G28 (Return to Machine Zero)
N2 T101 (1/2 DIA. DRILL - Tool 1 Offset 1)
N3 G97 S1500 M03
N4 G54 G00 X0. Z1. M08 (Rapid to Initial Start Point)
N5 G81 Z-0.625 R0.1 F0.005 (G81 Drilling Cycle)
N6 G80 G00 Z1. M09
N7 G28
N8 M30
%

TK-Lathe Lesson 3 - 4
Page 22
DEEP HOLE PECK DRILL CANNED CYCLE G83

G83 DEEP HOLE PECK DRILL CANNED CYCLE


Format : G83 Z-2.5 Q0.5 R0.1 F10.
X* Rapid X-axis location
Z Z-depth (feed to Z-depth starting from R plane)
W* Incremental Z-depth (feeding to Z-depth starting from R-plane)
Q* Pecking equal incremental depth amount (if I, J and K are not used)
I* Size of first peck depth (if Q is not used)
J* Amount reducing each peck after first peck depth (if Q is not used)
K* Minimum peck depth (if Q is not used)
P Dwell time at Z-depth
R R-plane (rapid point to start feeding)
F Feed rate in inches (mm) per minute
D t f le
* Indicates optional

n
This G code is similar to G81 but is used for drilling when the tool must be withdrawn periodically
p
to allow chips to be removed from the hole.

io
This cycle allows the tool to rapid to the R Plane, feeds towards the Z depth in increments
no m
tr r
(traversing to the R Plane and back to the point where drilling was interrupted after each

ut
increment) until the tool reaches the final Z depth.
is o
Sa

ib

TK-Lathe Lesson 3 - 5
Page 23
DEEP HOLE PECK DRILL CANNED CYCLE G83

Example of G83 using Q to define peck amount:


In the example below Q is set to 0.2.

When using G83 to peck drill a hole every pass will cut in by the Q amount 0.2, then rapid out to the
R plane to clear chips and then rapid into hole for the next Q peck amount until Z depth is reached.
%
O00121 (G83 Peck Drilling)
N1 G28
N2 T303 (1/2 DIA. DRILL - Tool 3 Offset 3)
N3 G97 S1900 M03
N4 G54 G00 X0. Z1. M08 (Rapid to Initial Start Point)
N5 G83 Z-1.5 Q0.2 R0.1 F0.005 (G83 Peck Drilling Cycle with Q)
N6 G80 G00 Z1. M09
D t f le
N7 G28
N8 M30

n
%
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 3 - 6
Page 24
DRILLING ON CENTRELINE - LESSON-3 - EXERCISE #1

D t f le
Material: Al. 6061
CS= ft/min

n
CREATE A DRILLING PROGRAM USING G83
Tool #8 (#4 CENTRE DRILL) FACE MUST BE CENTRE DRILLED BEFORE DRILLING
p

io
Tool #11 ( 0.25 DRILL) DRILL HOLE 0.75 DEEP Z ZERO RIGHT FACE OF PART
Spindle Speed RPM = 4xCS/D= Feed = in/min
no m
tr r
Depth of Peck = Total Distance traveled/# of Pecks = # of pecks = 4
ut
is o
%
O891 (LESSON-3-EXERCISE 1, CENTRE DRILL AND DRILLING EXERCISE)
Sa

N1 G18 G20 G40 G54 G80 G97 G99 (SAFETY BLOCK)


N3 T0800 M41 (C/DRILL TOOL CALL NO OFFSETS AND GEAR RANGE)
ib
N5 S2500 M03 (START SPINDLE, CLOCKWISE ROTATION)
N7 G00 X0 Z1.0 T0808 M08 (X CENTRE OF PART, Z SAFE DISTANCE FROM FRONT FACE OF PART)
N9 Z0.1 (RAPID TO 0.1 FROM FRONT FACE OF THE PART, NON-CUTTING MOVE)
N11 G98 (FEEDRATE PER MINUTE)
N13 G81 Z- 0.269 R0.1 F7.0 (G81 DRILLING CYCLE)
N15 G80 G00 X0 Z1.0 (CANCEL CYCLE RAPID TO ORIGINAL START POSITION)
N17 G28 U0 M09 (SEND TOOL TO HOME POSITION IN X AXIS)
N19 G28 W0 (SEND TOOL TO HOME POSITION IN Z AXIS)
N21 M01 (OPTIONAL STOP)
N23 T1100 M41 (0.25 DRILL TOOL CALL NO OFFSETS AND GEAR RANGE)
N25 S2000 M03 (START SPINDLE,CLOCKWISE ROTATION)
N27 G00 X0 Z1.0 T1111 M08 (X CENTRE OF PART, Z SAFE DISTANCE FROM FRONT FACE)
N29 Z0.1 (RAPID TO 0.1 FROM FRONT FACE OF THE PART, NON-CUTTING MOVE)
N31 G83 Z-1.495 Q0.375 R0.1 F10.0 (G83 PECK DRILLING CYCLE WITH Q)
N33 G80 G00 X0 Z1.0 T1111 (RAPID TO ORIGINAL START POSITION)
N35 G28 U0. (SEND TOOL TO HOME POSITION IN X AXIS)
N37 G28 W0. (SEND TOOL TO HOME POSITION IN Z AXIS)
N39 M30 (PROGRAM END)

TK-Lathe Lesson 3 - 7
Page 25
Page 26
Sa
no m
D t f le p
is o

TK-Lathe Lesson 3 - 8
tr r
ib
ut
io
n
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-4
LINEAR INTERPOLATION
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 27
RAPID G00 AND LINEAR G01 INTERPOLATION

G00 RAPID TRAVERSE


This code is used for rapid motion of the tool in air to traverse from one position to another as fast
as possible. This code will work for both axis motions at once.
This G00 code is modal and causes all the following blocks to be in rapid (up to 1000 in./min.)
motion until another Group 01 code is specified, for example G01 linear interpolation.
Generally, rapid motions "will not" be in a straight line. All the axes specified are moved at the
maximum speed and will not necessarily complete each axis move at the same time. It activates
each axis drive motor independently of each other and, as a result, the axis with the shortest move
will reach its destination first. So you need to be careful of any obstructions to avoid with this type
of rapid move.
D t f le
G00 is used when you are positioning the tool in fresh air.

n
Retracting from a hole you have drilled.
Rapid traverse is not used when cutting the part.
p

io
Used incorrectly, rapid traverse will break a tool very easily and possibly remove the part
no m

from the chuck.


tr r
ut
is o
G01 LINEAR INTERPOLATION
Sa

This G code provides for straight line (linear) motion with programmed feedrate for all axis motions
ib
from point to point. Motion can occur with both axes at once.
All axes specified will start at the same time and proceed to their destination and arrive
simultaneously at the specified feedrate.
To program a feedrate, the F command is used. The F command is modal and may be specified in a
previous block.
G01 is used for
Drilling a hole
Turning a diameter
Machining a profile I.D and O.D.
Grooving I.D and O.D.

TK-Lathe Lesson 4 - 2
Page 28
FACING

FACING
After a work piece has been loaded into a lathe the first operation should be to face the end of the
part to make it flat. This will allow the later turning and boring operations to start the cut without
having a sometimes large interrupted cut due to an uneven face. There are fixed or canned cycles
that can be programmed to do this but for now we will talk about manually programming this
operation.
A safe starting position away from the Outside Diameter (OD) of the rough material should
be determined, as well as from the uneven front face of the raw material (X and Z).
Depth of the face cut should be made from the safe position to the Z position required,
then program the X cut along the face as linear interpolation.
D t f le
If the material has a rough bore the X coordinate for facing should be programmed a

n
sufficient amount smaller than the Inside Diameter (ID) of the bore, as there is no need to
go to X0 this will eliminate fresh air cutting.
p

io
Dont forget the overcut! The usual amount of the overcut is not much more than the
no m

radius of the facing insert, if too much overcut is programmed damage to the insert itself
tr r
may occur due to rubbing of the cutting edge on the material.
ut
is o
PROGRAMMING EXAMPLE FACING STOCK DIAMETER 1.375
Sa

%
O43 (Program number)
ib
N1 G20 (Verify inch units)
N2 G40 G54 G80 G97 G99 (Safety block)
N3 T0100 M41 (Tool call T01 with gear selection)
N4 G50 S1200 (Specify maximum RPM to 1200)
N5 G97 S500 M03 (Start spindle 500 RPM CW)
N6 G00 G54 X1.7 Z0.25 T0101 M08 (Rapid to X1.7 Z0.25 safe position)
N7 G96 S700 (Specify constant surface speed 700 SFM)
N8 G01 Z0 F0.012 (Feed to Z0 finish front face of part)
N9 X-0.05 (Program tool to X-0.05 overcut by 0.05)
N10 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N11 G00 X1.7 Z0.25 (Rapid back to safe position)
N12 G28 U0 (Return to X machine home position)
N13 G28 W0 M05 (Return to Z machine home position)
N14 M01 (Optional stop)
N15 T0100 (Tool offset compensation canceled)
N16 M30 (Program End)
%

TK-Lathe Lesson 4 - 3
Page 29
FACING EXAMPLE

Example program to only face rough material (shown as a dashed line 1.625 diameter)
This example takes 2 face passes The first rough face pass 0.005 away from the finish face.
For the second finish pass face at Z0. Z0 = finished face of part. Tool T01 is being used.
D t f le
%

n
O43 (Program number)
N1 G20 (Verify inch units)
p

io
N3 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 M41 (Tool call T01 with gear selection)
no m
tr r
N7 G50 S1200 (Specify maximum RPM to 1200)
ut N9 G97 S500 M03 (Start spindle 500 RPM CW)
is o
N11 G00 G54 X1.7 Z0.25 T0101 M08 (Rapid to Safe position, coolant on)
Sa

N13 G96 S700 (Specify constant surface speed 700 SFM)


ib
N15 G99 G01 Z0.005 F0.012 (G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 X 1.5 (Rapid out for second finish facing cut)
N23 Z0 (Move to Z Zero for final facing cut)
N25 G01 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N27 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N29 G00 X1.7 Z0.25 M09 (Rapid back to safe position, coolant off)
N31 G28 U0 (Return to X machine home position)
N33 G28 W0 M05 (Return to Z machine home position)
N34 T0100 (Tool offset compensation canceled)
N35 M30 (Program End)
%

TK-Lathe Lesson 4 - 4
Page 30
LINEAR ROUGH TURNING EXAMPLE

D t f le

n
p

io
no m
tr r
ut
is o
LINEAR ROUGH TURNING EXAMPLE - ROUGHING TOOLPATH
This Example program faces the front of the part, one rough cut, one finish cut.
Sa

After facing the front of the bar stock the diameters are rough turned, leaving a small amount of
material for a finish pass.
ib
For this example a maximum cut of 0.25 off the diameter is being taken, leaving 0.03 on the
diameter and 0.005 on all Z faces. A finishing pass will be programmed in the next exercise.
The bar stock is 1.5 diameter
X0 is centerline of the part, Z0 is the front face (far right) of the part
All X positions are diameter, all Z positions past the front face are Z-
After facing the tool is retracted in X&Z (U&W) a small amount (0.05) then rapids to the X diameter
of the first Z feed across the rough OD of the part.
The tool is once again retracted in X&Z (U&W) then rapids back to a safe position in Z, and then
brought to the next position in X diameter for the next feed across and so on.
The 0.0625 x 45 chamfers will be added later in the finishing tool path
In this example the rough turning passes will machine past the left end of the part by 0.2. The
reason for this is to remove material prior to the parting off operation; this will leave less material
for the parting tool to remove.

TK-Lathe Lesson 4 - 5
Page 31
LINEAR ROUGH TURNING EXAMPLE
%
O00081 (PROGRAM NAME, ROUGH TURNING EXERCISE)
N1 G20 (Verify inch units)
N3 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 M41 (Tool call T01 with gear selection)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.7 Z0.25 T0101 M08 (Rapid to Safe position, tool nose compensation (TNC), coolant on)
N13 G96 S600 (Specify constant surface speed 600 SFM)
N15 G99 G01 Z0.005 F0.010 (Feed to Z0.01 0.01 from finish front face of part G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 X1.7 (Rapid out for second finish facing cut)
N23 Z0 (Move to Z Zero for final facing cut)
N25 G01 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N27 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
D t f le
N29 G00 X1.7 Z0.25 (Rapid back to safe position for start of rough turning)
N31 G96 S700 (Constant surface speed engaged at 700 SFM)

n
N33 G42 X1.405 (Move to the first X diameter cutting position, TNC right)
N35 G01 Z-2.2 (Feed to full length of part plus another 0.2 to allow for the parting tool)
p
N37 U0.05 W0.05 (Retract off part in feed mode)

io
N39 G00 Z0.25 (Rapid to safe position in front of part)
N41 X1.250 (Move to the second X diameter cutting position)
no m

N43 G01 Z-1.495 (Feed to length of 0.5" shoulder, leaving 0.005 for finish)
tr r
N45 U0.05 W0.05 (Retract off part in feed mode)
ut
is o
N47 G00 Z0.25 (Rapid to safe position in front of part)
N49 X1.0 (Move to the third X diameter cutting position)
Sa

N51 G01 Z-1.495 (Feed to length of 0.5" shoulder, leaving 0.005 for finish on z)
N53 U0.05 W0.05 (Retract off part in feed mode)
ib
N55 G00 Z0.25 (Rapid to safe position in front of part)
N57 X0.905 (Move to the fourth X diameter cutting position, plus 0.030" on 0.875"
diameter)
N59 G01 Z-1.495 (Feed to length of 0.5" shoulder, leaving 0.005 for finish)
N61 U0.05 W0.05 (Retract off part in feed mode)
N63 G00 Z0.25 (Rapid to safe position in front of part)
N65 X0.655 (Move to the fifth X diameter cutting position, plus 0.030" on 0.625"
diameter)
N67 G01 Z-0.370 (Feed to length of 0.375" shoulder, leaving 0.005 for finish on Z)
N69 U0.05 W0.05 (Retract off part in feed mode)
N71 G00 Z0.25 (Rapid to safe position in front of part)
N73 G40 G00 X1.7 Z0.25 (Cancel TNC offset, rapid to original start position)
N75 G28 U0 (Rapid to X machine home position)
N77 G28 W0 M05 (Rapid to Z machine home position)
N79 M30 (Program end)
%

TK-Lathe Lesson 4 - 6
Page 32
LINEAR FINISH TURNING EXAMPLE

CONTOUR THE FINISH PROFILE


In the previous Example the part was rough turned, now we will add the finishing tool path to the
rouging program. The continuation of this program is show below
The first part of the program rough turns the part and then a tool change takes place to load up the
finish tool
The tool used to finish the contour will be a carbide insert with a 0.032 tool nose radius - Tool # 2

D t f le

n
p

io
no m
tr r
(End of roughing tool path on previous page - continue finish cut here)

ut
N73 G40 G00 X1.7 Z0.25 (Cancel tool nose radius offset, rapid to original start position)
is o
N75 G28 U0 (Rapid to x machine home position)
Sa

N77 G28 W0 M05 (Rapid to z machine home position)


ib
N79 T0202 (O.D. Right Hand Finishing Tool 55)

N81 G50 S3500 (Specify maximum RPM to 3500)

N83 G97 S800 M03 (Start spindle 800 RPM CW)


N85 G00 G42 G54 X1.7 Z0.25 T0202 M08 (Rapid to Safe position, TNC, coolant on)
N87 G96 S700 (Specify constant surface speed 700 SFM)
N89 G99 G01 X 0.5125 Z0.05 F0.006 (Feed to Z0.05 from finish front face of part & 0.05 below chamfer)
N91 X0.625 Z-0.0625 (Cut chamfer at front of part)
N93 Z-0.375
N95 X0.875
N97 Z-1.5
N99 X1.3125
N101 X1.375 Z-1.5625 (Cut chamfer at left of part)
N103 Z-2.2

TK-Lathe Lesson 4 - 7
Page 33
LINEAR FINISH TURNING EXAMPLE - CONTINUED

D t f le
N105 X1.625

n
N107 G00 Z0.25 (Rapid to safe position in front of part)
p
N109 G40 G00 X1.7 Z0.25 (Cancel tool nose radius offset, rapid to original start position)

io
N111 G28 U0 (Rapid to X machine home position)
no m

N113 G28 W0 M05 (Rapid to Z machine home position)


tr r
ut
N115 M30 (Program end)
is o
%
Sa

ib

TK-Lathe Lesson 4 - 8
Page 34
LINEAR INTERPOLATION - LESSON-4 - EXERCISE #1

PROFILE TURNING and DRILLING EXERCISE


Use the previous sample programs as a guide to complete the part shown below
Z Zero is at the right face of the part
Make from 1.5 diameter bar stock.

D t f le

n
p

io
no m
tr r
ut
is o
Sa

Material: Alum T6061


ib

TK-Lathe Lesson 4 - 9
Page 35
%
O49 (LESSON 4 EXERCISE #1)
(Face Front of Part one cut)
N1 G20 (Verify inch units)
N3 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 (Tool call T01)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.5 Z0.25 T0101 M08 (Rapid to Safe position, tool nose compensation- TNC, coolant on)
N13 G96 S600 (Specify constant surface speed 600 SFM)
N15 G99 G01 Z0 F0.010 (Feed to Z0.01 0.01 from finish front face of part G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 G40 X1.5 Z0.25 (Rapid back to safe position for start of rough turning)
(Rough Turn)
N23 X1.480
N25 G01 Z-2.2
N27 U0.05 W0.05
D t f le
N29 G00 Z0.25 (Rapid to safe position in front of part)
N31 X1.375

n
N33 G01 Z-1.745
N35 U0.05 W0.05
p
N37 G00 Z0.25 (Rapid to safe position in front of part)

io
N39 X1.25
N41 G01 Z-1.745
no m

N43 U0.05 W0.05


tr r
N45 G00 Z0.25 (Rapid to safe position in front of part)
ut
N47 X1.125
is o
N49 G01 Z-1.745
Sa

N51 U0.05 W0.05


N53 G00 Z0.25 (Rapid to safe position in front of part)
N55 X1.030
ib
N57 G01 Z-1.745
N59 U0.05 W0.05
N61 G00 Z0.25 (Rapid to safe position in front of part)
N63 X0.905
N65 G01 Z-0.870
N67 U0.05 W0.05
N69 G00 Z0.25 (Rapid to safe position in front of part)
N71 X0.750
N73 G01 Z-0.370
N75 U0.05 W0.05
N77 G00 Z0.25 (Rapid to safe position in front of part)
N79 X0.625
N81 G01 Z-0.370
N83 U0.05 W0.05
N85 G00 Z0.25 (Rapid to safe position in front of part)
N87 X0.530
N89 G01 Z-0.370
N91 U0.05 W0.05

TK-Lathe Lesson 4 - 10
Page 36
N93 G00 Z0.25 (Rapid to safe position in front of part)
N95 G40 G00 X1.5 Z0.25 (Cancel TNC offset, rapid to original start position)
N97 G28 U0 (Rapid to X machine home position)
N99 G28 W0 M05 (Rapid to Z machine home position)
(Finish Cut)
N101 T0202 (O.D. Right Hand Finishing Tool 55)
N103 G50 S3500 (Specify maximum RPM to 3500)
N105 G97 S800 M03 (Start spindle 800 RPM CW)
N107 G00 G42 G54 X1.5 Z0.25 T0202 M08 (Rapid to Safe position, TNC, coolant on)
N109 G96 S700 (Specify constant surface speed 700 SFM)
N111 G99 G01 X 0.4187 Z0.05 F0.006 (Feed to Z0.05 from finish front face of part & 0.05 below chamfer)
N113 X0.5 Z-0.0312 (Cut chamfer at front of part)
N115 Z-0.375
N117 X0.875
N119 Z-0.875
N121 X1.0 Z-1.5
N123 Z-1.75
N125 X1.45
D t f le
N127 Z-2.2
N129 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)

n
N131 G00 Z0.25 (Rapid to safe position in front of part)
N133 G40 G00 X1.5 Z0.25 (Cancel TNC offset, rapid to original start position)
p
N135 G28 U0 (Rapid to X machine home position)

io
N137 G28 W0 M05 (Rapid to Z machine home position)
(Centre Drill - G81 Canned Cycle Drill)
no m

N139 T0800 (Tool call T08)


tr r
N141 G50 S3500 (Specify maximum RPM to 3500)
ut
N143 G97 S2500 M03 (Start spindle 2500 RPM CW)
is o
N145 G00 G54 X1.5 Z0.25 T0808 M08 (Rapid to Safe position,coolant on)
Sa

N147 G00 X0 Z0.25


N149 G98 G81 Z-0.2 R0.1 F7.0 (G81 Drilling Cycle)
N151 G80
ib
(Drill 1/4" - G83 Canned Cycle Peck Drill)
N153 G28
N155 T1111 (1/4 DIA. DRILL - Tool 11)
N157 G97 S2500 M03
N159 G00 G54 X1.5 Z0.25 T1111 M08 (Rapid to Safe position,coolant on)
N161 G00 X0 Z0.25
N163 G98 G83 Z-0.825 Q0.25 R0.1 F10.0
N165 G80
N167 G28
N169 M30 (Program end)
%

TK-Lathe Lesson 4 - 11
Page 37
LINEAR INTERPOLATION - LESSON-4 - EXERCISE #1
EXAMPLE OF CUT-OFF
The program below shows how the Lesson-4 Exercise #1 part would be cut-off using a parting tool.

D t f le

n
p

io
no m
tr r
(CUT OFF)
ut
is o
N137 T404 (Cut-Off Tool 0.118 wide)
Sa

N139 G97 S191 M03 (Start spindle 191 RPM CW)


N141 G00 X1.7 Z0.25 M8 (Rapid to safe position in front of part, Coolant on)
ib
N143 G50 S3000 (Specify maximum RPM to 3500)
N145 G96 S200 (Specify constant surface speed 200 SFM)

N147 Z-2.0 (Rapid move to Z-2.0, end of part)


N149 X1.6 (Rapid move to X1.6, clearance away from part)
N150 G99 (Feed Rate Per Revolution)
N151 G01 X-0.02 F0.002 (Feed to X-0.02 past center of part)
N153 G00 X1.7 (Rapid move to X1.7, clearance away from part)
N155 G28 U0 (Rapid to X machine home position)
N157 G28 W0 M05 (Rapid to Z machine home position)
N169 M30 (Program end)
%

TK-Lathe Lesson 4 - 12
Page 38
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
LESSON-5
TURNING CANNED CYCLES

Page 39
LESSON 5 - TURNING CANNED CYCLES G71, G72 and G70

G71-G72 ROUGH TURNING CYCLE


A canned cycle, which permits multiple function programming in one code, is very helpful to the
programmer for ease of programming and more compact programs.
The G71 cycle allows for rough turning in the Z- direction (towards the chuck)
The G72 cycle allows for rough facing in the X- direction (towards the centerline of the part)

G71 CANNED CYCLE TWO LINE FORMAT


Format: G71 U___ R___
G71 P___ Q___ U___ W___ F___S___
First G71 block
U Depth of roughing cut
D t f le
R Amount of retract after each cut
Second G71 block

n
P First block number of finish contour
Q Last block number of finish contour
p

io
U Amount of stock left for finish operation (diameter) X axis
W Amount of stock left on all faces for finish operation Z axis
no m

F Feed rate in inches or mm /rev.


tr r
S Spindle speed in ft or m /min.
ut
is o
G72 CANNED CYCLE TWO LINE FORMAT
Sa

Format: G72 W___ R___


G72 P___ Q___ U___ W___ F___S___
ib
First G71 block
U Depth of roughing cut
R Amount of retract after each cut
Second G71 block
P First block number of finish contour
Q Last block number of finish contour
U Amount of stock left for finish operation (diameter) X axis
W Amount of stock left on all faces for finish operation Z axis
F Feed rate in inches or mm /rev.
S Spindle speed in ft or m /min.

TK-Lathe Lesson 5 - 2
Page 40
LESSON 5 - TURNING CANNED CYCLES G71

G71 CANNED CYCLE HAAS

ONE LINE FORMAT

G71 O.D./I.D. STOCK REMOVAL CYCLE

The type described below is a TYPE I geometry path and is when the X-axis of the programmed path
does not change direction. This type of path is called monotonic.

Format: G71 P___ Q___ U___ W___ F___S___

P First block number of finish contour


Q Last block number of finish contour
D t f le
U* Finish stock remaining with direction (+or -), X-axis diameter value
W* Finish stock remaining with direction (+or -), Z-axis value

n
I* Last pass amount with direction (+or -), X-axis radius value
K* Last pass amount with direction (+or -), Z-axis value
p

io
D* Depth of cut stock removal each pass, positive radius value (Setting 72)
F Roughing passes feed rate throughout this cycle
R1* YASNAC type II roughing (only if setting 33 is on Yasnac)
no m
tr r
S** Spindle speed in this cycle
T**
ut
Tool and offset in this cycle
is o
* Indicates optional
Sa

** Rarely defined in a G71 line


ib

TK-Lathe Lesson 5 - 3
Page 41
LESSON 5 - FINISHING CANNED CYCLE G70

G70 FINISH TURNING/BORING CANNED CYCLE


Format : G70 P__ Q__ F__ S__
P= First block number of the finish contour
Q= Last block number of the finish contour
F= Cutting feedrate for the finishing (overrides the feed in roughing contour)
S= spindle speed (overrides speed in roughing contour)

This canned cycle is used after the roughing canned cycle is finished. It does not have to be run
directly after the roughing cycle but can be run in the same main program. The start and finish
blocks of the original definition of the profile that was used in the rough cycle are used to define
the contour of the finish cycle. It is recommended that the same start point is used for both rough
and finish cycles to ensure safe tool paths of both operations.
D t f le

n
TYPICAL O.D. FINISH CANNED CYCLE
p

io
N37 T0500 M42 (OD FINISH TOOL & GEAR SEL.)
N38 G96 S500 M03 (CSS. SPEED)
no m

N39 G42 X__ Z__ T0505 M08 (TOOL COMPENSATION & START POS.)
tr r
N40 G70 P11 Q19 F12.0 (CALL LINES FOR FINISH COORDS)
ut
N41 G00 G40 X__ Z__ T0100
is o
N42 M01
Sa

TYPICAL I.D. FINISH CANNED CYCLE


ib
N43 T0700 M42 (ID FIN TOOL & GEAR SEL.)
N44 G96 S475 M03 (CSS. SPD)
N45 G00 G41 X__ Z__ T0707 M08 (TOOL COMPENSATION & START POS.)
N46 G70 P27 Q34 F12.0 (CALL LINES FOR FIN. COORDS)
N47 G00 G40 X__ Z__ T0700
N48 M01

TK-Lathe Lesson 5 - 4
Page 42
LESSON 5 EXAMPLE - ROUGH AND FINISH TURNING CANNED CYCLES
In the previous lesson the part shown below was programmed as an exercise, the program in the
previous lesson did not use canned cycles to rough the diameters. In this example program the part
will be programmed using canned cycle G71 to rough the diameters of the part and G70 to Finish
machine the contour
Z Zero is at the right face of the part
The part is being made from 1.5 diameter bar stock
This Example program faces the front of the part, then a series of rough cuts and one finish cut.
After facing the front of the bar stock the diameters are rough turned, leaving a small amount of
material for a finish pass.
For this example a maximum cut of 0.1 off the diameter is being taken, leaving 0.03 on the diameter
and 0.005 on all Z faces.
In this example the rough turning passes will machine past the left end of the part by 0.2. The
reason for this is to remove material prior to the parting off operation; this will leave less material
for the parting tool to remove
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Material:
Alum T6061

TK-Lathe Lesson 5 - 5
Page 43
LESSON 5 EXAMPLE - ROUGH AND FINISH TURNING CANNED CYCLES
%
O49 (Roughing Cycle Example - Lesson-5)
(Face Front of Part one cut)
N1 G20 (Verify inch units)
N3 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 (Tool call T01)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.7 Z0.25 T0101 M08 (Rapid to Safe position, TNC, coolant on)
N13 G96 S700 (Specify constant surface speed 700 SFM)
N15 G99 G01 Z0 F0.010 (Feed to Z0.01 0.01 from finish front face of part G99=Feed per revolution)
D t f le
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)

n
N21 G00 G40 X1.7 Z0.25 (Rapid back to safe position for start of rough turning)
p
(Rough Turn O.D.)

io
N23 G71 P25 Q47 U0.03 W0.005 D0.1 F0.010 (G71 Rough Turning Cycle)
no m

N25 G00 G42 X0.4187 (P and G42 With the start of Geometry)
tr r
N27 G99 G01 X 0.4187 Z0.05 F0.006 (Feed to Z0.05 from finish front face of part & 0.05 below chamfer)
ut
is o
N29 X0.5 Z-0.0312 (Cut chamfer at front of part)
Sa

N31 Z-0.375
N33 X0.875
ib
N35 Z-0.875
N37 X1.0 Z-1.5
N39 Z-1.75
N41 X1.45
N43 Z-2.2
N45 X1.6
N47 G40 G00 X 1.7 (Q End of Geometry. Machine off of part and cancel compensation)
N49 G00 X1.7 Z0.25 (Rapid back to safe position)
N51 G28 U0 (Rapid to X machine home position)
N53 G28 W0 M05 (Rapid to Z machine home position)

TK-Lathe Lesson 5 - 6
Page 44
LESSON 5 EXAMPLE - ROUGH AND FINISH TURNING CANNED CYCLES
(Finish Cut)
N55 T0202 (O.D. Right Hand Finishing Tool 55)
N57 G50 S3500 (Specify maximum RPM to 3500)
N59 G97 S800 M03 (Start spindle 800 RPM CW)
N61 G00 G42 G54 X1.7 Z0.25 T0202 M08 (Rapid to Safe position, TNC, coolant on)
N63 G96 S700 (Specify constant surface speed 700 SFM)
N65 G70 P25 Q47 ( G70 Finishing OD)
N67 G28 U0 (Rapid to X machine home position)
N69 G28 W0 M05 (Rapid to Z machine home position)
(Centre Drill - G81 Canned Cycle Drill)
N71 T0600 (Tool call T08)
D t f le
N73 G50 S3500 (Specify maximum RPM to 3500)
N75 G97 S2500 M03 (Start spindle 2500 RPM CW)

n
N77 G00 G54 X1.7 Z0.25 T0606 M08 (Rapid to Safe position, coolant on)
p
N79 G00 X0 Z0.25

io
N81 G98 G81 Z-0.269 R0.1 F7.0 (G81 Drilling Cycle)
no m

N83 G80
tr r
N85 G28
ut
is o
(Drill 1/4" - G83 Canned Cycle Peck Drill)
Sa

N87 T0707 (1/4 DIA. DRILL - Tool 07)


N89 G97 S2500 M03
ib
N91 G00 G54 X1.7 Z0.25 T0707 M08 (Rapid to Safe position, coolant on)
N93 G00 X0 Z0.25
N95 G98 G83 Z-0.825 Q0.125 R0.1 F10.0
N97 G80
N99 G28
N101 M30 (Program end)
%

TK-Lathe Lesson 5 - 7
Page 45
LESSON 5 - EXAMPLE - ROUGH AND FINISH BORING CANNED CYCLES

D t f le

n
p

io
Material: Aluminium
no m

CS=700ft/min
tr r
1. 1/2 diameter drill has already been used to drill though the part, front face has been faced
ut
is o
2. Example shows below the Rough and Finish Boring Tool path using the above drawing
3. Use G71 (Roughing Towards The Chuck In Z Axis) G70 for finish cut
Sa

4. Leave 0.010 on diameters, Leave 0.003 on faces for finish cut


1. Spindle Speed RPM = 4xCS/D=________ 1. Feed =0.003 in per rev
ib
1. Depth of Cut=0.030

%
O67 (Roughing and Finishing Cycles - Boring)
N1 G20 (Verify inch units)
N3 G40 G54 G80 G97 G99 (Safety block)
N5 T0800 (Tool call T08 - Rough Boring Tool)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 X1.7 Z0.25 T0808 M08 (Rapid to Safe position, coolant on)
N13 G96 S700 (Specify constant surface speed 700 SFM)
N15 X0.490 Z0.1

TK-Lathe Lesson 5 - 8
Page 46
LESSON 5 - EXAMPLE - ROUGH AND FINISH BORING CANNED CYCLES

(Rough Bore)
N17 G71 P19 Q31 U-0.01 W0.005 D0.03 F0.005 (G71 Rough Turning Cycle)
N19 G00 G41 X0.875 Z0.1 (P and G41 With the start of Geometry)
N21 G01 Z-0.25
N23 X0.625
N25 Z-0.5
N27 X0.52
N29 Z-0.65 (Bore past end of part)
N31 G40 X0.49 (Q End of Geometry)
(Finish Cut Same Boring Tool)
N33 G96 S800 (Specify constant surface speed 800 SFM)
D t f le
N35 G70 P19 Q31 F0.004 (G70 Finishing OD)

n
N37 G00 Z0.25 (Rapid to safe position in front of part)
N39 G28 U0 (Rapid to X machine home position)
p

io
N41 G28 W0 M05 (Rapid to Z machine home position)
N43 M30 (Program end)
no m
tr r
%

ut
is o
Sa

ib

TK-Lathe Lesson 5 - 9
Page 47
LESSON 5 - TOOL TIP ORIENTATION
Toolpaths are programmed using the coordinates of the true profile, much like a mill but because there are
many possible positions of the tool point called the command point or Tool Tip Orientation. You have to
enter the position from
1-9 in the tool (T) column on the offset page during part set-up.

D t f le

n
p

io
no m
tr r
ut
These are the eight possible tool positions, the ninth position is a neutral one, sometimes used when no tool
is o
offset is needed.
Sa

ib
Once the tool position has been determined, the position is entered as the appropriate number in the chart
below in the T column. This chart is only a graphic representation of a lathe offset page.

TOOL # X Y R T
1
2
3
4
5
TK-Lathe Lesson 5 - 10
Page 48
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-6
CIRCULAR INTERPOLATION
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 49
CIRCULAR INTERPOLATION G02 & G03

G03 (CCW) U.125 W-.125 I0 K-.125 F15.0

G02 (CW) U.25 W-.25 I.25 K0 F15.0

D t f le

n
p

io
XZ PLANE
G02 U.25 W-.25 I 0.25 K0 F15.
no m

Clockwise Arc End Point Incremental Distance Feed rate 15 in/min


tr r
(optional incremental) from the tool start point to the center of arc
ut
is o
G03 U.125 W-.125 I 0. J-.125 F15.
Counter Arc End Point Incremental Distance Feed rate 15 in/min
Sa

Clockwise (optional incremental) from the tool start point to the center of arc
When the machine is required to move in a straight line under a controlled federate, linear interpolation is
ib
used (G01). When it is necessary to travel in the circular motion in any plane (XY, YZ, XZ), circular
interpolation is used (G02, G03).

The velocity at which the tool is moving is controlled by the feed rate (F) command.

All circular interpolation moves are defined and machined by programming three pieces of information into
the control.

1. DIRECTION OF TRAVEL: CLOCKWISE G02, COUNTER CLOCKWISE G03

2. ARC END POINT: X AXIS, Z AXIS

3. ARC CENTER: INCREMENTAL DISTANCE FROM START POINT TO ARC CENTER (I AND K)

TK-Lathe Lesson 6 - 2
Page 50
LESSON-6 EXERCISE #1 CIRCULAR INTERPOLATION-OD

D t f le

n
p

io
WORK OUT ALL THE VALUES
no m


tr r
When programming lathe coordinates only the top half of the part needs to be profiled,

ut
because the part is turning around, the full round part is machined.
is o
Dont forget to program in diameters and double the radii to calculate diameter positions
The front finished face is Z0.
Sa

Note that when programming fillets and radii for turning, most of the time it is easier to do
so incrementally (U and W).
ib
POSITION X U Z W I K
1 0 - 0 - - -
2 0.250 0
3 0.375 0.0625 -0.0625 -0.0625 0 -0.0625
4 0.375 -0.3125
5 0.500 -0.375 0.0625 0
6 0.625 -0.4375 0 -0.0625
7 0.625 -1.250
8 1.125 -1.500 0.25 0
9 1.375 -1.625 0 -0.125
10 1.375 -2.000

TK-Lathe Lesson 6 - 3
Page 51
LESSON-6 EXERCISE #1 CIRCULAR INTERPOLATION-OD (CONT.)
Contour the profile as shown on the previous page.
Start from machine home and rapid to a safe zone.
Face the front of the part, dont forget the overcut!
Program the contour using the above coordinates as a guide.
Material: Aluminum 6061 & Use appropriate Spindle Speed and Feedrate.
%
O63 (PROGRAM NUMBER)
N1 G20 (VERIFY INCH MODE)
N2 G18 G40 G80 G99 (SAFETY LINE WITH FEED AS INCH\REV.)
N3 G0 T0202 (TOOL CALL)
N4 G50 S3500 (SET MAX. SPEED AT 3500 RPM)
N5 G97 S____ M03 (START SPINDLE ____ RPM CLOCKWISE ROTATION)
N6 G00 G54 G41 X___Z___ T0202 M08 (TOOL NOSE RADIUS OFFSET, SAFE POSITION ,
COOLANT ON)
D t f le
N7 G96 S___ (CONSTANT SURFACE SPEED ENGAGED)

n
N8 G1 X-.05 F.008 (FEED TO X0 + OVERCUT)
N9 G0 Z.1 (PULL OFF FROM PART)
p

io
N10 G01 G42 X0.2 (FEED TO X0.2 ACTIVATE TOOL NOSE RADIUS OFFSET)
N11 G01 Z0 F___ (FEED INTO FRONT FACE TO Z0)
no m
tr r
N12 X___ (FEED UP FRONT FACE TO START OF FIRST RADIUS)
ut
is o
N13 G03 X___ Z___ K___ (CUT FIRST RADIUS)
N14 G01 Z___ (FEED ALONG 0.375 DIA.)
Sa

N15 G02 X__ Z___ I___ (CUT FIRST FILLET)


ib
N16 G03 X___Z___ K___ (CUT SECOND RADIUS)
N17 G01 Z___ (FEED ALONG 0.625 DIA.)
N18 G02 X___Z___ I___ (CUT SECOND FILLET)
N19 G03 X___ Z___ K___ (CUT THIRD RADIUS)
N20 G01 Z___ (FEED ALONG FINAL DIA. 0.2 PAST END OF PART)
N21 U0.1 (PART PULL OFF INCREMENTAL)
N22 G00 G40 X___ Z___ T0202 M09 (RAPID TO SAFE ZONE)
N23 G28 U0. (RAPID TO Z MACHINE HOME POSITION)
N24 G28 W0. M05. (RAPID TO X MACHINE HOME POSITION)
N25 M30 (PROGRAM END)
%

TK-Lathe Lesson 6 - 4
Page 52
LESSON-6 EXERCISE #2 CIRCULAR INTERPOLATION

ON THE FOLLOWING PAGES, CREATE A PROGRAM TO:


1. FACE.
2. TURN OUTSIDE DIAMETER ONE CUT.
3. DRILL 0.5 DIAMETER.
4. ROUGH AND FINISH THE BORE USING CANNED CYCLES AS USED IN LESSON 5.
5. CUT-OFF.
6. Z ZERO IS THE FRONT FACE OF THE PART
7. USE THE LESSON 6 VIDEOS TO GUIDE YOU THROUGH THE PROGRAMMING PROCESS.
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 5
Page 53
LESSON-6 EXERCISE #2 CIRCULAR INTERPOLATION - DRAWING

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 6
Page 54
LESSON-6 EXERCISE #2 CIRCULAR INTERPOLATION

D t f le

n
p

io
no m
tr r
ut
is o
USE THE CHART BELOW TO WORK OUT THE COORDINATES OF THE TOOL AS IT MOVES AROUND
THE BORE.
Sa

I = INCREMENTAL DISTANCE ALONG THE X-AXIS FROM THE TOOL START POINT TO THE CENTER OF
ARC (ARC PIVOT POINT)
ib
K = INCREMENTAL DISTANCE ALONG THE Z-AXIS FROM THE TOOL START POINT TO THE CENTER OF
ARC (ARC PIVOT POINT)

POSITION X U Z W I K
1
2
3
4
5
6
7
8
9 Please refer to Lesson 6 Exercise
10 #2.NC program on following pages
11
for co-ordinates.
12

TK-Lathe Lesson 6 - 7
Page 55
LESSON-6 EXERCISE #2 CIRCULAR INTERPOLATION

D t f le

n
p

io
no m
tr r
ut
is o
PROGRAMMING NOTE
Sa

BEFORE MACHINING A BORE IN A SOLID PIECE OF STOCK A HOLE WILL HAVE TO BE DRILLED TO
ib
ALLOW THE BORING BAR TO DO ITS JOB.

COORDINATES TO DRILL
POSITION X U Z W
1 0
2
3
Please refer to Lesson 6 Exercise
#2.NC program on following pages
for co-ordinates.

TK-Lathe Lesson 6 - 8
Page 56
LESSON-6 EXERCISE #2 CIRCULAR INTERPOLATION
%
O193(Face and Drill and bore - Lesson-6-Ex-2)
(Face Front of Part - Turn OD one cut)
N1 G20 (Verify inch units)
N3 G18 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 (Tool call T01)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.7 Z0.25 T0101 M08 (Rapid to Safe position, TNC, coolant on)
N13 G96 S700 (Specify constant surface speed 700 SFM)
N15 G99 G01 Z0 F0.010 (Feed to Z0. G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 G40 X1.25 Z0.25
N23 G01 G42 X1.095 Z0 F0.005
N25 G03 X1.115 Z-0.010 R0.01
D t f le
N27 G01 Z-0.8
N29 X1.15

n
N31 G40 G00 X 1.7
N33 G28 U0 (Rapid to X machine home position)
p
N35 G28 W0 (Rapid to Z machine home position)

io
(Drill 1/2" - G83 Canned Cycle Peck Drill)
no m

N37 T0707 (1/2 DIA. END MILL - Tool 07)


tr r
N39 G97 S2500 M03
ut
is o
N41 G00 G54 X1.7 Z0.25 T0707 M08 (Rapid to Safe position,coolant on)
N43 G00 X0 Z0.25
Sa

N45 G98 G83 Z-0.80 Q0.05 R0.1 F4.0


N47 G80
ib
N49 G28

(Roughing and Finishing Cycles - Boring - Pre Drilled Hole 0.5")


N51 T0800 (Tool call T08 - Rough Boring Tool 0.008" TIP RADIUS)
N53 G50 S3500 (Specify maximum RPM to 3500)
N55 G97 S500 M03 (Start spindle 500 RPM CW)
N57 G00 X1.7 Z0.25 T0808 M08 (Rapid to Safe position,coolant on)
N59 G96 S700 (Specify constant surface speed 700 SFM)
N61 G99
N63 G00 X0.490 Z0.1

(Rough Bore)
N65 G71 P67 Q91 U-0.01 W0.005 D0.03 F0.005 (G71 Rough Turning Cycle)
N67 G00 G41 X1.075 Z0.1 (P and G41 With the start of Geometry)
N69 G01 Z0
N71 G02 X0.875 Z-0.1 I0 K-0.1
N73 G01 Z -0.210
N75 G03 X0.795 Z-0.25 I-0.04 K0

TK-Lathe Lesson 6 - 9
Page 57
LESSON-6 EXERCISE #2 CIRCULAR INTERPOLATION

N77 G01 X0.760


N79 G02 X0.700 Z-0.280 I0 K-0.03
N81 G01 Z-0.335
N83 G03 X0.620 Z-0.375 I-0.04 K0
N85 G01 X0.600
N87 G02 X0.540 Z-0.405 I0 K-0.03
N89 G01 Z-0.665 (Bore past end of part)
N91 G40 X0.49 (Q End of Geometry)

(Finish Cut Same Boring Tool)


N93 G96 S800 (Specify constant surface speed 800 SFM)
N95 G70 P67 Q91 F0.004 ( G70 Finishing OD)
N97 G00 Z0.25 (Rapid to safe position in front of part)
N99 G28 (Rapid to machine home position)
D t f le
(CUT OFF)
N101 G00 T404

n
N103 G97 S191 M03
N105 G00 X1.7 Z0.25 M8
p
N107 G50 S3000

io
N109 G96 S200
N111 Z-0.625
no m

N113 X1.3
tr r
N115 G01 X0.450 F0.002
ut
N117 G00 X1.250
is o
N119 G28 (Rapid to machine home position)
Sa

N121 M30 (Program end)


%
ib

TK-Lathe Lesson 6 - 10
Page 58
Sa
no m
D t f le p
is o

TK-Lathe Lesson 6 - 11
tr r
ib
ut
io

Page 59
n
LESSON-6 EXERCISE #3 CIRCULAR INTERPOLATION

ON THE FOLLOWING PAGES, CREATE A PROGRAM TO:


1. FACE.
2. ROUGH TURN OUTSIDE DIAMETER ONE CUT USING CANNED CYCLES.
3. FINISH TURN OUTSIDE DIAMETER ONE CUT USING CANNED CYCLES.
4. DRILL 0.5 DIAMETER.
5. ROUGH AND FINISH THE BORE USING CANNED CYCLES AS USED IN LESSON 5.
6. CUT-OFF.
7. Z ZERO IS THE FRONT FACE OF THE PART
8. USE THE LESSON 6 VIDEOS TO GUIDE YOU THROUGH THE PROGRAMMING PROCESS.
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 12
Page 60
LESSON 6 EXERCISE #3 G02/G03 - DRAWING

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 13
Page 61
LESSON-6 EXERCISE #3 CIRCULAR INTERPOLATION

D t f le

n
p

io
no m
tr r
ut
is o
USE THE CHART BELOW TO WORK OUT THE COORDINATES OF THE TOOL AS IT MOVES AROUND
THE BORE.
Sa

I = INCREMENTAL DISTANCE ALONG THE X-AXIS FROM THE TOOL START POINT TO THE CENTER OF
ARC (ARC PIVOT POINT)
ib
K = INCREMENTAL DISTANCE ALONG THE Z-AXIS FROM THE TOOL START POINT TO THE CENTER OF
ARC (ARC PIVOT POINT)

POSITION X U Z W I K
1
2
3
4
5
6
7
8
9 Please refer to Lesson 6 Exercise
10 #3.NC program on following pages
11
for co-ordinates.
12

TK-Lathe Lesson 6 - 14
Page 62
LESSON 6 EXERCISE #3 G02/G03

D t f le

n
p

io
no m
tr r
ut
is o
PROGRAMMING NOTE
Sa

BEFORE MACHINING A BORE (ID) IN A SOLID PIECE OF STOCK A HOLE WILL HAVE TO BE DRILLED TO
ALLOW THE BORING BAR TO DO ITS JOB.
ib
COORDINATES TO DRILL
POSITION X U Z W
1 0
2
3

Please refer to Lesson 6 Exercise


#3.NC program on following pages
for co-ordinates.

TK-Lathe Lesson 6 - 15
Page 63
LESSON 6 EXERCISE #3 G02/G03 (CONT.)
%
O187 (Face, Rough & Finish OD - Drill and Bore - Lesson-6-Ex-3)
(Face Front of Part one cut)
N1 G20 (Verify inch units)
N3 G18 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 (Tool call T01)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.7 Z0.25 T0101 M08 (Rapid to Safe position, TNC, coolant on)
N13 G96 S700 (Specify constant surface speed 700 SFM)
N15 G99 G01 Z0 F0.010 (Feed to Z0. G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 G40 X1.125 Z0.25

(Rough Turn O.D.)


D t f le
N23 G71 P25 Q43 U0.010 W0.005 D0.1 F0.010
N25 G01 G42 X1.030 (P and G42 With the start of Geometry)

n
N27 Z0
N29 G03 X1.050 Z-0.010 R0.01
p
N31 G01 Z-0.475

io
N33 G02 X1.100 Z-0.5 R0.025
N35 G01 X1.105
no m

N37 G03 X1.115 Z-0.505 R0.005


tr r
N39 G01 Z-0.8
ut
is o
N41 X1.15
N43 G40 G00 X 1.7 (Q End of Geometry)
Sa

N45 G00 X1.7 Z0.25 (Rapid back to safe position)


N47 G28 U0 (Rapid to X machine home position)
ib
N49 G28 W0 M05 (Rapid to Z machine home position)

(Finish Cut)
N51 T0202 (O.D. Right Hand Finishing Tool 55)
N53 G50 S3500 (Specify maximum RPM to 3500)
N55 G97 S800 M03 (Start spindle 800 RPM CW)
N57 G00 G42 G54 X1.7 Z0.25 T0202 M08 (Rapid to Safe position, TNC, coolant on)
N59 G96 S700 (Specify constant surface speed 700 SFM)
N61 G70 P25 Q43 F0.004 ( G70 Finishing OD)
N63 G28 U0 (Rapid to X machine home position)
N65 G28 W0 M05 (Rapid to Z machine home position)

TK-Lathe Lesson 6 - 16
Page 64
LESSON 6 EXERCISE #3 G02/G03 (CONT.)
(Drill 1/2" - G83 Canned Cycle Peck Drill)
N69 T0707 (1/2 DIA. END MILL - Tool 07)
N71 G97 S2500 M03
N73 G00 G54 X1.7 Z0.25 T0707 M08 (Rapid to Safe position,coolant on)
N75 G00 X0 Z0.25
N77 G98 G83 Z-0.8 Q0.05 R0.1 F4.0
N79 G80
N81 G28

(Roughing and Finishing Cycles - Boring - Pre Drilled Hole 0.5")


N83 T0800 (Tool call T08 - Rough Boring Tool 0.008" TIP RADIUS)
N85 G50 S3500 (Specify maximum RPM to 3500)
N87 G97 S500 M03 (Start spindle 500 RPM CW)
N89 G00 X1.7 Z0.25 T0808 M08 (Rapid to Safe position,coolant on)
N91 G96 S700 (Specify constant surface speed 700 SFM)
D t f le
N93 G99
N95 X0.490 Z0.1

n
(Rough Bore)
p
N97 G71 P99 Q123 U-0.01 W0.005 D0.02 F0.003 (G71 Rough Turning Cycle)

io
N99 G00 G41 X1.0 (P and G41 With the start of Geometry)
N101 G01 Z0
no m

N103 G02 X0.900 Z-0.05 I0 K-0.05


tr r
N105 G01 Z -0.2
ut
is o
N107 G03 X0.800 Z-0.25 I-0.05 K0
N109 G01 X0.750
Sa

N111 G02 X0.7 Z-0.275 R0.025


N113 G01 Z-0.450
ib
N115 G03 X0.600 Z-0.50 I-0.05 K0
N117 G01 X0.590
N119 G02 X0.540 Z-0.525 R0.025
N121 G01 Z-0.665 (Bore past end of part)
N123 G40 X0.49 (Q End of Geometry)

(Finish Cut Same Boring Tool)


N125 G96 S800 (Specify constant surface speed 800 SFM)
N127 G70 P99 Q123 F0.002 (G70 Finishing ID)
N129 G00 Z0.25 (Rapid to safe position in front of part)
N131 G28 U0 (Rapid to X machine home position)
N133 G28 W0 M05 (Rapid to Z machine home position)

TK-Lathe Lesson 6 - 17
Page 65
LESSON 6 EXERCISE #3 G02/G03 (CONT.)
(CUT OFF)
N135 G00 T404
N137 G97 S191 M03
N139 G00 X1.7 Z0.25 M8
N141 G50 S3000
N143 G96 S200
N145 Z-0.625
N147 X1.3
N149 G01 X0.450 F0.002
N151 G00 X1.250
N153 G28 U0 (Rapid to X machine home position)
N155 G28 W0 M05 (Rapid to Z machine home position)
N157 M30 (Program end)
%
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 18
Page 66
LESSON-6 EXERCISE #4 CIRCULAR INTERPOLATION

ON THE FOLLOWING PAGES, CREATE A PROGRAM TO:


1. FACE.
2. ROUGH TURN OUTSIDE DIAMETER ONE CUT USING CANNED CYCLES.
3. FINISH TURN OUTSIDE DIAMETER ONE CUT USING CANNED CYCLES.
4. DRILL 0.5 DIAMETER.
5. ROUGH AND FINISH THE BORE USING CANNED CYCLES AS USED IN LESSON 5.
6. CUT-OFF.
7. Z ZERO IS THE FRONT FACE OF THE PART
8. USE THE LESSON 6 VIDEOS TO GUIDE YOU THROUGH THE PROGRAMMING PROCESS.
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 19
Page 67
LESSON 6 EXERCISE #4 G02/G03 TURNING AND BORING - DRAWING

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 20
Page 68
LESSON 6 EXERCISE #4 G02/G03 TURNING AND BORING

D t f le

n
p

io
no m
tr r
ut
is o
Sa

PROGRAMMING NOTE
ib
BEFORE MACHINING A BORE (ID) IN A SOLID PIECE OF STOCK A HOLE WILL HAVE TO BE DRILLED TO
ALLOW THE BORING BAR TO DO ITS JOB.

COORDINATES TO DRILL
POSITION X U Z W
1 0
2
3
Please refer to Lesson 6 Exercise
#4.NC program on following pages
for co-ordinates.

TK-Lathe Lesson 6 - 21
Page 69
LESSON 6 EXERCISE #4 G02/G03 TURNING AND BORING
%
O1345 (Face, Rough & Finish OD - Drill and Bore - Lesson-6-Ex-4)

(Face Front of Part one cut)


N1 G20 (Verify inch units)
N3 G18 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 (Tool call T01)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.7 Z0.25 T0101 M08 (Rapid to Safe position, TNC, coolant on)
N13 G96 S700 (Specify constant surface speed 700 SFM)
N15 G99 G01 Z0 F0.010 (Feed to Z0. G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 G40 X1.125 Z0.25
D t f le
(Rough Turn O.D.)
N23 G71 P25 Q47 U0.03 W0.005 D0.1 F0.010

n
N25 G99 G01 G42 X0.965 (P and G42 With the start of Geometry)
N27 Z0
p
N29 G03 X0.975 Z-0.005 R0.005

io
N31 G01 Z-0.125
N33 X1.025 Z-0.25
no m

N35 Z-0.470
tr r
N37 G02 X1.085 Z-0.5 R0.03
ut
is o
N39 G01 X1.105
N41 G03 X1.115 Z-0.505 R0.005
Sa

N43 G01 Z-0.8


N45 X1.15
ib
N47 G40 G00 X 1.7 (Q End of Geometry)
N49 G00 X1.7 Z0.25 (Rapid back to safe position)
N51 G28 U0 (Rapid to X machine home position)
N53 G28 W0 M05 (Rapid to Z machine home position)

(Finish Cut)
N55 T0202 (O.D. Right Hand Finishing Tool 55)
N57 G50 S3500 (Specify maximum RPM to 3500)
N59 G97 S800 M03 (Start spindle 800 RPM CW)
N61 G00 G42 G54 X1.7 Z0.25 T0202 M08 (Rapid to Safe position, TNC, coolant on)
N63 G96 S700 (Specify constant surface speed 700 SFM)
N65 G70 P25 Q47 F0.004 ( G70 Finishing OD)
N67 G28 U0 (Rapid to X machine home position)
N69 G28 W0 M05 (Rapid to Z machine home position)

TK-Lathe Lesson 6 - 22
Page 70
LESSON 6 EXERCISE #4 G02/G03 (CONT)

(Drill 1/2" - G83 Canned Cycle Peck Drill)


N73 T0707 (1/2 DIA. END MILL - Tool 07)
N75 G97 S2500 M03
N77 G00 G54 X1.7 Z0.25 T0707 M08 (Rapid to Safe position,coolant on)
N79 G00 X0 Z0.25
N81 G98 G83 Z-0.8 Q0.05 R0.1 F4.0
N83 G80
N85 G28

(Roughing and Finishing Cycles - Boring - Pre Drilled Hole 0.5")


N87 T0800 (Tool call T08 - Rough Boring Tool 0.008" TIP RADIUS)
N89 G50 S3500 (Specify maximum RPM to 3500)
N91 G97 S500 M03 (Start spindle 500 RPM CW)
N92 G99
N93 G00 X1.7 Z0.25 T0808 M08 (Rapid to Safe position,coolant on)
N95 G96 S700 (Specify constant surface speed 700 SFM)
D t f le
N97 X0.490 Z0.1

n
(Rough Bore)
N99 G71 P101 Q125 U-0.01 W0.005 D0.02 F0.003 (G71 Rough Turning Cycle)
p

io
N101 G00 G41 X0.935 Z0.1 (P and G41 With the start of Geometry)
N103 G01 Z0
no m

N105 G02 X0.875 Z-0.03 I0 K-0.03


tr r
N107 G01 Z -0.075

ut
N109 G03 X0.775 Z-0.125 I-0.05 K0
is o
N111 G01 X0.740
N113 G02 X0.700 Z-0.145 I0 K-0.020
Sa

N115 G01 Z-0.200


N117 G03 X0.600 Z-0.250 I-0.05 K0
ib
N119 G01 X0.580
N121 G02 X0.540 Z-0.270 R0.02
N123 G01 Z-0.80 (Bore past end of part)
N125 G40 X0.49 (Q End of Geometry)

(Finish Cut Same Boring Tool)


N127 G96 S800 (Specify constant surface speed 800 SFM)
N129 G70 P101 Q125 F0.002 ( G70 Finishing ID)
N131 G00 Z0.25 (Rapid to safe position in front of part)
N133 G28 U0 (Rapid to X machine home position)
N135 G28 W0 M05 (Rapid to Z machine home position)

TK-Lathe Lesson 6 - 23
Page 71
LESSON 6 EXERCISE #4 G02/G03 (CONT)

(CUT OFF)
N137 G00 T404
N139 G97 S191 M03
N141 G00 X1.7 Z0.25 M8
N143 G50 S3000
N145 G96 S200
N147 Z-0.625
N149 X1.3
N151 G01 X0.450 F0.002
N153 G00 X1.250
N155 G28 U0 (Rapid to X machine home position)
N157 G28 W0 M05 (Rapid to Z machine home position)
N159 M30 (Program end)
%
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 6 - 24
Page 72
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
LESSON-7
TOOL NOSE COMPENSATION

Page 73
G40, G41, & G42 TOOL NOSE COMPENSATION
When a program is created it is done so using the inserts command or reference point (see figure
below). Tool Nose Compensation is used to offset the tool by a distance that will bring the cutting
edge of the insert to the proper position in relation to the specific radius of the insert being used.
The radius of the tool must be input into the controller and it will calculate the proper offset known
as Tool Nose Compensation.

G40 TOOL COMPENSATION CANCEL

G40 will cancel the G41 or G42 tool compensation commands that are in effect at the time.

G41 TOOL COMPENSATION LEFT (BORING)


G41 will select tool compensation to the LEFT of the contouring direction; generally G41 is used for
D t f le
boring. The tool is compensated for the radius of the tool tip. The value of the compensation (tool
radius) must be entered in the controller registry during set-up.

n
G42 TOOL COMPENSATION RIGHT (TURNING)
p

io
G42 will select tool compensation to the RIGHT of the contouring direction; generally G42 is used
for turning. The tool is compensated for the radius of the tool tip. The value of the compensation
no m
tr r
(tool radius) must be entered in the controller registry during set-up.

ut
is o
Sa

ib

TK-Lesson 7 - 2
Page 74
G40, G41, & G42 TOOL NOSE COMPENSATION
Tool Nose Compensation is used to offset the tool by a distance that will bring the cutting edge of
the insert to the proper position in relation to the specific radius of the insert being used.

The radius of the tool must be input into the CNC controller and it will calculate the proper offset
known as Tool Nose Radius Compensation.

G40 is Tool Nose Radius Compensation CANCEL


G41 is Tool Nose Radius Compensation LEFT of the programmed path
G42 is Tool Nose Radius Compensation RIGHT of the programmed path

The shift direction is based on the direction of the tool movement relative to the tool, and which
D t f le
side of the part it is on.

n
When thinking about which direction the compensated shift will occur in tool nose compensation,
imagine looking down the tool tip and steering the tool.
p

io
Tool nose compensation works by shifting the Programmed Tool Path to the right or to the left.
no m

The programmer will usually program the tool path to the finished size.
tr r
ut
When tool nose compensation is used, the CNC control will compensate for the radius of the insert
is o
based on instructions written into the program.
Sa

At the CNC machine Tool Nose Compensation accomplishes its job by reading ahead one or two
ib
blocks to determine how it must modify the current programmed block of code.

This is done, so that the control can calculate in advance, how to position around radiuses and
angles with a specified tool nose radius.

This is referred to as Block Look-A-head Or Look-Ahead Processing.

Tool nose compensation does not need to be used when the programmed cuts are solely along the
X axis (diameters) or Z axis (faces).

Cutter compensation comes into effect on angled cuts and radius cuts.

TK-Lesson 7 - 3
Page 75
EXAMPLE PROGRAM USING G42

EXAMPLE OF PROGRAMMING WITH TOOL NOSE RADIUS OFFSET


%
O73 (PROGRAM NAME, FINISH TURNING EXERCISE)
D t f le
N1 G20 (Verify inch units)

n
N3 G40 G54 G80 G97 G99 (Safety block)
p
N5 T0200 (O.D. Right Hand Finishing Tool 55)

io
N7 G50 S3500 (Specify maximum RPM to 3500)
no m

N9 G97 S800 M03 (Start spindle 800 RPM CW)


tr r
N11 G00 G42 G54 X1.5 Z0.25 T0202 M08 (Rapid to Safe position, TNC, coolant on)
ut
is o
N13 G96 S700 (Specify constant surface speed 700 SFM)
Sa

N15 G99 G01 X 0.5125 Z0.05 F0.006 (Feed to Z0.05 from finish front face of part & 0.05 below chamfer)
N17 X0.625 Z-0.0625 (Cut chamfer at front of part)
ib
N19 Z-0.375
N21 X0.875
N23 Z-1.5
N25 X1.3125
N27 X1.375 Z-1.5625 (Cut chamfer at left of part)
N29 Z-2.2
N31 X1.625
N33 G00 Z0.25 (Rapid to safe position in front of part)
N35 G40 G00 X1.5 Z0.25 (Cancel tool nose radius offset, rapid to original start position)
N37 G28 U0 (Rapid to X machine home position)
N39 G28 W0 M05 (Rapid to Z machine home position)
N41 M30 (Program end)
%

TK-Lesson 7 - 4
Page 76
EXAMPLE PROGRAM USING G41 - BORING

D t f le
EXAMPLE OF PROGRAMMING WITH TOOL NOSE RADIUS OFFSET - BORING

n
%
O1345 (G41 - Finishing - Boring - Pre Drilled Hole 0.5")
p

io
N1 G20 (Verify inch units)
N3 G18 G40 G54 G80 G97 G99 (Safety block)
no m
tr r
N5 T0800 (Tool call T08 - Boring Tool 0.008" TIP RADIUS)

ut
N7 G50 S3500 (Specify maximum RPM to 3500)
is o
N9 G97 S500 M03 (Start spindle 500 RPM CW)
Sa

N11 G99
ib
N13 G00 X1.7 Z0.25 T0808 M08 (Rapid to Safe position, coolant on)
N15 G96 S700 (Specify constant surface speed 700 SFM)
N17 X0.490 Z0.1
N19 G00 G41 X0.935 Z0.1
N21 G01 Z0
N23 G02 X0.875 Z-0.03 I0 K-0.03
N25 G01 Z -0.075
N27 G03 X0.775 Z-0.125 I-0.05 K0
N29 G01 X0.740
N31 G02 X0.700 Z-0.145 I0 K-0.020

TK-Lesson 7 - 5
Page 77
EXAMPLE PROGRAM USING G41 - BORING - CONTINUED

D t f le
N33 G01 Z-0.200

n
N35 G03 X0.600 Z-0.250 I-0.05 K0
N37 G01 X0.580
p

io
N39 G02 X0.540 Z-0.270 R0.02
N41 G01 Z-0.80 (Bore past end of part)
no m
tr r
N43 G40 X0.49
ut
is o
N45 G00 Z0.25 (Rapid to safe position in front of part)
N47 G28 U0 (Rapid to X machine home position)
Sa

N49 G28 W0 M05 (Rapid to Z machine home position)


ib
N51 M30 (Program end)
%

TK-Lesson 7 - 6
Page 78
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-8
GROOVING/PART-OFF
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 79
GROOVING

GROOVING
When a circular slot or groove is needed in a part a special shaped tool may be needed. A grooving
tool is the tool that is most commonly used. It comes in many shapes and sizes but usually has one
thing in common, which is that it feeds straight in along the X axis and plunges into the part. A
grooving tool is typically used to plunge into the part and make a groove around the part, but some
grooving inserts are designed to cut in the X and Z axis direction.

D t f le

n
p

io
no m
tr r
ut EXAMPLE OF PROGRAMMING A GROOVING OPERATION
is o
O0001400(TYPICAL GROOVING EXAMPLE)
Sa

N1 G20...
N90 T0900 M42 (TOOL CALL & GEAR SELECTION)
ib
N91 G97 S650 M03 (SET SPEED AND TURN CLOCKWISE)
N92 G00 X1.0 Z0.25 T0909 M08 (RAPID TO SAFE POSITION & PICK-UP OFFSETS)
N93 Z-0.375 (RAPID TO GROOVE POSITION)
N94 G01 X0.675 F0.004 (FEED TO GROOVE DEPTH)
N95 G04 P0.5 (DWELL 0.5 SECOND)
N96 X1.0 F0.05 (FAST FEED OUT)
N97 G00 W-0.375 (INCREMENTAL RAPID TO NEXT LOCATION)
N98 G01 X0.675 F0.004 (FEED TO GROOVE DEPTH)
N99 G04 P0.5 (DWELL 0.5 SECOND)
N100 X1.0 F0.05 (FAST FEED OUT)
N101 G00 X1.0 Z0.25 T0900 M09 (RAPID TO SAFE POSITION CANCEL OFFSETS)
N102 M01 (OPTIONAL STOP)

TK-Lathe Lesson 8 - 2
Page 80
PARTING-OFF

PARTING-OFF
Parting-off is very similar to grooving but instead of stopping at a required depth of groove, the
part-off tool is able to go right to the center of the part to allow the finished part to fall away from
the chuck of the lathe. The design of the tool may be similar but the intent is very different.

D t f le

n
p

io
no m
tr r
EXAMPLE OF PROGRAMMING A PART-OFF OPERATION
ut
is o
O0001400(TYPICAL PART-OFF EXAMPLE)
Sa

N1 G20...
N90 T0900 M42 (TOOL CALL & GEAR SELECTION)
ib
N91 G99 G97 S500 M03 ( FEED PER REV., SET SPEED(RPM) AND TURN CLOCKWISE)
N92 G00 X2.25 Z-2.0 T0909 M08 (RAPID TO SAFE POSITION & ACTIVATE OFFSET)
N93 G96 S200 (SET C.S.S. 200 SF\M)
N94 G01 X-0.05 F0.004 (FEED TO FINISH PART-OFF DEPTH)
N95 X2.25 F0.05 (FAST FEED OUT)
N96 G00 Z0.25 T0900 M09 (RAPID TO SAFE POSITION CANCEL OFFSETS)
N97 G28 W0 (RAPID TO MACHINE HOME Z)
N98 G28 U0 (RAPID TO MACHINE HOME X)
N102 M01 (OPTIONAL STOP)

TK-Lathe Lesson 8 - 3
Page 81
LESSON 8 GROOVING & PART OFF - EXAMPLE - DRAWING

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 8 - 4
Page 82
LESSON 8 GROOVING & PART OFF - EXAMPLE - MACHINING PROCESS

D t f le

n
p

io
no m
tr r
ut
is o
Sa

Machining Process
ib
1. Face.
2. Turn outside diameter one cut.
3. Groove two slots
4. Dwell at bottom of each grooving cut. This ensures a clean cut at the bottom of the groove.
5. Cut-off.
6. Z zero is the front face of the part
7. The grooving\part-off tool is 0.118 wide
8. Program right hand side of grooving\part-off tool
9. Machine to finish depth with every plunge
10. Material is 1.125 aluminum

TK-Lathe Lesson 8 - 5
Page 83
LESSON 8 GROOVING & PART OFF - EXAMPLE - PROGRAM
Face and Turn OD

D t f le

n
%
O186 (GROOVING & PART-OFF LESSON-8-EXAMPLE)
p

io
(FACE FRONT OF PART - TURN OD ONE CUT)
N1 G20 (VERIFY INCH MODE)
no m
tr r
N3 G18 G40 G54 G80 G97 G99 (SAFETY BLOCK)
ut
N5 T0100 (TOOL CALL T01)
is o
N7 G50 S3500 (SPECIFY MAXIMUM RPM TO 3500)
Sa

N9 G97 S500 M03 (START SPINDLE 500 RPM CW)


ib
N11 G00 G41 G54 X1.5 Z0.25 T0101 M08 (RAPID TO SAFE POSITION, TNC, ACTIVATE OFFSET,
COOLANT ON)
N13 G96 S700 (SPECIFY CONSTANT SURFACE SPEED 700 SFM)
N15 G99 G01 Z0 F0.010 (FEED TO Z0. G99=FEED PER REVOLUTION)
N17 X-0.05 (MOVE TOOL TO X-0.05, OVERCUT BY 0.05)
N19 U0.05 W0.05 (INCREMENTAL PULL OFF FROM PART FACE X0.05 Z0.05)
N21 G00 G40 X1.25 Z0.25 (RAPID TO SAFE POSITION, CANCEL TNC)
N23 G01 G42 X1.100 Z0.1 F0.005 (ACTIVATE TNC, FEED TO FINISH DIAMETER)
N25 G01 Z-1.375 (FEED TO LENGTH + 0.125)
N27 X1.15 (PULL OFF FROM PART AT FEED RATE)
N29 G40 G00 X 1.5 (CANCEL TNC)
N31 G28 U0 (RAPID TO X MACHINE HOME POSITION)
N33 G28 W0 (RAPID TO Z MACHINE HOME POSITION)

TK-Lathe Lesson 8 - 6
Page 84
LESSON 8 GROOVING & PART OFF - EXAMPLE - PROGRAM
Cut First Groove

D t f le

n
(CUT FIRST GROOVE - FIRST CUT)
p

io
(INSERT WIDTH = 0.118")
(PROGRAM RIGHT HAND SIDE OF GROOVING\PART-OFF TOOL)
no m

N35 G00 T404 (TOOL CALL T04, ACTIVATE OFFSET)


tr r
ut
N37 G97 S191 M03 (START SPINDLE 191 RPM CW)
is o
N39 G00 X1.5 Z0.25 M8 (RAPID TO SAFE POSITION, COOLANT ON)
Sa

N41 G50 S3000 (SPECIFY MAXIMUM RPM TO 3000)


N43 G96 S200 (SPECIFY CONSTANT SURFACE SPEED 200 SFM)
ib
N45 Z-0.250 (RAPID TO FIRST GROOVE POSITION)
N47 X1.2 (RAPID TO X1.2 CLEAR OF PART BY 0.05)
N49 G01 X0.750 F0.002 (FEED TO GROOVE DEPTH)
N51 G04 P2.0 (DWELL 2.0 SECONDS)
N53 X1.2 (FEED TO X1.2 CLEAR OF PART BY 0.05)
(CUT FIRST GROOVE - SECOND CUT)
N55 G00 Z-0.332 (SECOND CUT 0.45-0.118 INSERT WIDTH = 0.118")
N57 G01 X0.750 (FEED TO GROOVE DEPTH)
N59 G04 P2.0 (DWELL 2.0 SECONDS)
N61 X1.2 (FEED TO X1.2 CLEAR OF PART BY 0.05)

TK-Lathe Lesson 8 - 7
Page 85
LESSON 8 GROOVING & PART OFF - EXAMPLE - PROGRAM
Cut Second Groove

D t f le

n
p

io
no m
tr r
ut
is o
Sa

(CUT SECOND GROOVE - FIRST CUT)


(INSERT WIDTH = 0.118")
ib
(PROGRAM RIGHT HAND SIDE OF GROOVING\PART-OFF TOOL)
N63 G00 Z-0.875 (RAPID TO SECOND GROOVE POSITION)
N65 G01 X0.875 (FEED TO GROOVE DEPTH)
N67 G04 P2.0 (DWELL 2.0 SECONDS)
N69 X1.2 (FEED TO X1.2 CLEAR OF PART BY 0.05)
(CUT SECOND GROOVE - SECOND CUT)
N71 G00 Z-0.957 (SECOND CUT 0.875+0.20-0.118 INSERT WIDTH = 0.118")
N73 G01 X0.875 (FEED TO GROOVE DEPTH)
N75 G04 P2.0 (DWELL 2.0 SECONDS)
N77 X1.2 (FEED TO X1.2 CLEAR OF PART BY 0.05)

TK-Lathe Lesson 8 - 8
Page 86
LESSON 8 GROOVING & PART OFF - EXAMPLE - PROGRAM
Cut-Off

D t f le

n
p

io
no m
tr r
ut
is o
Sa

(CUT OFF)
N79 G00 Z-1.25 (RAPID TO CUT-OFF POSITION)
ib
N81 G01 X-0.05 F0.002 (FEED TO FINISH PART-OFF DEPTH)
N83 G00 X1.250 (RAPID TO X1.25 CLEAR OF PART)
N85 G28 (RAPID TO MACHINE HOME POSITION)
N87 M30 (PROGRAM END)
%

TK-Lathe Lesson 8 - 9
Page 87
HAAS G75 GROOVING CYCLE MULTIPLE PASS

N49 G75 X0.750 Z-0.332 I0.1 K0.03 F0.002

D t f le
X X-axis absolute pecking depth, diameter value
Z* Z-axis absolute location to the furthest peck

n
U* X-axis incremental pecking depth, diameter value
W* Z-axis incremental distance and direction (+or -) to the furthest peck
p

io
I* X-axis pecking depth increment, radius value
K* Z-axis shift increment between pecking cycles
no m

D* Tool shift amount when returning to clearance plane (Caution see NOTE)
tr r
F Feed rate
ut
is o
* Indicates optional
Sa

The G75 canned cycle can be used for grooving an outside diameter with the added bonus of a chip
ib
break. A small retract move while cutting the groove allows the chip to break.

The G75 cycle is non-modal.

With G75 either a single pecking cycle can be performed, as for a single groove, or a series of
pecking moves can be performed for multiple grooves. G75 can also be used to cut-off the part by
using the single pass options.

When a Z or W code is added to a G75 block and Z is not the current position, then a minimum of
two pecking cycles will occur, one at the current location and another at the Z location.
The K code is the incremental distance between Z axis pecking cycles. Adding a K will perform
multiple evenly spaced, pecking cycles between the starting position and Z.
When I is added to a G75 block, then pecking will be performed at each interval specified
by I, the peck is a rapid move opposite the direction of feed and the peck distance is obtained from
Setting 22 on the Haas control.

TK-Lathe Lesson 8 - 10
Page 88
HAAS G75 GROOVING CYCLE SINGLE PASS - FOR CUT-OFF

N61 G75 X-0.030 I0.1 F0.002

D t f le

n
p

io
no m
tr r
At block 61 the grooving canned cycle G75 is being used to cut-off the part at the end of the machining

ut
operations.
is o
The X-0.030 is the destination that the tool will arrive at along the X axis. This move is at a feed rate of
Sa

0.002 per revolution.


ib
In this block the I value is set to 0.1, this is the X-axis pecking depth increment, a radius value. As the
tool moves to the X position it will cut for 0.1 and then retract to break the chip. This retract move
is a small amount and on the Hass lathe is governed by Setting 22. The Hass lathe used in the
machining videos has Setting 22 set to 0.01

When the G75 cycle is complete it will return to the starting X position at rapid.

TK-Lathe Lesson 8 - 11
Page 89
G75 GROOVING CYCLE
LESSON 8 GROOVING & PART OFF - EXAMPLE - DRAWING

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 8 - 12
Page 90
G75 GROOVING CYCLE
LESSON 8 GROOVING & PART OFF - EXAMPLE - MACHINING PROCESS

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
Machining Process
1. Face.
2. Turn outside diameter one cut.
3. Groove two slots using G75 Grooving Cycle
4. Cut-off using G75 Grooving Cycle.
5. Z zero is the front face of the part
6. The grooving\part-off tool is 0.118 wide
7. Program right hand side of grooving\part-off tool
8. Machine to finish depth with every plunge
9. Material is 1.125 aluminum

TK-Lathe Lesson 8 - 13
Page 91
G75 GROOVING CYCLE
LESSON 8 GROOVING & PART OFF - EXAMPLE - PROGRAM
Face and Turn OD

D t f le

n
%
p
O186 (GROOVING & PART-OFF LESSON-8-EXAMPLE)

io
(FACE FRONT OF PART - TURN OD ONE CUT)
no m

N1 G20 (VERIFY INCH MODE)


tr r
N3 G18 G40 G54 G80 G97 G99 (SAFETY BLOCK)
ut
is o
N5 T0100 (TOOL CALL T01)
Sa

N7 G50 S3500 (SPECIFY MAXIMUM RPM TO 3500)


N9 G97 S500 M03 (START SPINDLE 500 RPM CW)
ib
N11 G00 G41 G54 X1.5 Z0.25 T0101 M08 (RAPID TO SAFE POSITION, TNC, ACTIVATE OFFSET,
COOLANT ON)
N13 G96 S700 (SPECIFY CONSTANT SURFACE SPEED 700 SFM)
N15 G99 G01 Z0 F0.010 (FEED TO Z0. G99=FEED PER REVOLUTION)
N17 X-0.05 (MOVE TOOL TO X-0.05, OVERCUT BY 0.05)
N19 U0.05 W0.05 (INCREMENTAL PULL OFF FROM PART FACE X0.05 Z0.05)
N21 G00 G40 X1.25 Z0.25 (RAPID TO SAFE POSITION, CANCEL TNC)
N23 G01 G42 X1.100 Z0.1 F0.005 (ACTIVATE TNC, FEED TO FINISH DIAMETER)
N25 G01 Z-1.375 (FEED TO LENGTH + 0.125)
N27 X1.15 (PULL OFF FROM PART AT FEED RATE)
N29 G40 G00 X 1.5 (CANCEL TNC)
N31 G28 U0 (RAPID TO X MACHINE HOME POSITION)
N33 G28 W0 (RAPID TO Z MACHINE HOME POSITION)

TK-Lathe Lesson 8 - 14
Page 92
G75 GROOVING CYCLE
LESSON 8 GROOVING & PART OFF - EXAMPLE - PROGRAM
Cut First and Second Groove

D t f le

n
p

io
(CUT FIRST GROOVE - G75 - GROOVING CYCLE)
no m

(INSERT WIDTH = 0.118")


tr r
(PROGRAM RIGHT HAND SIDE OF GROOVING\PART-OFF TOOL)
ut
is o
N35 G00 T404 (TOOL CALL T04, ACTIVATE OFFSET)
Sa

N37 G97 S191 M03 (START SPINDLE 191 RPM CW)


N39 G00 X1.5 Z0.25 M8 (RAPID TO SAFE POSITION, COOLANT ON)
ib
N41 G50 S3000 (SPECIFY MAXIMUM RPM TO 3000)
N43 G96 S200 (SPECIFY CONSTANT SURFACE SPEED 200 SFM)
N45 Z-0.250 (RAPID TO FIRST GROOVE POSITION)
N47 X1.15 (RAPID TO X1.15 CLEAR OF PART)
N49 G75 X0.750 Z-0.332 I0.1 K0.03 F0.002 (G75 - GROOVING CYCLE)
N51 X1.15 (RAPID TO X1.15 CLEAR OF PART)
(CUT SECOND GROOVE - G75 - GROOVING CYCLE)
N53 G00 Z-0.875 (RAPID TO SECOND GROOVE POSITION)
N55 G75 X0.875 Z-0.957 I0.1 K0.03 F0.002 (G75 - GROOVING CYCLE)
N57 X1.15 (RAPID TO X1.15 CLEAR OF PART)

TK-Lathe Lesson 8 - 15
Page 93
G75 GROOVING CYCLE
LESSON 8 GROOVING & PART OFF - EXAMPLE - PROGRAM
Cut-Off

D t f le

n
p

io
no m
tr r
ut
is o
Sa

(CUT OFF - SINGLE PASS GROOVING CYCLE)


ib
N59 G00 Z-1.25 (RAPID TO CUT-OFF POSITION)
N61 G75 X-0.030 I0.1 F0.002 (CUT OFF - G75 - SINGLE PASS GROOVING CYCLE)
N63 G00 X1.250 (RAPID TO X1.25 CLEAR OF PART)
N65 G28 (RAPID TO MACHINE HOME POSITION)
N67 M30 (PROGRAM END)
%

TK-Lathe Lesson 8 - 16
Page 94
LESSON 8 GROOVING & PART OFF EXERCISE #1

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 8 - 17
Page 95
LESSON 8 GROOVING & PART OFF EXERCISE #1

Create a program for Exercise #1 to:

1. Face.
2. Finish turn outside diameter one cut.
3. Groove three places.
4. Cut-off.
5. Z zero is the front face of the part
D t f le 6. Use the Lesson 8 videos to guide you through the programming process.

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 8 - 18
Page 96
LESSON 8 GROOVING & PART OFF EXERCISE #1

%
O186(Lesson-8-EXERCISE-1 - Grooving & Part-Off )
(Face Front of Part - Turn OD one cut)
N1 G20 (Verify inch units)
N3 G18 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 (Tool call T01)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.5 Z0.25 T0101 M08 (Rapid to Safe position, TNC, coolant on)
N13 G96 S700 (Specify constant surface speed 700 SFM)
N15 G99 G01 Z0 F0.010 (Feed to Z0. G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 G40 X1.25 Z0.25
N23 G01 G42 X1.100 Z0.1 F0.005
D t f le
N25 G01 Z-1.375
N27 X1.15

n
N29 G40 G00 X 1.5
N31 G28 U0 (Rapid to X machine home position)
p
N33 G28 W0 (Rapid to Z machine home position)

io
(CUT FIRST GROOVE - FIRST CUT)
no m

(INSERT WIDTH = 0.118")


tr r
(PROGRAM RIGHT HAND SIDE OF GROOVING\PART-OFF TOOL)
ut
N35 G00 T404
is o
N37 G97 S191 M03
Sa

N39 G00 X1.5 Z0.25 M8


N41 G50 S3000
N43 G96 S200
ib
N45 Z-0.125
N47 X1.2
N49 G01 X0.800 F0.002
N51 G04 P2.0
N53 X1.2
(CUT FIRST GROOVE - SECOND CUT)
N55 G00 Z-0.207 (0.325-0.118 INSERT WIDTH = 0.118")
N57 G01 X0.800
N59 G04 P2.0
N61 X1.2

TK-Lathe Lesson 8 - 19
Page 97
LESSON 8 GROOVING & PART OFF EXERCISE #1

(CUT SECOND GROOVE - FIRST CUT)


N63 G00 Z-0.5
N65 G01 X0.850
N67 G04 P2.0
N69 X1.2
(CUT SECOND GROOVE - SECOND CUT)
N71 G00 Z-0.582 (0.70-0.118 INSERT WIDTH = 0.118")
N73 G01 X0.850
N75 G04 P2.0
N77 X1.2

(CUT THIRD GROOVE - FIRST CUT)


N79 G00 Z-0.875
N81 G01 X0.730
N83 G04 P2.0
D t f le
N85 X1.2
(CUT THIRD GROOVE - SECOND CUT)

n
N87 G00 Z-0.957 (0.875+0.20-0.118 INSERT WIDTH = 0.118")
N89 G01 X0.730
p
N91 G04 P2.0

io
N93 X1.2
no m

(CUT OFF)
tr r
N95 G00 Z-1.25
ut
N97 G01 X-0.05 F0.002
is o
N99 G00 X1.250
Sa

N101 G28 (Rapid to machine home position)


N103 M30 (Program end)
%
ib

TK-Lathe Lesson 8 - 20
Page 98
LESSON 8 GROOVING & PART OFF EXERCISE #1

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 8 - 21
Page 99
LESSON 8 GROOVING & PART OFF EXERCISE #1

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 8 - 22
Page 100
CNC PROGRAMMING
WORKBOOK

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

LESSON-9
THREADING
NOTE: Teachers Solutions are in shaded cells throughout this book.

Page 101
HAAS - G76 O.D./I.D. THREAD CUTTING CYCLE, MULTIPLE PASS

N93 G76 X0.5135 Z-0.8 K0.0558 D0.0176 F0.0909

G76 O.D./I.D. THREAD CUTTING CYCLE, MULTIPLE PASS


X* X-axis absolute thread finish point, a diameter value
Z* Z-axis absolute distance, thread end point location
D t f le
U* X-axis incremental total distance to finish point, diameter

n
W* Z-axis incremental thread length finish point
K Thread height, radius value
p

io
I* Thread taper amount, radius value
D First pass cutting depth
no m

P Thread Cutting Method P1-P4


tr r
A* Tool nose angle, no decimal with A command (0 to 120 degrees, If not used
ut
is o
then 0 degrees is assumed)
F Feed rate (Threading feed rate, is the thread distance per revolution)
Sa

ib
* Indicates optional
The G76 canned cycle can be used for threading both straight and tapered threads. G76 can be
used to create multiple cutting passes along the length of a thread.
The height of the thread is specified in K, this height is defined as the distance from the crest of the
thread to the root.
The calculated depth of the thread will be K less the finish allowance. On the Hass lathe Setting 86
(THREAD FINISH ALLOWANCE) is this stock allowance for a finish pass allowance, if required.

The depth of the first cut of the thread is specified in D. This also determines the number of passes
over the thread based on the value of K and the cutting method used.

The depth of the last cut on the thread can be controlled with Setting 99 on the Hass lathe
(THREAD MINIMUM CUT). The last cut will never be less than this value. The default value is .001
inches/.01 mm.

The feed rate is the Lead of thread. The F feed rate in a G76 threading cycle is 1.0 divided by the
number of threads per inch = F. (1.0 divided by 11 TPI = F.0909091)

TK-Lathe Lesson 9 - 2
Page 102
HAAS G92 THREAD CUTTING CYCLE

N95 G92 X.5135 Z-0.8 F0.0909

G92 THREAD CUTTING CYCLE

X* Absolute X-axis target location


D t f le
Z* Absolute Z-axis target location

n
U* Incremental X-axis target distance, diameter
W* Incremental Z-axis target distance
p

io
I* Distance and direction of X axis taper, a radius value
F Feed rate (Threading feed rate, is the thread distance per revolution)
no m
tr r
* Indicates optional
ut
is o
The G92 is a modal canned cycle. It can be used for simple threading.
Sa

Since it is modal, you can do multiple passes for threading by just specifying a new X location for
ib
successive passes. For example:

N16 G92 X.523 Z-0.8 F0.0909 M24 (First Pass of a G92 O.D. Thread Cycle)
N17 X.520 (Additional Pass)
N18 X.515 (Additional Pass)
N19 X.5135 (Additional Pass)

Straight threads can be made by just specifying X, Z and F. By adding I a pipe or taper thread can
be cut.

TK-Lathe Lesson 9 - 3
Page 103
HAAS M24 - THREAD CHAMFER OFF

N91 X0.650 M24

D t f le

n
At the end of the thread an optional chamfer can be performed. The size and angle of the chamfer
p
is controlled with Setting 95 (THREAD CHAMFER SIZE) and Setting 96 (THREAD CHAMFER ANGLE).

io
The chamfer size is designated in number of threads, so that if 1.000 is recorded in Setting 95 and
no m
tr r
the feed rate is .05, then the chamfer will be .05.

ut
is o
If relief is provided for at the end of the thread, then the chamfer can be eliminated by specifying
0.000 for the chamfer size in Setting 95. The default value for Setting 95 is 1.000 and the default
Sa

angle for the thread (Setting 96) is 45 degrees.


ib
A chamfer can improve the appearance and functionality of threads that must be machined up to a
shoulder.

As the Lesson-9 Example part has a 0.125 wide undercut M24 will be programed as no chamfer is
required.

M23 commands chamfer on.


M24 commands chamfer off.
M23 is the default value.

TK-Lathe Lesson 9 - 4
Page 104
THREADING

THREADING
The portion of the example CNC program below cuts the .625-11 UNC thread on the Lesson-9
Example part, the drawing is shown below.

At block N93 the G76 threading cycle is used to cut the thread in multiple passes. The G92
threading cycle is used at block N95 and N97 to perform spring passes.

These spring passes are sometimes referred to as ghost passes. The threading tool is not
moved any deeper but cuts along the path previously cut to clean up and get a good finish on the
threads.
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib
EXAMPLE OF THREADING OPERATION
(THREAD .625-11 UNC)
N85 T0505 (O.D. THREADING TOOL)
N87 G97 S800 M03 (START SPINDLE 800 RPM CW)
N89 G00 G54 X1.25 Z0.25 T0505 M08 (RAPID TO SAFE POSITION & PICK-UP OFFSETS)
N91 X0.650 M24 (CHAMFER AT END OF THREAD IS OFF)
N93 G76 X0.5135 Z-0.8 K0.0558 D0.0176 F0.0909 ( G76 OD THREADING CYCLE MULTIPLE PASSES)
N95 G92 X.5135 Z-0.8 F0.0909 (SPRING CUT)
N97 G92 X.5135 Z-0.8 F0.0909 (SPRING CUT)
N99 G28 U0
N101 G28 W0 M05

TK-Lathe Lesson 9 - 5
Page 105
THREADING - G76 THREADING CYCLE

THREADING - G76 THREADING CYCLE

N93 G76 X0.5135 Z-0.8 K0.0558 D0.0176 F0.0909

At block N93 the G76 threading cycle is used to cut the thread in multiple passes.

X0.5135 is the root diameter of the .625-11 UNC thread. The root diameter was identified in the
Machinerys Handbook.

Z-0.8 is the absolute Z-axis target location. This is 0.050 past the end of the thread.

K0.0558 is the thread height, a radius value. This is 0.625-0.5135 / 2 = 0.05575


D t f le

n
D0.0176 is the first pass cutting depth. This determines how many cuts will be taken to reach the
final depth.
p

io
F0.0909 is the feed rate. The threading feed rate is the thread distance per revolution. The
calculation for this thread having 11 threads per inch is 1 divided by 11 which is equals to 0.090909.
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 9 - 6
Page 106
THREADING G92 THREADING CYCLE

THREADING G92 THREADING CYCLE


N95 G92 X.5135 Z-0.8 F0.0909
N97 G92 X.5135 Z-0.8 F0.0909
At block N95 and N97 the G92 threading cycle is used after the G76 cycle to cut the thread in two
single passes both at the same depth.

G92 is being used in the Example program to perform two spring passes

The G92 is a modal canned cycle. It can be used for simple threading. Once the first G92 block is
input with all the relevant values, additional threading cuts can be made by just the input of the
D t f le
desired X value.

n
X0.5135 is the root diameter of the .625-11 UNC thread. The root diameter was identified in the
p

io
Machinerys Handbook.
no m

Z-0.8 is the absolute Z-axis target location. This is 0.050 past the end of the thread.
tr r
ut
is o
F0.0909 is the feed rate. The threading feed rate is the thread distance per revolution. The
calculation for this thread having 11 threads per inch is 1 divided by 11 which is equals to 0.090909.
Sa

ib

TK-Lathe Lesson 9 - 7
Page 107
LESSON 9 - THREADING - EXAMPLE - DRAWING

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 9 - 8
Page 108
LESSON 9 - THREADING - EXAMPLE - MACHINING PROCESS

D t f le

n
p

io
no m
tr r
Machining Process
ut
is o
1. Face.
Sa

2. Rough Turn OD
3. Finish Turn OD
ib
4. Groove undercut for thread 0.125 wide
5. Thread .625-11 UNC.
6. Cut-off.
7. Z zero is the front face of the part
8. The grooving\part-off tool is 0.118 wide
9. Program right hand side of grooving\part-off tool
10. Material is 1.125 aluminum

TK-Lathe Lesson 9 - 9
Page 109
LESSON 9 - THREADING - EXAMPLE - PROGRAM
Face

%
D t f le
O1294 (Lesson-9-Example)

n
(FACE FRONT OF PART)
N1 G20 (Verify inch mode)
p

io
N3 G18 G40 G54 G80 G97 G99 (Safety Block)
N5 T0100 (Tool call T01)
no m

N7 G50 S3500 (Specify maximum rpm to 3500)


tr r
ut
N9 G97 S500 M03 (Start spindle 500 RPM CW)
is o
N11 G00 G41 G54 X1.5 Z0.25 T0101 M08 (Rapid to safe position, TNC, activate offset)
Sa

N13 G96 S700 (Specify constant surface speed 700 sfm)


N15 G99 G01 Z0 F0.010 (Feed to Z0. G99=feed per revolution)
ib
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 G40 X1.25 Z0.25 (Rapid to safe position, cancel TNC)

TK-Lathe Lesson 9 - 10
Page 110
LESSON 9 - THREADING - EXAMPLE - PROGRAM
Rough Turn OD

(ROUGH TURN O.D.)


D t f le
N23 G71 P25 Q41 U0.03 W0.005 D0.1 F0.010 (G71 Rough Turning Cycle)

n
N25 G00 G42 X0.398 (P and G42 with the start of geometry)
N27 G99 G01 X 0.398 Z0.05 F0.006 (Feed to Z0.05 from finish front face, 0.05 below chamfer)
p

io
N29 X0.623 Z-0.0625 (Turned undersize - cut chamfer at front of part)
N31 Z-0.875
no m

N33 X0.925
tr r
ut
N35 X1.050 Z-0.9375 (Cut second chamfer)
is o
N37 Z-1.5 (Cut past end of part)
Sa

N39 X1.25 (Pull away from part)


N41 G40 G00 X 1.5 (Q end of geometry, machine off of part and cancel compensation)
ib
N43 G00 X1.25 Z0.25 (Rapid back to safe position)
N45 G28 U0 (Rapid to x machine home position)
N47 G28 W0 M05 (Rapid to z machine home position)

TK-Lathe Lesson 9 - 11
Page 111
LESSON 9 - THREADING - EXAMPLE - PROGRAM
Finish Turn OD

(FINISH CUT)
D t f le
N49 T0202 (O.D. right hand finishing tool 55)

n
N51 G50 S3500 (Specify maximum RPM to 3500)
N53 G97 S800 M03 (Start spindle 800 RPM CW)
p

io
N55 G00 G42 G54 X1.25 Z0.25 T0202 M08 (Rapid to safe position, TNC, coolant on)
N57 G96 S700 (Specify constant surface speed 700 SFM)
no m

N59 G70 P25 Q41 (G70 finishing OD)


tr r
ut
N61 G28 U0 (Rapid to X machine home position)
is o
N63 G28 W0 M05 (Rapid to Z machine home position)
Sa

ib

TK-Lathe Lesson 9 - 12
Page 112
LESSON 9 - THREADING - EXAMPLE - PROGRAM
Cut Groove

(CUT .125 WIDE GROOVE )


D t f le
(CUT GROOVE - G75 - GROOVING CYCLE)

n
(INSERT WIDTH = 0.118")
(PROGRAM RIGHT HAND SIDE OF GROOVING\PART-OFF TOOL)
p

io
N65 G00 T404 (Tool call T04, activate offset)
N67 G97 S191 M03 (Start spindle 191 RPM CW)
no m

N69 G00 X1.25 Z0.25 M8 (Rapid to safe position, coolant on)


tr r
ut
N71 G50 S3000 (Specify maximum rpm to 3000)
is o
N73 G96 S200 (Specify constant surface speed 200 SFM)
Sa

N75 Z-0.750 (Rapid to groove position)


N77 X1.15 (Rapid to X1.15 clear of part)
ib
N79 G75 X0.50 Z-0.757 I0.5 F0.002 (G75 Grooving Cycle)
N81 X1.15
N83 G28 (Rapid to machine home position)

TK-Lathe Lesson 9 - 13
Page 113
LESSON 9 - THREADING - EXAMPLE - PROGRAM
Thread

(THREAD .625-11 UNC)


D t f le
N85 T0505 (Tool call T05, activate offset, O.D. threading tool)

n
N87 G97 S800 M03 (Start spindle 800 rpm CW)
N89 G00 G54 X1.25 Z0.25 T0505 M08 (Rapid to safe position, TNC, coolant on)
p

io
N91 X0.650 M24 (Chamfer at end of thread is off)
N93 G76 X0.5135 Z-0.8 K0.0558 D0.0176 F0.0909 ( G76 OD threading cycle)
no m

N95 G92 X.5135 Z-0.8 F0.0909 (Spring cut)


tr r
ut
N97 G92 X.5135 Z-0.8 F0.0909 (Spring cut)
is o
N99 G28 U0 (Rapid to X machine home position)
Sa

N101 G28 W0 M05 (Rapid to Z machine home position)


ib

TK-Lathe Lesson 9 - 14
Page 114
LESSON 9 - THREADING - EXAMPLE - PROGRAM
Cut-Off

(CUT OFF)
D t f le
N103 G00 T404 (Tool call T04, activate offset)

n
N105 G97 S191 M03
N107 G00 X1.25 Z0.25 M8
p

io
N109 G50 S3000
N111 G96 S200
no m

N113 Z-1.520 (Rapid to cut-off position + 0.020 for rough cut)


tr r
ut
N115 X1.15
is o
N117 G75 X0.3 I0.1 F0.002 (Grooving Cycle Rough cut to 0.3 diameter)
Sa

N119 Z-1.485 (Position for chamfer on end of part)


N121 G01 X1.05
ib
N123 U-0.015 W-0.015 (Cut 0.015 chamfer on end of part remove sharp edge)
N125 X1.15 (Retract from groove)
N127 Z-1.5 (Position for cut-off)
N129 G75 X-0.03 I0.1 F0.002 (Grooving Cycle - Cut-Off to length)
N131 G00 X1.250
N133 G28 (Rapid to machine home position)
N135 M30 (Program end)
%

TK-Lathe Lesson 9 - 15
Page 115
LESSON 9 - THREADING EXERCISE

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 9 - 16
Page 116
LESSON 9 - THREADING EXERCISE

Create a program for the Lesson-9 Exercise to:

1. Face.
2. Rough Turn OD
3. Finish Turn OD
4. Groove undercut for thread 0.125 wide
5. Thread .500-13 UNC.
6. Cut-off.
7. Z zero is the front face of the part
8. The grooving\part-off tool is 0.118 wide
9. Program right hand side of grooving\part-off tool
10. Material is 1.125 aluminum
D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 9 - 17
Page 117
LESSON 9 - THREADING EXERCISE

%
O1294(Lesson-9-Example)
(Face Front of Part)
N1 G20 (Verify inch units)
N3 G18 G40 G54 G80 G97 G99 (Safety block)
N5 T0100 (Tool call T01)
N7 G50 S3500 (Specify maximum RPM to 3500)
N9 G97 S500 M03 (Start spindle 500 RPM CW)
N11 G00 G41 G54 X1.7 Z0.25 T0101 M08 (Rapid to Safe position, TNC, coolant on)
N13 G96 S700 (Specify constant surface speed 700 SFM)
N15 G99 G01 Z0 F0.010 (Feed to Z0. G99=Feed per revolution)
N17 X-0.05 (Move tool to X-0.05, overcut by 0.05)
N19 U0.05 W0.05 (Incremental pull off from part face X0.05 Z0.05)
N21 G00 G40 X1.25 Z0.25
D t f le
(Rough Turn O.D.)
N23 G71 P25 Q41 U0.03 W0.005 D0.1 F0.010

n
N25 G00 G42 X0.398 (P and G42 With the start of Geometry)
N27 G99 G01 X 0.398 Z0.05 F0.006 (Feed to Z0.05 from finish front face of part & 0.05 below chamfer)
p
N29 X0.623 Z-0.0625 (TURNED UNDERSIZE - Cut chamfer at front of part)

io
N31 Z-0.875
N33 X0.925
no m

N35 X1.050 Z-0.9375 (Cut second chamfer)


tr r
N37 Z-1.5
ut
N39 X1.25
is o
N41 G40 G00 X 1.5 (Q End of Geometry)
Sa

N43 G00 X1.25 Z0.25 (Rapid back to safe position)


N45 G28 U0 (Rapid to X machine home position)
N47 G28 W0 M05 (Rapid to Z machine home position)
ib
(Finish Cut)
N49 T0202 (O.D. Right Hand Finishing Tool 55)
N51 G50 S3500 (Specify maximum RPM to 3500)
N53 G97 S800 M03 (Start spindle 800 RPM CW)
N55 G00 G42 G54 X1.25 Z0.25 T0202 M08 (Rapid to Safe position, TNC, coolant on)
N57 G96 S700 (Specify constant surface speed 700 SFM)
N59 G70 P25 Q41 ( G70 Finishing OD)
N61 G28 U0 (Rapid to X machine home position)
N63 G28 W0 M05 (Rapid to Z machine home position)

TK-Lathe Lesson 9 - 18
Page 118
LESSON 9 - THREADING EXERCISE

(CUT .125 WIDE GROOVE )


(CUT GROOVE - G75 - GROOVING CYCLE)
(INSERT WIDTH = 0.118")
(PROGRAM RIGHT HAND SIDE OF GROOVING\PART-OFF TOOL)
N65 G00 T404
N67 G97 S191 M03
N69 G00 X1.25 Z0.25 M8
N71 G50 S3000
N73 G96 S200
N75 Z-0.750
N77 X1.15
N79 G75 X0.50 Z-0.757 I0.5 F0.002
N81 X1.15
N83 G28 (Rapid to machine home position)
D t f le
(THREAD .625-11 UNC)
N85 T0505 (O.D. THREADING TOOL)

n
N87 G97 S800 M03 (Start spindle 800 RPM CW)
N89 G00 G54 X1.25 Z0.25 T0505 M08 (Rapid to Safe position, TNC, coolant on)
p
N91 X0.650 M24 (CHAMFER AT END OF THREAD IS OFF)

io
N93 G76 X0.5135 Z-0.8 K0.0558 D0.0176 F0.0909 ( G76 OD THREADING CYCLE)
N95 G92 X.5135 Z-0.8 F0.0909 (SPRING CUT)
no m

N97 G92 X.5135 Z-0.8 F0.0909 (SPRING CUT)


tr r
N99 G28 U0 (Rapid to X machine home position)
ut
N101 G28 W0 M05 (Rapid to Z machine home position)
is o
Sa

(CUT OFF)
N103 G00 T404
N105 G97 S191 M03
ib
N107 G00 X1.25 Z0.25 M8
N109 G50 S3000
N111 G96 S200
N113 Z-1.520
N115 X1.15
N117 G75 X0.3 I0.1 F0.002
N119 Z-1.485
N121 G01 X1.05
N123 U-0.015 W-0.015
N125 X1.15
N127 Z-1.5
N129 G75 X-0.03 I0.1 F0.002
N131 G00 X1.250
N133 G28 (Rapid to machine home position)
N135
M30 (Program end)
%

TK-Lathe Lesson 9 - 19
Page 119
LESSON 9 - THREADING EXERCISE

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

TK-Lathe Lesson 9 - 20
Page 120
CNC PROGRAMMING
WORKBOOK LATHE

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

APPENDIX

Page 121
Appendix Extra CNC Programming Exercises

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 2
Page 122
Appendix Extra CNC Programming Exercises

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 3
Page 123
Appendix Extra CNC Programming Exercises

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 4
Page 124
Appendix Extra CNC Programming Exercises

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 5
Page 125
Appendix Extra CNC Programming Exercises

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 6
Page 126
Appendix Extra CNC Programming Exercises

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 7
Page 127
Appendix Extra CNC Programming Exercises

Material: Aluminum 6061 XZ PLANE


CS= ft/min

D t f le

n
p

io
no m
tr r
ut
is o
1. Tool #1 (OD Roughing Tool) Create A Toolpath To Rough The Above Profile
Feed =
Sa

Spindle Speed RPM = 4xCS/D=


in/min
Depth of Cut =0.1/side Use a G71 Canned Cycle
ib
2. Tool #2 (OD Finishing Tool) Finish The OD Using The Profile Created In The First Operation
Feed =
Spindle Speed RPM = 4xCS/D=
in/min
Depth of Cut =0.02/side Use a G70 Canned Cycle
3. Tool #9 (0.125 Right Hand Groove Tool) Machine Both Grooves By Plunging In The Middle Of
The Groove, Then Retract And Move Over To The Left And Right To Finish
Feed =
Spindle Speed RPM = 4xCS/D=
in/min
Start in the middle of grooves

Lathe Appendix - 8
Page 128
CNC PROGRAMMING EXERCISE (CONTINUED)
%
O00014;

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 9
Page 129
CNC PROGRAMMING EXERCISE (CONTINUED)

D t f le

n
p

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 10
Page 130
Appendix Preparatory Functions G-Codes

G00 RAPID POSITIONING MOTION

G01 LINEAR INTERPOLATION MOTION

G02 CIRCULAR INTERPOLATION MOTION - CLOCKWISE

G03 CIRCULAR INTERPOLATION MOTION - COUNTECLOCKWISE

G04 DWELL

G09 EXACT STOP

G10 PROGRAMMABLE OFFSET SETTING

G12 CW CIRCULAR POCKET MILLING


D t f le
G13 CCW CIRCULAR POCKET MILLING

n
G17 CIRCULAR MOTION XY PLANE SELECTION (G02 or G03)
p
G18 CIRCULAR MOTION ZX PLANE SELECTION (G02 or G03)

io
G19 CIRCULAR MOTION YZ PLANE SELECTION (G02 or G03)
no m
tr r
G20 VERIFY INCH COORDINATE POSITIONING

ut
is o
G21 VERIFY METRIC COORDINATE POSITIONING
Sa

G28 MACHINE ZERIO RETURN THRU REF. POINT


ib
G29 MOVE TO LOCATION THROUGH G28 REF. POINT

G31 FEED UNTIL SKIP FUNCTION

G35 AUTOMATIC TOOL DIAMETER MEASUREMENT

G36 AUTOMATIC WORK OFFSET MEASUREMENT

G37 AUTOMATIC TOOL LENGTH MEASUREMENT

G40 CUTTER COMPENSATION CANCEL G41/G42/G141

G41 2D CUTTER COMPENSATION, LEFT (X, Y, D)

G42 2D CUTTER COMPENSATION, RIGHT (X, Y, D)

G43 TOOL LENGTH COMPESATION POSITIVE (H, Z)

G44 TOOL LENGTH COMPENATION NEGATIVE (H, Z)

Lathe Appendix - 11
Page 131
Appendix Preparatory Functions G-Codes

G47 TEXT ENGRAVING (X, Y, Z, R, I, J, P, E, F)

G49 TOOL LENGTH COMPENSATION CANCEL G43/G44/G143)

G50 SCALING G51 CANCEL

G51 SCALING (X, Y, Z, P)

G52 WORK OFFSET COORDINATE POSITING

G52 GLOBAL WORK COORDINATE OFFSET SHIFT

G52 GLOBAL WORK COORDINATE OFFSET SHIFT

G53 MACHINE COORDAINTE POSITIONING, NON-MODAL (X, Y, Z, A, B)


D t f le
G54 WORK OFSET COORDIANTE POSITIONING #1

n
G55 WORK OFSET COORDIANTE POSITIONING #2
p
G56 WORK OFSET COORDIANTE POSITIONING #3

io
G57 WORK OFSET COORDIANTE POSITIONING #4
no m
tr r
G58 WORK OFSET COORDIANTE POSITIONING #5

ut
is o
G59 WORK OFSET COORDIANTE POSITIONING #6
Sa

G60 UNI-DIRECTIONAL POSITIONING (X, Y, Z, A, B)


ib
G61 EXACT STOP, MODAL (X, Y, Z, A, B)

G64 EXACT STOP G61 MODE CANCEL

G65 MACRO SUB-ROUTINE CALL

G68 ROATION (G17, G18, G19, X, Y, Z, R)

G69 ROTATION G68 CANCEL

G70 BOLT HOLE CIRCLE with a CANNED CYCLE (I, J, L)

Lathe Appendix - 12
Page 132
Appendix Preparatory Functions G-Codes

G71 BOLTHOLEARC with a CANNED CYCLE (I, J, K, L)

G72 BOLT HOLES ALONG AN ANGLE with a CANNED CYCLE (I, J, L)

G73 HIGH SPEED PECK DRILL CANNED CYCLE (X, Y, A, B, Z, I, J, K, Q, P, R, L, F)

G74 REVERSE TAPPING CANNED CYCLE (X, Y, A, B, Z, J, R, L, F)

G76 FINE BORING CANNED CYCLE (X, Y, A, B, Z, I, J, P, Q, R, L, F)

G77 BACK BORE CANNED CYCLE (X, Y, A, B, Z, I, J, Q, R, L, F)

G80 CANCEL CANNED CYCLE

G81 DRILL CANNED CYCLE (X, Y, A, B, Z, R, L, F)


D t f le
G82 SPOT DRILL/COUNTERBORE CANNED CYCLE (X, Y, A, B, Z, P, R, L, F)

n
G83 PECK DRILL CANNED CYCLE (X, Y, A, B, Z, I, J, K, Q, P, R, L, F)
p
G84 TAPPING CANNED CYCLE (X, Y, A, B, Z, J, R, L, F)

io
G85 BORE IN, BORE OUT CANNED CYCLE (X, Y, A, B, Z, R, L, F)
no m
tr r
G86 BORE IN, STOP, RAPID OUT CANNED CYCLE (X, Y, A, B, Z, R, L, F)

ut
is o
G87 BORE IN AND MANUAL RETRACT CANNED CYCLE (X, Y, A, B, Z, R, L, F)
Sa

G88 BORE IN, DWELL, MANUAL RETRACT CANNED CYCLE (X, Y, A, B, Z, P, R, L, F)


ib
G89 BORE IN, DWELL, BORE OUT (X, Y, A, B, Z, P, R, L, F)

G90 ABSOLUTE POSITIONING

G91 INCREMENTAL POSITIONING

G92 GLOBAL WORK COORDINATE SYSTEM SHIFT (FANUC) (HAAS)

G92 SET WORK COORDINATE VALUE (YA SNAC)

G93 INVERSE TIME FEED MODE ON

G94 INVERSE TIME FEED MODE OFF/FEED PER MINUTE ON

G98 CANNED CYCLE INITIAL POINT RETURN

G99 CANNED CYCLE R PLANE RETURN

Lathe Appendix - 13
Page 133
Appendix Miscellaneous Functions M-Codes

M00 PROGRAM STOP

M01 OPTIONAL PROGRAM STOP

M02 PROGRAM END

M03 SPINDLE ON CLOCKWISE

M04 SPINDLE ON COUTERCLOCKWISE

M05 SPINDLE STOP

M06 TOOL CHANGE

M08 COOLANT ON

M09 COOLANT OFF


D t f le
M19 ORIENT SPINDLE (P, R)

n
M21-M28 OPTIONAL USER M CODE INTERFACE WITH M-FIN SIGNAL
p
M30 PROGRAM END AN RESET

io
M31 CHIP AUGER FORWARD
no m
tr r
M32 CHIP AUGER REVERSE

ut
is o
M33 CHIP AUGER STOP
Sa

M34 COOLANT SPIGOT POSITION DOWN, INCREMENT

M35 COOLANT SPIGOT POSITION UP, DECREMENT


ib
M36 PALET PART READY

M39 ROTATE TOOL TURRET

M41 SPINDLE LOW GEAR OVERRIDE

M42 SPINDLE HIGH GEAR OVERRIDE

M50 EXECUTE PALLET CHANGE

Lathe Appendix - 14
Page 134
Appendix Miscellaneous Functions M-Codes

M51-M58 OPTIONAL USER M CODE SET

M59 OUTPUT RELAY SET (N)

M61-M68 OPTIONAL USER M CODE CLEAR

M69 OUTPUT RELAY CLEAR (N)

M75 SET G35 OR G136 REFERENCE POINT

M76 CONTROL DISPLAY INACTIVE

M77 CONTROL DISPLAY ACTIVE

M78 ALARM IF SKIP SIGNAL FOUND


D t f le
M79 ALARM IF SKIP SIGNAL NOT FOUND

n
M80 AUTOMATIC DOOR OPEN
p
M81 AUTOMATIC DOOR CLOSE

io
M82 TOOL UNCLAMP
no m
tr r
M83 AUTO AIR JET ON

ut
is o
M84 AUTO AIR JET OFF
Sa

M86 TOOL CLAMP


ib
M88 COOLANT THROUGH SPINDLE ON

M89 COOLANT THROUGH SPINDLE OFF

M93 AXIS POS CAPTURE START (P, Q)

M94 AXIS POS CAPTURE STOP

M95 SLEEP MODE

M96 JUMP IF NO SIGNAL (P, Q)

M97 LOCAL SUB-PROGRAM CALL (P, L)

M98 SUB-PROGRAM CALL (P, L)

M99 SUB-PROGRAM/ROUTINE RETURN OR LOOP

M109 INTERACTIVE USER INPUT (P)

Lathe Appendix - 15
Page 135
Standard Drill Sizes - Inches

Drill Decimal Drill Decimal Drill Decimal Drill Decimal


. . . . . . .
Size Equiv. Size Equiv. Size Equiv. Size Equiv.
80 = .0135 43 = .089 8 = .199 25/64 = .3906
79 = .0145 42 = .0935 7 = .201 X = .397
1/64 = .0156 3/32 = .0938 13/64 = .2031 Y = .404
78 = .016 41 = .096 6 = .204 13/32 = .4063
77 = .018 40 = .098 5 = .2055 Z = .413
76 = .020 39 = .0995 4 = .209 27/64 = .4219
75 = .021 38 = .1015 3 = .213 7/16 = .4375
74 = .0225 37 = .104 7/32 = .2188 29/64 = .4531
73 = .024 36 = .1065 2 = .221 15/32 = .4688
72 = .025 7/64 = .1094 1 = .228 31/64 = .4844
71 = .026 35 = .110 A = .234 1/2 = .500
70 = .028 34 = .111 15/64 = .2344 33/64 = .5156
69 = .0292 33 = .113 B = .238 17/32 = .5313
D t f le
68 = .031 32 = .116 C = .242 35/64 = .5469

n
1/32 = .0313 31 = .120 D = .246 9/16 = .5625
67 = .032 1/8 = .1250 1/4 (E) = .250 37/64 = .5781
p
66 = .033 30 = .1285 F = .257 19/32 = .5938

io
65 = .035 29 = .136 G = .261 39/64 = .6094
64 = .036 28 = .1405 17/64 = .2656 5/8 = .625
no m

63 = .037 9/64 = .1406 H = .266 41/64 = .6406


tr r
62 = .038 27 = .144 I = .272 21/32 = .6563
ut 61 = .039 26 = .147 J = .277 43/64 = .6719
is o
60 = .040 25 = .1495 K = .281 11/16 = .6875
Sa

59 = .041 24 = .152 9/32 = .2813 45/64 = .7031


58 = .042 23 = .154 L = .290 23/32 = .7188
ib
57 = .043 5/32 = .1563 M = .295 47/64 = .7344
56 = .0465 22 = .157 19/64 = .2969 3/4 = .750
3/64 = .0469 21 = .159 N = .302 49/64 = .7656
55 = .052 20 = .161 5/16 = .3125 25/32 = .7813
54 = .055 19 = .166 O = .316 51/64 = .7969
53 = .0595 18 = .1695 P = .323 13/16 = .8125
1/16 = .0625 11/64 = .1719 21/64 = .3281 53/64 = .8281
52 = .0635 17 = .173 Q = .332 27/32 = .8438
51 = .067 16 = .177 R = .339 55/64 = .8594
50 = .070 15 = .180 11/32 = .3438 7/8 = .875
49 = .073 14 = .182 S = .348 57/64 = .8906
48 = .076 13 = .185 T = .358 29/32 = .9063
5/64 = .0781 3/16 = .1875 23/64 = .3594 59/64 = .9219
47 = .0785 12 = .189 U = .368 15/16 = .9375
46 = .081 11 = .191 3/8 = .375 61/64 = .9531
45 = .082 10 = .1935 V = .377 31/32 = .9688
44 =.086 9 = .196 W = .386 63/64 = .9844

Lathe Appendix - 16
Page 136
Inch Tap Drill Sizes

INCH SIZES - NATIONAL COARSE INCH SIZES - NATIONAL FINE


UNC UNF
---------------------------- ----------------------------
TAP DRILL TAP DRILL
SIZE SIZE SIZE SIZE
---------------------------- ----------------------------
#1-64 #53 #0-80 3/64"
#2-56 #51 #1-72 #53
#3-48 5/64" #2-64 #50
#4-40 #43 #3-56 #46
#5-40 #39 #4-48 #42
#6-32 #36 #5-44 #37
#8-32 #29 #6-40 #33
#10-24 #25 #8-36 #29
#12-24 #17 #10-32 #21
D t f le
1/4-20 #7 #12-28 #15

n
5/16-18 F 1/4-28 #3
3/8-16 5/16 5/16-24 I
p
7/16-14 U 3/8-24 Q

io
1/2-13 27/64 7/16-20 W
9/16-12 31/64 1/2-20 29/64
no m

5/8-11 17/32 9/16-18 33/64


tr r
3/4-10 21/32 5/8-18 37/64
ut
is o
7/8-9 49/64 3/4-16 11/16
1"-8 7/8 7/8-14 13/16
Sa

1-1/8-7 63/64 1"-14 15/16


1-1/4-7 1-7/64 1-1/8-12 1-3/64
ib
1-1/2-6 1-11/32 1-1/4-12 1-11/64
1-3/4-5 1-35/64 1-1/2-12 1-27/64
2"-4-1/2 1-25/32 1-3/4-12 1-43/64
2"-12 1-59/64

Lathe Appendix - 17
Page 137
Metric Tap Drill Sizes

METRIC COARSE SIZES METRIC FINE SIZES


---------------------------- ----------------------------
TAP DRILL TAP DRILL
SIZE SIZE SIZE SIZE
---------------------------- ----------------------------
1mm x .25 .75mm 4 mm x .35 3.6mm
1.1 x .25 .85 4 x .5 3.5
1.2 x .25 .95 5 x .5 4.5
1.4 x .3 1.1 6 x .5 5.5
1.6 x .35 1.25 6 x .75 5.25
1.7 x .35 1.3 7 x .75 6.25
1.8 x .35 1.45 8 x .5 7.5
2 x .4 1.6 8 x .75 7.25
2.2 x .45 1.75 8x1 7
2.5 x .45 2.05 9x1 8
D t f le
3 x .5 2.5 10 x .75 9.25

n
3.5 x .6 2.9 10 x 1 9
4 x .7 3.3 10 x 1.25 8.8
p
4.5 x .75 3.7 11 x 1 10

io
5 x .8 4.2 12 x .75 11.25
6x1 5 12 x 1 11
no m

7x1 6 12 x 1.5 10.5


tr r
8 x 1.25 6.8 14 x 1 13
ut
is o
9 x 1.25 7.8 14 x 1.25 12.8
10 x 1.5 8.5 14 x 1.5 12.5
Sa

11 x 1.5 9.5 16 x 1 15
12 x 1.75 10.2 16 x 1.5 14.5
ib
14 x 2 12 18 x 1 17
16 x 2 14 18 x 2 16
18 x 2.5 15.5 20 x 1 19
20 x 2.5 17.5 20 x 1.5 18.5
22 x 2.5 19.5 20 x 2 18
24 x 3 21 22 x 1 21
27 x 3 24 22 x 1.5 20.5
30 x 3.5 26.5 22 x 2 20
24 x 1.5 22.5
24 x 2 22
26 x 1.5 24.5
27 x 1.5 25.5
27 x 2 25
28 x 1.5 26.5
30 x 1.5 28.5
30 x 2 28
Tap Drill Sizes
Lathe Appendix - 18
Page 138
Discriminator Installation Instructions
Installation Instructions for Workbook users:
1. Locate the DVD/CD that came with the workbook (fixed to the back cover).
2. Insert the disc into the DVD/CD ROM tray of your computer.
3. When the AutoPlay window is displayed select Open folder to view files as shown below:

D t f le

n
p
4. Double click or open the Discriminator folder as shown below:

io
no m
tr r
ut
is o
Sa

ib

Lathe Appendix - 19
Page 139
Discriminator Installation Instructions Continued
5. Double-click the Discriminator21017.exe file as shown below. This will start the installation process.
Follow the instructions on the screen to complete the installation.

D t f le

n
p
Installation Instructions for Online Course users:

io
1. Go to the Course Intro page of the Online Course as shown below:
no m
tr r
ut
is o
Sa

ib

2. Locate the What you need to complete this course section on this page and click on the
Discriminator link to download the Discriminator installation file. Make sure you save the file to a
place on the hard drive that you can be easily located.
3. Once the file has downloaded locate it and double-click the Discriminator.zip file to extract the
installation files onto your hard drive. Make sure you extract the files into a new folder on your hard
drive and remember where the folder is located.
4. Open the folder the files were extracted to and double click on Discriminator21017.exe.
5. Follow the instructions on the screen.

Lathe Appendix - 20
Page 140

Вам также может понравиться