Professional Documents
Culture Documents
The M06 tool change command performs an auto- In block N80, the modal G01 command invokes a lin-
matic tool change. The T1 command tells the automatic tool ear interpolation command and feeds the tool to point 2. The
changer to pick tool number 1. In this case, tool number 1 is modal feed rate that was active in block N70 has been changed
a .500 in.-diameter end milling cutter. to a feed rate of 10 inches per minute. The G01 command is
modal and will remain in effect until rapid traverse or another
interpolation mode is invoked. It was repeated in this line only
BLOCK #30 for clarity. The tool is fed around the part in a clockwise direc-
N30 G00 G54 X0.0 Y-1.0 M08 tion. This was done to perform climb milling. In CNC milling,
it is considered best to climb mill. Unlike a conventional milling
The G00 establishes rapid traverse positioning. machine, the CNC’s ball screws will permit climb milling with
Rapid traverse is used only to position the tool to a loca- no backlash problems. Climb milling will produce a better sur-
tion. The G54 activates the workpiece coordinate setting. face finish and possibly better dimensional control of the part.
The work coordinates setting informs the control where
the part is located on the table. The lower left corner of BLOCK #90
the part is the absolute X and Y zero point for this part N90 X4.5
(Figure M-33).
The tool rapidly positions to the absolute workpiece In N90, once again, the G01 modal command executes
coordinates of X0.0 and Y-1.0. This position is off of another linear interpolation to point 3. Because the G90
the part. You don’t want to plunge down onto the part. absolute positioning mode is invoked, it is not necessary to
The M08 starts the coolant. The position coordinates program the Y word address because the Y coordinate posi-
are to the center of the cutter, therefore, to compensate tion is the same as position 2.
for the radius of the cutter the position will have to be
adjusted otherwise the finish part size would be reduced BLOCK #100
by the amount of the cutter radius. Cutter radius com- N100 Y0.0
pensation will be covered later in this section. Cutter
radius compensation allows the programmer to program In N100, the G01 modal command executes another
the exact part shape. linear interpolation to point 5.
BLOCK #110
BLOCK #40
N110 X-1.0
N40 G43 H01
In N110, the G01 modal command executes another
A G43 activates a Z tool length offset. The H01 is the
linear interpolation to point 5. Point 5 is off the part. Feed-
particular height offset for tool 1.
ing the tool off of the part will ensure that no tool marks will
be left on the finished part.
BLOCK #50
N50 M03 S1600 N120 Z.10
Spindle start with clockwise rotation at a speed of 1600 In N120, the tool feeds up to a Z-axis clearance position.
rpm. As you become a more experienced programmer a rapid
move to a clearance position might be more appropriate.
BLOCK #60 BLOCK #130
N60 G00 Z0.1 N130 G28
Rapid traverse position mode positions the tool to a On line N130, the machine returns to a reference point.
clearance point .10 in. above the top of the part. Some CNC machines may require additional coordinate
UNIT TWO CNC PROGRAMMING 669
4.00''
t
cu
of
ction
Angular re
Di
interpolated
tool path
Y Axis 3.000
3.00'' 4.00''
X Axis
4.000
Cutter
Nxx G01 X 4.000 Y 3.000
entries. On most machines the reference point is a machine Figure M-35 Workpiece drawing of the hexagonal boss angular
home position. The home position of the machine is nor- linear interpolation program.
mally at the furthest extent of machine travels.
Figure M-36 The angular linear Point Point Cutter Surface projection
interpolated tool path around the 2 3
hexagonal boss, illustrating how to
move the cutter around the corners
properly.
Hex
corner
Point Point
1 4
Tangent
points
Cut
direction
Point Tangent
5 points
Surface
Hex projection
Entry Cutter corner
point
Centerline
of tool path
The tool has been positioned .100 over the entry point G01 linear interpolation moves the cutter to point 2.
and is plunged into the work to the required depth. The The X-axis motion is now positive. The Y-axis motion
Z-.350 command moves the tool down the .100 it is above remains positive.
the work and the .250 part thickness. G91 invokes incre-
mental positioning mode. BLOCK #30
N30 X2.0438
be achieved. For the cutter to be positioned correctly, it must see that a Y-axis move of only .020 in. will not position the
move inward toward the center of the hexagon along a radial cutter correctly for the finish cut. The X-axis motion is also
line passing through the corner of the hex and the part center. required to keep the cutter centerline on the radial projec-
This requires a move in both the X and Y axes (Figure M-37). tion line to the center of the hex boss. The amount of X-axis
The illustration shows an overview of the cutter position motion is calculated trigonometrically based on the .020-in.
for roughing and for finishing. Note how the cutter must final machining allowance and the angle along which the
move in so that it is tangent to the projected surfaces of the cutter most move toward the center of the feature.
finished hexagon. Figure M-38 shows a detail of the tool The rest of the program would remove the .020-in. fin-
motion. For the cutter to be correctly positioned and tangent ish allowance from the sides of the hexagon and machine
to the projected surfaces of the finished hex feature, a small the final dimension across the flats. A new hex dimension of
X-axis motion of .0115 in. is required along with the .020 3.500 would be used to compensate for the cutter radius of
in on the Y axis. This angular interpolation motion moves .250 in. This will also necessitate new X and Y dimensions to
the cutter in along a radial line extending through the center be calculated, because this final shape is smaller. We will not
of the hex boss. The illustration shows the cutter centerline examine the finish portion of the program. The axis motions
locations for both the roughing and finishing cuts. You can would be the same as for the roughing cuts. Final linear
cut line
he l lin
Rough
R
Hex
cut line corner
Tangent
Cutter at point
start of finish cut
Cutter at Tangent
start of rough cut point .020 in.
finish cut
allowance
Hex
Cutter in corner Figure M-38 Detail showing the
finishing
position Finish cut line X-axis motion required to position
Y Axis the cutter properly for the finish
Rough cut line cut.
Centerline
of cutter at
finish cut entry
Centerline
of cutter at
rough cut entry Y=.020
X=.0115
X Axis
Cutter in
rough position
672 SECTION M COMPUTER NUMERICAL CONTROL AND OTHER ADVANCED MACHINING PROCESSES
interpolation blocks would mill the remaining material to compensation dimension may be invoked and the part fin-
machine to part to the finish dimensions. ish machined to the drawing specifications. Cutter radius
Keep in mind that there are always many ways to compensation is canceled by the G40 command, which may
accomplish almost any CNC machining task. The preceding appear in the initial insurance block of the program.
program examples are intended to familiarize you with the
use of some simple programming codes and common inter-
Circular Interpolation
polation modes. When programming, always look for the
most efficient tool paths and optimum feeds and speeds to Up to this point, we only looked at straight-line moves. If
fully realize the productivity of the CNC machine tool. a CNC machine was only capable of straight-line moves,
it would be very limited. One of the most important fea-
Cutter Radius Compensation CNC programming for tures of a CNC machine is the ability to do circular cutting
milling and drilling is always based on the center of the cutting motions. CNC machines are capable of cutting an arc of any
tool. Because every cutter has a certain diameter and radius, it specified radius. Arc or radius cutting is known as circular
should be apparent that the outside dimensions of the work- interpolation. Circular interpolation is carried out with a
piece will be reduced by the amount of the cutter radius. When G02 or G03 code.
an inside feature is machined, the workpiece dimensions will
be increased by the cutter radius. This will necessitate that the
Programming Circular Moves
programmer manually correct the tool path to compensate for
the cutter radius. The CNC control can do the offsets for us. There are two basic methods used to program circular moves:
By invoking cutter radius compensation using G41 and G42 IJ and radius.
codes, a part may be programmed using the actual drawing
dimensions. The amount of cutter compensation is determined
Programming Circular Interpolation
by the D word address, and this information is contained in the
cutter radius compensation offset file. Using the IJ Method
The direction of radius compensation is determined When we start cutting an arc, the tool is already positioned
by observing the tool path direction in the first sequence as at the start point of the arc (see Figure M-40). First, we need
the cutter approaches the workpiece (Figure M-39). G41 is to tell the direction of the arc. Is it a clockwise (G02) or coun-
radius compensation to the left side of the tool path. G42 terclockwise (G03) arc? The second piece of information the
is radius compensation to the right side of the tool path. control needs is the end point of the arc. The last piece of
Another advantage of cutter radius compensation is that information is the location of the center of the arc.
the cutter radius dimension may be intentionally pro- Arc Direction (G02, G03) Circular interpolation can be
grammed larger or smaller than it actually is. This will leave carried out in two directions, clockwise and counterclock-
a finish machining allowance. After the roughing cut, a new wise. There are two G-codes that specify arc direction (see
Figure M-40). The G02 code is used for circular interpola-
Workpiece tion in a clockwise direction. The G03 code is used for cir-
Uncompensated cular interpolation in a counter-clockwise direction. Both
cutter path G02 and G03 codes are modal and also use a feed rate (F)
code, just like a G01.
Arc Start Point The arc start point is the coordi-
nate location where the arc starts. The tool is moved to
G41 left cutter G42 right cutter
compensation compensation
the arc start point in the line prior to the arc generation
line. Simply stated, the start point of the arc is the point
where the machine is positioned as it starts to cut the arc
(see Figure M-41).
Start position
Arc Center Points
Figure M-39 G41 and G42 milling cutter radius compensation To generate an arc path, the controller has to know where
left and right is invoked as the cutter approaches the the center of the arc is. When using the IJ method, a par-
workpiece. ticular problem arises. How do we describe the position of
UNIT TWO CNC PROGRAMMING 673
Circular Interpolation Using Figure M-48 shows an arc that is less than 180 degrees.
the Radius Method The code to machine this arc would be G02 X2.0625 Yl.0625
R-2.5. G02 means that it is a clockwise arc. The X value is the
Circular interpolation can also be programmed using the distance in the X axis from the start point to the end point.
radius value. The general format is G02 (or G03) X Y R. Note that it is positive in this example. The Y value is the
Figure M-45 shows an example of a circular cut using the distance from the start point to the end point in the Y direc-
radius method. The code for this cut would be G02 X8.250 Y tion. Note that it is positive in this example. The R value is
4.250 Rl0.0. The G02 means that it will be a clockwise circular the value of the radius of the arc. Note that it must be nega-
cut. The X value is 8.250 in. (incremental value) from the start tive in this example because the arc is less than 180 degrees.
point to the end point in the X direction. The Y value is 8.250 in. The radius method cannot be used to program a full
(incremental value) from the start point to the end point in circle. The IJ method should be used for full circles.
the Y direction. The R value is the length of the radius value.
In this example, it is a plus 10.0 in.
Study Figure M-46. Note that there are two potential
Parabolic and Cubic Interpolations
arcs with the same start point and same end point. Note also These advanced interpolation modes are usually used to cre-
that there are two possible centerpoints. One arc is greater ate three-dimensional shapes such as those used on forming
than 180 degrees and the second one is less than 180 degrees. dies for automobile parts.
We tell the controller which one to use by giving the radius
value a plus or minus sign.
Figure M-47 shows an arc that is more than 180 degrees.
The code to machine this arc would be G02 X2.0625 Yl.0625
R2.5. G02 means that it is a clockwise arc. The X value is the
distance in the X axis from the start point to the end point.
Note that it is positive in this example. The Y value is the dis-
tance from the start point to the end point in the Y direc-
tion. Note that it is positive in this example. The R value is
the value of the radius of the arc. Note that it must be positive
in this example because the arc is more than 180 degrees.
Figure M-50 Spiral pointed taps will push chips ahead of the
tap in through holes. For blind holes, the spiral fluted taps will lift
chips from the hole (Kennametal, Inc.).