You are on page 1of 43

Pr

ev
i

ew

Sa

m
pl
e

Computer Numerical Control


Programming Workbook

Generic Mill

Computer Numerical Control Workbook Generic Mill


Published by
CamInstructor Incorporated
330 Chandos Crt.
Kitchener, Ontario
N2A 3C2
www.caminstructor.com
Date: September 1, 2010
Author: Matthew Manton and Duane Weidinger
ISBN: 978-1-897466-84-1

National Library of Canada Cataloguing in Publication

Sa

To order additional copies of the book contact:


CamInstructor Inc.
330 Chandos Crt, Kitchener, ON, N2A 3C2
Phone 1-877-873-6867
Fax 1-866-741-8421
email sales@caminstructor.com

m
pl
e

Copyright 2010 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.

ev
i

ew

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
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
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.

Pr

Trademarks
Haas is a registered trademark of Haas Automation, Inc.
All brands are the trademark of their respective owners.
Printed in Canada

Page

Requirements
Use of the Multi-media CD/DVD requires a computer with speakers, and CD/DVD ROM.
August 3, 2010

CamInstructor CNC Programming Work Book-Generic Mill

TABLE OF CONTENTS

2. COMMONLY USED PREPARATORY G CODES

3. COMMONLY USED MISCELLANEOUS M CODES

5. EXAMPLE OF PROGRAM ENDING LINES


6. EXAMPLE OF PROGRAM TOOL CHANGE LINES

a. EXERCISE # 7-1 ~ # 7-5

Sa

7. ABSOLUTE & INCREMENTAL POSITIONING

8. RAPID (G00) AND LINEAR(G01) INTERPOLATION

ew

a. LINEAR INTERPOLATION: EXERCISE # 8-1 ~ # 8-4


9. DRILL CANNED CYCLE (G81)

ev
i

a. DRILL CANNED CYCLE: EXERCISE # 9-1

7
8
8
9

14
15
19
20
22

11. CIRCULAR INTERPOLATION (G02 & G03) : EXERCISE # 11-1

24

a. G02 CIRCULAR INTERPOLATION : EXERCISE # 11-2

26

b. G03 CIRCULAR INTERPOLATION : EXERCISE # 11-3

28

c. CIRCULAR INTERPOLATION: EXERCISE # 11-4 ~ # 11-7

29

Pr

10. DEEP HOLE PECK DRILL CANNED CYCLE (G83)

35

13. CNC PROGRAMMING: EXERCISE # 13

37

14. CNC PROGRAMMING: EXERCISE # 14

40

Page

12. CUTTER COMPENSATION (G40, G41, & G42)

4. EXAMPLE OF PROGRAM START-UP LINES

m
pl
e

1. AUTOMATIC TOOL CHANGER STANDARD TOOL CAROUSEL

CamInstructor CNC Programming Work Book-Generic Mill

AUTOMATIC TOOL CHANGER


STANDARD TOOL CAROUSEL

m
pl
e

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 same tools.

Carousel #

Tool Description

0.125 Diameter Flat End Mill

0.1875 Diameter Flat End Mill

Sa

0.250 Diameter Flat End Mill

ev
i

0.3125 Diameter Flat End Mill

ew

Pr

0.375 Diameter Flat End Mill


0.500 Diameter Flat End Mill
0.625 Diameter Flat End Mill
# 4 Centre Drill

0.187 Diameter Drill

10

0.250 Diameter Drill

Page

CamInstructor CNC Programming Work Book-Generic Mill

COMMONLY USED PREPARATORY G CODES

CODE

FUNCTION
Rapid traverse motion; Used for non-cutting rapid moves of the machine axis to a
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.

G01 *

Linear interpolation motion; Used for actual machining and metal removal.
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

G03 *

Circular Interpolation, Counterclockwise

G04

Dwell

G17

Circular Motion XY Plane Selection

G20

Verify Inch Coordinate Positions

G21

Verify Metric Coordinate Positions

G28

Machine Home (Rapid traverse)

G40

Cutter Compensation CANCEL

G41

Cutter Compensation LEFT of the programmed path

G42

Cutter Compensation RIGHT of the programmed path

G43

Tool Length Compensation

G49

Tool Length Compensation CANCEL

G54

Work Coordinate #1 (Part zero offset location)

G80 *

Canned Cycle CANCEL

G81 *

Drill Canned Cycle

G82

Spot Drill Canned Cycle

Pr

ev
i

ew

Sa

m
pl
e

G00 *

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

Page

* Programming exercises included

CamInstructor CNC Programming Work Book-Generic Mill

COMMONLY USED MISCELLANEOUS M CODES

CODE

FUNCTION

M01

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
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.

M03

Starts the spindle CLOCKWISE for most machining. Must have a spindle speed defined.
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.

M05

STOPS the spindle.


The M05 is used to turn the spindle off at the end of program or before a tool change.
If the coolant is on, the M05 will turn it off.

M06

Tool change command along with a tool number will execute a tool change for that
tool. This command will automatically stop the spindle, Z-axis will move up to the
machine zero 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.

Pr

ev
i

ew

Sa

m
pl
e

M00

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.
Pressing CYCLE START again will continue the program on the next block of the
program.

M09

Coolant OFF command.

M30

Program End and Reset to the beginning of program.

Page

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.

CamInstructor CNC Programming Work Book-Generic Mill

EXAMPLE OF PROGRAM START-UP LINES


Programs must begin and end with % depending
on the type of control.

O00023 ;

Letter O and up to a five digit program number.


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

N10 G20 ;

Nnn - Sequence Number


G20 - Verify Inch

N20 G00 G17 G40 G49 G80 G90 ;

G00 - Rapid Traverse


G17 - X, Y Circular Plane Selection
G40 - Cutter Compensation Cancel
G49 - Tool Length Compensation Cancel
G80 - Canned Cycle Cancel
G90 - Absolute Programming

m
pl
e

Sa

Startup
Block
(Machine
Default
Setting)

T8 - Tool number #8 to be loaded into the spindle.


M06 - Tool Change

ew

N30 T8 M06 ;

N50 G43 H8 Z2. ;

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
tool offset value is stored in.
* Tool Length offset # = Tool #
Z2. - Informs the control to move from full spindle
retract to this Z value and apply the tool length
offset.

Page

Pr

ev
i

N40 G00 G90 G54 X1. Y1. S4000 M03 ;

G00 - Rapid Traverse


G90 - Activates control to be in ABSOLUTE.
G54 - Selects work coordinate offset system No. 1
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

CamInstructor CNC Programming Work Book-Generic Mill

EXAMPLE OF PROGRAM ENDING LINES

N200 G00 Z2. ;

G00 - Rapid Traverse


Z2. Retracts tool to 2.0 above part zero

N210 M05 ;

M05 Turn off spindle

* N220 G53 Z0. ;

N230 G28 X0. Y0. ;

N240 M30 ;

G28 - Machine Zero Return


X0. - X axis to machine zero
Y0. - Y axis to machine zero

*Another way to
return to machine
zero

M30 End of Program and Reset

EXAMPLE OF PROGRAM TOOL CHANGE LINES

ev
i

N100 G00 Z2. ;

ew

Send to machine
zero Z-axis first to
avoid any crash.

Sa

* N230 G53 X-15. Y0.;

G91 - Incremental Programming


G28 - Machine Zero Return
Z0. - Z axis in the up direction to
machine zero

m
pl
e

N220 G28 G91 Z0. ;

Rapid Traverse and Retracts tool to 2.0 above part


zero

N110 M05 ;

M05 Turn off spindle

N120 G28 G91 Z0. ; / *N120 G53 Z0. ;

Machine Zero Return - Z axis

N140 M01;

Optional Program Stop

N150 T9 M06

Tool Change - Tool # 9

Pr

N130 G28 X0. Y0. ; / *N130 G53 X-15. Y0.;

Send to machine
zero Z-axis first to
Machine Zero Return - X, Y axis avoid any crash.

N160 G00 G90 G54 X1. Y1. S4000 M03 ; Turn on the spindle and Rapid traverse to X1. Y1.
Tool Length compensation for Tool #9 (H9)

Page

N170 G43 H9 Z2. ;

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 7-1

G90 ABSOLUTE PROGRAMMING

Sa

m
pl
e

ABSOLUTE & INCREMENTAL POSITIONING

ew

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.

G91 INCREMENTAL PROGRAMMING

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.

 STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND BACK

G90

G91

12

23

34

45

56

67

78

89

9O

Page

O1

Pr

O (Origin)

ev
i

TO THE POINT O USING G90 & G91

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 7-2

G90 ABSOLUTE PROGRAMMING

Sa

m
pl
e

ABSOLUTE & INCREMENTAL POSITIONING

ew

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.

G91 INCREMENTAL PROGRAMMING

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.

 STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND BACK

ev
i

TO THE POINT O USING G90 & G91

G90

G91
O1

12

23

34

45

56

67

78

89

9O

Pr

O (Origin)

Page

10

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 7-3

G90 ABSOLUTE PROGRAMMING

Sa

m
pl
e

ABSOLUTE & INCREMENTAL POSITIONING

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.

ew

G91 INCREMENTAL PROGRAMMING

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.

 STARTING AT THE POINT O (ORIGIN), DESCRIBE THE PATH FROM O THROUGH ALL 9 POINTS AND BACK

G90

G91
O1

12

Pr

O (Origin)

23

34

45

56

67

78

89

9O

Page

11

ev
i

TO THE POINT O USING G90 & G91

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 7-4

ew

Sa

m
pl
e

ABSOLUTE & INCREMENTAL POSITIONING

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

ev
i

G90

G91
O1

12

23

Pr

O (Origin)

34

45

56

67

78

89

9O

Page

12

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 7-5

ew

Sa

m
pl
e

ABSOLUTE & INCREMENTAL POSITIONING

9DIRECTION OF CUT CW

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

ev
i

G90

G91
O1

12

23

Pr

34

45

56

61

1O

Page

13

CamInstructor CNC Programming Work Book-Generic Mill

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 (710 in. /min.) motion until

m
pl
e

another Group 01 code is specified.


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

Sa

of rapid move.

G00 is used when you are positioning the cutter in fresh air.

Retracting from a hole you have drilled.

Rapid traverse is not used when cutting the part.

Used incorrectly, rapid traverse will break a cutter very easily.

ew

G01 LINEAR INTERPOLATION

ev
i

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.
All axes specified will start at the same time and proceed to their destination and arrive

Pr

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

Page

14

CamInstructor CNC Programming Work Book-Generic Mill

LINEAR INTERPOLATION EXERCISE


9DIRECTION OF CUT CW

EXERCISE # 8-1

9EXERCISE #8-1 CENTER DRILLING

LINEAR INTERPOLATION EXERCISE #8-1 (CENTRE DRILL 4 HOLES .100 DEEP)

Absolute Zero (Part Zero) is the bottom left corner of the part & Z=0 is the top of the part.
Center drill 4 holes .100 deep

ew

Sa

m
pl
e

9EXERCISE #8-2 CONTOUR THE PROFILE

CamInstructor CNC Programming Work Book-Generic Mill

Page

15

Pr

ev
i

%
O00081 (CENTRE DRILL EXERCISE) ;
N1 G20 (VERIFY INCH) ;
N3 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING) ;
N5 T8 M06 (#4 CENTRE DRILL) ;
N7 G90 G54 G00 X
Y
S4000 M03 (HOLE #1 POSITION) ;
N9 G43 H08 Z2. ;
N11 Z.1 (FAST FEED DOWN TO .1 ABOVE THE PART, NON-CUTTING MOVE) ;
F15. (CUT TO THE DEPTH) ;
N13 G01 Z
N15 G
Z.1 (RAPID RETRACT) ;
N17 X
(MOVE TO THE NEXT HOLE POSITION #2) ;
N19 G
Z
(CUT TO THE DEPTH) ;
Z.1 (RAPID RETRACT) ;
N21 G
N23 X
(MOVE TO THE NEXT HOLE POSITION #3) ;
N25 G
Z
(CUT TO THE DEPTH) ;
N27 G
Z.1 (RAPID RETRACT) ;
N29 X
Y
(HOLE POSITION #4) ;
Z
(CUT TO THE DEPTH) ;
N31 G
N33 G00 Z2. M05;
N35 G28 G91 Z0. ;
N37 G28 X0. Y0. ;
N39 M30 (PROGRAM END) ;
%

LINEAR INTERPOLATION EXERCISE(CONTD)

EXERCISE # 8-2

LINEAR INTERPOLATION EXERCISE #8-2 (CONTOUR THE PROFILE .250 DEEP)

Cutter will be a .750 endmill (Tool # 12)


Start contour from the bottom left corner of the part .250 deep.
Cutter Compensation is not being used in this exercise, so when programming, define the center of
cutter to position around the part.
Z=0 is the top of the part.

m
pl
e

O00082 ;
N10 G20 ;

N20 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING) ;

Page

16

Pr

ev
i

ew

Sa

N30

CamInstructor CNC Programming Work Book-Generic Mill

LINEAR INTERPOLATION EXERCISE

EXERCISE # 8-3

m
pl
e

Material: SAE 1018


CS=
ft/min

XY PLANE

Tool #6 (.500 Flat End Mill) Mill the .5 Wide Slot Through the Part
Spindle Speed RPM = 4xCS/D=

in/min

Start from the top of the slot

Sa

Depth of Cut =

Feed =

Page

17

Pr

ev
i

ew

O00083;

CamInstructor CNC Programming Work Book-Generic Mill

LINEAR INTERPOLATION EXERCISE

EXERCISE # 8-4

m
pl
e

Material: Al. 6061


CS=
ft/min

XY PLANE

Spindle Speed RPM = 4xCS/D=

in/min

Start from Position #1

Page

18

Pr

ev
i

O00084;

Feed =

ew

Depth of Cut =

Sa

Tool #6 (.500 Flat End Mill) Mill the profile .125 deep; Z=0 is Top of the Part

CamInstructor CNC Programming Work Book-Generic Mill

DRILL CANNED CYCLE G81


G80 CANCEL CANNED CYCLE

A canned cycle, which permits multiple function programming on one block, is canceled with this
code.

m
pl
e

G81 CANNED CYCLE DRILL


Format: G81 G99 Z-0.625 R0.1 F10.
X
Y
Z
R
F

Rapid X location (Optional)


Rapid Y location (Optional)
Z-depth (Feed to Z-depth starting from R Plane)
R-Plane (Rapid point to start feeding)
Feed rate in inches/min

Sa

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
Canned Cycle Drill.

All Z axis motions are in ABSOLUTE with any other axis motions unaffected.

ew

In a canned cycle drill, the cutter moves at rapid to the X and Y, then to a height above the part at
rapid rate to the R Plane, which is a point above the work surface. From the R Plane the cutter feeds
to the Z-depth at the specified feedrate. When the cutter reaches the Z depth, it retracts at rapid

Page

19

Pr

ev
i

rate to the R Plane.

CamInstructor CNC Programming Work Book-Generic Mill

DRILL CANNED CYCLE EXERCISE

EXERCISE # 9-1

Sa

m
pl
e

Material: CRS 1018


CS=
ft/min

XY PLANE

ew

1. Center Drill -.100 deep in Absolute Mode


2. Drill .25 Holes Through in Incremental Mode
1. Spindle Speed RPM = 4xCS/D=
2. Spindle Speed RPM = 4xCS/D=

in/min
in/min
Drill in order

ev
i

1. Depth of Cut =
2. Depth of Cut =

1. Feed =
2. Feed =

Page

20

Pr

O00091;

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 9-1

Page

21

Pr

ev
i

ew

Sa

m
pl
e

DRILL CANNED CYCLE EXERCISE (CONTD)

CamInstructor CNC Programming Work Book-Generic Mill

10

DEEP HOLE PECK DRILL CANNED CYCLE G83


G83 DEEP HOLE PECK DRILL CANNED CYCLE

Format : G83 G99 Z-2.5 Q0.5 R0.1 F10.

G83 G99 Z-2.18 I0.5 J0.1 K0.2 R0.1 F9.

Sa

m
pl
e

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)
F Feed rate in inches (mm) per minute
* Indicates optional

Page

22

Pr

ev
i

ew

This G code is similar to G81 but is used for drilling when the tool must be withdrawn periodically
to allow chips to be removed from the hole.
This cycle allows the tool to rapid to the R Plane, feeds towards the Z depth in increments
(traversing to the R Plane and back to the point where drilling was interrupted after each
increment) until the tool reaches the final Z depth.

CamInstructor CNC Programming Work Book-Generic Mill

CIRCULAR INTERPOLATION G02 & G03

Sa

m
pl
e

11

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


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

XY PLANE

ew

G02 & G03 Circular Interpolation Format

X4.25 Y3.0

Clockwise
Direction

Arc End Point

G03

X2.25 Y1.0

Counter
Clockwise

Arc End Point

I 0.

J-1.25

Incremental Distance
from the tool start point to the center of arc

ev
i

G02

I 0.

J-.75

Incremental Distance
from the tool start point to the center of arc

F15.
Feed rate 15 in/min

F15.
Feed rate 15 in/min

Pr

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 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 in three pieces of information
into the control.

3. ARC CENTER: INCREMENTAL DISTANCE FROM START POINT TO ARC CENTER (I, J, K)
CamInstructor CNC Programming Work Book-Generic Mill

Page

2. ARC END POINT

23

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

CIRCULAR INTERPOLATION EXERCISE

EXERCISE # 11-1

Contour the profile .200 deep as shown on page 22.


Material: Aluminum 6061 & Use appropriate Spindle Speed and Feedrate.

Page

24

Pr

ev
i

ew

Sa

m
pl
e

O00111;

CamInstructor CNC Programming Work Book-Generic Mill

m
pl
e

G02 CIRCULAR INTERPOLATION

ew

Sa

Entry

** The figure above is taken from HAAS Automation Workbook for educational purpose only.

ev
i

Note: The exercise of G02 circular interpolation above is not using cutter compensation,
so the circular moves that are shown here are defined from the center of the cutter around arc.

I = INCREMENTAL DISTANCE ALONG THE X-AXIS


FROM THE TOOL START POINT TO THE CENTER OF ARC (ARC PIVOT POINT)

Pr

J = INCREMENTAL DISTANCE ALONG THE Y-AXIS


FROM THE TOOL START POINT TO THE CENTER OF ARC (ARC PIVOT POINT)
K = INCREMENTAL DISTANCE ALONG THE Z-AXIS
FROM THE TOOL START POINT TO THE CENTER OF ARC (ARC PIVOT POINT)

Page

25

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.

CamInstructor CNC Programming Work Book-Generic Mill

G02 CIRCULAR INTERPOLATION EXERCISE

EXERCISE # 11-2

Contour the outside profile .200 deep as shown on page 24.


Entry at mid point in a closed contour and .25 away from the part.
Material: Aluminum 6061 & Use appropriate Spindle Speed and Feedrate.

Page

26

Pr

ev
i

ew

Sa

m
pl
e

O00112;

CamInstructor CNC Programming Work Book-Generic Mill

m
pl
e

G03 CIRCULAR INTERPOLATION

ew

Sa

Entry

** The figure above is taken from HAAS Automation Workbook for educational purpose only.

ev
i

Note: The exercise of G02 circular interpolation above is not using cutter compensation,
so the circular moves that are shown here are defined from the center of the cutter around arc.

I = INCREMENTAL DISTANCE ALONG THE X-AXIS


FROM THE TOOL START POINT TO THE CENTER OF ARC (ARC PIVOT POINT)

Pr

J = INCREMENTAL DISTANCE ALONG THE Y-AXIS


FROM THE TOOL START POINT TO THE CENTER OF ARC (ARC PIVOT POINT)
K = INCREMENTAL DISTANCE ALONG THE Z-AXIS
FROM THE TOOL START POINT TO THE CENTER OF ARC (ARC PIVOT POINT)

Page

27

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.

CamInstructor CNC Programming Work Book-Generic Mill

G03 CIRCULAR INTERPOLATION EXERCISE

EXERCISE # 11-3

Contour the inside profile .200 deep as shown on page 26.


Entry at mid point in a closed contour and .25 away from the part.
Material: Aluminum 6061 & Use appropriate Spindle Speed and Feedrate.

Page

28

Pr

ev
i

ew

Sa

m
pl
e

O00113;

CamInstructor CNC Programming Work Book-Generic Mill

CIRCULAR INTERPOLATION EXERCISE

EXERCISE # 11-4

1. Clockwise/ Counter Clockwise?


2. End Point?

ew

Sa

m
pl
e

3. Incremental Distance from the


tool center to the arc center

Note: The exercise of this circular interpolation above is not using cutter compensation,
so the circular moves that are shown here are defined from the center of the cutter around arc.

ev
i

1. What are the coordinates at the center of the cutter for A, B, C, and D
A:

B:

C:

D:

Pr

2. A to B Circular Interpolation (CW)


3. A to C Circular Interpolation (CW)

4. D to C Circular Interpolation (CCW)


5. D to B Circular Interpolation (CCW)

Page

29

3. A to A Circular Interpolation (CW)

CamInstructor CNC Programming Work Book-Generic Mill

CIRCULAR INTERPOLATION EXERCISE

EXERCISE # 11-5

PROGRAM CIRCULAR INTERPOLATION USING ABSOLUTE AND INCREMENTAL IN DIRECTION SHOWN


Y+

ABSOLUTE
X+

X-

(0, 0)

START POINT
END POINT

R=2

Y
Y
Y

/
.
J

m
pl
e

X
X

INCREMENTAL
START

START POINT
END POINT

FINISH
Y-

Y+
START/ FINISH

/
.

ABSOLUTE (COUNTER CLOCKWISE DIRECTION)

(-10, -5)

ABSOLUTE

Sa

X-

Y
Y

X
X

X+

INCREMENTAL

START POINT
END POINT
G

Y
Y

X
X

/
.
J

ew

D=10

INCREMENTAL (CLOCKWISE DIRECTION)


START POINT
END POINT

X
X

Y
Y

/
.

ev
i

Y-

Y+

(5, 2)

Pr

X-

FINISH

ABSOLUTE
X+

START POINT
END POINT
G

R=1.414

Y
Y

X
X

/
.
J

INCREMENTAL
START

START POINT
END POINT

Y
Y

X
X

/
.

Page

30

Y-

CamInstructor CNC Programming Work Book-Generic Mill

CIRCULAR INTERPOLATION EXERCISE

EXERCISE # 11-6

Sa

m
pl
e

Material: Aluminum 6061


CS=
ft/min

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


Spindle Speed RPM = 4xCS/D=

Start from the top left corner

Page

31

Pr

ev
i

O00116 ;

in/min

ew

Depth of Cut =

Feed =

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 11-6

Page

32

Pr

ev
i

ew

Sa

m
pl
e

CIRCULAR INTERPOLATION EXERCISE

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 11-7

Sa

m
pl
e

CIRCULAR INTERPOLATION EXERCISE

Material: Aluminum 6061


CS=
ft/min

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


Depth of Cut =

Feed =

in/min
Start from the top right hand corner

ev
i

ew

Spindle Speed RPM = 4xCS/D=

Page

33

Pr

O00117 ;

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE # 11-7

Page

34

Pr

ev
i

ew

Sa

m
pl
e

CIRCULAR INTERPOLATION EXERCISE

CamInstructor CNC Programming Work Book-Generic Mill

12

G40, G41, & G42 CUTTER COMPENSATION

Cutter Compensation is used to offset the center of the cutter and shift it the distance of the
cutters 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.

m
pl
e

G40 CUTTER COMPENSATION CANCEL


G40 will cancel the G42 or G42 cutter compensation commands.

G41 CUTTER COMPENSATION LEFT

Sa

G41 will select cutter compensation left. The tool is moved to the left of the programmed path to
compensate for the radius of the tool. A Dnn must also be programmed to select the correct tool
size from the DIAMETER/RADIUS offset display register.

G42 CUTTER COMPENSATION RIGHT

ew

G42 will select cutter compensation right. The tool is moved to the right of the programmed path
to compensate for the size of the tool.

Pr

ev
i

G41

G41 Left of the Line

G41
G42 Right of the Line

Page

35

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)

CamInstructor CNC Programming Work Book-Generic Mill

Sa

m
pl
e

G40, G41, & G42 CUTTER COMPENSATION

ew

Without Cutter Compensation

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

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

Page

36

Pr

ev
i

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

Using Cutter Compensation

CamInstructor CNC Programming Work Book-Generic Mill

13

PROGRAMMING EXERCISE

EXERCISE #13

Material: Aluminum 6061


CS=
ft/min

m
pl
e

P4

P3

Sa

P1

XY PLANE

ew

P2

1. Tool #8 (Center Drill) Center Drill 4 Holes to a depth of .100 in Absolute Mode (G90)

ev
i

Spindle Speed RPM = 4xCS/D=


Depth of Cut =

Feed =
in/min
Use a G81 Canned Cycle

2. Tool #10 (.250 Drill) Drill 4 Holes through the part in Incremental Mode (G91)
Feed =
in/min

Pr

Spindle Speed RPM = 4xCS/D=


Depth of Cut = Through

Use a G81 Canned Cycle

3. Tool #6 (.500 Flat End Mill) Mill the Profile to a depth of .260 in Absolute Mode (G90)
Feed =
in/min

Spindle Speed RPM = 4xCS/D=


Depth of Cut =

Start from the top left corner

Cutter Compensation is not being used

Center Drill all holes in order P1, P2, P3, & P4 in Absolute Mode and drill them in
Incremental Mode. The next step will be to contour the profile using an endmill.
CamInstructor CNC Programming Work Book-Generic Mill

Page

37

With given information as above, write a CNC program.

PROGRAMMING EXERCISE (CONTINUED)

EXERCISE #13

Page

38

Pr

ev
i

ew

Sa

m
pl
e

O00013;

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE #13

Page

39

Pr

ev
i

ew

Sa

m
pl
e

PROGRAMMING EXERCISE (CONTINUED)

CamInstructor CNC Programming Work Book-Generic Mill

14

CNC PROGRAMMING EXERCISE

EXERCISE #14

Material: Aluminum 6061


CS=
ft/min

ew

Sa

m
pl
e

XY PLANE

1. Tool #8 (Center Drill) Center Drill 4 Holes in this order


Spindle Speed RPM = 4xCS/D=

ev
i

Depth of Cut =

Feed =
in/min
Use a G81 Canned Cycle

2. Tool #10 (.250 Drill) Drill 4 Holes through the part; Decide on the appropriate depth
Feed =
in/min

Spindle Speed RPM = 4xCS/D=

Use a G81 Canned Cycle

Pr

Depth of Cut = Through

3. Tool #6 (.500 Flat End Mill) Machine the inside contour to a depth of .125 (G90)
Entry and Exit .500 away from the part
Feed =
in/min

Spindle Speed RPM = 4xCS/D=


Depth of Cut =

Start from the top left corner

USING CUTTER COMPENSATION (G41)

Page

40

With given information as above, write a CNC program.

Center Drill all holes 1, 2, 3, and 4 in this order and drill all holes through the part. Then using an
endmill, contour the inside profile to a depth of .125.

CamInstructor CNC Programming Work Book-Generic Mill

CNC PROGRAMMING EXERCISE (CONTINUED)

EXERCISE #14

Page

41

Pr

ev
i

ew

Sa

m
pl
e

O00014;

CamInstructor CNC Programming Work Book-Generic Mill

EXERCISE #14

Page

42

Pr

ev
i

ew

Sa

m
pl
e

CNC PROGRAMMING EXERCISE (CONTINUED)

CamInstructor CNC Programming Work Book-Generic Mill

Page

44

Pr

ev
i

ew

Sa

m
pl
e

Standard MILL G & M CODES

CamInstructor CNC Programming Work Book-Generic Mill

You might also like