CNC Machines 02
CNC Machines 02
LECTURE 11
Objectives:
To understand the working principle and applications of CNC machines.
To be able to prepare CNC part programs for machining 2-D workpiece.
To understand the structure and flow of a CAM system.
Part programming contains geometric data about the part and motion information to move the cutting tool with
respect to the work piece. Basically, the machine receives instructions as a sequence of blocks containing
commands to set machine parameters; speed, feed and other relevant information.
b. Word
A block is composed of one or more words. A word is composed of an identification letter and a series of
numerals, e.g. the command for a feed rate of 200 mm/min is F200.
c. Address
The identification letter at the beginning of each word is called address. The meaning of the address is in
accordance with EIA (Electronic Industries Association) standard RS-274-D. The most common 'addresses'
are listed below:
2
Programming Methods
1) Automatically Programmed Tools (APT)
A text based system in which a programmer defines a series of lines, arcs, and points which define the
overall part geometry locations. These features are then used to generate a cutter location (CL) file.
2) CAD/CAM systems
CAD/CAM systems allow for rapid development and modifying of designs and documentation.
The 3D geometric model produced becomes a common element for engineering analysis (FEA),
machining process planning (including CNC part programming, documentation (including engineering
drawings), quality control, and so on.
The following table gives the surface cutting speeds for some common materials:
7
The machine controller has the ability to interpret a maximum of four G codes in one single block of data.
However, these G codes must be from separate modal groups. When two or more G codes from the same group
are specified in the same block, the CNC will only make the last stated G code from that modal group effective.
Steps for CNC Programming and Machining
The following is the procedures to be followed in CNC programming and machining. The most important point
is to verify the program by test run it on the machine before the actual machining in order to ensure that the
program is free of mistakes.
a. Study the part drawing carefully.
b. Unless the drawing dimensions are CNC adapted, select a suitable program zero point on the
work piece. The tool will be adjusted to this zero point during the machine set up.
c. Determine the machining operations and their sequence.
d. Determine the method of work clamping (vice, rotary table, fixtures etc).
e. Select cutting tools and determine spindle speeds and feeds.
f. Write program (translate machining steps into program blocks). If many solutions are possible,
try the simplest solution first. It is usually longer, but better to proceed in this way.
g. Prepare tool chart or diagram, measure tool geometry (lengths, radii) and note.
h. Clamp work piece and set up machine.
i. Enter compensation value if necessary.
j. Check and test program. It is a good practice to dry run the program (i) without the workpiece,
(ii) without the cutting tools, or (iii) by raising the tool to a safe height. If necessary, correct and
edit program and check again.
k. Start machining.
G-codes in Part Programming
1. Absolute and Incremental Dimensioning (G90/G91)
G90 and G91 are used to control the dimensioning system that will be used in the data input. In G90 mode, the
dimensions will be recognized as absolute while in G91 will be incremental.
2. Rapid Positioning (G00)
This is to command the cutter to move from the existing point to the target point at the fastest speed of the
machine.
3. Linear Interpolation (G01)
This is to command the cutter to move from the existing point to the target point along a straight line at the
speed designated by the F address.
G02
X
Y
I (XC - XS)
J (YC - YS)
Where
XC and YC is the coordinate of the center,
XS and YS is the coordinate of the start point of
the arc.
Modern CNC systems are capable of doing this type of calculation which is known as cutter compensation.
What the system requires are the programmed path, the cutter diameter and the position of the cutter with
reference to the contour. Normally, the cutter diameter is not included in the program. It has to be input to the
CNC system in the tool setting process.
If the cutter is on the left of the contour, G41 is used. If the cutter is on the right of the contour, G42 will be
used. G40 is to cancel the compensation calculation.
6. Other Functions
Modern CNC systems have some specially designed functions to simplify the manual programming. However,
since most of these functions are system oriented, it is not intended to discuss them here in detail. The following
paragraphs give a brief description of commonly used functions in modern CNC systems. The user should refer
to the programming manuals of the machine for the detail programming and operation.
a. Mirror Image
This is the function that converts the programmed path to its mirror image, which is identical in dimensions but
geometrically opposite about one or two axes.
b. Program Repetition and Looping
In actual machining, it is not always possible to machine to the final dimension in one go. This function enables
the looping of a portion of the program so that the portion can be executed repeatedly.
c. Pocketing Cycle
Pocketing is a common process in machining. This is to excavate the material within a boundary normally in
zigzag path and layer by layer. In a pocketing cycle, the pattern of cutting is pre-determined. The user is
required to input parameters including the length, width and depth of the pocket, tool path spacing, and layer
depth. The CNC system will then automatically work out the tool path.
d. Drilling, Boring, Reaming and Tapping Cycle
12
This is similar to pocketing cycle. In this function, the drilling pattern is pre-determined by the CNC system.
What the user has to do is to input the required parameters such as the total depth of the hole, the down feed
depth, the relief height and the dwell time at the bottom of the hole.
N025 Y3.0
This is an order to move 3.0 inches on Y-axis for the origin. Note that no need to repeat the value of X-axis
since the hole on the same axis. Also, no need to write the G81 function again.
13
N040 Y0.5
Here no need to write the move on X-axis since the tool on the same axis.
N045 G80
It means cancel the order of G81 to draw holes.
N050 ……………
Example 05
Example 06: CNC milling circular interpolation program example to illustrate the use of G02 G03 Circular
Interpolation G-Codes.
18
Example 07: CNC milling programming for cnc programmers/cnc machinists to understand the usage of G-code
G02 circular interpolation milling programming
Example 09:The cnc G code G02 Circular Interpolation Clockwise is used in this programming example. Actually
the arc is clockwise, therefore I am using G02 the cnc G code for programming the Clockwise arc.
Example 09: NUM CNC Mill Program Example with G45 Pocket Milling G81 G84 G87
21