Machinery''''s Handbook 27th Episode 2 Part 7 doc - Pdf 20


NUMERICAL CONTROL 1275
Table 2. G-Code Addresses
Code Description Code Description
G00
ab
*
Rapid traverse, point to point
(M,L)
G34
ab
*
Thread cutting, increasing
lead (L)
G01
abc
Linear interpolation (M,L) G35
abc
Thread cutting, decreasing lead (L)
G02
abc
Circular interpolation —
clockwise movement (M,L)
G36-G39
ab
Permanently unassigned
G36
c
Used for automatic
acceleration and deceleration
when the blocks are

d
Also for lathe
programming with cylindrical
diameter values
G39, G39.1 Generates a nonprogrammed
block to improve cycle time and
corner cutting quality when used
with cutter compensation (M)
G09
ab
Programmed deceleration
(M,L).
d
Used to stop the axis
movement at a precise location
(M,L)
G39 Tool tip radius compensation used
with linear generated block (L)
G10–G12
ab
Unassigned.
d
Sometimes used
for machine lock and unlock
devices
G39.1 Tool tip radius compensation used
used with circular generated block (L)
G13–G16
ac
Axis selection (M,L) G40

G45–G49
ab
Unassigned
G16.2
c
End face milling—C axis (L) G50–G59
a
Reserved for adaptive control
(M,L)
G17–G19
abc
X-Y, X-Z, Y-Z plane
selection, respectively (M,L)
G50
bb
Unassigned
G20 Unassigned G50.1
c
Cancel mirror image (M,L)
G22–G32
ab
Unassigned G51.1
c
Program mirror image (M,L)
G22–G23
c
Defines safety zones in which
the machine axis may not enter
(M,L)
G52

G54–G59.3
c
Allows for presetting of work
coordinate systems (M,L)
G31, G31.1,
G31.2, G31.3,
G31.4
External skip function, moves
an axis on a linear path until
an external signal aborts the
move (M,L)
G60–G62
abc
Unassigned
G33
abc
Thread cutting, constant lead (L)
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1276 NUMERICAL CONTROL
G61
c
Modal equivalent of G09 except
that rapid moves are not taken
to a complete stop before the
next motion block is executed
(M,L)
G80
abc
Cancel fixed cycles

c
Cutting mode, usually set by
the system installer (M,L)
G85
abc
Boring cycle, no dwell, feed out
(M,L)
G65
c
Calls for a parametric macro
(M,L)
G86
abc
Boring cycle, spindle stop,
rapid out (M,L)
G66
c
Calls for a parametric macro.
Applies to motion blocks only
(M,L)
G87
abc
Boring cycle, manual retraction
(M,L)
G88
abc
Boring cycle, spindle stop, manual
retraction (M,L)
G66.1
c

ac
Circular interpolation CW
(three-dimensional) (M)
G88.6 Hemisphere milling, finishing
cycle (M)
G72
b
Unassigned
G72
c
Used to perform the finish cut
on a turned part along the
Z-axis after the roughing cuts
initiated under G73, G74, or
G75 codes (L)
G89
abc
Boring cycle, dwell and feed out
(M,L)
G89.1 Irregular pocket milling,
roughing cycle (M)
G73
b
Unassigned
G73
c
Deep hole peck drilling cycle
(M); OD and ID roughing
cycle, running parallel to the
Z-axis (L)

G94
c
Feed rate in inches or millimeters
per minute (ipm or mpm) (M,L)
G75
b
Unassigned G95
abc
Feed rate given directly in inches or
millimeters per revolution (ipr
or mpr) (M,L)
G75 Roughing routine for castings or
forgings (L)
G76–G79
ab
Unassigned G96
abc
Maintains a constant surface speed,
feet (meters) per minute (L)
G97
abc
Spindle speed programmed
in rpm (M,L)
G98–99
ab
Unassigned
Table 2. (Continued) G-Code Addresses
Code Description Code Description
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY

move from P2 to P3 in Fig. 2 is written as X + 1.0, Y − 0.7.
Most CNC systems offer both absolute and incremental part programming. The choice is
handled by G-code G90 for absolute programming and G91 for incremental programming.
G90 and G91 are both modal, so they remain in effect until canceled.
a
Adheres to ANSI/EIA RS-274-D;
b
Adheres to ISO 6983/1,2,3 Standards; where both symbols appear together, the ANSI/EIA and
ISO standard codes are comparable;
c
This code is modal. All codes that are not identified as modal are nonmodal, when used according
to the corresponding definition.
d
Indicates a use of the code that does not conform with the Standard.
Fig. 1. Fig. 2.
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1278 NUMERICAL CONTROL
The G92 word is used to preload the registers in the control system with desired values. A
common example is the loading of the axis-position registers in the control system for a
lathe. Fig. 3 shows a typical home position of the tool tip with respect to the zero point on
the machine. The tool tip here is registered as being 15.0000 inches in the Z-direction and
4.5000 inches in the X-direction from machine zero. No movement of the tool is required.
Although it will vary with different control system manufacturers, the block to accomplish
the registration shown in Fig. 3 will be approximately:
N0050 G92 X4.5 Z15.0
Miscellaneous Functions (M-Words).—Miscellaneous functions, or M-codes, also
referred to as auxiliary functions, constitute on-off type commands. M functions are used
to control actions such as starting and stopping of motors, turning coolant on and off,
changing tools, and clamping and unclamping parts. M functions are made up of the letter

M17 to M18 Unassigned.
M19 Oriented spindle stop. Causes the spindle to stop at a predetermined angular posi-
tion.
M20 to M29 Permanently unassigned.
M30 An end-of-tape code similar to M02, but M30 will also rewind the tape; also may
switch automatically to a second tape reader.
M31 A command known as interlock bypass for temporarily circumventing a
normally provided interlock.
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1280 NUMERICAL CONTROL
per tooth to feed per revolution, multiply the feed rate per tooth by the number of cutter
teeth: feed/revolution = feed/tooth × number of teeth.
For certain types of cuts, some systems require an inverse-time feed command that is the
reciprocal of the time in minutes required to complete the block of instructions. The feed
command is indicated by a G93 code followed by an F-word value found by dividing the
feed rate, in inches (millimeters) or degrees per minute, by the distance moved in the block:
feed command = feed rate/distance = (distance/time)/distance = 1/time.
Feed-rate override refers to a control, usually a rotary dial on the control system panel,
that allows the programmer or operator to override the programmed feed rate. Feed-rate
override does not change the program; permanent changes can only be made by modifying
the program. The range of override typically extends from 0 to 150 per cent of the pro-
grammed feed rate on CNC machines; older hardwired systems are more restrictive and
most cannot be set to exceed 100 per cent of the preset rate.
Spindle Function (S-Word).—An S-word specifies the speed of rotation of the spindle.
The spindle function is programmed by the address S followed by the number of digits
specified in the format detail (usually a four-digit number). Two G-codes control the selec-
tion of spindle speed input: G96 selects a constant cutting speed in surface feet per minute
(sfm) or meters per minute (mpm) and G97 selects a constant spindle speed in revolutions
per minute (rpm).

sfm 12×
π d×
=rpm
mpm 1000×
π d×
=
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
NUMERICAL CONTROL 1281
Compensation for variations in the tool nose radius, particularly on turning machines,
allows the programmer to program the part geometry from the drawing and have the tool
follow the correct path in spite of variations in the tool nose shape. Typical of the data
required, as shown in Fig. 4, are the nose radius of the cutter, the X and Z distances from the
gage point to some fixed reference point on the turret, and the orientation of the cutter (tool
tip orientation code), as shown in Fig. 5. Details of nose radius compensation for numerical
control is given in a separate section (Indexable Insert Holders for NC).
Tool offset, also called cutter offset, is the amount of cutter adjustment in a direction par-
allel to the axis of a tool. Tool offset allows the programmer to accommodate the varying
dimensions of different tooling by assuming (for the sake of the programming) that all the
tools are identical. The actual size of the tool is totally ignored by the programmer who pro-
grams the movement of the tools to exactly follow the profile of theworkpiece shape. Once
tool geometry is loaded into the tool data table and the cutter compensation controls of the
machine activated, the machine automatically compensates for the size of the tools in the
programmed movements of the slide. In gage length programming, the tool length and tool
radius or diameter are included in the program calculations. Compensation is then used
only to account for minor variations in the setup dimensions and tool size.
Fig. 6.
Customarily, the tool offset is used in the beginning of a program to initialize each indi-
vidual tool. Tool offset also allows the machinist to correct for conditions, such as tool
wear, that would cause the location of the cutting edge to be different from the pro-

When cutter compensation is used, it is necessary to include in the program a G41 code if
the cutter is to be to the left of the part and a G42 code if to the right of the part, as shown in
Fig. 8. A G40 code cancels cutter compensation. Cutter compensation with earlier hard-
wire systems was expensive, very limited, and usually held to ±0.0999 inch. The range for
cutter compensation with CNC control systems can go as high as ±999.9999 inches,
although adjustments of this magnitude are unlikely to be required.
Fig. 9.
Linear Interpolation.—The ability of the control system to guide the workpiece along a
straight-line path at an angle to the slide movements is called linear interpolation. Move-
Fig. 7. Fig. 8.
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
NUMERICAL CONTROL 1283
ments of the slides are controlled through simultaneous monitoring of pulses by the control
system. For example, if monitoring of the pulses for the X-axis of a milling machine is at
the same rate as for the Y-axis, the cutting tool will move at a 45-degree angle relative to the
X-axis. However, if the pulses are monitored at twice the rate for the X-axis as for the Y-
axis, the angle that the line of travel will make with the X-axis will be 26.57 degrees (tan-
gent of 26.57 degrees =
1

2
), as shown in Fig. 9. The data required are the distances traveled
in the X- and Y-directions, and from these data, the control system will generate the straight
line automatically. This monitoring concept also holds for linear motions along three axes.
The required G-code for linear interpolation blocks is G01. The code is modal, which
means that it will hold for succeeding blocks until it is changed.
Circular Interpolation.—A simplified means of programming circular arcs in one plane,
using one block of data, is called circular interpolation. This procedure eliminates the need
to break the arc into straight-line segments. Circular interpolation is usually handled in one

four blocks would be required to complete a circle. Four blocks would also be required to
complete the arc shown in Fig. 12, which extends into all four quadrants.
When utilizing absolute programming, the coordinates of the end point are described.
Again from Fig. 11, the block, expressed in absolute coordinates, appears as:
N0055 G02 X01800 Y019000 I013000 J003000
where the arc is continued from a previous block; the starting point for the arc in this block
would be the end point of the previous block.
The Standard still contains the format discussed, but simpler alternatives have been
developed. The latest version of the Standard (RS-274-D) allows multiple quadrant pro-
gramming in one block, by inclusion of a G75 word. In the absolute-dimension mode
(G90), the coordinates of the arc center are specified. In the incremental-dimension mode
(G91), the signed (plus or minus) incremental distances from the beginning point of the arc
to the arc center are given. Most system builders have introduced some variations on this
format. One system builder utilizes the center and the end point of the arc when in an abso-
lute mode, and might describe the block for going from A to B in Fig. 13 as:
N0065 G75 G02 X2.5 Y0.7 I2.2 J1.6
The I and the J words are used to describe the coordinates of the arc center. Decimal-point
programming is also used here. A block for the same motion when programmed incremen-
tally might appear as:
N0075 G75 G02 X1.1 Y − 1.6 I0.7 J0.7
This approach is more in conformance with the RS-274-D Standard in that the X and Y
values describe the displacement between the starting and ending points (points A and B),
and the I and J indicate the offsets of the starting point from the center. Another and even
more convenient way of formulating a circular motion block is to note the coordinates of
the ending point and the radius of the arc. Using absolute programming, the block for the
motion in Fig. 13 might appear as:
N0085 G75 G02 X2.5 Y0.7 R10.0
The starting point is derived from the previous motion block. Multiquadrant circular
interpolation is canceled by a G74 code.
Helical and Parabolic Interpolation.—Helical interpolation is used primarily for mill-

ent size pocket, is to change the values assigned to each of the parameters #1, #2, #3, and #4
as necessary. Techniques for using parametric programming are not standardized and are
not recognized by all control systems. For this reason, consult the programming manual of
the particular system for specific details.
N0080 X.8 Cutter is moved to the right 0.8 inch.
N0090 G00 Z.25 M93 Cutter is moved axially out of pocket at rapid traverse
rate. Last block of subroutine is signaled by word
M93.
N0100 X.75 Y.5 Cutter is moved to bottom left-hand corner of second
pocket at rapid traverse rate.
N0110 M94 N0030 Word M94 calls for repetition of the subroutine that
starts at sequence number N0030 and ends at
sequence number N0090.
N0120 G00 X.2 Y−I.3 After the second pocket is cut by repetition of
sequence numbers N0030 through N0090, the cutter
is moved to start the third pocket.
N0130 M94 N0030 Repetition of subroutine is called for by word M94
and the third pocket is cut.
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
NUMERICAL CONTROL 1287
As with a parametric subroutine, macro describes a type of program that can be recalled
to allow insertion of finite values for letter variables. The difference between a macro and
a parametric subroutine is minor. The term macro normally applies toa source program
that is used with computer-assisted part programming; the parametric subroutine is a fea-
ture of the CNC system and can be input directly into that system.
Conditional Expressions.—It is often useful for a program to make a choice between two
or more options, depending on whether or not a certain condition exists. A program can
contain one or more blocks of code that are not needed every time the program is run, but
are needed some of the time. For example, refer to the previous program for milling three

be used to generate the cycle functions is also shown above each illustration. Although the
G-codes for the functions are standardized, the other words in the block and the block for-
mat are not, and different control system builders have different arrangements. The blocks
shown are reasonable examples of fixed cycles and do not represent those of any particular
system builder.
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1288 NUMERICAL CONTROL
The G81 block for a simple drilling cycle is:
N_____ G81 X_____Y_____C_____D_____F_____EOB
N_____X_____Y_____EOB
This G81 drilling cycle will move the drill point from position A to position B and then
down to C at a rapid traverse rate; the drill point will next be fed from C to D at the pro-
grammed feed rate, then returned to C at the rapid traverse rate. If the cycle is to be repeated
at a subsequent point, such as point E in the illustration, it is necessary Only to give the
required X and Y coordinates. This repetition capability is typical of canned cycles.
The G82 block for a spotfacing or drilling cycle with a dwell is:
N_____G82 X_____Y_____C_____D_____T_____F_____EOB
This G82 code produces a cycle that is very similar to the cycle of the G81 code except for
the dwell period at point D. The dwell period allows the tool to smooth out the bottom of
the counterbore or spotface. The time for the dwell, in seconds, is noted as a T-word.
The G83 block for a peck-drilling cyle is:
N_____G83 X_____Y_____C_____D_____K_____F_____EOB
In the G83 peck-drilling cycle, the drill is moved from point A to point B and then to point
C at the rapid traverse rate; the drill is then fed the incremental distance K, followed by
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
NUMERICAL CONTROL 1289
rapid return to C. Down feed again at the rapid traverse rate through the distance K is next,
after which the drill is fed another distance K. The drill is thenrapid traversed back to C,

N_____G89 X_____Y_____C_____D_____T_____F_____EOB
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1292 NUMERICAL CONTROL
Multiple threads are specified by a code in the block that spaces the start of the threads
equally around the cylinder being threaded. For example, if a triple thread is to be cut, the
threads will start 120 degrees apart. Typical single-block thread cutting utilizing a plunge
cut is illustrated in Fig. 17 and shows two passes. The passes areidentical except for the dis-
tance of the plunge cut. Builders of control systems and machine tools use different code-
words for threading, but those shown below can be considered typical. For clarity, both
zeros and decimal points are shown.
The only changes in the second pass are the depth of the plunge cut and the withdrawal.
The blocks will appear as follows:
N0006 X − .1050
N0007 G33 Z − 1.0000 K.0625
N0008 G00 X.1050
N0009 Z1.000
Compound thread cutting, rather than straight plunge thread cutting, is possible also, and
is usually used on harder materials. As illustrated in Fig. 18, the starting point for the thread
is moved laterally in the -Z direction by an amount equal to the depth of the cut times the
tangent of an angle that is slightly less than 30 degrees. The program for the second pass of
the example shown in Fig. 18 is as follows:
N0006 X − .1050 Z − .0028
N0007 G33 Z − 1.0000 K.0625
N0008 G00 X.1050
N0009 Z1.0000
Fixed (canned), one-block cycles also have been developed for CNC systems to produce
the passes needed to complete a thread. These cycles may be offered by the builder of the
control system or machine tool as standard or optional features. Subroutines also can gen-
erally be prepared by the user to accomplish the same purpose (see Subroutine). A one-

APT is a high-level programming language. One difference between APT and the
ANSI/EIA RS-274-D (G-codes) programming format discussed in the last section is that
APT uses English like words and expressions to describe the motion of the tool or work-
piece. APT has the capability of programming the machining of parts in up to five axes, and
also allows computations and variables to be included in the programming statements so
that a whole family of similar parts can be programmed easily. This section describes the
general capabilities of the APT language and includes a ready reference guide to the basic
geometry and motion statements of APT, which is suitable for use in programming the
machining of the majority of cubic type parts involving two-dimensional movements.
Some of the three-dimensional geometry capability of APT and a description of its five-
dimensional capability are also included.
As shown above, the APT system can be thought of comprising the input program, the
five sections 0 through IV, and the output program. The input program shown on the left
progresses through the first four sections and all four are controlled by the fifth, section 0.
Section IV, the postprocessor, is the software package that is added to sections II and III to
customize the output and produce the necessary program format (including the G-words,
M-words, etc.) so that the coded instructions will be recognizable by the control system.
The postprocessor is software that is separate from the main body of the APT program, but
for purposes of discussion, it may be easier to consider it as a unit within the APT program.
Section 0
Controls the information flow
PARTNO XXXX
Section 1 Section 2 Section 3 Section 4
MACHIN/XXXX Converts
English-like
part program
into computer
language. Also
checks for syn-
tax errors in the

control system via
DNC
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1294 NUMERICAL CONTROL
APT Computational Statements.—Algebraic and trigonometric functions and compu-
tations can be performed with the APT system as follows:
Computations may be used in the APT system in two ways. One way is to let a factor
equal the computation and then substitute the factor in a statement; the other is to put the
computation directly into the statement. The following is a series of APT statements illus-
trating the first approach.
P1=POINT/0,0,1
T =(25*2⁄ 3 + (3**2 − 1))
P2=POINT/T,0,0
The second way would be as follows;
P1=POINT/0,0,1
P2=POINT/(25*2⁄ 3 + (3**2 − 1)),0,0
Note: The parentheses have been used as they would be in an algebraic formula so that
the calculations will be carried out in proper sequence. The operations within the inner
parentheses would be carried out first. It is important for the total number of left-hand
parentheses to equal the total number of right-hand parentheses; otherwise, the program
will fail.
APT Geometry Statements.—Before movements around the geometry of a part can be
described, the geometry must be defined. For example, in the statement GOTO/P1, the
computer must know where P1 is located before the statement can be effective. P1 there-
fore must be described in a geometry statement, prior to its use in the motion statement
GOTO/P1. The simplest and most direct geometry statement for a point is
P1 =POINT/X ordinate, Y ordinate, Z ordinate
If the Z ordinate is zero and the point lies on the X−Y plane, the Z location need not be
noted. There are other ways of defining the position of a point, such as at the intersection of

25 + 25 25 + 25 √25 SQRTF (25) arctan .5000 ATANF(.5)
25 − 25 25 − 25 sin θ SINF(θ)
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
NUMERICAL CONTROL 1295
Points
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1296 NUMERICAL CONTROL
Lines
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
NUMERICAL CONTROL 1297
P2 and P3 are points close to the tangent points
of L1 and the intersection point of L2, therefore
cannot be end points of the tabulated cylinder
Lines (Continued)
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
1298 NUMERICAL CONTROL
Circles
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY
NUMERICAL CONTROL 1299
Circles
APT Motion Statements.—APT is based on the concept that a milling cutter is guided by
two surfaces when in a contouring mode. Examples of these surfaces are shown in Fig. 1,
and they are called the “part” and the “drive” surfaces. Usually, the partsurface guides the
bottom of the cutter and the drive surface guides the side of the cutter. These surfaces may
or may not be actual surfaces on the part, and although they may be imaginary to the part

or
SP1 = SPHERE/5, 5, 3, 2.5 (where 5, 5, and 3
are the X, Y, and Z coordinates or P1, and 2.5 is
the radius)
Machinery's Handbook 27th Edition
Copyright 2004, Industrial Press, Inc., New York, NY


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status