Unit7-CNC Machining Centres
Unit7-CNC Machining Centres
Unit7-CNC Machining Centres
The variety being demanded in view of the varying tastes of the consumer calls for
a very small batch sizes. Small batch sizes will not be able to take advantage of the mass
production techniques such as special purpose machines or transfer lines. Hence, the need
for flexible automation is felt , where you not only get the benefits of rigid automation but
are also able to vary the products manufactured thus bringing in the flexibility. Numerical
control fits the bill perfectly and we would see that manufacturing would increasingly be
dependent on numerical control in future.
Numerical control
The purpose of a machine tool is to cut away surplus material, usually metal from
the material supplied to leave a work piece of the required shape and size, produced to an
acceptable degree of accuracy and surface finish. The machine tool should possess certain
capabilities in order to fulfill these requirements. It must be
a. Able to hold the work piece and cutting tool securely.
b. Endowed the sufficient power to enable the tool to cut the work piece material at
economical rates.
c. Capable of displacing the tool and work piece relative to one another to produce the
required work piece shape. The displacements must be controlled with a degree of
precision which will ensure the desired accuracy of surface finish and size.
Formerly, the machine tool operator guided a cutting tool around a work piece by
manipulating hand wheels and dials to get a finished or somewhat finished part. In his
procedure many judgments of speeds, feeds, mathematics and sometimes even tool
configuration were his responsibility. The number of judgments the machinist had to make
usually depended on the type of stock he worked in and the kind of organization that
prevailed. If his judgment was an error, it resulted in rejects or at best parts to be reworked
or repaired in some fashion.
Decisions concerning the efficient and correct use of the machine tool then
depended on the craftsmanship, knowledge and skill of the machinist himself. It is rare that
two expert operators produced identical parts using identical procedure and identical
judgment of speeds, feeds and tooling. In fact even one craftsman may not proceed in same
manner the second time around.
. Process planners and programmers have now the responsibilities for these matters.
It must be understood that NC does not alter the capabilities of the machine tool. The
With NC the correct and most efficient use of a machine no longer rests with the operator.
Actual machine tool with a capable operator can do nothing more than it was capable of
doing before a MCU was joined to it. New metal removing principles are not involved.
Cutting speeds, feeds and tooling principles must still be adhered to. The advantage is idle time
is reduced and the actual utilization rate is mush higher (compresses into one or two years that a
conventional machine receives in ten years).
Historical Development
1947 was the year in which Numerical control was born. It began because of an urgent
need. John C Parsons of the parson’s corporation, Michigan, a manufacturer of helicopter
rotor blades could not make his templates fast enough. so he invented a way of coupling
computer equipment with a jig borer.
The US air force realized in 1949 that parts for its planes and missiles were becoming
more complex. Also the designs were constantly being improved; changes in drawings
were frequently made. Thus in their search for methods of speeding up production, an air
force study contract was awarded to the Parson’s Corporation. The servomechanisms lab of
MIT was the subcontractor.
In 1951, the MIT took over the complete job and in 1952; a prototype of NC machine was
successfully demonstrated. The term “Numerical Control” was coined at MIT. In 1955
seven companies had tape controlled machines. In 1960, there were 100 NC machines at
the machine tool shown in Chicago and a majority of them were relatively simple point to
point application.
During these years the electronics industry was busy. First miniature electronic tubes
were developed, then solid state circuitry and then modular or integrated circuits. Thus the
reliability of the controls has been greatly increased and they have become most compact
and less expensive.
Today there are several hundred sizes and varieties of machines, many options and many
varieties of control system available.
Definition:
5. Smaller batches
By the use of preset tooling and presetting techniques downtime between
batches is kept at a minimum. Large storage facilities for work in progress are not
required. Machining centers eliminate some of the setups needed for a succession of
operation on one job; time spent in waiting until each of a succession of machine is
free is also cut. The components circulate round the machine shop in a shorter
period, inter department costs are saved and ‘program chasing’ is reduced.
9. Reduced inspection.
The time spent on inspection and in waiting for inspection to begin is greatly
reduced. Normally it is necessary to inspect the first component only once the tape
is proved; the repetitive accuracy of the machine maintains a consistent product.
10. Reduced scrap
Operator error is eliminated and a proven tape results in accurate component.
Evolution of CNC:
With the availability of microprocessors in mid 70’s the controller technology has made a
tremendous progress. The new control systems are termed as computer numerical control
(CNC) which are characterized by the availability of a dedicated computer and enhanced
memory in the controller. These may also be termed “soft wired numerical control”.
There are many advantages which are derived from the use of CNC as compared to NC.
The controls with the machine tools these days are all CNC and the old NC control do not
exist any more.
DEFINITION AND FEATURES OF CNC
CNC refers to a computer that is joined to the NC machine to make the machine versatile.
Information can be stored in a memory bank. The programme is read from a storage
medium such as the punched tape and retrieved to the memory of the CNC computer. Some
CNC machines have a magnetic medium (tape or disk) for storing programs. This gives
more flexibility for editing or saving CNC programs. Figure 1 illustrates the general
configuration of CNC.
CNC
controller with keypad and display
Machine tool
Advantages of CNC
1. Increased productivity.
2. High accuracy and repeatability.
3. Reduced production costs.
4. Reduced indirect operating costs.
5. Facilitation of complex machining operations.
6. Greater flexibility.
7. Improved production planning and control.
8. Lower operator skill requirement.
9. Facilitation of flexible automation.
Limitations of CNC:
1. High initial investment.
2. High maintenance requirement.
3. Not cost-effective for low production cost.
Features of CNC
Program editing at the machine tool : CNC permits a part program to be edited
while it resides in the MCU computer memory. Hence, a part program can be tested
and corrected entirely at the machine site, rather than being returned to the
programming office for corrections. In addition to part program corrections, editing
also permits cutting conditions in the machining cycle to be optimized. After the
program has been corrected and optimized, the revised version can be stored on
punched tape or other media for future use.
Fixed cycles and programming subroutines : The increased memory capacity and
the ability to program the control computer provide the opportunity to store
frequently used machining cycles as macros, that can be called by the part program.
Instead of writing the full instructions for the particular cycle into every program, a
programmer includes a call statement in the part program to indicate that the macro
cycle should be executed. These cycles often require that certain parameters be
defined, for
example, a bolt hole circle, in which the diameter of the bolt circle, the spacing of the
bolt holes, and other parameters must be specified.
Positioning features for setup : Setting up the machine tool for a given workpart
involves installing and aligning a fixture on the machine tool table. This must be
accomplished so that the machine axes are established with respect to the workpart.
The alignment task can be facilitated using certain features made possible by
software options in the CNC system. Position set is one of the features. With
position set, the operator is not required to locate the fixture on the machine table
with extreme accuracy. Instead, the machine tool axes are referenced to the location
of the fixture using a target point or set of target points on the work or fixture.
Cutter length and size compensation : In older style controls, cutter dimensions
hade to be set precisely to agree with the tool path defined in the part program.
Alternative methods for ensuring accurate tool path definition have been
incorporated into the CNC controls. One method involves manually entering the
actual tool dimensions into the MCU. These actual dimensions may differ from
those originally programmed. Compensations are then automatically made in the
computed tool path. Another method involves use of a tool length sensor built into
the machine. In this technique, the cutter is mounted in the spindle and the sensor
measures its length. This measured value is then used to correct the programmed
tool path.
The MCU is the hardware that distinguishes CNC from conventional NC. The general
configuration of the MCU in a CNC system is illustrated in Figure 2. The MCU consists of
the following components and subsystems: (1) Central Processing Unit, (2) Memory, (3)
Input/Output Interface, (4) Controls for Machine Tool Axes and Spindle Speed, and (5)
Sequence Controls for Other Machine Tool Functions. These subsystems are
interconnected by means of a system bus, which communicates data and signals among the
components of a network.
Central Processing Unit : The central processing unit (CPU) is the brain of the MCU.
It manages the other components in the MCU based on software contained in main
memory. The CPU can be divided into three sections: (1) control section, (2)
arithmetic-logic unit, and (3) immediate access memory. The control section retrieves
commands and data from memory and generates signals to activate other components in
the MCU. In short, it sequences, coordinates, and regulates all the activities of the MCU
computer. The arithmetic-logic unit (ALU) consists of the circuitry to perform various
calculations (addition, subtraction, multiplication), counting, and logical functions
required by software residing in memory. The immediate access memory provides a
temporary storage of data being processed by the CPU. It is connected to main memory
of the system data bus.
Memory : The immediate access memory in the CPU is not intended for storing CNC
software. A much greater storage capacity is required for the various programs and data
needed to operate the CNC system. As with most other computer systems, CNC
memory can be divided into two categories: (1) primary memory, and (2) secondary
memory. Main memory (also known as 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. These programs are usually
installed by the manufacturer of the MCU. 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.
Memory Central Processing Unit (CPU) Input/output interface
ROM – Operating System Operator panel
RAM – Part Program Tape reader
System bus
Also included in the I/O interface are one or more means of entering the part program
into storage. As indicated previously, NC part programs are stored in a variety of ways.
Programs can also be entered manually by the machine operator or stored at a central
computer site and transmitted via local area network (LAN) to the CNC system.
Whichever means is employed by the plant, a suitable device must be included in the
I/O interface to allow input of the program into MCU memory.
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. The control signals generated
by MCU must be converted to a form and power level suited to the particular position
control systems used to drive the machine axes. Positioning systems can be classified as
open loop or closed loop, and different hardware components are required in each case.
Depending on the type of machine tool, the spindle is used to drive either (1) workpiece
or (2) a rotating cutter. Turning exemplifies the first case, whereas milling and drilling
exemplify the second. Spindle speed is a programmed parameter for most CNC
machine tools. Spindle speed components in the MCU usually consist of s drive control
circuit and a feedback sensor interface. The particular hardware components depend on
the type of spindle drive.
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, interlocks, and discrete numerical data. To avoid
overloading the CPU, a programmable logic controller is sometimes used to manage the
I/O interface for these auxiliary functions.
There are two main types of machine tools and the control systems required for use with
them differ because of the basic differences in the functions of the machines to be
controlled. They are known as point-to-point and contouring controls.
(1.1)Point-to-point systems
Some machine tools for example drilling, boring and tapping machines etc, require the
cutter and the work piece to be placed at a certain fixed relative positions at which they
must remain while the cutter does its work. These machines are known as point-to-point
machines as shown in figure 3 (a) and the control equipment for use with them are
known as point-to-point control equipment. Feed rates need not to be programmed. In
these machine tools, each axis is driven separately. In a point-to-point control system,
the dimensional information that must be given to the machine tool will be a series of
required position of the two slides. Servo systems can be used to move the slides and no
attempt is made to move the slide until the cutter has been retracted back.
(1.2) Contouring systems (Continuous path systems)
Other type of machine tools involves motion of work piece with respect to the cutter
while cutting operation is taking place. These machine tools include milling, routing
machines etc. and are known as contouring machines as shown in figure 3 (b), 3 (c) and
the controls required for their control are known as contouring control. Contouring
machines can also be used as point-to-point machines, but it will be uneconomical to
use them unless the work piece also requires having a contouring operation to be
performed on it. These machines require simultaneous control of axes. In contouring
machines, relative positions of the work piece and the tool should be continuously
controlled. The control system must be able to accept information regarding velocities
and positions of the machines slides. Feed rates should be programmed.
Programmed instructions are fed into the controller through an input device. These
instructions are then converted to electrical pulses (signals) by the controller and sent to the
servo amplifier to energize the servo motors. The primary drawback of the open-loop
system is that there is no feedback system to check whether the program position and
velocity has been achieved. If the system performance is affected by load, temperature,
humidity, or lubrication then the actual output could deviate from the desired output. For
these reasons the open -loop system is generally used in point-to-point systems where the
accuracy requirements are not critical. Very few continuous-path systems utilize open-loop
control.
Figure 4(a) Open loop control system Figure 4(b) Closed loop control system
The closed-loop system has a feedback subsystem to monitor the actual output and correct
any discrepancy from the programmed input. These systems use position and velocity feed
back. The feedback system could be either analog or digital. The analog systems measure
the variation of physical variables such as position and velocity in terms of voltage levels.
Digital systems monitor output variations by means of electrical pulses. To control the
dynamic behavior and the final position of the machine slides, a variety of position
transducers are employed. Majority of CNC systems operate on servo mechanism, a closed
loop principle. If a discrepancy is revealed between where the machine element should be
and where it actually is, the sensing device signals the driving unit to make an adjustment,
bringing the movable component to the required
location. Closed-loop systems are very powerful and accurate
because they are capable of monitoring operating conditions through feedback subsystems
and automatically compensating for any variations in real-time.
Figure 4 (c) Closed loop system
CNC lathes will be coming under 2 axes machines. There will be two axes along which
motion takes place. The saddle will be moving longitudinally on the bed (Z-axis) and the
cross slide moves transversely on the saddle (along X-axis). In 3-axes machines, there will
be one more axis, perpendicular to the above two axes. By the simultaneous control of all
the 3 axes, complex surfaces can be machined.
4 and 5 axes CNC machines provide multi-axis machining capabilities beyond the standard
3- axis CNC tool path movements. A 5-axis milling centre includes the three X, Y, Z axes,
the A axis which is rotary tilting of the spindle and the B-axis, which can be a rotary index
table.
Reduced cycle time by machining complex components using a single setup. In addition
to time savings, improved accuracy can also be achieved as positioning errors between
setups are eliminated.
Improved surface finish and tool life by tilting the tool to maintain optimum tool
to part contact all the times.
Improved access to under cuts and deep pockets. By tilting the tool, the tool can
be made normal to the work surface and the errors may be reduced as the major
component of cutting force will be along the tool axis.
Higher axes machining has been widely used for machining sculptures surfaces
in aerospace and automobile industry.
(4) Based on the power supply ‘Electric, Hydraulic & Pneumatic systems’
Mechanical power unit refers to a device which transforms some form of energy to
mechanical power which may be used for driving slides, saddles or gantries forming a part
of machine tool. The input power may be of electrical, hydraulic or pneumatic.
Electric motors may be used for controlling both positioning and contouring machines.
They may be either a.c. or d.c. motor and the torque and direction of rotation need to be
controlled. The speed of a d.c. motor can be controlled by varying either the field or the
armature supply. The clutch-controlled motor can either be an a.c. or d.c. motor. They are
generally used for small machine tools because of heat losses in the clutches. Split field
motors are the simplest form of motors and can be controlled in a manner according to the
machine tool. These are small and generally run at high maximum speeds and so require
reduction gears of high ratio.
Separately excited motors are used with control systems for driving the slides of large
machine tools.
These hydraulic systems may be used with positioning and contouring machine tools of all
sizes. These systems may be either in the form of rams or motors. Hydraulic motors are
smaller than electric motors of equivalent power. There are several types of hydraulic
motors. The advantage of using hydraulic motors is that they can be very small and have
considerable torque. This means that they may be incorporated in servosystems which
require having a rapid response.
CNC MACHINING CENTERS
The machining centre, developed in the late 50’s is a machine tool capable of multiple
machining operations on a work part in one setup under NC program control.
Classification
Machining centres are classified as vertical, horizontal, or universal. The designation refers
to the orientation of the machine spindle.
1. A vertical machining centre has its spindle on a vertical axis relative to the work table.
A vertical machining centre (VMC) is typically used for flat work that requires tool
access from top. E.g. mould and die cavities, Large components of aircraft
2. A horizontal machining centre (HMC) is used for cube shaped parts where tool access
can be best achieved on the sides of the cube.
3. A universal machining centre (UMC) has a work head that swivels its spindle axis to
any angle between horizontal and vertical making this a very flexible machine tool.
E.g.: Aerofoil shapes, Curvilinear geometries.
The term “Multi tasking machine” is used to include all of these machine tools that
accomplish multiple and often quite different types of operations. The processes that might
be available on a single multi tasking machine include milling, drilling, tapping, grinding
and welding. Advantage of this new class of highly versatile machine compared to more
conventional CNC machine tolls include:
Fewer steps,
Reduced part handling,
Increased accuracy and repeatability because the parts utilize the same fixture
through out their processing
Faster delivery of parts in small lot sizes.
CNC machining centers are usually designed with features to reduce non productive time.
The features are:
The tools are contained in a storage unit that is integrated with the machine tool.
When a cutter needs to be changed, the tool drum rotates to the proper position and
an automatic tool changer (ATC) operating under program control, exchanges the
tool in the spindle for the tool in the tool storage unit. Capacities of tool storage unit
commonly range from 16 to 80 cutting tools.
Automatic work part positioner:
Many horizontal and vertical machining centers have the capability to orient the
work part relative to the spindle. This is accomplished by means of a rotary table on
which work part is fixtured. The table can be oriented at any angle about a vertical
axis to permit the cutting tool to access almost the entire surface of the part in a
single setup.
Machining centers are often equipped with two (or more) separate pallets that can
be presented to the cutting tool using an automatic pallet changer. While machining
is performed with one pallet in position at the machine, the other pallet is in a safe
location away from the spindle. In this location, the operator can unload the finished
part and then fixture the raw work part for next cycle.
Machining involves an important aspect of relative movement between cutting tool and
workpiece. In machine tools this is accomplished by either moving the tool with respect to
workpiece or vice versa. In order to define relative motion of two objects, reference
directions are required to be defined. These reference directions depend on type of machine
tool and are defined by considering an imaginary coordinate system on the machine tool. A
program defining motion of tool / workpiece in this coordinate system is known as a part
program. Lathe and Milling machines are taken for case study but other machine tools like
CNC grinding, CNC hobbing, CNC filament winding machine, etc. can also be dealt with
in the same manner.
Part programming requires establishment of some reference points. Three reference points
are either set by manufacturer or user.
a) Machine Origin
The machine origin is a fixed point set by the machine tool builder. Usually it cannot be
changed. Any tool movement is measured from this point. The controller always
remembers tool distance from the machine origin.
b) Program Origin
It is also called home position of the tool. Program origin is point from where the tool
starts for its motion while executing a program and returns back at the end of the cycle.
This can be any point within the workspace of the tool which is sufficiently away from
the part. In case of CNC lathe it is a point where tool change is carried out.
c) Part Origin
The part origin can be set at any point inside the machine's electronic grid system.
Establishing the part origin is also known as zero shift, work shift, floating zero or
datum. Usually part origin needs to be defined for each new setup. Zero shifting allows
the relocation of the part. Sometimes the part accuracy is affected by the location of the
part origin. Figure 1 and 2 shows the reference points on a lathe and milling machine.
Figure 1 - Reference points and axis on a lathe
An object in space can have six degrees of freedom with respect to an imaginary Cartesian
coordinate system. Three of them are liner movements and other three are rotary.
Machining of simple part does not require all degrees of freedom. With the increase in
degrees of freedom, complexity of hardware and programming increases. Number of
degree of freedom defines axis of machine.
Axes interpolation means simultaneous movement of two or more different axes generate
required contour.
For typical lathe machine degree of freedom is 2 and so it called 2 axis machines. For
typical milling machine degree of freedom is , which means that two axes can be
interpolated at
a time and third remains independent. Typical direction for the lathe and milling machine is
as shown in figure 1 and figure 2.
In case of CNC machine tool rotation of the reference axis is not possible. Origin can set by
selecting three reference planes X, Y and Z. Planes can be set by touching tool on the
surfaces of the workpiece and setting that surfaces as X=x, Y=y and Z=z.
The programmer and the operator must use a coding system to represent information, which
the controller can interpret and execute. A frequently used coding system is the Binary-
Coded Decimal or BCD system. This system is also known as the EIA Code set because it
was developed by Electronics Industries Association. The newer coding system is ASCII
and it has become the ISO code set because of its wide acceptance.
The CNC machine uses a set of rules to enter, edit, receive and output data. These rules are
known as CNC Syntax, Programming format, or tape format. The format specifies the order
and arrangement of information entered. This is an area where controls differ widely. There
are rules for the maximum and minimum numerical values and word lengths and can be
entered, and the arrangement of the characters and word is important. The most common
CNC format is the word address format and the other two formats are fixed sequential
block address format and tab sequential format, which are obsolete. The instruction block
consists of one or more words. A word consists of an address followed by numerals. For
the address, one of the letters from A to Z is used. The address defines the meaning of the
number that follows. In other words, the address determines what the number stands for.
For example it may be an instruction to move the tool along the X axis, or to select a
particular tool.
Most controllers allow suppressing the leading zeros when entering data. This is known as
leading zero suppression. When this method is used, the machine control reads the numbers
from right to left, allowing the zeros to the left of the significant digit to be omitted. Some
controls allow entering data without using the trailing zeros. Consequently it is called
trailing zero suppression. The machine control reads from left to right, and zeros to the
right of the significant digit may be omitted.
3) Types of CNC codes
The term "preparatory" in NC means that it "prepares" the control system to be ready for
implementing the information that follows in the next block of instructions. A preparatory
function is designated in a program by the word address G followed by two digits.
Preparatory functions are also called G-codes and they specify the control mode of the
operation.
Miscellaneous functions use the address letter M followed by two digits. They perform a
group of instructions such as coolant on/off, spindle on/off, tool change, program stop, or
program end. They are often referred to as machine functions or M-functions. Some of the
M codes are given below.
In principle, all codes are either modal or non-modal. Modal code stays in effect until
cancelled by another code in the same group. The control remembers modal codes. This
gives the programmer an opportunity to save programming time. Non-modal code stays in
effect only for the block in which it is programmed. Afterwards, its function is turned off
automatically. For instance G04 is a non-modal code to program a dwell. After one second,
which is say, the programmed dwell time in one particular case, this function is cancelled.
To perform dwell in the next blocks, this code has to be reprogrammed. The control does
not memorize the non-modal code, so it is called as one shot codes. One-shot commands
are non- modal. Commands known as "canned cycles" (a controller's internal set of
preprogrammed subroutines for generating commonly machined features such as internal
pockets and drilled holes) are non-modal and only function during the call.
On some older controllers, cutter positioning (axis) commands (e.g., G00, G01, G02, G03,
& G04) are non-modal requiring a new positioning command to be entered each time the
cutter (or axis) is moved to another location.
Command G- Function and Command
Illustration
group code Statement
Rapid traverse
G00
G00 Xx Yy Zz
Linear interpolation
G01
G01 Xx Yy Zz Ff
Circular interpolation in
counter- clockwise
direction
G03 Xx Yy Ii Jj
G03 G03 Xx Zz Ii Kk
G03 Yy Zz Jj Kk
Function and
G-
Command group Command Illustration
code Statement
Cutter
diameter
G40
compensation
cancel
Cutter
G41 diameter
Offset and compensation
compensation left
Cutter
G42 diameter
compensation
right
Command Function and Command
G-code Illustration
group Statement
Rapid traverse
G00
G00 Xx Zz
Linear interpolation
G01
G01 Xx Zz
Tool
motion
Circular Interpolation in
clock-wise direction
G02 G02 Xx Zz Ii Kk
(or)
G02 Xx Zz Rr
Circular interpolation in
counter- clockwise
G03 direction
G03 Xx Zz Ii Kk
(or)
G03 Yy Zz Rr
Illustrative Example Program
Example:
In the previous section, fundamentals of programming as well basic motion commands for
milling and turning have been discussed. This section gives an overview of G codes used
for changing the programming mode, applying transformations etc.
(Figure 4).
4.1.2 Relative programming (G91)
In incremental programming, the tool movement is measured from the last tool position.
The programmed movement is based on the change in position between two successive
points. The coordinate value is always incremented according to the preceding tool
location. The programmer enters the relative distance between current location and the next
point ( Figure 5).
4.2 Spindle control
The spindle speed is programmed by the letter 'S' followed by four digit number, such as
S1000. There are two ways to define speed :
1. Revolutions per minute (RPM
2. Constant surface speed
The spindle speed in revolutions per minute is also known as constant rpm or direct rpm.
The change in tool position does not affect the rpm commanded. It means that the spindle
RPM will remain constant until another RPM is programmed. Constant surface speed is
almost exclusively used on lathes. The RPM changes according to diameter being cut. The
smaller the diameter, the more RPM is achieved; the bigger the diameter, the less RPM is
commanded. This is changed automatically by the machine speed control unit while the
tool is changing positions. This is the reason that, this spindle speed mode is known as
diameter speed.
Tool selection is accomplished using 'T' function followed by a four digit number where,
first two digits are used to call the particular tool and last two digits are used to represent
tool offset in the program. The tool offset is used to correct the values entered in the
coordinate system preset block. This can be done quickly on the machine without actually
changing the values in the program.
Using the tool offsets, it is easy to set up the tools and to make adjustments
Cutting operations may be programmed using two basic feed rate modes:
1. Feed rate per spindle revolution
2. Feed rate per time
The feed rate per spindle revolution depends on the RPM programmed.
The programmed point on the part is the command point. It is the destination point of the
tool. The point on the tool that is used for programming is the tool reference point. These
points may or may not coincide, depending on the type of tool used and machining
operation being performed. When drilling, tapping, reaming, countersinking or boring on
the machining center, the tool is programmed to the position of the hole or bore center - this
is the command point.
When milling a contour, the tool radius center is used as the reference point on the tool
while writing the program, but the part is actually cut by the point on the cutter periphery.
This point is at 'r' distance from the tool center. This means that the programmer should
shift the tool center away from the part in order to perform the cutting by the tool cutting
edge. The
shift amount depends upon the part geometry and tool radius. This technique is known as
tool radius compensation or cutter radius compensation.
In case of machining with a single point cutting tool, the nose radius of the tool tip is
required to be accounted for, as programs are being written assuming zero nose radius. The
tool nose radius center is not only the reference point that can be used for programming
contours. On the tool there is a point known as imaginary tool tip, which is at the
intersection of the lines tangent to the tool nose radius.
Cutter compensation allows programming the geometry and not the toolpath. It also allows
adjusting the size of the part, based on the tool radius used to cut part. This is useful when
cutter of the proper diameter is not found. This is best explained in the Figure 11.
The information on the diameter of the tool, which the control system uses to calculate the
required compensation, must be input into the control unit's memory before the operation.
Tool diameter compensation is activated by the relevant preparatory functions (G codes)
as shown in Figure 12.
Compensation for tool radius can be of either right or left side compensation. This can
be determined by direction of tool motion. If you are on the tool path facing direction of
tool path and if tool is on your left and workpiece is on your right side then use G41 (left
side compensation). For, reverse use other code G42 (Right side compensation). Both
the codes are modal in nature and remain active in the program until it is cancelled by
using another code, G40.
5.2 Subroutines
Any frequently programmed order of instruction or unchanging sequences can benefit by
becoming a subprogram. Typical applications for subprogram applications in CNC
programming are :
Repetitive machining motions
Functions relating to tool change
Hole patterns
Grooves and threads
Machine warm-up routines
Pallet changing
Special functions and others
Structurally, subprograms are similar to standard programs. They use the same syntax rules.
The benefits of subroutines involve the reduction in length of program, and reduction in
program errors. There is a definition statement and subroutine call function.
Standard sub-routine
N10
N20
N30
….
N70 G22
N5 N80
N90
….
N100 G24
….
N160 G20 N5
In the above example G22 statement defines the start block of the sub-routine and G24
marks the end of the sub-routine statement. The subroutine is called by another code G20
identified by the label N5.
Parametric subroutine
..
..
G23 N18
G01 X P0 Y P1
..
..
G21 N18 P0=k10 P1=k20
In the above example G23 starts the subprogram label and starts the definition, and the
parameters P0, P1 are defined for values of x and y. The G21 statement is used to call the
subroutine and to assign the values to the parameters.
5.3 Canned Cycles
A canned cycle is a preprogrammed sequence of events / motions of tool / spindle stored in
memory of controller. Every canned cycle has a format. Canned cycle is modal in nature
and remains activated until cancelled. Canned cycles are a great resource to make manual
programming easier. Often underutilized, canned cycles save time and effort.
This cycle assumes the cutter is initially placed over the center of the pocket and at some
clearance distance (typically 0.100 inch) above the top of the pocket. Then the cycle will
take over from that point, plunging the cutter down to the "peck depth" and feeding the
cutter around the pocket in ever increasing increments until the final size is attained. The
process is repeated until the desired total depth is attained. Then the cutter is returned to the
center of the pocket at the clearance height as shown in figure 14
The overall length and width of the pocket, rather than the distance of cutter motion, are
programmed into this cycle.
For machining a circular pocket, the same syntax with code G88 is used
Common G-Words:
Common M-Words
Part programming for vertical machining centres
Example 1:
Note:
I is the X offset is defined as the distance from the beginning of the arc to the centre
of the arc in the X-direction
K is the Z offset is defined as the distance from the beginning of the arc to the
centre of the arc the Z direction
Example 2:
Note:
I is the X offset is defined as the distance from the beginning of the arc to the centre
of the arc in the X-direction
K is the Z offset is defined as the distance from the beginning of the arc to the
centre of the arc the Z direction
Program without the use of canned cycles:
APT is not 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. To program in APT, the programmer must first define the part geometry. 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 specific, tools must be called,
tolerances must be given for circular interpolation, and so forth. Thus, there are four basic
types of statements in the APT language.
1. Geometry 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 are a group of miscellaneous statements used to name the
part program, insert comments in the program, and accomplish similar functions.
These statements are constructed of APT vocabulary words, symbols, and numbers, all
arranged using appropriate punctuation. APT vocabulary words consist of six or fewer
characters. Such a restriction seems archaic today, but it must be remembered that APT was
developed in the 1950s, when computer memory technology was extremely limited. 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.
APT Geometry Statements
The geometry of the part must be defined to identify the surfaces and features that are to be
machined. Accordingly, the points, lines, and surfaces must be defined in the program prior
to specifying the motion statements. The general form of an APT geometry statements is
the following:
An APT geometry statement consists of three sections. The first is the symbol used to
identify the geometry element. A symbol can be any combination of six or fewer
alphabetical and numerical characters, at least one of which must be alphabetical. Also, the
symbol cannot be an APT vocabulary word. The second section of the APT geometry
statement is an APT major word that identifies the type of geometry element. Examples are
POINT, LINE, CIRCLE and PLANE. The third section of the APT geometry statement
provides the descriptive data that define the element precisely, completely, and uniquely.
These data may include numerical values to specify dimensional and position data,
previously defined geometry elements, and APT minor words.
Punctuation in an APT geometry statement is indicated in the preceding geometry
statements. The geometry definition is written as an equation, the symbol being equated to
the element type, followed by a slash with descriptive data to the right of the slash.
Commas are used to separate the words and numerical values in the descriptive data. There
are a variety of ways to specify geometry elements. In the following discussion, examples
of APT statements will be presented for points, lines, planes, and circles.
Points :
where the descriptive data following the slash indicate x-,y-, and z-coordinates. The
specification can be done in either inches or millimeters (metric). We use metric values in
our examples. As an alternative, a point can be defined as the intersection of two
intersecting lines, as in the following:
P1 = POINT/INTOF, L1, L2
where the APT word INTOF in the descriptive data stands for “intersection of”.
Other methods of defining points are also available. Several are illustrated in Figure 1. The
associated points are identified in the following APT statements:
P2= POINT/YLARGE, INTOF, L3,
C2 P2= POINT/XSMALL, INTOF,
L3, C2 P3= POINT/XLARGE,
INTOF, L3, C2 P3=
POINT/YSMALL, INTOF, L3, C2
P4= POINT/YLARGE, INTOF, C1,
C2 P5= POINT/YSMALL, INTOF,
C1, C2 P6= POINT/CENTER, C1
P7= POINT/C2, ATANGL, 45
Lines :
A line defined in APT is considered to be of infinite length in both directions. Also, APT
treats a line as a vertical plane that is perpendicular to the x-y plane. The easiest way to
specify a line is by two points through which it passes, as in Figure 2:
L1= LINE/P1, P2
The same line can be defined by indicating the coordinate positions of the two points by
giving their x-,y-, and z-coordinates in sequence; for example,
where PARLEL and PERPTO are APT’s way of spelling “parallel to” and “perpendicular
to”, respectively.
Figure 3 : Defining a line using a point and parallelism or perpendicularity to another line
Lines can also be defined in relation to a point and a circle, as in Figure 4, as in the
geometry statements
where the words LEFT and RIGHT are used by looking in the direction of the circle from
the point P1, and TANTO means “tangent to”.
Finally, lines can be defined using a point and the angle of the line relative to the x-axis or
some other line, as in Figure B7.5. The following statements illustrate the definitions:
Planes :
A plane can be defined by specifying three points through which the plane passes, as in the
following:
Of course, the three points must be non-collinear. A plane can also be defined as being
parallel to another plane that has been previously defined; for instance,
which states that plane PL2 passes through point P2 and is parallel to plane PL1. In APT, a
plane extends indefinitely.
Circles :
Two additional ways of defining a circle utilize previously defined points P2, P3, and P4,
or line L1 in the same figure:
Ground Rules :
Certain ground rules must be obeyed when formulating APT geometry statement. Following
are four important rules in APT:
1. Coordinate data must be specified in the order x, then y, then z, because the
2. Any symbols used as descriptive data must have been previously defined: for
example, in the statement
P1=POINT/INTOF, L1, L2
the two lines L1and L2 must have been previously defined. In setting up the list of
geometry statements, the APT programmer must be sure to define symbols before
using them in subsequent statements.
3. A symbol can be used to define only one geometry element. The same symbol
cannot be used to define two different elements. For example, the following
statements would be incorrect if they were included in the same program:
P1=POINT/20, 40, 60
P1=POINT/30, 50, 70
4. Only one symbol can be used to define any given element. For example, the
following two statements in the same part program would be incorrect:
P1=POINT/20, 40, 60
P2=POINT/20, 40, 60
Contouring motions :
Contouring commands are more complicated that PTP commands because the tool’s
position must be continuously controlled throughout the move. To exercise this control, the
tool is directed along two intersecting surfaces until it reaches a third surface, as shown in
Figure 8.
1. Drive surface : This is the surface that guides the side of the cutter. It is pictured as
a plane in our figure.
2. Part surface : This is the surface, again pictured as a plane, 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 the surface “checks” the
advance of the tool.
Example 1 : Apt programming
MACHIN/CNC1
CLPRNT
STPT=POINT/0,0
L1=LINE/50,50,100,50
L2=LINE/50,50,100,150
L3==LINE/50,50,50,150
C1=CIRCLE/100,100,RADIUS,50
P1=POINT/0,0,-20
P2=POINT/50,0,-20
P3=POINT/50,50,-20
PLN=PLANE/P1,P2,P3
CUTTER/10
SPINDL/350
FEDRAT/30
COOLNT/ON
FROM/STPT
GO/TOL1,TO,L3,TO,PLN
TLRGT,GORGT/L1,TANTO,C1
GOFWD/C1,TANTO,L2
GOFWD/L2,PAST,L3
GOLFT/L3,PAST,L1
GOTO/STPT
COOLNT/OFF
FINI
Note: GO/TO is used to initiate a sequence of contouring motions. Example: motion start
up command in contouring to position cutter against the drive surface, part surface and
check surface.
GOTO moves the cutter to only one point. E.g. GOTO/STPT
P0 = POINT/ 0, -2, 0
P1 = POINT/ 0.312, 0.312, 0
P2 = POINT/ 4, 1, 0
C1 = CIRCLE/ CENTER, P1, RADIUS,
0.312 C2 = CIRCLE/ CENTER, P2,
RADIUS, 1
L2 = LINE/ RIGHT, TANTO, C2, RIGHT, TANTO,
C1
L1 = LINE/ LEFT, TANTO, C2, LEFT, TANTO,
C1 PL1 = PLANE/ P0, P1, P2
MILL = MACRO/ DIA
L2
FROM/ P0
GO/TO, L1, TO, PL1, TO, C2 P2
P1
GOLFT/ L1, PAST, C1 C1
C2
GOFWD/ C1, PAST, L2
L1
GOFWD/ L2, PAST, C2
GOFWD/ C2, PAST, L1
GOTO/ P0
TERMAC P0
CALL MILL / DIA =
0.70 END
FINI