Вы находитесь на странице: 1из 433

IM 314

Computer Aided Designing/Computer


Aided Manufacturing (CAD/CAM)
Credit Hours: 3-1/2
Text Book/Reference Book(s):
1.
2.
3.

CAD/CAM Principles and Applications by PN Rao


Principles of CAD/CAM/CAE Systems by Kunwoo Lee
CADCAM: From Principles to Practice by Chris McMahon and
Jimmie Browne

Instructor: Ali Hassan


Lecturer, IMEM, PNEC, NUST.

Marks Distribution Scheme


-

Assignment/Project (5% - 10%) 10%


Quiz (10% 15%) 15%
One Hour Test (30% - 40%) 35%
Final Exam (40% - 50%) 40%

- Tentative dates for One Hour Test


- 04-March, 19-March, 30-April, 7-May, 13-May

Class Rules
No drinks or eatables in the class
No discussion/debate on politics/religion
No mobile texting during class
Please keep your mobile phone silent; if you
have to attend a call take it outside the class
Good is of discipline of utmost importance
No collective bunking, or else.

Bibliography
The lecture material has been compiled from the following
sources;

CAD/ CAM Principles and Applications by PN Rao

Principles of CAD/CAM/CAE Systems by Kunwoo Lee

CADCAM: From Principles to Practice by Chris


McMahon and Jimmie Browne

Notes from IM 314 CAD/CAM by Dr. Usama Umer,


PNEC, NUST

Notes from IE 433 CADCAM by Dr. Saeed M Hassan


Darwaish, KSU,SA

Notes from CAD/CAM by Zambri Harun, JKMB, UKM

World Wide Web (Internet)

CAM & its Applications

Implementation of a Typical CAM Process on a


CAD/CAM system
Geometric model

Inspection

Interface
algorithms

Assembly

Process planning

Packaging

NC programs
To shipping and marketing

CAM Tools Required to Support the Design Process


Manufacturing phase

Required CAM tools

Process planning

CAPP techniques; cost


analysis; material and
tooling specification.
NC programming

Part programming
Inspection
Assembly

CAQ; and Inspection


software
Robotics simulation and
programming

Definitions of CAM Tools Based on Their


Constituents
Networking
concepts

CAM
tools

Mfg tools

CAD

Definition of CAM Tools Based on Their Implementation


in a Manufacturing Environment
Hardware
(control unit; display
terminals;
I/O devices
Mfg tools + Computer

Software (CAD; NC;


MRP; CAPP)

Networking

= CAM tools

Why CAM
Greater design freedom changed incorporated
during design stage
Increased productivity totally organized by
computer
Greater operating activity flexible manufacturing
method
Shorter lead time
Reduced maintenance
Reduce scrap and reworks
Better management control

CAM in Manufacturing Planning


Computer aided process planning (CAPP)
Computer assisted NC part programming
Computerized machinability data system
Development of work standards
Cost estimating
Production and Inventory planning

CAM in Manufacturing Control


Process monitoring and control
Quality control
Shop floor control
Inventory control
Just in time production systems

From CAM definition, the application of CAM


falls into two broad categories:
1. Computer monitoring and control .
Process data
Mfg
Computer
Control signals operations

2.Manufacturing support application.


E.g. conveyers, AGVs, ASRS,

Types of Manufacturing Systems


1. Continuous-flow processes. Continuous dedicated production of
large amount of bulk product. Continuous manufacturing is
represented by chemicals, plastics, petroleum, and food industries.
2. Mass production of discrete products. Dedicated production of
large quantities of one product (with perhaps limited model
variations). Examples include automobiles, appliances and engine
blocks.
3. Batch production. Production of medium lot sizes of the same
product. The lot may be produced once or repeated periodically.
Examples: books, clothing and certain industrial machinery.
4. Job-shop production. Production of low quantities, often one of a
kind, of specialized products. The products are often customized
and technologically complex. Examples: prototypes, aircraft,
machine tools and other equipment.

Continuousflow
production
Production
quantity

Mass
production
Batch
production
Job shop
production

Product variety

Category

Automation achievements

Continuous-flow process

Flow process from beginning to end


Sensors technology available to measure
important process variables
Use of sophisticated control and optimization
strategies
Fully computer automated lines

Mass production of discrete products

Automated transfer machines


Dial indexing machines
Partially and fully automated assembly lines
Industrial robots for spot welding, part handling,
machine loading, spray painting, etc.
Automated material handling systems
Computer production monitoring

Batch production

Numerical control (NC), direct numerical control


(DNC), computer numerical control (CNC).
Adaptive control machining
Robots for arc welding, parts handling, etc.
CIM systems.

Job shop production

Numerical control, computer numerical control

TTlc BQT1 BT2 T3


TTcl total time during the product life cycle
B The number of batches produced throughout the product life cycle.
Q The number of units produced in each batch.
T1 The time required to produce one unit of product.
T2 The time associated with planning and setting up for

each batch of production.


T3 The time required for designing the product and for all the other
activities that are accomplished once for each different product .
Tlc The average time spent on each unit of product
T3
T2
during its life cycle T1

Q BQ

T1

The most important term in mass production


and batch production

T2 & T3 become very important in job shop


manufacturing.

Automation technology is concerned with reducing


T1 & T2 the with emphasis on the unit production
time T
1

CAD/CAM concerned with reducing all three


terms, but is perhaps focused on T 2 & T3 terms.
The emphasis in CAD/CAM includes the design
and planning function of the product life cycle.

Advantages of CAD/CAM systems


Greater flexibility.
Reduced lead times.
Reduced inventories.
Increased Productivity.
Improved customer
service.
Improved quality.
Improved communications
with suppliers.

Better product design.


Greater manufacturing
control.
Supported integration.
Reduced costs.
Increased utilization.
Reduction of machine
tools.
Less floor space.

Rapid Prototyping

RAPID PROTOTYPING
1. Fundamentals of Rapid Prototyping
2. Rapid Prototyping Technologies
3. Applications and Benefits of Rapid
Prototyping

Rapid Prototyping (RP)


A family of fabrication processes developed to
make engineering prototypes in minimum
lead time based on a CAD model of the item
Traditional method is machining
Can require significant lead-times several weeks,
depending on part complexity and difficulty in ordering
materials

RP allows a part to be made in hours or days,


given that a computer model of the part has
been generated on a CAD system

Why is Rapid Prototyping


Important?
Product designers want to have a physical
model of a new part or product design rather
than just a computer model or line drawing
Creating a prototype is an integral step in design
A virtual prototype (a CAD model of the part) may not be
sufficient for the designer to visualize the part adequately
Using RP to make the prototype, the designer can see and
feel the part and assess its merits and shortcomings

RP Two Basic Categories:


1. Material removal RP - machining, using a
dedicated CNC machine that is available to
the design department on short notice
Starting material is often wax
Easy to machine
Can be melted and resolidified
The CNC machines are often small - called desktop
machining

2. Material addition RP - adds layers of material


one at a time to build the solid part from
bottom to top

Starting Materials in Material


Addition RP
1. Liquid monomers that are cured layer by layer into solid
polymers
2. Powders that are aggregated and bonded layer by layer
3. Solid sheets that are laminated to create the solid part

Additional Methods
In addition to starting material, the various
material addition RP technologies use
different methods of building and adding
layers to create the solid part
There is a correlation between starting material and
part building techniques

Steps to Prepare Control


Instructions
1. Geometric modeling - model the component
on a CAD system to define its enclosed
volume
2. Tessellation of the geometric model - the CAD
model is converted into a computerized
format that approximates its surfaces by
facets (triangles or polygons)
3. Slicing of the model into layers - computerized
model is sliced into closely-spaced parallel
horizontal layers

Tessellation is the process of creating a twodimensional plane using the repetition of a


geometric shape with no overlaps and no
gaps.

A tessellation of a disk used to


solve a finite element problem

Solid Model to Layers

Figure 34.1 Conversion of a solid model of an object into layers


(only one layer is shown).

Classification of RP Technologies
There are various ways to classify the RP
techniques that have currently been
developed
The RP classification used here is based on
the form of the starting material:
1. Liquid-based
2. Solid-based
3. Powder-based

Liquid-Based Rapid Prototyping


Systems
Starting material is a liquid
About a dozen RP technologies are in this
category
Includes the following processes:
Stereolithography
Solid ground curing
Droplet deposition manufacturing
http://www.wimp.com/functionaltools/

Stereolithography (STL)
RP process for fabricating a solid plastic part out
of a photosensitive liquid polymer using a
directed laser beam to solidify the polymer
Part fabrication is accomplished as a series of
layers - each layer is added onto the previous
layer to gradually build the 3-D geometry
The first addition RP technology - introduced
1988 by 3D Systems Inc. based on the work of
Charles Hull
More installations than any other RP method

Stereolithography

Figure 34.2 Stereolithography: (1) at the start of the process, in which the
initial layer is added to the platform; and (2) after several layers have been
added so that the part geometry gradually takes form.

Rapid Prototyping Process (Damvig)


A computer-controlled laser beam is
scanned across the surface of a vat of
liquid photopolymer, instantly
solidifying the liquid at each point of
contact. Using data generated from a
CAD file, individual cross-sections of
the three-dimensional geometry are
solidified in turn to build up a solid
part layer by layer. In this way even
highly complex geometries can be
built in a few hours without requiring
any tools.

Facts about STL


Each layer is 0.076 mm to 0.50 mm (0.003 in
to 0.020 in.) thick
Thinner layers provide better resolution and more intricate
shapes; but processing time is longer

Starting materials are liquid monomers


Polymerization occurs on exposure to UV light
produced by laser scanning beam
Scanning speeds ~ 500 to 2500 mm/s

Solid Ground Curing (SGC)


Like stereolithography, SGC works by curing a
photosensitive polymer layer by layer to
create a solid model based on CAD geometric
data
Instead of using a scanning laser beam to cure
a given layer, the entire layer is exposed to a
UV source through a mask above the liquid
polymer
Hardening takes 2 to 3 s for each layer

Solid Ground Curing

Figure 34.4 SGC steps for each


layer: (1) mask preparation,
(2) applying liquid
photopolymer layer,(3) mask
positioning and exposure of
layer, (4) uncured polymer
removed from surface, (5)
wax filling, (6) milling for
flatness and thickness.

Facts about SGC


Sequence for each layer takes about 90
seconds
Time to produce a part by SGC is claimed to
be about eight times faster than other RP
systems
The solid cubic form created in SGC consists of
solid polymer and wax
The wax provides support for fragile and
overhanging features of the part during
fabrication, but can be melted away later to
leave the free-standing part

Droplet Deposition Manufacturing


(DDM)
Starting material is melted and small droplets are
shot by a nozzle onto previously formed layer
Droplets cold weld to surface to form a new layer
Deposition for each layer controlled by a moving
x-y nozzle whose path is based on a cross section
of a CAD geometric model that is sliced into
layers
Work materials include wax and thermoplastics

Droplet Deposition Manufacturing


(DDM)

Solid-Based Rapid Prototyping


Systems
Starting material is a solid
Solid-based RP systems include the following
processes:
Laminated object manufacturing
Fused deposition modeling

Laminated Object Manufacturing


(LOM)
Solid physical model made by stacking layers of
sheet stock, each an outline of the cross-sectional
shape of a CAD model that is sliced into layers
Starting sheet stock includes paper, plastic,
cellulose, metals, or fiber-reinforced materials
The sheet is usually supplied with adhesive
backing as rolls that are spooled between two
reels
After cutting, excess material in the layer remains
in place to support the part during building

Laminated Object Manufacturing

Figure 34.5 Laminated object manufacturing.

LOM Example

Fused Deposition Modeling (FDM)


RP process in which a long filament of wax or
polymer is extruded onto existing part surface
from a workhead to complete each new layer
Workhead is controlled in the x-y plane during
each layer and then moves up by a distance
equal to one layer in the z-direction
Extrudate is solidified and cold welded to the
cooler part surface in about 0.1 s
Part is fabricated from the base up, using a
layer-by-layer procedure

FDM Layer Formation


FDM generated
cross section
Filament
Heated
FDM Head
Molten
Filament
Supply

Notice that the FDM filament cannot


cross itself, as this would cause a high
spot in the given layer

Fused Deposition Machine

Stratasys FDM 2000


http://www.stratasys.com/

Powder-Based RP Systems
Starting material is a powder
Powder-based RP systems include the
following:
Selective laser sintering
Three dimensional printing

Selective Laser Sintering (SLS)


Moving laser beam sinters heat fusible powders
in areas corresponding to the CAD geometry
model one layer at a time to build the solid
part
After each layer is completed, a new layer of
loose powders is spread across the surface
Layer by layer, the powders are gradually
bonded by the laser beam into a solid mass
that forms the 3-D part geometry
In areas not sintered, the powders are loose
and can be poured out of completed part

SLS Process
Mirror
Powder
Bed

Optics

Piston

Laser

Powder
Bed

Leveling
Roller

Powder Feeding
System

Three Dimensional Printing (3DP)


Part is built layer-by-layer using an ink-jet printer to
eject adhesive bonding material onto successive
layers of powders
Binder is deposited in areas corresponding to the
cross sections of part, as determined by slicing
the CAD geometric model into layers
The binder holds the powders together to form
the solid part, while the unbonded powders
remain loose to be removed later
To further strengthen the part, a sintering step
can be applied to bond the individual powders

Three Dimensional Printing

Figure 34.6 Three dimensional printing: (1) powder layer is deposited,


(2) ink-jet printing of areas that will become the part, and (3) piston
is lowered for next layer (key: v = motion).

3-D Printing Process


Printhead
Powder
Bed

Binder
Printhead

"Fast"
Axis

Piston
"Slow" Axis

Powder
Bed

Ballistic Particle Manufacturing


(BPM)
Employs a technology called Digital Microsynthesis
1) Molten plastic is fed to a piezoelectric jetting mechanism,
similar to those on inkjet printers.
2) A multi-axis controlled NC system shoots tiny droplets of
material onto the target, using the jetting mechanism.
3) Small droplets freeze upon contact with the surface, forming
the surface particle by particle.
Process allows use of virtually any thermoplastic (no health
hazard) & offers the possibility of using material other than
plastic.

BPM Process
Ejector Head

Has multi-axis control


to "aim" droplet stream
Droplets
of Molten
Material

Build
Platform

SFM Layer Formation Methods


Solid

Liquid

Powder

Bulk

1 Component

Gluing Sheets

Selective Laser
Sintering

Laminated
Object
Manufacturing

Component
& Binder
3D Printing &
Gluing

Polymerization
Foil
Polymerization

Liquid
Polymerization

Melting &
Solidification
Shape Melting

Light
Two
frequencies
Beam Interference
solid

One
frequency

Heat
Thermal
Polymerization

Fused Deposition
Modeling
Ballistic Particle
Manufacturing

Solid Base Curing

Lamps Photosolid. Layer at a Time


Lasers Stereolithography

RP Applications
Applications of rapid prototyping can be
classified into three categories:
1. Design
2. Engineering analysis and planning
3. Tooling and manufacturing

Design Applications
Designers are able to confirm their design by
building a real physical model in minimum
time using RP
Design benefits of RP:
Reduced lead times to produce prototypes
Improved ability to visualize part geometry
Early detection of design errors
Increased capability to compute mass properties

Engineering Analysis and Planning


Existence of part allows certain engineering
analysis and planning activities to be
accomplished that would be more difficult
without the physical entity
Comparison of different shapes and styles to determine
aesthetic appeal
Wind tunnel testing of streamline shapes
Stress analysis of physical model
Fabrication of pre-production parts for process planning
and tool design

Tooling Applications
Called rapid tool making (RTM) when RP is
used to fabricate production tooling
Two approaches for tool-making:
1. Indirect RTM method
2. Direct RTM method

Indirect RTM Method


Pattern is created by RP and the pattern is used
to fabricate the tool
Examples:
Patterns for sand casting and investment casting
Electrodes for EDM

Direct RTM Method


RP is used to make the tool itself
Example:
3DP to create a die of metal powders followed by
sintering and infiltration to complete the die

Manufacturing Applications
Small batches of plastic parts that could not
be economically molded by injection molding
because of the high mold cost
Parts with intricate internal geometries that
could not be made using conventional
technologies without assembly
One-of-a-kind parts such as bone
replacements that must be made to correct
size for each user

Problems with Rapid Prototyping


Part accuracy:
Staircase appearance for a sloping part surface due to
layering
Shrinkage and distortion of RP parts

Limited variety of materials in RP


Mechanical performance of the fabricated parts is limited
by the materials that must be used in the RP process

Rapid Prototyping

Rapid Prototyping has


surgical applications

Layer by layer fabrication of


three-dimensional physical
models from CAD
Fast and inexpensive alternative
for producing prototypes and
functional models
Build parts in thin layers
Minimum operation time;
typically runs unattended

Medical Modeling - Zcorp

For more information on RP


efunda.com
http://www.efunda.com/processes/rapid_prototyping/

Numerical Control Machines

Introduction to Numerical Control


What is numerical control (NC)?

NC has been defined by the Electronic Industries Association (EIA) as a


system in which actions are controlled by the direct insertion of numerical
data at some points. The system must automatically interpret at least some
portion of this data
The term NC is used to describe the control of the various functions of a
machine using numeric data. In the early age of NC, machines were fed
with information by means of the punched tape. An Electro-mechanical
tape reader was used to load a machine tape into the controller.

In general there are three basic components of an


operational NC (as illustrated in Figure 1):
1.
Programme of instruction.
2.
A machine control unit.
3.
Machine tool.
Machine tool

Control unit

Program of
instruction

Punch Card for storing NC program

The program of instruction is a numerical or symbolic


code that is detailed step-by-step to tell the machine
tool what to do.
The controller unit is the unit that reads the
programme of instructions and converts it to real
movement of a machine tool. Two basic types of
control unit are used with NC machines: open-loop
control and closed-loop control.
The machine tool performs the mechanical work and
deals directly with the part being machined.

Computer Numerical Control (CNC)


CNC refers to a computer that is joined to the NC machine to
make the machine versatile. Information can be stored in a
memory bank. The programme is read from a storage medium
such as the punched tape and retrieved to the memory of the
CNC computer. Some CNC machines have a magnetic medium
(tape or disk) for storing programs. This gives more flexibility for
editing or saving CNC programs.

Miscellaneous control
-e.g. limit switches,

Magnetic tape
or disk or
paper tape
reader

coolant, spindle, etc.

NC controller
with keypad
and display
Machine tool

Paper
tape punch

Axis drive and


control (x,y,z,a,b,w)
spindle speed

Direct Numerical control (DNC) can be defined as a set of NC


machines that is connected to a main computer system to
establish a direct interface between the DNC computer memory
and the machine tools. The tape is not used in the DNC system;
hence a central time-sharing computer is used.
Multi-machine
controller
Direct axis and
service control

Distributed Numerical Control

Distributed NC is more advanced than DNC and is widely


used in many current applications. The distributed NC uses a
local area network but not like that in DNC. It has been
indicated that the main difference between DNC and
distributed NC is that because modern NC machines have
CNC capability, they have memory and therefore computer
programs can be downloaded into the memory of a CNC
local computer, rather than one block at a time as in DNC
systems.

CIM host database of


processes part
programs
controller
Local area network

CNC
controller

CNC
controller

CNC
controller

CNC
controller

CNC
controller

Voice Numerical Control (VNC)

Voice Numerical Control (VNC) is similar to DNC


machines but the programmer conveys the
information needed to operate the machine by means
of computer system. The programmer talks into the
computer, and the memory receives the information
using a wire. This information can be taken and used
to run the machines.

Advantages of CNC
1. Increased productivity.
2. High accuracy and repeatability.
3. Reduced production costs.
4. Reduced indirect operating costs.
5. Facilitation of complex machining operations.
6. Grater flexibility.
7. Improved production planning and control.
8. Lower operator skill requirement.
9. Facilitation of flexible automation.
Limitations of CNC:

1. High initial investment.


2. High maintenance requirement.
3. Not cost-effective for low production cost.

Applications of NC
Machine tool applications:
1. Milling machines.
2. Drilling machines.
3. Boring machines.
4. Turning machines.
5. Grinding machines.
6. Sawing machines.
Non- machine tool applications:
1. Welding machines- flame cutting machines.
2. Press-working machines- assembly machines.
3. Inspection machines- automatic drafting machines

Computer-Assisted Part Programming

Stages of Computer-Assisted Part Programming


Identify the part geometry, cutter motions, feeds, speeds and
cutter parameters
Code geometry, cutter motions and machine instructions by
part programming language source file.
Automatically Programmed Tools (APT)
COMPACT II

Compile the source file to machine-independent cutter


location data file (CLDATA)
Post-process the CLDATA to machine control data (MCD) for
target machine
Transmit MCD to machine

APT (programming language)


APT or Automatically Programmed Tool is a high-level computer
programming language used to generate instructions
for numerically controlled machine tools. Douglas T. Ross is
considered by many to be the father of APT. APT is a language and
system that makes numerically controlled manufacturing possible.
It is used to calculate a path that a tool must follow to generate a
desired form. APT is a special-purpose language and the
predecessor to modern CAM systems. It was created and refined
during the late 1950s and early 1960s to simplify the task of
calculating geometry points that a tool must traverse in space to cut
the complex parts required in the aerospace industry.
APT was created before graphical interfaces were available, and so
it relies on text to specify the geometry and toolpaths needed to
machine a part. The original version was created before even
FORTRAN was available and was the very first ANSI standard. Later
versions were rewritten in FORTRAN.

Language Statements of APT


Geometry statements
Definition of part geometry

Motion statements
Define the motion of cutting tool

Post-processor statements
Machine instructions passed unchanged into
CLDATA file

Auxiliary statements
Additional information of part name, tolerances
etc.

Geometry Statements
Format:
symbol = geometry_word / descriptive data
symbol : name of geometric element
geometry_word : major word name of geometry type
descriptive data : numeric data for the geometry entity,
reference to other entities, or qualifying minor words

Examples:
CIR = CIRCLE/CENTER, PT, TANTO,LN
P1 = POINT/X, Y, Z
L1 = LINE/P1, P2

Points Definition in APT

P1 = POINT/X, Y, Z
P2 = POINT/L1, L2
P3 = POINT/CENTER, C1
P4 = POINT/YLARGE, INTOF, L1, C1
P5 = POINT/XLARGE, INTOF, L1, C1
P6 = POINT/YLARGE, INTOF, C1, C2
P7 = POINT/XLARGE, INTOF, C1, C2

Lines Definition in APT


L1 = LINE/X1,Y1,Z1,X2,Y2,Z2
L2 = LINE/P1, P2
L3 = LINE/P1, PARLEL, L0
L4 = LINE/P1, PERPTO, L0
L5 = LINE/P1, TANTO, C1
L6 = LINE/P1, RIGHT, TANTO, C1
L7 = LINE/LEFT, TANTO, C1, LEFT, TANTO, C2
L8 = LINE/LEFT, TANTO, C1,RIGHT, TANTO, C2
L9 = LINE/RIGHT, TANTO, C1, LEFT, TANTO, C2
L10 = LINE/RIGHT, TANTO, C1, RIGHT, TANTO, C2
L11 = LINE/P1, ATANGL, Degree, L0

Circles Definition in APT

C1 = CIRCLE/X, Y, Z, R
C2 = CIRCLE/CENTER, P1, RADIUS, R
C3 = CIRCLE/CENTER, P1, TANTO, L0
C4 = CIRCLE/P1, P2, P3
C5 = CIRCLE/XSMALL, L1, XSMALL, L2, RADIUS, R

Motion Statements
Point-to-point operation
FROM/point_location
GOTO/point_location
GODLTA/x, y, z

P0 = POINT/0.0, 3.0, 0.1


P1 = POINT/1.0, 1.0, 0.1
P2 = POINT/2.0, 1.0, 0.1
FROM/P0
GOTO/P1
GODLTA/0, 0, -0.7
GODLTA/0, 0, 0.7
GOTO/P2
GODLTA/0, 0, -0.7
GODLTA/0, 0, 0.7
GOTO/P0

Examples

Motion Statements
Contouring operation
Control surface
Part surface
Drive surface
Check surface

Motion Statements
Contouring operation
GO command
GO/ {TO}, Drive surface, { TO }, part surface, { TO }, Check
surface

Constraint modifiers

TO
PAST
ON
TANTO used only with check surface

Motion Statements

A: GO/TO, L1, TO, PS, TANTO, C1


B: GO/PAST, L1, TO, PS, TANTO, C1

Motion Statements
Contouring operation
Tool moving command
GOLFT/
GORGT/
GOUP/
GODOWN/
GOFWD/
GOBACK/

Example
FROM/SP
GO/TO, L1, TO, PS, ON, L4
GORGT/L1, PAST, L2
GOLFT/L2, PAST, L3
GOLFT/L3, PAST, C1
GOLFT/C1, PAST, L3
GOLFT/L3, PAST, L4
GOLFT/L4, PAST, L1
GOTO/SP

Example
FROM/SP
GO/TO, L1, TO, PS, TO, L6
GORGT/L1, TO, L2
GORGT/L2, TANTO, C1
GOFWD/C1, TANTO, L3
GOFWD/L3, PAST, L4
GOLFT/L4, PAST, L5
GOLFT/L5, PAST, L6
GOLFT/L6, PAST, L1
GOTO/SP

Post-Processor Statements
MACHIN/
MACHINE/DRILL, 2

COOLNT/

COOLNT/MIST
COOLNT/FLOOD
COOLNT/OFF
COOLNT/ON

FEDRAT/
FEDRAT/4.5

SPINDL/
SPINDL/ON
SPINDL/1250, CCLW

TOOLNO/
TOOLNO/3572, 6

TURRET
END

Tolerance and Cutter Statements


OUTTOL/, INTOL/
INTOL/0.005
OUTTOL/0.003

CUTTTER/
CUTTER/0.6

Other Capabilities of APT


Arithmetic manipulation and looping
Subprogram as macro facility
P0 = POINT/0.0, 3.0, 0.1
FROM/P0
CALL/DRILL, X = 1.0, Y = 1.0, Z = 0.1, DEPTH = 0.7
CALL/DRILL, X = 2.0, Y = 1.0, Z = 0.1, DEPTH = 0.7
DRILL = MACRO/X, Y, Z, DEPTH
GOTO/X, Y, Z
GODLTA/0.0, -DEPTH
GODLTA/0.0, DEPTH
TARMAC

Post-Processing

Post-Processing
Compile APT program to Cutter Location Data
file (CLDATA)
Processing CLDATA file to MCD (G- and Mcode)
Generalized
Post-Processors (G-Post)
Post-processor output

APT Language Example

CNC Fundamentals

All CNC machine tools follow the same standard for


motion nomenclature and the same coordinate
system. This is defined as the EIA 267-C standard. The
standard defines a machine coordinate system and
machine movements so that a programmer can
describe machining operations without worrying about
whether a tool approaches a workpiece or a workpiece
approaches a tool.

Machine coordinate system


The direction of each finger
represents the positive direction
of motion.
The axis of the main spindle is
always Z, and the positive
direction is into the spindle.
On a mill the longest travel slide
is designated the X axis and is
always perpendicular to the Z axis.
If you rotate your hand looking
into your middle finger, the
forefinger represents the Y axis.
The base of your fingers is the
start point or (X0, Y0, Z0).

Axis and motion nomenclature Rotary motion


designation
The right-hand rule for determining the correct axis on
a CNC machine may also be used to determine the
clockwise rotary motion about X, Y, and Z.
To determine the positive, or clockwise, direction
about an axis, close your hand with the thumb pointing
out.
The thumb may represent the X, Y, or Z direction and the
curl of the fingers may represent the clockwise, or positive,
rotation about each axis.
These are known as A, B, and C and represent the rotary
motions about X, Y, and Z, respectively.

Axis and motion nomenclature CNC mill

On this gantry mill the spindle travels along the X Axis. The
travel direction of the table designates the Y Axis. The Z Axis is
designated by the stationary vertical column.

Axis and motion nomenclature CNC lathe

On most CNC lathes the Z Axis is parallel to the spindle and longer than the X Axis.

Axis and motion nomenclature 5-axis CNC contour mill

On this five-axis horizontal contour milling machine, note the


orientation of the X and Y axes in relation to the Z Axis. The rotary
axes for both the X and Y axes are designated by the A and B
rotary tables.

Axis and motion nomenclature vertical CNC knee mill

On a common vertical knee CNC mill the spindle is


stationary while the rest of the components move
according to their axis designations (X, Y, and Z).

Axis and motion nomenclature CNC punch machine

On a CNC punch press the part is moved in the X


and Y directions while the punch is stationary.

CNC milling fundamentals The three Cartesian planes

The three planes in the Cartesian coordinate system are XY, XZ,
and YZ. These are referred to as G17, G18, and G19,
respectively, on the mill.

CNC milling fundamentals The part reference zero

There are two reference points on a CNC Machine:


Machine Reference Zero (MRZ) and the Part
Reference Zero (PRZ). All coordinates are based on
these two points.
All CNC machine tools require a reference point
from which to base coordinates.
It is generally easier to use a point on the
workpiece itself for reference, because the
coordinates apply to the part anyway thus the
PRZ designation.
The PRZ is defined as the lower left-hand corner
and the top of the stock of each part.

The advantages of having the PRZ at the lower left top


corner are:
1.Geometry creation is in the positive XY plane for
CAD/CAM systems.
2.The corner of the workpiece is easy to find.
3.All negative Z depths are below the surface of the
workpiece.

The Cartesian graph


Cartesian coordinates were
invented by Ren Descartes,
who is famous for the phrase
"I think, therefore I am."
Most Cartesian graphs for
milling and turning use a
three-axis coordinate system,
denoted by the X, Y, and Z
axes. These coordinates are
used to instruct the machine
tool where to move on the
workpiece.

CNC milling fundamentals Absolute coordinates

Absolute coordinates use the


origin as the reference point.
This means that any point on
the Cartesian graph can be
plotted
accurately
by
measuring the distance from
the origin to the point, first
in the X direction, then in the
Y direction, and then, if
applicable, in the Z direction.

CNC milling fundamentals Incremental coordinates

Incremental coordinates use


the present position as the
reference point for the next
movement. This means that
any point in the Cartesian
graph can be plotted
accurately by measuring the
distance between points,
generally starting at the
origin.

EXERCISE 1: Absolute Coordinates


Fill in the X and Y blanks with the appropriate absolute coordinates
for points A through H.
A: X_____, Y_____ B: X_____, Y_____
C: X_____, Y_____ D: X_____, Y_____
E: X_____, Y_____ F: X_____, Y_____
G: X_____, Y_____ H: X_____, Y_____

EXERCISE 2: Incremental Coordinates


Fill in the X and Y blanks with the appropriate incremental
coordinates for points A through H.
A: X_____, Y_____ B: X_____, Y_____
C: X_____, Y_____ D: X_____, Y_____
E: X_____, Y_____ F: X_____, Y_____
G: X_____, Y_____ H: X_____, Y_____

CNC turning fundamentals

CNC lathes share the same two-axis coordinate system.


This allows for the transfer of CNC programs among
different machines, as all measurements are derived
from the same reference points.
In CNC turning there is a primary, or horizontal, axis and
a secondary, or vertical, axis. Because the major axis
always runs through the spindle (horizontally), the Z axis
is usually the longer one. The X axis is perpendicular to
the Z axis (or vertical).
It is important to remember that on most CNC lathes
the tool post is on the top, or backside, of the machine,
unlike on a conventional lathe. This is why the tool is
shown above the part in the simulation examples.

CNC turning fundamentals Cartesian graph for turning

When measuring X and Z coordinates, use a central reference


point. Start all measurements at this reference point, the origin
point (X0, Z0). For all our examples the origin is located at the
center right-hand endpoint of the workpiece. Keep in mind that
at times the center left-hand endpoint of the workpiece may be
used

CNC turning fundamentals Diameter programming

Diameter (or diametrical)


programming relates the
X axis to the diameter of
the
workpiece.
For
example, if the workpiece
has a 5-in. outside
diameter and you want to
command an absolute
move to the outside, you
would program X5.0.

CNC turning fundamentals Radial programming

Radius
(or
radial)
programming relates the
X axis to the radius of the
workpiece. For example,
for the same 5-in. outside
diameter workpiece, you
would program X2.5 to
move the tool to the
outside.

CNC turning fundamentals Absolute coordinates


When plotting points using
absolute
coordinates,
always start at the origin
(X0, Z0). Then travel along
the Z axis until you reach a
point directly below the
point that you are trying to
plot. Write down the Z value
and then go up until you
reach your point. Write
down the X value. You now
have the XZ (or ZX)
coordinate for that point.

CNC turning fundamentals Incremental coordinates


The second method for
finding points in a
Cartesian
coordinate
system is by using
incremental coordinates.
Incremental, or relative,
coordinates use each
successive
point
to
measure
the
next
coordinate. Instead of
constantly referring back
to the origin, the
incremental
method
refers to the previous
point

EXERCISE 1: Using Incremental Coordinates.


Find the diametrical X and Z coordinates for points A
through E.
A: X_____, Z_____ B: X_____, Z_____
C: X_____, Z_____ D: X_____, Z_____
E: X_____, Z_____

EXERCISE 2: Using Absolute Coordinates


Find the X and Z coordinates for points A through E.
A: X_____, Z_____ B: X_____, Z_____
C: X_____, Z_____ D: X_____, Z_____
E: X_____, Z_____

CNC Machining

Before you can fully understand CNC, you must first


understand how a manufacturing company processes a
job that will be produced on a CNC machine. The
following is an example of how a company may break
down the CNC process .

FLOW OF CNC PROCESSING


1. Obtain or develop the part drawing.
2. Decide what machine will produce the part.
3. Decide on the machining sequence.
4. Choose the tooling required.
5. Do the required math calculations for the program
coordinates.
6. Calculate the speeds and feeds required for the
tooling and part material.
7. Write the NC program.
8. Prepare setup sheets and tool lists.
9. Send the program to machine.
10. Verify the program.
11. Run the program if no changes are required

PREPARING A PROGRAM
A program is a sequential list of machining
instructions for the CNC machine to execute.
These instructions are CNC code that consists of
blocks (also called lines). Each block contains an
individual command for a movement or specific
action. As with conventional machines, one
movement is made before the next one. This is
why CNC codes are listed sequentially in
numbered blocks.

The following is a sample CNC milling program. Note how each


block is numbered and usually contains only one specific
command. The blocks are numbered in increments of 5 (this is
the software default on startup). Each block contains specific
information for the machine to execute in sequence.
Workpiece Size: X4, Y3, Z1
Tool: Tool #3, 3/8" Slot Drill
Tool Start position: X0, Y0, Z1.0
%
(Program Start Flag)
:1002
(Program #1002)
N5 G90 G20 G40 G17
(Block #5, Absolute in Inches)
N10 M06 T3
(Tool Change to Tool #3)
N15 M03 S1250
(Spindle on CW at 1250 RPM)
N20 G00 X1.0 Y1.0
(Rapid over to X1.0, Y1.0)
N25 Z0.1
(Rapid down to Z0.1)
N30 G01 Z-0.125 F5
(Feed down to Z-0.125 at 5ipm)
N35 X3.0 Y2.0 F10.0
(Feed diagonally to X3.0, Y2.0 at 10ipm)
N40 G00 Z1.0
(Rapid up to Z1.0)
N45 X0 Y0
(Rapid over to X0, Y0)
N50 M05
(Spindle Off)
N55 M30

(Program End)

CNC CODES

There are two major types of CNC codes, or letter addresses,


in any program. The major CNC codes are called G-codes and
M-codes.
G-codes are preparatory functions, which involve actual tool
moves (for example, control of the machine). These include
rapid moves, feed moves, radial feed moves, dwells,
roughing, and profiling cycles.
M-codes are miscellaneous functions, which include actions
necessary for machining but not those that are actual tool
movements (for example, auxiliary functions). These include
actions such as spindle on and off, tool changes, coolant on
and off, program stops, and related functions.

Each designation used in CNC programming is called a letter


address. The letters used for programming are as follows:
N
Block Number: Specifies the start of a block
G
Preparatory function, as previously explained
X
X Axis Coordinate
Y
Y Axis Coordinate
Z
Z Axis Coordinate
I
X Axis location of Arc center
J
Y Axis location of Arc center
K
Z Axis location of Arc center
S
Sets the spindle speed
F
Assigns a feedrate
T
Specifies tool to be used
M
Miscellaneous function, as previously explained

THREE MAJOR PHASES OF A CNC PROGRAM


The three phases of a CNC program are:
(1) Program setup: contains all the instructions that
prepare the machine for operation
(2) Material removal: deals exclusively with the actual
cutting feed moves
(3) System shutdown: contains the G- and M-codes
that turn off all the options that were turned on in
the setup phase.

The following shows the three major phases of a CNC


program.
%
:1001
N5 G90 G20
Program setup
N10 M06 T2
N15 M03 S1200
N20 G00 X1.00 Y1.00
Material removal N25 Z0.125
N30 G01 Z-0.125 F5.0
N35 G01 X2.0 Y2.0
N40 G00 Z1.0
N45 X0 Y0
System shutdown N50 M05
N55 M30

Examine the following program to see


how it was written.
%
:1001
N5 G90 G20
N10 M06 T1
N15 M03 S1200
N20 G00 X1 Y1 Z0.125
N25 G01 Z-0.125 F5.0
N30 G01 X3.0
N35 G01 Y2.0
N40 G01 X1
N45 G01 Y1
N50 G01 Z-0.25
N55 G01 X3
N60 Y2
N65 X1
N70 Y1
N75 G00 Z0.050
N80 G00 Z1
N85 X0 Y0
N85 M05
N90 M30

Program Start Flag


Program Number
Use Absolute Coordinates and inch programming
Tool change, use Tool #1.
Turn spindle on CW at 1200 RPM
Rapid move to X1 Y1 Z0.125
Feed down into the part 0.125" at 5 ipm
Feed to X3 (still at 5 ipm)
Feed to Y2 (still at 5 ipm)
Feed back to X1
Feed back to Y1
Feed down to Z-0.25" (still at 5 ipm)
Feed across to X3
Feed to Y2 (The G01 is MODAL)
Feed back to X1 (G01 is still MODAL)
Feed to start point at Y1
Rapid to Z0.05
Rapid tool up to Z1 or clearance plane
Rapid to home position
Turn spindle off
End of program

USING A PROGRAMMING SHEET


You use the CNC program sheet to prepare the CNC program. Doing so
simplifies the writing of the CNC program

EQUIVALENT CNC BLOCKS -->

N5 G20 G90
N10 T02 M06
N15 M03 S1200
N20 G00 X0 Y0
N25 Z0.1
N30 G01 Z-0.1 F2.0
N35 G01 X1.5

BLOCK FORMAT
Block format is often more important than program format. It is vital that each
block of CNC code be entered into the CPU correctly. Each block comprises
different components, which can produce tool moves on the machine.
Following is a sample block of CNC code. Examine it closely and note how it is
written.
N135 G01 X1.0 Y1.0 Z0.125 F5.0
N135

Block Number Shows the current CNC block number.

G01

G-Code The G-code is the command that tells the machine what it is to
do in this case, a linear feed move.

X1.0 Y1.0 Z0.125 Coordinate. This gives the machine an endpoint for its move.
X designates an X axis coordinate. Y designates a Y coordinate. Z
designates a Z coordinate.
F5.0

Special Function. Any special function or related parameter is to be


included here. In this case, a feed rate of 5 inches per minute is
programmed.

There are some simple restrictions to CNC blocks:


Each may contain only one tool move.
Each may contain any number of nontool move G-codes, provided they do not
conflict with each other (for example, G42 and G43).
Each may contain only one feedrate per block.
Each may contain only one specified tool or spindle speed.
The block numbers should be sequential.
Both the program start flag and the program number must be independent of
all other commands.
The data within a block should follow the sequence shown in the above
sample block, N-block number, G-code, any coordinates, and other required
functions.
Each may contain only one M-code per block.

PREPARING TO PROGRAM

Before you write a CNC program, you


must first prepare to write it. The
success of a CNC program is
directly related to the preparation
that you do before you write the
CNC program. You should do three
things before you begin to write a
program:
1. Develop an order of operations.
2. Do all the necessary math and
complete a coordinate sheet.
3. Choose your tooling and calculate
speeds and feedrates.

The CNC operator can also use coordinate and setup sheets.
Using them as references makes generation of the CNC program
easier.

Program zero allows you to specify a position from which to start or to

work. Once program zero has been defined, all coordinates used in a program
will be referenced from this point. When you work from a constant program
zero, you are using absolute programming. In incremental programming, you
have in effect a floating program zero that changes at all times
To specify absolute positions in
the X direction, use the Xaddress word. To specify
absolute positions in the Y and
Z directions, use the Y- and Zaddress words, respectively.
The position selected for
milling is always the lower lefthand corner and top surface of
the workpiece. The position
used for the lathe is always the
center of the part in X and the
right-hand end of the finished
workpiece in Z.

TOOL MOTION

Generally, three types of tool motion are used on a CNC


machine:
G00 Rapid tool move. Nonmachining command. Each
axis trajectory is exhausted as fast as the motor can drive
the axes.
G01 Straight-line feed move. Linear interpolation.
Coordinated moves at a controlled feedrate.
G02/G03
Two-dimensional arc feed moves. Circular
interpolation.

TOOL MOTION

USING CANNED CYCLES

Canned, or fixed program, cycles are aids that simplify


programming. Canned cycles combine many standard
programming operations and are designed to shorten the
program length, minimize math calculations, and optimize
cutting conditions to improve the efficiency of the machine.
Examples of canned cycles on a mill are drilling, boring, spot
facing, tapping, and so on; on a lathe, threading, rough
facing and turning, and pattern repeating cycles. On the
lathe, canned cycles are also referred to as multiple
repetitive cycles. You will find examples of these cycles as
you work through the milling and turning sections.

USING CANNED CYCLES

Tooling

Not all cutting operations can


be performed with a single
tool. Separate tools are used
for roughing and finishing, and
tasks such as drilling, slotting,
and thread cutting require
their own specific tools. The
correct cutting tool must be used at
all times. The size and shape of the
cutting tools that you can use
depend on the size and shape of the
finished part. A tool manufacturer's
catalog will give you a complete

Remember: The depth of cut that can be list of the various types of
available and the
taken depends on the workpiece tools
material, the coolant, the type of tool, applications of each
and the machine tool itself.

Tooling

The tool most often used


to make holes is the fluted
drill. Drills are made with
two, three, or four cutting
lips. The two-lip drill is
used for drilling solid stock.
The three- and four-lip
drills are used for enlarging
holes that have been
previously drilled. Modern
drills can also have
coolant holes for direct
delivery
of
coolant
through the end of the
drill.

Tooling

The rotating cutter, termed the


milling cutter, has almost an
unlimited variety of shapes and
sizes for milling regular and
irregular forms. The most common
milling cutter is the end mill. Other
tools that are often used are shell
mills, face mills, and roughing mills.
When milling, care must be taken
not to take a cut that is deeper
than the milling cutter can handle.
End mills come in various shapes
and sizes, each designed to
perform a specific task. The three
basic shapes of standard end mills
are flat, ballnose, and bullnose.

Tooling

In lathe operations, the tool is driven


through the material to remove chips
from the workpiece in order to leave
geometrically true surfaces. The type
of surface produced by the cutting
operation depends on the shape of
the tool and the path it follows
through the material. When the
cutting edge of the tool breaks down,
the surface finish becomes poor and
the cutting forces rise. Vibration and
chatter are definite signs of tool wear,
although many forces such as depth of
cut, properties of materials, friction
forces, and rubbing of the tool nose
also affect tool vibration.

FEEDRATES AND SPINDLE SPEEDS


It is very important to fully understand the value of the correct
feedrate and spindle speed. Too fast a speed or feedrate will
result in early tool failure or poor surface finish. Too slow a
speed or feedrate will lead to increased machining time and,
possibly, greater part cost. New tool technology has produced
a wide range of tools that can be used at greater speeds and
feed rates for longer periods.
For milling, the correct speeds and feed rates are determined in
part by the diameter of the cutter, spindle RPM, number of
teeth on the cutter, chip load per tooth, and surface feet per
minute for a particular material. For turning, the diameter of
the workpiece and the surface feet per minute for the material
are factors in determining the proper speeds and feed rates.

CUTTING FLUIDS
There are three main reasons for using cutting fluid
To remove or reduce the heat being produced
To reduce cutting tool wear
To help clear chips from the workpiece area

CNC Milling Programming

To maximize the power of modern CNC milling machines, a programmer has to


master the following five categories of programming command codes and
techniques:

1. Basic programming commands.


2. Compensating an offset.
3. Fixed cycles.
4. Macro and subroutine programs.
5. Advanced programming features.

1. Basic programming commands.


Motion commands (G00, G01, G02, G03)
Plane selection (G17, G18, G19)
Positioning system selection (G90, 091)
Unit selection (G70 or G20, G71 or G21)
Work coordinate setting (G92)
Reference point return (G28, G29, G30)
Tool selection and change (Txx M06)
Feed selection and input (Fxxx.xx, G94, 095)

Spindle speed selection and control (Sxxxx, M03, M04,


M05)

Miscellaneous functions (M00, M01, M02, M07, M08, M09,


M30)

2. Compensation and offset. The use of compensation and


offset functions in defining work coordinate systems,
performing tool diameter compensations, and accommodating
tool length differences often results in reduced programming
effort. The main compensation and offset functions are
Work coordinate compensation (G54-G59)
Tool diameter (radius) compensation (G40, G41, G42)
Tool length offset (G43, G44, G49)
3. Fixed cycles. The purpose of a fixed cycle is to execute a
series of repetitive machining operations with a single block
command. Fixed cycles may be classified into the following
three categories:
Standard fixed cycles (G80-G89)
Special fixed cycles
User-defined fixed cycles

4. Macro and subroutine programming. Most modem CNC


controls furnish the power of computer programming to
define variables, perform arithmetic operations, execute
logical decisions, and so on. These features allow easy
implementation of repetitive machining patterns and
complex workpiece shapes that can be defined
mathematically.
5. Advanced programming features. These commands are
dependent on user control. They are used to simplify
programming effort and reduce programming time and
program size. Typical features include scaling, rotation,
and mirror image.

CNC Milling G-Codes

G-codes are preparatory functions that involve actual tool


moves (for example, control of the machine). These include
rapid moves, feed moves, radial feed moves, dwells, and
roughing and profiling cycles.
Most G-codes described here are modal, meaning that they
remain active until canceled by another G-code. The
following codes are described in more detail in the
following sections.

CNC Milling G-Codes


G00

Positioning in rapid

Modal

G01

Linear interpolation

Modal

G02

Circular interpolation (CW)

Modal

G03

Circular interpolation (CCW)

Modal

G04

Dwell

G17

XY plane

Modal

G18

XZ plane

Modal

G19

YZ plane

Modal

G20/G70

Inch units

Modal

CNC Milling G-Codes

Modal

G21/G71

Metric units

G28

Automatic return to reference point

G29

Automatic return from reference point

G40

Cutter compensation cancel

Modal

G41

Cutter compensation left

Modal

G42

Cutter compensation right

Modal

G43

Tool length compensation (plus)

Modal

G44

Tool length compensation (minus)

Modal

G49

Tool length compensation cancel

Modal

G54-G59

Workpiece coordinate settings

Modal

CNC Milling G-Codes

G73

High-speed peck drilling

Modal

G80

Cancel canned cycles

Modal

G81

Drilling cycle

Modal

G82

Counter boring cycle

Modal

G83

Deep hole drilling cycle

Modal

G90

Absolute positioning

Modal

G91

Incremental positioning

Modal

G92

Reposition origin point

G98

Set initial plane default

G99

Return to retract (rapid) plane

CNC Milling M-CODES

M-codes are miscellaneous functions that include actions necessary


for machining but not those that are actual tool movements. That is,
they are auxiliary functions, such as spindle on and off, tool changes,
coolant on and off, program stops, and similar related functions. The
following codes are described in more detail in the following sections.
M00
M01
M02
M03
M04

Program stop
Optional program stop
Program end
Spindle on clockwise
Spindle on counterclockwise

CNC Milling M-CODES


M05
Spindle stop
M06
Tool change
M08
Coolant on
M09
Coolant off
M10
Clamps on
M11
Clamps off
M30
Program end, reset to start
M98
Call subroutine command
M99
Return from subroutine command
Block Skip Option to skip blocks that begin with /
Comments Comments may be included in blocks with
round brackets ( )

Tool Motion Command - G00 Positioning in Rapid


Format: N_ G00 X_ Y_ Z_
The G00 command is a rapid
tool move. A rapid tool move
is used to move the tool
linearly from position to
position without cutting any
material. This command is
not to be used for cutting any
material, as to do so would
seriously damage the tool
and ruin the workpiece. It is a
modal command, remaining
in effect until canceled by
another G-Code command

The G00 command is used to move the tool


quickly from one point to another without cutting,
thus allowing for quick tool positioning.

The G00 rapid move should have two distinct movements to


ensure that vertical moves are always separate from
horizontal moves. In a typical rapid move toward the part,
the tool first rapids in the flat, horizontal XY plane. Then, it
feeds down in the Z axis. When rapiding out of a part, the
G00 command always goes up in the Z axis first, then
laterally in the XY plane.

As this diagram shows, if the basic rules are not


followed, an accident can result. Improper use of
G00 often occurs because clamps are not taken
into consideration. Following the basic rules will
reduce any chance of error.

EXAMPLE:
N25 G00 X2.5 Y4.75
N30 Z0.1

(Rapid to X2.5,Y4.75)
(Rapid down to Z0.1)

Depending on where the tool is located, there are two basic rules to
follow for safetys sake:

If the Z value represents a cutting move in the negative direction,


the X and Y axes should be executed first.

If the Z value represents a move in the positive direction, the X and Y


axes should be executed last.

Sample Program :

Workpiece Size: X6,Y4,Z1


Tool: Tool #2, 1/4" Slot Drill

Tool Start Position: X0,Y0,Z1


%
:1001
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.25 F5
N35 Y3
N40 X5
N45 X1 Y1 Z-0.125
N50 G00 Z1
N55 X0 Y0
N60 M05
N65 M30

(Program start flag)


(Program number 1001)
(Absolute and inch programming)
(Tool change, Tool #2)
(Spindle on CW, at 1200 rpm)
(Rapid over to X1,Y1)
(Rapid down to Z0.1)
(Feed move down to a depth of 0.25 in.)
(Feed move to Y3)
(Feed to X5)
(Feed to X1,Y1,Z0.125)
(Rapid up to Z1)
(Rapid over to X0,Y0)
(Spindle off)
(End of program)

G01 Linear Interpolation


Format: N_ G01 X_ Y_ Z_ F_

The G01 command is


specifically for the
linear
removal
of
material
from
a
workpiece, in any
combination of the X, Y,
or Z axes. The machine
tool follows a linear
trajectory.
The G01 is modal and
requires a user variable
feedrate (designated by
the letter F followed by
a number).

Linear Interpolation,
or straight-line feed
moves, on the flat XY
plane (no Z values
are specified).

G01
command,
using multi-axis feed
moves. All diagonal
feed moves are a
result of a G01
command,
where
two or more axes
are used at once.

Sample Program (G01):


Workpiece Size: X4, Y3, Z1
Tool: Tool #3, 3/8" Slot Drill
Tool Start Position: X0, Y0, Z1
%
:1002
N5 G90 G20
N10 M06 T3
N15 M03 S1250
N20 G00 X1.0 Y1.0
N25 Z0.1
N30 G01 Z-0.125 F5
N35 X3 Y2 F10
N40 G00 Z1.0
N45 X0.0 Y0.0
N50 M05
N55 M30

(Program start flag)


(Program #1002)
(Block #5, absolute in inches)
(Tool change to Tool #3)
(Spindle on CW at 1250 rpm)
(Rapid over to X1,Y1)
(Rapid down to Z0.1)
(Feed down to Z0.125 at 5 ipm)
(Feed diagonally to X3,Y2 at 10 ipm)
(Rapid up to Z1)
(Rapid over to X0,Y0)
(Spindle off)
(Program end)

G02 Circular Interpolation (clockwise)


Format: N_ G02 X_ Y_ Z_ I_ J_ K_ F_
or N_ G02 X_ Y_ Z_ R_ F_

Circular Interpolation is
more commonly known as
radial (or arc) feed moves.
The G02 command is
specifically used for all
clockwise radial feed
moves, whether they are
quadratic arcs, partial
arcs, or complete circles,
as long as they lie in any
one plane.
The G02 command is
modal and is subject to a
user-definable feed rate.

G02 Circular Interpolation (cont'd.)

The G02 command requires


an endpoint and a radius in
order to cut the arc. The
start point of this arc is
(X1,Y4) and the endpoint is
(X4,Y1). To find the radius,
simply
measure
the
incremental distance from
the start point to the center
point. This radius is written
in terms of the X and Y
distances.
To
avoid
confusion, these values are
assigned variables, called I
and J, respectively.

EXAMPLE: G02 X2 Y1 I0 J-1


The G02 command requires an endpoint and a radius in order to cut the arc.
The start point of this arc is (X1, Y2) and the end-point is (X2, Y1). To find the
radius, simply measure the relative, (or incremental), distance from the start
point to the center point. This radius is written in terms of the X and Y
distances. To avoid confusion, these values are assigned variables called I and
J, respectively.

EXAMPLE: G02 X2 Y1 R1
You can also specify G02 by entering the X and Y endpoints and then R for the
radius.
Note: The use of an R value for the radius of an arc is limited to a maximum
movement of 90.
An easy way to determine the radius values (the I and J values) is by making a small
chart:
Center point
X1
Y1
Start point
X1
Y2
Radius
I0
J-1
Finding the I and J values is easier than it first seems. Follow these steps:
1. Write the X and Y coordinates of the arcs center point.
2. Below these coordinates, write the X and Y coordinates of the arcs start
point.
3. Draw a line below this to separate the two areas to perform the subtraction.
Result: G02 X2 Y1 I0 J-1 F5
4. To find the I value, calculate the difference between the arcs start point and
center point in the X direction. In this case, both X values are 1. Hence there is no
difference between them, so the I value is 0. To find the J value, calculate the
difference between the arcs start point and center point in the Y direction. In this
case, the difference between Y2 and Y1 is down 1 inch, so the J value is 1.

Sample Program (G02):


Workpiece Size: X4, Y3, Z1
Tool: Tool #2, 1/4" Slot Drill
Tool Start Position: X0, Y0, Z1
%
:1003
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-0.1 F5
N35 G02 X2 Y2 I1 J0 F20
N40 G01 X3.5
N45 G02 X3 Y0.5 R2
N50 X1 Y1 R2

N55 G00 Z0.1

N60 X2 Y1.5
N65 G01 Z-0.25
N70 G02 X2 Y1.5 I0.25 J-0.25
N75 G00 Z1
N80 X0 Y0
N85 M05
N90 M30

(Arc feed CW, radius I1,J0 at 20 ipm)


(Arc feed CW, radius 2)
(Arc feed CW, radius 2)

(Full circle arc feed move CW)

G03 CIRCULAR INTERPOLATION (CCW)

Format: N_ G03 X_ Y_ Z_ I_ J_ K_ F_ (I, J, K specify the radius)

The G03 command is


used
for
all
counterclockwise radial
feed moves, whether
they are quadratic arcs,
partial arcs, or complete
circles, as long as they
lie in any one plane.
The G03 command is
modal and is subject to
a user-definable feed
rate

EXAMPLE: G03 X1 Y1 I0 J-1

The G03 command requires an endpoint and a radius in order to cut the arc.
(See Fig. 5.7.) The start point of this arc is (X2, Y2) and the end-point is (X1, Y1).
To find the radius, simply measure the incremental distance from the start point
to the center point of the arc. This radius is written in terms of the X and Y
distances. To avoid confusion, these values are assigned variables called I and J,
respectively.

EXAMPLE: G03 X1 Y1 R1

You can also specify G03 by entering the X and Y endpoints and then R for the
radius.
Note: The use of an R value for the radius of an arc is limited to a maximum
movement of 90. An easy way to determine the radius values (the I and J values) is
to make a small chart as follows.
Center point X2
Y1
Start point
X2
Y2
Radius I0
J-1
Finding the I and J values is easier than it first seems. Follow these steps:
1. Write the X and Y coordinates of the arcs center point.
2. Below these coordinates, write the X and Y coordinates of the arcs start point.
3. Draw a line below this to separate the two areas to perform the subtraction.
4. To find the I value, calculate the difference between the arcs start point and
center point in the X direction. In this case, both X values are 2. Hence there is no
difference between them, so the I value is 0. To find the J value, calculate the
difference between the arcs start point and center point in the Y direction. In this
case, the difference between Y2 and Y1 is down 1 inch, so the J value is 1.
Result: G03 X1 Y1 I0 J-1

G03 Circular Interpolation (cont'd)


The G03 command requires an
endpoint and a radius in order to
cut the arc. The start point of this
arc is (X4,Y1) and the endpoint
is(X1,Y4). To find the radius,
simply measure the incremental
distance from the start point to
the center point. This radius is
written in terms of the X and Y
distances. To avoid confusion,
these values are assigned
variables I and J, respectively.

NOTE: Programming the G02 and G03 commands


with an R value is reserved only for arcs less than or
equal to 90 degrees. The more common method
involves the use of trigonometry to solve for the I, J,
or K values.

Sample Program (G03).


Workpiece Size: X4, Y4, Z0.25
Tool: Tool #2, 1/4" Slot Drill
Tool Start Position: X0, Y0, Z1
%
:1004
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X2 Y0.5
N25 Z0.125
N30 G01 Z-0.125 F5
N35 X3 F15
N40 G03 X3.5 Y1 R0.5
N45 G01 Y3
N50 G03 X3 Y3.5 I-0.5 J0
N55 G01 X2
N60 G03 X2 Y1.5 I0 J-1
N65 G01 Y0.5
N70 G00 Z0.1
N75 X1.5 Y2.5
N80 G01 Z-0.25 F5
N85 G03 X1.5 Y2.5 I0.5 J0
N90 G00 Z1
N95 X0 Y0
N100 M05

N105 M30

(G03 arc using R value)


(G03 arc using I and J)
(180 arc using I and J)

(Full circle using I and J)

Command Format with IJK Method


(GI7) G02 (or G03) Xx Yy li Ji Ff on XY-plane
(G18) G02 (or G03) Xx Zz li Kk Ff
on ZX-plane
(G19) G02 (or G03) Yy Zz Jj Kk Ff
on YZ-plane
Command Format with R Method
(GI7) G02 (or G03) Xx Yy Rr Ff on XY-plane
(G18) G02 (or G03) Xx Zz Rr Ff on ZX-plane
(G19) G02 (or G03) Yy Zz Rr Ff on YZ-plane

G04 DWELL
Format: N_ G04 P_

The G04 command is


a nonmodal dwell
command that halts
all axis movement for
a specified time while
the spindle continues
revolving
at
the
specified rpm. A dwell
is used largely in
drilling
operations
and after plunge
moves, which allows
for the clearance of
chips .

Sample Program (G04):

Workpiece Size: X3.5, Y2, Z0.5


Tool: Tool #1, 1/8" Slot Mill
Tool Start Position: X0, Y0, Z1
%
(Program start flag)
:1005
(Program #1005)
N5 G90 G20
(Absolute programming in inch mode)
N10 M06 T1
(Tool change to Tool #1)
N15 M03 S1300
(Spindle on CW at 1300 rpm)
N20 G00 X3 Y1 Z0.1
(Rapid to X3,Y1,Z0.1)
N25 G01 Z-0.125 F5.0
(Feed down to Z0.125 at 5 ipm)
N30 G04 P2
(Dwell for 2 seconds)
N35 G00 X2 Z0.1
(Rapid up to 0.1)
N33 X2
(Rapid to X2)
N40 G01 Z-0.125 F5.0
(Feed down to Z0.125)
N45 G04 P1
(Dwell for 1 second)
N50 G00 Z1.0
(Rapid out to Z1)
N55 X0. Y0.
(Rapid to X0, Y0)
N60 M05
(Spindle off)
N65 M30

(Program end)

G17 XY Plane
Format: N_ G17

G18 XZ Plane
Format: N_ G18

G19 Y Z Plane
Format: N_ G19

G17

XY plane

G18

XZ plane

G19

YZ plane

G20 or G70 Inch Units


Format: N_ G20 or G70

The G20 or G70 command defaults the


system to inch units. When a program is
being run and the G20 command is
encountered, all coordinates are stated as
inch units. This command is usually found
at the beginning of a program. However,
on some controllers it can be used to
switch from metric units in the middle of a
program.

G21 or G71 Metric, or SI, Units


Format: N_ G21 or G71

The G21 or G71 command defaults the


system to metric units. When a program is
being run and the G21 command is
encountered, all coordinates are stated in
as millimeter units. This command is
usually found at the beginning of a
program. However, it can be used to
switch between metric and inch units in
the middle of a program.

G28 Automatic Return to Reference


Format: N_ G28 X_ Y_ Z_
The G28 command is
primarily used before
automatic
tool
changing. It allows
the existing tool to be
positioned to the
predefined reference
point automatically
via an intermediate
position. This ensures
that when the tool
changer is engaged, it NOTE: When this command is being used, it is
is properly aligned advisable for safety reasons to cancel any tool
with the spindle head. offset or cutter compensation.

G29 Automatic Return from Reference


Format: N_ G29 X_ Y_ Z_
The G29 command
can be used
immediately after an
automatic tool
change. It allows the
new tool to be
returned from the
predefined reference
point to the
specified point via
an intermediate
point specified by
the previous G28
command.

NOTE: When this command is being used, it is


advisable for safety reasons to cancel any tool
offset or cutter compensation.

G40 Cutter Compensation Cancel


Format: N_ G40

Usually, CNC programs are written so that the tool center


follows the toolpath. Cutter compensation is used whenever
tool centerline programming is difficult. It is also used to
compensate for significant tool wear or tool substitution. The
G40 command cancels any cutter compensation that was
applied to the tool during a program and acts as a safeguard to
cancel any cutter compensation applied to a previous program
or G-codes.
NOTE: Cutter compensation is modal, so it must be canceled
when it is no longer needed. This is the sole function of the
G40 command

G41 Cutter Compensation Left


Format: N_ G41 D_
The
G41
command
compensates the cutter a
specified distance to the
left-hand side of the
programmed tool path. It is
used to compensate for
excessive tool wear or
substitute a tool to profile a
part.
The G41 command is
modal, so it compensates
each successive tool move
the same specified distance
until it is overridden by a
G40 command or receives a
different offset.

G41 Cutter Compensation Left


Format: N_ G41 D_

Sample program (G41):


Workpiece Size: X5, Y4, Z1
Tool: Tool #1, 1/4" Slot Drill
Tool #4, 1/2" End Mill
Register: D11 is 0.25"
Tool Start Position:X0, Y0, Z1
%
:1012
N5 G90 G20 G40 G17 G80
N10 T01 M06
N15 M03 S2000
N20 G00 X0.5 Y0.5
N25 Z0.1
N30 G01 Z-0.25 F5
N35 X2 F15
N40 X2.5 Y1
N45 Y2
N50 G03 X2 Y2.5 R0.5

N55 G01 X0.5


N60 Y0.5
N65 G00 Z1
N70 X0 Y0
N75 M06 T04
N80 M03 S1000
N85 G00 X0.75 Y1
N90 Z0.125
N95 G01 Z-0.25 F5
N100 G41 X0.5 Y0.5 D11 F20
N105 X2
N110 X2.5 Y1
N115 Y2
N120 G03 X2 Y2.5 R0.5
N125 G01 X0.5
N130 Y0.5
N135 G40 X0.75 Y0.75
N140 G00 Z1
N145 X0 Y0
N150 M05
N155 M30

G42 CUTTER COMPENSATION RIGHT


Format: N_ G42 D_

The
G42
command
compensates the cutter a
specified distance to the
right-hand side of the
programmed tool path. It
is used to compensate for
excessive tool wear or
substitute a tool to profile
a part. The G42 command
is
modal,
so
it
compensates
each
successive tool move the
same specified distance
until it is overridden by a
G40 command or receives
a different offset.

G42 CUTTER COMPENSATION RIGHT


Format: N_ G42 D_

Sample Program (G42):


Workpiece Size: X4, Y4, Z1
Tool: Tool #1, 1/4" Slot Drill
Tool #4, 1/2" End Mill
Register: D11 is 0.25"
Tool Start Position: X0, Y0, Z1
%
:1013
N5 G90 G20 G40 G17 G80
N10 T01 M06
N15 M03 S2000
N20 G00 X0.5 Y0.5
N25 Z0.1
N30 G01 Z-0.25 F5
N35 X2 F15
N40 X2.5 Y1
N45 Y2
N50 G03 X2 Y2.5 R0.5
N55 G01 X0.5
N60 Y0.5

N65 G00 Z1
N70 X0 Y0
N75 T04 M06
N80 M03 S1000
N85 G00 X-0.5
N90 Z-0.5
N95 G01 G42 X0.5 Y0.5 Z-0.5 D11 F15
N100 X2
N105 X2.5 Y1
N110 Y2
N115 G03 X2 Y2.5 R0.5
N120 G01 X0.5
N125 Y0
N130 G01 G40 Z0.25
N135 G00 Z1
N140 X0 Y0
N145 M05
N150 M30

G43 Tool Length Compensation (Plus)


Format: N_ G43 H_

The
G43
command
compensates for tool
length in a positive
direction. It is important
to realize that different
tools will have varying
lengths, and when tools
are changed in a program,
any variation in tool length
will throw the origin out
of zero. To prevent this,
the difference in tool
length
should
be
compensated for.

G43 Tool Length Compensation (Plus)


Format: N_ G43 H_

G44 Tool Length Compensation (Minus)


Format: N_ G44 H_

The
G44
command
compensates for tool
length
in
a
minus
direction. It is important
to realize that different
tools will have varying
lengths, and when tools
are changed in a program,
any variation in tool length
will throw the origin out
of zero. To prevent this,
the difference in tool
length
should
be
compensated for.

G44 Tool Length Compensation (Minus)


Format: N_ G44 H_

G49 Tool Length Compensation Cancel

Format: N_ G49

The G49 command cancels all previous cutter length offset


commands. Because the G43 and G44 commands are modal,
they will remain active until canceled by the G49 command. It
is important to keep this in mind; forgetting that a tool has
been offset can cause the cutter to crash into the workpiece.

G54G59 Workpiece Coordinate System


Format: N_ G54 through G59

The G54 G59 commands are


used to reposition the origin
per a user- defined working
coordinate system. In CNCez six
register sets in the controller
hold the values for the working
coordinate systems. The G54
G59 commands are very useful
when
multiple
workpiece
fixtures are used. On real CNC
controllers these values are
held in parameter fields which
are normally set in the
parameters entry screen of the
controller.

G73 High-Speed Peck Drilling Cycle


Format: N_ G73 X_ Y_ Z_ R_ Q_ F_

During a G73 high-speed peck


drilling cycle, the tool feeds in
to the peck distance or depth
of cut, then retracts a small
pre-determined
distance,
which is the chip-breaking
process, and then feeds to the
next peck, which takes the tool
deeper.
This
process
is
repeated until the final Z depth
is reached. Because the tool
doesn't retract fully from the
hole, as in the G83 cycle, it
minimizes cycle time and
improves total part machining
time.

G80 Cancel Canned Cycles

Format: N_ G80

The G80 command cancels all previous canned cycle commands. Because
the canned cycles are modal (refer to the canned cycles on the following
pages), they will remain active until canceled by the G80 command. Canned
cycles include tapping, boring, spot facing, and drilling.
Note: On most controllers the G00 command will also cancel any canned
cycles.

G81 Drilling Cycle


Format: N_ G81 X_ Y_ Z_ R_ F_

The G81 command


invokes a drill cycle at
specified locations. This
cycle can be used for
bolt
holes,
drilled
patterns, and mold
sprues, among other
tasks. This command is
modal and so remains
active until overridden
by
another
move
command or canceled
by the G80 command.

Invoking the G81 command requires


invoking the Z initial plane, Z depth
and Z retract plane parameters.

G82 Spot Drilling or Counter Boring Cycle


Format: N_ G82 X_ Y_ Z_ R_ P_ F_

This cycle follows the same


operating procedures as the
G81 drilling cycle, with the
addition of a dwell. The
dwell is a pause during
which the Z axis stops
moving but the spindle
continues rotating. This
pause allows for chip
clearing and a finer finish on
the hole. The dwell time is
measured in seconds.
The dwell is specified by the
P letter address, followed by
the dwell time in seconds.

The same Z levels apply to the G82


cycle as to the G81 cycle: Z initial
plane, Z depth and Z retract.

G83 Deep Hole Drilling Cycle


Format: N_ G83 X_ Y_ Z_ R_ Q_ F_
The G83 command involves
individual peck moves in each
drilling operation. When this
command is invoked, the tool
positions itself as in a
standard G81 drill cycle. The
peck is the only action that
distinguishes the deep hole
drilling cycle from the G81
cycle. When pecking, the tool
feeds in the specified distance
(peck distance or depth of
cut), then rapids back out to
the Z Retract plane. The next
peck takes the tool deeper,
and then it rapids out of the
hole. This process is repeated
until the final Z depth is
reached.

In the G83 cycle, Q is the incremental depth of


cut.

G90 Absolute Positioning


Format: N_ G90
The G90 command defaults the system to
accept all coordinates as absolute
coordinates. These coordinates are
measured from a fixed origin (X0, Y0, Z0)
and expressed in terms of X, Y, and Z
distances.

G91 Incremental Positioning


Format: N_ G91
The G91 command defaults the system to
accept all coordinates as incremental, or
relative, coordinates.

G92 Reposition Origin Point


Format: N_ G92 X_ Y_ Z_

The G92 command is


used to reposition the
origin point. The origin
point is not a physical
spot on the machine
tool, but rather a
reference point to which
the coordinates relate.
Generally, the origin
point is located at a
prominent
point
or
object (for example, front
top left corner of the
part) so that it is easier to
measure from.

G98 Set Initial Plane Rapid Default


Format: N_ G98

The G98 command


forces the tool to return
to the Z initial plane a
drilling operation. This
forces the tool up and
out of the workpiece.
This setting is normally
used when a workpiece
has clamps or other
obstacles that could
interfere
with
tool
movement. The G98
command is also the
system default.

G99 Set Rapid to Retract Plane


Format: N_ G99
The G99 command forces
the tool to return to the
retract plane after a drilling
operation. This forces the
tool up and out of the
workpiece to the retract
plane specified in the drilling
cycle, overriding the system
default. This command is
usually used on drilling cycles
within a pocket, or on
workpieces that do not have
surface obstacles. It is
quicker than the G98
command because the tool
moves only to the retract
plane.

CNC Milling M- Codes

M-codes are miscellaneous functions that include actions

necessary for machining but not those that are actual tool
movements (for example, auxiliary functions). They include
actions such as spindle on and off, tool changes, coolant on
and off, program stops, and similar related functions.

M-Codes
M00
Program stop
M01
Optional program stop
M02
Program end
M03
Spindle on clockwise
M04
Spindle on counterclockwise
M05
Spindle stop
M06
Tool change
M08
Coolant on
M09
Coolant off
M10
Clamps on
M11
Clamps off
M30
Program end, reset to start
M98
Call subroutine command
M99
Return from subroutine command
Block Skip Option to skip blocks that begin with /
Comments Comments may be included in blocks with round brackets
( )

M00 - Program stop

Format: N_ M00
The M00 command is a temporary program stop function. When
it is executed, all functions are temporarily stopped and will not
restart unless and until prompted by user input.
This command can be used in lengthy programs to stop the
program in order to clear chips, take measurements, or adjust
clamps, coolant hoses, and so on.

M01 Optional Program Stop

Format: N_ M01
If the Optional Stop switch is set to ON, the program will stop
when it encounters in an M01 command. Both real CNC
controllers and the CNC simulators have this feature.

M02 PROGRAM END


Format: N_ M02
The M02 command indicates an end of the main program cycle operation. Upon
encountering the M02 command, the MCU switches off all machine operations (for
example, spindle, coolant, all axes, and any auxiliaries), terminating the program.
This command appears on the last line of the program.
Sample Program (M02):
Workpiece Size: X4, Y3, Z1
Tool: Tool #2, 1/4" Slot Drill
Tool Start Position: X0, Y0, Z1
%
:1003
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X1 Y1
N25 Z0.1
N30 G01 Z-.125 F5
N35 X3 F15
N40 G00 Z1
N45 X0 Y0
N50 M05
N55 M02

(Program end)

M03 SPINDLE ON CLOCKWISE

Format: N_ M03 S_
The M03 command switches the spindle on in a clockwise rotation. The spindle
speed is designated by the S letter address, followed by the spindle speed in
revolutions per minute

M04 SPINDLE ON COUNTERCLOCKWISE

Format: N_ M04 S_
The M04 command switches the spindle on in a counterclockwise
rotation. The spindle speed is designated by the S letter address,
followed by the spindle speed in revolutions per minute.

M05 SPINDLE STOP


Format: N_ M05
The M05 command turns the spindle off. Although other Mcodes turn off all functions (for example, M00 and M01), this
command is dedicated to shutting the spindle off directly. The
M05 command appears at the end of a program.
M06 TOOL CHANGE
Format: N_ M06 T_
The M06 command halts all program operations for a tool
change. It is actually a two-fold command. First, it stops all
machine operationsfor example, the spindle is turned off and
oriented for the tool change, and all axes motion stopsso that
it is safe to change the tool. Second, it actually changes the tool

M06 TOOL CHANGE


Format: N_ M06 T_

M07/M08 COOLANT ON
Format: N_ M07 or N_ M08
The M07 and M08 commands switch on the coolant flow.
M09 COOLANT OFF
Format: N_ M09
The M09 command shuts off the coolant flow. The coolant should
be shut off prior to tool changes or when you are rapiding the tool
over long distances.

M08 Coolant On or M09 Coolant Off


Format: N_ M08 or N_ M09

M10 CLAMPS ON
Format: N_ M10
The M10 command turns on the automatic clamps to secure
the workpiece. Automatic clamps can be pneumatic,
hydraulic, or electromechanical. Not all CNC machines have
automatic clamps, but the option exists and the actual code
will vary by machine tool make and model.

M11 CLAMPS OFF


Format: N_ M11
The M11 command releases the automatic clamps so that the
work-piece may be removed and the next blank inserted. The
automatic clamps may be pneumatic, hydraulic, or
electromechanical, depending on the application.

Sample Program M11EX10:


Workpiece Size: X4, Y3, Z1
Tool: Tool #12, 1" End Mill
Tool Start Position: X0, Y0, Z1
%
:1011
N5 G90 G20
N10 M06 T12
N15 M10
(Clamp workpiece)
N20 M03 S1000
N25 G00 X-0.75 Y1
N30 Z-0.375
N35 G01 X0 F10
N40 G03 Y2 I0 J0.5
N45 G01 X2 Y3
N50 X4 Y2
N55 G03 Y1 I0 J-0.5
N60 G01 X2 Y0
N65 X0 Y1
N70 G00 Z1
N75 X0 Y0
N80 M05
N85 M11
(Unclamp workpiece)
N90 M30

M30 PROGRAM END, RESET TO START


Format: N_ M30
The M30 command indicates the end of the program data. In
other words, no more program commands follow it. This is a
remnant of the older NC machines, which could not
differentiate between one program and the next, so an End
of Data command was developed. Now the M30 is used to
end the program and reset it to the start.

M98 CALL SUBPROGRAM


Format: N_ M98 P_
The M98 function is used to call a subroutine or subprogram.
Execution is halted in the main program and started on the
program referenced by the P letter address value. For example,
N15 M98 P1003 would call program :1003, either from within
the current CNC program file or from an external CNC program
file. Machine status is maintained when a sub-program is called.
This is especially useful in family parts programming or when
several operations are required on the same hole locations. In
the following sample program the subprogram is used to drill a
hole pattern, using several calls to different drill cycles. The main
program positions the machine tool at the starting location to
invoke the cycle; the subprogram then continues the pattern

Sample Program M98EX9:


Workpiece Size: X5, Y5, Z1
Tool: Tool #1, 3/32" Spot Drill
Tool #2, 1/4 HSS Drill
Tool #3, 1/2 HSS Drill
Tool Start Position: X0, Y0, Z1
%
:1010
N5 G90 G20
N10 M06 T1
N15 M03 S1500
N20 M08 (Coolant on)
N25 G00 X1 Y1
N30 G82 X1 Y1 Z-.1 R.1 P0.5 F5
N35 M98 P1005
N40 G80
N45 G28 X1 Y1
N50 M09
N55 M06 T02

(Start of cycle)
(Call subprogram to do rest)

N60 G29 X1 Y1
N65 M03 S1200
N70 M08
N75 G83 X1 Y1 Z-1 R0.1 Q0.1 F5.0 (Start of cycle)
N80 M98 P1005
(Call subprogram to do rest)
N85 G80
N90 G28 X1 Y1
N95 M09
N100 M06 T03
N105 G29 X1 Y1
N110 M03 S1000
N115 M08
N120 G73 X1 Y1 Z-1 R0.1 Q0.1 F5.0 (Start of cycle)
N125 M98 P1005
(Call subprogram to do rest)
N130 G80
N135 G00 Z1
N140 X0 Y0
N145 M09

N150 M05
N155 M30
O1005
N5 X2
N10 X3
N15 X4
N20 Y2
N25 X3
N30 X2
N35 X1
N40 M99

(Subprogram)

(Return from sub-program)

M99 RETURN FROM SUBPROGRAM


Format: N_ M99
The M99 function is used to end or terminate the subprogram and return to
the main calling program. Execution is continued at the line immediately
following the subprogram call. It is used only at the end of the subprogram.
Sample Program M99EX10:
Workpiece Size: X5, Y5, Z1
Tool: Tool #1, 3/32" Spot Drill
Tool #2, 1/4 HSS Drill
Tool Start Position: X0, Y0, Z1
%
:1011
N5 G90 G20
N10 M06 T1
N15 M03 S1500
N20 M08 (Coolant on)
N25 G00 X1 Y1
N30 G82 X1 Y1 Z-.1 R.1 P0.5 F5

(Start of cycle)

N35 M98 P1005


(Call subprogram to do rest)
N40 G80
N45 G28 X1 Y1
N50 M09
N55 M06 T03
N60 G29 X1 Y1
N65 M03 S1200
N70 M08
N75 G83 X1 Y1 Z-1 R0.1 Q0.1 F5.0 (Start of cycle)
N80 M98 P1006
(Call subprogram to do rest)
N85 G80
N135 G00 Z1
N140 X0 Y0
N145 M09
N150 M05
N155 M30
O1006

(Subprogram to drill rest of square pattern)

N5 X2
N20 Y2
N25 X1
N30 M99 (Return from subprogram)

Examples
This program introduces you to the Cartesian coordinate
system and absolute coordinates. Only single-axis, linear-feed
moves show the travel directions of the X, Y, and Z axe

Workpiece Size: X5, Y4, Z1


Tool: Tool #3, 3/8" End Mill
Tool Start Position: X0, Y0, Z1 (Relative to workpiece)
%
:1001
N5 G90 G20
N10 M06 T3
N15 M03 S1200
N20 G00 X1 Y1
N25 Z0.125
N30 G01 Z-0.125 F5
N35 X4 F20
N40 Y3
N45 X1
N50 Y1
N55 G00 Z1
N60 X0 Y0
N65 M05
N70 M30

EXAMPLE 2: I-part2.mil
This next program introduces you to diagonal linear feed moves,
where both the X axis and the Y axis are traversed

Workpiece Size: X5, Y4, Z1


Tool: Tool #2, 1/4" End Mill
Tool Start Position: X0, Y0, Z1 (Relative to workpiece)
%
:1002
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X1 Y1
N25 Z0.125
N30 G01 Z-0.125 F5
N35 X4 F10
N40 Y3
N45 X1 Y1
N50 Y3
N55 X4 Y1
N60 G00 Z1
N65 X0 Y0
N70 M05
N75 M30

Example 3:
This program introduces arcs: G02 (clockwise) and G03
(counterclockwise). These are all simple quarter quadrant arcs
with a 1-in. radius

Workpiece Size: X5, Y4, Z1


Tool: Tool #2, 0.25" Slot Mill
Tool Start Position: X0, Y0, Z1 (Relative to workpiece)
%
:1003
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X0.5 Y0.5
N25 Z0.25
N30 G01 Z-0.25 F5
N35 G02 X1.5 Y1.5 I1 J0 F10
N40 X2.5 Y2.5 R1
N45 X3.5 Y1.5 I0 J-1
N50 X4.5 Y0.5 R1
N55 G01 Y1.5
N60 G03 X3.5 Y2.5 R1
N65 X2.5 Y3.5 I-1 J0
N70 X1.5 Y2.5 R1
N75 X0.5 Y1.5 I0 J-1
N80 G01 Y0.5
N85 G00 Z1
N90 X0 Y0
N95 M05
N100 M30

EXAMPLE 4: This program cuts several G02 and G03 arcs


(clockwise and counterclockwise) in semicircles and full circles

Workpiece Size: X4, Y4, Z2


Tool: Tool #4, 0.5" Slot Mill
Tool Start Position: X0, Y0, Z1 (Relative to workpiece)
%
:1004
N5 G90 G20
N10 M06 T4
N15 M03 S1200
N20 G00 Z0.25
N25 G01 Z0 F5
N30 G18 G02 X4 Z0 I2 K0
N35 G19 G03 Y4 Z0 J2 K0
N40 G18 G03 X0 Z0 I-2 K0
N45 G19 G02 Y0 Z0 J-2 K0
N50 G00 Z0.25
N55 X1 Y2
N60 G01 Z-0.25
N65 G17 G02 I1 J0 F10
N70 G00 Z1
N75 X0 Y0
N80 M05
N85 M30

EXAMPLE 5:
This program involves a simple drilling cycle with a defined
retract plane. Once the G-code for the drill cycle has been
executed, only the X and/or Y location of the remaining holes
need to be defined

Workpiece Size: X5, Y4, Z1


Tool: Tool #7, 3/8" HSS Drill
Tool Start Position: X0, Y0, Z1 (Relative to
workpiece)
%
N55 Y1
:1005
N60 X3
N5 G90 G20
N65 X4
N10 M06 T7
N70 Y2
N15 M03 S1000
N75 Y3
N20 G00 X1 Y1
N80 X3
N25 Z0.25
N85 Y2
N30 G98 G81 X1 Y1 Z-0.25 R0.25 F3
N90 G00 Z1
N35 Y2
N95 X0 Y0
N40 Y3
N45 X2
N100 M05
N50 Y2
N105 M30

EXAMPLE 6: I-part6.mil
This program involves a drilling cycle with a dwell and
incremental coordinates

Workpiece Size: X5, Y4, Z1


Tool: Tool #8, 3/4" HSS Drill
Tool Start Position: X0, Y0, Z1 (Relative to workpiece)
%
:1006
N5 G90 G20
N10 M06 T8
N15 M03 S500
N20 G00 X1 Y1
N25 Z0.25
N30 G91 G98 G82 Z-0.5 R0.25 P1
N35 X1
N40 X2
N45 Y1
N50 Y1
N55 X-2
N60 X-1
N65 Y-1
N70 X1
N75 G80 G90 G00 Z1
N80 X0 Y0
N85 M05
N90 M30

CNC Lathe/Turning Programming

LETTER ADDRESS LISTING


Letter addresses are variables used in G- and M-codes. Most G-codes
contain a variable, defined by the programmer, for each specific function.
Each letter used in CNC programming is called an address, or word. The
words used for programming are as follows.
F
Assigns a feed-rate
G
Preparatory function
I
X-axis location of ARC center
K
Z-axis location of ARC center
M
Miscellaneous function
N
Block number (specifies the start of a block)
P
Start block
D
Dwell time
Q
Block end
D
Depth
R
Radius
S
Sets the spindle speed
T
Specifies the tool to be used
A
Tool angle
U
X stock or incremental value
W
Z stock or incremental value
X
X coordinate
Z

Z coordinate

G-CODES

G-codes are preparatory functions, which involve actual tool moves (for example,
control of the machine). These include rapid moves, feed moves, radial feed
moves, dwells, and roughing and profiling cycles. Most G-codes described here
are modal, meaning that they remain active until canceled by another G-code.
The following codes are described in detail in the following sections:
G00
G01
G02
G03
G04
G20
G21
G28
G29
G32
G40
G41

Positioning in rapid
Linear interpolation
Circular interpolation (CW)
Circular interpolation (CCW)
Dwell
Inch units
Metric units
Automatic zero return
Return from zero return position
Simple or constant thread
Tool nose radius compensation cancel
Tool nose radius compensation left

Modal
Modal
Modal
Modal

G42

Tool nose radius compensation right

Modal

Modal
Modal

Modal
Modal

G50

Coordinate system setting

G54-G59

Workpiece coordinate systems

G70

Finishing cycle

Modal

G71

Turning cycle

Modal

G72

Facing cycle

Modal

G74

Peck drilling cycle

Modal

G75

Grooving cycle

G76

Threading cycle

G90

Absolute programming

Modal

G91

Incremental programming

Modal

G96

Constant surface speed setting

Modal

G97

Constant spindle speed setting

Modal

G98

Linear feedrate per time

Modal

G99

Feedrate per revolution

Modal

G00 POSITIONING IN RAPID

Format: N_ G00 X_ Z_
The G00 command is used primarily to move the tool to and from
a non-cutting position. It is used most often before and after a
G01, G02, and G03 command. It can also be used to position the
tool for a tool change. This command causes the tool to move at
its fastest possible rate

CNC turning fundamentals Absolute coordinates


When plotting points using
absolute coordinates, always
start
at
the
origin
(X0, Z0). Then travel along
the Z axis until you reach a
point directly below the
point that you are trying to
plot. Write down the Z value
and then go up until you
reach your point. Write
down the X value. You now
have the XZ (or ZX)
coordinate for that point.

EXAMPLE: N15 G90 G00 X1.8 Z0.0


In this example the tool positions in rapid mode from its
present location to a point at X1.8, Z0

Sample Program G00:


Workpiece Size: Length 4", Diameter 2"
Tool: Tool #2, Right-hand Facing Tool
Tool Start Position: X2, Z3
%
(Program Start Flag)
:1000
(Program number 1000)
N5 G20 G40
(INCH UNITS, TNR cancel)
N10 T0101
(TOOL CHANGE, Tool #1, Register #1)
N15 M03
(Spindle on CW)
N20 G00 X1.9
(Rapid to X1.9)
N25 Z0.1 M08
(Rapid to Z0.1)
N30 G01 Z-1.25 F0.012
(Feed to Z-1.25 at 0.12 IN./rev)
N35 G00 X4.0 Z3.0 M09
(Rapid to X4 and Z3)
N40 T0100 M05
(Tool cancel Register #1)
N45 M30
(Program end)

G01 LINEAR INTERPOLATION

Format: N_ G01 X_ Z_ F_
The G01 command executes all movement along a straight line at a particular
feedrate. These straight-line feed moves may cut in one or two axes
simultaneously. This command can be used for turning, facing, and tapering. It
is specified by the G01 command, followed by the endpoint of the move, and
then a specified feedrate.

EXAMPLE: G01 Z-2.5 F0.01


In this example, the tool cuts a straight line from its
present location to a point at Z2.5 at a rate of 0.01 ipr

Sample Program G01:


Workpiece Size: Length 4", Diameter 2.5"
Tool: Tool #1, Right-hand Facing Tool
Tool Start Position: X2, Z3
%
:1001
N5 G20 G40
N10 T0101
N15 M03
N20 G00 X2.375 M08
N22 Z0.1
N25 G01 Z-2.0 F0.015
(Feed to Z2.0 at a feedrate of 0.015 ipr)
N30 G00 X2.5
N35 Z0.1
N40 X2.25
N45 G01 Z-1.75
(Feed to Z1.75 at same feedrate)
N50 G00 X2.375
N55 Z0.1
N60 X2.125
N65 G01 Z-1.5
(Feed to Z1.5 at same feedrate)
N70 G00 X2.25
N75 Z0.1

N80 X1.875
N85 G01 Z0
N90 X2.125 Z-0.125
N95 G00 X4 M09
N100 Z3
N105 T0100 M05
N110 M30

(Feed to 0 at same feedrate)


(Feed to (X2.125, Z1.125) at same feedrate)

G02 CIRCULAR INTERPOLATION (CW)

Format: N_ G02 X_ Z_ I_ K_ F_

or N_ G02 X_ Z_ R_ F_
The G02 command executes all circular or radial cuts in a clockwise motion. It is
specified by the G02 command, followed by the endpoint for the move, the radius (the
distance from startpoint to the centerpoint), and a feedrate. Therefore the three
requirements for cutting arcs are:
1. The endpoint.
2. The radius R or I for X and K for Z values that represent the incremental distance from
the startpoint to the centerpoint. The R value is limited to a maximum of 90.
3. The feedrate.

EXAMPLE: N05 G01 X2 Z-1 F0.012


N10 G02 X0 Z0 I-1 K0
or N10 G02 X0 Z0 R0.5

Sample Program G02


Work piece Size: Length 4", Diameter 2"
Tool: Tool #2, Right-hand Facing Tool
Tool Start Position: X2, Z3
%
:1002
N5 G20 G40
N10 T0202
N15 M03
N20 G00 X1.7
N22 Z0.1 M08
N25 G01 Z-0.5 F0.012
N30 G00 X2
N35 Z0.1
N40 X1.4
N45 G01 Z-0.25
N50 G00 X2.1
N55 Z-1
N60 G01 X2.0
N65 G02 X0 Z0 I-1.0 K0
N70 G00 X2.1
N75 Z-1.0
N80 G01 X2.0
N85 G02 X2.0 Z-2 I0.5 K-0.5
N90 G00 X4.0 Z3.0 M09
N95 T0200 M05
N100 M30

(90 CW arc feed move)

(Partial CW arc feed move)

G03 CIRCULAR INTERPOLATION (CCW)

Format: N_ G03 X_ Z_ I_ K_ F_
or N_ G03 X_ Z_ R_ F_
The G03 command executes all radial cuts in a counterclockwise motion. It is
specified by the G03 command, followed by the endpoint for the move, the
radius (the distance from the startpoint to the centerpoint), and a feedrate.
The radius is specified by defining the incremental distance from the arcs startpoint to its center-point in both the X and Z directions. These values are
identified by I and K variables, respectively. The R word, the value of the radius
of the arc, can also be used.

EXAMPLE: N10 G01 X0 Z0 F0.012


N15 G03 X2.0 Z-1.0 I0 K-1.0
In this example, the tool cuts a counterclockwise arc from its
present position to (X2, Z1) at a feedrate of 0.012 ipr

Sample Program G03EX3:


Workpiece Size: Length 4", Diameter 2"
Tool: Tool #2, Right-hand Facing Tool

Tool Start Position: X2, Z3


%
:1003
N5 G20 G40
N10 T0202
N15 M03
N20 G00 X1.7
N22 Z0.1 M08
N25 G01 Z-0.5 F0.012
N30 G00 X2.0
N35 Z0.1
N40 X1.4
N45 G01 Z-0.25
N50 G00 X1.5
N55 Z0.1
N60 X0
N65 G01 Z0
N70 G03 X2.0 Z-1.0 I0 K-1.0
N75 G01 Z-2.0
N80 G03 X2.0 Z-1.0 I0.5 K0.5
N85 G00 X4.0 Z3.0 M09
N90 T0200 M05
N95 M30

(90 CCW arc feed move)


(Partial CCW arc feed move)

G04 DWELL
Format: N_ G04 P_
The G04 command is a no modal dwell command
that halts all axis movement for a specified time
while the spindle continues revolving at the
specified rpm. A dwell is sometimes used to allow
for the clearance of chips.

EXAMPLE: N10 G04 P2.0


In this example, the tool pauses at its current
location for a period of 2 seconds

G20 Inch Units


Format: N_ G20
G21 Metric or SI
Units
Format: N_ G2

G28 Automatic Return to Reference Point

Format: N_ G28 X_ Z_

The G28 command is commonly used prior to an


automatic tool change. It allows the existing tool to be
positioned to the predefined reference point
automatically via an intermediate position. This ensures
that when the tool turret is engaged, it is properly
aligned and clears the workpiece.

G28 Automatic Return to Reference Point

Format: N_ G28 X_ Z_

The G28 command is commonly used prior to an automatic tool change. It


allows the existing tool to be positioned to the predefined reference point
automatically via an intermediate position. This ensures that when the tool
turret is engaged, it is properly aligned and clears the workpiece.

Sample Program G28:


Workpiece Size: Length 4", Diameter 2.5"
Tool: Tool #1, Right-hand Tool
Tool Start Position: X2", Z3"
Zero Return Position: X2", Z3"
%
:1028
N5 G20 G40
N10 T0101
N12 M03 M08
N15 G00 X2.25
N20 Z0.1
N25 G01 Z-2.0 F0.012
N30 G28 X4.0 Z0.5 M09 (Rapid move to zero return position)
N35 T0100 M05
N40 M30

G29 Automatic Return from Reference Point


Format: N_ G29 X_ Z_

The G29 command can be used immediately after an automatic


tool change. It allows the new tool to be returned from the
predefined reference point to the specified point via an
intermediate point specified by the previous G28 command.

G29 Automatic Return from Reference Point

Sample Program G29EX29:


Workpiece Size: Length 4", Diameter 2.5"
Tools: Tool #1, Right-hand Tool
Tool #2, Finishing Tool
Tool Start Position: X2", Z3"
Zero Return Position: X2", Z3"
%
:1029
N5 G20
N10 T0101
N12 M03 M08
N15 G00 X2.25
N20 Z0.1
N25 G01 Z-2.0 F0.012
N30 G28 X4.0 Z0.5 M09
N35 T0100 M05
N40 T0202
N45 M03 M08
N50 G29 X2.25 Z0.1
(Return from zero return position)
N55 G01 Z-2.0
N60 G28 X4 Z0.5 M09
N65 T0100 M05
N70 M30

G32 Simple Thread Cycle

Format: N_ G32 Z_ K_ F_

The G32 command invokes a simple or basic thread


cycle. It automatically synchronizes spindle and axis
movements to achieve the desired thread pitch defined
by the F word address.

G32 Simple Thread Cycle


Format: N_ G32 X_ Z_ F_

Sample Program G32EX32:


Workpiece Size: Length 4", Diameter 2"
Tool: Tool #4, Neutral Tool / Threading Tool
Tool Start Position: X2, Z3
%
:1040
N5 G20 G40 (Set TNR cancel at beginning)
N10 T0101
N15 M03 M08
N20 G00 Z0.1
N25 X2.1
N30 G01 X1.0 F0.012
N35 G32 Z-2.0 F.05 (Machine a single-pass thread)
N40 G00 X4.0
N45 T0100 M05
N50 M30

G40 TOOL NOSE RADIUS (TNR) COMPENSATION CANCEL


Format: N_ G40
The G40 command cancels any compensation that was applied
to the tool during a program. It also acts as a safeguard to cancel
any cutter compensation applied previously.
TNR compensation is used to compensate for the small radius
on single-point turning and boring tools. Normally, CNC
programs are written so that the tool tip follows the tool-path.
This would be fine if all tools were perfect and had sharp points.
However, most turning tools have a small radius on the cutting
edge that makes the tools deviate slightly from the programmed
path. In this case, the tool must be offset either left or right.
However, tool nose radius compensation is modal, so the
compensation must be canceled once it is no longer required.
The G40 command does this.

G41 Tool Nose Radius (TNR) Compensation Left


Format: N_ G41

The G41 command applies cutter compensation to the left hand


side of the programmed tool path. This amount is equal to the
current tool's nose radius value, which is stored in the Tool Offset
Register table of the controller.
This register number is
referenced by the last two digits in the tool change command. For
example, a tool change command with T0202 will reference the
tool nose radius value in register #2.

G41 Tool Nose Radius (TNR) Compensation Left

Sample Program G41:


Workpiece Size: Length 4", Diameter
2"
Tools: Tool #8, Left-hand Facing Tool
Tool #10, 1" Drill
Tool #12, Center Drill
Tool Start Position: X2, Z3
N60 G74 Z-2 F0.5 D0 K0.25
%
N65 G00 Z3
:1041
N70 T1000 X4
N5 G20 G40
N75 G99 T0808
N10 T1212 M08
N80 G41 G00 X0.8 (TNR compensation left)
N15 G98 M03 S2000
N85 Z0.2
N20 G00 X0
N90 G01 Z-1.75 F0.012
N25 Z0.1
N95 X0.9
N30 G01 Z-0.2 F2
N100 Z-0.25
N35 G00 Z3
N105 G03 X2 Z0 R0.5
N40 X4 T1200
N110 G40 G00 X4 Z3 M09
N45 T1010
N115 T0800 M05
N50 G00 X0
N55 Z0.1
N120 M30

G42 Tool Nose Radius Compensation Right


Format: N_ G42

The G42 command applies cutter compensation to the right hand


side of the programmed tool path. This amount is equal to the
current tool's nose radius value, which is stored in the Tool Offset
Register table of the controller.
This register number is
referenced by the last two digits in the tool change command. For
example, a tool change command with T0808 will reference the
tool nose radius value in register #8.

G42 Tool Nose Radius Compensation Right


Format: N_ G42

G50 Coordinate System Setting

Format: N_ G50 X_ Z_
The G50 command is used to specify the program zero
from the current tool position. This sets the coordinate
system for the current program.The coordinate system
setting is similar to specifying the origin point on a
mill. The origin is not a physical spot on the machine
tool, but rather a reference point to which the
coordinates relate. In turning, the zero reference or
origin can be specified from the right-hand centerpoint of the workpiece, the left of back of the
workpiece, or from the face of the chuck.

G50 Coordinate System Setting

Format: N_ G50 X_ Z_

G54 G59 Working Coordinate System

Format: N_ G54 through G59

The G54 G59 commands are used to reposition the origin as per
a user- defined working coordinate system. Six register sets in the
controller which hold the values for the working coordinate
systems. The G54 G59 commands are very useful when multiple
workpiece fixtures are used.

G70 Finishing Cycle

Format: N_ G70 P_ Q_

The G70 command is used immediately after a roughing cycle, such as a G71
Rough Turning, or G72 Rough Facing cycle command. The remaining material is
machined as specified by the P and Q block number values, which point to the
start and finish blocks of the desired part profile contour.

G70 FINISHING CYCLE


Format: N_ G70 P_ Q_
P
Start block of segment
Q
End block of segment
F
Feedrate

G71 ROUGH TURNING CYCLE

Format: N_ G71_ P_ Q_ U_ W_ D_ F
P
Start block of segment
Q
End block of segment
U
Amount of stock to be left for finishing in X
W
Amount of stock to be left for finishing in Z
D
Depth of cut for each pass in thousandths
F
Feedrate for finish pass

G71 Rough Turning Cycle


Format: N_ G71_ P_ Q_ U_ W_ D_ F
The G71 command automatically generates roughing passes to turn a
workpiece to a specified profile, leaving an allowance for finishing. It
reads a program segment specified by the P and Q letter addresses and
determines the number of passes, the depth of cut for each pass, and
the number of repeat passes for the cycle.
Cutting is done parallel to the Z axis. The U and W signs determine the
direction of the cuts.

EXAMPLE: N35 G71 P40 Q100 U.025 W.025 D625 F0.012


In this example, the MCU reads the data between N40 and N100 and removes
material according to this profile. The cycle has a depth of cut of 1/16 in. for
each pass at 0.012 ipr

Positive and negative


U and W signs
instruct the MCU on
how to execute the
rough turning cycle.
This type of cycle is
known as a Type A
roughing cycle on
most
Fanuc
controllers.

The G71 command turns the part to the diameter specified in the
program segment. The cutting moves are parallel to the Z axis.
The upper half of the profile shows the G71 command and how
it steps down to size. The lower half of the profile shows how
the G70 command cleans up with a finishing pass.

Sample Program G71:


Workpiece Size: Length 4", Diameter 2"
Tools: Tool #1, Right-hand Facing Tool
Tool #2, Right-hand Finishing Tool
Tool Start Position: X2, Z3
%
:1071
N5 G90 G20
N10 T0101
N15 M03
N20 G00 X2 Z0.1 M08
N35 G71 P40 Q55 U0.05 W0.05 D625 F0.012
N40 G01 X0 Z0
N45 G03 X1 Z-0.5 I0 K-0.5
N50 G01 Z-1.0
N55 X2.1 Z-1.5
N60 T0100 G00 X4 Z3
N65 T0202
N70 G00 X2 Z0.1
N75 G70 P40 Q55 F0.006
N80 G00 X4 Z3 M09
N85 T0200 M05
N90 M30

(Rough turning)

G72 ROUGH FACING CYCLE

Format: N_ G72 P_ Q_ U_ W_ D_ F_
P
Start block
Q
End block
U
Amount of stock to be left for finishing in X
W
Amount of stock to be left for finishing in Z
D
Depth of cut for finish pass
F
Feedrate (this is optional)
The G72 command automatically faces off a part to a predefined depth of cut,
with preset offsets and feed rates.

EXAMPLE: N20 G72 P25 Q45 U0.05 W0.05 D500 F0.012


In this example, the MCU reads the commands in N25N45 and
then executes a facing operation, in accordance with the profile
defined

G72 Rough Facing Cycle

Format: N_ G72
The G72 command automatically faces off a part to a predefined profile,
with preset offsets and feedrates leaving an allowance for finishing. It
reads a program segment specified by the P and Q letter addresses and
determines the number of passes, the depth of cut for each pass, and
the number of repeat passes for the cycle.
Cutting is done parallel to the X axis. The U and W signs determine the
direction of the cuts.

Sample Program G72:


Workpiece Size: Length 4", Diameter 1"
Tools: Tool #1, Right-hand Facing Tool
Tool #2, Right-hand Finishing Tool
Tool Start Position: X2, Z3
%
:1072
N5 G90 G20
N10 T0101
N15 M03
N20 G00 X1 Z0.1 M08
N25 G72 P30 Q50 U0.05 W0.05 D500 F0.012 (Rough facing)
N30 G01 X0 Z0.1
N35 X0.25
N40 Z-0.125
N45 X0.5 Z-0.25
N50 G02 X1 Z-0.5 I0.25 K0
N55 G00 X4 Z3 T0100
N60 T0202
N65 G00 X1 Z0.1
N70 G70 P30 Q50 F0.006
N75 G00 X4
N80 Z3 M09
N85 T0200 M05
N90 M30

G74 PECK DRILLING CYCLE


Format: N_ G74 X0 Z_ K_ F_

The G74 command executes a peck drilling cycle with automatic retracts and
incremental depths of cut. The G74 command is specified by several letter
addresses:
X0
X always 0
Z
Total depth
K
Peck depth
F
Feed rate
EXAMPLE: N20 G74 X0 Z-1.0 K0.125 F0.015
In this example, a hole is peck
drilled to a total depth of 1 in.,
using 0.125 in. for the depth
of each peck

G74 Peck Drilling Cycle

Format: N_ G74 X0 Z_ K_ F_
The G74 command involves individual peck moves in each drilling
operation. When this command is invoked, the tool positions itself as in a
standard G81 drill cycle. The K value specifies the peck depth.

Sample Program G74:


Workpiece Size: Length 4", Diameter 1"
Tools: Tool #12, Center Drill
Tool #10, 1/2" Drill
Tool Start Position: X2, Z3
%
:1074
N5 G20 G98
N10 T1212 M08
N15 M03 S2000
N20 G00 X0
N25 Z0.1
N30 G01 Z-0.2 F2
N35 G00 Z3
N40 X3 T1200
N45 T1010
N50 G00 X0
N55 Z0.1
N60 G74 X0 Z-1.5 K0.125 F0.5 (Drilling cycle)
N65 G00 Z3
N70 X4 M09
N75 T1000 M05
N80 M30

G75 GROOVING CYCLE


Format: N_ G75 X_ Z_ F_ D_ I_ K_
X
Diameter of groove
Z
Z position of groove
F
Incremental retract
D
Depth/X offset
K
Z movement
I
X movement
The G75 command is used
to machine grooves.

EXAMPLE: N25 G75 X0.25 Z-0.75 F0.125 I0.125 K0.125


This command defaults to the last specified feedrate. The F
address is used to specify the retract distance, so the
feedrate cannot be set within the grooving cycle.

G75 Grooving Cycle


Format: N_ G75 X_ Z_ F_ D_ I_ K_

The G75 command invokes an outside diamter groove cycle. This cycle
involves plunges into the workpiece from the outside of the workpiece
parallel to the X axis. The X value is the final diameter. The Z value
represents the final Z position. The F value specifies the incremental
retract after every plunge. The I and K values specify the incremental
movements in the X and Z axes, respectively.

Sample Program G75EX75:


Workpiece Size: Length 4", Diameter 1"
Tool: Tool #5, Grooving Tool
Tool Start Position: X2, Z3
%
:1075
N5 G90 G20
N10 T0505 F0.015
N15 M03
N20 G00 Z-0.5 M08
N25 X1.2
N30 G75 X0.5 Z-0.75 F0.125 D0 I0.125 K0.125
N35 G00 X4
N40 Z3 M09
N45 T0500 M05
N50 M30

(Grooving cycle)

G76 THREADING CYCLE


Format: N_ G76 X_ Z_ D_ K_ A_ F_
The G76 command performs all threading operations in a cycle, with automatic
depth change and tool path calculation. The G76 command is specified by several
letter addresses:
X
Minor diameter of thread
Z
Position at end of thread
D
Depth of first pass in thousandths (the control uses the first depth of cut
to determine the number of passes)
K
Depth of thread
F
Pitch of thread (thread pitch = 1/thread/in.)
A
Tool angle (If the tool angle is given, the tool will continue to cut on the
leading edge of the tool; if no tool angle is given, the tool will cut on both
sides.)
EXAMPLE: N25 G76 X0.5 Z-1.0 D625 K0.25 A55 F0.1

In this example, the tool cuts a thread, starting at its present location and ending at the
specified XZ endpoint. The D value specifies each cut depth, and the K value defines the overall
depth. The A value defines the tool angle, and the F value defines the pitch

G76 THREADING CYCLE

G76 Threading Cycle

Format: N_ G74 X_ Z_ D_ K_ A_ F_
The G76 command automatically performs all cutting operations required
to achieve a thread. From the programmed variables the cycle will
calculate the toolpaths, based on the desired thread pitch, depth, and tool
angle.
X designates the minor diameter of thread. Z specifies the end of the
thread. D designates the depth of the first pass. K specifies the depth of
the thread. F specifies the desired pitch of the thread. A is tool angle.

Sample Program G76:


Workpiece Size: Length 4", Diameter 1"
Tool: Tool #6, Neutral Tool
Tool Start Position: X2, Z3
%
:1076
N5 G90 G20
N10 T0606 M08
N15 M03
N20 G00 X1
N25 Z0.1
N25 G76 X0.96 Z-2 D625 K0.125 A55 F0.1 (Threading
cycle)
N30 G00 X4
N35 Z3 M09
N35 T0600 M05
N40 M30

G90 Absolute Positioning

Format: N_ G90
The G90 command defaults the system to accept all coordinates as
absolute coordinates. These coordinates are measured from a
fixed origin (X0, Y0, Z0) and expressed in terms of X, Y, and Z
distances.
G91 Incremental Positioning

Format: N_ G91
Incremental coordinates are measured from the previous
point and are expressed in terms of the relative X and Z
distances from the previous point

G96 Constant Surface


Speed Setting
Format: N_ G96 S_

The G96 command sets constant


surface speed (CSS). When CSS is set
the spindle speed will vary according
to the tool position in the X direction.
To
maintain
CSS
the
MCU
automatically
calculates
the
appropriate spindle speed to maintain
proper relative speed between the
tool and the workpiece. As the tool
approaches the center of the rotating
workpiece, the radius distance
decreases and the spindle speed
increases. The surface speed depends
on the input units setting. If it is in
metric units, the surface speed is set
to meters per minute; if it is in inches,
the surface speed is set to feet per
minute. Note that the CSS is inversely
proportional to the radius.

G97 Constant Spindle Speed Setting


Format: N_ G97 S_

The G97 command is used to cancel the G96


setting and set the spindle speed in
revolutions per minute. The tool position
does not affect the spindle speed.
NOTE: Always use the G97 command when
programming any threading cycles.

G98 Linear Feedrate per Time

Format: N_ G98
The G98 command sets the linear feedrate to units
(inch or millimeter) per time (minutes). The setting
depends on which type of unit is currently active.
NOTE: The G98 command does not set the actual
feedrate. The feedrate is defined by using the F letter
address in the corresponding feed move command
blocks.

G99 Feedrate per Revolution


Format: N_ G99

The G99 command sets the feedrate to units (inch or


millimeter) per revolution. The setting depends on which type
of unit is currently active.
All feed moves will accept units per revolution as the defining
rate. It is the default setting on most CNC turning centers. It
also is used to synchronize axes moves with the spindle,
especially in programming threads.
Remember: Use the G99 prior to programming any threading
cycle.

M-CODES

M-codes are miscellaneous functions that include actions necessary for machining
but not those that are actual tool movements (for example, auxiliary functions). They
include spindle on and off, tool changes, coolant on and off, program stops, and
similar, related functions. The following codes are described in detail in the following
sections.
M00
Program stop
M01
Optional program stop
M02
Program end
M03
Spindle on clockwise
M04
Spindle on counterclockwise
M05
Spindle stop
M07
Coolant 1 on
M08
Coolant 2 on
M09
Coolant off
M98
Subprogram call
M99
Return from subprogram
M30
End of program, reset to start
Block Skip
/ used to bypass CNC blocks
Comments
( and ) used to help operator comments
Note:

Two or more M-codes cannot be included on the same line.

M00 Program Stop

Format: N_ M00

The M00 command is a temporary program stop


function. When it is executed, all functions are
temporarily stopped and will not restart until
prompted by user input. This command is very useful
in lengthy programs as a way to stop the machine in
order to clear chips, take measurements, or adjust
clamps, coolant hoses, and so on.

M01 Optional Program Stop

Format: N_ M01

The M01 command is an optional stop


command that also halts program execution,
but only if the Optional Stop switch is set to
ON. If the Optional Stop switch is set to OFF,
the program will ignore any M01 commands
it encounters in a program and no optional
stops will be executed.

M02 Program End

Format: N_ M02
The M02 command indicates the end of the
main program. This command, instructs the
MCU to switch off all machine operations (for
example, spindle, coolant, all axes, and any
auxiliaries) and terminates the program. This
command appears on the last line of the
program.

M03 Spindle on Clockwise


Format: N_ M03 S_

The M03 command switches the spindle on so that it


rotates clockwise. The spindle speed is designated by
the letter address S followed by the spindle speed in
revolutions per minute. The image shown illustrates
clockwise operation.

M04 Spindle on Counterclockwise

Format: N_ M04 S_

The M04 command switches the spindle on so that it rotates


counterclockwise. It is programmed as with the M03 command.
The spindle speed is designated by the letter address S, followed
by the spindle speed in revolutions per minute. The image
shown illustrates counterclockwise operation.

M05 Spindle Stop


Format: N_ M05

The M05 command turns off the spindle. Although


other M-codes turn off all functions (for example,
M00 and M01 ), this command is dedicated to
shutting off the spindle. The M05 command appears
most often at the end of a program, but it can also
be used prior to a tool change command.

M07 and M08 Coolant On or M09 Coolant Off


Format: N_ M07 or N_ M08
The M07/M08 and M09 commands control coolant flow.
M07/M08 turns the coolant flow on. In the simulator, the
coolant status is shown in the information area. The M09
command shuts off coolant flow.

M10 Chuck Open or M11 Chuck Close


Format: N_ M10 or N_ M11

The M10 and M11 commands control the automatic chuck.


M10 opens the chuck, and M11 closes it. In the simulator, the
automatic chuck status is shown in the Machine Status area.
These commands are normally used in conjunction with
automatic bar feeders. The actual M codes used will vary
according to machine tool manufacturer.

M30 Program End, Reset to Start

Format: N_ M30

The M30 command indicates the end of the


program. In other words, no more program
commands follow. This is a remnant of the
older NC machines, which utilized paper tape
and could not differentiate between one
program and the next, so an End of Data
command was developed. Now the M30 is
used to end the program and reset it to the
start.

M98 Subprogram call

Format: N_ M98 P_
The M98 command is used to call a subprogram. The
subprogram is referenced by the P letter address
followed by the program number. This is useful when
similar operations are required for a particular
program. An example of using sub-programming is
with bolt hole patterns where each hole must have
several canned cycle operations performed on it. If
there are many holes to be drilled these can reside in
the subprogram which is called after each canned
cycle is invoked.

M99 Return from Subprogram


Format: N_ M99

The M99 command is used to return from within a


subprogram. The machine control unit continues
execution from the block number immediately after
the M98 subprogram call.

Tool change function for turning


Format: N_ T__ __

The tool change function for turning involves the use of the T
letter address followed by a four-digit value. The first two digits
specify the tool turret position to be indexed. The last two digits
specify the offset register number to be referenced when tool
nose radius compensation is invoked. For example, to index to
tool station #3 and call offset #3, the program block would have
to contain T0303.
To cancel the tool you would use a reference to register 00 with
the last two digits instead. This register is usually preset to a zero
value and cannot be changed by the operator. For example,
T0300 would cancel register #3. This is usually done prior to a
tool change

Tool change function for turning


Format: N_ T__ __

Examples

EXAMPLE 1:
This program introduces you to
the basic G- and M-codes.
When executed, it turns the
workpiece from an original
diameter of 1.0 in.

Workpiece Size: 1" Diameter by 2" Length


Tool: Tool #1, Right-hand Turning Tool
Tool Start Position: X2, Z3
%
:1001
N5 G20 G40
N10 T0101 M03
N15 G00 X1 Z0.25 M08
N20 G01 Z-0.75 F0.015
N25 G00 X1.1
N30 Z0.05
N35 X0.9375
N40 G01 Z-0.75 F0.012
N45 G00 X1
N50 Z0.05
N55 X0.8745
N60 G01 Z-0.75
N65 G00 X0.5
N70 Z0.05
N75 X0.8125
N80 G01 Z-0.375
N85 G00 X1
N90 Z0.05
N95 X0.75
N100 G01 Z-0.375
N105 G00 X2 M09
N110 Z2
N115 T0100 M05
N120 M30

EXAMPLE 2:
This program introduces
you to the basic circular
interpolation routines.
Workpiece Size: 2"
Diameter by 4" Length
Tool: Tool #1, Right-hand
Turning Tool
Tool Start Position: X2, Z3
%
:1002

N5 G20 G40

N10 T0101
N15 M03
N20 G00 X1.8 Z0.05
N25 M08
N30 G01 Z-2.5 F0.015
N35 G00 X2
N40 Z0.05

N45 X1.6
N50 G01 Z-2
N55 G00 X1.8
N60 Z0.05

N125 X1
N135 G02 X0.8 Z0 I-0.1 K0

N65 X1.4
N140 G00 X2 Z2
N70 G01 Z-1.5
N145 M09
N75 X2 Z-3
N80 G00 Z0.05
N150 T0100 M05
N85 X1.2
N155 M30
N90 G01 Z-0.5
N95 G00 X1.4
N100 Z0.05
N105 X1
N110 G01 Z-0.5
N115 G03 X1.4 Z-0.7 I0 K-0.2
N120 G00 Z-0.1

EXAMPLE 3:

This program introduces you to the G71 turning cycle and G70 finishing cycle
commands.
Workpiece Size: 4" Diameter by 2" Length
Tool: Tool #1, Right-hand Turning Tool
Tool Start Position: X2, Z3
%
:1003
N5 G90 G20 G40
N10 T0101
N15 M03
N20 G00 X2.1 Z0.05
N25 G71 P30 Q50 U0.025 W0.005 D625 F0.012
N30 G01 X1 Z0
N35 G03 X1.5 Z-0.25 I0 K-0.25
N40 G01 X1.75 Z-2
N45 G03 X2 Z-2.125 I0 K-0.125
N50 G01 X2.2
N55 G70 P30 Q50 F0.006
N60 G00 X2 Z2
N65 T0100 M05
N70 M30

EXAMPLE 4
This example demonstrates the G72 facing cycle and the G74 drilling cycle
commands.
Workpiece Size: 2" Diameter by 3" Length
Tool: Tool #2, Right-hand Turning Tool
Tool #3, 3/8" Drill
Tool Start Position: X2, Z3
%
:1004
N5 G90 G20 G40
N10 T0202
N15 M03
N20 M08
N25 G00 X2 Z0.05
N30 G72 P35 Q50 U0.05 W0.005 D500 F0.012
N35 G01 X1 Z0.05
N40 Z-1
N45 X2 Z-1.5
N50 X2.2
N55 G70 P35 Q50 F0.006
N60 T0200 G00 X4 Z3

N65 T0303
N70 G00 X0 Z0.1
N75 G74 Z-1 F0.05 D0 K0.125
N80 G00 X4 Z3 M09
N85 T0300 M05
N90 M30

CNC Tooling

Cutting Tools
One of most important components in
machining process
Performance will determine efficiency of
operation
Two basic types (excluding abrasives)
Single point and multiple point

Must have rake and clearance angles ground


or formed on them

Cutting-Tool Materials
Toolbits generally made of seven materials
High-speed steel
Cast alloys (such as stellite)
Cemented carbides
Ceramics
Cermets
Cubic Boron Nitride
Polycrystalline Diamond

Cutting Tool Properties


Hardness
Cutting tool material must be 1 1/2 times
harder than the material it is being used to
machine.

Capable of maintaining a red hardness


during machining operation
Red hardness: ability of cutting tool to
maintain sharp cutting edge
Also referred to as hot hardness or hot
strength

Cutting Tool Properties


Wear Resistance
Able to maintain sharpened edge throughout
the cutting operation
Same as abrasive resistance

Shock Resistance
Able to take the cutting loads and forces

Cutting Tool Properties


Shape and Configuration
Must be available for use in different sizes and
shapes.

High-Speed Steel
May contain combinations of tungsten,
chromium, vanadium, molybdenum,
cobalt
Can take heavy cuts, withstand shock and
maintain sharp cutting edge under red
heat
Generally two types (general purpose)
Molybdenum-base (Group M)
Tungsten-base (Group T)

Cobalt added if more red hardness


desired

Cast Alloy
Usually contain 25% to 35% chromium, 4% to
25% tungsten and 1% to 3% carbon
Remainder cobalt

Qualities
High hardness
High resistance to wear
Excellent red-hardness

Operate 2 times speed of high-speed steel


Weaker and more brittle than high-speed steel

Carbide Cutting Tools


First used in Germany during WW II as
substitute for diamonds
Various types of cemented (sintered)
carbides developed to suit different
materials and machining operations
Good wear resistance
Operate at speeds ranging 150 to 1200
sf/min

Can machine metals at speeds that cause


cutting edge to become red hot without
loosing harness

Manufacture of Cemented
Carbides
Products of powder metallurgy process
Tantalum, titanium, niobium

Operations
Blending
Compaction
Presintering
Sintering

Blending
Five types of powders
Tungsten carbide, titanium carbide, cobalt,
tantalum carbide, niobium carbide

One or combination blended in different


proportions depending on grade desired
Powder mixed in alcohol (24 to 190 h)
Alcohol drained off
Paraffin added to simplify pressing
operation

Compaction
Must be molded to shape and size
Five different methods to
compact powder
Extrusion process
Hot press
Isostatic press
Ingot press
Pill press

Green (pressed) compacts soft, must be


presintered to dissolve paraffin

Presintering
Green compacts heated to about 1500 F
in furnace under protective atmosphere
of hydrogen
Carbide blanks have consistency of chalk
May be machined to required shape
40% oversize to allow for shrinkage that
occurs during final sintering

Sintering
Last step in process
Converts presintered machine blanks into
cemented carbide
Carried out in either hydrogen
atmosphere or vacuum
Temperatures between 2550 and 2730 F

Binder (cobalt) unites and cements


carbide powders into dense structure of
extremely hard carbide crystals

Cemented-Carbide Applications
Used extensively in manufacture of
metal-cutting tools
Extreme hardness and good wear-resistance

First used in machining operations as


lathe cutting tools
Majority are single-point cutting tools
used on lathes and milling machines

Types of Carbide Lathe


Cutting Tools
Blazed-tip type
Cemented-carbide tips brazed to steel
shanks
Wide variety of styles and sizes

Indexable insert type


Throwaway inserts
Wide variety of shapes: triangular, square,
diamond, and round
Triangular: has three cutting edges

Inserts held mechanically in special holder

Brazed-Tip Tools

Indexable Inserts

Indexable, meaning that they can be rotated or flipped without disturbing the overall geometry of the tool (effective
diameter, tool length offset, etc.). This saves time in manufacturing by allowing fresh cutting edges to be presented
periodically without the need for tool grinding, setup changes, or entering of new values into a CNC program.

Reasons Indexable Inserts More


Popular than Brazed-Tip Tools
1. Less time required to change cutting
edge
2. Amount of machine downtime reduced
considerable thus production increased
3. Time normally spent in regrinding
eliminated
4. Faster speeds and feeds can be used
5. Cost of diamond wheels eliminated
6. Indexable inserts cheaper than brazedtip

Cemented-Carbide Insert
Identification
American Standards Association has
developed system by which indexable
inserts can be identified quickly and
accurately

Carbide Insert Selection


M1-Fine
M2-Medium
M3-S.S
M4-Cast iron
M5-General
Purpose

A.N.S.I. Insert Identification


System
ANSI - B212.4-1986

Carbide Insert Selection

Grades of Cemented Carbides


Two main groups of carbides
Straight tungsten carbide
Contains only tungsten carbide and cobalt
Strongest and most wear-resistant
Used for machining cast iron and nonmetals

Crater-resistant
Contain titanium carbide and tantalum carbide in
addition to tungsten carbide and cobalt
Used for machining most steels

Qualities of Tungsten
Carbide Tools
Determined by size of tungsten carbide
particles and percentage of cobalt

1. Finer the grain particles, lower the tool


toughness
2. Finer the grain particles, higher tool
hardness
3. Higher the hardness, greater wear
resistance
4. Lower cobalt content, lower tool toughness
5. Lower cobalt content, higher hardness

Additive Characteristics
Titanium carbide
Addition provides resistance to tool cratering
Content increased
Toughness of tool decreased
Abrasive wear resistance at cutting edge lowered

Tantalum carbide
Addition provides resistance to tool cratering
Without affecting abrasive wear resistance

Addition increases tool's resistance to


deformation

General Rules for Selection of Proper


Cemented-Carbide Grade
1. Use grade with lowest cobalt content and
finest grain size
2. Use straight tungsten carbide grades to
combat abrasive wear
3. To combat cratering, seizing, welding, and
galling, use titanium carbide grades
4. For crater and abrasive wear resistance, use
tantalum carbide grades
5. Use tantalum carbide grades for heavy cuts in
steel, when heat and pressure might deform
cutting edge

Coated Carbide Inserts


Give longer tool life, greater productivity
and freer-flowing chips
Coating acts as permanent lubricant
Permits higher speed, reduced heat and stress

Two or three materials in coating give tool


special qualities
Innermost layer of titanium carbide
Thick layer of aluminum oxide
Third, very thin layer titanium nitride

Coatings
Titanium carbide

High wear and abrasion resistance


(moderate speed)
Used for roughing and finishing

Titanium nitride

Extremely hard, good crater resistance


Excellent lubricating properties

Aluminum oxide

Provides chemical stability


Maintains hardness at high temperatures

Tool
Geometry
Terms adopted
by ASME

SIDE RELIEF
SIDE CLEARANCE

Cutting Tools
Single point cutting tool

Cutting-Tool Terms
Front, End, Relief
(Clearance)
Allows end of cutting tool
to enter work

Side Relief (Side)


Permits side of tool to
advance into work

Cutting-Tool Terms
Side Cutting Edge Angle
Angle cutting edge meets work
Positive
Negative - protects point at start and end of cut

Nose Radius
Strengthens finishing point of tool
Improves surface finish on work
Should be twice amount of feed per
revolution
Too large chatter; too small weakens point

Side Rake
Large as possible to allow
chips to escape
Amount determined
Type and grade of cutting tool
Type of material being cut
Feed per revolution

Angle of keenness
Formed by side rake and side
clearance

Back Rake
Angle formed between top face of tool
and top of tool shank
Positive
Top face slopes downward
away from point

Negative
Top face slopes upward
away from point

Neutral

Cemented-Carbide Cutting-Tool
Angles and Clearances
Vary greatly
Depend on three factors
Hardness of cutting tool
Workpiece material
Type of cutting operation

May have to be altered slightly to suit


various conditions encountered

Cutting Speeds and Feeds


Important factors that influence speeds,
feeds, and depth of cut
Type and hardness of work material
Grade and shape of cutting tool
Rigidity of cutting tool
Rigidity of work and machine
Power rating of machine

Machining with Carbide Tools


To obtain maximum efficiency
Precautions in machine setup
Rigid and free from vibrations
Equipped with heat-treated gears
Sufficient power to maintain constant cutting
speed

Cutting operation
Cutting tool held as rigidly as possible to avoid
chatter

Suggestions for Using


Cemented-Carbide Cutting Tools
Work Setup
Mount work in chuck or holding device to
prevent slipping and chattering
Revolving center used in tailstock for turning
work between centers
Tailstock spindle extended minimum distance
and locked securely
Tailstock should be clamped firmly to lathe
bed

Suggestions for Using


Cemented-Carbide Cutting Tools
Tool Selection
Use cutting tool with proper rake and clearances
Hone cutting edge
Use side cutting edge angle
large enough tool can be
eased into work
Use largest nose radius
operating conditions permit

Cemented-Carbide
Capable of cutting speeds 3 to 4 times highspeed steel toolbits
Low toughness but high hardness and
excellent red-hardness
Consist of tungsten carbide sintered in
cobalt matrix
Straight tungsten used to machine cast iron
and nonferrous materials (crater easily)
Different grades for different work

Nose radius
The nose radius, re, on the insert is a key factor in turning operations.
Selection of nose radius depends on the:
Depth of cut, ap
Feed, fn
and influences the:
Surface finish
Chip breaking
Insert strength.
Small nose radius
Ideal for small cutting depths
Reduces vibration
Less insert strength.
Large nose radius
Heavy feed rates
Large depths of cut
Stronger edge
Increased radial forces.

Nose Radius in Relation to DOC


The radial forces that push the insert
away from the cutting surface
become more axial as the depth
of cut increases.
The nose radius also affects the
chip formation. Generally, chip
breaking improves with a smaller
radius.
As a general rule of thumb, the
depth of cut should be greater
than or equal to 2/3 of the nose
radius, or 1/2 of the nose radius in
the feed direction.

Nose radius surface finish and feed

In turning operations, the generated surface finish will be directly


influenced by the combination of nose radius and feed rate.

Insert Catalogue

Inserted Blade Face Mill


Consists of body that holds several
equally spaced inserts
Required rake angle
Lower edge of each insert has relief or
clearance angle ground on it

Cutting action occurs at lower corner of


insert
Corners chamfered to give strength

Face Milling

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

End Milling
Multi-fluted cutters held vertically in
vertical milling machine spindle or
attachment
Used primarily for cutting slots or
grooves
Workpiece held in vise and fed into
revolving cutter
End milling
Cutting done by periphery of teeth

Nomenclature of an
End Mill

Nomenclature of an
End Mill

Drilling
Multi-edge cutting tool that cuts on the point
Drill's cutting edges (lips) provided with lip
clearance to permit point to penetrate
workpiece as drill revolves
Rake angle provided by helical-shaped flutes
Slope away from cutting edge

Angle of keeness
Angle between rake angle and clearance angle

Characteristics of a
Drill Point

Cutting-point angles for


standard drill

Chip formation
of a drill

Basic Cutting Tools

Ball End Mill

Combination Drill &


Countersink
Indexable Shell
Mill

Center Cutting End


Mill

Non-Center Cutting
End Mill

Spotting Drill

Countersink

Flutes

2 Flute End Mill


More room for chip evacuation
Used for light metals
Weak, short tool life

4 Flute End Mill


More cutting edges, longer
tool life
Used for harder metals
Clogs easily in deep cuts

Center vs. Non-Center Cutting

2 Flute
Center Cutting

4 Flute
Center Cutting

4 Flute
Non-Center Cutting

Milling Tools
Tool

Description
2 Flute HSS
Single End Mills
For Cutting
Aluminum 3/8
Shank x 1
cutting length
2 Flute Ball End
Mill for Aluminum
3/8 shank x 1
cutting length

MSC Part
#
01901164

71886162

Application
Facing, profiling,
Pocketing,
Slotting,
Roughing and
Finishing
Surfacing,
Slotting,
profiling,
Roughing and
Finishing

Engraving Tool Options


Tool

Description

MSC Part
#

Application

Countersink &
De-burring Tool
90 Degree

02462166

Engraving, Deburring,
countersink,
Spot drilling

#3 Combined drill
& countersink 90
Degree

71037030

Spot drilling,
Engraving

spotting drill 90
deg
Professional Development ID Code: 6005

01833003

Spot Drilling,
Engraving

ISO CUTTING TOOLS

Tool Path Techniques

1. Roll the Tool In

Roll into the cut by following an arc that curves in the same
direction as the tool rotation. This keeps the chip thin at the end
of each cutting edge pass.

2. Ramp Down

Continuous ramping keeps the load on the tool consistent, preserving tool life.

3. Spiral Out

Even though the pocket is a polygon, the tool path should follow a gradually
increasing circle for as long as it can.
It is also called spiral morphing, in which the tool path follows a growing circle
until it reaches far enough out that it finally has to give way to the pockets
shape

4. Slice Corners

Corner slicing preserves tool life and makes the process more predictable by
replacing cornering tool paths with a progressive series of arcing moves.

5. Drive by the Edge

Milling turbine engine cases with larger-diameter tools involves driving the tool
according to a cutting point that actually lands inside the inserts curvature,
indicated here by the red dot on the drawing of the tool.

Parallel Profiling

Roughing

Finishing

Offset Profiling

Waterline Finishing

Pencil Finishing

CAD/CAM

Definitions of CAD/CAM Tools Based on


Their Constituents
Mfg tools

Design tools

CAD/CAM
Geometric
tools
Networking
modeling
Computer
graphics
concepts

Definition of CAD/CAM Tools Based on Their


Implementation in an Engineering Environment
Hardware

Design and
+ Computer
Mfg tools

Software

Networking

= CAD/CAM tools

Typical Utilization of CAD/CAM Systems in an Industrial Environment


Geometric modeling and graphics package

Process planning
Geometric modeling
of conceptual design

Is design evaluation
Possible with available
Standard software?

Design
package

No

Yes

Are there
manufacturing
discrepancies in CAD
databases?

Yes
Design testing
And evaluation

No

CAPP package

Is final design
Applicable?
Yes
Drafting
Documentation

Develop customized
programs and
packages
Programming
package

No
CNC
programming

NC
package

Machining
Inspection
Assembly

Inspection
And Robotics
package

There are 4 steps in any


CAD/CAM operation:
1. Geometry Creation
2. Toolpath Creation
3. Post Processing
4. Machining the Final Part

1. Geometry Creation
Producing a vector-based drawing of the
part you want to make.
3 Ways to Create Geometry
Draw it in CAD
Convert a raster-based drawing
to vectors
3D scan of an existing object

1. Geometry Creation
- Using CAD
CAD programs make vector-based
(mathematically calculated) entities.
Some common CAD formats include:
Mastercam - .mc9
AutoCAD - .dwg
Microstation - .dgn
Drawing Exchange

Format - .dxf

1. Geometry Creation
- Raster to Vector conversion
Most graphics programs make raster-based (dots
on screen) images that must be changed to vectors
so they can be used for CAM.
Some common raster formats include:
MS Paint - .bmp

Raster

Internet images - .jpg

Vector

Graphics editors - .gif


Scanned images - .tif

1. Geometry Creation
- 3D Scan
The scanner measures millions of points on an
object and records them as co-ordinates which are
then used to create the vector geometry.

Laser scanner

turns this object

into this geometry.

2. Toolpath Creation
Using the geometry to make a road
map that the cutting tool will follow in
order to machine the part.
Several parameters must be set:

Type of tool used


Cutting speeds, depths,
and feed rates
Material to be cut
Rough and finish settings

2. Toolpath Creation
- Verification
Most software will let you see a simulation of
your part being cut so you can verify that the
toolpath information is correct.

3. Post Processing
Translating the toolpath information into
a programming language called G-Code
that controls the machine.

From toolpath
to G-Code.

4. Machining the Final Part


The machine reads the G-Code and follows
the toolpath to cut the part.

End

History of CNC
The RS274-D is a word address format
Each line of program == 1 block
Each block is composed of several instructions, or (words)
Sequence and format of words:
N3 G2 X+1.4 Y+1.4 Z+1.4 I1.4 J1.4 K1.4 F3.2 S4 T4 M2
sequence no

destination coordinates

preparatory function

dist to center of circle

tool

feed rate spindle speed


Other function

Manual Part Programming Example


5
2.5
p3

p2

p4

p5

Tool size = 0.25 inch,


Feed rate = 6 inch per minute,
Cutting speed = 300 rpm,
Tool start position: 2.0, 2.0
Programming in inches

45
(4, 4)
p1
p0 (2, 2)

Motion of tool:
p0 p1 p2 p3 p4 p5 p1 p0

1. Set up the programming parameters


5
2.5
p3

p2

p4

p5

Programming in inches
5

Use absolute coordinates


Feed in ipm
45

N010 G70 G90 G94 G97 M04


(4, 4)
p1
p0 (2, 2)

Spindle speed in rpm


Spindle CCW

2. Set up the machining conditions


5
2.5
p3

p2

p4

p5

Machine moves in XY-plane


Use full-circle interpolation

Feed rate
Spindle speed
45

N020 G17 G75 F6.0 S300 T1001 M08


(4, 4)
p1
p0 (2, 2)

Tool no.
Flood coolant ON

3. Move tool from p0 to p1 in straight line


5
2.5
p3

p2

p4

p5

Linear interpolation
target coordinates
N030 G01 X3.875 Y3.698

45
(4, 4)
p1
p0 (2, 2)

4. Cut profile from p1 to p2


5
2.5
p3

p2

p4

p5

Linear interpolation
target coordinates

N040 G01 X3.875 Y9.125


45

or

(4, 4)
p1

N040 G01 Y9.125

p0 (2, 2)

X-coordinate does not change no need to program it

5. Cut profile from p2 to p3


5
2.5
p3

p2

p4

p5

Linear interpolation
target coordinates

N050 G01 X5.634 Y9.125


5
y = 9 + 0.125 = 9.125
(6.5 - x)2 + 0.1252 = (1 - 0.125)2
x = 5.634

45

p3
(x, y)

(4, 4)
p1

(6.5, 9)
.125

p0 (2, 2)
1

6. Cut along circle from p3 to p4


5
2.5
p3

p2

p4

p5

circular interpolation, CCW motion


5

target coordinates

45
(4, 4)
p1
p0 (2, 2)

N060 G03 X7.366 Y9.125 I6.5 J9.0


coordinates of center of circle

7. Cut from p4 to p5
5
2.5
p3

p2

p4

p5

Linear interpolation
45
(4, 4)
p1
p0 (2, 2)

target coordinates (Y is unchanged)


N070 G01 X9.302

8. Cut from p5 to p1
5
2.5
p3

p2

p4

p5

Linear interpolation
target coordinates (see step 3)
45

N080 G01 X3.875 Y3.698


(4, 4)
p1
p0 (2, 2)

9. Return to home position, stop program


5
2.5
p3

p2

p4

p5

Linear interpolation
target coordinates (see step 3)

N090 G01 X2.0 Y2.0 M30


45
(4, 4)
p1
p0 (2, 2)

end of data
N100 M00
program stop