You are on page 1of 240

AUTOMATION

Dr. Ibrahim Al-Naimi


Chapter five
Computer Numerical
Control (CNC)
Contents
• Machine operation and machine tool.
• Basic machining calculations for milling, turning and drilling.
• Numerical Control (NC) definition.
• Basic components of NC system.
• NC coordinate system.
• NC Motion control system.
• Computer Numeric Control (CNC) features.
• CNC machine control unit.
• Distributed Numerical Control.
• CNC applications.
• Engineering analysis of CNC positioning system.
• CNC part programming.
Machine Operation and Machine
Tool
• Turning and Related Operations
• Drilling and Related Operations
• Milling
• Machining Centers and Turning Centers
• Other Machining Operations
Machining
• A material removal process in which a sharp
cutting tool is used to mechanically cut away
material so that the desired part geometry
remains.
• Most common application: to shape metal parts
• Machining is the most versatile and accurate of all
manufacturing processes in its capability to produce
a diversity of part geometries and geometric features
(Casting can also produce a variety of shapes, but it
lacks the precision and accuracy of machining)
Classification of Machined Parts

1. Rotational - cylindrical or disk-like shape


2. Nonrotational (also called prismatic) -
block-like or plate-like

Machined parts are classified as: (a) rotational, or (b) nonrotational, shown here by
block and flat parts
Machining Operations and Part
Geometry
• Each machining operation produces a characteristic
part geometry due to two factors:

1. Relative motions between the tool and the workpart


– Generating – part geometry is determined by the feed
trajectory of the cutting tool
2. Shape of the cutting tool
– Forming – part geometry is created by the shape of the
cutting tool
Generating shape: (a) straight turning, (b) taper turning, (c) contour
turning, (d) plain milling, (e) profile milling
Forming to create shape: (a) form turning, (b) drilling, and (c)
broaching
Combination of forming and generating to create shape: (a) thread
cutting on a lathe, and (b) slot milling
Turning

• A single point cutting tool removes material from a


rotating workpiece to generate a cylindrical shape
• Performed on a machine tool called a lathe
• Variations of turning that are performed on a lathe:
– Facing
– Contour turning
– Chamfering
– Cutoff
– Threading
Turning operation
Facing
Tool is fed
radially inward

(a) facing
Contour Turning
Instead of feeding the tool parallel to the axis of rotation,
tool follows a contour that is other than straight, thus
creating a contoured form

(c) contour turning


Chamfering
Cutting edge cuts an angle on the corner of the
cylinder, forming a "chamfer"

(e) chamfering
Cutoff
Tool is fed radially into rotating work at some location to
cut off end of part

(f) cutoff
Threading
Pointed form tool is fed linearly across surface of
rotating workpart parallel to axis of rotation at a large
feed rate, thus creating threads

(g) threading
Methods of Holding the Work in a
Lathe
• Holding the work between centers
• Chuck
• Collet
• Face plate
Chuck

(b) three-jaw chuck


Collet

(c) collet
Face Plate

(d) face plate for non-cylindrical workparts


Holding the Work Between Centers

(a) mounting the work between centers using a "dog”


Turret Lathe
Tailstock replaced by “turret” that holds up to six tools
• Tools rapidly brought into action by indexing the
turret
• Tool post replaced by four-sided turret to index four
tools
• Applications: high production work that requires a
sequence of cuts on the part
Chucking Machine
• Uses chuck in its spindle to hold workpart
• No tailstock, so parts cannot be mounted
between centers
• Cutting tool actions controlled automatically
• Operator’s job: to load and unload parts
• Applications: short, light-weight parts
Bar Machine
• Similar to chucking machine except collet
replaces chuck, permitting long bar stock to be
fed through headstock
• At the end of the machining cycle, a cutoff
operation separates the new part
• Highly automated (the term automatic bar
machine is often used)
• Applications: high production of rotational parts
Automatic Screw Machine
• Same as automatic bar machine but smaller
• Applications: high production of screws and
similar small hardware items; hence, its name
Multiple Spindle Bar Machines
• More than one spindle, so multiple parts
machined simultaneously by multiple tools
– Example: six spindle automatic bar machine works on
six parts at a time
• After each machining cycle, spindles (including
collets and workbars) are indexed (rotated) to
next position
(a) Part produced on a six-spindle automatic bar machine; and (b)
sequence of operations to produce the part: (1) feed stock to
stop, (2) turn main diameter, (3) form second diameter and
spotface, (4) drill, (5) chamfer, and (6) cutoff
Boring
• Difference between boring and turning:
– Boring is performed on the inside diameter of an
existing hole
– Turning is performed on the outside diameter of
an existing cylinder
• In effect, boring is an internal turning operation
• Horizontal or vertical Boring machines refers to the
orientation of the axis of rotation of machine spindle
A vertical boring mill –for large, heavy workparts
Drilling
• Creates a round hole in
a workpart
• Contrasts with boring
which can only enlarge
an existing hole
• Cutting tool called a drill
or drill bit
• Customarily performed
on a drill press (b) drilling
Through Holes vs. Blind Holes
Through-holes - drill exits the opposite side of work
Blind-holes – drill does not exit work on opposite side

Two hole types: (a) through-hole, and (b) blind hole


Reaming
Used to slightly
enlarge a hole,
provide better
tolerance on
diameter, and
improve surface
finish

Machining operations related


to drilling:
(a) reaming
Tapping
Used to provide
internal screw
threads on an
existing hole
Tool called a tap

(b) tapping
Counterboring
Provides a stepped
hole, in which a
larger diameter
follows a smaller
diameter partially
into the hole

(c) counterboring
Milling
• Machining operation in which work is fed past a rotating tool
with multiple cutting edges.
• Axis of tool rotation is perpendicular to feed direction
• Creates a planar surface; other geometries possible either
by cutter path or shape
• Other factors and terms:
– Milling is an interrupted cutting operation
– Cutting tool called a milling cutter, cutting edges called "teeth"
– Machine tool called a milling machine
Two forms of milling:
(a) peripheral milling, and (b) face milling
Peripheral Milling vs. Face Milling
• Peripheral milling
– Cutter axis is parallel to surface being machined
– Cutting edges on outside periphery of cutter
• Face milling
– Cutter axis is perpendicular to surface being milled
– Cutting edges on both the end and outside periphery
of the cutter
Slab Milling
The basic form of peripheral milling in which the cutter
width extends beyond the workpiece on both sides

(a) slab milling


Slotting
• Width of cutter is less than workpiece width, creating
a slot in the work

(b) slotting
Conventional
Face Milling
Cutter overhangs
work on both sides

(a) conventional face milling


End Milling
Cutter diameter is less
than work width, so
a slot is cut into part

(c) end milling


Profile Milling
Form of end milling in
which the outside
periphery of a flat
part is cut

(d) profile milling


Pocket Milling
Another form of
end milling used
to mill shallow
pockets into flat
parts

(e) pocket milling


Surface Contouring
Ball-nose cutter is fed
back and forth across
the work along a
curvilinear path at close
intervals to create a
three dimensional
surface form

(f) surface contouring


Machining Centers
• Highly automated machine tool capable of
performing multiple machining operations under
CNC control in one setup with minimal human
attention
– Typical operations are milling and drilling
– Three, four, or five axes
• Other features:
– Automatic tool-changing
– Pallet shuttles
– Automatic workpart positioning
Mill-Turn Centers
• Highly automated machine tool that can perform
turning, milling, and drilling operations on a workpart
• General configuration of a turning center
• Can position a cylindrical workpart at a specified
angle so a rotating cutting tool (e.g., milling cutter)
can machine features into outside surface of part
– A conventional turning center cannot stop
workpart at a defined angular position and does
not possess rotating tool spindles
Operation of a mill-turn center: (a) example part with turned, milled, and
drilled surfaces; and (b) sequence of operations on a mill-turn center:
(1) turn second diameter,
(2) mill flat with part in programmed angular position, (3) drill hole with part
in same programmed position, and (4) cutoff
Shaping and Planing
• Similar operations
• Both use a single point cutting tool moved linearly
relative to the workpart

(a) Shaping, and (b) planing


Shaping and Planing
• A straight, flat surface is created in both operations
• Interrupted cutting
– Subjects tool to impact loading when entering work
• Low cutting speeds due to start-and-stop motion
• Usual tooling: single point high speed steel tools
Broaching
• Moves a multiple tooth cutting tool linearly relative to
work in direction of tool axis

The broaching operation


Broaching
Advantages:
• Good surface finish
• Close tolerances
• Variety of work shapes possible
Cutting tool called a broach
• Owing to complicated and often custom-shaped
geometry, tooling is expensive
Internal Broaching
• Performed on internal surface of a hole
• A starting hole must be present in the part to insert
broach at beginning of stroke

Work shapes that can be cut by internal broaching; cross-hatching


indicates the surfaces broached
Sawing
• Cuts narrow slit in work by a tool consisting of a
series of narrowly spaced teeth
• Tool called a saw blade
• Typical functions:
– Separate a workpart into two pieces
– Cut off unwanted portions of part
(a) power hacksaw –linear reciprocating motion of hacksaw blade
against work
(b) bandsaw (vertical) – linear
continuous motion of bandsaw
blade, which is in the form of
an endless flexible loop with
teeth on one edge
Basic Machining Calculations
Milling, Turning and Drilling
Feed and Feed Rate
Feed , f, can be defined as the relative lateral movement
between the tool and the workpiece during a machining
operation. It corresponds to the thickness (shape) of the chip
produced by the operation.
Basic Machining Calculations
Milling, Turning and Drilling
Feed and Feed Rate
In turning and drilling operations, it is defined
as the advancement of the cutter per revolution
of the workpiece (turning) or tool (drilling). The
typical unit is ipr (inch per revolution). In milling,
it is defined as the advancement of the cutter
per cutter tooth revolution; the unit is inch per
revolution per tooth.
Basic Machining Calculations
Milling, Turning and Drilling
Feed and Feed Rate
Feed rate V f , (sometimes f r ), is defined as the
speed of feed; the unit is ipm (inch per minute).

V f  fnN
where
n  the number of teeth in the cutter for milling; for
drilling and turning n  1 .
N  rotation speed of the cutter (drilling and milling)
or workpiece (turning) in rpm.
Basic Machining Calculations
Milling, Turning and Drilling
Cutting speed
The cutting speed, V , can be defined as the speed at which the
chips are removed from the surface of the workpiece (the
maximum linear speed between the tool and the workpiece).
The cutting speed for drilling, turning, and milling can be
determined as a function of the workpiece or the tool diameter, D
, and the rotational speed, N .
DN
V 
12
Where:
V  speed, feet per minute (fpm)
D  diameter, inches
N  rotational speed, rpm
Basic Machining Calculations
Milling, Turning and Drilling
Depth of Cut
The depth of cut is determined by the width of the
chip. For turning, it is one-half the difference
between the inner and the outer diameters of the
workpiece.
Basic Machining Calculations
Milling, Turning and Drilling
Metal-Removal Rate
The metal-removal rate (MRR) is a measurement of how fast
material is removed from a workpiece. It can be calculated by
multiplying the cross-sectional area of the chip by the speed. A
large metal-removal rate produces a short processing time,
and a low MRR yields a long processing time. However, the
MRR also affects the life of a cutter. The unit of the MRR is
usually expressed as cubic inches per minute. A different
formula is used for different processes.
For drilling, the cross section area of the chip is D 2 / 4.
Basic Machining Calculations
Milling, Turning and Drilling
Metal-Removal Rate

D 2 D 2
MRR  Vf  fN
4 4

where
D  drill diameter, inches
Vf 
feed rate, inches per minute
f  feed, inches per revolution

N  rotational speed, rpm


Basic Machining Calculations
Milling, Turning and Drilling

Metal-Removal Rate
Since
V
N
D

D 2 V DfV
MRR  f 
4 D 4
Basic Machining Calculations
Milling, Turning and Drilling

Metal-Removal Rate
For turning, the chip width is ( Do  Di ) / 2 , where Do and Di are
outer and inner workpiece diameters, respectively. The cross-
sectional area is  ( Do 2  Di 2 ) / 4. Therefore, the metal removal
rate is

 ( Do 2  Di 2 )  ( Do 2  Di 2 )
MRR  Vf  fN
4 4
V
N
 ( Do  Di ) / 2

( Do  Di )
2 2
MRR  fV
2( Do  Di )
Basic Machining Calculations
Milling, Turning and Drilling

Metal-Removal Rate
Basic Machining Calculations
Milling, Turning and Drilling

Metal-Removal Rate
For milling processes, the chip cross-sectional area is
V
MRR  a p wV f  a p wfnN N 
D
a p wn
MRR  fV
D
where a p  depth of cut, inches
w  width of cut, inches
n  number of teeth on the cutter
D  cutter diameter, inches
f  feed, inches per tooth per revolution
V  speed, inch per minute
Basic Machining Calculations
Milling, Turning and Drilling

Machining time is the total amount of time it takes to finish processing a


workpiece. Machining time is a function of work piece size, depth of cut,
feed and speed. It can be calculated by dividing the tool path length by
the feed speed. The tool path length is determined by the length of the
workpiece, over travel of the tool for clearance and the number of passes
required to clear the volume. For Drilling, one pass turning, and milling:
L  L
tm 
Where: Vf
tm = is machining time.
L = hole depth for drilling, workpiece length for turning.
∆L= clearance height. inches
Vf = feed speed, ipm
Basic Machining Calculations
Milling, Turning and Drilling
Machining Time
For multiple-pass turning, the number of passes can be
calculated as

Do  Di
np 
2a p
where n p  number of passes
Do  raw-material diameter
Di  finished-part diameter
a  depth of cut
p


x  round off x to the next integer number.
Basic Machining Calculations
Milling, Turning and Drilling
Machining Time
For milling processes,
 
h w
np 
a p D

where h  total height of material to be removed


w  workpiece width
  cutter overlapping factor = effective cutting width/tool
diameter  1.0
D cutter diameter
Basic Machining Calculations
Milling, Turning and Drilling
Example
A workpiece of 3-in. diameter is to be machined on a lathe to
2.7-in diameter. The total length of the workpiece is 10in. It is
recommended from the handbook that a feed of 0.01 ipr, a
cutting speed of 200 fpm, and a maximum depth of cut of 0.1-in.
be used. A 0.25-in. overtravel should be used for cutter
clearance. How long will it take to finish the part?
Solution
The spindle speed N is
12x 200
N  254 rpm
x3
Or 12x200
N  268.186 rpm
 (3  2.7)/2
Basic Machining Calculations
Milling, Turning and Drilling
Example

Or
V f  0.01x 254  2.54 ipm
V f  0.01x 268.186  2.682 ipm
since the required depth of cut is greater than the maximum allowable
depth of cut, multiple passes are necessary.


3  2.7
np   2 passes
2x 0.1
Basic Machining Calculations
Milling, Turning and Drilling
Example

 10  0.25 
t m  2   8.07 min
 2.54 

Or
 10  0.25 
t m  2   7.644 min
 2.682 
Numerical Control (NC)
Definition and Applications
Fundamentals of Numerical Control
Today numerically controlled devices are used in all manner of
industries. Milling machines manufacture the molds and dies for
polymer products. Flame cutting and plasma arc machines cut
shapes from large steel plates. Lasers are manipulated to cut
tiny cooling holes in gas turbine parts. Electronic components
are inserted into printed circuit boards by NC insertion
machines.
Numerical Control
Definition and Applications
Numerical Control NC is a form of programmable automation in
which the mechanical actions of a machine tool or other equipment
are controlled by a program containing coded alphanumerical data.

Numerical control NC is any machining process in which the


operations are executed automatically in sequences as specified by
the program that contains the information for the tool movements.

The alphanumerical data represent relative positions between a


workhead and a workpart as well as other instructions needed
to operate the machine.
The workhead is a cutting tool or other processing apparatus, and
the workpart is the object being processed.
Numerical Control
Definition and Applications
Applications of Numerical Control
1. Machine tool applications, such as drilling,
milling, turning, and other metal working
2. Nonmachine tool applications, such as
assembly, drafting, and inspection.

• The common operating feature of NC in all of


these applications is control of the workhead
movement relative to the workpart.
CNC TURNING
CNC MILLING
CNC LASER CUTTING
CNC PLASMA CUTTING
SAMPLE PRODUCTS
OF
CNC MANUFACTURING
AUTOMOTIVE INDUSTRY
Engine Block
AUTOMOTIVE INDUSTRY(Cont’d)

Different Products
AEROSPACE INDUSTRY
Aircraft Turbine Machined by
5-Axis CNC Milling Machine
CNC MOLD MAKING
ELECTRONIC INDUSTRY
RAPID PROTOTYPING
PRODUCTS
Basic Components of an NC System
The essential features of numerically
controlled machines have been established
for many years. They comprise a controller,
known as the machine control unit MCU,
capable of reading and interpreting a stored
program and using the instructions in this to
control a machine via actuation devices. This
arrangement is shown in the following
Figure.
Basic Components of an NC System
Basic Components of an NC System

Machine
Program
Control Unit

MCU
Computer
Processing
Equipment
(cutting tool)
Basic Components of an NC System

An NC system consists of three basic components:


(1) Program of instructions: The detailed step-by-step
commands that direct the actions of the processing
equipment. In machine tool applications, the program of
instructions is called a part program, and the person
who prepares the program is called a part programmer.
In these applications, the individual commands refer to
positions of a cutting tool relative to the worktable on
which the workpart is fixtured. Additional instructions
are usually included, such as spindle speed, feed rate,
cutting tool selection, and other functions. The program
is coded on a suitable medium for submission to the
machine control unit.
Basic Components of an NC System

(2) Machine control unit MCU: Consists of a


microcomputer and related control hardware that
stores the program of instructions and executes it by
converting each command into mechanical actions of
the processing equipment, one command at a time.
The related hardware of the MCU includes components
to interface with processing equipment and feedback
control elements. The MCU also includes one or more
reading devices for entering part programs into
memory. The MCU also includes control system
software, calculation algorithms, and translation
software to convert the NC part program into a usable
format for the MCU.
Basic Components of an NC System

NC and CNC:
Because the MCU is a computer, the term
computer numerical control CNC is used to
distinguish this type of NC from its technological
predecessors that were based entirely on a hard-
wired electronics. Today, virtually all new MCUs
are based on computer technology; hence, when
we refer to NC we mean CNC.
Basic Components of an NC System
(3) Processing equipment: Performs useful work
and accomplishes the processing steps to
transform the starting workpiece into a completed
part. Its operation is directed by the MCU, which
in turn is driven by instructions contained in the
part program.
• In the most common example of NC, machining,
the processing equipment consists of the
worktable and spindle as well as the motors
and controls to drive them.
Machine table Gear Tachometer
Position box
Controller transducer
Motor

Leadscrew
Servo
drive

Magnetics control
cabinet
Linear
ways
Bearing

Leadscrew
NC Coordinate Systems
In machine tools the cutter may typically move in multiple directions
with respect to the workpiece, or vice versa, and therefore the
controller normally drives more than one machine axis. Examples
of machine applications and numbers of axes are as follows:
1. 2-axis motion, generally in two orthogonal directions in a plane,
which applies to most lathes as well as punch presses, flame and
plasma-arc and cloth cutting machines, electronic component
insertion and some drilling machines.
2. 3-axis motion, which is generally along the three principal
directions (x, y and z) of the Cartesian coordinate system, and
applies to milling, boring, drilling and coordinate measuring
machines.
3. 4-axis motion typically involves three linear and one rotary axis, or
perhaps two x-y motions, as for example for some lathes fitted
with supplementary milling heads.
4. 5-axis machines normally involve three linear (x, y and z) axes,
with rotation about two of these, normally x and y, and are
generally milling machines.

• Most NC machine systems have less than six axes


A 3-AXIS MACHINING CENTER
5-AXIS MACHINE CONFIGURATIONS

Rotational axes Rotational axes on


on the spindle spindle and the table

Rotational axes on the table


5-AXIS MACHINE

Tool

Workpiece
HEXAPOD 6-AXIS MACHINES

Another hexapod configuration A Giddings & Lewis Hexapod


machine
NC Coordinate Systems
To program the NC processing equipment,
a standard axis system must be defined
by which the position of the workhead
relative to the workpart can be specified.
There are two axis systems used in NC,
one for flat and prismatic workparts
and the other for rotational parts. Both
axis systems are based on the
Cartesian coordinate system.
NC Coordinate Systems
Coordinate axes for flat and prismatic work
NC Coordinate Systems
Coordinate axes for flat and prismatic work
Milling Tool Coordinate System
NC Coordinate Systems
Coordinate axes for flat and prismatic work
Mill Coordinate System
NC Coordinate Systems
Coordinate axes for flat and prismatic work
Vertical Mill or Drill Vertical Coordinate System
NC Coordinate Systems
• Coordinate axes for flat and prismatic work
The axis system for flat and prismatic parts consists of three
linear axes (x, y, z) in the Cartesian coordinate system,
plus three rotational axes (a, b, c). In most machine tool
applications, the x-and y-axes are used to move and
position the worktable to which the part is attached, and
the z-axis is used to control the vertical position of the
cutting tool.
The a-, b-, and c-rotational axes specify angular positions
about the x-, y-, and z-axes, respectively.
The rotational axes can be used for:
(1) Orientation of the workpart to present different surfaces for
machining or
(2) Orientation of the tool or workhead at some angle relative
to the part.
NC Coordinate Systems
Coordinate axes for rotational work
NC Coordinate Systems
Coordinate axes for rotational work
Standard Lathe Coordinate System
NC Coordinate Systems
• Coordinate axes for rotational work
The coordinate axes for a rotational NC system
are associated with NC lathes and turning
centers. Although the work rotates, this is not
one of the controlled axes on most of these
turning machines. Consequently, the y-axis is
not used. The path of the cutting tool relative
to the rotating workpiece is defined in the x-z
plane, where the x-axis is the radial location
of the tool, and the z-axis is parallel to the
axis of rotation of the part.
Zero point and Target point
The part programmer must decide where the origin of the
coordinate axis system should be located. This decision is
usually based on programming convenience. For example,
the origin might be located at one of the corners of the part.
If the workpart is symmetrical, the zero point might be most
conveniently defined at the center of symmetry. Wherever
the location, this zero point is communicated to the
machine tool operator. At the beginning of the job, the
operator must move the cutting tool under manual control
to some target point on the worktable, where the tool can
be easily and accurately positioned. The target point has
been previously referenced to the origin of the coordinate
axis system by the part programmer. When the tool has
been accurately positioned at the target point, the operator
indicates to the MCU where the origin is located for
subsequent tool movements.
Open-loop and Closed-loop
Control Systems
• a numerical control systems require
Motors to control both position and velocity
of the machine tool.
• Each axis must be separately driven
• the control system can be implemented in
two ways
– open loop system
– close loop system
Open Loop System
• Instructions are feed to the controller
• Converted to electrical pulses or signals
• Sent to the Stepper motors
• The number of electronic pulses
determines the distance
• A frequency of the pulses determines the
speed
• Used mainly in point-to-point applications.
A Diagram of the Open Loop
System
Open Loop Control System
• Open loop control system is usually
appropriate when the following conditions
apply:
– The actions performed by the control system are
simple.
– The actuating function is very reliable
– Reaction forces opposing the actuator are small
enough to have no effect on the actuation.
Open Loops Systems
• Advantages
– Less expensive
– Less complicated
• Disadvantages
– Accuracy
– Repeatability
– Setup
Closed Loop Systems
• Main difference from an open loop system
is the inclusion of a feedback system in
the controller.
– Feedback may be analog or digital
– The feedback mechanism allows the machine
to “know” where the tool is in regards to
previous movements
Feed Back System
Fed-up With Feedback???
• Analog feedback
– Measures the variation of position and
velocity in terms of voltage levels.
• Digital feedback
– Monitor output variations in the form of
electrical pulses.
Motion Control Systems

• Some NC processes are performed at discrete


locations on the workpart (e.g., drilling and
spot welding). Others are carried out while the
workhead is moving (e.g., turning and
continuous welding). If the workhead is moving,
it may be required to follow a straight line
path or a circular or other curvilinear path.
These different types of movement are
accomplished by the motion control system.
Motion Control Systems
Features of Motion Control Systems
• Point-to-Point versus Continuous Path
Control:
Motion control systems for NC can be divided
into two types:
(1) point-to-point
(2) continuous path
Motion Control Systems
• Point-to-point systems, also called positioning
systems, move the worktable to a programmed
location without regard for the path taken to get to
that location (the path is not defined by the
programmer). Once the move has been completed,
some processing action is accomplished by the
workhead at the location, such as drilling or punching
a hole. Thus, the program consists of a series of
point locations at which operations are performed, as
depicted in the following Figure. Because this
movement from one point to the next is
nonmachining, it is made as rapid as possible.
Motion Control Systems

Point-to-point (positioning) control in NC. At each x-y position, table


movement stops to perform the hole-drilling operation.
Motion Control Systems
• Continuous path (Contouring) systems generally
refer to systems that are capable of continuous
simultaneous control of two or more axes. This
provides control of the tool trajectory relative to the
workpart. In this case, the tool performs the process
while the worktable is moving, thus enabling the
system to generate angular surfaces, two-
dimensional curves, or three-dimensional contours in
the workpart. This control mode is required in many
milling and turning operations. A simple two-
dimensional profile operation is shown in the
following figure to illustrate continuous path control.
Motion Control Systems

Continuous path (contouring) control in NC (x-y plane only). Note


that cutting tool path must be offset from the part outline by
a distance equal to its radius.
Motion Control Systems
Interpolation Methods
• One of the important aspects of contouring is
interpolation. The paths that a contouring-type
NC system is required to generate often consist
of circular arcs and other smooth nonlinear
shapes. Some of these shapes can be defined
mathematically by relatively simple geometric
formulas, whereas others cannot be
mathematically defined except by approximation.
In any case, a fundamental problem in
generating these shapes using NC equipment is
that they are continuous, whereas NC is digital.
Motion Control Systems
Interpolation Methods
• To cut along a circular path, the circle must
be divided into a series of straight line
segments that approximate the curve. The
tool is commanded to machine each line
segment in succession so that the machined
surface closely matches the desired shape. The
maximum error between the nominal
(desired) surface and the actual (machined)
surface can be controlled by the lengths of
the individual line segments, as explained in
the following figure.
Motion Control Systems
Motion Control Systems
• Approximation of a curved path in NC by a
series of straight line segments. The accuracy of
the approximation is controlled by the maximum
deviation (called the tolerance) between the
nominal (desired) curve and the straight line
segments that are machined by the NC system.
In (a) the tolerance is defined on only the inside
of the nominal curve. In (b) the tolerance is
defined on only the outside of the desired curve.
In (c) the tolerance is defined on both the inside
and outside of the desired curve.
Motion Control Systems
• A number of interpolation methods are available to
deal with the various problems encountered in
generating a smooth continuous path in contouring.
They include: (1) linear interpolation, (2) circular
interpolation, (3) helical interpolation, (4)
parabolic interpolation, and (5) cubic
interpolation.
• The interpolation module in the MCU performs the
calculations and directs the tool along the path. In
CNC systems, the interpolator is generally
accomplished by software. Linear and circular
interpolators are almost always included in modern
CNC systems.
CNC Interpolation
• Interpolation is performed either using software or
electronically
• Interpolation performs two functions
– It computes individual drive axes to move the tool along
a given path at a specified feed rate
– It generates intermediate coordinates points along a
program path.

x
VX  1
Vf
(x  y )
2 2 2

y
Vy  1
Vf
(x 2  y 2 ) 2
INTERPOLATION
Control multiple axes simultaneously to
Y
move on a line, a circle, or a curve.
Y

(10,5)
(10,5)

(3,2)
X (3,2)
X
Point-to-point control path Linear path

(10-3) 7
Vx =6 =6 = 5.5149
2
(10-3) + (5-2)
2 49+ 9
(5-2) 3
Vy =6 =6 = 2.3635
2
(10-3) + (5-2)
2 49+ 9
Motion Control Systems
Absolute versus Incremental Positioning
• Another aspect of motion control is concerned with
whether positions are defined relative to the
origin of the coordinate system or relative to the
previous location of the tool. The two cases are
called absolute positioning and incremental
positioning. In absolute positioning, the workhead
locations are always defined with respect to the
origin of the axis system. In incremental positioning,
the next workhead position is defined relative to the
present location. The difference is illustrated in the
following figure.
Motion Control Systems
Motion Control Systems
Absolute versus incremental positioning
The workhead 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; whereas in incremental
positioning, the move is specified by x=20,
y=30.
Motion Control Systems
Incremental Coordinates
Motion Control Systems
Absolute Coordinates
Information Needed by a CNC
1. Preparatory Information: units, incremental or
absolute positioning
2. Coordinates: X,Y,Z, RX,RY,RZ
3. Machining Parameters: Feed rate and spindle speed
4. Coolant Control: On/Off, Flood, Mist
5. Tool Control: Tool and tool parameters
6. Cycle Functions: Type of action required
7. Miscellaneous Control: Spindle on/off, direction of
rotation, stops for part movement

This information is conveyed to the machine through a set


of instructions arranged in a desired sequence Program.
Computer Numerical Control
• Today, NC means computer numerical control. Computer numerical control
CNC is defined as an NC system whose MCU is based on a dedicated
microcomputer rather than on a hard-wired controller.

Features of CNC
1. Storage of more than one part program
2. Various forms of program input
3. Program editing at the machine tool
4. Using programming subroutines.
5. Interpolation.
6. Positioning features for setup
7. Cutter length and size compensation
8. Acceleration and deceleration calculations
9. Communication interface
10. Diagnostics
Computer Numerical Control
The Machine Control Unit for CNC
The MCU is the hardware that distinguishes CNC from conventional
NC.

The general configuration of CNC MCU


Computer Numerical Control

The Machine Control Unit for CNC


MCU consists of the following components and subsystems:
(1) Central processing unit
(2) Memory
(3) I/O interface
(4) Controls for machine tool axes and spindle speed
(5) Sequence controls for other machine tool functions

• These subsystems are interconnected by means of a


system bus.
Computer Numerical Control

Central Processing Unit


• Manages the other components in the MCU
based on software contained in memory. The
CPU can be divided into three sections:
(1) Control section
(2) Arithmetic-logic unit
(3) Immediate access memory
Computer Numerical Control
Memory
• Consists of main memory and secondary memory.
• Main memory (Primary storage) consists of ROM (read-only
memory) and RAM (Random access memory) devices.
• Operating system software and machine interface programs
are generally stored in ROM. Numerical control part
programs are stored in RAM devices. Current programs in
RAM can be erased and replaced by new programs as jobs
are changed.
• High-capacity secondary memory (also called auxiliary
storage or secondary storage) devices are used to store
large programs and data files, which are transferred to main
memory as needed.
Computer Numerical Control
Input/Output Interface
• Provides communication between the various
components of the CNC system, other
computer systems, and the machine operator.
Computer Numerical Control
Controls for Machine Tool Axes and
Spindle Speed
• These are hardware components that
control the position and velocity (feed
rate) of each machine axis as well as the
rotational speed of the machine tool
spindle
Computer Numerical Control
Sequence Controls for other Machine Tool
Functions
• In addition to control of table position, feed
rate, and spindle speed, several additional
functions are accomplished under part
program control. These auxiliary functions are
generally ON/OFF (binary) actuations and
interlocks.
Computer Numerical Control
CNC Software
(1)Operating system software.
(2)Machine interface software.
(3)Application software.
Computer Numerical Control
Direct Numerical Control

General configuration of a DNC system. Connection to MCU is behind the tape reader.
Key: BTR=behind the tape reader, MCU=machine control unit.
Computer Numerical Control
Direct Numerical Control
• DNC involved the control of a number of machine tools by a single
(mainframe) computer through direct connection and in real time.
Instead of using a punched tape reader to enter the part program
into the MCU, the program was transmitted to the MCU directly from
the computer, one block of instructions at a time. This mode of
operation was referred to by the name behind the tape reader BTR.
The DNC computer provided instruction blocks to the machine tool
on demand; when a machine needed control commands, they were
communicated to it immediately. As each block was executed by the
machine, the next block was transmitted.
• In addition to transmitting data to the machines, the central computer
also received data back from the machines to indicate operating
performance in the shop. Thus, a central objective of DNC was to
achieve two-way communication between the machines and the
central computer.
Computer Numerical Control
Distributed Numerical Control

Two configurations of DNC: (a) switching network and (b) LAN. Key: MCU=machine
control unit, MT=machine tool.
Computer Numerical Control
Distributed Numerical Control

Two configurations of DNC: (a) switching network and (b) LAN. Key: MCU=machine
control unit, MT=machine tool.
Computer Numerical Control
Distributed Numerical Control
• Distributed NC systems can take on a variety of physical
configurations, depending on the number of machine tools included,
job complexity, security requirements, and equipment availability and
preferences.
• DNC permits complete part programs to be sent to the machine
tools, rather than one block at a time.
• The switching network is the simplest DNC system to configure. It
uses a data switching box to make a connection from the central
computer to a given CNC machine for downloading part programs or
uploading data.
• Local area networks have been used for DNC since the early
1980s. Various network structures are used in DNC systems, among
which is the centralized structure illustrated in Figure (b). In this
arrangement, the computer system is organized as hierarchy, with
the central (host) computer coordinating several satellite computers
that are each responsible for a number of CNC machines.
Computer Numerical Control
Applications of NC
Two categories:
(1) machine tool applications, and (2) non-machine tool
applications.
Machine tool applications are those usually associated with
the metalworking industry. Non-machine tool applications
comprise a diverse group of operations in other industries.

Machine Tool Applications


The most common applications of NC are in machine tool
control. Machining was the first application of NC, and it is
still one of the most important commercially.
Computer Numerical Control
Machining Operations and NC Machine Tools
• Machining is a manufacturing process in which the
geometry of the work is produced by removing excess
material. By controlling the relative motion between a cutting
tool and the workpiece, the desired geometry is created.
• There are four common types of machining operations: (a)
turning, (b) drilling, (c) milling, and (d) grinding.
• Each of the machining operations is carried out at a certain
combination of speed, feed, and depth of cut, collectively
called the cutting conditions for the operation.
Computer Numerical Control

The four common machining operations: (a) turning, (b) drilling, (c) peripheral milling,
and (c) surface grinding.
Computer Numerical Control
CNC application characteristics
• Part characteristics most suited to CNC
1. Batch production.
2. Repeat orders.
3. Complex part geometry.
4. Much metal needs to be removed from the work part.
5. Many separate machining operations on the part.
6. The part is expensive.
• NC for other metalworking processes :
• Punch press for sheet metal hole punching .
• Press for sheet metal bending.
• Welding machines: spot welding and continuous arc welding.
• Thermal cutting a machines such as laser cutting and plasma arc
cutting.
• Tube bending machines .
Computer Numerical Control

Other CNC applications


- Electrical wire wrap machines.
- Components insertion machines
- Drafting machines
- Coordinate measuring machines (CMM)
- Tape laying machines for polymer composites
- Filament winding machines for polymer
composites
Computer Numerical Control
Advantages of CNC machines
• CNC machines have many advantages over
conventional machines. Some of them are:
1. Nonproductive time is reduced.
2. Greater accuracy and repeatability.
3. Lower scrap rates.
4. Inspection requirements are reduced.
5. More complex part geometrics are possible.
6. Engineering changes can be accommodated more gracefully.
7. Simple fixtures (supporting devices) are needed.
8. Shorter manufacturing lead times
9. Reduced parts inventory.
10. Less floor space required.
11. Operator skill-level requirements are reduced
Computer Numerical Control
Disadvantages of CNC machines
1. Higher investment cost.
2. Higher maintenance effort
3. Part programming
4. Higher utilization of CNC equipment.
Engineering Analysis of CNC Positioning Systems

The NC positioning system converts the coordinate axis values


in the NC part program into relative positions of the tool and
workpart during processing. Consider the simple positioning
system shown in the following figure.

Motor and leadscrew arrangement in an NC positioning system.


Engineering Analysis of CNC Positioning Systems

• The system consists of a cutting tool and a worktable on


which a workpart is fixtured.
• The table is designed to move the part relative to the tool.
• The worktable moves linearly by means of a rotating
leadscrew, which is driven by a stepping motor or
servomotor.
• The leadscrew has a certain pitch p (in/rev, mm/rev).
Thus, the table moves a distance equal to the pitch for
each revolution.
• The velocity of the worktable, which corresponds to
the feed rate in a machining operation, is determined
by the rotational speed of the leadscrew.
Engineering Analysis of CNC Positioning Systems
Types of NC Positioning Systems
Engineering Analysis of CNC Positioning Systems
Types of NC Positioning Systems
Open-Loop System & Closed-loop System
• An open loop system operates without verifying that the actual
position achieved in the move is the same as the desired
position.
• A closed loop control system uses feedback measurements to
confirm that the final position of the worktable is the location
specified in the program.
• Open loop systems cost less than closed loop systems and are
appropriate when the force resisting the actuating motion is
minimal.
• Closed loop systems are normally specified for machines that
perform continuous path operations such as milling or turning, in
which there are significant forces resisting the forward motion of
the cutting tool.
Engineering Analysis of CNC Positioning Systems

Open-Loop Positioning Systems


An open-loop positioning system typically uses a stepping
motor to rotate the leadscrew. A stepping motor is driven by a
series of electrical pulses, which are generated by the MCU in
an NC system. Each pulse causes the motor to rotate a fraction
of one revolution, called the step angle. The possible step
angles must be consistent with the following relationship:
360
 
ns
where   step angle (degree/pulse), and ns  the number of
step angles for the motor, which must be an integer. The angle
through which the motor shaft rotates is given by
Am  n p
Engineering Analysis of CNC Positioning Systems

Open-Loop Positioning Systems


where Am  angle of motor shaft rotation (degrees), n p  number of
pulses received by the motor, and   step angle (degrees/pulse).
The motor shaft is generally connected to the leadscrew through a
gear box, which reduces the angular rotation of the leadscrew. The
angle of the leadscrew rotation must take the gear ratio into account
as follows:
n p
A
rg

where A  angle of leadscrew rotation (degrees), and rg = gear ratio,


defined as the number of turns of the motor for each single turn of the
leadscrew. That is,
Am N m
rg  
A N
Engineering Analysis of CNC Positioning Systems
Open-Loop Positioning Systems

Where N m  rotational speed of the motor (rev/min), and N 


rotational speed of the leadscrew (rev/min).

The linear movement of the worktable is given by the number of


full and partial rotations of the leadscrew multiplied by its pitch:
pA
x
360
where x  x-axis position relative to the starting position (mm,
inch), p  pitch of the leadscrew (mm/rev, in/rev), and A / 360 
number of leadscrew revolutions.
Engineering Analysis of CNC Positioning Systems
Open-Loop Positioning Systems
The number of pulses required to achieve a specified x-position
increment in a point-to-point system can be found by combining
the two preceding equations as follows:

360 xrg ns xrg


np  or
p p

where the second expression on the right-hand side is obtained


by substituting n s for 360 /  .
Engineering Analysis of CNC Positioning Systems

Open-Loop Positioning Systems


Control pulses are transmitted from the pulse generator at a certain
frequency, which drives the worktable at a corresponding velocity or feed
rate in the direction of the leadscrew axis. The rotational speed of the
leadscrew depends on the frequency of the pulse train as follows:
60 f p
N
n s rg
where N  leadscrew rotational speed (rev/min), f p  pulse train frequency
(Hz, pulses/sec), and n s = steps per revolution or pulses per revolution.
The table travel speed in the direction of leadscrew axis is determined by the
rotational speed as follows:

vt  f r  Np
Engineering Analysis of CNC Positioning Systems

Open-Loop Positioning Systems

where vt  table travel speed (mm/min, in/min), f r  table feed


rate (mm/min, in/min), N  leadscrew rotational speed (rev/min),
and p  leadscrew pitch (mm/rev, in/rev).

The required pulse train frequency to drive the table at a


specified linear travel rate can be obtained by combining the
last two equations and rearranging to solve for f p :

vt ns rg f r ns rg
fp  or
60 p 60 p
Engineering Analysis of CNC Positioning Systems

Example NC Open-Loop Positioning


The worktable of a positioning system is driven by a leadscrew
whose pitch = 6.0 mm/rev. The leadscrew is connected to the
output shaft of a stepping motor through a gearbox whose
ration is 5:1 (5 turns of the motor to one turn of the leadscrew).
The stepping motor has 48 step angles. The table must move
a distance of 250 mm from its present position at a linear
velocity = 500 mm/min. Determine (a) how many pulses are
required to move the table the specified distance and (b) the
required motor speed and pulse rate to achieve the desired
table velocity.
Engineering Analysis of CNC Positioning Systems

Example NC Open-Loop Positioning


Solution:
The leadscrew rotation angle corresponding to a distance x  250mm,

360 x 360(250)
A   15,000 o
p 6.0
With 50 step angles, each step angle is:

360
  7.5 o
48
Thus, the number of pulses to move the table 250 mm is

360 xrg Arg 15000(5)


np     10,000
p  7.5
Engineering Analysis of CNC Positioning Systems

Example NC Open-Loop Positioning


Solution:
(b) The rotational speed of the leadscrew corresponding to a table
speed of 500 mm/min can be determined as:

vt 500
N   83.333 rev/min
p 6
The motor speed:
N m  rg N  5( 83.333 )  416.667 rev/min

The applied pulse rate to drive the table is given by:


vt ns rg
500( 48 )( 5 )
fp    333.333 Hz
60 p 60( 6 )
Engineering Analysis of CNC Positioning Systems

Closed-Loop Positioning Systems


A closed-loop NC system uses servomotors and feedback
measurements to ensure that the worktable is moved to the
desired position. A common feedback sensor used for NC is
the optical encoder, shown in the following figure.
Engineering Analysis of CNC Positioning Systems

Closed-Loop Positioning Systems


An optical encoder consists of a light source and a photodetector on
either side of a disk. The disk contains slots uniformly spaced around
the outside of its face. These slots allow the light source to shine
through and energize the photodetector. The disk is connected,
either directly or through a gear box, to a rotating shaft whose
angular position and velocity are to be measured. As the shaft
rotates, the flashes are converted into an equal number of electrical
pulses. By counting the pulses and computing the frequency of the
pulse train, worktable position and velocity can be determined.
The equations that define the operation of a closed-loop NC
positioning system are similar to those for an open-loop system. In
the basic optical encoder, the angle between slots in the disk must
satisfy the following requirement: 360

ns
Engineering Analysis of CNC Positioning Systems

Closed-Loop Positioning Systems


Where   angle between slots (degrees/slot), and n s  the
number of slots in the disk (slots/rev). For a certain angular
rotation of the encoder shaft, the number of pulses sensed by
the encoder is given by:
Ae
np 

Where n p  pulse count emitted by the encoder, Ae  angle of
rotation of the encoder shaft (degrees), and  angle between
slots, which converts to degrees per pulse.
Engineering Analysis of CNC Positioning Systems
Closed-Loop Positioning Systems
The pulse count can be used to determine the linear x-axis
position of the worktable by factoring in the leadscrew pitch and
the gear reduction between the encoder shaft and the
leadscrew. Thus: pn
x
p

n s rge

Where n p and n s are defined above, p  leadscrew pitch


(mm/rev, in/rev), and rge  gear reduction between the encoder
and the leadscrew, defined as the number of turns of the
encoder shaft for each single turn of the leadscrew.
That is,
Ae N e
rge  
A N
Engineering Analysis of CNC Positioning Systems

Closed-Loop Positioning Systems


where Ae  encoder shaft angle (degrees), A  leadscrew angle
(degrees), N e  rotational speed of encoder shaft (rev/min), and N 
rotational speed of leadscrew (rev/min).
The velocity of the worktable, which is normally the feed rate in
machining operation, is obtained from the frequency of the pulse train
as follows:
60 pf p
vt  f r 
n s rge
where vt  worktable velocity (mm/min, in/min), f r  feed rate
(mm/min, in/min), f p  frequency of the pulse train emitted by the
optical encoder (Hz, pulse/sec), and the constant 60 converts
worktable velocity and feed rate from mm/sec (in/sec) to mm/min
(in/min).
Engineering Analysis of CNC Positioning Systems

Closed-Loop Positioning Systems


The pulse train generated by the encoder is compared with the
coordinate position and feed rate specified in the part program,
and the difference is used by MCU to drive a servomotor, which
in turn drives the worktable. A digital-to-analog converter
converts the digital signals used by MCU into continuous
analog current that powers the drive motor. Closed-loop NC
systems of the type described here are appropriate when a
reactionary force resists the movement of the table. Metal
cutting machine tools that perform continuous path cutting
operations, such as milling and turning, fall into this category.
Engineering Analysis of CNC Positioning Systems

Example NC Closed-Loop Positioning


An NC worktable operates by closed-loop positioning. The
system consists of a servomotor, leadscrew, and optical encoder.
The leadscrew has a pitch = 6.0 mm/rev and is coupled to the
motor shaft with a gear ratio of 5:1 (5 turns of the drive motor for
each turn of the leadscrew). The optical encoder generates 48
pulses/rev of its output shaft. The encoder output shaft is coupled
to the leadscrew with a 4:1 reduction (4 turns of the encoder
shaft for each turn of the leadscrew). The table has been
programmed to move a distance of 250 mm at a feed rate = 500
mm/min. Determine (a) how many pulses should be received by
the control system to verify that the table has moved exactly 250
mm, (b) the pulse rate of the encoder, and (c) the drive motor
speed that correspond to the specified feed rate.
Engineering Analysis of CNC Positioning Systems

Example NC Closed-Loop Positioning


Solution:
(a) xn s rge 250(48)(4)
np    8000 pulses
p 6.0
(b) The pulse rate corresponding to 500 mm/min:

fr ns rge
500(48)(4)
fp    266.667 Hz
60 p 60(6.0)
(c) Motor speed = table velocity (feed rate) divided by
leadscrew pitch, corrected for gear ratio:
rg f r5(500)
Nm    416.667 rev/min
p 6.0
Engineering Analysis of CNC Positioning Systems

Precision in NC Positioning
• For accurate machining or other processing
performed by an NC system, the positioning system
must possess a high degree of precision.
• Three measures of precision can be defined for an
NC positioning system: (1) control resolution, (2)
accuracy, and (3) repeatability.
• These terms are most readily explained by
considering a single axis of the positioning system, as
shown in the following figure.
Engineering Analysis of CNC Positioning Systems

A portion of a linear positioning system axis, with definition of


control resolution, accuracy, and repeatability.
Engineering Analysis of CNC Positioning Systems

• Control resolution refers to the control system's ability to


divide the total range of the axis movement into closely
spaced points that can be distinguished by the MCU.
• Control resolution is defined as the distance separating two
adjacent addressable points in the axis movement.
• Addressable points are locations along the axis to which the
worktable can be specifically directed to go. It is desired for
control resolution to be as small as possible.
• This depends on limitations imposed by: (1) the
electromechanical components of the positioning system
and/or (2) the number of bits used by the controller to
define the axis coordinate location.
Engineering Analysis of CNC Positioning Systems

A number of electromechanical factors affect control resolution,


including leadscrew pitch, gear ration in the drive system,
and the step angle in a stepping motor for an open-loop
system or the angle between slots in an encoder disk for a
closed-loop system. For an open-loop positioning system
driven by a stepper motor, these factors can be combined into
an expression that defines the control resolution as follows:
p
CR1 
ns rg
where CR1  control resolution of the electromechanical
components (mm, in), p  leadscrew pitch (mm/rev, in/rev), ns 
number of steps per revolution, and rg  gear ratio between the
motor shaft and the leadscrew.
Engineering Analysis of CNC Positioning Systems

A similar expression can be developed for a closed-loop


positioning system, except that the gear reduction between the
leadscrew and the encoder shaft must be included:
p
CR1 
n s rg rge
The second factor that limits control resolution is the number
of bits used by the MCU to specify the axis coordinate value.
For example, this limitation may be imposed by the bit storage
capacity of the controller. If B= the number of bits in the storage
register for the axis, then the number of control points into
which the axis range can be divided = 2B. Assuming that the
control points are separated equally within the range, then
Engineering Analysis of CNC Positioning Systems
L
CR2  B
2 1
where CR2  control resolution of the computer control system
(mm, in), and L  axis range (mm, in). The control resolution of
the positioning system is the maximum of the two values; that is,

CR  MaxCR1 ,CR2 
A desirable criterion is for CR2  CR1 ,meaning that the
electromechanical system is the limiting factor that determines
control resolution. The bit storage capacity of a modern
computer controller is sufficient to satisfy this criterion except in
unusual situations. Resolutions of 0.0025 mm (0.0001 in) are
within the current state of NC technology.
Engineering Analysis of CNC Positioning Systems

The capability of a positioning system to move the worktable to


the exact location defined by a given addressable point is limited
by mechanical errors that are due to various imperfections
in the mechanical system. These imperfections include play
between the leadscrew and the worktable, backlash in the gears,
and deflection of machine components.
We assume that the mechanical errors form an unbiased normal
statistical distribution about the control point whose mean μ = 0.
We further assume that the standard deviation of the distribution
is constant over the range of the axis under consideration. Given
these assumptions, then nearly all of the mechanical errors
(99.74%) are contained within  3 of the control point, as shown
in the previous figure for a portion of the axis range that includes
two control points.
Engineering Analysis of CNC Positioning Systems

Let us now use these definitions of control resolution and


mechanical error distribution to define accuracy and
repeatability of a positioning system. Accuracy is defined
under worst case conditions in which the desired target point
lies in the middle between two adjacent addressable points.
Since the table can only be moved to one or the other of the
addressable points, there will be an error in the final position of
the worktable. This is the maximum possible positioning error,
because if the target were closer to either one of the
addressable points, then the table would be moved to the
closer control point and the error would be smaller. It is
appropriate to define accuracy under this worst case scenario.
Engineering Analysis of CNC Positioning Systems

The accuracy of any given axis of a positioning system is the


maximum possible error that can occur between the desired
target point and the actual position taken by the system; in
equation form,
CR
Accuracy   3
2

Where CR  control resolution (mm, in), and   standard


deviation of the error distribution. Accuracies in machine tools
are generally expressed for a certain range of table travel, for
example, ±0.01 mm for 250 mm (±0.0004 in for 10 in) of table
travel.
Engineering Analysis of CNC Positioning Systems

Repeatability refers to the capability of the positioning system


to return to a given addressable point that has been previously
programmed. This capability can be measured in terms of
the location errors encountered when the system attempts
to position itself at the addressable point. Location errors
are a manifestation of the mechanical errors of the positioning
system, which follow a normal distribution, as assumed
previously. Thus, the repeatability of any given axis of a
positioning system is standard deviations of the mechanical
error distribution associated with the axis. This can be written:

Repeatability  3
The repeatability of a modern NC machine tool is around
±0.0025 mm (±0.0001 in).
Engineering Analysis of CNC Positioning Systems

Example Control Resolution, Accuracy, and Repeatability in


NC
Suppose the mechanical inaccuracies in the open-loop
positioning system discussed above are described by a normal
distribution with standard deviation   0.005 mm. The range of
the worktable axis is 1000 mm, and there are 16 bits in the
binary register used by the digital controller to store the
programmed position. Other parameters are: p  pitch 6.0
mm/rev, rg  gear ratio between motor shaft and leadscrew
5.0, and number of step angles in the stepping motor ns  48.
Determine:
(a) the control resolution, (b) the accuracy, and (c) the
repeatability for the positioning system.
Engineering Analysis of CNC Positioning Systems

Solution:
(a) Control resolution is the greater of CR1 and CR2:

p 6.0
CR1    0.025mm
ns rg 48(5.0)

1000 1000
CR2  16   0.01526mm
2  1 65,535

CR  Max0.025,0.01526  0.025mm
Engineering Analysis of CNC Positioning Systems

Solution:
(b) Accuracy

Accuracy  0.5(0.025)  3(0.005)  0.0275mm

(c) Repeatability

Repeatability  3( 0.005 )  0.015 mm


CNC Part Programming

1- Manual Part Programming (G-Code)


2- Computer Assisted Part Programming (APT)
3- Part Programming Using CAD/CAM
Manual Part Programming
(G-Code)
• Manual Part Programming is the low-level
machine language that can be understood by
the MCU.
• The format of this program language is
similar to English language format.
• The current standard for CNC programming
is based on ISO6983.
Manual Part Programming
(G-Code)
• The Manual part programming is divided
into the following parts:
1. Characters (Number and Address)
2. Words
3. Blocks
4. Main program
• Arrangement of addresses in a block
NGXYZIJKUVWABCPQRFSTMH
D.
Manual Part Programming
(G-Code)
Manual Part Programming Codes:
1.Sequence Number (N-Code)
2.Preparatory Functions (G-Codes)
3.Dimensions (X, Y, Z, … Codes)
4.Feed Rate (F-Code)
5.Spindle Speed (S-Code)
6.Tool Selection (T-Code)
7.Miscellaneous Functions (M-Code)
8.Comments.
Computer-Assisted Part Programming
• In computer-assisted part programming (APT), the
machining instructions are written in English-like
statements that are subsequently translated by the
computer into the low-level machine code that can be
interpreted and executed by the machine tool
controller.
• When using one of the part programming languages,
the two main tasks of the programmer are:
(1) Defining the geometry of the workpart.
(2) Specifying the tool path and operation
sequence.
Computer-Assisted Part Programming
APT: Automatically Programmed Tooling.
• APT is a three-dimensional NC programming
system.
• APT is not only a language; it is also the
computer program that processes the APT
statements to calculate the corresponding
cutter positions and generate the machine tool
control commands.
Computer-Assisted Part Programming
• To program in APT, the part geometry must first
be defined. Then the tool is directed to various point
locations and along surfaces of the workpart to
accomplish the required machining operations.

• The viewpoint of the programmer is that the workpiece


remains stationary, and the tool is instructed to move
relative to the part.

• To complete the program, speeds and feeds must be


specified, tools must be called, tolerances must be
given for circular interpolation, and so forth.
Computer-Assisted Part Programming

There are four basic types of statements in the APT


language:
1. Geometry statements, also called definition statements, are
used to define the geometry elements that comprise the part.
2. Motion commands are used to specify the tool path.
3. Postprocessor statements control the machine tool
operation, for example, to specify speeds and feeds, set
tolerance values for circular interpolation, and actuate other
capabilities of the machine tool.
4. Auxiliary statements, a group of miscellaneous statements
used to name the part program, insert comments in the
program and accomplish similar functions.
Computer-Assisted Part Programming

• The statements are constructed of APT vocabulary


words, symbols, and numbers, all arranged using
appropriate punctuation.
• APT vocabulary words consist of six or fewer
characters.
• Most APT statements include a slash (/) as part of the
punctuation.
• APT vocabulary words that immediately precede the
slash are called major words, whereas those that
follow the slash are called minor words.
Computer-Assisted Part Programming

Geometry Statements

SYMBOL = GEOMETRY TYPE/DESCRIPTIVE DATA

Points
P1 = POINT/20.0,40.0,60.0
P2 = POINT/INTOF,L1,L2

• Commas are used to separate the words and


numerical values in the descriptive data.
Computer-Assisted Part Programming
Geometry Statements

Lines
• A line defined in APT is considered to be infinite length in
both directions. Also, APT treats a line as a vertical plane
that is perpendicular to the x-y plane.

L3 = LINE/P3,P4
L4 = LINE/P5,PARLEL,L3
Computer-Assisted Part Programming

Geometry Statements

Circles
• In APT, a circle is considered to be a cylindrical surface that
is perpendicular to the x-y plane and extends to infinity in the
z-direction.
C1 = CIRCLE/CENTER,P1,RADIUS,25.0
C2 = CIRCLE/P4,P5,P6

Planes
• In APT, a plane extends indefinitely.
PL1 = PLANE/P1,P2,P3
PL2 = PLANE/P2,PARLEL,PL1
Computer-Assisted Part Programming
Geometry Statements

Rules for formulating APT geometry statements:


1. Coordinate data must be specified in the order x, then y,
then z.
2. Any symbols used as descriptive data must have been
previously defined.
3. A symbol can be used to define only one geometry
element.
4. Only one symbol can be used to define any given element.
Computer-Assisted Part Programming
Example Part Geometry Using APT
Computer-Assisted Part Programming
Example Part Geometry Using APT
Computer-Assisted Part Programming
Example Part Geometry Using APT
P1 = POINT/0,0,0
P2 = POINT/160.0,0,0
P3 = POINT/160.0,60.0,0
P4 = POINT/35.0,90.0,0
P5 = POINT/70.0,30.0,0
P6 = POINT/120.0,30.0,0
P7 = POINT/70.0,60.0,0
P8 = POINT/130.0,60.0,0
L1 = LINE/P1,P2
L2 = LINE/P2,P3
C1 = CIRCLE/CENTER,P8,RADIUS,30.0
L3 = LINE/P4,PARLEL,L1
L4 = LINE/P4,P1
Computer-Assisted Part Programming

Motion Commands
The format of an APT motion command is:

MOTION COMMAND/DESCRIPTIVE DATA


Example: GOTO/P1
• The statement consists of two sections
separated by a slash. The first section is the
basic command that indicates what move
the tool should make. The descriptive data
following the slash tell the tool where to go.
Computer-Assisted Part Programming
Motion Commands
• At the beginning of the sequence of motion statements, the tool
must be given a starting point. This is likely to be the target
point, the location where the operator has positioned the tool at
the start of the job. The part programmer keys into this starting
position with the following statement:
• FROM/PTARG
• Where FROM is an APT vocabulary word indicating that this is
the initial point from which all others will be referenced; and
PTARG is the symbol assigned to the starting point. Another
way to make this statement is the following:
• FROM/-20.0,-20.0,0
• The FROM statement occurs only at the start of the motion
sequence.
Computer-Assisted Part Programming
Motion Commands

Point-to-point motions

There are only two commands: GOTO and GODLTA.


• The GOTO statement instructs the tool to go to a particular point location
specified in the descriptive data.
Examples:
GOTO/P2
GOTO/25.0,40.0,0
• In the first command, P2 is the destination of the tool point. In the second
command, the tool has been instructed to go to the location whose
coordinates are x=25.0, y=40.0, and z=0.

• The GODLTA command specifies an incremental move for the tool. To


illustrate, the following statement instructs the tool to move from its present
position by a distance of 50.0mm in the x-direction, 120.0mm in the y-
direction, and 40.0mm in the z-direction:
GODLTA/50.0,120.0,40.0
Computer-Assisted Part Programming
Motion Commands

Point-to-point motions

•The GODLTA statement is useful in drilling and related


machining operations. The tool can be directed to go to a
given hole location; then the GODLTA command can be used
to drill the hole, as in the following sequence:

GOTO/P2
GODLTA/0,0,-50.0
GODLTA/0,0,50.0
Computer-Assisted Part Programming
Motion Commands
Contouring Motion Commands

• The tool's position must be continuously controlled throughout


the move. The tool is directed along two intersecting
surfaces until it reaches a third surface, as shown in the
following Figure.
• These three surfaces have specific names in APT; they are:
1.Drive surface. This surface guides the side of the cutter.
2.Part surface. This is the surface on which the bottom or nose
of the tool is guided.
3.Check surface. This is the surface that stops the forward
motion of the tool in the execution of the current command.
One might say that this surface "checks" the advance of the
tool.
Computer-Assisted Part Programming
Motion Commands

The surfaces in APT contouring motions that guide the cutting tool
Computer-Assisted Part Programming

Motion Commands
There are several ways in which the check
surface can be used. This is determined by
using any of four APT modifier words in the
descriptive data of the motion statement. The
four modifier words are TO, ON, PAST, and
TANTO.
Computer-Assisted Part Programming
Motion Commands

Use of APT modifier words in motion statements: (a) TO moves the


tool into initial contact with the check surface; (b) ON positions
the tool center on the check surface; (c) PAST moves the tool
just beyond the check surface.
Computer-Assisted Part Programming
Motion Commands
The modifier word TANTO is used when the drive
surface is tangent to a circular check surface.

Use of the APT modifier word TANTO. TANTO moves the


tool to the point of tangency between two surfaces, at
least one of which is a circular surface.
Computer-Assisted Part Programming
Motion Commands
• In writing a motion statement, the part programmer
must keep in mind the direction from which the tool
is coming in the preceding motion.
• The programmer must pretend to be riding on
the top of the tool, as if driving a car.
• After the tool reaches the check surface in the
preceding move, does the next move involve a right
turn or left turn or what? The answer to this question
is determined by one of the following six motion
words, whose interpretations are illustrated in the
following figure:
Computer-Assisted Part Programming
Motion Commands

Use of the APT motion words. The tool has moved from a previous
position to its present position. The direction of the next move
is determined by one of the APT motion words GOLFT, GORGT,
GOFWD, GOBACK, GOUP, or GODOWN.
Computer-Assisted Part Programming
Motion Commands
To begin the sequence of motion commands, the FROM
statement is used. The statement following the FROM
command defines the initial drive surface, part surface, and
check surface. With reference to the following figure, the
sequence takes the following form:
FROM/PTARG
GO/TO,PL1,TO,PL2,TO,PL3

• The symbol PTARG represents the target point where the


operator has set up the tool. The GO command instructs the
tool to move to the intersection of the drive surface (PL1), the
part surface (PL2), and the check surface (PL3). Because the
modifier word TO has been used for each of the three surfaces,
the circumference of the cutter is tangent to PL1 and PL3, and
the bottom of the cutter is on PL2. The three surfaces included
in the GO statement must be specified in the order: (1) drive
surface, (2) part surface, and (3) check surface.
Computer-Assisted Part Programming
Motion Commands

Initialization of APT contouring motion sequence.


Computer-Assisted Part Programming
Motion Commands
Note that GO/TO is not the same as the GOTO
command. GOTO is used only for PTP
motions. The GO/ command is used to
initialize a sequence of contouring motions
and may take alternatives forms such as
GO/ON,GO/TO, or GO/PAST.
Computer-Assisted Part Programming
Motion Commands
• After initialization, the tool is directed along its path by one of
the six motion command words. It is not necessary to
redefine the part surface in every motion command after it
has been initially defined as long as it remains the same in
subsequent commands. In the preceding motion command:

• GO/TO,PL1,TO,PL2,TO,PL3

• The cutter has been directed from PTARG to the intersection


of surfaces PL1, PL2, and PL3. Suppose it is now desired to
move the tool along plane PL3, with PL2 remaining as the
part surface. The following command would accomplish this
motion:

• GORGT/PL3,PAST,PL4
Computer-Assisted Part Programming
Motion Commands
Note that PL2 is not mentioned in this new
command. PL3, which was the check surface
in the preceding command is now the drive
surface in the new command. And the new
check surface is PL4. Although the part
surface may remain the same throughout the
motion sequence, the drive surface and check
surface must be redefined in each new
contouring motion command.
Computer-Assisted Part Programming

Motion Commands
The planes around the part outline can be
replaced by lines, and the APT commands can
be replaced by the following:
FROM/PTARG
GO/TO,L1,TO,PL2,TO,L3
GORGT/L3,PAST,L4
Computer-Assisted Part Programming
Example APT Contouring Motion Commands
Computer-Assisted Part Programming
Example APT Contouring Motion Commands
Computer-Assisted Part Programming
Example APT Contouring Motion
Commands
• Let us write the APT motion commands to profile
mill the outside edges of our sample workpart.
•The tool begins its motion sequence from a target
point PTARG located at x=0, y=-50mm and z=10mm.
• We also assume that "part surface" PL2 has been
defined as a plane parallel to the x-y plane and
located 25mm below the top surface of the part. The
reason for defining in this way is to ensure that the
cutter will machine the entire thickness of the part.
Computer-Assisted Part Programming
Example APT Contouring Motion
Commands
FROM/PTARG
GO/TO,L1,TO,PL2,ON,L4
GORGT/L1,PAST,L2
GOLFT/L2,TANTO,C1
GOFWD/C1,PAST,L3
GOFWD/L3,PAST,L4
GOLEFT/L4,PAST,L1
GOTO/P0
Computer-Assisted Part Programming

Postprocessor and Auxiliary Statements


A complete APT part program must include functions not
accomplished by geometry statements and motion
commands. These additional functions are implemented
by postprocessor statements and auxiliary statements.
Postprocessor statements control the operation of the
machine tool and play a supporting role in generating the
tool path. Such statements are used to define cutter
size, specify speeds and feeds, turn coolant flow ON
and OFF, and control other features of the particular
machine tool on which the machining job will be
performed. The general form of a postprocessor
statement is the following:
Computer-Assisted Part Programming
Postprocessor and Auxiliary Statements
POSTPROCCER COMMAND/DESCRIPTIVE DATA

Where the POSTPROCESSOR COMMAND is an APT major word


including the type of function or action to be accomplished, and the
descriptive data consists of APT minor words and numerical values.
In some commands, the descriptive data is omitted.
Examples:
• UNITS/MM indicates that the specified units in the program are
INCHES or MM.
• INTOL/0.02 specifies inward tolerance for circular interpolation
(OUTTOL/0.02).
• SPINDL/1000,CLW specifies spindle rotation speed in
revolutions per minute. Either CLW (clockwise) or CCLW
(counterclockwise) can be specified. (SPINDL/OFF)
Computer-Assisted Part Programming
• CUTTER/20 defines cutter diameter for tool path offset
calculation
• DELAY/30 temporarily stops the machine tool for a period
specified in seconds.
• FEDRAT/40,IPM specifies feedrate in mm/min or in/min as
specifies in UNITS statements. (FEDRAT/4,IPR)
• RAPID engage high feedrate for next moves.
• COOLNT/FLOOD turns fluid one (COOLNT/MIST)
(COOLNT/OFF)
• LOADTL/01 used with automatic tool changing.
Computer-Assisted Part Programming
Postprocessor and Auxiliary Statements
Auxiliary statements are used to identify the part program,
specify which postprocessor to use, insert remarks into the
program, and so on. Auxiliary statements have no effect on
the generation of tool path.

Examples:
• PARTNO is the first statement in an APT program, used to
identify the program; for example, PARTNO SAMPLE PART
NUMBER ONE
• REMARK is used to insert explanatory comments into the
program that are not interpreted or processed by the APT
processor.
• FINI indicates the end of an APT program.

You might also like