Sunteți pe pagina 1din 43

Computer Numerical Control

Programming Workbook

e
pl
m
Sa
iew
ev
Pr

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

Copyright © 2010 CamInstructor Inc. - All rights reserved.

e
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

pl
electronic medium or machine-readable form without prior consent, in writing, from CamInstructor Inc.

National Library of Canada Cataloguing in Publication

m
To order additional copies of the book contact:
CamInstructor Inc.
330 Chandos Crt, Kitchener, ON, N2A 3C2 Sa
Phone 1-877-873-6867
Fax 1-866-741-8421
email sales@caminstructor.com

Limit of Liability/Disclaimer of Warranty: While the Publisher and Author have used their best efforts in
ew

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

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

Trademarks
Pr

Haas is a registered trademark of Haas Automation, Inc.


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.
August 3, 2010
2
Page

CamInstructor CNC Programming Work Book-Generic Mill


TABLE OF CONTENTS

1. AUTOMATIC TOOL CHANGER STANDARD TOOL CAROUSEL 4

2. COMMONLY USED PREPARATORY G CODES 5

3. COMMONLY USED MISCELLANEOUS M CODES 6

e
4. EXAMPLE OF PROGRAM START-UP LINES 7

pl
5. EXAMPLE OF PROGRAM ENDING LINES 8

6. EXAMPLE OF PROGRAM TOOL CHANGE LINES 8

m
7. ABSOLUTE & INCREMENTAL POSITIONING 9

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


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

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


ew

9. DRILL CANNED CYCLE (G81) 19

a. DRILL CANNED CYCLE: EXERCISE # 9-1 20


i

10. DEEP HOLE PECK DRILL CANNED CYCLE (G83) 22


ev

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

a. G02 CIRCULAR INTERPOLATION : EXERCISE # 11-2 26


Pr

b. G03 CIRCULAR INTERPOLATION : EXERCISE # 11-3 28

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

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

13. CNC PROGRAMMING: EXERCISE # 13 37

14. CNC PROGRAMMING: EXERCISE # 14 40


3
Page

CamInstructor CNC Programming Work Book-Generic Mill


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

e
Carousel # Tool Description

pl
1 0.125” Diameter Flat End Mill

m
2 0.1875” Diameter Flat End Mill

3
Sa 0.250” Diameter Flat End Mill

4 0.3125” Diameter Flat End Mill


ew

5 0.375” Diameter Flat End Mill

6 0.500” Diameter Flat End Mill


i
ev

7 0.625” Diameter Flat End Mill


Pr

8 # 4 Centre Drill

9 0.187” Diameter Drill

10 0.250” Diameter Drill


4
Page

CamInstructor CNC Programming Work Book-Generic Mill


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

e
rate (I.P.M.) of a CNC Machine will vary depending on the model of the machine.

G02 * Circular Interpolation, Clockwise

pl
G03 * Circular Interpolation, Counterclockwise
G04 Dwell

m
G17 Circular Motion XY Plane Selection
G20 Verify Inch Coordinate Positions
G21
G28
Sa
Verify Metric Coordinate Positions
Machine Home (Rapid traverse)
G40 Cutter Compensation CANCEL
G41 Cutter Compensation LEFT of the programmed path
ew

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)
i

G80 * Canned Cycle CANCEL


ev

G81 * Drill Canned Cycle


G82 Spot Drill Canned Cycle
Pr

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

* Programming exercises included


5
Page

CamInstructor CNC Programming Work Book-Generic Mill


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

e
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

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

m
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. Sa
M04 Starts the spindle COUNTERCLOCKWISE. Must have a spindle speed defined.

STOPS the spindle.


M05 The M05 is used to turn the spindle off at the end of program or before a tool change.
ew

If the coolant is on, the M05 will turn it off.

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
M06
machine zero position and the selected tool will be put in the spindle. The coolant
i

pump will turn off right before executing the tool change.
ev

M08 Coolant ON command.


Pr

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

CamInstructor CNC Programming Work Book-Generic Mill


4 EXAMPLE OF PROGRAM START-UP LINES

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 ;

e
G20 - Verify Inch
Startup

pl
G00 - Rapid Traverse Block
G17 - X, Y Circular Plane Selection (Machine
G40 - Cutter Compensation Cancel Default

m
N20 G00 G17 G40 G49 G80 G90 ;
G49 - Tool Length Compensation Cancel Setting)
G80 - Canned Cycle Cancel
Sa G90 - Absolute Programming

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


N30 T8 M06 ;
M06 - Tool Change
ew

G00 - Rapid Traverse


G90 - Activates control to be in ABSOLUTE.
G54 - Selects work coordinate offset system No. 1
N40 G00 G90 G54 X1. Y1. S4000 M03 ; X__ - Axis move to initial X position.
i

Y__ - Axis move to initial Y position.


ev

S4000 - Spindle speed 4000 RPM for this tool.


M03 - Turns the spindle on in a clockwise direction
Pr

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

CamInstructor CNC Programming Work Book-Generic Mill


5 EXAMPLE OF PROGRAM ENDING LINES

G00 - Rapid Traverse


N200 G00 Z2. ;
Z2. – 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

e
Z0. - Z axis in the up direction to zero Z-axis first to
* N220 G53 Z0. ; avoid any crash.
machine zero

pl
*Another way to
N230 G28 X0. Y0. ; G28 - Machine Zero Return
return to machine
X0. - X axis to machine zero

m
zero
* N230 G53 X-15. Y0.; Y0. - Y axis to machine zero

N240 M30 ;
Sa
M30 – End of Program and Reset

6 EXAMPLE OF PROGRAM TOOL CHANGE LINES


ew

Rapid Traverse and Retracts tool to 2.0 above part


N100 G00 Z2. ;
zero

N110 M05 ;
i

M05 – Turn off spindle


ev

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 X-15. Y0.; Machine Zero Return - X, Y axis avoid any crash.
Pr

N140 M01; Optional Program Stop

N150 T9 M06 Tool Change - Tool # 9

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

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


8
Page

CamInstructor CNC Programming Work Book-Generic Mill


7 ABSOLUTE & INCREMENTAL POSITIONING EXERCISE # 7-1

e
pl
m
Sa
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.
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
TO THE POINT O USING G90 & G91
i
ev

G90 X Y G91 X Y
O (Origin) O→1
1 1→2
Pr

2 2→3
3 3→4
4 4→5
5 5→6
6 6→7
7 7→8
8 8→9
9 9→O
9
Page

CamInstructor CNC Programming Work Book-Generic Mill


ABSOLUTE & INCREMENTAL POSITIONING EXERCISE # 7-2

e
pl
m
Sa
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.
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
TO THE POINT O USING G90 & G91
i
ev

G90 X Y G91 X Y
O (Origin) O→1
1 1→2
Pr

2 2→3
3 3→4
4 4→5
5 5→6
6 6→7
7 7→8
8 8→9
10

9 9→O
Page

CamInstructor CNC Programming Work Book-Generic Mill


ABSOLUTE & INCREMENTAL POSITIONING EXERCISE # 7-3

e
pl
m
G90 ABSOLUTE PROGRAMMING
Sa
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


ew

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
TO THE POINT O USING G90 & G91
i
ev

G90 X Y G91 X Y
O (Origin) O→1
1 1→2
Pr

2 2→3
3 3→4
4 4→5
5 5→6
6 6→7
7 7→8
8 8→9
11

9 9→O
Page

CamInstructor CNC Programming Work Book-Generic Mill


ABSOLUTE & INCREMENTAL POSITIONING EXERCISE # 7-4

e
pl
m
Sa
ew

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

G90 X Y G91 X Y
i
ev

O (Origin) O→1
1 1→2
2 2→3
Pr

3 3→4
4 4→5
5 5→6
6 6→7
7 7→8
8 8→9
9 9→O
12
Page

CamInstructor CNC Programming Work Book-Generic Mill


ABSOLUTE & INCREMENTAL POSITIONING EXERCISE # 7-5

e
pl
m
Sa
9DIRECTION OF CUT CW 3
ew

 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

G90 X Y G91 X Y
i
ev

O O→1
1 1→2
2 2→3
Pr

3 3→4
4 4→5
5 5→6
6 6→1
1 1→O
O
13
Page

CamInstructor CNC Programming Work Book-Generic Mill


8 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
another Group 01 code is specified.

e
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

pl
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

m
of rapid move.



Sa
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


This G code provides for straight line (linear) motion with programmed feedrate for all axis motions
i

from point to point. Motion can occur up to three axes at once.


ev

All axes specified will start at the same time and proceed to their destination and arrive
simultaneously at the specified feedrate.
Pr

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
14
Page

CamInstructor CNC Programming Work Book-Generic Mill


LINEAR INTERPOLATION EXERCISE EXERCISE # 8-1

9DIRECTION OF CUT CW 3
9EXERCISE #8-1 CENTER DRILLING

9EXERCISE #8-2 CONTOUR THE PROFILE

e
pl
m
Sa
ƒ 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

%
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) ;
i

N9 G43 H08 Z2. ;


ev

N11 Z.1 (FAST FEED DOWN TO .1 ABOVE THE PART, NON-CUTTING MOVE) ;
N13 G01 Z F15. (CUT TO THE DEPTH) ;
N15 G Z.1 (RAPID RETRACT) ;
N17 X (MOVE TO THE NEXT HOLE POSITION #2) ;
Pr

N19 G Z (CUT TO THE DEPTH) ;


N21 G Z.1 (RAPID RETRACT) ;
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) ;
N31 G Z (CUT TO THE DEPTH) ;
N33 G00 Z2. M05;
N35 G28 G91 Z0. ;
N37 G28 X0. Y0. ;
N39 M30 (PROGRAM END) ;
15

%
Page

CamInstructor CNC Programming Work Book-Generic Mill


LINEAR INTERPOLATION EXERCISE(CONT’D) 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.

%
O00082 ;

e
N10 G20 ;

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

m
Sa
i ew
ev
Pr
16
Page

CamInstructor CNC Programming Work Book-Generic Mill


LINEAR INTERPOLATION EXERCISE EXERCISE # 8-3

Material: SAE 1018


CS= ft/min

e
pl
XY PLANE

m
Tool #6 (Ø.500” Flat End Mill) – Mill the .5” Wide Slot Through the Part
Spindle Speed RPM = 4xCS/D= Feed = in/min
Depth of Cut = Sa Start from the top of the slot

%
O00083;
i ew
ev
Pr

17
Page

CamInstructor CNC Programming Work Book-Generic Mill


LINEAR INTERPOLATION EXERCISE EXERCISE # 8-4

Material: Al. 6061


CS= ft/min

e
pl
XY PLANE

m
Tool #6 (Ø.500” Flat End Mill) – Mill the profile .125 deep; Z=0 is Top of the Part
Sa
Spindle Speed RPM = 4xCS/D= Feed = in/min
Depth of Cut = Start from Position #1

%
ew

O00084;
i
ev
Pr
18
Page

CamInstructor CNC Programming Work Book-Generic Mill


9 DRILL CANNED CYCLE G81

G80 CANCEL CANNED CYCLE


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

G81 CANNED CYCLE DRILL

e
Format: G81 G99 Z-0.625 R0.1 F10.
X Rapid X location (Optional)

pl
Y Rapid Y location (Optional)
Z Z-depth (Feed to Z-depth starting from R Plane)
R R-Plane (Rapid point to start feeding)

m
F Feed rate in inches/min

This G code permits the inclusion of multiple axis motions on one block of program. It is used to
Sa
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.
In a canned cycle drill, the cutter moves at rapid to the X and Y, then to a height above the part at
ew

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
rate to the R Plane.
i
ev
Pr

19
Page

CamInstructor CNC Programming Work Book-Generic Mill


DRILL CANNED CYCLE EXERCISE EXERCISE # 9-1

Material: CRS 1018


CS= ft/min

e
pl
m
Sa XY PLANE

1. Center Drill -.100 deep in Absolute Mode


2. Drill Ø.25 Holes Through in Incremental Mode
ew

1. Spindle Speed RPM = 4xCS/D= 1. Feed = in/min


2. Spindle Speed RPM = 4xCS/D= 2. Feed = in/min

1. Depth of Cut =
Drill in order
2. Depth of Cut =
i
ev

%
O00091;
Pr
20
Page

CamInstructor CNC Programming Work Book-Generic Mill


DRILL CANNED CYCLE EXERCISE (CONT’D) EXERCISE # 9-1

e
pl
m
Sa
ewi
ev
Pr

21
Page

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

e
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)

pl
K* Minimum peck depth (if Q is not used)
P Dwell time at Z-depth

m
R R-plane (rapid point to start feeding)
F Feed rate in inches (mm) per minute
* Indicates optionalSa
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
ew

increment) until the tool reaches the final Z depth.


i
ev
Pr
22
Page

CamInstructor CNC Programming Work Book-Generic Mill


11 CIRCULAR INTERPOLATION G02 & G03

e
pl
m
Sa G02 X4.25 Y3. I 0. J-1.25
G03 X2.25 Y1. I 0. J-.75 XY PLANE

G02 & G03 Circular Interpolation Format


ew

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


Clockwise Incremental Distance Feed rate 15 in/min
Arc End Point
Direction from the tool start point to the center of arc
G03 X2.25 Y1.0 I 0. J-.75 F15.
i

Counter Incremental Distance Feed rate 15 in/min


Arc End Point
ev

Clockwise 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
used (G01). When it is necessary to travel in the circular motion in any plane (XY, YZ, XZ) circular
Pr

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.

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

2. ARC END POINT


23

3. ARC CENTER: INCREMENTAL DISTANCE FROM START POINT TO ARC CENTER (I, J, K)
Page

CamInstructor CNC Programming Work Book-Generic Mill


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.

%
O00111;

e
pl
m
Sa
i ew
ev
Pr
24
Page

CamInstructor CNC Programming Work Book-Generic Mill


G02 CIRCULAR INTERPOLATION

e
pl
Entry

m
Sa
ew

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

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
ev

I = INCREMENTAL DISTANCE ALONG THE X-AXIS


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

J = INCREMENTAL DISTANCE ALONG THE Y-AXIS


Pr

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)

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

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.

%
O00112;

e
pl
m
Sa
i ew
ev
Pr
26
Page

CamInstructor CNC Programming Work Book-Generic Mill


G03 CIRCULAR INTERPOLATION

e
pl
Entry

m
Sa
ew

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

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

I = INCREMENTAL DISTANCE ALONG THE X-AXIS


ev

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

J = INCREMENTAL DISTANCE ALONG THE Y-AXIS


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

K = INCREMENTAL DISTANCE ALONG THE Z-AXIS


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

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

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.

%
O00113;

e
pl
m
Sa
i ew
ev
Pr
28
Page

CamInstructor CNC Programming Work Book-Generic Mill


CIRCULAR INTERPOLATION EXERCISE EXERCISE # 11-4

1. Clockwise/ Counter Clockwise?


2. End Point?
3. Incremental Distance from the
tool center to the arc center

e
pl
m
Sa
ew

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.

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

A: B:
ev

C: D:
2. A to B Circular Interpolation (CW)
Pr

3. A to C Circular Interpolation (CW)

4. D to C Circular Interpolation (CCW)

5. D to B Circular Interpolation (CCW)

3. A to A Circular Interpolation (CW)


29
Page

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+ START POINT X Y /
(0, 0) END POINT X Y .

G X Y I J .

e
R=2
INCREMENTAL

pl
START FINISH START POINT X Y /
END POINT X Y .
Y-

m
G X Y I J .

Y+ Sa ABSOLUTE (COUNTER CLOCKWISE DIRECTION)

X- START/ FINISH (-10, -5) X+ START POINT X Y /


END POINT X Y .
ABSOLUTE INCREMENTAL

G X Y I J .
D=10
ew

INCREMENTAL (CLOCKWISE DIRECTION)

START POINT X Y /
END POINT X Y .
Y-
i

G X Y I J .
ev

Y+ ABSOLUTE
FINISH
X- (5, 2) X+
START POINT X Y /
Pr

END POINT X Y .

G X Y I J .

R=1.414
INCREMENTAL

START START POINT X Y /


END POINT X Y .
Y-
G X Y I J .
30
Page

CamInstructor CNC Programming Work Book-Generic Mill


CIRCULAR INTERPOLATION EXERCISE EXERCISE # 11-6

Material: Aluminum 6061


CS= ft/min

e
pl
m
Spindle Speed RPM = 4xCS/D=
Sa
Tool #6 (Ø.500” Flat End Mill) – Mill the profile
Feed = in/min
Depth of Cut = Start from the top left corner
ew

%
O00116 ;
i
ev
Pr

31
Page

CamInstructor CNC Programming Work Book-Generic Mill


CIRCULAR INTERPOLATION EXERCISE EXERCISE # 11-6

e
pl
m
Sa
ewi
ev
Pr
32
Page

CamInstructor CNC Programming Work Book-Generic Mill


CIRCULAR INTERPOLATION EXERCISE EXERCISE # 11-7

e
pl
m
Sa Material: Aluminum 6061
CS= ft/min

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


Spindle Speed RPM = 4xCS/D= Feed = in/min
ew

Depth of Cut = Start from the top right hand corner

%
i

O00117 ;
ev
Pr

33
Page

CamInstructor CNC Programming Work Book-Generic Mill


CIRCULAR INTERPOLATION EXERCISE EXERCISE # 11-7

e
pl
m
Sa
ewi
ev
Pr
34
Page

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.

G40 CUTTER COMPENSATION CANCEL

e
G40 will cancel the G42 or G42 cutter compensation commands.

pl
G41 CUTTER COMPENSATION LEFT

m
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.
Sa
G42 CUTTER COMPENSATION RIGHT

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

G41
i
ev

G41
Pr

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)
35
Page

CamInstructor CNC Programming Work Book-Generic Mill


G40, G41, & G42 CUTTER COMPENSATION

e
pl
m
Sa
Without Cutter Compensation Using Cutter Compensation
ew

% %
O10011 ; O10012 ;
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;
i

N3 G43 H12 Z2. ; N3 G43 H12 Z2. ;


ev

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) ;
Pr

N8 X?.???? Y2.375 (Point D) ; N8 X1.732 Y2.0 (P2) ;


N8 X2.875 (Point E) ; N8 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
36

Centers (Point B,C,D & E)


Page

CamInstructor CNC Programming Work Book-Generic Mill


13 PROGRAMMING EXERCISE EXERCISE #13

Material: Aluminum 6061


CS= ft/min

P4

e
pl
P3

m
P1
Sa P2
ew

XY PLANE

1. Tool #8 (Center Drill) – Center Drill 4 Holes to a depth of .100 in Absolute Mode (G90)
Feed =
Spindle Speed RPM = 4xCS/D=
in/min
i
ev

Depth of Cut = Use a G81 Canned Cycle


2. Tool #10 (Ø.250” Drill) – Drill 4 Holes through the part in Incremental Mode (G91)
Feed =
Spindle Speed RPM = 4xCS/D=
in/min
Pr

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 =
Spindle Speed RPM = 4xCS/D=
in/min
Depth of Cut = Start from the top left corner
Cutter Compensation is not being used
With given information as above, write a CNC program.

• Center Drill all holes in order P1, P2, P3, & P4 in Absolute Mode and drill them in
37

Incremental Mode. The next step will be to contour the profile using an endmill.
Page

CamInstructor CNC Programming Work Book-Generic Mill


PROGRAMMING EXERCISE (CONTINUED) EXERCISE #13

%
O00013;

e
pl
m
Sa
i ew
ev
Pr
38
Page

CamInstructor CNC Programming Work Book-Generic Mill


PROGRAMMING EXERCISE (CONTINUED) EXERCISE #13

e
pl
m
Sa
ewi
ev
Pr

39
Page

CamInstructor CNC Programming Work Book-Generic Mill


14 CNC PROGRAMMING EXERCISE EXERCISE #14

Material: Aluminum 6061 XY PLANE


CS= ft/min

e
pl
m
Sa
ew

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


Feed =
Spindle Speed RPM = 4xCS/D=
in/min
Depth of Cut = Use a G81 Canned Cycle
i
ev

2. Tool #10 (Ø.250” Drill) – Drill 4 Holes through the part; Decide on the appropriate depth
Feed =
Spindle Speed RPM = 4xCS/D=
in/min
Depth of Cut = Through Use a G81 Canned Cycle
Pr

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 =
Spindle Speed RPM = 4xCS/D=
in/min
Depth of Cut = Start from the top left corner
USING CUTTER COMPENSATION (G41)

With given information as above, write a CNC program.


40

• Center Drill all holes 1, 2, 3, and 4 in this order and drill all holes through the part. Then using an
Page

endmill, contour the inside profile to a depth of .125”.

CamInstructor CNC Programming Work Book-Generic Mill


CNC PROGRAMMING EXERCISE (CONTINUED) EXERCISE #14

%
O00014;

e
pl
m
Sa
i ew
ev
Pr

41
Page

CamInstructor CNC Programming Work Book-Generic Mill


CNC PROGRAMMING EXERCISE (CONTINUED) EXERCISE #14

e
pl
m
Sa
ew
i
ev
Pr
42
Page

CamInstructor CNC Programming Work Book-Generic Mill


Standard MILL G & M CODES

e
pl
m
Sa
ewi
ev
Pr
44
Page

CamInstructor CNC Programming Work Book-Generic Mill

S-ar putea să vă placă și