Professional Documents
Culture Documents
MCPO L1 - Reading Material
MCPO L1 - Reading Material
MCPO L1 - Reading Material
Key Concept
1
Know Your Machine From A Programmer’s Viewpoint
It is from two distinctly different perspectives that you must come to know your CNC
machining center/s. Here in Key Concept Number One, we’ll look at the machine
from a programmer’s viewpoint. Much later, during Key Concept Number Seven, we’ll
look at the machine from a setup person’s or operator’s viewpoint.
Key Concept Number One is the longest of the Key Concepts. It contains seven lessons:
1: Machine configurations
2: General flow of programming
3: Visualizing program execution
4: Understanding program zero
5: Determining program zero assignment values
6: How to assign program zero
7: Introduction to programming words
A CNC programmer need not be nearly as intimate with a CNC machining center as a setup person or
operator – but they must, of course, understand enough about the machine to create programs – to instruct
setup people and operators – and to provide the related setup and production run documentation.
First and foremost, a CNC programmer must understand what the CNC machining center is designed to
do. That is, they must understand the machining operations a machining center can perform. They must be
able to develop a workable process (sequence of machining operations), select appropriate cutting tools for
each machining operation, determine cutting conditions for each cutting tool, and design a workholding
setup. All of these skills, of course, are related to basic machining practice – which as we state in the Preface
– are beyond the scope of this text. For the most part, we’ll be assuming you possess these important skills.
That said, we do include some important information about machining operations that can be performed on
CNC machining centers throughout this text. For example, we provide a description of hole-machining
operations in lessons eight and sixteen. We describe milling operations in lessons eight, nine, and twelve.
And in general, and we provide suggestions about how machining operations can be programmed when it is
appropriate. This information should be adequate to help you understand enough about machining
operations to begin working with CNC machining centers.
If you’ve had experience with conventional (non-CNC) machine tools…
A CNC machining center can be compared to a conventional milling machine. Many of the same
operations performed on a milling machine are performed on a CNC machining center. If you have
experience with manually operated milling machines, you already have a good foundation on which to build
your knowledge of CNC machining centers.
This is why machinists make the best CNC programmers. With a good understanding of basic machining
practice, you can easily learn to program CNC equipment. You already know what you want the CNC
machine to do. It is a relatively simple matter of learning how to tell the CNC machine to do it.
If you have experience with machining operations like face milling, end milling, drilling, tapping, boring, and
reaming, and if you understand the processing of machined workpieces, believe it or not, you are well on
your way to understanding how to program a CNC machining center. Your previous experience has
prepared you for learning to program a CNC machining center.
We can also compare the importance of knowing basic machining practice in order to write CNC programs
to how important it is for a speaker to be well versed with the topic they will be presenting. If not well
versed with their topic, the speaker will not make much sense during the presentation. In the same way, a
CNC machining center programmer who is not well versed in basic machining practice will not be able to
prepare a program that makes any sense to experienced machinists.
Lesson 1:
Machine Configurations
Most beginners tend to be a little intimidated when they see a machining center in operation for the first time.
Admittedly, there will be a number of new functions to learn. The first point to make is that you must not let
the machine intimidate you. As you go along in this text, you will find that a machining center is very logical
and is almost easy to understand with proper instruction.
You can think of any CNC machine as being nothing more than the standard type of equipment it is replacing
with very sophisticated and automatic motion control added. Instead of activating things manually by hand-
wheels and manual labor, you will be preparing a program that tells the machine what to do. Virtually
anything that needs to be done on a true machining center can be activated through a program – meaning
anything you need the machine to do can be commanded in a program.
There are two basic types of machining centers that we will be addressing in this text. They are vertical
machining centers and horizontal machining centers. Let’s start by describing the most common features of
each.
Z axis ways
Spindle Chip Guard
Y axis ways
X axis ways
Table
Bed Saddle
Headstock, column, and bed – Saddle and automatic tool changer Table and chip guard added – not
notice that the bed, column, and added – notice that the spindle shown is the operator’s control
headstock form a letter “C” points down – in a vertical pendant
orientation
Figure 1.1 – Components that make-up a C-frame style vertical machining center
This type of vertical machining center is called a C-frame style machining center because the bed, column, and
headstock, when taken together, form the letter “C”. An automatic tool changer is mounted to the machine
(usually on the left side) to allow tools to be loaded into the spindle without operator intervention. The table
has a series of tee-slots and/or location/clamping holes to allow workholding devices (like a table vise) to be
mounted on the table.
Directions of motion (axes) for a C-frame style vertical machining center
Basic vertical machining centers allow three directions of motion, or axes. Each of these basic axes is linear –
allowing motion along a straight line. With a C-frame style vertical machining center, the table can move
left/right (the X axis) – the table can move fore/aft (the Y axis) – and the headstock or spindle can move
up/down (the Z axis). Figure 1.2 shows the axes of a C-frame style vertical machining center.
Directions of motion (axes) of a C-frame style vertical machining center
X Y
The X axis is table motion The Y axis is table motion The Z axis is headstock
left/right (as viewed from the fore/aft (as viewed from the motion up/down
front of the machine) front of the machine)
Figure 1.2 – Directions of motion (axes) of a C-frame style vertical machining center
With this kind of machine, notice that the cutting tool will not move along with the X and Y axis. Instead, the
cutting tool will remain stationary in XY – it will only move along with the Z axis.
Axis polarity
Though not depicted in the previous illustrations, each axis has a polarity (plus and minus direction). As the
table moves to the left, it is moving in the X plus direction. As it moves to the right, it is moving in the X
minus direction. As the table moves toward you, it is moving in the Y plus direction. As it moves away from
you, it is moving in the Y minus direction. As the headstock/cutting tool moves up, it is moving in the Z plus
direction. As it moves down, it is moving in the Z minus direction.
For X and Y, since the cutting tool does not move along with every axis, it can be a little confusing (especially
for programmers) to understand polarity by looking at table motion. From a programmer’s viewpoint, we feel
it is much easier to understand polarity if you imagine that the cutting tool is moving along with each axis.
Figure 1.3 shows how to visualize polarity with this method.
Z+
Programmers should Y+
view polarity as if the tool
is moving in all axes
X- X+
Y-
Z-
If you imagine that the cutting tool can move in X and Y, determining polarity will be easier (especially when
we introduce the coordinate system used with CNC programming in Lesson Four). As the cutting tool
moves to the right, it is moving in the X plus direction. (But remember, the cutting tool cannot move to the
right in X axis. Instead, the table moves to the left – which again, is the X plus direction.) As the cutting tool
moves to the left, it is moving in the X minus direction. As the tool moves away from you, it is moving in the
Y plus direction. As it moves toward you, it is moving in the Y minus direction. In Z, of course, the tool is
moving with the axis, so polarity is much easier to understand. Up is Z plus, down is Z minus.
As you know, the X, Y, and Z axes are linear Drive motor Moving component
axes. They cause motion along a straight
line. Though you don’t have to understand
every detail of how an axis works, it helps to
understand the basic components. A drive
motor is connected to a ball screw that drives
the moving component for the axis (table or
headstock in our case). The action is not
unlike what occurs with a common table vise.
As you turn the screw on the table vise, it
causes the jaw on the vise to move along a
straight line – clamping a component in the Ball screw
vise.
Linear axis drive system
cutting tools must be manually loaded during the CNC cycle. Figure 1.4 shows a typical knee-style CNC
milling machine.
Knee-style CNC milling machine
X
Y
Figure 1.4 – Knee-style CNC milling machine with axes directions shown
Notice how similar the axes of this machine are to the C-frame style CNC machining center. The only
difference is that a knee-style CNC milling machine has a quill that moves within the headstock to form the Z
axis as opposed to the entire moving headstock of a C-frame style machining center.
The polarity for each axis is also the same. X plus is table motion to the left. X minus is table motion to the
right. Y plus is table motion toward you. Y minus is table motion away from you. Z plus is quill motion up.
Z minus is quill motion down. And since the tool does not move along with the X and Y axes, we
recommend that you view polarity as if the tool is moving in X and Y – just as we suggested with a C-frame
style machining center (see Figure 1.3).
Bridge -style vertical machining center (also called gantry-style)
Yet another type of vertical machining center is called the bridge-type machining center. Figure 1.5 shows
one.
Bridge -style vertical machining center
Figure 1.5 – Bridge type vertical machining center with axes shown
As you can see, the table remains stationary on this kind of machine, which is necessary when machining very
large workpieces – like larger aircraft components. With this kind of machine, the tool does move along with
each axis, and this makes understanding polarity much easier. X plus is tool movement to the right. X minus
is tool movement to the left. Y plus is tool movement away from you. Y minus is tool movement toward
you. Z plus is tool movement up. Z minus is tool movement down.
Automatic
pallet changer
Y axis ways
Spindle
Table
Saddle
Bed
Most horizontal machining centers sold today come with an automatic pallet changer (shown in the right-side
illustration). This device (which can also be equipped with vertical machining centers) allows the operator to
be loading a workpiece on one pallet while a workpiece on the other pallet is being machined. While it is not
shown in the illustration above, most horizontal machining centers have guarding that completely surrounds
the work area, which keeps the operator safe while loading workpieces.
At first glance, the axes of a horizontal machining center (X, Y, and Z) appear to be radically different from a
vertical machining center. But if you look more closely, you’ll see that a horizontal machining center is little
more than a vertical machining center placed on its back. In fact, a program written for a vertical machining
center will run properly in a horizontal machining center, at least with regard to axis movements.
Also notice the addition of the rotary axis (B) within the table. This allows the table to be rotated during the
execution of a CNC program – and can expose different surfaces of the workpiece to the spindle for
machining. Some horizontal machining centers do not have a full rotary axis within the table. Instead, they
have a simple indexing device. A rotary axis will allow machining to occur during table rotation. With an
indexer, machining can only occur after the table has rotated. We discuss both types of rotary devices during
Lesson Nineteen.
There is a bit of a misconception that horizontal machining centers are harder to work with than vertical
machining centers. Frankly speaking, the only major difference is that programs for horizontal machining
centers tend to be longer since several surfaces of the workpiece are exposed to the spindle and more cutting
tools will be required. While this will require a longer program, the program will not be more difficult to write.
In fact, a vertical machining center will require several programs to machine the same number of workpiece
surfaces.
Axis polarity
Notice in Figure 1.7 that the tool will not move along with the X and Z axes (it will move only with the Y
axis). And as we said during the discussion of C-frame vertical machining centers, this tends to cause some
confusion when it comes to determining the polarity of each axis. Again, we recommend that you view
polarity as if the tool is actually moving along with each axis. Figure 1.8 shows this.
When it comes to polarity for the B axis, most machine tool builders will make clockwise table rotation (as
viewed from above the table) the plus direction. But not all machine tool builders adhere to this standard.
Note: Since vertical machining centers are more popular than horizontal
machining centers, most example programs in this text are shown in the
format for a vertical machining center. During our discussion of rotary
devices in Lesson Nineteen, we discuss special programming
considerations for horizontal machining centers.
Spindle range
Some, especially larger machining centers, have two or more spindle ranges. Spindle ranges are like the gears
in an automobile transmission. Lower ranges are used for power – higher ranges are used for speed. With
most current model machining centers, spindle range selection is a bit transparent. Spindle range will be
automatically selected when you specify a spindle speed (S word). For this reason, some programmers don’t
even know the machine that they are programming has two or more spindle ranges!
Figure 1.9 shows the power curve chart for a machining center that has two spindle ranges. If your machining
center has more than one spindle range, you can find this kind of chart in your machine tool builder’s
programming manual.
Power curve chart for a machining center having two spindle ranges
425 rpm 1750 rpm
Low range: 0 – 1,500 rpm 10
High range: 1,501 – 3500 rpm
PowerS M03range
High -
S500 M03: Automatically word Low range
(hp) M04
CW -Z
selects the low range and starts 5
spindle (fwd) at 500 rpm M05
CCW-
S2200 M04: Automatically Y Off
X
selects high range and starts
spindle (rev) at 2,200 rpm Speed (rpm) 1500 3500
Figure 1.9 – Typical power curve chart for a machining center having two spindle ranges.
For our example machining center, full power is achieved in the low spindle range at 425 rpm and in the high
spindle range at 1,750 rpm. This is important information, especially when you are programming powerful
machining operations. Consider for example, using a 2.0 inch face mill for a rough milling operation. Say the
tooling manufacturer recommends using a speed of 800 surface feet per minute (sfm). This equates to 1,528
rpm (again, rpm equals 3.82 times sfm divided by tool diameter – 3.82 times 800 divided by 2.0 is 1,528). If
S1528 is specified as the spindle speed, the machine will automatically select the high spindle range, and there
may not be enough power to perform the powerful milling operation. The spindle may stall. In this case, it
will be necessary to compromise the spindle speed down to S1499 to force the machine to select the low
spindle range in order to achieve the needed power.
Feedrate
As you know, a machining center has three linear axes, X, Y, and Z. You must be able to control how quickly
these axes move, especially when machining is being done. Feedrate is the motion rate at which the cutting
tool will move during a machining operation. It is a programmable function of all machining centers.
Feedrate is specified with an F word (obviously, F for feedrate). For most machining centers, feedrate can
only be specified in per-minute fashion (inches per minute or millimeters per minute).
Note that most cutting tool manufacturers recommend feedrate in inches (or millimeters) per-revolution or
inches (or millimeters) per-tooth/flute. To determine the per-minute feedrate, you must multiply the per-
revolution value times the (previously calculated) rpm.
Again, say you need to drill a 0.5 diameter hole in mild steel. The previously calculated speed is 535 rpm (see
the previous discussion of spindle speed). The cutting tool manufacturer recommends a feedrate of 0.007
inches per revolution. In this case, you need to program a feedrate of F3.74, since 535 times 0.007 is 3.74.
Since calculated feedrate often includes a decimal portion of a whole number, you are allowed to include a
decimal point with the F word. Again, this will be F3.74 in the previous example.
Cutting tool manufacturers sometimes recommend feedrate with per-tooth values. This is commonly the case
for milling cutters. To determine the per-revolution feedrate amount, multiply the per-tooth value times the
number of teeth or flutes on the cutter.
There are some machine tool builders that do allow feedrate to be specified directly in per-revolution fashion
(which minimizes calculations). The vast majority do not. If both feedrate specifications are allowed (per-
minute and per-revolution), two G codes are used to specify the feedrate type.
For machining centers that allow this, G94 is commonly used to select feed-per-minute mode and G95 is
used to select feed-per-revolution mode. Any F word following a G94 will be taken as a per-minute feedrate.
Any F word following a G95 will be taken as a per-revolution feedrate.
Check with an experienced person in your company or school to find out whether or
not your machining center allows feedrate specification in per-revolution fashion.
What is a G code?
G codes are called preparatory functions. Common G codes:
They prepare the machine for what is G00: Rapid motion G42: Cutter comp. right
coming up – in the current command and G01: Straight line motion G43: Tool length comp.
possibly in up-coming commands. In many G02: Circular motion (CW) G81: Drilling cycle
cases, they set modes, meaning once a G G03: Circular motion (CCW) G83: Peck drilling cycle
code is instated it will remain in effect until G04: Dwell G84: Tapping cycle
the mode is changed or cancelled. G20: Inch mode selection G90: Absolute mode
G21: Metric mode selection G91: Incremental mode
Here we list a few common G codes, but G28: Zero return command G98: Initial plane
don’t worry if they don’t make much sense G40: Cancel cutter radius comp. G99: R plane
yet. Upcoming discussions will clarify. G41: Cutter comp. left
Coolant
Coolant is the liquid used to cool and lubricate the machining operation. All current model machining centers
provide flood coolant capability. Flood coolant is turned on with an M08 and turned off with an M09.
Some machine tool builders provide special coolant capabilities, including high pressure coolant, through-the-
tool coolant, and air-blast (to clear chips from the work area). These special coolant functions are almost
always programmed with M codes, but the specific M code numbers will vary from one machine tool builder
to another. You must look in your machine tool builder’s programming manual to see if your machine has
any special coolant capabilities, as well as to determine the relate M codes.
Automatic tool changer
All true machining centers have automatic tool changers that allow tools to be loaded into the spindle during
the program’s cycle. This, of course, allows several machining operations to be performed on a workpiece
within one program cycle. Machine tool builders vary when it comes to how many cutting tools their
machines can hold. They range from under ten to well over one hundred. A typical automatic tool changer
magazine can hold about twenty tools.
The automatic tool changer design will vary from one machine tool builder to another, but programming
methods remain amazingly similar, falling into one of two basic programming styles. We’ll discuss the specific
differences during Key Concept Number Five (program formatting).
For now, we’ll just mention that a T word is used to rotate the automatic tool changer mechanism. With most
machines, the T word does not actually cause a tool change to occur. Again, it just rotates the magazine to its
ready position (also called the waiting position).
Magazine stations are numbered. A machine having a tool changer magazine that can hold twenty tools will
commonly have T words ranging from T01 to T20. And again, the T word is used to specify the desired tool
station number that will be brought to the ready position.
An M06 is used to actually make the tool change. For most current model machining centers, M06 will cause
the tool that is in the spindle to be placed back into the magazine – and the tool in the ready position will then
be placed into the spindle. For example, the command
T05 M06
will cause tool station number five to rotate to the ready station and then be placed into the spindle (whatever
tool was currently in the spindle will be placed back into the magazine). Figure 1.10 illustrates the activation of
a double-arm-style automatic tool changer.
In step 1 of Figure 1.10, the T15 word will place tool station number fifteen in the ready position. Starting
from step 2, the M06 will cause the tool change. We’re showing a double-arm automatic tool changer, which
is the most efficient style of tool changer. Notice how the tool in the spindle is replaced with the tool in the
ready station. We’ll discuss automatic tool changers in more detail during Key Concept Number Five.
Measurement system mode (inch or metric)
All machining centers used in the United States allow you to work in the English (inch) system or the Metric
system. Since this text has been prepared for use in the United States, and since most companies in the US
(still) work in the English system, all examples in this text are provided in the English system. Note that for
CNC use, we refer to the two measurement systems as inch mode or metric mode.
Two G codes are used to select you measurement system of choice. With most machining centers, G20 is
used to select the inch mode and G21 is used to select the metric mode.
Many CNC functions are affected by your measurement system of choice, including two we’ve already
discussed – axis coordinates and feedrate. In the inch mode, these values are specified in inches. In the metric
mode, they are specified in millimeters.
For example, the command
G20
selects the inch mode. Any coordinate or feedrate following G20 will be taken in inches. The command
X1.0 Y1.0
will specify a value of one inch in each axis (as opposed to one millimeter).
Feedrates specified after a G20 will be taken in inches per minute. Feedrates after a G21 will be taken in
millimeters per minute. (Do remember that some machines, though not many, additionally allow feed per
revolution. This will additionally allow feedrate to be specified in inches or millimeters per revolution.)
Check with an experienced person in your company or school to find out what other
programmable features are available on the machining center you will be working
with.
Quiz
1) Which style of machining center is the most popular? 4) Provide the CNC word or command needed to
A) C-frame style vertical C) Bridge-style vertical activate the following:
B) Knee-style vertical D) Horizontal a) Start spindle (fwd) at 300 rpm: ____________
2) Specify the correct axis for each moving component b) Start spindle (reverse) at 2,000 rpm: ____________
below (C-frame style vertical machining center).
c) Stop spindle: ____________
a) ____Table motion in/out
d) Turn on the flood coolant: ____________
b) ____Headstock motion up/down
c) ____Table motion left/right e) Turn off the coolant: _____________
f) Place tool station seven in spindle: ____________
3) Specify the correct axis and polarity for each tool motion
below (C-frame style vertical machining center). g) Select inch mode: ____________
a) _____Tool motion left
b) _____Tool motion away from you Talk with experienced people in your company to learn more:
c) _____Tool motion down Do your machining centers have more than one spindle range?
If so, what are the cut-off points for each range? At what rpm
does the spindle achieve maximum horsepower in each range?
Do any of your machines have high pressure coolant systems?
Answers: 1: A, 2a: Y, 2b: Z, 2c: X, 3a: X-, 3b: Y+, If so, what is the related M code? How many cutting tools can
3c: Z-, 4a: S300 M03, 4b: S2000 M04, 4c: M05, 4d:your machining centers hold?
M08, 4e: M09, 4f: T07 M06, 4g: G20