Computer Numerical Control
Computer Numerical Control
1. Fundamentals of NC Technology
2. Computers and Numerical Control
3. Applications of NC
4. Analysis of Positioning Systems
5. NC Part Programming
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Numerical Control (NC)
• Form of programmable automation in which the mechanical
actions of a machine tool or other equipment are controlled
by a program containing coded alphanumeric data
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Basic Components of an NC
System
1. Program of instructions
➢ Called a part program in machining
2. Machine control unit
➢ Controls the process
3. Processing equipment
➢ Performs the process
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Basic Components of an NC System
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
NC Coordinate Systems
(a) For flat and block-like parts and (b) for rotational parts
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Motion Control Systems
• Point-to-Point systems
• Also called positioning systems
• System moves to a location and performs an
operation at that location (e.g., drilling)
• Also applicable in robotics
• Continuous path systems
• Also called contouring systems in machining
• System performs an operation during movement
(e.g., milling and turning)
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Point-To-Point Control
NC drilling
of three
holes in flat
plate
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Continuous Path Control
Capable of
continuous
simultaneous
control of two or
more axes
NC profile milling
of part outline
• Straight NC Cut
• Contouring
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Circular Interpolation
Approximation of a
curved path in NC by a
series of straight-line
segments, where
tolerance is defined on
(a) inside, (b) outside,
and (c) both inside and
outside of the actual
curve
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Interpolation Methods
1. Linear interpolation
➢ Straight line between two points in space, the feed rate to be
used along the straight line.
➢ Then interpolator calculates the feed rates for each of the
axes
2. Circular interpolation
➢ Circular arc defined by starting point, end point, center or
radius, and direction
3. Helical interpolation
➢ Circular plus linear motion
4. Parabolic and cubic interpolation
➢ Free form curves using higher order equations
➢ Aerospace and automotive industry
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Absolute and Incremental
Positioning
• Absolute positioning
• Locations defined relative to origin of axis
system
• Incremental positioning
• Locations defined relative to previous
position
• Example: drilling
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Absolute vs. Incremental
Positioning
The work head is
presently at point (20, 20)
and is to be moved to
point (40, 50)
▪ In absolute positioning,
the move is specified by x
= 40, y = 50
▪ In incremental
positioning, the move is
specified by x = 20, y = 30
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Computer Numerical Control (CNC) –
Additional Features
• Storage of more than one part program
• Program editing at the machine tool
• Fixed cycles and programming subroutines, macros
• Adaptive control
• Interpolation
• Positioning features for setup – to help operator align work
part on machine tool table
• Acceleration and deceleration computations
• Communications interface
• Diagnostics
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Configuration of CNC Machine Control Unit
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
CNC Software
• Operating system software: to interpret the NC part
programs and generate the corresponding control signals to
drive the machine tool axes.
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
DNC
• Direct numerical control (DNC) – control of multiple
machine tools by a single (mainframe) computer
through direct connection and in real time
• 1960s technology
• Two-way communication
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
General Configuration of a
Direct Numerical Control
System
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Applications of NC
Machine tool applications:
➢Milling, drilling, turning, boring, grinding
➢Machining centers, turning centers, mill-turn
centers
➢Other metalworking processes:
• Punch presses for hole punching and sheet metal
bending
• Tube bending
• Thermal cutting machines
• Wire EDM
• Welding
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Common NC Machining
Operations
(a) Turning
(b) drilling
(c) milling
(d) grinding
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
CNC Four-Axis
Horizontal Milling Machine
(a) With safety panels installed and (b) safety panels removed to show
typical axes configuration
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
NC Application Characteristics
(Machining)
Where NC is most appropriate:
1. Batch production
2. Repeat orders
3. Complex part geometries
4. Much metal needs to be removed from the starting
work part
5. Many separate machining operations on the part
6. Part is expensive
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Other Applications of NC
• Rapid prototyping and additive manufacturing
• Water jet cutting and abrasive water jet cutting
• Component placement machines in electronics
assembly
• Coordinate measuring machines
• Wood routers and granite cutters
• Tape laying machines for polymer composites
• Filament winding machines for polymer composites
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Advantages of NC
• Nonproductive time is reduced
• Greater accuracy and repeatability
• Lower scrap rates
• Inspection requirements are reduced
• More complex part geometries are possible
• Engineering changes are easier to make
• Simpler fixtures
• Shorter lead times
• Reduce parts inventory and less floor space
• Operator skill-level requirements are reduced
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Disadvantages of NC
Higher investment cost
➢ CNC machines are more expensive
Higher maintenance effort
➢ CNC machines are more technologically sophisticated
Part programming issues
➢ Need for skilled programmers
➢ Time investment for each new part
➢ Repeat orders are easy because part program is already
available
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
NC Positioning System
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Open-Loop Positioning Systems
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Open-Loop Positioning Systems
The angle through which the motor shaft rotates is given by
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Open-Loop Positioning Systems
• Control pulses are transmitted from the pulse generator at a
certain frequency.
The rotational speed of the screw depends on the frequency of
the pulse train as
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Open-Loop Positioning Systems
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Optical Encoder
• Device for measuring rotational position and speed: (a) apparatus and (b)
series of pulses to measure rotation
• Common feedback sensor for closed-loop NC control
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Closed-Loop Positioning Systems
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Closed-Loop Positioning Systems
In the basic optical encoder, the angle between slots in the disk
must satisfy the following requirement:
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Closed-Loop Positioning Systems
The velocity of the worktable
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Precision in NC Positioning
Three measures of precision:
1. Control resolution - distance separating two
adjacent addressable points in the axis movement
2. Accuracy - maximum possible error that can occur
between the desired target point and the actual
position taken by the system
3. Repeatability - defined as 3 of the mechanical
error distribution associated with the axis
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Definitions of Control Resolution,
Accuracy, and Repeatability
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
NC Part Programming
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Binary Coded Decimal System
• Each of the ten digits in decimal system is coded with
four-digit binary number
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Binary coded Decimal
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Creating Instructions for NC
• Bit : 0 or 1 = absence or presence of hole in the tape
• Character - row of bits across the tape
• Word - sequence of characters (e.g., y-axis position)
• Block - collection of words to form one complete
instruction (e.g. explicitly determines what machine
tool will do)
• Part program - sequence of instructions (blocks)
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Block Format
Organization of words within a block in NC part program
• Also known as tape format because the original
formats were designed for punched tape
• Word address format - used on all modern CNC
controllers
➢Uses a letter prefix to identify each type of word
➢Spaces to separate words within the block
➢Allows any order of words in a block
➢Words can be omitted if their values do not change
from the previous block
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Types of Words
N - sequence number prefix
G - preparatory words
➢Example: G00 = PTP rapid traverse move
X, Y, Z - prefixes for x, y, and z-axes
F - feed rate prefix
S - spindle speed
T - tool selection
M - miscellaneous command
➢Example: M07 = turn cutting fluid on
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Example: Word Address
Format
N001 G00 X07000 Y03000 M03
N002 Y06000
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Manual Part Programming
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
G01 G94 X050.0 Y086.5 Z100.0 F40 S800
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Circular interpolation
G02 G17 X088.0 Y040.0 R028.0 F30
G17, G18, G19: Circular interpolation is limited
to one of the planes x-y, x-z or y-z.
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Cutter offset
G42 G01 X100.0 Y040.0 D05
Where D05 refers to the cutter radius value stored in MCU memory (reserved)
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
An example-Self Study
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Computer-Assisted Part Programming
• Manual part programming is time-consuming, tedious, and
subject to human errors for complex jobs
• Machining instructions are written in English-like statements
that are translated by the computer into the low-level
machine code of the MCU
• APT (Automatically Programmed Tool) language and computer
program which processes APT commands
• The various tasks in computer-assisted part programming are
divided between
➢ The human part programmer
➢ The computer
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Computer-Assisted Part
Programming
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Part Programmer's Job
Two main tasks of the programmer:
1.Define the part geometry
2.Specify the tool path
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Defining Part Geometry
• Underlying assumption: no matter how complex the part
geometry, it is composed of basic geometric elements and
mathematically defined surfaces
Sample part with geometry elements (points, lines, and circle) labeled for
computer-assisted part programming.
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Defining Part Geometry
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Specifying Tool Path and
Operation Sequence
• Point-to-Point command:
– GOTO/P0
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Other Functions by Programmer in Computer-
Assisted Part Programming
• Specifying cutting speeds and feed rates
• Designating cutter size (for tool offset calculations)
• Specifying tolerances in circular interpolation
• Naming the program
• Identifying the machine tool
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Computer Tasks in Computer-Assisted Part
Programming
• Input translation – converts the coded instructions (APT High-
level language) in the part program into computer-usable form
• In particular, the following tasks:
• Syntax check of the input code to identify errors in
format, punctuation, spelling, and statement sequence;
• Assigning a sequence number to each APT statement in
the program;
• Converting geometry elements into a suitable form for
computer processing; and
• Generating an intermediate file called PROFIL
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Computer Tasks in Computer-Assisted Part
Programming
• Arithmetic and cutter offset computations – performs the
mathematical computations to define the part surface and
generate the tool path, including cutter offset compensation
(CLFILE)
• Editing – provides readable data on cutter locations and
machine tool operating commands (CLDATA)
• Postprocessing – converts CLDATA into low-level code that can
be interpreted by the MCU of a specific machine tool
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
CAD/CAM Tool Path Generation and Simulation
The next step is tool path definition
• Different approaches available
• Finally, the part program that has been developed and verified
using CAD/CAM is post-processed to create the machine-
language part program in word address format for the
particular machine tool that will be used for the job.
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Examples of Machining Cycles in Automated NC
Programming Modules
(a) Pocket milling, (b) contour turning, (c) facing, and (d) threading
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Some Common NC Modules for Automatic
Programming of Machining Cycles
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
CAD/CAM Part Programming-Advantages
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Some Specific Software
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
Typical Sequence of Steps in CNC Part Programming Using
Mastercam for a Sequence of Milling and Drilling Operations
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
STEP-NC
• The larger project is called STEP, which is an
acronym for Standard for the Exchange of Product
Model Data
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
STEP-NC
• A future CAM system would possess sufficient logic
and decision-making capability to accomplish
programming for the entire part without human
assistance.
• Research and development is proceeding on a new
machine tool control language that would eliminate
the need for machine-level part programming using
G-codes and M-codes.
• In effect, it would result in the automatic generation
of NC part programs without the participation of
human part programmers
Automation, Production Systems and Computer-integrated Manufacturing, M. P. Groover, PHI; ©2008 Pearson Education, Inc., Upper
Saddle River, NJ. All rights reserved.
STEP-NC
• The limitation of part programs based on G-codes and M-
codes is that they consist of instructions that only direct the
actions of the cutting tool, without any related information
content about the part being machined.