CNC Programming Handbook - Text
CNC Programming Handbook - Text
CNC
Programming
Handbook
Second Edition
CNC
Programming
Handbook
Second Edition
Peter Smid
Smid, Peter.
CNC programming handbook: comprehensive guide to practical CNC programming/
Peter Smid.
p. cm.
ISBN 0-8311-3158-6
1. Machine-tools— Numerical Control-Programming -Handbooks, manuals, etc.. I.
Title.
Second Edition
5 6 7 8 9 10
Dedication
To my father Frantisek and my mother Ludmila,
who taught me never to give up.
Acknowledgments
In thissecond edition of the CNC Programming Handbook, would like to express my I
thanks and appreciation to Peter Eigler for being the bottomless source of new ideas,
knowledge and inspiration - all that in more ways than one. My thanks also go to Eugene
Chishow, for his always quick thinking and his ability to point out the elusive detail or two
that might have missed otherwise. To Ed Janzen, thank for the many suggestions he of-
I I
fered and for always being able to see the bigger picture. To Greg Prentice, the President of
GLP Technologies, Inc., - and my early mentor - you will always be my very good friend.
Even after three years of improving the CNC Programming Handbook and developing the
enclosed compact disc, my wife Joan will always deserve my thanks and my gratitude. To
my son Michael and my daughter Michelle - you guys have contributed to this handbook in
more ways than you can ever imagine.
I have also made a reference to several manufacturers and software developers in the
book. It is only fair to acknowledge their names:
Mr. Smid's long time association with advanced manufacturing companies and CNC ma-
chinery vendors, as well as his affiliation with a number of Community and Technical Col-
lege industrial technology programs and machine shop skills training, have enabled him to
broaden his professional and consulting skills in the areas of CNC and CAD/CAM training,
computer applications and needs analysis, software evaluation, system benchmarking,
programming, hardware selection, software customization, and operations management.
Over the years, Mr. Smid has developed and delivered hundreds of customized educa-
tional programs to thousands of instructors and students at colleges and universities
across United States, Canada and Europe, as well as to a large number of manufacturing
companies and private sector organizations and individuals.
He has actively participated in many industrial trade shows, conferences, workshops and
various seminars, including submission of papers, delivering presentations and a number
of speaking engagements to professional organizations. He is also the author of articles
and many in-house publications on the subject of CNC and CAD/CAM. During his many
years as a professional in the CNC industrial and educational field, he has developed tens
of thousands of pages of high quality training materials.
The author welcomes comments, suggestions and other input from educators, students and industrial users.
You can e-mail him through the publisher of this handbook from the Main Menu of the enclosed CD.
You can also e-mail him from the CNC Programming Handbook page at www.industrialpress.com
TABLE OF CONTENTS
5
1 - NUMERICAL CONTROL 1 Axes and Planes 16
Point of Origin 16
Quadrants 16
DEFINITION OF NUMERICAL CONTROL . . . 1
Right Hand Coordinate System 17
NC and CNC Technology 1
MACHINE GEOMETRY 17
CONVENTIONAL AND CNC MACHINING ... 2
Axis Orientation - Milling 17
NUMERICAL CONTROL ADVANTAGES ... 2 Axis Orientation - Turning 18
Setup Time Reduction 3 Additional Axes 18
Lead Time Reduction 3
Accuracy and Repeatability 3
Contouring of Complex Shapes 3 - CONTROL SYSTEM 19
Simplified Tooling and Work Holding 3
Cutting Time and Productivity Increase 4
GENERAL DESCRIPTION 20
TYPES OF CNC MACHINE TOOLS 4 Operation Panel 20
Millsand Machining Centers 4 Screen Display and Keyboard 21
Lathes and Turning Centers 5 Handle 22
PERSONNEL FOR CNC 5 SYSTEM FEATURES 22
CNC Programmer 5 6 Parameter Settings 22
4 CNC Machine Operator 6 System Defaults 23
SAFETY RELATED TO CNC WORK 6 Memory Capacity 24
IX
8
X Table of Contents
Control System 31
PART COMPLEXITY 32
- PREPARATORY COMMANDS 47
MANUAL PROGRAMMING 32
DESCRIPTION AND PURPOSE 47
Disadvantages 32
Advantages 32 APPLICATIONS FOR MILLING 47
9
CAD/CAM AND CNC 32 APPLICATIONS FOR TURNING 49
Integration
Future of Manual Programming
33
33
G CODES IN A PROGRAM BLOCK .... 50
Modality of G-commands 50
TYPICALPROGRAMMING PROCEDURE . . . 33 Conflicting Commands in a Block 50
Word Order in a Block 51
PART DRAWING 34
34
GROUPING OF COMMANDS 51
Title Block
Dimensioning 34 Group Numbers 51
PROGRAMMING FORMATS . . 42
10 -SEQUENCE BLOCK 61
POSITION REGISTER COMMAND .... 113 TOOL LENGTH OFFSET COMMANDS ... 132
Position Register Definition 113 Distance-To-Go in Z Axis 132
Programming Format 113 TOOL LENGTH SETUP 133
Tool Position Setting 114
On-Machine Tool Length Setting 133
MACHINING CENTERS APPLICATION . . . 114 Off-Machine Tool Length Setting 134
Tool Set at Machine Zero 114 Tool Length Offset Value Register 134
Tool Set Away from Machine Zero 114
Z AXIS RELATIONSHIPS 134
Position Register in Z Axis 115
Preset Tool Length 135
Programming Example 115 20
ToolLength by Touch Off 135
LATHE APPLICATION 115 Using a Master Tool Length 136
Tool Setup 116 G43-G44 Difference 136
Three-Tool Setup Groups 116 PROGRAMMING FORMATS 137
Center Line Tools Setup 116
Tool Length Offset not Available 137
External Tools Setup 117
Internal Tool Setup 117
Tool Length Offset and G92 138
Tool Length Offset and G54-G59 139
Corner Tip Detail 117
Tool Length Offset and Multiple Tools 139
Programming Example 117
CHANGING TOOL LENGTH OFFSET. ... 140
DESCRIPTION 119
Programming Commands 119 - RAPID POSITIONING 143
Programming Format 119
Incremental Mode 120
Motion Length Calculation 120 RAPID TRAVERSE MOTION 143
Position Compensation Along the Z axis 122 GOO Command 143
Using G47 and G48 122
RAPID MOTION TOOL PATH 144
Face Milling 122
Single Axis Motion 144
Multiaxis Motion 144
Straight Angular Motion 146
18- WORK OFFSETS 123 Reverse Rapid Motion 146
Left or Right - not CW or CCW 251 High Speed Steel End Mills 276
Offset Commands 251 Solid Carbide End Mills 276
Radius of the Cutter 252 Indexable Insert End Mills 276
History of Offset Types 252 Relief Angles 276
Programming Format 253 End Mill Size 276
Address H or D ? 253 Number of Flutes 277
Geometry and Wear Offsets 254
SPEEDS AND FEEDS 277
APPLYING CUTTER RADIUS OFFSET ... 254 Coolants and Lubricants 278
Startup Methods 254 Tool Chatter 278
33
Offset Cancellation 256
STOCK REMOVAL 279
Cutter Direction Change 256
Plunge Infeed 279
HOW THE RADIUS OFFSET WORKS ... 256 In and Out Ramping 279
Look-Ahead Offset Type 257 Direction of Cut 279
Rules for Look-Ahead Cutter Radius Offset 257 Width and Depth of Cut 280
Radius of the Cutter 258
Radius Offset Interference 259
Single vs. Multiaxis Startup 260 - SLOTS AND POCKETS 281
OVERVIEW OF GENERAL RULES .... 261
PRACTICAL EXAMPLE MILLING - .... 262 OPEN AND CLOSED BOUNDARY .... 281
Part Tolerances 262 Open Boundary 281
Measured Part Size 262 Closed Boundary 281
Programmed Offsets 263 PROGRAMMING SLOTS 281
D Offset Amount - General Setting 263
Open Example
Slot 281
31Offset Adjustment 264
Closed Slot Example 283
Offset for External Cutting 264
Offset for Internal Cutting 265 POCKET MILLING 284
One Offset or Multiple Offsets? 265 General Principles 284
Preventing a Scrap 265 34
Pocket Types 285
Program Data - Nominal or Middle? 266
RECTANGULAR POCKETS 285
TOOL NOSE RADIUS OFFSET 266 Stock Amount 286
Tool Nose Tip 266 Stepover Amount 286
Radius Offset Commands 266 Length of Cut 287
Tool Tip Orientation 266 Semifinishing Motions 287
Nose Radius Offset
Effect of Tool 267 Finishing Tool Path 287
Sample Program 267 Rectangular Pocket Program Example 288
Minimum Clearance Required 268
CIRCULAR POCKETS 239
32
Change of Motion Direction 268
Minimum Cutter Diameter 289
Method of Entry 289
Linear Approach 289
- PLANE SELECTION 269
Linear and Circular Approach 290
Roughing a Circular Pocket 291
WHAT A PLANE?
IS 269
CIRCULAR POCKET CYCLES 292
MACHINING IN PLANES 269
Mathematical Planes 269
Machine Tool Planes 270 - TURNING AND BORING 293
Program Commands for Planes Definition 270
Default Control Status 271
TOOL FUNCTION -TURNING 293
STRAIGHT MOTION IN PLANES 271 T Address 293
CIRCULAR INTERPOLATION IN PLANES . . 271 LATHE OFFSETS 294
G 1 7-G 8-G 9 as Modal Commands
1 1 272 Offset Entry 294
Absence of Axis Data in a Block 272 Independent Tool Offset 294
Cutter Radius Offset in Planes 273 Tool Offset with Motion 295
PRACTICAL EXAMPLE 273 Offset Change 295
FUNCTIONS FOR GEAR RANGES .... 298 G70 Cycle Format - All Controls 320
AUTOMATIC CORNER BREAK 299 BASIC RULES FOR G70-G73 CYCLES . . . 321
Chamfering at 45 Degrees 299
G74 PECK DRILLING CYCLE
- 321
Blend Radius at 90 Degrees 301
Programming Conditions 301 G74 Cycle Format- 10T/1 1T/15T 321
Programming Example 301
G74 Cycle Format - 0T/1 0T/1 8T/20T/2 IT 321
G90- STRAIGHT CUTTING CYCLE .... 308 SIMPLE GROOVE PROGRAMMING .... 325
Cycle Format 308 PRECISION GROOVING TECHNIQUES ... 326
Straight Turning Example 309 Groove Width Selection 327
Taper Cutting Example 309 Machining Method 327
Straight and Taper Cutting Example 311 Finishing Allowances 328
G94 - FACE CUTTING CYCLE 312 Groove Tolerances 329
Groove Surface Finish 330
Cycle Format 312
1
2 Chapter 1
technology, described in this handbook under the abbrevia- ish quality are the most typical problems in conventional
tion ofNC. The letter 'C’stands for Computerized and it is ,
machining. Individual machinists may have their own time
not applicable to the hardwired system. All control systems ‘proven’ methods, different from those of their fellow col-
manufactured today are of the CNC design. Abbreviations leagues. Combination of these and other factors create a
such as C&C or C'n ‘C are not correct and reflect poorly on great amount of inconsistency.
anybody that uses them.
The machining under numerical control does away with
the majority of inconsistencies. does not require the same
CONVENTIONAL AND CNC MACHINING It
some bad moments. The results of these moments, when more powerful manual mill. Equally unreasonable are ex-
pectations of great improvements in cutting speeds and
applied to machining a part, are difficult to predict. There
feedrates over a conventional machine. If the machining
will be some differences and inconsistencies within each
and tooling conditions are the same, the cutting time will be
batch of parts. The parts will not always be exactly the
very close in both cases.
same. Maintaining dimensional tolerances and surface fin-
NUMERICAL CONTROL 3
Some of the major areas where the CNC user can and Long lead time, required to design and manufacture sev-
should expect improvement: conventional machines, can often
eral special fixtures for
be reduced by preparing a part program and the use of sim-
Setup time reduction
plified fixturing.
General productivity increase at will, but once proven, no changes are usually required
scheduling and work allocation to individual machine tools Benders, Winding and Spinning machines, etc.
can be done very accurately.
CNC machining centers and lathes dominate the number
The main reason companies often purchase CNC ma- of installations in industry. These two groups share the
chines is strictly economic - it is a serious investment. Also, market just about equally. Some industries may have a
having a competitive edge is always on the mind of every higher need for one group of machines, depending on their
plant manager. The numerical control technology offers One must remember
needs. that there are many different
excellent means to achieve a significant improvement in
kinds of lathes and equally many different kinds of ma-
the manufacturing productivity and increasing the overall chining centers. However, the programming process for a
quality of the manufactured parts. Like any means, it has to vertical machine is similar to the one for a horizontal ma-
be used wisely and knowledgeably. When more and more chine or a simple CNC mill. Even between different ma-
companies use the CNC technology, just having a CNC chine groups, there is a great amount of general applica-
machine does not offer the extra edge anymore. The com- tionsand the programming process is generally the same.
panies that get forward are those who know how to use the For example, a contour milled with an end mill has a lot in
technology efficiently and practice it to be competitive m common with a contour cut with a wire.
the global economy.
essential that users understand the fundamental principles Standard number of axes on a milling machine is three -
on which CNC technology is based. These principles take the X, Y and Z axes. The part set on a milling system is al-
many forms, for example, understanding the electronic cir- ways stationary, mounted on a moving machine table. The
cuitry, complex ladder diagrams, computer logic, metrol- cutting tool rotates, it can move up and down (or in and
ogy, machine design, machining principles and practices out), but it does not physically follow the tool path.
and many others. Each one has to be studied and mastered
by the person in charge. In this handbook, the emphasis is CNC mills - sometimes called CNC milling machines -
on the topics that relate directly to the CNC programming are usually small, simple machines, without a tool changer
and understanding the most common CNC machine tools, or other automatic features. Their power rating is often
the Machining Centers and the lathes (sometimes also quite low. In industry, they are used for toolroom work,
called the Turning Centers). The part quality consideration maintenance purposes, or small part production. They are
should be very important to every programmer and ma- usually designed for contouring, unlike CNC drills.
Lathes and Turning Centers offset adjustment and other production enhancing and time
saving devices.
Drilling machines
NUMERICAL CONTROL 5
There are two basic designs of a typical CNC machining PERSONNEL FOR CNC
center. They are the vertical and the horizontal machining
centers. The major difference between the two types is the
nature of work that can be done on them efficiently. For a
Computers and machine tools have no intelligence. They
vertical CNC machining center, the most suitable type of
cannot think, they cannot evaluate a situation in a rational
way. Only people with certain skills and knowledge can do
work are flat parts, either mounted to the fixture on the ta-
the field of numerical control, the skills are usually
that. In
ble,or held in a vise or a chuck. The work that requires ma-
in thehands of two key people - one doing the program-
chining on two or more faces in a single setup is more de-
ming, the other doing the machining. Their respective
sirable to be done on a CNC horizontal machining center.
numbers and duties typically depend on the company pref-
An good example is a pump housing and other cubic-like
erence, its size, as well as the product manufactured there.
shapes. Some multi-face machining of small parts can also
However, each position is quite distinct, although many
be done on a CNC vertical machining center equipped with
companies combine the two functions into a one, often
a rotary table.
called a CNC Programmer/Operator.
The programming process is the same for both designs,
but an additional axis (usually a B axis) is added to the hori- CMC Programmer
zontal design. This axis is either a simple positioning axis
The CNC programmer is usually the person who has the
(indexing axis) for the table, or a fully rotary axis for simul-
most responsibility in the CNC machine shop. This person
taneous contouring.
is often responsible for the success of numerical control
This handbook concentrates on the CNC vertical ma- technology in the plant. Equally, this person is held respon-
chining centers applications, with a special section dealing sible for problems related to the CNC operations. Although
with the horizontal setup and machining. The program- duties may vary, the programmer is also responsible for a
ming methods are also applicable to the small CNC mills or variety of tasks relating to the effective usage of the CNC
drilling and/or tapping machines, but the programmer has machines. In fact, this person is often accountable for the
to consider their restrictions. production and quality of all CNC operations.
Lathes and Turning Centers
Many CNC programmers are experienced machinists,
who have had a practical, hands-on experience as machine
A CNC lathe is usually a machine tool with two axes, the tool operators. They know how to read technical drawings
vertical X axis and the horizontal Z axis. The main feature and they can comprehend the engineering intent behind the
of a lathe that distinguishes it from a mill is that the part is design. This practical experience is the foundation for the
rotating about the machine center line. In addition, the cut- 'machine ’a part in an office environment. A good
ability to
ting tool is normally stationary, mounted in a sliding turret. CNC programmer must be able to visualize all the tool mo-
The cutting tool follows the contour of the programmed tionsand recognize all restricting factors that may be in-
tool path. For the CNC lathes with a milling attachment, so volved. The programmer must be able to collect, analyze,
called live tooling, the milling tool has its own motor and process and logically integrate all the collected data into a
rotates while the spindle is stationary. single, cohesive program. In simple terms, the CNC pro-
grammer must be able to decide upon the best manufactur-
The modem lathe design can be horizontal or vertical.
ing methodology in all respects.
Horizontal type is far more common than the vertical type,
but both designs have their purpose in manufacturing. Sev- In addition to the machining skills, the CNC programmer
eral different designs exist for either group. For example, a has to have an understanding of mathematical principles,
typical CNC lathe of the horizontal group can be designed mainly application of equations, solution of arcs and an-
with a flat bed or a slant bed, as a bar type, chucker type or a gles. Equally important is the knowledge of trigonometry.
universal type. Added to these combinations are many ac- Even with computerized programming, the knowledge of
cessories that make a CNC lathe an extremely flexible ma- manual programming methods is absolutely essential to the
chine tool. Typically, accessories such as a tailstock, steady thorough understanding of the computer output and the
rests or follow-up and
rests, part catchers, pullout-fingers control of this output.
even a third axis milling attachment are popular compo-
nents of the CNC lathe, fr. CNC lathe can be very versatile -
The last important quality of a truly professional CNC
programmer is his or her ability to listen to the other people
so versatile in fact, that it is often called a CNC Turning
Center. All text and program examples in this handbook
- the engineers, the CNC operators, the managers. Good
use the more traditional term CNC lathe, yet still recogniz-
listening skills are the first prerequisite to become flexible.
CNC Machine Operator panies talk about safety, conduct safety meetings, display
posters, make speeches, call experts. This mass of informa-
The CNC machine tool operator is a complementary po-
tion and instructions presented to all of us for some very
is
sition to the CNC programmer. The programmer and the
good reasons. Quite afew are based on past tragic occur-
operator may exist in a single person, as is the case in many
rences - many laws, rules and regulations have been written
small shops. Although the majority of duties performed by
as a result of inquests and mquiries into serious accidents.
a conventional machine operator has been transferred to
the CNC programmer, the CNC operator has many unique At first sight, it may seem that in CNC work, the safety is
responsibilities. In typical cases, the operator is responsible a secondary issue. There is a lot of automation, a part pro-
for the tool and machine setup, for the changing of the gram that runs over and over again, tooling that has ben
parts, often even for some in-process inspection. Many used in the past, a simple setup, etc. All this can lead to
companies expect quality control at the machine - and the complacency and false assumption that safety is taken care
operator of any machine tool, manual or computerized, is of. This is a view that can have serious consequences.
also responsible for the quality of the work done on that
machine. One of the very important responsibilities of the Safety is few points that relate to the
a large subject but a
CNC machine operator is to report findings about each pro- CNC work Every machinist should know
are important.
gram to the programmer. Even with the best knowledge, the hazards of mechanical and electrical devices. The first
skills, attitudes and intentions, the ‘final’ program can al- step towards a safe work place is with a clean work area,
ways be improved. The CNC operator, being the one who where no chips, oil spills and other debris are allowed to
is the closest to the actual machining, knows precisely what accumulate on the floor. Taking care of personal safety is
extent such improvements can be. equally important. Loose clothing, jewelry, ties, scarfs, un-
protected long hair, improper use of gloves and similar
infractions, is dangerous in machining environment. Pro-
SAFETY RELATED TO CNC WORK tection of eyes, ears, hands and feet is strongly recom-
mended.
On the wall of many companies is a safety poster with a
simple, yet powerful message: While a machine is operating, protective devices should
be in place and no moving parts should be exposed. Special
The first rule of safety is to follow all safety rules care should be taken around rotating spindles and auto-
matic tool changers. Other devices that could pose a hazard
are pallet changers, chip conveyors, high voltage areas,
The heading of this section does not indicate whether the
safety is oriented at the programming or the machining
hoists, etc. Disconnecting any interlocks or other safety
features is dangerous - and also illegal, without appropriate
The reason is that the safety is totally independent. It
level.
standson its own and it governs behavior of everybody in a skills and authorization.
machine shop and outside of it. At first sight, it may appear In programming, observation of safety rules is also im-
that safety is something related to the machining and the portant. A tool motion can be programmed in many ways.
machine operation, perhaps to the setup as well. That is Speeds and feeds have to be realistic, not just mathemati-
definitely true but hardly presents a complete picture.
cally ‘correct’. Depth of cut, width of cut, the tool charac-
teristics, all have a profound effect on overall safety.
Safety is the most important element in programming,
setup, machining, tooling, fixturing, inspection, shipping,
All these ideas are just a very short summary and a re-
and you-name-it operation within a typical machine shop minder that safety should always be taken seriously.
daily work. Safety can never be overemphasized. Com-
2 CNC MILLING
Many different types of CNC machines are used in indus- Types of Milling Machines
try, and the majority of them areCNC machining centers
Milling machines can divided into three categories:
and CNC lathes. They are followed by wire EDM, fabricat-
ing machines and machines of special designs. Although By the number of axes - two, three or more
the focus of this on the two types that domi-
handbook is
By the orientation of axes - vertical or horizontal
nate the market, many general ideas can be applied to other
CNC equipment. By the presence or absence of a tool changer
axes - and for this reason, they are called the XY machines.
7
8 Chapter 2
These simplified definitions do not really reflect reality Each machining center is described by its specifications
art in machine tool manufacturing.
of the current state of as provided by the machine tool manufacturer. The manu-
The machine tool industry is constantly changing. New and facturer lists many specifications as a quick method of
more powerful machines are designed and produced by comparison between one machine and another. It is not un-
many manufacturers worldwide, with more features. usual to find a slightly biased information in the descriptive
brochure - after all, it is a sales tool.
The majority of modern machines designed for milling
are capable of doing a multitude of machining tasks, not In the area of milling systems, three most common ma-
only the traditional milling. These machines are also capa- chine tools are available:
ble of many other metal removing operations, mainly drill-
CNC Vertical Machining Center - VMC
ing, reaming, boring, tapping, profiling, thread cutting and
many others. They may be equipped with a multi-tool mag- CNC Horizontal Machining Center - HMC
azine (also known as a carousel), a fully automatic tool
CNC Horizontal Boring Mill
changer (abbreviated as ATC) and a pallet changer (abbre-
viated as APC), a powerful computerized control unit (ab- Programming methods do not vary too much for either
breviated as CNC), and so on. Some machine models may type, except for special accessories and options. Some of
have additional features, such as adaptive control, robot in- the major differences be the orientation of machine
will
terface, automatic loading and unloading, probing system, axes, additional axis for indexing or full rotary motion, and
high speed machining features and other marvels of mod- the type of work suitable for individual models. Descrip-
ern technology. The question is - can machine tools of these tion of the most common type of a machining center - the
capabilities be classified as simple CNC milling machines? Vertical Machining Center (VMC) - presents a fairly accu-
In two words - certainly not. Milling machines that have at rate sample of describing other machines of the group.
leastsome of the advanced features built-in, have become a
new breed of machine tools - CNC Machining Centers. Vertical Machining Centers
This term is strictly CNC related - a manual machining
center is a description that does not exist. Vertical machining centers are mainly used for flat type
of work, such as plates, where the majority of machining is
Machine Axes done on only one face of the part in a single setup.
Milling machines and machining centers have at least A vertical CNC machining center can also be used with
three axes - X,Y and Z. The machines become more flexi- an optional fourth axis, usually a rotary head mounted on
ble if they have the fourth axis, usually an indexing or a ro- the main table. The rotary head can be mounted either ver-
of all axes has certain limitations. For example, a four-axis of the spindle, not the operator's. That means the view is
vertical machine has X, Y and Z axis as primary axes, plus as if looking straight down, at ninety degrees towards
an indexing table, designated as an A axis. The indexing ta- the machine table for development of the tool motion.
ble is used for positioning, but it cannot rotate simulta- Programmers always view the top of part!
neously with the motion of primary axes. That type of a TWO -
various markers located somewhere on the machine
machine is often called a 'three and a half axis’ machine. show the positive and the negative motion of the machine
By contrast, a more complex but similar machine that is axes. For programming, these markers should be ignored!
equipped with a fully rotating table, is designed as a four These indicate operating directions, not programming
axis machine. The rotary table can move simultaneously directions. As a matter of fact, typically the programming
with the cutting motion of the primary axes. This is a good directions are exactly the opposite of the markers on the
example of a true four am' machine tool. machine tool.
CNC MILLING 9
Table dimensions
780 x 400 mm 500 x 500 mm
31x16 inches 20 x 20 inches
Number of tools 20 36
AC 7. 5/5. 5 kW AC 1 1/8 kW
Spindle output
AC 10/7 HP AC 15/11 HP
30000 mm/min (XY) - 24000 mm/min (Z) 30000 mm/min (XY) - 24000 mm/min (Z)
Rapid traverse rate
1181 in/min (XY) - 945 in/min (Z) 1181 in/min (XY) - 945 in/min (Z)
6 kg 20 kg
Maximum tool weight
13 lbs 44 lbs
Horizontal Machining Centers There are many applications in this area. Common exam-
Horizontal CNC Machining Centers arc also categorized
ples are large parts, such as pump housings, gear cases,
manifolds, engine blocks and so on. Horizontal machining
as multi-tool and versatile machines, and are used lor cu-
centers always include a special indexing table and are
bical parts, where the majority of machining has to be done
typically equipped with a pallet changer and other features.
on more than one face in a single setup.
10 Chapter 2
Because of their flexibility and complexity, CNC hori- part of the way towards They both meet in the
the spindle.
zontal machining centers are priced significantly higher area of the part that could be machined using all the ma-
than vertical CNC machining centers. chine tool resources.
From the programming point of view, there are several Horizontal boring mill may be called a 3-1/2 axis CNC
unique differences, mainly relating to the Automatic Tool machine, but certainly not a 5-axis CNC machine, even if
Changer, the indexing table, and - in some cases - to the ad- the count of the axes is live. Programming procedures for
ditional accessories, for example, the pallet changer. All CNC boring mills are very similar to the horizontal and
differences are relatively minor. Writing a program for the vertical CNC machining centers.
horizontal machining centers is no different than writing a
program for vertical machining centers. Typical Specifications
or two cutting tools mounted at a time, but has more ma- REAR lathe ... a unique slant bed type
chining power.
Slant bed type is very popular for general work, because
Typical lathe work controlled by a CNC system uses ma- its design allows cutting chips to fall away from the CNC
chinesknown in industry as the CNC Turning Centers or - operator and, in case of an accident, forces the part to fall
more commonly - the CNC lathes. down into a safe area, towards the chip conveyer.
The term ‘turning center' is rather unpopular, but an ac- Between the categories of flat bed and slant type lathes,
curate overall description of a computerized lathe (a CNC frontand rear lathes, horizontal and vertical lathe designs,
lathe) that can be used for a great number of machining op- there is another variety of a lathe. This category describes
erations during a single setup. For example, in addition to CNC lathes by the number of axis, which is probably the
the standard lathe operations such as turning and boring, a simplest and most common method of lathe identification.
CNC lathe can be used for drilling, grooving, threading,
knurling and even burnishing. can also be used in differ-
It
spindle, a tailstock, a steadyrest and many other features are perpendicular to each other and represent the typical
not always associated with a conventional lathe design. two-axis lathe motions. The X axis also represents the cross
Lathes with more than four axes are also common. With travel of the cutting tool, the Z axis represents its longitudi-
constant advances in machine tool technologies, more nal motion. All varieties of cutting tools are mounted in a
CNC lathes appear on the market that are designed to do a turret (a special tool magazine) and can be external or inter-
number of operations in a single setup, many of them tradi- nal. Because of this design, the turret loaded with all cut-
tionally reserved for a mill or a machining center. ting tools moves along the X and Z axes, which means all
the vertical CNC lathe and the horizontal CNC lathe. Of ing or punching, is the Z axis.
11
12 Chapter 3
t z-
t
<- -+z+ <n
v This
Two-axis Lathe
Three-axis Lathe
The third axis has its own power source but the power rat-
ing is relatively lower when compared with the majority of
machining centers. Another limitation may be the smallest
increment of the third axis, particularly on the early three
axis lathes. Smallest increment of one degree is certainly
more useful than an increment of two or five degrees. Even
better is an increment of 0. °, 0.01 °, and commonly 0.00 0
1
on the latest models. Usually the lathes with three axes of-
fer a very fine radial increment that allows a simultaneous
rotary motion. Those with low increment values are usually
Schematic representation of a vertical CNC lathe designed with an oriented spindle slop only.
This is true for both the front and rear lathes and for lathes From the perspective of CNC part programming, the ad-
with three or more axes. The chuck face is oriented verti- ditional knowledge required a subject not difficult to
is
cally to the horizontal spindle center line for all horizontal learn. General principles of milling apply and many pro-
lathes. Vertical lathes, due to their design, are rotated by gramming features are also available, for example, fixed
90°, where the chuck face is oriented horizontally to the cycles and other shortcuts.
vertical spindle center line.
CNC TURNING 13
Not every lathe job benefits from the 4-axis machining. Tool size round
040 mm
01.57 inches
There are cases when it is more costly to run a job on a
Indexing time 0.1 second
4-axis lathe inefficiently and it may be very efficient to run
the same job on a 2-axis CNC lathe. Axis travel in X axis
222 mm
8.75 inches
A small to medium size six-axis lathe is popular CNC Spindle speed 35 - 3500 rpm
choice of screw machine shops and industries with similar
Minimum input increment
0.001 mm
.0001 inch
small parts and large volume applications.
Motorized head:
FEATURES AND SPECIFICATIONS Number of rotating tools 12
well done. It is the purpose of the brochure to make a good Tap size
M3 M16 - metric
#5 - 5/8 inches
marketing tool and attract the potential buyer.
14 Chapter 3
It is very important to understand the specifications and u Thread cutting of various forms (including taper and
features of the CNC machine tools in the shop. Many fea- circular) can be performed, depending on the control model
tures relate to the control system, many others to the ma- Dwell can use the P, U or X address (G04)
chine tool itself. In CNC programming, many important
decisions are based on one or several of these features, for Tool selection uses 4-digit identification
example number of tool stations available, maximum spin- Feedrate selection (normal) in mm/rev or in/rev
dle speed and others.
Feedrate selection (special) in m/min or in/min
The last item in understanding the overall description of a Multiple repetitive cycles for turning, boring, facing, contour
CNC lathe is the look at some control features unique to repeat, grooving, and threading are available
lathes and how they differ form a typical milling control.
Feedrate override is common from 0 to 200% in 1 0%
The subject of control features is described in more detail
increments (on some lathes only from 0 to 1 50%)
in Chapter 5.
X axis can be mirrored
At this time, some features and codes may not make
Tailstock can be programmable
much sense - they are included for reference only. Com-
mon and typical features are listed: Automatic chamfering and corner rounding
R and / K in G01 mode
I
The major step towards the basic understanding of CNC The length of each division on the scale represents the
principlesand geometrical concepts is the understanding of unit ofmeasurement a convenient and generally ac-
in
a subject known
in mathematics as the system of coordi- cepted scale. It may come as a surprise that this concept is
nates. System of coordinates is founded on a number of used every day. For example, a simple ruler used in schools
mathematical principles dating back over four hundred is based on the number scale concept, regardless of mea-
years. The most important of these principles are those that suring units. Weight scales using tons, pounds, kilograms,
can be applied to the CNC technology of today. In various grams and similar units of mass are other examples. A
publications on mathematics and geometry, these princi- simple household thermometer uses the same principle.
ples are listed under the headings like the real number sys- Other similar examples are available as well.
tem and the rectangular coordinates.
RECTANGULAR COORDINATE SYSTEM
REAL NUMBER SYSTEM
Rectangular coordinate system is a concept used to de-
The key to understanding the rectangular coordinates is fine a planar 2D point, using the XY coordinates, or a spa-
the knowledge of arithmetic, algebra and geometry. The cial 3D point, using the XYZ coordinates. It was first de-
key knowledge in this area is the knowledge of the real fined in the 17th century by a French philosopher and
number system. Within the real number system, there are mathematician Rene Descartes (1596-1650). His name is
ten available numerals (digits), 0 to 9 (zero to nine), that used as an alternative to the rectangular coordinate system,
can be used in any of the following groups: called the Cartesian Coordinate System - see Figure 4-2.
J Positive integers . . 1 , 2 ,
+3 ,
10 12943 , , +45
(with or without sign)
Fractions... 1 /8 , 3 / 16 , 9/ 32 35/64 ,
Figure 4-2
Computerized Numerical Control means control by the
numbers using a computer. All information in a drawing Rectangular coordinate system (Cartesian coordinate system
of a real number system can be expressed graphically on a matically defined on a plane (two coordinate values) or in
l l l I l l l l l l i l I I l l
be specified. In programming, point represents an exact lo-
cation. If such a location is on a plane, the point is defined
as a 2D point, along two axes. If the location is in a space,
Figure 4- the point is defined as a 3D point, along three axes.
Graphical representation of the Number Scale
15
16 Chapter 4
Point of Origin
When two number scales that intersect at right angles are
used, mathematical basis for a rectangular coordinate sys- Another term that emerged from the rectangular coordi-
tem is created. Several terms emerge from this representa- nate system is called the point of origin, or just origin. It is
tion, and all have an important role in CNC programming.
the point where the two perpendicular axes intersect. This
Their understanding is very important for further progress. point has a zero coordinate value in each axis, specified as
planar XOYO and spacial X0Y0Z0 - Figure 4-4.
Axes and Planes
Each major line of the number scale is called an axis.
This old principle, when applied to CNC programming,
means that at least two axes - two number scales - will be
used. This is the mathematical definition of an axis:
Viewing the two intersecting axes and the new plane, four
distinct be clearly identified. Each area is
areas can
bounded by two axes. These areas are called quadrants.
Mathematically defined,
Top View or a Plan View. Other planes are also used in tion from the horizontal X axis and the naming convention
CNC, but not to the same extent as in CAD/CAM work. uses Roman numbers, not Arabic numbers normally used.
COORDINATE GEOMETRY 17
A Y axis
Quadrant II - Quadrant I
X-Y+ - X+Y+
• I- -I- -t
—1-^prH i — ——
i i
i i X axis
Quadrant III
“ Quadrant IV
X-Y- " X+Y-
Figure 4-5
distance along an axis, relative to the origin - Figure 4-6. If these directions were superimposed over a human right
hand, they would correspond to the direction from the root
COORDINATE of thumb or finger towards its tip. The thumb would point
POINT LOCATION
X AXIS Y AXIS in the X direction, the index finger in the Y direction and
+ Z direction.
QUADRANT 1 + the middle finger in the
QUADRANT III
- - X0Y0Z0. This absolute method of pro-
the point of origin
gramming follows very strictly the rules of rectangular co-
QUADRANT IV + - ordinate geometry and all concepts covered in this chapter.
Figure 4-6
MACHINE GEOMETRY
Algebraic signs for a point location in plane quadrants
axis. Opposite directions are negative. nal direction, the Y axis is the saddle cross direction and
Chapter 4
18
, x+ z+
* REAR LATHE
FRONT LATHE
VERTICAL LATHE
X+
Figure 4-10
Standard orientation of planes and CNC machine tool axes zontal lathe rotated 90°. Typical axes for the horizontal and
vertical machine axes, as applied to turning, are illustrated
Ihe Z axis is the spindle direction. For horizontal machining in Figure 4-10.
centers, the terminology is changed due to the design of
these machines. The X axis is the table longitudinal direc- Additional Axes
tion, the Y axis is the column direction and the Z axis is the
indexing B axis. Typical machine axes applied to CNC ver- mally parallel to the primary X, Y
and Z axes respectively.
machines are illustrated in Figure 4-9. For a rotary or an indexing applications, the additional axes
tical
are defined as A, B and C
axes, as being rotated about the
X, Y and Z axes, again in their respective order. Positive di-
t* rection of a rotary (or an indexing) axis is the direction re-
quired to advance a right handed screw in the positive X, Y
i
Y+ or Z axis. The relationship of the primary and the second-
1 ary (or supplementary) axes is shown in Figure 4-11.
S'
Primary
— A
X+ 1 \
N. X Y Z axes
u V w Secondary
axes
ISOMETRIC VIEW Arc center
TOP VIEW 1 J K ]
vectors
Figure 4-9 Rotary
Typical machine axes of a vertical CNC machining center A B C J axes
What is more common for CNC lathes in industry, is the Arc center modifiers (sometimes called the arc center
double orientation of the XZ axes. Lathes arc distinguished vectors) are not true axes, yet they are also related to the
as front and a rear lathes. An example of a front
lathe is
primary axes XYZ. This subject will be described in the
similar to the conventional engine lathe. All the slant bed section on Circular Interpolation, in Chapter 29.
types of a lathe are of the rear kind. Identification of the
axes have often not followed mathematical principles.
5 CONTROL SYSTEM
A machine unit equipped with a computerized numerical In order to fully understand the CNC programming pro-
control system is commonly known as a CNC machine. In cess, it is important to understand not only the intricacies of
an analogy of the machine tool as the body of a CNC ma- how to machine a part, what tools to select, what speeds
chine system, the control unit is its brain ,
its nerve center. and feeds to use, how to setup the job and many other fea-
There are no levers, no knobs and no handles on a CNC tures. It is equally important to know how the computer, the
machine the way they function on conventional milling CNC unit, actually works without the need to be an expert
machines and lathes. All the machine speeds, feeds, axes in electronics or a computer scientist. Figure 5-1 shows an
motions and hundreds of other tasks are programmed by a actual Fanuc control panel.
CNC programmer and controlled by a computer that is ma-
jor part of the CNC unit. To make a program for a CNC ma-
The machine manufacturers add their own operation
panel, with all the switches and button needed to operate
chine tool means to make a program for the control system.
True, the machine tool is a major consideration as well, but
the CNC all its features. A typical operation
machine and
panel Figure 5-2. Another item required for
is illustrated in
it is the control unit that determines th e format of the pro-
the system, the handle, will be described as well.
gram, its structure and its syntax.
SELECTION KEYS
FUNCTION
MENU KEY
SOFTKEYS OPERATION
MENU KEY
SHIFT KEY \ \
CURSOR KEYS
ON /OFF BUTTONS
END-OF-BLOCK KEY
PAGE CHANGE KEYS CANCEL KEY
INPUT KEY
Figure 5-
A typical example of a Fanuc control panel - actual layout and features will vary on different models (Fanuc 16Mj
19
20 Chapter 5
GENERAL DESCRIPTION The control unit - the CNC system - contains features that
only work in it does not do
conjunction with the program,
anything useful on own. Some features can be used only
its
Even a brief look at any control unit reveals that there are
if the program itself supports them. All switches and but-
two basic components - one is the operation panel full of ,
tons and keys are used by the machine operator, to exercise
rotary switches, toggle switches and push buttons. The
control over the program execution and machining process.
other component is the display screen with a keyboard or a
keypad. The programmer who does not normally work on
Operation Panel
the CNC machine will seldom, if ever, have a reason to use
either the operation panel or the display screen. They are Depending on the type of the CNC machine, the follow-
available at the machine to the CNC machine operator, and ing table covers the most typical and common features
used for the machine setup as well as to control the activi- found on the modern operation panel. There are some small
ties of the machine. differences for the operation of a machining center and a
lathe, but As with any
both operation panels are similar.
Should the CNC programmer be ma-
interested in the
general reference book, always a good idea to double
it is
chine operation? Is it necessary for the programmer to check with the manufacturer specifications and recommen-
know and understand all functions of the control system? dations. It is common that many machines used in the shop
There is only one answer to both questions - definitely yes. have some special features.
A typical operation panel of a CNC machining center - actual layout and features will vary on different models
CONTROL SYSTEM 21
ON /OFF Power and control switch for AUTO Mode Allows automatic operations
switch the main power and the control unit
MEMORY Allows program execution from the
Starts program execution mode memory of the CNC unit
Cycle Start
or MDI command
Allows program execution from an
Emergency Stops machine activity and
all external device, such as a desktop
Stop turns off power to the control unit computer or a punched tape
Feedhold Temporarily stops motion of all axes EDIT Allows changes to be made to a
mode program stored in the CNC memory
Single Block Allows program run one block at a time
MANUAL
Allows manual operations during setup
Temporarily stops the program Mode
Optional Stop
execution (M01 required in program)
JOG Mode Selects the jog mode for setup
Ignores blocks preceded with
a forward slash ( / ) in the program RAPID Mode Selects the rapid mode for setup
Spindle Overrides the programmed spindle speed, Error Lights Red light indicating an error
Override usually within 50-120% range
Tool Change Switch allowing a manual tool change structions to the control. Existingprograms can be modi-
fied or deleted, new programs can be added. Using the key-
Switches and lights relating to setup of
board input, not only the machine axes motion can be
the machine from reference position controlled, but the spindle speed and feedrate as well.
Changing the internal parameters and evaluating various
Manual Pulse Generator (MPG).
diagnostics are more means of control, often re-
specific
used for Axis Select and Handle
stricted to service people. Keyboard and screen arc used to
Increment switches
set the program origin and to hook up to external devices,
Tailstock Tailstock and/or quill switch to manually such as a connection with another computer. There are
Switch position the tailstock many other options. Every keyboard allows the use of let-
ters, digits and symbols for data entry. Not every keyboard
Indexing Manually indexes machine table allows the use of all the alphabet letters or all available
Table Switch during setup symbols. Some control panel keys have a description of an
operation, rather than a letter, digit or symbol, for example,
Manual Data Input mode
Read and Punch keys or the Offset key.
22 Chapter 5
cated on the operation panel as well as on the handle) and the computer has to be designed by a company that has ex-
the range of increment (that is the least increment X X 1 ,
1
pertise in this type of special purpose computers. Unlike
and X100). The letter X in this case is the multiplier and many business types of computers, each CNC unit is made
stands for ‘X times'. One handle division will move the se- for a particular customer. The customer is typically the ma-
lected axis by X times the minimum increment of the active chine manufacturer, not the end user. The manufacturer
units of measurement. In Figure 5-3 and the following table specifies certain requirements that the control system has to
are the details of a typical handle. meet, requirements that reflect the uniqueness of the ma-
chines they build. The basic control does not change, but
some customized features may be added (or taken away)
for a specific machine. Once the control system is sold to
the machine manufacturer, more features are added to the
system. They mainly relate to the design and capabilities of
the machine.
Parameter Settings
#6 #5 #4 #3 #2 #1 #0
Handle
Multiplier
One handle
xxxx
D
#7
1 1 0
IS K9 0
D
one of
The Fanuc control system parameters belong to
XI 0.001 mm .0001 inch three groups, specified within an allowed range:
Units inputs
X100 0.100 mm .0100 inch
Setting values
CONTROL SYSTEM 23
Units input , for example, is used to set the increment sys- settings away from the control, in a sate place, just in case.
control
to the user and the parameter setting, whether the
will recognize 0.001 mm or .0001 inches as the least incre- Many parameters are periodically updated during pro-
ment. Another example a parameter setting that stores
is gram processing. The CNC operator is usually not aware
the maximum feedrate for each axis, the maximum
spindle going on at all. need to
There is no real
that this activity is
even if it is possible. Such a setting is wrong and can required, an authorized person should be assigned to do
cause serious damage! them - nobody else.
cation for a typical Fanuc control system (many of them are Many parameter settings stored in the control at the time
meaningful to the service technicians only): of purchase have been entered by the manufacturer as ei-
ther the only choices the most suitable choices or the most
, ,
A computer is fast and accurate but has no intelligence. Modern methods of measuring memory
People are often slow and make errors, but have one unique capacity prefer
touse bytes as the unit, rather that a length of an
obsolete
ability- they think. A
computer is just a machine that does tape. A byte is the smallest unit of storage
not assume anything, does not consider, does capacity and is
not feel - very roughly equivalent to one character in the
program.
computer does not think. A
computer does not do anything
that a human effort and ingenuity has not done during The memory capacity of the control system should be
the
design process, in form of hardware and software. large enough to store the longest CNC program expected
on a regular basis. That requires some planning before the
When the CNC machine
powered, the internal soft-
is CNC machine is purchased. For example, in three dimen-
ware sets certain existing parameters to their default condi-
sional mold work or high speed machining, the
cost of ad-
tion, designed by engineers. Not all system
parameters, ditional memory capacity may be very high. Although any
only certain parameters can have an assumed condition - a
cost a relative term, there are reliable and inexpensive
is
al-
condition that is known as the default value (condition). ternatives, well worth looking into.
which the G01 requires. Had the default setting been the To find the program length in meters ,/when the capacity
rapid motion GOO, a rapid motion would be performed, as it
is known in characters, use the following formula:
does not need programmed feedrate.
O Formula 3 :
block are processed as a single instruction. The blocks are
received by the control system in sequential order, from the
To find the number of characters in a given program, if
top down and in the order they appear in the program.
the system memory capacity is known in meters: Normally, a CNC machine is run in a continuous mode,
while the blocks are processed automatically, one after an-
. .
gle block mode, only one block of the program will be pro-
cessed each time the Cycle Start key is pressed. On the op-
C = Number of available characters
eration panel, the single block mode can be used separately
m = Memory capacity in meters
or in combination with other settings that make program
Virtually the same results can be achieved by a slightly proving faster and more accurate.
restructured formula:
Feedhold
m x 1000
Feedhold is a special push button located on the operation
2.54 panel, usually close to the Cycle Start button. When this
button is pressed during a rapid, linear or circular axes mo-
tion, immediately stop the motion. The action ap-
will
O Formula 4:
plies to
it
To find the number of characters, if the system memory for a machine setup or a first part run. Some types of mo-
capacity is known in feet, use the following formula: tion restrict the function of the feedhold or disable it alto-
gether. For example, threading or tapping modes make the
switch inoperative.
C = f x 120
Activating feedhold at the machine will not change any
other program values - it will only affect the motion. The
eg* where . .
Latest Fanuc controls show the available memory as the Emergency Stop
number of free screen display pages. This type of data is
not easy to convert as the others. Every CNC machine has at least one special mushroom
shaped push button, red in color, that is located in an acces-
In cases where the available memory capacity is too sible place on the machine. It is marked the Emergency
small to accept a large program, several techniques are Stop or E-stop. When this button is pressed, all machine ac-
available to minimize the problem, for example, the pro- tivities will cease immediately. The main power supply will
gram length reduction methods, described in Chapter 50.
be interrupted and the machine will have to be restarted.
The emergency slop switch is a mandatory safety feature
MANUAL PROGRAM INTERRUPTION on all CNC machines.
chine tool automatically and sequentially in a continuous For some machine actions, the effect of Emergency Stop
mode. Every program is a series of formatted commands
-
is not always apparent. For example, the spindle requires a
or instructions - written as individual lines of code, called certain time for deceleration to stop.
blocks. Blocks and their concepts will be described in the
following chapters. All program commands in a single
26
Chapter 5
MANUAL DATA INPUT - MDI Override switches can be used individually or together.
They are available on the control to make the work easier
for both the operator and the programmer.
A CNC machine is not always operated by the means of a The operator
program. During a part setup, the CNC operator has to do a does not need to ‘experiment’ with speeds and feeds by
number constantly editing the program and the programmer has a
of operations that require physical movements of
certain latitude in setting reasonable values for the cutting
the machine slides, rotation of spindle, tool change, etc.
feedrates and the spindle speed. The presence of the over-
There are no mechanical devices on a CNC machine. The
ride switches is not a licence to program unreasonable
handle (Manual Pulse Generator) is an electronic, not a
mechanical unit. In order to operate a CNC machine with- cutting values. The overrides are fine tuning tools only - the
out conventional mechanical devices the control system of-
program must always machining conditions of
reflect the
the work. The usage of override switches does not make
fers a feature called the Manual Data Input - or MDI.
any program changes, but gives the CNC operator the op-
The Manual Data Input enables the input of a program portunity to edit the program later to reflect the optimum
data into the system one program instruction at a time. If cutting conditions. Used properly, the override switches
too many instructions were to be input repeatedly, such as a can save a great amount oi valuable programming time as
long program, the procedure would be very inefficient. well as the setup time.at the CNC machine.
During a setup and for similar purposes, one or a few in-
structions at a time will benefit from the MDI. Rapid Motion Override
To access the MDI mode, the MDI key on the operation Rapid motions are selected in the CNC program by a pre-
panel must be selected. That opens the screen display with paratory command without a specified feedrate. If a ma-
the current status of the system. Not all, but the majority of chine is designed to move at 500 in/min (12700 mm/min)
programming codes are allowed in the MDI mode. Their in the rapid mode, never appear in the pro-
this rate will
format is CNC
identical to the format of a program in writ- gram. Instead, you motion mode by program-
call the rapid
ten form. This is one area where the CNC operator acts as a ming a special preparatory command GOO. During the pro-
CNC programmer. It is very important that the operator is
gram execution, all motions in the GOO mode wifi be at the
trained at least in the basics of CNC programming, cer- manufacturer’s fixed rate. The same program wifi run faster
tainly to the point of being able to handle the setup instruc- on a machine with high rapid motion rating then on a ma-
tions for Manual Data Input. chine with low rapid motion rating.
feedrate or the spindle speed by editing the program, but the actual reduced rates are250 in/min or 6350 mm/min at
this method is not very efficient. A
certain ‘experimenta- the 50% setting and 125 in/min or 3175 mm/min at the
tion’ may be necessary during the actual cut to find the opti- 25% setting. Each of the reduced rates is more comfortable
mum setting value. The manual override switches come to to work with during setup.
the rescue, because they can be used by trial during
operation. There are four override switches found on most
The fourth position of the switch often has
no percentage
assigned and is identified as an FI or
by a small symbol. In
control panels:
this setting, the rapid motion rate is even slower than that of
Rapid feedrate override (rapid traverse) 25% setting. Why is it not identified as 10% or 15%, forex-
(modifies the rapid motion of the machine tool) ample? The reason is simple - the control system allows a
Spindle speed override
customized selection as to what the value wifi be. It may be
a setting of between 0 and 100%. The default setting is also
(modifies the programmed spindle r/min)
the most logical - usually 10% of the maximum rapid tra-
Feedrate override (cutting feedrate) verse rate. This setting should never be higher than 25%
(modifies the programmed feedrate) and can be done only through a setting of a system parame-
Dry run mode ter. Make sure that all persons who work on such a machine
The same logic used for the application of the rapid rate The most commonly used override switch is one that
override can be used for the spindle speed override. The re- changes programmed feedrates. For the milling controls,
quired change can be established during the actual cutting the feedrate is programmed in in/min or m/min. For lathe
controrpanei. For example, if the programmed spindle The feedrate per minute on lathes is used only in cases
speed of 1000 r/min is too high or too low, it may be when the spindle is not rotating and the feedrate needs to be
changed temporarily by the switch. During the actual cut- controlled.
speed up or down when needed. A simple human oversight have the 0% percent setting and start at 10%. The maxi-
may ruin the part, the cutting tool or both. The recom- mum of 150% or 200% cutting feedrate will cut ,5x or 2x 1
mended method is to find out the optimum speed for each faster than the programmed value.
ple: x- the control panel by the Dry Run switch. only has a direct It
S„ = Optimized -or new -r/min What is the purpose of the dry run and what are its bene-
Sp = Originally programmed r/min fits? Its purpose is to test the integrity of the program before
p = Percentage of spindle override
the CNC operator cuts the first part. The benefits are
mainly in the time saved during program proving when no
Overriding the programmed spindle speed on the CNC
machining takes place. During a dry run, the part is nor-
machine should have only one purpose - to establish the
mally not mounted in the machine. If the part is mounted in
spindle speed rotation for the best cutting conditions.
28
Chapter 5
those that relate to the actual contact of the cutting tool with put by the Manual Data Input key. The operation of this
the material. function is closely tied to the machine tool design. More in-
formation on the usage can be found in the machine tool
The dry run is a very efficient setup aid to prove the over- manual. This function is very handy when a tool breaks
all of the CNC program. Once the program is
integrity during processing of long programs. It can save valuable
proven during a dry run, the CNC operator can concentrate production time, if used properly.
on the sections of the program that contain actual machin-
ing. Dry run can be used in combination with several other Auxiliary Functions Lock
features of the operation panel. .
There are three functions available to the operation of a
Make sure to disable the dry run before machining!
CNC machine that are part of the auxiliary functions' '
>
Z Axis Neglect
a program by locking all the tool motions, but there is a Once machine operator finds what values must be
the
good reason to use this feature. It gives the CNC operator changed program itself, the program must be edited
in the
the chance to test the program with virtually no chance of a to reflect these changes. Not only for the job currently
collision. worked on, but also for any repetition of the job in the fu-
ture. After all, it should be the goal of every programmer
When machine lock is enabled, only the axis motion
the
is locked. All other program functions are executed nor-
and CNC operator to run any job at one hundred percent ef-
ficiency. This efficiency is most likely reached as a com-
mally, including the tool change and spindle functions.
bined effort of the operator and the programmer. A good
This function can be used alone or in combination with
other functions in order to discover possible program er-
CNC programmer will always make the effort to reach
100% efficiency at the desk and then improve the program
rors. Probably the most typical errors are syntax errors and
even further.
the various tool offset functions.
tested with a rapid motion set to 25% or 50% of the avail- Graphic representation of the tool path on the display
able rapid rate. This relatively slow setting allows the oper- screen is one of the most important, as well as sought after,
ator to monitor the integrity of the program processing, as control options. Do not confuse this option with any type of
well as specific details. The may
include items such
details conversational programming, which also uses a graphic-
as a possibility of insufficient clearance between the tool tool path interface. In the absence of a computer assisted
and the material, checking if the Tool Path looks reason- programming (CAM), a graphic display on the control
able, and so on. panel is a major benefit. Whether in monochrome or in
color, the convenience of seeing the tool motions before ac-
The CNC operator will have a number of tasks to perform tual machining is much appreciated by CNC operators and
simultaneously. Some
of the tasks include monitoring the programmers alike.
spindle speed, feedrate, tool motions, tool changes, cool-
ant, etc. A careful and conscious approach results in build- A typical graphics option shows the machine axes and
ing the confidence in the integrity of the CNC program. It two cursors for zooming. When
the tool path is tested, indi-
may be the second or even the third part of the job when the vidual tools are distinguished by different colors, if avail-
CNC operator starts thinking of the optimization of the cut- able or different intensity. Rapid motions are represented
ting values, such as the spindle speed and the cutting fee- by a dashed motions by a continuous line
line type, cutting
drates. This optimization will truly reflect the ideal speeds type. If the graphics functionis applied during machining,
and feeds for a particular workpiece under given setup. the tool motions can be watched on the display screen -
very helpful for those CNC machines that have dirty, oily
A production supervisor should not arbitrarily criticize an and scratched safety shields.
override setting less than 100%.Many managers consider
the CNC program as an unchangeable document. They Upwards or downwards scaling of the display allows for
take the altitude that what is written is infallible - which evaluation of a tool motion overall or for detail areas. Many
is
not always true. Often, the CNC controls also include actual tool path simulation, where the
may have no
operator
other choice but to override the programmed values. What shape of the part and the cutting tool can be set first, then
is most important, is the modification of the program that seen on the screen.
reflects the optimized cutting conditions.
Chapter 5
30
Technological decisions
are the type and the size of the CNC machine, particularly
its work space or work area. Other features, equally impor-
Work sketch and calculations tant, are the machine power rating, spindle speed and
feedrate range, number of tool stations, tool changing sys-
Quality considerations in CNC programming
tem. available accessories, etc. Typically, small ma- CNC
The steps in the list are suggestions only - a guideline. chines have higher spindle speeds and lower power rating,
They are quite flexible and should always be adapted for large machines have lower spindle speeds available, but
each job and to the specific conditions of the work. their power rating is higher.
Control System
INITIAL INFORMATION
The control system is the heart of a CNC machine. Being
Most drawings define only the shape and size of the com- familiar with all the standard and optional features avail-
pleted part and normally do not specify data about the able-on all controls is a must. This knowledge allows the
initial blank material. For programming, a good knowledge use of a variety of advanced programming methods, such
of the material is an essential start - mainly in terms of its as the machining cycles, subprograms, macros and other
size, type, shape, condition, hardness, etc. The drawing and timesaving features of a modern CNC system.
material data are the primary information about the part. At
this point, CNC
program can be planned. The objective of A programmer does not have to physically run a CNC
machine. Yet, the programs will become better and more
such a plan is to use the initial information and establish the
creative with good understanding of the machine and its
most efficient method of machining, with all related con-
control system. Program development reflects program-
siderations - mainly part accuracy, productivity, safety and
convenience. mer’s knowledge of the CNC machine operation.
31
32 Chapter 6
Disadvantages
One of the main concerns in program planning should be
the operator’s perception of the program. To a large degree,
There are some disadvantages associated with manual
such a perception is quite subjective, in the sense that dif- programming. Perhaps the most common is the length of
ferent operators will express their personal preferences. On time required to actually develop a fully functioning CNC
the other hand, every operator appreciates an error-free, program. The manual calculations, verifications and other
concise, well documented and professionally prepared part
related activities in manual programming are very time
program, consistently and one after another. A poorly de- consuming. Other disadvantages, also very high on the list,
signed program is disliked by any operator, regardless of are a large percentage of errors, a lack of tool path verifica-
personal preferences. tion, the difficulty in making changes to a program, and
many others.
PART COMPLEXITY
Advantages
At the time the drawing, material and the available CNC On manual part programming does have
the positive side,
equipment are evaluated, the complexity of the program- quite a few unmatched qualities. Manual programming is
ming task becomes much clearer. How difficult is to pro- so intense that it requires the total involvement of the CNC
gram the part manually? What are the capabilities of the programmer and yet offers virtually unlimited freedom in
machines? What are the costs? Many questions have to be
the development of the program structure. Programming
answered before starting the program. manually does have some disadvantages, but it leaches a
tight discipline and organization in program development.
Simple programming jobs may be assigned to a less
It forces the programmer to understand programming tech-
experienced programmer or the CNC operator. It makes
also a niques to the last detail. In fact, many useful skills learned
sense from the management perspective and it is
in manual programming are directly applied to CAD/CAM
good way to gain experience.
programming. Programmer has to know what is happening
complex jobs will benefit from a computer-
Difficult or at all times and why it is happening. Very important is the
ized programming system. Technologies such as Computer- in-depth understanding of every detail during the program
Aided Design (CAD) and Computer Aided Manufacturing development.
(CAM) have been a strong part of the manufacturing pro-
CAD/CAM system many beliefs, a thorough knowledge of man-
Contrary to
cess for many years. The cost of a is
ual programming methods is absolutely essential lor effi-
only a fraction of what it used to be only a few years ago.
cient management of CAD/CAM programming.
Even small shops now find that the benefits offered by mo-
dern technology are too significant to be ignored. Several
programming systems are available various computers and CAD/CAM AND CNC
can handle virtually any job. For a typical machine shop, a
Windows based programming software can be very benefi- The need for improved efficiency and accuracy in CNC
cial. A typical example of this kind of application is the programming has been the major reason for development
very popular and powerful Mastercam ™, from CNC Soft- of a variety of methods that use a computer to prepare part
ware, Inc., Tolland, CT. There are several others. programs. Computer assisted CNC programming has been
around for many years. First, in the form of language based
MANUAL PROGRAMMING programming, such as APT rM or Compact II™. Since the
late '1970’s, CAD/CAM has played a significant role by
adding the visual aspect to the programming process. The
Manual programming (without a computer) has been the
acronym CAD/CAM means Computer Aided Design and
most common method of preparing a part program for
Computer Aided Manufacturing. The first three letters
many years. The latest CNC controls make manual pro- area of engineering design and drafting.
(CAD) cover the
gramming much easier than ever before by using fixed or
The second three (CAM), cover the area of comput-
letters
repetitivemachining cycles, variable type programming,
erized manufacturing, where CNC programming is only a
graphic tool motion simulation, standard mathematical in-
small part. The whole subject ofCAD/CAM covers much
put and other time saving features. In manual program-
more than just design, drafting and programming. It is a
ming, all calculations are done by hand, with the aid of a
part of modern technology also known as C1M - Computer
pocket calculator - no computer programming is used. Pro-
Integrated Manufacturing.
grammed data can be transferred to the CNC machine via a
cable, using an inexpensive desktop or a laptop computer. In the area of numerical control, computers have played a
This process is faster and more reliable than other methods. major role for a long time. Machine controls have become
Short programs can also be entered manually, by keyboard more sophisticated, incorporating the latest techniques of
entry, directly at the machine. A punched tape used to be
data processing, storage, tool path graphics, machining cy-
media of the
the popular past but has virtually disappeared cles, etc. Programs can now be prepared with the use of
from machine shops.
PROGRAM PLANNING
33
inexpensive computers, using graphical interface. Cost is the price, may handle to an absolute satisfaction. If the con-
no longer an issue, even small machine shops can afford a trol system can handle it, manual programming is the way
programming system in house. These systems are also to the ultimate control over such a project, when any other
popular because of their llexibility. A typical computerized methods may not be suitable.
programming system does not have to be dedicated only to
programming - all related tasks, often done by the pro- Even with a well customized and organized computer-
grammer, can be implemented on the same computer. For ized programming system, how can the generated program
example, cutting tool inventory management, database of output be exactly as intended? How can the CNC operator
part programs, material information sheets, setup sheets change any part of the program on the machine, without
and tooling sheets, etc. The same computer could also be knowing its rules and structure?
used for uploading and downloading CNC programs.
Successful use of computerized programming requires
Integration understanding of manual programming methods.
CAD/CAM computer software is: proached in a logical and methodical way. The first deci-
sions relate to what tasks have to be done and what goals
NEVER DO ANYTHING TWICE !
have to be reached. The other decisions relate to how to
achieve the set goals in an efficient and safe manner. Such a
When progressive method not only isolates individual problems
a drawing is made in a CAD software (such as
as they develop,
AutoCAD), then done again in a CAM software (such as it also forces their solution before the next
Mastercam), there step can be taken.
a duplication. Duplication breeds er-
is
rors. Inorder to avoid duplication, most of the sys- CAD The following items form a fairly common and logical
tems incorporate a transfer method of the design to the se-
sequence of tasks done in CNC programming. The items
lected CAMsystem to be used for CNC programming. are only in a suggested order, offered for further evaluation.
Typical transfers are achieved through special DXF or
This order may be changed to reflect special conditions or
ICES files. The DXF stands for Data Exchange Files or
working habits. Some items may be missing or redundant:
Drawing Exchange Files, and the ICES abbreviation is a
short lorm of Initial Graphics Exchange Specification files. 1 . Study of initial information (drawing and methods)
Once the geometry is transferred from the CAD system to 2. Material stock (blank) evaluation
the CAM system, only the tool path related process is 3. Machine tool specifications
needed. Using a post processor (special kind of formatter), 4. Control system features
the computer software will prepare a part program, ready to 5. Sequence of machining operations
be loaded directly to the CNC machine. 6. Tooling selection and arrangement of cutting tools
7. Setup of the part
Future of Manual Programming 8. Technological data (speeds, feedrates, etc.)
9. Determination of the tool path
It may seem that the manual programming is on the de- 1 0. Working sketches and mathematical calculations
cline. In terms of actual use, this is probably true. However, 1 1 . Program writing and preparation for transfer to CNC
it is necessary to keep in perspective that any computerized 1 2. Program testing and debugging
technology is based on the already well established meth- 13. Program documentation
ods of manual programming. Manual programming for
CNC machines serves as the source of the There is only one goal in CNC program planning and that
new technology
is the completion of all instructions in the form of a pro-
- it is the very elementary concept on
which the computer-
izedprogramming is based. This knowledge base opens the gram that will result in an error-free, safe and efficient CNC
door for development of more powerful hardware and soft- machining. The suggested procedures may require some
ware applications. changes - for example, should the tooling be selected be-
fore or after the part setup is determined? Can the manual
The manual programming may be used somewhat less partprogramming methods be used efficiently? Are the
frequently today and eventually will be used even less - but working sketches necessary? Do not be afraid to modify
knowing it well - really understanding it - is and always any so called ideal procedure - either temporarily, for a
will be the key to control the power of CAM
software. Even given job, qj- permanently, to reflect a particular CNC
pro-
computers cannot do everything. There are some special gramming style. Remember, there are no ideal procedures.
programming projects that a CAM software, regardless of
Chapter 6
34
and sections. The programmer first evaluates all the draw- cate how current is the drawing version. Only the latest ver-
then isolates those that are relevant for the de- sion of the part design is important to manufacturing.
ing data first,
Title Block
Figure 6-2
cri
OU DU 60 - Q A drawing dimension specifies a hole as
075+O.OO/-O.O5 mm. What actual dimension
1 1
should appear in the program?
Drawings in English units often contain fractions. A frac- A particular programming approach can control the fre-
tional dimension was sometimes used to identify a less im- quency of such manual adjustments to a great degree. Con-
portant dimensional tolerances (such as ±.030 inches from sider the 075 mm
mentioned earlier. If it is an external dia-
the nominal size). The number of digits following the deci- meter, the tool edge wear will cause the actual dimension
mal point often indicated a tolerance (the more digits speci- during machining to become larger. In the case of an inter-
smaller the tolerance range). These methods are
fied, the nal diameter, the actual dimension will become smaller as
not an ISO standard and are of no use in programming. the cutting edge wears out. By programming X74.95 for
Fractional dimensions have to be changed into their deci- the external diameter (the bottom limit) or X75.0 for the in-
mal equivalents. The number of decimal places in the pro- ternal diameter (the top limit), the wear of the cutting edge
gram determined by the minimum increment of the con-
is will move into the tolerance range, rather than away from
trol. A
dimension of 3-3/4 is programmed as 3.75, and a it. The manual tool offset adjustment by the machine
oper-
dimension of 5-1 1/64 inches is programmed as 5.1719, its ator may still be required, but less frequently. Another ap-
closest rounding. Many companies have upgraded their proach is to select the middle size of the tolerance range -
design standards to the ISO system and adhere to the prin- this method will also have a positive effect but more man-
ciples of CNC
dimensioning. In this respect, drawings us- ual adjustments may be necessary during machining.
ing the metric units are much more practical.
Surface Finish
Some dimensioning problems are related to an improper
use of a CAD software, such as AutoCAD. Some designers Precision parts require a certain degree of surface finish
do not change the default setting of the number of decimal quality. Technical drawing indicates the required finish for
places and every dimension ends up with four decimal various features of the part. English drawings indicate the
places (inches) or three decimal places (metric). This is a finish in micro inches, where I micro inch =. 000001".
poor practice and should be avoided. The best approach is Metric drawings use specifications expressed in microns,
to specify dimensional tolerances for all dimensions that where / micron = 0.001 mm. Symbol for a micron is a
require them, and even use Geometric Dimensioning and Greek letter p. Some drawings use symbols - Figure 6-4.
Tolerancing standards (GDT).
Tolerances
The most important factors influencing the quality of sur- METHODS SHEET
face finish are spindle speed, feedrate, cutting tool radius
and the amount of material removed. Generally, a larger manufacturing
Some companies have a staff of qualified
cutter radius and slower feedrates contribute towards finer
technologists or process planners responsible for determi-
surface finishes. The cycle time will be longer but can often
nation of the manufacturing process. These people develop
be offset by elimination of any subsequent operations such
a series of machining instructions, detailing the route of
as grinding, honing or lapping.
each part through the manufacturing steps. They allocate
the work to individual machines, develop machining se-
Drawing Revisions
quences and setup methods, select tooling, etc. Their in-
Another important section of the drawing, often over- structions arc written in a methods sheet ( routing sheet ) that
accompanies the part through all stages of manufacturing,
looked by CNC programmers, shows the engineering
typically in a plastic folder. If such a sheet is available, its
changes (known as revisions ) made on the drawing up to a
certain date. Using reference numbers or letters, the de- copy should become a part of the documentation. One of
- the purposes of a methods sheet is to provide the CNC pro-
signer identifies such changes, usually with both values
the previous and the new value - for example: grammer with as much information as possible to shorten
the turnover between programs. The greatest advantage of
REV. DIMENSION 5.75 WAS 5.65 a methods sheet in programming comprehensive cov-
is its
3 /
erage of all required operations, both CNC and conven-
Only the latest changes are important to the program de- tional, thus offering a complete overview of the manufac-
velopment. Make sure the program not only reflects the turing process. A good quality methods sheet will save a lot
current engineering design, but also is identified in some of decisions - it is made by a manufacturing engineer, who
unique way to distinguish it from any previous program specializes in work detailing. The ideal methods sheet is
versions. Many programmers keep a copy of the part draw- one where the recommended manufacturing process
ing corresponding to the program in the files, thus prevent- closely matches established part programming methods.
ing a possible misunderstanding later.
For whatever reason, a large number of CNC machine
shops does not use methods sheets, routing sheets or simi-
Special Instructions
lar documentation. The CNC programmer acts as a process
Many drawings also include special instructions and planner as well. Such an environment offers a certain de-
comments that cannot be expressed with the traditional gree of flexibility but demands a large degree of knowl-
drafting symbols and are therefore spelled out independ- edge, skills and responsibility at the same time.
ently, in words. Such instructions are very important for
CNC program planning, as they may significantly influ- MATERIAL SPECIFICATIONS
ence the programming procedure. For example, an element
of the part is identified as a ground surface or diameter. The
drawing dimension always shows the finished size. In the Also important consideration in program planning is eva-
luation of the material stock. Typical material is raw and
program, this dimension must be adjusted for any grinding
unmachined (a bar, billet, plate, forging, casting, etc).
allowance necessary - an allowance selected by the pro-
Some material be already premachined, routed from
may
grammer and written as a special instruction in the pro-
another machine or operation. It may be solid or hollow,
gram. Another example of a special instruction required in
with a small or a large amount to be removed by CNC ma-
the program relates to the machining performed during part
chining. The size and shape of the material determines the
assembly. For example, a certain hole on the drawing
setup mounting method. The type of material (steel, cast
should be drilled and tapped and is dimensioned the same
iron, brass, etc.) will influence not only the selection of cut-
way as any other hole, but a special instruction indicates the
ting tools, but the cutting conditions for machining as well.
drilling and tapping must be done when the part is handled
during assembly. Operations relating to such a hole are not
A program cannot be planned without knowing
programmed and if any overlook of a small instruction
the type, size, shape and condition of the material.
such as this, may result in unusable part.
({>12 - REAM 2 HOLES specifications within a particular batch or from one batch to
another. For example, a material ordered from two suppli-
This is a requirement to ream 2 holes with a reamer that ers to be used for the same part may have slightly different
has 1 2 mm diameter.
PROGRAM PLANNING 37
sizes, hardness and even shape. A similar example is a ma- MACHINING SEQUENCE
terial cut into single pieces on a saw, where the length of
each piece varies beyond an acceptable range. This incon-
sistency between blank parts makes programming more
Machining sequence defines the order of machining op-
and time consuming. and machine shop experience does
erations. Technical skill
difficult It also creates potentially un-
help in program planning, but some common sense ap-
safe machining conditions. If such problems are encoun-
proach is equally important. The sequence of machining
tered, the best planning approach is to place emphasis on
must have a logical order - for example, drilling must be
machining safety than on machining time. At worst, there
will be some air cutting or slower than needed cutting feed,
programmed before tapping, roughing operations before
finishing, first operation before second, etc. Within this
but no cuts will be too heavy for the tool to handle.
logical order, further specificationof the order of individual
Another approach is to separate non-uniform material tool motions is required for a particular tool. For example,
into groups and make separate programs for each group, in turning, a face cut may be programmed on the part first,
properly identified. The best method is to cover all known then roughing all material on diameters will take place. An-
and predictable inconsistencies under program control, for other method is to program a roughing pass for the first dia-
example, using the block skip function. meter, then face and continue with the remainder of the dia-
meter roughing afterwards. In drilling, a center drill before
Machinability Rating drilling may be useful for some applications, but in another
program a spot drill may be a better choice. There are no
Another important aspect of material specification is its
fixed rules on which method is better - each CNC program-
machinability. Charts with suggested speeds and feeds for ming assignment has to be considered individually, based
most common materials are available from major tooling on the criteria of safety and efficiency.
companies. These charts arc helpful in programming, par-
ticularly when an unknown material is used. The suggested The basic approach for determining the machining se-
values are a good and can be optimized
starling point, later, quence is the evaluation of all related operations. In gen-
when the material properties are better known. eral, program should be planned in such a way that the cut-
ting tool, once selected, will do as much work as possible,
Machinability rating in the English units is given in units before a tool change. On most CNC machines, less time is
called feet per minute (ft/min). Often the terms surface feet needed for positioning the tool than for a tool change. An-
per minute, constant surface speed (CSS or CS), periph- other consideration is in benefits gained by programming
eral speed or just surface speed are used instead. For metric all heavy operations first, then the lighter semifinishing or
designation of the machinability rating, the meters per min- finishing operations. It may mean an extra tool change or
ute (m/min) are used. In both cases, the spindle speed two, but this method minimizes any shift of the material in
(r/min) for a given tool diameter (for a mill) or a given part the holding fixture while machining. Another important
diameter (for a lathe) is calculated, using common formu-
factor the current position of a tool when a certain opera-
is
las.For the English system, the spindle speed can be calcu- tion completed. For example, when drilling a pattern of
is
lated in revolutions per minute (r/min): holes in the order of 1 -2-3-4, the next tool (such as a boring
bar, reamer or a tap) should be programmed in the order of
4-3-2- to minimize unnecessary tool motions - Figure 6-5.
1
TOOLING SELECTION Some machine types are designed to make the setup time
more productive. Multispindle machining centers or lathes
can handle two or more parts at the same time. Special fea-
Selecting tool holders and cutting tools is another impor-
tures, such as barfeeder for a lathe, an automatic pallet
tant step in planning a CNC program. The category of tool- changer or dual setup on the table, also help. Other solu-
ing covers a lot more than the cutting tools and tool holders
tions can be added as well.
- it includes an extensive line of accessories, including nu-
merous vises, fixtures, chucks, indexing tables, clamps,
Setup Sheet
collets and many other holding devices. Cutting tools re-
quire special attention, due to the large variety available At this stage of program planning, once the setup is de-
and their direct effect in machining. cided, making a setup sheet is a good idea. A setup sheet
can be a simple sketch, designed mostly for the use at the
The cutting tool itself is usually the most important selec-
machine, that shows the part orientation when mounted in a
tion. It should be selected by two main criteria:
holding device, tool offset numbers used by the program,
Efficiency of usage datum points and, of course, all the necessary identifica-
tions and descriptions. Other information in the setup sheet
Safety in operation
should relate to some unique requirements established
during planning stages of the program (such as the position
Many supervisors responsible for CNC programming try
of clamps, bored jaws dimensions, limits of tool extension,
to make work at all times. Often they
the existing tooling
etc.). Setup sheet and tooling sheet can be combined into a
ignore the fact that a suitable new tool may do the job faster
single source of information. Most programmers use their
and more economically. A thorough knowledge of tooling
a separate technical profession the
own various versions.
and its applications is -
All tool offset numbers and other program entries should Cutter Path
be documented in a form known as the tooling sheet. Such
a document serves as a guide to the operator during job
The core of any CNC programming is the determination
of the cutler path - the tool path. This process involves indi-
setup. It should include basic documentation re-
at least the
vidual cutter movements in its relationship to the part.
lating to the selected tool.For example, the documentation
may include the tool description, its length and diameter,
In CNC programming, always look at the cutting
the number of flutes, the tool and offset numbers, speed and
tool as being moved around the work !!
feed selected for that tool and other relevant information.
This principle applies to all CNC machine tools.
%
PART SETUP The key factor for understanding this principle is to visu-
alize the tool motion, not the machine motion. The most
Another decision program planning relates to the part
in noticeable difference between programming a machining
setup - how the raw or premachined material,
to mount center as compared to a lathe is the cutter rotation com-
what supporting tools and devices should be used, how pared to the part rotation. In both cases, the programmer al-
many operations are required to complete as many machin- ways must think in terms of the cutter moving around the
ing sequences as possible, where to select a program zero, part Figure 6 6.
etc. Setup is necessary and it should be done efficiently.
PROGRAM PLANNING 39
Positioning is used for a point location operations, such The topic of power and forces in machining can be com-
as drilling, reaming, tapping and similar operations; con- plex and is not always needed in everyday programming.
tinuous path generates a profile (contour). In either case, Work experience is often a better teacher than formulas.
the programmed data refer to the position of the cutter
when a certain motion is completed. This position is called Coolants and Lubricants
the tool target position - Figure 6-7.
When the tool contacts the material for an extended pe-
riod of time, a great amount of heat is generated. The cut-
tingedge gets overheated, becomes dull and may break. To
prevent these possibilities, a suitable coolant must be used.
The start and end positions of the profile are identified The CNC operator is responsible for a suitable coolant in
and so are the positions fqr each contour change. Each tar- The coolant should be clean and mixed in
the machine.
get position is called the contour change point, which has recommended proportions. Water soluble oils should be
to be calculated. The order of target locations in the pro- biodegradable to preserve the environment and properly
gram is very important. That means the tool position I is disposed of. The CNC programmer decides when to pro-
the target position commencing at the Start point, position
gram the coolant and when not. Ceramic cutting tools are
2 is the target position beginning at point position 3 is the
1
, normally programmed dry, without a coolant. Some cast
target from point 2 and so on, until the End position is
irons do not require flood coolant, but air blast or oil mist
reached. If the contour is for milling, the targets will be in X may be allowed. These coolant functions vary between ma-
and Y axes. In turning, they will be in X and Z axes. chines, so check the machine reference manual for details.
40 Chapter 6
Flood coolant may be used to cool down the part and gain Identification Methods
better tolerances. can also be used to Hush away chips
It
coolant smells. With proper management, all problems re- point in the drawing, use point reference numbers and cre-
lated to coolants can be controlled. ate a separate coordinate sheet form using the reference
numbers, as illustrated in Figure 6-8.
A coolant related programming issue is when to turn the
coolant on in the program. As the coolant function M08 Position X axis Y axis Z axis
only turns on the pump motor, make sure the coolant actu-
ally reaches the tool edge before contact with work. Pro-
gramming the coolant on early is better than late.
calculations, etc. - are required for programming complex only the applicable columns. The aim is to develop a con-
molds, dies and similar shapes. In such cases, a CAD/CAM sistent programming style from one program to another.
should be smaller or larger than the others, the relationship QUALITY IN CNC PROGRAMMING
of individual elements, the shape of an extremely small de-
tail, etc. However, there is one purpose you should never
An important consideration in program planning is a per-
use the sketch for: sonal approach and attitudes. Our attitudes have a signifi-
cant influence on the program development. Ask yourself
Never use a scaled sketch to guess unknown dimensions !
some questions.Are you attentive to detail, well organized,
concerned? Can a program be improved, is it safe, is it effi-
Scaling a sketch is a poor and unprofessional practice, cient? CNC program quality is more than writing an error
that creates more problems than it solves. It is a sign of lazi- free program. Part complexity is only related to your
ness or incompetence. knowledge level and willingness to solve problems. It
should be a personal goal to make a program that is the best
program possible. Set your standards high!
7 PART PROGRAM STRUCTURE
gram can be defined as an arrangement of the machining other for real numbers (numbers with a decimal point).
and related instructions, written in the format of the CNC Numbers can have positive or negative values. On some
system and aimed at a particular machine tool. numbers can be used with or without the deci-
controls, real
mal point. Numbers applied in either mode can only be en-
Various controls have a different format, but most are tered within the range that is allowed by the control system.
similar.Subtle differences exist among CNC machines
from different manufacturers, even those equipped with the Letters
Letter
program entered into the control system consists of individ-
ual lines of instructions, sequenced in a logical order. Each
Symbol called a sequence block or simply a block
line - - iscom-
posed of one or several words and each word is composed
Characters are combined into meaningful words. This
of two or more characters.
combination of digits, letters and symbols is called the
alpha-numerical program input.
41
42 Chapter 7
Program Figure 7-
Since the early days of numerical control, three formats Any one word is a series of characters (at least two) that
had become significant in their time. They are listed in the define a single instruction to the control unit and the ma-
order of their original introduction: chine.The above examples of typical words have the fol-
lowing meaning in a CNC program:
Tab Sequential Format NC only - no decimal point
the much more convenient Word Address Format. HO 1 Tool length offset number
mented by a symbol, 'such as a minus sign or a decimal /MO 1 Miscellaneousfimetion w/block skip symbol
point. Each letter, digit or symbol represents one character B180 0 . Indexing table junction
in the program and in the control memory. This unique al-
pha-numerical arrangement creates a word, where the letter Individual words are instructions grouped together to
is the address, followed by numerical data with or without form sequences of programming code. Each sequence that
symbols. The word address refers to a specific register of will process a series of instructions simultaneously, forms a
the control memory. Some typical words are: unit called a sequence block or simply a block. The series of
blocks arranged in a logical order that is required to ma-
G01 M30 D25 X5.75 N105 HOI YO S2500 chine a complete part or a complete operation is the part
Z-5.14 F12.0 T0505 T05 /M01 B180.0 program also known as a CNC program.
PART PROGRAM STRUCTURE
43
The next block shows a rapid tool motion to the absolute Address X accepts positive or negative data with the maximum
position of X 1 3.0Y4.6, with a coolant turned on: of five digits in front of a decimal point and three digits
maximum behind the decimal point - decimal point is allowed.
N25 G90 GOO X13 . 0 Y4.6 M08
The absence of a decimal point in the notation means the
decimal point is not used; the absence of a plus (+) sign in
csr where . .
G90 Absolute mode These samples of format notation explain the shorthand:
GOO Rapid motion mode
G2 Two digits maximum, no decimal point or sign
X13.0Y4.6 Coordinate location
M08 Coolant ON function N5 Five digits maximum, no decimal point or sign
number of digits allowed in a word, depending on the ad- of the short forms may vary significantly. The list of ad-
dress and maximum number of decimal places, is set by the dresses, their format notation and description is listed in the
control manufacturer. Not all letters can be used. Only let- following tables. They contain address notations based on a
ters with an assigned meaning can be programmed, except typical Fanuc control system.
in a comment. Symbols can be used in only some words,
and their position in the word is fixed. Some symbols are Milling System Format
used only in custom macros. Control limitations are impor-
tant. Symbols supplement the digits and letters and provide
The address description varies for many addresses, de-
pending on the input units. The table below lists English
them with an additional meaning. Typical programming
format descriptions (metric format is in parenthesis, if ap-
symbols are the minus sign, decimal point, percent sign and
plicable). Listed are format notations for milling units. The
a few others. All symbols are listed in a table below.
first column is the address, the second column is the format
Control manufacturers often specify the input format in Address Notation Description
an abbreviated form - Figure 7-2.
Rotary or Indexing axis - unit is
A A+5.3
degrees - used about the X axis
X ± 5 . 3
Rotary or Indexing axis - unit is
• • • • •
B B+5.3
degrees - used about the Y axis
Number of digits
after decimal point Cutter radius offset number
D2
(sometimes uses address H)
— Decimal point allowed
F5.3 Feedrate function - may vary
Number of digits
— before decimal point G G2 Preparatory commands
Positive or negative Offset number (tool position and/or
• - value possible H H3
tool length offset)
L L4
Fixed cycle repetition count
Subprogram repetition count
E
EaE2.6
Relief amount in G74 and G75
Depth of first thread in G76
m
T T4 Tool function P4 Custom macro number call
P Offset number with G10
X axis coordinate value
P53 Dwell time in milliseconds
designation
X
Q Q5 End block number in G71 and G72
X5.3 Dwell function with G04
Arc radius designation
Y
Y axis coordinate value
designation
R
inn Arc radius for corners
m
Z t—
(Z+5.3) designation T4 Tool function
Similar chart as for milling, this one is for lathe systems. U5.3 Dwell function with G04
A number of definitions are the same and are included only Incremental value in Z axis
for convenience.
ric notation is in
Notation is in
parenthesis, if
the English format, the met-
applicable to the address.
w wmm Stock allowance in Z axis
Multiple Word Addresses The table lists both standard and special symbols. Special
symbols are used only with optional features, such as the
One feature that is noticeable in both tables is the abun-
dance of different meanings for some addresses. This is a
custom macro option. These symbols cannot be used in
standard programming, as they would cause an error. Typi-
necessary feature of a word address format. After all. there
cal standard symbols are found on the computer keyboard.
are only 26 letters in the English alphabet, but more than
Ctrl, Shift and Alt character combinations are not allowed.
that number of commands and functions. As new control
features are added, even more variations may be necessary.
Plus and Minus Sign
Some of the addresses have such an established meaning
(for example, X, Y and Z are coordinate words), that giving
One of the most common symbols in CNC programming
them an additional meaning would be confusing. Many let-
isan algebraic sign - plus or minus. Any data in a motion
ters, on the other hand, are not used very often and a multi- command can be either positive or negative. For conven-
ple meaning for them is quite acceptable (addresses I, J. K.
ience, virtually all control systems allow for an omission of
P, for example). In addition, the meaning of addresses var-
a plus sign for all positive values. This feature is sometimes
ies between the milling and turning systems.
called positive bias of the control system. Positive bias is a
term indicating an assumed positive, value, if no sign is pro-
The control system has to have some means of accepting
grammed in a word:
a particular word with a precisely defined meaning in the
program. In most cases, the preparatory command G will
define the meaning, at other limes it will be the M function X+125.0 is the same as X125.0
or a setting of system parameters.
The minus sign must always be programmed. If the mi-
nus sign is missing, the number becomes positive, with an
SYMBOLS IN PROGRAMMING incorrect results value (in this case the tool position):
In addition to the basic symbols, Fanuc can accept other X- 12 5 . 0 Negath’e value
symbols for different applications. The following table de-
X12 5 0 . Posith’e value
scribes all symbols available on the Fanuc controls:
X+125.0 Posith’e value ( + sign is ignored)
Symbol Description Comment Symbols supplement the letters and digits and are an inte-
gral part of the program structure.
Decimal point Fractional part of a number
Slash Block skip function symbol or tures are identified. The next example is an exaggerated
/
(front slash) division sign in Fanucmacros sample of items that may be used in the program header:
% Percent sign Stop code (end of program file) (LAST VERSION DATE 07-DEC-01)
(LAST VERSION TIME 19:43)
Colon Program number designation (PROGRAMMER . . . PETER SMID)
(MACHINE OKK - VMC)
i
Comma Used only within comments (CONTROL FANUC 15M)
(UNITS INCHES)
wm Brackets
*
Arguments in Fanuc macros
Within the program, each tool may be identified as well: of the X and Y axes. If the absolute position is unknown,
change the block to the incremental version:
(*** TO 3 - 1/4-20 PLUG TAP ***)
N88 G91 G28 X0 Y0
Other comments and messages to the operator can be
added to the program as required. If a toolhas to be repeated, make sure not to include the
tool change block for the current tool. Many CNC systems
will generate an alarm if the tool change command cannot
TYPICAL PROGRAM STRUCTURE find the tool in the magazine. In the following program ex-
ample, the tool repeat blocks will be N5, N38 and N67.
Although it may be a bit early to show a complete pro-
gram, it will do no harm to look at a typical program struc- The program structure example is for a machine with
ture. Developing a solid program structure is
absolutely es- random tool selection mode and a typical control system,
sential - it is going to be used all the time. Each block of the with some minor changes to be expected. Study the How ot
comment. the program, rather than exact contents. Note the repeti-
its
program is identified with a
tiveness of blocks for each tool and also note the addition of
Note - Program blocks use only sample block numbers. a blank line (empty block) between individual tools for eas-
Blocks in parentheses are not required for fixed cycles. The ier orientation in the program.
XY value in the block N88 should be the current position
N62 GOO G80 Z2.0 M09 (CLEAR ABOVE PART - COOLANT OFF)
N63 G28 Z2.0 M05 (HOME IN Z ONLY - SPINDLE OFF)
N64 M01 (OPTIONAL STOP)
( —BLANK LINE —
N65 TO (TOOL T03 INTO WAITING POSITION - CHECK ONLY)
N66 M0 (T03 INTO SPINDLE)
N67 G90 G54 GOO X.. Y. . S. . M03 T01 (TO 3 RESTART BLOCK - T01 INTO WAITING POSITION)
N68 G43 Z2.0 H03 M08 (TOOL LG OFFSET - CLEAR ABOVE WORK - COOLANT ON)
(N69 G01 Z-. F. .) .
(FEED TO Z DEPTH IF NOT A CYCLE)
( CUTTING MOTIONS WITH TOOL TO 3 )
N2 G90
DESCRIPTION AND PURPOSE N3 GOO
N4 ...
N5 ...
A one block example will illustrate the purpose of the N6 ...
preparatory commands in the following program entry: N7 X13.0 Y10.0
N7 X13.0 Y10.0 All fourexamples have the same machining result, pro-
is no change of any G code mode between
viding that there
Even a casual look at this block shows that the coordi- blocks N4 and N6 in the examples B, C and D.
nates X13.0Y10.0 relate to the end position of the cutting
tool, when the block N7 is executed (i.e., processed by the
One G code in a modal group replaces
control). The block does not indicate whether the coordi- another G code from the same group
nates are in the absolute or the incremental mode. It does
For example, in order to make the block N7 a tool desti- of G codes must be kept separate.
nation in a rapid mode using absolute dimensions, all these
instructions - or commands - must be specified before the Check machine documentation for available G codes !
N7 G90 GOO X13.0 Y10.0 The G code table on the next page is a considerably de-
tailed list of the most common preparatory commands used
O Example B :
*
for programming CNC milling machines and CNC ma-
chining centers. The listed G codes may not be applicable
N3 G90 to a particular machine and control system, so consult the
N4 ... machine and control reference manual to make sure. Some
N5 ...
G codes listed are a special option that must be available on
N6 ...
the machine and in the control system.
N7 GOO X13.0 Y10.0
47
48 Chapter 8
G09 Exact stop check - one block only G57 Work coordinate offset 4
GIO Programmable data input (Data Setting) G58 Work coordinate offset 5
G22 Stored stroke check ON G67 Custom macro modal call cancel
G25 Spindle speed fluctuation detection ON G69 Coordinate system rotation cancel
G26 Spindle speed fluctuation detection OFF G73 High speed peck drilling cycle (deep hole)
G27 Machine zero position check G74 Left hand threading cycle
G28 Machine zero return (reference point 1) G76 Fine boring cycle
G40 Cutter radius compensation cancel G83 Peck-drilling cycle (deep hole drilling cycle)
G41 Cutter radius compensation - left G84 Right hand threading cycle
S
G42 Cutter radius compensation - right G85 Boring cycle
G52
Tool position register /
Fanuc lathe controls use three G code group types - A, B G54 Work coordinate offset 1
the table below. Only one type can be set at a time. Types A G56 Work coordinate offset 3
and B can be set by a control system parameter, but type C
G57 Work coordinate offset 4
is optional. Generally, most G codes are identical, only a
few are different in the A and B types. More details on the G58 Work coordinate offset 5
subject of G code groups is listed at the end of this chapter.
G59 Work coordinate offset 6
G code Description
G61 Exact stop mode
Tool nose radius offset cancel G96 Constant surface speed mode (CSS)
G40
Tool nose radius offset G97 Direct r/min input ( CSS mode cancel)
G41 left
G42 Tool nose radius compensation right G98 Feedrate per minute ( Group type A
G99 Feedrate per revolution (Group type A)
50 Chapter 8
Most of the preparatory commands are discussed under Note motion command GOO - how many times
the rapid
the individual applications, for example G01 under Linear does it appear program? Just once - in the block N30.
in the
Unlike the miscellaneous functions, known as the M in a certainmode until canceled by another mode.
functions and described in the next chapter, several prepa-
ratory commands may be used in a single block, providing
As most G codes are modal, there is no need to repeat a
they are not in a logical conflict with each other:
modal command in every block. Using the earlier example
C once more, the control will make the following interpre-
N25 G90 GOO G54 X6.75 Y10 .
Earlier, the following example C was used to demonstrate two or more modes of operation. If the rapid motion com-
the general placement of G codes into a program block: mand GOO is selected, it is a specific command relating to a
tool motion. As it is impossible to have a rapid motion and
Such
impossible to
a combina-
N3 G90 GOO tion creates a conflict in a block. If conflicting G codes are
N4 ... used in the same block, the latter G code will be used.
N5 ...
N6 ... N74 G01 GOO X3.5 Y6.125 F20.0
N7 X13.0 Y10.0
%
In the example, the two commands G01 and GOO are in
If the structure is changed slightly and filled with realistic conflict. As GOO is the latter one in the block, it will be-
data, these five blocks may be the result:
come effective. The feedrate is ignored in this block.
O Example C • modified (as programmed) N74 GOO G01 X3.5 Y6.125 F20.0
plication of this feature can be illustrated in this example: sometimes using the descriptions unmodal or non-modat.
They are only active in the block in which they were pro-
(G20) grammed. If unmodal G codes are to be effective in several
N45 G90 GOO G54 XI. 0 Y1.0 S1500 M03 (G90) consecutive blocks, they must be programmed in each of
N46 G43 Z0.1 H02 those blocks. In majority of unmodal commands, this repe-
N47 G01 Z-0.25 F5.0 tition will not be used very often.
N48 X2.5 G91 Y1.5 (G90 MIXED WITH G91)
N49 . .
For example, a dwell is a programmed pause measured in
all subsequent blocks, until the G90 is programmed. Most All three blocks contain the same function, a dwell, one
likely, the block N48 will be written in absolute mode: alter another. The program can be made much more effi-
cient by simply entering the total dwell value into a single
• • « block:
N48 X2.5 Y2.5
N56 G04 P6000
Normally, there is no reason to switch between the two The following groups are typical for the Fanuc control
modes. It can result in some very unpleasant surprises. systems. Applications for milling and turning controls are
There are some occasions when this special technique specially distinguished by the and M T letters respectively,
brings benefits, for example, in subprograms. in the Type column of the table:
52 Chapter 8
Group Description G codes Type Group 01 is not affected by G codes from Group 09. In a
summary ...
G61 G62 G64 M/T stalled, before any programs have been written for it.
13 Cutting Modes
G63 M Change of the G code type at random is a guaranteed way
to create an organizational nightmare. Keep in mind that a
14 Macro Mode G66 G67 M/T
change of one code meaning will affect the meaning of an-
Coordinate other code. Using the units example for a lathe, if G70
16 G68 G69 M
Rotation means an English input of dimensions, you cannot use it to
G96 G97 T program a roughing cycle. Fanuc provides a different code.
17 CSS
Always stay with the standard G code type. All G codes in
18 Polar Input G15 G16 M this handbook use the default group of the Type A, and also
»
The address Min a CNC program identifies a miscella- All machine tools designed for metal removal by cutting
neous function, sometimes called a machine function. Not have certain common features and capabilities. For exam-
all miscellaneous functions are related to the operation of a ple, spindle rotation can have three - and only three - possi-
CNC machine - quite a few are related to the processing of ble selections in a program:
the program itself. The more suitable term miscellaneous
Spindle normal rotation
functions is used throughout this handbook.
Spindle reverse rotation
ON OFF
terruption of a program execution requires an M
function,
Coolant operation or
for instance, during the change of a job setup, such as a part
a Tailstock or quill motion IN or OUT reversal. Another example is a situation, where one pro-
gram calls one or more subprograms. In such a case, each
These operations vary between machines, due to the dif- program has to have a program call function, the number of
ferent designs by various machine manufacturers. A ma- repetitions, etc. M functions handle these requirements.
chine design, from the engineering point of view, is based
on a certain primary machining application. A CNC mill- Based on the previous examples, the use of miscellane-
ing machine will require different functions related to the ous functionsfalls into two main groups, based on a partic-
Even two machines designed for the same type of work, This handbook covers only the most common miscella-
forexample, two kinds of a vertical machining center, will neous functions, used by the majority of controls. Unfortu-
have functions different from each other, if they have a dif- nately, there are many functions that vaiy between ma-
ferent CNC system or significantly different options. Dif- chines and the control system. These functions are called
ferent machine models from the same manufacturer will machine specific functions. For this reason, always consult
also have certain unique functions, even with the same the documentation for the particular machine model and its
model of the CNC system. control system.
53
54 Chapter 9
M code Description
M13 Tailstock quill OUT
MOO Compulsory program stop Turret indexing forward
M17
Optional program stop
M18 Turret indexing reverse
M02 End of program (usually with reset, no rewind) be divided into several groups, based on the specific appli-
cation of the miscellaneous functions within each group. A
M03 Spindle rotation normal contained the following table:
typical distribution list is in
MISCELLANEOUS FUNCTIONS
55
Coolant M07 MO 8 MO example, block N56, the precise time the M08
In this
function will be activatedis not very important. In other
M10 Mil
Ml 2 M13
cases, the timing may be very important. Some func- M
tions must be in effect before or after certain action takes
Accessories M17 Ml
place. For example, look at this combination - a Z axis mo-
M21 M2
tion is applied together with the program stop function
M78 M7 9
MOO in the same block:
Threading M23 M2
N319 G01 Z-12.8456 F20.0 MOO
Gear ranges M41 M42 M43 M44
This is a far more serious situation and two answers are
Feedrate override M48 M49
needed. One is what exactly will happen, the other is when
Subprograms M98 M99 exactly it will happen, when the MOO function is activated.
There are three possibilities and three questions to ask:
Pallets M60
1 . Will the program stop take place immediately, when
The table does not cover all M functions or even all possi-
the motion is activated - at the start of the block?
ble groups. Neither does it distinguish between machines. 2. Will the program stop take place while the tool
On does indicate the types of applications
the other hand, it is on the way - during a motion?
the miscellaneous functions are used for in everyday CNC
programming. 3. Will the program stop take place when the motion
command is completed - at the end of the block?
chine control system arc cither not used or not needed. system interprets blocks containing a tool motion and a
However, the concepts for their applications are always miscellaneous function.
similar for most control systems and CNC machines.
Each M function is designed logically - it is also designed
In this chapter, only the more general functions are cov- to make a common sense.
ered in significant detail. Remaining miscellaneous func- The actual startup of a M function divided into two
is
tions are described in the sections covering individual ap- groups - not three:
plications. At this stage, the stress is on the usage and
behavior of the most common miscellaneous functions. M function activates at the start of a block
(simultaneously with the tool motion)
If a miscellaneous function is programmed in a block by No M function will be activated during the block execu-
itself, with no other data supplementing it, only the func- tion, there is no logic to it. What is the logical startup of the
tion itself will be executed. For example, coolant ON function M08 in the block N56 above? The
correct answer is that the coolant will be activated at the
N45 M01 same time as the tool motion begins. The correct answer for
the example block N319 is that the MOO program stop
is an optional stop. This block is correct - an functionM function will be activated after the tool motion has been
can be the only block entry. Unlike the preparatory com-
completed. Makes sense? Yes, but what about the other
mands (G codes), only one M
function is allowed in a block
functions, how do they behave in a block? Let’s look at
- unless the control allows multiple M
functions in the same
them next.
block, a program error will occur (latest controls only).
Chapter 9
56
Startup of M Functions
M functions completed in ONE BLOCK
Take a look at the list of typical M
functions. Add a tool
MOO Compulsory program stop
motion to each and try to determine the way the function is
Optional program stop
going to behave, based on the previous notes. A bit of logi- M01
cal thinking provides a good chance to arrive at the right M02 End of program (usually with reset, no rewind)
conclusion. Compare,the two following groups to confirm:
M06 Automatic tool change (ATC)
M30 Program end (always with reset and rewind) PROGRAM FUNCTIONS
M60 Automatic pallet change (APC)
Miscellaneous functions that control program processing
can be used either to interrupt the processing temporarily
If an uncertainty about how the function will in-
there is (in the middle of a program) or permanently (at the end of a
teract with the tool motion, the safest choice is to program program). Several functions are available for this purpose.
the M
function as a separate block. That way the function
willalways be processed before or after the relevant pro- Program Stop
gram block. In the majority of applications this will be a
The MOO function defined as an unconditional or com-
is
safe solution.
pulsory program stop. Any time the control system en-
Duration of M Functions counters this function during program processing, all auto-
matic operations of the machine tool will stop:
Knowledge of when the M function takes effect is logi-
axes
Motion of all
cally followed by the question about how long the function
will be active. Some miscellaneous functions are active Rotation of the spindle
in the block they appear. Others will continue to be
in
only
function. Coolant function
effect until canceled by another miscellaneous
This is similar to the modality of the preparatory G com- Further program execution
block or in a block containing other commands, usually necessary information. The comment section must be
axis motion. If the MOO function is programmed together enclosed in parentheses (three versions shown):
O MOO programmed after a motion command [B] N39 X13.5682 MOO (REMOVE CHIPS)
Q MOO programmed with a motion command Any one of the three methods will give the CNC operator
the necessary information. From the two options, the sec-
N39 GOO X13.5682 MOO ond one IB], the comment section in the program, is prefer-
able. The built-in instructions can be read directly from the
In both cases, the motion command will be completed display screen of the control panel.
first, program stop is executed. The difference
before the
between the two examples is apparent only in a single Optional Program Stop
block processing mode (for example, during a trial cut).
The program stop function MOO is used only In case there is no M01 function programmed, the setting
for a manual intervention during program processing
of the Optional Stop switch is irrelevant. Normally, it
should be in the OFF position for production work.
The control also offers an optional program stop M01,
described next. of using MOO is the need of a
The main rule When active, the M01 function behaves the same way as
manual intervention for every part machined. Manual tool the MOO function. The motion of all axes, spindle rotation,
change in a program qualifies for MOO, because every part coolant function and any further program execution will be
needs it. A dimensional check may not qualify, if is infre- temporarily interrupted. Feedrate, coordinate settings,
quent. M01 will be a better choice. Although the difference spindle speed setting, etc., arc retained. The further pro-
between the two functions is slight, the actual difference in cessing of the program can only be reactivated by the Cycle
cycle time can be significant for large number of parts. Start key. All programming rules for the MOO function also
apply to the MO I function.
When using the MOO function, always inform the opera-
tor why the function has been used and what its purpose is. A good idea is to program the M01 function at the end of
Make the intent known
to avoid a confusion. This intent each tool, followed by a blank line with no data. If the pro-
can be made available to the operator in two ways: gram processing can continue without stopping, the Op-
tional Stop switch will be set to OFF and no production
In the setup sheet, refer to the block number that contains time is lost. If there is a need to stop the program tempo-
the miscellaneous function MOO and describe the manual
rarily at the end of a tool, the switch will be set to ON and
operation that has to be performed:
the processing stops at the end of the tool. The time loss is
Every program must include a special function defining The percent sign (%) after M30 is a special stop code.
the end of current program. For this purpose, there are two This symbol terminates the loading of a program from an
M functions available - the M02 and M30. Both are similar, external device. It is also called the end-of-ftle marker.
but each has a distinct purpose. The M02 function will ter-
minate the program, but will cause no return to the first Subprogram End
block at the program top. The function M30 will terminate
the program as well but it will cause a return to the program The last M function for a program end is M99. Its pri-
top. The word return
‘
is often replaced by the 're- word mary usage is in the subprograms. Typically, the M99 func-
wind'. a leftover from the times when a reel-to-reel
It is tion will terminate a subprogram and return to the process-
tape reader was common on NC machines. The tape had to ing of the previous program. If M99 is used in a standard
be rewound when the program has been completed for each program, it creates a program with no end - such a situation
part. M30 function provided this rewind capability. is called an endless loop. M99 should be used only in
subprograms, not in the standard programs.
When the control reads the program end function M02 or
M30, it cancels all axis motions, spindle rotation, coolant
function and usually resets the system to the default condi-
MACHINE FUNCTIONS
tions. On some controls the reset may not he automatic and
any programmer should be aware of it. Miscellaneous functions relating to the operation of the
machine tool are part of another group. This section de-
If the program ends with the M02 function, the control scribes the most important of them in detail.
remains at the program end, ready for the next Cycle Start.
On modern CNC equipment there is no need for M02 at all, Coolant Functions
except for backward compatibility. This function was used
in addition to M30 for those machines (mainly NC lathes) Most metal removal operations require that the cutting
that had tape readers without reels, using a short loop tape. tool flooded with a suitable coolant. In order to control
is
The trailer of the tape was spliced to the tape leader, creat- the flow of coolant in the program, there are three miscella-
ing a closed loop. When the program was finished, the start neous functions usually provided for this purpose:
of the tape was next to the end, so no rewind was necessary.
Long tapes could not use loops and required reels and M30.
M07 Mist ON
So much for the history of M02 - just ignore its existence.
Is M02 the Same as M30 ?
M08 Flood ON
On most modern controls, a system parameter can be set M09 Mist or Flood OFF
to make the M02 function with the same meaning as that of
M30. This setting can give it the rewind capabilities, useful
in situations where an old program can be used on a ma-
Mist is the combination of a small amount of cutting oil
mixed with compressed air. It depends on the machine tool
chine with a new control without changes.
manufacturer whether this function is standard for a partic-
In a summary, if the end of program is terminated by the ular CNC machine tool or not. Some manufacturers replace
M30 function, the rewind will be performed; if the M02 the mixture of oil and air with air only, or with oil shot only,
function is used, the rewind will not be performed. etc. In these cases, it is typical that an additional equipment
is built into the machine. If this option exists on the ma-
When writing the program, make sure the last block in chine, the most common miscellaneous function to activate
the program Contains nothing else but M30 as the preferred the oil mist or air is M07.
end (sequence block is allowed to start the block):
The function similar to M07 is M08 - coolant flooding.
N65 . . . This by far the most common coolant application in CNC
is
N66 G91 G28 XO YO programming. It is standard for virtually all CNC machine.
N67 M30 (END OF PROGRAM) The coolant, usually a suitable mixture of soluble oil and
% water, is premixed and stored in the coolant tank of the ma-
chine tool. Flooding the cutting edge of the tool is impor-
On some controls, the M30 function can be used together
tant for three reasons:
with the axes motion - NOT recommended !:
Heat dissipation
N65 . . .
The primary reason to use a coolant flood aimed at the Coolant should always be programmed with two impor-
cutting edge is to dissipate the heat generated there during tant considerations in
mind:
cutting. The secondary reason is to remove chips from the
There will be no coolant splashing outside of
cutting area, using coolant pressure. Finally, the coolant
the work area (outside of the machine)
also acts as a lubricant to ease the friction between the
cutting tool and material. Lubrication helps to extend tool There will never be a situation when
life and improves the surface finish. the coolant reaches a hot edge of the tool
During initial tool approach towards the part or during fi- The first consideration is relatively minor. If the coolant
nal return to the tool change position, the coolant is nor- function is programmed in the ‘wrong’ place, the result
mally not required. To turn off the coolant function, use the may be just an inconvenience. The wet area around the ma-
M09 function - coolant off. M09 will turn off the oil mist or chine may present unsafe working conditions and should
Hood supply and nothing else. In reality, the M09 function be quickly corrected. Even more serious situation happens
will shut off the coolant pump motor. when Hooding a cutting tool
the coolant suddenly starts
that has already entered the material. The change in tem-
Each of the three coolant related functions may be pro- perature at the cutting edge may cause the tool to break and
grammed in separate blocks or together with an axis mo- damage the part. Carbide tools are far more easily affected
tion.There are subtle but important differences in the order by temperature changes than high speed steel tools. Such a
and liming of the program processing. The following ex- possibility can be prevented during programming, by using
amples explain the differences: the M08 function a few blocks ahead of the actual cutting
block. Long pipes or insufficient coolant pressure on the
O Example A - oil mist is turned ON, if available :
N110 MO
Spindle Functions
Coolant ON, when programmed with the axes motion, front of the lathe. However, M03 and M04 spindle direc-
becomes active simultaneously with the axes motion tions are established the same way as for machining cen-
(Example D) ters. A further complication is the fact that left hand tools
Coolant OFF, programmed with the axes motion, are used in lathe work more frequently than in the work for
becomes effective only upon completion of milling applications. Make an effort to study the instruction
the axes motion (Example E) manual for a specific machine carefully - also see details
described in Chapter 12.
The main purpose of M08 function is to turn the coolant
pump motor on. It does not guarantee that the cutting edge Spindle function to program a spindle stop is M05. This
receives any coolant immediately. On large machines with function will stop the spindle from rotating, regardless of
long coolant pipes, or machines with low coolant pump the rotation direction. On many machines, the miscella-
pressure, some delay is to be expected before the coolant neous function M05 must also be programmed before re-
covers the distance between the pump and cutting tool. versing the spindle rotation:
60 Chapter 9
MO 3 (SPINDLE CW) For example, most roughing operations require the power
of the spindle more than the spindle speed. In this case, a
<. . Machining at the current location . . .
low range is usually a better selection. For finishing work, a
medium or high range is better, because high spindle rota-
MO 5 (SPINDLE STOP)
< . Usually a tool change ... > tion can be more beneficial to the metal removing process.
.
MO 4 (SPINDLE CCW)
The distribution of the miscellaneous functions depends
< . . Machining at the current location . . .
entirely on the number of gear ranges the CNC lathe has
available. Number of ranges is 1, 2, 3 or 4. The following
table shows typical distribution of the M functions, but
The M05 function may also be required when changing check the actual commands in a machine tool manual.
gear ranges on CNC lathes. A spindle stop programmed in
a block containing an axis motion, will take place after the Ranges M function Gear Range
motion has been completed.
1 available N/A None programmed
The last spindle control function is the function Ml 9,
called the spindle orientation. Some control manufacturers
M41 Low range
call it the spindle key lock function. Regardless of the de- 2 available
M42 High range
scription, the M
9 function will cause the spindle to stop in
1
orientation for most CNC machining centers. The orienta- The rule of thumb is that the higher the gear range, the
tion is built into the automatic tool changing sequence and more spindle speed is possible and less spindle power is re-
guarantees the correct positioning of all cutting tool hold- quired. The opposite is also true. Normally, the spindle ro-
ers. Some programmers like to program the 19 with the M tation does not have to be stopped to change a gear, but con-
machine zero return for the tool change position, to save a sult the lathe manual anyway. In doubt, stop the spindle
second or two of the cycle time. first, change the gear range, then restart the spindle.
similar approach is used for backboring operations. How- ready covered, specifically the coolant control and the gear
ever, these special cutting operations use fixed cycles in the changes. The remaining M
functions in this group are de-
program, where the spindle orientation is built in. For more scribed in detail elsewhere in this handbook, so only a short
details, Chapter 25 describes Fixed Cycles. description is offered here. The most notable of the ma-
chine related M functions are:
In conclusion, the M 19 function is rarely used in the pro-
gram. It is available as a programming aid and to the ma-
chine operator for setup work, using MDI operations. M function Description Type
As many program words as necessary are allowed in a The next few examples compare a typical structure of
single block. Some controls impose a limit on the number blocks for milling operations and blocks for turning opera-
of characters in one block. There is only a theoretical maxi- tions. Each block is presented as a separate example.
mum for Fanuc and similar controls, irrelevant in practice.
The only restriction is that two or more duplicated words Block Structure for Milling
(functions or commands) cannot be used in the same block
(with the exception of G codes). For example, only one In milling operations, the structure of a typical program
miscellaneous Mfunction (exceptions do exist) or only one block will reflect the realities of a CNC machining center
coordinate word for the X axis in a single block are or a similar machine.
61
62 Chapter 10
N23 G02 X7.5 Z-2.8 RO . 5 F0.012 (EXAMPLE 2) If the program name is longer than the sixteen characters
Since the control screen display can show only the first
PROGRAM IDENTIFICATION sixteen characters of the program name, the program
names will be ambiguous when displayed:
A CNC program can be identified by its number and, on
some controls, also by its name. The identification by the 01005 (LOWER SUPPORT AR)
program number is necessary in order to store more than 01006 (LOWER SUPPORT AR)
one program in the CNC memory. Program name, if avail-
able,can be used to make a brief description of the pro-
To eliminate this problem, use an abbreviated description
that is within the sixteen characters and contains all the sig-
gram, readable on the control screen display.
nificant data:
Program Number
01005 (LWR SUPP ARM OP1)
The first any part program is commonly a
block used in
01006 (LWR SUPP ARM OP2)
program number, if required by the control system from the
If a more detailed description is required, the description
program. Two addresses are available for the program
has to be split over one or more comment lines:
number - the standard letter O
for EIA format, and the co-
lon | : |
for the ASCII (ISO) format. In memory operation,
01005 (LWR SUPP ARM OP1)
the control system always displays program number with
(OPERATION 1 - ROUGHING)
the letter O. The block containing the program number is
not always necessary to include in the CNC program. The comments in the block or blocks following the pro-
gram number will not appear on the directory screen list-
If the program uses program numbers, they must be
ing, but still will be a useful aid to the CNC operator. They
specified within an allowed range. Programs for typical
will be displayed during the program execution and, of
Fanuc controls must be within the range of - 9999, pro- 1
controls and N I to N99999 for the newer controls. Some crement is allowed and
its selection depends on the
rather old controls accept block number in the three digit personal programming style or the standard established
range only, N1 - N999. within the company. The typical sequence block incre-
ments other then one are:
The N address must always be the first word in the block.
For an easier orientation in programs that use subprograms,
there should be no duplication of the numbers between the
Increment Program example
two types of programs. For example, a main program start- 2 N2, N4, N6, N8, ...
ing with NI and a subprogram also starting with N1 may
cause a confusing situation. Technically, there is nothing 5 N5 , N10, N15 , N20 , ...
wrong with such a designation. Refer to Chapter 39 for 10 N10 , N2 0 , N3 0 N40 ...
, ,
suggestions on block numbering in subprograms.
100 N100 , N2 0 0, N300, N400, ...
Sequence Number Command
quence numbers the way they are used normally, the sec-
lastexample N100, usually programmed in the incre-
-
ond column shows the sequence numbers required in a for- ments of 100, 10, or less. There is nothing wrong with this
rather a large start and increment, but the CNC program
mat acceptable to the machine control system, as applied to
will become unnecessarily too long, too soon, and possibly
a CNC program:
difficult to manage.
Increment First block number In all cases of block increments other than one, the pur-
Note the change in block N40 and added blocks N61 to The block sequence number does not affect the order of
N64. Preference in this handbook is to program in incre- program processing, regardless of the increment. Even if
ments of one and if an addition is needed, the added blocks the blocks are numbered in a descending or mixed order,
will have no block numbers at all (check if the control the part program will always be processed sequentially, on
system allows block numbers to be omitted, most do). the basis of the block contents, not number. The incre-its
G Example A - one face cut sertion of up to 4 to 9 blocks respectively between any two
original blocks. That should be more than sufficient for the
N40 GOO G41 X3.5 Z0 T0303 M08 majority of program modifications.
N41 G01 X-0.07 F0.01
N42 GOO W0.1 For those CNC programmers who use a computer based
N43 G40 X3.5 programming system, just a few words relating to the pro-
gramming of sequence numbers. Although the computer
O Example B - two face cuts :
programming system allows the start number of the block
and its increment to almost any combination, adhere to the
N40 GOO G41 X3.5 Z0.05 T0303 M08
startand increment numbers of one (Nl, N2, N3, ...). The
N41 G01 X-0.07 F0.01
N42 GOO W0.1 purpose of a computer based programming is to keep an ac-
X3.5 curate database of the part geometry and the cutting tool
ZO path. If the CNC program is modified manually, the part
G01 X-0.07 computer database is not accurate any more. Any CNC
GOO W0.1 program change should always be reflected in the source of
N43 G40 X3.5 the program, as well as its result - never in the result alone.
The use of block numbers in a program is optional, as numbers, such as a machining cycle or tool change. In these
shown in the earlier example. A program containing block cases, select increments of two or five, for the operator’s
numbers is easier to read. For the CNC operator, search and convenience. Even limited use of sequence numbers will
increase the program length, but for a justifiable reason.
edit functions in program editing can be used easily. Note -
The semicolon symbol on the screen is only a graphic The name safe block - which is another name used for the
representation of the end-of-block character and is never startup block - does not become safe on its own - it must be
entered literally in the CNC program. Under no circum- made safe. Regardless of the name, this block should con-
stances it should be included in the program itself. Some tain control settings for the program or the cutting tool that
older control systems have an asterisk [
* ] as the display start the program in a ‘clean’ state. The most common en-
symbol for the end-of-block, rather then the semicolon [ ; ]. tries that set the initial status are the dimensioning system
Many controls use other symbols, that also represent the (English/metric and absolute/incremental), cancellation of
end of block, for example, some use the dollar sign $ ]. In [
any active cycle, cancellation of the active cutter radius
any case, remember the symbol is only the representation offset mode, the plane selection for milling, the feedrate de-
of the end-of-block character, not its actual character. fault selection for lathes, etc. The presented examples show
some startup blocks for both milling and turning controls.
STARTUP BLOCK OR SAFE BLOCK At the beginning of the program for milling, a startup
block may be programmed with the following contents:
A startup block (sometimes called a safe block or a status
block ) a special sequence block. It contains one or more
is N1 GOO G17 G20 G40 G54 G64 G80 G90 G98
modal words (usually preparatory commands of several G
N1 block is the first sequence number, GOO selects the
groups) that preset the control system into a desired initial
or default state. This block is placed at the beginning of rapid mode, G17 establishes the XY plane selection, G20
each program or even at the beginning of each tool and it is
selects the English units, G40 cancels any active cutter ra-
(or a tool within a program). In the CNC program, the cels any active fixed cycle, G90 selects the absolute mode,
startup block usually precedes any motion block or axis and G98 will retract to the initial level in a fixed cycle.
setting block, as well as the toolchange or tool index block. These conditions apply only when the startup block is pro-
This is the block to be searched for, if the program or the cessed as the first major block in the CNC program - any
desired cutting tool is to be repeated during a machine op- subsequent program changes will become effective only
eration. Such a block will be slightly different for the mill- with the block in which the change is applied. For example,
if a GO command is effective by default, any subsequent
ing and turning systems, due to the unique requirements of 1
each control system. usage of GOO, G02, or G03 will cancel the GO command. 1
Earlier in this handbook, in the Chapter 5, one topic cov- At the beginning of a CNC lathe program, the startup
ered the state of the control system when the main power block may contain these G codes:
has been turned on, which sets the system default condi-
tions. A CNC
programmer should never count on these de- N1 G20 GOO G40 G99
fault conditions, since they can be easily changed by the
N1 is number, G20 selects the English
the first block
machine tool operator, without the
programmer’s knowl-
units, GOO mode. G40 cancels any active
selects the rapid
edge. If such a change does happen, the programmed set-
tool nose radius offset, and the G99 selects feedrate per rev-
tings will nor correspond to those suggested by the machine
olution mode. Reference to the absolute or incremental
tool manufacturer or the engineers who designed the con-
system is usually not required, since the lathe controls use
trol system.
addresses X and Z for the absolute dimensioning and the
A professional CNC programmer should always assume addresses U and W
for the incremental dimensioning. For
the attitude of a safe programming approach and will not lathe controls that do not support the U and addresses, W
leave anything to chance. The programmer will try to pre- the standard G91 code is used for incremental values in X
set all the required conditions under the program control, and Z axes. As in the milling example, any of the words
rather that counting on the defaults of the CNC system. programmed in the safe block can be overridden by subse-
Such an approach is not only much safer, it will also result quent change of the G commands.
in the programs that are easy to use during the setup, the
and the tool repetition due
Some controls systems do not allow certain G codes on
tool path proving to the tool
the same line. For example, G20 or G21 may not be pro-
breakage, dimensional adjustments, etc. It is also very
beneficial to the CNC machine operators, particularly to
grammed with other G codes. If you are not sure, place the
the startup block will not increase the machining cycle time
N1 G20 G17 G40 G49 G80
at all.Another benefit of the startup block is that the pro-
gram is more transportable from one machine tool to an- two or more blocks can be safely used:
other, since it does not count on the default setting of a par-
ticular machine-control combination. N1 G20
N2 G17 G40 G49 G80
66 Chapter 10
Various comments and messages in the program can be The instructions in a program block must be logical and
included within the program body as separate blocks, or as reasonable - not impossible. For instance, the first block of
parts of an existing block, mostly in cases when the mes- the program contains the following words:
sage is short. In either case, the message must be enclosed
in parenthesis (for ASCII/ISO format): N1 G20 G21 G17
- what will
Definitely not possible, but also not realistic
N330 MOO (REVERSE PART / CHECK TOOL)
actually happen and how does the control interpret such a
statement? The XY plane is all right, but what about the se-
O Example C
lection of dimensions? Obviously, both selection are not
N330 MOO possible, the block contains conflicting words, opposite di-
(REVERSE PART / CHECK TOOL) mensional units. Some controls may give an error message,
Fanuc systems What will happen? The control
will not.
The purpose of a message or comment in the program is unit will evaluate thesequence block and check for any
to inform the machine operator of a specific task that must words within the same group. The distribution of command
be performed every time the program reaches the stage of groups have been described in the section dealing with the
processing where such message appears. Comments are preparatory commands - G codes, in Chapter 8.
also useful for understanding the program at a later date
and can be used for documenting the program. If the computer system finds two or more words that be-
long to the same group, it will not return an error message,
Typical messages and comments relate to information it word of the group. In
will automatically activate the last
about setup changes, chip removal from a hole, dimen- the example of conflicting dimensional selection, it will be
sional check, cutting tool condition check and many others. the preparatory function G21 - selection of metric dimen-
A message or a comment block should be included only if sions - that becomes active. That may or may not be the se-
the required task is not clear from the program itself - no lection required. Rather than counting on some kind of elu-
need to describe what happens in each block. Messages and sive luck, make sure there are no conflicting words in any
comments should be brief and focused, as they occupy a program block.
memory space in the CNC memory.
In the example illustrating the English and metric selec-
From the practical perspective, a series of messages and tion, the preparatory command G was used. What would
comment blocks can be provided at the beginning of each happen example, the address
if, for X was used? Consider
program, to list all significant drawing information and cut- the following example:
ting tools required for the job. This subject has been
covered in Chapter 7 - here is just a reminder: N120 G01 X11.774 X10.994 Y7.056 F15.0
01001 (SHAFT - DWG B451) There are two X addresses in the same block. The control
(SHAFT TOOLING - OP 1 - 3 JAW CHUCK) system will not accept the second X value, but it will issue
an alarm (error). Why? Because there is a great difference
(T01 - ROUGH TOOL - 1/32R - 80 DEG) between the programming rules for a G code as such and
(T02 - FINISH TOOL - 1/32R - 55 DEG) for the coordinate system words. Fanuc controls allow to
(T03 - OD GROOVING TOOL - 0.125 WIDE)
place as many G codes in the same block as needed, provid-
(T04 - OD THREADING TOOL - 60 DEG)
ing they are not in conflict with each other. But the same
program more than one co-
control system will not allow to
N1 G20 G99
ordinate word of the same address for each sequence block.
N2 ...
Some other rules may also apply. For example, the words in
If the available memory space of the CNC unit is limited, a block may be programmed in any order, providing the N
using comment blocks in this manner may prove impracti- address is the first one listed. For example, the following
cal. It will be better if the messages and comments are block is legal (but very nontraditional in its order):
As a matter of good programming practices, be sure to The answer may be surprising - in both cases, the control
write the entries for each sequence block in a logical order. will ignore the I and J values and will only process the value
The block number must be the first word and is usually fol- of radius R. The order of address definition is irrelevant in
lowed by G code(-s), primary axes in their alphabetical or- this special case. The address R has a higher control prior-
der X.., Y.., Z..), auxiliary axes or modifiers (I.., J.., K..), ity than the I and J addresses, if programmed in the same
miscellaneous functions and words, and the feedrate word block. All examples assume that the control system sup-
as the last item. Select only those words needed for the indi- ports the R radius input.
vidual block:
section dealing with this subject ( Chapter 29), specifies N15 G90 G01 XI. 5 Y6 5 F18. .
that an arc or a circle can be programmed either with arc N16 G90 G01 XI. 5 Y3.4 F18.0
modifiers I, J and K (depending whether a milling or a turn- N17 G90 GOO XI. 5 Y3.4 Z1.0
ing control system is used). It also specifies that a direct ra-
dius input, using the address R, can be used. Both of the
O Example B - with modal values :
N15 XI.
N16 Y3.4
N21 G01 X15.35 Y11.348 N17 GOO Z1.0
N22 G02 X16.85 Y12.848 11.5 JO
N23 G01 . .
Both examples will produce identical results. Compare
each block of the Example A with the corresponding block
O With the direct radius R address :
block N22, if it contains both, the I and J modifiers as well structions,such as tool change, indexing table, etc.). The M
as the radius input: functions behave in a similar fashion. For example, if the
program contains a machine zero return in two consecutive
N22 G02 X16.85 Y12.848 11.5 JO R1.5 blocks (usually for safety reasons), it may look like this:
There are special cases, mentioned earlier, where the or- MO 3 MO 4 M07 M08
der of commands in the block determines the priority in
which the commands are executed. To complete the subject Functions that will be executed after the cutting tool mo-
of a block, let’s look at another situation. tion hasbeen completed:
N410 GOO X22.0 Y34.6 S850 M03 Be careful here - if in doubt, program it safe. Some mis-
cellaneous functions require an additional condition, such
and
as another command or function to be active For example,
M03 and M04 will only work if the spindle function S is in
N560 GOO Z5.0 M05
effect (spindle is rotating). Other miscellaneous functions
N410, the rapid motion is programmed to-
In the block should be programmed in separate blocks, many of them
for logical or safety reasons:
gether with two spindle commands. What will actually
happen during the program execution? It is very important
MO 2 MO 6 M10 Mil Ml 9 M30 M60 M99
to know when the spindle will be activated in relationship
to the cutting tool motion. On Fanuc and many other con-
Functions indicating the end of a program or a sub-
trols, the spindle function will take effect simultaneously
program (M02, M30, M99) should stand on their own and
with the tool motion.
not combined with other commands in the same block, ex-
In the block N560, a Z axis tool motion is programmed cept in special cases. Functions relating to a mechanical ac-
(Z5.0), this time together with the spindle stop function tivity of the machine tool (M06, M10, Mil, Ml 9, M60)
(M05). Here, the result will be different. The spindle will should be programmed without any motion in effect, for
be stopped only when the motion is one hundred percent safety. In the case of M 19 (spindle orientation), the spindle
completed. Chapter 9 covering Miscellaneous Functions rotation must be stopped first, otherwise machine may get
explains this subject. damaged. Not all M
functions are listed in the examples,
but they should provide a good understanding of how they
Similar situations exist with a number of miscellaneous may work, when programmed together with a motion. The
functions (M codes), and any programmer should find out chapter describing the miscellaneous functions also covers
exactly how a particularmachine and control system han- the duration of typical functions within a program block.
dle a motion combined with an M
function address in the
same block. Here is a refresher in the form of a list of the It never hurts to play it safe and always program these
most common results: possible troublemakers in a sequence block containing no
tool motion. For the mechanical functions, make sure the
program is structured in such a way that it provides safe
working conditions - these functions are oriented mainly
towards the machine setup.
11 INPUT OF DIMENSIONS
Addresses in a CNC program that relate to the tool posi- During the program development, it is imperative to con-
tion at a given moment are called the coordinate words. Co- sider the impact of default conditions of the control system
ordinate words always take a dimensional value, using the on program execution. The default conditions come into ef-
currently selected units, English or metric. Typical coordi- fect the moment the CNC machine tool has been turned on.
natewords are X ,Y, Z, I, J, K, R, etc. They are the basis of Once a command is issued in theMDI mode or in a pro-
alldimensions in CNC programs. Tens, hundreds, even gram, the default value may be overwritten and will remain
thousands of values may have to be calculated to make the changed from that point on. The dimensional unit selection
program do what it is intended to do - to accurately ma- in the CNC program will change the default value (that is
chine a complete part. the internal control setting). In other words, if the English
unit selection is made, the control system will remain in
The dimensions in a program assume two attributes:
that mode until a metric selection command is entered.
The units of dimensions in a program can be of two kinds To select a specific dimensional input, regardless of the
- metric or English. The reference of dimensions can be ei- default conditions, a preparatory G command is required at
ther absolute or incremental. the beginning of the CNC program:
69
70 Chapter 1
Millimeter mm
G2 0 Initial unit selection (English)
dimensioning in a part program. If the program calls a mensional systems (older terms are in parentheses):
In fact, it is unwise to mix them, even if the results for the mm/min in/min (also IPM or ipm)
Offset values (the FI and D offsets for milling A dimension in either input units must have a specified
and tool preset values for a lathe) point of reference. For example, if X35.0 appears in the
The initial selection of dimensional units can also be There are two types of references in programming:
done by a system parameter setting. The control status Reference to a common point on the part
when power has been turned on is the same as is was at
the ... known as the origin for ABSOLUTE input
the time of the last power shut off. If neither G20 nor G2 is 1
the program, the program command will always take a pri- In the example, the dimension X35.0 (and any other as
ority over any control system parameter setting. Program- well) can be measured from a selected fixed point on the
mer makes the decisions - the control system is only inter- part, called origin, or program program reference
zero, or
preting them, but it does not mean it is always ‘right’.
point - all these terms have the same meaning. The same
value of X35.0 can also be measured from the previous po-
Always program the units setting in a separate block, be-
sition, which is always the last tool position. This position
fore any axis motion, offset selection, or setting of a coordi-
then becomes the current position for the next tool motion.
nate system (G92, G50 and G54 to G59). The failure to fol-
The control system cannot distinguish one of the two possi-
low this rule may produce incorrect results, particularly
bilitiesfrom the X35.0 statement alone, so some other de-
when frequently changing units for different jobs.
scription must be added to the program.
INPUT OF DIMENSIONS 71
All dimensions in a CNC program measured from the Preparatory Commands G90 and G91
common point (origin) are absolute dimensions, as illus-
There are two preparatory commands available for the in-
Figure 11-1 and all dimensions in a program mea-
trated in ,
put of dimensional values, G90 and G9 1 ,
to distinguish be-
sured from the current position (last point) are incremental
tween two available modes:
dimensions, as illustrated in Figure 11-2.
G90 command will be used in the program default setting in the control system. It may come as a
surprise that the common default setting of the control sys-
tem is the incremental mode, rather than the absolute
mode.
After all, more advantages
absolute programming has a lot
than incremental programming and is far more popular. In
addition, even if the incremental programming is used
frequently, the program still starts up in the absolute mode.
The question is why the incremental default? The reason is
- as in many cases of defaults - the machining safety. Fol-
low this reasoning:
Absolute dimensions in the program represent When the first tool motion command is processed, the
the target locations of the cutting tool from origin chances arc that the tool target values will be positive or
have small negative values. Because the dimensional input
Incremental dimensions in the program represent mode is missing in the program, the control system 'as-
the actual amount and direction of the cutting tool sumes' the mode as incremental, which is the default value
motion from the current location of the system parameter. The tool motion, generally in X
and Y axes only, will take place to either the overtravel
Since the dimensional address X in the example, written area, in the case of positive target values, or by a small
as X35.0, is programmed the same way for either point of amount, in the case of negative target values. In either case,
reference, some additional means must be available to the the chances are that no damage will be done to the machine
programmer. Without them, the control system would use a or the part. Of course, there is no guarantee, so always pro-
default setting of a system parameter, not always reflecting gram with safely in mind.
the programmer’s intentions. The selection of the dimen-
sioning mode is controlled by two modal G commands. G91 is the standard default mode for input of dimensions.
72 Chapter 11
In the absolute programming mode, all dimensions are On many Fanuc controls, the absolute and incremental
measured from the point of origin. The origin is the pro- modes can be combined in a single program block for spe-
gram reference point also known as program zero. The ac- cial programming purposes. This may sound rather un-
tual motion of the machine is the difference between the usual, but there are significant benefits in this advanced ap-
current absolute position of the tool and the previous abso- plication. Normally, the program is in one mode only -
lute position. The algebraic signs [+] plus or (-] minus refer either in the absolute mode or in the incremental mode. On
to the quadrant of rectangular coordinates, not the direction many controls, for any switch to the opposite mode, the
of motion. Positive sign does not have to be written for any motion command must be programmed in a separate block.
address. All the zero values, such as XO, YO or ZO refer to Such controls, for example, do not allow to program an in-
the tool position at program reference point, not to the tool cremental motion along one axis and an absolute motion
motion itself. The zero value of any axis must be written along the other axis in the same block.
when necessary.
Most Fanuc control systems do allow to program both
The preparatory command G90 selected for absolute modes in the same block. All that needs to be done is to
mode remains modal until the incremental command G91 specify the G90 or the G91 preparatory command before
is programmed. In the absolute mode, there will be no mo- the significant dimensional address.
tion for any axis that is omitted in the program.
For lathe work, where G90 and G91 are not used, the
The main advantage of absolute programming is the ease switch is between the X and U axes and the Z and axes. W
of modification by the programmer or by the CNC opera- The X and Z contain the absolute values, U and are the W
A change of one dimension does not
tor. effect any other di- incremental values. Both types can be written in the same
mensions in the program. block without a problem. Here are some typical examples
for both applications:
For CNC lathes with Fanuc controls, the common repre-
sentation of the absolute
and Z, without the G90 command. Some
mode is the axis designation as
lathes may use the
X G Milling example
G90, but not those with Fanuc controls. N68 G01 G90 X12.5037 G91 Y4.5177 F18 .
Incremental Data Input - G91 The milling example shows a motion where the cutter has
to reach the absolute position of XI 2.5037 inches and - at
In the incremental mode
of programming, also called a the same tune - has to move along the Y axis by the distance
relative mode, all program dimensions are measured as de-
of 4.5 1 77 inches in the positive direction. Note the position
parture distances into a specified direction (equivalent to
of the commands G90 and G91 in the block - it is very im-
the 'distance-to-go on the control system). The actual mo- work on
'
portant, but it may not all controls.
tion of the machine is the specified amount along each axis,
with the direction indicated as positive or negative. O Turning example
The signs + or - specify direction of the tool motion, not
N60 G01 X13.56 W-2.5 F0.013
the quadrant of rectangular coordinates. Plus sign for posi-
tive values docs not have to be written, but minus sign must This example for a CNC lathe shows a tool path motion,
be used. All zero input values, such as XO, YO or ZO mean where the cutting tool has to reach the diameter of 13.56
there will be no tool motion along that axis, and do not have inches and - at the same time - has to move 2.5 inches into
to be written at all. If a zero axis value is programmed in in- the negative Z axis direction, represented by the incremen-
cremental mode, it will be ignored. The preparatory com- tal designation address W. G90 or G91 is not normally
mand for incremental mode is G9I and remains modal un- used, since the Group A of G codes is the most common
til the absolute command is programmed. There will be no one and does not support G code designation of dimen-
motion for any axis omitted in the program block. sional mode selection.
The main advantage of incremental programs is their Anytime a switch between the absolute and the
there is
portability between individual sections of a program. An incremental mode in a CNC program, the programmer
incremental program can be called at different locations of must be careful not to remain in the ‘wrong mode longer ’
the part, even in different programs. It is mostly used when than needed. The switch between the modes is usually tem-
developing subprograms or repeating an equal distance. porary, for a specific purpose. It may affect one block or
several blocks. Ensure that the original setting for the pro-
For Fanuc controlled CNC lathes, the common represen-
gram is reinstated. Remember that both the absolute and
tationof the incremental mode is the axis designation as U
the incremental modes axe modal - they remain in effect un-
and W, without the G91 command. Some lathes may use
til canceled by the opposite mode.
the G9 but not those with Fanuc controls.
1 ,
INPUT OF DIMENSIONS 73
All dimensions along the X axis on a CNC lathe can be Minimum increment (also called the least increment) is
programmed as diameter values. This approach simplifies the smallest amount of an axis movement the control sys-
lathe programming and makes the program easier to read. tem is capable of supporting. The minimum increment is
Normally, the default of most Fanuc controls is the diame- the smallest amount that can be programmed within the se-
ter programming. The control system parameter can be lected dimensional input. Depending on the dimensional
changed to interpret the X axis as a radius input: input selection, the minimum axis motion increment is ex-
pressed either in millimeters for the metric system or in
GOO X4.0 Diameter dimension when set hy a parameter inches for the English system.
In the incremental mode, the intended X axis motion will 0.001 mm .00003947 inches
In order to understand the format differences, looking Since the leading zeros suppression and the trailing zeros
back some years may be beneficial. Older control systems suppression are mutually exclusive, which one should be
(mainly the old NC systems as compared to the more mod- programmed for addresses without a decimal point? As it
ern CNC systems) were not able to accept the highest input depends on the parameter setting of the control system or
level of dimensions - the decimal point format - but the the designation of the status by the control manufacturer,
newest controls accept all the earlier program formats, the actual control status must be known. The status deter-
even when the decimal format is most common. The reason mines which zeros can be suppressed. It may be the zeroes
is compatibility with the existing programs (old programs). at thebeginning or the zeros at the end of a dimension with-
Since decimal point programming method is the latest of out a decimal point. In the extremely unlikely event that the
the four available, control systems that allow decimal point CNC system is equipped with the zero suppression feature
programming can also accept programs written many years as the only mode, programming the decimal point will not
earlier (assumed that the control and machine tool are also be possible. To illustrate the results of zero suppression,
compatible). The reverse is not true. earlier examples will be used.
This is a very important issue, because knowing how the If the English input of .625 inches is to be programmed in
control interprets a number that has no decimal point is the leading zero suppression format and applied to the X
critical for all tool motion commands and feedrates. axis, it will appear in the program as:
The full format of a dimensional address is described by The same dimension of .625 inches with the trailing ze-
the notation of +44 in the English units and +53 in the met- ros suppressed, will appear in the program as:
That means all eight available digits have to writ-
ric units.
comparison. Yes, this format will work quite nicely in because of its practicality. Here is the reason why - study it
modern programs, but don’t used it as a standard. carefully, although today the subject is more trivial than
practical. On even one decimal point is
the other hand, if
X100 . X1000000 X01 Note that the logic behind the format is the same for
dwell as for the coordinate words. The programmed format
X1000.0 X10000000 XI
will always adhere to the notation of the address. Inci-
dentally, in some fixed cycles, the dwell is expressed
by the
The leading zero suppression is much more common, be- P address, which docs not take a decimal point at all and
cause it benefits numbers with a small fractional part rather must be programmed with the leading zero suppression
than a large integer part. mode in effect. Half a second will be equal to P500.
For the metric input the results will be similar:
Decimal Point Programming
Input value comparison - millimeters All modern programming will use the decimal point for
dimensional input. Programming the decimal point, par-
Leading zeros Trailing zeros ticularly for program data requiring a fractional portion,
Decimal point
suppression suppression makes the CNC program much easier to develop and to
read at a later date.
X0.001 XI X00000001
From all program addresses that can be
the available
X0.01 X10 X0000001
used, not can be programmed with the decimal point.
all
XO.l X100 X000001 The ones that can are those that specify the data in inches,
millimeters or seconds (some exceptions exist).
XI. 0 X1000 X00001
The following two lists contain addresses where the deci-
X10.0 X10000 X0001 mal point is allowed in programs for both milling and turn-
ing controls:
X100.0 X100000 X001
X10000 . X10000000 XI X, Y, Z, I, J, K, A, B, C, Q, R
This compatibility enables many long time users to load Input Comparison
their old programs (usually in the tape format), into the new
Differences in the input format for both the English and
CNC controls - but not the other way around - usually with
metric dimensioning can be seen clearly. One more time,
minor modifications, or no modifications at all.
the same examples will be shown, as before:
Some modern CNC units do not have the ability to accept
an paper tape because they have no tape reader. To convert O English example - input of .625 inches :
any tapes that contain good programs, there are two options Full format X00006250
- one, have someone to install a tape reader in the control, if
No leading zeros X6250
possible and justified (probably not). The other method is No trailing zeros X0000625
to store the contents of a tape in the memory of a desktop Decimal point X0.625 or X.625
computer. This method is very inexpensive and offers
much better storage options than a paper tape. With suit- © Metric example - input of 0.42 mm :
able software and a portable tape reader, the task is not im-
Full format X00000420
possible. Keep also in mind that there are companies spe-
No leading zeros X420
cializing in this kind of work.
No trailing zeros X0000042
Decimal point X0.42 or X.42
The dimensional data in the metric system assume 0.001
mm minimum increment, while in the English system the
increment is .0001 of an inch (leading zero suppression CALCULATOR TYPE INPUT
mode is in effect as a default):
Both types of CNC machines, machining centers and On the CNC lathes, all three alternatives may exist, de-
lathes, use spindle rotation when removing excessive mate- pending on the control system. For the CNC milling sys-
rial from a part. The rotation may be that of the cutting tool tems, peripheral spindle speed is not applicable, but the
(milling) or the part itself (lathes). In both cases, the activi- spindle speed code number and the direct spindle speed
ties of the machine spindle and the working feedrate of the are. The spindle speed selection by special code number is
cutting tool need to be strictly controlled by the program. an obsolete concept, not required on modern controls.
These CNC machines require instructions that relate to the
selection of a suitable speed of the machine spindle and a The spindle speed designation S is not sufficient to be
cutting feedrate for a given job.
programmed by itself. In addition to the selected spindle
speed address, certain additional attributes are necessary as
There are several methods to control the spindle and cut- well. These are attributes that control the spindle function
ting feedrate and they all depend mainly on the type of the environment. For example, if the spindle speed is specified
CNC machine and the current machining application. In as S400 program, the programming instruction is not
in the
this chapter, we look at the spindle control and its program- complete, because the spindle function stands by itself in
ming applications. the program. It does not include all information the control
system requires for the spindle data. A spindle speed value
SPINDLE FUNCTION that is set, for example, to 400 r/min or 400 m/min or 400
in/min (depending on the machining application), does not
contain all necessary information, namely, the spindle rota-
The program command relative to spindle speed is con- tion direction.
CNC system by the address S. The program-
trolled in the
ming format of the S address is usually within the range of Most machine spindles can be two directions -
rotated in
1to 9999 and no decimal point is allowed: clockwise or counterclockwise depending on the type and
,
have spindle speed available up to five digits, in the range M03 and M04.
of 1 to 99999, within the S address range:
DIRECTION OF SPINDLE ROTATION
SI to S99999
Thinking in terms of right and left, up and down, clock-
The maximum spindle speed range available in the con-
wise and counterclockwise, and similar directional terms, is
trol must always be greater than the maximum spindle
thinking in terms that are relative to some known reference.
speed range of the machine itself. It is quite typical that vir-
To describe a spindle rotation as clockwise (CW), or as
tually all control systems support a much greater range of
counterclockwise (CCW), some established and standard
spindle speeds than theCNC machine allows. In program- reference method is needed, in this case a reference point of
ming spindle speeds, the limitation is always caused by the
view (reference viewpoint).
machine unit, not by the control system.
The direction of spindle rotation is always relative to the
Spindle Speed Input point of view that is established from the spindle side of the
machine. This part of a machine that contains the spindle,
The address S machine spindle function,
relates to the
and is generally called the machine headstock. Looking
and must always be assigned a specific numeric value in
from the machine headstock area into the direction along
the CNC program. There are three alternatives as to what
spindle center line and towards its face, establishes the cor-
the numeric value (input) of the spindle function may be:
rect viewpoint for defining and CW CCW
rotation of the
Spindle speed code number .. old controls - obsolete spindle. For CNC drills, milling machines and CNC ma-
chining centers, the reference point of view is quite simple
Direct spindle speed r/min
For CNC lathes, the rules are exactly the
..
to understand.
Peripheral spindle speed .. ft/min or m/min same, and will be described shortly.
77
78 Chapter 12
CW
<d
CCW Tailstock
Figure 12-2
Figure 12-4
view of a slant bed two axis CNC lathe.
Typical
CW and CCW directions only appear to be reversed Spindle rotation direction as viewed from the tailstock
SPINDLE CONTROL
79
Direction Specification
This second example B is technically correct, but logi-
If the spindle rotation clockwise, M03 cally flawed. There is no benefit in splitting the spindle
is function is used
program speed and spindle rotation into two blocks. This method
in the - if the rotation is counterclockwise, M04
function is used in the program. makes the program harder to interpret.
Since the spindle speed S in the program is dependent on G Example C - Milling application :
If the spindle speed and rotation are programmed together been switched on just prior to running this program. On the
in the same block, the spindle speed and the spindle other hand, M03 will activate the spindle rotation, if an-
rotation will start simultaneously other program was processed
earlier. This could create a
possibly dangerous situation, so follow a simple rule:
If the spindle speed and rotation are programmed in
separate blocks, the spindle will not start rotating until both
the speed and the rotation commands have been processed Program M03 or M04 together with or
after the S address, not before.
Spindle Startup
O Example D - Turning application with G50 :
N1 G20 based on the CSS value of 420 (ft/min) and the current part
N2 G17 G40 G80 diameter at XI 3.625. The next example E is correct but not
N3 G90 GOO G54 X14 0 Y9.5 . recommended (see caution box above).
N4 G43 Z1.0 HOI S600 M03 (SPEED WITH ROTATION)
N5 ... O Example E - Turning application with G50 :
These examples are only technically correct methods for order. This method may result in a slightly longer program,
a spindle start. All contain selected rotation at the begin- but it be easier to read and maintain
will it, mainly by CNC
ning of a program and cover both, milling and turning ap- operators with limited experience.
plications. The example for the beginning of a program has
been selected intentionally, because for any first tool in the Spindle stop function can be programmed as a separate
program, there is no active speed or rotation in effect (nor- block, for example:
speed selection and its rotation in the same block and for
is Ml 9.
This function is most commonly used to set a ma-
In CNC
machine tool operation, the M19 function en- SPINDLE SPEED - R/MIN
ables the machine operator to place a tool into the spindle
manually and guarantees a proper tool holder orientation.
Later chapters will provide more details about spindle ori-
When programming CNC machining centers, designate
the spindle speed directly in revolutions per minute (r/min).
entation and its applications, for example, in single point
boring cycles. A basic block that contains spindle speed of 200 r/min, for
example, will require this data entry:
WARNING - An incorrect tool holder orientation
may result in a damage to the part or machine.
N230 S200 MO
Based on the surface speed and the cutter diameter (or the
machine spindle speed can be cal-
part diameter for lathes),
culated in revolutions per minute, using one mathematical
formula for English units system and another when metric
units are programmed.
ns" where . .
High speed steel tools will run slower n = Constant 3.141 5927
than carbide tools in the same material. D = Diameter in mm (cutter diameter for milling,
or part diameter for turning)
O Example
CONSTANT SURFACE SPEED
Peripheral speed for the selected material is 150 ft/min,
and the cutting tool diameter is 1.75 inches:
On the CNC lathes, the machining process is different
from the milling process. The turning tool has no diameter
r/min = (12 x 150) / (3.1415 x 1.75)
and the diameter of a boring bar has no relationship to the
= 327.4
= 327 r/min spindle speed. It is the part diameter that is the diameter
used for spindle speed calculations. As the part is being
Many programming applications can use a shorter for- machined, the diameter changes constantly. For example,
mula, without losing any significant accuracy: during a facing cut or during roughing operations the diam-
eter changes - see illustration in Figure 12-7. Programming
the spindle speed in r/min is not practical - after all, which
of the many diameters should be selected to calculate the
r/min? The solution is to use the surface speed directly in
the lathe program.
For milling,
using the G50 (or G92) command:
this distinction normally does not exist and
spindle speed in r/min is always assumed.
N1 G20
N2 G50 X16.0 Z5.0 T0100
By programming the surface speed command G96 for
N3 G96 S400 M03
turning and boring, the control enters into a special mode,
known as the Constant Surface Speed or CSS. In this mode,
the actual spindle revolutions will increase and decrease In this quite common application, the actual spindle
automatically, depending on the diameter being cut (cur- speed will be based on the current diameter of 16 inches,
rent diameter). The automatic Constant Surface Speed is resulting in 95 r/min in block N3. In some cases, this will
built in the control systems available for most CNC lathes. be too low. Consider another example:
It is a feature that not only saves programming time, it also
creating a better surface finish. On large CNC lathes, G50 setting of the X axis diameter
is quite large, say 024.0 inches. In the previous example,
Figure 12-7 shows a typical example, when a facing cut the target diameter of the next tool motion was not impor-
starts atX6.2 (06.2), and faces the part to the centerline (or tant, but in this case it is. For example:
slightly below). G96 S375 was used in the program, and
6000 r/min was the maximum spindle speed of the lathe. N1 G20
N2 G50 X24.0 Z5.0 T0100
N3 G96 S400 M03
375 ft/min N4 GOO X20.0 T0101 M08
G96 S375
06.20 231 r/min
06.00 239 r/min 6000 r/min In the Example 2, the initial tool position is at X24.0 and
05.50 260 r/min max. spindle the tool motion terminates at X20.0, both values are diame-
05.00 286 r/min speed
ters.This translates to an actual motion of only 2.0 inches.
04.50 318 r/min At the X24.0, the spindle will rotate at 64 r/min, at X20.0 it
04.00 358 r/min will rotate at 76 r/min. The difference is very small to war-
03.50 409 r/min rant any special programming. It is different, however, if
03.00 477 r/min the starting position is at a large diameter, but a tool moves
02.50 573 r/min to a much smaller target diameter.
02.00 716 r/min
01.50 955 r/min O Example 3a
01.00 1432 r/min
00.50 2865 r/min From the initial position of 024.0 inches, the tool will
00.25 5730 r/min move to a rather small diameter of 2.0 inches:
00.00 6000 r/min = spindle max.
N1 G20
Figure 12-7
N2 G50 X24.0 Z5.0 T0100
Example of a facing cut using constant surface speed mode G96 N3 G96 S400 M03
N4 GOO X2.0 TO 101 M08
Although only selected diameters are shown in the illus-
tration, along with their corresponding revolutions per min-
Spindle speed at the start of program (block N3) will be
ute, the updating process is constant. Note the sharp in-
the same as in previous example, at 64 r/min. In the next
crease in r/min as the tool moves closer to machine center
block (N4), the speed calculated for 02.0 inch will be 764
line. When the tool reaches X0 (00.0), the speed will be at
r/min, automatically calculated by the control. This rather
itsmaximum, within the current gear range. As this speed
large change in spindle speeds may have an adverse effect
may be too high in some cases, the control system allows
on some CNC lathes. What may happen is that the cutting
setting of a certain maximum, described later.
tool will reach the 02.0 inch before the spindle speed fully
To program a peripheral speed for a CNC lathe, there are accelerates to the required 764r/min. The tool may start re-
several options. In the following three examples, the most moving material at a speed much slower than intended. In
important ones will be examined. The gear change func- order to correct the problem, the CNC program needs to be
tions are omitted for all examples. modified:
84 Chapter 12
O Example 3b : Whenever the CSS spindle mode is active and the tool
reaches spindle center line at X0, the result will normally
The modification takes place in block N3. Instead of pro- be the highest spindle rotation possible, within the active
gramming a constant surface speed mode, program the di- gear range. It is paradoxical, but that is exactly what will
rect r/min for the target of 02.0 inches, based on 400 ft/min happen. Such situation is acceptable when the part is well
surface speed. The r/min has to be calculated first, then the mounted, does not extend from the chuck or fixture too far
CSS setting will be programmed in a subsequent block: out, the tool is strong and robust, and so on. When the part
is mounted in a special fixture, or an eccentric setup is used,
N1 G20 when the part has a long overhang, or when some other ad-
N2 G50 X24.0 Z5.0 T0100 verse conditions are present, the maximum spindle speed at
N3 G97 S764 M03
the center line may be too high for operating safety.
N4 GOO X2.0 T0101 MO
N5 G96 S400 There is a simple solution to this problem, using a pro-
gramming feature available for Fanuc and other controls.
The CSS mode can be used with a preset highest limit,
In the example, at the 024.0 (X24.0 in N2), the actual
specified in revolutions per minute. The program function
r/min would be only 64 r/min. At the 02.0 (X2.0 in N4),
for the maximum spindle speed setting is normally G50.
the r/min will be 764. The cutting tool may reach X2.0 po-
This maximum setting is sometimes called maximum spin-
sition before the spindle speed has accelerated to full 764
dle speed clamping. Do not confuse this G50 with its other
r/min, if it is not calculated and programmed earlier.
meaning, position register preset. Here is an example:
This technique is only useful if the CNC lathe does not
01201 (SPINDLE SPEED CLAMP)
support automatic time delay. Many modem lathes have a
N1 G20 T0100
built-in timer, that forces the cutting tool to wait before ac-
N2 G50 X9.0 Z5.0 S1500 (1500 R/MIN MAX)
tual cutting, until the spindle speed has fully accelerated. N3 M42 (HIGH SPINDLE RANGE)
N4 G96 S400 M03 (CSS AND 400 FT/MIN)
Modem CNC lathes today do not use the G50 setting and N5 GOO G41 X5.5 ZO T0101 MO 8
use the Geometry Offset setting instead. In this case, the ac- N6 G01 X-0.07 F0 .012 (BELCW CENTER LINE)
tual starting diameter at machine zero position is normally N7 GOO Z0.1
not known. Some experience can be useful in this case, N8 G40 X9.0 Z5.0 T0100
otherwise program a short dwell before the actual cutting. N9 M01
Maximum Spindle Speed Setting What actually happens m program 01201? Block N 1 se-
lects English units of measurement. The critical block N2
When the CNC lathe operates in the Constant Surface has two meanings
Speed mode, the spindle speed is directly related to the cur-
The smaller work diameter Sets only the tool coordinate position, as in:
rent part diameter. the is, the
greater die spindle speed will be. So die natural question is
- what will happen if the tool diameter is zero'! It may seem G50 X9.0 Z5.0
impossible to ever program a zero diameter, but there are at Also sets the maximum r/min to 1500 as in:
ter line operations. All drilling, center drilling, tapping and Block N3 selects the spindle gear range; block N4 sets
similar operations are programmed at the zero diameter the CSS mode, using 400 ft/min surface speed. Spindle ro-
(X0). These operations are always programmed in the di- tation M03 is called in the same block. In block N5, the tool
rect r/min mode, using G97 command. In G97 mode, the makes a rapid motion towards 05.5 and the part front face.
spindle speed is controlled directly, r/min does not change. During rapid motion, tool nose radius offset and the cool-
ant function are activated. The spindle speed at 05.5 will
The second case of a zero diameter off a is when facing
be 278 r/min, using a formula described earlier in this chap-
solid part all the way a different
to the center line. This is
ter. Next block N6 is the actual facing cut. At the cutting
situation. For all operations at X0, the cutting diameter
feedrate of 0.012 in/rev, the tool tip faces off the blank to
does not change, because a direct r/min is programmed.
the center line. In reality, the end point is programmed on
During a face cutting operation, the diameter changes all
the other side of spindle center line. The tool point radius
the time while material removal continues until the tool
size must be taken into consideration when programming
reaches the spindle center line. No, don’t reach for the for-
with the tool nose radius offset and to the machine center
mulas explained earlier. Any calculation with a diameter in
line. A special section later explains what exactly will hap-
the formula being zero, will result in error! Rest assured,
pen during this cut.
there will not be 0 r/min at the center line of the spindle in
the G96 mode. Return to Figure 12-7 for illustration.
SPINDLE CONTROL 85
Block N7 moves the tool tip .100 inches away from the N15 G50 X8.5 Z2.5 Single meaning
face, at a rapid rate. In the remaining two blocks, the tool
will rapid to the indexing position with a cancellation of ra-
N40 G50 Z4.75 S700 Double meaning
dius offset in N8 and an optional program stop is provided
in block N9. From these examples, G50 command should be easy to
understand. There are two, completely independent, mean-
Now, think of what happens in blocks N5 and N6. The
spindle will rotate at the speed of 278 r/min at the 05.5.
ings of the G50 command. Either one can be programmed
Since the CSS mode is in effect, as the tool tip faces off the
in a single block, or they can be separated into two individ-
ual blocks.
part, the diameter is becoming smaller and smaller while
the r/min is constantly increasing. If the CNC lathe supports G92 instead of G50, keep in
mind that they have exactly the same meaning and purpose.
Without the maximum spindle speed limit in block N2,
the spindle speed at the center line will be equivalent to the
On lathes, the G50 command is more common than the
7t x D x r/min
O Example - Metric units :
ft / min
12
If the preset value in the program is G50 SI 200 and the
it
selected as
reaches the 043.768 mm:
O EXAMPLE:
CSS Calculation
To calculate the Cutting Speed in metric units:
The Constant Surface Speed (CSS) is required for most
turning and boring operations on a CNC lathe. It is also the 7t x D x r/min
basic source of cutting data, from which the spindle speed m/min
is calculated for virtually all machining center operations. 1000
Now - consider a very common scenario - the CNC opera-
tor has optimized the current cutting conditions, including
the spindle speed, so they are very favorable. Can these
O EXAMPLE:
conditions be applied to subsequent jobs? A 07 mm end mill works very well at 1 850 r/min - what
is its cutting speed in m/min?
Yes, they can - provided that certain critical requirements
will be satisfied: m/min = (3.14 x 7 x 1850) / 1000 = 40.66
Machine and pari setup are equivalent
The G code Group A is the most commonly used In milling, the programming command (G code) for the
on Fanuc controls and in this publication. feedrate per minute is G94. For most machines, it is set au-
tomatically, by the system default and does not have to be
written in the program. For lathe operations, feedrate per
Another type of a special feedrate is called the inverse
time feedrate.It is very seldom used and is not discussed in
minute is used very seldom. In Group A, the G code for
feedrate per minute is G98, for Groups B and C it is G94.
this handbook.
CNC lathes use primarily feedrate per revolution mode.
87
88 Chapter 13
For the CNC lathe work, the feedrate is not measured in Tool diameter [
M ]
or the tool nose radius T
[ ]
0.42937 mm/rev will be programmed as F0.429 on most bility number one, to assure the safety of the people
and
controls. Many modern control systems accept feedrate of equipment. Safe speeds and feeds are only two aspects of
up to six decimal places for English units and five decimal safety awareness in CNC programming.
grammed with up to six decimal places feedrate precision and clearances. In contouring, it means that in order to pro-
for threading only. gram a sharp corner on a part, the tool motion along the X
axis in one block will have to change into a motion along
The programming command for the feedrate per revolu- the Y axis in the next block. To make thechange from one
tion is G99. For most lathes, this is the system default, so it cutting motion to another, the control must slop the X mo-
does not have to written in the program, unless the opposite tion first, then start the Y motion. Since it is impossible to
command G98 is also used. start at a full feedrate instantly, withoutan acceleration,
and equally impossible to stop a feedrate without a deceler-
It is relatively more common to program a feedrate per
ation, a possible cutting error may occur. This error may
minute (G98) for a CNC lathe program, than it is to pro-
cause the sharp corners on the profile to be cut with an un-
gram a feedrate per revolution (G95) in a milling program.
desirable overshoot, particularly during very high feedrates
The reason is that on a CNC lathe, this command controls or extremely narrow angles. It only occurs during a cutting
the feedrate while the spindle is not rotating. For example,
motion in G01, G02, G03 modes, not the rapid motion
during a barfeed operation, a part stopper is used to ‘push’ mode GOO. During the rapid motion, the deceleration is au-
the bar to a precise position in the chuck or a collet, or a tomatic - and away from the part.
pull-put finger to ‘pull’ the bar out. Rapid feed would be too
fastand feedrate per revolution is not applicable. Feedrate In a routine CNC
machining, there is a small chance of
per minute is used instead. In cases like these, the G98 and ever encountering such an error. Even if the error is present,
G99 commands are used in the lathe program as required. it will likely be within tolerances.
Both commands are modal and one cancels the other.
If the error does need correction, Fanuc controls provide
two commands that will correct the problem:
FEEDRATE SELECTION
G09 Exact stop (one block only)
To one that is most suitable for a
select the best feedrate,
given job, some general knowledge of machining is useful. G61 Exact stop mode (modal)
This is an important part of programming process and
should be done carefully. A feedrate selection depends on
many factors, most notably on: Exact stops increase the cycle time. For programs used
on older machines, they may be required in some cases.
FEEDRATE CONTROL 89
01304
Exact Stop Command (G61 CUTTING)
The first of two commands that control the feedrate when N13 GOO X15.0 Y12.0
machining around corners is G09 command - Exact Stop. N14 G61 G01 X19.0 F90.0
This is an unmodal command and has to be repeated in ev- N15 Y16.0
ery block, whenever it is required. N16 X15.0
N17 Y12.0
In the program example 01301, there is no provision for N18 G64
acceleration and deceleration. That may cause uneven cor-
ners, due to the rather high feedrate of F90.0 (in/min):
Note that the program example 01304 is identical in re-
01301 (NORMAL CUTTING) sults to 01301. In both cases, the exact stop check applies
to all cutting motions - unmodally in 01301, modally in
N13 GOO X15.0 Y12.0 0 1 304. Also note the additional block N 1 8. It uses the G64
N14 G01 X19.0 F90.0 command normal cutting mode. The normal
- cutting mode
N15 Y16.0 is the default setting when the machine power is turned on
N16 X15.0 and is not usually programmed. Figure 13-1 illustrates the
N17 Y12.0
tool motion with and without the G09/G61 command. The
large overshoot amount is exaggerated only for the illustra-
By adding the G09 exact stop command in the program, tion, in reality it is very small.
the motion in that block will be fully completed before the
motion in the other axis will start. OVERSHOOT
Tn
01302 (G09 CUTTING) I
r
i
V 'J
N13 GOO X15.0 Y12.0 !
V \
|
\
N14 GO 9G01 X19.0 F90.0
N15 GO 9Y16.0
N16 GO 9X15.0 Target point Target point
N17 Y12.0
t t
V
(V.y
01303 (GO 9 CUTTING) Feedrate control around corner - Exact Stop commands
The overshoot is exaggerated for clarity
crease in size for all external arcs. Since the cutting feed-
by system default, it represents the normal cutting mode.
rate does not change automatically during the cutter radius
When this command is active, the exact stop check G61
will not be performed, neither will the automatic corner
offset mode, it must be adjusted in the program. Usually,
this adjustment is not necessary, except in cases where the
override G62 or the tapping mode G63. That means the ac-
surface finish is of great importance or the cutter radius is
celeration and deceleration will be done normally and the
very large. This consideration applies only to circular mo-
feedrate overrides will be effective. This is the most com-
tions, not to linear cutting.
mon default mode for the control system.
same program. To compare the G62 and the G64 modes, be adjusted higher or lower with consideration of the cutter
;
see illustration in Figure 13-2. radius, the type of radius cutting (outside or inside arc) and
the cutting conditions. The larger the cutter radius, the
more reason the cutting feedrate for programmed arcs will
need some correction.
I "r~ 1 T
TKTy V > In case of arc cutting, the equidistant tool path (after ap-
I
may be much larger or much
plying cutter radius offset)
y/j / // ///
smaller than the arc programmed to drawing dimensions.
k
yyyyz i
/
/////////
The feedrate for compensated arc motions is always
(
/|2\
+
Wm 0 t
v///////A based on the linear motion feedrate. Look for a more de-
tailed explanation in Chapter 29, with an illustration and
examples. First, here is the standard formula for calculating
a linear feedrate:
Corner override mode G62 and default G64 cutting mode os’ where . .
arcs, from the practical point of view. At this point, the fo- justments are influenced by the side of the machined arc -
cus is on the understanding of the constant feedrate, rather outside or inside arc. The linear feedrate should be in-
than its application. creased for outside arcs and decreased for inside arcs.
In programming, normal process is to calculate the coor- F° r outside arcs, the feedrate is generally adjusted up-
dinate values for all the contour change points, based on the wards, to a higher value:
part drawing. The cutter radius that produces the center
line of the tool path is typically disregarded. When pro-
gramming arcs to the drawing dimensions, rather than to
the center line of the cutter, the feedrate applied to the pro-
grammed arc always relates to the programmed radius, not
the actual radius cut at the tool center. cs3 where . .
When the cutter radius offset is active and the tool path of F„ = Feedrate for outside arc
the arc is by the cutter radius, the actual arc radius
offset F, = Linear feedrate
that is cut can be either smaller or larger, depending on the R = Outside radius of the part
offset value for the cutting tool motion. r = Cutter radius
FEEDRATE CONTROL 91
For inside arcs, the feedrate is generally adjusted down FEEDHOLD AND OVERRIDE
wards, to a lower value:
The maximum programmable feedrate for the CNC ma- stop not only a cutting feed with G01, G02, G03 in effect -
chines is determined by the machine manufacturer, not the it will also stop the rapid motion GOO. Other program func-
control manufacturer. For example, the maximum feedrate tions will remain active during a feedhold state.
F max
vs" where . . This rotary switch has marked settings or divisions, indi-
cating the percentage of programmed feedrate. typical A
F max = Max. allowed feedrate per revolution in/rev range of a feedrate override is 0 to 200%, where 0 may be
R max = Lower of the maximum feedrate,
no motion at all or the slowest motion, depending on the
selected from the X and the Z axis
r/min = Spindle speed in revolutions per minute
machine. The 200% setting doubles all programmed feed-
rates. A programmed feedrate of 12.0 in/min (FI 2.0) is the
The Rmax is either in in/min or mm/min, depending on the 100% feedrate. If the override switch is set to 80%, the ac-
input units selected. In Chapter 38 are details relating to the tual cutting feedrate will be 9.6 in/min. If the switch is set to
feedrate limits for threading. 1 10%, the actual cutting feedrate will be 13.2 in/min.
92 Chapter 13
This simple logic applies to metric system as well. If the M48 function enables the CNC operator to use the feed-
programmed feedrate 300 mm/min, it becomes 100%.
is rate override switch freely; theM49 function will cause
An 80% feedrate override results in 240 mm/min cutting feedrates to be executed asprogrammed, regardless of the
feedrate and a 110% feedrate override setting is equivalent on the control panel. The
feedrate override switch setting
to 330 mm/min for the cutting tool. most common usage of the two functions is for tapping or
threading without a cycle, where the exact programmed
The feedrate override switch works equally well ioxfeed- feedrate must always be maintained. The following exam-
rates per revolution. For example, the programmed feed- ple shows the programming technique:
rate of .014 in/rev will result in actual feedrate of .0126
in/rev with 90% feedrate override and .0182 in/rev with N10 S500 M0 (USING TAP 12 TPI)
1 30%feedrate override. If a very precise feedrate per spin-
dle revolution is required, be careful with the override set- N14 GOO X5.0 Y4 .0 M0 8
tings. For example, programmed feedrate is F0.012, in N15 Z0 .25
inches per revolution. A change by one division on the N16 M49 (DISABLE FEEDRATE OVERRIDE)
N17 G01 Z-0.625 F41.0 M0
override dial will either increase or decrease the pro-
N18 Z0.25 M0
grammed value by a full 10 percent. Therefore, the feedrate N19 M48 (ENABLE FEEDRATE OVERRIDE)
will be .0108 at 90%, .01 20 at 100%, .0132 at 10%, etc. In 1
N20 GOO X. Y. M0 5
.
most cases, the precise feedrate is not required, but keep in N21 M0 3
mind that some feedrates will not be accessible, for exam-
ple, a feedrate of .0115 in/rev, because of the fixed 10% in-
crements on the override switch. The tapping occurs between blocks N 1 6 and N 1 9 and the
feedrate override is disabled for these blocks.
In single point threading mode G32, the feedrate override
switch is disabled. Feedrate override is also disabled for
tapping cycles G84 and G74 on machining centers, and for
E ADDRESS IN THREADING
single point threading cycles G92 and G76 on lathes. If the
tapping mode is used for milling systems, with the com- Some older CNC lathes use the feedrate address E for
mand G63, both the feedrate override and the feedhold threading, rather than the more common address F.
tool selection, available for many modern CNC machining numbered in a consecutive order. It is important to know
that the pocket numbers are fixed for each pocket. The
centers.
magazine can be operated manually during setup and auto-
matically, through the CNC program or MDI. The number
Tool Storage Magazine
of magazine pockets is the maximum number of tools that
typical CNC machining center (vertical or horizontal)
A can be changed automatically on that machining center.
isdesigned with a special tool magazine (sometimes called
Within the travel of the tool magazine is one special posi-
a tool carousel), that contains all tools required by the pro-
gram. This magazine is not a permanent storage for the tion,used for the automatic tool change. This position is
commonly aligned with the tool changer and is commonly called the
tools, but many machine operators keep the
A waiting position, the stand-by position, the tool-ready posi-
used tools there at all times, if possible. typical 20-tool
tion, or just the tool change position.
magazine is illustrated in Figure 14-1.
93
94 Chapter 14
Fixed Tool Selection waiting position within the tool magazine. This can happen
simultaneously, while the machine using another tool to
A machining center that uses a fixed tool selection re-
is
N67 T04 Do not confuse the meaning of address T used with the
N68 MO fixed tool selection and thesame address T used with the
random tool selection. The former means the actual num-
simply means to bring number 4 into the spindle (the
tool
ber of the magazine pocket the latter means the tool num-
,
last method is preferred). What will happen to the tool that ber of the next tool. The tool call is programmed earlier
is in the spindle at that time? The M06 tool change function
than it is needed, so the control system can search for that
will cause the active tool to return to the magazine pocket it
tool while another tool is doing productive work.
came from, before the new tool will be loaded. Usually, the
tool changer takes the shortest way to select the new tool.
Registering T ool Numbers
Today, type of a tool selection is considered impracti-
this
Computers in general, and CNC systems in particular,
cal and costly in a long run. There is a significant time loss
can process given data very quickly and with the utmost
during tool changes, because the machine tool has to wait
precision. For the CNC work, the required data must be
until the selected tool is found in the magazine and placed
input first, to make the computer work in our favor. In the
into the spindle. The programmer can somewhat improve
random tool selection method, the CNC operator is free to
the efficiency by selecting tools and assigning tool num-
place any tool into any magazine pocket, as long as the ac-
bers carefully, not necessarily in the order of usage. Exam-
tual setting is registered into the CNC unit, in the form of
ples in this handbook are based on a more modern type of
control system parameters. There is no need to worry too
the tool selection, called the random memory’.
much about system parameters, just accept them as the col-
lection of various system settings. Registering tool num-
Random Memory Tool Selection
bers has own
its entry screen.
This feature is the common
on modern machining
most
During the machine setup, the CNC operator will place
centers. It also stores all machine a part in
tools required to
the required tools into magazine pockets, writes down the
the tool magazine pockets, away from the machining area.
numbers (which tool number is in which pocket number),
The CNC programmer identifies each tool by a T number,
and registers the information into the system. Such an op-
usually in the order of usage. Calling the required tool
eration is a normal part of the machine tool setup and vari-
number by the program will physically move the tool to the
ous shortcuts can be used.
TOOL FUNCTION 95
pose of the T function for milling systems is to rotate the must be selected in a clear area
magazine and place the selected tool into the waiting posi- The next tool must be previously
tion, where the actual tool change can take place. This next selected by a T function
tool search happens while the control processes blocks fol-
lowing the T function call.
96 Chapter 14
A typical program sample illustrates the toolchange be- O Example for illustrations :
Figure 14-2 this is not necessary, but may come very useful for repeat-
ATC example - Blocks N5 1 to N78 1current status) ing the tool later. Block N79 is the actual tool change. The
T02 in the spindle will be replaced with T03 that is cur-
rently in the waiting position.
the T04 at the block end. To save time, the next tool should
be placed into the waiting position as soon as possible after
the tool change.
TOOL MAGAZINE SPINDLE were made in some examples. There are many designs of
ATC’s on various machines and they vary greatly from one
machine manufacturer to another. Needless to say, the
T03 method of programming varies for different types, some-
T04 times quite a bit. The machine tool changer, once it is setup,
a -f
-
J
will automatically index the programmed cutting tool, in
V- t* '
change, while the current tool works. This machine feature Maximum Tool Length
always guarantees the same tool change time. The typical
The tool length in relation to the ATC, is the projection of
time for the tool changing cycle can be very fast on modern
a cutting tool from the spindle gauge line towards the part.
CNC machines, often measured in fractions of a second. The longer the tool length, the more important it is to pay
The maximum number of tools that can be loaded into attention to the Z axis clearance during the tool change.
many as 400 or more. A small CNC vertical machining is extremely undesirable. Such a condition
ture or the part
Apart of the tool changer features, programmer and ma- trates the concept of the tool length.
chine operator should be also aware of other technical con-
siderations that may influence the tool change under pro-
gram control. They relate to the physical characteristics of
cutting tools when mounted in the tool holder:
size may be used in every pocket of the tool magazine. The concept of tool length
Many machine manufacturers allow for a slightly larger
tool diameter to be used, providing the two adjacent maga-
Maximum Tool Weight
zine pockets are empty (Figure 14-5).
Most programmers will usually consider the tool diame-
ter and the tool length, when developing a new program.
However, some programmers will easily forget to consider
the tool overall weight. Weight of the cutting tool does not
generally makes a difference programming, because the
in
majority of tools are lighter than the maximum recom-
mended weight. Keep in mind that the ATC is largely a me-
chanical device, and as such has certain load limitations.
The weight of the tool is always the combined weight of the
cutting tool and the tool holder, including collets, screws,
pull studs and similar parts.
A programmer does not have to know every detail related Incidentally,each step of the tool change cycle can usu-
to the automatic tool changer actual operation. It is not a vi- ally be executed through the MDI (Manual Data Input), us-
tal knowledge, although it may be quite a useful knowledge ing special M
functions. These functions are only used for
in many applications. On the other hand, a CNC. machine service purposes, via the MDI operation and cannot be
operator should know each and every' step of the ATC cycle used in a CNC program. The benefit of this feature is that a
inside out. tool changing problem can be traced to its cause and cor-
rected from there. Check instructions for each machine to
Asan example, the following description is relevant to a get details about these functions.
typical CNC
vertical machining center and may be a little
have a step-by-step cycle available with a special rotary matic tool changer. Some of the important ones are the
switch, usually located near the tool magazine. number of tools used, what tool number is registered to the
spindle (if any) at the start of a job, whether a manual tool
In the following example, a tool changer with a double change is required, whether an extra large tool is used, etc.
arm swing system is used. It will lake the cutting tool from
the waiting position and exchange it with the tool currently In the next several examples, some typical options will be
in the machine spindle. presented - these examples can be used directly, if the CNC
machine tool uses exactly the same format, or they can be
The ATC
a process that will execute the following or-
is adapted to a particular working environment. For the fol-
der of steps when the tool change function M06 is pro- lowing examples, some conditions must be established that
grammed. All steps described are quite typical, but not nec- will help to understand the subject of programming a tool
essarily standard for every CNC machining center, so take change much better.
them only as a close example:
To program the ATC successfully, all that is needed is the
1. Spindle orients programming format for three tools - the first tool used, the
2. Tool pot moves down tools used in the middle of the program and the last tool
3. Arm rotates 60 degrees CCW used in the program. To make the whole concept even eas-
Tool unclamped the magazine and spindle)
ier to understand, the examples will use only four tool num-
4. is (in
5. Arm moves down bers - each tool number will represent one of the four avail-
6. Arms rotates 1 80 degrees CW able programming formats:
7. Arm moves up
8. Tool is clamped T01 ... tool designation represents the
struction manual for the machine usually lists relevant de- last tool used in the CNC program
tails about the ATC. tool designation represents an empty tool
T99 ...
M05 function) In allexamples, the first three tools will always be used,
The spindle must be stopped (with the
the empty tool only if required. Hopefully, these examples
The tool changing axis must be at the home position
will illustrate the concept of many possible ATC applica-
(machine reference position)
tions. Another possible situation is in situations where only
For CNC vertical machining centers, the tool changing one tool is used in the CNC program.
spindle with the M05 function (spindle stop) before the tool tool todo the job. In this case, the tool is generally mounted
change cycle is executed. in the spindle during setup and no tool calls or tool changes
are required in the program:
TOOL FUNCTION 99
< . . . T01 working . . . > To fill the table, start from the program top and find every
occurrence of the T address and M06 function. All other
N26 GOO Z.. MO (T01 MACHINING DONE) data are irrelevant. In the example 01402, the table will be
N27 G28 Z.. MO (T01 TO Z-HOME) filled as a practical sample of usage.
N28 GOO X. Y. . (SAFE XY POSITION)
N29 M30 (END OF PROGRAM) Any Tool in Spindle- Not the First
%
This is the most common method of programming an
Unless the tool is in the way of part changing, it remains ATC. The operator sets all tools in the magazine, registers
in the spindle permanently for the job. measured in the spindle.
the settings but leaves the last tool
On most machines, this tool should not be the first tool. The
Programming Several Tools programmer matches this tool changing method within the
program. The following example is probably the one that
Machining a part using several tools is the most typical may be the most useful for everyday work. All activities are
method of CNC work. Each tool is loaded into the spindle listed in the comments.
when required, using various ATC processes. From the
programming viewpoint, the various tool changing meth- 01402 (ANY TOOL IN SPINDLE AT START)
ods do not affect the cutting section of the program, only (*** not THE FIRST TOOL ****)
the start of the tool (before machining) or the end of the N1 G20 (INCH MODE)
tool (after machining). N2 G17 G40 G80 T01 (GET T01 READY)
N3 MO 6 (T01 TO SPINDLE)
As already discussed, the required tool can be changed N4 G90 G54 GOO X. Y. S.. MO 3 T02 (T02 READY).
automatically, only if the Z axis is at machine zero (for ver- N5 G43 Z.. HOI M08 (APPROACH WORK)
tical machining centers) or the Y axis is at machine zero
(for horizontal machining centers). The tool position in the < . . . 707 working ...>
remaining axes is only important to the safety of the tool
change, so there is no tool contact with the machine, the N26 GOO Z.. MO (T01 MACHINING DONE)
Fixture, or the part. All following examples are formatted N27 G28 Z.. MO (T01 TO Z HOME)
for vertical machine models. Some programs use machine N28 GOO X., Y. . (SAFE XY POSITION)
zero return for all axes at the end of last tool, for example:
N29 M01 (OPTIONAL STOP)
Technically, there is nothing wrong with this practice, but N46 GOO Z.. MO (TO 2 MACHINING DONE)
it may cause a significant time loss for a large volume of N57 G28 Z.. MO (T02 TO Z HOME)
parts. A preferred method is to either make the tool change N48 GOO X.. Y. . (SAFE XY POSITION)
move the tool away from N49 M01 (OPTIONAL STOP)
above the last tool location, or to
the part, to a safe location. This last method is illustrated in
N50 T03 (T03 CALL REPEATED)
the examples that present various methods of program N51 MO 6 (T03 TO SPINDLE)
startup, as it relates to different methods of tool changing. N52 G90 GOO G54 X. . Y. . S. . MO 3 T01(T01 READY)
N53 G43 Z. . HO 3 MO (APPROACH WORK)
Keeping Track of Tools
< . . . T03 working . . . >
changing operation is simple, it should be easy
If the tool
to keep a track of where each tool is at any given moment.
N66 GOO Z.. MO (TO 3 MACHINING DONE)
In later examples, more complex tool changes will take
N67 G28 Z.. MO (TO 3 TO Z HOME)
place. Keeping a visual track of which tool is waiting and
N68 GOO X. Y. . (SAFE XY POSITION)
which tool is in the spindle can be done with a 3 column ta- N69 M30 (END OF PROGRAM)
ble with block number, tool waiting and tool in the spindle. %
100 Chapter 14
The filled-in table below shows the status of tools for the A few comments to the 01402 example. Always pro-
part only. *?’ any tool number.
represents gram M01 optional stop before a tool change - it will be
first
easier to repeat the tool, if necessary. Also note beginning
Block Number Tool Waiting Tool in Spindle of each tool, containing the next tool search. The tool in the
block containing the first motion has already been called -
N1 ? ?
compare block N4 with N30 and block N32 with N50. The
N2 T01 7 repetition of the tool search at the start of each tool has two
reasons. It makes the program easier to read (tool is coming
N3 ? T01
into the spindle will be known) and it allows a repetition of
N4 T02 T01 the tool, regardless of which tool is currently in the spindle.
01404 (NO TOOL IN SPINDLE AT START) N4 G43 Z.. HOI M08 (APPROACH WORK)
N1 G20 (INCH MODE)
N2 G17 G40 G80 T01 (GET T01 READY) < . . . TOl working . . . >
N3 MO 6 (T01 TO SPINDLE)
N4 G90 G54 GOO X.. Y. . S. . M03 T02 (T02 READY)
(APPROACH WORK) N26 GOO Z.. MO 9 (TOl MACHINING DONE)
N5 G43 Z.. HOI M08
N27 G28 Z.. MO 5 (TOl TO Z HOME)
N28 GOO X.. Y.. (SAFE XY POSITION)
< . . . TOl working . . . > N29 M01 (OPTIONAL STOP)
N26 GOO Z.. MO (TOl MACHINING DONE) N30 T99 (T9 9 CALL REPEATED)
N27 G28 Z.. MO (TOl TO Z HOME) N31 M06 (T9 9 TO SPINDLE)
N28 GOO X. Y. . (SAFE XY POSITION) N32 TO (T03 READY)
N29 M01 (OPTIONAL STOP) N33 MOO (STOP AND LOAD T02 MANUALLY)
N30 T02 (T02 CALL REPEATED) N34 G90 G54 GOO X.. Y S.. MO 3 (NO NEXT TOOL)
N31 MO (T02 TO SPINDLE) N35 G43 Z.. HO 2 M08 (APPROACH WORK)
N32 G90 G54 GOO X. Y . S.. MO 3 T03 (T03 READY)
N33 G43 Z.. HO 2 M08 (APPROACH WORK) < . . . T02 working ...>
< . . .
71)2 working . . . > N46 GOO Z.. MO MACHINING DONE)
(TO 2
N47 G28 Z.. MO (T02 TO Z HOME)
N46 GOO Z.. MO (TO 2 MACHINING DONE) N48 GOO X. Y. . . (SAFE XY POSITION)
N47 G28 Z.. MO (T02 TO Z HOME) N49 Ml (SPINDLE ORIENTATION)
N48 GOO X. Y. . (SAFE XY POSITION) N50 MOO (STOP AND UNLOAD T02 MANUALLY)
N49 M01 (OPTIONAL STOP)
N51 T03 (T03 CALL REPEATED)
N50 TO (T03 CALL REPEATED) N52 MO (T03 TO SPINDLE)
N51 MO 6 (T03 TO SPINDLE) N53 G90 G54 GOO X. Y . S.. MO 3 TOl (TOl READY)
N52 G90 G54 GOO X.. Y S.. MO 3 T99 (T99 READY) N54 G43 Z.. HO 3 M08 (APPROACH WORK)
N53 G43 Z.. HO 3 M08 (APPROACH WORK)
< . . . T03 working . . . >
< . . . T03 working ...>
N66 GOO Z.. MO (TOl MACHINING DONE)
N66 GOO Z.. MO (TO 3 MACHINING DONE) N67 G28 Z.. MO (T03 TO Z HOME)
N67 G28 Z.. MO (T03 TO Z-HOME) N68 GOO X. Y. . . (SAFE XY POSITION)
N68 GOO X. . Y. . (SAFE XY POSITION) N69 M01 (OPTIONAL STOP)
N69 MO (T9 9 TO SPINDLE) N70 MO (TOl TO SPINDLE)
N70 M30 (END OF PROGRAM) N71 M30 (END OF PROGRAM)
%
%
102 Chapter 14
Note the M19 function in the block N49. This miscella- First Tool in the Spindle and an Oversize Tool
neous function will orient the spindle to exactly the same
position as if the automatic tool changing cycle were used.
Sometimes it is necessary to use a little larger diameter
The CNC tool than themachine specifications allow. In that case, the
operator can then replace the current tool with
oversize tool must return to the same pocket in the tool
and still maintain the tool position orientation.
the next tool
This consideration is mostly important for certain boring magazine it came from and the two adjacent magazine
pockets must be empty. Do not use a tool that is too heavy!
cycles, where the tool bit cutting edge has to be positioned
In the example 01407, the large tool is T02.
away from the machined surface. If a boring bar is used, it
is necessary to align its cutting tip.
01407 (FIRST TOOL IN SPINDLE AT START)
N1 020 (INCH MODE)
No Tool in the Spindle with Manual Change N2 G17 G40 G80 T99 (GET T99 READY)
N3 G90 G54 GOO X. Y. . S. M03 . .
The following program is a variation on the previous ex- N4 G43 Z.. HOI M08 (APPROACH WORK)
ample, except that there is no tool in the spindle when the
program starts.
< . . . TO I working ...>
N46 GOO Z. . MO 9 (TO 2 MACHINING DONE) N54 G43 Z.. HO 3 M08 (APPROACH WORK)
N47 G28 Z. . MO 5 (T02 TO Z HOME)
N48 GOO X. . Y. (SAFE XY POSITION) <
.
. . . T03 working . . . >
N49 Ml 9 (SPINDLE ORIENTATION)
N50 MOO (STOP AND UNLOAD T02 MANUALLY)
N66 GOO Z.. MO (T03 MACHINING DONE)
N51 T03
N67 G28 Z.. MO (T03 TO Z HOME)
(T03 CALL REPEATED)
N52 MO 6 N68 GOO X.. Y. . (SAFE XY POSITION)
(T03 TO SPINDLE)
N53 G90 G54 GOO X. N69 M01 (OPTIONAL STOP)
Y. . S.. MO 3 T99 (T99 READY)
N54 G43 Z. HO 3 MO 8 (APPROACH WORK) N70 MO (T01 TO SPINDLE)
N71 M30 (END OF PROGRAM)
%
< . . . 703 working . . >
No Tool in the Spindle and an Oversize Tool
N66 GOO Z. . MO 9 (T03 MACHINING DONE)
N67 G28 Z. . MO 5 (T03 TO Z HOME) This is another tool change version. It assumes no tool in
N68 GOO X. . Y. . (SAFE XY POSITION) the spindle at the program start. It also assumes the next
N69 M01 (OPTIONAL STOP) tool is larger than the maximum recommended diameter,
N70 MO 6 (T99 TO SPINDLE)
within reason. In this case, the oversize tool must return to
N71 M30 (END OF PROGRAM)
exactly the same pocket it came from. It is important that
%
the adjacent pockets are both empty.
TOOL FUNCTION 103
N70 MO (T9 9 TO SPINDLE) lathe, this format calls for the address T, followed by four
N71 M30 (END OF PROGRAM) digits - Figure 14-8.
%
It is important to understand this function well. Think On the OFFSET display of a typical Fanuc control, there
about the four digits as two pairs of digits, rather than four is a choice of two screens, both very similar in appearance.
single digits. Leading zeros within each pair may be omit- One is called the Geometry Offset screen, the other is called
ted. Each pair has its own meaning: the Wear Offset screen. Figure J 4-9 and Figure 1 4- 10 show
examples of both screens, with typical (/.<?., reasonable)
The first pair (the and the second digits), control the
first
sample entries.
tool index station and the geometry offset.
OFFSET -GEOMETRY
G Example
No. X-OFFSET Z-OFFSET Radius Tip
TOIxx - selects the toolmounted in position one 01 -8.4290 -16.4820 0.0313 3
and activates geometry offset number one 02 -8.4570 -14.7690 0.0000 0
03 -8.4063 -16.3960 0.0156 3
The second pair (the third and the fourth digits), control 04 -8.4570 -12.6280 0.0000 0
the tool wear offset number used with the selected tool. 05 -8.4350 -16.4127 0.0000 0
06 -9.8260 -13.2135 0.0313 2
G Example 07 0.0000 0.0000 0.0000 0
TxxOI - selects the wear offset register number one Figure 14-9
It is customary, not arbitrary, to match the pairs, if possi- Example of the GEOMETRY offset screen display
ble. For example, tool function T010I will select tool sta-
tion number one, geometry offsetnumber one and the asso- OFFSET - WEAR
ciated tool wear offset register number one. This format is No." X-OFFSET Z-OFFSET Radius Tip
easy to remember and should be used every time, if only 01 0.0000 0.0000 0.0313
1
3
one offset number is assigned to the tool number. 02 1 0.0000 1 0.0150 0.0000 0
03 0.0036 0.0000 0.0156 3
two or more different wear offsets are used for the same
If 04 n nnnn U.UiiOU n nnnn
U.UUUU
V_/*T
u
it is not possible to match the pairs. In such a case, two
tool, 05 0.0010 -0.0022 0.0000 0
or more different wear offset numbers must be pro- 06 -0.0013 0.0000 0.0313 2
grammed for the same tool station number: 07 0.0000 0.0000 0.0000 0
G Example
Figure 14-10
T0101 for turret station 01, Example of the WEAR offset screen display
The first pair is always the tool station number and the The GEOMETRY offset value is always measured
geometry offset number. The examples assumed that tool from the machine zero position.
wear offset is not used by another tool. If tool
1 1 is used 1 1
Figure 14-14
On-size dimension
Oversize dimension
Undersize dimension
UNDER size SCRAP Recut possible Arbitrary tool tip orientation numbers used with tool nose radius
compensation (G4 1 or G42 mode)
Let’s go a little further. Whether the part will be oversized The main rule of using R and T columns is that they are
or undersized, something has to be done to prevent this only effective in a tool nose radius offset mode. If no G4
from happening again. The action to take is adjusting the or G42 is programmed, values in these columns are irrele-
wear offset value. Again, the emphasis here is that this is an vant. If G41/G42 command is used, non-zero values for
example of an outside diameter. that tool must be set in both columns. The R column re-
between
In ihe previous chapters, the basic relationship The common point here is that all three environments
machine geometry and the part setup was discussed.
the cannot be useful without some ‘team work’. They have to
CNC programmers work in a fairly precise environment, work together, they have to interact.
and mathematical relationships are of extreme importance.
For programming purposes, these relationships and inter-
There are three major environments in programming that one common denominator of each en-
actions are based on
require an established mathematical relationship: vironment - a reference point.
Each environment by itself is independent of the other Machine reference point .. Machine zero or Home
two. If the relationship is not apparent right away, consider Part reference point Program zero or Part zero
..
They do not normally manufacture machine tools part reference point. And the name tool tip or a tool com-
or cutting tools. mand point are commonly used for the tool reference point.
CUTTING TOOLS are a specialty of tooling companies, for short, which is the combination of machine proper and
which may or may not make cutting tool holders. the control system. The numeric values that relate to the
These companies do not manufacture machine tools CNC machine tool include a variety of dimensions, specifi-
or CNC systems. cations, parameters, ranges, ratings, etc. When a part is set
in a fixture on the machine table or mounted into a lathe
These sources inevitably meet when a customer buys a chuck, collet, face plate, or other work holding device,
CNC machine. A certain engineering design (part), must be there is a second group of numbers to consider. The part
machined on a machine tool from one manufacturer, using considerations such as its size, its height, diameter, shape,
,
a control system of another manufacturer, cutting tools etc., are unique to each job. Finally, the third group of num-
from yet another manufacturer, and tool holders from a bers relate to the cutting tools. Each cutting tool has its indi-
fourth source. These sources are similar to a musical quar- vidual features, as well as features that are shared with the
tetof first class musicians who never played together. In other cutting tools.
both cases there is a need to create a harmony.
All available numeric values have a meaning - they are
By each environment is not very useful. A machine
itself,
not merely numbers - they are actual values that program-
without tools will not yield any profit; a tool that cannot be mers and operators have to work with individually as well
used on any machine is not going to benefit the manufac- as together.
turing either. A part cannot be machined without tools.
107
108 Chapter 15
Also note that in front view, there is a dashed line identi- This vital reference point will be used in a program to es-
fied as the gauge line. This is an imaginary location for the tablish the relationship with machine reference point, refer-
proper of the tool holder tapered body and is set by the
111 ence point of the cutting tool and the drawing dimensions.
machine manufacturer. The inside of the spindle is a preci-
sion machined taper that accepts the tool holder with the The part reference point is commonly known as a pro-
cutting tool. Any tool holder mounted in the spindle will be gram zero or a part zero. Because the coordinate point that
in exactly the same position. The Z motion illustrated will represents program zero can be selected by the program-
be shortened by the cutting tool projection. This subject of mer almost anywhere, it is not a fixed point, but a floating
point. As this point is selectable, more details can be cov-
tool referencing is discussed later in this chapter.
ered - after all, it is the programmer who selects part zero.
Never power fluence the efficiency of the part setup and its machining in
necessary. turn machine, while the
oft' to the
machine slides are at or very close to the machine zero po- the shop. Always be very attentive to all factors that are for
return more difficult later, after the power had been re-
program zero point may be selected liter-
In theory, the
stored. A clearance of .0 inch (25.0 mm) or more for each
1
ally anywhere. That is not much of an advice, although true
axis from machine zero is usually sufficient. A typical pro-
in mathematical terms. Within the practical restrictions of
cedure to physically reach the machine zero position will
the machine operations, only
the most advantageous possi-
follow these steps:
should be considered. Three such considerations
bilities
1 . Turn the power on (machine and control) should govern the selection of program zero:
2. Select machine zero return mode
3. Select the first axis to move (usually Z axis) Accuracy of machining
4. Repeat for the all other axes
Convenience of setup and operation
5. Check the lighted in-position indicators
6. Check the position screen display Safety of working conditions
7. Set display to zero, if necessary
Machining Accuracy
Mainly for safety reasons, the first selected axis should be
the Z axis for machining centers and the X axis for lathes. Machining accuracy paramount - all parts must be ma-
is
In both cases, either axis will be moving away from work, chined exactly to the same drawing specifications. Accu-
into the clear area. When the axis has reached machine zero racy is also important consideration in repeatability. All the
position, a small indicator light on the control panel turns parts in the batch must be the same and all subsequent jobs
on to confirm that the axis actually reached machine zero. must be the same as well.
The machine is now at its reference position, at the machine
Convenience of Setup and Operation
zero, or at the machine reference point, or at home - which-
ever term is used in the shop. The indicator light is the con-
Operating and setup convenience can only be considered
firmation for each axis. Although the machine is ready for
once the machining accuracy is assured. Working easier is
use, a good operator will go one step further. On the posi-
everyone's desire. An experienced CNC programmer will
tion display screen, the actual relative position should be
always think of the effect the program has in the machine
set to zero readout for each axis, as a standard practice, if it
shop. Defining program zero that is difficult to set on the
is not Set to zero automatically by the control. The POS but-
machine or difficult to check is not very convenient. It
ton on the control panel selects the position screen display.
slows down the setup process even more.
Working Safety
PART REFERENCE POINT
Safety always important to whatever we do - machine
is
A part ready for machining is located within the machine and part setup are no different. Program zero selection has a
motion limits. Every part must be mounted in a device that lot to do with safety of the machining operation.
is safe, suitable for the required operation and does not
change position for any other part of the job run. The fixed We look at the typical considerations of program zero se-
location of the device is very important for consistent re- lection for vertical machining centers and lathes individu-
sults and precision. It is also very important to guarantee
ally. Differences design influence the program zero
in part
that each part of the job is set the same way as the first part. selections as well.
Program Zero - Machining Centers part are both parallel to the machine axes and perpendicular
to each other. Program zero (part zero) is at the intersection
CNC machining centers allow a variety of setup meth-
of the two locating edges.
ods. Depending on the type of work, some most common
setup methods use vises, chucks, subplates and hundreds of The three-pin concept is common for virtually all setups,
special fixtures. In addition, CNC milling systems allow a without using actual pins. If a part is mounted in a vise,
multi-part setup, further increasing the available options. In
there are similarities. The jaws must be parallel to or
vise
order to select a program zero, all three machine axes must
perpendicular with the machine axes and the fixed location
be considered. Machining centers with additional axes re- must be established with a stopper or other fixed method.
quire zero point for each of these axes as well, for example,
the indexing or rotary axes. Since a machine vise is the most common work holding
device for small parts, let’s use it as a practical example of
What are the most common setup methods? Most ma- how to select program zero.
Figure 15-5 illustrates a typical
chining done while clamped on machine table, in a vise
is
simple engineering drawing, with all the expected dimen-
or a fixture mounted on the table. These basic methods can sions, descriptions and material specifications.
be adapted to more complex applications.
i
tion for each program. The process of selecting the pro-
gram zero starts with drawing evaluation, but two steps 25
have to be completed first:
9 1
0.8 .
1 .
T
which dimensions are critical and which are not 1.0 — —
Step 2. Decide on the method of part setup and holding - 2.5 —
a r\
•t.VJ
Program zero almost presents itself in the drawing. In any
setup, make sure all critical dimensions and tolerances are 1020 STEEL 5 x 3.5 x 0.5
maintained from one part Drawing dimensions
to another.
not specified are usually not critical. Figure 15-5
in Figure 15-6.
MOVING JAW
Y
1
- -X
Figure 15-6
MOVING JAW
Y
i
UJ ~X
Figure 15-7
Program Zero - Lathes The most popular method is setting program zero on the
front face of the finished part. This is not a perfect selection
On CNC lathes, program zero selection is simple. There
either but has many other advantages. The only disadvan-
are only two axes to consider - the vertical X axis and the
horizontal Z axis.
Because of the lathe design, the X axis
tage is that during setup, there is no finished face. Many op-
erators add the width of the rough face to the setup or cut a
program zero selection is always the spindle center line.
small face for the tool to touch.
On CNC lathes, the program zero for the X axis What are the benefits of program zero at the front face?
MUST be on the center line of the spindle
One benefit is that many drawing dimensions along Z axis
can be transferred directly into the program, normally with
For the Z axis, three popular methods are used: a negative value. A lot depends on the dimensioning me-
thod but in majority of cases, the CNC programmer bene-
Chuck face . . . main face of the chuck
fits. Another benefit, probably the most important, is that a
Jaw face . . . locating face of the jaws Z value of a tool motion indicates the work area, a
negative
JAW FACE In turning and boring, the most common tool reference
point an imaginary tool point of the cutting insert, be-
is
Stock X cause most tools have a cutting edge with a built-in radius.
1
The three reference points available for CNC program- Position Register Definition
ming must be harmonized to work together correctly. Hav-
ing the reference points for the part program zero) and
(i.e.,
A little more verbose definition of the position register
the cutting tool (i.e., tool tip) available, there has to be some command could be expressed this way:
means to associate them together, to fit them together.
There must be some means to 'tell 'the control system ex- Position register command sets the tool location
as the distance and direction
actly where each tool is physically located, within the ma-
FROM ... the program zero,
chine work area, before it can be used. The oldest method
TO . . . the tool current position,
to do to register the current position of the tool
all this is
measured along the axes
system memory, through the program. This
into the control
method required a command called the Position Register.
Note that the definition does not mention the machine
zero at all - instead, it mentions the current tool position.
POSITION REGISTER COMMAND This is a very important distinction. The current tool posi-
tion may be at machine zero, but it also may be somewhere
The preparatory command for the tool position register is else, within travel limits of the machine axes.
G92 for machining centers and G50 for lathes:
Also note the emphasis on from-to direction. By defini-
tion, the distance is unidirectional, between the program
G92 Position register command (used in milling) zero and the current tool location. The direction is always
from program zero, to tool position, never reversed. In a
G50 Position register command (used in turning)
program, the correct sign of each axis value (positive, nega-
tive, or zero) is always required.
113
114 Chapter 16
has some values for each axis. They could be zero or any
the operator must setup the same part exactly 7.5 inches
away from machine zero for the Y axis. The same ellort has
to be done for the Z axis as well.
In order to place tool into the starting tool change posi- Programming Example
tion, the operator physically moves the tool from the pro-
To illustrate how to use the position register command in
gram zero by amounts specified in the G92 statement. This
a part program for vertical machining centers, certain rules
is a lot easier job and also much more efficient that restrict-
have to be followed:
ing setup to the machine zero.
The cutting tool should be changed first
Once the tool change position is established, all tools in
the program will return to this position for a tool change. G92 must be established before any tool motions
The Z axis automatic tool change position on vertical ma-
Tool must return to the G92 position when
chining centers must be programmed at machine zero as all the cutting is completed
the only automatic tool change position. So the discussion
really applies to XY axes only. Regardless of a tool posi- All three rules are followed in a sample program:
tion, the G92 setting will be the same for all tools, unless
there is a good reason to change it. 01601 (PROGRAM NUMBER)
N1 G20 (SET ENGLISH UNITS)
The only major disadvantage of this method is that the N2 G17 G40 G80 G90 T01 (GET TOOL 1 READY)
new tool change position is only memorized by the control N3 MO 6 (TOOL 1 TO SPINDLE)
system while the power is on. When the power to the ma- N4 G92 X9.75 Y6.5 Z11.0 (SET CURRENT XY)
N5 GOO XI. 0 Y0.5 S800 M03 (MOVE TO POSITION)
chine is turned off, the tool change position is lost. Many
N6 ZO.l MO 8 (MOVE TO CLEAR ABOVE)
experienced CNC operators solve this problem by simply
N7 G01 Z-0.55 F5.0 (FEED TO DEPTH)
finding the actual distance from the machine zero to the N8 X3.0 Y4.0 F7.0 (CUT A SLOT)
tool change position, register it once for each particular N9 GOO Z11.0 MO 9 (RAPID TO Z MACHINE ZERO)
setup and then move the tool by that distance after restoring N10 X9.75 Y6.5 M05 (RAPID TO XY SET POSITION)
power, for example, at the start of a new day. Nil M01 (OPTIONAL STOP FOR TOOL 1)
For the CNC lathes with Fanuc and similar controls, G50
command is used instead of G92 command:
SPINDLE AT
MACHINE ZERO [Z] G50 X.. Z..
G92 X..Z..
Figure 16-3
Current tool position register set at machine zero for the Z axis
/each tool will normally have a different setting
116 Chapter 16
Commands G50 and G92 are identical, except that they Three-Tool Setup Groups
belong to two different G code groups. Fanuc actually of-
fers three G code groups for lathe controls. Based on his-
On a typical slant bed CNC
lathe, equipped with a po-
lygonal turret (6 to 14 stations), all cutting tools reside in
Japanese made controls use G50, whereby typ-
tory, typical
individual stations of the turret. During tool indexing, only
ical US madecontrols used G92. A cooperative US and
the selected tool is in the active station. Upon evaluation of
Japanese venture known as GE Fanuc ( General Electric
and Fanuc) produces controls that are the most common in
the type of tools used for CNC lathe operations, it will be
clear that there are only three groups of cutting tools, based
North American industry, and using the G50 command.
on the type of work they normally do:
To program the position register for lathe applications is
Tools working on the part center line
very similar to that of G92 However, due to
for the mills.
design of CNC lathes, where all tools are mounted in the Tools working externally on the part
turret, the projection of each tool (for both axes) from the
Tools working internally on the part
turret holder must be considered. Not only that, possible in-
terference must be prevented, because all mounted inactive If the position register for each group is understood well,
tools move simultaneously along the one that is used for it will be easy to apply it to any tool within a group, regard-
cutting. In milling, all non-active tools are safely out of less of the number of tools used.
way, placed a tool magazine. Several new designs of
in
CNC lathes are available, where tool changer on the lathe Center Line Tools Setup
resembles the milling type.
Lathe tools classified as center line tools are typically
center drills, spot drills, standard twist drills, indexable car-
Tool Setup
bide drills, taps, reamers, and so on. Even an end mill can
The most important programming decision for lathe be used at the spindle center line. All tools in this group
work relates to the setup. Although there are several op- have a single common denominator, whereby the tool tip is
tions to select from, some are preferable to others. always located on the spindle center line, while they cut.
These tools must always be setup exactly at 90° to the work
Probably the most practical approach for lathe setup will face (parallel to the Z axis).
be to have the tool change position for all tools correspond-
ing to the machine zero position. This is a very easy posi- The position register value in the X axis is from the spin-
tion move
to the turret to, just using the control panel dle center line (X0) to the center line of the tool. For the Z
switches. The position register measured to machine zero axis, the position register value is measured from program
does have one major disadvantage - it may be too far for zero to the tool tip. Typically, the center line tools will have
most jobs, particularly on larger lathes along the Z axis. a fairly large overhang - that means their G50 value along
Just imagine a tool motion of 30 inches or more along the Z the Z axis will be relatively small, when compared to the
axis only to index the turret and than the same 30 inch mo- external tools, which generally do not project too much.
tion back to continue the cutting cycle. It is not efficient at
all. There is a solution, however.
Figure 16-4 illustrates a typical setup for center line tools,
using an indexable drill as an example.
Much more efficient method is to select the tool indexing
position as close to the part as possible. This position
should always be based on the longest tool mounted in the
turret (usually internal tools), whether the tool is used in the
program or not. If there is enough clearance for the longest
Figure 16-6
Figure 16-5
Comer Tip Detail
Typical G50 setting for external lathe tools
Internal tools are all tools that do majority of their work radius built-in, the programmer has to know (and also tell
inside of a part, in a premachined hole, core or other cavity. the CNC operator), which edge the G50 corresponds to. In
Typically, we may first think of a boring bar, but other tools many cases, the choice is simple. The G50 value is mea-
can be used as well for various internal operations. For ex- sured from program zero to the imaginary intersection of
ample, an internal grooving and internal threading are com- tangential X and Z axis. Depending on the tool shape and
mon operations on a CNC lathe. The setup rules along the its orientation in the turret, G50 setting will vary. Figure
Z axis apply in the same way for internal tools as for exter- 16-7 on the next page shows several typical settings for the
nal tools of the same type. most common orientations of a tool with a corner radius,
including two grooving tools.
Along the X axis, the tool position register setting must
be made to the imaginary tip of the insert. Figure 16-6 Programming Example
shows a typical position register setup for an internal tool
(boring bar shown in the example). The example showing how to use a position register com-
mand G50 on a lathe will be very similar to that of a ma-
All three illustrations (Figures 16-4, 16-5 and 16-6) show chining center. First, the tool change is made, followed
a possible order of the three operations (drill - turn - bore) with G50 setting for the selected tool. When the machining
for a typical CNC lathe job. Note that the turret position is is done with that tool, it has to return to the same absolute
identified as a tool change position, not necessarily as the position as specified in the G50 block. The following sim-
machine zero position. That means G50 may be set any- plified example is for two tools - the first tool is pro-
where within travel limits of the machine, even at the ma- grammed to cut a face, the second tool is programmed to
chine zero. cut a 2.5 inch diameter:
118 Chapter 16
Figure 16-7
Position register setting G50 for common tool tip orientations • the heavy dot indicates XZ coordinates set by G50 X.. Z. for the tool above
01602 Note blocks N2 and N7 for the first tool, and N10 and
N1 T0100 N15 for the second tool. For each tool, these XZ pairs of
N2 G50 X7.45 Z5.5 blocks are exactly the same. What the program is ‘telling’
N3 G96 S400 M03 the control system here is that block N2 only registers the
N4 GOO X2.7 ZO T0101 M08
current tool position, but block N7 actually returns that tool
N5 G01 X-0.07 F0.007
N6 GOO ZO.l MO to the same position it came from. For the second tool,
N7 X7.45 Z5.5 T0100 block N10 registers the current tool position, block N15
N8 M01 forces the tool to return there.
The relationships between various reference points in In this handbook, each term is used in the same meaning
CNC programming are expressed as preset numeric values. as the majority of users interpret it. Ppsition compensation
More often than not, these numbers, these specific values, can also be used for a very limited replacement of the cutter
are required well before the actual machine setup takes radius offset - this usage is not covered at all for its obsoles-
place. During part programming, many dimensions are cence. Instead, the emphasis will be on positioning of the
known exactly, others are known approximately and there tool from machine zero towards the part.
are also many that are not known at all. Some known di-
Like several other functions, the position compensation is
mensions are subject to variations between jobs. Without
a programming method that requires input of the CNC ma-
any corrective facility available to the programmer, it will
chine operator. Programmer specifies the type of compen-
be almost impossible to setup the machine precisely and ef-
modern controls offer many features
ficiently. Fortunately,
sation and the memory register number, the operator enters
the actual values at the machine, using appropriate display
to make both programming and machine setup an easier,
screens, during part setup.
faster and more precise activity. A number of coordinate
systems, offsets and compensations are typical support
tools used in programming for corrective purposes.
Programming Commands
One
of the oldest programming techniques available in
On Fanuc and similar controls, there are four preparatory
programming is called a position compensation. As the commands (G codes) available to program position com-
pensation functions:
name suggests, using position compensation functions, the
actual tool position is compensated relative to its theoreti-
cal or assumed position. Single increase in the programmed direction
G45
by the compensation amount
only one of several corrective methods available to
It is
119
120 Chapter 17
G91 GOO G45 X. . H31 (H31 STORES THE X VALUE) This example motion from machine zero (the
illustrates a
G45 Y. H32 . (H32 STORES THE Y VALUE) current tool position), to program zero, which is the target
position, along XY axes. Note the absolute mode setting
or G90 in block N4. Assume that the control system is set to
H31 =-12.0000 inches. The control will evaluate the block
G91 GOO G45 X.. D31 (D31 STORES THE X VALUE) and interpret it as programmer’s intention to go to the abso-
G45 Y.. D32 (D32 STORES THE Y VALUE) lute zero, specified by G90. It checks the current position,
finds it is at the absolute zero already and does nothing.
For the record, the H address is also used with another
There will be no motion, regardless of the compensation
type of compensation, known as the tool length offset (or value setting, if the absolute motion is programmed to ei-
tool length compensation), described in Chapter 19. The D ther XO or YO target position. If the G90 is changed to G91
address is also used with another type of compensation,
from absolute to incremental mode, there will be a motion
known as the cutter radius offset (or cutter radius compen- along the negative direction of X axis, by the distance of
sation), described in Chapter 30.
exactly 12 inches and there will be a similar motion along
The applicable preparatory G code will determine how Y axis, in block N5. The conclusion? Use position compen-
the address H or address D will be interpreted. In the exam- sation commands in the incremental mode G91 only.
TABLE - H31
MACHINE
ZERO
Let’s look a
prets a position
little closer at how the control system inter-
compensation block. Interpreting the way
1
— \
\ —w- how the control unit manipulates
understanding how
numbers is
v•
works. Earlier definition has stated that a single increase is
will be interpreted as
Figure 17-2 shows illustration for the following program
-15.0 + 0 = -15.0000 example 01701 The logic applies to the X and Y axes ex-
.
the X axis. work the same way). The position compensation values
H98 and H99 were set to:
If the value of X axis target position is a non-zero and
positive, the same formula applies: H98 = -250.000
H99 = -150.000
G91 GOO G45 XI. 5 H31
for the X and Y axes respectively. The modal commands
will be interpreted as were not repeated:
offset valuecould have been changed to a positive value. N15 G90 GOO G45 X-15.0 H98 (ABS X- TARGET)
This could be quite confusing and definitely not consistent,
N16 G46 Y-13.0 H99 (ABS Y- TARGET)
N17 G28 X0 Y0
but would work quite well. To see the different possibili-
it
ties,program 01701 is not doing very much, except mov- N18 G91 GOO G45 X-15.0 H98 (INC X- TARGET)
ing from machine zero to different positions and back to N19 G46 Y-13.0 H99 (INC Y- TARGET)
machine zero (G28 command refers to a machine zero re- N20 G28 X0 Y0
turn and is explained separately in Chapter 21). N21 M30
%
122 Chapter 17
The control system will process each motion block sepa- method is described in Chapter 19 of the handbook. If the
rately - either the way it was intended or the wrong way Z axis is programmed with G45 or G46 commands, it will
(symbol O/T means an overtravel condition, preceded with also be affected.
the axis and direction of the overtravel):
Using G47 and G48
N3 G90 — G45 — 0 no motion
N4 G90 — G46 — 0 . . . no motion In the examples, position compensation feature was used
N6 G91 — G45 — 0 . . . X-250.0 only between the machine zero and program zero, as a
N7 G91 — G46 — 0 . •
. . Y+ O/T method of determining where exactly is the part located on
the table. The single increase using G45 and the single de-
N9 G90 — G45 — + X-241.0
— —
. . .
crease using G46 commands were used, because they were
N10 G90 G46 + Y+ O/T
— “ the only commands needed.
N12 G91 G45 + . . . X-241.0
N13 G91 — G46 — + Y+ O/T
. . .
Commands G47 (double increase) and G48 (double de-
crease) are only necessary for a very simplified cutter ra-
N15 G90 — G45 — _ . . . X+ O/T
dius offset and are not covered in this handbook because of
N16 G90 — G46 — - . . . Y- 163.0
— — - X+ O/T their obsolescence. However, they can still be used.
N18 G91 G45 . . .
Position compensation feature usually applies only to the ing will be explained in more detail. In that chapter is a very
X and Y axes and will not normally be used with the Z axis. good example of how to apply position compensation to
In most cases, the Z axis has to be controlled by another offset diameter of the face mill in a clear position, regard-
less of its size. This is probably the only possible use of
kind of compensation - known as the tool length offset. This
G45 and G46 commands in contemporary programming.
18 WORK OFFSETS
Using the method of Work Offsets for tool positioning In position compensation, to switch machining from one
based on machine zero is much faster and more efficient part to another within the same setup, the program has to
than using the older methods of position compensation contain a different compensation number from program
functions G45 and G46 described in the previous chapter. zero of the previous part. Using the work offset method, all
The work offsets are also known as Work Coordinate Sys- program zeros are measured from the machine zero posi-
tem, or even as Fixture Offsets. Work offsets are much more tion normally up to six, but more offsets are available.
,
grammers who do not know the meaning of position com- on Fanuc control systems are assigned the fol-
are available
lowing preparatory commands:
pensation functions or the meaning of position register
commands, are most likely working with the most modern
CNC machines only. However, there are many machines in G54 G55 G56 G57 G58 G59
industry that still require these rather obsolete functions.
When the control unit is turned on, the default coordinate
Knowing them well will increase the number of available
system is normally G54.
programming tools.
Basically, the work offsets establish up to six independ-
This chapter describes the most modern methods to coor-
ent work The values input into
areas as a standard feature.
dinate the relationship between machine zero reference
the CNC unit are always distances measured from the ma-
position and the program zero reference point. We will use
chine zero to the program zero. As there are up to six work
the Work Coordinate System feature of any modern control
areas, up to six independent program zero positions can be
system, whether it is called the Work Coordinate System or
defined. Figure 18-1 shows the basic relationships, using
the Work Offsets. The latter term seems to be more popular
the default G54 setting.
because it is a little shorter. Think of the work offsets as an
alignment between two or more coordinate systems.
G54 X MAUHIlNt
WORK AREAS AVAILABLE [
]
ZERO
/
Before some more detailed descriptions can be covered,
just what is a work coordinate system - or a work offset?
>
Work offset is a method that allows the CNC programmer
s
to program a part away from the CNC machine, without
knowing its exact position on the machine table. This is a
very similar approach as in the position compensation
/ o (!)
more axes may be moved simultaneously with work ablework offsets G55 to G59. The values stored in the con-
offsets, although the Z axis for CNC machining centers is trolsystem arc always physically measured from the ma-
controlled independently, using G43 or G44 tool length chine zero position to the program zero of the part, as
offset commands. Commands relating to the Z axis offset determined by the CNC programmer.
are fully described in the next chapter, Chapter 19.
123
124 Chapter 18
The distance from machine zero to program zero of each Part position on the machine table is usually unknown
work area is measured separately along the X and Y axes during the programming process. The main purpose of
and input into the appropriate work offset register of the work offset is to synchronize the actual position of the part
control unit. Note that the measurement direction is from as it relates to the machine zero position.
machine zero to program zero, never the other way around.
If the direction is negative, the minus sign must be entered Additional Work Offsets
in the offset screen.
The standard number of six work coordinate offsets is
For comparison with the position register command G92, usually enough for most types of work. However, there are
Figure 18-2 shows the same part set with the older method jobs that may require machining with more program refer-
of G92 and machine zero as a start point. Note the opposite ence points, for example, a multi-sided part on a horizontal
arrows designation, indicating the direction of measure- machining table. What options do exist, if the job requires
ment - from program zero to machine zero. ten work coordinate systems, for example?
G92 X MACHINE sets, for the total of 54 (6+48). If this option is available on
[ ]
ZERO the CNC system, any one of the 48 work offsets can be ac-
cessed by programming a special G code:
t
Selection of additional work offset,
where P = 1 to 48
CN
cn
O O O G54.1 P.. example :
In theprogram, the work offset may be established in two X = -12.5543 + 5.5 = -7.0543
ways either as a separate block, with no additional infor-
- Y = -7.4462 + 3.1 = -4.3462
mation, as in this example:
These calculations are absolutely unnecessary in every-
N1 G54 day programming - they are only useful to the thorough un-
derstanding of how the control unit interprets given data.
The work offset can also be programmed as part of a
The whole calculation is so consistent, it can be assigned
startup block, usually at the head of program or at the be-
into a simple formula. For simplicity, the settings of the
ginning of each tool:
EXT (external or common) offset are not included in the
formula, but are explained separately, later in the chapter:
N1 G17 G40 G80 G54
MINUS
MINUS
the program zero away from machine zero and enters these -10 + (- 12 ) = -10 - 12 = -22
values into the control register, under the G54 heading. The
entry could be either manual or automatic. Ifany other work offset is programmed, it will be auto-
matically replaced by the new one, before the actual tool
Assume for a moment, that after setup, the measured dis-
motion takes place.
tances from machine zero to program zero were X- 1 2.5543
and Y-7.4462. The computer will determine the actual mo- Work Offset Change
tion by a simple calculation always add the pro-
- it will
grammed target value X to the measured value X, and the A single CNC
program may use one, two, or all work
programmed target value Y to the measured value Y. work offset
offsets available. In all multi-offset cases, the
setting stores the distance from the machine zero to the pro-
The actual tool motion in'the block N40 will be: gram zero of the each part in the setup.
126 Chapter 18
For example, if there are three parts mounted on the table, N7 G56 X5.5 Y3 1 . (SWITCH TO G56)
each individual part will have its own program zero posi- N8 G80 Z1.0 MO
tion associated with one work offset G code.
N9 G91 G54 G28 ZO M05 (SWITCH TO G54)
N10 M01
... will rapid from the current tool position, to the pro-
Z Axis Application
gram zero position of the first part.
So far, there was a conspicuous absence of the Z axis
from all discussions relating to the work offset. That was no
G90 GOO G55 XO YO
accident - it was intentional. Although any selected work
... from the current tool position,
will rapid to the pro-
offset can apply to the Z axis as well, and with exactly the
G90 GOO G56 XO YO form of G43 and G44 commands that relate specifically to
the tool length compensation, more commonly known as
... will rapid from the current tool position, to the pro- the tool length offset. This important subject is discussed
gram zero position of the third part. separately in the next chapter. In the majority of program-
ming work offset is used only within the
applications, the
Of course, the target position does not have to be part zero XY plane. This a typical control system setting and may
is
(program zero) as shown in the example - normally, the tool be represented by the following setup example of the stored
will be moved to the first cutting position right away, to values within the control register:
save the cycle time. The following program example will
illustrate that concept. (G54) X-8.761 Y-7.819 ZO
(G55) X-15.387 Y-14.122 ZO
In the example, a single hole will be spot drilled on each (G56) X-22.733 Y-8.352 ZO
of the three parts to the calculated depth of Z-0.14 (pro- (G57) ...
gram 01801). Study the simplicity of transition from one
work offset to another - there are no cancellations - just a The ZO offset entry is very important in the examples and
new G code, new work offset. The control will do the rest: in the machine control. The specified ZO means that the co-
ordinate setting for the Z amount (representing the height
01801 of the part) does not change from one part to another, even
N1 G20 if the XY setting does.
N2 G17 G40 G80
N3 G90 G54 GOO X5.5 Y3.1 S1000 M03 (G54 USED) The only time there is a need to consider Z axis within the
N4 G43 ZO.l HOI M08 work offset setting is in those cases, where the height of
N5 G99 G82 RO.l Z-0.14 P100 F8.0 each part in the setup is different. So far, only the XY posi-
N6 G55 X5.5 Y3 1 . (SWITCH TO G55) were considered, as they had been the ones changing.
tions
WORK OFFSETS 127
If the Z amount changes as well, that change must be con- HORIZONTAL MACHINE APPLICATION
sidered by modifying the coordinate register setting of the
control. This is the responsibility of the CNC operator, but
Machining several parts in a single setup is done quite
the programmer can learn an important lesson as well.
frequently on CNC vertical machining centers. The multi-
ple work offset concept is especially useful for CNC hori-
zontal machining centers or boring mills, where many part
faces may have to be machined during a single setup.
If the previous multi-offset example for XY setting are Z0 were at the center of indexing table, which is also quite a
also adapted for the Z axis, the work offset can be set up for common setup application. See Chapter 46 for more de-
parts within the same setup, but with variable heights. This tails relating to horizontal machining.
variable height is controlled by the Z axis. The result of the
setting will reflect the difference in height between the
measured Z one part and the measured Z
axis surface for
axis surface for the other parts. Based on the data in the pre-
vious example, combined with the Z values shown in Fig-
ure 18-6 the control system settings
, may look like this:
EXTERNAL WORK OFFSETS All six standard work offsets, as well as any additional
work offsets, will be affected by the values set in the exter-
nal work offset, based on the setting of each axis. Because
A careful look at a typical work offset screen display
all programmable coordinate systems will be affected, the
reveals one special offset that is identified by one of the fol-
name for this special offset is Common Work Offset or more
lowing designations: often, the External Work Offset.
00 (EXT)
00 (COM)
LATHE APPLICATIONS
The two zeros - 00 - indicate that this work offset is not Originally, the work coordinate system was designed for
one of the standard six offsets G54-G59. These offsets are CNC machining centers only. It did not take long to apply it
identified by numbers 01 through 06. The 00 designation to CNC lathes as well. The operation, logically and physi-
also implies that this is not a programmable offset, at least cally, is identical to that for machining centers. Using work
not by using the standard CNC programming methods. offsets for CNC lathes eliminates the awkward use of G50
Fanuc Macro B option does allow programming this offset. or G92 and makes the CNC lathe setup and operation much
faster and easier.
The abbreviation EXT means External, and the abbrevia-
tion COM means Common. The machine control will have
Types of Offsets
one or the other designation, but not both. As a matter of
curiosity, the COM
designation is found on older controls, The main work offsets on a lathe is
difference in applying
whereby the EXT designation is more recent. The reason? that seldom need for more than one work
will there be a
With the explosion of personal computer market, the COM offset. Two work offsets are a possibility, three or more are
abbreviation has become the de facto standard abbreviation used for some very special and complex setups. G54 to
for the word communications. As Fanuc controls also sup- G59 commands are available on all modern CNC lathes
port several communication methods, including the con- and it is quite customary to ignore the work offset selection
nection with a personal computer, some time ago, the COM in the program, unless more than one offset is used. That
offset designation has been replaced with the designation means the CNC lathe programmer depends on the default
EXT, to prevent possible confusion between the two abbre- G54 setting as a rule.
viations used in computing.
Two special offset features found on the latest control
Either abbreviation refers to the same offset and has the systems are the Geometry and Wear offsets, either on the
same purpose. On the screen display, this special offset is same screen display, or on separate screens, depending on
usually located before or above the offset for G54, for ex- the control model.
ample, as illustrated in Figure 18-8
Geometry Offset
X 0.0000 X -12.5543 from tool reference point to program zero, measured from
the machine zero along a selected axis. Typically, on a slant
Y 0.0000 Y - 7.4462 bed CNC lathes, with the tool turret above the spindle cen-
Z 0.0000 Z 0.0000 terline, the geometry offset for both X and Z axes will be
negative. Figure 18-9 illustrates reasonable geometry val-
ues for a drill, turning tool and boring bar (TO T02, T03). 1 ,
Figure 18-8
= COM)
Example of an EXT (external) work offset display (EXT
GEOMETRY OFFSET
The major difference between an external or common No. X OFFSET Z OFFSET RADIUS TIP
work offset is that it is not programmable with any particu-
01 -8.6330 -2.3630 0.0000 0
lar G code. Its setting is normally set to zero for all axes.
Any non-zero setting will activate this work offset in a very 02 -8.6470 -6.6780 0.0469 3
important way: 03 -9.0720 -2.4950 0.0313 2
04 0.0000 0.0000 0.0000 0
****** IMPORTANT ****** 05 0.0000 0.0000 0.0000 0
Wear Offset
TOOL SETUP
The wear offset is also known and used on milling con-
trols, but only for the tool length offset and the cutter radius In the next three illustrations is a very similar layout as
offset, not for the work coordinate system (work offset). that shown in Chapter 16, describing the use of G50 regis-
ter method (position register command used in the pro-
On the CNC lathes, the purpose of the wear offset is iden- gram). Compare the two illustrations!
tical to that formachining centers. This offset compensates
for the tool wear and is also used to make fine adjustments The setup of the CNC lathe is identical in both cases, ex-
to the geometry offsets. As a rule, once the geometry offset cept for the method and purpose of the position measuring.
for a given tool is set, that setting should be left unchanged. All illustrations in the applications also match the reason-
Any adjustments and fine tuning of actual part dimensions able data entered in the tool geometry and the tool wear off-
should be done by the wear offset only. set screens of the control.
No. X OFFSET Z OFFSET RADIUS TIP usually negative. A positive value is also possible, but that
means the tool is above work and tool changing can be very
01 0.0000 0.0000 0.0000 0 dangerous. Watch out for such situations!
02 -0.0060 0.0000 0.0469 3
03 0.0000 0.0040 0.0313 2
The actual setting procedures are subject of a ma- CNC
chine operation training and not practical to cover in a
04 0.0000 0.0000 0.0000 0
programming handbook. There are additional methods,
05 0.0000 0.0000 0.0000 0 also part of machine training, that allow faster tool setting,
using one tool as a master and setting all the remaining
Figure 18-10
tools relative to the master tool.
one coordinate offset is used, but different tool numbers. ting for center line tools.
Remember, the tool number for a lathe has four digits, for
example, T0404: TURRET AT
The first two digits select the tool indexing station (turret
TOOL CHANGE POSITION V
station) and the geometry offset number. There is no T01
choice here. Tool station 4, for example, will also use
in
GEOM (Z)
geometry offset number 4.
, ,
The second two digits are for the wear offset register
number only. They do not have to be the same as the tool
number, but it makes sense to match the numbers, if <
possible. o
X
Depending on the control model and the display screen
size, the tool offset register may have a separate screen dis-
play (page) for the geometry and wear offsets, or both off-
set types may be shown on the same screen display. The
work offset values (work coordinates) are always placed in
the Geometry offset column. Figure 18-11
Turning tools - or external tools - are measured from the Boring tools - or internal tools - are always measured
imaginary tool tip to the program zero, along the X axis (as from the imaginary tool tip to program zero, along the X
a negative diameter) and along the Z axis, usually as a neg- axis (typically as a negative diameter) and along the Z axis,
ative value as well. Keep in mind that if the cutting tool in- typically as a negative value as well. In majority of cases,
sert (for turning or boring) is changed from one radius to the X
value of a boring tool will be noticeably larger than
another radius in the same tool holder, the entered setup that for a turning or other external tool.
amount must The change may be marginal,
also change.
but even a marginal change is enough to cause a scrap, so a For boring operations, same as for turning operations,
good care is needed. For turning, be extra careful for a tool also be extra careful for a tool nose radius that changes
nose radius that changes from a larger size to a smaller size, from a larger size to a smaller size. It is the same as for a
turning tool. The scrap can be made very easily.
for example, from 3/64 (R0.0469) to 1/32 (R0.03I3).
Tool holders accept inserts of the same shape and size but
with a different nose radius. Always be cautious when re-
placing an insert with an insert that has a larger or smaller
toolnose radius. The offset has to be adjusted in both axes,
by the proper amount.
Figure 18-12
TURRET AT
TOOL CHANGE POSITION '
w
T03
GEOM (Z)
I
^=1: -i
< Setting error caused by a different insert radius in the same holder
Q
X The example in Figure 18-14 shows standard setting for a
1/32 .0313) nose radius (middle), and the setting error for
(
So far, we have looked at two methods of compensation out, the rest is hidden in the holder. The tool holder is
for the actual position of the cutting tool in relation to the mounted by means of a standardized tooling
in the spindle,
machine reference point. One method was the older type, system. Tool designations, such as the common sizes
using position compensation, the other was the contempo- HSK63, HSK100, BT40 and CAT50, are examples of es-
rary work coordinate system method (work offset). In both tablished European and American standards. Any tool
cases, the emphasis was only on the X and Y axes, not on holder within its category will fit any machine tool de-
the Z axis. Although the Z axis could have been included signed for that category. This is just one more precision fea-
with either method, the results would not have been very ture built into the CNC machine.
practical. The main reason is the nature of the CNC work.
The length of a tool for the purposes of CNC program-
Normally, programmer decides on the setup of a part in ming must always be associated w ith the tool holder and in
the fixture and selects the appropriate location of the XYZ relation to the machine design. For that purpose, manufac-
program zero (part reference point or part zero). When turers build a precision reference position into the spindle,
using work offsets, XY axes are always measured from the called the gauge line.
machine reference point to the program zero position. By a
strict definition, the same rule applies to the Z axis. The Gauge Line
major difference ismeasured XY values will re-
that the
main unchangedfor all tools, whether there is one tool used When the tool holder with the cutting tool is mounted in
or one hundred tools. That is not the case with the Z axis. the spindle of a CNC machine, its own taper is mounted
131
132 Chapter 19
Table Top Face This is also a convenient block to add coolant function
M08 for the current tool:
Every CNC machining center has a built-in machine ta-
ble on which the fixture and part are mounted. Top of the N66 G43 Z1.0 H04 M08
machine table is precision ground to guarantee flatness and
squareness for the located part. The resulting motion in the example will be to 1 .0 inch
above the part zero. The control system will calculate the
In addition, the table is located a certain fixed distance
distance to go, based on the value of H offset stored by the
from the gauge line. Just like the position of the tool holder
operator during setup.
in the spindle cannot be changed, the position of the table
(even for a removable table using a palette system) cannot Figure 19-2 shows a typical screen for the tool length off-
be changed either. The surface of the table creates another
reference plane that is related to the gauge line and parallel
to it as well. This arrangement allows to accurately pro- TOOL OFFSET (LENGTH)
gram a tool motion along the Z axis.
No. GEOMETRY WEAR
The tool length offset (compensation) can be defined: 001 -6.7430 0.0000
002 -8.8970 0.0000
The tool length offset is a procedure that corrects the
003 -7.4700 0.0000
difference between the programmed length of the tool
Tool length offset should always be programmed in the In order to interpret how the CNC system uses the tool
absolute mode G90. A typical program entry will be the length command, the programmer or operator should be
G43 or G44 command, followed by the Z axis target posi- able to calculate the distance-to-go of the cutting tool. The
tion and the H offset number: logic behind the tool length offset is simple:
The value of the H offset will be added to the target Z position G43 Z-0.625 H07 where:
if G43 is used, because G43 is defined as the positive tool
length offset G54 along Z is set to 0.0500, Z axis target is -0.625 and
The value of the H offset will be subtracted from the
theH07 is -8.28. The distance-to-go calculation uses the
target
Z position if G44 is used, because G44 is defined as the
same formula, but with different values:
negative tool length offset
Zd = (+0.05) + (-0.625) + (-8.28)
The target position in both cases is the absolute Z axis = 0.05 - 0.625 - 8.28
= -8.855
coordinate in the program. If the Z axis setting of the work
offset (G54-G59), the H value, and the Z axis target are all
Again, the formula works correctly and can be used for
known, the distance-to-go can be accurately calculated.
any distance-to-go calculation along the Z axis. Experi-
The control system will use this formula:
menting with other settings may also be useful.
Zd = Distance-to-go along Z axis (actual travel) cutting tooland the tool holder), can be set directly on the
W z
= Work coordinate value for Z axis CNC machine or away from it. These setup options are of-
Z, = Target position in Z axis (Z coordinate) ten called on-machine or off-machine tool length setups.
H = Value of the applied H offset number Each option has an advantage and it has its corresponding
disadvantage. They both share a certain relationship to the
Q Example - W, = 0: gauge line, as it of the tool or its pro-
applies to the length
jection.These two setup options are direedy opposite to
G43 Z0.1 HOI where: each other and often cause philosophical divisions (or at
least some friendly disagreements) among CNC program-
G54 in Z is set to ZO, Z axis target position is 0. 1 and HOI mers. Evaluate each setup option and compare its advan-
is set to -6.743, then the distance-to-go Zd will be: tages with its disadvantages. Which one appears to be
somewhat better will depend on many other factors as well.
Z(j = 0 + (+0.1) + (-6.743)
= 0 + 0.1 - 6.743 Both options require involvement of two people, or at
= -6.643 least two professional skills - the CNC programmer and the
CNC operator. The question narrows down to who is going
The displayed distance-to-go will be Z-6.673.
to do what - and when. To be fair, both sides have to do
© Example - W, = 0.0200: dress for each tool. The operator has to physically set the
tools into the holder and measured values of H
register the
In this example, the program contains block addresses into the CNC system memory.
G54 in Z is set to 0.0200, Z axis target is Z1.0 and the In technical terms, the bulk of on-machine setting re-
valueofH03 is -7.47: quires the work of a CNC operator. Typically, the operator
places a tool into the spindle and measures the distance the
Zd = (+0.02) + (+1.0) + (-7.47) tool travels from machine zero to part zero (program zero).
= 0.02+1.0-7.47 This work can only be done between jobs and is definitely
= -6.45 nonproductive. It can be justified under certain circum-
stances, particularly for jobbing shops and short-run jobs
The result is correct, the tool will travel along the Z axis,
or for machine shops with very few people. Although the
towards the part and the distance-to-go will be Z-6.45.
setting of a large number of tools will take much longer
In the last example, a negative target position is shown: than setting of a few tools, there are setup methods avail-
able to the CNCoperator that allow reasonably speedy
O Example - Wr
= 0.0500: on-machine tool length setup, namely using the master tool
method, described later in this section. The one major ben-
The program block contains a negative 7. coordinate: efit of this method is that it does not require the expense of
additional equipment and a skilled person to operate it.
134 Chapter 19
Off-Machine Tool Length Setting The figure represents a common setup of a CNC vertical
In technical terms, the off-machine setting requires the machining center, looking from the front of the machine, a
work of a skilled tool setter or a CNC operator. Since the
typical operator’s viewpoint. The spindle column is located
setting done away from the machine, a special equipment
is
at the machine zero position. This is the limit switch posi-
Tool Length Offset Value Register mensions or given dimensions and used as equally critical
for accurate machine setup:
Whichever method of the tool length setting is used, it
Distance between the tool gauge line and
produces a measured value that represents the length of the
the tool cutting point
selected tool. This value is useless by itself and must be
somehow supplied to the program, before the job is ma- ... dimension A in the illustration
chined. The operator must register the measured value into
the system, under the proper heading on the control panel. Distance between the tool cutting point and the ZO
(program zero of the part)
The control system contains a special registry for the tool
length offset, usually under the heading of too/ length set- ... dimension B in the illustration
Each method has its benefits. The CNC programmer con- During the tool length measurement process, distance
siders these benefits and chooses one method over the from the cutting tip of the tool to the gauge line is accu-
other. Applications of these methods and operations do not rately determined - Figure 19-4. Preset tools will reach the
relate to the programming process directly - they are meth- machine already mounted in a tool holder, identified by the
ods of physical setup on the machine only. For proper un- number of the tool and with the list of measured (preset)
derstanding of the subject by CNC programmers, they are tool lengths. All the CNC operator has to do, is to set the re-
included here as well. Regardless of which setting method quired tools into the magazine and register each tool length
is chosen, include a reference to the selected setting in the in the offset register, using the proper offset number.
program, in the form of a comment or message.
The preset dimensions have positive values, measured
Preset Tool Length from the tool reference point to the gauge line of the holder.
The gauge line of the machine is simulated in the presetting
Some users prefer to preset the length of cutting tools device to match. Each dimension will be entered as the H
away from the machine, rather than during the machine offset value in the tool length offset screen. For example, a
setup. This has been the original method of setting tool tool length is preset to the value of 8.5 inches, with the pro-
lengths. There are some benefits in this approach - the most grammed offset number for this tool as H05. On the offset
notable is the elimination of nonproductive time spent dur- screen, under number 05, the operator enters the measured
ing setup. Another benefit applies to horizontal machining length of 8.5000:
centers, where program zero is often preset to the center of
the rotary or indexing table. There are disadvantages as 04 ...
well. Presetting tool length away from machine requires an 05 8.5000
external device, known as the tool presetter, which could be 06 ...
change. All the operator has to do, is to enter the measured lustration in Figure 19-5 shows, each tool is assigned an H
values into the offset registers. Even that portion of the number (similar to the previous example), called the tool
length offset number.
setup can be done through the program by using the op-
tional G 10 command (if available).
This method also requires a qualified person responsible
for presetting the cutting tools. A large number of small and
medium users with vertical machining centers cannot af-
ford the additional expenses and do the setting of the cut-
ting tools during the part setup, mostly using the touch-off
method. This method may also be suitable choice when
small job runs are machined. The touch-off method is de-
scribed in the next section.
GAUGE
Figure 19-4 control system. The important notion here is that the Z axis
away from the machine presetter method).
settings for any work offset G54-G59 and the common off-
Tool length preset Itool
Work offset (G54-G59) must be used set are normally set to Z0.0000.
136 Chapter 19
are correct:
Choosing any other tool as master tool, the procedure is
logically same, except the H offset entries will be positive G43 Plus offset
for any tool that longer than the master and they will be
is G44 Minus offset
negative for any tool that is shorter than the master. In the
rare case where the measured tool will have exactly the G43 Tool length offset positive
same length as the master tool, the offset entry for that tool G44 Tool length offset negative
will be zero. Illustration in Figure 19-6 shows the concept
of master tool setting. G43 Plus direction
G44 Minus direction
After the master tool length is setand registered into the Z
axis of work offset, enter the distance from the tool tip of These definitions are correct only if taken within the con-
the new tool to the tool tip of the master tool, and register it text of their meaning into consideration. That context is not
really clear from any of these definitions. Plus to where?
in the appropriate H offset number. If the longest tool is an
actual tool, rather than a plain bar used for setup, its H off- Positive of what? To find the context, think about the use of
The main and most important purpose of any tool length program will be exactly the same
In either case, written
offset is to allow a CNC
program to be developed away only the setting method that changes, not the program-
(it is
from the machine, away from tooling and fixturing, and ming method). Program will contain the tool length offset
without knowing the actual cutting tool length during pro- command (G43 or G44), followed by the target position
gram development. along the Z axis and the H offset number:
Setting tool length without tool length offset - program 01901 Setting tool length with G43 (Z) and G92 (XY) - program 0 1902
This early program required the position compensation In an improved program, the tool length offset G43 is ap-
command G45 or G46 in XY axes and the position register plied to the first motion command of the Z axis:
command G92 in XYZ axes. Each part must start at ma-
chine zero - Figure 19-9: 01902
N1 G20 (INCH MODE SELECTED)
01901 N2 G92 XO YO ZO (MACHINE ZERO POSITION)
N1 G20 (INCH MODE SELECTED) N3 G90 GOO G45 X3 .4 H31 (X POSITION COMP)
N2 G92 XO YO ZO (MACHINE ZERO POSITION) N4 G45 Y2.8 H32 (Y POSITION COMP)
N3 G90 GOO G45 X3.4 H31 (X POSITION COMP) N5 G92 X3.4 Y2 (TOOL POSITION REGISTER)
.
N4 G45 Y2.8 H32 (Y POSITION COMP) N6 G43 Z1.0 HOI (TOOL LENGTH COMP Z)
N5 G92 X3.4 Y2 8 (TOOL POS REGISTER XY)
.
N7 S850 MO (SPINDLE COMMANDS)
N6 G92 Z9.0 (TOOL POS REGISTER Z) N8 G01 ZO.l F15.0 MO 8 (Z APPROACH MOTION)
N7 S850 MO 3 (SPINDLE COMMANDS) N9 Z-0.89 F7.0 (Z CUTTING MOTION)
N8 G01 ZO.l F15.0 M08 (Z APPROACH MOTION) N10 GOO ZO.l MO (Z RAPID RETRACT)
N9 Z-0.89 F7.0 (Z CUTTING MOTION) Nil G28 X3.4 Y2.8 Z1.0 (MACHINE ZERO RETURN)
N10 GOO ZO.l MO 9 (Z RAPID RETRACT) N12 G49 DOO HOO (OFFSETS CANCELLATION)
Nil Z9.0 (MACHINE ZERO RETURN Z) N13 M30 (END OF PROGRAM)
N12 X-2.0 Y10.0 (CLEAR POSITION XY) %
N13 M30 (END OF PROGRAM)
When a program is developed using G92, blocks N6 and
N7 can be joined together for convenience, if preferred:
Tool Length Offset and G92
N6 G43 Z1.0 S850 M03 HOI
When the tool length offset became available, program- N7 ...
ming became easier. The position compensation G45/G46
was still in use at the time and G92 had to be set for both X This method has no effect on the tool length offset, only
and Y axes. However, G92 setting for the Z axis was re- on the moment at which the spindle starts rotating. Position
placed by G43 or G44 command, with an assigned H offset compensation and the tool length offset cannot be pro-
number - Figure 19-10. grammed in the same block.
Today, this method of combining the position compensa- Note that the position compensation is still in effect in
tion G45/G46 and tool length offset G43/G44 is considered this-example, due to the lack of work coordinate offset of
obsolete, or at least quite old-fashioned. Only the G43H.. is the G54 to G59 series.
used in modern programming, with the target position.
I
TOOL LENGTH OFFSET 139
Tool Length Offset and G54-G59 Tool Length Offset and Multiple Tools
The most modern programming has many commands The majority of CNC programs include more than one
and functions available and G54-G59 series is one of them. tool; in fact, most jobs will require many different tools.
The G92 command has been replaced with work offset sys- Our next example (independent of the previous drawings)
tem G54-G59 and, optionally, more. Normally, G92 is not illustrates a common method how the programmer enters
used in the same program that contains any work offset se- the tool length offset for three tools.
lection G54 through G59 or the extended series.
Three holes need to be spot-drilled, drilled and tapped.
Here a program example of using the tool length offset
is Drawing or explanation of the machining is not important
in a G54-G59 work offset environment: at this time - just concentrate on the G43 tool length appli-
cation. It is the program structure that is important now -
01903 note that there is no change in the program structure of any
N1 G20 (INCH MODE SELECTED) tool, only in the programmed values.
N2 G90 GOO G54 X3.4 Y2.8 (XY TARGET LOCATION)
N3 G43 Z1.0 HOI (TOOL LENGTH COMP Z) 01904
N4 S850 MO (SPINDLE COMMANDS) N1 G20
N5 G01 ZO.l F15.0 M08 (Z APPROACH MOTION)
N2 G17 G40 G80 T01
N6 Z-0.89 F7.0 (Z CUTTING MOTION)
N3 MO 6
N7 GOO ZO.l MO (Z RAPID RETRACT)
N4 G90 GOO G54 XI. 0 Y1.5 S1800 M03 T02
N8 G28 X3.4 Y2.8 Z1.0 (MACHINE ZERO RETURN) N5 G43 Z0.5 HOI M08 (TOOL LG OFFSET FOR T01)
N9 G49 DOO HOO (OFFSETS CANCELLATION) N6 G99 G82 RO.l Z-0.145 P200 F5.0
N10 M30 (END OF PROGRAM)
N7 X2.0 Y2.5
% N8 X3.0 Y1.5
N9 G80 Z0.5 MO
N10 G28 Z0.5 MO
Nil M01
N12 T02
N13 MO 6
N14 G90 GOO G54 X3.0 Y1.5 S1600 M03 T03
N15 G43 Z0.5 H02 M08 (TOOL LG OFFSET FOR T02)
N16 G99 G81 RO.l Z-0.89 F7.0
N17 X2.0 Y2.5
N18 XI. 0 Y1.5
N19 G80 Z0.5 MO
N20 G28 Z0.5 M05
N21 M01
N22 T03
N23 MO
N24 G90 GOO G54 XI. 0 Y1.5 S740 M03 T01
N25 G43 Z1.0 H03 M08 (TOOL LG OFFSET FOR T03)
N26 G99 G84 RO 5 Z-1.0 F37.0
.
Setting tool length with G43 (Z) and G54-G59 IXY) - program 01903 This a practical example of contemporary use of G43
is
The command G54 will affect all axes, G43 with HOI Also note that there is no tool length offset cancellation,
will affect only the Z axis. Tool must move in the clear. Cancellation will also be explained later in this chapter.
140 Chapter 19
Figure 19-13
Note the words - the bottom edge versus the top edge of
the slot mill. Which edge is programmed as a reference for
the tool length? The one at the bottom or the top?
for the sametool. For this reason, the program requires two
01905
(TWO TOOL LENGTH OFFSETS FOR ONE TOOL)
N1 G20
Figure 19-12 N2 G17 G40 G80
Example of programming more than one tool length offset for a N3 G90 GOO G54 XO YO S600 M03
single tool - program 01905 N4 G43 Z1.0 H07 MO 8 (ABOVE JOB CLEARANCE)
N5 G01 Z-0.65 F20.0 (CUTTER EDGE - BOTTOM)
Based on the illustration, we have to decide on the cutting N6 M98 P7000 (CUTTING GROOVE AT Z-0.65)
method first (premachining of the 03.000 hole is as- N7 G43 Z-0.43 H27 (CUTTER EDGE - TOP)
N8 M98 P7000 (CUTTING GROOVE AT Z-0.43)
sumed). A 125 wide slot mill will be a good choice to pro-
.
N9 GOO Z1.0 MO
file the circle, using typical milling method for a full circle
N10 G28 Z1.0 MO
(see Chapter 29). The program can be shortened by using a Nil M30
subprogram method (see Chapter 39). Because the .220 %
groove width is larger than the cutter, more than one cut is
needed - two in this case. For the first cut, the tool is posi- 07000
tioned at the Z-0.65 depth (as per drawing) and makes the (SUBPROGRAM FOR GROOVE IN 01905)
first cut at the bottom of the groove. The bottom edge of the
N1 G01 G41 XO 875 Y-0.875 D07 F15.0
.
and the tool makes the profile for the second groove (actu-
N5 G01 G40 XO YO
N6 M99
ally, it will widen the first groove) at the depth of Z-0.43
%
(again, as per drawing).
TOOL LENGTH OFFSET 141
Full circle milling - subprogram 07000. Typical tool length offset setting for a preset tool.
Start and finish of cutting is at the center of the groove. Program zero is at the face of the part.
So far, all presented examples were aimed towards a In programming, a well organized approach is always
CNC vertical machining Although the logic of tool
center. important. That means, a program command that is turned
length offset applies equally to any machining center, re- on when needed should also be turned off, when not needed
gardless of the Z axis orientation, there are some noticeable anymore. Tool length offset commands are no exception.
differences in the practical applications on horizontal ma-
chining centers (Chapter 46). The tool length offset cancellation may be included in the
program. There is a special preparatory command available
A horizontal machining center allows programming of a that cancels any selected method of the tool length offset,
tool path on several faces of the part. Since each face has a either G43 or G44. The command to cancel the tool length
different distance from the tool tip (along the Z axis), the offset in the program (or via MDI) is G49:
tool length offset for each face will vary. It is common to
program different work offsets and different tool length
G49 Tool length offset cancel
offsets for each face.
N176 G49
N177 G91 G28 ZO
A program may also be started with the tool length offset The Fanuc rule is quite explicit - any G28 or G30 com-
command canceled (under program control), usually in the mands (both execute the tool return to the machine zero)
safety line (safety block or initial block): will cancel the tool length automatically.
N1 G20 G17 G40 G80 G49 The meaning is simple - programmer may take advantage
of this rule and does not need to specifically cancel the tool
... or a variation of the same block: length offset, if the machine returns to the tool change posi-
tion. This is normal for all machines with an automatic tool
N1 G20 changer. This approach is illustrated in many examples in-
N2 G17 G40 G80 G49 cluded in this handbook.
There is one more way to cancel the tool length offset - do Any one of the methods will guarantee that the active tool
not program it at all. may be some differ-
length offset will be canceled. There
ences between machine manufacturers and consulting the
A strange suggestion, perhaps, but well founded. Most machine manual will always be the responsible approach.
examples handbook do not use G49 command
in this at all.
Why not ? What happens at the end of each tool? There are machines that require
the use of G49 for every tool.
20 RAPID POSITIONING
A CNC machine tool does not always cut material and GOO Command
‘make’ chips. From the moment becomes
the cutting tool
Preparatory command GOO is required in CNC program
active in a part program, it goes through a number of mo-
motion mode. Feedrate function F is not
to initiate the rapid
tions - some are productive (cutting), others- are nonpro-
required with GOO and, if programmed, will be ignored
ductive (positioning).
during the rapid motion (in GOO mode). Such a feedrate
Positioning motions are necessary but nonproductive. will be stored in memory and becomes effective beginning
Unfortunately, these motions cannot be totally eliminated with the first occurrence of any cutting motion (G01 G02,
,
143
144 Chapter 20
Depending on the CNC machine design, rapid motion Although an obstacle may be in the way of cutting mo-
rate can he the same for all axes, or each axis can have its tions in G01 G02 or G03 mode
, example a face turning (for
own maximum rate. The maximum rapid rates for a typical towards a tailstock on a lathe), the most problems occur
machining center may be 1181 in/min (30000 mm/min) for during rapid motions GOO, G28, G29, G30 and with fixed
the X and Y axes and about 945 in/min (24000 mm/min) cycles G8 to G89, G73, G74 and G76. During a rapid mo-
1
lor the Z axis. For a CNC lathe, the rates are somewhat tion, the tool path is much less predictable than during cut-
slower, for example 197 in/min (5000 mm/min) for the X ting motions. Keep in mind that the only purpose of rapid
axis, and 394 in/min (10000 mm/min) for the Z axis. The motion is to gel from one part location to another location
rapid rates can be much higher for modern machines. fast -
but not necessarily straight.
terfere with the tool motion are: Several consecutive program blocks, each containing
only a single axis motion, can be included in the program to
FOR MACHINING CENTERS
bypass obstacles to machining. This method of program-
Clamps, vises, fixtures, rotary or indexing table, ming is preferable in cases where only the exact or approxi-
machine table, part itself, etc. mate position of certain obstacles (such as clamps or fix-
tures) is known during the program preparation.
FOR LATHES:
Multiaxis Motion
Tailstock quill and body, chuck, steadyrest,
live center, face plate, fixture, other tool, part itself, etc.
We have already moved at
learned that the cutting tool is
In theory, the motion along any two axes is equivalent to a both axes, with a resulting 45° motion. The total lime re-
straight diagonal motion. The real motion, however, may quired to reach the end position is 1.44 seconds, which is
or may not be a straight diagonal tool path at all. Consider the longest time required for either axis to reach its target
the following example in Figure 20-2. position. After the elapsed time of 0.42 seconds, the Y axis
target position has been reached, but there is still another
1 .02 seconds left to complete the motion along the X axis.
The target must be reached in both axes, so the tool then
continues along the X axis only (for 1 .02 seconds), in order
to reach the final position.
0.525s
Figure 20-2
0.42s 1.02s 1
(2.753 X 60) / 315 = 0.525 seconds
0.42s /
45°, because of the different rating of rapid traverse rate for
L
1.44s — each axis. During the 0.525 seconds (which is the common
time to both axes), the X axis motion will travel
Figure 20-3
The resulting motion is at 38.605° and a slight rounding
Rapid motion deviation - same rapid rate for each axes have been applied. The actual departure angle is not always
necessary to be known, but it helps to calculate it for rapid
Figure 20-3 shows a combination of an angular and a
motions in some very tight areas of the part. It only takes a
straight motion as the actual tool path. The tool departs at
few simple trigonometric functions to make sure of the true
the rate of 394 in/min (10000 mm/min) simultaneously in
rapid tool path, provided the rapid rate is known.
146 Chapter 20
Both of the above examples illustrate an angular motion This consideration is more important in turning applica-
along two axes, followed by a straight single axis motion in tions than in milling, due to the nature of programming for
the remaining axis. The graphical expression of thesemo- the two types of machines. In turning, the approach motion
tions is a bent line, resembling a hockey stick or a dog leg may be along the Z axis first, to avoid a collision with the
shape, which are also very common terms applied to such a tailstock,and then along the X axis. The reverse motion
rapid motion. should be along the X axis first, then along the Z axis mo-
tion, in order to achieve the same safety goal when return-
Calculation of the actual motion shape, as we have done
ing to the tool change position.
earlier, is only seldom necessary. Taking some basic pre-
cautions, the rapid motion can be programmed safely with- A typical application of this programming technique may
out any calculations. If no obstacle is within the work area be useful after using a machining cycle (such as turning,
(the imaginary rectangle created by the diagonally posi- boring, facing, threading, etc.), where the cycle starting
tioned start and end point), there is no danger of collision point is also its end point.
due to the diverted rapid tool path. On CNC milling sys-
tems, the third axis can also used. The rectangle of the
above example will be enhanced by the third dimension
and a three dimensional space must be considered. In this
case, no obstacle should be within this space otherwise the ,
same rules apply for a rapid motion along three axes as for
a two-axis simultaneous rapid motion. Note that the rapid
rate for the Z axis on CNC machining centers is usually
lower than the rapid rate for the X and Y axes.
The required time for tool travel along each axis can be
easily calculated:
X axis time:
Y axis time:
Z axis time:
G00 X11.812 Y3.54 Z1.0 During actual production, after the program has been
and optimized for the best tool performance and
verified
If this motion were to be separated into three individual
productivity, the override switch should be set to the 100%
program blocks, the total time would be the result of indi- pointer, to shorten the cycle time.
vidual times added together:
which is about 37.5% longer. The percentage will vary, The calculations relating to the rapid tool motion can be
depending on the rapid motion rate and the rapid travel expressed as formulas and used quickly at any time by sub-
length, measured along each machine axis. The program stituting the known parameters. Relationships between the
blocks will be written separately: rapid traverse rate, length of the motion and the elapsed
time can be expressed in the following three formulas:
G00 X11.812
Y3.54
Z1.0 V
be somewhat shortened by keeping the part clearances to grammed to a much more comfortable position of .500
the smallest safe minimum. Let’s have a look at some po- inches above the part (N315). Then, the motion continued
tential problems. to the cutting start point, using the linear interpolation G01
in block N316. Since this is still a motion in the air, there-
In the following example, an approach to the part is made fore not productive, a relatively heavy feedrate was used at
along the Z axis, with a clearance of .05 inches ( 1 .27 mm) the same time. As may be expected in such situations, there
in block N315: is a Hade off.
N314 G90 G54 GOO X10.0 Y8.0 S1200 M03 Although the cutting time was slightly increased, at the
N315 G43 Z0.05 HOI same time, the CNC operator has been given an opportu-
N316 G01 Z-1.5 F12.0 nity to use the feedrate override switch for testing the first
training stages. If the operator’s convenience is considered lots of large numbers (several thousands, for example).
as a significant factor contributing to the overall productiv-
21 MACHINE ZERO RETURN
—
z-
one of the extreme travel limits of each axis. The exact posi-
tion is determined by the machine manufacturer and is not
i
- ?i XY = UPPER RIGHT
normally changed during the machine working life. Return
1
to that position is automatic, on request from the control Y-
panel, in MDI operation, or via the program. WORK AREA
|
encing purposes. In order that the CNC machine is accu- Machine zero position located at the upper right XY corner
rate, we need more than just the high quality components, of a CNC vertical machining center
can be reached repeatedly, on request, through the control normally placed a safe distance from the machine table and
panel, MDI, or program code execution. the work area. For most machines, the standard machine
zero of CNC machining centers is at the extreme travel
Machining Centers limit of each axis in the positive direction. There are excep-
tions, as may be expected.
Although the design of CNC machining centers varies for
different models, there are only four possible locations for
the machine zero, within the XY view:
Z = UP (TOP)
Lower left corner of the machine
MACHINE ZERO \
Upper left corner of the machine
POSITION Z-
Lower right corner of the machine X+ 1
149
150 Chapter 21
In both illustrations, the arrows indicate the tool motion Tool motion from machine zero of a typica^rear lathe:
direction towards the work area. Moving the tool from ma-
chine zero into the opposite direction will result in a condi- X+ Z+ ... tool motion will overtravel
mind that the relative display can only be set to zero from
the control panel and the absolute display can only be
changed through a work offset, MDI mode, or the part pro-
Machine zero position for a typical CNC lathe (rear type
gram. This topic normally a part of CNC machine opera-
tion training, directly at the machine.
In the illustration, the arrows indicate the tool
motion di-
rection towards the work area. Moving the tool from the For the last two methods of a machine zero return, the
machine zero into the opposite direction will result in over- CNC system offers specific preparatory commands.
travel in the particular axis:
MACHINE ZERO RETURN
151
Program Commands
For example,
There are four preparatory commands relating to the ma-
chine zero reference position: N67 G28
sition and do it along the one or more axes specified in the N67 G28 X.. Y. . Z.
MACHINE make the intermediate motion equal to zero and move the
o
®
/
ZERO
POSITION
cutting tool to the machine zero directly.
specifying the intermediate point as identical to the current
This is done by
v.>
POINT
G90 GOO XO YO ZO and G91 GOO XO YO ZO
Figure 21-4
Intermediate point for machine zero return -XY axes shown Each coordinate statement XOYOZO is interpreted by the
control system differently.To review, an address followed
The toolmotion in Figure 2 1-4 is from the central hole of by a zero, for example XO, means position at the program
the part. During such a motion, the tool can collide with the reference point if the mode is absolute, using the G90
,
upper right clamp on its way to machine zero, if the motion command. If the mode is incremental, using the G91 com-
to the home position were programmed directly. Only the mand, the XO word means no motion for the specified axis.
X and Y axes are considered in the illustration. An interme-
diate point can be programmed in a safe location, without Most CNC lathes use the U and W axes for incremental
making the program any longer. The program without an motion (based on absolute X and Z axes respectively), with
intermediate point can be constructed as:
the same logical applications. Absolute axes coordinates
willbe interpreted as the programmed tool position, incre-
G90 mental coordinates indicate the programmed tool motion.
(MACHINED HOLE) Compare the two program examples below - they are the
GOO X5.0 Y4.0
G28 X5.0 Y4.0 (MACHINE ZERO MOTION) same - they are identical in terms of the actual tool motion:
program to achieve two motions, that would otherwise re- N25 G01 X9.5 Y4.874
quire two blocks. A safe program could also be: N26 G91 G28 ZO M09 (G28 IN INCREMENTAL MODE)
G90
Which method is methods produce
better? Since both
GOO X5.0 Y4.0 (MACHINED HOLE) identical results, the choice based on a given situation or
is
X12.0 (SAFE LOCATION) personal preference. To switch to the incremental mode has
G28 X12.0 Y4.0 (MACHINE ZERO RETURN)
its benefit, because the current tool location may not always
chine zero. If programmed with care, the intermediate posi- in an expensive and possibly serious error.
Absolute mode of programming specifies the current tool The above example can be changed, so the intermediate
position from program zero - always and at all times. motion is eliminated - or - defined as the current too! posi-
Many examples presented here use the absolute program- tion. The intermediate motion can never be eliminated, but
ming mode - after all, this is - or it should be - the standard it can be programmed as a physical zero distance.
reach the machine zero position. That is the defined point One common example of using the intermediate tool po-
already known to be the intermediate position for the ma- sition in a program block, is the return from a deep hole or a
chine zero return command. This intermediate point is as- cavity to the machine zero. In the following example, and
signed the coordinates relating to the part (in absolute solely for the purpose of better explanation, regular tool
mode). In the example, the cutting tool will move to the motions are used rather than a drilling cycle, to retract the
program zero before continuing to the machine zero, result- tool from the hole depth. In the example, the current XY
ing in a single block definition of two tool motions. This, of position is X9.5Y4.874. and a peck drilling operation will
O Option 2
In block N25, the tool is at the bottom of the hole, at a
current tool position of X9.5 Y4.874 Z-0.75 absolute coor- To retract the Z axis all the way to machine zero first and
dinates. All the cutting is done and the tool has to be re- then return the XY axes in the next block, is a variation on
turned home in all three axes. For safety reasons, the Z axis Option 1 First, return the Z axis to the machine zero:
Retract the Z axis above work in one block, Then, return the XY axes to machine zero as well:
then return XYZ axes to machine zero
N27 G28 X9.5 Y4.874
Retract the Z axis all the way to machine zero,
The Figure 21-5 shows the available options. N22 G43 ZO.l HOI M08
N23 GOl Z-0.45 F10.0
XY AXES ONLY MACHINE N24 GOO Z-0.43
% ZERO
POSITION
N25 GOl Z-0.75
N26 G28 Z-0.75 M09
/ N27 G28 X9.5 Y4.874 M05
N28 M01
Hole location
in XY axes is
X9.5 Y4.874 O Option 3
O Option 1
Here is the complete program for Option 3:
the ‘normal’ method, commonly used: N22 G43 ZO.l HOI M08
N23 GOl Z-0.45 F10.0
N24 GOO Z-0.43
N26 GOO ZO.l MO
N25 GOl Z-0.75 M09
N26 G28 X9.5 Y4.874 ZO.l M05
This block must be followed by a return to the home posi-
N27 M01
tion,along the Z axis:
The motion to machine zero will take two steps:
N27 G28 ZO.l M05
Step 1 : Z axis will rapid to ZO. 1 position
Although this is a matter of opinion, the choice of many Zero Return for CNC Lathes
programmers is to move the tool out of a cavity or hole first,
then call the machine zero return command. If there is any
For CNC lathe work, the G28 command may also be
used, usually for setup. Common application of the ma-
justification for this preference, it is the perceived safety the
chine zero return is also used, when at least one axis starts
CNC programmer puls into the program design. To be fair
and ends at the machine zero position. This is quite often
here, there is wrong with the alternate
absolutely nothing
true of the X axis but not of the Z axis, which may be too far
method, if it is used with care. Comparing individual op-
away on some larger lathe models.
tions with each other does offer some valuable conclusions:
Typically, a CNC lathe program will be designed in such
OPTION 1...
a way, that machining of the first part will start from the
... is only reasonably safe, but quite efficient in terms
machine zero, but any subsequent part will be machined
of cycle time. There may be a possibility of an obstacle from a safe tool change position. This method is only prac-
within the three-axis motion to machine zero. tical if program uses geometry offset, rather than the
the
older G50 The most common method of machine
setting.
OPTION 2... zero return on the lathes is the direct method, without an in-
termediate point, because no G91 is required, therefore, an
... is somewhat less efficient than the previous option, but
error is more difficult to make:
definitely the safest one of all three.
N78 G28 UO WO
G91 G28 ZO MO
Figure 21-6 illustrates a typical withdrawal of a boring
Horizontal machining centers require only the Y axis to
bar from a hole, when the machining is completed.
reach its reference position for the automatic tool change.
For safety and extra convenience, the Z axis is usually pro-
grammed as well, along with the Y axis, to prevent a colli-
sion with an adjacent tool in the magazine:
If safe, the B axis may be programmed simultane- When using position register command G50, the XZ
it is
G91 G28 XO BO very similar. Assuming that the machine zero position is at
the coordinate position X10.0 Z3.0, the program for the
Absolute mode designation follows the same rules for a boring tool can be written in two ways - one without using
rotary or indexing axis, as for the linear axes. the G28 command, the other one with the G28 command.
156 Chapter 21
The first example does not use G28 machine zero return G27 X.. Y.. Z..
command at all:
where at least one axis must be specified.
N1 G20 (EXAMPLE 1)
When used in the program, the cutting tool will automati-
N58 G50 X10.0 Z3.0 S1000 (OLDER METHOD ONLY) cally rapid (no GOO necessary) to the position as specified
N59 GOO T0300 M42 by the axes in the G27 block. The motion can be either in
N60 G96 S400 M03 the absolute or incremental mode. Note that no G28 com-
N61 GOO G41 X4.0 Z0.15 T0303 M08 mand is used.
N62 GOl Z-2.45 F0.012
N63 X3.8 MO
N1 G20
N64 GOO G40 X3 5 Z0.15 M05 .
N1 G20 (EXAMPLE 2)
In the example, block N8 contains G27, but no GOO or
G28. This block instructs the CNC machine to return to the
N58 G50 X10.0 Z3.0 S1000 (OLDER METHOD ONLY)
position X7.85 Z2.0 and check, upon arrival to the target
N59 GOO T0300 M42
N60 G96 S400 M03 position, if that position is the machine zero in all specified
N61 GOO G41 X4.0 Z0.15 T0303 M08 axes (two axes in the example). A confirmation light will
N62 GOl Z-2.45 F0.012 turn on, if the machine zero position is confirmed. If the po-
N63 G40 X3.8 MO sition is not confirmed, the program will not proceed any
N64 G28 X3.5 Z0.15 M05 T0300 further until the cause (misposition) is eliminated.
N65 M01
Compare the starting position in block N2 and the return
Most CNC
programmers will likely feel more comfort- position in block N8. Assuming that this position is at ma-
able with the first example and saving one program block chine zero reference point in both the X and Z axes, the
program will not likely be compelling enough to change above example will confirm OK position in the N8 block.
their programming style. The second example (Example 2) Now, suppose that a small error has been made while writ-
can be programmed in the incremental mode as well, using ing block N8, and the X value was entered as X7.58 rather
the U and W addresses, but it would not be too practical. than the expected X7.85:
RETURN POSITION CHECK COMMAND N8 G27 G40 X7.58 Z2.0 T0400 M09
Here is how the first program (Example 1) listed earlier, (LATHE EXAMPLE)
can be modified to accept the G27 command. Note that the
G27 will only move to the coordinates specified, not to any T0303
intermediate or other point. Block N65 will become the ac-
G28 U5.0 W3.0
tual check block. The control system will move the ma-
G29 U-4.0 W2.375
chine axes to XI 0.0 Y3.0 and checks (confirms) whether
this position is in fact the machine zero reference point.
The G29 command should always be issued in the can-
This is the reason Example 1 could be modified, but not the celed mode of
both the cutter radius offset (G40) and the
second Example 2. fixed cycles (G80), if either is employed in the program.
Use the standard cancellation G codes - G40 to cancel cut-
N1 G20 ter radius offset and G80 to cancel a fixed cycle, before the
try that do need the G50 setting. The equivalent program commands, starting at the cur-
rent tool position, which is point A, and resulting in the A
RETURN FROM MACHINE ZERO POINT to B to C to B to D tool path are quite simple:
G30 P.. X.. Y.. Z. In this case, the setting of the second reference point is
within the parameters of the control system. In respect to
other programming considerations, the G30 command is
used in exactly the same way as the much more common
G28 machine zero return command.
22 LINEAR INTERPOLATION
Linear interpolation is closely related to the rapid posi- Start and End of the Linear Motion
tioning motion.While the rapid tool motion is meant to be
used from one position of the work area to another position Linear motion, like any other motion in CNC program-
without cutting the linear interpolation mode is designed
,
ming, is a motion between two end points of the contour. It
for actual material removal, such as contouring, pocketing, has a start position and the end position. Any start position
face milling and many other cutting motions. is often called the departure position, the end position is
from one position to another by the shortest distance be- Single Axis Linear Interpolation
tween the end points. This is a very important program-
ming feature, used mainly in contouring and profiling. Any The programmed tool motion along any single axis is al-
angular motion (such as chamfers, bevels, angles, tapers, ways a motion parallel to that axis, regardless of the motion
etc.) must be programmed in this mode to be accurate. mode. Programming in either GOO or G01 mode will result
Three types of motion can be generated in the linear inter- in the same programmed end point, but at different feed-
polation mode: rates and with different results. Evaluate Figure 22-1 for
comparison of the two motion modes.
Horizontal motion ... single axis only
LINEAR COMMAND
G01 Linear interpolation
Comparison of the rapid mode and the linear interpolation mode
In G01 mode, the feedrate function F must be in effect. For CNC machining centers and the related machines, all
159
160 Chapter 22
>
r Motion from gramming method is not efficient enough. Such program-
ming projects more than justify an investment into a profes-
X2.0 Y1.0
sional computer based programming system, such as the
to
c yo n V9 n very powerful and widely used Mastercani rM that is based
o AZTO I O.U
,
9
£ Computer based programming is not a subject of this hand-
o book, but its general concepts are discussed briefly in the
C3.
i last chapter of the handbook ( Chapter 53).
n
u * ^ AY The three-axis (XYZ) simultaneous linear motion is il-
Figure 22-2
PROGRAMMING FORMAT
program a tool motion in the linear interpola-
In order to
tion mode, use preparatory command GO along with one,I
G01 X. . Y. . Z. . F.
Two axes simultaneous linear interpolation motion
All entries in the linear motion block are
modal and need
Three Axis Linear Interpolation to be programmed only if they are new or changed. Only
the block instruction (word) that is affected by the change
A linear motion that takes place along three axes at the needs to be included in the program block.
same time, is called the three axis linear interpolation. A
simultaneous linear motion along three axes is possible on Depending on which programming method is selected,
virtually all CNC machining centers. Programming a linear the linear interpolationmotion may be programmed in the
motion of this kind is not always easy, particularly when absolute or incremental mode, using G90 and G9 prepara- 1
working with complex parts. Due to many difficult calcula- tory commands for milling and incremental addresses U
tions involved in this type of tool motion, the manual pro- and W
for turning.
LINEAR INTERPOLATION 161
The actual cutting feedrate for a defined tool motion can cial in programming at all. It is included here for the mathe-
be programmed in two modes: matically oriented and interested individuals only. There is
... per spindle revolution mm/rev or in/rev automatically. On the other hand, here it is anyway.
The selection depends on the machine type and dimen- In order to keep the linear motion as the shortest motion
sional units used. Typically, CNC machining centers, drills, between two points, the CNC unit must always calculate
mills, routers,flame cutters, laser profilers, wire EDM, etc., the feedrate for each ctxis individually. Depending on the
direction of the linear motion (its angular value), the com-
use feedrate per time. CNC lathes and turning centers typi-
cally use feedrate per revolution. puter will 'speed up' one axis and 'holdback' the other axis
at the same time and it will do it constantly during the cut.
,
Feedrate Range The result is a straight line between the start and end points
of the linear contour. Strictly speaking, it is not a straight
Every CNC system supports cutting feedrate only within line but a jagged line, with edges so diminutive in size that
a certain range. For linear interpolation in milling applica- they arc virtually impossible to see, even under magnifica-
tions, the typical lowest feedrate is 0.0001 either as in/min, , tion. For all practical purposes, the result is a straight line.
mm/min or deg/min. The lowest feedrate for linear interpo-
lation in turning is dependent on the minimum increment The calculations are done by the CNC system, according
of the coordinate axes XZ. The following two tables point to the following entries, as illustrated in Figure 22-5.
.0001 inch .000001 - 50.000000 in/min GOO X10.0 Y6.0 (START POINT)
G01 X14.5 Y7.25 F12.0 (END POINT)
2 ! 1
L = V X, + Y, + Z,
2 2 2
L = ^ 4.5 + L25 + 0 = 4.6703854
F
X,
© Example 1 :
L x F
(CLOCKWISE DIRECTION
Z.
Fz
r -
L x F O Example 2
In order to illustrate the practical use of linear interpola- Linear interpolation provides means of programming all
tion mode in a CNC program, here is a simple example, orthogonal (i.e., vertical and horizontal) motions, as well as
shown in Figure 22-6. angular tool motions as the shortest linear distance between
two points. Cutting feedrate must be programmed in this
For even more comprehensive understanding, the exam-
mode, for proper metal removal. Note that the coordinate
ple will be presented twice. One tool motion will start and
location that has not changed from one point to the next -
end at the P location and will be programmed in the clock-
I
In many control manuals, the block skip function is also BLOCK SKIP SYMBOL
called the block delete function. The expression ‘block de-
lete’ offers rather a misleading description, since no pro-
To identify the block skip function in a program, a special
gram blocks skipped dur-
will actually be deleted but only
programming symbol is required. This block skip function
ing program processing. For this good reason, the more
symbol is represented by a forward slash [ / ]. The system
accurate description of the function is the block skip func- will recognize the slash as a code for the block skip. For
tion, a term used in the handbook. This function is a stan-
most of CNC programming applications, the slash symbol
dard feature of virtually all CNC controls. Its main purpose is placed as the first character in a block:
is programmer some additional flexibility in de-
to offer the
signing a program for no more than two conflicting possi-
bilities. In the absence of a block skip function, the only al-
O Example 1 :
ternative is to develop two individual part programs, each N1 ... (ALWAYS PROCESSED)
covering one unique possibility. N2 ... (ALWAYS PROCESSED)
N3 ... (ALWAYS PROCESSED)
/ N4 ... (PROCESSED IF BLOCK SKIP IS OFF)
TYPICAL APPLICATIONS (PROCESSED IF BLOCK SKIP IS OFF)
/ N5 ...
/ N6 ... (PROCESSED IF BLOCK SKIP IS OFF)
To understand the idea of two conflicting possibilities, N7 ... (ALWAYS PROCESSED)
consider this programming application. The assignment is
N8 ... (ALWAYS PROCESSED)
to write a program for a facing cut. The problem is that the
On some control systems, the block skip code can also be
blank material for parts delivered to the CNC machine is
used selectively for certain addresses within a block, rather
not consistent in size. Some blanks are slightly smaller in
than at its beginning. Check the manual if such a technique
size and can be faced with a single cut. Others are larger
can be used - it can be very powerful:
and will require two facing cuts. This is not an uncommon
occurrence in CNC shops and is not always handled effi-
ciently. Making two inefficient programs is always an op-
O Example 2
skip function will be provided in the program and applied not active), the whole block will be executed in Example 2,
to all blocks relating to the first facing cut. The ‘second’ cut including the coolant function.
will always be needed!
Other common applications of the block skip function in- CONTROL UNIT SETTING
clude a selective ON/OFF status toggle, such as the coolant
function, optional program stop, program Also
reset, etc. Regardless of the slash code position within a block, the
useful are applications for bypassing a certain program op- program will be processed in two ways. Either in its en-
eration, applying or not applying a selected tool to a part tirety, or the instruction following the slash will be skipped
contour and others. Any programming decision that re- (ignored). The final decision whether or not to use the
quires a choice from two predetermined options is a good block skip function is made during actual machining, by
candidate for the block skip function.
163
164 Chapter 23
the operator, depending on the type of machining. For this A simple programming solution to avoid this potential
purpose, a push button key, a toggle switch, or a menu item problem is available. Just repeat all modal commands in
selection provided on the control panel of the CNC unit.
is the program section that will not be affected by the block
Selection of the block skip mode can be either as active skip function.
(ON) - or inactive (OFF).
Compare the following two examples:
Most programs will not require any block skip codes. In
such cases, the setting mode for the block skip function on © Example A Modal commands
- are not repeated :
Block skip function set to OFF position means In both examples A and B, the program block containing
"Process all block instructions." the slash code indicates an intermediate Z axis position as
Z0.1. This position may be required only in certain cases
the contents of blocks N4,
during machining and the operator will decide whether to
In the Example 1 listed earlier,
use it or not, and also when to use it.
N5 and N6 will be ignored, if the block skip function is ON.
They will be processed, if the switch setting is OFF. The The examples as N6, con-
critical block, identified in the
Example 2, also listed earlier, contains a slash in the block tains several modal functions. The commands G01, Z0.1,
N7. The slash symbol is preceding the miscellaneous func-
F30.0 and M08 will all remain in effect, unless they are
tion M08 (coolant ON). If the skip function switch is ON,
canceled or changed in any following block. From block
the coolant will be ignored; if it is OFF, the coolant function N7 it is apparent that the Z coordinate position and the cut-
will be effective. This application may be useful in a dry ting feedrate value have changed. However, the G01 and
run mode, to bypass the coolant Hood during program veri- M08 commands are not repeated in the example A and will
fication, if no manual override is available.
not be in effect, if the block skip switch is set ON.
Not all controls allow the slash code in any other block Both examples A and B will produce identical results, but
position, except as the first character in the block: / N.. only if the block skip function is in the inactive (OFF)
mode. The control system will then execute the instructions
of programming sequence.
BLOCK SKIP AND MODAL COMMANDS in all blocks, in the order
summary, there is one basic rule for developing tions for two cuts and the block skip function will be used
In the
CNC programs with blocks using the block skip function: on all blocks relating to the first cut.
PROGRAMMING EXAMPLES
The block skip function is very simple, often neglected,
yet, ita powerful programming tool. Many programs can
is
Block N5 contains the initial tool approach motion. The Block N9 does not need a feedrate for a good reason - it will
next three blocks are preceded by a slash. In N6, the tool be e/r/ier FI 5.0 or FI 8.0, depending on whether blocks N6
cuts off the front face, at Z0.135; N7 moves the tool away to N8 were skipped or not. The feedrate is very important in
from the face, block N8 is a rapid motion back to the initial block N 10. Such a repetition guarantees the required feed-
diameter. There are no other blocks to be skipped after the rate in the critical block, when actual cutting takes place.
block N8. N9 block contains a feedrate to the front face ZO,
N10 is the front face cutting motion, N1 1 is the clearance Both lathe and mill examples should offer at least some
motion, followed by standard final blocks. basic understanding of the logic used in program develop-
ment, using the block skip function. Exactly the same logi-
Evaluate the example not once but at least twice - it shows cal approach can be used for more than two cuts and can
what exactly happens. During the first evaluation, read all also be applied to operations other than face cutting.
blocks and ignore the block skip function. During the sec-
ond time, ignore all blocks containing the slash code. There Machining Pattern Change
will be identical results when compared with the first eval-
uation. The only difference will be the number of actual Another application, where the block skip function may
cuts - one, not two. In milling, the procedure is very similar. be used efficiently, is a simple family programming. The
term family programming means a programming situation
An example for a milling application uses a 05 inch face where there may be a slight difference in the design be-
mill. The excessive material stock to be faced varies be- tween two or more parts. Such a small variation between
tween .120 and .315. The largest reasonable depth of cut similar parts is often a good prospect for block skip func-
selected will be .177 (4.5 mm) - Figure 23-2. tion. Aminor deviation in a machining pattern from one
drawing to another can be adapted in a single program us-
ing the block skip function. Following two examples show
typical possibilities of programming a change of the tool
path. In one example, the emphasis is on a skipped machin-
ing location. In the other example, the emphasis is on the
pattern change itself. Both examples are in metric and illus-
trate a simple grooving operation. In the lathe example, the
Figure 23-3 is related to program 02303.
02302 (MILLING)
(VARIABLE FACE STOCK)
N1 G20
N2 G17 G40 G49 G80
N3 G90 GOO G54 X11.0 Y4.0
N4 G43 Z1.0 S550 M03 HOI
N5 G01 ZO 177 F15.0 M08
.
/ N6 X-3.0 F18.0
/ N7 ZO 375 .
/ N8 GOO X11.0
N9 G01 ZO
N10 X-3.0 F18.0
Variable machining pattern - turning application
Nil GOO Z1.0 MO
N12 G28 X-3.0 Y4.0 Z1.0 The upper picture shows the result with block skip func-
Ml 3 M30
tion set ON, the lower picture shows the result with block
%
skip function set OFF, using the same program.
Block N5 in the example contains the Z axis approach to
02303 (LATHE EXAMPLE)
the first cut, at Z0.177 level. The next three blocks can be
N1 G21
skipped if necessary. In the N6 block, the face mill actually
cuts at ZO. 177 position, N7 is the tool clearance motion af- N12 G50 S1800
and N8 returns the tool to the initial X position.
ter the cut, N13 GOO T0600 M42
There are no other blocks to be skipped after block N8. N14 G96 S100 MO
BLOCK SKIP FUNCTION 167
N15 X43.0 Z-20.0 T0606 M08 Both variations of program 02304 machine a hole pat-
N16 G01 X35.0 F0.13 tern with 6 or 4 holes. Block skip function has been used to
N17 GOO X43.0 make a single program covering both patterns. The top of
/ N18 Z-50.0
Figure 23-4 shows the hole pattern when block skip func-
/ N19 G01 X35.0
tion is set OFF, the bottom shows the hole pattern when
/ N20 GOO X43.0
N21 X400.0 Z45.0 T0600 MOl block skip mode is set ON.
Program 02303 demonstrates a single program for two 02304 (MILLING EXAMPLE)
parts with similar characteristics. One part requires a single N1 G21
groove, the other requires two grooves on the same diame-
N16 G90 GOO G54 X30.0 Y25.0 M08
ter. In the example, both grooves are identical - they have
N17 G43 Z25.0 S1200 M03 H04
thesame width and depth and are machined with the same N18 G99 G81 R2 5 Z-4.0 F100.0. (HOLE 1)
The only difference between the two examples is the
tool. N19 X105.0 (HOLE 2)
number of grooves and the second groove position. Ma- N20 Y75.0 (HOLE 3)
chining the part will require the block skip function set ON / N21 X80.0 Y50.0 (HOLE 4)
or OFF, depending on the grove to be machined. / N22 X55.0 (HOLE 5)
N23 G98 X30.0 Y75.0 (HOLE 6)
Evaluate the more important blocks in the program ex- N24 G80 G28 X30.0 Y75.0 Z25.0
ample. The N15 block is the initial tool motion to the start N25 MOl
of the first groove at Z-20.0. In the next two blocks, N16
and N17, the groove will be cut and the tool returns to the
Blocks N18 to N20 will drill holes 1, 2 and 3. Hole 4 in
clearance diameter. The following three blocks will cut the N21 and hole 5 in N22 will be drilled only if the block skip
function is set to inactive mode (OFF), but neither one will
second groove, if it is required. That is the reason for the
block skip code. In the block N 8, the tool moves to the ini-
1
not be drilled when the block skip setting is active (ON).
parts and two missing holes in the second part only. This is
function has been set ON. The middle hole will have a dif-
a good example of similar parts program, using block skip. ferent Y axis position, depending on the setting of the block
skip function at the machine.
Program 02304 - variable machining pattern for a milling Program 02305 - variable machining pattern for a milling
application - result with block skip OFF (top) and ON (bottom) application - result with block skip OFF (top) and ON (bottom)
168 Chapter 23
Another useful application of the block skip is to provide / N17 G96 S600 M03
the machine operator with means of measuring the part be- N18 GOO G42 XI. 675 ZO.l T0606 M08
fore any final machining on the part has been done. Due to N19 G01 X2.0 Z-0.0625 F0.007
various dimensional imperfections of the cutting tool com-
N20 Z-1.75
N21 X3.5 F0.01
bined with other factors, the completed part may be slightly
N22 GOO G40 X10.0 Z2.0 T0600
outside of the required tolerance range.
N23 M01
The following method of programming is very useful for
When program 02306 is processed with the block skip
programming parts requiring very close tolerances. It is
set OFF, all blocks will be executed, including the trial cut
also a useful method for those parts, where the pan shape is
and finish profile. With the block skip set ON, the only op-
difficult to measure after all "machining is completed, for
eration executed will be the finishing to size, without the
example conical shapes, such as tapers. The same method
trial cut. In this case, all significant instructions are retained
is also quite useful for parts where the cycle time of an indi-
by repetition of the key commands (N 18 and N19). Such a
vidual tool is relatively long and all the tool offsets have to
repetition is very crucial for successful processing in both
be fine tuned before production machining.
modes of the block skip function. MOO function in N16 al-
This approach to pan programming is more efficient, as it
ways stops the machine and enables a dimensional check.
eliminates a recut, increases surface finish, and can even
Selecting trial diameter of 2.0563 example may be
in the
prevent a scrap. In cither case, a trial cut programming
questioned. What is the logic for it? The trial diameter can
method that employs the block skip function is used. Set-
be other reasonable size, say 2.05. That would leave a .025
ting the block skip mode OFF, the machine operator checks
stock per side for the finish cut. It is true that a different
the dimension, adjusts the individual offset, if neces-
trial
diameter could have been selected. The four decimal num-
sary, and continues the machining with block skip set ON.
ber was only selected for one reason - to psychologically
The general concepts described in example 02306 are encourage the operator to maintain accurate offset settings.
equally applicable to turning and milling - Figure 23-6. Feel free to disagreeprogrammers may prefer a three or
-
In the next example, another trial cut will also be pro- 02308
grammed before the actual machining, but for a different (TRIAL CUT FOR TAPER - TWO TOOLS)
reason - Figure 23-7. N1 G20 G99 G40
N2 G50 S1750 T0200 M42
N3 G96 S500 M03
/ N4 GOO G42 X4.46 ZO.l T0202 M08
/ N5 G01 Z-0.4 F0.008
/ N6 U0.2 F0.03
/ N7 GOO G40 X10.0 Z5 0 T0200 MOO .
N16 GOO G40 X10.0 Z5.0 T0200 M01 towards a when the clearances are small.
part, particularly
The rapid motion rate of many modern CNC machines can
Program 02307 illustrates a common situation, where a be very high, well over 1500 in/min. At such high speeds,
single cutting tool is used for both roughing and finishing the rapid approach to the cutting position on the part may
operations. It shows a logical way of using the block skip not add to the operator’s confidence, particularly when the
function, in a simple form. In most applications, separate approach is programmed to the close proximity of the ma-
tools for roughing and finishing may be needed, depending terial. On
most controls, the operator can set the rapid over-
on the degree of required accuracy. When using two cutting ride rate to 100%, 50%, 25% and slower. On older controls,
tools, the trial cut dimension is usually more important for the rapid rate override cannot be done.
the finishing tool than for the roughing tool. In program
The next two examples, 02309 and 02310, show a typi-
02308, the block skip function is illustrated using two cut-
cal programming method to eliminate the problem during
ting tools - T02 is for roughing, T04 is for finishing. Previ-
setup and program proving, yet maintain the full rapid mo-
ous example in Figure 23-7 is used.
tion rate during repeated operations for productivity.
170 Chapter 23
Block skip function in these examples takes a less usual Numbered Block Skip
role used for a section of a block, rather than the
- it is
For machining, the block skip function is set to either the
whole block itself, if the control supports such a method.
ON or OFF position and remains in this mode for the whole
program. If the ON setting is required for one section of the
02309 (TURNING EXAMPLE)
N1 G20 G40 G99 program, but not for another, the operator has to be in-
N2 G50 S2000 formed, usually in the program comments. This practice of
N3 GOO T0200 M42 changing block skip mode in the middle of a program can
N4 G96 S400 M03 be unsafe and possibly create problems.
N5 G41 X2.75 ZO T0202 M08 /G01 F0.1
N6 G01 X. F0.004
. An optional feature on some controls is a selective or a
N7 .. . numbered block skip function. This option allows the oper-
ator to select which portions of the program required the
02310 (MILLING EXAMPLE) ON setting and which portions require the OFF setting. The
N1 G20 G17 G40 G80 settings can bedone before pressing the Cycle Start key to
N2 G90 GOO G54 X219.0 Y75.0 M08 initialize theprogram. This method also uses the slash
N3 G43 Z-1.0 S600 M03 HOI /G01 F30.0
symbol, but followed by an integer, within the range of to 1
N4 G01 X. F12.0
.
9. The actual selection of the mode is done on the control
N5 ...
screen (Settings), under the matching switch number.
In both examples, the block skip used within a single is
For example, a program may contain three groups, each
block. The design of both programs takes advantage of two
expecting a different setting of the skip function. By using
conflicting commands within the same block. If two con-
the switch number after the slash symbol, the groups are
flicting commands exist in a single block, the latter com-
clearly defined and all the operator must do is to match the
mand used in the block will become effective.
control settings with the required activity.
In both examples, the first command is GOO, the second
one is G01. Normally, the G01 motion will take a priority. Nl ...
N2 . .
Because of the slash code, the control will accept GOO, if
/I N3 ... (BLOCK SKIP GROUP 1)
the block skip is set ON, but it will accept G01, if the block
/I N4 ... (BLOCK SKIP GROUP 1)
skip is set OFF. When the block skip mode is OFF, both
motion commands will be read and the second command in
that block becomes effective (G01 overrides GOO). Watch N16 ...
for one possibility, already emphasized: /2 N17 ... (BLOCK SKIP GROUP 2)
/2 N18 . . (BLOCK SKIP GROUP 2)
Block skip within a block may not work with all controls.
/2 N19 ... (BLOCK SKIP GROUP 2)
During the first machine run, the operator should set the N29 . .
block skip OFF, making the G01 command effective. The /3 N30 ... (BLOCK SKIP GROUP 3)
tool motion will be slower than in the rapid mode, but much /3 N31 ... (BLOCK SKIP GROUP 3)
safer. Also, the feedrate override switch of the control sys-
tem will become effective, offering additional flexibility.
vent the G01 motion from being processed. Both 02309 for thenormal version. Incidentally, the / selection is the
1
and 02310 are typical examples of breaking with tradition same as a plain slash only, so blocks N3 and N4 above,
to achieve a specific result. could have also be written this way:
riod of time required for the pause. This time has to be suf- in a separate block. Only fixed cycles that require a dwell
ficient - neither too short nor too long. time can use it in the same block. For all other applications,
the dwell command must be programmed as an independ-
Dwell command is always completed ent block. It will remain active for
block only and does
that
before the next operation begins. not carry over to the next block. Dwellis a only one block
171
172 Chapter 24
Dwell Command Structure The control unit interprets such a command as a dwell,
not as a axis motion. This is because of the presence of the
The structure - or format - for the dwell function is:
preparatory command G04, which establishes meaning of
the address that follows it. If using the X or U address for
X5.3 ... All machines, excludingfixed cycles dwell does not feel comfortable, use the third alternative -
U5.3 ... Lathes only the address P. Keep in mind, that the address P does nut ac-
P53 ... AH machines, includingfixed cycles cept the decimal point, so the dwell is programmed directly
as the number of milliseconds to control the pause duration.
Inany case, the typical representation is five digits before One millisecond is l/1000th of a second, therefore one sec-
and three digits after the decimal point, although that may ond is equivalent to 1000 milliseconds.
vary on different control systems.
X
The addresses and U can also be programmed in milli-
Since milliseconds or seconds can be used as units of seconds, without a decimal point - for example,
dwell, the relationship can be established:
G04 X2.0 is equal to G04 X2000
Is = 1000ms
Leading zero suppression is assumed in the format with-
out the decimal point (trailing zeros are required):
lms = 0.001s
PI P0001 ... 1 millisecond
nsr where . .
P10 P0010 ... 10 milliseconds
confusion, particularly to new programmers. The X and U program one second seems
the dwell duration. After all,
incorrectly be interpreted as an axis motion. like a very short time, but think about this example:
addresses may
This will never be the case. By definition, the axis and its X
X one block of the program, a dwell function is assigned
In
lathe application, the U
axis, is the dwelling axis. axis is
for the duration of one second. The spindle speed is set to
the only axis common to all CNC machines.
480 r/min and the dwell is applied at 50 locations on the
part, perhaps during a spot face operation. That means the
No axis motion will take place when the X, P or U address
command G04 cycle time for each part is 50 seconds longer with the dwell,
is used with the dwell
then it would be without the dwell. Fifty seconds may not
DWELL COMMAND 173
seem too unreasonable, but are they really necessary? Give MINIMUM DWELL
it a little thought or - even better - calculate it. If the dwell
must be used at all, make sure to calculate the minimum
During a cut, that is for operations where cutting tool is in
dwell that can do the job. It is easy to select the dwell arbi-
contact with the machined part, the minimum dwell defini-
trarily, by guessing and without much thinking. In the ex-
tion is important, but the setting mode is unimportant (time
ample, the minimum dwell required is only 0. 25 seconds: 1
or number of revolutions).
60 / 480 = 0.125
Minimum dwell is the time required
to complete one revolution of the spindle.
This minimum dwell is eight times less than the pro-
O Example
SETTING MODE AND DWELL
calculate minimum dwell in seconds for spindle rota-
To
tionof 420 r/min, divide the r/min into sixty (there are 60
Most programs machining centers will use feedrate
for
seconds in one minute):
per time (programmed in inches per minute - in/min - or
For the number of spindle revolutions setting, the dwell is The reasoning for this adjustment takes into consider-
expressed as the number of times the spindle rotates, within ation some machining realities. It is quite normal that the
the range of 0.001 to 99999.999 revolutions, for example: CNC operator may be running a certain job with the spin
die speed in an override mode, perhaps even set at its lowest
G04 P1000 setting, at 50%. Since 50% spindle speed override is the
usual minimum on most CNCdouble mini-
controls, the
. . . represents the dwell for the duration of one revolution mum dwell will always guarantee at least one complete
of the spindle. revolution without the loss of production time.
,
174 Chapter 24
NUMBER OF REVOLUTIONS 60 x n
D we H sec
r/min
In the other dwell mode (selected by a system parameter),
the programming format will only appear to be the same,
but its meaning will be much different. In some applica- ns- where . .
For example, to dwell as long as it takes to complete three The program block representing the required three spin-
spindle revolutions can be programmed directly, regardless dle revolutions in terms of dwell time will take one of the
of the spindle r/min. following forms:
Time Equivalent ^ The result confirms the formula is correct. It is more than
The two modes cannot be mixed in one program deliber- likely, that the calculation will start with a dwell that is al-
lent time must be calculated. The spindle speed (in r/min) tions mostly used for CNC lathe applications, especially
is
must always be known in such a case. when cutting with very slow spindle speeds. A slow spindle
rotation does not have the latitude of faster speeds and does
The dwell time in seconds can be calculated to be equal to not allow for a large error in the dwell calculation. Keep in
the required number of spindle revolutions. Use the follow- mind one complete part rota-
that the goal is to get at least
ing formula: tion in order to achieve desired machining results. Other-
wise, why program dwell at all? Consider another example:
DWELL COMMAND 175
seconds. The large range available on the control system chining center in the example. The initial spindle speed
first
(over 27 hours) is more important to the maintenance per- setting includes gear range selection, for example, M43.
sonnel, than to the CNC programmer. As an example of a The spindle rotation has been set to 100 r/min. The dwell of
typical application when a long dwell may be beneficial, is 600 seconds follows, leaving the spindle rotating for full 10
a program developed by the maintenance technicians for minutes. Then the speed is increased to 500 r/min and re-
testing the spindle functionality. mains that way 20 minutes ( 1 200 seconds). Be-
for another
fore the spindle is more change is done - the
stopped, one
Consider carefully the following actual situation com- spindle speed increases to 1500 r/min and remains at that
mon to machine service - a spindle of the CNC machine speed for another 30 minutes (1800 seconds).
has been repaired and must be tested before the machine
can be released back to production. The testing will mainly Maintain all safety rules when using long dwell times !
The maintenance (service) program will be a little different up). As usually, all safety considerations must have a high
for machining centers than for lathes but the main objec- priority in all cases.
left before the dwell time expires. This can be viewed by Chapter 25 of this handbook covers the subject of fixed
looking at the X display of the Distance-To-Go indicator on cycles for CNC machining centers and drills in a significant
the POS (position) screen of a typical Fanuc control. This detail. In-depth descriptions of all cycles can be found in
display will always be displayed as X, since X axis is the this chapter. For the purpose of the current topic, here are
only dwelling axis, regardless of control system, even if ad- just some comments relative to the subject of dwell, this
dresses P or programmed. Why the X axis has been
U are time, as the dwell relates to fixed cycles.
selected as the dwelling axis and not any other axis? There
is a simple reason - because the X axis is the only axis com- Several fixed cycles can be programmed with a dwell:
mon to all CNC machine tools - i.e., drilling machines,
Normally, cycles G76, G82, G88, G89
mills, machining centers, flame cutters, waterjets, lasers,
and so on. They all use XYZ axes. Lathes use XZ axes Also cycles G74 and G84, only by parameter setting
Machining holes is probably (he most common opera- The method of point-to-point machining for holes is a
tion, mainly done on CNC milling machines and machin- method of controlling the motions of a cutting tool in the X
ing centers. Even in the industries traditionally known for and Y axes at a rapid machine rate, and in the Z axis at a
their complex parts, such as aircraft and aerospace compo- cutting feedrate. Some motions along Z axis may also in-
nents manufacturing, electronics, instrumentation, optical clude rapid motions. All this means is that there is no cut-
or mold making industries, machining holes is a vital part ting along XY axes for holes operations. When the cutting
of the manufacturing process. tool completesall motions along the Z axis and returns
Even holes machined with the same tool may be differ- Step 2: Rapid motion to the starting point of the cut
... along the Z axis
ent.Holes having the same diameter may have a variable
depth, they may even be at different depths of the part. If all Step 3: Feedrate motion to the specified depth
possible combinations are considered, it is easy to realize ... along the Z axis
that making one hole may be a simple matter, butmaking a
Step 4: Return to a clear position
series of many different hole operations in one program re-
... along the Z axis
quires a well planned and organized approach.
These four steps also represent the minimum number of
In the majority of programming applications, hole opera-
blocks required to program a single hole, using manual
tions offer a great number of similarities from one job to
programming method, without using fixed cycles. If there
another. Hole machining is a reasonably predictable opera-
is only one or two holes in a part drawing and the machin-
tion and any operation that is predictable is an ideal subject
ing operation is nothing more than a simple center drilling
to be handled very efficiently by a computer. For this rea-
or drilling, the program length is of no significant impor-
son, virtually all CNC control manufacturers have incorpo-
tance. That is not the common case - normally, there are
rated several ingenious programming methods for machin-
many holes in a part and several tools have to be used to
ing holes in their control systems. These methods use so the
complete each hole to engineering specifications. Such a
called canned cycles or - more commonly - the fixed cycles.
program could be extremely long and very difficult to inter-
pret and change. In fact, it may even be too long to fit into
POINT-TO-POINT MACHINING the standard CNC memory.
177
178 Chapter 25
Single Tool Motions vs. Fixed Cycles N5 G99 G82 RO.l Z-0.6813 P200 F4 .
N6 X3.87 Y3.4
The following two examples compare the differences of N7 X2.047
programming a hole pattern in individual blocks (02501), N8 G80 G28 X2.047 Y3.4 Z1.0 M09
where each step of the tool path must be programmed as a N9 M30
single motion block, and the same pattern of holes using a %
fixed cycle (02502). No explanations to the programs are
given at this stage and the comparison is only a visual illus-
Program 02501 required the total of 18 blocks, even for
tration between two programming methods. It
distinct three holes only. In program 02502, using fixed cycles,
03/16 standard drill that is used only nine blocks were needed. The shorter program 02502
shows an application of a
is also easier to read, there are no repetitious blocks. The
to cut a full blind depth of .625 inches. Only three holes are
programmed in the example, illustrated in Figure 25-1. program modifications, updates and other changes can be
done much easier, whenever required. Always use fixed cy-
cles for machining holes, even if a single hole is machined.
The second example in program 02502 uses the same Boring cycle
G85
hole pattern, but fixed cycles are used for efficiency.
G86 Boring cycle
02502 (EXAMPLE 2)
(PROGRAM USES FIXED CYCLE) G87 Back boring cycle
N1 G20
G88 Boring cycle
N2 G17 G40 G80
N3 G90 G54 GOO X5 9 Y1.89 S900 M03
.
Boring cycle
G89
N4 G43 Z1.0 HOI M08
FIXED CYCLES 179
General format for a fixed cycle is a series of parameter The dwell time is practically applicable only to G76,
values specified by a unique address (not all parameters are G82, G88 and G89 fixed cycles. It may also apply to G74,
available for every available cycle): G84 and other fixed cycles, depending on the control pa-
rameter setting.
N.. G.. G.. X.. Y.. R.. Z.. P.. Q.. I.. J.. F.. L.. (or K..)
Dwell time can be in the range of 0.001 to 99999.999
Explanation of the addresses used in fixed cycles (in the seconds, programmed as PI to P99999999
Within the range of N1 to N9999 or N1 to N99999, de- it means a depth of each peck
pending on the control system When used with cycles G76 or G87,
it means the amount of shift for boring
G (first G command) = G98 or G99 The addresses I and J may be used instead of address Q,
depending on the control parameter setting.
G98 returns tool to the initial Z position
G99 returns tool to the point specified by the address R I = Shift amount
G (second G command) = Cycle number Must include the X axis shift direction for
boring cycles G76 or G87
X value can be an absolute or incremental value The J shift may be used instead of the Q - see above.
Y value can be an absolute or incremental value Applies to the cutting motion only
G91 command is required to select the incremental mode. Manual motion and direction
cycle, the control system will select the default command OSS Oriented spindle stop
as set by a system parameter (usually the G98 command).
DWELL Dwell function executed
Address P for the dwell time designation cannot use a
decimal point (G04 is not used) - dwell is always Figure 25-2
main function is to bypass obstacles between holes within a another. Safety is the determining issue here.
machined pattern. Obstacles may include clamps, holding
fixtures, protruding sections of the part, unmachined areas,
Once a fixed cycle is applied, the initial Z level cannot be
accessories, etc. Without these commands, the cycle would changed, unless the cycle is canceled first with G80. Then,
have to be canceled and the tool moved to a safe position. the initial Z level can be changed and (he required cycle be
The cycle could then be resumed. With the G98 and G99 called. The initial Z level is programmed as an absolute
commands, such obstacles can be bypassed without cancel- value, in the G90 mode.
ing the fixed cycle, for more efficient programming.
R LEVEL SELECTION
by definition, the absolute value of the last
Initial level is,
1 ' IMITIAI
1111 1
1
L_
crx/ci
l VI
rules
than once
do not allow the same axis
in a single block. Therefore,
to be programmed more
some adjustment in
— — R LEVEL
ZO
the control design
values required for a fixed cycle.
must be made toaccommodate both Z
The obvious solution is
that one of them must be replaced with a different address.
I —Z
l (Z DEPTH) for the tool Z position from which the cutting feedrate
applied. This address uses the letter R. A simplified term of
is
Z DEPTH CALCULATIONS
the part 7.0. Part setup has to be considered as well, and ad- Material thickness or full diameter depth of the hole
justments to the setting made, if necessary.
Selected clearances - above and below material
(below material clearance for through holes)
The R level usually increases
about three or four times for
tapping operations using cycles G74 and G84, to allow the
On vertical machining centers, the Z0 is typically pro-
feedrate acceleration to reach its maximum.
grammed as the top of finished part face. In this case, the
absolute value of Z address will always be programmed as
O Example of R level programming :
a negative value. Recall that the absence of a sign in an axis
address means a positive value of that address. This method
N29 G90 GOO G54 X6.7 Y8.0 S850 M03 has one strong advantage. In case the programmer forgets
N30 G43 Z1.0 HO 4 M08 (INITIAL LEVEL IS 1.0) to write theminus sign, the depth value will automatically
N31 G99 G85 R0.1 Z-1.6 F9.0 ® LEVEL IS 0.1) become a positive value. In that case, the cutting tool will
N32 ... move away from the part, generally into a safe area. The
part program be correct, but can be easily cor-
will not
rected, with only a loss of time.
N45 G80
Z1.0. The R level is set in block N31 (cycle call block) as To illustrate a practical example of Z depth calculation,
.100 inches. In the same block, the G99 command is pro- consider the hole detail in Figure 25-6. We will use a 0.75
grammed and never changed during the cycle. That means inch drill to make a hole, with a
depth of 2.25 inches. If
full
the tool position will be 100 above part zero at the start
. and a standard twist drill is lip has to be taken into
used, the tool
end of the cycle. When the tool moves from one hole to the consideration. Its design has a typical 1 18° to 120° point
next, it moves along the XY axes only at this Z height level angle and we have to add an additional .225 inches to the
of .100 above work. specified depth:
knowledge of the internal cycle structure will help in de- anytime a smooth finish is required at the bottom of hole. Often
signing any unique cycles, particularly in the area of cus- used when slow spindle speed needs to be programmed.
tom macro programming.
If used for boring, the G82 cycle will produce a scratch mark
Rapid motion to the previous depth less a clearance For deep hole also known as peck drilling, where the
drilling,
(clearance is set by a system parameter) chip breaking ismore important than the full retract of the drill
from the hole. The G73 cycle is often used for a long series
Items 3, 4, and 5 repeat until the
drills, when a full retract is not very important.
programmed Z depth is reached
Rapid retract to initial level (with G98) The G73 fixed cycle is than the G83 cycle, hence
slightly faster
or Rapid retract to R level (with G99) the name because of the time saved by not
'high speed',
retracting to the R level after each peck. Compare this cycle
WHEN TO USE G83 CYCLE - Figure 25-9 with the standard deep hole drilling cycle G83.
For deep hole drilling, also known as peck drilling, where the
drill has to be retracted above the part (to a clearance position)
after drilling to a certain depth. Compare this cycle with the
high speed deep hole drilling cycle G73.
Figure 25-10
G83 fixed cycle - typically used for deep hole drilling When using cycles G83 and G73 in the program, always
(this cycle retracts to R level after each peck) have at least a reasonable idea about how many pecks will
the tool make each hole. Unnecessary peck drilling of
in
hundreds or thousands of holes will accumulate the total
lost time, which can be can very significant. Try to avoid
G73 - Deep Hole Drilling Cycle - High Speed too many pecks for a single hole. For predictable results,
the number of pecks can be calculated.
G98 (G99) G73 X.. Y.. R.. Z.. Q.. F..
The number of pecks calculation applies equally to both
O Example 1 - English data : The result of the calculation must be rounded to either
18.667 or 18.666. Although it looks that only one micron
G90 G98 G83 X.. Y. . R0.1 Z-1.4567 Q0.45 F. (0.001 mm) is at stake, it will make a big difference which
way the rounding is done. If only three pecks are required,
In the example, the distance between the R level and Z round off upwards,
depth is 1.5567 inches, the Q value is .450, so the number
to Q 18.667:
of pecks can be calculated: Cut 1 18.667
Cut 2 18.667
1.5567 / .45 = 3.4593333 Cut 3 18.666
places for English units and three decimal places for metric If the result is rounded downwards, to 1 8.666, the num- Q
units. The result must be correctly rounded upwards! ber of pecks will be four and practically no cutting will take
place during the last peck:
The nearest higher integer so each hole will re- is four,
quire four pecks. The hole depth cannot be changed, so the Cut 1 18.666
only other available method to change the number of pecks Cut 2 18.666
is to change the R level and/or the depth of each peck. The Cut 3 18.666
R level is usually as close to the top face of part as is practi-
Cut 4 0.002
cal, so there is not much
can be done there. That leaves
that
Total 56 mm
the Q value, the depth of each peck. By increasing this
value, the total
ing the Q value,
number of pecks will be fewer, by decreas-
the total number of pecks will be higher.
G Example 4 - English data :
In order to increase the number of pecks, last peck amount is greater than the remaining distance to
change the current Q value to a smaller number. the programmed Z depth, only that distance will be drilled.
In order to decrease the number of pecks, No peck depth will ever exceed the Z depth coordinate position.
change the current Q value to a larger number.
The programmed Q value can be manipulated in any cre-
The Q value setting is more accurate, if it is actually cal- ative way. By changing the Q value skillfully, particular re-
culated rather than just guessed. To achieve a precise num- sults can be achieved, such as an exact position of the tool
ber of pecks, divide the total distance between the R level tip during material penetration. This method is described in
and Z
depth by the required number of pecks. The result detail in Chapter 26.
will be the Q value programmed for the selected number of
To determine the ‘best’ depth of peck, consider the over-
pecks. If rounding is necessary, always round off upwards ,
otherwise the number of pecks may increase by one, with-
all operating conditions for the job. The setup rigidity, the
part fixturing, the design of cutting tool, the machinabilily
out receiving any cycle time benefits.
of material and other factors contribute to what the cutting
56 / 3 = 18.666667 are two fixed cycles available, the standard G84 and the of-
ten neglected G73 cycle.
186 Chapter 25
The sequence of G84 fixed cycle is based on the normal 2 Rapid motion to R level
initial spindle rotation - specified by M03.
Feedrate motion to Z depth
The
G84
Step
tap design
cycle with
must be of the
M03
right hand design
spindle rotation in effect.
D 5
Spindle rotation stop
4
Feedrate motion to
G74
Figure 25- 1
G84 fixed cycle - exclusively used for right hand tapping G98
•
G99
1
r— SPINDLE CCW
G74- Tapping Cycle -Reverse L1
i
— zo
G98 (G99) G74 X.. Y.. R.. Z.. F..
G98 (G99) G85 X.. Y.. R.. Z.. F.. For boring rough holes or holes that require additional
machining operations. This fixed cycle is very similar to the
cycle G81. The difference is the spindle stop at the hole bottom.
Step Description of G85 cycle
NOTE Although this cycle is somewhat similar to the G81
-
1 Rapid motion to XY position cycle, has characteristics of its own. In the standard drilling
it
cycle G81, the tool retracts while the spindle of the machine
2 Rapid motion to R level
tool is rotating, but the spindle is stationary in the G86 cycle.
Feedrate motion to Z depth Never use the G86 fixed cycle for drilling - for example, to save
3
time - since any deposits of the material on the drill flutes may
4 Feedrate motion back to R level damage the drilled surface of the part or the drill itself.
G98
The G85 boring cycle is used for boring and reaming
typically
iStr o, • SPINDLE CW
operations. This cycle is used in cases where the tool motion j
G99
into and out of holes should improve the hole surface finish, its 1
1
--
dimensional tolerances and/or its concentricity, roundness, etc.
ZO
If using G85 cycle for boring, keep in mind that on some parts
1
G99
G87 - Backboring Cycle
ih~r zo There are two programming formats available for the
backboring fixed cycle G87 - the first one (using Q) is
much more common than the second one (using I and J):
Figure 25- 13
G98 G87 X..Y.. R.. Z.. I.. J.. F..
G85 fixed cycle - typically used for boring and reaming
Step Description of G87 cycle
Step
2
Rapid motion
Rapid motion
Description of
to
to
XY
R
G86 cycle
level
D 5
Shift out
or shift
Rapid motion
by the Q value
by the amount and direction of
to R level
I and J
D 3
5
Feedrate motion to
8
or shift back in the opposite direction of
T Z.U
DWELL -y nrnTU
SPINDLE STOP
Figure 25-16
G89 G76
G98
sp c*.^, G98
Q —
? < 399
X
r r ZO
jl
ZO
DWELL DWELL,
j <
Z DEPTH /~\0 O Z DEPTH
G89 fixed cycle - typically used for boring or reaming 676 fixed cycle - typically used for high quality boring
This is a very useful cycle for high quality holes. There Any fixed cycle that is active can be canceled with the
are two programming formats available for the precision
G80 command. The control mode is automatically trans-
boring fixed cycle G76 - the first one (using Q) is much ferred to a rapid motion mode GOO:
more common than the second one (using I and J):
N34 G80
G98 (G99) G76 X.. Y.. R.. Z.. P.. Q.. F.. N35 X5.0 Y-5.75
G98 (G99) G76 X.. Y.. R.. Z.. P.. I.. J.. F.. Block N35 does not specify the rapid motion, it only im-
plies it. This a normal programming practice, but speci-
is
Step Description of G76 cycle fied GOO as well may be a personal choice, although not
necessary:
1 Rapid motion to XY position
2 Rapid motion to R level
N34 G80
N35 GOO X5.0 Y-5.75
3 Feedrate motion to Z depth
Both of the examples will produce identical results. The
4 Dwell at depth - in milliseconds (P-) (if used) second version of the example may even be a better choice.
7
Shift out by the Q value In all three cases, the differences appear rather small, but
or shift by the amount and direction of 1 and J they are very important to understanding the cycles. Al-
though GOO without G80 would also cancel the cycle, it is a
Rapid retract to initial level (with G98)
8 poor programming practice that should be avoided.
or remain at R level (with G99)
Normally, the control system will execute a fixed cycle at each hole location! There is no need for this type of ma-
only once at a given location - it this case, there is no need chining. By changing the format only a little, the fixed cy-
to program the number of executions, since the system de- cle repetition can be used as a benefit - to make the program
faults toone automatically. To repeat the fixed cycle several more powerful and efficient:
The L or K Address
With advantage of a feature ‘hidden in
that change, the
’
the location of XI 7.0 Y20.0, the other holes at locations ters for future use ’.
There is a quite good chance that the majority of pro- All the relevant information is in the drawing, but some
grams for CNC machining centers include machining of at searching for details and other requirements needed. The is
least one hole, probably more. From a simple spot drill to hole location X3.5Y5.0 was specified in the drawing, as
reaming, tapping and a complex backboring, the field of well as the material - mild steel. The Z axis program will be
hole machining is very large. In this chapter, we look at assigned to the top face of part. Drilling and tapping opera-
many available programming methods for holes machin- tions are obvious, but is that all there is to know?
ing, and learn a number of techniques used. Various drilling
and boring operations, as well as reaming, tapping and sin- How many tools will be needed? What about center drill-
ing to maintain exact location of the hole? Is the spot drill a
gle point boring will be covered.
better choice? What about chamfering the drilled hole for
The most common type of hole machining on ma- CNC tapping? What about the hole tolerances and surface finish?
chining centers is in the area of drilling, tapping, reaming What about ...?
ting toolshave to be selected, speeds and feeds applied, the by the tap drill then the
, through-the-hole drill and finally,
best setup determined and many other related issues must the tap. A standard center drill may be used instead of the
be resolved. Regardless of the exact approach, always start spot drill, but an additional tool will be required to chamfer
with a thorough evaluation of the given hole. the hole diameter at the top. All choices have to be sorted.
The first step relates to the drawing data. That will usu- For this example, the following four tools are used:
ally define the material to be machined, the hole location
Tool 1 - T01 - 90° spot drill (+ chamfer)
and dimensional values. Holes are often described
its ,
rather than dimensioned and the programmer has to supply Tool 2 - T02 - Letter U tap drill (0.368)
the missing details. Figure 26-1 shows a medium complex-
ity hole that can be machined using a CNC machine.
Tool 3 - T03 - 0 5/1 6 drill (through the material)
191
192 Chapter 26
The drawing does not specify a chamfer or its size, but a big difference for what purpose is the tap used. Not all
good machinist will always make a small chamfer, some- tapped holes can be done the same way. Some jobs require
times called a broken corner, unless there is a different re- a loose fit, others a tight fit. The fit for the tap is determined
quirement. A suitable chamfer will be .015x45°. by the size of the tap drill. Most tapping applications fall
into the 72-77% full thread depth category. In this case, the
Once the spot drill is selected, its cutting depth has to be T02 (letter U drill) will yield approximately 75% full
calculated - yes, calculated, not guessed. In order to
thread depth. The percentage of the thread depth can be
achieve a .015x45° chamfer for a tap size 07/16(0.4375),
found in catalogues of all tap manufacturers. For example,
the tap diameter has to be enlarged by .01 5 per side (.03 on
these are the choices for the 7/16-14 tap:
diameter), to the .4675 chamfer diameter. Figure 26-2
shows the relationships of the hole to the tool used (diame- Drill 0 Decimal Value Full Thread %
ters and depth).
T .3580 86%
U .3680 75%
V .3770 65%
tableshowing various mathematical constants to calculate In most through-hole applications, this value will not be
- the most common constant uses the drill
drill point length sufficient - some extra clearance has to be added, applied to
diameter multiplied by .300, for a 18° drill point angle: 1 the tool penetration (breakthrough), say fifty thousands of
an inch (.050). The programmed value for the total drill
depth (absolute Z value in the program) is the sum of the
P = .368 x .300 = .1104 = .1110
nominal hole length, plus the tool point angle length, plus
the selected clearance. In the program example, amount for
Adding the two calculations (.975+. 1 1
1 ), will provide the
the through drill depth will be:
programmed Z depth of Z- .086. 1
The next tool is a tool that drills the hole through the ma-
terial. In the example, it is the T03 (tool 3), a 05/16 stan- One last calculation for this tool still has to be made. Re-
dard drill. member that the previous tool had been used to predrill an
opening? That means a smaller tool of 0.3125 is placed
As for the cutting depth of the through drill, some simple into an existing 0.368 hole. The drilling can start from in-
calculations are needed. To do the calculations, the re- side of the hole, rather than from a clearance above the part.
quired hole depth has be known, which is 1 .5 inches in the In the program, the R value is used and selected at R-0.986,
example. Then, the calculated drill point length can be which applies 00 clearance above the bottom of the exist-
. 1
added to the required drill depth, usually with an extra ing hole.
clearance.
Tool 4 - Tap
The calculations for this through drilling operation are il-
lustrated in Figure 26-4 There is one more tool left to complete this example. It
will be used for tapping the 7/16-14 thread. The thread size
as specified in the drawing is 7/16 nominal diameter with
14 tlireads per inch (1/14 = .0714 = pitch). Anytime a tap-
ping tool is used in the program, watch the programmed
depth along the Z axis, particularly in a blind or semi-blind
hole. The example shows a semi-blind hole, because the
through-hole is smaller than the tapped hole. If there were
no through-hole, we would have a blind hole (solid bot-
tom), and if the through-hole were the same size as the tap
drill, we would have a 100% through hole.
The example drawing for the hole calls for the tap depth
of .875 inches. This is th e full depth of the thread. Full
depth of a thread is the actual distance a screw or a nut must
travel before stopping (before retract). The programmed
depth is, if fact, an extended depth, which must be greater
Through drill operation detail - T03 in program 02601
than the theoretical depth, in order to achieve this goal. To
calculate the length of the extended depth, evaluate the tap
First, evaluate the drill point length P. It is calculated from
end chamfer design (its type and length), described in more
the relationship of two given values - the drill diameter and
detail in the tapping section of this chapter.
the drill point angle. For a standard 05/16 drill (0.3125)
that has 18° drill point angle, the 0.300 constant is used
1
A reasonable Z depth is Z-0.95 (about one pitch over the
again, the length of the drill point P is: depth) and can be optimized after actual machining. This is
Programming Considerations During the cut, the drill angular end will be gradually
entered into the part, creating an increasingly larger hole
A drill has, regardless of size, two important
standard
diameter, yet still smaller than the drill diameter. At the
features the diameter
- and the point angle. The diameter is
end, the largest machined diameter will be equivalent to the
selected according to the requirements of the drawing, the
effective diameter of the used. The effective drill diam-
drill
tool point angle relates to the material hardness. They are
eter defines the actual hole diameter created within the zone
both closely connected,' since the diameter determines the
of the drill end point. Typical use of this kind of machining
size of the drilled hole, the tool point angle determines its
is a spot drilling operation for chamfering. The spindle
depth. A smaller consideration is the number of flutes,
speed and feed must be calculated according to the effective
which is normally two.
drill diameter, not the full diameter. The r/min for the effec-
tivediameter will be higher and the feedrate lower than the
Nominal Drill Diameter
corresponding values for the nominal drill size. For this
The major consideration for a drill is always its diameter. kind of jobs, selection of a short drill for rigidity is advised.
tions. These tools cover boring bars, reamers, chamfering 1 r — IOOI point
tools, end mills and others. Using these tools does mean length
more work is involved, but the quality of the finished part
Figure 26-6
should never be traded for personal conveniences.
Tool point length data for a standard twist drill
i— v !
PROGRAMMED *
DEPTH (P)
EFFECTIVE
DRILL DIAMETER bsp where ...
Figure 26-5
P = Length of the drill point
A = Included angle of the drill point
Nominal and effective drill diameters Itwist drill shown)
D = Diameter of the drill
196 Chapter 26
The same formula can be simplified and used with a The most common tool for center drilling is a standard
mathematical constant (fixed for each drill point angle): center drill (often called a combined drill and countersink),
producing a 60° angle. Established North American indus-
trial standards use a numbering system from #00 to #8
P = D x K
(plain type) or#l 1 to #18 (bell type) for center drills. In the
metric system, center drills are defined by the pilot diame-
US' where ... ter, for example, a 4 mm
center drill will have the pilot dia-
meter of 4 mm. In both cases, the higher the number, the
P = Drill point length
larger the center drill diameter. For some pre-drilling oper-
D = diameter
Drill
ations, such as chamfering, a tool with a 90° point angle,
K = Constant (see the following table)
called a spot drill, is a better choice.
82 .575184204 .575
i "T
90 .500000000 .500
no
D2 / n m
D 1
\
118 .300430310 .300
r i.
f
.157649394
#5 0.438 0.188 0.350 0.382
145 .158
#6 0.500 0.218 0.400 0.438
150 .133974596 .134 #7 0.625 0.250 0.500 0.538
#8 0.750 0.312 0.600 0.651
The constant in the formula is rounded, hut its shorter Figure 26-7
value is sufficient for all programming applications. The Standard center drill cutting depth table - #7 to #8 plain type
value of the constant K for 1
18° drill angle is .300, the real L is the depth of cut for an arbitrary effective diameter D
of being easy to memorize and there is no formula to solve. In the table, there are all the necessary dimensions for
For most jobs, only three constants are needed. For 90° standard English size center drills. The most important of
(spot drilling and soft materials), 1 1 8° (standard materials), them is the cutting depth L. Its calculation has been based
and 135° (hard materials). They are easy to memorize: on an arbitrary selection of the chamfer diameter D.
0.500 ... for a 90° drill angle For example, #5 center drill has the depth value L that is
118° -120° angle listed as .382,based on an arbitrarily selected chamfer dia-
0.300 ... for a drill
meter D of .350 inches. These values can be modified as
0.200 ... for a 135° drill angle desired or a different table can be made. A similar table can
be developed for metric center drills
Center Drilling
Through Hole Drilling
Center drilling is a machining operation that provides a
small, concentric opening for a tailstock support or a pilot Drilling a hole through the material is a very common op-
hole for a larger drill. Chamfering is not recommended eration. It requires the Z depth to include the material thick-
with a center drill, because of the 60° angle of the tool. ness, the drill point length and an extra clearance beyond
the drill penetration point, also known as the breakthrough
Never center a hole to be drilled with indexable insert drills !
amount.
MACHINING HOLES 197
Metric holes are treated exactly the same way. For exam-
ple, a016 mm
drill is used to machine the full diameter
In Figure 26-8 is shown that the programmed depth for a N56 G01 Z-44.8 F150.0
through hole is the sum of the material thickness T, that
is
equivalent to the full diameter depth F, plus the break- If thedepth appears in a fixed cycle, the same depth value
through clearance C, plus the tool point length P. will be used, although in a different format:
For example, if the material thickness is one inch and the N56 G99 G81 X215.0 Y175.0 R2.5 Z-44.8 F150.0
standard drill diameter D is 05/8 (0.625) of an inch, the
programmed depth, including a .050 clearance, will be: When machining blind holes, the cutting chips may clog
the holes. This may cause a problem, especially if there is a
1 + .050 + (5/8 x .300) = 1.2375 subsequent operation on the hole, for example, reaming or
tapping. Make sure you include a program stop code MOO
Pay attention to obstructions (machine table, vise, paral- orMOl before this operation. The M00 is a better choice, if
lels, fixture, machine table, etc.), when programming the each hole will have to be cleaned every time the program is
tool breakthrough clearance. There is usually a very little executed. Otherwise, the more efficient optional program
space below the bottom face of the part. stop M01 is sufficient.
The major difference between drilling a blind hole and a Flat bottom hole is a blind hole with a bottom at 90° to the
through hole is that the drill does not penetrate the material. drill centerline. There are two common methods of pro-
Blind hole drilling should not present any more problems gramming such a hole. A good practice is to use a standard
than a through hole drilling, but use a peck drilling method drill to start the hole, then use a flat bottom drill of the same
fordeep holes. Also a choice of a different drill geometry diameter and finish the hole to its full depth. Also a good
may improve the machining and the hole cleanup may of- choice is to use a slot drill (also known as the center cutting
ten be necessary as well. end mill), without predrilling. This is the best method, but
some tool sizes may not be available.
In a typical shop drawing, the depth of a blind hole is
given as the full diameter depth. The drill point length is not To program a flat bottom hole using a slot drill is quite
normally considered to be part of the depth - it is in addi- simple. For example - a 010 mm hole should be 25 mm
tion to the specified depth. In Figure 26-8 the programmed
, deep (with a flat bottom). Using a 010 slot drill, the mm
depth of a blind hole will be the sum of the full diameter program is quite short (tool in spindle is assumed):
depth F, plus the tool point length P.
A fixed cycle could be used instead and other improve- rigid and can do the job much better.
ments added as well, but the program is correct as is.
N14
N15
GOl Z-0.74 F15.0
Z-0.95 F7.0 D / _ —
_ —
N16 G04 X0.5
N17 GOO ZO.l MO i
I I
,
© \\
standard drill. The drill stops short of the full depth by .010 Cutting end of a typical indexable insert drill
A reason for not drilling to the full depth with the standard size produced by the drill. The tip point length H is defined
drill is to prevent possible dimple mark at the hole center. by the drill manufacturer and its amount is listed in the tool-
ing catalogue. For example, an indexable drill with the D
The other two blocks appear in the second tool of the pro- diameter of 1.25, may have the H tip length .055. The
gram - blocks N 14 and N 15. In block N 14, the flat bottom indexable drill can be used for rotary and stationary appli-
drill feeds at a heavier feedrate depth of only .740
to the cations, vertically or horizontally, on machining centers or
inches. That makes sense, as there is nothing to cut for the lathes. For best performance, the coolant should be pres-
flat bottom drill for almost 3/4 of an inch. Follow the calcu- sure fed through the drill, particularly for tough materials,
lation of the 0.740 intermediate depth from this procedure: long holes, and horizontal operations. The coolant not only
disperses the generated heat, it also helps flush out the
From the total depth of .94 cut by the standard drill (TO ), When using an indexable insert drill, make sure there
1
chips.
subtract the length of the tool point 8°
P. That is 1 5 for a 1
. 1
is enough power at the machine spindle. The power re-
drill point angle and 0.5 drill. The result is .79. From the quirements at the spindle increase proportionally with in-
and the result is the Z axis
result, subtract .05 for clearance,
creased drill diameters.
value of Z-0.74. In the block N15, the flat bottom drill re-
moves the excessive material left by TO at a suitable cut-
1 ,
On a machining center, the indexable drill is mounted in
ting feedrate, usually programmed at a slower rate. the machine spindle, therefore it becomes a rotating tool. In
this setup, the drill should be used in a rigid spindle that
MACHINING HOLES 199
runs true - no more than .010 inch (0.25 rnm) of T.I.R. (To- PECK DRILLING
tal Indicator Reading). On spindles that have a quill, try to
work with the quill inside the spindle, or extend it as little as
Peck drilling is also called interrupted cut drilling. It is a
possible. Coolant provisions may include an internal cool-
drilling operation, using the fixed cycles G83 (standard
ant, and special adapters are available for through the hole
peck drilling cycle) or G73 (high speed peck drilling cy-
cooling, when the drill is used on machining centers.
cle). The difference between the two cycles is the tool re-
On a CNC lathe, the indexable drilling tool is always sta- tractmethod. In G83, the retract after each peck will be to
tionary. The correct setup requires that the drill is posi- the R level (usually above the hole), in G73, there will only
tioned on the center and be concentric with the spindle cen- be a small retract (between .02 and .04 inches).
terline. The concentricity should not exceed .005 inch
Peck drilling is often used for holes that are too deep to be
(0.127 mm) of T.I.R.
drilled with a single tool motion. Peck drilling methods
Always exercise care when the drilling operation starts also offer several opportunities to improve the standard
on a surface that is not flat. For best results, use indexable drilling techniques as well. Here are some possible uses of
drills on surfaces that are 90° to the drill axis (flat surfaces). the peck drilling methods formachining holes:
Within limits, the drill can also be used to enter or exit an
Deep hole drilling
inclined, uneven, concave, orconvex surface quite success-
fully. The feedrate may need to be reduced for the duration Chip breaking - also used for short holes in tough materials
respectively. many pecks will result with a certain Q value for a given to-
tal depth is usually not important. If the program is running
An indexable drill should always be used efficiently, there is no need for a modification. To find out
in a fully protected machining area. how many pecks the G83/G73 cycle will generate, it is
important to know the total distance the drill travels be-
tween the R level and the Z depth (as an incremental value).
It is equally important to know the peck depth Q The value.
For example, in the following G83 cycle, There will be four pecks and the last one will only cut
.0001 - or practically nothing at all. In those cases, where
N73 G99 G83 X.. Y. . R0.125 Z-1.225 Q0.5 F12.0 the last cut is very small and inefficient, always round the
No rounding
is necessary in this case. Now, let’s have a
Peck drilling cycle G83 is great for it, but the Q depth cal- A reaming operation will require a coolant to help make a
culation extremely important. The total number of pecks
is better quality surface finish and to remove chips during cut-
is not important, only the last two are critical for this pur- ting. Standard coolants are quite suitable, since there is not
pose. To control the problem associated with the drill pene- very much heat generated during reaming. The coolant also
tration, only two peck motions are needed. The illustration serves in an additional role, to Hush away the chips from
shows the two positions for a 01/2 drill drill through a 3/4 the part and to maintain the surface finish quality.
thick plate.
Reamer Design
For most jobs, such a hole requires no special treatment.
Just one cut through (using G81 cycle) and no peck drill- In terms of design, there are two features of a reamer that
ing. Let’s/evaluate the solution to this situation. The 0.5 have a direct relationship to the CNC machining and pro-
drillhas the point length of .300 x .500 = .150. Take one gramming. The first consideration is the flute design.
half (.075) of the drill point length as the first penetration
Most reamers are designed with a left-hand flute orienta-
amount, which will bring the drill .075 below the 3/4 plate During
tion. This design is suitable to ream through holes.
thickness, to the Z depth of Z-0.825. This depth has to be
the cut, the left-hand flute design ‘forces’ the chips to the
reached with the value of the Q depth. Keep in mind that the
bottom of the hole, into an empty space. For blind holes
Q depth is an incremental value, measured from the R that have to be reamed, the left-hand type of a reamer may
level, in this case R0.1. That specifies the Q depth as
not be suitable.
Q0.925 (.100 above and .825 below Z0). The programmed
Z depth is the final drill depth. If the .05 clearance is added The other factor of the reamer design is the end chamfer.
below the depth will be the sum of the plate
plate, the Z In order to enter an existing hole that is still without a
thickness (.75), the clearance (.05) and the drill point length chamfer, a lead-in allowance is required. The reamer end
(.150), for the program value of Z-0.95: provides that allowance. Some reamers also have a short
taper at their tip, for the same purpose. The chamfered lead
G99 G83 X.. Y. . R0 1 Z-0.95 Q0.925 F.
.
issometimes called a 'bevel lead' and its chamfer an 'attack
angle’. Both have to be considered in programming.
This technique does not only solve a particular job re-
lated problem, it also shows how creativity and program-
Spindle Speeds for Reaming
ming are complementary terms.
Just like for standard drilling and other operations, the
REAMING spindle speed selected for reaming must be closely related
to the type of material being machined. Other factors, such
as the part setup, its rigidity, itssize and surface finish of the
The reaming operations are very close to the drilling op-
completed hole, etc., each contributes to the spindle speed
erations, at least as far as the programming method is con-
selection.
cerned. While a drill is used to make a hole (to open up the
hole), a reamer is used to enlarge an existing hole. general programming rule, the spindle speed for
As a
reaming will be reasonable if you use a modifying factor of
Reamers are either cylindrical or tapered, usually de-
.660 (2/3), based on the speed used for drilling of the same
signed with more than two flutes of different configura-
material. For example, if a speed of 500 r/min produced
tions. Reamers made of high speed steel, cobalt, carbide
good drilling conditions, the two thirds (.660) of that speed
and with brazed carbide tips. Each reamer design has its ad-
will be reasonable for reaming:
vantages and disadvantages. Carbide reamer, for example,
has a very high resistance to wear, but may be not economi-
500 x .660 = 330 r/min
cally justified for every hole. A high speed steel reamer is
economical, but wears out much faster that a carbide Do not program a reaming motion in the reversed spindle
reamer. jobs do not accept any compromise in the
Many rotation - the cutting edges may break or become dull.
tooling selection and the cutting tool has to be selected cor-
rectly for a given job. Sizing and finishing tools, such as a Feedrates for Reaming
reamer, have to be selected even more carefully.
The reaming feedrates are programmed higher than those
Reamer is not designed for removal of
a sizing tool and is
used for drilling. Double or triple increases are not unusual.
heavy stock. During a reaming operation, an existing hole The purpose of the high feedrates is to force the reamer to
will be sized - reamer will size an existing hole to close tol- the material. If the feedrate is too
cut, rather than to rub
erances and add a high quality surface finish. Reaming will slow, the reamer wears out rapidly. The slow feedrates
not guarantee concentricity of a hole. For holes requiring cause heavy pressures as the reamer actually tries to en-
both high concentricity and tight tolerances, center drill or large the hole, rather than remove the stock.
spot drill the hole first, then drill it the normal way, then
rough bore it and only then finish it with a reamer.
202 Chapter 26
Stock Allowance
SINGLE POINT BORING
Stock is amount of material left for finishing opera-
the
tions. A hole to be reamed must be smaller ( undersize ) than Another sizing operation on holes is called boring. Bor-
the pre-drilled or pre-bored hole - a logical requirement. of machining holes,
ing, in the sense is a point-to-point op-
Programmer decides how much smaller. A stock too small eration along the Z axis only, typical to milling ma- CNC
forreaming causes the premature reamer wear. Too much chines and machining centers. It is also known as a ‘single
stock for reaming increases the cutting pressures and the point boring', because the most common tool is a boring
reamer may break. bar that has only one cutting edge. Boring on CNC lathes is
considered a contouring operation and is not covered in this
A good general rule is to leave about 3% of the reamer
chapter (see Chapters 34-35).
diameter as the stock allowance. This applies to the hole
diameter - not per side. For example, a 3/8 reamer (0.375), Many jobs requiring precision holes that have previously
will work well in most conditions if the hole to be reamed been done on a special jig boring machine can now be done
has a diameter close to .364 inches: on a CNC machining center, using a single point boring
tool. The modern CNC machine tools are manufactured to
.375 - (.375 x 3 / 100) = .36375 = .364 very high accuracy, particularly for the positioning and re-
peatability - a proper boring tool and its application can
Most often, a drill that can machine the required hole di-
produce very high quality holes.
ameter exactly will not be available. That means using a
boring bar to presize the hole before reaming. It also mean
Single Point Boring Tool
an extra cutting tool, more setup time, longer program and
other disadvantages, but the hole quality will be worth the As for its practical purpose, a single point boring is a fin-
these cases, for tough materials and some of the
effort. In ishing, or at least a semifinishing, operation. Its main job is
‘space age’ materials, the stock allowance left in the hole to enlarge - or to size - a hole that has been drilled, punched
for reaming, is usually decreased. or otherwise cored. The boring tool works on the diameter
of the hole and its purpose is to produce the desired hole di-
Other Reaming Considerations ameter, within specified tolerances, often with a quality
surface finish as well.
The general approach for reaming is no different than for
other operations. When drilling a blind hole, then reaming Although there is a variety of designs of boring tools on
it, it is inevitable that some chips from the drilling remain in the market, the single point boring tool is usually designed
the hole and may prevent a smooth reaming operation. for the cartridge type inserts. These inserts are mounted at
Using the program stop function MOO before the reaming the end of the holder (i.e., a boring bar) and usually have a
operation allows the operator to remove all the chips first, built-in micro adjustment for fine tuning of the effective
for a clear entry of the reamer. boring diameter - Figure 26-12.
Just like any other cutting tool, a single point boring bar When the machine spindle is oriented, it must be in a
achieves the best cutting results if it is short, rigid and runs stopped mode. The spindle cannot rotate during any ma-
concentric with spindle centerline. One of the main causes chining operation that requires a spindle shift. Review de-
of poorly bored holes is the boring bar deflection, applying scriptions of the fine boring fixed cycle G76 and the back-
equally to milling and turning. The tool tip (usually a car- boring cycle G87 in Chapter 25. Machine operator must
bide bit), should be properly ground, with suitable cutting always know which way the spindle orients and into which
geometry and overall clearances. The position of the boring direction the tool shift actually moves.
bar in the spindle - or its orientation - is very important for
Programming a bored hole that will be reamed later
many boring operations on machining centers.
requires the boring bar only to assure the concentricity and
straightness of the finished hole. The surface finish of the
Spindle Orientation
bored hole is not too important. If the boring is the last ma-
Any round such as a drill or an end mill, can enter or
tool, chining operation in the hole, the chances are that the sur-
exit a hole along the Z axis, with little programming con- face finish will be very important. It is difficult to retract the
siderations for the hole quality. Neither of the tools is used boring tool without leaving drag marks on the hole cylin-
for holes that demand high quality surface finish and close drical surface. In that case, select a suitable fixed cycle,
tolerances. With boring, the hole surface integrity is very probably the precision boring cycle G76 is the best choice.
important. Many boring operations require that the cutting
tool does not damage the hole surface during retract. Since Block Tools
retracting from a hole almost always leaves some marks in
When using a single point boring bar for roughing or
the hole, special methods of retract must be used. There is
semifinishing operations, there is an option that is more ef-
one such method - it uses cycle G76 or G87 with the spin-
ficient. This option also uses a boring tool, but one that has
dle orientation feature of the machine and a shift of the bor-
two cutting edges (180° opposite) instead of one - it is
ing tool away from the finished surface. This feature was
called a block tool. Block tools cannot be used for fine fin-
already described in Chapter 12, so just a reminder now.
ishing operations, because they cannot be shifted. The only
The sole purpose of spindle orientation is to replace the way of programming a block tool is within the 'in-and-out'
tool holder in exactly the same position after each tool tool motion. Several fixed cycles support this kind of mo-
change. Without spindle orientation, the tool tip will stop at tion. All motions 'in ’are at a specified feedrate. On the way
a random position of its circumference. Orienting the spin- ‘out’, some motions are feedrates, others are rapid, depend-
dle for boring purposes is only one half of the solution. The ing on the cycle selection. The cycles that can be used with
other is the setting position of the boring bit. This is usually block tools are G81 and G82 (feed-in-rapid-out), as well as
a responsibility of the operator, since it has to be done dur- G85 and G89 that feeds and feeds out while the machine
in
ing setup at the machine. The boring bar cutting bit must be spindle is rotating and another one, G86, when the tool re-
set in such a way that when the shift takes place in fixed cy- tracts while the spindle is not rotating.
cle G76 or G87, it will be into the direction away from the
XY vector relative to the The greatest advantage of a block tool is the increased
finished hole wall, ideally by the
feedrate that can be programmed for this tool. For example,
angle of the spindle orientation - Figure 26-13.
if the feedrate for a single point tool is .007 per flute, for a
block toolit be
will at least double, .014 inches per flute or
There are two fixed cycles that require the tool shift away
from the centerline of current hole. These cycles are boring
cycles G76 and G87. G76 is by far the most useful and both
are illustrated together in program example 02604.
Figure 26-15
A hole bored with G76 cycle will have a high quality. 02604 (G76 AND G87 BORING)
(T01 - 15 MM DIA SPOT DRILL - 90 DEG)
Backboring Cycle G87 N1 G21
N2 G17 G40 G80 T01
Although the backboring cycle has some applications, N3 MO 6
it
N4 G90 G54 GOO XO YO S1200 M03 T02
is not a common fixed cycle. As the name suggests, it is a
N5 G43 Z10.0 HOI M08
boring cycle that works in the reverse direction than other
N6 G99 G82 R2.0 Z-5.0 P100 F100.0
cycles -from the back of the part. Typically, the backboring N7 G80 Z10.0 MO
operation starts at the bottom of the hole, which
is the ‘back N8 G28 Z10.0 MO
of the part’, and the boring proceeds from the bottom up- N9 M01
wards, in the Z positive direction.
(T02 - 24 MM DIA DRILL)
The G87 cycle has been described in the previous chap- N10 T02
ter. The Figure 26-14 also shows a diameter of 27 mm, Nil MO
which will be bored during the same setup as the 25 mm N12 G90 G54 GOO XO YO S650 M03 T03
hole. This larger diameter is at the 'back side of the part’,
N13 G43 Z10.0 HO 2 M08
and
N14 G99 G81 R2.0 Z-39.2 F200.0
it will be backbored, using the G87 cycle.
N15 G80 Z10.0 MO
Figure 26-15 shows the setup of the tool that will bore N16 G28 Z10.0 MO
N17 M01
the 27 mm
hole, from the bottom of the hole, upwards. Pay
a close attention to the descriptions.
(T03 - 25 MM DIA STANDARD BORING BAR)
N18 T03
In the illustration, the Dl represents the diameter of the
N19 MO
smaller hole, and D2 represents the diameter of the hole to N20 G90 G54 GOO XO YO S900 M03 T04
be backbored. D2 is always larger than Dl. Always make N21 G43 Z10.0 HO 3 M08
sure there is enough clearance for the body of the boring N22 G99 G76 R2.0 Z-31.0 Q0.3 F125.0 (25 DIA)
bar within the hole and at the hole bottom. N23 G80 Z10.0 M09
N24 G28 Z10.0 M05
N25 M01
MACHINING HOLES 205
(T04 - 27 MM DXA BACK BORING BAR) part to be accurately seated in the hole by creating a clean
N26 T04 surface. For example, a bolt head that has to be seated on a
N27 MO
flat surface will require countersinking or spotfacing op-
N28 G90 G54 GOO X0 YO S900 M03 T01
eration. All three operations require a perfect alignment
N29 G43 Z10.0 H04 M08
N30 G98 G87 R-32.0 Z-14.0 Q1.3 F125.0 (27 DIA) with the existing hole (concentricity). Programming tech-
N31 G80 Z10.0 MO nique is basically the same for all three operations, except
N32 G28 Z10.0 M05 for the tool used. Speeds and feeds for these tools are usu-
N33 G28 XO YO allylower than for drills of equivalent size. Any hole to be
N34 M30 enlarged must exist prior to these operations.
%
Countersinking
Make sure to follow all rules and precautions when pro-
gramming or setting up a job with G76 or G87 fixed cycles Countersinking is an operation that enlarges an existing
in the program. Many of them are safety oriented. hole in a conical shape, to a required depth. Countersinking
is used for holes that have to accommodate a conical bolt
Precautions in Programming and Setup head. From all three similar operations, countersinking re
quires the most calculations for precision depth. Typical
The precautions for boring with a tool shift relate to a few
countersinks have three angles:
special considerations that arc necessary for successful re-
alization of the two cycles G76 and G87. The following list 60 degrees
sums up the most important precautions:
82 degrees - the most common angle
The through boring must be done before the backboring
90 degrees
The first boring cycle (G76) must be programmed
Other angles are also possible, but less frequent.
all the way through the hole, never partially
For the G76 cycle, only a minimum Q value is required To illustrate the programming technique and the required
(ex., 0.3 mm or .012 inches) must be known
calculations, the cutting tool used first. Fig-
ure 26-16 shows a typical countersinking tool.
For the G87 cycle, the Q value must be greater than one
half of the difference between the two diameters:
(D2-DD/2 = (27-25)/2 = 1,
Always know the shift direction and set the tool properly
Figure 26-16
ENLARGING HOLES
Typical nomenclature of a countersinking tool
An existing hole can also be enlarged from the top. To In the illustration, d is the countersink body diameter, A is
enlarge an existing hole at the top, we can use one of three the countersink angle, F is the diameter of the tool flat
methods that will enlarge an existing hole. These methods (equal to zero for a sharp end), / is the body length.
are common in every machine shop. They are:
Programming of a countersink requires certain data in the
Countersinking C'SINK or CSINK on drawings drawing. This information is often provided through a de-
Counterboring C'BORE or CBORE on drawings scription (leader/text) in the drawing, for example:
There is one challenge for programming a countersink. The process of calculation is simple enough. First, deter-
The specified countersink diameter must be accurate. That mine the height e, for a given Hat diameter F. Use the stan-
is the 0.78 in the description. The countersink angle is dard constants as applied to a drill point length:
82°. The precise diameter can be created by carefully cal-
60° = .866
culating the Z depth. That should not be too difficult, be-
82° = .575
cause we can use the constant values K
for the tool point
90° = .500
length (described earlier in this chapter), then calculate the
cutting depth, similar to drills. The problem here is that the In the illustration, D is the required countersink diameter,
constant K always assumes a sharp point at
for a drill point
A is the countersink angle, F is the Hat diameter, e is the
the tool tip. Countersinking tools do not always have a height of the sharp end, and the Z-DEPTH is the pro-
sharp point (except for some small sizes). Instead, they grammed tool depth. In this case, the angle A is 82°, the Hat
have a diameter of the Hat F, normally specified in tooling diameter F as per catalogue is 3/16 (.1875). The height of
catalogues. the sharp end e can be calculated:
Since that depth includes the height of sharp end, all that
Programming example of a countersinking operation Incidentally, the R level could be lowered, since there is a
through hole already machined in the previous operation.
Figure 26-18 shows the known and unknown counter-
Be careful here, the R level will most likely be negative. Al-
sinking dimensions required for depth programming of a ways program the G98 command and a small initial level,
countersinking tool.
for example, Z0. 1
Counterboring
surfaces that are not at 90° to the bolt assembly. As for the
proper tool selection, use a counterboring tool specially de-
signed for this type of machining, or a suitable end mill
instead. In cither case, the program uses G82 fixed cycle.
Since the depth of the counterbore always given, there is
For the example, the 01/2 inch hole had been machined
earlier. The program block will be quite simple:
60
Figure 26-20 illustrates two programming possibilities,
r/ min
in a symbolic representation. Tlie front view of a stepped
dwell value guarantees that even at 50% spindle speed can be used. The setting for the initial level is usually done
override, there will be at least one full revolution of the in the G43 block, where the Z value must represent a clear
spindle that cleans up bottom of the counterbored hole. tool location above all obstacles.
Spotfacing
MULTILEVEL DRILLING
Two tools are used - T01 is a 90° spot drill, cutting to the WEB DRILLING
depth of .108 below each step face. T02 is a 03/16 drill
through programmed to the absolute depth of Z- 06: 1 . 1
,
Web drilling is a term for a drilling operation taking place
between two or more parts, separated by an empty space.
02605 (MULTILEVEL EXAMPLE)
(T01 - 0.375 SPOT DRILL - 90 DEG)
The programming challenge, is to make such holes effi-
N2 G17 G40 G80 T01 the separate parts as well as the empty spaces. For many
N3 MO 6 holes, this approach would prove to be very inefficient.
N4 G90 G54 GOO X0.25 Y0.375 S900 M03 T02 Evaluate the front view of a web drilling example shown in
N5 G43 Z1.0 HOI M08 Figure 26-22.
N6 G99 G82 R-0.4 Z-0.608 P200 F8.0
N7 YO .75
N8 Y1.125
N9 G98 Yl. 625
N10 G99 X0.875 R-0.05 Z-0.258
Nil Yl 125
.
Note that a single hole has required three blocks of the The higher clearance for the R level allows acceleration
program, rather than the usual one. Each block represents of the feedrate from 0 to 30 inches per minute to take place
only one plate in the part. Also note the G98 in block N 16. in the air. When the tap contacts the part, cutting feedrate
Only one hole is done in the example, so the G98 is not re- should be at its value, not less. A good rule of
programmed
ally needed. The cycle cancellation command G80 with a thumb isprogram the tapping clearance about two to
to
return motion in block N17 would take care of the tool re- four times the normal clearance. This clearance will guar-
tract from the hole. However, if more holes are machined, antee the feedrate to be fully effective when the actual tap-
move the tool to the new XY position before the G80 is pro- ping begins. Try to experiment with a slightly smaller num-
grammed. In this case, the G98 needed when the drills
is ber, to make program more efficient. Another good
the
penetrates the last plate of the part. This example is not a method is to double, triple, or quadruple the pitch of the tap
perfect solution to web drilling cuts, as there is still some and use that value as the clearance above the tap. Which-
wasted motion. The only efficient programming method is ever method is used, its purpose is to eliminate the feedrate
to use the optional custom macro technique and develop a problems associated with motion acceleration.
unique and efficient web drilling cycle.
Another question was the feedrate amount. The relatively
high value of 30 in/min (F30.0) has also been carefully cal
TAPPING culated. Any cutting feedrate for tapping must be synchro-
nized with the spindle speed - the r/minprogrammed as the
Tapping is second only to drilling as the most common S address. Keep in mind that the tap is basically a form tool
hole making operation on CNC machining centers. As it is and the thread size and shape are built into it. Later in this
very common to tap on a CNC mill or a machining center, chapter, the relationship between the spindle speed and the
two tapping fixed cycles are available for programming ap- feedrate is explained in more detail. The cutting feedrate F
plications on most control systems. They are the G84 cycle in the program example was calculated by multiplying the
for normal tapping (R/H), and the G74 cycle for reverse thread lead by the spindle speed given as r/min:
tapping (L/H):
P = 1 / 20 TPI x 600 r/min = 30.0 in/min
Normal tapping - for right hand threads
G84 Another way to calculate feedrate is to divide the spindle
with M03 spindle rotation
speed (r/min) by the number of threads per inch (TPI):
Reverse tapping - for left hand threads
G74
with M04 spindle rotation F = 600 r/min / 20 TPI = 30.0 in/min
Is it possible to tell the tap size used? It should be. In the has is often called the tension-compression holder and its
example, the tap size is a standard, 20 TPI (twenty threads applications are the same for both milling and turning op-
per inch), plug tap. The XY coordinates are missing from erations. This type of holder allows the tap to be pulled out
the G84 cycle, because the current tool position has been of it or pushed into it, within certain range. The only notice-
established in block N64. The usual R level is the thread able difference is the mounting method of the tool (tool ori-
starting position and the Z depth is the absolute depth of entation) in the machine (either vertical or horizontal).
thread. The last address in the block is feedrate in inches High end floating tap holders also have an adjustable
per minute (in/min), programmed with the F address. torque, which can change the feel of the tap and even the
range of the tension and compression.
Note that the R level of R0.4 has a value that is somewhat
higher than might be used for drilling, reaming, single Tapping applications on CNC lathes are similar to those
point boring and similar operations. Also, the programmed on machining centers. A special tapping cycle for a lathe
feedrate appears to be unreasonably high. There is a good control is not needed, as only one tap size can be used per
reason for these values - they are both correct and selected part. Each tapping motion is programmed with the G32
Tap Geometry
flute’,and others. These terms basically describe how the threads. A typical number of threads
for a tapered chamfer
tap cutting edges are ground into the body of the tap. When is 8 to 10, for a plug tap 3 to 5, and for a bottoming tap to 1
programming a tapping operation, the effectiveness of the 1 .5. The angle of the chamfer a also varies for each type;
flute geometry is tied to the spindle speed. Experimenting typically 4-5° for the tapered tap, 8- 3° for the plug tap and
1
with the tapping feedrate is limited by the tap lead (pitch), 25-35° for the bottoming tap.
but there is a greater latitude with the spindle speed selec-
tion. The part material and the flute geometry of the tap
A blind hole will almost always require a bottoming tap,
a through hole will require a plug tap in most cases and a ta-
both influence the machine spindle speed. Since almost all
per tap in some rarer cases. Described in different words,
tooling designs (not limited to taps only) are the results of
the larger the tap chamfer, the greater depth allowance must
corporate policies, engineering decisions and philosophies,
be added to each drilled hole.
various trade names and marketing strategies, there is not a
one way of saying ‘use this tool’ or ‘use that tool’ for a CNC
Tapping Speed and Feedrate
program. The tooling catalogue of a tool supplier is the best
source of technical data, but a catalogue from another sup- The relationship of the machine spindle speed (r/min)
plier may provide a better solution to a particular problem. and the programmed cutting feedrate is extremely impor-
Information gathered from a catalogue is a very good start- tant when programming the cutting motion in feedrate per
ing base for the data in the CNC program. Keep in mind time mode. Per time mode is programmed as in/min (inches
that the all taps share some common characteristics. per minute) in programs using English units, and mm/min
(millimeters per minute) for the metric units programming.
Tap Chamfer Geometry
This per minute mode is typical to CNC milling machines
Tap chamfer geometry relates to the end configuration of and machining centers, where virtually all work is done ei-
the tap. For CNC programming, the most important part of ther in in/min or mm/min. For tapping operations, regard-
the tap end point geometry is the tap chamfer. less of the machine tool, always program the cutting feed-
rate as the linear distance the tap must travel during one
In order to program a desired hole correctly, the tap must spindle revolution. This distance is always equivalent to the
be selected according to the specifications of the hole being lead of the tap, which is the same as the tap pitch (for tap-
tapped. If tapping a blind hole, a different tap is required ping only), because taps are normally used to cut a single
than for tapping a through hole. There are three types of start thread only.
taps, divided by their end geometry configuration:
When using the feedrate per revolution mode, mode that
Bottoming tap is typical to CNClathes, the tap lead is always equivalent to
Plug tap
the feedrate. For example, the lead of .050 results in .050
in/rev feedrate, or F0.05 in the program.
Taper tap
MACHINING HOLES 211
On CNC machining centers, the typical feedrate mode is The actual feedrate value would be F26.1 or even F26.0.
always per time measured in per minute mode, and the
, easy to change the spindle speed of the tool in the pro-
It is
feedrate is calculated by one of the following formulas: gram, or even directly on the CNC
machine, then forget to
modify the feedrate for the tapping tool itself. This mistake
can happen during program preparation in the office or dur-
ing program optimization at the machine. If the change is
small, there may be no damage, more due to luck than in-
tent. If the change of spindle speed is major, the tap will
more flexible than the compression of the same holder. 1/4 18 7/16 .4375 27/64 .4219
If the spindle speed in the above example is changed from 3/8 18 37/64 .5781 9/16 .5625
S450 to S550 (tap size is unchanged at 20 TPI), the spindle Vi 14 45/64 .7031 11/16 .6875
speed change must be reflected in a new tapping feedrate:
3/4 14 29/32 .9062 57/64 .8906
F = 550 x .05 = 27.50 = F27.5 (in/min) 1.0 11 - 1/2 1 - 9/64 1.1406 1 - 1/8 1.1250
For the straight pipe thread sizes (NPS), the following With modern CNC
machines, the method of rigid tap-
tap drills are recommended: ping has become quite popular. There is no need for special
tapping holders, such as the tension compression type - reg-
Pipe Size TPI Tap Drill Decimal Size ular end mill holders or strong collet chucks can be used,
saving the cost of tool holders. However, the CNC machine
1/16 27 1/4 .2500 and its control system must support the rigid tapping fea-
1/8 27 11/32 .3438 ture. To program rigid tapping, there is a special M code
.4375
available - check the machine documentation.
1/4 18 7/16
Many designs of tap holders have their own special re- speed per minute, as ft/min). The system will then calculate
quirements, which may or may not have any effect on the the required spindle speed in r/min for the use by the ma-
programming approach. If in doubt, always check with the chine tool.
tap holder manufacturer for the suggested operation.
MACHINING HOLES 213
The calculation is based on the standard mathematical The first method may be practical only in those cases
formula that relates to the part diameter. If the diameter is when the tool motion area is absolutely clear and has no ob-
zero - which is exactly what it is at the spindle centerline - stacles in the way (do not count on such a situation). The
the spindle revolutions will always be the highest r/min that second method, and probably the most common in pro-
is available in the currently selected spindle gear range. gramming, will first move the Z axis close (but not too
This calculationis an exception to the standard r/min calcu- close) to the part, say .50 inch in the front (Z0.5). The mo-
lation formula, where the spindle speed at the centerline tion that follows is the X axis motion only - directly to the
(diameter zero) would be zero - yes, 0 r/min centerline (XO). At this point, the cutting tool (such as a
drill) is far from the Z axis face. The last approach motion
For example, if the peripheral (surface) speed for a given will be to the Z axis start position, closer to the part face,
material is 450 ft/min. the r/min at a 03 inch (X3.0) for the where the actual drilling cut begins. This method elimi-
same material will be approximately: nates (or at least minimizes) the possibility of a collision
with obstacles along the way. The obstacles are - or at least
S = (450 x 3.82) / 3 = 573 rpm could be - the tailstock, the parts catcher, the stcadyrest, the
fixture, the face plate, etc. The example of this program-
same speed of 450 ft/min is applied to the diameter
If the
ming tool path method is the previous example, modified:
zero (X0 in the program), the formula does not change, but
the resulting action does:
N36 T0200 M42
N37 G97 S700 M03
S = (450 x 3.82) / 0 = 0 r/min (ERROR) N38 GOO XO Z0.5 T0202 M08
N39 Z0.1
Although the spindle might be expected to stop (because N40 . .
motion long before completing the X axis motion (with the duction, there will be no significant loss in the cycle time.
infamous hockey-stick motion of the rapid command). The
result is a tool motion very close to the part face: Tool Return Motion
then complete the Z axis motion into from (ZO. 1 ). It is not necessary to return to the same posi-
the drilling start position tion, but it makes the programming style more consistent.
214 Chapter 26
tion and chip removal. in block N87 and continue to the Z-0.8563 position in
block N88. That results in a 1 .0563 long cut. Calculation of
the number of pecks is the same as in milling.
MACHINING HOLES 215
With the .300 length of each peck, there will be the total closer,it is important to know the tool that holds the lap (the
of three full length pecks and one partial length peck, at the tap holder) and the tapping process on lathes in general.
following Z axis locations:
The selected tap should always be mounted in a special
z- 0.1 tapping holder; the best type one with tension and com-
is
Although the first three pecks are .300 deep each, the first Since there is no fixed cycle for tapping on a typical CNC
one starts at Z0.2 and ends at Z-0. That will result in two
1 . lathe,each tool motion is programmed as a separate block.
thirds of the cut being in the air. Programmer has to decide To do that, and to find out how to tap properly, let’s first
when this approach is an advantage and when another evaluate the process for a typical right hand tap in general,
method would be more suitable. At the end of each peck applied to a lathe operation:
motion using the G74 cycle, the drill will make a small re-
Step 01 Set coordinate position XZ
tract by a fixed distance. This distance is set by a parameter
Step 02 Select tool and gear range
of the control system and is typically about .020 inches (0.5
Step 03 Select spindle speed and rotation
mm). A full retraction after each peck out of the hole (simi-
Step 04 Rapid to the center line and clearance with offset
lar to the G83 cycle for milling controls) is not supported
Step 05 Feed-in to the desired depth
by the G74 cycle. Step 06 Stop the spindle
Note that there is no programmed motion out of the hole Step 07 Reverse the spindle rotation
when the peck drilling cycle completed. This return mo-
is
Step 08 Feed-out to clear of the part depth
Step 09 Stop the spindle
tion is built-in within the G74 cycle. If a tool motion such as
Step 1 0 Rapid to the starting position
G0OZ0.2M05 follows block N88, no harm is done. It may
when running Step 1 1 Resume normal spindle rotation or end program
give the operator extra confidence the job.
lows the same machining principles as tapping on machin- Figure 26-25 shows the layout of the part and the tool
ing centers. The major difference for lathes is the absence setup, used for programming example 02607. The exam
of a tapping cycle. There is no real need for a tapping cycle pie program 02607 follows the eleven steps described
on a lathe, since most of lathe tapping operations machine above literally and is based on a very solid foundation.
only one hole of the same type. The absence of a tapping Technically, the program 02607 is correct - but only tech-
cycle may present some unexpected difficulties. Unfortu-
nically, not practically. Are there possible problem situa-
nately, they are more common among programmers with tions in the example 02607?
limited experience. Before evaluating these difficulties
Figure 26-25
Typical setup of a tapping tool on a CNC lathe - program examples 02607 and 02608
216 Chapter 26
02607 (TAPPING ON LATHES) controls). The G32 command is normally used for single
(ONLY THEORETICALLY CORRECT VERSION) point threading.Two major results will be achieved with
the G32 command - the spindle will be synchronized and
(T02 - TAP DRILL 31/64) ,
This chapter describes some typical hole patterns laid out RANDOM HOLE PATTERN
on a flat part and the various methods of their program-
ming. To make matters simple, all programming examples The most common pattern used in programming holes is
related to the hole patterns will assume a center drilling op- a random pattern. Random pattern of holes is a pattern
eration, using a #2 center drill, with chamfer diameter 50, . 1
where all holes share the same machining characteristics,
to the depth of .163 (programmed as Z-0.163). The pro-
but the X and Y distances between them are inconsistent. In
gram zero (program reference point Z0) is the top face of other words, holes within a random pattern share the same
part and the tool is assumed to be already in the spindle. For tool, the same nominal diameter, usually the same depth,
the purposes of clarity, no hole diameters or material size but a variable distance from each other - Figure 27-1.
and thickness are specified in the examples.
Random pattern
There are no special time saving techniques used in pro-
217
218 Chapter 27
N6 X3.0 Y2.0 zero position motion, in the example, along all three axes.
N7 X4.4 Y1.6 However, without a calculation, we do not know the abso-
N8 X5.2 Y2.4 lute position at the tenth hole for the X axis (the Y axis re-
N9 G80 MO mains unchanged at the position of .60 inches = Y0.6). To
N10 G28 ZO.l MO solve this ‘problem’, cancel the cycle with G80, leave the
Nil G28 X5.2 Y2.4 G91 mode in effect and move to themachine zero position
N12 M30
in the Z axis first (for safety reasons). Then - still in the in-
%
cremental mode G9 1 - return both X and Y axes to the ma-
chine zero simultaneously.
STRAIGHT ROW HOLE PATTERN
Normally, this first tool of the example would be fol-
lowed by other tools to complete the hole machining. To
Hole patternsparallel to the X or Y axis with an equal
protect the program and machining from possible prob-
pitch a straight row pattern. Figure 27-2 shows a 10 hole
is
lems, make sure that the G90 absolute command is rein-
pattern along the X axis, with a pitch of .950 inch.
stated for every tool that follows.
X and Y coordinates are given for the first and the last hole
Straight row hole pattern - program example 02702
method, the pattern angular position
In this is not speci-
The programming approach takes advantage of a fixed
fied and no pitch between holes is given.
cycle repetition feature, using the L or K address. It would
be inefficient to program each hole individually. As always, X and Y coordinates are given for the first hole only
the tool will be positioned at the first hole in G90 mode,
then the cycle will machine the first hole in block N5.
In this method, pattern angular position is specified and
the pitch between the holes is given.
For the remaining holes, G90 mode must be changed to
incremental mode G91, which instructs the control to ma- In either case, all X and Y dimensions are
the necessary
available to write the program. However, the programming
chine the other nine holes incrementally, along the X axis
approach will be different for each method of drawing
only. The same logic would also apply for a vertical pattern
dimensioning.
along the Y axis. In that case, the pitch increment would be
programmed along the Y axis only. Note that the repetition
Pattern Defined by Coordinates
count is always equal to the number ofspaces, not the num-
ber of holes. The reason? The first hole has already been This method of programming is similar to the straight
machined in the cycle call block. row pattern. Since the pitch between holes is not given, the
increment between holes along each of the two axes must
02702 (STRAIGHT ROW HOLE PATTERN) be calculated. This axial distance commonly known
is as
N1 G20
N2 G17 G40 G80
the delta distance (delta X
measured along the X axis,
is
N7 G80 M0 9
N8 G28 Z0 M0
N9 G28 X0 Y0
N10 M30
%
10.82 / 5 = 2.1640
02703 (ANGULAR RCW 1) Since the calculated increments are rounded values, a certain
N1 G20 accumulative error is inevitable. In most cases, any error will
N2 G17 G40 G80 be well contained within the required drawing tolerances.
N3 G90 G54 GOO XI. 0 Y0.625 S900 M03 However, for the projects requiring the highest precision, this
N4 G43 Z1.0 H01 M08 error may be important and must be taken into consideration.
N5 G99 G81 R0.1 Z-0.163 F3 .
To make sure all calculations are correct, a simple check- corner hole will be machined twice. Visualize the whole
ing method can be used to compare the calculated values: process - the last hole of one row pattern is also the first
hole of the next pattern, duplicated. Creating a special cus-
O Step 1 tom macro is worth the time for many corner patterns. The
tolerance. In that case, the only correct way to handle the continuous. Just like in the earlier examples, keep in mind
programming is to calculate the coordinates of each hole as that the repetition count L or K is for the number of moves
absolute dimensions (that means from a common point (spaces), not the number of holes.
rather than a previous point). The programming process
but it will be much more accurate.
will take a little longer,
GRID PATTERN
CORNER PATTERN Basic straight grid pattern can also be defined as a set of
equally spaced vertical and horizontal holes, each row hav-
Pattern of holes can be arranged as a corner - which is ing equally spaced holes. If the spacing of all vertical holes
nothing more than a pattern combining the straight and/or is the same as the spacing of all horizontal rows, the final
angular hole patterns - Figure 27-5. grid pattern will be a square. If the spacing of all vertical
Figure 27-5
All rules mentioned for the straight and angular hole pat-
terns apply for a corner pattern as well. The most important
difference is the corner hole, which is common to two rows.
A corner pattern can be programmed by calling a fixed cy- Figure 27-6
cle for each row. Soon, it will become apparent that each Rectangular grid hole pattern - program example 02706
PATTERN OF HOLES 221
3.5
repeat the process until all rows and columns are done. The *v
*
wasted time of the rapid motion is kept to the minimum.
4.0 |— -J3.2h—
02706 (STRAIGHT GRID PATTERN)
N1 G20
Figure 27-7
N2 G17 G40 G80
N3 G90 G54 GOO XI. 7 Y2.4 S900 M03 Angular grid hole pattern - program example 02707
N4 G43 Z1.0 HOI M08
N5 G99 G81 RO 1 Z-0.163 F3
. .
N10 XI.
Nil Y2.1 L6 (K6) X = 4.6 x tanl6 = 1.319028774 (XI. 319)
N12 XI.
N13 Y-2.1 L6 (K6) The program can be written in a similar way as for the
N14 XI. straight row grid, except the extra ‘jump’ between rows will
N15 Y2.1 L6 (K6) take place along both axes:
N16 G80 MO 9
N17 G28 ZO MO 02707 (ANGULAR GRID)
N18 G28 XO YO N1 G20
N19 M30 N2 G17 G40 G80
% N3 G90 G54 GOO X4.0 Y3.5 S900 M03
N4 G43 Z1.0 HOI M08
Two features of the program are worth noting - one is the N5 G99 G81 RO.l Z-0.163 F3 .
jump from one row of the pattern to another - it has no repe- N6 G91 X3.2 L5 (K5)
tition address L or K, because only one hole is being ma- N7 XI. 319 Y4.6
chined at that location. The second feature may not be so N8 X-3.2 L5 (K5)
obvious right away. To make the program shorter, start N9 XI. 319 Y4.6
along the axis that contains the larger number of holes (the N10 X3.2 L5 (K5)
Nil XI. 319 Y4.6
Y axis in the program example 02706). This example is a N12 X-3.2 L5 (K5)
variation on the previous examples and also adheres to all
N13 G80 MO
the rules established so far. A special subprogram made for
N14 G28 ZO MO 5
a grid pattern is also a common programming approach and N15 G28 XO YO
can be used as well. N16 M30
%
Angular Grid Pattern
Many experienced programmers will consider even more
Although the straight grid pattern is the most common efficient way of approaching
programs for grid patterns
the
pattern for square and rectangular hole arrangement, a grid by using subprograms or even User Macros. Subprograms
pattern may also be in the shape of a parallelogram, called are especially useful for grid patterns consisting of a large
an angular grid pattern - Figure 27-7. number of rows or a large number of columns. The subject
of subprograms, including a practical example of a really
Again, the programming approach remains the same as
large grid pattern, is covered in Chapter 39. The subject of
for the rectangular grid pattern, the only extra work re-
user macros is not covered in this handbook.
quired is the calculation of the angular increments, similar
to previous methods:
222 Chapter 27
The approach to programming an arc hole pattern should Use trigonometric functions to calculate the X and Y co-
be the same as if programming any other hole pattern. Se- ordinates of the first hole:
lect the firsthole as the one that is most convenient. Is it the
Hole #1
first hole or the last hole on the arc that is easier to find the
© STEP 3
R2 5
% y
20° TYP
culate
hole
Hole
XY coordinates for the 3 remaining holes. For each
in the pattern, increase the included angle by 20°, so
the second hole angle will be 40°, the third 60°,
#2
and so on:
1 — >1
^ T
1.0 X = 1.5 + 2.5 x cos40 = 3.415111108 (X3.4151)
r+ 4 EQSP HOLES
Y = 1.0 + 2.5 x sin40 = 2.606969024 (Y2.607)
Hole #3
In the pattern, the arc center locations are known, so is the X* 1.5+ 2.5 x cos 80 = 1.934120444 (XI. 9341)
arc radius, angular spacing between holes and the number Y = 1.0 + 2.5 x sin80 = 3.462019383 (Y3.462)
of equally spaced holes along the circumference.
coordinates for each hole center location within the bolt If the XY coordinates are calculated in the same order as
hole pattern. The procedure is similar to that of an angular they will appear in the CNC program, the listing of all hole
line in a grid pattern, but with several more calculations. locations can be used in that order:
The calculation uses trigonometric functions applied to
each hole separately - all necessary data and other informa- Hole #1: X3.8492 Y1.8551
Hole #2: X3.4151 Y2.6070
tion are listed in the drawing.
Hole #3: X2.7500 Y3.1651
For any number of holes, exactly the double number of Hole #4: XI. 9341 Y3.4620
calculations will be required to get the coordinates for both
Now, the program for the hole arc pattern can be written,
axes. In the example, there are four holes, therefore eight
calculations will be necessary. Initially, it may seem as a lot
using the XY coordinates for each hole location from the
established calculations - program 02708:
of work. In terms of calculations, it is a lot of work, but
keep in mind that only two trigonometric formulas are in-
02708 (ARC PATTERN)
volved for any number of holes, so the calculations will be-
N1 G20
come a lot more manageable. Incidentally, this observation N2 G17 G40 G80
can be applied to just about any other similar programming N3 G90 G54 GOO X3.8492 Y1.8551 S900 M03
application. N4 G43 Z1.0 H01 M08
N5 G99 G81 R0.1 Z-0.163 F3.0
The best way to illustrate the arc pattern programming, is N6 X3.4151 Y2.607
to use the drawing example. First, the programming task N7 X2.75 Y3.1651
will be split into four individual steps: N8 XI. 9341 Y3.462
PATTERN OF HOLES 223
There are two other methods (perhaps more efficient) to the starting point for calculations of all holes on the bolt cir-
program an arc hole pattern. The first method will take an cle. When the circle center coordinates are known, write
advantage of the local coordinate system G52, described in them down. Each hole coordinate on the circumference
Chapter 40. The second method will use the polar coordi- must be adjusted by one of these values. When all calcula-
tions for the first hole are done (based on the circle center),
nate system (optional on most controls), described later in
this chapter - in program 02710.
continue to calculate the X and Y coordinates for the other
holes on the circle circumference, in an orderly manner.
BOLT HOLE CIRCLE PATTERN example 02709 are 6 equally spaced holes on the bolt
In
circle diameter of 10.0 inches. That means there is a 60° in-
A pattern of equally spaced holes along the circumfer- crement between holes (360/6=60). The most common
starting position for machining is at the boundary between
ence of a circle is called a bolt circle pattern or a bolt hole
quadrants. That means the most likely start will be at a po-
pattern. Since the circle diameter is actually pitch diameter
sition that corresponds to the 3, 12, 9 or 6 o’clock on the
of the pattern, another name for the bolt circle pattern of
face of an analog watch. In this example, the start will be at
holes is a pitch circle pattern. The programming approach
the 3 o’clock position. There is no hole at the selected loca-
is very similar to any other pattern, particularly to the arc
tion, the nearest one will be at 30° in the counterclockwise
hole pattern and mainly depends on the way the bolt circle
pattern is oriented and how the drawing is dimensioned.
direction. A good idea is to identify this hole as a hole num-
ber 1 . Other holes may be identified in a similar way, pref-
A typical bolt circle in a drawing is defined by XY coor- erably in the order of machining, relative to the first hole.
dinates of the circle center, its radius or diameter, the num-
ber of equally spaced holes along the circumference, and
Note that each calculation uses exactly the same format.
the angular orientation of holes, usually in relation to the X Any other mathematical approach can be used as well, but
watch the consistency of all calculations:
axis (that is to the zero degrees).
Hole #1
A be made up of any number of equally
bolt circle can
spaced holes, although some numbers are much more com-
mon than others, for example, X = 7.5 + 5.0 x cos30 = 11.830127 (X11.8301)
Y = 6.0 + 5.0 x sin30 = 8.500000 (Y8.5)
4 5 6 8
, , , ,
10 12 16 18 20 24
, , , , ,
Hole #2
In laterexamples, the 6-hole and the 8-hole patterns (and
their multiples) have two standard angular relationship to X = 7.5 + 5.0 x COS90 = 7.5000000 (X7.5)
the X axis at zero degrees. Y = 6.0 + 5.0 x sin90 = 11.0000000 (Y11.0)
Hole #4
Hole #5
Hole #6
Once all coordinates are calculated, the program is writ- Using the following explanation and the formula, coordi-
ten in the same way as for the previous patterns: nates for any hole in any bolt circle pattern can be calcu-
lated easily. The formula is similar for both axes:
02709 (BOLT CIRCLE PATTERN)
N1 G20
N2 G17 G40 G80 X = cos ((n - 1) x B + A) x R + X c
N3 G90 G54 GOO X11.8301 Y8.5 S900 M03
N4 G43 Z1.0 HOI M08
N5 G99 G81 RO 1 Z-0.163 F3.0
.
Y = sin ((n - 1) x B + A) x R + Yc
N6 X7.5 Y11.0
N7 X3.1699 Y8.5 US’ where ...
N8 Y3.5
N9 X7.5 Y1.0 X = Hole X coordinate
N10 X11.8301 Y3.5 Y = Hole Y coordinate
Nil G80 MO n = Hole number counter - CCW from 0°
N12 G28 ZO.l MO H = Number of equally spaced holes
N13 G91 G28 XO YO B = Angle between holes = 360 / H
N14 M30 =
A First hole angle - from 0°
% =
R Bolt circle radius or bolt circle diameter/2
Xc = Bolt circle center from the X origin
Itwould be more logical to select the bolt circle center as
Yc = Bolt circle center from the Y origin
program zero, rather than the lower left corner of the part.
This method would eliminate modifications of the bolt cir-
Pattern Orientation
cle center position for each coordinate value and perhaps
reduce a possibility of an error. At the same time, it would The bolt circle pattern orientation is specified by the an-
make it more difficult to set the work offset G54 on the ma- gle of the first hole from the 0° of the bolt circle.
chine. The best solution is to use G52 local coordinate
offset method. This method is especially useful for those In daily applications, bolt circle patterns will have not
jobs that require translation of the bolt circle pattern (or any only different number of holes, but different orientations as
other pattern) to other locations of the same part setup. For well.The bolt circles most commonly affected are those
details on the G52 command, see Chapter 40. whose number of equally spaced holes is based on the mul-
tiples of six ...) and multiples of eight (4, 8,
(6, 12, 18, 24,
Bolt Circle Formula 1 6, 24, 32, This relationship is important, since the ori-
...).
entation of the first hole will influence the position of all the
In the previous calculations, there are many repetitious other holes in the bolt circle pattern. /
data. The methods are the same, only the angle changes. /
This type of calculation offers an excellent opportunity for Figure 27-11 shows relationship of the first hole position
creating a common formula that can be used, for example, to the 0° location of the bolt circle. 0° location is equivalent
as the basis of a computer program, calculator data input, to the 3 o’clock position or the East direction.
Figure 27 -W
Basis for a formula to calculate bolt hole pattern coordinates Typical orientations of a six and eight hole bolt circles
PATTERN OF HOLES 225
N. . G16 (POLAR COORDINATES ON) In the next program 02711, holes are equally spaced on
N. . G9 . G8
. . . X.. Y.. R. . Z. . F. .
the bolt circle circumference. Dimensions in Figure 27-13
N are applied to the polar coordinate programming method.
N (MACHINING HOLES)
N
N. . G15 (POLAR COORDINATES OFF)
02711 (G15-G16 EXAMPLE) G17 plane is known as the XY plane. If working in another
N1 G20 plane, make double sure to adhere to the following rules:
N2 G17 G40 G80
N3 G90 G54 GOO XO YO S900 M03 (PIVOT POINT)
The first axis of the selected plane
N4 G43 Z1.0 HOI M08
is programmed with the arc radius value.
N5 G16 (POLAR COORDINATES ON)
N6 G99 G81 X6.8 YO RO.l Z-0.163 F3.0
N7 X6.8 Y60.0 The second axis of the selected plane
N8 X6.8 Y120.0 is programmed as the angular position of the hole.
N9 X6.8 Y180.0
N10 X6.8 Y240.0 In a table format, all three possibilities are illustrated.
Nil X6.8 Y300.0
Note, that if no plane is selected in the program, the control
N12 G15 (POLAR COORDINATES OFF)
N13 G80 MO system defaults to G17 - the XY plane.
N14 G91 G28 ZO M05
N15 G28 XO YO
G-code Selected plane First axis Second axis
N16 M30
% G17 XY X = radius Y = angle
Order of Machining
If a particular job requires many arc or bolt hole patterns,
polar coordinate system option will be worthy of purchase, The order in which the holes are machined can be con-
even at the cost of adding it later. If the Fanuc User Macro trolled by changing the sign of the angular value, while the
option is macro programs can be created without
installed,
polar coordinate command is in effect. If the angular value
having polar coordinates on the control and offer even is programmed as a positive number, the order of machin-
more programming flexibility. ing will be counterclockwise, based on the 0° position. By
changing the value to a negative number, the order of ma-
Plane Selection
chining will be clockwise.
Face milling is a machining operation that controls the Basic Selection Criteria
height of the machined part. For most applications, face
Based on the job to be machined, selection of a face mill
milling a relatively simple operation, at least in the sense
is
culler has to lake into account several situations;
that it usually does not include any difficult contouring
motions. The cutting tool used for face milling is typically a Condition of the CNC machine
multi tooth cutter, called a face mill, although end mills
Material of the part
may also be used for certain face milling operations, usu-
ally within small areas. The top surfaces machined with a Setup method and work holding integrity
face mill are generally perpendicular to the axis of the fac-
Method of mounting
ing cutter. In CNC programming, the face milling opera-
tions are fairly simple, although two important consider- Overall construction of the cutter
ations are critical:
Face mill diameter
Selection of the cutter diameter
Insert geometry
Initial starting position of the tool in relation to the part
The last two items, and insert geometry,
cutter diameter
It helps to have some experience and knowledge of face will influence the actual program development the most,
milling principles, such as the right cutter and insert selec- although other items are important as well.
of cuts, machine power consumption, and
tion, distribution
several other technical considerations. Some of the basic Face Mill Diameter
ones are covered in this chapter, but manufacturers’ tooling
catalogues and various technical references will be a more One of the most important considerations for face milling
operations is the selection of cutter size. For a single face
in-depth source.
cut, the ideal width of the face mill cutter should be about
1 .3 to 1 .6 times larger than the material width. For example,
CUTTER SELECTION a single 2.5 inches wide cut will benefit from a 04.0 face
mill as a suitable size. This 1 .3 to 1 .6 times ratio will assure
Like all milling operations, face milling employs a cut- a good formation of chips and their clearout from the part.
ting tool that rotates while the part remains stationary. Face For multiple cuts, always select the largest diameter cutter
milling requires that a specific amount of material be re- that can be used for the job, always considering the ma-
moved from the top of part, at one or several depth levels, in chine power rating, the cutter and insert geometry, the setup
a single cut or multiple cuts. The programming for face rigidity, depth and width of each cut, and other machining
milling is so effortless that, in fact, many programmers do related factors.
not pay sufficient attention to proper selection of the face
milling cutter, proper inserts, do not even consider the ma-
The basic purpose of face milling is to machine off the
top of a part to the specified height. For this type of machin-
chine requirements and capabilities.
ing, select a reasonable face mill diameter size, which often
A typical face mill is a multi tooth cutter with inter- means to use relatively large diameter face mills. Sizes in
changeable carbide inserts. High speed steel face mills are the range of 2 t<Z» 12 inches (50 to 300 mm) are not unusual,
not recommended for CNC work, although an HSS end depending on the machine and the job.
mill can be a suitable choice to face mill small areas or ar-
eas hard to get toin any other way. Typical to a face milling
Oneimportant consideration in face milling is the diame-
terof the tool versus the full width of the cut. Take, for in-
operation is the fact that not all inserts of the milling cutter
stance, a 05.0 inch face mill. All tooling catalogues list the
are actually working at the same time. Each insert works
only within a part of one complete revolution. This obser- nominal size of the face mill (5 inches in the example), al-
though the body diameter can be found in the catalogue as
vation may be an important consideration when trying to
well. The nominal diameter always refers to the full width
establish an optimum tool life for a face milling cutter. Face
milling does require significant power resources from the of the cut. There is no way to tell the actual diameter of a
tool holder body from the nominal size alone, it has to be
machine For the insert setup in the cutter body,
tool. it is
very important to have all inserts properly mounted. looked up in the tooling catalogue. Normally, the actual
size of the cutter body is not needed, except in those cases
227
228 Chapter 28
where the face milling takes place close to walls or other Negative Geometry
obstacles. The size of the cutter body may prevent access to
Negative geometry face mills offer very high strength of
some areas of the part and may interfere elsewhere as well.
the insert edge and usually require a heavy duty machine
The Figure 28-1 shows some typical configurations.
and a robust setup. The side effects are poor formation of
the chips for steel but not for some kinds of cast irons,
where there is hardly any curling effect during chip for-
mation. Their main benefit is the insert economy, since
negative inserts are generally double sided, offering up to
eight cutting edges for a single square insert, inserted in
pockets of the face mill.
Learn and become familiar with the basic terminology of Positive / Negative Geometry
milling cutters order to understand the terms used in pro-
in
Positive /Negative geometry is the most beneficial to face
gramming. Most of the tooling companies have available
catalogues and technical booklets for the cutters and inserts milling operations where chip clogging could become pro-
they manufacture that explain the cutter usage as well as all blematic. This dual geometry design offers strength of the
related terms. Keep in mind that cutting tool technology negative insert with the capability of ‘curling’ the chip into
does change quite rapidly and constant improvements are a spiral shape. This design is usually most suitable for full
being made. For the programming purposes in this chapter, width face milling.
we look only at the very basic items of insert geometry for
Always consult supplied technical specifications of the
face milling cutters.
cutting tool manufacturers and compare several products
o Combination of both . .
.
positive / negative ent conditions. For example, unless a specially designed
face milling cutter and propter insert geometry, shape and
Any detailed variations are too numerous to list, but a
grade are used, try to avoid face milling a part width that is
short overview offers at least some basis for further studies.
equal to, or only a slightly larger than, the cutter diameter.
Full width face milling cut may cause the insert edge to
Positive Geometry
wear out prematurely and the chip to ‘weld’ itself to the in-
geometry cutters require less machining power
Positive sert. Not only the insert suffers in form of a wear out, the
chines. They offer a good chip breaking characteristics and creasing the machining cost.
arc a good choice for machining steel materials when the
Figure 28-2 shows desirable and undesirable relationship
cutting load not too heavy. Positive inserts are generally
is
of the cutter diameter to the part width during face milling.
single sided, therefore less economical.
FACE MILLING 229
Table ' i
v with the material, which will prevent heavy interrupted cut,
with the possible damage to the cutter and to the machine.
direction
This situation may occur if a large face mill diameter is
used for a very narrow part width.
Programmed
direction
PROGRAMMING TECHNIQUES
Although defined earlier as a relatively simple operation,
face milling can be programmed much better if some com-
mon sense points are observed. Since face milling often
covers a large cutting area, it is important to consider care-
Table
:c fully the actual tool path from the start position to the end
direction / , V position. Here is a list of some points that should be evalu-
ated for any face milling operation:
direction
If surface finish is important, change the cutter
direction away from the part (in the air)
l / , A"
for better cutting conditions
Figure 28-4
0
(a) Neutral milling mode i
(b) Climb or 'down' milling mode
(cl Conventional or 'up' milling mode
Width
Figure 28-5a illustrates the incorrect and Figure 28-5b The part X0Y0 is at the lower left corner. To establish the
the correct width of a face mill cut. In the example (a), the starting X position, consider the part length of 5.0 inches,
cutter is engaged in the part with its full diameter, causing the cutter radius (5/2=2.5) and the clearance (.25). The start
friction at the cutting edge and decreasing tool life. The ex- X axis position will be the sum of these values, X7.75. For
ample keeps only about 2/3 of the cutter diameter in the
(b) the Y axis start position calculation, consider the overhangs
work, which causes a suitable chip thickness, as well as fa- on both edges and select climb milling mode at the same
vorable angle of insert entry into the material. time. Actually, the climb milling will be combined with a
little of conventional milling, which is quite normal for face
Single Face Mill Cut milling operations. Figure 28-7 shows the cutter start posi-
tion at X7.75Y1.0, and the end position at X-2.75Y1.0, as
For the first face milling programming example, we will well as the details of calculations.
use a 5x3 plate (1 inch thick) that has to be face milled
along the whole top surface to the final thickness of .800.
Figure 28-6 shows this simple drawing.
— 5.0 — —0.8 —
5x3x1 STEEL PLATE face mill positions for a single face mill cut example
Figure 28-6 The position Y 1 .0 was based on the desire to have about
Example of a single face mill cut - program 02801 one quarter to one third of the cutter diameter overhang at
the part edge, for best insert entry angle. As 1 .5 inch over-
From the drawing is apparent that the face milling will hang is 30% of the cutter diameter, the programmed abso-
take place along the part, so the X axis horizontal direction lute Y position was established at a convenient Y 1 .0.
will be selected. Before the program can be started, there
arc two major decisions to be made: Now, part program for the single face milling cut can be
written, with the top of part as program zero (Z0). Only one
Face mill diameter
face cut is used - program example 02801
Start and end position of the cut
02801
There are other important decisions to make, but these (SINGLE FACE MILLING CUT)
two are the most critical. N1 G20
N2 G17 G40 G80
The part is only 3 inches wide, so a face mill that is wider N3 G90 G54 GOO X7.75 Y1.0 S344 M03
than 3 inches should be selected. Although a 04.0 inch N4 G43 Z1.0 H01
face mill seems like a natural choice, let’s see if it conforms N5 G01 Z-0.2 F50.0 M08
have been established earlier. The
N6 X-2.75 F21.0
to the conditions that
N7 GOO Z1.0 MO
cutter diameter should be .3 to 1 .6 larger than the width of
1
N8 G28 X-2.75 Y1.0 Z1.0
cut. In this case, 3 x 1.3 = 3.90 and 3 x 1.6 = 4.80. With a N9 M30
04.0 face mill, that means only 1.33 times larger. Con- %
sidering the need for the cutter to overlap both edges of the
part, selection of a five inch face mill diameter is better. Spindle speed and feedrate are based on 450 ft/min sur-
face speed, .006" per tooth and 8 cutting inserts, used only
Once the face mill diameter has been finalized, concen-
as reasonable values.Note the Z axis approach in block N4.
trate on the start and end positions. For safety reasons,
Although the tool is well above an empty area, the rapid
plunging to the depth has to start away from the part, in the
motion is split between blocks N4 and N5, for safety rea-
air. The decision to cut along the X axis (horizontally) has
sons. With increased confidence, rapid to the Z-0.2 directly
been made, so the question is whether from the left to the
may be an option, if desired. This example shows the pro-
right orfrom the right to the left. It really does not matter, not the more
gram Z0 at the top of the unmachined part,
except for the direction of chip flow, so selection from the
customary finished face.
right to the left is arbitrary.
232 Chapter 28
Schematic tool path representation for the climb face milling mode,
applied to a unidirectional cutting
Note the start position (S) and the end position (E) in the 6
two illustrations. They are indicated by the heavy dot at the
J
center of cutter. Regardless of the cutting method, the face
milling cutter is always in a clear position at the start and
13x6 PLATE
end of cutting, mainly for safety reasons.
Figure 28- 1
The programming example for multiple face milling cuts Some of the examples could have been done in a shorter
is based on the drawing shown in Figure 28-11. The previ- way along the X axis, resulting in a smaller program. How-
ously discussed basics are applied and should present no ever, for the purpose of example illustrations, using the Y
difficulty in understanding the program. axis was more convenient.
The 3 1 inch part width was separated into four equal cut-
modern CNC machining centers.
ting widths of 3.25 each, which is a little less than 2/3 of a Revisit the example 02801 and refer to earlier Figures
05.0 cutter, its usable width of cut. Clearances of .25 off 28-6 and 28-7. Illustrations show that we have to face (with
the part are the same as for the single face cut example. The
a single cut) a 5x3 plate, using a 05 inch face mill. In order
major deviation from the norm was the motion to position to adhere to the safety rules in machining, the face mill has
number 7 in Figure 28-10 and block Nil in the program. to be positioned in an open area, away from the part. In or-
The last cutting motion is from position 7 to position 8. In der to keep the face mill cutting edges away from the part
order to make the surface finish better, the expected cut was by one quarter of an inch, the clearance of .25 inches has to
overlapped at X9.0 by .100 to the programmed value of
be incorporated with the radius of the face mill, which is 2.5
X8.9. In Figure 28-12, the schematics for 02802 program inches, to achieve the actual tool starting position for the
are shown, including block number references.
face milling cutter.
S' ''
/ N6 bnoyNi 1 N7 The face mill radius is programmed using the actual values
YRU. 7*5
1 /
3.25 EACH
02801
r\ r\r\
u.uu (SINGLE FACE MILLING CUT - NO COMPENSATION)
YjN3YI sJ9 .. N1 2 N N1 G20
t- 75
Y-2 I . 1
N2 G17 G40 G80
A
Y Ly
\ / T \
i
1 \
Block N3 moves the face mill to the actual, calculated When comparing, note the major differences in block N3
start position of the cut. In block N6, the cut is completed - (new X value), in block N5
(compensation G46), and also
again, at the actual previously calculated position. The pro- in block N7 (compensation G47). The situation will benefit
gram 02803 using position compensation is similar, but it from some more detailed evaluation.
does have some notable differences.
The N3 block contains the X position with value of X8.0.
Compare program 02801 with the new pro-
the original That is the initial position. Since the plan is to apply the
gram 02803, program that uses the position compensation compensation G46 (single contraction), the tool has to be at
feature - Figure 28-13 a position of a larger value than the one expected when the
compensation is completed. Therefore, X8.0 is an arbitrary
value. Note that if the G45 compensation command were
planned, the initial position would have to be a smaller
value than the one expected when the compensation is
completed. This is because the position compensation is al-
ways relative to the programmed direction.
The N5 block added to program 02803. It contains the
is
is used, the job can be done very nicely, but the starting po-
02803 sition may have to be changed. In this case, the stored value
(SINGLE FACE MILLING CUT) of the EX) offset will be 1.75, but block N5 will still con-
I
(USING POSITION COMPENSATION) tain X5.25. The CNC system will do its work.
N1 G20
N2 G17 G40 G80 The last block worth a further look is N7. It contains G47
N3 G90 G54 GOO X8.0 Y1.0 S344 M03 position compensation command. The X value is equiva-
N4 G43 Z1.0 HOI lent to the selected clearance of X-0.25. The G47 command
N5 G46 X5.25 D01
means a double elongation -of the offset value along the
N6 G01 Z-0.2 F50.0 MO
N7 G47 X-0.25 F21.0 programmed direction. This is necessary, because of the
N8 GOO Z1.0 MO need to compensate at the start of cut, as well as at the end
N9 G91 G28 XO YO ZO of cut. Also note the initial position and the compensated
N10 M30 start position cannot be the same, otherwise no compensa-
% tion will take place. With some ingenuity, the face milling
can be programmed very creatively, using a rather obsolete
programming feature.
29 CIRCULAR INTERPOLATION
To understand the principles of programming various cir- elements of a circle used in part programming are the circle
cular motions, it helps to know something about the basic radius and the circle diameter.
geometrical entity known as the circle. As an entity that is
quite common in everyday life, a circle has various proper- The radius of a circle is the line segment
ties that are strictly mathematical, only considered in spe- from the center point to any point on the circle
cialized disciplines, such as Computerized Numerical Con-
trol, motion control and automation. The diameter of a circle is the line segment
through the center point of the circle and
The following definition of a circle and several other defi- having both end points on the circle
nitions that are related to a circle are based on some com-
mon dictionary definitions - Figure 29-1.
The center point location of the circle is also important
for CNC programming. The plural form of the word radius
A circle is defined as a closed curve on a plane,
is radii although the word ‘radiuses’ has been accepted as
,
where all points have the same distance from an
a colloquial term. In CNC programming, radii and dia-
internal point called the circle center point.
meters are used all the time, on a daily basis for almost all
contouring machines. Drawings used in machine shops use
There are other similar definitions of a circle that can be
radius and diameter dimensions a lot, with an almost un-
found in dictionaries and mathematical books. The general
limited number of possible applications.
understanding of a circle and its various properties as de-
scribed in this handbook, provides a sufficient knowledge Radii and diameters are also used in relation to the cutting
for general CNC programming. Additional
knowledge will tool insert designation, they are used for measuring and
be needed for some specialized or complex programming gauging (inspections), as well as in trigonometric calcula-
applications. At this time, become at least reasonably fa- tions and various auxiliary sketches. In programming, the
miliar with the geometrical and trigonometric relationships actual application of an arc or circle is not important, only
for arcs and circles. its mathematical characteristics.
235
236 Chapter 29
Circle Area and Circumference Also worth mentioning is a mirrored tool path and its re-
where ...
about mirror image as a programming subject. For now, it
should be adequate to cover a very brief overview only.
A = Area of the circle
= The circle radius
For example, if a programmed tool path in Quadrant I is
R
71 = Constant (3.141 5927) mirrored to Quadrants II or IV, the cutting method will be
reversed. That means a climb milling will become conven-
The circumference of a circle is the length of a circle if it tional milling and vice versa. The same rule applies to a
were a straight line: programmed tool path in Quadrant II as it relates to Quad-
rants I and III. This
a very important consideration for
is
A quadrant is a major property of a circle and can be de- though the latter term is not used too often, except in math-
fined mathematically: ematical terminology. There are four quadrant points on a
given circle, or four intersections of the circle with its axes.
A quadrant is any one of the four parts of the plane The quadrant points locations can be remembered easier by
formed by the system of rectangular coordinates. associatingthem with the dial of a compass or a standard
watch with an analog dial:
It is to every programmer’s benefit to understand the con-
cept of quadrants and their applications for circular mo- Compass Watch Located
tions in milling and turning programs. Degrees
direction direction between quadrants
A circle is programmed
in all four quadrants, due to its
0 EAST 3 o'clock IV and 1
For many arc programming projects, the direct radius can 270 SOUTH 6 o'clock III and IV
G02 X. . Y. .. I. .. J. . Milling program - CW example, block N66 represents the end of a con-
In the
G02 X. . Z. .. I. ,. K. . Turning program - CW tour,such as a linear motion. It also represents the start of
G03 X. . Y. .. I. ,. J. . Milling program - CCW the arc that follows next. In the following block N67, the
G03 X. . Z. .. I. ,. K. . Turning program - CCW
arc is machined, so the coordinates represent the end of arc
and start point of the next element. The last block of the ex-
Control systems supporting the arc radius designation by
ample is N68 and represents the end point of the element
address R will also accept the 1JK modifiers, but the reverse
that started from the arc. The end point of the arc is the co-
is nor true. If both the arc modifiers IJK and the radius R are
ordinate point of any two axes, where the circular motion
programmed in the same block, the radius value takes pri-
ends. This point is sometimes called the target position.
ority. regardless of the order:
G02 (GO 3) X. . Y. . R. . I. . J.
Arc Center and Radius
G02 (G03) X. . Y. . I. . J. . R. .
The radius of an arc can be designated with the address R
UK or with arc center vectors I. J and K. The R address allows
The controls that accept only the modifiers will re-
turn an error message case the circular interpolation
in
programming the arc radius directly, the UK arc center
vectors are used to actually define the physical (actual) arc
block contains the R address (an unknown address).
center position. Most modern control systems support the
R address input, older controls require the arc center vec-
Arc Start and End Points
tors only. The basic programming format will vary only
The start point of an arc is the point where circular inter- slightly between the milling and turning systems, particu-
polation begins, as determined by the cutting direction. larly for the R address version:
This point must be located on the arc and it can be a tan-
gency point or an intersection, resulting in a blend radius or G02 X. Y.. . R. . Milling program - CW
a partial radius respectively. The instruction contained in
G02 X. Z.. .
R.. Turning program - CW
G03 X.. Y.. R. . Milling program - CCW
the start point block is sometimes called the departure
.
CCW=+ CCW = + be sufficient. This is never true. Always keep in mind that
numerical control means control of the tool path by num-
bers. In this case, there is an infinite number of mathemati-
cal possibilities and all are corresponding to this incom-
plete definition. There is virtually an unlimited number of
arc radii that will fit between the programmed start and end
i A points and still maintain the cutting direction.
— •-! I-
— - K- - Another important concept to understand is that the cut-
ting direction CW or CCW has nothing to do with the arc
center or the radius. The control system needs more infor-
USED IN MILLING USED IN TURNING
mation than direction and target point in order to cut the de-
Figure 29-3 sired arc. This additional information must contain a defi-
Center point and start point of an arc nition that defines a programmed arc with a unique radius.
The arc start point is always relative to the cutting motion This unique radius is achieved by programming the R ad-
dress for the direct radius input, or using the IJK arc center
direction and is represented in the program by coordinates
in the block preceding the circular motion. In terms of a vectors. Address R is the actual radius of the tool path, usu-
definition.
ally the radius taken from the part drawing.
Figure 29-4
Arc vectors I and J (also known as arc modifiers) and their sign designation in different quadrants (XY plane)
Arc center vector / is the distance, with specified direction, An error can be particularly likely in those
possible error.
measured from the start point of the arc, cases where both types of controls are installed in the shop.
to the center of the arc, parallel to the X axis. There is no compatibility between programs using absolute
and incremental designation of the arc center.
Arc center vector J is the distance, with specified direction,
measured from the start point of the arc,
The specified direction applies only to the incremental
to the center of the arc, parallel to the Z axis. and must always be written. Arcs using absolute center de-
finition follow standard rules of absolute dimensioning.
most always measured as an incremental distance between For machining centers, programming an arc in any one of
the two points. Some control systems, for example many the three geometrical planes is allowed - Figure 29-5. The
Cincinnati designs, use the absolute designation to define
correct arc vectors must be used for each plane:
an arc center. In those cases, the arc center is programmed
as an absolute value from the program zero, not from the G17 G02 (G03) X.. Y. R.. . (or I.. J..)
arc center. Always make sure how each of the control sys- G18 G02 (G03) X.. Z.. R. . (or I.. K..)
tems in the machine shop handles these situations. G19 GO 2 (G03) Y. Z.. R. . . (or J. .K..)
2
^NT
G0^\ GoX\ G0^\
— V to Y
Figure 29-5
Arc cutting direction in three planes - the orientation of the axes is based on mathematical, not machine, planes
arc vectors or the R value. Such a block is complete and Partial Radius
will always be executed on the basis of axes designation
priority. This method is preferable to the selection of a pre- The opposite of a blend arc is a partial arc - there is no
viously defined plane. Even if the plane designation is in- smooth blend between two contour elements, instead, there
correct. the resulting tool motion will always be correct. is an intersection. Mathematically, there are always two
RADIUS PROGRAMMING quite clear as to the shape of any partial radius. Partial ra-
dius can also exist between two lines, one line and an arc,
or between two arcs. Partial radius can be defined as a ra-
Programming arc is very common. By definition, an arc
dius where either the start point or the end point is not tan-
isonly a portion of a circle and there are many ways to pro- gent to the adjacent element, but intersects it in two places.
gram an arc. If the arc is 360°, it must be programmed with The actual calculation of point coordinates for the arc start
the cutting start position being the same as its end position. or end point is about the same as that for a blend arc, de-
In this case, a full circle is the result. If only a portion of the pending which method of dimensioning had been used in
circle is programmed, only a radius is programmed. Two the part drawing.
kinds of radii are used in CNC programming:
A point of tangency between an arc and its adjacent ele- Circular pocket milling
ment creates a blend radius. Blend radius is defined as a ra-
Spotface milling
dius tangent between a line and an arc. an arc and a line, or
between two arcs. A blend arc creates a smooth transition Helical milling (with linear axis)
between one contour element and another. The point of tan-
Milling a cylinder, sphere or cone
gency is the only contact point between the two elements.
CIRCULAR INTERPOLATION
241
A full circle cutting is defined as a circular too! motion G01 Z-0.25 F10.0
that completes 360° between the and end points, re-
start G02 X2.0 Y0.75 1-1.25 JO F12.0 (BLOCK 1 OF 4)
sulting in identical coordinates for the start and end tool po- G02 X0.75 Y2.0 10 J1.25 (BLOCK 2 OF 4)
G02 X2.0 Y3.25 11.25 JO (BLOCK 3 OF 4)
sitions. This a typical application of one block program-
G02 X3.25 Y2.0 10 J-1.25 (BLOCK 4 OF 4)
ming of a full circle - Figure 29-6.
GOO Z0.1
Figure 29-6
blocks, not four, and the XY coordinates of the start point of
the arc (shown as xs and vs distances), will have to be calcu-
Full circle programming using one block of program entry
lated using trigonometric functions - Figure 29-8:
G90
G01
G54 GOO X3.25 Y2 0 S800 M03
Z-0.25 F10.0
.
xs
—
f— — START
G02 X3.25 Y2.0 1-1.25 JO F12.0 (FULL CIRCLE) 1 POINT
GOO Z0.1
L
Older controls do not allow a circular interpolation in
more than one quadrant per block. In this case, the circular i
o
T
• -
V
.
33° ;
• ;
ys
I
motion has to be divided among four or even five blocks,
depending on the starting tool position. Using the previous
2.00
drawing example, the resulting program will be a little lon- ^ Vi/
R1.25
ger, but with the same results - Figure 29-7:
T
— 2.00 -
Figure 29-8
Figure 29-7 Values x< and y. were calculated by the following trigono-
Full circle programming using four blocks of program entry metric functions:
G90 G54 GOO X3.25 Y2.0 S800 M03 ^ = 1.25 x cos33 = 1.0483382
ys = 1.25 x sin33 = .6807988
242 Chapter 29
From the results, the start point of the cut can be found: Boss Milling
quire the I and J arc center vectors only - the R radius value
cannot be used in this case. The reason is that I and J
vectors are always unique in their meaning, the radius R
designation can be ambiguous. The following example is
correct, using the I and J arc vectors:
N12 M30
%
Program 02902 shows both the arc start point and end
point at 90°, programmed at 12 o’clock position. The cutter
radius offset started during the motion from the arc center.
Alternate applications may include multiple roughing last example will not be practical when smooth blend be-
passes, a semifinishing pass, two cutting tools and other se- tween the approach and the circular cut is required. To im-
lections related to machining.
prove the surface finish, the start position of circular mo-
tion can be reached on an arc. The usual startup is from the
Internal Circle Cutting - Linear Start center, first at a 45° linear motion, to apply the cutter radius
on an arc that blends with the full circle. The
offset, then
Internal full circle cutting is common
and has many ap- Figure 29-13 illustrates the principle and program 02303
plications, such as circular pockets or counterbores. In an shows the complete program.
example, a 0
1 .25 circular cavity is to be machined to the
0.25
r A
"T
I 01.25 — ^/y
Figure 29-13
02903
(0.5 DIA CENTER END MILL)
Figure 29-12 N1 G20
N2 G17 G40 G80
Internal circle cutting - linear approach only
N3 G90 G54 GOO XO YO S900 M03
02902 N4 G43 ZO.l HOI
(0.5 DIA CENTER END MILL) N5 G01 Z-0.25 F10.0 M08
N1 G20 N6 G41 XO 3125 Y0.3125 D01 F12.0
.
This programming method is slightly longer, but the sur- What is not true in any other circular application, is true
face finish quality with a circular approach is much better in this situation. In normal programming of arcs and cir-
than with the linear approach. cles, a cutter radius offset cannot start in an arc tool motion.
In G 2/G 3 programming mode, the start motion from the
1 1
Circle Cutting Cycle On some Yasnac CNC models, there is an additional pa-
rameter in the G12/G13 format - the radius parameter, or
Several controls, for example some Yasnac or Mitsubishi, the R parameter. This indicates special rapid motion por-
but not Fanuc, have a built-in routine (cycle) to cut a full in- tion, designed to reduce air cutting time.
ternal circle using special preparatory commands, typically
G12 and G13. These cycles are very convenient program- G
As an example of 1 2/G 1 3 programming, the earlier cir-
ming aid and to the surprise of many programmers, Fanuc cular pocket, illustrated in Figure 29-14, will be used.
dropped this feature many years ago.
ARC PROGRAMMING
Note that the Y coordinate is the same for the arc start and
G01 X10.5 Y8.625 F17
end position. T he Y value in the circular motion block does
.
Another example shows programming an arc of 270°, If frequently programming arcs that cover more than
still using the R address. Are the following blocks correct?
180°, establish a particular programming style. If the style
is well thought out, it will avoid the costly mistakes associ-
Programmers do not normally think of these mathemati- Many programmers do not consider the machined radius
cal alternatives, until they program arcs larger than 180° when selecting the cutting feedrate for the tool. Yet, if the
(or scrap a part). This is a similar situation to that of a full machined surface always
finish quality is really important,
circle,described earlier. Although the I and J vectors can be consider the size of every radius specified in the part draw-
used to remedy the problem, a different remedy may be a ing. Perhaps the same feedrate for linear and circular mo-
preferred choice. The R address can still be used in the pro- tions programmed so far may have to be adjusted - either
gram, but with a negative sign for any arc that is greater upward or downward.
than 180°. For arcs smaller than 180°, the usual positive R
radius remains in effect. Recall from some earlier explana- In lathe programming, there is no reason to distinguish
tions that if there is no sign with the R word (or any other
between linear and circular tool motions, regardless of the
word), the word assumes a positive value. Compare the two radius size. The tool nose radius is usually small, only aver-
programming examples: aging .0313 inches (or 0.8 mm) and the equidistant tool
path is close to the programmed tool path, taken from a
G01 X10.5 Y8.625 F17 .
drawing. This is not the case for milling contour program-
G02 X13.125 Y6.0 R2.625 (90 DEGREES) ming, where large tool radii are normal and common.
246 Chapter 29
The adjusted arc feedrate is not required in every pro- Two formulas provide the tools to find the adjusted arc
gram. If the cutter center tool path is close to the part draw- feedrate, mathematically equivalent to the linear feedrate.
ing contour, no adjustment is needed. On the other hand, Both formulas are recommended for external or internal
when a large diameter cutter is used to contour a small out- contouring only, not for rough machining of solid material.
side radius, a problem that affects the surface finish may
occur. In this case, the tool center path generates a much Feedrate for Outside Arcs
longer arc than one in the drawing. In a similar situation, if
For outside arcs, the adjusted feedrate will be higher than
a large cutter diameter is used for an inside arc, the equidis-
the linear feedrate, calculated from this formula:
tant path will be much shorter than the original arc length.
tively large cutter diameter, such as 0.625 (15.875 mm) or The result is a major increase, to F23.3 in the program.
larger, the linear feedrate adjustment up or down for circu- Consider the same example with .75 cutter radius (01.5):
lar motion may be necessary to maintain good finish.
F, x (R - r)
An outside arc of a tool path is longer than the drawing arc Fi = 14 x (.8243 - .625) / .8243 = 3.384932
247
248 Chapter 30
! PI XO Y0
l
P2 XO Y1.125
1.125
> R0.625
P3
P4
X2.25
X2.25 Y0.625
— 2.25 -
Pb XI. 625 Y0
Figure 30-2 Once all the coordinates are completed, there is enough
Sample drawing for manual calculations Iexamples data to start the tool path, but only if the cutter radius offset
feature is used. However, that is not the intention at the mo-
Note that there arc five points on the drawing, one at each ment. To illustrate, a whole new set of points has to be
contour change. These points are either intersections or
found - coordinates for the center of the cutter!
points of tangency. As each point has two coordinates, total
Figure 30-3
small! The same procedure is used when cutting a board
with a saw - the saw width has to be compensated.
Contour change points required by the cutter path
Equidistant tool path - cutter center coordinates required Contour change points for the cutter center path
In the program, the old set of points will be used to calcu- Figure 30-7 shows the details of point P2 calculation. The
late a new set of points. Again, try to see which points are trigonometry method itself is a subject programmers have
easy to calculate and establish them first. to know how to work with - it is part of mathematics, ex-
tended to CNC programming. A similar calculation is re-
For example, what are the XY coordinates of point PI? It
quired for P3, shown in Figure 30-8.
is easy to see that the new PI has the value of cutter radius
in the X minus and also the value of cutter radius in the Y
minus direction, from the old PI The actual value for any
.
Cutter Radius
At the moment, it is still too soon to write the program. The Type C cutter radius offset - the look ahead type (also
This section can be closed with the table of the new points, called the intersectional type) - is the one that is used on all
representing the center of 0.750 cutter but none other'. modern CNC systems today. There is no need to call it Type
C anymore, as there are no other types available.
Point No. X coordinate Y coordinate
Definition and Applications
PI X-0.375 Y-0.375
Cutter radius offset is a feature of the control system that
P2 X-0.375 Y1.3975
allows programming a contour without knowing the exact
P3 X2.625 Y2.3722 diameter (radius) of the cutter. This very sophisticated fea-
ture performs all necessary calculations of contour change
P4 X2.625 Y0.625
points, based on three items:
P5 XI. 625 Y-0.375
Points of the drawing contour
There is a single digit 1 used in the calculations. It may Specified direction of the cutter motion
raise a question where it came into the equation. It repre-
Radius of the cutter stored in the control system
sents the value of sin90°, which is And that little triangle
1 .
in front of the Y - it is a symbol for the Greek word ‘delta’, In practical programming - and machining - this feature
often used in mathematics to represent an increment, a vec- allows the CNC programmer to develop a program without
tor, or a distance. knowing the exact cutter diameter at the time of program-
ming. It also allows the CNC operator to adjust, to fine
COMPENSATED CUTTER PATH tune, the cutter size in the control system (nominal, over-
size or undersize), during actual machining. In practical
terms, using cutter radius offset (and tool nose radius offset
The previous examples are typical to theprogramming
on lathes) should be considered for a number of reasons:
methods used on the early numerical controls. These con-
trols (normally of the NC type, not CNC), had no cutter ra- Unknown exact size of the cutter radius
the program
J Specified direction of the cutter motion
Type A offset - oldest - uses special vectors in
to establish the cutting direction (G39, G40, G41, G42). Radius of the cutter stored in the control system
not so obvious. It is also true for other types of CNC ma- Cutter path direction as it relates to a stationary part contour:
chines, such as wire F.DM, laser cutting machines, waterjet la - b) No motion direction shown - left and right is unknown
I c - d) Cutter positioned to the LEFT of the contour
cutters, flame cutters, etc. When it comes to the so called (e - f) Cutter positioned to the RIGHT of the contour
direction clockwise versus counterclockwise, a closer look
is necessary.
Offset Commands
Left or Right - not CW or CCW
In order to program one or the other mode of cutting (cut-
The first thing to take care of is to eliminate the mislead- ting direction), there are two preparatory commands avail-
ing terms clockwise and counterclockwise. These terms are able to select the cutter radius offset direction:
reserved exclusively for circular interpolation and have no
place in discussion of the cutter radius offset. Instead, the Offset (compensation) of the cutter radius
more accurate terms Left and Right are used for clarity.
G41
to the LEFT of the contouring direction
Just like in everyday situations, when faced with the di- Offset (compensation) of the cutter radius
G42
rectional terms left and right we determine the correct po-
,
to the RIGHT of the contouring direction
In terms of the milling method, G41 command is applied The answer to the last question is - in the control system
to the climb milling mode, G42 command is applied to the area called offset settings. We are already familiar with the
conventional milling mode. This is true only if the spindle on the control unit). These terms
offset areas (offset screens
rotates with M03 function active (spindle CW) and the cut- have been used for the Position Compensation, the Work
ter is right hand. If the cutter is left hand, the spindle must Offsets and the Tool Length Offset (discussed in earlier
rotate with M04 function active (spindle CCW) and all Chapters 17 to 19 respectively). Now is the time to look at
rules applying to cutter radius offset are the exact opposite the control offsets in more depth and emphasize their rela-
of those discussed here. There is no cutter radius offset ap- tionship to the compensation of the cutter radius. Although
plied when G40 command is in effect. this topic may appear to be aimed at the interest of the CNC
operator, the programmer has to understand the same prin-
Figure 30- 1 shows the G41 command as a climb milling ciples equally well, if not in even more depth.
mode and G42 command as a conventional milling
the
mode. Climb milling mode is the most common in CNC History of Offset Types
milling, particularly in contour milling.
Fanuc controls have developed over the years, and be-
cause of their reliability and popularity, many of the older
models are still in use by machine shops. To understand the
offsets and their application, it is important to know what
type of offset the Fanuc control has. The rule of thumb is -
as expected - the lower level or the older the control is, the
lower the flexibility, and vice versa. Notice the word flexi-
bility - it is
not the quality that is lower or higher - just the
llexibility. Differences are categorized as Offset Memory
Types. There tire three memory types on Fanuc systems:
Climb milling and conventional milling mode for Do not confuse these tool offset memory types with the
a right hand cutter and the spindle rotation mode M03 cutter radius offset types!These offset types determine how
the tool length offset and the cutter radius offset will be en-
Radius of the Cutter tered into the control system and nothing else. Work offsets
G54 to G59 are not affected.
The benefit of the cutter radius offset that allows to pro-
gram the tool path as if the part contour were the required Tool Offset Memory Type A
cutter path, does not mean the cutter radius should be either
forgotten or ignored during programming. The logical The Type A tool offset is the lowest level available. Its
The Type C offset group offers the most flexibility. It is With the three types of Tool Memory Offset, it is reason-
the only offset type available that separates the tool length able to expect somewhat different programming methods
values from those of the tool radius. It still keeps the dis- for each type. Up to a point, this is true.
ical appearance of each Offset Memory Type (all shown Many cutting tools do not require the cutter radius offset in
with zero values). The actual appearance may be slightly the program, but all cutting tools require the tool length off-
different, depending on the control model. set in the program. If a particular cutter requires both tool
length offset number and cutter radius offset number, two
different offset numbers from the same offset range must be
Offset
Offset used in the program and stored in the control register. That
No.
is the reason these offsets are called shared offsets.
01 0.0000
02 0.0000 For example, programmed tool T05 requires both offsets,
03 0.0000 which obviously cannot have the same offset number. The
solution is number as the tool length offset
to use the tool
number and number by 20, 30, 40, or so, for
increase that
Offset Geometry the cutter radius offset. The entry for the Type A in the off-
No.
Wear
set screen could be similar to the one in Figure 30-14
01 0.0000 0.0000
02 0.0000 0.0000
Offset
03 0.0000 0.0000 Offset
No.
05 -8.6640
Offset H-offset D-offset
No. Geometry Wear Geometry Wear
35 0.3750
01 0.0000 0.0000 0.0000 0.0000
02 0.0000 0.0000 0.0000 0.0000 Figure 30- 14
03 0.0000 0.0000 0.0000 0.0000
Shared offset register screen for tool offset memory Type A
Figure 30-15
G41 X. .. D.. or.. Shared offset register screen for tool offset memory Type B
G42 X. ..
D. . or..
The Type C offset will have two pairs of columns. Since
G41 Y. D. . or..
.
the tool length and the tool radius have each their own col-
G42 Y. ..
D. .
umns, the same offset number can be used for both - there is
no need for the 20, 30, 40 or so, increment. In this case, the
The inclusion or exclusion of the tool motion and how
H address is reserved for the tool length offset number and
many axes can be used at a time will be discussed in this
the D address is reserved for the cutter radius offset num-
chapter as well. First, let’s resolve the question of which
ber. Figure 30-16 shows an input logically corresponding
address to use and when. The H address or the address? D to the Type A and the Type B:
254 Chapter 30
Offset H-offset D-offset The cardinal rule number two is also simple and is based
No. Geometry Wear Geometry Wear on the adherence to the first rule:
Similar to the application of geometry and wear offsets What clearances are required?
for tool length offset, described in Chapter 19, the identical
Which direction will the tool take?
general rules can be used for the cutter radius offset.
Is there no danger of collision?
Offsets entered in the Geometry offset column should
only contain the nominal cutter radius. In the examples, we Can other diameter cutter be used if needed?
have used a 0.750 cutter, with the radius of 0.375. That is
How much stock is to be removed?
the nominal value and that would also be the typical value
Geometry offset column. The Wear offset
entered into the The same drawing used already will be used for this ex-
column should only be used for adjustments, or fine tuning, ample as well and the cutter radius offset will be applied to
nominal size, as required during setup and/or
relative to the the contour. To turn the offset on, to make it effective, the
machining. There is no separate column for adjustment or cutler will be away from the actual cutting area, in the clear.
2. tuning for the Type A offset. Adjustments can still be
fine The intended cutter is 0.750, the climb milling mode is de-
made,
3. the only difference is that the value in the single col- sired, and .250 clearance is away from the contour. With
umn
4. will always change with each adjustment, even if it these numbers, the start position is calculated at X-0.625
represents the cutter radius. Y-0.625. Figure 30-17 shows the start position that satisfies
all rules and answers the questions established earlier.
Startup Methods
Of course, the suggested location is one suit-
not the only
Starting up the cutter radius offset is much more than us- able, but it is just as good as other Note that
possibilities.
ing the G4IX..D.. in the program (or something similar). the cutter located at the position X-0.625Y-0.625 is not
Starting up the offset means adherence to two cardinal rules compensated, the coordinates are to the center of the cutter.
and several important considerations and decisions. The Once the start location is established, the first few blocks of
cardinal rule number one is simple - it relates to the start po- the program can be written:
sition of the cutter:
03001 (DRAWING FIGURE 30-2)
Always select the start position of the cutter N1 G20
away from the contour, in the clear area N2 G17 G40 G80
N3 G90 G54 GOO X-0.625 Y-0.625 S920 M03
CUTTER RADIUS OFFSET 255
N4 G43 Z1.0 HOI The last possibility - option (c) - is also simple and re-
N5 G01 Z-0.55 F25.0 M08 (FOR 0.5 PLATE THICK) quires only two motions:
N6 ...
N. . G01 G41 X0 Y0 D01 F15.0
For extra safety, the approach to the depth of Z-0.55 N. Yl. 125
. (P2)
(based on a Z2 inch plate thickness) was split into two mo- N
tions, although the cutter is safely above the clear area.
Once the depth has been reached, the first motion can be In all three versions, the cutter radius offset is started to-
programmed. The cutting direction is to the left of the part gether with the first motion while ,
still away from the actual
(climb milling) and the G41 command is used. Moving the part contour. Because the option (c) actually ends on the
tool around the part on the means the first target
left side, part, selecting the option (a) is the preferred programming
point on the part has to be the X0Y1.125 location. How- method of the lead-in. A combination of (a) and (c) is also a
ever, this position cannot be reached directly, because the good choice, with the Y axis target in the negative area.
left side of the part has to be machined as well. That means
the tool has to reach the X0Next decision is
position first.
Once the offset has been turned on, the contour change
selecting the Y position, to get the target point. Normally,
points can be programmed along the part and the control
this is done by programming a so called lead-in motion, or
computer will do its work by constantly keeping the cutler
properly offset at all times. The program 03001 can now
a cutter entry motion.
be extended up to point P5 in the original illustration:
Figure 30-18 shows some possibilities, all of them cor-
rect and all reaching the X0Y1.125 location eventually. 03001 (DRAWING FIGURE 30-2)
Which one is the best? Here are some possible options: N1 G20
N2 G17 G40 G80
N3 G90 G54 GOO X-0.625 Y-0.625 S920 M03
N4 G43 Z1.0 HOI
N5 G01 Z-0.55 F25.0 M08 (FOR 0.5 PLATE THICK)
N6 G41 XO D01 F15.0 (START OFFSET)
N7 Yl 12 5 . (P2)
N8 X2.25 Yl 8561 . (P3)
N9 Y0.625 (P4)
N10 G02 XI. 625 YO R0.625 (P5)
Nil G01 X.
At block N10, the tool has reached the end of the 0.625
radius. The contouring is not yet finished, the bottom side
has to be cut, along the X axis. The question is - how far to
cut and when to cancel the cutter radius offset?
Possible lead-in motions to apply the cutter radius offset This is the last cut on the part, so it has to be machined
while the offset is still in effect! The cutter can end at XO,
The (a) option is simple - the tool moves towards the X0 but that is not a practical position - the tool should move a
and the cutter radius offset is turned on during that mo-
first bit farther, still along the X axis only. How far is further?
tion.Then, the tool continues towards the first target point Why not to the same X-0.625, the original start position?
(Y1.125), already in the compensated mode. This is not the only clearance position available, but is the
safest, most reliable and consistent. The block N 1 1 will be:
These two motions will appear in the program as:
The option (b) is technically correct, but requires three shortly, but a little review of the startup may help.
control system offset registry. The speeds and feeds may Finally, the program 03001 is completed. There was no
have to be adjusted, if necessary. We will look later at what need for any change of the tool direction - such an change is
exactly happens when the cutter radius offset is applied. rather a rare occurrence, at least for contouring operations
using milling controls. Since the directional change may be
The general rule to establish the start position is that it
needed in the future, some comments may be useful.
should always be selected with a clearance that is greater
than the radius of the largest cutter that may be used. This Cutter Direction Change
clearance may be increased for a large stock left on the ma-
terial or for a tool that is above average diameter. In order to During a normal milling cut, there will seldom be a need
complete the program, let’s look at methods of canceling to change the cutter offset direction from left to right or
the cutter radius offset, when it is no longer needed. from right to left. If it does become necessary, the normal
practice is to change from one mode to the other without
Offset Cancellation canceling the G40 command. This practice is seldom used
in milling, because change from G41 to G42 would also be
A lead-in motion has been used at the startup of the cutter a change from the preferred climb milling to the less pre-
radius offset. To cancel the offset, a lead-out motion will be
ferred conventional milling. However, it is quite common
used. The length of the lead-out (just as the length of the in CNC lathe programming, with examples shown later.
lead-in) has to be somewhat greater than or at least equal to
the cutter radius. The lead-in and the lead-out motions are
also called ramp-in and ramp-out motions.
HOW THE RADIUS OFFSET WORKS
The safest place to cancel cutter radius offset, for any ma- Being able to program from given examples is certainly a
chine, is away from the contour just finished. This should
good way to learn. Learning by a recipe or a sample does
always be a clear area position. The start position can also help in many cases, but it will not help much in cases where
be the end position. Figure 30-19 shows the offset cancella- there is no sample, no recipe, and no example. In those
tion in the example. Program 03001 can be now be written. cases, it is critical to really understand all principles behind
the subject, such as principles of the cutter radius offset.
The startup method is a good beginning. Next question is -
what does happen during the tool motion in block N6?
Figure 30-1
Yes, there are two possibilities and they are both correct! How docs the control handle such requirement? Controls
Both versions compensate the cutter to the left of XO target C have a built-in feature
using the cutter radius offset Type
position. The conditions specified in block N6 have been called the '\ook-ahead'lype of cutter radius offset
fully satisfied - the cutting tool moves to XO as expected,
the offset turned on to the left of the part contour, during
is
The look-ahead feature is based on the principle known
the motion, using the radius value stored in the offset regis- as buffering or reading-ahead. Normally, the control pro-
ter D01 So what is the problem? cessor executes one blockat a time. There will never be a
motion caused by any buffered block (next block).
The situation is ambiguous. There are two possible out-
is required. Which one? For this job,
In a short overview, this is the sequence of events:
comes, while only one
the one in the left part of the illustration, one where the tool The control will first read the block containing the
moves along the Y+ when the radius offset
direction next, startup of the cutter radius offset (that is the block N6)
has been applied. This is the key! The motion direction that
follows G4I or G42 block must be known to the control.
The control detects an ambiguous situation,
and does not process the block as yet
Look at two different ways the program can be written:
The control advances the processing to the next block
O Example 1 - Figure 30-21 left (that is N7), to find out into which direction
the tool will be programmed next
The next target position after N6 is Y positive direction:
During the 'next block reading', there is no motion at all -
N3 G90 G54 GOO X-0.625 Y-0.625 S920 M03 the control will only register the direction towards the
target point and applies the radius offset on the correct
N6 G41 XO D01 F15.0 (START OFFSET) side of the part contour, during the startup block
N7 Yl. 125 (POSITIVE Y-MOTION FOLLOWS) (N6 in the example)
O Example 2 - Figure 30-21 right This look-ahead type of the cutter radius offset is very
advanced internally in the software, but makes the contour
The next target position after N6 is Y negative direction: programming so much easier on a daily basis. As maybe
expected, there are some situations to be aware of.
N3 G90 G54 GOO X-0.625 Y-0.625 S920 M03
Rules for Look-Ahead Cutter Radius Offset
N6 G41 XO D01 F15.0 (START OFFSET)
N7 Y- 1.125 (NEGATIVE Y-MOTION FOLLOWS) Look at thefollowing sample program selection, not re-
lated to any previous examples:
In both cases, the content of block N6 is the same, but the
motion that follows the N6 is not - Figure 30-21. O Example - single NO MOTION block :
can be justified, there is nothing wrong with it. The fact re-
Uncomfortable, perhaps - but not wrong - this time there 03002 (PROGRAM WITH RADIUS OFFSET ERROR)
are two consecutive blocks following the cutter radius off- N1 G20
set - two consecutive blocks that do not include any motion. N2 G17 G40 G80
N3 G90 G54 GOO X-0.5 Y-0..5 SHOO MO
Both examples present a program that might be fine if the N4 G43 Z1.0 HOI
radius offset were not applied. With an offset in effect, such N5 G01 Z-0.55 F20.0 (FOP. 0.5 PLATE THICK)
N6 G41 XO D01 F12.0 (START OFFSET)
a program structure can create problems. Controls with the
N7 MO 8 (NO MOTION BLOCK)
‘look-ahead’ feature can look ahead only so many blocks. N8 GO 4 P1000 (NO MOTION BLOCK)
If the control has the feature, one block look-ahead is al- N9 Y2.5 (MOTION BLOCK)
ways there. There are two or more look-ahead blocks avail- N10 X3.5 (MOTION BLOCK)
able. It all depends on the control features, and not all con- Nil YO (MOTION BLOCK)
trols are the same. Here are some basic suggestions: N12 G01 X-0.5 (MOTION BLOCK)
N13 GOO G40 Y-0. (CANCEL OFFSET)
If the control has a look-ahead type cutter radius N14 Z1.0 MO 9
offset feature, but the number of blocks that can be N15 G28 X-0.5 Y-0. 5 Z1.0
processed ahead is not known, assume it is only one block N16 M30
%
Make a test program to find out how many blocks
the control can read ahead
A control that can read only one or two blocks ahead will
Once the cutter radius offset is started in the program, not process program 03002 correctly - the next motion is in
try hard not to include any non-motion blocks - restructure the third block when the offset is in effect. In order to avoid
the program, if necessary an incorrect tool motion, avoid any program structure that
contains more than one no-motion block.
Keep in mind that the control subjects the program input
to the rules embedded in the software. The correct input
Radius of the Cutter
must be provided first, in the form of an accurate program.
Every milling cutter has a diameter and one half of that
What kind of a response can be expected if the cutter ra- diameter is the cutter radius. With new tools, the radius is
dius offset is programmed wrong? Probably a scrap of the always known and is sufficiently accurate. The accuracy of
part. If the control system cannot calculate the offset cutter the radius depends on the cutter quality as well as on the
position, if the offset were not programmed at
will act as
it
way mounted in the machine spindle. A run-off of .001
it is
all. That means, the initial tool motion will be towards the or .002 inches may not be a problem for roughing opera-
X0 with the cutter center. When the necessary information
tions, but for a precision finish, much higher accuracy is
is passed on be applied, usu-
to the control, the offset will
needed. Also needed is a way to correct for a tool wear, or
ally too late, after the cutter has entered the part. Scrap is
even a slight tool deflection. All this is done through the D
the most likely result in this case. Such an incorrect pro-
offset number, used as a pointer to the actual radius amount
gram is shown in Figure 30-22: stored in the control register.
Tool path error due to wrong program structure - program 03002 and two, where the cutter radius
travel, is larger than the
programmed length of the tool travel.
There are two no-motion blocks in the program example
Figure 30-23 shows a start position of a cutter that has the
03002 that cause this error. They are after the cutter radius
same programmed length of travel as the cutter radius. This
offset had been applied - in blocks N7 and N8. If the control
is certainly allowed, but definitely not recommended. The
system can look ahead only a single block, the program is
reason is it of adjustments that can be made
limits the range
wrong and the corrupted tool path shown in the above illus-
to the actual cutter radius during machining.
tration will be the result.
CUTTER RADIUS OFFSET 259
Cutter start position is equal to the cutter radius control does not. The engineers who designed the software
could have taken a number of actions; yet, they wisely de-
The following example results in a .375 travel length as cided to play it safe. They have decided to let the control
programmed along the X axis. If the D01 amount is less system to reject this possibility and issue an alarm. De-
than .375, there will be a motion toward XO. If the D01 pending on the control system, the alarm 'Overcutting will
amount is equal to .375, the difference between the pro- occur in cutter radius compensation C' or 'CRC interfer-
grammed length and the actual length is zero and there will
ence’ ox a similar message will appear - the common alarm
not be any motion along the X axis. In that case, the offset number for this error is No. 041 on Fanuc control systems.
of the radius takes place without a movement and the mo- Many programmers, even with a long experience, have ex-
tion to the target position Y 1.1 25 will continue. perienced this alarm. If not, they were either very fortunate
or have never used cutter radius offset in the program.
N3 G90 GOO G54 X-0.375 Y-0.625 S920 M03
Anytime the cutter radius interference alarm occurs, al-
N6 G41 XO D01 F15.0 (START OFFSET) ways look at the surrounding blocks as well, not just at the
N7 Y1.125 (P2)
one where the control stops processing.
Try to avoid situations like this one - although logically In the next section, we look at the cutter radius interfer-
correct, they do not provide any flexibility and can cause ence that occurs during a tool motion, not just at the startup
serious difficulties at some time in the future. or termination of the cutter radius offset.
~"
Scale 1:1
R0.20
“*• 100
03003 (DRAWING FIGURE 30-25) Since the drawing dimension cannot be changed, the size
N1 G20 of the cutter diameter must be changed, to a cutter diameter
N2 G17 G40 G80 that is less than .500 inches. The other drawing radius of
N3 G90 G54 GOO X-0.625 Y-0.625 S920 M03
.200 is no problem, as external radii can have any size.
N4 G43 Z1.0 HOI
N5 G01 Z-0.55 F25.0 M08 (FOR 0.5 PLATE THICK)
The Fanuc controls will not allow gouging in cutter ra
N6 G41 XO D01 F15.0 (START OFFSET)
dius offset Type C. This feature is built-in and there is no
N7 Y0.925
opportunity to see what would actually happen, if the pro-
N8 G02 X0.2 Y1.125 R0.2
N9 G01 XI. tection were not there. Nobody wants to see the gouging on
N10 Y0.75 the part, but the Figure 30-26 shows the same effect graphi-
Nil G03 XI. 25 Y0.5 R0.25 cally. In fact, this was a real error in the earlier forms of cut-
N12 G01 XI. 75 ter radius offsets Type A and Type B.
N13 YO
N14 X-0.625
N15 GOO G40 Y-0.625 (CANCEL OFFSET)
N16 Z1.0 MO
N17 G28 X-0.625 Y-0.625 Z1.0
N18 M30
%
What has happened? There is nothing wrong with the Single vs. Multiaxis Startup
program at all. Most CNC operators would look at the pro-
There is another possible problem during cutter radius
gram and check it. Aftercareful study, if they find it correct,
offset startup, particularly if programming the startup mo-
the cause of the problem must be somewhere else, outside
tion along two axes, rather than the suggested single axis.
of the program. Try not to blame the computer and don’t
waste any more time once you are satisfied that the pro-
We had look at this possibility for an external cutting, with
.375 is stored there. That is also OK for the tool in the spin- Evaluate the two approach methods in Figure 30-27, us-
dle. Check the drawing next. That is OK too. So while ev- ing a cutter radius offset startup towards an internal profile,
erything seems OK and there is still a radius offset alarm on for example, a wall of a pocket or other internal contour.
the screen, do the next logical step.
amount
also requires a fair of experience as well. In the pro-
gram example 03003, the problem is in the relationship of
the stored offset amount and the drawing dimension.
Correct approach Incorrect approach
Study the drawing carefully - there is an internal corner
radius of .250 while the offset is set to the cutter radius of Figure 30-27
.375. This larger stored radius is expected to fit into the .250 Possible problem in cutter radius offset mode during a startup
part radius. Obviously, it cannot - hence the alarm. with two axes simultaneously Iinternal cutting shown)
CUTTER RADIUS OFFSET 261
O Correct approach - single axis motion : Here are the first few correct blocks of each method:
The correct programming approach shown on the left O Correct approach - single axis motion :
N8 YO 75 .
The incorrect motion approach shown on the right side of Note that in cases of the cutter radius offset for an exter-
the illustration contains the following initial blocks: nal contour, both programs listed are correct, because there
appears to be no interference with any section of the part. In
N1 (INCORRECT APPROACH WITH TWO AXES)
G20 fact, there is the same interference as in the internal milling
N2 G40 G80
G17 example - the only difference is that this type of ‘interfer-
Compare the two possible startups for the drawing shown OVERVIEW OF GENERAL RULES
in Figure 30-2 , earlier in the chapter. If the radius offset is
[
M-T ]
Never start or cancel the radius offset in an
[
M-T ]
Make sure the cutter radius is always smaller
than the smallest inside radius of the part contour.
l
M-T 1
In the canceled mode G40, move the cutter to a
clear area. Always consider the cutter radius, as well as
all reasonable clearances.
Figure 30-28 [
M-T Apply the cutter radius offset with the G41 or
]
Startup of the cutter radius offset for external cutting: G42 command, along with a rapid or a linear motion
Single axis approach - shown on the left to the first contour element (GOO or G01 in effect).
[
M ]
Reach the Z axis milling depth in the G40 mode
n\-j n+0.002 /-xq c+0.002 n 7R
(cutter radius offset cancel mode). 02.O. oooo 02.5.QOOO
l
M-T] Give the preference to a single axis approach
from the startup position.
[
M ] Do not forget the offset number D.. for in the
program - it is a small error that can cost you a lot.
(
M-T ]
Make sure to know exactly where the tool
command point will be when the radius offset is applied
along two axis.
[
M-T ]
In the compensated mode (G41 or G42 in effect),
[
M-T ]
Cancel cutter radius offset with the G40 command, 0.375
along with a rapid or a linear motion (G00/G01) only, 3 x 3 x 3/4 AL PLATE
preferably as a single axis motion only. 1-7/8 CORE DIAMETER
[
M ]
Retract from the depth (along the Z axis only) Figure 30-29
after the radius offset has been canceled.
Drawing to illustrate practical application of a cutter radius offset
[
M ]
Make sure the cutter radius offset corresponds
to the work plane selected (see Chapter 31 ).
The focus will be on the specified tolerance in the draw-
ing as being +.002/-.000, for the dimensions of the two dia-
[
M-T ]
G28 or G30 machine zero return commands will
meters - the 02.5 external and 02.0 internal. Note that the
not cancel the radius offset (but either one will cancel
range of all dimensional tolerances is the same for both dia-
the tool length offset).
meters. This statement will be very important later.
[
M-T )
G40 command can be input through the MDI to
cancel the cutter radius offset (usually as a temporary Measured Part Size
or an emergency measure).
Every experienced machinist knows that the actual mea-
sured size of the part depends on many factors, such as the
PRACTICAL EXAMPLE - MILLING rigidity of setup, cutting depth, material being used, cutting
direction, the selection of tool, its exact size, and so on.
The following in-depth example attempts to present a
practical application of the cutter radius offset to both the When a part is measured
inspected, the size can have only
CNC programmer and the CNC operator. It covers virtu- one of the three possible outcomes:
ally all situations that can happen during the machining
Right on size ... within specified tolerances
process and presents solutions to maintaining the required
dimensions of the part. The first subject that has to be well Oversize ... will be scrap for internal cutting
the drawing. Implied tolerances are often company estab- additional two items that also have to be considered:
lished standard that are based on the number of decimal
places used for the dimensions (a method on the decline).
External cutting method ... known as Outside or OD
Internal cutting method ... known as Inside or ID
The next example focuses strictly on the effect of cutter
radius offset on the part size in the XY plane (top view). For Because the cutting tool approaches the machined con-
that reason, only a simple application is presented, with the tour from different directions, the terms oversize and un-
simplest tool path, but not necessarily the best machining dersize are always relative to the type of cutting. The fol
method. Figure 30-29 shows the drawing. lowing table shows the most likely results:
CUTTER RADIUS OFFSET 263
Programmed Offsets
N1 G20
N2 G17 G40 G80
N3 G90 G54 GOO XO Y2.5 S600 MO 3 (START POS.)
N4 G43 Z0.1 HOI MO (CLEAR+TOOL LG.)
Detail for internal tool path shown in example 03004
N5 G01 Z-0.375 F20.0 (DEPTH FOR 2.5 DIA)
N6 G41 Y1.25 D01 F10.0 (APPROACH MOTION)
(EXT. CIRCLE CUTTING)
As is customary in CNC programming and is also used in
N7 G02 J-1.25
N8 G01 G40 Y2.5 (RETURN MOTION) program 03004, the tool path uses the drawing dimensions
N9 GOO Z0.1 (CLEAR ABOVE) and the other positions defined by the programmer. This is
not only the standard but also the most convenient method
(**** PART 2-2.0 DIA INTERNAL CUTTING **** ) to develop a CNC program. Such a program is easy to un-
N10 YO (START POS. AT XOYO) derstand by the machine operator, drawing dimensions are
Nil G01 Z-0.8 F20.0 (DEPTH FOR 2.0 DIA) easy to trace (if necessary) and changes can be made, if
N12 G41 Y1.0 Dll F8.0 (APPROACH MOTION) required. In plain language, the programmer ignores the
N13 GO 3 J-1.0 (INT. CIRCLE CUTTING)
cutter radius and writes the program as if the cutter were a
N14 G01 G40 YO (RETURN MOTION)
(CLEAR ABOVE) point -
in effect, a cutting tool with a zero diameter.
N15 GOO Z0.1 MO 9
N16 G28 Z0.1 MO (Z AXIS MACHINE ZERO)
N17 M01 (OPTIONAL STOP) D Offset Amount - General Setting
Figure 30-30 shows the tool path for the first half of the not usually used, except for some engraving work. The ma-
program - the external diameter of 2.500 inches. Figure jority of cutting tools do have specified diameters and the
30-31 shows the tool path for the second half of the pro- actual diameters have to be always considered - if not in the
gram - the internal diameter of 2.000 inches. program, then on the machine.
264 Chapter 30
One critical fact to be established first is that the CNC dius offset commands G4 1 or G42 as well as the D address
system always calculates a specified offset by its cutter ra- offset number - with the appropriate cancellation by G40.
dius , not by its diameter. It means the programmer provides
the cutter radius offset in the form of a D address. On the Evaluating what exactly happens during the tool motion
machine, the programmed offset D01 will apply to the cut- for each cutting method ( external or internal) offers certain
although all internal calculations arc still set by the radius. Offset Adjustment
Evaluate program 03004; what will be the stored amount Before any special details can be even considered, think
of D01? A 0.750 inch end mill is used, so the D01 should about how the offset amount can be changed. In those cases
be set to .375. This is correct in theory, but factors such as where the size of the part is to be adjusted, the incremental
tool pressures, material resistance, tool deflection, actual change of the offset value is a good choice. Incremental
tool size, tool tolerances and other factors do influence the offset change means adding to or subtracting from the cur-
finished part size. The conclusion is that the D01 registered rent offset amount (using the +INPUT key on a Fanuc
amount can be .375, but only under ideal conditions. screen) or storing the adjustment in the Wear offset screen
column. Changes to the program data is never the option.
Ideal conditions are rare. The same factors that influence
machining have a significant effect on part dimen-
will also
Offset for External Cutting
sions. It is easy to see that any measured size that is not
within tolerances can be only oversize or undersize and ex- Evaluate the tolerance range for the outside circle 02.5.
ternal and internal cutting method does make a difference The tolerance for this diameter is +.002/-0.0, so all sizes
as to how the offset can be adjusted. between 2.500 and 2.502 are correct. Any size smaller than
2.5 is undersize and a size greater than 2.502 is oversize.
Regardless of the cutting method, there is one major rule
applied to the cutter radius offset adjustment in any control There are three possible results of the measured size for
system - the rule has two equal parts: external cutting. All examples are based on the expected
middle size of 2.501 and on D01 holding the amount of
POSITIVE increment to the cutter radius offset will cause .375, which is the radius of a 0.750 milling cutter.
the cutting tool to move AWAY from the machined contour.
O External measured dimension - Example 1 :
placed - with a new amount. The concept of ‘moving away' face exactly. All is working well and the offset setting is ac-
curate. Only standard monitoring is required. This is not
and 'moving closer to' the part refers to the tool motion as
the CNC operator will see. The measured size of the part
such a rare situation as it seems - in fact, it is quite common
with a new cutter, rigid setup and common tolerances.
can be controlled by adjusting the cutter radius offset value
in the control, programmed as the D address, according to
these two The most useful rule that applies equally to
rules.
O External measured dimension - Example 2 :
2.4930
One Offset or Multiple Offsets?
with D01 = 0.3750
The program 03004 used D01 for the external diameter
The measured diameter is .008 undersize. The cutting
and Dl 1 for the internal diameter. Only one tool was used
tooledge has reached beyond the programmed machining
and the goal was the middle tolerance of 2.501 for the ex-
surface and has to move away from it. The radius offset
ternal diameter and 2.00 for the internal diameter. Are two
1
Now is the time to look at tolerance range for the inside Assume for a moment, that only one offset is used, for ex-
diameter of 2.0 inches. The tolerance range for this diame- ample D01, with the stored amount of .375. When mea-
ter is +.002/-0.000, so all part sizes between 2.000 and sured, the external diameter is 2.001. After continuing cut-
2.002 will be correct. A size smaller than 2.000 will be un- ting the internal diameter of 2.000 inches, when measured
dersize and a size greater than 2.002 will be oversize. again, its size is not 2.001 as expected, but only 1 .999. This
measurement is .002 undersize then the expected diameter.
There are three possible of the measured size for
results
The reason is that both diameters have a +.002/-0.000 toler-
internal cutting. All examples are based on the expected The
ance. results are different - for the external diameter,
middle size of 2.001 and on D1 1 holding the amount of
+.002 means oversize that can be recut, for the internal dia-
.375, the radius of a 0.750 cutter.
meter, +.002 means oversize that is a scrap. Since one off-
alone cannot be adjusted to meet the middle tolerance
O Internal measured dimension - Example 4 :
set
on both diameters, two offsets have to be used. It follows,
that if DO I =.3750 and makes a perfect external diameter,
2.2010 with Dll = 0.3750 Dl should have a smaller setting amount of only .3730.
I
the
starting values for each offset as a professional courtesy.
2.0060 with Dll = 0.3750
1.9930 with Dll = 0.3750 Whether machining an external or internal tool path, even
the best setup will not guarantee that the part dimensions
The measured diameter is edge
.008 undersize. The tool will be within tolerances. When machining an external
has not reached the intended machining surface and has to contour, the diameter can be cut intentionally larger than
move closer to it. The radius offset value has to be de- required - in a controlled way. In this case, the risk that the
creased by one half of the undersize amount. The undersize diameter will be too small is present.
is on the diameter (or width), but the offset amount is en-
In both cases, when the test cut is made, measure the dia-
meter and adjust the offset by one hal f of the difference be-
tween measured and intended diameters. If only one side is
cut, the difference is not halved.
erance range? There are two opinions among CNC pro- The same preparatory commands used in milling opera-
grammers. One opinion favors the use of the middle value tions are used for contouring on CNC lathes - Figure 30-33:
of tolerance range, the other prefers to use the nominal size
and ignore the tolerances. Both opinions have some credi-
bility and should not be discarded. In this handbook, the
preference is to use the nominal dimensional sizes and let
the tolerances be handled by proper use of offsets - at the
machine. Two reasons prevail. One is that a program using
nominal dimensions is easier to read. Two, in case of draw-
ing changes, they will affect the tolerances more often than
nominal sizes.
All the principles and rules described so far also apply to Figure 30-33
the radius offset for a lathe contouring tool. There are few Lathe application of the tool nose radius offset
differences, mainly caused by the shape of the tool.
Offset of the tool nose radius
In milling, the cutting tool is always round. The cutter pe- G41
to the LEFT of the contouring direction
riphery is the cutting edge and its radius value is the offset.
Offset of the tool nose radius
Turning tools have a different design. The most common is G42
to the RIGHT of the contouring direction
a multi-sided carbide insert. An insert may have one or
more cutting edges. For strength and longer insert life, the G40 Offset of the tool nose radius CANCEL
cutting edge has a relatively small corner radius. Typical ra-
dii for turning and boring tools are:
For lathes, G codes do not use the D address - offset value
1/64 = .01 56 (English) or 0.40 mm (metric) is stored in the Geometry/Wear offset. Lathe tools have dif-
1/32 = .0313 (English) or 0.80 mm (metric) ferent cutting edges, otherwise they are similar to milling.
3/64 = .0469 (English) or 1.20 mm (metric)
virtual point. It is the point that is moved along the contour, number nose radius center and its orienta-
to establish the
because it is directly related to XOZO of the part. tion. Figure 30-34 shows two tools and their tip orientation.
CUTTER RADIUS OFFSET 267
Figure 30-34
Relationship of the tool reference point and the nose radius center
Effect of tool nose radius offset - (a) offset not used (b) offset used
Sample Program
/ X2.650
X2.410
3 4 XI. 990
8 TLR = Tool radius XI. 750
X0.950
Figure 30-36 X0.750
numbering (Fanuc controls
XO
Schematic illustration of the tool tip
N40 X4.8 Z-2.395 fect, changing to a turning cut(-s) with G42 in effect - see
N41 U0.2 Figure 30-40. Possible problem is discussed as well.
N42 GOO G40 X8 0 Z5 0 T0300
. .
N43 M01
NNN
N46 GOO G41 X2.19 ZO.l T0404 M08
N47 G01 XI. 75 Z-0.12 F0.006 XI. 70 Correct
N48 Z-1.6 F0.009 G42 approach
XI. 40
N49 G03 X0.95 Z-2.0 R0.4
N50 G01 X0.75 Z-2.1 XI. 00
N51 Z-2.925
N52 U-0.2
N53 GOO G40 X8.0 Z2.0 T0400
N54 M01 XO
CLEARANCE - - X-0.07 Incorrect
approach
Note that the contour start and end positions are in the Figure 30-40
clear area - away from the part. Make sure there is enough Tool nose radius offset change lor the same tool
clearance. Cutter radius compensation interference alarm
(alarm #41) is always caused by insufficient clearance.
N21 T0100 (CORRECT APPROACH)
N22 G96 S400 M03
Minimum Clearance Required N23 GOO G41 XI. 7 ZO T0101 M08 (START)
N24 G01 X-0.07 F0.007 (FACE OFF)
As a rule, each clearance in program should be large N25 GOO ZO.l (ONE AXIS ONLY)
enough to accommodate the double tool nose radius. N26 G42 XI. 0 (THEN COMPENSATION)
N27 G01 XI. 4 Z-0.1 F0.012 (CONTOURING)
N28 Z-0.65
N29 X. .
for consistency. For solid parts, the face cut must end below
the center line, X-0.07 in block N24, at a diameter margin-
ally larger than double tool radius. If the cut finishes at XO,
the tool leaves a small unfinished tip at the center line and
the face will not be fiat. Also compare the correct and in-
correct tool motions on the right side of the last illustration.
If the above program is modified to the following version,
From all available machining operations, contouring or Planes in the mathematical sense have their own proper-
profiling is most common CNC application, per-
the single ties. There is no need to know them all, but there are impor-
haps along with hole making. During contouring, the tool tant properties relating to planes that are useful in CNC
motion is programmed in at least three different ways: programming and in various phases of CAD/CAM work:
Tool motion along a single axis only -i Any three points that do not lie on a single line define
a plane (these points are called non-collinear points)
Tool motion along two axes simultaneously
J A plane is defined by two lines that intersect each other
Tool motion along three axes simultaneously
A plane is defined by two lines that are
There are additional axis motions that can also be applied parallel to each other
(th e fourth and fifth axis, for example), but on a CNC ma-
A plane is defined by a single line
chining center, we always work with at least three axes, al-
and a point that does not lie on that line
though not always simultaneously. This reflects the three
dimensional reality of our world. A plane can be defined by an arc or a circle
This chapter applies only to CNC milling systems, since J Two intersecting planes define a straight line
turning systems normally use only two axes, and planes are A straight line that intersect a plane
therefore not required or used. Live tooling on CNC lathes on which it does not lie, defines a point
does not enter this subject.
These mathematical definitions are only included for ref-
Any absolute point in the program is defined by three co- erence and as a source of additional information. They are
ordinates, specified along the X, Y and Z axes. A pro- not required for everyday CNC programming.
grammed rapid motion GOO or a linear motion GO can use I
In all three cases - and only in these three cases - pro- and used are planes consisting of a combination of any two
grammer has to consider a special setting of the control sys- primary axes XYZ. Therefore, the circular cutting motion,
tem - it is called a selection of the machining plane. cutter radius offset and fixed cycles can take place only in
any one of the three available planes:
To look up a definition of a plane, research a standard The actual order of axis designation
for a plane definition
textbook of mathematics or even a dictionary. From various isvery important. For example, the plane and the XY YX
definitions, plane can be described in one sentence: plane are physically the same plane. However, for the pur-
poses of defining a relative tool motion direction (clock-
A plane is a surface in which a straight line joining any wise vs. counterclockwise or left vs. right), a clear standard
two of its points will completely lie on that surface. must be established.
269
270 Chapter 31
A typical CNC machining center has three axes. Any two The selection of a plane for Fanuc and related controls
axes form a plane. A machine plane may be defined by adheres to the mathematical designation of planes, not the
looking at the machine from standard operating position. actual CNC machine tool planes.
In a part program, each of
For a vertical machining center, there are three standard the threemathematical planes can be selected by a special
views, viewed perpendicularly (straight on): preparatory command - a unique G code:
The illustration in Figure 31-1 shows the difference be- G19 YZ plane selection
tween the two definitions, caused by a viewpoints that are
not compatible.
For all rapid motions (programmed with GOO) and all lin-
It is clear that the XY plane and top view are the same in ear motions (programmed with G01), the plane selection
both definitions, and so is the YZ plane and the right side command is totally irrelevant and even redundant. That is
view. The ZX mathematical plane is different from the front not the case for other motion modes, where the plane selec-
plane on the machine, which is XZ, as shown in the middle tion in a program is extremely important and must be con-
illustration. sidered carefully.
The mathematical plane defined as the ZX plane, where For machining applications using the circular interpola-
Z is the horizontal axis, is reversed on the machine plane tionmode, with G02 or G03 commands, cutter radius offset
forCNC machining centers. On the machine, this plane be- mode with G41 or G42 commands and fixed cycles mode
comes the XZ plane, where the X axis is the horizontal axis with G8 to G89 commands, as well as G73, G74, G76, the
1
L1 CO
c
Note that the G code direction for arcs does not change The following format examples show some typical pro-
either within the mathematical plane (a), or the mathemati- gramming applications for circular interpolation:
cal plane mirrored (b), or even the mirrored plane rotated
by negative 90° (c), even if the plane itself is changed. G17 G02 X14.4 Y6.8 R1.4
What occurred here is not a creation of any new plane
(mathematical or otherwise). The view still represents a G18 GO 3 X11.575 Z-1.22 R1.0
three dimensional object, viewed from a different direc-
G19 G02 Y4.5 Z0 R0.85
tional point (viewpoint).
In order to understand the CNC applications of G02 and XZaxes - G18 plane - I and K arc center modifiers
G03 commands in planes, the illustration in Figure 31-3 YZaxes - G1 9 plane - J and K arc center modifiers
should be helpful.
Absence of Axis Data in a Block
G17-G18-G19 as Modal Commands Block N43 represents a contour of a 180° arc in the ZX
plane. Because of the G18 command in N43, the control
The preparatory commands for a plane selection G17, will correctly interpret the ‘missing' axis as the Z axis, and
G 8 and G 9 are all modal commands - programming any
1 1
its value will be equal to the last Z axis value programmed
one of them will activate the selected plane only. The plane
(Z-3.0). Also examine the GI7 command in block N44. It
selection in the program will be in effect until canceled by
is always a good practice to transfer the control status to its
another plane selection. The three plane related G codes original plane selection as soon as the plane changes, al-
belong to the G code group number 02 exclusively.
though this is not absolutely necessary in the example.
PLANE SELECTION 273
Omitting the G 1 8 command in block N43 will cause a se- There will not be a 3-axis cutter radius offset taking place!
rious program error. If G18 is omitted, the originally se- In the next example, compare the absolute tool positions
lected command G17 will still be in effect and circular in- for each plane when the rapid motion is completed and the
terpolation will take place in the XY plane, instead of the cutter radius offset is activated in the program. Tool abso-
intended ZX plane. when the cutting motion
lute position is completed depends
on the motion following block N121
In this case, the axis assumed as ‘missing’ in the G17
plane will be the Y axis and its programmed value of Y7.5. The radius offset value of D25=100.000 mm, stored in
The control system will process such a block as if it were the control offset registry, is used for the next example:
specified in a complete block:
O Example
N43 G17 G02 X7 . 0 Y7 5 R3
. .
in effect:
N43 GO 2 X7.0 Z-3.0 R3 0 . G 17 is still in effect If G1 7 command is programmed with three axes :
Although G 1 7 is still the active plane, the arc will be ma- G17X.. Y.. Z.. XY motion will be compensated
chined correctly in the G 8 plane, even if G 1 8 had not been
1
vant, providing that no cutter radius offset G4 or G42 is in 1 The example illustrated in Figure 31 -4 is a simple job that
effect. In theory, it means that regardless of the plane selec- requires cutting the R0.75 arc in the XZ plane. Typically, a
tion, all GOO and G01 motions will be correct. That is true, ball nose end mill (also known as a spherical end mill) will
but seldom practical, since most CNC programs do use a be used for a job like this.
contouring motion and they also use the cutter radius offset
feature. As an example, evaluate the following blocks: In the simplified example, only two main tool passes are
programmed. One pass is the left-to-right motion - across
N1 G21 the left plane, over the cylinder, and over the right plane.
The other pass is from right to left - across the right plane,
N120 G90 GOO X50.0 Y100.0 Z20.0 over the cylinder, and across the left plane. A stepover for
N121 G01 X90.0 Y140.0 ZO F180.0 the tool isprogrammed, between the passes. The pro-
also
gram of this type for the whole part could be done in the in-
When the rapid motion programmed in block N120 is cremental mode and would greatly benefit from the use of
completed, the cutter will be positioned at the absolute lo- subprograms.
cation of X50.0 Y 100.0 Z20.0. The absolute location of the
cutting motion will be X90.0 Y 140.0 Z0, after the block Figure 31-5 demonstrates tool motion for the two passes
N121 is completed. included in the program example. To interpret the program
data correctly, note that program zero is at the bottom left
Adding a cutter radius offset command G4 1 or G42 to the corner of the part. Both clearances off the part arc . 1 00 and
rapid motion block, the plane selection will become ex-
the stepover is .050:
tremely important. The radius offset will be effective only
for those two axes selected by a plane selection command.
274 Chapter 31
Q C
HSHMihMI i
2.5
I.
R0.750
0.5
i Tool path for programming example 03101
Figure 31-4
FIXED CYCLES IN PLANES
Drawing for the programming example 03 101
N10 G90 X2.5 many industries they are gaining in popularity. When pro-
Nil G02 XI. 0 1-0.75 (= G02 XI. 0 ZO 5 1-0.75 KO) .
gramming these attachments, always consider the tool di-
N12 G01 X-O.l rection into the work (the depth direction). In the common
N13 G91 G42 Y0.05 applications of fixed cycles, G17 plane uses XY axes for
N14 G90 . .
the hole center location and the Z axis for the depth direc-
tion. If the angle head is set to use the Y axis as the depth di-
When working with this type of CNC program the first rection, use G 18 plane and the XZ axes will be the hole
lime, it may be a good idea to test the tool path in the air. a
center positions. If the angle head is set to use the X axis as
little above the job. F.rrors can happen quite easily.
the depth direction, use G19 plane and the YZ axes will be
Three axes cutting motion is programmed manually only the hole center positions. In all cases, the R level always ap-
plies to the axis that moves along the depth direction.
for parts where calculations arc not too time consuming.
For parts requiring complex motions calculations, a com- The difference between the tool tip and the center line of
puter programming software is a better choice. spindle is the actual overhang. This extra overhang length
must be known and incorporated into all motions of the
affected axis not only for correct depths, but also for safety.
32 PERIPHERAL MILLING
Even with the ever increasing use of carbide cutters for END MILLS
metal removal, the traditional HSS (high-speed steel) end
mills still enjoy a great popularity for a variety of milling End common
mills are the most tools used for peripheral
operations and even on lathes. These venerable cutters of-
milling. Therea wide selection of end mills available for
is
fer several benefits - they are relatively inexpensive, easy to
just about any conceivable machining application. Tradi-
find, and do many jobs quite well. The term high speed
tional end mills come in metric and English sizes, variety of
steel does not suggest much productivity improvement in
diameters, styles, number of cutting flutes, numerous flute
modern machining, particularly when compared to carbide designs, special corner designs, shanks, and tool material
cutters. It was used long time ago to emphasize the benefit compositions.
of this tool material to carbon tool steel. The new material
of the day was a tool steel enhanced with tungsten and mo- Here are some of the most common machining opera-
lybdenum (i.e., hardening elements), and could use spindle can be performed with an end mill - HSS, cobalt,
tions that
speeds two to three times faster than carbon steel tools. The solid carbide or an indexable insert type:
term high-speed-steel was coined and the HSS abbrevia-
Peripheral end milling and contouring
tion has become common to this day.
Milling of slots and keyways
The relatively low cost of high speed steel tools and their
capability to machine a part to very close tolerances make Channel groves, face grooves and recesses
them a primary choice for many milling applications. End
Open and closed pockets
mills are probably the single most versatile rotary tool used
on a CNC machine. Facing operations for small areas
275
276 Chapter 32
Relief Angles
Figure 32-
Flute length
Basic configuration of the three most typical end mills
For CNC work, the diameter of the end mill must be very
accurate. The nominal diameters are those that are listed in
High Speed Steel End Mills
the catalogues of various tooling companies. Nonstandard
True high speed steel end mills arc the ‘old-timers' in ma- size, such as reground cutters, must be treated differently
for CNC work. Even with the benefits of cutter radius off-
chine shops. They are manufactured either as a single end
set, it is not advisable to use reground end mills for preci-
or a double end design, with various diameters, lengths and
sion machining, although they may do a good job for emer-
shank configurations. Depending on the cutting tip geome-
try. they can be used for peripheral motion (XY axes only),
gency situations and for some roughing. That does not
plunge motion (Z axis only), or all axes simultaneously
mean a reground cutter cannot be used for non-CNC work
(XYZ axes). Either a single end or a double end can be used elsewhere in the shop or for less demanding CNC work.
Number of Flutes
SPEEDS AND FEEDS
When selecting an end mill, particularly fora material of
average hardness, the number of flutes should be the pri- In many other sections of the handbook, speeds and feeds
mary consideration. For profiling, many programmers se- are mentioned. Tooling catalogues have very good charts
lect (virtually automatically) a four-flute end mill for any and recommendations on speeds and feeds for particular
required tool size larger than 0.625 or 0.750. An end mill tools, used with different materials. However, one standard
that has to plunge-in - that is - it has to cut into a solid mate- formula (English version) is used for calculating the spin-
rial along the Z axis - has normally only two flutes, regard- dle speed in r/min (revolutions per minute):
less of diameter. This 'plunging-type' of end mill is also
known under a more technical name as a center-cutting end
mill, or under a rather old-fashioned name, a slot drill. The
term slot drill has no relation to the tool called a drill, but to
its machining action - just like a drill, a slot drill penetrates
into a solid material, parallel to the Z axis.
where ...
cause two other factors have to be considered - tool chatter Sometimes, there may be a benefit from the reverse for-
and tool deflection. There is no doubt, that in ferrous mate-
mula - for example, when cutting at a certain spindle speed
rials, the multi flute end mills will deflect less and chatter
( r/min) that seems to be the perfect choice for the particular
less than their two-flute counterparts.
material. Next lime a different diameter of the tool for that
and that applies to all tools. Deflection pushes the tool All entries in the formulas are based on previous explana-
away from its axis (center line). These are all results of tions and should be easy to understand and apply.
common physical laws.
278 Chapter 32
To calculate a cutting feedrate for any milling operation, The English units version of the formula is:
When using carbide insert end mills for cutting steels, the
in/ min = r/min x ft x N faster spindle speeds arc generally better. At slow speeds,
the carbide cutter is in contact with a steel being cold. As
us" where ... the spindle speed increases, so does the steel temperature at
the tool cutting edge, producing lower strength of the mate-
in/min = Feedrate in inches per minute
rial. That results infavorable cutting conditions. Carbide
r/min = Spindle speed in revolutions per minute
insert cutting tools can often be used three times and up to
f, = Chip load in inches per tooth (per flute)
= Number of teeth (flutes)
five times faster than standard HSS cutters. The two basic
N
rules relating to the relationship of tool material and spindle
For metric system of measurement, the chipload is meas- speed can be summed up:
ured in millimeters per tooth (per flute), with the abbrevia-
tion of mm/tooth. The metric formula is similar to the one High speed steel (HSS) tools will wear out very quickly,
end mill may require 100 ft/min in cast iron. For the same cutlers, coolant may not be always necessary, particularly
for roughing steel stock.
cutting tool and part material. .004 per flute is the recom-
mended chip load. Therefore, the two calculations will be:
Never apply coolant on a cutting edge
is already engaged in the material!
that
Spindle speed:
setup, their rigidity, depth and/or width of cut and other rel- ments with the combination of spindle speeds and cutting
evant conditions very carefully. feedrates should be the first step. If chatter still persists,
look at the machining method used and the setup integrity.
Feed per tooth f (in inches per tooth), can be calculated as
reversed values from the formula listed above.
PERIPHERAL MILLING 279
STOCK REMOVAL
cavity into the required size, shape and depth. quality of surface finish. From the basic concepts of ma-
chining, die cutting direction can be in two modes:
Plunge Infeed
Climb milling - also known as the DOWN milling
Entering an end mill into the part material along the Z Conventional milling - also known as the UP milling
axis alone is plunge in-
called center-cutting, plunging or
feed. It is a typical machining operation and programming Anytime the G4 command is programmed, cutter radius
1
procedure to enter into an otherwise inaccessible area, such is offset to the left of part and the tool is climb milling. That
as a deep pocket, a closed slot, or any other solid material assumes, of course, that the spindle rotation is normal, pro-
entry. Not every end mill is designed for plunge cutting and grammed widi the M03
and the cutting tool is
function,
the CNC machine operator should always make sure the right hand. The opposite, G42 offset, to die right of the part,
right end mill is always selected (HSS or carbide or in- will result in conventional milling. In most cases, climb
dexable insert type of end mill). Programmer can make it milling mode is the preferred mode for peripheral milling,
easier by placing appropriate comments in the program. particularly in finishing operations.
In and Out Ramping Figure 32-4 illustrates die two cutting directions.
cutter, 8° for a 2.000 inch cutter, and 3° for a 4.000 inch cut-
ter. Ramping approach toward the part can be used for flat
type, ball nose type, and bull nose type of end mills.
Smaller end mills will use smaller angles (3°-10°). See Fig-
ure 32-3 for an illustration of a typical ramping motion.
Climb Milling the cut and upon exit, the chip is very thick. The practical
result is possible hardening of the part, rubbing the tool into
Climb milling - sometimes called the down milling - uses
the material, and a poor surface finish.
rotation of the cutler in the feeding direction and has the
tendency to push the part against the table (or the fixture).
Width and Depth of Cut
Maximum thickness of the chip occurs at the beginning of
the cut and upon exit, the chip is very thin. The practical re- For good machining, the width and depth of cut should
sult is that most of the generated heat is absorbed by the correspond to the machining conditions, namely the setup,
chip, and hardening of the part is largely prevented. the type of material being machined and the cutting tool
used. Width of cut depends also on the number of flutes of
Do not misunderstand the words climb and down describing the cutter that are actually engaged in the cut.
the same machining direction.
Approximately one third of the diameter for the depth of
cut is a good rule of thumb for small end mills, a little more
Both terms are correct, if taken in the proper context.
for larger end mills.
Conventional Milling
Peripheral milling requires a solid machining knowledge
Conventional milling -sometimes called the up milling - and certain amount of common sense. If a successful ma-
uses rotation of the cutter against the feeding direction, and chining operation in one job is documented, it can be
has the tendency to pull the part from the table (or the fix- adapted to another job with ease.
ture). Maximum thickness of the chip occurs at the end of
33 SLOTS AND POCKETS
OPEN AND CLOSED BOUNDARY quires a roughing operation and a finishing operation. Both
operations can be made with the same tool or with two or
more depending on the part material, required di-
tools,
A continuous contour on which the start point and the end
mensional tolerances, surface finish, and other conditions.
point is in a different location, is called an open contour.
Continuous contour defined in the program that starts and Certain slots, for example keyways, can be done with
ends at the same point location, is called a closed contour. special cutters, called slotting cutters, rather than an end
From the machining point of view, the major difference be- mill. To program a slotting cutter is usually a simple pro-
tween an open and closed contour is how the cutting tool cess of a linear motion and out. More complex - and
- in
reaches the contour depth. more accurate slots are machined with end mills, and the
-
Closed Boundary
281
282 Chapter 33
Number of tools The drawing shows the slot depth as .2 10. Always check
the depth - may
be too deep for a single cut, usually for
it
Tool size
small cutters or tough materials. Although a single cut can
Speeds and feeds be used for the full depth, some stock at the slot bottom
should be left for finishing.
Maximum cutting depth
Method of cutting
Method of Cutting
Number of Tools Once all the other machining conditions are established,
the method of cutting almost presents itself. The tool will
One or two tools can be used to cut the slot. If dimen- be positioned above a clear position and at the slot center
sional tolerances are very critical or the material is hard to line. Then the tool will be fed into the slot depth, leaving
cut, use two tools - one tool for roughing, another one for some material at the bottom, for finishing. In a linear mo-
finishing. The tools could have the same diameter or differ- tion, the tool will rough out the material all the way to the
ent diameters. For this example, only one tool will be used center of the slot radius, then retract above the material.
for both roughing and finishing. Then it will be moved back to the original starting position
and at the full depth for contouring the slot, in climb mill-
Tool Size
ing mode. In Figure 33-2, the XY tool motions and their
The size of the cutting tool is mainly determined by the program locations are shown.
width of the slot. In the drawing, the slot has .300 radius, so
the width is .600. There is no standard cutter of 0.600 - but
- even if there were - would it be practical? What about a
0.500 inch cutler for .500 inch wide slot? It is possible, but
would not be of the highest quality. Toler-
the resulting cut
ances and surface finish would be hard to control. That
means choosing a tool, preferably available off-shelf, that
is a little slot width. For the slot in the ex-
smaller then the
ample, a 0.500 inch end mill is a suitable choice. When se-
lecting the tool size, always calculate how much stock the
tool will leave on the slot walls for finishing. Too much
stock may require some semifinishing cuts. With the 0.500
cutter and the slot width of .600, the amount of stock left
Closed slot does not differ from an open slot that much.
The greatest difference is in the tool entry into the material.
There is no outside location - tool has to plunge into the
Figure 33-4
material along the Z axis, unless there is a predrilled hole.
One method is to use a center cutting end mill (known as Roughing operation detail for a closed slot example 03302
slot drill). If this type of end mill is not available, or ma-
chining conditions are not suitable, tool will have to ramp Internal Contour Approach
into the material, as a second method. Ramping is a linear
cutting motion, usually in the XZ, the YZ, or the XYZ axes. In the program, the tool is now at the center of the left side
of slot, ready to start the finishing cut. Climb milling mode
has been selected and the contour approached in such a
way that the tool motion continues to its left. One way is the
make a straight linear cut from the current tool location at
the center, to the ‘south' position of the left arc (while ap-
plying the cutter radius offset).
Now, look closely at how the approach arc was created. N12 G01 xi. (CUT WALL TOP)
The goal is to select the location and radius of the approach N13 GO 3 Y0.585 R0.3 (CUT RADIUS LEFT)
arc. Location selection is easy - the arc must be tangent to
N14 XI. 78 Y0.865 R0.28 (CIRCULAR DEPARTURE)
N15 G01 G40 XI. 5 Y0.885 (LINEAR DEPARTURE)
the contour. The radius dimension has to be selected with
N16 GOO Z1.0 MO 9 (RETRACT ABOVE WORK)
some logical thinking. When faced with an unknown di-
N17 G28 XI. 5 Y0.885 Z1.0 MO 5 (M/C ZERO)
mension, always think of its purpose first. The purpose of N18 M30 (END OF PROGRAM)
the approach arc is to lead-in the cutting tool in a smooth %
curve towards the contour. That means the approach arc ra-
dius must be smaller than the cutting tool radius. Finally, This program example is also a good illustration of how
there is the slot radius itself, which is defined by the draw- to approach any inside contour for finishing. Slots of other
ing. Relationship of all three radii can be put in perspective: kinds (angular, circular, etc.), use the same principles illus-
trated in the last two examples.
R t
< Ra < Rc
POCKET MILLING
car where ...
- .260 or .290? Well, the larger the better. With selection of There are two main considerations when programming a
rather a largerapproach radius from the range, the arc tan- pocket for milling:
gential approach takes place at a smoother curve than with
a smaller radius. The result is an improved surface finish. Method of cutter entry
For program 03302, .280 is selected as the approach ra- Method of roughing
dius. This selection meets all the three relationships:
To open a space to start milling a pocket (into solid mate-
rial), motion has to be programmed to enter along
the cutter
.250 (R t ) < .280 (R a ) < .300 (RJ the direction of spindle (Z axis), which means the cutter
must be center cutting - to be able to plunge cut. In cases
That is all the information needed before writing the pro- where the plunge cut is either not practical or not possible,
gram. Note the programming similarities with the open slot a method called ramping can be used very successfully.
listed in program 03301. This method is often used when the center cutting tool is
N9 G03 XI. 5 Y0.585 R0.28 (CIRCULAR APPROACH) of cut. It may be difficult to do all the roughing in climb
N10 G01 X3.0 (CUT BOTTOM WALL) milling mode. Il may be difficult to leave exactly the same
Nil GO 3 Yl. 185 R0.3 (CUT RIGHT SLOT RADIUS) amount of stock for finishing everywhere in the pocket.
SLOTS AND POCKETS 285
Many cuts will be irregular and stock amount will not be To illustrate the complete pocket programming, starting
even. For that reason, it is quite common
program a to with tooling selection is important. Material is also impor-
semifinishing cut of the pocket contour, before any finish- tant and so are other machining decisions. Although rect-
ing cut takes place. One or more tools may be used for this angular pockets are often drawn with sharp corners, they
situation, depending on exact requirements. will always have corners of the tool used, or larger, when
machined. The corners in the drawing are 5/32 (. 1 563), and
Some typical methods for roughing a pocket are:
a 05/1 6 center cutting end mill (0.3 1 25). For roughing, it
Zigzag
may be a good choice, but for finishing, the radius should
be a little smaller so the tool can actually cut in the corner,
One direction - from the inside of the pocket out not just rub there. Selection of a 0.250 end mill is reason-
One direction - from the outside of the pocket in
able and will be used it in the example.
In computer applications, other pocketing options are Since all the material in the enclosed area has to be re-
also possible, such as a true spiral, morph, one way, and moved (including the bottom), think about all possible
others. In many cases, there is a choice of specifying the an- places where the cutting tool can enter into the depth by
gle of cut, even a user selected point of entry and finishing plunging or ramping. Ramping must always be done in a
left overs. Manually, these more complex methods may be clear area, but plunging can be done almost anywhere.
used as well, but it may be a very tedious work. There arc only two practical locations:
Pocket center
Pocket Types
Pocket corner
The most common pockets are also the easiest to pro-
gram. They all have a regular shape, without any islands: There are some benefits to both selections and the inevi-
table disadvantages. Starting at the pocket center, the tool
Square pocket can follow a single directional path and, after the initial cut,
Rectangular pocket can cut only in climb milling or conventional milling mode.
There are slightly more math calculations involved in this
Circular pocket
method. The other method, starting at the pocket corner, is
quite popular as well, but uses a zigzag motion, so one cut
Square pocket and a rectangular pocket are fundamen-
will be in a climb milling mode, the other cut will be in a
tally the same and apart from their different side lengths,
conventional mode of machining. It is a little easier for cal-
there is no major difference in programming.
culations, however. In the example, the corner will be used
as a start location.
RECTANGULAR POCKETS
Any corner of the pocket is equally suitable for the start.
the corner radius (or radii) of the pocket - they must always
be known, as well as the pocket position and its orientation
to other elements of the part.
Pocket roughing start point in the corner - zigzag method Result of a zigzag pocketing, without a semifinish cut
Stepover Amount
X, = X location of tool at start
The actual shape of the pocket before semifinishing is de-
Y, = Y location of tool at start
termined by the amount of stepover. A stepover in pocket-
TLR = Tool radius (cutter diameter/ 2)
= ing is just another name for the width of cut. This amount
L Pocket length as per drawing
W = Pocket width as per drawing
may be selected without actual calculation. A much better
Q = Calculated stepover between cuts way is to calculate the stepover amount, based on the num-
D = Calculated length of actual cut ber of required cuts. That way, the amount will be equal for
S = Stock left for finishing all cuts. Since it is quite common to think of a width of cut
C = Stock left for semifinishing (clearance) as some percentage of the cutter diameter, use this method
for referencepurposes only, and still calculate the cutting
Stock Amount width and select one that will be the closest to the cutter
diameter percentage desired.
There are two stock amounts (values) - one relates to the
finishing operation, usually done with a separate finishing In the example, a rather larger than average stepover will
tool, the other one relates to the semifinishing operation, be used, based on five required cuts (zigzag type). There is
usually done with the roughing tool. The cutter moves back a substantial difference whether the number of cuts is se-
and forth in a zigzag direction, leaving behind so called lected as an even number or as an odd number:
scallops. In 2D work, the word ‘scallops’ is used to describe
Even number of cuts will terminate the roughing
uneven wall surface caused by the tool shape, and is similar
on the opposite side of the pocket relative
in 3D cutting as well. The result of such a zigzag tool path
to the start location
is generally unacceptable for the finish machining, because
of the difficulty of maintaining tolerances and surface fin- Odd number of cuts will terminate the roughing
ish while cutting uneven stock. on the same side of the pocket relative
to the start location
To avoid possible cutting problems later, a secondary
semifinishing operation is often necessary. It purpose is to Practically, it does not matter which corner is selected to
eliminate the scallops. Choose semifinishing cut particu- start at or in which direction the first cut begins. What mat-
larly for machining tough materials or when using small ters is that the stepover is reasonable and, preferably, equal
size diameter tools. Semi finishing stock allowance, marked for all cuts. There is a simple way of calculating the step-
as the C value in the illustration, can also be equal to zero. If over, based on a given number of cuts. If the calculated
that is the case, it means no additional stock is required. amount is too small or too large, just repeat the calculation
Typically the stock allowance will have a small value. with a different number of cuts N.
Figure 33-8 illustrates the result of a roughing operation The calculation can be expressed in a formula:
G Example
G Example
Finishing Tool Path
D = 2.0 - 2 x 0.125 - 2 x 0.025 - 2 x 0.01 Once the pocket is roughed out and semifinished, another
D = 1.6800 tool (or even the same tool in some cases) can be used to
finish the pocket to its final size. This programmed tool
This is the incremental length of cut between the step-
path will typically provide offsets to maintain machining
overs (no cutter radius offset has been used). tolerances and speeds and feeds to maintain required sur-
face finish. Typical starting tool position for a small to me-
Semifinishing Motions
dium pocket is at its center, for a large pocket the starting
The only purpose of semifinishing motions is to elimi- position should be at the middle of the pocket, away from
one of the walls, but not too far.
nate uneven stock. Since the semifinishing will be nor-
mally done with the same tool as the roughing operation, For the finishing cut, the cutter radius offset should be in
the place to start the semifinishing cuts is the last tool posi-
mainly to gain flexibility in maintaining tolerances
effect,
tion of the roughing sequence. In this case, it was the upper during machining. Since the cutter radius offset cannot be
left comer of the pocket. Figure 33-9 shows the motions
started during an arc or a circular motion, linear lead-in and
from the Start to End (of the semifinishing).
lead-out motions have to be added. In Figure 33-10 is the
The length Li and W i are calculated, and the difference illustration of a typical finishing tool path for a rectangular
The mode of the milling cut is normally the climb milling N28 MO 6
N29 G90 G54 GOO XI. 5 Y1.25 S1500 M03 T01
mode and the radius offset used will be G4 to the left side 1 ,
5/32 (.1563) and the tool radius has been selected as .125, N36 G01 Yl. 1874
so the condition R, < R< is satisfied. In order to also satisfy N37 G03 X-0.1563 YO 1563 R0.1563 .
the condition R„ > Ri. choose almost any approach radius N38 G01 X-1.6874
larger than the tool radius, as long as it is reasonable. The N39 G03 X-0.1563 Y-0.1563
pocket length and width are also important, as always. If N40 G01 Y-1.1874
possible, choose the approach radius as one quarter of the
N41 G03 X0.1563 Y-0.1563 R0.1563
N42 X0.8437
pocket width W. for a little easier tool motion calculations.
N43 GO 3 X0.375 YO 375 R0.375
.
Once all selections and decisions have been done, the part In the program, blocks N17 and N18 can be joined to-
program can be written for the pocket in example 03303. gether into a single block. The same applies to biocks N 1
Two tools will be used, both 0.250 end mills, the roughing and N20. They are only separated for the convenience of
cutter must be able of center cutting. Program zero is the tracing the tool motions to match the illustrations. There is
lower left corner of the part. All roughing and semi- a slight benefit in using the incremental mode of program-
finishing steps are documented in the program. ming, but the absolute mode would have been just as easy.
SLOTS AND POCKETS 289
CIRCULAR POCKETS
> D
3
Figure 33- 12
immmm ,
0.25
1
The
Method
next step
of Entry
Figure 33- 1
In a circular pocket, the best place to enter along the Z axis,
is at the center of the pocket. pocket center is also the
If the
Sample drawing of a circular pocket (program examples 03304-06)
program zero X0Y0, and the pocket depth is .250, the be-
ginning of the program may be similar to the following
be done is the selec-
In terms of planning, the first thing to example (cutting tool placed in the spindle is assumed):
tion of the cutter diameter. Keep
mind, that in order to
in
make the pocket bottom clean, without any residual mate- 03304 (CIRCULAR POCKET - VERSION 1)
rial (uncut portions), it is important to keep the stepover N1 G20
from one cut to another by a limited distance that should be N2 G17 G40 G80
calculated. For circular pockets, this requirement influ- N3 G90 G54 GOO X0 Y0 S1200 M03
ences the minimum cutter diameter that can be used to cut N4 G43 Z0.1 H01 M08
the circular pocket in a single 360° cut.
N5 G01 Z-0.25 F8.0
N6 ...
Along the way, cutter radius offset for the climb milling N8 G01 G40 YO F15.0
mode G41 is programmed, followed by the full 360° arc N9 G28 Z-0.25 M09
back towards the center. Dur-
straight motion,
N10 G91 G28 XO YO M05
and another
Nil M30
ing this motion, the cutter radius offset will be canceled.
%
Figure 33-13 shows the tool path.
Another programming technique for a circular pocket is
much more practical - one that makes better surface fin-
ishes and also maintains tight tolerances required by many
drawings. Instead of a single linear approach directly to-
wards the pocket diameter, the cutting tool can be applied
in a combined linear-circular approach.
profile the full arc, then return back to the center: Since the radius offset isneeded to maintain tolerances,
and the offset cannot start on an arc, a linear approach will
N6 G41 Y0 .75 D01 F10.0 be programmed first with the cutter radius offset applied.
N7 GO 3 J-0.75 Then, the circular lead-in approach is programmed. When
N8 G01 G40 YO F15.0 the pocket is completed, the procedure will be reversed and
the radius offset canceled during a linear motion back to the
Now, the tool is back at the pocket center and the pocket
pocket center. The approach radius calculation in this ap-
iscompleted. The tool must also retract first, then move to
plication is exactly the same as described earlier in this
machine zero (G28 motion is always in the rapid mode):
chapter, for the slot finishing tool path. Figure 33-14 shows
the suggested tool path.
N9 G28 Z-0.25 M09
N10 G91 G28 XO YO M05
Nil M30
%
03305 (CIRCULAR POCKET - VERSION 2) The calculation is logically similar to the one for the rec-
N1 G20 tangular pocket and the desired amount of the stepover can
N2 G17 G40 G80 be achieved by changing the number of steps.
N3 G90 G54 GOO XO YO S1200 M03
N4 G43 ZO.l HOI M08 The example for program 03306 uses three stepovers,
N5 G01 Z-0.25 F8.0 calculated from the following formula:
N6 G41 XO 625 Y0.125 D01 F10.0
.
N7 GO 3 XO YO 75 R0.625
.
N8 J-0.75 R - TLR - S
N9 X-0.625 YO 125 R0.625 .
N13 M30
% Q = Calculated stepover between cuts
R = Pocket radius (pocket diameter D/ 2)
This programming technique is by far superior to the TLR = Tool radius (cutter diameter / 2)
straight linear approach. It does not present any additional S = Stock left for finishing
programming difficulty at all, partly because of the sym- N = Number of cutting steps
metry of tool motions. In fact, this method can be - and
should be - used for just about any approach towards an in- In our application, the example values are:
N7 GO 3 XO YO .75 R0.625
radius offset cancel mode in effect, and has the following
N8 J-0.75
format in the program:
N9 X- 0.625 YO 125 R0.625.
03305 (CIRCULAR POCKET - VERSION 2) subject is beyond the limits of this handbook.
N1 G20
34 TURNING AND BORING
There is so much information that can be covered in this Txxyy format represents tool station xx and wear offset
section, that a whole book could be written just on the sub- number yy. For example, T0202 will cause the turret to in-
ject of turning and boring. Selected subjects are presented dex to the tool station #2 (first two digits) which will be-
in this chapter, others are covered in chapters dealing with come the working station (active tool). At the same time,
lathe cycles, grooving, part-off, single point threading, etc. the associated tool wear offset number (the second pair of
digits) will become effective as well.
TOOL FUNCTION -TURNING Selection of the tool number (the first pair of digits), also
selects the geometry offset on most modern CNC lathes. In
In terms of distinction, turning are boring are practically that case, the second pair of digits will select the tool wear
identical operations, except for the area of metal removal offset number. Any tool station selected by the turret station
where the actual machining takes place. Often, terms exter- number identification can be associated with any offset
nal turning and internal turning are also used, meaning the number within the available offset range. In most applica-
same as turning and boring respectively. From program- tions, only one tool offset number is active for any selected
ming perspective, the rules are virtually the same, and any tool. In such a case, it is wise to program the offset number
significant differences will be covered as necessary. the same as the tool number. Such an approach makes the
operator's job much easier. Consider the following choices:
CNC lathes require programming the selected tool by its
tool number, using the T address. In comparison with a
GOO T0214 Tool station 02, wear offset 14
CNC machining center, the tool function for lathes is more
GOO T1105 Tool station II, wear offset 05
extensive and calls for additional details. One major differ-
ence between milling and turning controls is the fact that GOO T0404 Tool station 04, wear offset 04
the T address for CNC lathes will make the actual tool
change. This is not a case in milling. No M06 function ex-
Although all examples are technically correct, only the
ists on a standard CNC
lathe.
last example format is recommended. When many tools are
used in a program, the offset numbers for individual tools
T Address may be confusing, if they do not correspond to the tool sta-
tion numbers. There is only one time when the offset num-
One difference from machining centers is that a tool de- ber cannot be the same as the tool station number. That
fined as T01 program must be mounted in the turret
in the happens in the cases when two or more offsets are assigned
station #1, tool defined as T12 must be mounted in turret to the same tool, for example T0202 for the first wear off-
station #12, etc. Another difference between milling and set, T0222 for the second wear offset.
GOO T0404
& Tool GEOMETRY offset The most useful preference is to disregard the leading
zero suppression and use the tool function in its full format,
Figure 34-1 as shown above and in all examples in this handbook.
Typical tool function address for CNC lathes
293
294 Chapter 34
Offset Entry
LATHE OFFSETS
The tool offset can be entered into the program in two dif-
Although the tool been to some extent covered
offset has ferent ways:
The purpose of the tool wear offset is to adjust the differ- on is described. Since the control system usually assumes
ence between the programmed dimensions and the actual
the G01 command (linear interpolation) at the start up, a
tool position on the part. If the wear offset is not available
feedrate would be required. However, it looks rather absurd
to program T0202 F0.025, although it is correct. Rapid mo-
on the control, the adjustments are made to the only offset
tion is far more practical and rather that depending on the
available - that is to the geometry offset.
current control status, programming the GOO command
will always get the offset activated.
TURRET AT
•
MACHINE ZERO
Z GEOMETRY OFFSET
[
Distance is negative ]
i2=
X GEOMETRY OFFSET
[ Diameter is negative ]
Figure 34-2
Geometry offset is the distance from tool reference point to program zero, measured along an axis from machine zero
TURNING AND BORING 295
Tool Offset with Motion Also note that no GOO is required for a block containing
tool indexing with zero wear offset entry. The advantage of
The second method is to program the wear offset simulta-
programming the tool offset simultaneously with a motion
neously with a cutting tool motion, usually during the tool
is the elimination of the jumpy motion; at the same time, no
approach towards the part. This is the preferred method.
overtravel condition will result, even if the wear offset is
The following two examples illustrate this recommended
unusually large. The wear offset value will only extend or
programming of the T function for turning systems - the
shorten the programmed rapid approach, depending on the
offset is activated when the second pair of digits in a tool
actual offset amount stored.
number call are equal to or larger than 01
Generally, the tool wear offset register number is entered
N1 G20 T0100 before or during the rapid approach motion.
N2 G96 S3 00 M03
N3 GOO X. Z. T0101 M08
. .
Offset Change
In most cases, it makes no difference, whether the offset offset can be changed to another offset for the same tool to
is activated with or without a motion command. But some achieve the extra flexibility. This is useful mainly in cases
limitations are possihle when programming the tool offset when must be ma-
individual diameters or shoulder lengths
entry without a motion command. For example, if the wear chined to exact tolerances. Any new offset must be pro-
offset value stored is unusually large and the tool starts grammed without a cancellation of the previous one. In
from the machine zero position, this type of programming fact, this is the preferable method for changing from one
may cause an overtravel condition. The reason is simple - remember that any
offset to another.
offsetchange serves a purpose only during actual cutting.
Even in cases of a small offset value, there will always be Offset cancellation could be unsafe if programmed during
a ‘jump’ motion of the turret when the offset is activated. cutting motion. This is a very important - and largely unex-
Some programmers do not like this jumpy motion, al- plored programming technique - that some detailed exam-
though it will do no harm to the machine. In these cases, the ples are justified.
best approach is to activate the tool wear offset during the
first motion, usually as a rapid approach motion towards
MULTIPLE OFFSETS
the part. One consideration is very important when the tool
wear offset is activated together with a motion. Earlier in
this chapter was a comment that the lathe tool function is Most jobs machined on CNC lathes require very high
also a function causing the tool indexing. Without a doubt, precision. High precision requires tolerance ranges as
the one situation to avoid is the simultaneous tool indexing specified in the engineering drawing and these ranges may
and tool motion - it may nave dangerous consequences. have quite a variety. Since a single offset per tool is often
not enough to maintain these tolerances, two or more wear
The best approach is to start each tool with the tool index- offsets are required for one tool.
ing only, without any wear offset:
The following three, examples are designed to present a
N34 T0200 M42 complete understanding of the advanced subject covering
multiple offsets. The same basic drawing will be used for
The above example will register the coordinate setting for all examples.
rial is a 01.5 inch aluminum bar and three tools are used: N1 G20
N2 G50 S3000 T0100
N3 G96 S500 M03
T01 For the face and rough contour N4 GOO G41 XI. 7 Z0 T0101 M08
N5 G01 X-0.07 F0.005
T03 For the finishing of the contour to size N6 Z0.1
N7 GOO G42 XI. 55
25 wide part-off tool
N8 G71 P9 Q16 U0.04 WO. 004 D1000 F0.01
T05 0. 1
N9 GOO X0.365
N10 G01 X0.625 Z-0.03 F0.003
Nil Z-0.4
The of the programmer determines the final result -
skill
N12 XI. 0 C-0.03 (K-0.03)
the correct number of offsets must be entered at the right
N13 Z-0.75
places within the program and the CNC operator must store N14 XI. 375 C-0.03 (K-0.03)
the correct values for each offset. In all cases, the main goal N15 Z-1.255
will be to aim for the middle tolerance in machining, not in N16 U0.2
programming. N17 GOO G40 X5.0 Z5.0 T0100
N18 M01
Diameter Tolerances
(T03 - FINISH TURN)
The drawing Figure 34-3 shows the sample part with
in N19 G50 S3500 T0300
(-- OFFSET 00 AT THE START OF THE TOOL --
variable tolerances only on the diameters. )
N22 X0.365
N23 G01 X0.625 Z-0.03 F0.002
N24 Z-0.4
N25 XI. 0 C-0.03 (K-0.03) T0314
(-- OFFSET 14 FOR THE 1.0 DIAMETER )
N26 Z-0.75
N27 XI. 375 C-0.03 (K-0.03) T0313
(-- OFFSET 13 FOR THE 1.375 DIAMETER )
N28 Z-1.255
N29 U0.2
N30 GOO G40 X5.0 Z5.0 T0300
(-- OFFSET 00 AT THE END OF TOOL )
N31 M01
Note that the Z-offset (which controls shoulders) must be ing examples, only T03 will be shown from now on.
the same for both wear offsets.
TURNING AND BORING 297
Multiple offsets - example for shoulders - 03402 Multiple offsets - example for diameters and shoulders - 03403
The example drawing shown in Figure 34-4 illustrates The example drawing shown in Figure 34-5 illustrates
the sample part with variable tolerances specified only on the sample part with variable tolerances specified on both
the shoulders. the diameters and shoulders.
The programming solution is to include two offsets for The programming solution is to include four offsets for
example T0313 and T0314.
finishing, for In the control, finishing, for example T033, 1 4, T03 15 and T03 6. In
T03 1 1
their amounts have to be set before machining - the ideal the control, their amounts have to be set before machining -
amounts for middle tolerance are shown: the ideal amounts for middle tolerance are shown:
(T03 - FINISH TURN) Note that the four X offsets (which control size of the dia-
N19 G50 S3500 T0300 meters) tie up with the four Z offsets (which control the
(-- OFFSET 00 AT THE START OF TOOL --) length of shoulders). Here is the T03 for program 03403:
N20 G96 S750 M03
N21 GOO G42 XI. 7 Z0.1 T0313 M08 03403
(-- OFFSET 13 FOR THE 0.4 SHOULDER )
N27 XI. 375 C-0.03 (K-0.03) T0316 FUNCTIONS FOR GEAR RANGES
(-- OFFSET 16 FROM X OVER TO X UNDER ONLY ---)
N28 Z-1.255
N29 U0.2 A number of CNC lathes are designed to work in several
N30 GOO G40 X5.0 Z5.0 T0300 ranges of gear engagement. This feature enables the pro-
OFFSET 00 AT THE END OF TOOL )
grammer to coordinate the required spindle speed with spe-
N31 M01
cific power requirements of the machine. As a general rule,
the higher the requirement for spindle speed, the lower the
maximum available power rating will be, and vice versa.
The CNC operator must always be aware of the existence
The ranges of spindle speed and power ratings for each
of multiple offsets program as well as the program-
in the
mer’s reason for using them. Initial settings are always crit
range arc determined by the machine manufacturer, and
must never be changed.
ical, so are all changes during machining. As can be seen in
OFFSET SETTING
Number of available ranges
n-
ndiiye
The OFFSET screen selected by pressing a key on the 1 2 3 4
control panel will initially display the tool geometry and
the tool wear offsets. They are identical, except the title at Low - M41 M41 M41
the top of the screen. A typical display will resemble this
screen layout (no offsets set): Medium Low - - -
M42
- M43
NO. X AXIS Z AXIS RADIUS TIP
and the Tip columns arc only used if a tool nose radius off- produce more power.
set is programmed. In that case, the Radius will be the tool
Here is an actual, although unrelated, example:
nose radius and the Tip will be an arbitrary number, as de-
fined by Fanuc, specifying the tool tip orientation. This Low gear range: 20 - 1075 r/min (M41)
subject has been described in Chapter 30. High gear range: 70 - 3600 r/min (M42)
TURNING AND BORING 299
N51 T0100
In CNC turning and boring, there are occasions where the N52 G96 S450 M03
cut from from a diameter to a
a shoulder to a diameter (or N53 GOO G42 X0.3 Z0.1 T0101 M08
shoulder) requires a comer break. Breaking a sharp comer N54 G01 X0.625 Z-0.0625 F0.003
N55 Z-0.4
is a common practice when machining between shoulders
N56 GO 2 X0.825 Z-0.5 R0.1
and diameters. Many engineering drawings specify that all
N57 G01 XI. 125
sharp comers are to be broken, often without suggesting N58 XI. 25 Z-0.5625
their size. It is up to the programmer to decide, usually N59 Z-0.9
within the range of 0.005 to 0.020 inches (0.125 to 0.500 N60 GO 2 XI. 45 Z-1.0 R0.1
mm). The required comer break may be either a chamfer at N61 G01 XI. 675
a 45° angle, or a blend radius - both usually small. If the N62 GO 3 XI. 875 Z-l.l R0.1
N63 G01 Z-1.4375
size of the comer break is specified, then the programmer
N64 X2.0 Z-1.5
must apply it. Comer breaking has three practical reasons:
N65 X2.375
Functionality
N66 X2.55 Z-1.5875
... for strength, ease of assembly, and clearances N67 U0.2
N68 GOO G40 X10.0 Z5.0 T0100
Safety N69 M01
... sharp corners are dangerous
Only the finished contour is programmed (no facing cut),
Appearance
ofZO.l, with the calculated
starting at a selected clearance
... the finished part looks better
X diameter at X0.3. Each contour change point has to be
In lathe work, many comer breaks
apply to cuts between carefully calculated. At the contour end, the last chamfer
a shoulder and the adjacent diameter (the cut takes a 90° has been completed at a clearance of 0.025 above the larg-
turn in one axis at a time). The start and end points calcula- est diameter, at X2.55, and calculated Z axis at Z-l .5875.
01.875
N56 GO 2 XO .725 Z-0.5 R0.1 (ERROR IN X)
The vector
is used to create
I
c+
The K vector
is used to create a chamfer starting from the Z axis,
into the Z-X+, Z-X-, Z+X+, or Z+X- direction
c-
K- K+
Figure 34-8
Vectors I and K for automatic comer chamfering The values of I and K commands are always single values
(i.e., radius values, not diameter values).
When the control system encounters a block containing
Many latest controls use vectors C+ and C- that replace
the chamfering vector or K, it will automatically shorten
I
G01 Z-1.75 10.125 (CUTTING ALONG Z AXIS) If the unit control allows the C+ or C- vectors, the pro-
X4.0 (CONTINUING IN X AXIS AFTER CHAMFER) gramming is much easier, as long as the motion direction is
Z-3.0 (CONTINUING IN Z AXIS AFTER CHAMFER) also specified as a single value per side, not per diameter.
TURNING AND BORING 301
Blend Radius at 90 Degrees The radius deviation can also be from the Z axis towards
The R vector is used Positive value of R vector indicates the radius direction
into the plus direction of the axis not specified in the
... to create a blend radius starting from the X axis,
radius block
into the X+Z-, X-Z-, X+Z+, or X-Z+ direction
Negative value of R vector indicates the radius direction
- or into the minus direction of the axis not specified in the
radius block
... to create a blend radius starting from the Z axis,
into the Z-X+, Z-X-, Z+X+, or Z+X- direction Programming Conditions
The R vector definition is illustrated in Figure 34-9. Breaking corners automatically makes programming for
modern CNC lathes a lot easier, as only drawing dimen-
sions are used and no external manual calculations are nec-
R- R+ essary. Regardless of whether program contains vectors I or
K or C for chamfering, or vector R for blend radius corner,
R+ a r+ the basic conditions and general rules are very similar:
v 2
„ l* J- Chamfers must have a 45° angle and radii
1
R - R+ Direction of cut before the corner rounding must be
perpendicular to the direction of the cut after rounding,
Figure 34-9
along one axis only
Vector R for automatic corner rounding (blend radius) The direction of the cut following the chamfer or radius
must continue along a single axis only, and must have
When the control system encounters the block containing the length equivalent to at least the chamfer length or the
a blend radius vector R, it will automatically shorten the ac- radius amount - the cutting direction cannot reverse
In order to fully appreciate the differences between the ing does not produce a high precision part, that is not the
two programming methods (both are technically correct), purpose of roughing. Its main purpose is to remove un-
compare the following program 03405 with the earlier wanted stock efficiently, which means fast and with maxi-
program 03404. The I and K vectors are used for chamfer- mum tool and leave suitable all-around slock for fin-
life,
ing, as they are more difficult then the C vectors: ishing. Cutting tools used for roughing are strong, usually
with a relatively large nose radius. These tools have to be
03405 (AUTOMATIC CORNER BREAKS USED) able to sustain heavy depths of cut and high cutting feeds.
Common diamond shaped tools suitable for roughing are
N51 T0100 80° inserts (up to 2+2 cutting corners), and trigon inserts
N52 G96 S450 M03
(up to 3+3 cutting corners). 2+2 or 3+3 means on 2 or 3
N53 GOO G42 XO 3 ZO 1 T0101 M08
. .
cutting edges on each side of the insert. Not all inserts can
N54 G01 X0.625 Z-0.0625 F0.003
N55 Z-0.5 RO.l be used from both sides. Figure 34-10 shows some typical
N56 XI. 25 K-0.0625 tools and orientation for rough turning and boring.
N57 Z-1.0 RO.l
N58 XI. 875 R-O.l
N59 Z-1.5 10.0625
N60 X2.375
N61 X2.55 Z-1.5875
N62 U0.2
N63 GOO G40 X10.0 Z5.0 T0100
N64 M01
Rough and finished shapes often require manual calcula- This basic rule means that all roughing should be done
tions, using algebra and trigonometry. These calculations before the first finishing cut is programmed. The reason
should be done on separate sheets of paper, rather than in here is to prevent a possible shift of the material during
the drawing itself. That way, the work is belter organized. roughing, after some finishing had already been done.
Also, if there is a change later, for example, an engineering
design change, it is easier to keep track of what is where. For example, the requirement is to rough and finish both
external and internal diameters. If the above rule is applied
Rough Operations to these operations, the roughing out the outside of the part
will be first, then roughing out the inside of the part, and
A great part of lathe machining amounts to removal of only then applying the finishing cuts. It really does not mat-
excessive stock to create a part, almost completed. This ter whether the roughing is done first externally or inter-
kind of machining is generally known as roughing, rough nally. as long as it gets done before any finish cuts, which
turning, or rough boring. As a machining operation, rough- also can be in either order.
TURNING AND BORING 303
Tool wear can be minimized if the depth of cut is suffi- specifies the amount of material left for these fine opera-
cient and the cutting radius gets 'under the skin’ of the ma- tions. If too much material or too little material is left to be
terial, usually during the first cut. Coolant is usually a must cut during finishing, the part accuracy and surface finish
for most materials and should be applied before the tool ac- quality will suffer. Also, carefully consider not just a stock
tually contacts the part. allowance overall on the part, but individual stock allow-
ances for the X and Z axes.
Finish Operations
As before, there is a general rule of thumb, that on the X
Finish operations take place as the final cutting motions, axis, that is for cutting diameters, leave the stock equivalent
after most of the stock has been removed (roughed out), to or slightly larger than the radius of the subsequent finish-
leaving only a small amount of overall stock for finishing. ing tool. For example,if a .031 inch tool nose radius (0.80
The cutting tool can have smaller nose radius and. for even mm) used for finishing, leave .030 to 0.040 inch slock
is
a better surface finish, higher spindle speeds and lower cut- (about mm). That is the physical stock, the actual slock
1
ting feeds arc typical. amount assigned per side, not on diameter!
Many different tools can be used for finishing operations The amount of stock left on the Z axis (typically for fac-
as well, but the most typical finishing tools are two dia- ing shoulders at 90°) is much more critical. If cutting along
mond shaped inserts, with a 55° and a 35° insert angle. the positive X axis only (for turning), or the negative X axis
Their shape, common orientation and cutting directions are only (for boring), with a tool that has a lead angle of 3° to
shown in Figure 34-11. 5°, do
not leave more than .003 to .006 inch (0.080 to 0. 150
mm) on any straight shoulder. Figure 34-12 shows the ef-
fect of too much stock allowance for certain cutting direc-
tions and a method to eliminate it.
Tool orientation and cutting direction for finishing with Effect of stock allowance W on depth of cut D
common lathe tools. Upper row shows external tools,
lower row shows internal tools. In the illustration, the actual depth of cut D at the face Z
POS, determined by the amount of slock W. To calculate
is
Note that some cutting directions are only recommended the depth D. use this formula:
for light or medium cuts. Why? The answer has a lot to do
with the amount of material (stock) the tool removes in the
specified direction. D = ^
tan
A
— x
_
R +
W + R
2 tan A
Stock and Stock Allowance
The material machined is often called stock. When the where ...
The illustration applies equally to the boring, when the X In CNC lathe programming, a recess can be machined
axis direction is opposite the one shown. To understand very successfully with any tool that is used with the proper
better the consequences of a heavy stock left on the face, depth of cut, and a suitable back angle clearance. It is the
evaluate this example: second requirement that will be looked at next.
Once the recess depth D is known, the formula to calcu- The question is this: What is the actual spindle speed (in
late the angle b is: r/min), when the block N2 is executed? Of course, the spin-
dle speed is unknown at the moment.
cannot be known, It
b = cos
_1 ,
(
— —D
R -
- )
unless the current diameter, the diameter where the tool is
located at that moment, is also known. The control system
keeps track of the current tool position at all times. So,
when block N2 is executed, the actual r/min of the spindle
For the example, the calculation will be: will be calculated for the current diameter, as stored in the
control, specified in the geometry offset entry. For the ex-
ample, consider that the current diameter is 23.5 or X23.5.
.5625 - .045
b = cos'
1
)
= 23.07392
.5625 From the standard r/min formula, the spindle speed cal-
culated for 450 ft/min and 023.5 as 73 r/min is rather slow,
but correct. At the next block, block N3, the tool position is
For actual machining, select a tool with the back angle a
From the
rather close to the part, at diameter of .700 (X0.7).
greater than the calculated angle b. For the illustrated draw-
same standard formula, the spindle speed can be calculated
ing (23.07° required clearance), the selected tool could be
for that diameter as 2455 r/min - considerably fast but also
either a 55° diamond shape (back angle clearance a is 30°
correct. The problem? There may not be one for every
to 32°), or a 35° diamond shape (back angle clearance a is
machine, but if ever there is a problem, the following solu-
50° to 52°) - both are greater than the calculated minimum
tion will eliminate it.
clearance. The actual angles depend on the tool manufac-
turer, so a tooling catalogue is a good source of data. The possible problem will be linked to the rapid motion
from the 023.5 to the 0.700. The actual travel distance
This type of calculation is important for any recesses, un-
(per side of part) is (23.5-.700)/2, which is .400. During 1 1
called a style, a format, a form, a template, as well as sev- ure 34-15. Although a facing cut is illustrated, the approach
eral other terms. Each programmer develops his or her own would be logically the same for a turning or a boring cut.
style over a period of time. A consistent style is important Keep the starting point SP well above the diameter, at least
for efficient program development, program changes and . 00 per side and more, if the actual diameter is not known
1
program interpretation. exactly. The B option of the tool approach is two single axis
at a time. It is a variation of the first example, and the X axis
Program Format -Templates motion can be further split into a rapid and cutting motion,
if required. Finally, the C option uses the clearance in the Z
Most examples have followed a certain program format. axis, farfrom the front face. Again, the final motion toward
Note that each CNC lathe program begins with the G20 or the face can be split into a rapid and linear motion.
G21 command and perhaps some cancellation codes. The
block that follows is a tool selection, next is spindle speed
data, etc. This format will not basically change from one
job to another - it follows a certain consistent pattern which
forms the basic template for writing the program.
O. . (PROGRAM NAME)
N1 G20 G40 G99 (PROGRAM START UP)
N2 T. .00 M4 . . (TOOL AND GEAR RANGE)
N3 G97 S. .MO (STABILIZE R/MIN)
N4 GOO [G41/G42] X. . Z T.. MO 8 (APPROACH)
N5 G96 S. (CUTTING SPEED)
N6 G01 [X../Z. •] F- (FIRST CUTTING MOTION)
N7 ...
(MACHINING)
Safe approach to a part - example for a facing cut shown
N. . GOO [G40] X.. Z.. T.. 00 (TOOL CHG POSITION)
N. . M01 (OPTIONAL STOP) There are many variations on these methods, too numer-
ous to list. The main objective of considering the approach
N. . M30 (PROGRAM END) to the part in the first place is safety. A collision of a tool
% with a revolving part can have serious consequences.
This generic structure is good for most lathe programs. Turning and boring is a large subject. Many other exam-
Feel free to adjust it as necessary. For example, not every ples could have been included in this chapter. Other chap-
job requires spindle speed stabilization, so block N3 will ters in this book also cover turning and boring, but in a
not be necessary. It also means that M03 rotation has to be more specialized way, for example, turning and boring cy-
moved to block N5. Take the general program pattern as an cles. The examples that were presented in this chapter
example only, not as a fixed format. should be useful to any CNC lathe programming.
35 LATHE CYCLES
307
308 Chapter 35
G90 STRAIGHT CUTTING CYCLE The second format adds the parameter I or R to the block
and is designed for taper cutting motions, with the domi-
nance of the Z axis - Figure 35-2.
Before going further, a reminder. Do not confuse G90 for
lathes with G90 for machining centers. In turning, G90 is a
lathe cycle, G90 is the absolute mode in milling:
G90 • w
X(U). z ( )- . I.. F..
G90 X(U). z(w).
• . R.. F..
X = Diameter to be cut
Z = End of cut in Z position
I (R) = Distance and the direction of taper
(1=0 or R=0 for straight cutting)
F = Cutting feedrate (usually in/rev or mm/rev)
Cycle Format used for taper cutting along the horizontal direction. It has
an amount equivalent to one half of the distance from the
The G90 cutting cycle has two predetermined pro- diameter at the taper end, to the diameter at the taper begin-
gramming formats. The first one is for straight cutting only, ning. The R address replaces the I address, and is available
along the Z axis, as illustrated in Figure 35-1. on newer controls only.
Format 1 :
To cancel the G90 cycle, all that is necessary to do is to
use any motion command GOO, G01 G02 or G03. Com-
-
,
X = Diameter to be cut
Z = End of cut in Z position GOO ...
F = Cutting feedrate (usually in/rev or mm/rev)
LATHE CYCLES 309
from a 04. 125 inch stock down to a final 02.22 inch, over If preferred,use the incremental programming method.
the length of 2.56 inches. There are no chamfers, no tapers, However, it is program progress with the
easier to trace the
and no radii. This fact restricts the practical usefulness of absolute coordinates than the incremental distances. How-
the G90 cycle to a very simple roughing only, but still beats ever, here is the incremental version:
the manual alternative.
03502
(G90 STRAIGHT TURNING CYCLE - INCREMENTAL)
N1 G20
N2 T0100 M41
N3 G96 S450 M03
N4 GOO X4.325 ZO.l T0101 M08 (START POINT)
N5 G90 U-0.5075 W-2.655 F0.01 (PASS 1)
N6 U-0.3075 (PASS 2)
N7 U-0.3075 (PASS 3)
N8 U-0.3075 (PASS 4)
N9 U-0.3075 (PASS 5)
N10 U-0.3075 (PASS 6)
Nil GOO X10.0 Z2.0 T0100 M09
N12 M01 (END OF ROUGHING)
Since G90 is a roughing cycle, the depth of each cut has Taper Cutting Example
to be selected first, then the stock amount left for finishing.
To decide on the depth of each cut, find out how much The Figure 35-4 is a drawing similar to that used for the
stock is actually there to be removed from the diameter. previous example. In this example, a taper will be cut, also
The actual amount of stock is calculated per side, as a ra- using the G90 simple cycle.
dius value, along the X axis:
For a .030 stock per side for the finishing cut, the .030
willbe subtracted from the total X stock, so the total depth
amount to remove will be .9225. Next is the selection of cut
segmentation for the total depth. For five even cuts, each
depth of cut will be .1845, for six cuts, .1538. Six cuts will
be selected and .030 left per side, or 0.06 on the diameter -
the first diameter will be X3.8175. Also, .005 stock allow-
ance will be left on the face, so the Z axis end of cut will be
at Z-2.555. The actual clearance above the diameter and in
front of the part will be the usual .100.
03501
(G90 STRAIGHT TURNING CYCLE - ABSOLUTE)
N1 G20
N2 T0100 M41
N3 G96 S450 M03
N4 GOO X4.325 ZO.l T0101 M08 (START POINT) Example of G90 cycle in taper cutting - program 03503
N5 G90 X3.8175 Z-2.555 F0.01 (PASS 1)
N6 X3.51 (PASS 2) In order to distinguish between the straight cutting and
N7 X3.2025 (PASS 3) the taper cutting methods, using the same G90 cycle, there
N8 X2.895 (PASS 4) must be a way to distinguish these two kinds of cut, and
N9 X2.5875 (PASS 5) there is one indeed.
310 Chapter 35
Figure 35-6
The I amount used for G90 turning cycle - external and internal
for external taper cutting (turning) and positivefor internal The I distance calculation using the similar triangles method
taper cutting (boring).
The example shown above almost suggests the simplest
To program the part in Figure 35-4, keep in mind that the
method of calculation, a method that is known in mathe-
illustration represents the finished item and does not con- matics as the law ofsimilar triangles. This law has several
tain any clearances. Always add all necessary clearances possible definitions, and the one that applies here is that ...
first, then calculate the I amount.
Chapter 52 for details on shop mathematics). Figure 35-6 method, expecting the same result. Both methods will be
and Figure 35-7 illustrate the details of the known and un- used here, to confirm the accuracy of the calculation.
known values for the I amount calculation.
LATHE CYCLES 311
i = (4-2.25) / 2 = 0.875
I / 2.7 = i / 2.5
The amount of I can be calculated using the result: 02.750 and the 01.750:
Nil M01 (END OF ROUGHING) suitable depth of cut, with safety in mind, as well as the cut-
ting conditions. In this example, the depth of cut selection
will benefit from one simple programming technique. If
Straight and Taper Cutting Example the depth of cut is selected arbitrarily, the last depth will be
whatever is left to cut. A better way is to select a calculated
Another variation of a taper is also common in CNC pro-
number of equal cuts - Figure 35-9.
gramming. The Figure 35-8 shows another simple draw-
ing, this time with a taper and a shoulder.
312 Chapter 35
roughing and three cuts of .173 for the tapered cutting. All G94 X(U).. Z(W).. F..
stock allowances are in effect.
For tapered turning, the cycle format is:
The program 03504 will use the calculations:
The result will also include the sign of the / amount. G94 turning cycle structure - straight and tapered application
LATHE CYCLES 313
turning, the advanced cycles for CNC lathe work are much be covered separately in Chapter 38.
more sophisticated. The major and most distinctive feature
An important fact to take a note of, is that the format of
of these cycles is their departure from the repealed order of
programming method of data input, is
for these cycles, the
operations. Lathe work can be very complex and the mod-
different for the lower level of Fanuc controls, such as the
ern control systems do reflect that need. Not only straight
very popular OT or the 16/ 18/20/2 IT series, than for the
or tapered cuts can be programmed, but also radii, cham-
higher level, such as the 10/1 IT or the 15T series. These
fers, grooves, undercuts, etc, simply, several of these cycles
cycles, if they are available for the lower level controls, re-
are used for contouring. Tool nose radius offset may also be
programming format in two blocks, not the nor-
quire their
applied, if applicable to the job.
mal one block. Check the parameter settings for each con-
Multiple repetitive cycles as these cycles are called, re-
,
trol, to find about compatibility issues. Description of both
quire a computer memory in order to be useful, so the old formats is also included in this chapter.
Chipbreaking Cycles
G75 Peck grooving cycle in X axis - vertical
sufficient detail in Chapter 38. really a ‘peck-grooving’ cycle, is used rarely, as it does not
produce a precision groove.
314 Chapter 35
By far, the profile cutting cycles (contouring cycles), are file cutting cycle. It can be defined in simple terms:
the most common cycles in CNC lathe programming. They
are used for external (turning) and internal (boring) mate- The start point is defined as the last XZ coordinate
location of the tool, before the profile cutting cycle is called.
rial removal, along almost any machinable contour.
Boundary Definition Typically, this start point will be closest to the part corner
where therough cutting begins. It is important to select the
The roughing cycles are based on two the definition of
start point very carefully, because it is more than ‘just a start
boundaries, typically called the material boundary, which point’. In fact, this special point controls all approach clear-
is the outline of the blank, and the part boundary, which is
ances and the actual depth of the first roughing cut.
the outline of the part contour. This is not a new concept at
the material is removed in an orderly way. following speci- Point Q represents the block number of
fied machining parameters in the cycle call block or blocks. the last XZ coordinate of the finished contour.
Mathematically, the minimum number of points that can
define an area is three. These three points must be nonlinear
Other in-depth considerations relating to the P and Q
(meaning not on the same line). Figure 35-11 shows a sim-
boundary points are equally important, and there are quite a
ple boundary with only three points and a boundary con-
few of them:
sisting of many points.
A number of points may be defined between the P and Q
Material boundary points, representing the XZ coordinates of the finished
c ,A
T / '
contour. The contour is programmed using G01, G02,
,
1
and G03 tool motions, including feedrates.
r
—
i
1
Roughing area The material removal defined by the starting point and
Part boundary defined by the P-Q contour must include all necessary clearances.
three points only
B Tool nose radius offset should not be included between
the P and Q points, but programmed before the cycle is
Material boundary called, usually during the motion to the start point.
C
tA
1
For roughing, the material to be machined will be divided
Y into a series of machinable cuts. Each roughing cycle
1 1
Roughing area accepts a number of user supplied cutting parameters.
i
* defined by more J
Part boundary For safety reasons, the diameter of the start point
than three points should be above the stock diameter for external cutting,
"**B
and below the core diameter for internal cutting.
Figure 35-11 The tool motion between the P point and the Q point
Material and part boundaries as applied to turning must be steadily increasing for external cutting, or
steadily decreasing for internal cutting.
In the profile cutting cycles,each point represents a tool
Any change in direction between P and Q points is allowed
position and the points A, B, and C represent the extreme
only if Type II cycle is availableand programmed, and then
corners of the selected (defined) machining area. in one direction only - see the next section for details.
The material boundary is not actually defined, it is only Blocks representing the first XZ coordinate of the
In the initial versions of the contour cutting cycles, a in turning and boring cycles,
it also supports the Type /, if it
change of the contouring direction into the opposite direc- needs be used for some special applications. That means,
to
tion along one axis was not allowed. That limited these cy- Fanuc has not replaced one type for another, it has added
cles to some extent, because common undercuts or recesses the Type II. Of course, the question is - how to distinguish
were not possible to use in the program, yet they were com- between the two types in the program? The key to the type
mon in machine shops. selection is in the contents of the block that immediately
follows the cycle call:
Presently, this older method is called Type I repetitive cy-
many more advanced soft- Type only one axis is specified
cles. The modern controls use 1 ...
ware features and the change in a single direction is now al- Type II ... two axes are specified
lowed. This newer method is now called Type //, allowing
more programming flexibility when cutting recesses and O Example - Type 1
TYPE CYCLE 1
O Example - Type II
... contour change On the next few pages is a description of the six turning
is not allowed cycles, covered in detail. It is important to understand the
format of each cycle as it applies to a particular control.
Figure 35- 12 Several Fanuc control models are available and for the pur-
Comparison of Type I and Type II cycles - poses of programming these multiple repetitive cycles,
- bi-directional change along two axes is not allowed
they can be separated into two groups:
Type I allows a steadily increasing profile (for external Fanuc system OT, 16T, 18T, 20T, 21 T ... lower level
cutting) or steadily decreasing profile (for internal cutting)
Fanuc system 1 0T, 1 1 T, 1 5T ... higher level
from die point P Q (typical cutting directions).
to the point
On older controls, opposite X or Z direction is not allowed. Practically, it only means a change in the way the cycle is
Modern controls do allow an undercut to be machined with programmed, but the subject is also important for solving
Type I, but the cutting will be done with a single pass. That some incompatibility problems. Note that the tool function
may cause some heavy metal removal in certain cases. T is not specified in any of the examples, although it is also
Make sure to know exactly which type the control system allowed as a parameter in all multiple repetitive cycles. Its
supports. Some experimentation may be necessary. only need maybe for a tool offset change.
of an undercut will be a multiple tool path. The selection of to remove stock by horizontal cutting, primarily along the
Type I or Type II is applicable to the cycle, by programming Z axis, typically from the right to the left. It is used for
both axes in the block represented by the P point. This is roughing out material out of a solid cylinder. Like all cy-
typically the block immediately following the cycle call in cles, it comes in two formats - a one-block and a double
the program (after G7 1 ,
G72, etc.). block format, depending on the control system.
316 Chapter 35
G71 P.. Q.. I.. K.. U.. W.. D.. F.. S..
G71 Cycle Format - OT/1 6T/1 8T/20T/21 The stock material in the example has an existing hole of
09/16 (.5625). For external cutting of this part, a standard
If the control requires a double block entry for the G7 80° tool will be used for a single cut on the face, as well as
cycle, the programming format is:
for roughing the outer shape.
and the retract amount R is set by a system parameter. the program and the internal roughing can be programmed
for the next tool. In all examples that include a tool change
The external and internal use of the G7 1 cycle will use the between a short tool (such as a turning tool) and a long tool
drawing data in Figure 35-13. (such as a boring bar), it is important to move the short tool
further from the front The motion should be far
face.
enough to accommodate the incoming long tool. The clear-
ance is 6.0 in the above example (block N1 8 with Z6.0).
LATHE CYCLES 317
!
SP
is
to P direction
negative for
external cutting
N21 G96 S400 M03 (SPEED FOR ROUGH BORING)
N22 GOO G41 XO 5 Z0.1 T0303 M08
. (START POS.) P
N23 G71 P24 Q31 U-0.06 WO. 004 D1000 F0.012 P
N24 GOO XI. 55 (P POINT = START OF CONTOUR)
SP to P direction
ispositive for
N25 G01 XI. 25 Z-0.05 F0.004
i external cutting
N26 Z-0.55 R-0.1 F0.008 j -A SP
N27 XO 875 K-0.05
.
The part has been completely roughed out. leaving only G72 - STOCK REMOVAL IN FACING
the required stock on diameters and faces or shoulders. Fin-
ishing with the G70 cycle, described later, is possible with
the same tool, if tolerances and/or surface finish are not too
The G72 cycle is identical in every respect to the G7 1 cy-
cle, except the stock is removed mainly by vertical cutting
critical. Otherwise, another tool or tools will be required in
(facing), typically from the large diameter towards the
the same program, after a tool change.
spindle center line XO. It is used for roughing of a solid cyl-
At this stage, evaluate what has been done and why. inder, using a series of vertical cuts (face cuts). Like all
Many principles that applied to the example are very com- other cycles in this group, it comes in two formats - a one
mon to other operations that also use the multiple repetitive block and a double block format, depending on the control
cycles. It is important to learn them well at this point. system. Compare G72 with the G71 structure on examples
in this chapter.
The control system will process the cycle for external P = The first block number of the finishing profile
cutting, if the X direction from the start point SP to the Q = The last block number of the finishing profile
= Distance and direction of rough semifinishing
P is negative. In the example, the X start point is X3.
I
point 1
in the X axis - per side
the P point is XI .7. The X direction is negative or decreas-
K = Distance and direction of rough
ing and an external cutting will take place.
semifinishing in the Z axis
U = Stock amount for finishing on the X axis diameter
The control system will process the cycle for internal cut-
ting, if the X direction from start point SP to the point P is
W = Stock left for finishing on the Z axis
D = The depth of roughing cut
positive. In the example, the X start point is X0.5, the P
F = Cutting feedrate (in/rev or mm/rev) overrides
point is XI. 55. The X direction is positive or increasing,
feedrates between the P block and the Q block
and an internal cutting will take place.
S = Spindle speed (ft/min or m/min) overrides spindle
speeds between the P block and the Q block
Figure 35-14 illustrates the concept of G71 cycle, as ap-
plied to both, external and internal cutting. The meaning of each address is the same as for the G71
cycle.The I and K parameters are not available on all
By the way, although thes/g/i of the stock U value is very
machines. These parameters control the amount of cut for
important for the final size of the part, it does not determine
semifinishing, whichis the last continuous cut before final
the mode of culling. This concludes the section relating to
roughing motions are completed.
the G71 multiple repetitive cycle. The face roughing cycle
G72 is similar, and is described next.
318 Chapter 35
G72 Cycle Format - OT/1 6T/1 8T/20T/21T 03506 (072 ROUGHING CYCLE - ROUGHING ONLY)
N1 G20
If the control system requires a double block entry for the N2 T0100 M41 (OD FACING TOOL + GEAR)
G72 cycle, the programming format is: N3 G96 S450 M03 (SPEED FOR ROUGH FACING)
N4 GOO G41 X6.25 Z0.3 T0101 M08 (START POS.)
G72 W.. R.. N5 G72 P6 Q12 U0.06 WO. 03 D1250 F0.014
G72 P.. Q.. U.. W.. F.. S.. N6 GOO Z-0.875 (P-POINT = START OF CONTOUR)
N7 G01 X6.05 F0.02
1
Q = The last block number of the finishing profile SP and compare it with the G71 cycle.
U = Stock amount for finishing on the X axis diameter
W = Stock left for finishing on the Z axis
F = Cutting feedrate (in/rev or mm/rev) overrides
feedrates between the P block and the Q block
S = Spindle speed (ft/min or m/min) overrides spindle
speeds between the P block and the Q block
G73 P.. Q.. I.. K.. U.. W.. D.. F.. S..
W — Stock left for finishing on the Z axis There are three important input parameters in the G73 cy-
D = The number of cutting divisions cle -
1, K and D. One parameter seems to be missing - there
F = Cutting feedrate (in/rev or mm/rev) overrides
is no depth of cut specification! In the G73 cycle, it is not
feedrates between the P block and the Q block
needed. The actual depth of cut is calculated automatically,
S = Spindle speed (fVmin or m/min) overrides spindle
based on these three parameters:
speeds between the P block and the Q block
I ... amount of rough material to remove in the X axis
G73 Cycle Format - OT/1 6T/1 8T/20T/21
K . . . amount of rough material to remove in the Z axis
Figure 35-17
(03505 CONTINUED . . .)
N39 M01
the P and Q points. Each individual tool path is offset by a N45 M30 (END OF PROGRAM)
calculated amount along the X and Z axes. On the machine, %
watch the progress with care - particularly for the first tool
path. Feedrate override may come useful here. Even for the external finishing, the cutting tool is still pro-
grammed above the original stock diameter and off
to start
the front face, although all roughing motions have already
G70 - CONTOUR FINISHING CYCLE
been completed. A similar approach applies to the internal
cut. For safety reasons, this is a recommend practice.
The of the contouring cycles isG70. Although it has a
last
smaller G number than any of the three roughing cycles There are no feedrates programmed for the G70 cycle, al-
G71, G72 and G73, the finishing cycle G70 is normally though the cycle format accepts a feedrate. The defined
used after any one of these three roughing cycles. As its de- block segments P to Q for the roughing tool already include
scription suggests, it is strictly used/or the finishing cut of a feedrates. These programmed feedrates will be ignored in
previously defined contour. the roughing mode and will become active only for the G70
cycle, during finishing. If the finish contour did not include
G70 Cycle Format - All Controls any feedrates, then program a common feedrate for finish-
ing all contours during the G70 cycle processing. For ex-
For this cycle, there is no difference in the programming ample, program block
format for various controls - it is all the same, and the cycle
call is a one-block command. N37 G70 P9 Q17 F0.007
Return motion to the start point is automatic, I = Depth of each cut (no sign)
and must not be programmed K = Distance of each peck (no sign)
D = Relief amount at the end of cut
The P block G71 should not include
in
(must be zero for face grooving)
the Z axis value (Z or W) for cycle Type I
F = Groove cutting feedrate (in/rev or mm/rev)
S = Spindle speed (ft/min or m/min)
Change of direction is allowed only for Type II
D address does not use decimal point, and must be First block:
If both the X(U) and I (or P) are omitted in the cycle, the I
= Depth of each cut (no sign)
machining is along the Z axis only (peck drilling). In a typi- K = Distance between grooves (no sign)
G75 R..
G75 X..(U..)Z..(W..)P.. Q.. R.. F.. S..
G75 - GROOVE CUTTING CYCLE A practical example of G75 cycle will be presented in the
next chapter.
The G75 cycle is the other of two lathe cycles available
for simple, non precision work. Together with the G74 cy- BASIC RULES FOR G74 AND G75 CYCLES
cle, used for operations requiring an interrupted cut, for
it is
cept the X axis is replaced with the Z axis. The relief amount at the end of cut can be omitted -
Groove shape
GROOVING OPERATIONS
Groove location on a part
The cutting tools for grooving are either external or inter- Groove dimensions and tolerances
nal and use a variety of inserts in different configurations.
Unfortunately,many grooves are not of the highest qual-
The most important difference between grooving and turn-
ity. Perhaps it ismany grooves do not require high
because
ing is the direction of cut. Turning tool can be applied for
precision and when a high precision groove has to be done,
cuts in multiple directions, grooving tool is normally used
the programmer does not know how to handle it properly.
to cut in a single direction only. A notable exception is an
Watch particularly for surface finish and tolerances.
operation known as necking (relief grooving), which takes
place at 45°, where the angle of the cutting insert and the
angle of infeed must be identical (usually at 45°). There is GROOVE SHAPE
another application of a two axis simultaneous motion in
grooving, a corner breaking on the groove. Strictly speak- The first evaluation before programming grooves is the
ing, this is a turning operation. Although a grooving tool is groove shape. The shape is determined by the part drawing
not designed for turning, it can be used for some light ma- and corresponds to the purpose of the groove. The groove
chining, like cutting a small chamfer. During the corner shape is the single most important factor when selecting the
breaking cut on a groove, the amount of material removal is grooving insert. A groove with sharp corners parallel to the
always very small and the applied feedrate is normally low. machine axes requires a square insert, a groove with radius
requires an insert having the same or smaller radius. Spe-
Main Grooving Applications cial purpose grooves, for example an angular groove shape,
will need an insert with the angles corresponding to the
Groove an essential part of components machined on
is
groove angles as given in the drawing. Formed grooves re-
CNC lathes. There are many kinds of grooves used in quire inserts shaped into the same form, etc. Some typical
industry. Most likely, programming will include many un-
shapes of grooving inserts are illustrated in Figure 36-1.
dercuts, clearance and recess grooves, oil grooves, etc.
Some of the main purposes of grooving are to allow two
components to lit face-to-face (or shouldcr-to-shoulder)
and, in case of lubrication grooves, to let oil or some other
lubricant to flow smoothly between two or more connect-
ing parts. There are also pulley or V-belt grooves that are
used for belts to drive a motor. O-ring grooves are specially
designed for insertion of metal or rubber rings, that serve as
stoppers or sealers. There are many other kinds of grooves.
Figure 36-1
Many industries use grooves unique to their needs, most
Typical shapes of common grooving tools
others use the more general groove types.
323
324 Chapter 36
Nominal Insert Size Although some variations are possible, for practical pur-
poses, only these three categories are considered. Each of
In many groove cutting operations, the groove width will
the three locations may be either external or internal.
be greater than the largest available grooving insert of a
nominal size (/.<?., off the shelf size). Nominal sizes are nor- The two most common groove locations are on a cylin-
mally found in various tooling catalogues and typically der, i.e., on a straight outside - or external - diameter, or on a
have widths like mm, 2 mm, 3
1 mm
or 1/32, 3/64, 1/16, 1/8 straight inside - or internal - diameter. Many other grooves
in inches, and so on, depending on the units selected. may be located on a face, on a taper (cone), even in a cor-
ner. The illustration in Figure 36-3 shows some typical lo-
For example, a groove width of .276 inches can be cut
cations of various grooves.
with a nearest lower nominal insert width of .250 inch. In
such cases, the groove program has to include at least two
cuts one or more roughing cuts, in addition to at least one
-
Cut distribution for grooves wider than the insert GROOVE DIMENSIONS
Insert Modification
The dimensions of a groove are always important when
Once in a while, programmers encounter a groove that re- selecting the proper grooving insert. Grooving dimensions
quires a special insert in terms of its size or shape. There are include the width and the depth of a groove, as well as the
two options to consider. One
have a custom made in-
is to corners specifications. It is not possible to cut a groove with
sert, if it is possible and practical. For a large number of an insert that is larger than the groove width. Also, it is not
grooves, it may be a justified solution. The other alternative possible to feed into a groove depth that is greater than the
Groove Position In the Figure 36-5a, the top and bottom diameter of the
groove are both given. This method has a major benefit that
In Figure 36-4 are shown two most common methods of
the bottom diameter of the groove will actually appear as
dimensioning a typical groove. The groove width is given
an X axis amount inthe program. A disadvantage is that the
in both cases as dimension W, but the distance L from the
actual depth still has to be calculated and a proper grooving
front face is different in the example a and the example b.
tool selected. The example in Figure 36-5b docs show the
groove depth, but most likely, the bottom diameter will
have to be calculated manually. Both dimensioning exam-
ples are about equally common in CNC programming.
The simplest of all grooves is the one that has the same
width and shape as the tool cutting edge - Figure 36-6.
The sample program uses the tool T08, as the last tool: PRECISION GROOVING TECHNIQUES
03601 (SIMPLE GROOVE)
(G20) A simple in-out groove will not be good. Its sides may
have a rough surface, the outside corners will be sharp and
N33 T0800 M42 (TOOL 8 ACTIVE) its width is dependent on the insert width and its wear. For
N34 G97 S650 M03 (650 RPM SPEED) most of machining jobs, such a groove is not acceptable.
N35 GOO X3.1 Z-0.625 T0808 M08 (START POINT)
N36 G01 X2.637 F0.003 (FEED-IN TO DEPTH) To program and machine any precision groove requires
N37 G04 X0.4 (DWELL AT THE BOTTOM) extra effort, but the result will be a high quality groove.
N38 X3.1 F0.05 (RETRACT FROM GROOVE) This effort is not always justified, as high quality comes
N39 GOO X6.0 Z3 0 T0800 M09
. (CLEAR POSITION) with a price. The next two illustrations show the groove di-
N40 M30 (END OF PROGRAM)
mensions and program related details. Drawing in Figure
%
36-7 shows a high precision groove, although its width is
intentionally exaggerated for impact of the example.
The program 03601 does the following. First, the Eng-
lish mode of input is preset from the beginning of the pro-
gram with G20. Blocks N33 and N34 are startup blocks for
0.1584
the tool T08, with direct r/tnin selected. Constant Surface
Speed (CSS) in G96 mode can be selected instead. N35 is a
block where the tool moves to the position from which the
groove will be started (start point). Clearance at this safe lo-
cation is the clearance above the part diameter, which is
.074 inches in the example:
actual difference between the insert width and the groove width of 1250 of an inch. That translates into the minimum
.
width is so small (.00215 inch over two walls), there is very of two grooving cuts. Always round upwards, to the nearest
little material to cut. integer: .1584/ 1250= 1. 2672=2 cuts.
The dimensional difference would allow only slightly A possible decision could be to plunge once to finish the
more than .001 per each side of the groove, which may left one more plunge, to finish
side of the groove and, with
cause the insert to rub on the wall rather than cut it. A better the groove right side. The necessary overlap between the
choice is to step down to the next lower standard insen two cuts is guaranteed and the only remaining operation is
width, that is l/8th of an inch (.1250). There is much more the chamfering. A groove programmed this way may be ac-
flexibility with 1/8 width than with 5/32 width. Once the ceptable, but will not be of a very good quality.
The first few program blocks can now be written: In order to write first class programs, make the best efforts
to deliver an exceptional quality at th e programming level,
03602 (PRECISION GROOVE) in order to prevent problems at the machining level.
(G20)
Machining Method conditions, better surface finish control and better tool life.
Once the grooving tool has been selected and assigned a If this observation is used in the current example, an im-
tool station number (tool turret position), the actual method portant conclusion can be made. If two plunge cuts of un-
of machining the groove has to be decided. Earlier, the ma- even width will yield at least acceptable results, three cuts
chining method has been described generally, now a more that are equally distributed should yield even better results.
Look carefully at how these factors are implemented in Next look is at the X axis positions. The first position is
the example. The first factor applied under the program where the plunge will start from, the second position is the
control is the groove position. The groove position is given end diameter for the plunging cut. A good position for the
in the drawing as .625 inches from the front face of the part, start is about .050 per side above the finished diameter,
of the groove. There is no plus or minus di-
to the left side which in this case would be a clearance diameter calculated
mensional tolerance specified, so the drawing dimension is from the 04.0:
used as arbitrary and is programmed directly. The second
factor under the program control is the groove width. That 4.0 + .05 X 2 = 4.1 (X4.1)
is .1584 of an inch on the drawing and the selected tool in-
sert width is .1250. The goal is to program the cutting mo- Do not start the more than .050
cut with a clearance of
tions in three steps , using the technique already selected: inch (1.27 mm) with slow feedrates that are typical to
-
grooves, there will be too much air to cut, which is not very
O STEP 1 The end diameter is the groove bottom, given on
efficient.
the drawing as 3.82. Dimension of X3.82 could be pro-
Rough plunge in the middle of the groove, leaving an
equal material stock on both groove faces for finishing
grammed as the target diameter, but it does help to leave a
- also leave small stock on the bottom of the groove
very small stock, such as .003 per side (.006 on diameter),
to make a sweep finish of the groove bottom. That will add
O STEP 2 two times .003 to the 3.82 groove diameter, for the pro-
grammed X target as X3.826. Once the plunge is done, the
Program the grooving tool operation on the left side
tool returns to the start diameter:
of the groove, including the chamfer (corner break)
© STEP 3
N43 GOO X4.1 Z-0.6083 T0303 M08
N44 G01 X3.826 F0.004
Program the grooving on the right side
tool operation N45 GOO X4.1
chamfer (corner break) and
of the groove, including the
sweep the groove bottom towards the left wall. The rapid motion back above the groove (N45) is a good
choice in this case, because the sides will be machined later
The last two chamfer cutting or a corner
steps require
with the finishing cuts, so the surface finish of the walls is
break. The width of the chamfer plus the width of the sub-
not critical at this moment. After roughing the groove, it is
sequent cut should never be larger than about one half to
time to start the finishing operations.
three quarters of the insert width. In the third step, sweep-
ing of the bottom is desired. That suggests the need to con- All the calculated amounts can be added to the previous
sider stock allowances for finishing. Figure 36-8 and create data for a new Figure 36-9:
,
Finishing Allowances
During the first step, the first plunge has to take place at
the exact center of the groove. To calculate the Z axis posi-
tion for the start, find first the amount of stock on each wall
that is left for finishing. The stock amount will be one half
of the groove width minus the insert width - see details in
the previous Figure 36-8:
Groove Tolerances the grooving tool will not contact the right side wall stock.
That means do not retract the tool further then the position
As in any machining, program for grooves must he struc-
of Z-0.6083. It also means do not rapid out. because of a
tured in such a way, that maintaining tolerances at the ma-
possible contact during the 'dogleg' or ‘hockey stick’ mo-
chine will be possible. There is no specified tolerance in the
tion, described in Chapter 20 - Rapid Positioning. The best
example, but it is implied as very close by the four-decimal
approach is to return to the initial start position at a rela-
place dimension. A tolerance range, such as 0.0 to +.00 is 1 .
the drawing dimension of .1584 (selected intentionally). At this point, the left side wall is finished. To program the
motions for the right side wall, the tool has to cut with the
A possible problem often encountered during machining
and a problem that influences the groove width the most, is
right side (right edge) of the grooving insert. One method is
when was planned, offset 03 ond offsetis programmed. This is the only block where off-
Earlier, the precision groove
set 13should be applied - one block before, it’s too early,
had been assigned to the grooving tool. Why would an ad-
and one block, after it’s too late.
ditional offset be needed at all? Assume for a moment, that
all machine settings use just a single offset in the program.
Block N51 contains the target chamfer position and the
Suddenly, during machining, the groove gets narrower due absolute mode for the X axis and is combined with the in-
to tool wear. What can be done? Change the insert? Modify
cremental mode for the Z axis.
the program? Change the offset? If the Z axis offset setting
is adjusted, either to the negative or positive direction, that To completethe groove right side wall, finish the cut at
will change the groove position relative to the program zero the fullbottom diameter, block N52, then continue to re-
but it will not change the groove width! What is needed is a move the stock of .003 from the bottom diameter (block
second offset, an offset that controls the groove width only. N53) - this is called sweeping the groove bottom :
In the program 03602, the left chamfer and side will lx;
finished with one offset (03), the right chamfer and side N52 X3.82 F0.003
will use a second offset. To make the second offset easier to N53 Z-0.6247 T0303
remember, number 13 will be used.
Also look at the Z axis end amount
a small value - it is
One other step has to be finished first - calculation of the that is .0003 short of the .625 drawing dimension! The pur-
left chamfer Z-0.6083
start position. Currently, the tool is at pose here compensate for a possible tool pressure.
is to
but has to move by the wall stock of .0167 and the chamfer There will not be a step in the groove corner! Because the
width .0 2 as well as clearance of .050 - for a total travel of
1 sweep will end at the left side of the groove, the original
.0787, to Z-0.687 position. At a slow feedrate, the chamfer offset (03) must be reinstated. Again, the block N53 is the
is done first and the cut continues to finish the left side, to only block where the offset change is correct. Make sure
the same diameter as for roughing, which is X3.826: not to change the tool numbers - the turret will index !
N46 Z-0.687 The intended program 03602 can now be completed. All
N47 G01 X3.976 Z-0.625 F0.002 that remains to be done is the return to the groove starling
N48 X3.826 F0.003 position, followed by the program termination blocks:
The next step is to return the tool above part diameter. N54 X4.1 Z-0.6083 F0.04
This motion is more important than it seems. In the pro- N55 GOO X10.0 Z2.0 T0300 M09
gram, make sure the finished left side is not damaged when N56 M30
the tool retracts from the groove bottom. Also make sure %
330 Chapter 36
N56 M30 cases, the program will most likely benefit from developing
% a subprogram (subroutine) for multiple grooves, that will
be called at various groove locations. Subprograms save
WARNING ! valuable programming lime, they are easily designed and
It is very important to use caution when a double easily edited. Although subprograms will be discussed in
is used during machining
tool offset for a single tool Chapter 39. an example of a multiple groove programming
( this warning applies generally - not only for grooving )
using a subprogram is shown at the end of this chapter, at
least for reference and basic introduction.
Remember that the purpose of the offset in the example is
If the groove width becomes too narrow and has to be M01 can be useful in this case. When all chips have been
adjusted, only the Z offset amount is changed. removed, continue with the same tool to cut more grooves.
Figure 36- 1
This is the actual groove width amount, .275 in the given Standard grooving insert modified for face grooving
example. Always keep in mind that the program will use a
smaller .250 wide face grooving insert. Following the pro- Face Grooving Program Example
gramming examples of a precision groove, listed earlier,
Program 03603 uses modified insert and a .012 corner
three cuts will be made - one rough plunge in the middle of
break, to eliminate sharp corners. Only one offset is used in
the groove, and two finishing cuts, with a small corner
the program. The tool set point is the lower edge of insert,
break. But first, let’s look at the radial clearance of the
corresponding to the 02.075. All calculations should be
grooving tool. This is a very important programming con-
easy to retrace, they use exactly the same procedures as
sideration; one that is unique to most face grooving opera-
those described for vertical grooving:
tions, yet, it is also one that is easy to be overlooked.
CORNER GROOVES / NECK GROOVES Block N219 positions the tool in such a way that the cen-
terof insert (as well as the setup point) is in on center line of
the neck groove (.050 clearance in X and Z axes). Blocks
Corner grooving is also a grooving operation, one that
N220 and N222 are the two cutting motions - one into the
uses a special grooving insert designed to cut along a 45°
groove in N220, the other out of the groove in N222. The
angular motion. The groove can be square or with a radius,
amount of travel is exactly the same in either direction. The
depending on the tool and insert used and design required.
dwell of 0. second is added for convenience at the bottom
1
radius minimum undercut. peck drilling, the G75 is used for cutting in the X axis, and
is used mostly for simple grooving.
N224 M30
% Schematic representation of the G75 cycle
GROOVING ON LATHES 333
03606
(G75 MULTIPLE GROOVES)
(G20)
N87 M30
Single groove example using the G75 cycle - program 03605
%
The following program example 03605 cuts a single The setup and conditions for multiple groove are identi-
groove and is based on Figure 36-15. cal to those for a single groove. The only difference is the
additional entries in the G75 cycle call.
03605
(G75 SINGLE GROOVE) This technique may be used not only for multiple grooves
(G20) separated by solid material, but also for opening up a single
groove that is much wider than the grooving insert. The
N43 G50 S1250 T0300 M42
N44 G96 S375 M03
only difference in programming will be the value of K - the
N45 GOO XI. 05 Z-0.175 T0303 M08 distance between grooves. If the K is greater than the insert
N46 G75 X0.5 10.055 F0.004 width, several individual grooves will be cut. If the K is
N47 GOO X6.0 Z2 0 T0300 M09
. equal to or smaller than the insert width, a single wide
N48 M30 groove will be cut. Experiment to find the best amounts.
%
subprogram and all motions that vary from groove to N12 G50 S2500 T0500
groove, in the main program. This way, the same groove N13 G96 S500 MO
can be repeated at fixed intervals or variable intervals, as N14 GOO Z-0.5875 T0505 M08 (POS-GRV1)
needed.
N15 XI.
N16 M98 P3657 (CUT GRV 1)
N17 GOO W-0.375 M98 P3657 (CUT GRV 2)
0
C..
A'.
1 £-kJ N18 GOO W-0.375 M98 P3657 (CUT GRV 3)
N19 GOO W-0.375 M98 P3657 (CUT GRV 4)
- 0.625 - N20 GOO Z-2.285 (OPEN UP FOR PART- OFF)
N21 G01 X0.8 F0.006
i N22 XI.
i
N23 GOO XI. 0 Z-2.2 (CHAMFER BACK START)
in in N24 G01 X0.9 Z-2.25 FO .003 (CHAMFER)
CD 05
N25 X-0..02 F0.005 (PART-OFF)
o o N26 GOO XI.
Q Q N27 G40 X4.0 Z4.0 T0500 M09
(CLEAR)
i
N28 M30
T
%
- _ 0.2 TYP.
0.375 TYP. —— 03657 (SUB-PROG FOR 03607)
N1 G01 X0.66 F0.004 (FEED TO ROUGH OD)
01 ALUMINUM BAR N2 GOO XI. 0 (CLEAR OUT)
N3 W-0.0875 SHIFT TO LEFT CHFR)
(
tions related to the actual groove cutting are programmed lenge in certain cases.
in the subprogram 03657. An equal spacing between the
grooves is used for the example.
37 PART-OFF
PART-OFF PROCEDURE
335
336 Chapter 37
other tubular stock with thin walls, it is the wrong tool se-
lecting that also wastes material. A short part-off tool with a
narrower insert will justify the setup change.
Another program entry that is important to look at is the Cut the chamfer in one block and
X value in block N 122 - it X2.65
example. That
is in the
part-off in the subsequent block
After all, the part has just been separated, fallen into the
bin and one block in the program can be saved. Don't do
this could be a very hazardous procedure. The part
, it
In block N122, the tool is positioned .015 past the posi- When the part is separated from the bar, it falls down. On
tion Z 2.0. Block N
23 makes only a temporary groove (to
1
impact, it may suffer a damage severe enough to make a
02.200). The next block N124 is a motion out of the good part a scrap. To prevent the possibility of a damage,
groove, to the starting diameter of the chamfer (02.460). In the CNC lathe operator may want to place a bucket filled
the following block NI25. the tool shifts in the Z axis, to with cutting coolant in the path of the falling part. Another
the start position of the chamfer. The value of .950 was 1
method is to offset the part-off tool away from the center-
calculated by additions and subtractions: line, just far enough that it does not separate the part. Then,
when the machine is stationary (i.e., not moving), the CNC
1.875 - .020 - .030 + .125 = 1.950 operator breaks the part manually.
clearance, and .125 is the insert width. Note the .125 tool
width position adjustment, to maintain the tool reference Never touch the part while the program
is in operation or the spindle is rotating.
point on the left side of the cutting edge while actually cut-
ting with the right edge. Block N 26 is the chamfer cutting,
1
using incremental mode. Using the incremental mode The best solution for part damage prevention is a CNC
saves a few calculations. If using the absolute mode, block equipped with a parts catcher, which is often a special
lathe
N126 will be: machine option, ordered at the time of machine purchase.
Also note the decreased feedrate for the chamfer only, to Tools with sharp edges, or with very small radii, are gener-
assure a good finish. The feedrate decrease can be quite ally weak tools, yet doing some very demanding work. No-
significant for very small chamfers. The remainder of the body wants to run out of tools in the middle of a very
program is unchanged. important rush job.
Threading is a machining process used to produce a heli- Single point thread cutting - typically known as a single
calgroove of a particular shape, usually on a cylinder. The point threading -
uses a tool holder similar to other tool
major purpose of threads is to connect two parts together holders, but contains one special threading indexable in-
without damage during joining and disjoining (assembly sert, which may have one, two or three tips. Generally, the
and disassembly). The most common applications of shape and size of the threading insert must correspond to
threading fall into four major categories: the shape and size of the finished thread - Figure 38-1.
Tapping and die work uniform advancement per spindle revolution. The shape or
form of the thread is mainly determined by the shape and
Thread milling mounting position of the cutting tool. The uniformity of ad-
Thread grinding vancement is controlled by the programmed feedrate.
For a typical CNC programmer, the areas of interest are The most common thread form used in CNC program-
usually confined to the tapping, milling and single point ming is the familiar V-thread (in the shape of the letter V)
threading. Methods for tapping operations have been de- with a 60° included angle. There is a large variety of the
scribed in Chapters 25 and 26, thread milling is described V-shape forms in manufacturing, including metric and
in Chapter 45. This chapter covers programming methods English threads. Other forms include trapezoidal shapes
described as single point threading. such as metric trapezoid, ACME and worm threads, square
and round threads, buttress threads and many others. In ad-
THREADING ON CNC LATHES dition to these relatively common forms, there are threads
specific to a particular industry, such as automotive, air-
craft, military and petroleum industries. To make matters
CNC lathes can produce a very high quality thread in ad- even more complicated, the thread shape can be oriented on
dition to the variety of turning and boring operations, in a
a cylindrical surface, a conical surface, it also can be exter-
single setup of the machined part. This is a very attractive
nal or internal. The thread can be cut on a face (scroll
feature for manufacturers and many machine shops have
threads), even on circular surfaces. It can have a single or
purchased a CNC lathe for that reason alone. Any second-
multiple starts, right or left hand orientation, constant or
ary operation requires additional setup, increasing the cost
variable lead, etc.
of production.
339
340 Chapter 38
External and internal threading during one spindle revolution. The lead always determines the
threading feedrate and can have constant or variable form.
Cylindrical threads (straight treads)
MAJOR DIAMETER
Tapered threads (conical threads)
... is the largest diameter of the thread
Right hand (R/H) and Left hand (L/H) threads
MINOR DIAMETER
Face threads (scroll threads)
Multi-start threads
MULTISTART THREAD
Circular threads
... is a thread with more than one start, shifted by the pitch
amount
Multi-block threads
PITCH
In spite of the seemingly endless possibilities and combi-
... is the distance from a specified point of one thread to the
nations in thread cutting, the programming knowledge and corresponding point of the adjacent thread, when measured
experience gained in one category will be indispensable in parallel to the machine axis
A good threading program is based on a
other categories.
PITCH DIAMETER
sound knowledge of common threading principles.
... on a straight thread, the pitch diameter is an imaginary
TERMINOLOGY OF THREADING diameter, "the surface of which would pass through the threads
at such points as to make equal the width of the threads and
the width of the spaces cut by the surface of the cylinder"
Threading is a relatively large subject, in lact, it is large
ROOT
enough to have a whole book dedicated to it. As subjects of
this kind usually are, threading has its own technical terms. ...is the bottom surface of a thread, joining the sides of two
These terms appear in books, articles, technical papers, adjacent threads
manuals and other sources. To understand them is manda-
SCROLL THREAD
tory for any CNC programmer and operator.
... is also known as a face thread - it is a thread machined
Listed here are some of the most common terms used for along the X axis, rather than the more common thread
threads and thread cutting: machined along the Z axis
... is the included angle between the sides of the thread, ...in multistart threading, it is the distance by which the
measured in an axial plane cutting tool is displaced to cut another start; this distance is
... is the top surface of a thread that joins the two sides TAPERED THREAD
DEPTH OF THREAD .. . is a thread on which the pitch diameter is increased
or decreased by a constant ratio (such as a pipe thread)
. .
.
generally, the distance between the crest and the root
of the thread, measured normal to the axis (in programming, TPI
depth is considered as a measurable value per thread side)
... in English units of measuring, the number of threads
EXTERNAL THREAD counted over the length of one inch (1 / pitch) - metric
thread is defined by its pitch - TPI equivalent is not applicable
... is a thread that is cut on the outside of the machined
part, for example as a bolt
SINGLE POINT THREADING 341
programmer should have the ability to think of yet another same, only the thread data change from one pass to another.
solution, when all the other solutions seem to have been In a most elementary setup, there are at least four motions
used up. This is true for any problem solving process and for each threading pass (as applied to a straight thread):
Compare a threading insert with a common 80° diamond late the XZ coordinates for this position correctly. The co-
tool used for rough turning, and a few oddities will emerge: ordinates arc called the thread starting position because ,
they define where the thread cut will start from and eventu
Tool radius:
ally return to. The start position must be defined away from
Tool angle: The first tool motion is directly related to the thread. It is a
motion from the starling position to the cutting diameter of
Threading typically 60° and a weak support
the thread. Since the thread cannot be cut at full depth in a
Turning 80° and a strong support
single pass, the total depth must be split into a series of
Typical feedrates: more manageable depths. Each depth will depend on type
of tool, the material and the overall rigidity of the setup.
Threading = up to .25 in/rev (6.5 mm/rev) or more This approach motion is programmed in rapid mode.
Turning = .01 5 in/rev to .03 in/rev typical
(0.4 mm/rev to 0.6 mm/rev) Threading Motion 2
Threading = small depth, the second motion becomes effective. The actual
Turning = medium to large threading pass will be cut during this step, at the specified
feedrate and only when the machine spindle is synchro-
The comparison shows that even a fine pitch thread can- nized with the threading feedrate. There is no need to take
not be cut with a single threading pass. A single pass would any special steps to maintain the synchronization - in
produce a thread of poor quality at best and a unusable threading mode, the synchronization is automatic. The
thread at worst. The tool life would also be much shorter thread will be cut to the programmed thread end position.
than expected.
342 Chapter 38
Threading Motion 4 To avoid this serious problem, this rule may help:
The threading process is completed with the fourth mo- Z axis clearance for the starting point should be
tion,when the tool returns to the starling position in a rapid three to four times the length of the thread lead
straight cylindrical thread, the minimum suitable clearance threading techniques are often used simultaneously.
along the X axis is about 100 (2.5 mm) per side, more for
.
ations are necessary. When the threading tool comes into matically. Formanual calculations, the procedure follows a
contact with material, it must be advancing exactly 100% logical approach. The total depth of the thread (measured
of the programmed feedrate. Since the cutting feedrate for per side) must be known - programmer decides how many
threads is equivalent to the thread lead, it will take some threading passes will be suitable for the particular thread.
time to arrive at the programmed feedrate. Just like a car Another value to be decided is the last cut depth, the cut
needs some lime to accelerate before reaching its cruising that actually finishes the thread. These values usually come
speed, the threading tool has to reach a full feedrate before from experience. The rest is limited to mathematical calcu-
it contacts the material. The effect of acceleration must be lations or available charts.
When the three parameters (values) are established, the Pass #1 depth - 0.0140 Accumulated depth = 0.0140
depth must be distributed among the individ-
total cutting Pass #2 depth - 0.01 00 Accumulated depth = 0.0240
ual threading passes, including the last pass depth. Start Pass #3 depth - 0.0080 Accumulated depth = 0.0320
with approximation of individual calculations to make Pass #4 depth - 0.0065 Accumulated depth = 0.0385
each depth smaller than the preceding one and still not ex- Pass #5 depth - 0.0050 Accumulated depth = 0.0435
ceed the total thread depth. Chances are that each depth Pass #6 depth - 0.0045 Accumulated depth = 0.0480
will not guarantee absolutely consistent chip load, but the Pass #7 depth - 0.0031 Accumulated depth = 0.0511
cuts will be well within the margin of acceptability.
These calculations will be used when the program is ac-
tually written. The thread depth is dependent on the num-
0 3.0 NOMINAL
ber of threads per inch and whether the thread is external or
internal. The thread diameter is irrelevant for the thread
0 2.9720 depth calculation. Once the diameter is known, the calcu-
lated depths can be used and the diameter for each thread
0 2.9520 pass found. As an example, for an external thread of 3.0-12
size, each threading diameter calculated is based on the
0 2.9360
nominal thread size of three inches:
0 2.9230
0 2.9130 Threading diameter #1 3.0-2x0.0140 = 2.9720
0 2.9040
Threading diameter #2 3.0 2 x
- 0.0240 = 2.9520
0 2.8978
=
Threading diameter #3 3.0 - 2 x 0.0320 2.9360
Threading diameter #4 3.0-2 x 0.0385 = 2.9230
Threading diameter #5 3.0-2 x 0.0435 — 2.9130
Threading diameter #6 3.0-2 x 0.0480 — 2.9040
Figure 38-3
Threading diameter #7 3.0-2x0.0511 = 2.8978
Threading diameters distributed for equal chip load
Figure 38-3 shows a typical external thread (diameter is There is nothing wrong with this method of calculating
only an example). It is a 12 TPI thread and the programmer the threading diameters. What this method lacks is a built-
has to find single depth of the thread. There is a mathemati- in check for accuracy. Since each diameter is calculated
cal way to do it, using a standard formula. The single, full from the nominal diameter, any error in calculation is not
profile external thread depth will
be 0.0511 inches, based accumulative and might be hard to find. A much better
on the following tlnead depth formula - for Unified and method is to calculate each threading diameter based on the
metric external threads only: previous calculation, using single depth of cut, not the ac-
cumulative depth - compare it with the last method:
0.61343 =
D= = 0.61343 xP Threading diameter #1 3.0000 - 2 x 0.01 40 2.9720
TPI Threading diameter #2 2.9720 -2 x 0.01 00 = 2.9520
Threading diameter #3 2.9520 -2 x 0.0080 = 2.9360
Threading diameter #4 2.9360 - 2 x 0.0065 = 2.9230
where ...
thread forms), the constant in the formula is 0.64952, diameter and the result must be equal to the nominal
to this
which would make the depth 0.0541. diameter of the thread, or 3.0000 in the example:
For a fall profile internal thread, the formula to calculate 2.8978 + 2 x 0.0511 = 3.0000
the depth will be used for metric and American National
If the result is not the nominal thread diameter, there wa:
threads only - D value is the internal depth:
an error in the calculations. Using both methods an<
comparing the results is significantly more thorough check
0.54127
D= - = 0-54127 xP
y pi Thread Cutting Motion
motion, do not use preparatory command G01 for thread- N64 U0.2 W-0.1 (GRADUAL PULLOUT)
ing. If G01 is used, the start for each pass will not be syn- N65 GOO X3.3 (RAPID OUT)
chronized with the previous thread start. Instead of GO I
command, use a G code specifically designated for thread- For external threads, the clearance diameter must always
most common code used by Fanuc controls be further away from spindle center line than the diameter
ing. G32 is the
During a thread cutting motion G32, control
for threading. of gradual pullout. For internal threads, the clearance di-
system automatically disables the feedrate override. The ameter must be closer to spindle center line than the diame-
ter of gradual pullout. Figure 38-5 illustrates the concept.
CNC operator has to be extra careful to set the threading
tool exactly, particularly when thread ends close to shoul-
ders of the part. To illustrate the programming process up to
this point, here is a typical program section:
o
3
1
1
(2)
1
^. STRAIGHT
PULLOUT
usually the Z axis. This is because in most programs, the
tool retraction from the thread has already reached the X
axis diameter. Here is a complete program excerpt - gradual
4'
pullout is shown:
3 r* GRADUAL
0>
(D PULLOUT
N61 GOO X3.3 Z0.3 (START POINT XZ)
Figure 38-4
N62 X2.972 (THREAD DIA START)
N63 G32 Z-1.75 F0.0833 (THREAD TO END)
Straight and gradual pullout from a thread N64 U0.2 W-0.1 (GRADUAL PULLOUT)
N65 GOO X3.3 (RAPID OUT)
Generally, the straight pullout should be programmed N66 Z0.3 (RETURN TO Z-START)
whenever the tool an open space, for exam-
ends cutting in
placed by a rapid motion mode, using the GOO command: speed and feedrate selection are rather restricted. Both, the
cutting tool and the feedrate arc determined by the finished
N64 GOO X3.3 (RAPID OUT) thread, as specified in the engineering drawing. Threading
insert is one of the weakest tools used on CNC lathes - yet
For the gradual pullout, the threading G code and the its applications demand some of the heaviest feedrates used
feedrate must remain in effect. When the normal length of in CNC lathe programming Other factors that
for any tool.
thread is completed - but before the tool is retracted - the can influence the have to be dealt with as well,
final thread
threading tool moves in two axes simultaneously, ending such as spindle speed, the depth of each threading pass, the
outside of the thread. The normal length of the pullout is tool edge preparation, setup of the culling tool and insert,
usually to 1-1/2 times the lead (not the pitch), the sug-
1 plus similar considerations. Often, a change of only one
gested angle is 45°. It is also important to pay attention to factor will correct a threading problem. Figure 38-6 com-
the clearance diameter. pares feedrates for turning and threading.
SINGLE POINT THREADING 345
PITCH = —
TPI
based on such factors as material type, tool nose radius, re- F = Required feedrate (in/rev or mm/rev)
quired surface finish, etc. In this sense, the ‘correct' feed- L = Lead of the thread (inch or mm)
rate for turning and boring cover a large range. In thread- P = Pitch of the thread (inch or mm)
ing, this flexibility is limited. The threading feedrate is n = Number of starts (positive integer)
always determined by the lead of the thread - never the
pitch. In English units drawings, the thread description is
For example, a thread with a single start and the pitch of
given as the number of threads over one inch length, or TPI three millimeters (3 mm) will require feedrate of
(TPI = threads per inch), and a nominal diameter. As an ex-
ample, a thread that is described in the drawing as 3.75-8.
3 x 1 = F3.0
means that the thread has 8 threads per inch and
the nomi- ,
Regardless of the dimensional unit, the most important tsr where ...
terms for selecting the correct feedrate are the lead of the
thread and the number of threading starts. P = Thread pitch
TPI = Number of threads per inch
It may
help to review some of the basic relationships of
the thread lead and the thread pitch (see the terminology of As an example, the thread with one start and 8 TPI will
shop conversation (shop talk), the words lead and pitch are
often used incorrectly. The reason is that for a single start 1/8x1= .125 x 1 = F0.125
thread, the amount of the lead is identical to the amount of
the pitch. Since most machine shops work with a single
Multistart threads are special in many ways, but the feed-
rate selection is also the lead - not the pitch of the thread.
start thread on a daily basis, the misuse of the terms is sel-
dom noticed. In addition, virtually all laps have a single
Spindle Speed Selection
start. What may be acceptable in a shop talk language has
to be interpreted correctly in CNC programming. Each The speed of the spindle for thread cutting is always pro-
term has a very specific meaning in threading, so use them grammed in direct r/min never as a constant surface speed
.
and the root of thread, so G96 selection would seem logi- O English example
cal. This is not the case. First, even for fairly deep coarse
ing,
In CNC lathe programming generally, not only
always make sure that the feedrate per revolution
in thread-
com-
Fr = —S
bined with the spindle speed will be less than nr equal to
the maximum available feedrate per time for the axis with
os' where ...
the lower rating, which is usually the X axis.
Based on this simple rule, the maximum spindle speed Fr„, lx = Maximum feedrate for a given spindle speed
Ft max = Maximum feedrate per time (X axis)
for a given lead can be selected according to the following
S = Programmed spindle speed (r/min)
formula:
O English example:
F
= Desired actual feedrate
= Programmed rounded feedrate
In a similar example, using metric units, the maximum TPI = Number of threads per inch
machine feedrate for X axis is 6350 mm/min and the pro-
grammed Over one inch, the error in the will be .0004 ofexample
spindle speed S is selected as 1600 rpm. In this
maximum programmable threading feedrate will
an inch, over fifty inches it will be .0200 of an inch. An- full
case, the
other example, somewhat more critical, is an incorrect
be (in mm/rev):
rounding value. Ideally, a thread with 1 1 .5 threads per inch
6350 / 1600 = 3.969 mm/rev should be programmed with the feedrate of .086956522. If
this value is rounded to F0.0870, the accumulated error is
That means the maximum lead that can be threaded at .0005 per one inch and the error over 50 inches will be
1600 r/min must be less than 4 mm. .0250 inches. Even if the CNC machine does not allow six
decimal places for the threading feedrate, the proper round-
The calculated values only indicate the actual capabili- ing of the calculation is very important.
ties of the control and the machine and do not guarantee a
safe job setup or even suitable machining speed. Compare the following rounded values and the errors
they cause (1 1 .5 TPI over 50 inches):
Lead Error
.0869 . . . error of .0325
Normally, the threading feedrate requires the address F, .0870 . . . error of .0250
with up to four decimal place accuracy for threads in F.ng- .0871 . . . error of .0825
lish units (F2.4 format), and three decimal place accuracy
The rounded value used in the program should be F0.07 14. The latest CNC systems allow the use of a
six digit accuracy for the F address as well!
Over a short thread length there is no noticeable error at all
and the thread is well within all tolerances. That is not true
if the thread is unusually long or the rounded value has The lead error is always a potential problem when pro-
been improperly calculated. An accumulative error known ;
gramming long thread leads. Depending on the kind of
as the thread lead error will result in a possible scrap due to
;
threading applications in the machine shop, the accumula-
an incorrect thread. By using the rounded value of .0714, tive error of the thread lead may be critical or it may never
the loss is .000028571 inches for each thread revolution. be an issue to deal with.
Lead error over one inch (or more) can be easily calculated:
348 Chapter 38
TOOL REFERENCE POINT Each of the four basic steps occupies one block of pro-
gram, resulting in the minimum of four blocks per each
threading pass. If the gradual pullout from the thread is
A good tool setup is critical to a good machining environ- used for thread cutting, there will be five blocks of program
ment. While a good setup is important to all tools, it is even
for each threading pass. When cutting coarse threads,
more important good setup of the threading
to maintain a
threads in hard or exotic materials, even some multi start
tools, external and internal. The tool cutting edge has to be
threads, this method often means quite a long program. The
properly oriented, securely mounted in the insert pocket
length of the program, difficulty in editing, high possibility
and it has to be the right type. Its reference point, used for
of errors, and even small memory capacity of the control
setup, is also very critical.
system, are the negative sides of using this method.
The reference point of a threading tool requires more G32. Command G33 may existon some controls, but G32
considerations than for turning tools. In the Figure 38-7 ,
is the standard G code for Fanuc and compatibles.
there are three possibilities, in the order of programming
In an example, a 3.0-12 TPI external thread will be used.
frequency. The third version (c) is the rarest and offers vir-
All cuts are distributed in seven passes, for the total depth
tually no benefit to the programmer except in some cases of
of .0511:
left hand threading. For most left hand threads, one of the
first two versions is also quite sufficient. Pass #1 depth = .0140 Total depth .0140
Diameter 2.9720
The threading insert setting as in Figure 38-7ct is the most
suitable for general use and for threads that end at a shoul-
=
Pass #2 depth .0100 Total depth .0240
der. Configuration in Figure 38-71? is suitable for threads
Diameter 2.9520
that end on an open diameter. The Figure 38-7c shows a
possible setting for aleft hand threading work. =
Pass #3 depth .0080 Total depth .0320
Diameter 2.9360
Selection of the tool reference point (G50 or geometry
offset setting) as per illustration in Figure 38-7ci is the most
Pass #4 depth = .0065 Total depth .0385
desirable one, when the intent is to standardize tooling
Diameter 2.9230
setup for any type of thread. It is the most convenient set-
%
Using the G92 cycle, the following list shows the calcu-
each new pass diameter - they are always the same. For a Pass #1 depth = 0 2.9720
thread with many passes these repetitions will be very nu-
Pass #2 depth = 0 2.9520
merous. This block-by-block method has one main benefit
- is it under programmer’s full control. Adjustments may be
Pass #3 depth = 0 2.9360
Pass #4 depth = 0 2.9230
made to the number of threads and depth of each pass. Pass #5 depth = 0 2.9130
Non-standard infeed method and a gradual pullout from the Pass #6 depth = 0 2.9040
thread can be added. Actual program editing after it has Pass #7 depth = 0 2.8978
been completed is much more inconvenient.
350 Chapter 38
As before, the threading tool has been assigned a tool program, the control system will expect that there are more
number and spindle speed - tool 5 (T0505) and 450 r/min: threads to cut, while they had been actually completed in
the previous block.
03802
The simple threading cycle G92 is just that - it is simple,
(N45 G50 X12.0 Z4.5) without any frills. It does not have any special infeed meth-
N46 T0500 M42 ods, in fact, the only feeding method is a straight plunge
N47 G97 S450 M03 type. Later in this chapter, the plunge method of infeed will
N48 GOO X3.2 Z0.25 T0505 M08 (START POSITION) be described as not suitable for most threading operations.
The first four blocks are identical to the block method of An automatic gradual pullout can be programmed with
threading. In the next step, the threading tool will be posi- G92 by using M24 function prior to calling the G92 cycle,
tioned at the first pass diameter, chase the thread, retract with examples later in this chapter. If the control system
from the thread and return to the starting position. The last supports the feature (most controls do), always use the
three blocks are repetitive for each pass. The main benefit much more sophisticated threading cycle - G76, described
of the G92 threading cycle is that it eliminates such repeti- in the next section.
tive data and makes the program easier to edit.
G92 X.. Z.. F In Chapter 35, various lathe cycles were the main sub-
ject, normally used for turning and boring. In this section, a
cs* where ...
similar look will aim at one more of the multiple repetitive
cycles, this time used for various threading applications.
X = Current diameter of the thread pass
Z = End position of the thread In the earlier stages of CNC development, the simple
F = Threading feedrate in in/rev
G92 threading cycle was a direct result of the computerized
technology of its time. The computer technology has been
The first threading pass will be programmed in this block
rapidly advancing and many great new features have been
- N49. Note the X axis and the Z axis input values as well as
offered to CNC programmers. These new features simplify
the cutting feedrate:
the program development. One of the major additions is
N49 G92 X2.972 Z-1.6 F0.0833 (PASS 1) another lathe cycle, used for threading - a multiple repeti-
tive threading cycle G76. This cycle is considered a com-
The control system will take the last X value and the last plex cycle - not because it is difficult to use (on the con-
Z value before the cycle call as the starting position for the trary) but because it has some powerful internal features.
thread. This position is the starting point for the cycle. In
To fully appreciate the impact of G76 threading cycle,
the example, the starting position is XT. 2 7.0.25 (block
compare it with the original G32 threading method, and
N48). The remaining six threading passes can be pro-
even theG92 cycle just described. While a program using
grammed just by changing the diameters. There is no need
theG32 method requires four or even five blocks of pro-
to repeat the Z value or the feedrate.
gram for each threading pass, and the G92 cycle requires
(PASS one block for each threading pass, the G76 cycle will do
N50 X2.9520 2)
N51 X2.9360 (PASS 3) any single thread in one block of program code (two blocks
N52 X2.9230 (PASS 4) are required for some controls). With the G76 cycle, any
N53 X2.9130 (PASS 5) number of threading passes will still occupy only a very
N54 X2.9040 (PASS 6) small portion of the program, making editing on the ma-
N55 X2.8978 (PASS 7) chine (if necessary) very easy and fast.
The block N55 will be completed by an automatic return There are two programming formats available, depend-
motion to the starting position of the thread. From that po- ing on the control model. This is similar to programming of
sition, the program ends the same way as for G32. the other lathe cycles.
N56 GOO X12.0 Z4 . 5 T0500 M09 G76 Cycle Format - 10T/1 IT/1 5T
N57 M30
% A threading cycle requires initial data input - information
provided to the control that defines the thread in machining
One frequent can be made
programming mistake that terms. Figure 38-9 illustrates the G76 for Fanuc 10/1 1/15T
with this cycle is to omit GOO command in block N56. G92 controls.
cycle can be canceled only by another motion command, in
this case by a rapid motion GOO. If GOO is missing in the
SINGLE POINT THREADING 351
1
i® where ...
First block:
Second block:
G76 - Multiple repetitive thread cutting cycle (10T/11T/15TI X = (a) Last diameter of the thread (absolute diameter)
... or...
These parameters form the structure of the one-block cy- (b) The distance from the start point to
cle (for external or internal threads): the last thread diameter (incremental)
Z = End of thread along the Z axis
G76 X.. Z.. I.. K.. D.. F.. A.. P (can be an incremental distance W)
R = Radial difference between start and end
US’ where ... positions of the thread at the final pass
(R0 used for straight thread can be omitted)
X = Diameter of the last threading pass P= Height of the thread
Z = Position indicating the thread end (positive radial value - no decimal point)
I = Amount of taper over the total length Q= Depth of the first threading pass
K = Single depth of the thread -positive (positive radial value - no decimal point)
D = Depth of the first threading pass - positive F = Feedrate of the thread (same as the thread lead)
A = Included angle of the insert - positive
P = Infeed method (one of four)- positive This format follows the logic of several lathe cycles de-
Do not confuse the P/Q/R ad-
scribed earlier in Chapter 35.
Observe differences in the format structure for the multi- dresses of the block with the P/Q/R addresses of the
first
ple repetitive cycle G76 with the basic G92 cycle. The G76 second block. They have their own meaning - within each
cycle appears to be simple, but internally, it is very complex block only!
- must do a large number of calculations
the control system
and checks. This is one reason why we use computers - to O Example - English units
let them do the hard work. These calculations need data (External 1-11/16 thread with 20 TPI)
(repetitive information), in the form of input parameters
that establish the thread specifications. Yet, in spite of the NIO G76 P011060 Q005 R0.003
more input values, the G76 is a very easy cycle to use in Nil G76 XI. 6261 Z-1.5 P0307 Q0100 F0.05
CNC programming.
O Example - Metric units
(Internal M76x1.5 thread)
G76 Cycle Format - OT/1 6T/1 8T
If the control system requires a double block entry for a G76 programming method. Examples for both types of
G76 cycle, the two-block programming format is: controls are shown, using only the minimum number of
program blocks (last tool shown in examples):
352 Chapter 38
03803 (G76 METHOD - ONE BLOCK METHOD) In the two block version, the same program will be very
similar, applying the same logical thinking.
(N45G50 X12.0 Z4.5)
N46 T0500 M42 03804 (G76 METHOD - TWO BLOCK METHOD)
N47 G97 S450 M03
N48 GOO X3.2 Z0.25 T0505 M08 (N45G50 X12.0 Z4.5)
N49 G76 X2.8978 Z-1.6 10 K0.0511 D0140 A60 N46 T0500 M42
P4 F0.0833 (or F/EO. 083333)
N47 G97 S450 M03
N50 GOO X12.0 Z4.5 T0500 M09 N48 GOO X3.2 Z0.25 T0505 M08
N51 M30 N49 G76 P011060 Q005 R0.003
% N50 G76 X2.8978 Z-1.6 P0511 Q0140 FO. 083333
N51 GOO X12.0 Z4.5 T0500 M09
Several points relating to the program may need clarifica- N52 M30
tion. The fact that the whole program requires only six or %
seven blocks is, in itself, significant. Any programming
change can be done by a simple modification of a proper There are few other parameters to explain, but first look at
parameter in block N49, which is the threading cycle call. how the cycle calculates the first thread depth. The higher
For instance, to change the depth of the first threading pass level controls using the one-block input will be used for the
to .0160 from the current .0140, all that has to be modified explanations, unless mentioned otherwise.
is the entry of DO 40 1 to DO 160.
First Thread Calculation
The comparison of the G76
cycle with G92 cycle is un-
fair, as each cycle is the product of a different technological For the G32 block threading, as well as for the G92 sim-
era. They coexist same control unit even at the pres-
in the ple threading cycle, the thread starting position was always
ent time, mainly to be downward compatible with older determined as only reasonable applied , to both axes for the
programs. The two cycles are a good illustration of some purposes of supplying a suitable tool clearance. The Z axis
significant differences between programming techniques. clearance in the start position block only takes into consid-
eration the lead of the thread and the spindle speed. Its pur-
For example, in the G92 threading cycle application, in-
pose is to prevent cutting imperfect threads, due to the ma-
put of each thread pass diameter is important, in G76 cycle, chine acceleration for the feedrate. The clearance for the X
only the last pass diameter input is important.
axis is an arbitrary clearance for the tool to move away
Internally, the CNC system does allnecessary calcula-
from the thread. The same principles apply to G76 thread-
tions. The supplied information is contained in the pro- ing cycle as well and can be used the same way as in the
previous threading methods.
gram. First, the control registers the thread starting posi-
tion, the same way as for G92 cycle. In this example (block There is one major difference from programming the
N48), the position is X3.2Z0.25. The next step the control
G32 and the G92 methods. In the previous threading exam-
goes through is the evaluation of all G76 parameters (the ples, the starting position for the X axis was X3.2. In the
programmed data in block N49). The X value is the diame- G32 block cutting, as well as in the G92 simple threading
terof the last threading pass, the K value is the single thread cycle, the first threading diameter was always programmed
depth. That provides enough information for the control to
(in the examples, the value was X2.972). This is not the
'know’ what is the theoretical premachined part diameter case in the G76 threading cycle. In this cycle, it is the last
(the actual premachincd diameter cannot be known). This diameter that is programmed - not the first - and that means
relationship is important for selection of the tool rapid ap- must be calculated by the control
the first cut diameter sys-
proach direction. If the thread start diameter X is larger tem internally.
than the lastpass diameter, the threading is external. If the
thread start diameter X is smaller than the last pass diame- The calculation of the first thread diameter is done com-
ter, the thread is internal. pletely by the control system, providing the following in-
formation is supplied:
The Z value in the G76 cycle has the same meaning as the
Z value in the G.32 thread cutting or the G92 threading cy- The root diameter [
X value ]
In the example, X is 2.8978, K is .051 1 (or P051 1), the Each threading method has its own procedures, using the
first threading depth D is .0140, entered in the program as following features;
D0140 or Q0140, depending on the control. Therefore, the
Constant cutting amount
first diameter of the thread 7) will be:
Constant cutting depth
T f = 2.8978 + (.0511 x 2) - (.014 x 2)
One edge cutting
T £ = 2.9720
Both edges cutting
The result is the same diameter as in the previous simpler
examples, but this time it was calculated by the control unit. The P parameter of the G76 cycle selects the feature.
Radial Infeed
THREAD INFEED METHODS
Radial infeed method of the threading tool is also one of
The entry of the threading tool into the material can be the most common conventional threading methods. It can
programmed in several ways. One of the most important be applied to a unidirectional, straight motion of the cutting
options is the method that controls threading tool approach tool,towards the diameter being cut. T he threading tool is
towards the thread, also known as the threading infeed. fed straight for each new pass. This pass diameter is speci-
This is a method detailing the motions of the threading tool, fied as the X data in the program. In G76 threading cycle,
using one of two basic methods of infeed, as illustrated in A0 parameter is used for a radial infeed. In G32 block pro-
Figure 38-10. gramming and G92 simple threading cycle, there is no pa-
rameter to program. The Z axis start position is the same for
all thread diameters and is easier to program. The radial in-
feed is suitable for soft materials (brass, some aluminum,
etc.), but it could damage threads cut in harder metals.
Compound Infeed
other method is called an angular method, better known as passes will be required for most threads. In Figure 38-10 is
a compound infeed or a flank infeed. shown the compound where one cutting edge is in
infeed,
constant contact with the thread wall. There is no cutting,
The need to control the infeed direction in threading is to only undesirable rubbing which may cause a poor surface
offer the best cutting conditions for the insert edge. Except finish on the thread. To avoid this problem, program the
for threads with very fine leads and some soft metals, the infeed angle a little smaller than the Hank angle (one half of
majority of threading cuts will benefit from a compound the thread included angle). A typical V-thread, with 60° in-
infeed (at an angle). Some threaded shapes are excluded for cluded angle has the flank angle 30° and the infeed angle
the reasonof their geometry - for example, a square thread should be a little less than that, say 29°. Keep in mind -
the
willalways need a plunge infeed (straight radial infeed). shape or geometry of the thread is not changed - that is built
The angle of infeed is programmed with the A parameter of into the shape of cutting insert. What is changing is the way
the G76 cycle. how the insert will cut - Figure 38-11.
354 Chapter 38
Modified compound infeed angle for better thread quality on the included angle of the threading insert. For a more
controlled infeed method, a method that controls the
In the G76 threading cycle, there are very powerful tools threading depth, there is also parameter P, programmable in
in forms of cutting parameters, two of which are related to the G76 cycle format and available for the Fanuc controls
the infeed method of a threading tool. One is the address A, 10T and higher. It defines the thread cutting type relating ,
and the other is the address P. Only the angle description is to the programmed depth of the thread.
available for the two-block method, as the last pair of the P
In addition to the radial infeed (straight or plunge), pro-
address in the first G76 command - N49 G76 P....60Q.. R..
grammed with the AO parameter and compound infeed
Thread Insert Angle - Parameter A (non-zero parameter A), there are two other main cutting
types that can be used in programming a thread infeed - a
For the compound infeed (all controls), a non-zero value one side cut and a zig-zag cut. These terms refer to the
is assigned to the parameter that represents the tool angle, a number of cutting edges employed at one time. The one
value that is equal to the included angle of the threading in- side cut refers to cutting with one edge the zig-zag cut re-
,
sert. The tool approach towards the part will be a little less fers to cutting with two cutting edges. Each of them can be
than one half of the included angle A. For example, if the used in conjunction with the selected A thread angle pa-
standard A60 is programmed in G76 cycle, the infeed angle rameter and the cutting depth - either as a constant amount
will be slightly less 30°, allowing for the extra clearance. or a constant depth.
Only the following six A angle settings are allowed in a Fanuc CNC lathe controls offer four methods of control-
G76 threading cycle: ling the thread cutting depth infeed (Figure 38-12):
motion individually. Is it a lot of work? Yes. Is it worth do- Pass #2 depth at 0 2.9520 ( single depth .01 00 )
ing? Absolutely. It has to be a really good job, because even Pass #3 depth at 0 2.9360 ( single depth .0080 )
a slight modification at the machine could be very difficult. Pass #4 depth at 0 2.9230 ( single depth .0065 j
A top class programming job is always worth the extra time Pass #5 depth at 0 2.9130 (
single depth .0050 )
and effort when quality and precision of the final part de- Pass #6 depth at 0 2.9040 (
single depth .0045 )
pends on it. Quality is not instant - programmers (and ma- Pass #7 depth at 0 2.8978 ( single depth .0031 )
chine operators) have to invest some work and time into it.
In addition to the single depths and threading pass diame-
The principles of compound threading as applied to a ters, Figure 38-13 also shows shifts as an S and S 1 -S7 dis-
block-by-block programming are simple, but the program- tances. When the Z starting position is shifted, the shift dis-
ming work may be tedious and editing on the machine may tance must be calculated on the basis of compound angle
be impractical. Each threading pass has to be calculated in and the threading pass depth. Any new calculation must be
a different Z axis start position. This is called the shifted po- based on the last calculation.
sition that must be calculated exactly, otherwise the pro-
gram will fail. It also had better be right the first time, other- Z Axis Start Position Calculation
wise the changes could be long and costly. Again, in this
example, the same thread will be used as in previous exam- The illustrated distance S represents the from
toted shift
ples (3.0-12 TPI). Program will use the G32 threading the nominal Z axis starting position, in the example pro-
command, with a modified compound infeed at 29°. grammed as Z0.25. The shift is to the Z positive direction.
The S distance represents the total shift of a threading The seven shifted positions for the start Z axis position
tool.The shift for each threading pass will he its relative can be calculated, based on the theoretical starting position
share of the S value. Each share is identified as an S> in the of Z0.2783 at the 03.000:
Figure 38-13 within the range of SI to S7.
,
ing the D depth input. Keep in mind that the purpose of this nal Z0.25 position. Using this method offers confidence
03805
(COMPOUND INFEED EXAMPLE)
In program 03805, the thread infeed method is equiva- Single Axis Pullout
lent to the P parameter in G76 cycle. This cutting type em-
1
A single axis pullout (thread finishing OFF) is a simple
ploys only a single edge of the threading insert, with a con-
rapid motion programmed at the end of threading pass as
stant amount per each threading pass. It represents the most
the third motion of the four basic threading sequences. The
common programming method for threads and can be used
pullout direction always at 90° to the thread. For either
is
as a sample for many other thread cutting applications.
threading cycle G92 or G76), this is the default condition,
Block-by-block threads will be longer and will need to be
so M24 is not needed, unless M23 function is used as well,
checked for accuracy very carefully.
usually for another thread in the same program. These two
functions cancel each other. If M24 function it mustis used,
THREAD RETRACT MOTION be programmed before which it has
the threading cycle for
been applied. For example, the threading program 03803
Earlier, a statement had been made that there are only two using the G76 cycle will be slightly modified in 03806:
dl
thread lead. Normal control setting is equivalent to one
i_ times the thread lead. The pullout angle from the thread is
usually 45°. or a little less because of a delay in the servo
Figure 38-15 system. If the finishing distance d is greater than the pullout
Typical miscellaneous functions for gradual thread pullout distance dl, the pullout will not be done.
358 Chapter 38
Any thread can be cut in either the right hand or the left Programming a thread that terminates at a shoulder pres-
hand orientation. Neither selection has any effect on the ents a unique difficulty. The difficulty is the wall - better
profile and/or depth of the thread, but other factors are im- known as shoulder of the part. It is not enough to program
portant. The majority of threading applications use the the end point for the thread reasonably - it must be pro-
right hand thread. Right hand and left hand terms relate to grammed exactly. Even then, a collision is possible if the
the helix of the thread - Figure 38-16. tool setup is not accurate. The three typical problems in this
area of thread programming are:
Right Hand (top) and Left Hand bottom) ( thread cut using
If a smaller tool cannot be used, program for a modified
a right hand threading holder (reverse mounting)
existing threading insert. Modification in this case means
The hand of thread is determined by two conditions: grinding off the portion of the insert that is in the way of
cutting, without disturbing the portion that actually re-
Cutting direction of the tool (Z+ or Z-) moves the material. Before deciding on the modification by
grinding, consider other options carefully - altering the
Direction of the spindle rotation (M03 or M04)
standard tools designed for CNC work should always be
These conditions are used in combinations to program a the last resort, not the automatic first choice. A coated in-
particular thread. The factors that influence the program- sert will loose its cutting advantages, if the coating is re-
ming method for a R/H and L/H thread are: moved by grinding. Be careful not to grind off coating
within the cutting section of the insert. In case the program
Threading tool design - right hand or left hand
does use a modified threading insert, a few suggestions
Spindle rotation direction - M03 or M04 may help to do it with more insight.
To modify a standard threading insert, look at its normal .750 - .100 = .650
configuration first. Figure 38-17 shows a typical threading
insert with the known width W
and the angular length A, The minimum thread length in the illustration is only
tip radius or fiat R, and an unknown angular height H.
.620.There are no clearances and the length of the thread is
too short. To solve this problem, select a smaller size
threading insert if possible. If not, modification of a larger
h w ^ insert is the only way.
Figure 38-17
Always calculate the modification amounts, never guess them
Essential dimensions of a threading insert
H = A / tan30 the programmer. The solution is the total amount of the in-
H = .130 / .577350269 sert modification being .080. In other words, the amount of
H = .225166605 .080 must be ground off the original large threading insert.
H = .2252 That will shorten the original angular lengthof 30 to the . 1
Threading insert before modification does not fit in the recess area
In threading, the thread length is the actual length of the
The job is to program a thread with a .100 recess groove full depth thread. The part design often allows a little lon-
width, using an insert that has an angular length A of . 1 30. ger thread, but not shorter. The height of the shoulder is
This insert is not suitable for the job, as it cannot finish the also important. In the example, the shoulder is .301 1 high
minimum full depth thread length - the difference between and the insert modification was possible. A large threading
the shoulder length and the recess width: insert may not always be modified and the only solution
will be to use a smaller insert size.
360 Chapter 38
Program Testing
OTHER THREAD FORMS
Whether a threading insert used is based on catalogue di-
mensions or a modified insert, threading to a shoulder pres- Although the standard V-shape thread with the 60° in-
ents a time of anxiety for the CNC operator, when the first cluded tip angle is the most common thread form, it is by
part is produced. Since the feedrate override and the feed- no means the only form. There are many threading forms
hold switches are disabled during threading, the program and shapes programmers encounter in machine shops, too
verification on the lathe will become more difficult. Even numerous to list.
computer based graphic testing methods may not show the
potential collision. As an example of a different threading form, look at an
ACME thread as a subject for discussion. In metric, there is
A simple, yet very effective, thread program checking an equivalent thread, called the Metric Trapezoidal thread.
method is always available, right at the CNC lathe. This From the programming perspective, both threads are al-
method requires a skilled CNC lathe operator, who does most identical. ACME thread has a 29° included thread an-
understand both the program and the threading principles gle. the metric trapezoidal thread has a 30° angle and some-
well. Knowledge of the operation panels is also important. what different geometry definition.
This method employs several features found on the con- The main application of the trapezoidal type thread is to
temporary CNC controls. The purpose of the program test transmit a motion, usually with a disengaging half-nut.
is to find out if the threading tool will collide with the part Certain types of lead screws for conventional lathes use this
shoulder before actual threading cut takes place. type of thread. The programming of a trapezoid threads
often requires a steadyrest, since these threads may be quite
The following steps are general in nature - adapt them to
long. An important consideration is the lead error accumu-
suit local conditions when testing the threading program:
lated over a long distance, discussed earlier.
Use the SINGLE BLOCK mode and step through
the program until the thread start position is reached Thread Depth
Switch from the AUTO to the MANUAL mode - spindle Every thread has its formulas and mathematical relation-
stops and the threading tool is in the clearance area ships. There are two basic formulas relating to an ACME
Select the XZ screen display (absolute mode) thread depth. One is for threads of 10 TPI and coarser, the
other for threads of 2 TPI and finer. For ACME threads
1 1
If the tool just about touched the part, but has not yet
Td = .500 x P + .005
reached the programmed Z end position of the thread,
the tool setup needs adjusting by the difference between
the programmed position and the actual position, plus Kr where ...
In the non-threading mode, the feed overrides are effective, viding the thread formulas and the geometric details of the
whereas in the threading mode, they are not thread design are known to the programmer.
Programming procedure for a lapered thread is not sig- depth D of the thread used in the program will be:
Taper Calculation
One method uses the thread length and angle and can be
calculated by applying the standard trigonometric func-
Tapered thread example - program 03808 tions.The other method defines taper as the ratio of its
This method is often confusing to an inexperienced
sides.
The thread is defined by its overall length (2.500), by the programmer. Typical ratios are defined in the part drawing
front diameter of the blank part ( 1 .375), by its angle (3.000 directly, forexample as 1:12, 1:16, etc., or indirectly, for
inches taper per foot) and by its pitch (8 TPI). It is a single example as the amount of taper per foot or, sometimes, as
start thread and the program zero will be at the front face of taper per inch. Keep one rule in mind:
finished part. All premachining operations have been done
for the example. The first programming consideration for Taper is always measured on a diameter
this type of machining will be the depth of the thread.
362 Chapter 38
3/12 = 1/ 4 = 1:4 Calculated values for the tapered thread program example 03808
ample can be calculated. Note that only the per side or ra- depths must be applied at both ends of the thread. The first
dial dimensions were used. In many programming applica- column lists the depth of thread per pass, the second col-
either the angle or the ratio. There will always be the option end thread diameter. The front diameter is calculated at ab-
to use the other method to verify accuracy of the calcula- solute coordinate of Z0.4, the end diameter at Z-2.7:
tions.
Depth Front0 End 0
and end diameters have been
In Figure 38-22, the start
calculated using the angle and/or the ratio of sides method. .0165 1.2420 2.0170
Which results of the calculations will actually be used in .0145 1.2130 1.9880
.0120 1.1890 1.9640
the program will depend on the type of selected program-
.0100 1.1690 1.9440
ming technique, such as using a block-by-block approach
.0080 1.1530 1.9280
versus a cycle method. The details depend on the thread
.0060 1.1410 1.9160
specifications and machine and control features. .0040 1.1330 1.9080
.0030 1.1270 1.9020
.0027 1.1216 1.8966
SINGLE POINT THREADING 363
All requirements are available to write program 03808: The X represents the current thread diameter at the end of
the cut,Z is the end position of the thread, I is the difference
03808 per side between the thread diameter at the end and the
thread diameter at the start. The I value must include an al-
(G32 - TAPERED THREAD) gebraic sign (only minus sign must be written), specifying
(N45 G50 X12.0 Z4.5) the direction of the taper inclination, in this case a negative
N46 T0500 M42
value. Program 03809 will cut a tapered thread using the
N47 G97 S450 M03
N48 GOO X2.5 Z0.4 T0505 M08 G92 threading cycle.
N49 XI. 242 (PASS 1)
N50 G32 X2.017 Z-2.7 F0.125 03809
N51 GOO X2.5
N52 Z0.4 (G92 - TAPERED THREAD)
N53 XI. 213 (PASS 2) (N45 G50 X12.0 Z4.5)
N54 G32 XI. 988 Z-2.7 N46 T0500 M42
N55 GOO X2.5 N47 G97 S450 M03
N56 Z0.4 N48 GOO X2.5 Z0.4 T0505 M08
N57 XI. 189 (PASS 3) N49 G92 X2.017 1-0.3875 Z-2.7 F0.125 (PASS 1)
N58 G32 XI. 964 Z-2.7 N50 XI. 988 (PASS 2)
N59 GOO X2.5 N51 XI. 964 (PASS 3)
N60 Z0.4 N52 XI. 944 (PASS 4)
N61 XI. 169 (PASS 4) N53 XI. 928 (PASS 5)
N66 G32 XI. 928 Z-2.7 N58 GOO X12.0 Z4.5 T0500 MO
N67 GOO X2.5 N59 M30
N68 Z0.4 %
N69 XI. 141 (PASS 6)
N70 G32 XI. 916 Z-2.7 Note that the I distance of taper inclination is the differ-
N71 GOO X2.5 ence between the end diameter of .8966 and the start dia- 1
N86 M30 The multiple repetitive threading cycle G76 cycle re-
% quires the I value not to be a zero, a tapered thread is cut.
if
These tools are the thread start position and the thread
feedrate calculations. Figure 38-24 shows symbolically the
views of the thread cross sections and the end views.
Figure 38-23
03810
rect shift value from one thread start to the next has to be
MULTISTART THREAD programmed, in threading mode.
Most threads have only one start, suitable for most appli- Threading Feedrate Calculation
cations. The most common purpose of a multistart thread is
The threading feedrate is always the lead of the thread,
to transfera precision motion very rapidly over a relatively
never the pitch. For a single start thread, the lead and the
long distance. Note the word precision - a coarse thread can
pitch have the same value - for a multistart thread, they do
also be used to transfer a motion rapidly, but with very little
not. Take a single start thread of 16 TPI. Here, the lead and
precision. An example of precision multistart threads arc
the pitch are both .0625, so the feedrate is F0.0625. If the
some internal designs of some camera zoom lenses.
drawing specifies the thread as 6 TPI, but indicates a dou-
1
For programmers, there are some unique considerations ble start (for example 3.0-16 TPI 2 START), that means
,
for a multistart thread. It is important that the start position the pitch of the thread will remain unchanged (.0625), but
the thread end of the screw or the nut. each start on the cir- programmed feedrate for the double start thread with the
cumference will be divided in equal angular increments. pitch of .0625 will be F0.125. The multiplication of the
Also important is to maintain the equal thread profile when pitch will always depend on the number of thread starts.
viewed from the thread cross section. To achieve these con- That means a triple start thread will have the feedrate three
ditions, two programming tools are available. times the pitch, quadruple start thread four times, and so on.
SINGLE POINT THREADING 365
Shift Amount
Feedrate is not the only consideration forprogramming a
thread with two or more starts. The other, equally important
factor, is the programmed amount of the tool point shift.
This shift will guarantee that each start will be in the proper
relationship to all other starts. When one thread is finished,
the starting position of the tool has to be shifted (in Z axis
only), always by the pitch amount. The formula for the tool
shift amount will be:
wt
VvvnXai
A \\ \ \ \y \\
v \\
lAyVWVNj
' I \\ \
_)
The number
The thread is
of starts
is
start thread)
Figure 38-26
Although the block-by-block programming method G32
can be used for special applications, acceptable results can
Multistart threads - pitch and lead relationships:
be achieved in many threading applications by using the
I a Single start thread Lead = Pitch = IP
I
N54 G92 XI. 988 Z-2.7 (T2 - P2) already completed (only as accurate as one's eye)
The length of a CNC program is usually measured in the Each program must have its own program number and is
number of characters such program contains. This number stored in the controlmemory. The programmer uses special
is similar to the number of bytes, if the program is stored on M code function to call one program from another. Thefirst
a computer disk. The physical length of a program is usu- program that calls another program is called the main pro-
ally not an issue for most jobs. The program length will gram. all other programs arc called subprograms. The main
vary, depending on the complexity of work, the number of program is never called by a subprogram - it becomes the
tools used, the method of programming and other factors. top level of all programs. Subprograms can also be called
Generally, the shorter the program, the less timeis needed from other subprograms, up to a certain number of nesting
to write and the less space it will occupy in the CNC
it, levels. When a program containing subprograms is used,
memory. Short programs also reduce the possibility of a always select the main program, never the subprogram.
human error, because they arc easily checked, modified and The only time a subprogram is selected on the control is for
optimized. Virtually all CNC systems offer features de- editing purposes. In some reference materials, subpro-
signed to shorten the length of a program to some extent grams are also called subroutines or macros, but the term
and make the programming process easier, more efficient subprogram is used most often and the word macro could
and less prone to errors. Typical examples of this type of have a different meaning altogether.
programming are fixed cycles, multiple repetitive cycles
and custom macros. This chapter describes the structure, Subprogram Benefits
development and applications of another method of effi-
cient program preparation - the use of subprograms. Any frequently programmed order of instructions or un-
changing block sequences, can benefit from becoming a
subprogram. Typical applications for subprogram applica-
MAIN PROGRAM AND SUBPROGRAMS tions in CNC programming are:
Repetitive machining motions
A CNC program is a series of instructions, assigned to
different tools and operations. If such a program includes Functions relating to tool change
two or more repetitive instructions, its structure should be
Hole patterns
changed from a single long program to two or more sepa-
rate programs. Each repetitive instruction is written only Grooves and threads
once and called when required. This is the main concept of
Machine warm-up routines
subprograms. Figure 39-1 shows a typical part layout re-
peated at different locations. Pallet changing
Figure 39- Not every subprogram will provide all the benefits, but
Example of a part requirement suitable to be used as a subprogram even one benefit should be a reason to use subprograms.
367
368 Chapter 39
The subprogram call function M98 must always be fol- 03951 (SUB-1) Subprogram start
lowed by the subprogram number P--. The subprogram end
function M99 terminates the subprogram and transfers the
processing back to program it originated from (a main pro- M9 9 Subprogram end
gram or a subprogram). Although M99 is mostly used to %
end a subprogram, it may also be rarely used in the main
program, replacing the M30 function. In this case, the pro- When a subprogram terminates, the control returns the
gram will ran ‘forever’, or until the Reset key is pressed. processing to the program of origin - it will not terminate
the main program - that is the exclusive function of M30.
Subprogram Call Function Additional parameters also be added to the M99
may
subprogram end, for example a block skip code, a block
The function M98 calls up a previously stored sub-
number to return to upon exit, etc. Note that the stop code
program from another program. If used only by itself in a
block, it will result in an error. M98
an incomplete func-
is
symbol (the %
sign) is used in the same manner for a sub-
program, as for a main program. The subprogram termina-
tion - it requires two additional parameters to become com-
tion is important and must always be done right. It sends
plete, therefore effective:
two very important instructions to the control system:
The address P identifies the selected subprogram number
To terminate the subprogram
The address L or K identifies the number of subprogram
To return to the block following the subprogram call
repetitions ( LI or Kl is the default
SUBPROGRAMS 369
Never use the program end function M30 (M02) to termi- In this format, the P address represents
the block number
nate a subprogram - it will immediately cancel all program completed subprogram. The block
to return to - from the
processing and reset the control. The program end function number must be present in the program of origin. For ex-
does not allow program execution of any blocks beyond ample, if the main program contains these blocks,
the block that contains it.
(MAIN - PROGRAM)
Normally, the subprogram end M99 returns the process-
ing to the block immediately following the subprogram call N67 M98 P3952
M98. This concept is illustrated in Figure 39-2 (without N68 ...
block numbers) and described next. N69 ...
N70 . ..
03952 (SUB)
M99 P70
%
block of the program it originated from. For example, thenumber of subprogram repetitions - how many times the
subprogram has to be repeated before the processing re-
N67 M98 P3952 (SUBPROGRAM CALL) sumes in the original program. In most programs, the
N68 ... (BLOCK TO RETURN TO FROM 03952) subprogram will be called only once, then the original pro-
N69 . . . gram will continue.
N70 ...
Programs that require a multiple subprogram repetition
executes block N67 by calling subprogram 03952. When before proceeding with the rest of the original program are
thesubprogram 03952 is processed, the control returns to common. To compare, a single use of the subprogram
the originalprogram and continues processing instructions 03952 could be called up from the program of origin as:
from the block N68, which is the block to return to.
N167 M98 P3952 LI (Kl)
Special Applications
This is a correct program block, but the Ll/Kl counter
For some special applications, it may be necessary to does not have to be programmed at all. It can be safely ig-
specify a different block number to return to, rather than us- nored - the control unit defaults to only one repetition.
ing the next block default. If the programmer finds this op-
tion useful for certain jobs and uses this technique, the P ad- If no address L/K is specified, the default value is always L1/K1
dress must be included in the M99 block:
M99 P.. N167 M98 P3952 LI (Kl) is identical to N167 M98 P3952
370 Chapter 39
Note - In the following examples, substitute K for every there are some good reasons. Observe Figure 39-3. The
L listed, if required by the control system. five hole pattern has to be spot drilled, drilled and tapped.
Figure 39-3
N342 M98 P3952 L4 (K4)
Sample drawing used for a subprogram development
program the requested number of repeats directly after Used in programs 03901, 03902 and 03953
the P address, in a single statement:
For the spot drill (00.750), G82 cycle is used with the 0.2
seconds dwell to Z-0.3275 depth. For the tap drill, G81 cy-
N342 M98 P43952 is the same as N342 P00043952
cle is used, and for tapping 5/8-12 tap, G84 cycle is used.
The result is identical to the other version - the subpro- The spot drill prepares the hole for drilling and makes a
gram will be repeated four times. The first four digits are 0.015 chamfer. The tap drill will be 35/64 drill (00.5469),
reserved for the number of repeats, the last four digits de- used to open up the hole for 5/8-12 tap:
fine the subprogram number. For example,
03901
(TOOL 1 - 90 -DEG SPOT DRILL - 3/4 DIA)
M98 P3950 isthesameas M98 00013950 N1 G20
N2 G17 G40 G80 T01
assumes a single repetitiomn of subprogram 03950. In N3 M0 6
order to repeat 00050 subprogram 39 times, program N4 G90 GOO G54 X2.0 Y2.0 S900 M03 T02
N5 G43 H01 Z1.0 M08
M98 P390050 or M98 P00390050 N6 G99 G82 R0.1 Z-0.3275 P200 F3.0 (LL HOLE)
N7 X8.0 (LR HOLE)
N8 Y8.0 (UR HOLE)
The maximum number of repetitions does not change for
N9 X2.0 (UL HOLE)
- it is represented by the first
the 0/16/18/20/21 controls
N10 X5.0 Y5.0 (MIDDLE HOLE)
four digits, to the maximum of 9999. Nil G80 Z1.0 M0
N12 G28 Z1.0 MO
M98 P99993952 N13 M01
repeats the execution of subprogram 03952, nine thou- (TOOL 2 - 35/64 DRILL)
sand, nine hundred and ninety nine times, the maximum N14 TO
number of repetitions available (some old models may N15 M0
have the maximum of only 999 times). N16 G90 GOO G54 X2.0 Y2.0 S840 M03 T03
N17 G43 HO 2 Z1.0 M08
N18 G99 G81 R0.1 Z-1.214 F11.0
LO/KO in a Subprogram Call
N19 X8.0
N20 Y8.0
There is no mystery in using the L/K counter greater than
N21 X2.0
one to repeat a subprogram. This is a common application.
N22 X5.0 Y5.0
Fanuc also offers a zero number of repetitions, in the form N23 G80 Z1.0 MO
of L0/K0. When can the L0/K0 be programmed? Would N24 G28 Z1.0 M05
anybody want to repeat a subprogram zero times N25 M01
SUBPROGRAMS 371
This type of program uses repeating XYcoordinates for N23 M98 P3953
each tool (spot drilling, drilling, tapping). In order to make N24 G28 Z1.0 M05
the program more effective, all repeating blocks of the pro- N25 G28 X5.0 Y5.0
N26 M30
gram will be collected into a subprogram and used much
%
more efficiently. Here is the pattern of holes separated from
the long program that also includes the G80Z1.0M09, as
In the program, the XY tool
motion for each cut-
initial
the standard end of any active fixed cycle:
ting tool will position the cutter at the first hole of the ma-
chining pattern. All fixed cycles used in the program start at
X2.0 Y2.0
the first hole of the pattern. Since the first hole definition is
X8.0
Y8.0 included in the subprogram, as well as in the main pro-
X2.0 gram program LO in the fixed cycle call is mandatory, else
,
X5.0 Y5.0 the first hole of the pattern will be machined twice. This is a
G80 Z1.0 MO classic application of the LO relating to fixed cycles, but not
subprograms. Also included in subprogram (93953 can be
Only a small effort is needed to reformat the existing pro- the standard machine zero return block G28Z1 .0M05, as it
gram and separate it into a main program and a subprogram repeats after each M98 call in the main program 03902.
that stores the repeating machining pattern. Isolated XY This practice correct but not recommended, as it lacks in a
coordinates of all five holes in the pattern are included: clearly structured program.
03953 (SUBPROGRAM)
(FIVE HOLE PATTERN)
SUBPROGRAM NUMBERING
N1 X2.0 Y2.0
N2 X8.0 To keep track of subprograms is much more important
N3 Y8.0 than keeping track of regular programs. Always make sure
N4 X2.0
to know exactly what subprograms are available and how
N5 X5.0 Y5.0
N6 G80 Z1.0 MO 9 they are used, what is their purpose. A single subprogram
N7 M99 may be used in many other programs and proper subpro-
% gram identification technique is extremely important.
N2 G17 G40 G80 T01 the programming level, not at the machine operation level.
N3 MO 6 It is programmer’s responsibility, not the CNC opera-
the
N4 G90 GOO G54 X2.0 Y2.0 S900 M03 T02 tor’s, to assign subprogram numbers. Programmer has a
N5 G43 HOI Z1.0 M08 great flexibility in organizing the subprograms and their
N6 G99 G82 RO.l Z-0.3275 P200 F3.0 LO identification - in fact, any programmer can design and set
N7 M98 P3953 up certain basic rules and related standards. Many of the
N8 G28 Z1.0 MO
rules governing the format of mam programs also apply to
N9 M01
subprograms. Remember these four main points:
372 Chapter 39
If used in a program, the program number is quently called from any program, main or another sub-
commonly specified by the letter 0, followed by four program. without a fear of duplication or a part program
or five digits, depending on the control system
number mismatch.
If used in a program, the program number can be specified
Subprograms should always be documented in some log
by the colon symbol, commonly for the ISO format,
:
numbers can be assigned by the machine operator. On the P... is the minimum requirement for a subprogram call from
06200 (SUB 2)
current program number
N6201 ...
N6202 ...
2. Display comment on the display screen
N6203 ... ...cmdsoon
3. Set the units of measurement (inches in the example)
This method works only with the maximum of one hun-
4. Branch out to the top of subprogram 03954
dred blocks, suitable for many subprograms. The operator
finds it easy to monitor a program with several subpro-
5. Execute all blocks in the subprogram 03954
grams. This is not a foolproof method for all programs, but
6. When M99 is processed, the subprogram ends the idea will work for most jobs.
and returns to the main program
Protected Subprograms
7. The main program is processed, beginning
with the block N3 Subprograms are special programs designed to be used
frequently. Special subprograms may be even stored in the
8. When M30 is processed, the main program ends
system memory permanently, to be called by all or many
and returns to the beginning
other programs. Any interference with these subprograms,
9. When the CYCLE START switch is activated, accidental or intentional, can prove to be disastrous. If only
steps 1 to 8 are repeated a single subprogram is lost from the memory, it may halt
literally hundreds of programs that depend on the use of
As example shows, the main program uses incre-
the this ill fated subprogram.
ments of the subprogram also uses increments of
1 , but 1 ,
starting with N101 block number. There are two reasons Fanuc controls address problem by allow-
this potential
for it. The first reason is that a properly designed subpro- ing an assignment of a certain specified series of program
gram will not likely be a subject to any major changes - numbers that can be locked up by a system parameter set-
there should be no need to add any extra blocks into the ting. As a typical example, a program number series 9000
subprogram once it has been debugged. The second reason (within the range of 09000 to 09999), will not display on
is even more important. The lack of duplicated sequence the control screen, when locked by the system parameter.
numbers will be visible on the control display screen. The Also, programs in this series cannot be edited or printed
display of active block numbers will quickly inform the out, etc. If the locking parameter is not set, the programs of
CNC operator whether the main program or a subprogram the 9000 series behave normally, like any other program. In
is being processed. Fanuc controls are very forgiving about order to take advantage of this feature to protect some im-
the block numbers and allow identification of block se- portant programs from unauthorized editing or even view-
quences freely, within a specified range. ing, consult the Fanuc documentation for further details.
is no damage done by developing the long program first. It Subprogram 03955 contains this pattern and uses the L
takes more time and it is not efficient. However, this is how address to establish the number of fixed cycle repeats. In
a professional experience is gained. With limited experi- the first main program 03904, the tool motion precedes the
ence, be willing to re-write a program from a single long subprogram block. To start the program development, con-
form to a main program and one or more subprograms. centrate on the hole pattern. First, select the G91 incremen-
Programmer should be able to identify those sections of a tal mode for the pattern. Then program the X and Y incre-
long program that can qualify as subprograms. Once such a mental values, starting from any hole, such as the lower left
series of repetitive data is identified in the conventional hand corner and continue in one direction - Figure 39-6.
program, it is only a matter of small adjustments to separate
these repetitive clusters and define them as subprograms.
h* - 0.75(3)
L
4©OO
0.60
-
(2)
O o Figure 39-6
ft o o 03955 (SUBPROGRAM)
( FOUR- CORNER LOCATIONS)
00.407 N551 G91 X0.75 L3
10 PLACES N552 Y0.6 L2
0.50 DEEP N553 X-0.75 L3
N554 Y-0.6
N555 M99
Figure 39-4
%
Detail of the hole pattern used in program 03904
The subprogram is designed to machine nine holes in a
This hole pattern is repeated
four specified locations of
at rectangular pattern. The tenth hole - actually it is the first
the part, as illustrated in Figure 39-5. hole - is machined in a block with the cycle call or the rapid
motion. The four pattern locations are not included in the
subprogram - they must be included in the main program.
Since the main program is using absolute mode G90, the
individual locations can be established:
incremental positioning commands and the number of cy- contouring subprogram, with embedded D offset. D51 set-
cle repetitions. The number of repetitions in the subpro- ting value is equal to the cutter radius:
gram is the number of spaces, not the number of holes.
03956 (CONTOUR SUBPROGRAM - A)
A simpler way, particularly useful for a great number of N561 G41 G01 XO D51 F10.0 (D.. INCLUDED)
pattern locations, is to combine the rapid motion to the N562 Y1.75
pattern starting location with the subprogram call. This is
N563 G02 XO 25 Y2.0 R0.25.
The major advantage of 03905 is shortening the length tain the stock allowance (D5 = cutter radius + stock), D52
1
of program 03904 - either method produces the same re- stores the finishing radius only (D52 = cutter radius). For a
sults and the selection is a matter of personal preference. 0.500 end mill, the set values could be:
Note the seemingly unnecessary repetitions of the modal
G90 and X and Y axes. Modal values have to be followed D51 = .250 radius + .007 stock = .257
extra carefully for subprograms. D52 = .250 radius + .000 stock = .250
Modal Values and Subprograms Next, the D.. has to be removed from the subprogram:
In theexamples 03904 and 03905, note repetitions of N564 G01 XI. 875
G90, X6.25 and Y5.0. They are very important. The sub- N565 YO
program 03955 changes the control status to the incre- N566 X-0.75
mental mode G91 and the last hole of the ten hole pattern is N567 GOO G40 Y-0.75
not the same as thefirst one. The first hole of the pattern is
N568 M99
%
machined when the rapid motion to that hole is completed
in the absolute mode. That happens in the main program.
The control does require the D offset but not necessarily
not within the subprogram.
in thesame block as G4 1/G42. As long as the D is specified
Here is another common problem. A finish contour sub- before G41/G42, it can be passed on to the subprogram
program uses cutter radius offset G4 or G42 with the D 1
from the main program, depending on the operation:
two D offsets and take the D address out of the subprogram, This is a very powerful method of using subprograms for
then call it together with M98, for example: more than one operation, if the control supports it.
376 Chapter 39
Return from a Subprogram main program. When a subprogram is called from the main
program by M98 P.. block, the control forces a branch to
The current modal values should he clear in the main pro-
the beginning of the called subprogram, processes its con-
gram when a subprogram is completed. Values that may
tents, then it returns to the main program to process the re-
have changed in the subprogram are absolute or incremen-
maining blocks of the main program - Figure 39-7.
tal mode, motion command, coolant and others. Subpro-
any modal values that are currently active. branch from the main program and starts processing the
blocks in the first subprogram, starting from its top. During
As the 03904 and 03905 examples show, a fixed cycle is
processing of the first level subprogram. CNC system en-
called from the main program only once. All modal cy-
the
counters a call for a second level subprogram.
cle data are carried forward to the subprograms. The main
program clearly shows current modal values. At this point, processing of the first level is temporarily
suspended and CNC system branches to the second level.
MULTI LEVEL NESTING Since there is no subprogram call from the second level, all
blocks in the subprogram will be processed. Anytime the
block containing M99 function is encountered, the CNC
The example has shown the main program that calls
last
system will automatically return to the program it branched
only one subprogram and the subprogram does not call an-
out of. It willresume processing of that program, tempo-
other subprogram. This is called one level nesting, or nest-
rarily suspended before.
ing at one level deep. Modern controls allow nesting up to
four levels deep. That means, if the main program calls a The return to the program of origin will normally be to
subprogram number one, this subprogram can call a sub the block immediately following the subprogram call block
program number two. that can call a subprogram number in that program. All remaining blocks in the first subpro-
three, and that can call a subprogram number four. This is gram willbe executed until another M99 function is en-
called a four level nesting. All four levels are rarely needed countered. When that happens, the control system will re-
forany practical application, but these are the program- turn to the program it branched out of (program of origin),
ming tools available, just in case. The following examples in this case to the main program.
show program processing How of each nesting level.
Since there are still some blocks left
main program,
in the
One Level Nesting they will be processed until the M30 is encoun-
function
tered. M30 terminates the execution of the main program.
One level nesting means that a main program calls only Figure 39-8 illustrates schematically the concept of a two
one subprogram and nothing more. Subprogram that is level subprogram nesting.
nested one level deep is the most common in CNC pro-
gramming. The program processing starts at the top of the
<START>
010 r-
<START>
(MAIN) 021 022
010 r-
(SUB) (SUB)
(MAIN) 021
(SUB)
<START> M99
M99
OlO r- M30 %
% M99 M99
(MAIN) %
021 022 023 '
—% L- %
(SUB) (SUB) (SUB) <END>
Figure 39-10
Three level subprogram nesting There are many fairly experienced CNC programmers in
the machining trades field, who try to use a multi level nest-
Four Level Nesting ing at all costs, and the more levels, the better programmers
they feel they arc. These programmers, more often then
The logic of multi level subprogram nesting should be not, use such complex programming technique as the
pretty clear by now. Four level nesting is just a multiple ex- means of expressing their so called ‘professional skill’,
tension of a single nesting and is logically identical to all usually measured against other programmers. Often, this
the previous examples. is nothing more than a unnecessary contest, a frustration
perhaps, and definitely an expression of a little ego trip.
Unnecessary addition of more branches for a multi depth
subprogram nesting makes any programming application When a programmer becomes obsessed with making the
that much more complex and more difficult to master. program as short as possible, at any and all costs, he or she
is taking the wrong trek. Such programs, even if they are
Programming the subprogram nesting into the four level
technically flawless and logically correct, are not always
depth (or even the three level depth) will require a full un-
very easy to use by a CNC operator. A CNC machine op-
derstanding of the program processing order - and having a
erator with limited or no programming knowledge will find
suitable application for it. In typical machine shop pro-
these programs extremely intimidating - even skilled and
gramming, there is seldom the need to use level three and
experienced operators will find them hard to read, hard to
level four nesting. If a good example of a four level nesting
interpret and most likely, they will be unable to make any
application is found, the typical program How will conform
substantial changes to them, in order to modify or optimize
to the formal illustrated in Figure 39-10.
the programs for a better performance.
Nesting Applications A simple general rule for multi level nesting technique -
CONTOURING WITH A SUBPROGRAM profile 25 times, for 25 x ,010 = .250 total required depth.
Preference for a subprogram in such a case is without a
question. Symbolic detail of the depth cut for a single in-
So number of programming examples have been us-
far, a
crement is illustrated in Figure 39-12.
ing a subprogram. They all related to machining holes and,
hopefully, offered enough material to understand the con- The subprogram 03958 will contain only the tool mo-
cept of subprogramming (there will be one more - a rather tions common groove cuts. That means the .0
to all the 1
Even in a material that cuts well, for example brass, split- to the main program (after a subprogram is completed)
ting a single depth cut of .250 into two depth cuts of .125
Thefirst requirement is met in block N5. The Z axis posi-
may prove beneficial. The material is D2 tool steel, rather a
must be at ZO, nowhere else! Being at ZO, it will enable
tion
tough material. The tool will run at only 630 r/min and only
the tool to increment 25 times the distance of .010, result-
plunge into the material .010 at a time, repeating the groove
ing in .250 groove depth. Described differently, the tool
start position before a subprogram is called must be at a po-
sition that results in a correct tool path.
1
G91 Z-0.01 The second requirement is met in block N7. It is the G90
command that makes this block special. Why? Because the
subprogram uses G91 incremental mode. When the sub-
— Groove width — program processing returns back to the main program, it no
longer benefits from the incremental mode, and the G90
Figure 39- 12 changes the incremental mode back to absolute mode.
Detail of the subprogram 03958 front view shown
SUBPROGRAMS 379
TOOL CHANGE SUBPROGRAM Also note the various cancellation functions - there are
quite afew of them in subprogram 03959. When designing
such a subprogram, the programmer has absolutely no idea
The programming sequence for a typical automatic tool
whether the coolant will be ON or OFF; no idea if a fixed
change (ATC) is usually short and simple. For a CNC mill- cycle or the cutter radius offset is active or not. Also, the
ing system, the M06 function will normally do the job and
programmer has no idea as to what the current status of
for the CNC lathes, it is the T function that does the same
G90 or G91 modes is.
thing. The change cannot be programmed without es-
tool
tablishing certain conditions. Program functions relating to Their actual status is really not that important. These can-
machine zero return, coolant cancellation, spindle stop and cellations arc included in the subprogram, taking advan-
others, are all an integral part of the tool change routine. It tage of the fact that a cancellation of a function that is al-
may take three, four, five or more program blocks to estab- ready canceled will be ignored by the control system. As
lish the right conditions - every time the automatic tool the example shows, even a ‘simple’ tool change sequence
change is programmed, which can be quite often. Even requires some serious thinking.
more significant is the fact that the blocks always have the
same contents, regardless of the program being used.
100 000 000 HOLE GRID
As an example of this concept, consider the following se-
quence of operations, they are quite typical, required to In the last section of this chapter, perhaps a little deviation
program a tool change for several tools in a single program. from the handbook seriousness will be tolerated. This
section will look at subprograms from a different angle, but
The example based on a typical vertical CNC machin-
is
with a real example. The following exercise takes the sub-
ing center, and uses automatic tool change function (ATC):
programming power to the very extreme. Although it is
1. Turn off the coolant presented primarily on a light note, it docs serve a very
2. Cancel a fixed cycle mode practical purpose - it shows the power of subprograms and,
3. Cancel a cutter radius offset mode hopefully, makes a strong case for their use.
4. Turn off the spindle
5. Return to Z axis machine reference position The example illustrates how one hundred million holes,
6. Cancel offset values (yes, one hundred million holes), can be spot drilled and
7. Make the actual tool change
drilled using a program of only 29 blocks for the two cut-
ting tools. These 29 blocks even include the program num-
The seven individual operations will occur in every pro-
gram that requires this particular tool change and they will bers and stop codes (% signs). Figure 39-13 shows a simple
occur for every tool in each program. That is a lot of pro- grid pattern of 10000 rows (X) and 10000 columns (Y).
To make the example reasonable, simple, and interesting What makes the program even more interesting is the es-
at the same time, the holes are very small, only 05/64 timate of machining time. This may go a little too far, but
(.078 ), with a pitch of 20 along each axis, resulting in a
1
. 1 let’s finish whole page, make a
the fun. Before reading the
square grid pattern of holes very close to each other. guess - how long will it take to machine all holes with the
two tools? The speeds and feeds are reasonable for most
Only two tools are used, a spot drill with a 90° tool point materials, so are the clearances and the dwell time for spot
angle to startup the hole for drilling and a 05/64 drill. Both drilling. A rapid traverse of 475 in/min is assumed in all
cutting tools start machining from R0.06 cycle position
axes, a reasonable speed. It is worth the few calculations?
above the plate to their respective depths: Z-0.04 for the
Motions between the machine zero and the first location
spot drill and Z-0.215 for the drill.
are disregarded in both directions for convenience.
From the programming point of view, the program design The first calculation finds the time it takes to make a rapid
is not difficult at a main program and one
all - it will use
motion between all holes. One hundred million spaces (less
subprogram. The programming procedure is the same for one space) multiplied by .120 divided by 475 in/min is
100 0(X) 000 holes, as if the grid were only 100 holes. The 25.263.1576 minutes. These motions will be multiplied by
main program contains the standard settings and also calls two, for two tools, therefore 50,526.3153 minutes.
the subprogram. The subprogram will repeat the active
fixed cycle 9999 times, for two rows, one in each direction. The spot drill will move .060 from the clearance to the
top of part and .040 depth of cut, for the total length of 100, .
The start position for the first tool motion is at an arbi- multiplied by one hundred million holes at the rate of 5.0
trary location X 1 ,0Y 1 .0 (shifted by . 1 20 along the minus Y in/min, therefore cutting time for spot drilling will be
axis). A fixed cycle drills the first hole, repeats itself 9999 2,000,000 minutes. The spot drill will rapid out of the hole
times, shifts in the positive Y axis once, drills a hole and re- one hundred million times the distance of 00 at the rate of . 1
peats along the negative X axis 9999 times again. This 475 in/min. totaling 2 ,052.63 6 minutes: the dwell time at
1 1
03960 (SUBPROGRAM) The actual drilling will take place to the depth of .215
N601 G91 Y0.12 from .060 clearance level, for the total travel of .275 at the
N602 X0.12 L9999 rate of 4.0 in/min - which is another 6,875,000 minutes.
N603 Y0.12 The drill will rapid out of one hundred million times by the
N604 X-0.12 L9999
distance of .275, at the rate of 475 in/min, adding another
N605 M99
% time of 57,894.7368 minutes.
N2 G17 G40 G80 T01 (SPOT DRILL) which is 17.2269 years. Believe it or not, it will take more
N12 MO 6 market can handle this monstrous task. How would the
N13 G90 GOO G54 XI. 0 Y1.0 S3000 M03 T01 plate be mounted, for example? That is another question.
N14 G43 Z1.0 HO 2 M08
N15 G99 G81 R0.06 Z-0.215 F4.0 LO To make the example even more fun for the last time,
N16 M98 P3960 L5000 consider the time spent on programming, doing it without a
N17 G90 G80 Z1.0 subprogram and without the repetition count (address L).
N18 G28 Z1.0 Assuming that each block will take 6 seconds to write and
N19 G91 G28 XO YO 55 blocks will on a standard paper (hard copy), it would
fit
N20 M30 take about 19 years (yes, nineteen years just to write the
!)
%
program for the two tools (no interruptions, of course). As
far as the paper is would end up with 'only'
concerned, it
The program design takes an advantage of the subpro-
1.818.182 sheets, or a stack of approximately 705 feet (2
gram nesting and the maximum number of repetitions.
1
The majority of CNC programs will be programs for a mand G92 and G50 registers the absolute coordinates of
single job - a job that is relative to a specific machine avail- the current tool position and have no influence whatsoever
able in the shop. Such a particular job will have its unique on the incremental dimensions, when using the G91 com-
characteristics, its special requirements as well as its own mand for milling or the U/W axes for turning. Its normal
tool path. The tool path is the most important of all the fea- purpose is to ‘tell’ the control system the current tool posi-
tures of a CNC program. tion. This step is necessary at least once at the beginning of
each tool to establish the relationship between the fixed
It is the CNC programmer’s main responsibility to de-
program zero (part origin) and the actual position of the
velop a functional tool path for any given job, without er-
cutting tool. For example,
rors and in the most efficient way. The tool path develop-
ment is very important, because it represents a machining G92 X10.0 Y6.5
pattern unique to the job at hand. In most programming
jobs, this machining pattern is executed for the given job is ‘telling’ the control system that the cutting tool is set at
only and is irrelevant to any other
program. Often, CNC positive 10.0 units away from the program zero in the X
programmers encounter opportunities, where an existing axis and positive 6.5 units away in the Y axis.
machining pattern can be used for many new jobs. This dis-
covery will encourage development of the programs more What happens if a wrong position is registered? What if
efficiently and produce CNC programs for many additional the values in the G92 or G50 statement do not accurately
applications and without errors. reflect the true, the physical position of a cutting tool? As
may be expected, the tool path will occur at the wrong
The programming technique that addresses this issue is place and the result is quite likely a scrap of the machined
known as the Translation of a Machining Pattern or, more part, tool breakage, even a damage to the machine itself.
commonly, a Datum Shift. The most typical example of this Certainly not a desirable situation.
technique a temporary change of the program reference
is
point (program zero) from the original position to a new A imaginative CNC programmer always tries to find
position, so called work shift. Other programming tech- ways and special methods that take advantage of the avail-
niques include Mirror Image, described in the next chapter. able programming tools. G92 and G50 commands are only
Coordinate Rotation and Scaling Function, described in two of many tools that offer a tremendous power to a
the chapters that follow. creative CNC programmer.
Datum Shift, also known as the Machining Pattern Transla- manipulations. It is not very economical to invest precious
tion. This is a basic feature of all CNC systems that can be time on adding features to the program that will never
applied in a variety of ways. provide real advantages. If such a need is well justified, the
program can be optimized later.
datum a temporary or permanent If the G92 command is used on machining centers or the
In essence, a shift is re-
location of the part zero (program reference point) inside of G50 command for lathes at all, rather than the more current
the program. When this programming technique is used, it
and very efficient G54 to G59 work offsets, only one G92
relocates an existing machining pattern (tool path) in the (G50) position register command is needed for a single tool
program at different locations within the CNC machine
- assuming that work offsets are not used.
work area.
Any occurrence of more than a single position register
In an earlier section (Chapter 16), explanation of G92 command per each tool in one program is called a program
(milling) and G50 (turning) commands was covered. Re- zero shift.
381
382 Chapter 40
04001
(G92 USED FOR TWO TABLE LOCATIONS)
N1 G20 G90
N2 G92 X22.7 Y19.5 Z12 5 (TOOL AT M/C ZERO)
.
N3 S1200 MO
N4 MO 8
N5 G99 G82 X2.5 Y1.5 RO.l Z-0.2 P200 F8 .
N6 X6.75
N7 Y5.0
N8 X2.5 (TOOL AT LAST HOLE OF PART A)
N9 G80 Z1.0
N10 G92 X-8.7 Y-4.7 (SET AT LAST HOLE OF A)
Nil G99 G81 X2.5 Y1.5 RO.l Z-0.2 P200
N12 X6.75
N13 Y5.0
N14 X2.5 (TOOL AT LAST HOLE OF PART B)
N15 G80 Z1.0
A sample drawing for zero shift illustration - program 04001 N16 G92 X-9.0 Y-4.8 (TOOL FROM M/C ZERO)
N17 GOO Z12.5 MO
Based on this drawing, the four holes will be machined at N18 XO YO (TOOL AT M/C ZERO)
two independent locations of the machine table setup, as il- N19 M30
%
lustrated in Figure 40-2.
G92 X(A) _ Machine Several blocks require clarification, namely blocks N2.
N8, N10, N14, N16 and N18. Each of them relates to the
Zero
current tool position in some way. Be very careful here. Not
understanding the principles behind G92 calculations have
caused programmers many troubles.
I The cutting tool starts from the machine zero position for
< each program execution. It is also mounted in the spindle
> before machining. In block N2, the part zero (reference
CM
05
point) for Part A is established. The cutting tool at this point
CD is 22.7 inches from program zero along the X axis, and 1 9.5
inches along the Y axis. The coordinate setting in block N2
reflects this fact. In blocks N7 and N8, the tool has com-
pleted the last hole of Part A (at X2.5Y5.0 of the current
G92 setting).
PartB: X- 11.2 Y-9.7 ZO from Part A Blocks N13 and N14 contain the coordinates for the last
Also note that the Z value is the same for both Part A and
tool locationof Part B. From the illustration, it should be
easy to understand the meaning of the coordinate values in
Part B, because the same tool is parts. To spot
used for both
drill the four holes at two locations, the program may be block N16. In order to complete the program, the cutting
tool has to return to the home position (machine zero). This
written this way - program 04001
DATUM SHIFT 383
“
o o lO
« O) When working with work offsets, three programming
B
X2.5 't methods are available to make the job a lot more conve-
9.7 Y5.0 -© — e- t nient and perhaps even less prone to miscalculations:
- 11.2 hole of the pattern for example, G54 for the reference to the part edge
and G55 for the reference to the center
Figure 40-3 of the bolt circle pattern
Calculations of G92 coordinates fXY) for program example 04001 Use a local coordinate system, within the current work
coordinate system (work offset) selected at the
return will take place fromX2.5Y5.0 of the Part B, which beginning of program
is9.000 inches from the machine zero along the X axis and
4.800 inches along the Y axis: In all cases, one significant advantage has been gained -
Once the current tool position is set at the last hole of Part The first method, programming to the bolt circle center,
B, a return to the machine zero can be made. This return is is a common method and no comments are necessary.
necessary, because it is the location of the first tool. The tar-
get position for machine zero is X0Y0 not because it is a The second method, using the changes from one work
machine zero, but because the G92 coordinates were mea- offset to another, is also quite common. Its usage is not dif-
sured from there! The actual X and Y motion to machine ficult.The limitation of this method is the reality that only
zero is programmed in block N 18. six work offsets are available as a standard feature on typi-
cal Fanuc control - G54 to G59. If all six offsets are needed
for some work, none is left as a ‘spare’, to use for situations
LOCAL COORDINATE SYSTEM
such as a bolt circle pattern. (There are additional work off-
sets available as an optional feature of the control system).
The G92 command for position register is as old as abso-
lute programming itself. In time, it has been supplemented The third method, using the local coordinate system
by additional commands that control the system of coordi- method, has the main advantage that it allows the use of a
nates. The work coordinate system (G54 to G59 work off- dependent - also called a child - coordinate system within
sets) has been discussed and a suggestion made that G92 the current work offset - also called the parent work offset.
should not be used when any work offset is in effect. Such a Any number of local coordinate systems can be defined
situation prevents changing the program zero on the fly, within any parent work offset. Needless to say, work is al-
when needed only temporarily. Fortunately, there is a solu- ways done in one coordinate system at a time. Note:
tion in the form of a programmable subset of the work co-
ordinate system (work offsets) called the local coordinate The local coordinate system is not a replacement for,
system or the child coordinate system. but an addition to, the work coordinate system.
G52 Local coordinate system All tool motions that follow the cancellation will be rela-
tive to the original work offset, which was specified by the
G54 selection earlier in the example.
The G52 command is always complemented by the ac-
tualknown work coordinates that set a new - that is tempo- The bolt circle program uses the techniques described.
rary - program zero as illustrated in Figure 40-4. Think about the benefit of this type of programming, as op-
posed to letting the lower left corner be the only part zero.
G54(X)
First, a possible error by the CNC
G52(X)«
# operator during setup
has been minimized. True, the operator still has to set the
G54 readingat the lower left corner of the plate, but does
not have to do any adjustments for the bolt circle center.
Programming is also easier, because the coordinate values
G54(Y) of the bolt circle originate from the center of the bolt circle,
not from the plate edge.
G54 SETTING ORIGIN PROGRAM ORIGIN N7 G99 G82 R0.1 Z-0.2 P100 F10.0 LO (NO HOLE)
N8 X2.25 YO (HOLE 1)
N9 XI. 125 Y1.9486 (HOLE 2)
Figure 40-4
N10 X-1.125 (HOLE 3)
Local coordinate system definition using the G52 command Nil X-2.25 YO (HOLE 4)
N12 X-1.125 Y-1.9486 (HOLE 5)
The shows a bolt circle of six holes located in
illustration N13 XI. 125 (HOLE 6)
The typical program zero is at the lower
a rectangular plate. N14 G80 Z1.0 MO
edge of plate and the bolt circle center is located X8.0 and N15 G52 XO YO (RETURN TO G54 SYSTEM)
Y3.0 inches from that edge, which will become the G52 N16 G28 Z1.0 MO
shift amount. The bolt circle is 04.500 inches and the first N17 M01
hole is at the 0° position of the bolt circle. Subsequent holes
N18 T02
are machined in the CCW direction as holes 2, 3, 4, 5 and 6. N19 MO 6
What program will do is to temporarily transfer the
the N2 0 (... Machining continues ...)
part zero from the lower edge of plate to the bolt circle cen-
ter, in the program. Using the illustration as a guide, follow
MACHINE COORDINATE SYSTEM
the programming blocks, as they relate to the bolt circle and
in the logical order they would appear in a program:
So the work coordinate system (G54 to G59 work off-
far,
G90 G54 GOO X8.0 Y3.0 (BOLT CIRCLE CENTER) sets)have been discussed, as well as the local coordinate
(-- WORK COORDINATE SYSTEM POSITION ) system G52. They are both very powerful and extremely
useful programming tools. Fanuc eontrol system offers yet
G52 X8.0 Y3.0 another coordinate system, not commonly used. It may he
(-- NEW PROGRAM ZERO ESTABLISHED ) called the third coordinate system.
(G81) X2.25 YO (HOLE 1 LOCATION FROM NEW ZERO) Selection of this coordinate system is exclusively with
(-- COORDINATES FROM NEW ZERO )
the machine coordinates and preparatory command G53.
G52 XO YO
(-- CANCEL LOCAL OFFSET AND RETURN TO G54 ---) G53 Machine coordinate system
DATUM SHIFT
385
Machine coordinate system uses the coordinates mea- 04003 (G53 COMMAND USAGE)
sured from the machine zero as an input - always! N1 G20
N2 G17 G40 G80 T01
At benefits in using this unique coordinate system
first, N3 G91 G28 ZO
may notbe apparent. Before jumping to conclusions, N4 G90 G53 GOO X- 170.0 Y-50.0 (TOOL CHG POS)
evaluate the rules for machine coordinates system, perhaps N5 MO 6 (ACTUAL TOOL CHANGE)
N6 G54 GOO X26.0 Y25.0 S1000 M03 T02
some applications will become clear:
N7 G43 Z1.0 HOI M08
Command G53 is effective only in the block
N8 G99 G82 R0.1 Z-0.2 P100 F8 .
where it is specified
N9 X53.0 Y13.0
N10 G80 G28 Z1.0 MO 5
Programmed coordinates are always relative Nil G53 GOO X- 170.0 Y-50.0 (TOOL CHANGE POS)
tomachine zero position N12 M01
The following program illustrates the use of the G53 N250 G90 G54 GOO X17.7 Y35.3
command. It makes the tool change at a fixed position of N251 G01 Z-5.0 F200.0
themachine table, position that is not directly related to the N252 GOO Z500.0
program or the job - see Figure 40-5. N253 G53 X-400.0 Y-100.0 (FIXED POSITION)
N254 MOO (MANUAL TOOL CHANGE)
N255 S1200 MO
N256 X50.0 Y35.0 (IN ORIGINAL WORK OFFSET)
N257 (... Machining continues...)
Machine coordinate system G53 - program example 04003 N256 G90 G54 GOO X50.0 Y35.0
386 Chapter 40
As a good programming practice, always program the G10 command has a simple format that is different for
complete block that contains all setting information, and do machining centers and lathes. Be prepared to encounter mi-
it for each new tool called. There are other practical uses for nor differences in format for various Fanuc controls, al-
the machine coordinate system, waiting to be discovered. though the programming methods are logically the same.
Formats also vary for the different types of offsets, for ex-
automated, including the maintenance of tools and related Work offsets G54 to G59 and G54.1 P..
All this high tech automation is possible with an optional This group includes all associated offsets, if available.
control feature called Data Setting. Many controls have this
special feature available, a feature that should never be WORK OFFSETS
underestimated. Even a small shop with only one stand
alone CNC machine can benefit from Data Setting feature,
Before studying this section, review Chapter 18 that de-
provided it is supported by the control system.
scribes the concept of the work offsets in detail.
In its basic form, the preparatory command G 10 is a non G10 L2 P. . X. . Y. . Z Machining centers = mills
modal command, valid only for the block in which it is pro- G10 L2 P. . X. . Z. Turning centers = lathes
The L2 is a fixed offset group number that identifies the TOOL LENGTH OFFSETS
input as the work offset setting. The P address in this case
can have a value from 1 to 6, assigned to the G54 to G59 se-
Tool length offset value for milling controls can be pro-
lection respectively:
grammed with the G 0 command combined with the L off-
1
P1=G54 P2=G55 P3=G56 set group. Depending on the type of control memory, the L
P4=G57 P5=G58 P6=G59 offset group will have different meanings.
for example, There are three types of memory on Fanuc controls for
the tool lengthand tool radius offsets:
G90 G10 L2 PI X-450.0 Y-375.0 ZO
Memory A - only one column for tool length offset
inputs X-450.0Y-375.0Z0 coordinates into the G54 work
offset register (all examples for this section are metric). Input: Combined Geometry + Wear offset
G90 G10 L2 P3 X-630.0 Y-408.0 Values: Value set by G10 L1 1 R. R.. block
inputs X-630.0Y-408.0 coordinates into the G56 work Memory B - two columns for tool offset
L2 = Standard work offsets Values 1 Values set by G10 L10 R. R.. block
will place X-10.0 into the external work while re- offset,
In all cases, the L number is an arbitrarily assigned offset
taining all other settings (the Y axis, the Z axis and any ad-
group number by Fanuc and the P address is the offset reg-
As an example for a CNC machining center, the follow- If the existing offset amount needs to be only adjusted,
ing block will input the amount of negative 468 mm into use the incremental programming mode. The last example
the tool length offset register number 5 (five): of a wear offset will be updated by adding 0.010 mm:
G90 G10 L10 P5 R-468.0 G91 G10 L13 P7 R0.01 (NEW SETTING IS 0.02 MM)
If the offset has to be adjusted in order to make the cut 0.5 Be careful with the G90 and G9 mode remember to re-
1
-
mm less deep for the tool length offset 5, change to the in- store the mode for subsequent sections of the program.
cremental mode G91 and program:
LATHE OFFSETS
G91 G10 L10 P5 R0.5
Older Fanuc controls were using the address LI instead of G10 P.. X(U).. Z(W).. R (C) . . Q..
the newer LI 1 . These controls did not have a wear offset
as a separate entry. For a compatibility with the older The P address is either the geometry offset number or the
controls, LI is accepted on all modern controls in lieu of L1 1. wear offset number to be set. The addresses X, Z and R are
absolute values, the addresses U, W and C are their respec-
tive incremental equivalents. No G90 or G91 mode is avail-
To tell apart the geometry offset and the wear offset, the
On most CNC machining centers, the range of tool length
geometry offset number must be increased by an arbitrary
offset values is limited:
value of 10000:
will input -0.030 radius amount into the cutter radius G10 PI R0.8 Current T setting assumed
wear offset register number 7.
. . sets R0.8 value in W 01 wear offset
DATUM SHIFT 389
. . . updates X-0.12 by +0.05, help much. Authorization to change parameters for the ma-
to the new value of X-0.07 chine tool, regardless of other professional qualifications,
is equally important to apply this section.
Note that the tool tip number (programmed in the G10
application as the Q entry) will always change the geome- WARNING!
try offset and the wear offset simultaneously, whatever the Incorrect setting of CNC system parameters
amount or the offset type is. The reason is a control built-in may cause irreparable damageto the CNC machine!
When the G 10 command was used for the offset data set-
MDI mode on the CNC unit first, and check the results: ting earlier, had to be repeated in each block. G 10 for the
it
Set the Program mode offset entry can only be used as a non-modal command.
Modern Fanuc controls also allow to do another type of
Set the MDI mode
change through the program - the change of CNC system
Insert the test data parameters through a modal G 10 command.
For example, enter: Many entries used in programs are automatically con-
verted to a system parameter by the control. For example,
G90 G10 L10 P12 R-106.475 programming G54, the set value is seen on the work offset
screen. Yet, the actual storage of G54 value takes place in a
Press INSERT system parameter, identified by a certain parameter num-
Press CYCLE START ber. The G54 setting can be changed either through the off-
set data or through a parameter change, and the parameter
To verify, check the tool length offset H 1 2 - it should have number must be known. Some system parameters cannot
the stored value of -106.475. be changed as easily (and some cannot be changed at all),
so the modal G 10 command can be very useful. In fact, two
While still in the MDI mode, insert another test data, for
related commands are required - G 0 to start the setting and
1
example:
G 1 1 to cancel the setting:
Again, to verify, check the setting of tool length offset The data setting block has three entries:
G10 L50
Develop other similar tests to follow the same routine. It . . P. . R.
is always better to start a program with confidence.
Gil
390 Chapter 40
In case of a modal G 10 and G1 1 combination, the com- If more than one axis is required to be set at the same
mands have this meaning: time, use multiple .. R. R.. entries between G10 and G 1 1
-
Two word axis type 0 to ±99999999 The following examples illustrate various programmable
parameter entries and have been tested on a Fanuc 16
Watch Model R C.NC control - lathe and mill version. The selected
the bit types parameters - a single data number is
parameters are used for illustration only, not necessarily as
always assigned 8 bits. Each bit has a different meaning, so
typical applications. Testing these parameters on the ma-
exercise care when changing one bit but not another.
chine is not recommended!
Word type is also called an integer type and the two-word
type is also called a long integer type.
The first example changes the baud rate setting of an In-
put/Output device with RS-232 interface, if the I/O Chan-
Parameters Notation nel is set to 0 ):
Numbering of bit type and bit axis type parameters is G10 L50
standard from 0 to 7 ( computers start counting from zero N0103 R10
Gil
not from one), from right to left:
Number #7 #6 #5 #4 #3 #2 #1 #0 Parameter that controls the baud rate setting for the se-
lected device has a number #103. From a table supplied by
Fanuc, the R value can be input:
P Address
3 110 baud
G90
Setting R-value Description
— — -
G10 L50
N1221 PI R-250.0 (DECIMAL POINT NOT ALLOWED)
6 300 baud
Gil
7 600 baud
Proper input is without the decimal point. An error condi-
8 1200 baud tion (alarm or fault) will also be generated if the P address
is not specified at all. For example,
9 2400 baud
G90
10 4800 baud G10 L50
N1221 R-250000
11 9600 baud Gil
(gradual pullout distance applicable to lathe controls only). ther case, the two axes of the G54 work
first offset setting
The data type is a non axis byte, unit of the data is 0. 1 of a will be -250.000 and -175.000 respectively.
pitch and the range is from 0 to 127:
Sometimes it is necessary to set all axes to zero. This may
be done with a standard offset setting:
G10 L50
N5130 R1
Gil G90 G10 L2 PI X0 Y0 Z0 (MILLING CONTROL)
G90
one pitch of the thread. Do not confuse byte with a bit - byte
G10 L50
is a value 0 to 127 or 0 to 255 for the byte axis type, bit is a
N1221 PI R0 (SET G54 X COORDINATE TO 0)
state only (0 or 1 , OFF or ON, DISABLED or ENABLED), N1221 P2 R0 (SET G54 Y COORDINATE TO 0)
offering selection of only one of two options available. The N1221 P3 RO (SET G54 Z COORDINATE TO 0)
word BIT is actually an abbreviation of two words: Gil
Bit = fl/nary digit (‘binary’ means based on two ) Bit Type Parameter
Another example is for the entry of a two word parameter The next example is quite harmless and may be used as a
type.It will change the work offset G54 to X-250.000:
test, but be careful with any other parameters. Its only pur-
pose is to set automatic block sequencing ON while enter-
G90
G10 L50
ing a CNC program at the control. It also serves as an illus-
of a bit type parameter and is a good example of
tration
N1221 PI R-250000
Gil some general thoughts and considerations that go into pro-
gram preparation using programmable parameter mode.
Parameter #1221 controls G54, # 222 controls G55, and 1
eight bits. bit has its own meaning. Bit #5 (SEQ) con-
Each trol panel keyboard. Anytime the End-Of-Block key EOB
trols the state of the automatic sequence numbering (ON or is pressed, the N number will appear automatically on the
OFF is the same as 1 or 0. but only a number can be input). screen, in the increments of five, saving keyboarding time
An individual bit cannot be programmed, only the single during manual program input.
datanumber of all eight bits. That means all the other bits
must be known in order to change one. In this example, the The idea behind the G10 being modal in the programma-
select increments of live, for N5, N10, N15, etc. The incre-
ment has to be set - yes - by another parameter number. On N121 G10 L50
Fanuc 16, the parameter number that contains the auto- N122 N0000 R00101010
matic numbering value is #3216. This is a word type pa- N123 N3216 R5
rameter and the valid range is 0 to 9999. This parameter can N124 Gil
only be activated by setting the bit #5 in parameter 0000 to
1. Program segment will look like this:
Will the program work? There are now two different N
G10 L50
addresses in blocks N
22 and N 23. How does the control
1 1
The main purpose of a CNC program development is to BASIC RULES OF MIRROR IMAGE
create a cutter tool path in a specific location of the part or
machine. If the tool path requires both the right and left The basic rule of a mirror image is based on the fact that
hand orientation, the programming time can he shortened
machining a given tool path in one quadrant is not much
by using a feature called the Mirror Image.
different than machining the same tool path in another
quadrant. The main difference is the reversal of certain
Any sequence of machining operations can be repeated
motion directions. That means a given part machined in
symmetrically by using the mirror image feature of the
control system. There is no need for new calculations, so
one quadrant can be repeated in another quadrant using the
this technique of programming reduces the programming
same program with the mirror image function in effect.
time as well as the possibility of errors. Mirror image is
The principle of the Right Hand vs. Left Hand orientation
sometimes called the Axis Inversion function. This descrip- can be applied to a machined part orientation - Figure 41 -2.
tion is accurate up to a point. Although it is true that in mir-
ror image mode the machine axes will be inverted, but sev-
eral other changes will also take place. This makes the
Mirror Image description more accurate. Those who arc fa-
miliar with a CAD system will find that the mirror image
function in CNC is based on the same principles.
Figure 41-2
Right hand vs. Left hand as the principle of mirror image Depending on the quadrant selected for the mirror image,
the tool path directional change may affect some or all of
Programming mirror image requires understanding of the these activities:
basic rectangular coordinate system, particularly how it ap-
Arithmetic sign of axis (plus or minus)
plies to quadrants. It also requires good grasp of circular in-
terpolation and applications of cutter radius offset. Milling direction (climb or conventional)
Earlier discussions established that there arc four quad- Arc motion direction (CW or CCW)
rantson a plane. The upper right area creates Quadrant I.
One or more machine axes may be affected. Normally,
the upper left area is Quadrant II. the lower left area is
Quadrant III. and the lower right area is Quadrant IV. If the
these axes are only the X and Y. The Z axis is generally not
used for mirroring applications.
program zero is at the lower left corner of the part, you are
programming in the first quadrant.
393
394 Chapter 41
X-
/ t t
MIRROR AXIS FOR
G03 o o G02
^^ r—
—o Q1
Q4
Q2
to
to
to
Q4
Q1
Q3
X- i
* ,
.
X+ Q3 Q2
—Q
'i i ,
' | | , i
to
T
QUADRANT III (Q3) y. QUADRANT IV (Q4)
G41 0 O G42
G02 G03 Figure 41-4
V
QUADRANT
1 . 1 <
QUADRANT
Mirror axis and its effect on part orientation
Mirroring will always transfer the machining pattern (the The 'normal' sign depends on the quadrant of the coordi-
another quadrant or quadrants. That is the pur-
tool path) to nate system used in programming. If programming in the
pose of the mirror image function. Programming mirror Quadrant /, both the X and Y axes have positive absolute
image requires that certain conditions are met. One of the values. Here is the complete list for absolute values in all
conditions is definition of the mirror axis. four quadrants:
Mirror Axis
Quadrant 1 X+ Y+
Since there arc four quadrants, they provide in fact four Quadrant II X- Y+
available machining areas. These areas are divided by two
machine axes. Mirroring axis is the machine axis about Quadrant III X- Y-
which all programmed motions will 'flip' over. Figure 41-4 Quadrant IV X+ Y-
shows the mirror axes and their effect on part orientation in
quadrants. The mirror axis can be defined in two ways:
Mirroring the programmed tool path, the control system
At the machine ... by the CNC operator will temporarily change one or both signs, depending on
the mirroring axis. For example, if the tool motion is pro-
Through the program ... by the CNC programmer grammed in Quadrant I (X+Y+), and is mirrored about the
The typical person who is responsible for the ‘flip ’ is also
X axis, it will assume Quadrant IV (X+Y-).
the signs of
Only the X axis is the mirroring axis in this case. In another
listed. Either method allows one selection of the following
example, also based on the original program in Quadrant I,
possibilities:
the mirroring axis is the Y axis. In this case, the temporary
1 . Normal machining - no mirror image set signs will be those of QuadrantII (X-Y+). If mirroring the
2. Mirrored machining about the X axis program defined in Quadrant I along both axes, the pro-
3. Mirrored machining about the Y axis
gram will be executed in Quadrant III (X-Y-).
4. Mirrored machining about the X and Y axes
MIRROR IMAGE 395
Milling Direction
MIRROR IMAGE BY SETTING
Peripheral milling can be programmed in either conven-
tional milling or climb milling mode. When looking at the A mirror image can be set at the control unit. No special
original tool motion defined in climb milling mode within codes are required. Program is relatively short, since it con-
Quadrant I the mirrored machining in the remaining quad-
, tains tool motion for one quadrant only. Not every program
rants will be as follows: can be mirrored without a good plan first - it must be struc-
tured with mirror image in mind.
Mirrored in Quadrant II ... Conventional mode
O
poo
C\i 't CO
Figure 41-6
1.50
01/8 DRILL
0.25 DEEP 0.50 -
12 HOLES - -
0.125 R1.00 R0.15 (3)
0.50
I
!_
4.00
1
0.125
MATERIAL:
4.00 AL PLATE - 4 x 4 x 1/2
Figure 41-9
Comprehensive example of programmable mirror image. Uses main program 04103 and subprograms 04152 and 04153
398 Chapter 41
Two subprograms are needed - one for drilling the three N7 M98 P4152 (QUADRANT I)
N8 M21 (X-MIRROR ON)
holes in 04152, one for the slot milling in 04153.
N9 M98 P4152 (QUADRANT II)
N10 M22 (Y-MIRROR ON)
04152 (SUBPROGRAM - DRILLING) Nil M98 P4152 (QUADRANT III)
N1 X0.125 Y0.125 (MIDDLE HOLE) N12 M23 (MIRROR OFF)
N2 XI. (HOLE IN X)
N13 M22 (MIRROR ON)
N3 X0.125 Y1.5 (HOLE IN Y)
N14 M98 P4152 (QUADRANT IV)
N4 XO YO LO (NO HOLE AT PLATE CENTER)
N15 G80 MO 9 (CYCLE CANCEL)
N5 M99 (SUBPROGRAM 04152 END) N16 M23 (MIRROR OFF)
N17 G52 XO YO
N18 G28 ZO.l MO
Subprogram 04152 contains only the three hole loca- N19 GOO X4.0 Y6.0 (CLEAR ATC LOCATION)
tions in Quadrant I. The cycle call is not included in the N20 M01 (OPTIONAL STOP)
subprogram and the return to the center of the plate (N4) is
still in a cycle mode but with the LO modifier. (T02 - 1/4 DIA CENTER CUTTING END MILL)
N21 T02 MO 6 (TOOL TO 2 TO SPINDLE)
04153 (SUBPROGRAM - MILLING) N22 G52 X2.0 Y2.0 M23 (MIRROR OFF)
N1 GOO XI. 5 Y1.5 (CENTER OF SLOT) N23 G90 G54 GOO XO YO S2500 MO 3 T01
N2 G01 Z-0.25 F3.0 N24 G43 ZO.l HO 2 MO
N3 G03 X0.5 Y0.5 10 J-1.0 F5.0 N25 M98 P4153 (QUADRANT I)
N4 G01 XI. N26 M21 (X-MIRROR ON)
N5 G41 D01 XI. 365 Y0.485 (SLOT START) N27 M98 P4153 (QUADRANT II)
N6 GO 3 XI. 5 YO 35 10.135 JO .
N28 M22 (Y-MIRROR ON)
N7 XI. 65 YO 5 10 JO. 15
.
N29 M98 P4153 (QUADRANT III)
N8 XI. 5 YO 65 1-0.15 JO
.
N30 M23 (MIRROR OFF)
N9 G01 XO .7254 N31 M22 (Y-MIRROR ON)
N10 G02 XO 6754 Y0.7 10 JO. 05
.
N32 M98 P4153 (QUADRANT TV)
Nil XO 677 YO 7125 10.05 JO
. .
N33 M23 (MIRROR OFF)
N12 XI. 5 Y1.35 10.823 J-0.2125 N34 G52 XO YO MO
N13 G03 XI. 65 Y1.5 10 JO. 15 N35 G28 ZO.l MO
N14 XI. 5 Y1.65 1-0.15 JO N36 GOO X4.0 Y6.0 (CLEAR ATC LOCATION)
N15 XO 35 YO 5 10 J-1.15
. .
N37 M30 (PROGRAM END)
N16 XO 5 YO 35 10.15 JO
. .
%
N17 G01 XI.
N18 GO 3 XI. 635 Y0.485 10 JO. 135 Note how the G52 is used. In order to use the mirror im-
N19 G01 G40 XI. 5 YO 5 (SLOT END)
. age correctly, the program zero must be defined on the mir-
N20 GOO ZO.l ror line (mirror axis). Since two lines (axes) are required for
N21 XO YO (MOTION TO PLATE CENTER) this project, the plate center plate must be the program zero.
N22 M99 (SUBPROGRAM 04153 END) There is no need to return to the X and Y machine zero, ei-
% ther at the end of the tool or at the end of the program. Lo-
cation in a clear area for the tool change is all that is needed.
Quadrant I is also used in subprogram 04153 for one
slot. The machining starts with the cutter at the slot center-
line, roughing the radius and the walls. Then, cutler radius MIRROR IMAGE ON CNC LATHES
offset is used and slot is finished to size. The subprogram
ends at the plate center in N21, the same as in drilling. The Mirror Image function has its main application on a CNC
program 04103 uses the two subprograms. If more tools machining center. On lathes, this application is limited to a
are used, the programming technique will not change.
lathe with two turrets, one on each side of the spindle center
line. The actual mirroring will use the X axis (the spindle
04103 (MAIN PROGRAM) center line) as the mirror axis and, in effect, allows the same
(USES SUBPROGRAMS 04152 AND 04153)
programming method for both turrets.
(XO YO LOWER LEFT CORNER - ZO WORK TOP)
(M21 = X-MIRROR ON )
Machining with mirror image can be used alone or c< n-
(M22 = Y-MIRROR ON )
bined with other time saving features, such as Coordin. te
(M23 = MIRROR OFF )
Center of Rotation
399
400 Chapter 42
/
/
cw = -
PROGRAM ZERO
X'
\
CENTER OF ROTATION i
(ROTATED) v
b 1
V 15°
Figure 42-2 'P
Direction of coordinate rotation, based on the center of rotation:
CENTER OF
ROTATION = X-1.0 Y-1.0
\ PROGRAM ZERO
( Counterclockwise direction has a positive angle R (ORIGINAL)
a )
P V
PROGRAM ZERO
15°
(UNCHANGED)
Figure 42-5
Figure 42-3
The following program 04201 illustrates the above ex-
Part oriented as per engineering drawing specification
ample Figure 42-5, which does include the program
(a) in
zero rotation. If the program zero is not to be rotated, in-
The actual tool path, including the approach towards the
part and the departure from the part, is not normally in-
clude only the part profile tool path between the G68 and
cluded in the engineering drawing. Be careful here - if the G69 commands, and exclude the tool approach or depar-
ture motions. Also note the G69 in block N2 - the cancella-
approach and/or departure motions are included in the rota-
tion is included there for added safety.
tion, the program zero may also be rotated. In the Figure
42-4. the orientation of the part is 15° counterclockwise,
04201
based on the lower left corner.
N1 G20
N2 G69 (ROTATION CANCELED IF NEEDED)
R1.5
N3 G17 G80 G40
N4 G90 G54 GOO X-1.0 Y-1.0 S800 M03
N5 G43 Z0.1 HOI M08
N6 G01 Z-0.375 F10 .
Common Applications
As mentioned already, the majority of CNC machines do Coordinate rotation applied to fit a long part within the work area
not have the coordinate rotation function available at all or
they may have it available as an optional feature. This func-
Table size is typically larger than the actual work area, to
tion can be very useful in two particular areas of machining
allow for setup and additional space. Work area is used for
applications.
programming and often the setup as well, and is always de-
If the nature of the work includes orthogonal parts fined by the limits of tool motions. Work area must be able
machined at an angle (as per drawing requirement). to accommodate all programmed tool motions and clear-
The earlier example belongs to this category. ances, including the ones with cutter radius offset in effect.
The angle of the setup must be known deceptively simple but involves quite a bit of programming.
In the Figure 42-6 a part cannot fit within the work area
,
The requirements and conditions for the program devel-
orthogonally, but it can fit when rotated. opment must be evaluated. The core of the program will
machine all 7 pockets with a 0.250 end mill (center cutting
This method is quite interesting but it is not always possi- type). To make the program more realistic, rather than
ble to be implemented. A hundred inch long part cannot be plunging depth of .235, we select .050 as the
to the full
placed within the work area length of only 20 inches. How- maximum depth of cut. The program will also leave some
ever, there are cases when this programming technique can stock for finishing of the pocket walls (.0075 per side). In
be very useful, even if it is not too common. The illustration addition, all sharp edges must be broken with a minimum
only shows the general principles of the application. If the chamfer. In all, only three tools will be used:
positioning angle is not known, use an indicator at two lo-
cations of the mounted part and calculate it trigonometri-
0 3.0 FACE MILL
cally. In some cases, a special fixture may be required for
0 1/4 CENTER CUTTING END MILL
0 3/8 CHAMFERING TOOL
such a setup.
Thisis definitely a very advanced programming applica-
Do not confuse the term work area with the term table size tion.Not understanding the program at first is expected.
With growing experience, it will be easier to interpret the
program. Hopefully, the enclosed notes will help.
02.0
o
MATERIAL: AL PLATE 4 x 3 x 1/2
Figure 42-7
(T01 3.0 DIA FACE MILL - SKIM CUT TO CLEAN TOP FACE)
(T02 1/4 DIA CENTER CUTTING END MILL - MAX DEPTH OF CUT 0.05)
(T03 3/8 DIA CHAMFERING TOOL - 90 DEGREES - MINIMUM CHAMFER)
(T02 / D51 - OFFSET FOR ROUGHING POCKET WALLS 0.140 SUGGESTED - 0.0075 PER SIDE)
(T02 / D52 - OFFSET FOR FINISHING POCKET WALLS ... 0.125 SUGGESTED)
(T03 / D53 - OFFSET FOR CHAMFERING 0.110 SUGGESTED - TO BE ADJUSTED)
(INCREMENT OF ROTATION 360/7 = 51.429 DEGREES)
(T01 - 3.0 DIA FACE MILL - SKIM CUT TO CLEAN TOP FACE)
N1 G20 (ENGLISH UNITS)
N2 G69 (CANCEL COORDINATE ROTATION IF ACTIVE)
N3 G17 G40 G80 T01 (SEARCH FOR T01 IF NOT READY)
N4 M0 6 (T01 TO THE SPINDLE)
N5 G90 G54 GOO X-1.375 Y-3.25 S3500 M03 T02 (XY START POSITION FOR FACE MILLING)
N6 G43 Z1.0 H01 M08 (Z CLEARANCE FOR SETUP - COOLANT ON)
N7 G01 Z0 F30.0 (TOP OF FINISHED PART FOR FACE MILLING)
N8 Y3.125 F15.0 (FACE MILL LEFT SIDE)
N9 GOO XI. 375 (MOVE TO THE RIGHT SIDE)
N10 G01 Y-3.25 (FACE MILL RIGHT SIDE)
Nil GOO Z1.0 M0 (Z AXIS RETRACT - COOLANT OFF)
N12 G28 Z1.0 M0 (Z AXIS HOME FOR TOOL CHANGE)
N13 M01 (OPTIONAL STOP)
(T02 - 1/4 DIA CENTER CUTTING END MILL - MAX DEPTH OF CUT 0.05)
N14 T02 (SEARCH FOR TO 2 IF NOT READY)
N15 M0 6 (T02 TO THE SPINDLE)
N16 G69 (CANCEL COORDINATE ROTATION IF ACTIVE)
N17 G90 G54 GOO XI. 0 Y0 S2000 M03 T03 (XY START POSITION FOR THE CENTER OF POCKET 1 )
Normally, a programmed tool motion for a CNC machin- Scaling Function Usage
ing center represents the dimensions of the drawing, per-
haps with cutter radius offset in effect. Occasionally, there
In industry, there are many applications for scaling the
may be times when the machining tool path that has al- existing tool path. The result is many hours of extra work
ready been programmed once must be repeated, but ma-
saved. Here are some of the typical possibilities when a
scaling function can be beneficial:
chined as smaller or larger than the original, yet still keep it
proportional at the same time. To achieve this goal, a con- Similar parts in terms of their geometry
trol feature called the Scaling Function is used. Note the
following two important items: Machining with built-in shrinkage factor
Mold work
Scaling function is an option on many controls
and may not be available on every machine English to metric and metric to English conversion
Some system parameters may be used for Changing size of engraved characters
this function as well
Regardless of application, scaling is used to make a new
For even greater flexibility in programming, the scaling tool path larger or smaller than the original one. Scaling is
function can be used together with other programming therefore used for magnification (increasing size) or reduc-
functions, namely with Datum Shift Mirror Image and Co- ,
tion (decreasing size) of an existing tool path - Figure 43- J
ordinate System Rotation subjects described in the last
three chapters.
DESCRIPTION
Tool length offset amount ... G43-G44/H Scaling factor ... Reduction or Magnification
X and Y shift amounts in G76 and G87 cycles G50 Scaling mode cancel Scaling OFF
Peck drill depth Q in G83 and G73 cycles G51 Scaling mode active Scaling ON
Stored relief amount for G83 and G73 cycles
405
406 Chapter 43
Scaling function uses the following program format: The scaled part will always expand away from and reduce
towards the scaling point equally along the axes, as illus-
G51 I.. 1. K.. P. trated in Figure 43-2.
Scaling Center
Fanuc 15M uses I/J/K to specify the center point of scal- Figure 43-3
ing inX/Y/Z axes respectively. These values are always Effect of scaling point on the scaled part
programmed as absolute values. As the center point con-
trols the location of the scaled tool path, it is important to Points A1 to A8 and points B1 to B8 in the illustration
know one major principle: represent contour change points of the tool path.
Scaling Factor
Scaling from millimeters to inches is much different. The Program 04301 is a basic contouring program, using a
scaling factor for millimeters to inches (within a nine place single cutting tool and only one cut around the part periph-
accuracy) 0.039370079. However, scaling factor may
is ery. It is programmed normally, without any scaling.
only be programmed with a three or five decimal place ac-
curacy. That means rounding the scaling factor will result 04301 (BASIC PROGRAM USING G54 - NOT SCALED)
in an inaccurate conversion. In many cases, the rounded re-
N1 G20
sult will be quite acceptable, but it is very important to con-
N2 G17 G40 G80
N3 G90 GOO G54 X-1.25 Y-1.25 S800 M03
sider the possibility of an error, in case it does matter.
N4 G43 Z1.0 HOI M08
Compare the error amount with different rounded scaling N5 G01 Z-0.7 F50.0
N6 G41 X-0.75 D01 F25.0
factors for 1 2.7 mm, which equals exactly to 0.500 inch: N7 Y1.75 F15.0
N8 XI
© Using 0.001 minimum scaling factor:
.
04302
(PROGRAM 04301 SCALED DY 1.05 FACTOR)
N1 G20
N2 G17 G40 G80
N3 G50 (SCALING OFF)
N4 G90 GOO G54 X-1.25 Y-1.25 S800 M03
N5 G43 Z1.0 HOI M08
N6 G51 10 JO KO PI. 050 (FROM XOYOZO)
N7 G01 Z-0.7 F50.0
N8 G41 X-0.75 D01 F25.0
N9 Y1.75 F15.0
N10 XI.
Nil G02 X2.5 YO .75 10 J-1.0
N12 G01 Y-0.75
N13 X-1.25
N14 G40 Y-1.25 M09
N15 G50 (SCALING OFF)
N16 GOO Z1.0 Figure 43-5
N17 G28 Z1.0 Original contour in full scale
N18 G28 X-1.25 Y-1.25
N19 M30
%
Any CNC
machine can be equipped with additional ac- CHUCK CLOSED ~o _ CHUCK CLOSED _ XJ
Q) TJ XI
cessories, to make it more functional or functional in a par- switch set to c ^ V <D
W C
switch set to
ticular way. In fact, most CNC machines have at least some Q) Q)
IN Q- .2
o u
OUT 2o o
CL
additional accessories, either as a standard equipment or as
SC
an option. Machining centers have indexing and rotary ta- o o o o
3 3 3 3
bles, pallets, right angle heads, etc. All these are complex
o o
1
Tailstock quill
EXTERNAL CHUCKING INTERNAL CHUCKING
Figure 44-
Bi-directional turret indexing
Part chucking - external and internal applications.
Barfeeder Note the setting of the CHUCK CLOSED switch
Several other features may also be available as program-
In some applications, such as barfeeding, it is necessary
mable options:
toopen and close the chuck under program control. Two M
Parts catcher (unloader) functions that control the chuck or collet opening and clos-
ing arc normally available.
Pull-out finger
CHUCK CONTROL
O Example
In manual operations, a chuck, a collet or a special fixture Typical programming procedure would include spindle
mounted on the headstock of a normally opens and
lathe stop and dwell:
closes when the CNC operator presses a foot pedal. For
safety reasons, a chuck that is rotating cannot be opened, MO 5 (STOP SPINDLE)
because it is protected by an special safety interlock. An- M10 (OPEN CHUCK)
other important feature of chucks is that the terms open and G04 U0.1 (DWELL 1 SECOND)
close depend on the method of chucking - external or inter- Mil (CLOSE CHUCK)
nal. A key switch is available to select the type of chucking. MO 3 (RESTART SPINDLE)
Figure 44-1 shows the difference.
This is a very simplified sequence, in which the dwell is
Note that the terms opened and closed are relative to the the time required for the bar (for example) to go through to
setting of a toggle switch or a key switch, found on the ma- the stop position. Some barfeeders do not require the spin-
chine itself, usually marked CHUCK CLOSED - that has dle to be stopped to feed the bar through and others have a
two settings - IN and OUT. special programming routine of their own.
409
410 Chapter 44
M
10 and M
functions can also be used on the machine,
1 1 The jaws may be hard (usually serrated for better grip) or
during setup, using the MDI setting mode in manual mode. soft (normallybored by the CNC operator to suit the work
Later in this chapter, 10 and M M
functions will be used
1 1 diameter. Only soft jaws can be modified.
for applications associated with barfeeding.
There is not much that can be done with hard jaws, except
Chucking Pressure purchasing a suitable type for external or internal grip. Soft
jaws are designed to be bored and the ability to do that is
The amount of force required to clamp a part in the chuck one of the basic skills a CNC operator must have. There are
is called the chucking pressure. On most CNC lathes the various techniques to bore soft jaws, all beyond the scope
pressure is controlled by an adjustable valve, usually in the of this handbook. What is important is the understanding of
tailstock area.Once the chuck pressure has been set. it is what happens if the jaws are not bored correctly.
not changed very often. However, there are jobs that re-
quire the chucking pressure to be increased (tighter grip) or
decreased (looser grip) frequently, usually within the same
operation. Such special jobs will benefit from a program-
mable chuck pressure control.
Typically, the part has to be reclamped in the chuck be- Soft jaws diameter bored correctly (left) and incorrectly
fore either function can replace the other, which may dis-
turb its position in the holding device. If the chucking pres- Figure 44-3 shows three versions - one correctly bored
sure feature is present on the lathe, read the documentation jaws and two incorrectly bored jaws. In both incorrect ver-
supplied by the lathe manufacturer. sions, the grip, the concentricity, or both, may suffer.
a Quill
Center
Tailstock Body
Quill is the shiny cylinder that moves in and out of the Tailstock body is normally not programmable (only the
tailstock body. It has a fixed range of travel, for example, a quill is), but this feature is available for many CNC lathes
3 inch travel may be found on medium size lathes. When as a factory installed option. That means it has to be or-
the tailstock body is mounted to the lathe bed in a fixed po- dered it when making the initial purchase; the dealer cannot
sition, the quill is moved out to support the part, or in, to al- adapt the option to the machine at a later date. Many differ-
low a part change. The part itself is supported by a center, ent types of programmable tailstocks arc available, for ex-
mounted in the quill. ample, a slide-type that moves left and right only, or a
swing out type, that is out of the way when not needed.
Center
A typical tailstock defined as programmable can be pro-
Center a device that is placed into the quill with a ta-
is grammed using two non-standard M functions (check
pered end, held by a matching internal taper and is physi- these functions). For the example, a CNC lathe will use
cally in contact with the part. Depending on the design, if these two M functions:
the tailstock has an internal bearing, a dead center can be
used. If the tailstock has no internal bearing, a live center
M21 Body of tailstock forward
must be used instead. Machined part has to be pre-centered
(on the CNC lathe or before), using the same angle of the M22 Body of tailstock backward
tool as the tailstock center (normally 60°). A typical tail-
stock is illustrated in Figure 44-4.
On some CNC lathes, there may also be two additional M
functions available, one of them for clamping the tailstock.
the other for unclamping it. In many cases, the two tailstock
functions have the clamp/unclamp functions built-in.
If the quill is supporting the part, it is in, using the M12 important as for other operations. The tool mo-
at least as
function. If the quill is not supporting the part, it is out. us- tion towards the part at the tool path beginning and its re-
M12 M13 turn to the tool change position is critical. The safest is an
ing the M13 function. For the setup, the and
functions may be used, and on many lathes, a toggle switch approach from the tool change position towards the part
on the control is provided to operate the quill. along the Z axis first, then the X motion. On return from a
clear position close to the work, reverse the order - first re-
Spindle should be ON when the quill fully supports the part tract the X axis above the part, then move the Z axis (both
axes usually move to a safe tool change position).
412 Chapter 44
Programming Example
BI-DIRECTIONAL TURRET INDEXING
This example is a complete program incorporating the bi-
Another efficiency feature is a bi-directional turret index- -directional indexing and also shows hoe to use a fully pro-
ing. Many CNC lathes have a so called bi-directional in- grammable tailstock. All tool motions are realistic but not
dexing built-in, that means an automatic method of the tur- important for the example. The order of numbering the
ret indexing (the control decides the direction). However, tools on the turret may not be consistent from one machine
there is having a programmable index-
a certain benefit in to another! The terms forward and backward are related to
ing direction. If that feature is available on the CNC lathe, such order. M functions described earlier are used here:
there will be two miscellaneous functions available to
program turret indexing. Both functions are non-standard, 04401
machine tool manual.
(BI-DIRECTIONAL INDEXING AND TAILSTOCK)
so check the
N1 G20 G99 Ml 8 (SET INDEX BACKWARD)
Typical M functions for turret indexing are: N2 G50 S1200
N3 T0100
(LIMIT MAX RPM)
(SHORT FROM T02 TO T01 WITH M18)
N4 G96 S500 M03
Ml 7 Indexing forward: T01 T02 T03 ... N5 GOO G41 X3.85 Z0.2 T0101 M08
N6 G01 ZO F0.03
M18 Indexing backward: ... T03-T02-T01 N7 X-0.07 F0.007
N8 GOO Z0.2
N9 G40 X10.0 Z5.0 T0100
Figure 44-5 shows an example of MI7 and M18 func- N10 M01
tions for an 8-sided turret.
Nil T0800 (SHORT FROM T01 TO T08 WITH M18)
N12 G97 S850 M03
N13 GOO XO ZO .25 T0808 M08
N14 G01 Z-0.35 F0.005
N15 G04 U0.3
N16 GOO ZO 25.
automatic turret indexing direction. It makes sense, that a N33 T0200 (SHORT FROM T01 TO T02 WITH M17)
bi-directional turret indexing should be used for efficiency. N34 G96 S600 M03
After all, T01 and T08 may be far apart in numbers but they N35 GOO G42 X3 325 ZO.l T0202 M08
.
are next to each other on a polygonal turret with eight sta- N36 G01 X3.625 Z-0.05 F0.004
tions. The control system will always choose the shortest N37 Z-2.5 F0.006
from TO to T08 in backward direc-
N38 U0.2 F0.015
method, in this case, I
This example first uses T01 to face stock to the spindle Bars of material are stored in a special tube that guides
center line. Then T08 comes in, the center drill, and makes the bar (by pushing it or pulling it)from the tube to the area
a center hole. When the center drill moves in a clear posi- where machining takes place. The only limitations are the
tion, tailstock body moves forward and locks, then the quill bar length and the bar diameter. They are specified by the
moves into the work. T01 comes back to rough out the barfeeder manufacturer and the spindle bore diameter of
chamfer and diameter, after which T02 comes to finish the the CNC lathe.
chamfer and diameter. When the finishing is completed,
moves out, then the tailstock body
spindle stops, quill
Many ingenious designs of barfeeders do exist nowadays
moves backward. The operator sets the tailstock position. and the programming method is heavily influenced by the
All this leads to one question - how do we find out if the Although the bar movement from the guide tube is con-
available CNC lathe has a built-in automatic indexing di- trolledby the chuck open and chuck close functions (M 10
rection (shortest direction) or a programmable direction? and Mil), the target position for the bar still has to be pro-
There is a good chance that on CNC lathes where only the vided, in terms of how far it has to move out of the guide
forward direction takes place (automatic indexing is not tube. This position should be lower than the bar diameter
available), there is a feature called the programmable direc- and on the positive side of the Z axis (.025 shown). This is
tion, available in the form of M17 and M
8 miscellaneous -1 the amount to be faced off (Z0 at the front face assumed).
or similar - functions. Figure 44-6 shows the example.
IS
possible. This may not be a typical situation - it will take a
few seconds extra time, but it can happen quite often. Figure 44-6
04402 age, this attachment will safely intercept the part and move
N1 G20 T0100 MO (T01 IS BAR STOPPER) it into a receiving box. The receiving box is often in the area
N2 GOO X0.125 Z0.025 T0101 (STOP POSITION) of CNC lathe where the operator can reach without danger,
N3 M10 (CHUCK OPEN)
and without having coolant in the way. There are two non-
N4 G04 U1.0 (1 SEC. DWELL)
standard miscellaneous functions for a parts catcher:
N5 M71 (BARFEEDER ON)
N6 G04 U2.0 (2 SEC. DWELL)
N7 Mil (CHUCK CLOSE) M73 Part catcher advance ... in or forward
N8 G04 U1.0 (1 SEC. DWELL)
N9 M72 (BARFEEDER OFF) M74 Part catcher retract ... out or backward
N10 GOO X10.0 Z5.0 T0100 (CLEAR POSITION)
Nil M01 (OPTIONAL STOP)
The following program example illustrates how each
A few important notes relating to a bar stopper may be function is programmed for a part-off tool.
ADDITIONAL OPTIONS ing off a 02.0 stock diameter to 2.5 length, a standard pro-
cess. In the program, there is a special programming tech-
nique used, relating to continuous operation. Concentrate
There arc many other options (non-standard features) on
a CNC lathe that will qualify as programmable accessories.
on the last three blocks. N90, N91 and N92.
Some maybe be rather unusual, such as a programmable
chip conveyer, or programmable tailstock pressure, others
Continuous Operation
may not be that rare, for example, a program mable/o//o»ve/' Block N90 is an optional stop, typically used for setup
rest (a moving version of a steady rest), used for ahead-of-
and random checking. Block N91 contains M30 - the end
tool support for long parts. Steady-rest and a follower-rest
of program function. Note the slash symbol in front of the
help prevent chatter or deflection on a relatively long part block. This is a block skip function, described earlier in
or a part with thin walls. Chapter 23. When the block skip switch on the control
panel is set to the ON position, the control system will not
Another two other accessories that are also often related
in block N91. That means the pro-
process the instructions
to each other - and to barfeeding as well - are:
gram end there and the processing will continue to
will not
Part Catcher also known as Part Unloader the block N92, where M99 is programmed.
Pull-Out Finger Although the M99 function is mainly defined as the end
of subprogram, it can also be used in the main program (as
Both are commonly used together with barfeeding opera-
in this example). In that case, it causes a continuous pro-
tions and use two miscellaneous functions.
cessing loop. The M99 function will make the program to
return to the top, and - without interruption - repeat the pro-
Part Catcher or Part Unloader
cessing again. Since the first tool will normally have a bar
A very common accessory for a continuous machining, stopper programmed, the barfeeder moves the slock out of
using a barfeeder, is part catcher or part unloader, as it is the lube and the whole program repeats indefinitely - well,
sometimes called. Its purpose is to catch the completed part until the block skip switch on the control panel is set to the
after it had been parted-off. Instead of letting the completed OFF position. Then the M30 takes over and M99 in the
part fall into the machine area and possibly causing dam- subsequent block will not be processed.
CNC LATHE ACCESSORIES 415
Regardless of the exact pull-out finger model available, them already discussed, mostly in this chapter:
the programming procedure is just about the same - no bar
04405
projects from the spindle longer than its face after part-off:
(N1 TO N18 FOR NEW BAR ONLY - 1.5 CUT-OFF)
01 . At a safe start position, index to the tool station where N1 Ml 8 (INDEX T03 TO T01)
the pull-out finger is mounted. Spindle must be stopped N2 G20 T0100 M05 (T01 - BAR STOPPER)
at this time with MU5! N3 GOO X0.1 Z1.5 T0101 (NEW BAR OUT 1.5)
N4 M10 (CHUCK OPEN)
02. At a rapid rate, move to the spindle centerline (XO), N5 G04 U1.0 (1 SEC. DWELL)
and a Z axis position about half-way of the overall N6 M71 (BARFEEDER ON)
bar projection. N7 G04 U1.0 (1 SEC. DWELL)
03. In 'feed-per-time' mode, feed-in towards the bar as
N8 Mil (CHUCK CLOSE)
N9 X5.0 Z2.0 T0100 (CLEAR POSITION)
projected after part-off.
N10 M01 (OPTIONAL STOP)
04. Dwell for about 0.5 second for the finger to catch
the bar stock. Nil M17 (INDEX T01 TO TO 3)
N12 T0300 (T03 - 0 .125 WIDE PART -OFF TOOL)
05. Open the chuck with Ml 0. N13 G97 S1400 MO (CUTTING RPM)
06. Pull out the bar stock from the guide tube.
N14 GOO XI. 25 Z0 T0303 M0 8 (START POSITION)
N15 G01 X-0.02 F0.004 (PART-OFF BAR END)
07. Dwell for about 0.5 second for the finger to complete N16 GOO XI. 25 MO (MOVE ABOVE BAR)
the pull-out. N17 X5.0 Z2.0 T0300 (CLEAR POSITION)
N18 M01 (OPTIONAL STOP)
08. Close the chuck with Mil.
09. Dwell for about 1 second to complete chuck closing. N19 Ml (INDEX T03 TO T01)
N20 T0100 M0 (T01 - BAR STOPPER)
1 0. Move the pull-out finger away from the bar stock. N21 GOO X0.1 Z0.05 T0101 (0.05 STOCK ON FACE)
N22 M10 (CHUCK OPEN)
1 1 Return the pull-out finger to the safe start position.
.
N26 Mil (CHUCK CLOSE) N43 GOO XI. 25 Z-1.125 T0303 M08 (START POS.)
N27 X5.0 Z2.0 T0100 (CLEAR POSITION) N44 G01 X-0.02 F0.004 (PART-OFF TO LENGTH)
N28 MOl (OPTIONAL STOP) N45 GOO XI. 25 (MOVE ABOVE BAR)
N29 M17 (INDEX T01 TO T02) N46 X5.0 Z2.0 T0300 (CLEAR POSITION)
N30 T0200 (T02 - FACE -CHAMFER -TURN OD) N47 MOl (OPTIONAL STOP)
N31 G96 S400 MO (CUTTING SPEED) N48 M89 (INCREASE PART COUNTER BY 1)
N32 GOO G41 XI. 25 ZO T0202 M08 (START FACE) / N49 M30 (CONTROLLED END OF PROGRAM)
N33 G01 X-0.07 F0.007 (FACE-OFF FRONT) N50 M99 P19 (RESTART FROM BLOCK N19)
N34 GOO Z0.1 (CLEAR Z+) %
N35 G42 X0.67 (CHAMFER START)
N36 G01 X0.92 Z-0.025 F0.003 (CUT CHAMFER) As it usually goes with accessories and options, the ma-
N37 Z-1.26 F0.01 (CUT DIAMETER) chine tool manufacturers use a number of M
functions to
N38 U0.2 F0.02 (CLEAR ABOVE BAR) activate and deactivate a particular accessory. It is not pos-
N39 GOO G40 X5.0 Z2.0 T0200 (CLEAR POSITION) cover any specific procedures into a general refer-
sible to
N40 MOl (OPTIONAL STOP)
ence material. Hopefully, the ideas presented in this chapter
will help to adapt any manufacturer’s recommendations
N41 T0300 (T03 - 0.125 WIDE PART-OFF TOOL)
N42 G97 S1400 M03 (CUTTING RPM) and understand them better.
45 HELICAL MILLING
This type of operation is only available for CNC machin- axis. In the active plane G18 (ZX), the third dimension is
ing centers as an optional feature. Let’s look at the subject the Y axis and in the active plane G19 (YZ), the third di-
of helical milling a little closer. mension is the X axis.
For example, in the G 1 7 XY plane (the plane that is most Programming Format
common), a typical format of the circular interpolation will
be in two forms: The general formats for helical interpolation in a pro-
gram are similar to the formats available for a circular inter-
O Using arc centers UK for CW and CCW motion :
polation - plane selection is very important:
.
F..
F. .
© Using arc centers UK for CW and CCW motion :
G02 X. . Y. . R. . F. .
GO 3 X. . Y. . R. . F.
417
418 Chapter 45
Arc Modifiers for Helical Interpolation T hread milling can be used in programming to achieve
special benefits. These benefits are quite numerous:
The arc modifier functions are programmed using the
same principles as in circular interpolation but will be dif- A large thread diameter - virtually any diameter
ferent for each plane. Here is a summary in a table: can be thread milled (with high concentricity)
Tapping is impractical
Note that the arc vectors apply to the two axes that form
the circular motion - the linear motion has no influence Tapping is difficult and causes problems
whatsoever. If the control system supports the direct radius
Tapping is impossible in hard materials
entry R (instead of the traditional IJK vectors), the physical
center of the arc motion is calculated automatically, within Blind hole tapping causes problems
the current plane.
Part cannot be rotated on a CNC lathe
frequently (without the use of a cycle), but the majority of cutters. In both cases, there is one common feature for both
threads are machined by the single point threading method, types of cutters - the pitch of thread is built into the cutter.
using the block method of G32, the simple cycle G92 and
the multiple repetitive cycle G76. Conditions for Thread Milling
Applying Thread Milling For successful thread milling, three conditions must exist
before writing a program:
There are many cases in manufacturing, where either the
tapping or the single point threading method is impractical, Control system must support the operation
difficult, or impossible
in Many of these
a given situation.
Diameter to be threaded must be premachined
can often be overcome by choosing the thread
difficulties
milling method instead. Thread milling is probably the Suitable thread milling tool must be selected
most common industrial application of helical interpola-
All three conditions must exist simultaneously.
tion feature of the control.
HELICAL MILLING 419
The thread milling cutters are available in at least two va- Clearance radius protects the thread from damage by the
rieties - some arc made of a solid carbide, some use carbide cutting tool. Each cutting edge on the threading tool (hob)
interchangeable inserts. In either design, the threading tool or indexable insert is ground with a decreasing angle in the
pitch must match the pitch of a thread required by the draw- direction of the cut - this is called the clearance angle. This
ing. The tool has to be small enough to fit into the available clearance angle guarantees smooth cutting conditions dur-
internal space and large enough to guarantee suitable rigid- ing thread milling.
ity while cutting externally. For internal thread milling, cut-
ters are available for thread milling in holes as small as .250 Productivity of Thread Milling
inch (6.35 mm).
One of the reasons programmers choose the thread mill-
Unlike a lap, thread milling tools do not have the helix ing operation could be the desire to improve machining
angle built in, only the pitch. The helix angle is required for productivity. There are many sizes of thread cutting tools
threading and is controlled during helical interpolation mo- available, with just about all pitch variations. In order to
tion by the linear movement. Typical thread milling tools achieve the highest level of efficiency in thread milling, use
are illustrated in Figure 45-1. a threading tool that is large enough to cut the required
thread in a single revolution (in a 360° sweep). At the same
time, the tool must have all necessary clearances.
THE HELIX
The main word that is used in this context is the word he-
lix.The word helix is based on the original Greek word for
spiral. A dictionary definition gives us some clue as to its
Typical thread milling cutters.
meaning - it suggests that a helix is anything in the shape of
Solid carbide (left), single insert (middle) and a double insert (right) “
the thread of a screw. Helix is defined in the Machinery's
Handbook” by Industrial Press, Inc., New York, NY, USA.
Premachining Requirements this way:
A hole for a tap cannot have the same diameter as the tap "A helix is a curve generated by a point moving about a
has to be smaller to accommodate the depth of the
itself. It cylindrical surface (real or imaginary ’) at a constant rate in
thread. The same rule applies to helical milling: the direction of the cylinder's axis."
If the thread is milled on the inside diameter This quite detailed definition means that the helix is a
of the part (internally), the premachined diameter curve created by a circular motion of a point on a cylinder
must be smaller that the nominal thread size
or a cone, combined with a simultaneous linear advance. A
If the thread is milled on the outside diameter curvature of a common screw thread is a typical example of
of the part (externally), the premachined diameter a straight helix.
must be equal to the nominal thread size
A cutting tool motion based on the mathematical defini-
Either diameter (internal or external) may be slightly tion (using three axes), results in a helical motion, also
larger or slightly smaller than the ‘normal’ size, but this de- known as helical interpolation.
viation is decided by the required ‘fit’ of the thread.
420 Chapter 45
Figure 45-2
A typical helix shown in four standard views - two revolutions are shown between the top and the bottom of the helix
The front view (XZ) shows the helix from the front.
The side view (YZ) shows the helix from the standard
right side view.
THREAD MILLING EXAMPLE Item 4 is the threading cutter size. Two main characteris-
Item 5 deals with the tool number and its related offset
numbers. In this case, the tool number is 3, programmed as
T03. The tool length offset number is H03 and the cutter ra-
dius offset number is D03. The D03 offset setting will con-
tain the radius of threading cutter, in this case, the nominal
value will be .6250. The offset numbers are arbitrary num-
bers for this example, others may be different. Just keep in
Item 6.
1 . Internal thread is 3.00 diameter - through the plate 3.0000 - 2 x .0451058 = 2.9097884
2. Plate thickness is 0.75 Therefore, the bored diameter for the thread should be
4. 1 .500 diameter thread hob At this point, another consideration must be made. The
threading cutter itself. Essentially, the threading cutter is a
5. Tool T03 and offsets H03 and D03
forming tool. Its crest and its root will be formed on the fin-
6. Bored diameter is 2.9000 inches ished thread. This feature presents a certain advantage. By
programming the internal diameter a little smaller, the final
This summary sets the stage for programming. size will be formed and result in a smooth surface finish.
Leaving about .003 to .006 stock per side will do the trick.
Initial Calculations For the example, the .003 to .006 range is used and the
calculated 02.9097884 can be rounded to an even 02.9,
In the example are six items to consider. Items 1, 2 and 3
leaving only .0097884 stock on diameter, or .0048942 per
were supplied by the drawing, but items 4, 5 and 6 were se-
programming side, for finishing. No doubt, the difference is reasonable,
lected or calculated as part of the process.
but it did take advantage of a rounding to a ‘nice’ number,
We look at the selected or calculated items individually.
such as 2.9000.
422 Chapter 45
After all required data have been collected and properly In helical interpolation it is extremely important to coor-
calculated, another step can be made, this time to calculate dinate, to synchronize, the following three program items:
the thread starting position.
Spindle rotation
Thai is easy for the X and Y axes - ihe center of the thread Circular cutting direction
diameter is as good start as any - better, in fact. In this ex-
ample, and for simplicity, this XY position is also equiva- Z axis motion direction
lent to the XOYO position.
Why are the three items so important? Why do they have
Starting position of the threading cutter measured along to be coordinated at all? Evaluate them, one by one.
the Z axis is much more important in helical milling than in
Spindle Rotation
any other type of milling. The Z axis start position must al-
ways be synchronized with the pitch of thread, as the cut- Spindle rotation can be either M03 (clockwise) or M04
ting will proceed in three axes simultaneously. The Z axis (counterclockwise).
zero (ZO) will be at the top of part.
Circular Cutting Direction
The start position of the Z axis is determined by several
factors - of the thread mill (in this case a tool with
the size Circular direction follows the rules of circular interpola-
- G02 is the clockwise direction, G03
an indexable of the thread (in this case
insert), the pitch tion is the counter-
.0833333), the direction of the Z axis motion (up or down) clockwise direction.
and the method of the infeed along the XY axes.
Z Axis Motion Direction
When a thread is cut using the helical interpolation fea-
ture, all three axes used must be considered equally. Just For vertical machining, the direction of cutting along Z
like defining the approach arc for circular interpolation, the
axis may be along two directions:
approach arc for a helical interpolation can be defined the Up or positive
same way - the procedure is exactly the same.
Down or negative
Figure 45-5
EXTERNAL thread milling using the climb milling mode - right and left hand threads, spindle rotation and cutter motions shown
HELICAL MILLING 423
Figure 45-6
INTERNAL thread milling using the climb milling mode - right and left hand threads, spindle rotation and cutter motions shown
Each motion item by itself is important, but it is the coor- 04501 (INTERNAL RIGHT HAND THREAD MILLING)
dination of all motions that makes the thread to match engi- N1 G20
N2 G17 G40 G80
neering purposes. These motions together determine the
N3 G90 G54 GOO XO YO S900 M03
hand of thread (left hand vs. right hand), and whether ap-
N4 G43 Z0.1 HOI M08
plied externally or internally. Figures 45-5 and 45-6 show N5 G01 Z-0.95 F50.0
the possibilities for the most common method of threading
- in the climb milling mode.
Similar to a program using circular interpolation, the next
Lead-In Motions step to be done is determination of the linear approach to
the lead-in arc (in climb milling mode). This is also the mo-
example, the thread to be milled is a right hand
In the
tion that applies the cutter radius offset.
thread and an internal thread. The spindle rotation is nor-
mal, using M03. The last figure indicates that the thread has
In helical milling, the cutter radius offset applies
to be milledfrom the bottom upwards, using the counter- only to the two axes of the selected plane.
clockwise (G03) tool motion.
There is one last consideration, the thread milling insert - In the example, the radius offset is entered in block N6:
mainly its height. The insert height determines how many
revolutions are required to cut the thread at full depth. A N6 G01 G41 X0.75 Y-0.75 D01 F10.0
single insert cutter will be used, and by consulting the tool-
The next block is the lead-in arc, with .750 approach ra-
ing catalogue, determined that two revolutions will be suf-
dius. Only the motions along X and Y axes will be needed:
ficient to mill the required thread.
To start the thread milling example, the cutter has to be N7 GO 3 XI. 5 YO R0.75 (or 10 JO. 75)
positioned at XOYO part origin and at a clear Z depth. Since
a multi tooth insert cutter isused and there is space avail- Since only two axes are used, the motion is planar (on a
plane). Figure 45-7 illustration shows the tool motion. Note
able, start will be a little below the bottom of the part, say
that the motion appears to be the same as for a circular in-
.200, at Z-0.95 (the plate thickness is .750, as per drawing).
This extra clearance provides an even entry into the thread. terpolation (circular pocket application). This can be mis-
The program start includes all current considerations: leading - there is also the Z axis involved.
424 Chapter 45
o L c = 90 x .0833333 / 360
> L t = .0208333 (.0208)
R1.50 R0.75 The cutting motion takes place along the positive Z direc-
\\ tion (up), so the target position absolute value will be above
£ the start position, and a corrected block N7 can be written:
/74 /
N7 GO 3 XI. 5 Y0 Z-0.9292 R0.75 (or 10 JO. 75)
4
|
360 First, the absolute method will be selected, then the incre-
mental method:
L = 90 x .0833333 / 360
fc
L t = .0208333
At of the
this point, the cutter is in a position that is clear
thread, so the linear motion can resume and cancel the cut-
ter radius offset, then move back to the center of the bore,
retract the tool above part, move to machine zero and termi-
nate the program:
The complete program that follows, combines the indi- lead-out motions are very important in this situation as
vidual calculations and includes all motions for the thread- well. Their calculations and those for the thread follow the
ing cutter: same rules as for an internal thread. A straight linear lead-in
and lead-out may be used, similar to the ones described in
04501 (INTERNAL RIGHT HAND THREAD MILLING) Chapter 29 {Circular Interpolation). Otherwise, follow the
N1 G20 motions shown in Figure 45-9.
N2 G17 G40 G80
N3 G90 G54 GOO XO YO S900 M03 Tapered Thread Milling
N4 G43 Z0.1 HOI M08
N5 G01 Z-0.95 F50.0 It is possible, but much more difficult, to manually pro-
N6 G41 XO 75 Y-0.75 D01 F10
. .
gram a tapered thread (such as NPT or NPTF) using a
N7 GO 3 XI. 5 YO Z-0.9292 R0.75 thread milling cutter. For threads with a small pitch, soft
N8 Z-0.8459 1-1.5 (TURN 1)
material and very narrow taper angle, a tapered cutter may
N9 Z-0.7626 1-1.5 (TURN 2)
be used and programmed as if it were a straight cutter, in a
N10 XO 75 YO .75 Z-0.7418 R0.75
.
Nil G40 G01 XO YO single revolution. For larger threads, the only method is a
V.
X0Y0
V / in
do
any case. What is needed is
THREAD
START/END To illustrate this topic, the same thread will be used as in
program 04701 Needless . to say, a simulated program may
be extremely long - at least a few hundreds blocks. Here is
Figure 45-9 an example of such a program - it shows only a few blocks
Lead-in and lead-out motions for an external thread milling of the beginning and a few blocks where the tool completes
the lead-in arc. It only relates to the straight line and the part
this case), using very small increments in linear interpola- of the lead-in arc. Practically, the program is incorrect, be-
tion mode only. Holders and inserts should be selected by cause the tool radius is not compensated. The radius com-
the nominal size of the thread. pensation would be done in the software, not with G41 or
G42 in the program - this is a linear interpolation in three
Tapered threads are sometimes called conical threads and may not be used. The complete
axes and cutter radius offset
will require different tool holders for right-hand threads program had been done by using a CAD/CAM software,
and left-hand threads. This is a special application of heli- and was 463 blocks long, comparing to just 14 blocks for
cal interpolation that does not really belong in the manual the complete program using helical interpolation.
programming area.
G20
Further Considerations G17 G40 G80
G90 G54 GOO X0 Y0 S900 M03
Two additional considerations are necessary to cover the G43 zo.:L H01 M0
subject of general thread milling in a reasonable depth. One G01 Z-0..95 F10.0
is the application of the cutter radius offset and the other X0.75 Y- 0.75
one XO .7846 Y-0.7492 Z-0. 9494
is the selection of the cutting feedrate.
X0.8191 Y-0.7468 Z-0. 9488
Cutter radius offset will only be active for the two axes
X0.8536 Y-0.7428 Z-0. 9482
X0.8878 Y-0.7373 Z-0. 9476
selected by the active plane (for example, in G17, it will be
X0.9216 Y-0.7301 Z-0. 9470
the X and Y axes). Always select the climb milling method, X0.9552 Y-0.7214 Z-0. 9464
it is the preferred method for the majority of thread milling X0.9883 Y-0.7112 Z-0. 9457
applications.
trol. This may be a case for many CNC machines, or in guage (such as Visual Basic*. Visual C++® and similar lan-
such cases where the machine shop needs to mill a thread guages), writing similar utility software can be done very
only once in a while and the helical interpolation is not when the utility is executed, the user
efficiently. Typically,
worth the cost of a control update. inputs the number of revolutions, the radius, thread lead
and resolution. The length of the program can be shortened
To mill a thread (external or internal) under these condi- but the threading quality may not be acceptable.
tions, a helical milling simulation will be used. Simulation
HELICAL MILLING 427
Helical ramping is used primarily as a replacement for a Any increment value can be chosen for the depth, de-
plunge cut into solid materials. Recall that a roughing op- pending on cutting conditions. The smaller the increment,
eration in an enclosed area (for example a pocket), requires the more helical passes will be necessary and the longer
the cutting tool to reach a certain Z depth, before the actual cutting time will be required.
material removal. This Z axis motion can be in an open
space, if the material had been predrilled for instance. The The program can be in either absolute or incremental
,
Z axis motion can also be cutting into a solid material, if the mode and, in this case, the incremental mode is a little eas-
XY
xz
Figure 45-10
N10 1-0.375 Z-0.05 (CUT 3 BELCW TOP FACE) helical motion. Figure 45-10 shows the schematics of the
Nil 1-0.375 Z-0.05 (CUT 4 BELCW TOP FACE) program in four different views.
N12 1-0.375 Z-0.05 (CUT 5 BELCW TOP FACE)
N13 1-0.375 (CIRCULAR BOTTOM CLEANUP) Helical interpolation can be a very powerful program-
N14 G90 G01 G40 XO (RETURN TO XY START) ming tool, often irreplaceable by any other methods. Al-
N15 GOO Z1.0 MO though it is a control option, its main benefit is the short
N16 G28 Z1.0 MO
program output and the possibility of quick changes may
N17 M30
justify its extra cost.
%
Two items are worth a note here. One, because the incre-
mental mode is used, the Z axis start is extremely important
(block N4). The cutter radius offset is applied during a sim-
ple straight motion from the center to the start of the first
46 HORIZONTAL MACHINING
Throughout the handbook, there have been dozens of INDEXING AND ROTARY AXES
programming examples. They all shared one common fea-
ture - they were aimed at the vertical machining centers.
All programming concepts that ve been discussed so far,
There was a reason for this approach. First, there are more
apply equally to CNC horizontal machines. The axes XY
vertical machining centers in machines shops overall, and
are used mostly for drilling and contouring operations, the
mixing two different types of machines would make all ref-
Z axis controls the cutting depth.
erence material more complex. Second, almost every sub-
ject covered so far for the vertical models is equally applic- Horizontal machining centers differ from the vertical ma-
able to the horizontal models. So what are the differences? chining centers not only in the axes orientation and the type
of work that can be machined. One of the major differences
The horizontal machining center mainly differs from a
is an additional axis.
vertical machining center in its general functionality. While
a vertical machine is mostly used for only one face type of Thisan indexing or a rotary axis, usually designated as
is
work, a horizontal machine is used for work on many faces the B Although the two terms are often used inter-
axis.
of the part during a single setup. This feature alone makes a changeably, there is a difference between them.
horizontal machining center a much more versatile ma-
An is mounted on
indexing table will rotate the part that
chine and also more expensive. Figure 46-1 shows the
- it,
A rotary table will also rotate the part that is mounted on it,
From the illustration is clear that all the XY plane is used The indexing axis is programmed in the number of de-
for the primary plane of work and the Z axis is used to con- grees that is required by the job. For example, to index a ta-
trol cutting depth. There is no difference whatsoever be- ble to a 45° position, program:
tween the two machine types in this respect.
G90 GOO B45.0
Between programming and setup, there are three major
differences on a horizontal machining center: The minimum increment depends on the machine design.
For indexing, a typical minimum unit of increment could
Presence of a fourth axis, typically an indexing B axis
be 1 degree or even 5 degrees. However, for more flexibil-
Presence of a pallet changer ity - and for rotary machining - much liner increment is re-
quired. Most machine manufacturers offer 0.1, 0.01 and
Richer variety of setup and offset settings
0.001 of a degree as the minimum
indexing increment. In
First, a brief look at the fourth axis of a typical CNC hori- all cases, the programming of the indexing motions can be
zontal machining center. done in two directions.
429
430 Chapter 46
Figure 46-2
B247.356 CCW -22.644 degrees
B axis direction and general descriptions BO CCW -247.356 degrees
B-37.0 CCW -37 degrees
The table size including the size of corners is important to
determine the clearances before indexing. B42.0 CW 79 degrees
The function numbers may greatly with different ma- Programmed motion in G91 Actual absolute position
chine designs, so check the manual for proper coding. G90 G28 B0 Machine B zero position
Normally, the unclamp function is programmed before G91 G28 B0 Machine zero - no motion
the indexing, followed by the B axis motion and another GOO B90.0 CW 90.000
block containing the clamp function:
B180.0 CW 270.000
147 9 Unclamp table B90.0 CW 360.000
GOO B90.0 Index table B270.0 CW 630.000
M7 8 Clamp table B0 No motion
linear axes, including the mode of dimensioning. Either the B-75.31 CCW 424.690
absolute or the incremental mode can be used for indexing, CCW
B-424.69 0.000
using standard G90 and G91 commands respectively.
HORIZONTAL MACHINING 431
Study both tables block by block, in the listing order. The B AXIS AND OFFSETS
results are always important for understanding. Note the
B-37.0 in the first table - exactly the same result could be
achieved if the block read B323.0 as a positive value. One of the most important differences between vertical
and horizontal machining centers is the way we program
In the second table, the first block is in the absolute mode and particularly set the two major offsets:
to guarantee a start at BO. One occurrence that is interesting
Work offset
- when the rotation in the same direction reaches 360° (a
full circle), it continues to increase. It does not become a Tool length offsets
46-4 shows a typical setting, looking at the part from the di-
rection of the spindle.
G54 (X)
Machine
Zero
04601
G90 G54 GOO X. . Y. . Z. .
M79
BO
M78
PART
:• w
...
—
< DRILL HOLE AT BO > TABLE
< DRILL HOLE AT B45.0 > Although the illustration shows the part zero at the center
of the indexing may as well be at the top
table, the part zero
of each part face or even elsewhere. There are benefits in ei-
The dimensions relating to the drilling are not important
ther approach and there is no 'best' method. Often, it is the
for the example.
specified requirement of the job, the fixture design, nature
of the work and - of course - the programmer’s personal
Always observe safe clearances when indexing the B axis
preferences.
432 Chapter 46
H = NEGATIVE VALUE
This settingis an entry of the distance between machine
Figure 46-5 gauge and the ZO of the current work offset Z address -
line
Touch-off tool length offset method - layout with H as negative Figures 46-7 and 46-8.
HORIZONTAL MACHINING 433
Preset tool length offset to Z0=face - layout with H as positive Preset tool length offset to Z0=center - layout with H as positive
Figure 46-8
In the program is block that moves the tool to the Z clear INDEXING AND A SUBPROGRAM
position - G43Z152.0H01. To calculate the distance-to-go
The tool then continues normally to the Z- 135.0 depth. spot of the cylinder. All the depth calculations are real.
the table in an index position other than zero, long and short
Don't get discouraged by the large number of holes re-
tools, different part faces, fixture in the way, etc., it may be
quired. Using a subprogramming approach will minimize
difficult to always know exactly how far to retract the Z
the program length. The program does not use any clamp
axis. That is why a simple rule is worth remembering:
and unclamp sequences, which is typical to the rotary type
B axis. If the machine requires unclamping the table before
Return in Y axis because is necessary and in Z axis for safety.
it
indexing and clamping it after indexing, use suitable M
functions for clamp and unclamp the table.
HORIZONTAL MACHINING 435
Before getting into the program itself, the tools and their 04602 (MAIN PROGRAM)
use need to be selected. Only two tools will be required, a (START FROM MACHINE ZERO - T01 IN THE SPINDLE)
(XOYO = FIXTURE CENTER / ZO = BOTTOM OF PART)
10 mm spot drill and a 6 mm drill. Figure 46-12 shows the (T01 - 10 MM DIA SPOT DRILL)
critical positions of the two tool tips.
(T02 - 6 MM DIA DRILL THRU)
N1 G21
N2 G17 G40 G80
/N3 G91 G28 ZO
/N4 G28 XO YO
/N5 G28 BO
N6 G90 G54 GOO XO Y26.875 S1000 M03 T02
N7 G43 Z275.0 HOI M08
N8 M98 P4651 L18
N9 G28 YO ZO
N10 G28 BO
Nil M01
N12 T02
N13 MO 6
N14 G90 G54 GOO XO Y26.875 S1250 M03 T01
Figure 46- 12 N15 G43 Z275.0 H02 M08
Detail of tool data used in program 04602 N16 M98 P4652 L18
N17 G28 XO YO ZO
The R level is the same and the depth for
for both tools N18 G28 BO
chamfer to deburr the
N19 MO 6
the spot drill also includes a small
N20 M30
holes. Drilling depth guarantees a full drill penetration. Ac-
%
tual calculations are not important here, but they do follow
the same rules established in the earlier chapters. 04651 (SUBPROGRAM FOR SPOT DRILL)
N101 G91 G80 Y-6.875 (MOVE DOWN BY PITCH)
Development of the subprogram needs some work. Two N102 G90 Z275.0 (CLEAR Z)
subprograms will be used. They are virtually the same, ex- N103 G91 B10.0 (ROTATE BY 10 DEGREES)
cept for the fixed cycle selection. Several other methods N104 G99 G82 R-148.0 Z-5.4 P200 F120.0 (DRL)
could have been also used, but this chapter concentrates on N105 Y13.75 L16 (16 MORE HOLES IN Y PLUS)
the indexing table only. The two subprograms will start at N106 G80 GOO Y6.875 (MOVE UP BY PITCH)
the bottom of the pattern, at the BO location (0°). This hole N107 G90 Z275.0 (CLEAR Z)
will be used as the only but will not be drilled
start position
N108 G91 B10.0 (ROTATE BY 10 DEGREES)
N109 G99 G82 R-148.0 Z-5.4 P200 (1 HOLE)
until all other holes have been done. The hole is not drilled
N110 Y-13.75 L16 (16 MORE HOLES IN Y MINUS)
yet, but the 10° indexing has to be included in the
Nlll M99 (END OF SUBPROGRAM 04651)
subprogram. That is the reason for starting one column %
0°
away. Two columns are part of each subprogram with a 1
index between them. Comments in the subprograms ex- 04652 (SUBPROGRAM FOR 6 MM DRILL)
plain the process. Note the area marked in Figure 46-13, in- N201 G91 G80 Y-6.875 (MOVE DOWN BY PITCH)
dicating the subprogram contents. N202 G90 Z275.0 (CLEAR Z)
N203 G91 B10.0 (ROTATE BY 10 DEGREES)
N204 G99 G83 R-148.0 Z-15.84 Q7 0 F200.0 (DRL) .
Figure 46- 14
A typical multi sided part suitable for a horizontal machining operation - program 04603 (subprograms 04653 and 04654)
N35 G80 Z300.0 self can shorten the unproductive time to a great degree.
N36 M79 They include work offsets, cutter radius
tool length offset,
N37 B90.0 offset, etc. However, none of them solves the problem of
N38 M78 the time used up when mounting individual parts on the ta-
N39 G55 X49.5 YO Z10.0
ble. Probably the major breakthrough was an introduction
N40 G99 G83 R2 0 Z-24.8 Q6 0 LO
. .
N41 M98 P4654 (TAP DRILL FACE B) of a pallet table to the CNC machine. Pallets are not a new
N42 G80 Z300.0 M09 idea in machining. For horizontal machining centers, inter-
N43 G91 G28 YO ZO M05 faced pallets have become very practical feature to mini-
N44 M01 mize the setup time.
(T03 - M10 X 1.5 TAP) Traditionally, one machine has one work table. Such a
N45 T03 design of a machine tool has one major Haw - while the ma-
N46 MO 6 chine is working (and the CNC operator is virtually idle),
N47 G90 G55 GOO X49.5 YO S550 M03 T04 no other work can be performed. That means a setup for the
N48 G43 Z10.0 H03 M08
next part is done at the expense of the machine being idle,
N49 G99 G84 R5.0 Z-23.0 F825.0 LO
resulting in an unproductive time.
N50 M98 P4654 (TAP FACE B)
438 Chapter 46
By definition, an automatic pallet is a work table that can The popular rotary type works on the principle of a turn-
be moved into and out of the machining position by a pro- table, where one pallet is outside of the machine, the other
gram command. If a purpose of such a design is to improve pallet is in inside of the machine. The pallet change com-
a nonproductive setup time, it is necessary to have at least mand rotates the pallets 180° and programming is very
its
two independent pallets available - while the part on one simple. Figure 46-15 illustrates the rotary type..
pallet isbeing machined, the other pallet is available for
changing the setup for the next job or for unloading and
loading individual parts. In this way, the machining and the
setup can be done simultaneously, shortening or even to-
tally eliminating the unproductive time.
Working Environment
area and Pallet #2 (with no part) in the setup area. There are
many designs of pallets, but they all share three ma jor parts: Typical rotary type of a pallet changer
Often the terms load and unload are used. Load means to
move the pallet into the machining area, unload means to
move the pallet into the setup area. The transfer system de-
termines the type of the pallet.
Types of Pallets
Rotary type Both pallet types are loaded from the machine front area.
Other pallet types are also available for some special ma-
Shuttle type
chining applications.
HORIZONTAL MACHINING 439
Programming Commands Although there are five axis designated, a horizontal bor-
ing mill is still only a four axis machine
The fairly standard miscellaneous function for automatic
pallet changing is M60. X axis ... table longitudinal
tion is at one of two machine reference points: B axis ... indexing or rotary table
[ 10 ] . . .
. . .
[14]
similar to a CNC horizontal machining center, usually a lit-
[15]
.
N350
. .
GOO W.
tle larger in size. It may or may not have an automatic tool
[16] N360 MO
changer, and usually has the spindle motion split into two [17] N380 ZO
axes - Z and W. The following is a typical setup of a 4 axis [18] N390 G30 G49 WO
horizontal boring mill with an indexing B axis and a Fanuc [19] N400 G91 G30 XO YO
or similar control with: [20] N410 MO
[ 21 ] . . .
[23] . . .
Two machine reference points ... G28 and G30
[24] N600 M30
[25] %
440 Chapter 46
[
01 ]
Program number (name up to 16 characters) 1 15 ]
Rapid motion back to the clearance level (see [
08 ])
[ 02 ]
Message to the operator - only between parenthesis [16] Spindle stop
[ 03 ]
Metric or English units selection [17] Rapid motion of the quill back to the spindle
04 W axis moves to a tool change position [18] Rapid motion to the tool change position along the
W axis and cancellation
[ j
[
06 ]
Rapid motion to the starting position in XY within and Y axes - in incremental mode for safety
[
09 ]
Feedrate motion to the required depth [ 24 ]
End of program
10 ]
... | 25 ] End of record (stop code)
[
MU ...
47 WRITING A CNC PROGRAM
Writing a CNC program is the final result of manual pro- PROGRAM WRITING
gramming. This last step requires a sheet of paper, or many
sheets of paper, that contain the program. The program is
Writing all collected data into a final version of the CNC
composed of individual instructions related to machining
part program is one of the last items inside of the program-
and arranged in a series of sequential blocks. Writing does
ming process. To get to this stage requires hard work
not mean using only a pen or pencil. Modern writing meth-
through all other stages - when all thoughts have been col-
ods employ a computer and a text editor, but the result is lected, all decisions have been made and a certain level of
still a written copy of a manually generated part program.
comfort has settled in. In the previous chapters, the empha-
sis was on the program development as a logical process.
Manual program development is the result of a lot of hard
Now. the focus will shift at the actual method of writing the
work. A short program with a few lines of code may be as
easily entered into the control directly as to be written down CNC program, following this logical process.
on paper. However, the written copy will often be required Writing the program is based on two initial factors:
for documentation and other reference purposes.
The corporate standards . . . company decides
The need program by hand seems somewhat back-
to
wards in the age of computers, printers and other hi-tech The personal style ...you decide
writing, using a devices such as pens, pencils, calculators ploys - or plans to employ - more than one programmer,
and erasers. should establish certain minimum standards for the prepa-
ration of a part program. Adherence to these standards al-
Regardless of the media used, learn how the computer -
lows any team member to pick up where another member
the control system - interprets the written program, what
has left. Often, the personal style of the first programmer in
syntax to use, what to avoid and what format is correct.
the company will carry on and on and eventually becomes
Even if not programming manually at all, it is important to
the company standard, for better or worse. Such a situation
know the principles of program writing techniques, in or-
may well be very positive, but in most cases it needs revalu-
der to make changes in any program that was developed by
ation or at least a bit of modernizing.
a CAD/CAM system, if necessary.
To define a company standard, first evaluate some sug-
CNC program should be written in such a way gestions and practical observations that may be helpful to
that it can be interpreted without a difficulty prepare the program efficiently for any style that may be
suitable to follow and useful in the future.
441
442 Chapter 47
Legibility of Handwriting For instance, all computers and printers (even the old tape
Writing a program without any assistance of a computer
preparation systems) use a special method to distinguish
individual characters on the screen and In this
and a text editor, means writing a CNC program in pencil,
in print.
handbook there is an obvious difference between a wide
by hand. A
hand written program (preferably by pencil) is
easier to correct without a mess and it should be double or
letter 0 (as in 01111) and a narrow digit 0 (as in OO 0 01).
even triple spaced when written on a sheet of paper. Indi- The same technique should be applied to personal hand-
vidual words in a program block should be separated by a writing. Take advantage of the fact that there is no letter O
space, to further enhance legibility. This way, any additions used on most controls anywhere, except as a program num-
or future changes (if they become necessary) can be made ber and in a comment section, where a misprint will not
still keeping the overall appearance of the
quite easily, yet create a problem anyway. If preferred, find a special desig-
paper copy clean and neat. Problems with legibility of a nation only for the letter O and the rest is all digits 0 by de-
manually generated program are much less of a factor, if fault - unless hundreds of zeros are identified specifically
the program is typed directly into a computer text file. Even and in a unique way in every part program.
in those cases, the printed copy may be illegible for techni-
cal reasons, such as a low printer toner, for example.
Programming Forms
0 or
0 DIGIT ZERO
PROGRAM OUTPUT FORMATTING This is the most primitive way of writing a program. Al-
though it may offer some doubtful benefits, it is the least
friendly version. Good program with a very poor appear-
Those who followed this handbook from the beginning,
ance. It is extremely difficult for the CNC operator to read
chapter by chapter, should be well familiar with program-
this mess.
ming by now. This section deals with the actual program
format - not its contents, but how it appears on the printed
O Program Version 2 :
N7X3.25Y3.25
sion will be improved over the previous version.
N8X0
N9X-3.25
O Program Version 1 :
N10Y0
N11Y-3 .25
G20 N12X0
G17G40G80G49 N13X3.25
T01M06 N14G80G00Z1 0M09 .
G43Z10000H01M08 N16M01
G99G82X-32500Y0R1000Z-3900P0500F80 N17T02M06
X32500Y32500 N18G90G54G00X-3 25Y0S750M03T03 .
XO N19G43Z1. 0H02M08
X-32500 N20G99G81X-3 25Y0R0 1Z-2 2563F12 . . . .
YO N21X3 25Y3 25
. .
Y-32500 N22X0
XO N23X-3.25
X32500 N24Y0
G80G00Z10000M09 N25Y-3 25 .
G28Z10000M05 N26X0
M01 N27X3.25
T02M06 N28G80G00Z1. 0M09
G90G54G00X-32500Y0S750M03T03 N29G28Z1 0M05 .
G43Z10000H02M08 N30M01
G99G81X-32500Y0R1000Z-22563F120 N31T03M06
X32500Y32500 N32G90G54G00X-3 25Y0S600M03T01 .
XO N33G43Z1. 0H03M08
X-32500 N34G99G84X-3 25Y0R0 5Z-1 3F37 . . . .
Y-32500 N36X0
XO N37X-3.25
X32500 N38Y0
G80GOOZ10000M09 N39Y-3.25
G28Z10000M05 N40X0
M01 N41X3.25
T03M06 N42G80G00Z1 0M09 .
G43Z10000H03M08 N44M30
G99G84X-32500Y0R5000Z-13000F375 %
X32500Y32500
XO This is definitely a much improved version of the pro-
X-32500
gram. Look at what a simple block numbering and inclu-
YO
sion of the decimal points do to the program legibility. This
Y-32500
XO program version is far from being final, but it does offer
X32500 some tangible improvement. Decimal points in programs
G80G00Z10000M09 are of course standard, except for old controls.
G28X32500Y-32500Z10000M05
M30 The next program version applies all improvements done
% so far and addresses some additional issues.
444 Chapter 47
© Program Version 3 :
(TOl
Nl G20
- 1.0 DIA - 90 DEG SPOT DRILL)
Nl G20 N2 G17
G40 G80 G49
N2 G17 G40 G80 G49 N3 TOl
MO
N3 T01 MO N4 G54 GOO X-3.25 YO S900 M03 T02
G90
N4 G90 G54 GOO X-3.25 YO S900 M03 T02 N5 Z1.0 HOI M08
G43 (INITIAL LEVEL)
N5 G43 Z1.0 HOI M08 N6 G82 X-3.25 YO RO.l Z-0.39 P0500 F8
G99 .
A
simple way to reduce the program length is to elimi- A grand total of 194 characters have been programmed.
nate all unnecessary characters from the program. Since The condensed version of the program needs only 89 char-
the problem is related to a long program, the reduction in acters, with a minor compromise. Program in this form is
length will be much greater than can be illustrated here. more memory efficient but much harder to read remember -
There is a number of areas that should be considered before this is real long program in its en-
only a short sample, not a
taking the red pen and starting the changes: tirety, where the difference would be more impressive:
Use default control settings, but check them first A total of 54.12% of the program length have been saved
Although both program examples will result in a part ma- ulate a tape with many added benefits. Tape mode is not to
chined according to the drawing specifications, some pro- be taken literally. Think of the Tape mode as an external
gramming instructions will be processed differently. A mode, not in its actual old fashioned sense.
very important change can be achieved in the tool approach
towards the part. In the first example (standard version), the In order to use this external mode requires a little extra
motion command positions the X and Y axes first, with the hardware and software. On the hardware side, only a reli-
able micro computer is needed, with a fair size hard disk
Z axis motion following in a separate block. In the shorter
example, the order of motions has been preserved for safety
storage capacity. A properly configured cable that will con-
edited from the memory, and is run from the memory. The system. So before investing into rather expensive memory
Tape mode is, of course, to run a program from a tape and updates, investigate this method of running a program from
many users ignore the possibilities this mode offers. Even if a personal computer, if the transfer speed is fast enough.
not using punched tapes in the machine shop anymore,
(most companies do not), the Tape mode can be used to em-
PROGRAM DOCUMENTS
organized and stored in one place. A good documentation AH of these files are useful to the programmer, but only
makes a review of the program at a later date much easier. If some are important to the CNC machine operator or the
somebody else has to review a program, the documentation setup person. A number of files are only for reference, and
will save much of the valuable time. The way programmers are not normally sent to the machine shop. Two basic rules
document programs reflects not only their personal pro- for data files can be established:
gramming style, it also becomes a reliable indication of
and organizational Programmer keeps all the files
their sense of discipline capabilities.
can be predefined, then filled quickly whenever they are machine operator. Normally, it is the printed output of the
needed. CAD system will save time, it makes the program program. The remaining two items, the setup sheet and the
tooling sheet describe the programmer’s decisions relating
documentation neat, and every sketch drawn in scale can be
to the part setup and the selection of cutting tools. Each also
easily retraced. Using a word processing or a spreadsheet
is a complement to the program itself. In some cases, other
software is another way to save time for documentation.
documentation has to be included as well, not mentioned
In essence, the purpose of a program documentation is to here. Any piece of paper that is considered important
communicate programmer’s ideas to somebody else or to should be included.
review them at a later date. Creating documentation is not a
directly productive work, but does not have to take too Those who have written programs in a high level lan-
much extra time. Documentation may me a good invest- guage (C++, Visual Basic etc) or in older languages such
,
ment in time management, it can save a lot of time one day as Basic, Pascal or even AutoLISP (the original program-
in the future.
ming language for AutoCAD), know that they can add
comments within the body of the program.
447
448 Chapter 48
These comments are usually terse, just long enough to re- Internal Documentation
mind the user of what is happening in the program. If more
Internal documentation is contained within the body of a
information about the program is necessary, most likely
program. When writing a program, make an effort to strate-
there would be additional instructions, even a user’s man-
gically place comments
into the program. Such messages
ual. This kind of external and internal program documenta-
are integral part of theprogram and are categorized as in-
tion applied in software development, is also adaptable to a
ternal program documentation. These messages are either
CNC program. separate blocks of a program or additions to individual
blocks (delimited by parentheses) and can be actually seen
PROGRAM DOCUMENTATION on the display screen during program execution (on most
controls). They are also printed in the copy of the program.
That only leaves the program data source (usually stored Note that T03 is the current tool. This designation will
on a disk or similar media) to be included in the documen- vary greatly, depending on the tool changing systems of the
tation folder and any special instructions that may be re- particular machine tool builder. Also note the use of abbre-
quired by the programmer, the CNC machine operator or viations in the program comment - 4-FLT E/M is a short
somebody else. form for a 4-flute end mill.
PROGRAM DOCUMENTS 449
Every time the Program Stop command MOO is used in 04802 (RING-OP. 1)
the program, document the reason why it is used: (DWG. A-8462 REVISION D)
(PETER SMID - 07 -DEC- 01)
N104 GOO Z1.0 N1 ...
N105 MOO (CHECK DEPTH = .157 INCHES)
The main purpose of program documentation is to trans-
N106 ... fer allimportant decisions and ideas from the developer to
the user. In the CNC programming environment, the docu-
To gain an extra space in the comment block, make it a mentation transfers the ideas from the programmer’s desk
separate block: to the machine shop. It serves as an important link within
the communication process.
N104 GOO Z1.0
N105 MOO
(DEPTH TO SHOULDER MUST BE .157 INCHES)
SETUP AND TOOLING SHEETS
N106 ... Apart from the program printed copy and the part draw-
ing, the setup sheet and tooling sheet are the other two most
Comments can be in the same block as program data:
important pieces of good program documentation. The ma-
jor difference between the setup sheet and tooling sheet is
N12 GOO X3.6 Z1.0
the subject emphasized. The setup sheet is a sketch or a
N13 MO 5 (CLEAN CHIPS FROM THE HOLE)
drawing that shows the layout and orientation of the part on
N14 ...
even the description of in-
the table or in a fixture, possibly
number for the comment block is usually not used. The in- cutting tools and their mounting positions, with spindle
structions that are part of the documentation should be speeds, feedrates and offsets for each tool. Examples of
clearly understood. Enigmatic or cryptic messages will not both types are shown in this chapter.
Once these conditions are followed, the program number Logic, however, does not take into consideration the ma-
can be viewed along with its description right on the direc- chine shop realities, even if they are essentially not the best
tory screen (program listing) of the control system. or even dead wrong. A small conflict between different de-
partments, a delay in material delivery, a tool on a back or-
If an additional description that
does not fit the 15 charac- der and similar problems, all contribute to the frustrations
ters is needed, enter more comments in subsequent blocks. of a CNC programmer in many companies. Being under
They will not be seen on the directory screen, but can still pressure from all programmer has no choice but
sides, the
be handy for internal program documentation. They will be to improvise, even incrisis. Programmer has to
times of
displayed during the program processing on all controls compromise reflects the reality a little more accurately. If
that accept the comments. The length of these comments is there is no choice, always try to find a reasonable compro-
not usually limited to 15 characters: mise, but never as an excuse for being sloppy.
450 Chapter 48
Setup Sheet
n
In many shops, setup sheets are a luxury. It is a simple
statement of fact, but many setup sheets are quite poorly
prepared if at all. Often, they do not re-
they are prepared Figure 48-
flect the latest program changes and adjustments, they are Simple setup sheet form - only basic data shown
not consistent between individual machines and even pro-
grammers. Although the time spent on preparing a setup A well designed setup sheet should also include informa-
sheet is considered nonproductive from the cost angle, it is tion about the material used for machining, material the
a time far from being wasted. The setup process can be program is based on. Not only the type of material, also its
organized, certain rules can be set and adhered to and they rough dimensions, amount of stock for machining, its con-
can be applied to the preparation of a good setup sheet. dition, and other features that are important to include in
program documentation. This information is very valuable
The golden rule of a good setup sheet is to make it in at its conception and will be even more valuable in the fu-
scale. Setup sheet using an outline of the material, fixtures ture, mainly for repeated jobs. Many times, a program is
layout, finished shape, tool path, etc., should always be made when the blank material is not yet available. If the
done in scale. Scale, even an approximate scale, is very im- programmer finds out later that there is too much deviation
portant for visual comparison. Clamps and other mounting from the estimated conditions, the necessary changes are
devices should be drawn in positions corresponding to the
easier to make with good program documentation.
actual setup. Tool change location should be marked accu-
rately, different views shown, if necessary. Critical posi- Although not a strict requirement, some programmers in-
tions should be dimensioned, indicating the maximum or clude the cutting time for each machining operation on the
minimum distances. setup sheet. When the job is run for the first time, the actual
cutting time unknown. As the program is used and opti-
is
If is used, the speeds and feeds re-
a cutler radius offset mized on the machine, it becomes proven and eventually fi-
flect a certain nominal cutter radius. At the discretion of the nalized, the cutting time becomes known with more preci-
operator, the cutter radius may be changed within a reason- sion. Knowing the cutting time may help in planning the
able range. This range should appear in the setup sheet, in- load work on the CNC machine. The most useful cutting
cluding a note on the adjustment of speeds and feeds. time for an individual part is the chip-to-chip time that in-
cludes all the supplementary times (for example the tool
In many cases when the cutter exceeds a certain length, it
change time, part replacement time, etc.), not only the cut-
may interfere with the part or other tools. In these cases, the
ting time itself.
setup sheet should include the maximum cutter length al-
lowed within that setup. For a chuck work on a lathe, the
Tooling Sheet
maximum grip of the material should be specified in the
setup sheet as well. Although the tooling is really part of the setup, it requires
Machine unit and the CNC system influence the contents Coordinate Sheet
of a tooling sheet. A tooling sheet for a lathe will be differ- Program reference: Date: Programmer: Sheet:
ent than a tooling sheet for a machining center. The data ANGLE BRACKET 07-Dec-01 Peter Smid 1 of 1
gathered for either machine will have some similarities and Ptt X coordinate Y coordinate Z coordinate
some unique items. A contents of a typical tooling sheet PI X0.000 Y0.000
will include description of the following items:
Tool diameter
Tool projections from the holder The Z axis column will be usually blank for machining
Block number of the tool being indexed
centers and Y axis column will be blank for lathe programs.
Modify the sheet to add additional axes or make separate
Brief description of the tool operation sheets for each machine type.
One of the first decisions is the program name selection. method of communicating the operator’s ideas back to the
Regardless of the number of machining operations or in- CNC programmer. Whatever system may be selected, it
cluded subprograms, there should be only one folder for should be available machine, so the operator has a
at the
one job and only one name for one folder. The name of one primary access to it. The main
benefit of such a system is
folder should share the common denominators with any that all communication goes into one source and is easier to
other folder. Try to make such a name meaningful. keep under control.
With an access to a personal computer, the chances are Apart from the nature of the particular comment or idea,
each program are stored in the com-
that all files relating to
the log should have the operator’sname, current date, per-
only limiting factor is the software
puter. In that case, the haps even current time, the machine and job description, as
format structure to name the files. For example, the old well as any other details that may be relevant and useful
DOS software files accepted up to eight alpha numeric anytime in the future.
characters for the file name and another three alpha nu-
meric characters for the file extension. Since Windows 95. Filing and Storage
long file names are allowed, up to 255 characters plus
Program file folders can be quite bulky, particularly when
extension - try to take advantage of this feature. Regardless
they contain computer media, such as disks, large size
of the CNC system used, establish a file naming convention
paper drawings, long program printouts, etc. The storage of
conforming to any possible restrictions. There are several
file folders is usually confined to standard office steel filing
methods for this approach.
which should be accessible to every work shift, al-
cabinets,
One is an independent, sequential order. In this simplest though only qualified and authorized persons should be
form, documentation related to the first program would
all
given the actual access.
Every program should be checked against all errors be- The method any programmer should use is simple -
first
check your own work. Read the program and evaluate it. If
fore it reaches the machine. Checking can be quite simple,
such as a visual comparison of the written copy and the the rules of consistency had been followed, the error check
printed copy. The main purpose of a program check is to
is easy. Programmers know the appearance of the program,
the established standards, the order of commands at the be-
detect obvious mistakes - mistakes that can be seen by con-
centrating and looking for them. The kind of errors de-
ginning and end of each tool. Checking the program should
tected first are mostly syntax errors. Of course, there is no
not take much time at all.
discovered first. In CNC programming, errors can be found gram, the control will reject it as illegal. The control returns
either before or after the program copy leaves the office. an error message or an 'alarm'. If the digit 2 is entered in
The intentions of any good programmer are undoubtedly to the program instead of the intended digit 7. that is nor a syn-
discover any errors before they are detected during the pro- tax error. That is a logical error, since both are legitimate
gram execution on the CNC machine. This is a preventive characters the control can accept.
effort. If the error has to be corrected at the machine, during
the run of the program, the CNC operator has to do some- Corrective Measures
thing that should not normally be part of the operator’s du-
ties. Whatever action must take, it is a cor-
it is the operator If an error is discovered at the control, during the program
rective action. Therefore, measures that can be taken to processing, it was missed and the preventive check did not
453
454 Chapter 49
For example, a missing coolant function M08 in the pro- One method of graphic verification of a CNC program is
gram can be switched on manually at the machine, without a screen plot. This optional control feature will show all
interrupting the program processing. That is an example of programmed tool motions on the screen. The motion will
a soft error - it is still an error, but classified as a minor error. be represented as lines and arcs. The feedrate motions will
appear as a solid line of the selected color, the rapid motion
A hard error occurs when the program processing must will appear as a dashed line. The display of the tool path
be stopped by the operator, as the only available choice, will appear on the screen of the control.
and without doing a damage to the machine, cutting tool,
part, or all of them. A common example of a hard error is a Many controls offer a graphic simulation option, where
programmed tool motion that cuts in the wrong direction. the tool path is simulated on the screen. Each cutting tool
The program itself is wrong and must be corrected. This is can be shows by a different color or density, making the vi-
an example of a hard error, classified as a major error. sualization easier. Some graphic simulation uses actual tool
shape and the part for a realistic display. The negative part
Most CNC operators do not like delays, especially delays of any graphic verification is that it can only be used when
caused by somebody else. A dedicated machine operator the program is loaded into the control.
will do anything possible to correct a problem without any
assistance. For program errors, the operator will try to take The second verification method is much older than the
corrective measures to eliminate the problem. Not every a hard copy plotted representation of the cutting
first. It is
operator is qualified to do even a simple change to the pro- tool motions. Hard copy plotting has been available in
gram. On the other hand, some qualified operators may not computer programming for a long time. To get the benefits
be authorized to do program changes as a matter of policy. of hard copy plotting, a pen plotter and a suitable software
will make it work. The plotter is seldom a problem in com-
Every company benefits greatly, if the CNC operator has
panies using CAD software but may not be available to
at least a basic training in CNC programming. The purpose small machine shops. The required software is also part of
of such a training is not to make the machine operator a a large computer based programming system and can be
CNC programmer. Its purpose is to highlight
fully qualified
quite expensive. A simple version of a pen plotted tool path
how a part program influences CNC machining, the setup, is a screen dump, usually to a printer.
tooling and all the other relationships between program-
ming and machining. purpose is to offer the operator
Its There is a third method of graphic verification and can be
tools that can be used for minor program changes, etc. Such done in the office. It uses a computer and software specially
a training, if it is designed and delivered in a professional designed to read a manually generated program, then dis-
manner, is always a worthwhile investment. It may be a plays the tool path on the screen. Some software even uses
relatively short training that will pay for itself very quickly. a solid model like features, so the actual surface of the part
Time delays on CNC machines are costly and the sooner after machining can be seen as well. This is very useful for
the program is made functional, the less damage to the pro- 2-1/2D and 3D tool path verification.
duction control has been done.
Although the average distribution of programming errors Logical errors cover an unlimited number of possibilities.
could be generally 50/50 between the syntax and
split at For example, the following lathe program is wrong:
logical errors, certain conditions may swing the balance. A
programmer with limited experience will make all kinds of 04901
errors. An experienced programmer makes more syntax er- (EXAMPLE WITH ERRORS)
rors. Let’s look at each error group. N1 G20 G40 G99
N2 G50 S2500 T0400 M42
N3 G96 S530 M03
Syntax Errors N4 GOO G41 X12.0 Z0.1 M08
/ N5 G01 X-0.06 F0.012
Errors in this group are usually easy to deal with, once
/ N6 GOO Z0.2
they arc identified. Syntax error is simply one or more char-
/ N7 X12.0
acters in the program that are either misplaced or do not be- N8 ZO
long there. This error covers program entries that do not N9 G01 X-0.06
conform to the programming format (known as syntax) of N10 GOO Z0.1 M0
the control system. For example, a lathe control systems do Nil X20.0 Z5.0 T0400 M01
not accept the character Y. If the control encounters the let-
and WHILE, words not allowed in a standard program. missing in block N8. In this case, the control would issue an
Macro symbols or words in a non macro program result in a error message, but only for the first time the program is
syntax error. The error will also occur when the custom processed. The correct block N8 should be:
macro option is available, but some of the symbols are used
incorrectly or the special words are misspelled.
N8 ZO F0.012
The control system handles syntax errors arbitrarily - it The third error is the missing cutter radius offset cancel in
simply rejects them. 'Hie rejection is displayed as an error block Nil. This block should correctly be written as:
message on the screen. Program processing will stop. Syn-
tax errors are irritating and embarrassing, but almost harm- Nil G40 X20.0 Z5.0 T0400 M01
less. Scrap as a result of a syntax error is possible but rare.
The second group - the logical errors - is much different. A error of this kind may have a serious implications for
the next tool. Even worse, this error may not be discovered
during the first part run. The correct program is 04902:
Logical Errors
The control does not and cannot have any built-in protec- / N7 X12.0
tion against logical errors. Programmer has the responsibil- N8 ZO F0.012
ity to exercise all necessary care and caution. Logical errors N9 G01 X-0.06
can be serious - they may not only result in a scrap, they can
N10 GOO Z0.1 MO
Nil G40 X20.0 Z5.0 T0400 M01
damage the machine and even harm the operator.
456 Chapter 49
After evaluating the three errors, what chances are there Calculation Errors
that the control will return an error message? Nil, zero,
Using math functions and formulas is a part of develop-
zilch. All errors in the example are good illustrations of log-
ing CNC programs manually. The type of calculation er-
ical errors. They may not always be easy to find, but they
rors include a wrong numeric input, even when a pocket
can create a lot of additional problems if not found early.
calculator is used. Keying a wrong formula, wrong arith-
metic sign or placing parentheses in a wrong position, all
Rounding Error
Strictly speaking, there are no ‘common programming
errors. Every programmer makes some unique mistakes. It A special type of an error
is caused by incorrect round-
is difficult to list any errors as being more common than ing. This error an accumulative error that results from too
is
others. It is also true, that some mistakes are made more many dependent calculations. A rounded value used in
frequently than others and in that sense they are more com- other calculations may lead to an error. In many cases the
mon. Focusing on this group should be beneficial. error will be too small to cause any problems, but never
count on it. It may become a very bad habit.
Both syntax and logical errors share the same cause - the
person who writes the program. The most important step Calculations check
towards eliminating errors is the identification of a problem
- ask yourself ‘what mistake do l do repeatedly ?’ Every- To prevent math errors when
using formulas for calcula-
body makes some ‘favorite’ mistakes, the solution lies in tions, it is a good idea to check the calculated result once
the correct answer to this simple question. more, using a different formula. Math is a generous science
and more than one calculation method is usually possible.
Most errors are a result of insufficient program planning
and a lack of precise programming style. Planning offers a Hardware Errors
sense of direction, style offers tools and organization.
The last type of program errors is by the malfunction of a
The simplest - and the most frequent - error is an omis- hardware element of the control system or machine. In
sion of some fundamental instruction. It may be a coolant CNC, even a bug in the software is possible. Their occur-
function, program stop, a missing minus sign and others. rence is rare, as modern controls are very reliable. When
Even the whole block may get lost, mainly when preparing encountering an error, don’t blame the control or the ma-
the program from poor sources. Many errors are caused by chine as the first and only possible cause. It shows igno-
the programmer’s inability to visualize what will exactly rance and unwillingness to address the problem responsi-
happen when the program is processed. To this category bly. Before calling for a service, make sure to exhaust all
belong all errors relating to setup, tooling and machining other possibilities of error detection first.
conditions - cuts that are too heavy or too light, insufficient
clearances and depths, incorrect spindle speeds and cutting Miscellaneous Errors
feedrates, even the selection of wrong tools for a given job.
Some errors can be traced to the part drawing. An error in
Program Input Errors the drawing is possible, but first make sure to interpret the
drawing correctly. Drawing errors include too many or too
Most programs are hand written or typed and have to be few dimensions, poor tolerances, etc. Also make sure to
transferred to the control system or a computer file. Many work with the latest drawing version only.
errors are caused by the incorrect input of intended data.
Keep in mind that if somebody else is using the program, Other errors may be caused by the wrong setup, tooling
its legibility and syntax is very important. or material. These are not programming errors, but they
have to be considered as possibilities. With some common
Input errors also include errors caused by forgetting to in- sense and suitable precautions, many programming prob-
put significant characters in the program. These strings can lems can be eliminated. For example, to prevent an un-
be almost anything and can cause a serious problem. A proven program to be processed as a proven program, just
missed coolant function is not likely to cause a big prob- mark it as unproven. Mark it at the beginning of the pro-
lem; a missed decimal point or a wrong tool retraction will. gram and leave it there until the program is checked.
Other errors are insufficient tool clearances, a depth that is
too shallow or too deep, errors relating to cutter radius off- A complete elimination of errors is not realistic. Mistakes
set (this is always a big group). Be also careful when can- do not happen - but mistakes are always caused. Inexperi-
celing or changing modal program values. One common ence. negligence, lack of concentration, poor attitudes, are
error is one kind of motion by replacing it with
to cancel just some causes. Always program with the attitude to
another type of motion in one block, then forgetting to rein- eliminate programming errors altogether. That will be the
state the previous motion later. first step to making fewer errors.
50 CNC MACHINING
When a part program is completed and sent to the ma- ideas and do communicate with each other - that is the best
chine shop, the programming process is over. All the calcu- advice for becoming a better CNC
programmer. Machine
lations have been done, program has been written, docu- shop offers tremendous resources, take advantage of them.
mented, and the production file is on the way to the CNC
machine. Is the programmer’s job really finished? Is there CNC technology is an instrument to improve productiv-
some reason that could bring the program back, perhaps ity with a minimal human involvement, measured at least
by the physical level. As any other technology, it must be
with operator’s comments, suggestions, or even criticism?
managed intelligently and by qualified people with experi-
If the delivered part programmer will
program is perfect, ence. Without a firm grip and good control, without good
not hear a word from any direction. No doubt, programmer management, the technology will not yield the expected re-
will hear negative comments from all directions. The ques- sults - in fact - in will become counterproductive.
tion is - when is the programmer’s responsibility really
over? At what point in the process of manufacturing can the
The function and responsibilities of a CNC programmer
programming results be evaluated? When can the program has been covered. Now, let’s look at what happens when
good program?
qualify as a
the completed program and related material actually reach
the machine shop.
Probably the fairest and the most reasonable answer
would be whenever the part has been machined under the MACHINING A NEW PART
most optimized working conditions. This means that the
programming responsibility does note nd with the program
and documentation delivery to the shop. The program at
The most expensive part done on a CNC machine is al-
this stage is still very much in the development process. It
ways the first one of the batch. After the machine setup is
still has to be loaded to the CNC system, the machine has to completed, the CNC operator is ready to test the program
be set up, cutting tools mounted and measured and a variety and the machining conditions. Setup time is always non
productive and testing a program is non productive as well.
of small jobs done before the first part can be started. True,
It takes quite a bit of time and effort, even if a good part
all these tasks are the responsibility of CNC operator, so
there is no need for the programmer to care what happens comes out of the first run, as it should. These activities are
during machining, right? necessary and must be done, but doing too many ‘first’
fieldof business software development, it is quite normal to having a different effect on program proving. The first
have a team of people to work on a certain large program- group covers all programs that have never been used on the
ming project. After all, most programming ideas come CNC machine. These programs must be proved for accu-
from talking to colleagues and the actual users of the pro- racy, as well as optimized for best performance. The sec-
gram or particular software. The same is true for CNC pro- ond group covers the repetitive jobs - programs that have
grams used in machine shops. The users of programs are been used at least once before and have been proved to be
typically CNC machine operators - they can be a gold mine
correct in all respects. Programs group have most
in this
of constructive ideas, improvements and suggestions. Talk likely been optimized for the bestperformance under the
to them, ask questions, make suggestions, and - most im-
given conditions. In both cases, the CNC operator must
portant - listen to what they have to say. Programmers who take a good care when running the first part of the batch.
never put their foot in the machine shop or go there However, there are differences between a new job run ver-
sus a repetitive job run.
reluctantly, programmers who may go there with their eyes
closed and ears plugged, programmers who take the atti-
In either case, two qualities relating to the part program
tude that they are always right, are all on the wrong track.
have to be established first:
Exchanging ideas with machine operators, asking ques-
tions and seeking answers is the only way to be fully in- Setup integrity
457
458 Chapter 50
These two considerations are equally important - if only Control Settings Check
The main purpose of this check list, or any other for that
matter, is to cover as many details as possible and not to Machine Tool Check
omit an important item, operation, procedure, etc. Even a
small omission may cause an accident and part damage or
Is the slide lubrication container filled with the proper type
even a scrap due to a faulty machine tool setup.
of oil (lubricant)
isloaded into the control system. It is surprising what can STEP 5 - Check the program
be seen on the screen that was not seen during the paper
This step is the first evaluation of the part program. The
copy check. The reverse is also true. The common mistakes
part may be removed from the fixture temporarily. Since all
such as a missing minus sign or an address, a misplaced
offsets arc already set in the control, the program is
decimal point or a programmed amount extra large or extra
checked accurately, with all considerations. Program over-
small can usually be detected on the screen easier than on
ride switches on the control panel may be used, if required.
the paper. If using a computer for manual programming,
Watch for tool motions in general and be sure to watch for
print out the program and check it visually. Using a double
tool indexes specifically. Repeat this step, if not absolutely
check, many costly mistakes can be prevented. There is
sure with any aspect of the programmed tool path.
software available to graphically check the program on a
computer, using simulation and file comparisons. STEP 6 - Reset the part
The consistency in a programming style is very important If the part was removed in the previous step, now is the
and cannot be overemphasized. Consistency is the major time to mount the part in the fixture again. The successful
method to gain confidence of the CNC operator in the pro- completion of all previous steps allows continuation with
gram integrity, time after time. proving the first part. At this point, check the tooling once
more, also check the oil and air pressure, clamps, offsets,
RUNNING THE FIRST PART switch settings, chucks, etc., just to be sure.
Make sure the tools are sharp and mounted properly in the order to fine tune the program before production begins.
holders. This step includes final offset adjustment (usually a wear
offset). It is also a good time to adjust spindle speeds and
STEP 2 -
Set the fixture feedrates, if necessary.
documentation, particularly for complex setups. A fixture second double check may prove to be worth the time.
drawing may often be required as well.
The ideal way to run a new program is to run it first
STEP 3 - Set the part through the control graphic display, if available. It is fast
STEP 4 - Set the tool offsets If using graphic options of the control system, most
likely, there will be two kinds of graphic representation of
Depending on the type of machine, this step takes care of
the tool path:
setting the tool geometry and wear offsets, tool length off-
set and cutter radius offset, if applicable. One of the most Tool path simulation
important parts of this step is the setting of the work coordi-
Tool path animation
nate system (work offsets G54 to G59) or the tool position
registers (G92 or G50). but not both. Work offset setting is
They have been described in the last chapter.
by far the best and most convenient selection of modern
CNC machine tool setup.
460 Chapter 50
The first type of graphic representation, the tool path PROGRAM CHANGES
simulation, shows the outline of a finished part and the tool
motions. The part outline is identified by a single color, the
Even ifprogram is proven, tested and the first part
a part
tool motions are identified by a dashed line (rapid motion)
and a solid line (cutting motion). During program process-
made and good CNC operator looks at ways of
inspected, a
improvement. Some improvements may be done immedi-
ing, the order of machining is shown on the display screen
ately on the machine, before the whole job is completed.
as either dashed lines or solid lines, depending on the mo-
tion type. The solid area of the part is not shown, neither are
Some improvements may require a different setup, tooling
or llxturing. Often, it would not be practical or even possi-
the tools, thechuck or the tailstock for lathe applications.
ble to implement those changes on the current job, but they
With a color screen, the colors can be preset for each tool to
should be applied the next time the job is done. Some
further enhance the flexibility of the graphics display.
changes to the part program are result of a design modifica-
The more descriptive method of verifying the tool path tion and have nothing to do with the program optimization.
prior to machining is tool path animation. In many respects Others are strictly steps taken for the best productivity rat-
similar to the tool path simulation, the tool path animation ing. Regardless of the reason, virtually any change required
offers a few additional benefits. The part can be seen as a by the machine shop involves the CNC programmer who
shaded form, rather than an outline only. The tool shape can has to apply any new changes to the new program.
be preset and seen on the screen display; the shape and size
All changes to a program should be for the better, they
of the chuck can also be preset, as well as the outline of the
should improve the program. Often a major change will re-
tailstock, fixture, etc., all in a shaded form. The result is a
quire a complete program rewrite, but more likely, a pro-
very accurate representation of the actual setup conditions.
gram can be modified to a reasonable extent. When a pro-
As an additional benefit, the display is also proportional in
gram is changed for the better, it is said to be optimized, it is
scale. During the actual cut, the material can be seen as be-
upgraded. That can be compared to another type of pro-
ing ‘machined’, right on the screen. The tool path anima-
gram change - program update.
tion is a significant improvement over tool path simulation.
Do not expect 100% accurate display of the tool path. No Program Upgrading
graphic display can show every single detail and no simula-
tion will show flying chips. What does show is quite im-
it
Upgrading a CNC program means to strengthen it, to en-
pressive, however. For CNC machining centers, the control rich it,make it better than it was before. It means to
to
change it in a way that the cost of the part production is de-
with graphics can be set to one of several selectable views.
creased. The cost reduction must be achieved with no com-
More than one view can be set at the same time on the
promise in quality of the part or machining safety.
display screen, using a split screen method, also called win-
dows or viewports. Many CNC operators run the graphic The most common form of program upgrading (optimi-
display twice, especially for milling systems - once in the
zation) is minor changes to spindle speeds and feedrates.
XY view, the second time in the ZX or YZ view. Make sure The process is called the cycle time optimization. Milling
the rapid motion display is turned on. The display can be operations may require a different approach then turning
run in a single step mode, areas that are cither too small or
operations. Jobs that are repeated frequently, as well as
especially critical can be enlarged (or reduced for large
large size lots, should be scrutinized with even more care.
parts) with zooming features. Cutter radius offset, tool
Keep in mind
only one second saved on a cycle time
that
length offset and other functions can be turned on or off for will save one hour for each batch of 3600 pieces, half an
the graphic display. Make sure the simulated conditions are hour for each 1 800 pieces, and so on.
as close to real conditions as possible. Also, do not forget to
have all tools and offsets set before the program is tested. In the following check list are some major points to con-
Unfortunately, this graphic option also adds to the overall sider when optimizing a CNC program. The list is far from
cost of the control system and many companies choose not complete, but it should serve as a guide to what areas can be
to purchase it. looked into and be explored. Some items in the list apply
only to the milling operations, others only to turning. There
Many programming instructions cannot be tested by us- are also some items that apply to both systems. Several of
ing the graphics only. On most controls, there will be no them require a special option of the control system or the
clamps, no spindle speed or feedrates. Many other impor- machine tool to be available.
tant activities cannot be seen, but what does show will
make the actual cutting so much easier. Since all motions
have been tested in the graphic mode of the control, all that a Fine-tune the spindle speed and/or feedrate
has to be done during the actual run. is to concentrate on Choose the heaviest depth of cut possible
those details that could not be seen on the display. The tasks
Choose the largest tool radius possible
to be checked have been narrowed down and the program is
Documentation Change
Rearrange tool order for faster tool changes
Program bi-directional turret rotation The documentation that is associated with a particular
CNC program is not much useful if it does not reflect the
Let one tool do as much work as possible
program changes done during part machining. Just like a
Use the M01 rather than the MOO whenever possible well documented engineering drawing or other important
data source, all revisions, updates, upgrades and many
Avoid excessive dwell times
other changes should be recorded. Changes in mathemati-
Eliminate 'air cutting' situations cal calculations should be especially well documented and
Shorten rapid motions where applicable supplemented with formulas and sketches if possible. If
there are several existing copies of the documentation, they
Use multiaxis motion whenever safe
too, should be replaced to make them current and up to
Apply fewer passes for threading date. The programmer’s name, the nature of the change, the
date, even the time of the day, should be used to indicate
Look for block skip applications
when such a change took place.Keeping the old version for
Avoid spindle direction change reference (at least for a while) may also be a good idea.
Shorten the tailstock travel distance Sometimes one or two experiments may be necessary be-
fore deciding on the best documentation, on the final docu-
Do not return to machine zero after each piece
mentation suitable to particular needs.
Program tool changes close to part
Reassess the setup and/or design a new one ALTERNATE MACHINE SELECTION
Re-evaluate your knowledge and skills
oped from experience. Many more items can be added to about to be set up on that very machine. It usually happens
this list and many item can be modified in their description. when it is expected the least.
Even programs once should be
that are to be used only
carefully audited. There may be an improvement that can
Every production manager has to have an alternate plan
be applied to a different job, sometimes in the future. of action. One of the most common actions is to do the job
on another CNC machine. Of course, such a machine has to
Program Updating be available, but there is more to consider.
son for program updating has nothing to do with decreas- CNC system. two or more such machines have been in-
If
stalled in the shop, the program can be executed on any one
ing the part cost. In the end, the part may cost less, due to a
change in the engineering design or similar interventions, of them. Comparably, if two or more machines and/or con-
trols are totally incompatible, programs are not transferable
but not because of a program change. A program needs to
be updated after any change is made in the drawing that af- and a new program must be developed. The best opportu-
nity for compromise exists if two machines are different in
fects the CNC machining. Even programs that have been
size, but with the same control type. The existing program
previously upgraded may still have to be updated.
may be usable as is, or with only very minor modifications.
Engineering changes in part design are more common in
companies that manufacture their own product line. In a job The major considerations for alternate machine selection
involve tooling and setup. First, the cutting tools and hold-
shop, the design changes are typically initiated by the cus-
ers, as well as fixtures, must be available. Tools must all be
tomer, but have the same overall effect. The only difference
the same size, even if holders are different. The part posi-
is in the source and origin of the change.
tion on the table, clamps locations, data holes, clearance ar-
A specific change that will affect the upgrade of a CNC eas, etc., must also be the same. In addition to these general
program may be as small as a change in a single dimen- considerations, specific conditions such as spindle speed,
sional tolerance or as large as a complete part redesign. feedrates, the power rating of the machine tool and other
Personal experience may be somewhere between the two. factors must also be carefully examined. The accuracy and
An upgraded CNC program will reflect the magnitude of rigidity of the alternate machine is also very important.
the change - whether it is a minor correction or a complete
program rewrite. Those machine shops where many part programs have to
be portable have adapted various standards for both pro-
gramming and setup operations.
462 Chapter 50
cision machines even have an internal cooling system to The Z axis motion is the first motion
keep the spindle temperature constant. In cold climates, on
a cold morning in the winter, when the machine was sitting Spindle speed is increased gradually
all night in an unheated shop, the experienced CNC opera- Dwell is used to lengthen the current action
tor turns the spindle on for a few minutes, to let it warm up.
The end tool motion is to the machine zero
At the same time, in order to make the slide lubricant freely
moving along the guide ways, the operator makes a few The end of program M30 is 'hidden' by
free motions in both directions of all axes. If this process is a block skip function
05001 (WARM-UP FOR A MILL) Machine shop safety is everybody’s responsibility. Some
N1 G20 basic safety issues have already been introduced in the first
N14 X-2.0 Y-2.0 isfy all the safety concerns. Here is an attempt at a typical
N15 Z-2.0 S800 list of safety concerns in CNC shop. There are several gen-
N16 G04 P5000 eral groups in the incomplete list. Many suggestions can be
N17 G28 ZO MO in different groups.
CNC MACHINING 463
Check fixtures and tools before they are used In certain situations, it is possible to cause damage to the
On the machine, make sure all the tools are tight in machine and tooling when pressing the Emergency Switch.
the holders, that the tools are sharp and selected Depending on the machine design, there may be several
properly for the job on hand emergency stop switches available, located at convenient
places. The CNC operator should always know the loca-
Stop all machine motions when measuring
tions of each emergency stop switch. Emergency switch is
or inspecting finished work
also called the E-switch.
Do not leave objects on top of machines
When the Emergency Stop switch is released or un- Set the Single Block switch ON
locked, the machine does not restart automatically. The
Set the Optional Block switch ON
machine setup conditions and other conditions have to
present before the automatic start can be selected. This con- Set operation mode to MDI
dition is usually achieved by pressing the Power On switch.
remove the
If available, Edit key from the lock
Parking Machine Slides Several other precautions could be also be used, but the
ones listed are the most typical and should ensure reason-
Several chapters have mentioned a comment that a CNC able safety precautions.
program cannot be executed unless the machine had been
zeroed first. Recall that zeroing the CNC machine while the Turning the Power Off
machine slides are at - or almost at - machine zero, is
the
impractical and may result in an overtravel. The machine Procedures vary from one machine to another, so always
zero return needs about one inch minimum (or 25 mm), to consult the machine manual first. However, there are some
be away from the machine zero position in each axis. This procedures pretty common
machines. General rule is
to all
position is at the end of work than at its
often easier to reach to reverse the procedure of turning the power on. For exam-
beginning. A practical CNC
machine operator knows that ple. if the procedure to turn the power on is
to shut off the machine when the slides are at the machine
1. Main switch on
zero position causes the subsequent start up to take a little
2. Machine switch on
more time. 3. Control switch on
To avoid any potential problems in the future, some pro- then the power off procedure will be
grammers make a small program to bring the machine
slides into a safe position at the end of work, before the 1 . Control switch off
power is turned off. Although the idea is good, the solution 2. Machine switch off
3. Main switch off
to one problem may cause another problem. If the machine
slides are 'parked’ repeatedly at the same position for a Note that in either case, there is no one switch to do all
lengthy period of time, various dirt deposits will collect un- work. This is for the safety of the sensitive electronic sys-
der the slides, possibly causing staining or even rusting in
tem of the CNC unit. Also check the exact function of the
and around the ‘parking’ area. A better way is to let the emergency switch (described earlier), as it relates to the
CNC operator do the positioning of the slides manually. It machine shut down procedure.
does not take any more time and the slides will never be too
long at any one position. All that is needed is a motion of
one axis at a time, to a different position every time. Since it
EQUIPMENT MAINTENANCE
is done manually, there is a better chance that the machine
Setting the Control System maintenance to qualified technicians. The CNC machine
operator should only be concerned with the basic preven-
Control panel of the CNC unit has many switches set to a tivemaintenance, just by taking care of the machine in gen-
certain state at the time of a shut down. Again, variations eral.Modern control systems require very little mainte-
exist as to what is the proper procedure, but a good CNC nance, usually consisting of the air filter change and similar
operator will leave the control system in such a state that it
simple tasks.
does minimize a potentially dangerous situation, when
used by the next person. Here are only some possibilities to The manufacturer of the CNC unit and the machine
apply before leaving the control system for a break, or a manufacturer supply reference manuals, including special
complete shut down: ones for maintenance, with their products. These publica-
tions should be a compulsory reading for any person in-
Turn down the feedrate override switch to
volved with maintaining machine tools in working order,
the lowest setting
electrical, electronic, or mechanical. Many machine manu-
Turn down the rapid override switch to the lowest setting facturers, and even dealers, also offer training courses in
maintenance and general troubleshooting.
Set mode to JOG or HANDLE
Set the handle increment to XI
51 INTERFACING TO DEVICES
Data cards The RS-232C port on the CNC unit is usually a standard
Bubble cassettes feature and uses the DB-25S type (the letter S means it is a
socket type). An external computer, usually a desktop com-
Floppy disks puter or a laptop, together with a suitable cable and a com-
Hard (fixed) disks munications software is also needed to transfer CNC pro-
grams. The external devices use mainly the DB-25P type
Removable devices
connector (the letter P means it is a pin type). The price tag
ROM (read-only-memory) devices for such a setup (hardware and software) is well below the
cost of any suitable alternative. It is also a very convenient
and others
method. The CNC program is sent to the system memory
...
Many of these devices are proprietary, many require not and is stored there as long as needed to run the job. The
only a special cabling, but also a software drivers that can CNC operator usually makes some changes and when the
job is completed, all changes that are to remain permanent
run these devices. The focus of this chapter will be on the
connections that can be easily assembled and those that use are sent back to the desktop computer or a laptop computer
standard configurations. There is one industrial standard and stored on the hard disk. This method works well with a
most of these devices have in common - a standard called single CNC machine as well as several machines.
an RS-232C interface. Well - almost a standard. There is a Although terms such as Transmit (or Send) and Receive
number of variations that follow the standard in principle,
are more common in software, even the latest CNC sys-
but deviate from it to some extent. This handbook is not an
tems use the terms Punch (which is equivalent to Send) and
in-depth discussion of CNC communications, it only does Read (which is equivalent to Receive). These terms go back
an overview of the standard as a guideline, not as a solution
to the days of punched tape.
to all CNC communications.
465
466 Chapter 51
To make this very popular method of communications Modern machine shops do not use tapes, tape punchers
work, only a suitable cable has to be installed between the and tape readers of any kind. These once powerful tools
computer port and the CNC system port. Loading and con- have been replaced by the inexpensive microcomputer
figuring a communications software that runs the complete technology and inexpensive communication software.
operation also has to be done first. In addition, both devices
must be set in a way they can 'talk' to each other. Even if the punched tape technology is obsolete by any
modern standards, it may justify a short sideline for those
Later in this chapter will be a few notes relating to the ba- who still use it and also for those who are interested in the
sic principles of using a personal computer as an interface ‘historical’ aspects of numerical control.
with the CNC system. First, a short look at the original in-
Tape Media
terface device - the venerable punched tape - as a media
used for many years but rarely used anymore.
Punched tape is the oldest media for storing programs.
The tape is made of good quality, enforced paper. The
PUNCHED TAPE punched tape .0000 inch wide (25.4 mni) and about 900
is 1
a punched tape has been the primary media for sending the mensions are illustrated in Figure 51-2.
part program instructions to the control system. In the late
1980’s, the punched tape has lost almost all its splendor and
has been replaced by desktop and laptop computers loaded
with inexpensive software.
Tape Coding The even parity format ISO is also known as the standard
DIN 66024 (ISO) or RS-358 (EIA) or ISO code R-840.
A punched tape consists of a series of holes, laid across
The odd EIA format is the standard number RS-244-A.
the tape width,where each row represents one character of
the program - a character is the smallest unit of input. The Most modern numerical controls, providing they have a
punched characters are transferred through the tape reader tape reader interface, will accept either tape coding auto-
to the control system in a form of electric signals. Each matically, based on the parity of the first end-of-block char-
character can be composed of up to eight signals, repre- acter punched on the tape.
sented by a unique combination of holes punched across
the width of the tape in .1000 (2.54 mm) increments. A Parity Check
character can be any capital letter of the English alphabet,
While punching a tape, make sure that the process is con-
any digit, plus some symbols, such as a decimal point, mi-
sistent for the whole length of the program tape. Mixing
nus sign, slash, and others.
ISO and EIA codes on any one tape will result in a rejection
ISO and EIA Tape Format by the control tape reader. Such a fault is normally called a
parity error. The system check for correct parity is auto-
When preparing the tape, try to understand two methods matically performed by the control unit, when the punched
of standard tape coding - one, which employs the even tape is loaded into the CNC memory or processed in a
number of punched holes, and the other, that uses the odd reel-to-reel operation. Thecheck for the occur-
control will
number of punched holes. The technical terms for these rence of odd characters in an ISO tape and the occurrence
two systems are Even Parity when a character is composed of even characters in an EIA tape. The purpose of such a
of 2, 4, 6 or 8 punched holes, and Odd Parity, when the check is to detect malfunction of the punching or reading
character is composed of 3, 5 or 7 punched holes. There
1 , equipment, which can be very costly if it causes a character
is also coding that is a mixture of the two, called No Parity, of one coding to become a character of the other coding.
that has no application for the machine tools. For illustra-
Control In and Out
tion of a partial tape coding, see Figure 51-3.
Blank Tape
Blank tape can also be one that has only sprocket holes
punched but no holes representing individual program
characters. The sprocket holes are small size holes, located
between the third and the fourth channel of the tape. Blank
section of a tape is used at the beginning (leader) and at the
(American Standard Code for Information Interchange). term used in conjunction with the significant data section is
Odd parity is the standard of the Electronic Industries As- a label skip function. It means that everything up to the first
sociation, EIA in short, that is slowly on the decline, mostly EOB (end-of-block) character, that is punched on the tape
due to the limited number of available characters. will be ignored. That means the significant data section of a
tape is the section following the first EOB character.
468 Chapter 51
and a trailer. The blank section preceding the coded pro- Tab codes
gram data (significant data section) is called a leader the .
;
section following the data is called a trailer. The suitable One character appears on the display screen as a semico-
length of the leader or the trailer is usually about 10 inches lon ( ;
). a symbol for the end-of-block character and
This is
(250 mm) for memory operation (without reels), but should is never written. It is a control system representation of the
be about 60 inches (1500 mm) when the tape is on reels. carriage return in the part program.
For smaller diameter reels, the leader and trailer section can
be shorter than for large reels. Sometimes the length of the Storage and Handling
leader section must be extended to allow space for tape
identification. Stickers or bright pencils can be used to sup-
Paper tape is punched in a tape puncher. Punchers come
ply information about the tape in its leader section.
with only the basic features, some have advanced features
such as keyboard, printer, tape reader, setting switches, In-
put/Output ports, etc. Additional equipment, such as a tape
Tape Identification
winder, splicer, digital tape viewer, etc., is also available.
Each punched tape should be identified as to its contents.
fair amount of space which in-
Storage of tapes requires a
Hand written data, adhesive labels or readable characters
can be used within the leader section of the punched tape.
creases with more tapes. Tapes are normally stored in plas-
tic boxes, small enough to fit in specially designed metal
Adhesive labels may not be a good choice because of their
cabinets with dividers. Tapes can be transferred into com-
tendency to peel and fall off. Hand written notes may pres-
puter files to save space and expensive cabinets.
ent difficulty when writing on a black background. The
identilication usually contains the program or tape number, If still using paper tapes, handle them carefully by the
drawing number and the part name - other information may Insist on the same treatment by the operator and
edges only.
also be included.
Take a special care for paper tapes, particularly
others.
when they are manipulated by winding or unwinding. In
So called readable characters - Figure 51-4 - seem to be
the best solution, since they can be generated on the major-
order to prevent curling, the tape should never be wound
into a small tight roll, which is very tempting for saving
ity of tape preparation equipment.
storage space. Heat and direct sunlight are also enemies of
the tape, as is water. A
reasonable amount of moisture
keeps the tape from becoming too dry.
Data Bits ing device and informs it that a byte of data is coming next.
Start Bit A bit similar to the start bit, but at the end of the byte, has
exactly the opposite meaning. It sends a signal to (he re-
Stop Bit
ceiving device that the byte has ended or stopped being
transmitted. This bit at the end of a byte is called the stop
Baud Rate
bit. Because the start and stop bits go together, they are of-
Baud rate is the data transmission speed. It is measured ten teamed up together as the stop bits and set the devices to
as the amount of data bits per second, written as bps. Baud two stop bits.
only 0.00042 of a second. In practice, it takes about 10 bits 7 data bits (seven data bits)
to transfer one character (see Stop Bits section below), so at
2400 bps setting, the transmission will be at a rate of about 2 stop bits (two stop bits)
CONNECTING CABLES
The 25-pin port has each pin or socket numbered (see the
firstpage of this chapter) and the individual wires of the ca-
ble have to be connected to proper numbers at each end. It
is quite common to ‘cross' the wires between each end. Graphic representation of null modem connections
Typical crossing would be between the pin number 2 and
the socket number 3, and a pin 3 and socket 2. Some num-
Cabling for Fanuc and PC
bered positions have to be connected at the same end of the
cable. This is called ‘jumping’. As the most common communication will be between a
Fanuc control and a desktop computer or a laptop, Figure
Null Modem 51-7 illustrates a typical cable configuration. Note the simi-
larity to the null modem configuration.
A very common cable wiring that is used in general com-
munications is called a null modem. The connection of the
two ends follows a certain standard, shown in Figure 51-5.
Each number represents the pin or the socket on the DB-25
connector. Note the jumps between connections 6 and 8 at
both ends. Figure 51-6 shows the same null modem con-
figuration in a graphic way. 'This is a very popular method
showing cable configurations.
PIN SOCKET
DB-25P DB-25S
1 1
2 3
3 2
4 5 Typical cable configuration for Fanuc controls
Figure 51-5
Math in programming -
the single word ‘math’ often ap- There are several specific mathematical subjects to learn
pears to be so powerful that it strikes a weak chord in many and to know in depth. All of them have been selected only
programmers. It is surprising how many new programmers, for their importance in CNC programming and are de-
manual programmers in particular, are afraid of the often scribed here in the necessary detail.
numerous calculations associated with CNC programming.
This fear is really not substantiated. Let’s look very briefly BASIC ELEMENTS
at what kind of mathematical knowledge is really neces-
Order of Calculations
Most difficulties in solving trigonometric problems are
In the field of mathematics, there is a precisely defined
not as much in the ability to use a specific formula and
order in which Every elec-
the calculations are performed.
solve the triangle - but in the inability to see the triangle to
on these centuries old rules. In a
tronic calculator is based
be solved in the first place. Often, programming involves a
combination of various algebraic operations, the order of
drawing that is very complex in terms of geometrical defi-
calculations will follow these rules:
nitions of the part. Such a drawing will have so many ele-
ments, that overlooking the obvious is possible, even likely. Multiplications and divisions are always calculated first
Any specific knowledge of analytic and spacial geometry Additions and subtractions follow, order is not important
is not really required for a 2 and 2-1/2 axis work, but it is es-
Any roots, powers to a number, and operations within
sential for a work complex
in all three axes, particularly for
parentheses are always calculated before multiplications
surfaces, 3D tool path and multi surface machining or sur- and divisions.
face manipulation. However, this kind of programming is
not done without a computer and CAD/CAM software. The following calculation will have the same result with
or without parentheses:
471
472 Chapter 52
These two examples show that an innocently looking an arc is drawn with a given radius.
Lines
ARC - is any part of the circle between two points on the
circumference of the circle.
Circles and Arcs
CIRCUMFERENCE - is the length of the circle
Points have no parts and arc represented by the XY coor- (length of the line that bounds a circle)
Point is also created by a line tangent to a circle, line tan- SECANT - is a straight line that passes through
gent to an arc, a circle or an arc tangent to another circle or a circle and divides it into two sections.
an arc.
Two area sections of a circle have their own names. They
Lines are straight connections between two points creat- are called the sector and the segment of a circle, and are
ing the shortest distance between the points. shown in Figure 52-2:
PI Constant Quadrants
Circumference of a Circle
C = Circle circumference
n = Constant 3.141 592654...
r = Circle radius
A = Arc angle
POLYGONS -
- S
Polygon is a common geometric element defined by a
number of straight line segments that arc joined at the end
points.These line segments are the sides or edges of the
polygon - Figure 52-5.
Figure 52-6
Regular polygon
Inscribed and circumscribed circles and a single angle
S = Sum of the angles Although regular polygons may have virtually unlimited
N = Number of sides in the polygon number of sides, some polygons are so common that they
have a special descriptive mathematical name:
For example, a five sided polygon shown in the illustra-
where all angles are also equal, called equilateral angles - 6 Hexagon
Figure 52-6.
7 Heptagon
A single angle in a regular polygon can be calculated
from this formula:
8 Octagon
(N - 2) x 180 Nonagon
A 9
10 Decagon
12 Dodecagon
A = Single angle in degrees
N = Number of sides in the polygon n n-gon
MATH IN CNC PROGRAMMING 475
- — — F
"7 C = Fx f2
The description varies between English and the metric-
standards. For example, AMER NATL STD TAPER NO. 2
(American National Standard Taper number 2) is a specific
taper description. Another common description in English
/ F = C x sin45°
ing only a ratio. Ratio is used in English drawings as well.
In both measuring systems, there is one common rule:
/_
Taper on diameter is the difference
C = F / cos30° in diameter per unit of length
C =2xS
I F = C x cos30°
Taper Definition
c s F = S/tan30°
„
L Most drawings define a taper in two common ways:
S = F x tan30°
S=C/2 One diameter and length with taper description or note
TAPERS
Many tapers are industry standards and are used for small
tool holders (shanks), such as a Morse taper or a Brown and
Sharpe taper. In addition, there standard tapered pins, ma-
chine spindle tapers, tool holder tapers, etc. In most cases,
the taper is normally defined by the large end diameter, its
length and a special note describing the taper.
Circular taper - Metric description
476 Chapter 52
111 the Figure 52-8, showing Eng lish units method, the Taper Calculations - English Units
letters have the following meaning:
Missing drawing dimensions in Figure 52-8 may be cal-
oar Dimensions...
culated from the given data. If the taper ratio is not speci-
fied (the normal case), but we want to know what the ratio
D = Diameter at the large end in inches is, To calculate
the following formula will help. the taper
d = Diameter at the small end in inches ratio amount X, when D, d and L are known:
L = Length of taper in inches
TPF = Taper per foot in inches
X = Ratio value 1 : X (not shown)
D-d
In the Figure 52-9, showing metric units method, the let-
D =d+ —
X
CALCULATIONS OF TRIANGLES
Types of Angles and Triangles Sum nf all angles in a triangle is always 180 degrees
Three sides
Typical triangles
/a) Right triangle I bI Acute triangle Icl Obtuse triangle
RIGHT angle means that the given angle is equal to 90° Isosceles triangle
All triangles share a single feature - the sum of all angles Figure 52-13
in a given triangle is always equal to 180° - Figure 52-11. Equilateral triangle
478 Chapter 52
Similar triangles -
L
L = Original length
H = Original height
A = Common (shared) angle With known values entered, the U side can be calculated.
XI = Front clearance in the X axis If the U is isolated on the left and the known values on the
X2 = Back clearance in the X axis right of the equation, the calculation is simple:
Y =1 Front clearance in Y axis
the
Y1 = Back clearance in the Y axis U = (2.250 X 0.500) / 1.750
U = 0.6428571
Figure 52-19 shows the same two triangles in a simpli-
upper part of the illustration, the values X
fied way. In the
Sine - Cosine - Tangent
and Y are sums of the extensions (clearances) from the pre-
vious example: Figure 52-20 shows the most important relationships of
sidesand angles of a right triangle.
X = XI + X2
Y = Y1 + Y2
H _L
=
~
U W
If three of the values are known rather than two, the un-
known value can be calculated using a new formula. For ex-
ample, the values H, L and W
are known, and the value U
has to be calculated. H is 0.500, L is 1.750 and W
is 2.250.
This relationship has its own terminology and is defined The following formula converts degrees-minutes-sec-
as a ratio of sides , using the sine, cosine and tangent func- onds designation to decimal degrees:
tionsof the given angle. Other available functions, namely
cotangent, secant and cosecant are normally not used in
CNC programming.
Sine of an angle - abbreviated as sin - is a ratio of side
opposite the angle to hypotenuse of the triangle
where...
Cosine of an angle - abbreviated as cos - is a ratio of side
adjacent to the angle to hypotenuse of the triangle DD = Decimal degrees
D = Degrees
-
Tangent of an angle - abbreviated as tan a ratio of side
is
M = Minutes
opposite the acute angle to the side adjacent = Seconds
S
ondary key function. Just enter the ratio of the function: than isolating the fractional part of the number in three
steps. For example, in order to convert 29.545021° to de-
If ... tanA = a / b
Then ... A = arctan (a / b) 0.545021 x 60 = 31.701126 = 32'
Or... A = tan 1
(a / b)
The third and final step is to take the decimal portion of
the last result, and multiply it by sixty to get seconds:
While there is only a single result for each trigonometric
function, there could be several results for the inverse func-
tion. For example, absolute value of 0.707106781 is the 0.701126 x 60 = 42"
seconds to describe the precision of angular degrees re- The well known work of the ancient Greek mathemati-
quired. There are two methods of dimensioning angles in a
cian Pythagoras (6th century B.C.), known today as the Py-
drawing. The older and method is the angle designation in thagorean Theorem, is taught and emphasized fairly early
in a high school mathematics classes. This mathematical
DMS or D-M-S, which means degrees-minutes-seconds.
The modem methods are associated with CAD drawings theory relates to the solution of right triangles and states:
The last two charts show formulas for calculations of the In this chapter, only the most important and commonly
chord C or the tangent T of a
Trigonometric formu-
circle. used mathematical subjects have been presented. Many
las can be used as well, but the formulas can make the same more solutions and shortcuts are used by programmers and
calculations faster. With only one exception, there are two operators every day, showing their ingenuity in solving
solutions, dependent on the available data. The formulas math problems. Author will appreciate any formula, short-
can also calculate the radius R, angle A and the deviation d. cut or a solution to any programming problem, and will be
Calculations relative to the chord of a circle are shown in considered for the next edition of this handbook.
Figure 52-23. Calculations relative to the tangent of a cir-
cle are shown in Figure 52-24.
Figure 52-23
Figure 52-24
gramming for CNC machines it is not dead yet and will not gramming against computer programming and vice versa.
What is necessary to promote is the knowledge and under-
disappear anytime soon.
standing of manual programming principles. Without such
The first reason is that in manual programming, the pro- knowledge, one can not become a good CNC programmer.
grammer is able to do what computers cannot - and never
will be - programmers can think. Manual programming
Most of the CNC programming can be done quite well on
personal computers. The existing technology is progress-
teaches the invaluable lessons of discipline - a very impor-
tant quality of a professional CNC programmer. Discipline ing very rapidly and many 2D and 3D programming appli-
cations are available for a fraction of the cost when com
means to concentrate, to constantly evaluate, to make deci-
pared to just a few years ago. This trend will continue well
sions - to think all the time. In manual programming, there
into the future.
is a total, absolute and unequivocal control over the final
product - the part program. Only a programmer can evalu-
Desktop Computer Programming
ate a given situation, analyze the problem and adapt to un-
foreseen circumstances. Only a programmer can feel that The complete computer system - that means the hard-
something may not be right. Only people use instruments ware, software and peripherals suitable for CNC
- pro-
known as thinking process, intelligence, instinct, gut feel,
gramming changing at such a rapid pace that any in-
is
common sense and experience. Those are instruments in-
depth discussion of the hardware would be obsolete in a
herent to humans, not computers. CNC programming is
matter of weeks. Almost the same speed of obsolescence
like the work of an artist - it can never be fully automated.
applies to software as well. New features, new capabilities,
483
484 Chapter 53
chine shops. Others are unique to a particular type of manu- existing CNC
machines and existing machining methods
facturing and the kind of work or the product manufac- and practices. This rather narrowly focused approach is not
tured. The following short list itemizes the major groups always successful. Consider future plans in both strategies
that a typical computer based CNC programming system and capital investment. What about the product? How will
should have: the product change in five years? Knowing the philosophy
and focus of the company, its policies and management
Tool path geometry creation environment strategies and yes - even its politics - will help to make a
Complete programming environment The computer technology has grown a lot, yet it is so new
Most CNC programming systems require a tool path ge- fered. but it is important to select a CNC software devel-
ometry creation before the actual path of a cutting tool can oped by a solid and well established company that has the
be generated. The key words here are tool path geometry. A best chance to be still in existence when the need to update
a system comes up. The computer industry is very active,
common misconception among programmers is that they
and mergers, acquisitions and takeovers are as common as
have to re-create everything in the original drawing. That is
wrong approach. bankruptcies and failures.
a
Associative operations for flexible editing When a tool path is developed, it is attached to the previ-
ously defined tool path geometry. For many reasons, it is
Job setup and material blank definition
not unusual to change the tool path geometry later. The tra-
Tooling list and job comments (setup sheets) ditional method has been (and for many software vendors
still is) to recreate the geometry, then recreate the tool path.
Connection between computers
(communications feature)
Associative operation avoids the creation of a new tool
Program text editor (with CNC oriented features) path, it updates it and accurate. It
automatically. It is fast
Support for solid modeling Job setup is a feature that describes the material blank of
the part - its shape, dimensions, zero origin, and many other
Software specifications and features related items. Toolsand related speeds and feeds can be of-
(including customizable post processing)
ten selected from the job setup, as well as various program
Support for generally available hardware parameters. Libraries that store common data for tools, ma-
terials and operations are also powerful software features.
Utilities and special features, open architecture
cannot be used for lathes, machining centers or EDM. for many materials and the programming software will cal-
culate the exact spindle speed and feedrate, based on the
Dedicated software is often developed for a rather narrow tool selected. This is a good example of interaction be-
and very specialized field of applications or when it applies tween the tool library and material library.
to a particular machine only. CNC punching, forming and
press brake equipment are good examples of such software. Connection Between Computers
The integrated software allows the programmer selection A programming system should also include a connection
of several types of machine tools. Such a selection usually (communications option) between the personal computer
offers milling, turning and wire EDM. It is also common to and the CNC machine. This feature allows the program
use the software for machines such as burners, routers, la-
data exchange via a cable. Programs can be sent from the
ser cutters, waterjets, and profilers. For metal cutting, this is
computer to the memory of the CNC machine and back.
the preferred type of software.
An is that not all CNC machines have the
important point
Another reason also speaks clearly in favor of integrated port (outlet) and the capability to take advantage of direct
software, and that is its interface. It is much easier to get connection. Even if all machines in the shop have this capa-
used to one display for a lathe work and have the same dis- bility, it requires additional hardware and organizational
play for a milling work or an EDM work. The software discipline to make all elements work in harmony. The exis-
menus look the same, the navigational operations share tence of a direct connection in a programming software is a
common menu items, the customization of the software must, even if it is not used immediately after the purchase.
(including post processors) is much simplified.
486 Chapter 53
A CNC program generated by the software should be Pen plot will usuallyproduce image quality superior to
100% complete and ready for use by the machine. The im- the printer plot but for a CAM
programming it is an unnec-
plication is that such a program is so perfect that it needs no essary luxury. The only time when a pen plotter can be ben-
further editing. This is way it should hap-
the ideal way, the eficial is for plotting to paper size that is not supported by
pen. If a change in the program needed, it should be done
is standard printers. Other reasons will be the need for a color
within the design of the part shape and that means through output, a special requirement by customers, or special doc-
the CNC software - not outside of it. The reason is that any umentation development. Before the graphics software ap-
manual change to the generated program does not corre- peared on the market, plotters were widely used to verify
spond to the program data as generated by the computer. In the tool path. Now, the tool path is on the
verified directly
the environment where the data is shared by many users, computer display screen, during interactive programming
such a practice will cause a lot of problems. process, including different views and zooms.
That brings up a question - why does a CNC software Most HPGL compatible. HPGL is an acro-
plotters are
have a built-in text editor? There are two reasons. One, the nym Hewlett-Packard Graphics Language and is cur-
for ,
editor can be used for creating or modifying various text rently the most supported plot file exchange formal.
files such as setup sheets, tooling sheets, operation data,
post processor templates, configuration files, special in- CAD Software Access
structions, procedures, etc. These
can be updated and
files
otherwise modified as required, without a damage to the If an engineering drawing is generated by a soft- CAD
ware, all drawing information is stored in a computer data-
program database. The second reason is that in some spe-
base. This database can be accessed by several program-
cial circumstances, a CNC
program can be edited outside
of the computer model, providing the change docs not ming software packages, through a file format translation
modify significant data. For example, to add a missing (more on the subject later). Once the CNC software
utility
coolant function M08 to the part program is much faster accepted and processed the database from the sys- CAD
tem, the CNC programmer can concentrate on generation
done in the text editor, than repeating the program generat-
ing process with the computer. Purists are right, it is not the
of the tool path itself, rather than defining the tool path ge-
right way of using the text editor, but at least the significant
ometry from scratch. Some modifications are usually nec-
data (tool locations) are not tampered with and the database
essary, so expect them. The most significant advantage of a
Any text saved into a file, CNC programs included, can CAD system - the tool path geometry and the tool path it-
be printed using a standard printer. The paper copy is often
self can be developed from within the software, inde-CAM
pendently of other software.
necessary as a reference for the CNC operator, for stored
documentation, or just for convenience. The printer does
not need to be top of the line, just one with a standard paper
Support for Solids
width. Some programming software supports an option
Solid modeling for 3D applications had been for a long
that is known as a printer plot or a hard copy. Hard copy is a
time the domain of large computer systems. With the ad-
graphic image of the screen transferred to the printer. The vance of powerful microcomputers, solid modeling is now
image quality is usually more than adequate. This hard part of high level CNC software.
copy an excellent aid during program development stage.
is
Better quality printer provides better quality print plot. The With solid models, the machining process of complex
printer support is provided by the Windows environment, surfaces is much more streamlined. In addition, solid mod-
as most PC based CAM software is developed for the Win- of supplying engineering data, easier
els offer the benefits
dows operating system. manipulation of objects, and many other features.
CNC AND CAD/CAM 487
Another benefit of a high level CNC software is that it Data is stored in the computer in two forms - memory
comes well supplied with a variety of useful features. What storage and disk storage (file). When an application such as
makes each system unique, is usually the method of how CNC programming is started, the CAM software is loaded
the programming process is executed. In the early years of into the computer memory. The more powerful the applica-
development, programming was done by using special pro- tion software, the more memory it requires. This memory is
gramming languages, such as APT™ or Compact II™. known as Random Access Memory usually called RAM.
,
geometry, typically as the tool path geometry, followed by when the application is ended or the computer power is in-
the tool path itself. Any error in the process is immediately terrupted. To save important data from RAM
into disk files,
displayed on the graphic screen and can be corrected before a hard disk or similar media can be used. For a micro com-
too much other work is done. puter CAD/CAM work, the absolute minimum require-
ment is high density removable drive and one large size
Hardware Specifications hard drive. Floppy drives of any kind are not suitable.
Specification of the software will determine the hardware The hard drive should have a fast access time and a high
selection. Hardware is common
term for the computer,
a storage capacity. Another option is a tape drive, CD-R and
monitor, keyboard, printer, modem, plotter, mouse, scan- CD-RW disks or recordable DVD disks for backup.
ner, disk drive, storage media, CD writer, and many others.
The hardware referred to in this chapter is based on the Input and Output
Windows ™ operating systems. Modern operating systems Input and Output (I/O) computer features, cover hard-
are based on a graphical user interface ( GUI). Some soft-
ware items such as monitor, graphic card, keyboard, digi-
ware can run under a different operating system, for exam-
tizer, scanner, printer and plotter. Monitor suitable for
pleUnix (used mainly by workstations) or different Win-
dows versions. It is always to the advantage of the user that
CAD/CAM work should be a large size color monitor pro-
viding very high resolution. The monitor and the graphic
the latest version of the operating system and the CAM card do relate to each other. The card must be able to gener-
software is installed on the computer.
ate the image, the monitor must be able to display the im-
When thinking of purchasing a computer hardware, con- age. Speed of the video output is also very important.
sider carefully at least three major criteria:
A keyboard is a standard feature of a computer and serves
Performance ... computer speed as a basic input device. Mouse (or a digitizer on larger sys-
tems) are also input devices, but much faster than keyboard
Data storage ... type and size
input. In CAD/CAM, where a lot of work is done in graphic
Input /Output ... ports mode under a menu system, the item from the menu is user
selected. Inmost cases can be selected with a pointing
it
Performance of the computer system is typically mea- pointing device most suitable for CAM
work in the Win-
sured by the relative speed of the main processor. The
dows environment is a mouse.
chip (generally Intel 80386 or 80486) and reached 25Mhz, All peripherals are interfaced with the computer using
33Mhz and more. Pentium processors followed, and the specially configured cables connected to the Input/Output
process is ongoing. Chips in thousand plus MHZ speed are (I/O) outlets called ports. The modem is normally not re-
a reality. For serious CAD/CAM work, the latest fully fea- quired for CNCprogramming, except for data exchange
tured processors should be used. Newest processors offer with a remote computer or Internet access. The laser or ink
much higher processing speed, and the more processing jet printers generally use a parallel interface known as the
speed is available, the better performance of the CNC pro- Centronics standard, but many other devices use a serial in-
gramming system. terface. There are also other I/O options, such as the USB
(Universal Serial Bus) interface.
488 Chapter 53
Currently, the most popular hardware for CNC program- Even the most updated version of the operating system is
ming Windows based computer system. It is not possi-
is the never as powerful and flexible as many users would like it to
ble to make a simple ‘shopping list' for all hardware require- be. For that reason,many software developers came up with
ments that every CNC machine shop can use. Here are some thousands of programs and utilities that supplement
literally
mles applicable to any system and are not subject to becom- the readily available features. Many of these utilities are
ing outdated very quickly. A typical list of minimum hard- available as shareware or freeware from the Internet and
ware requirements and options may be compiled: other sources. Access to the Internet and the World Wide
Web provides a great source of CNC and machine shop re-
Hardware compatibility with IBM (Windows based)
lated topics and general information. These utilities are not
- Apple computers havevery limited CAD/CAM applications
necessary to use a CAM software, but they are a great time
The latest version of the Windows operating system saver for many tasks associated with using a computer.
(must be supported by the CAM software)
Fast memory cache CNC software must be able to output a program in a for-
mat unique to each control unit. The most important part of a
The requirement of a numeric (math) co-processor
tool path generation is the data integrity. The computer gen-
(normally part of the higher end processors)
erated program must be accurate and ready for the CNC ma-
Random Access Memory (RAM) - as much as possible chine. That means the completed program should require no
editing, no optimization, no merging with other programs or
Enough of hard disk space for program and data storage
similar manual activities. Such a goal can be achieved only
(measured in gigabytes or higher - with a fast access time)
by a well developed programming style - and a properly
Backup system for data protection configured post processor for each different CNC machine.
(tape cartridge, removable drive, CD, DVD, ...)
CD or DVD drive & various multimedia features Typically, a supplied post processor more or less ge-
is
IMPORTANT FEATURES Also important is the representation of the tool path for
lathe tools. Many cutting tools for a CNC lathe have a back
angle. A
high quality software should also evaluate the tool
There are several important features to look into when in-
back angle in its calculations and in the display.
vesting into a CNC programming software. They do have
an impact on the final functionality of the program, at the
CAD Interface
machine level. All these features arc important and should
he considered carefully. A stand alone CNC programming system does not need a
CAD software for the geometry definitions. can create its It
Input from User own. Yet. in a any CAD/CAM system is important to have
the option of impoi ting part geometry from a CAD system.
One of the important features of a CAM programming
Even if a company does not need CAD, it should be pre-
software is its ability to handle input from the user. This in-
pared to accept its files, perhaps from customers or com-
put can be a special sequence of commands that cannot be
pany branch offices.
handled by the post processor at all. or would require too
much effort. These commands are usually small in size and Needless to say, if a CAD software is not available, the
can be called and used in the graphics mode whenever re- computer cannot not accept the drawing files generated by
quired. Examples of such applications are a barfeeder se- such a software. These files are proprietary and their struc-
quence on a lathe or a pallet changing routine on a horizon- ture is not a matter of public access. Therefore, there must
tal machining center. If the software supports some type of be another way to interchange drawing files. There is an-
variable type of user commands, it adds an extra flexibility other way - use a different file format.
and power to the system.
File Exchange Formats
Machining Cycles
The need to exchange design files between different soft-
Another very important feature of a CAM software is its ware systems has always been a prime requirement. There
ability to generate a variety of fixed and repetitive cycles, are many competing formats of a neutral file format. The
that modern controls support. These cycles make a manual oldest of them is called IGES (Initial Graphics Exchange
programming simpler and faster. The modern CNC sys- Specification), originally developed to transfer complex
tems take advantage of such cycles are available with a lim- design files from one software to another. Another format
ited memory capacity. For that reason, support for such cy- that is also used, is the DXF format by Autodesk™.
for milling applications, and the shape of a turning tool for CNC software developer, therefore it is a subject to change.
CNC lathes. This tool image shows the current tool posi-
tion, valid for the processed program section. Normally, the SUPPORT AND MANAGEMENT
graphic image moves along the contour, without leaving
any traces. A variation is that the tool will remain at the
contour change points only, but nowhere else. This is called
Hardware and software for CNC programming work can
be costly. can represent a significant investment of money
It
static display and is very important for some machining op-
and people and can become a total failure if it is not used
erations. Premium CAM software also allows to design a
properly.A failure is not the actual loss of the hardware and
customized tool shape, including the tool holder and use it
software cost. The real and heaviest loss is in the increased
on the screen to simulate actual tool path. Shaded 3D tools
productivity, speed and quality that was expected but never
add even more realism to program viewing.
materialized. The loss is also in the confidence the com-
490 Chapter 53
pany employees put into the technology. These losses can System Management
be high. To prevent such prospects, keep three key elements
A reliable operation of all system elements is crucial to
in mind when planning a CNC programming system:
the success of CNC software. Use of any software requires
High quality training program for long term skills good organization, it needs strategies, it needs focus, and it
definitely needs a professional management. System man-
System management philosophy and strategies
agement establishes standards and procedures for CNC and
Technical support for hardware and softvyare related operations. Concerns about people selection, data
backup methods, confidentiality and security, work envi-
No single item in the list is any more important than the ronment quality etc., are not confined to a single discipline
,
others - they are all equally important. and should be important in the overall company culture.
Training should be planned, thorough, and professional. Technical support is an important part of the system man-
Many successful programs apply three levels of training. agement. A
service contract or a support package can be
Some companies do not place enough emphasis on train- usually negotiated with the vendor, covering installation,
ing, despite many studies and examples proving that good hardware, update policies, new developments, etc. An im-
quality training does work. The lack of time and perceived portant part of technical support is the speed and reliability
high costs are often used as excuses. Training is a necessary of handling emergency situations. If a hard disk fails - and a
investment for any company that wants to be competitive. data back up does exist - what can be done? The CNC shop
is waiting for the critical job, while the programmer cannot
Training level 1
send program data to the machine, because an inexpensive
Th c first level of training should be aimed at the person hard disk failed. Support should cover both the hardware
with none or very computer experience. It should in-
little
and software. All support promised by the vendor should
troduce the CNC software to the programmer who pro- always be written down. Know exactly what the bill is for.
grams manually. It should be an overall training, mainly Ifsomething isn 't in the contract, it usually isn 't available.
general in nature, with the emphasis on the system features
and capabilities - as they relate to the company where the THE END AND THE BEGINNING
software is installed. The typical general approach should
be balanced by explaining the philosophy behind the soft-
future of CNC technology holds is always hard
What the
ware design, and the structure of menus and commands. It
to predict.There are many indications where the technol-
is very important to show the student what the software can
ogy will be going. System controls with more computing
do in skilled hands. The first level should be done when the
power, more standardized approach to programming, more
software is purchased. The objective is to give the program-
solid modeling, more 3D, better storage methods, etc., are
mer enough tools to play with the software, to grow into it.
in the works. Changes are also inevitable in work skills.
A simple way to achieve this goal is to try out simple proj-
ects while still programming manually the important jobs. Stand aloneCNC machines will always be needed. On
Training level 2
the CNC machining centers, there will be much more em-
phasis on faster machining rates. On the CNC lathes, the
The second level is most beneficial two or three weeks af- natural way of development would be to adapt the tool in-
ing to the machining operations used locally. This training features that eliminate secondary operations, such as com-
level eliminates manual programming, and marks the be- plex milling features on lathes and built-in part indexing.
ginning of a new era. Supervisors should evaluate the com-
Predictions for computers are difficult at best, except that
plexity of the first few jobs to be programmed and select, if
theirpower will increase. Hardware has developed at a
possible, the less difficult jobs to build a little confidence.
higher rate than software and this will not change soon.
Training level 3 CNC software is no exception. The winner of the competi-
tive race will be the one that can combine hardware, soft-
The third level is usually done 2-3 months later. It covers ware and people, makes a product for a reasonable price
problems, questions, difficulties and concerns, introduces and markets it across the world. The protectionist economy
tips, shortcuts, etc. The purpose of this level is to create a does not work, and trading will not be confined to several
long term confidence. At this stage, the programmer has ‘local’ blocks - it will be a part of the true global economy.
many questions. Professional instructor can answer all Before too many personal opinions force their way out, it is
questions, weed out bad habits, and offer further guidance. time to end and say "Learn, work, and then team again".
REFERENCE TABLES
Decimal Equivalents
Decimal inch Fraction Number / Letter Metric (mm)
.0335 0 85
The following chart lists fractional, wire gauge (number), .0350 65
letter and metric (mm) values for given decimal equivalents .0354 0.90
in inches. .0360 64
.0110
.0115
.0118
.0120
25
.0126
.0130
492 Appendix
Appendix 493
Decimal inch Fraction Number / Letter Metric (mm) Decimal inch Fraction Number / Letter Metric (mm)
.2854 .4688 15/32
494 Appendix
All tap drill sizes in the following tables are based on the Thread-TPI Tap Drill Size Inch equivalent ic alternative
9/16-18 33/64 .5156 13.00
approximate full thread depth of 72-77% of nominal.
9/16-24 33/64 .5156 13.00
5/8-11 17/32 .5313 13.50
English Threads - UNC/UNF 5/8-12 35/64 .5469
5/8-18 37/64 .5781
5/8-24 37/64 .5781
Thread-TPI
11/16-12 39/64 .6094
#0-80
11/16-16 5/8 .6250
1/16-64
11/16-24 41/64 .6406
#1-64
3/4-10 21/32 .6563
#1-72
3/4-12 43/64 .6719
#2-56
3/4-16 11/16 .6875
3/4-20 45/64 .7031
3/4-28 23/32 .7188
13/16-12 47/64 .7344
13/16-16 3/4 .7500
7/8-9 49/64 .7656
7/8-12 51/64 969
7/8-14 13/16 .8125
7/8-16 13/16 .8125
7/8-20 53/64 .8281
15/16-12 55/64 .8594
15/16-16 7/8 .8750
15/16-20 57/64 .8906
1-8 7/8 .8750
1-12 59/64 9
1-14 15/16 .9375
1-20 61/64
1 1/16-12 63/64
1 1/16-16 1.0
1/4-18
3/8-18
Vi- 14
3/4-14 6
1-11 Vi 1 3/16
1 1/4-11 Vi 1 33/64
1 Vi-11 Vi 1 3/4
2-1 1 Vi 2 7/32
27 1/4 .2500
27 .3438
18 7/16 .4375
18 37/64 .5781
14 23/32 .7188
14 59/64 .9219
Taper Pipe Taps NPT Nominal 0 x Pitch (mm) Tap Drill 0 (mm) Inch equivalent
MIOxl.5 8.50 .3346
Mil x 1.5 9.50 .3740
Tap Size Tap Drill 0 (in M12x 1.75 10.20 .3937
1/16-27 D M14 x2 12.00 .4724
1/8-27
M16 x2 14.00 .5512
1/4-18
M18 x 2.5 15.50 .6102
3/8-18
M20 x 2.5 17.50 .6890
Vi-14
M22 x 2.5 19.50 .7677
3/4-14
M24 x 3 21.00 .8268
1-11 Vi
M27 x 3
1 1/4-11 Vi
M30 x 3.5
1 Vi-1 1 Vi
2-11 Vi
^
M4.5 x 0.5 4.00 .1575
M5 x 0.5 4,50 .1772
M5.5 x 0.5 5.00 .1969
M6 x 0.75 — 5.25 .2067
1/8 27 Q .3320 21/64 .3281
M7 x 0.75
M9 x 1
3/8 .5781 9/16 .5625
M10 x 0.75
’/a
[9121 .7031 11/16 .6875 M10
M10
x 1
x 1.25
3/4 14 29/32 .9062 57/64 .8906
Mil x 1
1.0 11-1/2 1-9/64 1.1406 1-1/8 1.1250
M12 x 1
11-1/2 1-31/64 1.4844 1-15/32 1.4688 M12 x 1.25
M12 x 1.5
1-1/2 11-1/2 1-47/64 1.7344 1-23/32 1.7188
M13 x 1.5
2.0 11 -1/2 2-13/64 2.2031 2-3/16 2.1875 M13 x 1.75
M14 x 1.25
M14 x 1.5
Metric Coarse Threads M15 x 1.5
M16 x 1
Nominal 0x Pitch (mm) Tap Drill 0 (mm) Inch equivalent M16 x 1.5
Mi x C.25 M17 x 1.5
Ml. x 0.25 M18 x 1
Ml. x 0.3 M18 x 1.5
Ml. x 0.35 M18 x 2
Ml. x 0.35 M20 x 1
Ml. x 0.35 M20 x 1.5
M2 x 0.4 M20 x 2
M2. x 0.45 M22 x 1
M2. x 0.45 M22 x 1.5
M3 x 0.5 M22 x 2
M3.5 x 0.6 M24 x 1
M4 x 07 M24 x 1.5
M4.5 x 0.75 M24 x 2
M5 x 0.8 M25 x 1.5
M6 x 1 M27 x 2
M7 x 1 M28 x 2
M8 x 1.25 M30 x 2
M9x 1.25 M30 x 3
496 NOTES
Selective block skip 170
Index
.
.
... .164
.223
A Boring operations
Backboring cycle G87
Block tools
Boring tools
... .203
204
130
Absolute data input . 70-73. 308. 430 Precision boring cycle G76 ... 203
Acceleration and deceleration .... 88 Single point boring 202
Additional axes . .... 18 Tool shift 203
Address format . . . .
43-44 Boss milling 242
Air cutting . . . 165
....
.
Alpha-numerical input 41
APC . . 437-439
....
.
Automatic tool change . 8. 60. 95-96. 149. 155 CAM software ... 483
ATC cycle ... 98 Complete programming environment . . . 484
First tool in the spindle inn Desktop computer programming . 483
....
.
....
.
...
.
...
.
Character . . . 41
Block format .
. . 63 Full circle programming 240, 244
Block numbering .
. . 63 Lead-in and lead-out path .
. 243
497
498 Index
Lathe axes 11
Machine axes 8
Milling 7
Six-axis lathe 13
Three-axis lathe
Turning centers and lathes
Two-axis lathe
... 12
11
12
...
. . 386
75
Running the part 459 Decimal point programming
Safety issues
first
...
.
.... ...
.
CSS .
. 82, 305 Peck drilling . .
...
. 21,143
Programming format .
... 253 Minimum dwell .
. . 173,207
250 Safety issues . 176
Programming techniques . .
...
. . .
...
.
.... ...
.
Cutting mode 90
Cutting tool animation ... 30
Index 499
Absolute and incremental applications 180 G82 spot drilling cycle . 183
177 G83 peck drilling cycle 184
Basic format structure .
L0 parameter
Plane selection
... 181
190
274
G89
boring cycle
boring cycle
.312
88
G-codes 47-52
Conflicting commands . 50
....
. .
Group numbers 51 21
Keyboard
Milling applications 47
Modal commands .... 50
Turning applications 49
Types of G codes .
52
Helix 4 ’9 160
Programming format .
. .
I
MOO function . 56
M01 function 57
IGES files ... 33
M02 program end function . 58
Incremental data input 70, 72, 308. 430 59, 79
,
M03 function .
429-436 80
Indexing table .
In-process gauging 30 58
.
. . .
M07 function .
69-76, 429 58
Input of dimensions .
M08 function
...
. . .
Input format 73 58
M09 function . .
M10-M11 functions.
Inscribed circle 474 411
. . .
Ml 2-MI 3 functions.
Interfacing to devices 465-470 410
. .
M15-M1 6 functions.
Connecting cables 470 412
. . .
M17-M18 functions. .
469
Data setting .
M21-M22 functions.
Punched tape .... 466
M23-M24 thread finishing functions 60. 357
RS-232C interface 465, 467, 469 58
M30 program end function . .
M48-M49 functions
...
. . .
. .
. . . .
M98-M99 subprogram functions . . . 58, 60. 368, 375, 462 Programming functions . 396
37,81 Miscellaneous functions 13, 53-60
Machinability rating
Machine accessories 60 Application in a block 55
M-codes 53-60
MDI functions . . 54
M-function duration . 56
Milling applications 54 Pallet changer . . . .
429. 437
Turning applications .
54 Parameters. 22. 389
21,26, 389 Parsons, John
....
.
81 Programming formats 42
speed
.
Peripheral spindle . .
....
.
....
.
269-270
274 Pythagorean Theorem 161,480
Machining in planes
Mathematical planes .
. . 269
Selection of planes 226, 269-274
....
.
Circular pockets .
. . 289
Rectangular pockets .
. . 285
Position compensation .
. 119-122
Programming commands .
. . 119
Z-axis . . 122
Lathes .
. . Rapid positioning . . . . .
....
.
Program end .
. . 58 Fixed point 108
Documenting a program .
. 448 Tool reference point .
112
Program stop . .
56
Avoidance of errors .
. . 454
Programming forms . .
442 Scaling center 406
....
.
Setup sheet . .
. . 38. 449-450 Simulation method . 426
Similar triangles 478 Tapered thread 425
Single block 21. 25 Threading 339-366
Slash symbol 163 Block-by-block threading 348
Slot drill 197 Depth of thread 342-343. 360-361
100 000 000 hole grid 379 Tool length offset . . . 126,131-142.387
Development strategies .... 373 Cancellation 141
T Tool magazine
Tool memory
Fixed type
type
.... ......
8, 93
94
94
Random memory type . .
External tooling .
117 Word address format 42
Tooling sheet .
449-450 Word 41
Trial cut .
168 Work area 31
Trigonometric table .
481 Work coordinate system 123-130
Trigonometry .
477-481 Work offsets 123-130,386
Turning tools .
130,293 Defaults 174,386
Turret indexing .
412 External offset (0a) 128,387
G54-G59 commands 1 23- 1 30. 386
Z-axis neglect 28
W-axis 10
By Peter Smid
version 1.0
Minimum System
Requirements:
(0 2(WH Industrial Press Ini Window s OX or Itighei
and their licensors. CD includes
All rights reserved. Aerobal Reader v 5
Industrial
l>ress
iMadeintheUSA
n
k by Peter Smid fills the void for the intelligent reader who craves to
id the simplistic concepts regurgitated in so many other books." — Toronto,
; read close to 20 books on CNC programming and can honestly say that this is the
it has covered both basic and advanced programming techniques for both mills and la
— Houston, Texas, USA
"A superb book, very well written, easy to understand, and should be on the desk of every
CNC Programmer and Production Engineer." Nottingham, England —
Extraordinarily comprehensive, this popular and authoritative reference covers just about every
possible subject a typical CNC programmer may encounter on a daily basis. Fully indexed to
help the user quickly locate topics of interest, this "industrial strength" handbook presents most
common programming subjects in great depth and is equally applicable to both CNC milling
and CNC turning operations. Many advanced subjects are also covered, thus making this an
unusually comprehensive reference for machinists, programmers, engineers, and supervisors.
Filled with over one thousand illustrations, tables, formulas, tips, shortcuts, and practical
examples, this widely respected publication is structured in a logical order that is readily adapt-
able to virtually all levels of CNC training, from the basic to the advanced.
V
CNC Programming Handbook has just become more valuable than ever! A new
CD-ROM, packed with actual problem-solving projects and enhancing the
1
material presented in the book, is included for the first time. Users will find pro-
gramming projects and exercises for most chapters, special programming and
machining projects, solutions to problems, and numerous reference files useful in
CNC programming, as well as several utilities. With the majority of files in Adobe PDF, instruc-
tors will be able to quickly and easily print and distribute any of the projects, exercises, and
references to their classes. Meanwhile, students and professionals will find this CD an effective
self-study aid that allows them to enhance their understanding of the subject one topic at a time.
I le consults for both manufacturers and educational institutions on the practical use of CNC
technology, part programming. C AD CAM. advanced machining, tooling, setup, and many other
related fields. I lundreds of organizations have used his scrv ices and benefited from lus wide-ranging
industrial background in CNC programming, machining, and company-oriented training.