Professional Documents
Culture Documents
Libro de Trabajo de Programacion CNC
Libro de Trabajo de Programacion CNC
ev
i
ew
Sa
m
pl
e
Generic Mill
Sa
m
pl
e
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
TABLE OF CONTENTS
Sa
ew
ev
i
7
8
8
9
14
15
19
20
22
24
26
28
29
Pr
35
37
40
Page
m
pl
e
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
Sa
ev
i
ew
Pr
10
Page
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 *
G03 *
G04
Dwell
G17
G20
G21
G28
G40
G41
G42
G43
G49
G54
G80 *
G81 *
G82
Pr
ev
i
ew
Sa
m
pl
e
G00 *
G83 *
G84
G90 *
G91 *
G98
G99
Page
CODE
FUNCTION
M01
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
M05
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
M30
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.
O00023 ;
N10 G20 ;
m
pl
e
Sa
Startup
Block
(Machine
Default
Setting)
ew
N30 T8 M06 ;
Page
Pr
ev
i
N210 M05 ;
N240 M30 ;
*Another way to
return to machine
zero
ev
i
ew
Send to machine
zero Z-axis first to
avoid any crash.
Sa
m
pl
e
N110 M05 ;
N140 M01;
N150 T9 M06
Pr
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
EXERCISE # 7-1
Sa
m
pl
e
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.
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
EXERCISE # 7-2
Sa
m
pl
e
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.
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
G90
G91
O1
12
23
34
45
56
67
78
89
9O
Pr
O (Origin)
Page
10
EXERCISE # 7-3
Sa
m
pl
e
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
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
EXERCISE # 7-4
ew
Sa
m
pl
e
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
EXERCISE # 7-5
ew
Sa
m
pl
e
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
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
Sa
of rapid move.
G00 is used when you are positioning the cutter in fresh air.
ew
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
Drilling a hole
Machining a slot
Machining a profile
Page
14
EXERCISE # 8-1
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
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) ;
%
EXERCISE # 8-2
m
pl
e
O00082 ;
N10 G20 ;
N20 G00 G17 G40 G49 G80 G90 (MACHINE DEFAULT SETTING) ;
Page
16
Pr
ev
i
ew
Sa
N30
EXERCISE # 8-3
m
pl
e
XY PLANE
Tool #6 (.500 Flat End Mill) Mill the .5 Wide Slot Through the Part
Spindle Speed RPM = 4xCS/D=
in/min
Sa
Depth of Cut =
Feed =
Page
17
Pr
ev
i
ew
O00083;
EXERCISE # 8-4
m
pl
e
XY PLANE
in/min
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
A canned cycle, which permits multiple function programming on one block, is canceled with this
code.
m
pl
e
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
EXERCISE # 9-1
Sa
m
pl
e
XY PLANE
ew
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;
EXERCISE # 9-1
Page
21
Pr
ev
i
ew
Sa
m
pl
e
10
Sa
m
pl
e
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.
Sa
m
pl
e
11
XY PLANE
ew
X4.25 Y3.0
Clockwise
Direction
G03
X2.25 Y1.0
Counter
Clockwise
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
23
EXERCISE # 11-1
Page
24
Pr
ev
i
ew
Sa
m
pl
e
O00111;
m
pl
e
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.
Pr
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.
EXERCISE # 11-2
Page
26
Pr
ev
i
ew
Sa
m
pl
e
O00112;
m
pl
e
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.
Pr
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.
EXERCISE # 11-3
Page
28
Pr
ev
i
ew
Sa
m
pl
e
O00113;
EXERCISE # 11-4
ew
Sa
m
pl
e
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
Page
29
EXERCISE # 11-5
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
/
.
(-10, -5)
ABSOLUTE
Sa
X-
Y
Y
X
X
X+
INCREMENTAL
START POINT
END POINT
G
Y
Y
X
X
/
.
J
ew
D=10
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-
EXERCISE # 11-6
Sa
m
pl
e
Page
31
Pr
ev
i
O00116 ;
in/min
ew
Depth of Cut =
Feed =
EXERCISE # 11-6
Page
32
Pr
ev
i
ew
Sa
m
pl
e
EXERCISE # 11-7
Sa
m
pl
e
Feed =
in/min
Start from the top right hand corner
ev
i
ew
Page
33
Pr
O00117 ;
EXERCISE # 11-7
Page
34
Pr
ev
i
ew
Sa
m
pl
e
12
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
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.
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
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)
Sa
m
pl
e
ew
%
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 ;
%
13
PROGRAMMING EXERCISE
EXERCISE #13
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
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
3. Tool #6 (.500 Flat End Mill) Mill the Profile to a depth of .260 in Absolute Mode (G90)
Feed =
in/min
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
EXERCISE #13
Page
38
Pr
ev
i
ew
Sa
m
pl
e
O00013;
EXERCISE #13
Page
39
Pr
ev
i
ew
Sa
m
pl
e
14
EXERCISE #14
ew
Sa
m
pl
e
XY PLANE
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
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 =
in/min
Page
40
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.
EXERCISE #14
Page
41
Pr
ev
i
ew
Sa
m
pl
e
O00014;
EXERCISE #14
Page
42
Pr
ev
i
ew
Sa
m
pl
e
Page
44
Pr
ev
i
ew
Sa
m
pl
e