0% found this document useful (0 votes)
282 views529 pages

CNC Programming Handbook - Text

Uploaded by

Nicolas Fiumara
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
282 views529 pages

CNC Programming Handbook - Text

Uploaded by

Nicolas Fiumara
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 529

Second Edition

CNC
Programming
Handbook

Second Edition
CNC
Programming
Handbook
Second Edition

A Comprehensive Guide to Practical CNC Programming

Peter Smid

Industrial Press Inc.


989 Avenue of the Americas, New York, NY 10018
http://www.industrialpress.com
Library of Congress Cataloging-in-Publication Data

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.

TJ1189 .S592 2000


621.9’023— dc21
00-023974

Second Edition

CNC Programming Handbook

Industrial Press Inc.


989 Avenue of the Americas, New York. NY 10018

Copyright © 2003. Printed in the United States of America.

All rights reserved.

This book or parts thereof may not be reproduced, stored in a retrieval

system, or transmitted in any form without the permission of the publishers.

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:

• FANUC and CUSTOM MACRO or USER MACRO or MACRO B


are registered trademarks of Fujitsu-Fanuc, Japan

• GE FANUC is a registered trademark of GE Fanuc Automation, Inc.,


Charlottesville, VA, USA
• MASTERCAM is the registered trademark of CNC Software Inc.,
USA
Tolland, CT,

• AUTOCAD is a registered trademark of Autodesk, Inc.,


San Rafael, CA, USA
• HP and HPGL are registered trademarks of Hewlett-Packard, Inc.,

Palo Alto, CA, USA


• IBM is a registered trademark of International Business Machines, Inc.,

Armonk, NY, USA

• WINDOWS is a registered trademarks of Microsoft, Inc.,


Redmond, WA, USA
About the Author
Peter Smid is a professional consultant, educator and speaker, with many years of practi-
cal,hands-on experience, in the industrial and educational fields. During his career, he has
gathered an extensive experience with CNC and CAD/CAM applications on all levels. He
consults to manufacturing industry and educational institutions on practical use of Com-
puterized Numerical Control technology, part programming, CAD/CAM, advanced ma-
chining, tooling, setup, and many other related fields. His comprehensive industrial back-
ground in CNC programming, machining and company oriented training has assisted
several hundred companies to benefit from his wide-ranging knowledge.

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

MANUAL PROGRAM INTERRUPTION. ... 25


Single Block Operation 25
2 - CNC MILLING 7 Feedhold 25
Emergency Stop 25
CNC MACHINES MILLING - 7 MANUAL DATA INPUT MDI - 26
Types of Milling Machines 7 PROGRAM DATA OVERRIDE 26
Machine Axes 8
Rapid Motion Override 26
VerticalMachining Centers 8
Spindle Speed Override 27
Horizontal Machining Centers 9
Feedrate Override 27
Horizontal Boring Mill 10
Dry Run Operation 27
Typical Specifications 10
Z Axis Neglect 28
Manual Absolute Setting 28
Sequence Return 28
3 -CNC TURNING 11 Auxiliary Functions Lock 28
Machine Lock 28
CNC MACHINES -TURNING 11 Practical Applications 29
Types of CNC Lathes 11 SYSTEM OPTIONS 29
Number of Axes 11 Graphic Display 29
AXES DESIGNATION 11 In-Process Gauging 30
Stored Stroke Limits 30
Two-axis Lathe 12
Drawing Dimensions Input 30
Three-axis Lathe 12
Machining Cycles 30
Four-axis Lathe 13
Cutting Tool Animation 30
Six-axis Lathe 13
Connection to External Devices 30
FEATURES AND SPECIFICATIONS .... 13
Typical Machine Specifications 13
Control Features 14 - PROGRAM PLANNING 31

STEPS IN PROGRAM PLANNING 31


- COORDINATE GEOMETRY 15
INFORMATION
INITIAL 31

REAL NUMBER SYSTEM 15 MACHINE TOOLS FEATURES 31


Machine Type and Size 31
RECTANGULAR COORDINATE SYSTEM . . . 15

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

Tolerances 35 G CODE TYPES 52


35
7 Surface Finish G Codes and Decimal Point 52
Drawing Revisions 36
Special Instructions 36

METHODS SHEET 36 - MISCELLANEOUS FUNCTIONS 53


MATERIAL SPECIFICATIONS 36
Material Uniformity 36 DESCRIPTION AND PURPOSE 53
Machinability Rating 37 Machine Related Functions 53
MACHINING SEQUENCE 37 Program Related Functions 53

TOOLING SELECTION 38 TYPICAL APPLICATIONS 54


Applications for Milling 54
PART SETUP 38
Applications for Turning 54
Setup Sheet 38 Special MDI Functions 54
TECHNOLOGICAL DECISIONS 38 Application Groups 54
Cutter Path 38 M FUNCTIONS IN A BLOCK 55
Machine Power Rating 39 M Functions
Startup of 56
Coolants and Lubricants 39 Duration of M Functions 56
WORK SKETCH AND CALCULATIONS ... 40 PROGRAM FUNCTIONS 56
Identification Methods . 40 Program Stop 56
QUALITY IN CNC PROGRAMMING .... 40 Optional Program Stop
Program End
57
58
Subprogram End 58
- PART PROGRAM STRUCTURE 41 MACHINE FUNCTIONS 58
Coolant Functions 58
BASIC PROGRAMMING TERMS . 41 Spindle Functions 59
Character 41 Gear Range Selection 60
Machine Accessories 60
Word 41
Block 41
Program 42

PROGRAMMING FORMATS . . 42
10 -SEQUENCE BLOCK 61

WORD ADDRESS FORMAT . . 42


BLOCK STRUCTURE 61
FORMAT NOTATION . . . . 43 Building the Block Structure 61
Short Forms 43 Block Structure for Milling 61
System Format
Milling
Turning System Format
a PROGRAM IDENTIFICATION 62

Multiple Word Addresses


45 Program Number 62
Program Name 62
SYMBOLS IN PROGRAMMING . 45
SEQUENCE NUMBERS 63
Plus and Minus Sign 45
Sequence Number Command 63
PROGRAM HEADER . . . . 45 Sequence Block Format 63
TYPICAL PROGRAM STRUCTURE. 46 Numbering Increment 64
Long Programs and Block Numbers 64

END OF BLOCK CHARACTER 64


STARTUP BLOCK OR SAFE BLOCK .... 65
Table of Contents XI

PROGRAM COMMENTS 66 Exact Stop Command 89


CONFLICTING WORDS IN A BLOCK .... 66 Exact Stop Mode Command 89

MODAL PROGRAMMING VALUES .... 67


Automatic Corner Override
Tapping Mode
89
89
EXECUTION PRIORITY 68 Cutting Mode 90
CONSTANT FEEDRATE 90
Circular Motion Feedrates 90
1 1 - INPUT OF DIMENSIONS 69
MAXIMUM FEEDRATE 91
Maximum Feedrate Considerations 91
ENGLISH AND METRIC UNITS 69 14
Comparable Unit Values 70 FEEDHOLD AND OVERRIDE 91
Feedhold Switch 91
ABSOLUTE AND INCREMENTAL MODES . . 70
Feedrate Override Switch 91
Preparatory Commands G90 and G91 71 Feedrate Override Functions 92
Absolute Data Input - G90 72
Incremental Data Input - G91 72 E ADDRESS IN THREADING 92
Combinations in a Single Block 72

DIAMETER PROGRAMMING 73 - TOOL FUNCTION 93


MINIMUM MOTION INCREMENT 73
FORMAT OF DIMENSIONAL INPUT .... 73 T FUNCTION FOR MACHINING CENTERS . . 93
FullAddress Format 74 Tool Storage Magazine 93
Zero Suppression 74 Fixed Tool Selection 94
Decimal Point Programming 75 Random Memory Tool Selection 94
Input Comparison 76 Registering Tool Numbers 94
Programming Format 95
CALCULATOR TYPE INPUT 76
Dummy Tool
Empty Tool or 95
TOOL CHANGE FUNCTION -M06 95
12 -SPINDLE CONTROL 77 Conditions for Tool Change 95
AUTOMATIC TOOL CHANGER ATC - . ... 96
SPINDLE FUNCTION 77 Typical ATC System 96
Spindle Speed Input 77 Maximum Tool Diameter 97
13
DIRECTION OF SPINDLE ROTATION .... 77
Maximum
Maximum
Tool Length
Tool Weight
97
97
Direction for Milling 78 ATC Cycle 98
Direction for Turning 78
MDI Operation 98
Direction Specification 79
15
PROGRAMMING THE ATC 98
Spindle Startup 79
Single Tool Work 98
SPINDLE STOP 80
Programming Several Tools 99
SPINDLE ORIENTATION 80 Keeping Track of Tools 99
SPINDLE SPEED R/MIN - 81 Any Tool in Spindle- Not the First 99
First Tool in the Spindle 100
SPINDLE SPEED -SURFACE 81 No Tool in the Spindle 101
Material Machinability 81 First Tool in the Spindle with Manual Change .... 101
Spindle Speed - English Units 82 No Tool in the Spindle with Manual Change 102
Spindle Speed - Metric Units 82 First Tool in the Spindle and an Oversize Tool .... 102
No Tool in the Spindle and an Oversize Tool 102
CONSTANT SURFACE SPEED 82
Maximum Spindle Speed Setting 84 T FUNCTION FOR LATHES 103
Part Diameter Calculation in CSS 85 Lathe Tool Station 103
Tool Indexing 103

TOOL OFFSET REGISTERS 104


- FEEDRATE CONTROL 87 Geometry Offset 104
Wear Offset 105
FEEDRATE CONTROL 87 Wear Offset Adjustment 106
The R and T Settings 106
FEEDRATE FUNCTION 87
Feedrate per Minute 87
Feedrate per Revolution 88
- REFERENCE POINTS 107
FEEDRATE SELECTION 88
ACCELERATION AND DECELERATION ... 88 REFERENCE POINT GROUPS 107
xii Table of Contents

Reference Point Groups Relationship 108 TOOL SETUP 129


MACHINE REFERENCE POINT Center Line Tools 129
108
Turning
19 Tools 130
= e*um to Machine Zero 109
Boring Tools 130
PART REFERENCE POINT 109 Command Point and Tool Work Offset 130
program Zero Selection 109
Program Zero - Machining Centers 110
program Zero - Lathes 112 - TOOL LENGTH OFFSET 131
TOOL REFERENCE POINT 112
GENERAL PRINCIPLES 131
Actual Tool Length 131
16 - REGISTER COMMANDS 113 Gauge Line 131
Table Top Face 132

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

17 POSITION COMPENSATION 119


HORIZONTAL MACHINE APPLICATION ... 141
-
21
TOOL LENGTH OFFSET CANCEL .... 141

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

TYPE OF MOTION & TIME COMPARISON . . 146


WORK AREAS AVAILABLE 123
124
REDUCTION OF RAPID MOTION RATE . . . 147
Additional Work Offsets
RAPID MOTION FORMULAS 147
WORK OFFSET DEFAULT AND STARTUP . . 124
Work Offset Change 125 APPROACH TO THE PART 148
Z Axis Application 126
HORIZONTAL MACHINE APPLICATION 127
. . .
- MACHINE ZERO RETURN 149
EXTERNAL WORK OFFSETS 128
LATHE APPLICATIONS 128 MACHINE REFERENCE POSITION .... 149
Types of Offsets 128 Machining Centers 149
Geometry Offset 128 Lathes 150
Wear Offset 129 Setting the Machine Axes 150
Tool and Offset Numbers 129 Commands
Program 151
Command Group 151
Table of Contents xiii

RETURN TO PRIMARY MACHINE ZERO. . . 151 LONG DWELL TIME 175


Intermediate Point 151 Machine Warm-Up 175
Absolute and Incremental Mode 152 X Axis is the Dwelling Axis 176
Return from the Z Depth Position 153
25Safety and Dwell 176
Axes Return Required for the ATC 155
FIXED CYCLES AND DWELL 176
Zero Return for CNC Lathes 155
22
RETURN POSITION CHECK COMMAND. . . 156
RETURN FROM MACHINE ZERO POINT. . . 157 - FIXED CYCLES 177
RETURN TO SECONDARY MACHINE ZERO. . 158
POINT-TO-POINT MACHINING 177
Single Tool Motions vs. Fixed Cycles 178
- LINEAR INTERPOLATION 159 FIXED CYCLE SELECTION 178
PROGRAMMING FORMAT 179
LINEAR COMMAND 159
GENERAL RULES 180
and End of the Linear Motion 159
23Start
Single Axis Linear Interpolation 159 ABSOLUTE AND INCREMENTAL VALUES . . 180
Two Axes Linear Interpolation 160
INITIAL LEVEL SELECTION 181
Three Axis Linear Interpolation 160
R LEVEL SELECTION 181
PROGRAMMING FORMAT 160
Z DEPTH CALCULATIONS 182
LINEAR FEEDRATE
Feedrate Range
161
161
DESCRIPTION OF FIXED CYCLES .... 183
Individual Axis Feedrate 161 G81 - DrillingCycle 183
G82 - Spot-Drilling Cycle 183
PROGRAMMING EXAMPLE 162 G83 Deep Hole Cycle Standard 184
26 - Drilling -

G73 - Deep Hole Drilling Cycle - High Speed 184


G84 - Tapping Cycle - Standard 186
24 - BLOCK SKIP FUNCTION 163 G74 - Tapping Cycle - Reverse 186
G85 - Boring Cycle 187
G86 - Boring Cycle 187
TYPICAL APPLICATIONS 163
G87 - Backbormg Cycle 187
BLOCK SKIP SYMBOL 163 G88 - Boring Cycle 188
G89 Boring Cycle 188
CONTROL UNIT SETTING 163 -

G76 - Precision Boring Cycle 189


BLOCK SKIP AND MODAL COMMANDS . . 164
FIXED CYCLE CANCELLATION 189
PROGRAMMING EXAMPLES 165
FIXED CYCLE REPETITION 189
Variable Stock Removal 165
Machining Pattern Change 166 The L or K Address 190
Trial Cut for Measuring 168 LO or KO in a Cycle 190
Program Proving 169
Barf eeder Application 170
Numbered Block Skip 170 - MACHINING HOLES 191

SINGLE HOLE EVALUATION 191


- DWELL COMMAND 171 Tooling Selection and Applications 191
Program Data 194
PROGRAMMING APPLICATIONS .... 171
DRILLING OPERATIONS 194
Applications for Cutting 171
Types of Drilling Operations 194
Applications for Accessories 171
Types of Drills 194
DWELL COMMAND 171 Programming Considerations 195
Dwell Command Structure 172 Nominal Drill Diameter 195
Effective Drill Diameter 195
DWELL TIME SELECTION 172 Drill Point Length 195
SETTING MODE AND DWELL 173 Center Drilling 196
Through Hole Drilling 196
Time Setting 173
Blind Hole Drilling 197
Number of Revolutions Setting 173
Flat Bottom Drilling 197
MINIMUM DWELL 173 Indexable Insert Drilling 198
NUMBER OF REVOLUTIONS 174 PECK DRILLING 199
System Setting 174 Typical Peck Drilling Application 199
Time Equivalent 174 Calculating the Number of Pecks 199
XIV Table of Contents
28
Selecting the Number of Pecks 200
Controlling Breakthrough Depth 200 - FACE MILLING 227
REAMING 201
Reamer Design 201 CUTTER SELECTION 227
Spindle Speeds for Reaming 201 Basic Selection Criteria 227
Feedrates for Reaming 201 Face Mill Diameter 227
Stock Allowance 202 Insert Geometry 228
Other Reaming Considerations 202
CUTTING CONSIDERATIONS 228
SINGLE POINT BORING 202 Angle of Entry 229
Single Point Boring Tool 202 29Milling Mode 229
Spindle Orientation 203 Number of Cutting Inserts 230
Block Tools 203
PROGRAMMING TECHNIQUES 230
BORING WITH A TOOL SHIFT 203 Single Face Mill Cut 231
Precision Boring Cycle G76 203 Multiple Face Mill Cuts 232
Backboring Cycle G87
Programming Example
204
204
USING POSITION COMPENSATION .... 233
Precautions in Programming and Setup 205
ENLARGING HOLES 205 - CIRCULAR INTERPOLATION 235
Countersinking 205
Counterboring 206
207
ELEMENTS OF A CIRCLE 235
Spotfacing
Radius and Diameter 235
MULTILEVEL DRILLING 207 Circle Area and Circumference 236
WEB DRILLING 208 QUADRANTS 236
TAPPING 209 Quadrant Points 236
Tap Geometry 210 PROGRAMMING FORMAT 237
Tapping Speed and Feedrate 210
Arc Cutting Direction 237
Pipe Taps 211
Circular Interpolation Block . 237
Tapping Check List 212
Arc and End Points
Start 238
HOLE OPERATIONS ON A LATHE .... 212 30
Arc Center and Radius
Arc Center Vectors
238
238
Tool Approach Motion 213
Tool Return Motion 213 Arc m Planes 239
Drilling and Reaming on Lathes 214 RADIUS PROGRAMMING 240
Peck Drilling Cycle - G74 214
Blend Radius 240
Tapping on Lathes 215
Partial Radius 240
Other Operations 216
FULL CIRCLE PROGRAMMING 240
Boss Milling 242
27 - PATTERN OF HOLES 217 Internal Circle Cutting • Linear Start 243
Internal Circle Cutting - Circular Start 243
Circle Cutting Cycle 244
TYPICAL HOLE PATTERNS 217
ARC PROGRAMMING 245
RANDOM HOLE PATTERN 217
STRAIGHTROW HOLE PATTERN .... 218
FEEDRATE FOR CIRCULAR MOTION ... 245

ANGULAR ROW HOLE PATTERN .... 218


Feedrate for Outside Arcs
Feedrate for Inside Arcs
246
246
Pattern Defined by Coordinates 218
Pattern Defined by Angle 219

CORNER PATTERN 220 - CUTTER RADIUS OFFSET 247


GRID PATTERN 220
Angular Grid Pattern 221
MANUAL CALCULATIONS 247
Tool Path Center Points 248
ARC HOLE PATTERN 222 Cutter Radius 249
BOLT HOLE CIRCLE PATTERN 223 Center Points Calculation 249
Bolt Circle Formula 224 COMPENSATED CUTTER PATH 250
Pattern Orientation 224
Types of Cutter Radius Offset 250
POLAR COORDINATE SYSTEM 225 Definition and Applications 250
Plane Selection 226 PROGRAMMING TECHNIQUES 250
Order of Machining 226 Direction of Cutting Motion 251
Table of Contents XV

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

FIXED CYCLES IN PLANES 274 MULTIPLE OFFSETS 295


General Approach 296
Diameter Tolerances 296
- PERIPHERAL MILLING 275 Shoulder Tolerances 297
Diameter and Shoulder Tolerances 297

END MILLS 275 OFFSET SETTING 298


XVI Table of Contents

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

ROUGH AND FINISHED SHAPE 302 G75 GROOVE CUTTING CYCLE


- 322

Rough Operations 302 G75 Cycle Format - 10T/1 IT/1 5T 322


Finish Operations 303
G75 Cycle Format - 0T/1 6T/1 8T/20T/2 IT 322
Stock and Stock Allowance 303 BASIC RULES FOR G74 AND G75 CYCLES . . 322
PROGRAMMING A RECESS 304
SPINDLE SPEED IN CSS MODE 305 36 - GROOVING ON LATHES 323
LATHE PROGRAM FORMAT 306
Program Format - Templates 306 GROOVING OPERATIONS 323
General Program Format 306
Main Grooving Applications 323
Approach to the Part 306
Grooving Criteria 323
GROOVE SHAPE 323
35- LATHE CYCLES 307 Nominal Insert Size 324
Insert Modification 324

STOCK REMOVAL ON LATHES 307 GROOVE LOCATION 324


Simple Cycles 307 GROOVE DIMENSIONS 324
Complex Cycles 307 Groove Position 325
PRINCIPLES OF LATHE CYCLES 307 Groove Depth 325

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

MULTIPLE REPETITIVE CYCLES 313 MULTIPLE GROOVES 330


General Description 313 FACE GROOVES 330
Cycle Format Types 313 Radial Clearance 331
Cutting Cycles and Part Contour 313 Face Grooving Program Example 331
Chipbreaking Cycles 313
CORNER GROOVES /NECK GROOVES ... 332
CONTOUR CUTTING CYCLES 314
GROOVING CYCLES 332
Boundary Definition 314
G75 Cycle Applications 332
Start Point and the Points P and Q 314
Single Groove with G75 333
TYPE AND TYPE
I II CYCLES 315 Multiple Grooves with G75 333
Programming Type and Type I II Cycles 315 SPECIAL GROOVES 333
Cycle Formatting

G71 -STOCK REMOVAL IN TURNING ...


315
315
GROOVES AND SUBPROGRAMS .... 334

G71 Cycle Format- 10T/1 IT/1 5T 316


G71 Cycle Format - 0T/16T/18T/20T/21T 316 37 - PART-OFF 335
G71 for External Roughing 316
G71 for Internal Roughing 317
Direction of Cutting in G71 317 PART-OFF PROCEDURE . 335

G72 - STOCK REMOVAL IN FACING . ... 317


Parting Tool Description
Tool Approach Motion
...
...
335
336
G72 Cycle Format- 10T/1 IT/1 5T 317 Stock Allowance ... 337
G72 Cycle Format - 0T/1 6T/1 8T/20T/2 1 T 318 Tool Return Motion ... 337
G73 - PATTERN REPEATING CYCLE . . . . 318 Part-off with a Chamfer ... 337
G73 Cycle Format - 10T/1 1T/15T 318 Preventing Damage to the Part ... 338
G73 Cycle Format - 0T/16T/18T/20T/2 IT 319
G73 Example of Pattern Repeating 319
38 SINGLE POINT THREADING 339
G70 -CONTOUR FINISHING CYCLE . ... 320
-
Table of Contents XVI

THREADING ON CNC LATHES 339


Form Thread
of a 339 39 - SUBPROGRAMS 367
Threading Operations 340
TERMINOLOGY OF THREADING 340 MAIN PROGRAM AND SUBPROGRAMS . . 367
THREADING PROCESS 341 Subprogram Benefits 367
Identification of Subprograms 368
Steps in Threading 341
Thread Start Position 342 SUBPROGRAM FUNCTIONS 368
Thread Cutting Diameter and Depth 342 Subprogram Call Function 368
Thread Cutting Motion 343 Subprogram End Function 368
Retract from Thread 344 BlockNumber to Return to 369
Return to Start Position 344 Number of Subprogram Repetitions 369
THREADING FEED AND SPINDLE SPEED . . 344 L0 in a Subprogram Call 370

Threading Feedrate Selection 345 SUBPROGRAM NUMBERING 371


Spindle Speed Selection 345 Organized Approach 372
Maximum Threading Feedrate 346 Protected Subprograms 373
Lead Error 347
SUBPROGRAM DEVELOPMENT 373
TOOL REFERENCE POINT 348 Repeating Pattern Recognition 373
BLOCK-BY-BLOCK THREADING 348 Tool Motionand Subprograms 374

BASIC THREADING CYCLE - G92 .... 349


Modal Values and Subprograms 375

MULTIPLE REPETITIVE CYCLE G76 - .... 350


MULTI LEVEL NESTING
One Level Nesting
376
376
G76 Cycle Format - 10T/1 1T/15T 350
Two Level Nesting 376
G76 Cycle Format 0T/16T/18T
- 351
Three Level Nesting 377
Programming Example 351
Four Level Nesting 377
First Thread Calculation 352
Nesting Applications 377
THREAD INFEED METHODS 353
CONTOURING WITH A SUBPROGRAM ... 378
Radial Infeed 353
Compound Infeed 353 TOOL CHANGE SUBPROGRAM 379
Thread Insert Angle - Parameter A 354 100 000 000 HOLE GRID 379
Thread Cutting Type - Parameter P 354

ONE-BLOCK METHOD CALCULATIONS. . . 355


Initial Considerations 355 40 - DATUM SHIFT 381
Z Axis Start Position Calculation 355
THREAD RETRACT MOTION 357 DATUM SHIFT WITH G92 OR G50 .... 381

Thread Pullout Functions 357 Program Zero Shift 381


Single Axis Pullout 357 LOCAL COORDINATE SYSTEM 383
Two-Axis Pullout 357
G52 Command 384
HAND OF THREAD
THREADING TO A SHOULDER
358
358
MACHINE COORDINATE SYSTEM .... 384
DATA SETTING 386
Insert Modification 358
Data Setting Command 386
Program Testing 360
Coordinate Mode 386
OTHER THREAD FORMS 360 WORK OFFSETS 386
Thread Depth 360
Standard Work Offset Input 386
TAPERED THREAD 361 Additional Work Offset Input 387
Depth and Clearances 361 External Work Offset Input 387
Taper Calculation 361 TOOL LENGTH OFFSETS 387
Block by Block Taper Thread 362
Valid Input Range 388
Tapered Thread Using a Simple Cycle 363
Tapered Thread and a Multi Repetitive Cycle 363 CUTTER RADIUS OFFSETS 388
MULTISTART THREAD 364 LATHE OFFSETS 388
Threading Feedrate Calculation 364 MDI DATA SETTING 389
Shift Amount 365
Application Example 366
PROGRAMMABLE PARAMETER ENTRY. . . 389
Modal G10 Command 389
THREAD RECUTTING 366 Parameters Notation 390
Program Portability 390
Bit Type Parameter 391
Effect of Block Numbers 392
xviii Table of Contents
41
BARFEEDER ATTACHMENT 413
- MIRROR IMAGE 393 Bar Stopper 413
ADDITIONAL OPTIONS 414
BASIC RULES OF MIRROR IMAGE .... 393 Part Catcher or Part Unloader 414
Tool Path Direction 393 Continuous Operation 414
Original Tool Path 394 Parts Counter 415
Mirror Axis 394 Pull-Out Finger 415
Sign of Coordinates 394
Milling Direction 395
PROGRAMMING EXAMPLE 415
Arc Motion Direction 395
Program Start and End 395
45 - HELICAL MILLING 417
MIRROR IMAGE BY SETTING 395
42Control Setting 395
HELICAL MILLING OPERATION 417
Programming - Manual Mirror Setting 396
PROGRAMMABLE MIRROR IMAGE .... 396
Helical Interpolation
Programming Format
417
417
Mirror Image Functions 396 Arc Modifiers for Helical Interpolation 418
Simple Mirror Image Example 397 Applications and Usage 418
Complete Mirror Image Example 398
THREAD MILLING 418
MIRROR IMAGE ON CNC LATHES
43 .... 398 Applying Thread Milling 418
Conditions for Thread Milling 418
Thread Milling Tool 419
- COORDINATE ROTATION 399 Premachining Requirements 419
Clearance Radius 419
Productivity of Thread Milling 419
ROTATION COMMANDS 399
Center of Rotation 399 THE HELIX 419
Radius of Rotation 399 THREAD MILLING EXAMPLE 421
44
Coordinate Rotation Cancel 401
Straight Thread 421
Common Applications 401
Calculations
Initial 421
PRACTICAL APPLICATION 401 Starting Position 422
Motion Rotation and Direction 422
Lead-In Motions 423
- SCALING FUNCTION 405 Thread Rise Calculation 424
Milling the Thread 424
Lead-Out Motions 425
DESCRIPTION 405 Complete Program 425
Scaling Function Usage 405 External Thread Milling 425
lapered hread Milling 425
PROGRAMMING FORMAT 405 I

Further Considerations 426


Scaling Center 406
Scaling Factor 406 THREAD MILLING SIMULATION METHOD . . 426
Rounding Errors in Scaling 407 HELICAL RAMPING 427
PROGRAM EXAMPLES 407

46 - HORIZONTAL MACHINING 429


- CNC LATHE ACCESSORIES 409
INDEXING AND ROTARY AXES 429
CHUCK CONTROL 409 INDEXING TABLE (B AXIS) 429
Chuck Functions 409 Units of Increment 429
Chucking Pressure 410 Direction of Indexing 430
Chuck Jaws 410 Table Clamp and Unclamp Functions 430
TAILSTOCK AND QUILL 410 Indexing in Absolute and Incremental Mode 430
Tailstock Body 410 B AXIS AND OFFSETS 431
Quill 411
Work Offset and B Axis 431
Center 411
Tool Length Offset and B Axis 432
Quill Functions 411
Programmable Tailstock 411 RETURN TO MACHINE ZERO 434
Safety Concerns 411 INDEXING AND A SUBPROGRAM .... 434
BI-DIRECTIONAL TURRET INDEXING ... 412 COMPLETE PROGRAM EXAMPLE . 436
Programming Example 412 AUTOMATIC PALLET CHANGER APC - 437
able of Contents XIX

Working Environment 438 RUNNING THE FIRST PART 459


Types of Pallets 438 PROGRAM CHANGES 460
E rogramming Commands 439
47= 3llet Changing Program Structure 439
Program Upgrading 460
Program Updating 461
HORIZONTAL BORING MILL 439 Documentation Change 461
ALTERNATE MACHINE SELECTION .... 461

- WRITING A CNC PROGRAM 441 MACHINE WARM UP PROGRAM .... 462


CNC MACHINING AND SAFETY 462
PROGRAM WRITING 441 SHUTTING DOWN A CNC MACHINE ... 463
-•agibility of Handwriting . 442 Emergency Stop Switch 463
= 'ogramming Forms 442 Parking Machine Slides 464
Confusing Characters 442 Setting the Control System 464
=ROGRAM OUTPUT FORMATTING .... 443 Turning the Power Off 464

-ONG PROGRAMS 445 EQUIPMENT MAINTENANCE 464


= 'ogram Length Reduction 445
Vemory Mode and Tape Mode 446
51 - INTERFACING TO DEVICES 465

48 - PROGRAM DOCUMENTS 447 RS-232C INTERFACE 465


PUNCHED TAPE 466
DATA FILES 447 Tape Reader and Puncher 466
=ROGRAM DOCUMENTATION 448 Leader and Trailer 468
Tape Identification 468
ExternalDocumentation 448
Non-printable Characters 468
•nernalDocumentation 448
Storage and Handling 468
=rogram Description 449
SETUP AND TOOLING SHEETS 449
DISTRIBUTED NUMERICAL CONTROL ... 468

Setup Sheet 450 TERMINOLOGY OF COMMUNICATIONS . . 469


~co rig Sheet 450 Baud Rate 469
Coordinate Sheet 451 Parity 469

DOCUMENTATION FILE FOLDER .... 451


Data Bits
Start and Stop Bits
469
469
oentification Methods 451
cerator's Suggestions 452 DATA SETTING 469
50!

- 'ng and Storage 452 CONNECTING CABLES 470


Null Modem 470
Cabling for Fanuc and PC 470
49 - PROGRAM VERIFICATION 453

DETECTION OF ERRORS 453 52 - MATH IN CNC PROGRAMMING 471


:- 453
e.entive Measures
I :"ective Measures 453 BASIC ELEMENTS 471
D-=APHIC VERIFICATION 454 Arithmetic and Algebra 471
Order of Calculations 471
-.OIDING ERRORS 454
'tax Errors 455 GEOMETRY 472
-OO'Cal Errors 455 Circle 472
PIConstant 473
: '.'MON PROGRAMMING ERRORS Circumference of a Circle 473
;
-ogram Input Errors 456 Length of Arc 473
Insulation Errors 456 Quadrants 473
- 5'dware Errors 456
soclloncous Errors 456 POLYGONS 474
TAPERS 475
Taper Definition 475
- CNC MACHINING 457 Taper Per Foot 476
Taper Ratio 476
•ACHINING A NEW PART 457 Taper Calculations - English Units 476
Taper Calculations - Metric Units 476
letup Integrity 458
^ogram Integrity 458 CALCULATIONS OF TRIANGLES 477
XX Table of Contents

. :=s z~ Angles and Triangles 477 Hardware Specifications 487


-.ignt Triangles 478 Typical Hardware Requirements 488
S.milar Triangles 478 Utilities and Special Features 488
Sme Cosine Tangent
- - 479
POST PROCESSORS 488
Inverse Trigonometric Functions 480
Degrees and Decimal Degrees 480 Customizing Post Processor 488
Pythagorean Theorem 480 IMPORTANT FEATURES 489
Solving Right Triangles 481
Input from User 489
ADVANCED CALCULATIONS 482 Machining Cycles 489
User Interface 489
CONCLUSION 482
CAD Interface 489
SUPPORT AND MANAGEMENT 489
53 - CNC AND CAD/CAM 483 Training 490
System Management 490
Technical Support 490
PROGRAMMING MANUALLY? 483
CAM Software. 483 THE END AND THE BEGINNING 490
Desktop Computer Programming 483
TOOL PATH GEOMETRY DEVELOPMENT . . 484
A REFERENCE TABLES
- 491
TOOL PATH GENERATION 484
COMPLETE ENVIRONMENT 484 Decimal Equivalents 491
Multi Machine Support 485 English Threads - UNC/UNF 494
Associative Operations 485
Job Setup 485 Straight Pipe Taps NPS 494
and Job Comments
Tooling List 485 Taper Pipe Taps NPT 495
Connection Between Computers 485
Program Text Editor 486
Metric Coarse Threads 495
Printing Capabilities 486 Metric Fine Threads 495
Pen Plotting 486
CAD Software Access 486
Support for Solids 486 Index 497
Software Specifications 487
1 NUMERICAL CONTROL

Numerical Control technology as it is known today, NC and CNC Technology


emerged in the mid 20th century. It can be traced to the year
In strict adherence to the terminology, there is a differ-
of 1952, the U.S. Air Force, and the names of John Parsons
ence in the meaning of the abbreviations NC and CNC. The
and the Massachusetts Institute of Technology in Cam-
bridge, MA, USA. It was not applied in production manu-
NC stands for the older and original Numerical Control
facturing until the early 1960’s. The real boom came in the
technology, whereby the abbreviation CNC stands for the
newer Computerized Numerical Control technology, a
form of CNC, around the year of 1972, and a decade later
with the introduction of affordable micro computers. The
modem spin-off of its older relative. However, in practice,
history and development of this fascinating technology has
CNC is the preferred abbreviation. To clarify the proper us-
age of each term, look at the major differences between the
been well documented in many publications.
NC and the CNC systems.
In the manufacturing field, and particularly in the area of
Both systems perform the same tasks, namely manipula-
metal working, Numerical Control technology has caused
tion of data for the purpose of machining a part. In both
something of a revolution. Even in the days before comput-
cases, the internal design of the control system contains the
ers became standard fixtures in every company and in
logical instructions that process the data. At this point the
many homes, the machine tools equipped with Numerical
similarity ends.
Control system found their special place in the machine
shops. The recent evolution of micro electronics and the The NC system (as opposed to the CNC system) uses a
never ceasing computer development, including its impact fixed logical functions, those that are built-in and perma-
on Numerical Control, has brought significant changes to nently wired within the control unit. These functions can-
the manufacturing sector in general and metalworking in- not be changed by the programmer or the machine opera-
dustry in particular. tor. Because of the fixed wiring of the control logic, the NC
control system is synonymous with the term 'hardwired'.
DEFINITION OF NUMERICAL CONTROL The system can program, but it does not al-
interpret a part
low any changes to the program, using the control features.
All required changes must be made away from the control,
In various publications and articles, many descriptions
typically in an office environment. Also, the NC system re-
have been used during the years, to define what Numerical
quires the compulsory use of punched tapes for input of the
Control is. It would be pointless to try to find yet another
program information.
definition, just for the purpose of this handbook. Many of
these definitions share the same idea, same basic concept,
The modem CNC system, but not the old NC system,
just use different wording. uses an internal micro processor (/.&, a computer). This
computer contains memory registers storing a variety of
The majority of all the known definitions can be summed
routines that are capable of manipulating logical functions.
up into a relatively simple statement:
That means the part programmer or the machine operator
can change the program on the control itself (at the ma-
Numerical Control can be defined as an operation of
coded chine), with instantaneous results. This flexibility is the
machine tools by the means of specifically
instructions to the machine control system greatest advantage of the CNC systems and probably the
key element that contributed to such a wide use of the tech-
nology in modem manufacturing. The CNC programs and
The instructions are combinations of the letters of alpha-
the logical functions are stored on special computer chips,
bet, digits and selected symbols, for example, a decimal
as software instructions, rather than used by the hardware
point, the percent sign or the parenthesis symbols. All in-
connections, such as wires, that control the logical func-
and a predetermined
structions are written in a logical order
form. The collection of all instructions necessary to ma-
tions. In contrast to the NC system, the CNC system is syn-
onymous with the term 'softwired ’.

chine a part is called an NC Program, CNC Program, or a


Part Program. Such a program can be stored for a future When describing a particular subject that relates to the
use and used repeatedly to achieve identical machining re- numerical control technology, customary to use either
it is
sults at any time. the termNC or CNC. Keep in mind that NC can also mean
CNC in everyday talk, but CNC can never refer to the older

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

physical involvement as manual machining. Numerically


controlled machining does not need any levers or dials or
What makes the CNC machining superior to the conven- handles, at least not in the same sense as conventional ma-
tional methods? Is it superior at all? Where are the main chining does. Once the part program has been proven, it
benefits? If the CNC and the conventional machining pro- can be used any number of times over, always returning
cesses are compared, a common general approach to ma- consistent results. That does not mean there are no limiting
chining a part will emerge: factors. The cutting tools do wear out, the material blank in
one batch is not identical to the material blank in another
1 . Obtain and study the drawing
batch, the setups may vary, etc. These factors should be
2. Select the most suitable machining method
considered and compensated for, whenever necessary.
3. Decide on the setup method (work holding)
4. Select the cutting tools The emergence of the numerical control technology does
5. Establish speeds and feeds not mean an instant, or even a long term, demise of all man-
6. Machine the part ual machines. There are times when a traditional machin-
ing method
is preferable to a computerized method. For ex-
This basic approach is the same for both types of machin-
ample, simple one time job may be done more efficiently
a
ing. The major difference is in the way how various data
on a manual machine than a CNC machine. Certain types
are input.A feedrate of 10 inches per minute (10 in/min) is
of machining jobs will benefit from manual or semiauto-
the same in manual or CNC applications, but the method of
matic machining, rather than numerically controlled ma-
applying it is not. The same can be said about a coolant - it
can be activated by turning a knob, pushing a switch or
chining. The CNC machine tools are not meant to replace
every manual machine, only to supplement them.
programming a special code. All these actions will result in
a coolant rushing out of a nozzle. In both kinds of machin- many
In whether certain machin-
instances, the decision
ing, a certain amount of knowledge on the part of the user is ing will be done on a CNC machine or not is
based on the
required. After metal working, particularly metal cut-
all,
number of required parts and nothing else. Although the
ting, is mainly a but it is also, to a great degree, an art
skill, volume of parts machined as a batch is always an important
and a profession of large number of people. So is the appli- criteria, it should never be the only factor. Consideration
cation of Computerized Numerical Control. Like any skill should also be given to the part complexity, its tolerances,
or art or profession, mastering it to the last detail is neces- the required quality of surface finish, etc. Often, a single
sary to be successful. It takes more than technical knowl- complex part will benefit from CNC machining, while fifty
edge to be a CNC
machinist or a CNC programmer. Work relatively simple parts will not.
experience and intuition, and what is sometimes called a
'gut-feel ', is a much needed supplement to any skill. Keep mind that numerical control has never machined
in
a single partby itself. Numerical control is only a process
In a conventional machining, the machine operator sets or a method that enables a machine tool to be used in a pro-
up the machine and moves each cutting tool, using one or ductive, accurate and consistent way.
both hands, to produce the required part. The design of a
manual machine tool offers many features that help the
process of machining a part - levers, handles, gears and di-
NUMERICAL CONTROL ADVANTAGES
als, to name just a few. The same body motions are re-
peated by the operator for every part in the batch. However, What are the main advantages of numerical control?
the word 'same ’in this context really means ‘similar 'rather
than ‘identical’. Humans are not capable to repeat every
It is important to know which areas of machining will

process exactly the same at


benefit from it and which done the conventional
are better
all of ma-
times - that is the job
work way. absurd to think that a two horse power CNC mill
It is
chines. People cannot at the same performance level
will win over jobs that are currently done on a twenty times
all the time, without a rest. All of us have some good and

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.

Lead time reduction


Accuracy and Repeatability
Accuracy and repeatability

The high degree of accuracy and repeatability of modern


Contouring of complex shapes
CNC machines has been the single major benefit to many
Simplified tooling and work holding users. Whether the part program is stored on a disk or in the
Consistent cutting time
computer memory, or even on a tape (the original method),
it always remains the same. Any program can be changed

General productivity increase at will, but once proven, no changes are usually required

any more. A given program can be reused as many times as


Each area offers only a potential improvement. Individ-
needed, without losing a single bit of data it contains. True,
ual users will experience different levels of actual improve-
program has to allow for such changeable factors as tool
ment, depending on the product manufactured on-site, the
wear and operating temperatures, it has to be stored safely,
CNC machine used, the setup methods, complexity of
but generally very little interference from the CNC pro-
fixturing, quality of cutting tools, management philosophy
grammer or operator be required. The high accuracy of
will
and engineering design, experience level of the workforce,
CNC machines and their repeatability allows high quality
individual attitudes, etc.
parts to be produced consistently time after time.

Setup Time Reduction


Contouring of Complex Shapes
In many cases, the setup time for a CNC machine can be
CNC lathes and machining centers are capable of con-
reduced, sometimes quite dramatically. It is important to
realize that setup is a manual operation, greatly dependent
touring a variety of shapes. Many CNC
users acquired their
machines only to be able to handle complex parts. good A
on the performance of CNC operator, the type of fixturing
examples are CNC applications in the aircraft and automo-
and general practices of the machine shop. Setup time is
tive industries. The use of some form of computerized pro-
unproductive, but necessary - it is a part of the overhead
gramming is virtually mandatory for any three dimensional
costs of doing business. To keep the setup time to a mini-
tool path generation.
mum should be one of the primary considerations of any
machine shop supervisor, programmer and operator. Complex shapes, such as molds, can be manufactured
without the additional expense of making a model for trac-
Because of the design of CNC machines, the setup time
ing.Mirrored parts can be achieved literally at the switch of
should not be a major problem. Modular fixturing, standard
a button. Storage of programs is a lot simpler than storage
tooling, fixed locators, automatic tool changing, pallets and
of patterns, templates, wooden models, and other pattern
other advanced features, make the setup time more efficient
making tools.
than a comparable setup of a conventional machine. With a
good knowledge of modern manufacturing, productivity
Simplified Tooling and Work Holding
can be increased significantly.
Nonstandard and ‘homemade’ tooling that clutters the
The number of parts machined under one setup is also
benches and drawers around a conventional machine can
important, in order to assess the cost of a setup time. If a
be eliminated by using standard tooling, specially designed
great number of parts is machined in one setup, the setup
for numerical control applications. Multi-step tools such as
cost per part can be very insignificant. A very similar re-
pilot drills, step drills, combination tools, counter borers
duction can be achieved by grouping several different oper-
and others are replaced with several individual standard
ations into a single setup. Even if the setup time is longer, it
tools. These tools are often cheaper and easier to replace
may be justified when compared to the time required to
than special and nonstandard tools. Cost-cutting measures
setup several conventional machines.
have forced many tool suppliers to keep a low or even a
nonexistent inventory, increasing the delivery time to the
Lead Time Reduction
customer. Standard, off-the-shelf tooling can usually be ob-
Once a part program is written and proven, it is ready to tained faster then nonstandard tooling.

be (Used again in the future, even at a short notice. Although


usually longer, virtually
Fixturing and work holding for CNC machines have only
the lead lime for the first run is it is
one major purpose - to hold the part rigidly and in the same
nil any subsequent run. Even if an engineering change
for
position for all parts within a batch. Fixtures designed for
of the part design requires the program to be modified, it
CNC work do not normally require jigs, pilot holes and
can be done usually quickly, reducing the lead time.
other hole locating aids.
4 Chapter 1

Cutting Time and Productivity Increase Boring mills and Profilers

The cutting time on the CNC machine is commonly EDM machines


known as the cycle time - and is always consistent. Unlike a
Punch presses and Shears
conventional machining, where the operator’s skill, experi-
ence and personal fatigue are subject to changes, the CNC Flame cutting machines
machining is under the control of a computer. The small
Routers
amount of manual work is restricted to the setup and load-
ing and unloading the part. For large batch runs, the high Water jet and Laser profilers

cost of the unproductive time is spread among many parts,


Cylindrical grinders
making it less significant. The main benefit of a consistent
cutting time is for repetitive jobs, where the production Welding machines

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.

Mills and Machining Centers


To reach the goal of a major increase in productivity, it is

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.

chine tool operator and this goal is also reflected in the


handbook approach as well as in the numerous examples.
CNC machining centers are far more popular and effi-
cient than drills and mills, mainly for their flexibility. The
main benefit the user gets out of a CNC machining center is
TYPES OF CNC MACHINE TOOLS the ability to group several diverse operations into a single
setup. For example, drilling, boring, counter boring, tap-
Different kinds of CNC machines cover an extremely ping, spot facing and contour milling can be incorporated
large variety. Their numbers are rapidly increasing, as the into a single CNC program. In addition, the flexibility is
technology development advances. It is impossible to iden- enhanced by automatic tool changing, using pallets to
tify all the applications, they would make a long list. Here minimize idle time, indexing to a different side of die part,
is a brief list of some of the groups CNC machines can be using a rotary movement of additional axes, and a number
part of: * of other features. CNC machining centers can be equipped
with special software that controls die speeds and feeds, the
Mills and Machining centers
life of the cutting tool, automatic in-process gauging and

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.

ing all its modem functions.


A good CNC programmer must be flexible in order to offer
high programming quality.
6 Chapter 1

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

Milling machines where the spindle motion is up and


CNC MACHINES -MILLING down, are categorized as vertical machines. Milling ma-
chines where the spindle motion is in and out are catego-
,

The description of CNC milling machines is so large, it


rized as horizontal machines - see Figure 2-1 and 2-2.
can fill a thick book all by itself. All machine tools from a
simple knee type milling machine up to a five axis profiler
can be included They vary in size, features,
in this category.
suitability for certain work, etc., but they do all have one

common denominator their primary axes are the X and Y


-

axes - and for this reason, they are called the XY machines.

In the category of the XY machines are also wire EDM


machine and water jet cutting machines, flame
tools, laser
cutters, burners, routers, etc. Although they do not qualify
as milling type machine tools, we mention them because
the majority of programming techniques applicable to the
mills is identical to these machines types as well. The best
example is a contouring operation, a process common to
many CNC machines.

For the purpose of this handbook, a milling machine can


be defined:

Schematic representation of a CNC vertical machining center


Milling machine machine capable of a simultaneous
is a
cutting motion, using an end mill as the primary cutting tool,
along at least two axes at the same time

This definition eliminates all CNC drill presses, since


their design covers positioning but not profiling. The defi-
nition also eliminates wire EDM
machines and a variety of
burners, since they are capable of a profiling action but not
with an end mill. Users of these machine tools will still
benefit from many subjects covered here. The general prin-
ciples are adaptable to the majority of CNC machine tools.
For example, a wire EDM
uses a very small cutter diame-
ter, in the form of a wire. A laser cutting machine uses the
laser beam as its cutter, also having a known diameter but
The focus will be concentrated
the term kerf is used instead.
on metal cutting machine tools, using various styles of end
mills as the primary tool for contouring. Since an end mill
can be used in many ways, first look will be at the various
types of available milling machines. Schematic representation of a CNC horizontal machining center

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-

tary axis (the A models or the B axis for


axis for vertical tically or horizontally, depending on the desired results and
horizontal models). Even higher of flexibility can be
level the model type. This fourth axis can be used either for in-
found on machines with live or more axes. A simple ma- dexing or a full rotary motion. In the combination with a
chine with five axes may be a boring mill that has three ma- tailstock (usually supplied), the fourth axis in the vertical
jor axes, plus a rotary axis (usually the B axis) and an axis configuration can be used for machining long parts that
parallel to the Z axis (usually the W
axis). However, true need support at both ends.
complex and flexible five-axis profiling milling machine is
The majority of vertical machining centers most opera-
the type used in aircraft industry, where a multi-axis, simul-
tors work with are those with an empty table and three-axes
taneous cutting motion is necessary to machine complex
configuration.
shapes and reach cavities and various angles.
From the programming perspective, there are at least two
At times, the expression two and a half axis machine or a
items worth mentioning:
three and a half axis machine is used. These terms refer to
the type of machines, where simultaneous cutting motion ONE programming always takes place from the viewpoint
-

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

Vertical and Horizontal Machining Center - Typical Specifications

Description Vertical Machining Center Horizontal Machining Center

Number of axes 3 axes (XYZ) 4 axes (XYZB)

Table dimensions
780 x 400 mm 500 x 500 mm
31x16 inches 20 x 20 inches

Number of tools 20 36

Maximum travel - X axis


575 mm 725 mm
22.5 inches 28.5 inches

Maximum travel - Y axis


380 mm 560 mm
15 inches 22 inches

Maximum travel - Z axis


470 mm 560 mm
18.5 inches 22 inches

Table indexing angle N/A 0.001 degree

Spindle speed 60-8000 rpm 40 - 4000 rpm

AC 7. 5/5. 5 kW AC 1 1/8 kW
Spindle output
AC 10/7 HP AC 15/11 HP

Spindle nose-to-table distance - Z axis


150 - 625 mm 150-710 mm
6 - 24.6 inches 6 - 28 inches

Spindle center-to-column distance - Y axis


430 mm 30 - 560 mm
17 inches 1.2-22 inches

Spindle taper No. 40 No. 50

Tool shank size BT40 CAT50

2 - 10000 mm/min 1 - 10000 mm/min


Feedrate range
0.100 - 393 in/min 0.04 - 393 in/min

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)

Tool selection Random memory Random memory

Maximum tool diameter


80 mm (150 w/empty pockets) 105 mm
3.15 inches (5.9 w/empty pockets) 4.1 inches

Maximum tool length


300 mm 350 mm
11.8 inches 13.75 inches

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

Horizontal Boring Mill On the preceding a comprehensive chart showing


page is

the typical specifications of a CNC Vertical Machining


Horizontal boring mill is just another CNC machine. It Center and a CNC Horizontal Machining Center. The spec-
closely resembles a CNC horizontal machining center, but ifications are side by side in two columns, strictly for con-
it does have its own differences. Generally, a horizontal venience, not for any comparison purposes. These are two
boring mill is defined by the lack of some common fea- different machine types and comparison is not possible for
tures, such as the Automatic Tool Changer. As the name of all features. In order to compare individual machine tools
the machine suggests, its primary purpose is boring opera- within a certain category, machine tool specifications prov-
tions, mainly lengthy bores. For that reason, the reach of ided by the machine manufacturer often serve as the basis
the spindle is extended by a specially designed quill. An- for comparison. These specifications are contained a list of
other typical feature is an axis parallel to the Z axis, called verifiable data,mainly technical in nature, that describes
the W axis. Although this is, in effect, the fifth axis Resig- the individual machine by its main features. Machine tool
nation (X, Y, Z, B, W), a horizontal boring mill cannot be buyers frequently compare many brochures of several dif-
called a true five axis machine. The Z axis (quill) and the W ferent machines as part of the pre purchase process. Man-
axis (table) work in the opposite directions towards each agers and process planners compare individual machines in
other, so they can be used for large parts and hard-to-reacli the machine shop and assign the available workload to the
areas. It also means, that during drilling, the machine table most suitable machine.
moves against an extended quill. The quill is a physical part
of the spindle. It is in the spindle where the cutting tool ro- A fair and accurate comparison can be made between two
tates - but the in-and-out motions are done by the table. vertical machining centers or between two horizontal ma-
Think of the alternate method offered on horizontal boring chining centers, but cannot be done fairly to compare be-
mills - if the quill were to be very long, it would lose its tween two different machine types.
strength and rigidity. The better way was to split the tradi-
In a typicalmachine specification chart, additional data
tional single Z axis movement into two - the quill extension
may be not included in the earlier chart. In this hand-
listed,
along the Z axis will move only part of the way towards the
book, the focus is on only those specifications that are of
table and the table itself, the new W
axis, will move another
interest to the CNC programmer and the CNC operator.
3 CNC TURNING

CNC MACHINES -TURNING Number of Axes


The most common distinction of different CNC lathes is
A conventional engine lathe or a turret lathe is a common by the number of programmable axes. Vertical CNC lathes
machine in just about every machine shop. A lathe is used have two axes in almost all designs available. The much
for machining cylindrical or conical work, such as shafts,
more common CNC horizontal lathes, commonly designed
rings,wheels, bores, threads, etc. The most common lathe with two programmable axes, are also available with three,
operation is removal of material from a round stock, using a
four or six axes, thus adding extra flexibility to manufactur-
turning tool for external cutting. A lathe can also be used
ing of more complex parts.
for internal operations such as boring, as well as for groov-
ing, threading, etc., if a proper cutting tool is used. Turret A horizontal CNC lathe can further be described by the
lathes are usually weaker in machining power than engine type of engineering design:
do have a special carousel that holds several
lathes, but they
mounted cutting tools. An engine lathe has often only one FRONT lathe ... an engine lathe type

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

ent modes, such as chuck work, collet work, barfeeder, or


AXES DESIGNATION
between centers. Many other combinations also exist. CNC
lathes are designed to hold several tools in special turrets, A typical CNC lathe is designed with two standard axes -
they can have a milling attachment, indexable chuck, a sub one axis is the X axis, the other axis is the Z axis. Both axes

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

tools are in the work area.

Types of CNC Lathes


Following the established standards of the milling ma-
Basically, CNC lathes can be categorized by the type of chines and machining centers, the only machine axis capa-
design and by the number of axes. The two basic types are ble of making a hole by methods of drilling, boring, pierc-

the vertical CNC lathe and the horizontal CNC lathe. Of ing or punching, is the Z axis.

the two, the horizontal type is by far the most common in

manufacturing and machine shops. A vertical CNC lathe


In CNC lathe work, the traditional axis orientation for a
horizontal type of lathe is upwards and downwards motion
(incorrectly called a vertical boring mill) is somewhat less
for the X axis, and left and right motion for the Z axis, when
common but is irreplaceable for a large diameter work. For
looking from the machinist’s position. This view is shown
a CNC programmer, there are no significant differences in
in the following three illustrations Figure 3-1, Figure 3-2,
the programming approach between the two lathe types.
and Figure 3-3.

11
12 Chapter 3

HEADSTOCK X and Z primary axes, the multi-axis


In addition to the
TURRET lathes have individual descriptions of each additional axis,
for example, the C axis is usually the third axis, used for
CHUCK
milling operations, using so called live tooling. More de-
JAWS on the subject of coordinate system and machine ge-
tails
'
TOOL ometry are available in the next chapter.
X+ TAILSTOCK

t z-
t
<- -+z+ <n
v This
Two-axis Lathe

is the most common type of CNC lathes. The work

holding device, usually a chuck, is mounted on the left side


J CENTER of the machine viewed by the operator). The rear type,
(as
X- QUILL with the slant bed, is the most popular design for general

work. For some special work, for example in the petroleum


Figure 3- industry (where turning tube ends is a common work), a
Typical configuration of a two axis slant bed CNC lathe - rear type Hat bed is usually more suitable. The cutting tools are held
in a specially designed indexing turret that can hold four,
six, eight, ten, twelve and more tools. Many such lathes
also have two turrets.

Advanced machine tool designs incorporate tool storage


away from the work area, similar to the design of machin-
ing centers. Tens, even hundreds, of cutting tools may be
stored and used for a single CNC program. Many lathes
also incorporate a quick changing tooling system.

Three-axis Lathe

Three-axis lathe is essentially a two-axis lathe with an ad-


ditional axis. This axis has its own designation, usually as a
C axis in absolute mode (H axis in incremental mode), and
is programmable. Normally, the third axis is used for
fully
cross-milling operations, slot cutting, bolt circle holes drill-
Typical configuration of a CNC lathe with two turrets
ing, hex faces, side faces, helical slots, etc. This axis can re-
place some simple operations on a milling machine, reduc-
ing the setup time for the job. Some
limitations do apply to
many models, for example, the milling or drilling opera-
tions can take place only at positions projecting from the
tool center line to the spindle center line (within
a machin-
ing plane), although others offer off-center adjustments.

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

Four-axis Lathe There more in the promotional brochure than just


is

attractive photographs - in fact, in a well designed bro-


By design, a four-axis CNC lathe is a totally different
chure, there is a wealth of technical information, describing
concept than a three-axis lathe. As a matter of fact, to pro-
the machine tool. These are the features and specifications
gram a four-axis lathe is nothing more than programming
two two-axis lathes at the same time. That may sound
the CNC machine tool manufacturer considers important to
the customer.
strange at first, until the principle of a four-axis CNC lathe
becomes clearer. In the majority of brochures, there are practical data that
can be used in a particular CNC machine, a
programming
There are actually two controls (and two sets of the XZ
lathe in the example.
axes), one for each pair (set) of axes. Only one program
may be used to do the external - or outside - diameter
Typical Machine Specifications
roughing (OD) and another program to do the inside - or in-
ternal - roughing (ID). Since a four-axis lathe can work A typical horizontal CNC lathe, with two axes and a slant
with each pair of axes independently, the OD and ID can be bed design, may have the following specifications (taken
machined at the same time, doing two different operations from an actual brochure):
simultaneously. The main keys to a successful 4-axis lathe
programming is coordination of the tools and their opera- Description Specification
tions, timing of the tool motions and a generous sense of
healthy compromise. Number of axes Two (X, Z) or three (X, Z and C)

Maximum swing over bed


560 mm
For several reasons, both pairs of axes cannot work all the 22.05 inches
time. Because of this restriction, special programming fea- Maximum turning diameter
350 mm
13.76 inches
tures such as synchronized waiting codes (typically Miscel-
Maximum 550 mm
laneous Function), the ability to estimate how much time turning length
21.65 inches
each tool requires to complete each operation, etc., are re-
Spindle bore
85 mm
3.34 inches
quired. There is a level of compromise here, because only
one spindle speed can be used for both active cutting tools, Bar capacity
71 mm
2.79 inches
although feedrate independent for both pairs of axes.
is
Number of tools 12
This means that some machining operations simply cannot
be done simultaneously. Tool size square
25 mm
1 inch

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

Axis travel in Z axis 635 mm


Six-axis Lathe 25 inches
16000 mm/min
Rapid traverse rate X axis
Six-axis CNC lathes are specially designed lathes with a 629 in/min
twin turret and a set of three axes per turret. This design in- 24000 mm/min
Rapid traverse rate Z axis 944 in/min
corporates many tool stations, many of them power driven,
0.01 - 500 mm/rev
as well as back-machining capabilities. Programming these Cutting feedrate .0001 - 19.68 in/rev
lathes is similar to programming a three-axis lathe twice.
Chuck size
254 mm
10 inches
The control system automatically provides synchroniza-
tion, when necessary. Main spindle motor
AC 1 5/1 1 kW
AC 20/14.7HP

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

Rotating tool speed 30 - 3600 r/min


A look at a typical promotional brochure describing a
CNC machine tool is very useful in many respects. In most Milling motor
AC 3. 7/2. 2 kW
AC 5/2.95 HP
cases, the artwork quality impressive, the printing, pho-
is
Collet size
1 - 16 mm
tographs, paper selection and the use of colors is equally .04 - .63 inches

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

Control Features Rapid traverse rate different for X and Z axes

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

X axis represents a diameter, not a radius


Thread cutting feedrate available with six-decimal
Constant surface speed (CSS) is standard control feature
place accuracy (for inch units)
(G96 for CSS and G97 for r/min)
Least input increment in X axis is 0.001 mm or .0001
Absolute programming mode is X or Z or C inches on diameter - one half of that value per side

Incremental programming mode is U or W or H


4 COORDINATE GEOMETRY

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.

Zero integer ... 0

J Positive integers . . 1 , 2 ,
+3 ,
10 12943 , , +45
(with or without sign)

Negative integers ... -


4 ,
- 381 ,- 25 -77 ,

(minus sign required)

Fractions... 1 /8 , 3 / 16 , 9/ 32 35/64 ,

I I l-H —l-H— — — —t-H —


I I I- I

Decimal fractions . . 0 185


.
, . 2 , . 546875 3.5 ,

All groups are used almost daily. These groups represent


the mainstream of just about all applications of numbers in
modern life. In CNC
programming, the primary goal is to
use the numbers to ’translate' the drawing, based on its di-
mensions, into a cutter path.

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

has to be translated into a CNC program, using primarily


numbers. Numbers are also used to describe commands, The concepts used in design, drafting and in numerical
functions, comments, and so on. The mathematical concept control are over 400 years old. A given point can be mathe-

of a real number system can be expressed graphically on a matically defined on a plane (two coordinate values) or in

straight line, called the number scale where all divisions ,


space (three coordinate values). The definition of one point
is relative to another point as a distance parallel with one of
have the same length - Figure 4-1.
three axes that are perpendicular to each other. In a plane,
only two axes arc required, in the space, all three axes must

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:

An axis is a straight line passing through


the center of a plane or a solid figure,
around which the parts are symmetrically arranged

The definition can be enhanced by a statement that an


axis can also be a line of reference. In CNC programming,
an axis used as a reference all the time. The definition
is

contains the word ‘plane’. A plane is a term used in 2D ap-


plications, while a solid object is used in 3D applications.
Figure 4-4
Mathematical definition of a plane is:
Point of origin - intersection of axes

A plane is a surface in which a straight line joining


This intersection has a special meaning in CNC program-
any two of its points will lie wholly in the surface
ming. The origin acquires a new name, typically the pro-
gram reference point. Other terms are also used: program
From the top viewpoint of the observer, looking straight zero, part reference point, workpiece zero, part zero, with
down on the illustration Figure 4-3, a viewing direction is the same meaning and purpose.
established. This is often called viewing a plane.
Quadrants

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,

A quadrant is any one of the four parts of the plane

formed by the system of rectangular coordinates

The word quadrant (from word quadrans or


the Latin
quadrantis, meaning the fourth part), suggests four
uniquely defined areas or quadrants. Looking down in the
top view at the two intersecting axes, the following defini-
tions apply to quadrants. They are mathematically correct
and are used in CNC/CAD/CAM applications:

Figure 4-3 Quadrant 1


UPPER RIGHT
Axis designation - viewing plane
Quadrant UPPER LEFT
Mathematical designation is fully implemented in CNC II

Quadrant III LOWER LEFT


tal axis, the letter Y identifies its vertical axis. This plane is

XY plane. Defined mathematically, the horizon- Quadrant IV LOWER RIGHT


called the
tal axis is always listed as the first letter of the pair. In draft-
ing and CNC programming, this plane is also known as the The quadrants are defined in the counterclockwise direc-

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

The counting starts at the positive side of the horizontal


axis. Figure 4-5 illustrates the definitions.

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

Quadrants in the XY plane and their identification

Any point coordinate value can be positive, negative or


Coordinate definition of points within the rectangular coordinate
zero. Any coordinate value is determined solely by the lo- system (point PI = Origin =X0Y0)
cation of the defined point in a particular quadrant and its

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

- + The majority of CNC machines are programmed using


QUADRANT II
the so called absolute coordinate method, that is based on

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

IMPORTANT: Machine geometry is the relationship of distances be-


... If the defined point lies exactly on the X axis, tween the fixed point of the machine and the selectable
it has the Y value equal to zero (YO). point of the part. Typical geometry of a CNC machine uses
... If the pointlies exactly on the Y axis, the right hand coordinate system. The positive and negative
it has the X value equal to zero (XO). axis direction is determined by an established viewing con-
the point lies exactly on both X and Y axes,
basic rule for the Z axis is that it is always the
... If
vention. The
both X and Y values are zero (XO YO).
axis along which a simple hole can be machined with a sin-
gle point tool, such as a drill, reamer, wire or a laser beam.
X0Y0Z0 is the point of origin. In part programming, pos-
itive values are written without the plus sign - Figure 4-7. The Figure 4-8 illustrates the standard orientation of an
XYZ type machine tools.

Right Hand Coordinate System


Axis Orientation - Milling
In the illustrations of the number scale, quadrants and
axes, the origin divides each axis into two portions. The A typical 3-axis machine uses three controlled axes of
zero point - the point of origin - separates the positive sec- motion. They are defined as the X axis, the Y axis, and the Z
tion of the axis from the negative section. In the right-hand
axis. The X axis is parallel to the longest dimension of the
coordinate system, the positive axis begins at the origin and machine table, Y axis is parallel to the shortest dimension
is directed towards the right for the X axis, upwards for the of the table and the Z axis is the spindle movement. On a
Y axis and towards the perpendicular viewpoint for the Z vertical machining center, the X axis is the table longitudi-

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

Typical machine axes of a CNC lathe Iturning center)

Figure 4-8 Another variety, a vertical CNC


lathe, is basically a hori-

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

spindle direction. Horizontal machine can be viewed as a


A CNC machine of any type can be designed with one or
more additional axes, normally designated as the second-
vertical machine rotated in space by ninety degrees. The
additional feature of a horizontal machining center is the
ary axes using the U, and V W
letters. These axes are nor-

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

Axis Orientation - Turning


X axis Y axis Z axis
X and Z. More axes are related related related
Most CNC lathes have two axes,
available, but they are not important at this point. A special
Figure 4- 1
third axis, the C axis, is designed for milling operations
(live tooling) and is an option on the typical CNC lathe. Relationship of the primary and the secondary machine 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.

CRT DISPLAY SCREEN RESET KEY EDIT KEYS

HELP KEY ADDRESS NUMERIC


KEYBOARD KEYBOARD

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

Feature Description Feature Description

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

Enables program testing at fast


Dry Run Key (switch) to allow program editing
feedrates (without a mounted part)

Spindle Overrides the programmed spindle speed, Error Lights Red light indicating an error
Override usually within 50-120% range

Even is some features may not be listed, virtually all of


Feedrate Overrides the programmed feedrate,
usually within 0-200% range
those in the table are somewhat related to the CNC pro-
Override
gram. Many control systems have unique features of their
Shows current status of the chuck own. These features must be known to the CNC operator.
clamping (Outside / Inside clamping) The program supplied to the machine should be flexible,
not rigid - it should be ‘user friendly’.
Table Clamp Shows current status of table clamping

Screen Display and Keyboard


Coolant
Coolant control ON / OFF / AUTO
Switch The screen display is the ‘window’ to the computer. Any
active program can be viewed, including the status of the
Gear Shows current status of working
control, current tool position, various offsets, parameters,
gear range selection
Selection
even a graphic representation of the Tool Path. On all CNC
units, individual monochrome or color screens can be se-
Spindle Indicates spindle rotation direction
(clockwise or counterclockwise) lected to have the desired display at any time, using the in-
Rotation
put keys (keyboard pads and soft keys). Setting for interna-
Spindle tional languages is also possible.
Manual orientation of the spindle
Orientation
The keyboard pads and keys are used to input in-
soft

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

Handle SYSTEM FEATURES


For the setup purposes, each CNC machine has a rotary
handle that can move one selected axis by as little as the The CNC unit is nothing more than a sophisticated spe-
least increment of the control system. The official Fanuc cial purpose computer. The ‘special purpose’ in this case is
name for the handle is Manual Pulse Generator. Associ- a computer capable of controlling the activities of a ma-
ated with the handle is the Axis Select switch (often dupli- chine tool such as a lathe or a machining center. It means
,

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.

A good example is a CNC unit for two machines that are


thesame in all respects except one. One machine has a
manual tool changer, the other has an automatic tool
changer. In order to support the automatic tool changer, the
CNC unit must have special features built-in, that are not

required for a machine without the tool changer. The more


complex the CNC system is, the more expensive it is. Users
that do not require all the sophisticated features, do not pay
a premium for features they do not need.

Parameter Settings

The information that establishes the built-in connection


between the CNC control and the machine tool is stored as
special data in internal registers, called the system parame-
ters. Some of the information in this handbook is quite spe-
cialized and listed for reference only. Programmers with
limited experience do not need to know system parameters
in a great depth. The original factory settings are sufficient
for most machining jobs.

When the parameter screen is displayed, it shows the pa-


rameter number with some data in a row. Each row of num-
Figure 5-3 bers represents one byte , each digit in the byte is called a
An example of a detached handle, called the Manual Pulse bit. The word bit is made from the words Binary diglT and
Generator (MPG), with a typical layout and features. is the smallest unit of a parameter input. Numbering of bits
Layout and features may vary on different machine models.
starts with 0, read from the right to the left :

#6 #5 #4 #3 #2 #1 #0
Handle
Multiplier
One handle

for Metric units


division motion is

for English units


...
Number

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:

X10 0.010 mm .0010 inch Binary codes

Units inputs
X100 0.100 mm .0100 inch
Setting values
CONTROL SYSTEM 23

The binary input Parameters related to High-Speed Skip Signal Input


The groups use different input values.
Parameters related to Automatic Tool Compensation
can only have an input ot a 0 or for the bit data format, 0
1

broader scope - Parameters related to Tool Life Management


to +1 27 for the byte type. Units input has a
Parameters related to T urret Axis Control
the unit can be in mm, inches, mm/min, in/min, degrees,
Parameters related to High Precision Contour Control
milliseconds, etc. A value can also be specified within a
Parameters related to Service ... and other parameters
given range, for example, a number within the range of
0-99, or 0-99999, or +127 to -127, etc. .
Quite a few parameters have nothing to do with daily pro-
gramming and are listed only as an actual example. All sys-
A typical example of a binary input is a selection be-
tem parameters should be set or changed only by a quali-
tween two options. For instance, a feature called dry run A
fied person, such as an experienced service technician.
can be set only as effective or ineffective. To select a prefer-
0 programmer or operator should not modify any parameter
ence, an arbitrary bit number of a parameter has be set to
settings. These changes require not only qualifications but
to make the dry run effective and to 1 to make it ineffective.
authorization as well. Keep the list ol original parameter

Units input , for example, is used to set the increment sys- settings away from the control, in a sate place, just in case.

tem - the dimensional units. Computers in general do not


distinguish between inch and metric, just numbers. It is up Take care when changing control system parameters !

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

etc. Such values must never be set higher than


the The once
safest rule to observe is that
speed, monitor this activity.
machine can support. An indexing axis with a minimum in- the parameters have been set by a qualified technician, any
crement of 1°, will not become a rotary axis with .001° in- temporary changes required for a given work should be
crement, just because the parameter is set to a lower value, done through the CNC program. If permanent changes are

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.

To better understand what the CNC


system parameters
System Defaults
can do, here is an abbreviated of parameter classifi-
listing

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
, ,

Parameters related to Setting


common selections. That does not mean they will be the
Parameters related to Axis Control Data
preferred settings - it means they were selected on the basis
Parameters related to Chopping
of their common usage. Many settings are rather conserva-
Parameters related to the Coordinate System
tive in their values, for safety reaspns.
Parameters related to Feedrate
Parameters related to Acceleration/Deceleration Control The set of parameter values established at the time of in-
Parameters related to Servo stallation are called the default settings.The English word
Parameters related to DI/D0 'default' is a derivative of a French word ‘defaut’, that can
Parameters related to MDI, EDIT, and CRT be translated as ‘assumed’. When the main power to the
Parameters related to Programs controlis turned on, there are no set values
passed to pa-
Parameters related to Serial Spindle Output rameters from a program, since no program has yet been
Parameters related to Graphic Display automati-
used. However, certain settings become active
Parameters related to 1/0 interface without an external program. For instance, a cutter ra-
cally,
Parameters related to Stroke Limit the
dius offset is automatically canceled at the startup of
Parameters related to Pitch Error Compensation canceled are the fixed cycle mode and
control system. Also
Parameters related to Inclination Compensation certain condi-
tool length offset. The control ‘assumes 'that
Parameters related to Straightness Compensation
tions arc preferable to others. Many operators will
agree
Parameters related to Spindle Control although not necessarily
with most of these initial settings,
Parameters related to Tool Offset
with of them. Some settings are customizable by a
all
Parameters related to Canned Cycle
change of a parameter settings. Such settings will become
Parameters related to Scaling and Coordinate Rotation
permanent and create a new 'default'.
Parameters related to Automatic Corner Override
Parameters related to Involute Interpolation
Always document any changes to the parameters!
Parameters related to Uni-directional Positioning |

Parameters related to Custom Macro (User Macro)


Parameters related to Program Restart
24
Chapter 5

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.

For example, a tool motion has three basic modes - a


One alternative is running the CNC program from a per-
rapid motion, a linear motion and a circular motion. The
sonal computer. An inexpensive communication software
default motion setting is controlled by a parameter.
Only and cabling is required to connect the computer with the
one setting can be active at the startup. Which one? The an-
CNC system. The simplest version is to transfer the CNC
swer depends on the parameter setting. Many parameters program from one computer
can be preset to a desired state. Only the rapid or the linear
to the other. More sophisti-
cated possibility includes software and cables that
mode can be can actu-
set as default in the example. Since the rapid ally run the machine from the personal
computer, without
motion is the first motion in the program, it seems to make
sense to make
loading it to the memory of the first. This method is CNC
it a default - but wait! often called 'drip-feeding' or 'bitwise input’. When
oper-
Most controls are set to the linear motion as the default ated from the personal computer, the program can be CNC
as long as the capacity of the storage device,
(GO command), to be in effect at the start - strictly for
I typically the
hard drive.
safety reasons. When the machine axes are moved manu-
ally, the parameter setting has no effect. If a manual input of Most CNC programs will fit into the internal memory of
an axis command
value takes place, either through the pro- the control system. Many controls use the number of avail-
gram or from the control panel, a tool motion results. If the able characters or the equivalent length of tape.
Here are
motion command is not specified, the system will use the some formulas that can be used to get at least the approxi-
command mode that had been preset as the default in the mate memory capacity calculations:
parameters. Since the default mode is a linear motion G01,
the result is an error condition, faulting the system/or
the
lack of a feedrate! There is no cutting feedrate in effect,
O Formula 1 :

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.

It is beneficial to know the default settings of


Sm = Nc x .00254
all controls
in the shop. Unless there is a good reason to do otherwise,
defaults for similar controls should be the same. US’ where . .

Memory Capacity Sm = Storage capacity in meters


Nc = Memory capacity (number of characters)
CNC programs can be stored in the control memory. The
program size is only limited by the capacity of the control. O Formula 2
This capacity is measured in a variety of ways, originally as
To find the length of program in feet, when the capacity is
the equivalent length of tape in meters or feet, lately as the
known in characters, use the following formula:
number of bytes or the number of screen pages. A common
minimum memory capacity of a CNC lathe control is 20 m
ol tape (66 This
an old fashioned method that some-
ft). is
- Nc
s
how persisted in staying with us. On CNC milling systems, °f
120
the memory requirements based on the same criteria are
generally larger and the typical minimum memory capacity
is 80 m or about 263 It. Optionally, larger memory capacity tar where . .

can be added to the control system. The minimum memory


capacity of the control varies from one machine to another - S, = Storage capacity in feet
always check control specifications carefully. Nc = Memory capacity (number of characters)
CONTROL SYSTEM 25

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-

r m other. This continuity is important for production, but not


v—
practical when proving a new program, for example.
.00254
To disable the continuous program execution, a Single
Block switch is provided on the operation panel. In the sin-
i® where
1

. .
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

axes active at the time. This feature is convenient


all

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 . .

feedhold switch will be illuminated (in red light), as long as


C = Number of available characters it is effective. The CNC
programmer can override the feed-
f = Memory capacity in feet hold from within the program, for special purposes.

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.

Pressing the emergency stop button is not always the best


If a program needsbe interrupted in the middle of pro-
to or even the only way to stop a machine operation. In fact,
cessing, the control system offers several ways to do that, the latest controls offer other features, far less severe, de-
using the machine operation panel. The most common fea- signed to prevent a collision between a cutting tool and the
tures of this type are toggle switches or push buttons for a part or fixture. Previously discussed feedhold button is only
single block operation, feedhold and the emergency stop. one option, along with other features. If the emergency stop
must be used at all, it should be used as the last resort, when
Single Block Operation any other action would require unacceptably longer time.
ma- There is no need for panic, if something does go wrong.
The normal purpose of a program is to control the

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.

During setup, the rapid motion rate may require some


PROGRAM DATA OVERRIDE program proving, when high rapid rates are un-
control for
comfortable to work with. After the program had been
All CNC units are designed with a number of special ro-
proven, rapid rate can be applied at its maximum. ma- CNC
tary switches that share one common feature - they allow chines are equipped with a rapid override switch to allow
the CNC operator to override the programmed speed of the temporary rapid motion settings. Located on the control
spindle or the programmed speed of the axis motion. For panel, this switch can be set to one of the four settings.
example, a 15 in/min feedrate in the program produces a Three of them are marked as the percentage of the maxi-
slight chatter. A knowledgeable operator will know that by mum rate, typically as 100%, 50% and 25%. By switching
increasing the feedrate or decreasing the spindle speed, the to one of them, the rapid motion rate changes. For example,
chatter may be eliminated. It is possible to change the if the maximum 500 in/min or 2700 mm/min,
rapid rate is 1

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

(changes cutting motions to a variable speed) are aware of the changes.


CONTROL SYSTEM 27

Spindle Speed Override Feedrate Override

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

by using the spindle speed override switch located on the ,


controls, the feedrate is programmed in in/rev or in mm/rev.

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.

ting, the CNC operator may experiment with the spindle


The new feedrate calculation, based on the overridden
speed override switch to find the optimum speed for the
feedrate setting, is similar to that for spindle speed:
given cutting conditions. This method is a much faster than

‘experimenting’ with the program values.


Fn = F x p x 0.01
p
The spindle speed override switch can be continuous on
some controls or selectable in increments of 10%, typically
US' where
within the range of 50-120% of the programmed spindle
. .

speed. A spindle programmed at 1000 r/min can be over-


F„ = Optimized - or new - feedrate
ridden during machining to 500, 600, 700, 800, 900,. 1000, programmed feedrate
F = Originally
1 100 and 1200 r/min. This large range allows the op- CNC p
= Percentage of feedrate override
p
erator the flexibility of optimizing the spindle rotation to
suit the cutting conditions. There is a catch, however. The Feedrate can be overridden within a large range, typically
optimized spindle speed change may apply to only one tool from 0% to 200% or at least 0% to 150%. When the
of the many used in the program. No CNC operator can be feedrate override switch machine is set to 0%, the CNC
expected to watch for that particular tool and switch the will stop the cutting motion. Some CNC machines do not

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.

tool, write it down, then change the program accordingly,


100% spindle override There are situations, where the use of a feedrate override
so cdl the tools can be used at the
would damage the part or the cutting tool - or both. Typical
setting for production.
examples are various tapping cycles and single point
Comparison of the increments on the spindle override threading. These operations require spindle rotation syn-
switch with the increments on switches for the rapid tra- chronized with the feedrate. In such cases, the feedrate
verse override (described earlier) and the feedrate override override will become ineffective. The feedrate override will
(described next), offers much more limited range. The rea- be effective, if standard motion commands GOO and G01
son for the spindle speed range of 50% to 120% is safety. are used toprogram any tapping or tread cutting motions.
To illustrate with a rather exaggerated example, no operator command G32, tapping fixed cycles
Single point threading
would want to mill, drill or cut any material at 0 r/min (no G74 and G84, as well as lathe threading cycles G92 and
spindle rotation), possibly combined with a heavy feedrate. G76 have the feedrate override cancellation built into the

software. All these and other related commands are de-


order to change the selected override setting into 100%
In
scribed later in the handbook, in more detail.
speed in the program, a new spindle speed has to be calcu-
lated. If a programmed spindle speed of 1200 r/min lor a Dry Run Operation
tool is always set to 80%, itshould be edited in the program
to 960 r/min, then used at 100%. The formula is quite sim- Dry run is a special kind of override. It is activated from

ple: x- the control panel by the Dry Run switch. only has a direct It

effect on the feedrate and allows much higher feedrate than


thatused for actual machining. In practice, it means the
Sn = Sp X p X 0.01
program can be executed much faster than using a feedrate
override at the maximum setting. No actual machining
csr where . .
takes place when the dry run switch is in effect.

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

and the dry run is used as well, it is very


the holding device Sequence Return
important to provide sufficient clearances. Usually, it
means moving Sequence Return is a function controlled by a switch or a
the tool away from the part. The program is
then executed ‘dry’, without actual cutting, without a cool- key on the control panel. Its purpose is to enable the CNC
operator to start a program from the middle of an inter-
Because of the heavy feedrates in the dry
ant, just in the air.
rupted program. Certain programmed functions are memo-
run, the part cannot he machined safely. During a dry run,
the program can be checked for all possible errors except rized (usually the last speed and feed), others have to be in-

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' '

>

group. These functions are:

Z Axis Neglect

Another very useful tool for testing unproven programs


Miscellaneous functions lock Locks M functions
on CNC machining centers (not lathes) is a toggle switch Spindle functions lock Locks S functions
located on the operation panel called the Z Axis Neglect or
ZAxis Tool functions lock
Ignore. As either name suggests, when this switch is
Locks T functions
activated, any motion programmed for the Z-axis will not
be performed. Why the Z axis? Since the X and Y axes are
As described later in this chapter, auxiliary functions
used to profile a shape of the part (the most common con-
touring operations), it would make no sense to temporarily
generally relate to the technological aspects of the CNC
programming. They control such machine functions as
cancel either one of these axes. By neglecting (disabling)
spindle rotation, spindle orientation, coolant selection, tool
the Z axis temporarily, the CNC operator can concentrate
changing, indexing table, pallets and many others. To a
on proving the accuracy of the part contour, without worry-
lesser degree, they also control some program functions,
ing about the depth. Needless to say, this method of pro-
such as compulsory or optional program stop, subprogram
gram testing must take place without a mounted part (and
flow, program closing and others.
normally without a coolant as well). Be careful here! It is
important to enable or disable the switch at the right time. When the auxiliary functions are locked, all machine re-
If the. 7. axis motion is disabled before the Cycle Start key is lated miscellaneous functions M, all spindle functions S
pressed, all following Z axis commands will be ignored. If and all tool functions T will be suspended. Some machine
the motion enabled or disabled during program process-
is tool manufacturers prefer the name M ST Lock rather than
ing, the position of the Z axis may be inaccurate. Auxiliary Functions Lock. The MST is an acronym of the
firstletters from the words Miscellaneous Spindle and
The Z axis neglect switch may be used in both the manual Tool referring to the program functions that will be locked.
,

and automatic modes of operation. Just make sure that the


motion along the Z axis is returned to the enabled mode, The applications of these locking functions arc limited to
once the program proving is completed. Some CNC ma- the job setup and program proving only and are not used for
chines require resetting of the Z axis position settings. production machining.

Manual Absolute Setting - Machine Lock


If this feature is installed on the control (some controls Machine Lock function is yet another control feature for
use it automatically), it enables the CNC operator to re- program proving. So far, we have looked at the Z axis Ne-
sume a program in the middle of processing. Manual abso- glect function and the locking of the auxiliary functions.
lute can save time, particularly when processing long Remember that the Z axis Neglect function will disable the
programs. Manual Absolute setting switch is not a typical motion of the Z axis only and the Auxiliary Functions Lock
option. To some extent, it is functionally related to the Se- (also known as the MST lock ) locks the miscellaneous
quence Return setting. Check
machine tool documenta-
the functions, the spindle functions and the tool functions. An-
tion before using either of these two features. other function, also available through the control panel, is
called the Machine Lock. When this function is enabled,
the motion of all axes is locked. It may seem strange to test
CONTROL SYSTEM
29

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.

Practical Applications SYSTEM OPTIONS


Many of the control features described in this chapter, are
used in conjunction with each other. A good example is
Optional features on a CNC system are like options on a
car. What is an option atone dealership, maybe a standard
Dry Run used conjunction with the Z axis Neglect or the
in
feature at another. Marketing strategies and corporate phi-
Auxiliary Functions Lock. By knowing what function are
losophies have a lot to do with this approach.
available, the CNC operator makes a choice to suit the
needs of the moment. There are many areas of equal impor- Here is a look at some control features that may or may
tance on which the CNC
operator has to concentrate when not be classified as optional on a particular system. But
setting up a new job or running a new program. Many fea- some important disclaimer first:
tures of the control unit are designed to make the operator’s
job easier. They allow concentration on one or two items at This handbook covers the subject matter relating
a time rather than the complexity of the whole program. to the majority of control features, regardless of whether they
These features have been covered in a reasonable detail, are sold as a standard or an optional feature of the system.
now is the time to look at some practical applications. It is up to the user to find out what exact options are installed
on a particular control system.
During the initialization of a new program run, a good
CNC operator will take certain precautions as a matter of Graphic Display
fact. For example, the first part of the job will most likely be

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

In-Process Gauging Machining Cycles

Both the milling and the turning controls offer a variety


During many unattended machining operations, such as
manufacturing, a periodic of machining cycles. Typical machining cycles for milling
in manufacturing cells or Agile
operations are called fixed cycles, also known as the canned
chocking and adjusting dimensional tolerances of the part
wears out. or perhaps be cycles. They simplify simple point-to-point machining op-
is imperative. As the cutting tool
dimensions may fall into the erations such as drilling, reaming, boring, backboring and
cause of other causes, the
‘out-of-tolerance’ zone. Using a probe device and a suitable tapping. Some CNC systems also offer cycles for face mill-

ing, pocket milling, hole patterns, etc.


program, the In-Process Gauging option offers quite a sat-

isfactory solution. The CNC part program for the


CNC lathes also have many machining cycles available
In-Process Gauging option will contain ^ome quite unique finish-
to remove material by automatic roughing, profile
format features - it will be written parametrically, and
will
ing, facing, taper culling, grooving and threading. Fanuc
Custom
be using another option of the control system
- the
controls call these cycles Multiple Repetitive Cycles.
Macros (sometimes called the User Macros), which offer
programming. All these cycles are designed for easier programming
and
the variable type
control
faster changes at the machine. They are built
in the
If a company or a CNC
machine shop is a user of the In-
and cannot be changed. Programmer supplies the cutting
other
Process Gauging option, there are good chances that values during the program preparation by using the
appro-
to the CNC
control options are also installed and available priate cycle call command. All the processing is done
auto-
programmer. Some the most typical options are probing
by the CNC system. Of course, there will always
ol
matically,
management, macros, etc. This technol-
software, tool life
be special programming projects that cannot use any cycles
ogy goes a too far beyond standard CNC program-
be programmed manually or with the use of an
little
and have to
ming* although closely related and frequently used.
it is
external computer.
Companies that already use the numerical control technol-
options to re-
ogy, will be well advised to look into these Cutting Tool Animation
main competitive in their field.

Many of the graphic tool path displays defined earlier, are


Stored Stroke Limits represented by simple linesand arcs. The current tool posi-
tion usually the location of the line or arc endpoint on the
Definition of an area on a CNC lathe or a cube on a CNC is

screen. Although this method of displaying the


motion of
machining center that is safe to work within, can be stored the cutting tool graphically is certainly useful, there are two
stored stroke limit.
as a control system parameter called disadvantages to it. The shape of the cutting tool and the
These stored stroke limits are designed to prevent a colli- material being removed cannot be seen on the screen and
a
sion between the cutting tool and a fixture, the
machine tool
tool path simulation may help a bit. Many
modern controls
or the part. The area (2D) or the cube (3D) can
be defined
incorporate a graphic feature called Cutting Tool Anima-
for the cut-
as either enabled for the cutter entry or disabled tion. If available on the control, it shows the
blank of the
ter entry. It can be set manually on the
machine or, if avail- As the pro-
part, the mounting device and the tool shape.
one
able, by a program input. Some controls allow only gram executed, the
is CNC
operator has a very accurate vis-
area or cube to be defined, others allow more. ual aid in program proving. Each graphic
element is identi-
fied by a different color, for even a better
appearance. The
When this option is ineffect and the CNC unit detects a
blank mounting device and the
size, the tool shape can be
motion in the program that takes place within the forbidden
preset for exact proportions and a variety of tool shapes can
zone, an error condition results and the
machining is inter-
be stored for repetitive use. This option is a good
example
rupted. A typical applications may include
zones occupied
control
a chuck, a rotary table, and even an of CAD/CAM-like features built into a stand-alone
by a tailstock, a fixture,
system.
unusually shaped part.

Connection to External Devices


Drawing Dimensions Input
pro- The CNC computer can be connected to an external de-
An option that seems somewhat neglected, is the
input of the dimensions from vice, usually another computer. Every CNC unit has one or
gramming method by using
known coordi- more connectors, specifically designed for interfacing to
an engineering drawing. The ability to input
given angles directly from the peripheral devices. The most common device is called
nates, radii, chamfers and
some- RS-232 (EIA standard), designed for communications be-
drawing makes it an attractive option. This ability is
program portability. Such an tween two computers. Setting up the connection with exter-
what overshadowed by poor CNC operator
the shop, in or- nal devices is a specialized application. The
option must be installed on all machines in
other set-
uses such a connection to transfer programs and
der to use the programmed features efficiently.
and
computers, usually for storage
tings between two
backup purposes.
6 PROGRAM PLANNING

The development of any CNC


program begins with a The initial part information is not limited to the drawing
very carefully planned process. Such a process starts with and the material data - it also includes conditions not cov-
the engineering drawing (technical print) of the required ered in the drawing, such as pre- and post- machining,
part released for production. Before the part is machined, grinding allowances, assembly features, requirements for
several steps have to be considered and carefully evaluated. hardening, next machine setup, and others. Collecting all
The more effort is put into the planning stage of the this information provides enough material to start planning
program, the better results may be expected at the end. the CNC program.

STEPS IN PROGRAM PLANNING MACHINE TOOLS FEATURES


The program planning are decided by
steps required in No amount of initial information is useful if the CNC
the nature of the work.There is no useful formula for all the machine is not suitable for the job. During program plan-
jobs, but some basic steps should be considered: ning, programmer concentrates on a particular machine

Initial information / Machine tools features


tool, using a particular CNC system. Each part has to be
setup in a fixture, the CNC machine has to be large enough
Part complexity to handle the sizeof the part, the part should not be heavier
Manual programming / Computerized programming
than the maximum
weight allowed. The control system
must be capable to provide the needed tool path, and so on.
Typical programming procedure
In most cases, the CNC equipment is already available in
Part drawing Engineering data
/
the shop. Very few companies go and buy a new CNC ma-
Methods sheet / Material specifications chine just to suit a particular job. Such cases are rather rare
and happen only if they make economic sense.
Machining sequence

Tooling selection Machine Type and Size


Part setup The most important considerations in program planning

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.

The keyword in the acronym CIM is - integration. It


means putting all the elements of manufacturing together
TYPICAL PROGRAMMING PROCEDU RE
and work with them as a single unit and more efficiently.
The main idea behind a successful integration is to avoid Planning of a CNC program is no different than any other
duplication. One of the most important rules of using a planning - at home, at work, or elsewhere -
it must be ap-

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

visions, special instructions, etc. Data in the title block sup-


PART DRAWING ply crucial information for CNC programming and can be
used for program documentation to make easier cross ref-
The part drawing is the single most important document erencing. Not all title block information is needed in pro-
used in CNC programming. It visually identifies the shape, gramming, but may be used for program documentation.
dimensions, tolerances, surface finish and many other re-
quirements for the completed item. Drawings of complex Revision dates in a drawing arc associated with the title
parts often cover many sheets, with different views, details block. They are important to the programmer, as they indi-

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,

velopment of a particular program. Unfortunately, many


drafting methods do not reflect the actual manufac- CNC Dimensioning
designer's thinking rather
turing process. They reflect the ,

drawing arc either in English or


drawings gen- Dimensions on the part
than the method of manufacturing. Such are
metric dimensions
units. Individual can be referenced from
erally correct in technical sense, but they are harder to study can be consecutive, measured
a certain datum point or they
by the programmer and may need to be interpreted’ to be dimension. Often, both types ol dimen-
from the previous
of any value in CNC programming. Typical examples
are
sions are mixed in the same drawing. When writing the
methods of applying dimensions, absence of a datum point
program, it may be more convenient to translate all con-
that can be used as a program reference point and
the view
secutive or incremental
- - dimensions into datum - or abso-
orientation in drawn. In the CAD/CAM
which the part is
lute dimensions.
- Most CNC programs benefit from draw-
environment, the traditional gap between the design, draft- dimensioning. Similarly,
ings using datum, or absolute
ing and CNC programming must be eliminated. Just as
it

when developing a subprogram for tool path translation, an


helps the programmer to understand designer’s intentions,
CNC incremental method of programming may be the right
it helps the designer to
understand the basics of pro-
choice - and the choice depends on the application. The
gramming. Both, the designer and the programmer have to for CNC machines
most common programming method
understand each other’s methods and find common ground method (Figure 6-2),
uses the absolute dimensioning
that makes the whole process of design and
manufacturing
mainly because of the editing ease within the CNC system.
coherent and efficient.

Title Block

The block - Figure 6-1 - is typical to all professional


title

drawings. Its purpose is to collect all the descriptive infor-


mation related to the particular drawing.

Figure 6-2

Program using ABSOLUTE dimensions


Only one change in the program is necessary

With the absolute system of dimensioning, many pro-


Figure 6-
gram changes can be done by a single modification. Incre-
mental method requires at least two modifications. The dif-
A title block example of an engineering drawing
ferences between the two dimensioning systems can be

The and contents of a title block vary between com-


size
compared in Figure 6-2, using the absolute dimensioning
panies, depending on the type of manufacturing and inter-
method, and in Figure 6-3, using the incremental dimen-
usually a rectangular box, positioned in sioning method. The word incremental is more common in
nal standards. It is

the corner of the drawing, divided into several small boxes.


CNC, in drafting the equivalent word would be relative.
The contents of the title block include such items as the part Both illustrations show the a) figure before revision, and
the b) figure after revision.
name and part number, drawing number, material data, re-
PROGRAM PLANNING
35

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?

a There are some choices. The dimension on the high side


may be programmed as X75.0 and X74.95 on the low side
70 — ^ of the range. A middle value of X74.975 is also a choice.
u
( 4Q a 1
t)U
Each selection is mathematically correct. A creative CNC
i 1 programmer looks not only for the mathematical points,
but for the technical points as well. The cutting edge of a
b tool wears out with more parts machined. That means the
machine operator has to fine-tune the machined size by us-
Figure 6-3
ing the tool wear offsets, available on most CNC systems.
Program using INCREMENTAL dimensions
Such a manual interference during machining process is
Two (or more) changes in the program are necessary
acceptable, but when done too often, it slows down the pro-
Fractions duction and adds to the overall costs.

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

For quality precision machining work, most part dimen-


sions have a specified range of acceptable deviation from
the nominal size, within its system of reference. For exam-

ple,an English tolerance of +.001/-.000 inches will be dif-


ferent from a metric tolerance of +0.1/-0.0 mm. Dimen-
sions of this type are usually critical dimensions and must
be maintained during CNC machining. It may be true that
the CNC operator is ultimately responsible for maintaining
the part sizes within the tolerances (providing the program
is correct) - but it is equally true, that the CNC programmer
can make the machine operatos’s task easier. Consider the
following example for a CNC lathe: Surface finish marks in a drawing:
English (top) and metric (bottom)
36 Chapter 6

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.

Many drawing instructions use a special pointer called a


leader. Usually it is a line, with an arrow on the end, point- Material Uniformity
ing towards the areq that it relates to. For example, a leader
may be pointing to a hole, with the caption: Another important consideration, often neglected by pro-
grammers and managers alike, is the uniformity of material

({>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

T01 = Spot Drill T02 = Drill T03 = Tap


Hole 1 Hole 4 Hole 1
For a metric calculation, the formula is similar:
Hole 2 Hole 3 Hole 2
. 1000 x m/min Hole 3 Hole 2 Hole 3
r/min =
71 X D Hole 4 Hole 1 Hole 4
Figure 6-5

US' where ...


Typical machining sequence
(spot drill, drill and tap shown as an example)
r/min = Revolutions per minute (spindle speeds)
12 = Converts feet to inches This machining sequence may have to be changed after
1000 = Converts meters to millimeters the final selection of tools and the setup method. The re-
ft/min = Peripheral speed in feet per minute verse sequence may not be practical in subprograms.
m/min = Peripheral speed in meters per minute
7t(pi) = Constant value of 3.141593... Program planning is not an independent execution of in-
D = Tool diameter (milling) or dividual steps - it is a very interdependent and very logi-
part diameter (turning) - in inches or mm cally coherent approach to achieve a certain goal.
38 Chapter 6

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 -

programmer should know well all general principles of cut-


ting tool applications. In many cases, a tooling representa- TECHNOLOGICAL DECISIONS
tive may provide additional valuable assistance.

The arrangement of tools in the order of usage is also a


The next stage of CNC program planning involves the se-
lection of spindle speeds, cutting feedrates, depth of cut,
subject of serious consideration in CNC program planning.
coolant application, etc. All of the already considered fac-
On CNC lathes, each cutting tool is assigned to a certain
tors will have their influence. For example, the available
turret station, making sure the distribution of tools is bal-
range of spindle speeds is fixed for any CNC machine, the
anced between short and long tools (such as short turning
size of the cutter and the type of material will influence
tools versus long boring tools). This is important for the
speeds and feeds, the power rating of the machine tool will
prevention of a possible interference during cutting or tool
help determine what amount of material can be removed
changing. Another concern should be the order in which
each cutting tool is called, particularly for machines that do
safely, etc. Other factors that influence the program design
include tool extensions, setup rigidity, cutting tool material
not have a bi-directional tool indexing. Most machining
and its Not to be overlooked is the proper selec-
condition.
centers use a random type tool selection, where the order of
tion of cutting fluids and lubricants - they, too, are impor-
tools is unimportant, only the diameter of the tool and its
tant for the part quality.
weight has to be considered.

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

Most contouring operations require more than just one


cutting motion, for example, roughing and finishing. Part
of the programming process is to isolate the area that needs
roughing. Can one cutting tool do both operations? Can all
tolerances be maintained? Is the tool wear a problem? Can
the surface finish be achieved? When programming non-
cutting rapid motions, take the same care as with cutting
motions. A particular focus should be to minimize rapid
tool motions and ensure safe clearances.

Machine Power Rating


Contouring tool path motion - as intended (lathe or mill) Machine tools are rated by their power. Heavy cuts re-
quiremore power than light cuts. A depth or width of a cut
that is too large can break the tool and stall the machine.
The tool path for all profiling tools has to take into con-
sideration the cutter radius, either by programming Such cases are unacceptable and must be prevented. The
the
equidistant path for the center of the radius or by using cut-
CNC machine specifications list the power rating of the
motor at the machine spindle. The rating is in kW (kilo-
ter radius offset. CNC machines for milling and turning are
watts) or HP (horsepower). Formulas are available for
provided with rapid motion, linear interpolation and circu-
power ratings, calculating metal removal rate, tool wear
lar interpolation, all as standard features. To generate more
complex paths, such as a helical milling motion, a special factors, etc. Useful is the comparison of k and HP (based
on HP = 550 foot-pounds per second):
1
option has to be available in the control unit. Two groups of
typical tool paths exist:
1 kW = 1.341 HP
Point-to-point also called Positioning
1 HP = 0.746 kW
Continuous also called Contouring

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.

Water soluble oil is the most common coolant. A prop-


erly mixed coolant dissipates heat from the cutting edge
and it also acts as a lubricant. The main purpose of lubrica-
tion is to reduce friction and make the metal removal easier.
The Hood of the coolant should aim at the tool cutting edge,
with a flexible pipe or through a coolant hole in the tool.

Never use plain water as a coolant -


Contouring tool path motion with identified contour change points it may severely damage the machine tool

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

from congested areas, such as deep holes and cavities.


A calculation sketch can be done directly in the drawing
or on paper. Every sketch is associated with mathematical
The benefits of cutting fluids far outweigh their incon- calculations. Using color coding or point numbering as
veniences. Cutting fluids are often messy, the cutting edge identification methods offers benefits and better organizat-

cannot be seen, operator may


wet and sometimes old
get ion. Rather than writing coordinates at each contour change

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.

WORK SKETCH AND CALCULATIONS


Manually prepared programs require some mathematical
program preparation intimidates
calculations. This part of
many programmers but is a necessary step. Many complex
contours will require more calculations, but not more com-
^——
Figure 6-8
plex calculations. Almost any math problem in CNC pro-
gramming can be solved by the use of arithmetic, algebra Coordinate sheet example - blank form (no data)
and trigonometry. Advanced fields of mathematics - ana-
lytic geometry, spherical trigonometry, calculus, surface
Such a sheet can be used for milling or turning, by filling

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.

programming system is necessary. even those that do not change. A com-


Fill-in all values,
pleted coordinate sheet is a better reference - Figure 6-9.
Those who can solve a can make cal-
right angle triangle
culations for almost any CNC
program. At the end of the Position X axis Y axis Z axis
handbook is an overview of some common math problems. START X4.275 Y3.22
When working with more difficult contours, it is often not PI X4.155 Y3.01
the solution itself that is difficult, it is the ability to arrive at P2 X4.7878 Y3.01
the solution. The programmer must have the ability to see P3 X5.1668 Y2.755
exactly what triangle has to be solved. It is not unusual to
P4 X5.1668 Y2.456
do several intermediate calculations before the required co-
P5 X5.44 Y2.1833
ordinate point can be established.
P6 X6.09 Y2.1833
Calculations of any type often benefit from a pictorial END X6.09 Y2.575
representation. Such calculations usually need a working
sketch.The sketch can be done by hand and should be done
Figure 6-9
inan approximate scale. Larger sketch scales are easier to
work with. Scaling the sketch has one great advantage - you Coordinate sheet example - filled form for milling tool path

can immediately see the relationships what dimensions -

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

A CNC program is composed of a series of sequential in- Digits


structions related to the machining of a part. Each instruc-
tion is specified in a format the CNC system can accept, in- There are ten digits, 0 to 9, available for use in a program
terpret and process. Each instruction must also conform to to create numbers. The digits are used in two modes - one
the machine tool specifications. This input method of a pro- for integer values (numbers without a decimal point), the

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

same control system. This is common, considering the spe-


The 26 letters of the English alphabet are all available for
cific demands individual machine builders place upon the
programming, at least in theory. Most control systems will
control manufacturer to accommodate many original and
accept only certain letters and reject others. For example, a
unique machine design features. Such variations are usu-
ally minor but still important for programming.
CNC lathe control will reject the letter Y, as the Y axis is

unique to milling operations (milling machines and ma-


chining centers). Capital letters are normal designation in
BASIC PROGRAMMING TERMS CNC programming, but some controls accept low case let-
ters with the same meaning as their upper case equivalent.
The field of CNC has its own terminology and special
terms and its jargon. It has own abbreviations and ex-
its If in doubt, use CAPITAL letters only!

pressions that only the people in the field understand. CNC


programming is only a small section of the computerized Symbols
machining and it has a number of its own expressions. The
Several symbols are used for programming, in addition to
majority of them relate to the structure of the program.
the digits and letters. The most common symbols are the
There are four basic terms used in CNC programming. decimal point, minus sign, percent sign, parenthesis and
They appear in professional articles, books, papers, lec- others, depending on the control options.
tures and so on. These words are the key to understanding
the general CNC terminology; Word
A program word a combination of alpha-numerical
Character ^ Word - Block -4 Program
is
characters, creating a single instruction to the control sys-
tem. Normally, each word begins with a capital letter that is
Each term is very common and important in CNC pro- followed by a number representing a program code or the
gramming and deserves its own detailed explanation. actual value. Typical words indicate the axes position, fee-
drate, speed, preparatory commands, miscellaneous func-
Character tions and many other definitions.

A character is the smallest unit of CNC program. It can Block


have one of threeTorms:
Just like the word
used as a single instruction to the
is
Digit CNC system, is used as a multiple instruction. A
the block

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

In the control system, each block must be separated from


Characters
all others. To separate blocks in the MDI (Manual Data In-
-
put) mode each block has to end with a spe-
at the control, 6 F .

cial End-Of-Block code (symbol). This code is marked as


EOB on the control panel. When preparing the program on Words
a computer, the Enter key on the keyboard will terminate
the block with the same result (similar to the old Carriage F275.0 G 0 1 N 5
Return on typewriters). When writing a program on paper
first, each program block should occupy only a single line Block
of sin-
on the paper. Each program block contains a
gle instructions that are executed together.
series
N5G01Y-6 48F275 . .

Program Figure 7-

Typical word address programming format


The program structure varies for different controls,
part
but the logical approach does not change from one control The address - the letter - in the block defines the meaning
to another. A CNC program usually begins with a program of the word and must always be written first. For example,
number or similar identification, followed by the blocks of X5.75 is correct, 5.75X is not. No spaces (space characters)
instructions in a logical order. The program ends with a are allowed within a word but they are only allowed before
stop code or a program termination symbol, such as the the word, meaning before the letter.
percent sign - %. Internal documentation and messages to
the operator may be placed in strategic places within the Data indicates the word numerical assignment. This
program. The programming format has evolved signifi- value varies greatly and depends on the preceding address.
cantly during the years and several formats have emerged. Itmay represent a sequence number N, a preparatory com-
mand G, a miscellaneous function M, an offset register
PROGRAMMING FORMATS number D or H, a coordinate word X, Y or Z, the feedrate
function F. the spindle function S, the tool function T, etc.

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

u Fixed Format NC only - no decimal point GO 1 Preparatory conunand

Word Address Format NC or CNC - decimal point M30 Miscellaneousfunction

D2 5 Offset number selection - mills


Only the very early control systems use the tab sequen-
X5 7 5. Coordinate word - jwsith’e value
tial them disappeared in the early
or fixed formats. Both of
1970’s and are now obsolete. They have been replaced by N1 0 5 Sequence number (bloc k number)

the much more convenient Word Address Format. HO 1 Tool length offset number

YO Coordinate word -zero value

WORD ADDRESS FORMAT S2500 Spindle speedfunction

Z-5.14 Coordinate word - negative value

The word address format is based on a combination of F12 0 . Feedratefunction


one letter and one or more digits - Figure 7-1. T0505 Toolfunction -lathes

In some applications, such a combination can be supple- TO 5 Toolfimetion - mills

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 . .

the notation means that the address value cannot be nega-


N25 Sequence or block number
tive a lack of sign means a positive value by implication.
-

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

The control any one block as a complete unit


will process F5 Five digits maximum, no decimal point or sign

- never partially. Most controls allow a random word order


F3.2 Five digits maximum, three digits maximum in front of
in a block, as long as the block number is specified first. the decimal point, two digits maximum behind the
decimal point, decimal point is allowed, no sign is used

FORMAT NOTATION Be careful when evaluating the shorthand notations from


a manual. There are no industry standards and not all con-
Each word can only be written in a specific way. The trol manufacturers use the same methods, so the meaning

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

notation and the third column is a description:


Short Forms

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)

Described address Arc center modifier for X axis


Shift amount in fixed cycles (X)
1
Figure 7-2 Corner vector selection for
Word address format notation X axis format in - metric mode shown X axis (old type of controls)

Arc center modifier for Y axis


The format description for each meaning would be
full
J+4.4 Shift amount in fixed cycles (Y)
unnecessarily too long. Consider the following complete J
(J+5.3) Corner vector selection for
and not abbreviated description of the address X - as a coor- Y axis (old type of controls)
dinate word that is used in the metric system:
Chapter 7

Address Notation Description Address Notation Description

K+4.4 D4 Number of divisions in G73


K Arc center modifier for Z axis
(K +- 5.3)
D Depth of cut in G71 and G72

L L4
Fixed cycle repetition count
Subprogram repetition count
E
EaE2.6
Relief amount in G74 and G75
Depth of first thread in G76

Precision feedrate for threading


Miscellaneous function

F F2.6 Feedrate function - may vary


Block number or sequence number
G G2 Preparatory commands
Program number (EIA)
0 04
or(:4 for ISO) Arc center modifier for X axis
Taper height in X for cycles
Subprogram number call 1+4.4
P4 1
X axis relief in G73
Custom macro number call (1+5.3)
Direction of chamfering

P P3 Work offset number - used with G10 Motion amount in X in G74


Arc center modifier for Z axis
P53 Dwell time in milliseconds
Taper height in Z for cycles
Block number in main program when K+4.4 Z axis relief in G73
P5 K
used with M99 (K+5.3) Direction of chamfering
Motion amount in Z in G75
Q4.4 Depth of peck in fixed cycles Thread depth in G76

m (Q5.3) G73 and G83


L 14 Subprogram repetition count
Q
amount in fixed cycle
Shift
G76 and G87 M2 Miscellaneous function

Retract point in fixed cycles N N5 Block number or sequence number


R Arc radius designation Program number (EIA)
0 04
or (:4 for ISO)
S S5 Spindle speed in r/min
Subprogram number call

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

S S5 Spindle speed in r/min or ft/min


Z+4.4 Z axis coordinate value

m
Z t—
(Z+5.3) designation T4 Tool function

Incremental value in X axis


Turning System Format U Stock allowance X axis
in

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

Absolute value in X axis


Address Notation Description X
X5.3 Dwell function with G04
Angle of thread for G76
A A3
Angle for direct drawing input
Z axis
C
IB Chamfer for direct drawing input z
ESI Absolute value in

Block number in a subprogram


P5
Startblock number in G71 and G72
PART PROGRAM STRUCTURE
45

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

Positive value or PROGRAM HEADER


+ Plus sign
addition sign in Fanuc macros

Negative value or Comments or messages may be placed in the program,


- Minus sign providing they are enclosed in parentheses. This kind of in
subtraction sign in Fanuc macros
ternaldocumentation is useful to both the programmer and
Multiplication Multiplication sign in
* operator. A series of comments at the program top is de-
sign Fanuc macros
fined as the program header where various program fea-
;

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:

El Parenthesis Program comments & messages (

(FILE NAME 01234. NC)


)

% 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

Non programmable End-Of-Block


(JOB NUMBER
(OPERATION DRILL-BORE-TAP)
4321)

Semicolon (STOCK MATERIAL . . . H.R.S. PLATE)


i
symbol (screen display only) (MATERIAL SIZE . . 8X6X2)
Variable definition or call in Fanuc
(PROGRAM ZERO XO - LEFT EDGE)
# Sharp sign
macros
( YO - BOTT EDGE)
( ZO - TOP FACE )
- Equal sign Equality in Fanuc macros (STATUS . . NOT VERIFIED)
( )
Chapter 7
46

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

00701 (ID MAX 15 CHARS) (PROGRAM NUMBER AND ID)


(SAMPLE PROGRAM STRUCTURE) (BRIEF PROGRAM DESCRIPTION)
(PETER SMID - 07 -DEC- 01) (PROGRAMMER AND DATE OF LAST REVISION)
(BLANK LINE)
N1 G20 (UNITS SETTING IN A SEPARATE BLOCK)
N2 G17 G40 G80 G49 (INITIAL SETTINGS AND CANCELLATIONS)
N3 T01 (TOOL T01 INTO WAITING POSITION)
N4 M0 6 (T01 INTO SPINDLE)
N5 G90 G54 GOO X.. Y. S. M03 T02. . (T01 RESTART BLOCK - T02 INTO WAITING POSITION)
N6 G43 Z2.0 H01 M08 (TOOL LG OFFSET - CLEAR ABOVE WORK - COOLANT ON)
(N7 G01 Z-. F. .).
(FEED TO Z DEPTH IF NOT A CYCLE)
( CUTTING MOTIONS WITH TOOL T01 )

N33 GOO G80 Z2 0 M09 .


(CLEAR ABOVE PART - COOLANT OFF)
N34 G28 Z2.0 M05 (HOME IN Z ONLY- SPINDLE OFF)
N35 M01 (OPTIONAL STOP)
( — BLANK LINE —
(TOOL T02 INTO WAITING POSITION - CHECK ONLY)
N36 T02
N37 MO (T02 INTO SPINDLE)
(T02 RESTART BLOCK - T03 INTO WAITING POSITION)
N38 G90 G54 GOO X.. Y. . S.. M03 T03
(TOOL LG OFFSET CLEAR ABOVE WORK - COOLANT ON)
-
N39 G43 Z2.0 H02 M08
(N40 G01 Z-. F. .) .
(FEED TO Z DEPTH IF NOT A CYCLE)
( CUTTING MOTIONS WITH TOOL TO 2 )

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 )

N86 GOO G80 Z2 0 M09 .


(CLEAR ABOVE PART - COOLANT OFF)
N87 G28 Z2.0 M05 (HOME IN Z ONLY - SPINDLE OFF)
N88 G28 X. Y. .
(HOME IN XY ONLY)
N89 M30 (END OF PROGRAM)
% (STOP CODE - END OF FILE TRANSFER)
8 PREPARATORY COMMANDS

The program address G identifies a preparatory com-


mand, often called the G code. This address has one and
O Example C :

only objective - that is to preset or to prepare the control N3 G90 GOO


system to a certain desired condition or to a certain mode ,
N4 ...
or a state of operation. For example, the address GOO pre- N5 ...
sets a rapid motion mode for the machine tool, the address N6 ...
G8I presets the drilling cycle, etc. The term preparatory N7 X13.0 Y10.0
command indicates its meaning - a G code will prepare the
control to accept the programming
the G code in a specific way.
instructions following
O Example D

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

not indicate whether the values are in the English or the


Modal and non-modal G-codes will be described shortly.
metric units. Neither indicates whether the motion to this
it
Each control system has its own list of available G codes.
specified target position is a rapid motion or a linear mo-
Many G codes are very common and can be found on virtu-
tion. If a look at the block cannot establish the meaning of ally all controls, others are unique to the particular control
the block contents, neither can the control system. The sup-
system, even the machine tool. Because of the nature of
plied information in such a block is incomplete therefore ,
machining applications, the list of typical G codes will be
unusable by itself. Some additional instructions for the
different for the milling systems and the turning systems.
block are required.
The same applies for other types of machines. Each group

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 !

block or within the block:

APPLICATIONS FOR MILLING


O Example A :

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

G code Description G code Description

GOO Rapid positioning G52 Local coordinate system setting

G01 Linear interpolation G53 Machine coordinate system

G02 Circular interpolation clockwise G54 Work coordinate offset 1

G03 Circular interpolation counterclockwise G55 Work coordinate offset 2

G04 Dwell (as a separate block) G56 Work coordinate offset 3

G09 Exact stop check - one block only G57 Work coordinate offset 4

GIO Programmable data input (Data Setting) G58 Work coordinate offset 5

G11 Data Setting mode cancel G59 Work coordinate offset 6

5 Polar Coordinate Command cancel G60 Single direction positioning

6 Polar Coordinate Command G61 Exact stop mode

G17 XY plane designation G62 Automatic corner override mode

G18 ZX plane designation G63 Tapping mode

G19 YZ plane designation G64 Cutting mode

G20 English units of input G65 Custom macro call

G21 Metric units of input G66 Custom macro modal call

G22 Stored stroke check ON G67 Custom macro modal call cancel

G23 Stored stroke check OFF G68 Coordinate system rotation

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

Return from machine zero G80 Fixed cycle cancel

G30 Machine zero return (reference point 2) G81 Drilling cycle

G31 Skip function G82 Spot-drilling 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

G43 Tool length compensation - positive G86 Boring cycle

Tool length compensation - negative G87 Back boring cycle

sai Position compensation* single increase G88 Boring cycle

G46 Position compensation - single decrease G89 Boring cycle

G47 Position compensation - double increase G90 Absolute dimensioning mode

G48 Position compensation - double decrease G91 Incremental dimensioning mode

G49 Tool length offset cancel G92 Tool position register

Scaling function cancel G98 Return to initial level in a fixed cycle

Scaling function G99 Return to R level in a fixed cycle


PREPARATORY COMMANDS
49

In any inconsistency between the listed codes in this


G code Description
handbook and the control system manual, the G codes
listed by the control manufacturer must be selected.
I G50

G52
Tool position register /

Local coordinate system setting


Maximum r/min preset

APPLICATIONS FOR TURNING


G53 Machine coordinate system setting

Fanuc lathe controls use three G code group types - A, B G54 Work coordinate offset 1

and C. The Type A is the most common; in this handbook,


G55 Work coordinate offset 2
all examples and explanations are Type A group, including

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

Rapid positioning G62 Automatic corner override mode


GOO

G01 Linear interpolation G64 Cutting mode

Circular interpolation clockwise G65 Custom macro call


G02

Circular interpolation counterclockwise G66 Custom macro modal call


G03

G04 Dwell (as a separate block)


G67 Custom macro modal call cancel

G68 Mirror image for double turrets


G09 Exact stop check - one block only
G69 Mirror image for double turrets cancel
G10 Programmable data input (Data Setting)

Data Setting mode cancel G70 Profile finishing cycle


G11

English units of input G71 Profile roughing cycle - Z axis direction

Metric units of input G72 Profile roughing cycle - X axis direction

G73 Pattern repetition cycle


Stored stroke check ON
G74 Drilling cycle
Stored stroke check OFF
G75 Grooving cycle
Spindle speed fluctuation detection ON
G76 Threading cycle
Spindle speed fluctuation detection OFF
Machine zero position check G90 Cutting cycle A ( Group type A

Machine zero return (reference point 1)


G90 Absolute command (Group type B)

Return from machine zero G91 Incremental command ( Group type B)

G92 Thread cutting cycle (Group type A)


Machine zero return (reference point 2)

G92 Tool position register (Group type B)


Skip function

Threading - constant lead G94 Cutting cycle B (Group type A)

Circular threading CW G94 Feedrate per minute (Group type B)

Circular threading CCW G95 Feedrate per revolution ( Group type B)


G36

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

Interpolation G02 and G03 under Circular Interpolation


, ,
In fact, so is the command for absolute mode, G90. The
etc. In this section, G codes are described in general, re- reason neither GOO nor G90 has been repeated is because
gardless of the type of machine or control unit. both commands remain active from the moment of their
first appearance in the program. The term modal is used to

G CODES IN A PROGRAM BLOCK describe this characteristic.

For a command to be modal, it means has to remain it

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 .

tation during program execution:

This method of program writing several blocks shorter


than the single block alternative:
is
O Example C - modified (as processed)

N3 G90 GOO X50.0 Y30.0


N25 G90 N4 G90 GOO XO
N26 GOO N5 G90 GOO Y200.0
N27 G54 N6 G90 GOO X150.0 Y220.0
N28 X6.75 Y10.5
N7 G90 GOO X130.0 Y100.0

Both methods appear identical during a continuing


will
The program does not have any practical application by
processing. However, the second example, when executed
moving from one location to another at a rapid rate, but it
in a single block mode, each block will require pressing the
demonstrates the modality of preparatory commands. The
Cycle Start key to activate the block. The shorter method is purpose of modal values is to avoid unnecessary duplica-
more practical, not only for its length, but for the logical tion of programming modes. G codes are used so often, that
connection between individual commands within the
writing them in the program can be tedious. Fortunately,
block.
the majority of G codes can be applied only one e, providing
they are modal. In the control system specifications, prepa-
Some and general considerations ap-
rules of application
ply to G
codes used with other data in a block. The most ratory commands are identified as modal and unmodal.
important of them is the subject of modality.
Conflicting Commands in a Block
Modality of G-commands The purpose of preparatory commands is from
to select

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

O Example C - original a cutting motion active at the


have GOO and G01
same
active simultaneously.
time, it is

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

N3 G90 GOO X5.0 Y3 .


This is the exact opposite of the previous example. Here,
N4 XO GOO
the is in the front, therefore the G01 will take prece-
N5 Y20.0
dence and the motion will take place as a cutting motion at
N6 X15.0 Y22.0
the specified feedrate of 20.0 in/min.
N7 X13.0 Y10.0
PREPARATORY COMMANDS 51

Word Order in a Block


GROUPING OF COMMANDS
G codes are normally programmed at the beginning of a
block, after the block number, before other significant data: The example of conflicting G codes in one block brings
one issue to the forefront. It makes sense, for example, that
N40 G91 G01 Z-0.625 F8.5 motion commands such as GOO, GO G02 and G03 cannot I
,

coexist in the same The distinction is not so clear for


block.
This is a traditional order, based on the idea that if the
other preparatory commands. For example, can the tool
purpose of the G codes is to prepare or preset the control
length offset command G43 be programmed in the same
system to a certain condition, the preparatory commands block as the cutter radius offset command G41 or G42?
should always be placed first. Supporting this argument is
The answer is yes, but let’s look at the reason why.
the- fact that only non-conflicting codes arc allowed in a
single block. Strictly speaking, there is nothing wrong with Fanuc control system recognizes preparatory commands
rearranging the order to: by separating them into arbitrary groups. Each group,
called the G code group, has a Fanuc assigned arbitrary
N40 G91 Z-0.625 F8 5 G01 .
two-digit number. The rule governing the coexistence of G
codes in one block is very simple. If two or more G codes
Perhaps unusual, but quite correct. That is not the case from the same group are in the same block, they are in con-
with the next method of positioning a G code in a block: flict with each other.

N40 Z-0.625 F8.5 G01 G91


Group Numbers
Watch for situations like this! What happens in this case is The G code groups are typically numbered from 00 to 25.
that the cutting motion G01, the feedrate F and the depth Z This range varies between different control models, de-
will be combined and executed using the current dimen- pending on the features. It can even be higher for the new-
sional mode. If the current mode is absolute, the Z axis mo- est controls or where more G codes are required. One of
tion will be executed as an absolute value, not an incremen- these groups - the most unique one and perhaps the most
tal value. The reason for this exception is that Fanuc allows important as well the Group
- is 00.
to mix dimensional values in the same block. That can be a
very useful feature, if used carefully. A typical correct ap- All preparatory commands in the 00 group are not modal,

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

milliseconds. needed only for the duration within the


It is

specified time, no longer. There is no logical need to pro-


Blocks N45 through N47 are all in the absolute mode.
gram dwell in two or more consecutive blocks. After all,
Before the block N48 is executed, the absolute position of
what is the benefit of the next three blocks?
the axes X and Y is 1 .0, 1 .0. From this starting position, the
target location is the absolute position of X2.5 combined
N56 G04 P2000
with the incremental motion of 1 .5 inches along the Y axis. N57 G04 P3000
The resulting absolute position will be X2.5Y2.5, making a N58 G04 P1000
45° motion. In this case, the G91 will remain in effect for

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 ...

G04 GO 9G10 M/T


Gil G27 G28 G29 M/T Any G code from a given group automatically
G30 G31 G37 M/T replaces another G code from the same group
G45 G4 6G47 G48 M/T
Unmodal
G52 G53 G65 M/T
G codes
G51 G60 G92 M G CODE TYPES
G50 T
G70 G71 G72 G73 T Fanuc control system offers a flexible selection of pre-
G74 G75 G76 T paratory commands. This fact distinguishes Fanuc from
many other controls. Considering the fact that Fanuc con-
GOO G01 G02 GO 3 M/T
Motion Commands, trols are used worldwide, it only makes sense to allow the
01 G32 G35 G36 T
Cutting Cycles standard control configuration to follow established style
G90 G92 G94 T
of each country. A typical example is the selection of di-
02 Plane Selection G17 G18 G19 M mensional units. In Europe, Japan and many other coun-
M tries, metric system is the standard. In North America, the
G90 G91
Dimensioning Mode common system of dimensioning still uses the English
03
(U and W for lathes) T
units. As both markets are substantial in the world trade, a
04 Stored Strokes G22 G23 M/T clever control manufacturer tries to reach them both. Al-
Feedrate G93 G94 G95 T most all control manufacturers offer a selection of the di-
05
mensional system. But Fanuc and similar controls also of-
06 Units Input G20 G21 M/T fer selection of programming codes that were in effect

Cutter Radius before Fanuc reached the worldwide market.


07 G40 G41 G42 M/T
Offset
The method Fanuc controls use is a simple method of pa-
Tool Length By selecting the specific system parameter,
rameter setting.
08 G43 G44 G49 M
Offset one of two or three G code types can be selected, the one
G73 G74 G76 G80 M that is typical for a particular geographical user. Although
G81 G82 G83 G84 M the majority of the G codes are the same for every type, the
09 Cycles
G85 G86 G87 G88 M most typical illustration are G codes used for English and
G89 M metric selection of units. Many earlier US controls used
G70 for English units and G71 for metric units. Fanuc sys-
10 Return Mode G98 G99 M tem has traditionally used G20 and G21 codes for English
Scaling Cancel, G50 M and metric input respectively.
11
Mirror Image G68 G69 T
Setting up a parameter, theG code type that is the most
Coordinate G54 G55 G56 G57 M/T practical can be selected. Such a practice, if done at all,
12
System G58 G59 M/T should be done only once and only when the control is in-

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
»

Spindle Speed the most common group.


24 G25 G26 M/T
Fluctuation
G Codes and Decimal Point
The group relationship makes a perfect sense in all cases. Many latest Fanuc controls include a G code with a deci-
One possible exception is Group 01 for Motion Commands mal point, for example, G72.1 (Rotation copy) or G72.2
and Group 09 for Cycles. The relationship between these preparatory commands
(Parallel copy). Several in this
two groups is this - if a G code from Group 01 is specified group are related to a particular machine tool or are not typ-
in any of the fixed cycle Group 09, the cycle is immediately
ical enough to be described in this handbook.
canceled, but the opposite is not true. In other words, an ac-
tive motion command is not canceled by a fixed cycle.
g MISCELLANEOUS FUNCTIONS

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

DESCRIPTION AND PURPOSE Spindle stop

In addition to these three possibilities, there is a function


Within the structure of a CNC program, programmers of-
called the spindle orientation, also a machine related func-
ten need some means of activating certain aspects of the
tion. Another example is a coolant. Coolant can only be
machine operation or controlling the program flow. With-
out the availability of such means, the program would be
controlled as being ON or being OFF.
incomplete and impossible to run. First, let’s look at the These operations are typical to most CNC machines. All
miscellaneous functions relating to the operation of the ma- are programmed with an M
function, followed by no more
chine - the true machine functions. than two digits, although some control models allow the
use of a three digit M
function, Fanuc 16/18, for example.
Machine Related Functions
Fanuc also uses the three digit M functions in several spe-
Various physical operations of the CNC machine must be cial applications, for example, for synchronization of two
controlled by the program, to ensure fully automated ma- independent turrets on a 4-axis lathe. All these and other
chining. These functions generally use the M
address and functions are related to the operation of the machine and
include the following operations: belong to the group collectively known as miscellaneous

Spindle rotation CW or CCW functions or simply as the Mfunctions or M codes.


a Gear range change Low /Medium /High Program Related Functions
Automatic tool change ATC In addition to the machine functions, some M
functions
Automatic pallet change APC are used to control the executionof a CNC program. An in-

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-

machine than a CNC machining center or a CNC lathe. A ular application:


numerically controlled EpM wire cutting machine will
Control of the machine functions
have many unique functions, typical to that kind of ma-
chining and those found on no other machine. Control of the program execution

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

TYPICAL APPLICATIONS M04 Spindle rotation reverse

M05 Spindle stop


Before learning the M functions, note the type of activity
these functions do, regardless of whether such activity re- M07 Coolant mist ON
lates to the machine or the program. Also note the abun-
M08 Coolant ON (coolant pump motor ON)
dance of two way toggle modes, such as ON and OFF, IN
and OUT, Forward and Backward, etc. Always check your M09 Coolant OFF (coolant pump motor OFF)
manual first - for the reasons of consistency, all func- M
tions in this handbook are based on the following table: M10 Chuck open

Mil Chuck close


Applications for Milling
M12 Tailstock quill IN

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)


M19 Spindle orientation (optional)

M03 Spindle rotation normal


M21 Tailstock forward

Spindle rotation reverse


M22 Tailstock backward

M05 Spindle stop


ON
M23 Thread gradual pull-out
M06 Automatic tool change (ATC)
M24 Thread gradual pull-out OFF
M07 Coolant mist ON
M30 Program end (always with reset and rewind)
M08 Coolant ON (coolant pump motor ON)
M41 Low gear selection
Coolant OFF (coolant pump motor OFF)
M42 Medium gear selection 1

M19 Spindle orientation


M43 Medium gear selection 2
M30 Program end (always with reset and rewind)
M44 High gear selection
M48 Feedrate override cancel OFF (deactivated)
M48 Feedrate override cancel OFF ( deactivated)
M49 Feedrate override cancel ON ( activated
M49 Feedrate override cancel ON (activated)
M60 Automatic pallet change (APC)
M98 Subprogram call
M78 B axis clamp (nonstandard)
M99 Subprogram end
M79 B axis unclamp (nonstandard)

M98 Subprogram call Special MDI Functions


Subprogram end
M99 Several M functions cannot be used in the CNC program
at all. This group is used in the Manual Data Input mode
Applications for Turning exclusively (MDI). An example of such a function is a step
by step tool change for machining centers, used for service
purposes only, never in the program. These functions are
M code Description outside of the scope of this handbook.

MOO Compulsory program stop


Application Groups
M01 Optional program stop
The two major categories, described earlier, can further

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

Group Typical M-functions


A practical method of programming certain miscellane-
ous functions is in a block that contains a tool motion. For
MOO M01 example, turning the coolant on and - at the same time -
Program
MO 2 M30 moving the cutting tool to a certain part location may be
required. As there is no conflict between the instructions,
MO 3 MO 4 MO
Spindle the block may look something like this:
Ml 9
Tool change MO 6 N56 GOO X12.9854 Y9.474 M08

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?

The miscellaneous functions listed in this chapter are


used throughout the book. Some of them appear more often One of the three options will happen - but which one?

than others, reflecting their general use in programming.


Even if a practical purpose of these examples may not be

The functions that do not correspond to a particular ma-


apparent at this stage, it is useful to know how the control

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)

M FUNCTIONS IN A BLOCK M function activates at the end of a block


(when the tool motion has been completed)

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)


M functions activated at the START OF A BLOCK
M60 Automatic pallet change (APC)
M03 Spindle rotation normal

M04 Spindle rotation reverse


M functions active UNTIL CANCELED or ALTERED
Automatic tool change (ATC)
1
M07 Coolant mist ON M04 Spindle rotation reverse

Coolant ON (coolant pump motor ON) M05 Spindle stop

M07 Coolant mist ON


M functions activated at the END OF A BLOCK M08 Coolant ON (coolant pump motor ON)
M09 Coolant OFF (coolant pump motor OFF)
Compulsory program stop

M01 Optional program stop


The classification is shows some com-
quite logical and
End of program (usually with reset, no rewind) mon sense. There is no need to remember individual M
M02
functions and their exact activities. The best place to find
M05 Spindle stop out for certain, study manuals supplied with the
is to CNC
machine and watch the program run right on the machine.
Coolant OFF (coolant pump motor OFF)

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

mands, however the word modal is not usually used with M


functions.As an example of a function duration, take mis- The control will not be reset when the MOO function is
processed. All significant program data currently active are
cellaneous functions MOO or M01 Either one will be active
.

retained (feedrate, coordinate setting, spindle speed, etc.).


for one block only. The coolant ON function M08,
will be

active until a canceling or an altering function is pro-


The program processing can only be resumed by activating
grammed. Remember, any one of the following functions the Cycle Start key. The MOO function cancels the spindle
rotation and the coolant function - they have to be repro-
will cancel the coolant ON mode - MOO, M01, M02, M09
and M30. Compare these two tables: grammed in subsequent blocks.
MISCELLANEOUS FUNCTIONS 57

The MOO programmed as an individual


function can be In the program itself, issue a comment section with the

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):

with a motion command, the motion will be completed


first, then the program stop will become effective:
[A] N39 MOO (REMOVE CHIPS)

O MOO programmed after a motion command [B] N39 X13.5682 MOO (REMOVE CHIPS)

N38 GOO X13.5682 [C] N38 X13.5682 MOO


N39 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).

mode of pro- The miscellaneous function M01 is an optional or a con-


There will be no practical difference in auto
cessing (Single Block switch set to OFF).
ditional program stop. It is similar to MOO function, with
one difference. Unlike the MOO function, when M01 func-
Practical Usage tion is encountered in the program, the program processing
will not stop, unless the operator interferes via the control
The program stop function used in a program makes the panel. The Optional Stop toggle switch or a button key lo-
CNC operator’s job much easier. It is useful for many jobs. cated on the panel can be set to either ON or OFF position.
One common is a part inspection on the machine, while
use When the M01 function in the program is processed, the
the part mounted. During the stop, the part dimen-
is still setting of the switch will determine whether the program
sions or the tool condition can be checked. Chips accumu- will temporarily stop or continues to be processed:
lated in a bored or drilled hole can be removed, for exam-
ple, before another machining operation can start, such as
Optional Stop switch setting Result of M01
blind hole tapping. The program stop function is also nec-
essary to change the current setup in the middle of a pro- ON Processing will stop
gram, for example, to reverse a part. A manual tool change
also requires the MOO function in the program. OFF Processing will not stop

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

usually justified under the circumstances, for example, to


BLOCK N39 REMOVE CHIPS
change the cutting insert or to inspect a dimension or the
surface finish of the part.
58 Chapter 9

Program End Percent Sign

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 . . .

N66 G91 G28 XO YO M30 (END OF PROGRAM) Chip removal


% a Lubrication
MISCELLANEOUS FUNCTIONS 59

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 :

machine may delay the start of the actual flooding.

N110 MO
Spindle Functions

O Example B - coolant is turned ON :


Chapter 12 - Spindle Control, details all aspects of con-
trolling themachine spindle in a CNC program. Miscella-
N340 MO neous functions that are available for the spindle control its
rotation and orientation.
O Example C - coolant is turned OFF :

Most spindles can rotate in both directions, clockwise


N500 MO (CW) and (CCW). The direction of rota-
counterclockwise
tion always relative to a standard point of view. The
is
O Example D - axis motion and coolant ON :
viewpoint is established from the spindle side as the direc-

N230 GOO X11.5 Y10.0 M08


tionalong the spindle center line towards its face. rota- CW
such a view is programmed as M03,
tion in direction CCW
as M04, assuming the spindle can be rotated either way.
O Example E - axis motion and coolant OFF :

The drilling and milling types of machines use this estab-


N400 GOO Z1.0 MO lished convention quite commonly. The same convention is
also applied to CNC lathes. On a CNC milling machine or a
The examples show the differences in the program pro- machining center, it is more practical to look towards the
cessing.The general rules of coolant programming are: part from the spindle side rather than from the table side.
On a lathe (slant bed horizontal type), the more practical
Coolant ON orOFF in a separate block becomes active in
view is from the tailstock towards the spindle because that ,
the block in which it is programmed (Examples A, B and C)
is the closest to how the CNC machine operator stands in

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

an oriented position. This function is used mostly during


M41 Low range
machine setup, seldom in the program. The spindle must be 3 available M42 Medium range
oriented in two main situations: M43 High range

Automatic tool change (ATC)


M41 Low range
Tool shift during a boring operation M42 Medium range 1
4 available
(G76 and G87 boring cycles only) M43 Medium range 2
M44 High range
When the Automatic Tool Change (ATC) function M06 is
used program, there is no need to program the spindle
in the

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.

The spindle orientation is necessary for certain boring Machine Accessories


operations on milling systems. To exit a bored hole with a
boring tool away from the finished cylindrical wall, the The majority of miscellaneous functions is used for some
spindle must be stopped first, the tool cutting bit must be physical operation of the machine tool accessories. From
oriented, aqd then the tool can be retracted from the hole. A this group, the more common applications have been al-

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

Gear Range Selection M06 Automatic tool change (ATC) M

Virtually programmable gear range selections apply to


all M60 Automatic pallet change (APC) M
a CNC On
machining centers, the spindle gear range
lathe.
is automatically changed. Most CNC lathes have two or M23 M24 Thread gradual pull-out ONI OFF T
more gear ranges available, some more powerful lathes are
equipped with up to four selections. The basic program- M98 M99 Subprogram call / Subprogram end M/T
ming rule is to select the gear range based on the machining
application.
10 SEQUENCE BLOCK

Each line of in a CNC program is called a block. In the Block number N


terminology established earlier, a block was defined as a
Preparatory commands G
single instruction processed by the CNC system.
Auxiliary functions M
A sequence block, a program block - or simply a block -
is normally one hand written line in the program copy, or a
Axis motion commands XYZABCUVW..
line typed in a text editor and terminated by the Enter key. Words related to axes 1 J K R Q...
This line can contain one or more program words - words
that result in the definition of a single instruction to the Speed, feed or tool function S F T
CNC machine. Such a program instruction may contain a The contents of the program block will vary between ma-
combination of preparatory commands, coordinate words,
chine tools of different kinds, but logically, the majority of
tool functions and commands, coolant function, speeds and
general rules will always be followed, regardless of the
feeds commands, position registration, offsets of different
CNC system or the machine tool.
kinds, etc. In plain English, the contents of one block will
be processed as a single unit before the control processes
Building the Block Structure
any following block. When the whole CNC program is pro-
cessed, the system will evaluate individual instructions Each block of a CNC program has to be built with the
(blocks) as one complete machine operation step. Each same thoughts and the same care as any other important
program consists of a series of blocks necessary to com- structure, for example a building, a car, or an aircraft. It
plete a certain machining process. The overall program starts with good planning. Decisions have to be made as to
length will always depend on the total number of blocks what will and what will not be part of the program block,
and their si/e. similar to a building, car, aircraft or other structure. Also,
decisions have to be made as to what order of commands -
BLOCK STRUCTURE instructions are going to be established within the block
and many other considerations.

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.

allowed. The order of individual words within a block fol-


lows a fairly free format - that means the required words O Milling block examples:

may be in any order, providing that the sequence block (the


Nil G43 Z2.0 S780 M03 HOI (EXAMPLE 1)
N address) is written as the first address. Although the or-
der of individual words in a block is allowed to be in any or-
N98 G01 X2.15 Y4.575 F13 . 0 (EXAMPLE 2)
der, it is a standard practice to place words in a logical or-
der within a block. It makes the CNC program easier to The first milling example in block N1 1, is an illustration
read and understand.
of a tool length offset block, applied together with the spin-
dle speed and the spindle rotation direction.
A typical program block structure is very dependent on
the control system and the type of the CNC machine. A The second example in block N98, shows a typical pro-
typical block may contain the following instructions, in the
gramming instruction for a simple linear cutting motion,
order suggested. Not all program data are necessary to be
using the linear interpolation method and a suitable cutting
specified every time, only when required.
feedrate.

61
62 Chapter 10

O Turning block examples: rectory more The program descrip-


descriptive and useful.
tion can be read on the display screen and provides an eas-
r
N67 GOO G42 X2 .5 Z0.1 T0202 M08 (EXAMPLE 1) ier identification of each program stored.

N23 G02 X7.5 Z-2.8 RO . 5 F0.012 (EXAMPLE 2) If the program name is longer than the sixteen characters

recommended, no error is generated, hut only the first six-


In the lathe examples, block N67 illustrates a rapid mo- teen characters will be displayed. Make sure to avoid pro-
tion to an XZ position, as well as a few other commands - gram names that can be ambiguous when displayed. Con-
the tool nose radius offset startup G42, activation of the tool sider these two program names, they appear to be good:
offset (T0202), and the coolant ON function M08. The ex-
ample in block N23 is a typical circular interpolation block 01005 (LOWER SUPPORT ARM - OP 1)
with a feedrate. 01006 (LOWER SUPPORT ARM - OP 2)

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

course, in a hard copy printout.


gram number zero (OO or 00000) is not allowed. Some
controls allow a 5-digit program number. Also not allowed
Keep program names short and descriptive - their pur-
the
are decimal point or a negative sign in the program number. pose is CNC operator in the search of programs
to assist the
Suppression of leading zeros is allowed - for example, 01 stored in the control memory. The suitable data to include
OOl, OOOI, alid OOOOl are all legitimate entries, in this in the program name are the drawing number or the part
case for a program number one. number, shortened part name, operation, etc. Data not suit-
able are the machine name, control model, programmer’s
Program Name name, date or time, company or customer’s name and simi-
lar descriptions.
On Fanuc control systems, the name of the pro-
the latest
gram can be included in addition to the program number, On many controls, when loading the program into the
not instead of the program number. The program name (or memory, the CNC operator must specify the program num-
a brief description of the program) can be up to sixteen ber on the control panel, regardless of the number in the
characters long (spaces and symbols are counted). The pro- CNC can be a number that just happens to be
program. It
gram name must be on the same line (in the same block) as available in the system, or it can be a number that has a
the program number: unique meaning, perhaps indicating a unique group (for ex-
ample, all programs that begin with the OlOxx belong to
01001 (DWG. A-124D IT. 2)
the group associated with a single customer). Subprograms
must always be stored under the number specified by the
This feature has the advantage that when the directory of
thememory is displayed on the screen, the name of the pro-
CNC programmer. Innovative use of program numbers
may also serve to keep track of programs developed for
gram appears next to the program number, making the di-
each machine or part.
SEQUENCE BLOCK
63

SEQUENCE NUMBERS Sequence Block Format

The program input format notation for a block number,


Individual sequence blocks in the CNC program can be using the address N, is N5 more advanced controls,
for the
referenced with a number for easier orientation within the and N4 or even N3 for older controls. Block number NO is
program. The program address for a block number is the not allowed, neither is a minus sign, a fractional number or
letter N, followed by up to five digits - from sequence to 1
a block number using a decimal point. Minimum block in-
sequence 9999 or 99999, depending on the control system. crement number must always be an integer - smallest inte-
The block number range will be N 1 to N9999 for the older ger allowed is one (N N2, N3, N4, N5, etc.). A larger in-
I ,

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

In the following table, the first column represents se-


Some programmers like to start with the default of the

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-

1 N1 pose of the program is the same - to allow for additional


blocks to be filled-in between the existing blocks, if such a
2 N2 need comes. The need may arise while proving or optimiz-
ing theprogram on the CNC machine, where an addition to
5 N5
the existingprogram will be required. Although the new
10 N10 blocks (the ones inserted) will not be in the order of an
equal increment, at least they will be numerically ascend-
50 N50 ing. For example, a face cut on a lathe with one cut (Exam-
100 N100 ple A) was modified by the machine operator for two cuts
(Example B):
99999 N99999
O Example A one face
- cut
Using sequence numbers (block numbers) in a CNC pro-
gram offer several advantages and at least one likely disad- N40 GOO G41 X3.5 Z0 T0303 M08
vantage. N50 G01 X-0.07 F0.01
N60 GOO W0.1 MO
On the positive side, the block numbers will make the N70 G40 X3.5
program search greatly simplified during editing or tool
repetition on the machine. They also make the program © Example B - two face cuts :

much easier to read on the CNC display screen during


processing or on the printed hard copy. That means both the
N40 GOO G41 X3.5 Z0.05 T0303 M08
N50 G01 X-0.07 F0.01
programmer and the operator benefit.
N60 GOO W0.1
On the negative side, block numbers will reduce the N61 X3.5
N62 Z0
availablecomputer memory of the CNC. That means a
N63 G01 X-0.07
fewer number of programs can be stored in the memory,
N64 GOO W0.1 MO
and long programs may not Fit in their entirety. N70 G40 X3.5
64 Chapter 10

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

ment of 5 or 10 is the most practical, since


it allows for in-

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.

Note that the program is a little smaller and the additional


Long Programs and Block Numbers
blocks are quite visual and noticeable when printed or
displayed on the screen. Long programs are always difficult to load into a CNC
memory with limited capacity. In such cases, the program
Leading zeros may (and should) be omitted in the block
length may be shortened by omitting the block numbers al-
number - for example, N00008 can be written as N8.
together or even better - by programming them only in the
-

Omitting the leading zeros will reduce the overall program


significant blocks. The significant blocks are those that
length. The trailing zeros must always be written, to distin-
have to be numbered for the purpose of program search, a
guish for such similarities as NOS and N80.
tool repetition, or other procedure that depends on program

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 -

some programming applications depend on the block num-


If all sequence block numbers have been omitted in the
bers, for example, lathe multiple repetitive cycles G70,
program, the search on the machine control will become
G7 1 , G72, G73, In this case, at least the significant blocks
rather difficult. The CNC operator will have no other op-
have tobe numbered (see Chapter 35).
tion but to search for the next occurrence of a particular ad-
dress within a block, such as X, Y, Z, etc., rather than a se-
Numbering Increment quence block number. This method of search may
unnecessarily prolong the search time.
Block numbers in a program can be in any physical order
- ascending, descending or mixed - they can also be dupli-
cated or missing altogether. Some programming practices END OF BLOCK CHARACTER
are established as preferable, because they are logical and
make sense. Having a mixed order of sequence numbers in
Because of the control system specifications, the individ-
the program serves no useful purpose and neither do dupli-
ualsequence blocks must be separated by a special charac-
cated sequence numbers. If the program contains duplicate
ter, known as the end-of-block character or by its abbrevia-
block numbers and a block number search is initiated at the
tion EOB or E-O-B. On most computer systems, the EOB
machine, the control system will only search for the first
character is generated by the Enter key on the keyboard.
occurrence of the particular block number, which may or
When the program is input to the control by MDI (Manual
may not be the block required. Any further search will have
Data Input), the EOB character key on the control panel
to be repeated from the string found last. The reason for the
terminates the block. The end-of-block symbol on Fanuc
generous latitude in the sequence block numbering is to of-
controls appears as a semicolon [ ].
fer flexibility to the CNC operator after the program has
;

been done and loaded into the control.


SEQUENCE BLOCK 65

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-

block processed during a repetition of a program


th e first
dius offset, G64 sets a continuous cutting mode, G80 can-

(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

those with limited experience. In all the applications listed,


G codes in separate blocks. Instead of

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

PROGRAM COMMENTS CONFLICTING WORDS IN A BLOCK

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

© Example A What the block contains is simply not logically possible.


It instructs the control to:
N330 MOO (REVERSE PART)
'Set the English system of dimensions, also set the metric

O Example B system of dimensions and set the XY plane’.

- 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):

listed in proper setup and tooling sheets, with all the


required details. N340 Z-0.75 Y11.56 F10.0 X6.845 G01
SEQUENCE BLOCK 67

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:

N340 G01 X6.845 Y11.56 Z-0.75 F10.0


MODAL PROGRAMMING VALUES
Two other possibilities exist that may require a special at- Many program words are modal. The word modal is
tention in programming approach. For example, how will based on the word 'mode' and means that the specific com-
the following block be interpreted? mand remains in this mode after it has been used in the pro-
gram once. It can only be canceled by another modal com-
N150 G01 G90 X5.5 G91 Y7.7 F12.0 mand of the same group. Without this feature, a program
using linear interpolation in absolute mode with a feedrate
There is an apparent conflict between the absolute and in- of 18.0 in/min, would contain the absolute command G90,
cremental modes. Most Fanuc controls will process this the linear motion command G01 and the feedrate FI 8.0 in
block exactly the way it is written. The X axis target posi- every block. With the modal values, the programming out-
tion will be reached in absolute values, but the Y axis will put is much shorter. Virtually all controls accept modal
be an incremental distance, measured from the current po- commands. The following two examples illustrate the dif-
sition of the cutter. It may not be a typical approach, but it ferences:
offers advantages in some cases. Remember - the sequence
block following the block NI50 will be in the incremental O Example A - without modal values :

mode, since G91 is specified after the G90 command!


N12 G90 G01 XI. 5 Y3.4 F18.0
The other programming application to watch for, is in a N13 G90 G01 X5.0 Y3.4 F18.0
block programmed in the circular interpolation mode. The N14 G90 G01 X5.0 Y6 5 F18 . .

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 :

following examples are correct, resulting in a 90° arc with a


N12 G90 G01 XI. 5 Y3.4 F18 .
1.5 inch radius:
N13 X5.0
N14 Y6.5
O With I and J arc modifiers :

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 :

of the Example B. Observe that the modal commands are


not necessary to be repeated in the CNC program. In fact,
N21 G01 X15.35 Y11.348
in everyday programming, many program commands used
N22 G02 X16.85 Y12.848 R1.5
are modal. The exceptions are those program instructions,
N23 G01 . .

whose functionality starts and ends in the same block (for


Now, consider how the control system will process the example dwell, machine zero return, certain machining in-

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:

or N83 G28 Z1.0 M09


N84 G28 X5.375 Y4.0 M05
N22 G02 X16.85 Y12.848 R1.5 11.5 JO
G28 cannot be removed from block N84, because the
G28 command is not modal and must be repeated.
68 Chapter 10

EXECUTION PRIORITY Functions that will be executed simultaneously with the


cutting tool motion:

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:

Here are two unrelated blocks used as examples:


MOO M01 MO 5 MO 9 M98

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.

Dimensional units ... English or Metric


That can be done either through the MDI mode, a program
block, or a system parameter. This applies even for situa-
Dimensional references . . . Absolute or Incremental tions when the power has been turned offand then on again

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:

Fractional values, for example 1/8, are not allowed in a


CNC program. In the metric format, millimeters and meters G20 Selects English units (inches and feet)
are used as units, in the English format it is inches and feet
that are used as units. Regardless of the format selected, the G21 Selects metric units (millimeters and meters)

number of decimal places can be controlled, the suppres-


sion of leading and trailing zeros can be set and the decimal
point can be programed or omitted, as applicable to a par- Without specifying the preparatory command in the pro-
ticular CNC system. gram, control system will default to the status of current pa-
rameter setting. Both preparatory command selections are
modal, which means the selected G code remains active
ENGLISH AND METRIC UNITS until the opposite G code is programmed - so the metric
system is active until the English system replaces it and
Drawing dimensions can be used in the program in either vice versa.
English or metric units. This handbook uses the combined
examples of both the English system, common in the USA, This reality may suggest a certain freedom of switching
between the two units anywhere in the program, almost at
to some extent in Canada and one or two other countries.
The metric system is common in Europe, Japan and the rest random and indiscriminately. This is not true. All controls,
including Fanuc, are based on the metric system, partially
of the world. With the economy reaching global markets, it
because of the Japanese influence, but mainly because the
is important to understand both systems. The use of metric
metric system is more accurate. Any ‘switching’ by the use
system is on the increase even in countries that still use the
of the G20 or G2 1 command does not necessarily produce
English units of measurement, mainly the United States.
any real conversion of one unit into the other, but merely
Machines that come equipped with Fanuc controls can be shifts the decimal point, not the actual digits. At best, only
programmed in either mode. The initial CNC system selec- some conversions take place, not all. For example, G20 or
tion (known as the default condition) is controlled by a pa- G21 selection will convert one measuring unit to another
rameter setting of the control system, but can be overridden on some - but not all - offset screens.
by a preparatory command written in the part program. The
default condition is usually set by the machine tool
The following two examples will illustrate the incorrect
result of changing G21 to G20 and G20 to G21 within the
manufacturers or distributors (sometimes even by the CNC
dealers) and is based on the engineering decisions of the same program. Read the comments for each block - you
manufacturer, as well as the demands of their customers. may find a few surprises:

69
70 Chapter 1

O Example 1 - from metric to English units :


Comparable Unit Values

There are many units available in both the metric and


G2 1 Initial unit selection (metric)
CNC programming, only a very small
English systems. In
GOO X60.0 X value is accepted as 60 nun portion of them is used. The metric units are based on a mil-
G2 0 Previous value will change into 6.0 inches limeter or a meter, depending on the application. The Eng-
lish units are based on inches and feet, again depending on
(reed translation is 60 nun = 2.3622047 inches)
the application. Common abbreviations for the different

O Example 2 - from English to metric units :


units are:

Millimeter mm
G2 0 Initial unit selection (English)

GOO X6 0 . X value is accepted as 6.0 inches


Meter m
G2 1 Previous value will change into 60 nun Inch in

( real translation is 6.0 inches = 152.4 nun)


Foot ft

Both examples illustrate the possible problem caused by


switching between the two dimensional units in the same Many programming terms use these abbreviations. The
program. For always use only one unit of
this reason, next table shows the comparable terms between the two di-

dimensioning in a part program. If the program calls a mensional systems (older terms are in parentheses):

subprogram, the rule extends to subprograms as well:


Metric English

Never mix metric and English units in the same program


m/min (also MPM) ft/min (also FPM or SFPM)

In fact, it is unwise to mix them, even if the results for the mm/min in/min (also IPM or ipm)

control system are predictable. The selection of the dimen-


mm/rev in/rev (also IPR or ipr)
sional system will make a great difference how some con-
trol functions will work. The following functions will be af- mm/tooth in/tooth (also IPT or ipt)
fected by the change from one system of units to the other:
kW HP
Dimensional words (X, Y, Z axes, I, J, K modifiers, etc.)

Constant Surface Speed (CSS - for CNC lathes)


ABSOLUTE AND INCREMENTAL MODES
Feedrate function (the F address)

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

Screen position display (the number of decimal places)


program and the selected units are millimeters, the state-
ment does not indicate where the dimension of 35 has mm
Manual pulse generator the FIANDLE (value of divisions)
its origin. The control system needs more information to
-

Some control system parameters program dimensional values correctly.

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

Reference to a previous point on the part


programmed, the control accepts the dimensional units se-
known as the last tool position for INCREMENTAL input
lected by a parameter setting. If G20 or G21 is included in
...

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 Absolute mode of dimensioning

G91 Incremental mode of dimensioning

Both commands are modal, therefore they will cancel


each other. The control system uses an initial default setting
when powered on, which is usually the incremental mode.
This setting can be changed by a system parameter that pre-
sets the computer at the power startup or a reset. For indi-
vidual CNC programs, the system setting can be controlled
by including the proper preparatory command in the pro-
gram, using either one of two available commands - the
G90 or G9 1

Figure 11-1 a good programming practice to always include the


It is

Absolute dimensioning - measured from part origin


required setting in the CNC program, not to count on any

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:

Consider a typical start of a new program loaded into the


machine control unit. The control had just been turned on,
the part is safely mounted, the cutting tool is at the home
/ position, offsets are set and the program is ready to start.
START AND END Such a program is most likely written in the more practical
absolute mode. Everything seems Fine, except that the ab-
Figure 11-2
solute G90 command is missing in the program. What will
Incremental dimensioning - measured from the current tool location
happen at the machine? Think before an answer and think
G91 command will be used in the program
logically.

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

Absolute Data Input - G90 Combinations in a Single Block

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

DIAMETER PROGRAMMING MINIMUM MOTION INCREMENT

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.

GOO X2 0 . Radius dimension . . . when set by a parameter


Units system Minimum increment
Either value is correct, with the appropriate parameter
setting.The diameter programming is easier to understand Metric 0.001 mm
by both the programmer and operator, because drawings
use the diameter dimensions for cylindrical parts and mea- English .0001 inch

suring diameters at the machine is common. Exercise cer-


tain caution - if the diameter programming is used, all tool
wear offsets for the X axis must be treated as applicable to
In the definition of minimum increment, the most com-
the diameter of the part, not to its single side (radius value).
mon increments are 0.001 mm
and 0.0001 inches for met-
ric and English units respectively. For a typical lathe, CNC
Another programming consideration, also very impor- the minimum increment for the X axis is also 0.001 mm or
tant, is the selection of the absolute or the incremental .0001 inches but is measured on the diameter - that means a
mode of dimensional input. The diameter programming, 0.0005 mm or .00005 minimum increment per side.
inches
where the X axis value represents the part diameter, is Fine tuning for machining precision is much more flexible
much more common in the absolute mode. In those cases, and precise in the metric system than in the English system:
when an incremental value is required, remember that all
incremental dimensions in the program must also be speci-
Minimum increment Converted equivalent
fied per diameter, not per radius.

In the incremental mode, the intended X axis motion will 0.001 mm .00003947 inches

be programmed as the U axis, specified as a distance and


.0001 inches 0.00254 millimeters
direction to travel on a diameter.

For example, the two sections of the following metric


For high precision work, using metric units should be the
programs are identical - note that they both start in the ab-
preferred dimensional system for part programming. In
solute mode and only the diameters appear different:
fact, the metric system is 154% more accurate than the

© Example 1 - Absolute diameters :


English system, which makes the English system almost
60.63% less accurate than the metric system.

GOO G42 X85.0 Z2.0 T0404 M08 (ABSOLUTE START)


G01 Z-24.0 F0.3 FORMAT OF DIMENSIONAL INPUT
X95.0
Z-40.0
X112.0 The year of 959 1 is often considered to be the first year of
Z-120.0 practical numerical control. Since that time, several major
X116.0 changes have taken place that influenced the programming
GOO . .
format of dimensional input.

© Example 2 - Incremental diameters :


Even to this day, dimensional data can be programmed in

one of the four possible ways:


GOO G42 X85.0 Z2 . 0 T0404 M08 (ABSOLUTE START)
G01 Z-24.0 F0.3 Full address format
U10.0 (X95.0)
Leading zeros suppression
Z-40.0
U17.0 (X112.0) Trailing zeros suppression
Z-120.0
U4.0 (X116.0) Decimal point
GOO . .
74 Chapter 1

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:

Full Address Format X6250

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.

words X, Y, Z, I, J, K, etc. For example, the


ten for the axis X0000625
English dimension of .625, when applied to the X axis, will
be written as: The metric units input of 0.42 mm, also applied to the X
axis, is written with the leading zeros suppressed as:
X00006250
X420
The metric dimension of 0.42 mm, also when applied to
the X axis, will be written as: The same dimension of 0.42 mm with the trailing zeros
in the program as:
suppressed will appear
X00000420
X0000042
The full format programming is applicable only to the
very early control units, but is correct even today. The pro- Although the examples above illustrate only one small
grammed axis was usually written without the axis desig- application, the impression that the leading zero suppres-
nation, which is determined by position of the dimension sion is more practical than the trailing zero suppression is
within the block. For modern CNC programming, the full Many older control systems are indeed set arbi-
quite right.
format is obsolete and is used here only for reference and accept the leading zero suppression as the default ,
trarily to

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

Zero Suppression omitted (forgotten) in the program, this knowledge beco-


mes very useful and the subject is not trivial any more.
Zero suppression concept is a great improvement over the
fullprogramming format. It was the adaptation of a new Preference for Leading Zero Suppression
format that reduced the number of zeros in the dimensional
input. Many modern controls still support the method of
The minimum and the maximum dimensional input the
control system can accept consists of eight digits, without a
zero suppression, but only for reasons of compatibility with
decimal point, ranging from (XXXHXX)I to 99999999:
old and proven programs.

Zero suppression means that either the leading or the


Minimum: 0000.0001 inches or 00000.001 mm
trailing zeros of the maximum dimensional input do not Maximum: 9999.9999 inches or 99999.999 mm
have to be written in the CNC program. The result is a great
reduction in the program length. The default setting has
The decimal point is not written. If the program uses zero
been done by the control manufacturer, although the de- suppression of either type, a comparison of input values

fault mode can be optionally set by a system parameter.


should be useful:
Don 7 make any changes without a valid reason!
INPUT OF DIMENSIONS
75

the dwell can be programmed with the X axis, followed by


Input value comparison - inches
the maximum of eight digits, always positive. If the control
system allows the decimal point, there is no confusion. If
Leading zeros Trailing zeros
Decimal point the leading or the trailing zeros have to be suppressed, the
suppression suppression
programmed input is very important.
xo 0001
. XI X00000001
For example, a program requires dwell lasting 0.5 of a
xo 001
. X10 X0000001 second (one half of a second). In the various formats the
program block containing the 'A sec. dwell will be:
X0.01 X100 X000001
Full format X0000050
xo 1
. X1000 X00001
No leading zeros X500
XI. 0 X10000 X0001 No trailing zeros X000005
X10 . X100000 X001 Decimal point X0.5 or X.5

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

X1000.0 X1000000 X01 G Milling control programs :

X10000 . X10000000 XI X, Y, Z, I, J, K, A, B, C, Q, R

Even programs use decimal point all the time, knowing


if
G Turning control programs :

the effect of zero suppression is important. For example,


X, Z, U, W, I, K, R, C, E, F
what will happen if the programmer forgets to program the
decimal point or the CNC operator forgets to punch it in? The control system that supports the option of program-
These are serious - and common - errors that can be avoided ming the decimal point, can also accept dimensional values
with some care and good knowledge. without a decimal point, to allow compatibility with older
programs. In such cases, it is important to understand the
To complete the section on zero suppression, let’s look at principles of programming format using the leading and
a program input that uses an axis letter but not as a coordi-
the trailing zeros. If they are used correctly (see earlier ex-
nate word. A dwell command will be used to explain.
no problem to apply the various
planations), there will be
Chapter 24 covers all the details relating to the dwell pro- dimensional formats to any other control system, old or
gramming. For now, just use the basic format and one sec- new. If possible, program the decimal point as a standard
ond dwell time as the unit. The dwell format is specified by
approach.
the dwelling axis X, as being X5.3. This format tells us that
76 Chapter 11

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):

In some specialized industries, such as woodworking or


Y12.56 is Y125600 ...for English mils fabricating, the majority ofdimensions (especially metric)
Y12.56 is Y12560 ...for metric units do not require decimal parts, only whole numbers. In these
cases, the decimal point would always be followed with a
The programmed values with and without the decimal zero. Fanuc provides a solution to such situations by the
point can be mixed together in the same block: feature called calculator input. Using this feature can
shorten program size.
N230 X4.0 Y-10
The calculator type input requires the setting of a system
This may be beneficial for extreme conservation of the parameter. Once the parameter is set, the decimal point and
system memory. For example, the X4.0 word will require the trailing zeros do not have to be written - they will be as-
fewer characters than the word X40000 - on the other hand, sumed. For example, X25 will be interpreted as X25.0, not
the Y-10 is shorter than the decimal point equivalent of the normally expected X0.0025.
Y-O.(X) I (both examples are in English units). If all digits
In case the input value does require the decimal point, it
before or after the decimal point are zeros, they do not have
be written: can be written as usually. This means the values with a dec-
to
imal point will be interpreted correctly and numbers with-
xo.5 = x.5 out the decimal point will be treated as major units only
Y40.0 = X40 (inches or millimeters). Here are some examples:
Z-0.1 = Z-.l
F12 . 0 = F12 Standard Input Calculator Input
RO 125 = R. 125
. ...etc.
X345.0 X345
Any zero value must be written - for example, X0 cannot XI. 0 XI
be written as X handbook, all the program ex-
only. In this
amples use the decimal point format, whenever possible.
Y0.67 Y0 67 .

Many programmers prefer to program zeros as in the left Z7.48 Z7.48


column of the example. They add a few characters into the
system memory, but they are much easier to read. They are Normally, the control system is set to the leading zero
also easier for learning. suppression mode and the non-decimal values are inter-
preted as the number of the smallest units. For example,
Z1000 in G21 mode will be equivalent to Z1.0 (mm).
12 SPINDLE CONTROL

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
,

setup of the cutting tool used. The spindle rotation has to be


SI to S9999 specified in program, in addition to the spindle speed func-
tion. There are two miscellaneous functions provided by
For many high speed CNC machines is not unusual to the control system that control the direction of the spindle -

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

Direction for Milling Although the descriptions CW


and CCW
in the illustra-
tionappear to be opposite to the direction of arrows, they
It may be rather impractical to look down along the center
are correct.The reason is that there are two possible points
line of the spindle, perpendicularly towards the part. The
of view, and they are both using the spindle center line as
common standard view is from the operator’s position, fac-
the viewing axis. Only one of the viewpoints matches the
ing the front of a vertical machine. Based on this view, the
standard definition and is, therefore, correct. The definition
terms clockwise and counterclockwise can be used accu-
of spindle rotation for lathes is exactly the same as for ma-
rately, as they relate to the spindle rotation - Figure 12-1.
chining centers.

To establish spindle rotation as CW and CCW,


look from the headstock towards the spindle face.

The first and proper method will establish the relative


viewpoint starting at the headstock area of the lathe. From
this position, looking towards the tailstock area, or into the
same general area, the clockwise and counterclockwise di-
rections are established correctly.

The second method of viewing establishes the relative


viewpoint starting at the tailstock area, facing the chuck.
This is an incorrect view!

Compare the following two illustrations - Figure 12-3


shows the view from the headstock, Figure 12-4 shows the
view from the tailstock and arrows must be reversed.

Direction of spindle rotation.


Front view of a vertical machining center is shown

Direction for Turning

A comparable approach would seem logical for the CNC


lathes as well. After all, the operator also faces the front of a
machine, same as when facing a vertical machining center.
Figure 12-2 shows a front view of a typical CNC lathe.

CW = M03 CCW = M04


Figure 12-3
Headstock
Spindle rotation direction as viewed from the headstock
/

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 :

the spindle rotation function M03 or M04, their relation-


ship in a CNC program is important. N1 G20
N2 G17 G40 G80
The spindle speed address S and spindle rotation function N3 GOO G90 G54 X14.0 Y9.5 M03 (ROTATION SET)
M03 or M04 must always be accepted by the control sys- N4 G43 Z1.0 HOI (NO ROTATION)
tem together. One without the other will not mean anything N5 G01 Z0.1 F50.0 S600 (ROTATION STARTS)
N6 ...
to the control, particularly when the machine is switched
on. There are at least two correct ways to program the spin- Again, the C example
is not wrong, but it is not very prac-
dle speed and spindle rotation:
There is no danger, if the machine power has
tical either.

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 :

The following examples demonstrate a number of correct


stans for the spindle speed and spindle rotation in the pro- N1 G20
gram. All examples assume that there is no active setting of N2 G50 X13.625 Z4.0 T0100
the spindle speed S, either through a previous program or N3 G96 S420 M03 (SPEED SET - ROTATION STARTS)
through the Manual Data Input (MDI). On CNC machines, N4 ...

there is no registered or default spindle speed when the ma-


chine power is turned on.
This is the preferred example for CNC lathes, if the older
G50 setting method is used. Because the spindle speed is

O Example A - Milling application :


set as CSS Constant Surface Speed, the control system
-

will calculate the actual revolutions per minute (r/min)

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 :

This example is one of the preferred formats for milling N1 G20


applications. Both the spindle speed and spindle rotation N2 G50 X13.625 Z4.0 T0100 M03 (ROTATION SET)
are set with the Z axis motion towards the part. Equally N3 GOO X6.0 Z0.1 (NO ROTATION)
popular method is to start the spindle with the XY motion - N4 G96 G01 Z0 F0.04 T0101 S420 (ROTAT. STARTS)
N3 in the example:
N5 ...

N3 G90 GOO G54 X14 0 Y9.5 S600 M03 .


O Example F - Turning application without G50 :

Selection is a matter of personal preference. The G20 N1 G20 T0100


in a
N2 G96 S420 M03 (SPEED SET - ROTATION STARTS)
separate block in not necessary for Fanuc controls.
N3 GOO ...
O Example B - Milling application :

In this more contemporary example (G50 is not used as a


N1 G20
position register command anymore), the machine spindle
N2 G17 G40 G80 speed will be calculated for a tool offset value stored in the
N3 G90 GOO G54 X14 0 Y9 . . 5 S600 (SPEED ONLY) Work Geometry Offset register of the control system. The
N4 G43 Z1.0 HOI MO 3 (ROTATION STARTS) system will perform the calculation of actual r/min when
N5 ... the block N2 is executed.
80 Chapter 12

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:

mally carried on from a previous tool). However, the con-


N120 MO
trol unit may still store spindle speed and rotation from the

last tool of the previous job!


or in a program block containing the tool motion, such as
Any normally assume the
tool following the first tool will in the next example:
programmed speed and rotation for the previous
selection
tool. If only the spindle speed command S is programmed
N120 Z1.0 MO
for the next tool, without the rotation direction, the tool will
The motion will always be completed first, then the spin-
assume the last programmed rotation direction. If only the
dle will be stopped. This is a safety feature built into the
rotation direction code M03 or M04 is programmed, the
spindle speed S will be the same as for the previous tool.
control system. Always remember to program M03 or M04
to reinstate the spindle rotation.

Be careful if a program contains the program stop func-


tions MOO or M01, or the spindle stop function M05. Any SPINDLE ORIENTATION
one of them will automatically stop the spindle. It means to
be absolutely sure as to when the spindle rotation will take
place and what it will be. Always program the spindle
The last M function that also relates to a spindle activity,

speed selection and its rotation in the same block and for
is Ml 9.
This function is most commonly used to set a ma-

each tool. Both functions are logically connected and plac-


chine spindle into an oriented position. Other codes may M
be valid, depending on the control system, for example
ing them within a single block will result in a coherent and
logical program structure.
M20 on some controls. The spindle orientation function is
a very specialized function, seldom appearing in the pro-
gram itself. When M 19 function is used, it is mainly during
SPINDLE STOP setup, in the Manual Data Input mode (MDI). This func-
tion is exclusive to the milling systems, because only spe-
Normally, most work requires a spindle that rotates at a cially equipped CNC lathes may require it. The function
certain speed. In some cases, a rotating spindle is not al- can only be used when the spindle is stationary, usually af-
ways desirable. For example, before programming a tool ter the spindle has stopped. When the control system exe-
change or reverse a part in the middle of a program, the cutes the M 19 function, the following action will result:
spindle must be stopped The spindle must also be
first.
The spindle will make a slight turn in both directions,
stopped during a tapping operation and at the end of pro-
clockwise and counterclockwise, and after a short period,
gram. Some miscellaneous functions will stop the spindle
the internal locking mechanism will be activated. In some
rotation automatically (for example, the functions MOO,
cases, the locking that takes place is audible. The spindle
M01 M02 and M30).
,
Spindle rotation will also stop auto-
will be locked
in a precise position, and rotating it by hand,
matically during certain fixed cycles. For a total control of
be successful. The exact locking position is deter-
will not
program, the spindle stop should always be specified in the
mined by the machine tool manufacturer, indicated by the
program. Counting on other functions to stop the spindle is
setting angle - Figure 12-5.
not a good programming practice. There is a special func-
tion available in programming, to stop the spindle.

In order to stop the spindle rotation, use function M05.


M05 will stop either the clockwise or the counterclockwise
spindle rotation. Because M05 does not do anything else
(unlike other functions that also stop the spindle, such as
MOO, M01 M02, , M30 and others), it is used for situations,
where the spindle must be stopped without affecting any
other programmed activities. Some typical examples in-
clude reversal in tapping, tool motion to the indexing posi-
tion, turret change position, or after machine zero return, A SPINDLE ORIENTATION ANGLE |

depending on the application. Using one of the other mis-


cellaneous functions that automatically stop the spindle, Figure 12-5
the M05 function is not required. On the other hand, it does is defined by the machine
Spindle orientation angle
no harm to program exactly what is required, in a particular manufacturer and cannot be changed
SPINDLE CONTROL
81

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

Such format is typical to milling controls, where no pe-


Many CNC machining centers (not all) use tool holders ripheral speed is used. T here is no need to use a special pre-
that can be placed into the tool magazine only one way. To paratory command to indicate the r/min setting, it is the
achieve this goal, the tool holder has a special notch control default. The r/min value must have a minimum in-
built-in, that matches the internal design of the spindle -
crement of one. Fractional or decimal values are not al-
Figure 12-6. In order to find the side of the holder that has lowed and the r/min must always be within the range of any
the notch, thereis a small dimple on the notch side. This de-
machine specifications.
sign is intentional.
A few machining centers may be equipped with the op-
tion of a dual spindle speed selection - direct r/min and a
peripheral speed. In this case, as well as for all lathe pro-
gramming, a proper preparatory command is used to distin-
guish which selection is active. G96 is used for peripheral

speeds, G97 for direct specification of r/min. The distinc-


tion between them is discussed next.

SPINDLE SPEED -SURFACE

Programmed spindle speed should be based on the ma-


chined material and the cutting tool diameter (machining
centers), or the part diameter (lathes). The general rule is
that the larger the diameter, the slower the spindle r/min
must be. Spindle speed should never be guessed - it should
always be calculated. Such a calculation will guarantee
that the spindle speed is directly proportional to the pro-
grammed diameter. An incorrect spindle speed will have a
negative effect on both the tool and the part.

Built-in notch in a tool holder used for correct tool


orientation in the spindle - not all machines require this feature Material Machinability

To calculate spindle speed, each work material has a sug-


For tools with several flutes (cutting edges), such as
gested machinability rating for a given tool material. This
drills,end mills, reamers, face mills, etc., the orientation of
rating is either a percentage of some common material,
cutting edge relative to the stopped spindle position is not
such as mild steel, or a direct rating in terms of its periph-
that important. However, for single point tools such as bor-
eral speed or surface speed. Surface speed is specified in
ing bars, orientation of the cutting edge during setup is ex-
feet per minute (ft/min) in English units, and in meters per
tremely important, particularly when certain fixed cycles
minute (m/min) in the metric system. An older abbreviation
are used. The two fixed cycles that use the built-in spindle
used for ft/min is FPM, meaning Feet Per Minute. The
orientation, G76 and G87, the tool retracts from the ma-
amounts of surface speeds indicate the level of machining
chined hole without rotating. In order to prevent damage to
difficulty with a given tool material. The lower the surface
the finished bore, the tool retraction must be controlled.
speed, the more difficult it is to machine the work material.
Spindle orientation guarantees that the tool will shift away
from the finished bore into a clear direction. An accurate Note the emphasis on the words 'given tool material'. To
initial setup is necessary! make all comparisons meaningful and fair, they must be

made with the same type of cutting tool, for example,


Those machines that allow placing tool holder into the
spindle either way still require proper setting of tools that
surface speeds for high speed steel tools will be much
lower then those for cobalt based tools and, of course, for
shift when G76 or G87 fixed cycles are programmed.
carbide tools.
82 Chapter 12

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 . .

Surface speed will increase for soft materials =


r/min Spindle speed in revolutions per minute
and decrease for hard materials. =
1000 Multiplying factor - meters to mm
m/min = Peripheral speed m/minin

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)

Spindle Speed - English Units


O Example:

Given surface speed is 30 m/min and the cutting tool dia-


To calculate the spindle speed in r/min, the peripheral
meter is 15 mm:
speed of the material for the cutting tool type must be
known, as well as the diameter of the tool or the part:
r/min = (1000 x 30) / (3.1415 x 15)
= 636.6
= 637 r/min

A shorter version of the formula is an acceptable alterna-


tive and almost as accurate as the precise formula:
us* where . .

r/min = Spindle speed in revolutions per minute


12 = Multiplying factor -feet to inches
ft/min = Peripheral speed in feet per minute
n = Constant 3.1415927 Again, by replacing the constant 3 1 8.3 with constant 320
D = Diameter in inches (cutter diameter for milling,
(oreven 300), the r/min will be somewhat inaccurate, but
or part diameter for turning)
most likely within an acceptable range.

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 less demanding calculations, the 3.82 constant may


To select a surface speed is only a half of the procedure.
be rounded to 4 and used as an easier calculation without a
The other half is to communicate this selection to the con-
calculator. The measuring units must be applied properly,
trol system. The control has to be set to the surface speed
otherwise the results will not be correct.
mode, not the r/min mode. Operations as drilling, reaming,
tapping, etc., are common on a lathe and they require the
Never mix English and metric units in the same program !

direct r/min in the program. To distinguish between the two


alternatives in a lathe programming, the choice of the sur-
Spindle Speed - Metric Units
face speed or the revolutions per minute must be specified.
When metric system is used in the program, the logic of This is done with preparatory commands G96 and G97,
previous formula is the same, but the units are different: prior to the spindle function:
SPINDLE CONTROL
83

G96 S.. MO 3 Surface speed selected O Example 1 :

G97 S.. MO 3 Revolutions per minute selected


The surface speed is set right after the coordinate setting,

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

allows the tool to remove constant amount of material at all


times, thus saving the cutting tool from excessive wear and
O Example 2

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:

least two cases when that is the case.


G50 X9.0 Z5.0 S1500
In the zero diameter is programmed for all cen-
first case,

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

maximum r/min available within M42 gear range. A typical


G92 command but programming method is the same.
speed may be 3500 r/min or higher.
Part Diameter Calculation in CSS
With the preset maximum spindle speed limit of 1500
Often, knowing at what diameter the spindle will actually
r/min (G50 SI 500), the spindle will be constantly increas-
be clamped can be a useful information. Such knowledge
ing its speed, but only until it reaches the 1500 preset r/min,
then it will remain at that speed for the rest of cut. may influence the preset value of spindle speed clamp. To
find out at what diameter the Constant Surface Speed will
At the control, CNC operator can easily change the maxi- remain fixed, the formula that finds the r/min at a given dia-
mum limit value, to reflect true setup conditions or to opti- meter must be reversed:
mize the cutting values.

Spindle speed is preset (or clamped) to the maximum


r/min setting, by programming the S function together with
the G50 preparatory command. If the S function is in a
block not containing G50, the control will interpret it as a
new spindle speed (CSS or r/min), active from that block es* where . .

on. This error may be very costly!


D = Diameter where CSS stops (in inches)
12 = Multiplying factor -feet to inches
Use caution when presetting maximum r/min of the spindle!
=
ft/min Active surface speed
71 = Constant 3.1415927
The maximum spindle speed can be clamped in a sepa- r/min = Preset maximum spindle speed
rate block or in a block that also includes the current tool
coordinate setting. In the example 01201, block N2 con- O Example - English units :

tains both settings. Typically, the combined setting is useful


If the preset value in the program is G50 SI 000 and the
at the beginning of a tool, the separate block setting is use-
surface speed is selected as G96 S350, the CSS will be
ful if the need arises to change the maximum spindle speed
clamped when it reaches the 01.3369 inches:
in the middle of a tool, for instance, between facing and
turning cuts using the same tool.
D = (12 x 350) / (71 x 1000)
To program the G50 command as a separate block, any- = 1.3369015
where in the program, just issue the preparatory command = 01.3369
combined with the spindle speed preset value. Such a block
will have no effect whatsoever on any active coordinate set-
The formula may be shortened:
ting, it represents just another meaning of G50 command.
The following examples are all correct applications of G50
command for both, the coordinate setting and/or the maxi-
mum spindle speed preset:
86 Chapter 12

B*‘ where If these requirements are met, the


. . most important source
data is the spindle speed actually used during machining.
D Diameter where CSS stops (in mm) Once the optimum spindle speed is known, the cutting
1000 Multiplying factor - meters to mm speed (CSS) can be calculated and used for any other tool
m/min Active surface speed
diameter, providing the requirements above are met.
n Constant 3. 141 5927
r/min Preset maximum spindle speed In a nutshell, the whole subject can be quickly summed
up by categorizing it as a CSS calculation - that of Constant
Just like in the English version, you may shorten the met- Surface Speed, also known as the Cuting Speed (CS), when
ric formula as well: the tool or part diameter and the spindle speed are known.
From there on, it is a simple matter of formulas:
318.3 x m/min
D To calculate the Cutting Speed in English units:
r/min

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

surface speed G96 SI 65, the CSS will be


clamped when
is

it
selected as
reaches the 043.768 mm:
O EXAMPLE:

A 05/8 inch drill works very well at 756 r/min - what is

D = (1000 x 165) / (7t x 1200) its cutting speed in ft/min?


= 43.767609
= 043.768 ran
ft/min = (3.14 x 0.625 x 756) / 12 = 123.64

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

Cutting tools are equivalent


The major benefit of using this method is a significant re-
duction of time spent at the CNC machine, usully required
Material conditions are equivalent and optimum
to find 'fine-tune' the spindle speed during
Other common conditions are satisfied setup or part optimization.
/
FEEDRATE CONTROL

Feedrate is the closest programming companion to the FEEDRATE FUNCTION


spindle function. While the spindle function controls the
spindle speed and the spindle rotation direction, feedrate
The calling address for a feedrate word in the program is
controls how fast the tool will move, usually to remove ex-
the address F, followed by a number of digits. The number
cessive material (stock). In this handbook, the rapid posi-
of digits following the address F depends on the feedrate
tioning,sometimes called a rapid motion or rapid traverse
mode and the machine tool application. Decimal place is
motion, is not considered a true feedrate and will be de-
usually allowed.
scribed separately, in Chapter 20.

Feedrate per Minute


FEEDRATE CONTROL
For milling applications, all cutting feedrate in the linear
and circular interpolation mode is programmed in inches
Cutting feedrate is the speed at which the
per minute (in/min) or in millimeters per minute (mm/min).
cutting tool removes the material by cutting action.
The value of the feedrate is the distance a cutting tool will
travel in one minute. This value is modal and is canceled
The cutting action may be a rotary motion of the tool
only by another F address word. The main advantage of the
(drilling and milling, for example), the rotary motion of the
feedrate per minute is that it is not dependent on the spindle
part (lathe operations), or other action (flame cutting, laser
speed. That makes it very useful
in milling operations, us-
cutting, water jet, electric discharge etc.). The feedrate
ing a large variety of tool diameters. Standard abbrevia-
function is used in the CNC program to select the feedrate tions for feedrate per minute are:
value, suitable for the desired action.
Inches per minute in/min (or older ipm)
Two feedrate types are used in CNC programming:
Millimeters per minute mm/min
Feedrate per minute
The most typical format for feedrate per minute is F3.1
Feedrate per revolution
for the English system and F4.1 for the metric system.
The most common types of machines, CNC machining
For example, the feedrate of 15.5 inches per minute, will
centers and lathes, can be programmed in either feedrate
be programmed as FI 5. 5. In the metric system, the feedrate
mode. In practice, it is much more common to use the amount of 250 mm/min will appear in the program as
feedrate per minute on machining centers and the feedrate
F250.0. A slightly different programming format may be
per revolution on the lathes.
expected for special machine designs.
There is a significant difference in G codes used for ma- One important item to remember about feedrate is the
chining centers and lathes.
range of the available feedrate values. The feedrate range
of the control system always exceeds that of the machine
Turning Turning Turning servo system. For example, the feedrate range of a Fanuc
FEEDRATE Milling
CNC system is between .0001 and 24000.0 in/min or
Group A Group B Group C
0.0001 and 240000.0 mm/min. Note that the difference be-
Per minute G94 G98 G94 G94 tween the two units is only a decimal point shift, not an ac-
tual translation. In programming, only the feedrates that
Per revolution G95 G99 G95 G95 belong within the specified range can be used. Such a
feedrate will be smaller than that for the control system.

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

Feedrate per Revolution Spindle speed - in rev/min

For the CNC lathe work, the feedrate is not measured in Tool diameter [
M ]
or the tool nose radius T
[ ]

terms of time, but as the actual distance the tool travels in


Surface requirements of the part
one spindle revolution (rotation). This feedrate per revolu-
tion iscommon on lathes (G99 for Group A). Its value is Cutting tool geometry
modal and another feedrate function cancels it (usually the
Machining forces
G98). Lathes can also be programmed in feedrate per min-
ute (G98), to control the feedrate when the spindle is sta- Setup of the part
tionary. Two standard abbreviations are used for feedrate
Tool overhang (extension)
per revolution:
Length of the cutting motion
Inches per revolution in/rev (or older ipr)
Amount of material removal (depth or width of cut)
Millimeters per revolution mm/rev
Method of milling (climb or conventional)
The most typical format for feedrate per revolution is four
Number of flutes in the material (for milling cutters)
decimal places English system and three decimal
in the
places in the metric system. This format means the feedrate Safety considerations
of 0.083333 in/rev will be applied in the CNC program as
F0.0833 on most controls. The metric feedrate example of The last item always a programming responsi-
is safety,

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.

for metric units.


ACCELERATION AND DECELERATION
Be careful when rounding feedrate values. For turning
and boring operation, reasonably rounded feedrates are
quite sufficient. Only in single point threading, the feedrate
During a contouring operation, the direction of the cut-
precision is critical for a proper thread lead, particularly for
ting motion is changed quite often. There is nothing un-
long or very fine threads. Some Fanuc controls can be pro- usual about it, with all the intersections, tangency points

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

Example 01302 guarantees a sharp comer at all three po-


sitions of the only one corner is critical for sharp-
part. If
ness, program the G09 command in the block that termi-
G09/G61 NOT USED G09/G61 USED
nates at that corner (program 01303):
Figure 13-1

01303 (GO 9 CUTTING) Feedrate control around corner - Exact Stop commands
The overshoot is exaggerated for clarity

N13 GOO X15.0 Y12.0


N14 G01 X19.0 F90.0 Automatic Corner Override
N15 G09 Y16.0
N16 X15.0 While a cutter radius offset is in effect for a milling cutter,
N17 Y12.0 the feedrate at the contour change points is normally not
overridden. In a case like this, the preparatory command
G62 can be used
automatically override the cutting feed-
to
The G09 command is useful only if a handful of blocks rate at the corners of a part. This command is active until
require the deceleration for a sharp corner. For a program theG61 command (exact stop check mode), the G63 com-
where all corners must be precise, the constant repetition of mand (tapping mode), or the G64 command (cutting mode)
the G09 is not very efficient. is programmed.

Exact Stop Mode Command Tapping Mode


The second command that corrects an error at sharp cor- Programming in the tapping mode G63 will cause the
ners is G61 - Exact Stop Mode. It is much more efficient control system to ignore any setting of the feedrate over-
than G09 and functions identically. The major difference is ride switch, except the 100% setting. It will also cancel the
that G61 is a modal command that remains in effect until it function of the feedhold key, located on the control panel.
is canceled by the G64 cutting mode command. G61 short- The tapping mode will be canceled by programming the
ens the programming time, but not the cycle time. It is most G61 command (exact stop check), or the G62 command
useful when the G09 would be repeated too many times in (automatic corner override mode selection), or the G64
the same program, making it unnecessarily too long. command (cutting mode selection).
90 Chapter 13

Cutting Mode It is important to understand that the effective cutting ra-


dius will decrease in size for all internal arcs and will in-
When mode G64
programmed or is active
the cutting is
it

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.

The mode can be canceled by programming G61


cutting Circular Motion Feedrates
command (exact stop mode), G62 command (automatic
Setting feedrates for circular motions is generally the
corner override mode) or G63 command (tapping mode).
same as for linear feedrates. In fact, most programs do not
The G64 command is not usually programmed, unless change feedrate for linear and circular tool motions. If the
one or more of the other feedrate modes are used in the part surface finish important, the ‘normal’ feedrate must
is

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:

G62 USED G64 USED


F, = r / min x F x n
t
Figure 13-2

Corner override mode G62 and default G64 cutting mode os’ where . .

CONSTANT FEEDRATE F, = Linear feedrate (in/min or mm/min)


r/min = Spindle speed
F, = Feedrate per tooth (cutting edge)
In Chapter 29, the topic is circular interpolation. In this n = Number of cutting edges (flutes or inserts)
chapter are detailed explanations and examples of main-
taining a constant cutting feedrate for inside and outside Based on the linear feedrate formula, the arc feedrate ad-

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:

While running a program, the programmed feedrate may


F, x (R - r)
F = be temporarily suspended or changed by using one of two
available features of the control system. One is called a
feedhold switch, the other is a feedrate override switch.
Both switches are standard and allow the CNC operator to
cs" where . .
manually control the programmed feedrate during program
execution. They are located on the operation panel.
F, = Feedrate for inside arc
F, = Linear feedrate
R = Inside radius of the part
Feedhold Switch
r = Cutter radius
Feedhold is a push button that can be toggled between
Feedhold ON and Feedhold OFF modes. It can be used for
MAXIMUM FEEDRATE both feedrate modes, the feedrate per minute or the feed-
rate per revolution. On many controls, the feedhold will

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.

on a particular machine may be only 393 in/min, although


For certain machining operations, the feedhold function
the CNC system can support a feedrate several times
is automatically disabled and becomes ineffective. This is
greater. This is applicable to all controls, but there are addi-
tional programming considerations for CNC lathes, where
typical for tapping and threading, using the G84 and G74
tapping cycles on machining centers and threading opera-
the feedrate per revolution is the main method of program-
tions using the G32, G92 and G76 on lathes.
ming a cutting tool.
Feedrate Override Switch
Maximum Feedrate Considerations
Feedrate override is normally controlled by means of a
The maximum cutting feedrate per revolution is always
special rotary switch, located on the control panel of the
restricted by the programmed spindle speed (r/min) and the
maximum rapid traverse rate of the CNC lathe. It is quite
CNC unit - Figure 13-3.

easy to program the feedrate per revolution too high with-


out even realizing it. This problem is most common in sin-
gle point threading.

A CNC machine cannot deliver heavier feedrates than the


maximum it was designed for, the results will not be accu-

rate.Threading results could be unacceptable. When un-


usually heavy feedrates and fast spindle speeds are used in
the same program, it is advisable to check whether the final
feedrate does not exceed the maximum feedrate allowed on
the given machine. It can be calculated the maximum fee-
drate per revolution, according to the following formula:

F max

Typical feedrate override switch

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.

functions are disabled - through the program !


The feedrate function E is similar to the F function. It also
The control system offers two feedrate override functions specifies the thread lead as feedrate per revolution, in in/rev
for cutting motions other than tapping or threading cycles. or in mm/rev, hut it has a greater decimal place accuracy.
They are M48 and M49. These are programmable func- On older Fanuc control system model 6T, for example, the
tions, but may not be available for all controls. range for the thread lead is:

Feedrate Override Functions O English - Fanuc 6T control

Although the feedrate function uses the address F, two


F = 0.0001 to 50.0000 in/rev
special miscellaneous functions M can be used in the pro-
E = 0.000001 to 50.000000 in/rev
gram to set the feedrate override ON or OFF. On the opera-
provided for feedrate override. If the
a switch
tion panel,
CNC
is

programmed feedrate has to be


operator decides that
© Metric - Fanuc 6T control

temporarily increased or decreased this switch is very ,

F = 0.001 to 500.000 mm/rev


handy. On the other hand, during machining operations,
where the cutting feedrate must be used as programmed, E = 0.0001 to 500.0000 mm/rev
the override switch has to be set to 100% only, not to any
other setting.
On the newest control models, FS-0/10/1 1/15/16T, the
ranges are similar (there is no E address), but the safest way
A good example are special tapping operations without to find the available ranges is to lookup the specifications
cycles, using G01 and GOO preparatory commands. Func- for your control system.
tions M48 and M49 arc used precisely for such purposes:
The E address is redundant on the newer controls and is

retained only for compatibility with older programs that


Feedrate override cancel function is OFF,
M48 may be used on machines equipped with newer controls.
which means feedrate override is active
The available threading feedrate ranges vary between dif-
Feedrate override cancel function is ON.
M49 ferent control systems, and depend on the type of feed
which means feedrate override is inactive
screw and the input units used in the program.
14 TOOL FUNCTION

Each numerically controlled machine using an automatic


tool changer must have a special tool function (T function)
thatcan be used in the program. This function controls the
behavior of the cutting toot, depending on the type of ma-
chine There are noticeable differences between T
tool.
functions used on CNC machining centers and those used
on CNC lathes. There are also differences between similar
controls for the same machine type. The normal program-
ming address for the tool function uses the address T.

For CNCmachining centers, the T function typically


controls the tool number only. For the CNC lathes, the
function controls indexing to the tool station number, as
well as the tool offset number.

T FUNCTION FOR MACHINING CENTERS

All vertical and horizontal CNC machining centers have


a feature called the Automatic Tool Changer, abbreviated as
ATC. In the program or MDI mode
on the machine, this
feature uses the function T,where the T address refers to a
tool number selected by the programmer. The subsequent
digits describe the tool number itself. On CNC machines
with a manual tool change, the tool function may not be
required at all. Figure 14-1

Typical side view of a 20-tool magazine


Before programming for a particular machining CNC
center begins, the type of the tool selection for that machine
The capacity of such a magazine can be as small as ten or
must be known. There are two major types of tool selection
twelve tools and as high as several hundred tools on special
used in automatic tool change process:
machines. Typical medium size machining center may
Fixed type have between twenty and forty tools, larger machines will
have more. The magazine is usually round or oval (larger
Random memory type
capacity will be shaped in a zigzag form). It consists of a

the difference between them, the


certain number of pockets - where the tool holder
or pots -
To understand first step
is to understand the general principles of tool storage and with a cutting tool is placed during setup. Each pocket is

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

quires the CNC operator to place all tools into magazine


cut a part. Actual tool change can take place anytime later.
The is the concept of the next tool waiting - where the T
pockets that match the tool numbers. For example, tool
function refers to the next tool, not the current tool. In the
number (called as T01 in the program) must be placed
1

program, the next tool can be made ready by programming


into themagazine pocket number 1, tool number 7 (called
a few simple blocks:
as T07 in the program) must be placed into the magazine
pocket number 7, and so on.
T04 (MAKE TOOL 4 READY)
The magazine pocket is mounted on a side of the CNC
machine, usually away from the work area (work cube). <... Machining with previous tooI ...>
With the fixed tool selection, the control system has no way
of determining which tool number is in which magazine MO 6 (ACTUAL TOOL CHANGE - T04 IN SPINDLE)
pocket number at any given time. The CNC operator has to T15 (MAKE NEXT TOOL READY)
match the tool numbers with the magazine pocket numbers
during setup. This type of a tool selection is commonly <... Machining with tool 4 T04 ...>
found on many older CNC machining centers, or on some
inexpensive machining centers.
In the first block, the T04 tool was called into the waiting
Programming the tool is quite easy - whenever the T station of the tool magazine, while the previous tool was
function number is used in the program, that will be the tool still cutting. When the machining has been completed, ac-
number selected during a tool change. For example, tual tool change will take place, where T04 will become the
active tool. Immediately, the CNC system will search for
N67 T04 MO the next tool (T15 in the example) and places it into the
waiting position, while T04 is cutting.
or
This example illustrates that the T function will not make
N67 MO 6 T04 any physical tool change at all. For that, the automatic tool
change function - M06 - also described later in this section,
or
is needed and must be programmed.

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

Programming Format Q Example

Programming format for the T function used on milling


systems depends on the maximum number of tools avail- N81 T01 . . . makes T01 ready = loaded in the waiting position
able for the CNC machine. Most machining centers have N82 MO 6 ... brings T01 into the spindle
number of available tools under 100, although very large N83 TO 2 ... makes T02 ready = loaded iti the wailing position
machines will have more tool magazines available (even
several hundred). In the examples, two-digit tool function The three blocks appear to be simple enough, but let’s ex-
will used, covering tools within a range of T01 to T99. plore them anyway. In block N81, the tool addressed as
T01 in the program will be placed to the waiting position.
In a typical program, the T01 tool command will call the
The next block, N82, will activate the actual tool change -
tool identified in the setup sheet or a tooling sheet as tool
tool T01 will be placed into the spindle, ready to be used for
number 1; T02 will call tool number 2, T20 will call tool
machining. Immediately following the actual tool change
number 20, etc. Leading zeros for tool number designation
is T02 in block N83. This block will cause the control sys-
may be omitted, if desired - T01 can be written as T1 T02 ,

tem to search for the next tool, T02 in the example, to be


as T2, etc. Trailing zeros must always be written, for exam-
placed into the waiting position. The search will take place
ple, T20 must be written as T20, otherwise the system will
simultaneously with the program data following block
assume the leading zero and call the tool number 2 (T2
N83, usually a tool motion to the cutting position at the
equals to T02, not T20).
part. There will be no time lost, on the contrary, this method

assures that the tool changing times will be always the


Empty Tool or Dummy Tool same (the so called chip-to-chip time).

Often, an empty spindle, free of any tool, is required. For


Some programmers prefer to shorten the program some-
this purpose, an empty tool station has to be assigned. Such
what by programming the tool change command together
a tool will also have to be identified by a unique number,
with the next tool search in the same block. This method
even if no physical tool is used. If the magazine pocket or
saves one block of program for each tool:
the spindle contains no tool, an empty tool number is neces-
sary for maintaining the continuity of tool changes from
N81 T01
one part to another. This nonexistent tool is often called the N82 MO 6 T02
dummy tool or the empty tool.

The results will be identical - the choice is personal.


The number of an empty tool should be selected as higher
than the maximum number of tools. For example, if a ma-
Some machine tools will not accept the shortened two-block
chining center has 24 tool pockets, the empty tool should be version and the three-block version must be programmed.
identified as T25 or higher. It is a good practice to identify If in doubt, always use the three-block version.
such a tool by the largest number within the T function for-
mat. For example, with a two digit format, the empty tool
should be identified as T99, with a three digit format as
Conditions for Tool Change
T999. This number is easy to remember and is visible in the
program. Before calling the M06 tool change function in the pro-
gram, always create safe conditions. Most machines have a
As a rule, do not identify the empty tool as TOO - all tools
light located on the control panel for visual confirmation
not assigned may be registered as TOO. There are, however,
that the tool is at the tool change position.
machine tools that do allow the use of TOO, without possi-
ble complications. The safe automatic tool change can take place only if

these conditions are established:


TOOL CHANGE FUNCTION - M06 The machine axes had been zeroed

The spindle must be fully retracted:


The tool function T, as applied to CNC machining cen-
ters, will not cause the actual tool change - the miscella-
( a ) In Z axis at machine zero for vertical machines
neous function M06 must be used in the program to do that.
( b ) In Y axis at machine zero for horizontal machines
The purpose of tool change function is to exchange the tool
in the spindle with the tool in the waiting position. The pur- u The X and Y axis positions of the tool

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 :

tween tools in the middle of the program (from T02 to T03)


- graphically illustrated in Figures 14-2 to 14-4: N51 ... (... T02 IN SPINDLE)
N52 . . . TO 3 TO 3 READY FOR TOOL CHANGE)
( . .

. . (MACHINING WITH T02)


TOOL MAGAZINE SPINDLE N75 GOO
.

Z1.0 (RETRACT FROM DEPTH)


N76 G28 Z1.0 M05 (T02 COMPLETED)
T02 N77 M01 (OPTIONAL STOP)
(BLANK LINE BETWEEN TOOLS)
T03 N78 T03 (T03 CALL REPEATED)
N79 MO 6 (T02 OUT - T03 IN THE SPINDLE)
N80 G90 G54 GOO X-18.56 Y14.43 S700 M03 T04
.h - N81 . . . (MACHINING WITH T03)

In theexample, block N76 represents the end of machin-


LA t
ing, using tool T02. It will cause tool T02 to move into the
ATC
m Z axis machine zero position, stopping the spindle at the
€ same time. The optional program stop function M01 fol-
lows in the block N77.
Front view of the machine
In the following block N78, the call for T03 is repeated -

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.

N80, the rapid motion in X and Y axes


Finally, in block
represents the motion of T03, with spindle ON. Note
first

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.

Also note that when T02


completed in block N77, it is
is

still in programmers who do not fol-


the spindle'. There are
low this method. If the tool change is included right after
the G28 block (machine zero return) and before the M01
block, it will be more difficult for the operator to repeat the
tool that just finished working, if it becomes necessary.

AUTOMATIC TOOL CHANGER - ATC


ATC example - Block N79 (actual tool change)
Several references to Automatic Tool Changer (ATC)

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* '

the proper order. Everything will be under program control.


Programmer and operator should be thoroughly familiar
vr with the type of ATC on all machining centers in the shop.

Typical ATC System


ATC £>. . J

A typical Automatic Tool Change system may have a


double swing arm, one for the incoming tool, another for
Front view of the machine the outgoing tool. It will likely be based on Random Mem-
ory' selection (described earlier), which means the next tool
Figure 14-4
can be moved to a waiting position and be ready for a tool
ATC example - Block N80 (new tool waiting = next tool)
TOOL FUNCTION 97

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.

the tool greatly, from as few as 10 to as


magazine varies Any physical contact of the tool with the machine, the fix-

many as 400 or more. A small CNC vertical machining is extremely undesirable. Such a condition
ture or the part

center may have typically 10 to 30 tools. Larger machining


could be very dangerous - there is not much that can be
centers will have a greater tool capacity. done to interrupt the ATC cycle, except pressing the Emer-
gency Switch which is usually too late. Figure 14-6 illus-
,

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:

Maximum tool diameter

Maximum tool length

Maximum tool weight

Maximum Tool Diameter

The maximum tool diameter that can be used without any


special considerations is machine manu-
specified by the
facturer. assumes that a maximum diameter of a certain
It

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.

Do not exceed the recommended tool weight during setup !

For example, a given CNC machining center may have


the maximum recommended tool weight specified as 22
The adjacent pockets must be empty for a large tool diameter
pounds or about 10 kg. If even a slightly heavier tool is
For example, a machine description lists the maximum used, for example 24 lb. (10.8 Kg), the ATC should not be
tool diameter with adjacent tools as 4 inches (100 mm). If used at all - use a manual tool change for that tool only. The
both adjacent pockets are empty, the maximum tool diame- machine spindle may be able to withstand a slight weight
ter can be increased to 5.9 inches ( 150 mm), which may be increase but the tool changer may not. Since the word
quite a large increase. By using tools with a larger than rec- 'slight' is only relative, the best advice in this case is - do
ommended diameter, there is a decrease in the actual num- not overdo it! If in doubt, always consult the manufac-
ber of tools that can be placed in the tool magazine. turer’s recommendations. Examples in this chapter illus-
trate how
to program such a unusual tool change, providing
Adjacent pockets must be empty for oversize tools ! the tool weight is safe.
98 Chapter 14

ATC Cycle MDI Operation

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

different for some machines. Always study individual steps


knowledge will resolve a
PROGRAMMING THE ATC
of the ATC operation - often, that
problem of a tool jam during the tool changing. This is a
possible time loss that can be avoided. Some machines A number of possibilities exists in relation to the auto-

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

9. Arm rotates 60 degrees CW first tool used in the CNC program


1 0. The rack returns any tool in
T02 ... tool designation represents
11. Tool pot moves up the CNC program between the first and
- the last tool
The example is only presented as general information
its be adapted to each machine tool. The in-
logic has to T03 ... 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 ...

(dummy tool) as an empty tool pocket


Regardless of the machine tool used, two conditions are
identification
always necessary to perform the ATC correctly:

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.

axis is the Z axis, for the horizontal machining centers it is


Single Tool Work
the Y axis. The M06 function will also stop the spindle, but
never count on strongly recommended to stop the
Certain jobs or special operations may require only one
it. It is

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

01401 (FIRST TOOL IN THE SPINDLE AT START)


N1 G20 (INCH MODE) Block Number Tool Waiting Tool in Spindle
N2 G17 G40 G80 (SAFE BLOCK)
N3 G90 G54 GOO X.. Y. S. M03 (TOOL MOTION) . .

N4 G43 Z.. HOI M08 (APPROACH WORK)

< . . . 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)

N30 T02 (T02 CALL REPEATED)


N31 MO 6 (TO 2 TO SPINDLE)
N393 GOO Z.. MO 9 (CURRENT TOOL WORK DONE)
N32 G90 GOO G54 X. . Y. . S.. MO 3 T03 (T03 READY)
N394 G28 Z. M05 . (CURRENT TOOL TO Z HOME)
N33 G43 Z.. HO 2 MO (APPROACH WORK)
N395 G28 X. Y. . . (CURRENT TOOL TO XY HOME)
N396 M30 (END OF PROGRAM)
% < . . . 702 working ...>

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.

T01 WORKING First Tool in the Spindle


N30 T02 T01
Program may also with the
start first tool in the spindle.
N31 T01 T02 This is a common practice for the ATC programming. The
first tool in the program must be loaded into the spindle
N32 T03 T02 during setup. In the program, the first tool is called to the
waiting station (ready position) during the last tool - not the
T02 WORKING
first tool. Then, a tool change will be required in one of the
N50 T03 T02 last blocks in the program. The first tool in the program
must be first for all parts within the job batch.
N51 T02 T03

N52 T01 T03 01403 (FIRST TOOL IN SPINDLE AT START)


N1 G20 (INCH MODE)
T03 WORKING N2 G17 G40 G80 T02 (GET T02 READY)
N3 G90 G54 GOO X.. Y. S.. M03 .

When the machined and any other part af-


second part is N4 G43 Z.. HOI M08 (APPROACH WORK)
ter that, the tools tracking is simplified and consistent.
Compare the next table with the previous one - there are no < . . . TJ I working ...>
question marks. The table shows where each tool is.
N26 GOO Z.. MO (T01 MACHINING DONE)
Block Number Tool Waiting Tool in Spindle N27 G28 Z.. MO (T01 TO Z HOME)
N28 GOO X.. Y.. (SAFE XY POSITION)
N1 T01 T03 N29 M01 (OPTIONAL STOP)

N2 T01 T03 N30 T02 (T02 CALL REPEATED)


N31 MO (T02 TO SPINDLE)
N3 T03 T01
N32 G90 G54 GOO X.. Y S.. MO 3 T03 (T03 READY)
N4 T02 T01 N33 G43 Z.. HO 2 M08 (APPROACH WORK)

T01 WORKING < . . . T02 working ...>


N30 T02 T01
N46 GOO Z.. MO (T02 MACHINING DONE)
N31 T01 T02 N47 G28 Z.. MO (T02 TO Z HOME)
N48 GOO X. . Y. (SAFE XY POSITION)
N32 T03 T02
N49 M01 (OPTIONAL STOP)
T02 WORKING
N50 T03 (T03 CALL REPEATED)
N50 T03 T02 N51 MO 6 (T03 TO SPINDLE)
N52 G90 G54 GOO X. Y . S.. MO 3 T01(T01 READY)
N51 T02 T03 N53 G43 Z.. HO 3 M03 (APPROACH WORK)
N52 T01 T03
< . . . T03 working . . >
T03 WORKING
N66 GOO Z.. MO (T03 MACHINING DONE)
Examples shown here use method as is or slightly
this N67 G28 Z.. MO (T03 TO Z HOME)
modified. For most jobs, there is no need to make a tool N68 GOO X. . Y. (SAFE XY POSITION)
change at XY safe position, if the work area is clear of ob- N69 MO (T01 TO SPINDLE)
stacles. Study this method before the others. It will help to
N70 M30 (END OF PROGRAM)
%
see the logic of some more advanced methods a lot easier.
TOOL FUNCTION 101

This method is not without a disadvantage. Since there is


First Tool in the Spindle with Manual Change
always a tool in the spindle, it may become an obstacle dur-
In the next example, the second tool represents any mid-
ing setup or part changing. The solution is to program the
dle tool in the program using three or more tools. This tool
tool change in such a way that there is no tool in the spindle
may be too heavy or too long and cannot be indexed
during the part setup (spindle empty condition).
through the ATC cycle and must be loaded manually. This
tool change can be done by the operator, but only if the pro-
No Tool in the Spindle
gram supports manual tool change. To achieve this goal is
to use M(X) program stop with an appropriate comment, de-
An empty spindle at the start and end of each machined
part is less productive than starting with the first tool in the
scribing the reason for the stop. Optional stop M01 is not a
spindle. One extra tool change increases the cycle time. An good selection - MOO is a much safer choice - it will always
stop the machine without interference from the operator.
empty spindle at start should only be used if the program-
mer has a valid reason, for example, to recover space above Follow the next example carefully, to understand how a
the part that would otherwise be occupied by the tool. The
manual tool change can be performed when the first tool is
recovered space may be useful for removing the part, for in the spindle. T02 in the example will be changed manu-
example, with a crane or a hoist. The programming format ally by the CNC operator.
for this situation is not much different from the previous ex-
ample - except that there is an extra tool change at the end 01405 (FIRST TOOL IN SPINDLE AT START)
of the program. This tool change brings the first tool back N1 G20 (INCH MODE)
into the spindle, for consistent startup of each program run. N2 G17 G40 G80 T99 (GET T99 READY)
N3 G90 G54 GOO X.. Y. . S. M03 .

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 ...>

01406 (NO TOOL IN SPINDLE AT START)


N1 G20 N26 GOO Z. . MO 9 (T01 MACHINING DONE)
(INCH MODE)
N2 G17 G40 G80 T01 N27 G28 Z. MO 5 (T01 TO Z HOME)
(GET T01 READY)
N3 MO 6 N28 GOO X. . Y. . (SAFE XY POSITION)
(T01 TO SPINDLE)
N4 G90 G54 GOO X. N29 M01 (OPTIONAL STOP)
Y. S. M03 T99 (T99 READY) , . .

N5 G43 Z.. HOI M08 (APPROACH WORK)


N30 T99 (T9 9 CALL REPEATED)
N31 MO 6 (T9 9 TO SPINDLE)
< . . . TO I working . . . > N32 T02 (T02 READY)
N33 MO 6 (T02 TO SPINDLE)
N26 GOO Z. . MO 9 (T01 MACHINING DONE) N34 G90 G54 GOO X. . Y. S.. MO 3 (NO NEXT TOOL)
N27 G28 Z. . MO 5 (T01 TO Z HOME) N35 G43 Z. HO 2 MO 8 (APPROACH WORK)
N28 GOO X. . Y. . (SAFE XY POSITION)
N29 M01 (OPTIONAL STOP) < 702 working
. . . . . . >
N30 T99 (T9 9 CALL REPEATED)
N31 MO 6 N46 GOO Z. MO 9 (T02 MACHINING DONE)
(T99 TO SPINDLE)
N32 T03 N47 G28 Z. . MO 5 (T02 TO Z HOME)
(T03 READY)
N33 MOO (STOP AND LOAD T02 MANUALLY) N48 GOO X. . Y. . (SAFE XY POSITION)
N34 G90 G54 GOO X. Y. S.. MO 3 (NO NEXT TOOL) . ..
N49 M01 (OPTIONAL STOP)
N35 G43 Z. . H02 MO 8 (APPROACH WORK)
N50 MO 6 (T02 OUT OF SPINDLE TO THE SAME POT)
N51 T03 (T03 READY)
< . . . T02 working > N52 MO 6 (T03 TO SPINDLE)
. .

N53 G90 G54 GOO X.. Y. S.. M03 T01(T01 READY) .

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

Lathe Tool Station


Both adjacent magazines pockets
must be empty for an oversize tool diameter A typical slant bed lathe uses a polygonal turret holding
all external and internal cutting tools in special holders.
In the 01408 example, T02 represents the large tool. These tool stations are similar to a tool magazine on a ma-
chining center. Their design accepts 8, 10, 12 or more cut-
01408 (NO TOOL IN SPINDLE AT START) ting tools - Figure 14-7.
N1 G20 (INCH MODE)
N2 G17 G40 G80 T01 (GET T01 READY) -
N3 MO 6 (T01 TO SPINDLE)
N4 G90 G54 GOO X.. Y. S.. MO 3 T99 (T99 READY)
N5 G43 Z.. HOI M08 (APPROACH WORK)

< . . . TO I working ...>


r4>
L
w
N26 GOO Z.. MO (T01 MACHINING DONE) 07 03

N27 G28 Z. MO . (T01 TO Z HOME)


N28 GOO X.. Y. (SAFE XY POSITION)
N29 M01 (OPTIONAL STOP) 1

(T99 CALL REPEATED)


1
N30 T99 1

N31 MO (T9 9 TO SPINDLE)


N32
N33
T02
MO
(T02 READY)
TO SPINDLE)
(TO 2
l1 u
N34 G90 G54 GOO X.. Y. . S.. MO 3 (NO NEXT TOOL)
N35 G43 Z.. HO 2 M08 (APPROACH WORK) Figure 14-7

Typical view of an octagonal lathe turret

< 702 working >


CNC
. . . . . .

Many latest models start adopting the tool


lathe
changer type similar to machining centers, with many more
N46 GOO Z.. M09 (TO 2 MACHINING DONE)
tools available and away from the work area.
N47 G28 Z.. MO (T02 TO Z HOME)
N48 GOO X. Y. (SAFE XY POSITION) one
.
Since all tools are normally held in a single turret, the
N49 M01 (OPTIONAL STOP)
selected for cutting will always carry along all other tools

(T02 OUT OF SPINDLE TO THE SAME POT)


into the work area. This may be a design whose time has
N50 MO 6
N51 T03 (T03 READY) passed but it is still very commonly used in industry. Be-
N52 MO 6 (T03 TO SPINDLE) cause of a possible interference between a tool and the ma-
N53 G90 G54 GOO X. Y. S.. MO 3 T99 (T99 READY)
. . chine or part, care must be taken not only of the active cut-
N54 G43 Z.. HO 3 M08 (APPROACH WORK) ting tool, but also of all other tools mounted in the turret,
for all possible collision situations.
< . . . T03 working ...>
Tool Indexing
N66 GOO Z.. MO (TO 3 MACHINING DONE)
(T03 TO Z HOME) To program a tool change, or rather to index the cutting
N67 G28 Z.. MO
N68 GOO X. Y. . (SAFE XY POSITION) tool into the active position, the T
function must be pro-
N69 M01 (OPTIONAL STOP) grammed according to proper format. For the CNC
its

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.
%

These examples illustrate some of the ATC programming


methods. The once the tool changing
task is not difficult
mechanics of the machining center are known.

T FUNCTION FOR LATHES

So far, the tool function was covered as it applied to the


CNC machining centers. CNC lathes also use the tool func-
tion T, but with a completely different structure.
Figure 14-8

Structure of a 4-digit tool number for CNC lathes


104 Chapter 14

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

geometry offset 01 and wear offset 01


Geometry Offset
G Example
Geometry offset number is always the same as the turret
T0111 for turret station 01, stationnumber. The operator measures and fills-in the ge-
geometry offset 01 and wear offset 1 ometry offsets for all tools used in the program.

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

with the offset another suitable wear offset number


1 1,
The distance from the machine zero position will reflect
must be selected, for example 2 1 and program it as TO 1 2 1
,
the distance from the tool reference point to the part refer-
Most controls have 32 or more offset registers for geometry
ence point. Figure 14-11 shows a typical measurement of
offsetsand another 32+ wear offsets registers.
the geometry offset applied to a common external tool.

The offset values can be applied to the CNC lathe pro-


All X
values will normally have diameter values and arc
gram by registering their value into the offset registers.
stored as negative for a typical rear lathe of the slant bed
type. The Z axis values will normally be also negative
TOOL OFFSET REGISTERS (positive values are possible but impractical). How to actu
ally measure the geometry offset is a subject of CNC ma-
The word offset has been mentioned already several times chine tool operation training, not programming.
with two adjectives - with the expression geometry offset
Figure 14-12 shows a typical measurement of the geome-
and the expression wear offset. What exactly is an offset ?
What is the difference between one offset and the other?
try offset applied to a common internal tool.
TOOL FUNCTION 105

The third and last possibility relating to the geometry off-


set is illustrated in Figure 14-13. It shows geometry offset
applied to any tool used on the spindle center line (at X0
position). These tools include center drills, drills, taps,
reamers, etc. Their X offset value will always be the same.
Wear Offset

In writinga CNC program, the same dimensions arc used


in the program as those in the finished drawing. For exam-
ple, a dimension of 3.0000 inches, is programmed as X3.0.
This figure does not reflect any implied dimensional toler-
ances. Program entries X3.0, X3.00, X3.000 and X3.0000
have exactly the same result. What is needed to maintain di-
mensional tolerances, particularly when they are tight?
What has to be done with a worn out tool that is still good
enough to cut a few more parts? The answer is that the pro-
Figure 14- 1 grammed tool path must be adjusted, fine-tuned, to match
Typical geometry offset for external (turning) tools the machining conditions. The program itself will not be
changed, but a wear offset for the selected tool is applied.

The WEAR offset value is the difference between the


programmed value and the actual measured size of the part.

Figure 14-14 illustrates the principle of the tool wear off-


set, although the scale is exaggerated for emphasis.

Typical geometry offset for internal (boring) tools


yiy. /
OFFSET
PATH
y \ PROGRAM
PATH

Figure 14-14

Programmed tool path and tool path with wear offset

The wear offset value has only one purpose - it compen-


sates between the programmed value, for example of the
3.0 inch diameter, and the actual dimension as measured
during inspection, for example 3.004. The differential
value of -.004 is entered into the wear offset register. This is
the offset number specified as the second pair of the tool
function in the program. Since the program uses diameters
for the X axis, the offsets will also be entered for a diame-
ter. Details on this kind of adjustment are more useful to the

CNC machine operator, but any programmer will benefit


Figure 14-13 from them as well.
Typical geometry offset for center line (drilling) tools
106 Chapter 14

Wear Offset Adjustment


Theprinciple of the wear offset adjustment is logical. If

To concept of offset adjustment on a rear


illustrate the the machined diameter is larger then the drawing dimen-
type lathe, T0404 sion allows, the wear offset is changed into the minus direc-
the program will be used as an exam-
in
ple. The goal is to achieve an outside diameter of 3.0 inches
tion, towards the spindle center line, and vice versa. This
and tolerance of ±.0005. The starting value of the wear off- principle applies equally to external and internal diameters.

set in the register Txx04 will be zero. The relevant section


The only practical difference is that an oversized external
of the program may look something like this: diameter and undersize internal diameter can be recut (see
the table above).Chapter 34 presents several practical ex-
N31 M01 amples using the wear offset creatively.

N32 T0400 M42 The R and T Settings


N33 G96 S450 M03
N34 GOO G42 X3.0 Z0.1 T0404 M08 The items are the R and T columns ( Geometry and
last
N35 G01 Z-1.5 F0.012 Wear). The offset screen columns are only useful during
N36 . . setup. The R column is the radius column, the T column is
the tool tip orientation column ( Figure 14-15).
When the machined part is inspected (measured), it can
have only one of three possible inspection results:

On-size dimension

Oversize dimension

Undersize dimension

If the part is measured on size, there is no need to inter-


fere. The tool setup and the program are working correctly.
it can usually be recut for machining
If the part is oversize,
an outside diameter. For an inside diameter, the exact oppo-
site will apply. The recut may damage the surface finish,
which could be a concern. If the part is undersize, it be-
comes a scrap. The aim is to prevent all subsequent parts
from being undersize as well. The following table shows
the inspection results for all existing possibilities:

Measurement External diameter Internal diameter

ON size Size OK Size OK

OVER size Recut possible SCRAP

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-

The external diameter X3.0 in the example may result in


quires the tool nose radius of the cutting tool, the column T
requires the tool tip orientation number of the cutting tool.
3.004 diameter measured size. That means it is 0.004 over-
Both are described in Chapter 30, in more detail. The most
size - on diameter. The operator, who is in charge of the off-
common tool nose radii for turning and boring are:
set adjustments, will change the current 0.0000 value in the
X register of the wear offset 04 to -0.0040. The subsequent 1/64 of an inch = .0156 or 0,4 mm
cut should result in the part that will be measured within 1/32 of an inch = .0313 or 0,8 mm
specified tolerances. 3/64 of an inch = .0469 or 1,2 mm
If the part in the example is undersize, say at 2.9990 The tool tip numbers are arbitrary and indicate the tool
inches, the wear offsetmust be adjusted by +.0010 in the X orientation number used to calculate the nose radius offset,
positive direction. The measured part is a scrap. regardless of the tool setting in the turret.
15 REFERENCE POINTS

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.

A reference point is a fixed or selected arbitrary location


Environment Relationship consists of ...
on the machine, on the tool and on the part. A fixed refer-
ence point is a precise location along two or more axes, de-
Machine Machine tool + Control system (CNC unit)
signed during manufacturing or setup. Some reference
points are established by the programmer, during the pro-
Part Workpiece + Drawing + Material
gramming process. In these three environments, three ref-
erence points are needed - one reference point for each of
Tool Holder + Cutting tool
the available groups:

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
..

the sources of each environment:


Tool reference point .. Tool tip or Command point
MACHINE TOOL is made by a company specializing in
machine tools, usually not controls or cutting tools In a typical language of a machine shop, these reference
points have somewhat more practical meaning. Home posi-
. . . this environment is combined with . .
tion or a machine zero are synonymous terms for machine
reference point. A program zero or part zero or part origin
CONTROL SYSTEM is made by a company specializing
, ,

are terms commonly used instead of the more official term


in the application of electronics to machine tools.

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.

PART (workpiece) is a unique engineering design


developed in a company that does not manufacture REFERENCE POINT GROUPS
machine tools, control systems, or cutting tools and
holders. The group is the CNC machine tool or CNC machine
first

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

Reference Point Groups Relationship

The key to any successful CNC program is to make all

three groups to work in a coordinated way. This goal can


only be achieved by understanding the principles of refer-
ence points and how they work. Each reference point can
have two characteristics:

Fixed reference point

Flexible or floating reference point

A fixed reference point by the machine manufac-


is set

turer as part of the hardware design and cannot be physi-


cally changed by the user. A CNC machine has at least one
fixed reference point. When it comes to deciding the refer-
ence points for the part or the cutting tool, the programmer Figure 15-1
has certain degree of freedom. A part reference point (pro- machine
Machine reference point and axes orientation fora vertical
gram zero) is always a flexible point, meaning its actual po-
sition is in programmer’s hands. The reference point for the The cubical shape shown is useful only for overall under-
mounted cutting tool can be either fixed or flexible, de- standing of the machine work area. For programming and
pending on machine design. setup, the majority of work is done with one or two axes at a
time. To understand the work area and machine zero point
MACHINE REFERENCE POINT in a plane, look at the machine from the top (XZ machine
plane) and from the front (YZ machine plane). Figures
15-2 and 15-3 illustrate both views.
The machine zero machine zero,
point, often called the
home position or just a machine reference position, is the
MACHINE ZERO
- v tt-
X-motion -
origin of machine coordinate system. The location of this / XY AXES
'

point may vary between the machine manufacturers, but


the most obvious difference is between individual machine
types, namely the vertical and horizontal models.
MACHINE
In general terms, a CNC machine has two, three, or more TABLE Y-motion
axes, depending on the type and model. Each axis has a TOP AREA
maximum range of travel that is fixed by the manufacturer.
This range is usually different for each axis. If the CNC op-
L
erator exceeds the range on either end, an error condition
known as overtravel will occur. Not a serious problem, but TOP view
one could be annoying. During machine setup, particu-
that
Figure 15-2
larly after the power has been turned on, the position of all
Top view of a vertical machine as viewed towards the table
axes has to be preset to be always the same, from day to
day, from one part to another. On older machines, this pro-
cedure is done by setting a grid, on modern machines, by MACHINE ZERO
performing a machine zero return command. Fanuc and Rnindle centerline XY AXES
many other control systems prevent automatic operation of
f
a machine tool, unless the machine zero return command 1
L -©-J
Gauge line
T
has been performed at least once - when the power to the
machine has been turned on. A good safety feature.
Z-motion
On all CNC machines that use typical coordinate system,

the machine zero is located at the positive end of each axis 1


travel range. For a typical three-axis vertical machining MACHINE TABLE
center, look at the part in the XY plane, that is straight down
from the tool position (tool tip). Also look into the XZ
FRONT view
plane (operator’s front view of the machine), or into the YZ Figure 15-3
plane (operator’s right-side view of the machine). These
Front view of a vertical machine as viewed from the front
three planes are perpendicular to each other and together
create so called work cube or work space - Figure 15-1. Compare the two views. In top view, the upper right cor-
ner is also the spindle center line shown in the front view.
REFERENCE POINTS 109

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.

Return to Machine Zero


Program Zero Selection
manual mode, the CNC operator physically moves the
In
axes to the machine zero position. The operator is also re- When program zero, often in the comfort of
selecting the

sponsible to register this position into the control system, if


programmer’s major decision is made that will in-
office, a

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

sition. Being too close make


manual machine zero
will the and against a program zero selection in a certain position.

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.

Once the setup is established, the part reference point can


be selected.
110 Chapter 15

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.

CNC programmer determines method for any the setup 00.75 \


given job, perhaps in cooperation with the machine opera- 3 HOLES
THRU
tor. CNC programmer also selects the program zero posi- 1

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:

Step Study how the drawing is dimensioned,


Q 1

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

Sample drawing used for selecting program zero example


The simplest setup on a machine table involves support
for the part, some clamps and locating surfaces. The locat- When selecting a program zero, first study the drawing
ing surfaces must be fixed during the job run and easy to be dimensions. The designer’s dimensioning style may have
measured from. The most typical setup of this kind is based Haws, but it still is the engineering drawing. In the example,
on the three pin concept. Two pins form a single row and dimensioning for all holes is from the lower left corner of
the third pin is offset away at a right angle, creating a 90° the work. Does the program zero of the part suggest itself?
angle setup corner as two locating surfaces - Figure 15-4.
For this example, there should be no question about pro-
gramming the reference point anywhere else except at the
lower left corner of the part. This is the drawing origin and
it will become the part origin as well. It also satisfies Step 1
MACHINED PART of the program zero selection process. The Step 2, dealing
with work holding device selection is next. A typical setup
P" 90°
in a special CNC machine vise could be the one illustrated

in Figure 15-6.

P P — In the setup identified as Version /, the part has been posi-


tioned between the vise jaws and a left part stopper. The
part orientation is the same as per drawing, so drawing
all
PROGRAM ZERO P PIN LOCATORS dimensions will appear in the program using these drawing
dimensions. It seems that this is a winning setup - yet, this
Figure 15-4
setup is actually quite poor.
Three-pin concept of a part setup Iall pins have the same diameter)
What is missing in the decision is any consideration of
Since the part touches only one point on each pin, the the actual overall size of material. The drawing specifies a
setup is very accurate. Clamping usually done with top
is rectangular stock of 5.00 x 3.50. These are open dimen-
clamps and parallels. The left and the bottom edge of the sions- they can vary ±.010 or more and still be acceptable.
REFERENCE POINTS 111

If the choice is between Version 1 and 2, select Version 2


and make sure all negative signs are programmed correctly.

Is there another method? In most cases there is. The final


Version 3 will offer the best of both worlds. Part program
will have all dimensions in the first quadrant, as per draw-
ing. Also, the part reference edge will be against the fixed
jaw! What is the solution? Rotate the vise 90° and position
the part as shown - Figure 15-8, if possible.

MOVING JAW
Y
1

- -X
Figure 15-6

A sample part mounted in a machine vise - Version 1

Combine any acceptable tolerance with the vise design,


where one jaw is a fixed jaw and the other one is a moving
jaw and the problem can be seen easily. The critical Y axis
,

reference is against a moving jaw!

The program zero edge should be the fixed jaw - a jaw


that does not move. Many programmers incorrectly use a A sample part mounted in a machine vise - Version 3
moving jaw as the reference edge. The benefit of program-
ming in the first quadrant (all absolute values are positive) To select a program zero for the Z axis, the common prac-
is attractive, but can produce inaccurate machining results, tice is to select the top face of the finished part. That will
unless the blank material is 100% percent identical for all make the Z axis positive above the face and negative below
parts (usually not anormal case). Version 1 setup can be the face. Another method is to select the bottom face of the
improved significantly by rotating the pan 1 80° and align- part, where it is located in the fixture.
ing the part stopper to the opposite side - Figure 15-7.
Special fixtures can also be used for a part setup. In order
to hold a complex part, a fixture can be custom made. In
many applications of special fixtures, the program zero po-
sition may be built into the fixture, away from the part.

Selecting a program zero for round parts or patterns (bolt


circles, circular pockets), the most useful program zero is at

the center of the circle - Figure 15-9.

MOVING JAW
Y
i

UJ ~X
Figure 15-7

A sample part mounted in a machine vise - Version 2

In Version 2, results are consistent with the drawing. Part


Figure 15-9
orientation by 1 80° has introduced another problem - the
part is located in the third quadrant! All X and Y values Common program zero for round objects is the center point

will be negative. Drawing dimensions can be used in the


Chapter 40 describes the G52 command that may solve
program, but as negative. Just don’t forget the minus signs.
many problems associated with program zero at the center.
112 Chapter 15

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

a front of the finished part


Z value is in the clear area. During program devel-
positive
Part face . . .

opment, is easy to forget a minus sign for the Z axis cut-


it

ting motions. Such an error, if not caught in time, will posi-


tion the tool away from part, with the tailstock as a possible
Stock X
obstacle. It is a wrong position, but a better one than hitting
i
the part. Examples in this handbook use program zero at
Z the front finished face, unless otherwise specified.

CHUCK FACE TOOL REFERENCE POINT


Stock X The last reference point is related to the tool. In milling
1
and related operations, the reference point of the tool is
Z usually the intersection of the tool centerline and the lowest
positioned cutting tip (edge).

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

For tools such as drills and other point-to-point tools used


-Z in milling or turning, the reference point is always the ex-
treme tip of the tool, as measured along Z axis. Figure
15-11 shows some common tool tip points.
PART FRONT FACE
Figure 15-10

Common program zero options for a CNC lathe - center line is XO

Figure 15-10 illustrates the options. In setup, a chuck face


offers only one benefit - it can be easily touched with the
tool edge, using feelers to prevent tool chipping. On a nega-
tive side, unless the part rests against chuck face, additional
calculations are needed for the coordinate data and drawing
dimensions cannot be used easily.

Jaw or fixture face presents more favorable situation. The


face can also be touched with the tool and is consistent for
all parts. This location may benefit machining irregular
shapes, such as castings, forgings and similar parts.

Typical tool reference points for various cutting tools


Many lathe parts require machining at both ends. During
the first operation, material stock for the second operation
All three reference point groups are connected. An error
must always be added to every Z value. This is the main
in one setting will have an adverse effect on another. The
reason why CNC programmers keep away from program
knowledge of reference points is important to understand
zero located on jaw or fixture face, except in special cases.
register commands, offsets and machine geometry.
16 REGISTER COMMANDS

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.

Some CNC lathes also use G92 command, but lathes


The position register is only applicable in the absolute
supplied with Fanuc and similar controls normally use G50 mode of programming, while G90 command is in effect. It
command instead. In practical applications, both G92 and has no use in the incremental programming mode G91. In
G50 commands have identical meaning and the following
practical programming, virtually all programs written in
discussion applies to both commands equally. In the first
the incremental mode do begin in the absolute mode, in or-
part of this chapter, the focus will be on milling applica-
der to reach the first tool location.
tions using G92 command, lathe applications using G50
command will be explained later.
Programming Format
In modern CNC programming, both position register
As the name of the command suggests, the tool position
commands were replaced by a much more sophisticated
data associated with the G92 command will be registered
and flexible feature called the Work Offsets (G54 to G59),
(i.e., stored) into the control system memory.
described in Chapter 18, and the Tool Length Offset (G43),
described in Chapter 19. However, there are still quite a The format for G92 command is as follows:
few older machine tools in shops that do not have the lux-
ury of the G54 series of commands. There are also many G92 X.. Y.. Z.
companies using programs developed years ago, but still
running on modern CNC equipment. In those cases, under- In all cases, the address of each axis specifies the distance
standing the position registration command is an essential
from the program zero to the tool reference point (tool tip).
skill. This command has always been one that some pro- Programmer provides all coordinates based on the program
grammers and operators found a little difficult to under-
reference point (program zero), discussed earlier. Any ad-
stand. In reality, it is a very simple command. ditional axis will alsohave to be registered with G92, for
First, a look at some more detailed definition of this com- example the B axis for the indexing table on horizontal ma-
chining centers.
mand. A typical description only specifies Position Regis-
ter Command, which by itself is not very conclusive.

113
114 Chapter 16

Tool Position Setting

The only purpose of G92 command is to register the cur-


rent tool position into the control memory nothing more!
-

No machine motion will ever occur


in a block containing the G92 command !

The effect of G92 can be seen on the absolute position


screen display. times, the absolute position display
At all

has some values for each axis. They could be zero or any

other values. When G92 command is executed, all current

values of the display will be replaced with the values speci-


fied with G92. If an axis was not specified with G92, there
will be no change of display for that axis. At the machine,
the operator has a major responsibility - to match the actual
tool setting with the values specified in the G92 command.
Current tool position register set at machine zero
(only XY axes shown)
MACHINING CENTERS APPLICATION
Figure 16-1 shows a G92 setup based on the tool set at
In programming for CNC machining centers without the machine zero position. This method of starting program at
Work Coordinate System feature (also known as Work Off- machine zero is useful. There could be an advantage, for
sets ), the Position Register must be established for each example, if a special fixture is permanently attached to the
axis and each tool. There are two methods: machine table. A subplate with a locator grid is a common
example. Permanently set one or more vises may also ben-
The tool position is set at machine zero
efit. There are numerous variations on this type of setup.

The tool position is set away from machine zero


Tool Set Away from Machine Zero
Which method is better? We look at both of them.
The second method eliminates the difficulty of the previ-
Tool Set at Machine Zero ous setup. It allows the programmer to set XY tool position
anywhere within the machine travel limits (considering
The first method requires that the machine zero position safety first) and use that position as the tool change position
be the tool change position for all axes. This is not
will also for XY axes. As there is no need for the machine zero itself,
necessary and definitely very impractical. Consider it for a the CNC operator can setup the part anywhere on the table,
moment and think why it is impractical. in any reasonable position, within limits of the machine
axes. Figure 16-2 shows an example of a tool set at a nega-
A program is usually done away from the machine, but
tive X axis and a positive Y axis.
the part position on the table must be specified:

G92 X12.0 Y7.5 Z8.375

Numbers in the example look innocent enough. But con-


sider the CNC operator at the machine, trying to setup the
part (without a special fixture), to be exactly 12.0 inches
away from machine zero in the X axis. At the same time,

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.

It isan almost impossible task, at least without some spe-


It is definitely an extremely unproductive task.
cial fixtures.
There is no need for those numbers, they are strictly arbi-
trary - the XI 2.0 could have easily been XI 2.5, with no
added benefit whatsoever. All this difficulty is encountered
only because the programmer has chosen the machine zero
Figure 16-2
reference point for tool change position (mainly in the X
Current tool position register set away from machine zero
and Y axes).
(only XY axes shown)
REGISTER COMMANDS 115

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)

Position Register in Z Axis


This is a simple example to write but more difficult to set-
For a typical vertical machine, the Z axis must be fully re- up on the machine. Don’t worry about unknown program
tracted to the machine zero, in order to make the automatic entries at the moment, the explanations should be clear.
tool change. The position register value is measured from
the program zero of the Z axis (usually the top of finished Note - the Z axis setting position must always be known -
face), to the tool reference tip, while the Z axis is at ma-
at machine zero! It does not matter whether the tool change
in XY is made, at machine zero or away from it - the pro-
chine zero position. There is no other option.
gram format will be the same, just meaning of the values
Normally, each tool will have a different Z value of the will be different. Only one tool is used, but normally, each
G92 command, assuming the tool length is different for tool will have a different Z value as the position register,
each tool. As a rule, the XY settings will not change. Figure since each tool has a different length.
16-3 shows a typical setting for G92 command along the Z
axis. Example 01601 illustrates the concept.
LATHE APPLICATION

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..

If G92 is used for a lathe, the command is similar:

G92 X..Z..

PART Either command has exactly the same definition and


1
rules as for milling - it indicates the distance from program
zero, to the current tool position along axes.
TABLE

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

tool, there will also be enough clearance for all remaining


shorter tools.

A possible compromise of the two methods described is


to keep tool indexing position at the X axis machine zero
only (which is usually not too distant) and just establish the
Z axis position.

On a CNC lathe, do not forget to keep in mind the general


layout of all tools in the turret, to prevent a collision with
the part, the chuck, or the machine.

There are other, but less common, methods to setup a tool


on the lathe using the G50 command.
Typical G50 setting for center line lathe tools
REGISTER COMMANDS 117

External Tools Setup

For external machining operations such as roughing and


finishing outside diameters, taper cutting, grooving, knurl-
ing, single point threading, part-off and others, the cutting
tool is rather small and approaches the part in an open
space with generous clearances.

The position register value is measured from the program


zero to the imaginary tool tip of the insert (see details at the

end of this chapter). In case of tools like threading tool or a


grooving tool, G50 amount is usually measured to the left
side of the insert, for safety reasons.

Figure 16-5 illustrates a typical position register setup for


an external tool (turning tool shown in the example).

Figure 16-6

Typical G50 setting for internal lathe tools

For safety reasons, no tool should extend from a turret


into theZ minus zone - that is to the left of part front face.
Many CNC lathes have a fairly long travel beyond the Z
axis machine zero (about 1-2 inches or 25-50 mm). Some-
times, this zone can be entered tomake a safe tool change
for very long tools.However, this is a more advanced pro-
gramming method and requires strict safety considerations.
There is virtually no extended zone for the X axis above
machine zero position (only about .02 inches or 0.5 mm).

Another safety concern relating to long tools is clearance


in the part holding area, includingchuck and jaws. Make
sure to extend only those tools where the work requires it.

Figure 16-5
Comer Tip Detail
Typical G50 setting for external lathe tools

Typical turning tool contains an indexable insert, with a

Internal Tool Setup


corner radius for strength and surface finish control. When
the position register commandused for a tool that has a
is

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.

N9 T0200 Other important blocks to consider together are the


N10 G50 X8.3 Z4.8 blocks N7 and N10. Block N7 is the tool change position
Nil G96 S425 M03 for the first tool, block N10 is the tool position register for
N12 GOO X2.5 ZO.l T0202 M08 the second tool - both tool are at the same physical position
N13 Z-1.75 F0.008 of the turret! The difference in the XZ values reflects the
N14 GOO X2.7 MO difference in the projection (length) of each tool from the
N15 X8.3 Z4.8 T0200
is done with G50 command is telling
turret station. All that
N16 M30
where the current tool tip is from program zero -
the control
%
always keep that in mind!
17 POSITION COMPENSATION

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

the programmer and machine operator. On modern CNC G46


Single decrease in the programmed direction by
the compensation amount
systems, this method is still available for compatibility with
older programs. Today, this technique is not really needed.
Double increase in the programmed direction
It has been replaced by the much more flexible Work Off- G47
by double the compensation amount
sets (Work Coordinate System ), described in the next chap-
ter this handbook. The current chapter' describes some
of Double decrease in the programmed direction
G48
typical programming applications that can benefit from us- by double the compensation amount
ing the old-fashioned position compensation method.

These definitions are based on positive compensation


DESCRIPTION values stored in the control register. If the stored values are
negative, the meaning of all definitions is valid only when
The main purpose of position compensation is to correct the signs are inverted. None of these four preparatory com-
any difference between machine zero and program zero mands is modal and all are valid only within the block in

tool positions. In practice, it is used in those cases, where


which they appear. If required in many blocks, they must be
the distance between the two reference points is subject to repeated in any subsequent block, if needed again.

variations or is not known at all. For example, when work-


ing with castings, the program zero taken from the cast sur- Programming Format
face will be subject to frequent change. Using position
Each G code (G45 to G48) is associated with a unique
compensation will eliminate the need to make constant
position compensation number, programmed with the ad-
program changes or realignment of the fixture setup. Nor-
dress H. The H
address points to the memory area storage
mally, the part is mounted in a fixture on the table and the
number of the control system. On most Fanuc control sys-
whole setup is compensated. For this reason, the position
tems, the programmed letter can also be D, with exactly the
compensation is sometimes called fixture offset or the table
same meaning. Whether the H or D address is used in the
offset. The difference between an offset and a compensa-
program, depends on the actual setting of a control system
tion is often very subtle, and for any practical purposes, the
parameter.
two terms are same.

119
120 Chapter 17

A typical programming format for position compensa- Incremental Mode


tion function is:
The question may arise why the compensated motion is
in the incremental mode. Remember that the main purpose
G91 GOO G45 X. . H.
of position compensation is to allow a correction of the dis-
tance between machine zero and program zero. The normal
or
use when starting the tool motion/row machine zero po-
is

sition. By default, and without any offsets, coordinate set-


G91 GOO G45 X. . D.
tings or active compensations, the machine zero is the ab-
where the appropriate G code (G45 through G48), is fol- solute zero, it is the only zero the machine control system
lowed by the target position and number of the memory ‘knows’ at the time.

storage area (using H or D address).


Take the following example of several blocks, typically
Note that the example uses incremental and rapid motion programmed at the beginning of a program with position

modes and only one Normally, the compensation has


axis. compensation:
to be applied to both X and Y axes.
However, only a single
measured amount can be stored under either H or D num- N1 G20
N2 G17 G80 T01
ber. Since it is most probable that the compensation value
N3 MO 6
will be different for each axis, it must be specified on sepa-
N4 G90 GOO G45 X0 H31 (NO X MOTION)
rate blocks, with two different offset numbers H (or offset
N5 G45 Y0 H32 (NO Y MOTION)
numbers D), for example: N6 .. .

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.

ples, more common address H will be used - Figure 17-1.


Motion Length Calculation

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

a particular offset or compensation


important for

v•
works. Earlier definition has stated that a single increase is

programmed with G45 command and a single decrease


H32 with G46 command. Both G47 and G48 commands are of
no consequence at the moment. Since both commands are
tied up with a particular axis and with a unique H address,
all possible combinations available must be evaluated:

Either an increase or a decrease is programmed


(G45 or G46)
PART
PROGRAM ZERO Axis target can have a zero value, or a positive value,
or a negative value

Figure 17-1 Compensation amount may have a zero value,


Position compensation - general concept or a positive value, or a negative value
POSITION COMPENSATION
121

In programming, it is important to set certain standards


and consistently abide by them. For example, on vertical
machining centers, the compensation is measured from ma-
chine zero to program zero. That means a negative direc-
tion from the operator’s viewpoint. The result is a logical
decision to set negative compensation values as standard.

It is very crucial to understand how the control interprets


information in a block. In position compensation, it evalu-
ates the value stored in memory called by the address H (or
D). If the value is zero, no compensation takes place. If the
value of H is stored as a negative value, it adds this value to
the value of the axis target position and the result is the
motion length and direction. For example, assume the
memory register H3I stores the value of -15.0 inches, and
the machine current location is at its zero position and the
axis setting on the control is also set to zero. Then the block
Position compensation applied to different target locations:
G91 GOO G45 XO H31 zero, positive and negative -see 01701 program example

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-
.

actly the same way.


In is written in metric units and has
resulting in the total motion of negative 5.0 inches along
1 been tested on Fanuc IM, with the H address (D would
I

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:

-15.0 + 1.5 = -13.5000 01701 (G45 AND G46 TEST)


N1 G21 G17
However, the next example is not correct: N2 G92 X0 Y0 Z0
N3 G90 GOO G45 XO H98 (ABS XO TARGET)
G91 GOO G45 X-1.5 H31 N4 G46 Y0 H99 (ABS Y0 TARGET)
N5 G28 X0 Y0
Here, the motion will try to go into the positive X axis di-
N6 G91 GOO G45 X0 H98 (INC XO TARGET)
rection and the result will be X axis overtravel. Since the
N7 G46 Y0 H99 (INC Y0 TARGET)
value of X is negative, G45 command cannot be used and N8 G28 X0 Y0
G46 command must be used instead:
N9 G90 GOO G45 X9.0 H98 (ABS X+ TARGET)
G91 GOO G46 X-1.5 H31 N10 G46 Y17.0 H99 (ABS Y+ TARGET)
Nil G28 X0 Y0
will be interpreted as
N12 G91 GOO G45 X9.0 H98 (INC X+ TARGET)
-15.0 + (-1.5) = -15.0000 - 1.5 = -16.5000 N13 G46 Y17.0 H99 (INC Y+ TARGET)
N14 G28 X0 Y0
G45 could have been left in the program and the negative

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 . . .

N19 G91 — G46 — - . . . Y-163.0


Face Milling
Position Compensation Along the Z axis
(Chapter 28). the principles of face mill-
In a later section

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.
,

efficient than using the position register commands G92


(milling systems) or G50 (turning systems). CNC pro-
The work coordinate systems - or work offsets - that
six

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 (!)

method, but much more advanced and flexible. In the work


PART 1
offset system, up to six parts may be set up on the machine PROGRAM1*
table, each having a different work offset number. Pro- ZERO
grammer can move the tool from one part to another with
absolute ease. To achieve this goal, a special preparatory AXES MOTION LIMITS
command work offset is needed in the pro-
for the active Figure 18-1
gram and system will do the rest. The system
the control
Basic relationships of the work offset method
will automatically make any adjustment for the difference
between the two part locations.
The same relationships illustrated for the default work
Unlike the position compensation function, two, three, or offset apply exactly the same way for the other five avail-

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?

Fanuc offers as an option - up to 48 additional work off-


-

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 :

PART G54.1 PI Selection of additional work offset 1

G54.1 P2 Selection of additional work offset 2


PROGRAM^ G54.1 P3 Selection of additional work offset 3
ZERO G54 1 Px.. Selection of additional work offset x..

G54.1 P48 Selection of additional work offset 48


AXES MOTION LIMITS
The utilization of additional work offsets in the program
Figure 18-2
is exactly the same as that of the standard commands:
Basic relationships of the Position Register command G92
N2 G90 GOO G54.1 PI X5.5 Y3.1 S1000 M03
For work offsets G54 to G59, a typical entry into the co-
ordinate offset position register will be the X axis as a nega- Most Fanuc controls will allow omission of the decimal
tive value, the Y axis as a negative value and the Z axis as a portion of the G54. 1 command. There should be no prob-
zero value, for the majority of vertical machining centers.
lem programming:
This is done by the CNC operator at the machine. Figure
18-3 shows an example of a typical control system entry. N2 G90 GOO G54 PI X5.5 Y3.1 S1000 M03

The presence of PI to P48 function within a block will


01 (G54) select an additional work offset. If the PI to P48 parameter
is missing, the default work offset command G54 will be

selected by the control system.


X -12.5543
Y - 7.4462 WORK OFFSET DEFAULT AND STARTUP
Z 0.0000
If no work offset is specified in the program and the con-
Figure 18-3
trol system supports work offsets, the control will automat-
ically select G54 - that is the normal default selection. In
Typical data entry for the G54 work coordinate system
programming, is always a good practice to program the
it

work offset command and other default functions, even if


By using the G54 to G59 settings in the program, the con-
the default G54 is used constantly from one program to
trolsystem selects the stored measured distances and the
another.The machine operator will have a better feel for the
cutting tool may be moved to any position within the se-
CNC program. Keep in mind that the control still has to
lected work offset simultaneously in both the X and Y axes,
have accurate work coordinates stored in the G54 register.
whenever desired.
WORK OFFSETS 125

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

The most common application is to program the appro- A = M + P


work offset G code in the same block as the first cut-
priate
ting tool motion:
csf where ...

N40 GOO G90 G54 X5 5 Y3.1 S1500 M03


.
A = Actual motion length (distance-to-go displayed)

Figure 18-4 illustrates this concept. In the above block


M = Measured distance from machine zero
P = Programmed absolute target position (axis value)
N40, the absolute position of the tool has been established
as X5.5Y3.1, within the G54 work offset. What will actu- Be very careful when adding a negative value - mathe-
ally happen when this block is processed? matically, the double signs are handled according to the
standard rules:

PLUS and PLUS becomes


a + (+ b) = a + b
PLUS

PLUS and MINUS becomes

MINUS

MINUS and PLUS becomes

MINUS

MINUS and MINUS becomes


a - (- b) = a + b
Direct tool motion to a given location using G54 work offset PLUS
Note that there are no X or Y values associated with the
G54 command in the illustration. There is no need for In the example, plus and minus combination creates a
them. The CNC operator places the part in any suitable lo- negative calculation:
cation on the machine table, squares it up, finds how far is

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

Blocks N3 through N5 relate to the first part, within the


G54 work offset. The block N6 will spot drill the hole of
the second part of the same setup, within the G55 work off-
set and the block N7 will spot drill the hole of the third part
of the same setup, within the G56 work offset. Note the re-
turn to the G54 work offset in block N9. Return to the de-
fault coordinate system is not required - itonly a sug-
is

gested good practice when the tool operation completed.


is

The work offset selection is modal - take care of the transi-


tions between tools from one work offset to another.
Bringing back the default offset G54 may always be helpful
at the end of each tool.

If all these in the same program, the control


blocks arc
unit will automatically determine the difference between
Figure 18-5
the current tool position and the same tool position within
Using multiple work offsets in one setup and one program. work
the next This is the greatest advantage of using
offset.
Three parts shown in the example.
work offsets - an advantage over the position compensation
and the position register alternatives. All mounted parts
Compare all possible motions in Figure 18-5:
may be identical or different from each other, as long as
they are in the same positions for the whole setup.
G90 GOO G54 XO YO

... 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

gram zero position of the second part.


same logic as for X and Y axes, there is a better way of con-
trolling the Z
The method used for Z axis is in the
axis.

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.

Machining two, three, four, or more faces of the part on a


l
CNC horizontal machining center is a typical everyday
o work many companies. For this purpose, the work offset
in
X selection is a welcome tool. For example, the program zero
N
n at the pivot point of the indexing table can be set for the X
O and Y axes. setting of the Z axis may be in the
Program
L
same position (the pivot point of the indexing table) or it
0.356
*
A can be on the face of each indexed position - either choice is
0.408 acceptable. The work offset handles this application very
r
nicely, up to six faces with a standard range of the G codes.
G56 G55 G54
TABLE There is no significant difference in the programming ap-
proach - the switch from one work offset to another is
Figure 18-6 programmed exactly the same way as for the vertical ma-
Setting of work offsets for a variable part height
chining applications. The only change is that the Z axis will
be retracted to a clear position and the table indexing will
Figure 18-6 shows some typical and common possibili- usually be programmed between the work offset change.
tiesused for special parts that have a variable height within
Figure 18-7 illustrates a typical setting for four faces of a
the same tool setup. The difference between part heights
part, where Z0 is at the top of each part face. There could be
has to be always known, either from the part drawing speci-
as many faces as there are table indexing positions. In ei-
fications or from actual measurements at the machine.
ther case, the programming approach would be similar if

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:

(G54) X-8.761 Y-7.819 ZO


(G55) X-15.387 Y-14.122 Z-0.408
(G56) X-22.733 Y-8.352 Z0.356

The important thing to know about the control of the Z


axis within the selected work offset is that it works in very
close conjunction with the tool length offset, discussed in
the next chapter (Chapter 19). Stored amount of the Z axis
setting within a work offset will be applied to the actual tool
motion and used to adjust this motion, according to the set-
ting of the tool length offset. An example may help.

For instance, if the tool length offset of a particular cut-


ting tool measured as Z- 10.0, the actual motion of such a
is

tool to the program zero along Z axis will be -10.0 inches


within the G54 work offset, -10.408 within the G55 work
offset, and -9.644 within the G56 offset - all using the ex-
Example of work offsets applied to a horizontal machining center
amples in the previous illustration, shown in Figure 18-6.
128 Chapter 18

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

00 (EXT) 01 (G54) Geometry offset is the equivalent of a work offset as it is

known from the milling controls. It represents the distance

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

Any setting of the external work offset will always


affect ALL work offsets used in the CNC program. Figure 18-9

Typical data entries for a lathe tool GEOMETRY offset


WORK OFFSETS 129

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.

Typical values along the X axis are always negative (as


WEAR OFFSET shown in illustrations), typical values along the Z axis are

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.

Typical data entries for a lathe tool WEAR offset


Center Line Tools
Figure 18-10 shows some reasonable sample entries in
Tools that work on the spindle center line are tools that
the wear offset registers. The tool radius and tip number
have their tool tip located on the center line during machin-
settings appear in both displays and the display in both
ing. This area covers all center drills, spot drills, various
screens is automatic after the offset value input. The tool
drills, reamers, taps, even end mills used for flat bottom
nose radius and the tool tip orientation number are unique
holes. At the same time,
it disqualifies all boring bars, since
to CNC lathe controls.
does not normally lie on the spindle center line
their tool tip
during machining. Center line tools are always measured
Tool and Offset Numbers
from the center line of the tool to the center line of the spin-
on CNC machining centers have numbers,
Just like tools dle along the X axis and from the tool tip to the program
they have numbers on CNC lathes as well. Usually, only zero along the Z axis. Figure 18-11 illustrates a typical set-

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

Typical geometry offset setting for CENTER LINE tools


130 Chapter 18

Turning Tools Boring Tools

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).

Command Point and Tool Work Offset

TOOL CHANGE POSITION


TURRET AT
V For various reasons, it is quite common to change a cut-

middle of work, primarily to maintain fa-


ting insert in the
T02 vorable cutting conditions and to keep dimensional toler-
GEOM (Z) ances within drawing specifications. Cutting inserts are
manufactured to very high standards, but a certain toler-

. B ance deviation should be expected between inserts ob-


tained from different sources. If changing an insert, it is ad-
< visable to adjust the wear offset for precision work, in order
Q
X to prevent scrapping the part.

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

Typical geometry offset setting for EXTERNAL tools

Figure 18-12 illustrates a typical geometry setting for a


turning (external) tool and Figure 18-13 illustrates a typical
geometry setting for a boring (internal) tool.

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
(

a radius that is smaller (left) and one that is larger (right).


The dimensions indicate the amount of error for the partic-
ular insert shown in the example.

Figure 18-13 When changing an insert, adjust the required offset(-s)


Typical geometry offset setting for INTERNAL tools
19 TOOL LENGTH OFFSET

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

against an opposite taper in the spindle and held in tightly


The reason? Each tool has a different length. by a pullbar. The precision of manufacturing allows for a
constant location of the tool holder (any tool holder) in the
GENERAL PRINCIPLES spindle. This position is used for reference and is com-
monly called the gauge line. As the name suggests, an
it is

imaginary reference line used for gauging - or measuring -


The length of each cutting tool has to be accounted for in
along the Z axis - Figure 19-1.
every program for a CNC machining center. Since the
earliest applications
of numerical control, various tech-
niques of programming tool length have emerged. They all
belong into one of two basic groups:

Actual tool length is known

Actual tool length is unknown

Needless to say, each group requires its own unique pro-


gramming technique. To understand the concept of tool
length in CNC programming, it is important to understand
meaning of the phrase actual tool length. This length is
sometimes known as the physical tool length or just tool
length and has a very specific meaning in CNC program-
ming and setup.

Actual Tool Length


Typical front view of a CNC vertical machining center
Let’s evaluate a simple tool first. By holding a typical

we can determine its physical length with a measuring


drill,
We use the gauge line for accurate measuring of tool
device. In human terms, a six inch long drill has a length of length and any tool motion along the Z axis. Gauge line is

determined by the machine manufacturer and is closely re-


six inches, measured from one end to the other. In CNC
lated to another precision face, called the machine table,
programming that is still true, but not quite as relevant. A
drill - or any other cutting tool - is normally mounted in a
actually, the table top face. The gauge line is one side of a
tool holder and only a portion of the actual plane that is parallel with another plane - the table top face.
tool projects

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

and its actual length. 004 0.0000 0.0000


005 0.0000 0.0000
The most significant benefit of tool length offset in CNC 006 0.0000 0.0000
programming is that it enables the programmer to design a
complete program, using as many tools as necessary, with-
Figure 19-2
out actually knowing the actual length of any tool.
Typical tool length offset entry screen

TOOL LENGTH OFFSET COMMANDS set entry. Note from one


that the actual display will vary
wear offset may not be available
control to another and the
Fanuc systems and several other machine controls offer on some controls. The wear offset (if available) is only used
three commands relating to the tool length offset - all are for adjustments to the tool length as a separate screen entry.
preparatory G commands:
The G44 command is hardly ever used in a program - in

has the dubious distinction of being the least used


G43 G44 G49 fact, it

commands of all Fanuc G codes. Its comparison with G43


All three commands are only applicable to the Z axis. is described later in this chapter.
Unlike the work offset commands G54-G59, G43 or G44
cannot be used without a further specification. They can
Many CNC programmers and operators may not realize

that the Z axis setting in a work offset (G54-G59) is also


only be used with an offset number designated by the ad-
very important for the tool length offset. The reason why
dress H. The address H must be followed by up to three
willbe clear in the coming descriptions of different meth-
digits, depending on the number of offsets available within
ods of tool length offset setting.
the control system:

Some programming manuals suggest the older G45 or


G43 Positive tool length offset G46 commands can also be used for tool length offset. Al-
though this is still true today and may have had some ad-
G44 Negative tool length offset
vantages in the early days, it is best to avoid them. First, the
G49 Tool length offset cancel position commands are not used very much anymore and,
second, they can also be used with the X and Y axes and do
H00 Tool length offset cancel
not truly represent the Z axis exclusively.

H.. Tool length offset number selection


Distance-To-Go in Z Axis

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:

N66 G43 Z1.0 H04


TOOL LENGTH OFFSET 133

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 = W z +Z + H t TOOL LENGTH SETUP


^ where ...
The length of a tool usedfor machining (consisting of the

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

In order to make sure the formula is always correct, try to


something. The programmer has to identify all selected
tools by their number (the T address) and assign tool length
change a few values.
offset numbers, for example, G43 or G44 with the H ad-

© 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.

G43 Z1.0 H03 where: On-Machine Tool Length Setting

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-

is required, adding to the overall cost of manufacturing.


tion for positive Z axis travel and is necessary for the auto-
1'his equipment can be a simple fixture with a height gage
matic tool change on virtually machining centers. All all
four illustrated dimensions are either known, can be found
(even made in-house ), or a more expensive, commercially
in various instruction or service manuals, or can be physi-
available digital display device.
cally measured. They are always considered as known di-

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

ting tool length offset, tool length


, compensation or just off- Height of the part (distance between
set. Regardless of the exact heading, the setting procedure the table top and ZO of the part)
is tomake sure the measured length is entered into the con-
trol, so it can be used by the program. The measured length ... dimension C in the illustration
is always well within the Z axis travel limits of the ma-
Total of all three previous dimensions
chine, yet allows for sufficient clearances for the part
still
(distance between the tool gauge line and the table top)
and the tool changes.

To understand the tool length offset, try to fully under-


... dimension D in the illustration

stand the motion and geometry of the CNC machine


Z axis It is programmer or the operator would
rather rare that the
first. On and horizontal machining centers, look at
vertical
always know all Even if that were possi-
four dimensions.
the XZ plane, which is the top of part for both. The princi-
ble, some calculations would not be worthwhile doing. The
ples are identical, but the focus will be on the vertical ma- reality is that only some dimensions are known or can be
chining center layout.
found out relatively easily.

Z AXIS RELATIONSHIPS In the illustration, the dimension D is always known, be-


cause it is the distance determined by the
machine manu-
facturer. It may not be possible to know the C dimension
To understandthe general principles of tool length offset,
(height of the part with clearances), but with planning and a
let’slook at the schematic illustration of a typical setup for
common setup, this dimension can be known as well.
a vertical machining center - Figure 19-3.
That leaves dimension A - the distance between the tool
gauge line and the tool cutting point. There is no other
method to find this dimension, but to actually measure it. In
the earlier days of numerical control, this length A had to
be always known and embedded in the program. Because
of the inconveniences involved in finding this dimension,
other methods have developed later.

Today, three methods are considered in programming the


tool length setup, including the original method:

Preset tool method is the original method


... it is based on an external tool setting device

Touch-off method is the most common method


it is based on the measurement at the machine

Master tool method is the most efficient method


Z axis relationships of the machine, cutting tool, table top face, ... it is based relative to the length of the longest tool
and the part height
TOOL LENGTH OFFSET 135

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 ...

a relatively expensive addition to the CNC machine.


Tool Length by Touch Off
Using the tool presetter, all cutting tools are set at the ex-
ternal device, while the CNC
machine runs a production The tool length that uses the touch-off method is very

job. There is no measuring on the machine when jobs do


common, of some time loss during setup. As the il-
in spite

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

Touch-off method of the tool length offset setting

This number is programmed as the address H followed


by the number itself. The H number usually corresponds to
the tool number for convenience. The setup procedure is to
measure the distance the tool travels from machine zero po-
sition (home) to program zero position (Z0). This distance
PART is always negative and is entered into the corresponding H

offset numbers under the tool length offset menu of the

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

Using a Master Tool Length

Using the touch-off method to measure tool length can be


significantly speeded up by using a special method of a
master tool, usually the longest tool. This tool can be a real
tool or just a long bar with a rounded tip, permanently
mounted in a tool holder. Within the Z axis travel, this new
‘tool’ would usually extend out more than any anticipated
tool that may be used.

Offsets G54 to G59 and the external work offset nor-


mally contain the Z value set to 0.0, when the part touch-off
method is used. This setting will change for the master tool
length method. The master tool length measurement is very
efficientand requires the following setup procedure. It pro-
vides suggested steps that may need some modification:
Tool length offset using the master tool length method.
1 . Take the master tool and place it in the spindle. T02 is the master tool, with setting of H02= 0.0

2. Zero the Z axis and make sure the read-out on the


relative screen is Z0.000 or Z0.0000. The greatest benefit of this setting method is shortened
setup time. If certain tools are used for many of jobs, only
3. Measure the tool length for the master tool, using the the length of the master tool needs to be redefined for any
touch-offmethod described previously. After touching
new part height while all other tools remain unchanged.
the measured face, leave the tool in that position !
They are related to the master tool only.
4. Instead of registering the measured value to the tool
length offset number, register it into the common work G43-G44 Difference
offset or one of the G54-G59 work offsets under the
Z setting ! It will be a negative value. Initial description at the beginning of this chapter indi-

5. While the master tool is touching the measured face,


cates that Fanuc and similar CNC systems offer two prepa-
set the relative Z axis read-out to zero !
ratorycommands that activate the tool length offset. These
two commands are G43 and G44. Most programmers use
6. Measure every other tool, using the touch-off method.
the G43 command exclusively in the program and may
The reading will be from the master tool tip, not from
have some difficulty to interpret the meaning of G44 com-
machine zero.
mand, because they have never used it. There is a good rea-
7. Enter the measured values under the H offset number, son why G44 is a dormant command - not quite dead but
in the tool length offset screen. It will always be barely breathing. Programmers would like to know how -
a negative value for any tool shorter than the master tool.
and when - or even if - to use one over the other. Here is an
attempt at explanation.
Q Note:
First, take a look at the definitions found in various CNC
The master tool does not have to be the longest tool at all. reference books and manufacturers’ specifications sheets.
The concept of the longest tool is strictly for safety. In different versions of these publications, the following
It means that every other tool will be shorter.
typical definitions are used - all are quoted literally and all

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

set value must be always set to 0.0.


the tool length offset on a CNC machine. What is the pur-
pose of the tool length offset?
TOOL LENGTH OFFSET 137

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:

The process has two parts - one is in the program, the


G43 Zl.O HO 6 or G44 Z1.0 H06
other at the machine. In the program, either G43 command
or G44 command is required, together with proper H offset The control system cannot offer any benefits, until the
number that - is programmer. At the machine,
done by the
measured value for H06 is stored in the offset registers. For
the tool length offset can be set on or off the machine. Ei- example, if the H06 has been measured as 7.6385, it will be
ther way, the tool length is measured and the measured entered as a negative value, if G43 is used, and as a positive
value is entered into the control - that is the job of the opera-
value, if G44 is used (tool motions will be identical):
tor. It is the measuring at the machine that has a number of
variations - programmer has a choice of only two G codes.
G43 Zl.O H06 HO 6 = -7.6385
G44 Zl.O HO 6 HO 6 = +7.6385

It is clear that the ‘secret’ ofG43 versus G44 difference is


nothing more than a sign reversal. Either command in-
how the actual Z axis motion is cal-
structs the control as to
culated. Using G43, the H offset value will be added (+) in
the calculation. Using G44, the H offset value will be sub-
tracted (-). The actuaTZ' travel motion will be:

G43 : Z + H06 = (1.0) + (-7.6385) = -6.6385


G44 : Z - HO 6 = (1.0) - (+7.6385) = -6.6385

The tool length measuring method done on the machine


(touch-off) will result in offsets with negative values. The
setup process can automatically input all measured values
Figure 19-7
into the offset register, as negative. That is the reason why
Less common method of using the tool length offset.
G54) must be set as
G43 is the standard command to program tool length off-
Work offset (typically well.
set. G44 is just not practical for everyday work.

Figure 19-7 illustrates one of two methods to set a tool


length command - G54 or otherwork offset must be used. PROGRAMMING FORMATS
Programming format for tool length offset is very simple
and has been illustrated many times. In the following ex-
amples are some general applications of various methods.
The first one will show programming method if no tool
length offset is available. Understanding the development
of tool length offset over the years makes it easier to apply
it in the program. Other example shows a comparison of

programming methods for the older G92 programming


styleand the modern G54 to G59 method. The last example
shows the G54 to G59 method applied to a simple program
using three tools, a typical way of programming today.

Tool Length Offset not Available


Figure 19-8
days of programming, tool length offset and
In the early
More common method of using the tool length offset. work were not available. G92 position register com-
offsets
No work offset setting is required and G43 is the preferred choice.
mand was the only G code used for setting the current tool
position. The programmer had to know all and every di-
Figure 19-8 illustrates the other, and much more com-
mension specified by the machine manufacturer and all
mon, method. In this case, all work offset commands G54
and every dimension of the job being setup, specifically the
to G59 will normally have a Z value set to 0.0.
distance from the ZO to the tool tip.
Chapter 19

Figure 19-9 Figure 19-10

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
.

N27 X2.0 Y2.5


N28 X3.0 Y1.5
N29 G80 Z1.0 MO
N30 G28 Z1.0 MO
N31 M30
%
Figure 19-11

Setting tool length with G43 (Z) and G54-G59 IXY) - program 01903 This a practical example of contemporary use of G43
is

CNC program. In summary, G43 tool


tool length offset in a
In this example - Figure 19-1 l^u sing work offsets G54 length offset requires target Z position and the address H
through G59, the blocks N2, N3 and N4 can be joined to- for each tool. The actual offset value is set at the control,
gether without a problem, perhaps to speed up processing: during the given job setup. Two or more length offsets may
be used for the same tool if necessary, but that is a little
N2 G90 GOO G54 G43 X3.4 Y2.8 Z1.0 S850 M3 HOI more advanced subject, described separately in the next
N3 ... section of this chapter.

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

CHANGING TOOL LENGTH OFFSET

The vast majority of programming jobs requires only a


single tool length offset command per cutting tool. Based
on this principle, we have identified Tool I (T01) with tool
length offset HOI, Tool 2 (T02) with tool length offset H02,
etc. However, in some special circumstances, the tool
length offset may have to be changed for the same tool. In
those applications, there will be two or more tool length
offsets for one tool.

An example of a single tool length offset change would


be any part that uses two or more drawing references along
the Z axis. Figure 19-12 illustrates this concept with a
groove dimensioned by its depth location for the top and
bottom (groove width of .220 is implied).

Figure 19-13

two length offsets for a single tool. The difference


Setting of
between H07 and H27 offsets is the width of slot (. 125 shown).

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?

Figure 13 shows that two reference positions are used


! 9-

for the sametool. For this reason, the program requires two

tool length offsets, H07 and H27 in the illustration. D07 is


the cutter radius offset, and .125 is the slotting mill width.

Other methods of programming can be used, for exam-


manually, but the method us-
ple, calculating the difference
ing multiple tool length offsets is very useful during ma-
chining to allow fine groove width adjustments. It is shown
in the following example - program 01905:

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
.

Z-0.65 depth. N2 GO 3 XI. 75 YO R0.875 F10.0


tool will reach the
N3 1-1.75
For the second cut, the top edge of the slotting mill is used N4 XO 875 YO 875 R0.875 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.

In the example, tool length offset H07


is used for the bot- The two related illustrations show typical setup of the
tom reference edge of the and H27 is used for
slotting mill tool length offset for preset tools on a horizontal machining
the top reference edge of the slotting mill. D07 is used for center. Figure 19-15 shows the program zero at the center
the cutter radius only. Figure 19-14 shows the tool motions of the table, Figure 19-16 shows the program zero at the
used in subprogram 07000. face of the part.

HORIZONTAL MACHINE APPLICATION TOOL LENGTH OFFSET CANCEL

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.

One method of using the G49 command ison its own - in


a single block - just before returning to the machine zero in
the Z axis, for example:

N176 G49
N177 G91 G28 ZO

A similar method also cancels the offset numbers:

N53 G91 G28 ZO H00

In this case, the is coupled with an H off-


G28 command
set number zero H00. Note, there is no G49 in the block
-

and H00 does the job of cancellation. There is no setting for


H00 on the control. It just means cancellation of the tool
Typical tool length offset setting for a preset tool.
length offset.
Program zero is at the center of the table.
142 Chapter 19

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,
,

and have be managed as efficiently as possible. For this


to G03, etc.), unless a new F function is programmed with the
purpose, the CNC system provides a feature called the cutting motion:
rapid traverse motion. Its main objective is to shorten the
positioning time between non-cutting operations, where O Example A
the cutting tool is not in contact with the part. Rapid motion
operations usually involve four types of motion: N21 GOO X24.5 F30.0
N22 Y12.0
From the tool change position towards the part N23 G01 X30.0

From the part towards the tool change position


In block N21, only the rapid motion will be executed.
Motions to bypass obstacles The feedrate of 30.0 in/min will be ignored in this block,
but stored for later use. The block N22 will also be in the
Motions between different positions on the part
rapid positioning mode, since GOO is a modal command.
The last block, N23, is a linear motion (cutting motion),
RAPID TRAVERSE MOTION that requires a feedrate. As there is no feedrate assigned to
this block, the last programmed feedrate will be used. That

Rapid traverse motion, sometimes called a positioning


was specified in block N21 and it will become the current
feedrate in block N23, as F30.0.
motion, is a method of moving the cutting tool from one

position to another position at a rapid rate of the machine.


The maximum rapid rate is determined by the CNC ma-
O Example B

chine manufacturer and takes place within the travel limits


N21 GOO X24.5 F30.0
of the machine.
N22 Y12.0
N23 G01 X30.0 F20.0
The common many larger CNC machines is
rapid rate for
about 450 in/min 1430 mm/min). The modern machines
(1
In block N2 GOO command becomes modal and re-
1 , the
offer a rapid motion up to 500 in/min (38 00 mm/min) or
it is canceled by another command of
1 1
mains in effect until
even more, particularly for smaller machines. The machine
the same group. In the example (B), the G01 command in
manufacturer determines the rate of rapid motion for each
block N23 cancels the rapid motion mode and changes the
of the machine axes. The motion rate can be the same for
rapid mode to a linear mode. Also, the feedrate is repro-
each axis or it can be different. A different rapid rate is usu-
grammed and will 20.0 in/min starting at block N23.
be at
ally assigned to the Z axis, while the X and Y axes have the
The feedrate F30.0 in block N21 has never been used. It is
same rapid motion rate. redundant and should be removed.

Rapid motion can be executed as a single axis motion, or


The rapid traverse motion is measured as the distance in
as a compound motion of two or more axes simultaneously.
current units traveled one minute (measured in in/min or
in
It can be programmed in the absolute or incremental mode
mm/min). The maximum rate is always set by the machine
of dimensioning and it can be used whether the spindle is manufacturer, never by the control system or the program.
rotating or stationary. During program execution, the CNC
A typical limit set by the machine builder is a rate between
operator may temporarily interrupt the rapid motion by
300 and 1500 in/min (7620 and 38100 mm/min), and even
pressing the fecdhold key on the control panel, or even set-
higher. Since motion per time is independent of the spindle
ting the feedrate override switch to zero or a decreased rate.
rotation, it can be applied at any time, regardless of the last
Another kind of rapid rate control can be achieved by the spindle rotation function mode (M03, M04, M05).
dry run function, usually during setup.

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.

In order to bypass obstacles and still assure a safe rapid


RAPID MOTION TOOL PATH motion in the program at all times, let’s take a closer look at
the available options while programming a rapid motion.
Every motion in the GOO mode is a rapid non-circular
motion (circular or helical motion cannot normally be Single Axis Motion
made at the rapid rate). The actual linear motion of the tool
between two points is not necessarily the shortest tool path
Any motion programmed specifically for only one
tool
axis at a time is always a straight line along the selected
in the form of a straight line. Programmed tool path and the
axis. In other words, each rapid motion that is parallel to
resulting actual tool path will be different, depending on
one of the available axes, must be programmed in a sepa-
several factors:
rate block. The resulting motion is always equivalent to the
The number of axes programmed simultaneously shortest distance between the start and end points of the
motion - Figure 20-1.
The actual length of motion for each axis

The rapid traverse rate of each axis

Since the only purpose of the rapid motion is saving the


unproductive time (motion from the current tool position to
the target tool position), the tool path itself is irrelevant to
the shape of the machined part. Always be aware of the ac-
tual rapid motion tool path for reasons of safety, particu-
larly when two or more axes are programmed at the same
lime. No physical obstacles must be in the way of the tool
path motion.

If there is an obstacle between any two points of the tool


path, the obstacle will not be automatically bypassed by the
control for one very simple reason - the control has no way
of detecting such an obstacle. It is the programmer’s
responsibility to assure that any tool motion (rapid motion
included) occurs without any obstacles in its way. Figure 20-1

Single axis motion for a machining center application (XY shown)


Some typical examples of physical obstacles that can in-

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

a rapid rate using the GOO command. If this motion is a mo-


Additional obstacles during a tool motion may be caused
tion of two or more axes simultaneously, the programmed
by special types of setup, machine design, tool mounting
rapid path and the actual rapid path of the tool are not al-
method, etc.
ways the same. The resulting compound motion can be -
and often is - much different from the theoretical pro-
grammed motion (the intended motion).
RAPID POSITIONING 145

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.

Another example, also using the location coordinates in


Figure 20-2 , illustrates another situation, with the rapid rate
different for each axis - Figure 20-4.

0.525s
Figure 20-2

Drawing sketch for rapid motion examples y


y
y
y
0.525s
The current tool position (the start point)
Y0.787 coordinate location. The tool motion terminates at
is at X2.36
0""
XI 1.812 Y3.54 location. In the terms of incremental mo- |
1.44s| — —I
tion, the cutting tool has to travel 9.452 inches along the X
axis and 2.753 inches along the Y axis. PROGRAMMED
MOTION
If the rapid rate for both axes is the same (XY rapid mo-
ACTUAL X = 394 in/min
tion rates usually are), such as 394 in/min, it will take
MOTION Y = 315 in/min
(9.452 x 60) / 394 = 1.44 seconds Figure 20-4

Rapid motion deviation - different rapid rate for each axis


to complete the X axis motion - but only

In this not so common example, the X axis rate is set to


(2.753 x 60) / 394 = 0.42 seconds 394 in/min (10000 mm/min) and the Y axis rate is set to
315 in/min (8000 mm/min). It will than take
is required to complete the Y axis motion. Since the mo-
tion is not completed until both axes reach the end point, it
(9.452 x 60) / 394 = 1.44 seconds
is logical that the actual tool path will be different from the
programmed tool path.
to complete the X axis motion - but only

0.42s 1.02s 1
(2.753 X 60) / 315 = 0.525 seconds

to complete the Y axis motion. In this case, the resulting


/
[
”*
motion will also include an angular departure, but not at
**

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

0.525 / 60 x 394 = 3.448 inches


PROGRAMMED
MOTION but the Y axis motion will be only
ACTUAL x= 394 in/min
MOTION Y = 394 in/min
.525 / 60 x 315 = 2.753 inches

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.

Straight Angular Motion

In some uncommon circumstances, the theoretical rapid


tool path will correspond to the actual tool path (with no
bent line as a result). This will happen if the simultaneous
tool motion has the same length in each axis and the rapid Figure 20-5
rates of all axes are identical. Such an occurrence is rather
Typical example of a reversed rapid motion on a CNC lathe,
rare, although not impossible. Some machine manufactur- used to bypass obstacles, for example, a tailstock
ers provide this feature as a standard and the programmer
should know whether the machining center does have that As Figure 20-5 shows, rather than programming a direct
feature or not. Another situation where the resulting motion motion from the turret position to the cutting position
is a straight angle, is when the rapid rating varies for each (which would be from point A to point C), the tool motion
axis, but the required length of motion just ‘falls’ into the was split. The approach towards the part will be in the order
range that results in a straight angular motion. of A to B to C, at a rapid rate. From point C to point D, the
actual cutting takes place. When the cutting is completed,
Both of these occurrences are rare (more or less a case of
the tool will rapid in the reverse order, back to the starting
good luck) and in actual programming will seldom happen.
position. Rapid motion will be from D to C to B to A. This
To be on the safe side, never take any chances - it is always is a necessary precaution to bypass a potential obstacle, for
more practical to program the rapid motion without the ac- example, the tailstock.
tual calculation of the tool path but with safety as a primary
consideration.
TYPE OF MOTION & TIME COMPARISON
Reverse Rapid Motion
The technique of programming each axis separately in
Any must be considered in terms of ap-
rapid motion
individual blocks of the program,is recommended only for
proach towards a part and the return back to the tool chang-
the purpose of bypassing possible obstacles during the tool
ing position. This is the way a cutting tool is normally
path - and strictly for safety. This method of programming
programmed - we start at a certain position and then return
requires a slightly longer cycle time than the simultaneous
there, when all cutting activity for the toolis completed. It
multiaxis rapid motion. To compare the difference, con-
is not a mandatory method, but it is an organized method, it
sider a three axis rapid motion, such as a typical tool ap-
is consistent, and it makes programming much easier.
proach in milling.

So far, we have examined a rapid motion before an actual


As an example, the rapid rate is at 394 in/min (10000
cut, starting from the tool change position. When the tool
mm/min) for each axis. The motion takes place between
cutting function is completed, a rapid motion is required to
the coordinate location of X2.36 Y0.787 Z0.2 (start point)
return back to the tool change position.
and XI 1.812 Y3.54 Z1.0 (end point).
RAPID POSITIONING
147

The required time for tool travel along each axis can be
easily calculated:

X axis time:

((11.812 - 2.36) x 60) / 394 = 1.440 sec.

Y axis time:

((3.54 - .787) x 60) / 394 = 0.420 sec.

Z axis time:

Rapid motion override switch set to 1 00% of rapid rate


((1.0 - .2) x 60) / 394 = 0.121 sec.
The configuration of the rapid override switch varies be-
axes are moved simultaneously, the total time
If all three
tween machines from different manufacturers. On some
for positioning is 1 .44 seconds, which is the longest time
machines, the rapid motion may be stopped altogether, on
required for any axis to reach the end point. The program
others, the tool will move at the slowest percentage and
block will be:
cannot be stopped with the override switch alone.

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:

1.44 + 0.42 + 0.121 = 1.981 seconds RAPID MOTION FORMULAS

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

Note that the modality of GOO rapid motion command


does not require its repetition in the subsequent blocks.

REDUCTION OF RAPID MOTION RATE

During a part setup or while proving a new program on


the machine, the CNC operator has an option to select a
slower rapid traverse rate than the maximum established
by the machine manufacturer. This adjustment is done by
the means of a special rapid override switch. located on the
control system panel. This switch has typically four se- =
T Required time in seconds
lectable positions,depending on the machine brand and the R = Rapid traverse rate per minute
type of control system - Figure 20-6. for the selected axis - in/min or mm/min
L = Length of motion - inches or mm
The second, third and fourth positions on the rapid mo-
tion override switch are rated as the percentage of the ac- Units applied to the formulas must always be consistent
tual rapid rate 25%, 50%, 00% respectively. They are set
-
1 within the selected system of measurement in the program.
by the machine manufacturer. The first setting, typically Inches and inches per minute (in/min) must be used with
identified by F0 (or FI ) is a rapid motion rate set through a the English system. Millimeters and millimeters per minute
control system parameter. The F0 (FI) setting should al- ( mm/min) must be used in the metric system. For any calcu-
ways be slower than any other setting, typically less than lation relating to the rapid traverse time, the measuring
the lowest setting of 25%. units cannot be mixed.
148 Chapter 20

APPROACH TO THE PART might be a reasonable compromise to


ity, it split the Z axis
motion into two separate motions:

The previous Figure 20-5 had an illustration of a safe tool


N314 G90 G54 GOO X10.0 Y8.0 S1200 M03
approach as applied to a CNC lathe. For CNC machining N315 G43 Z0.5 HOI
centers, the safety of part approach should be considered N316 G01 Z0.05 F100.0
with equal care. Keep in mind that the general principles of N317 Z-1.5 F12.0
rapid tool motion have to be considered for any machine.
When approaching a part at a rapid rate, the cycle time can In method, the rapid motion has been first pro-
this

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

part (used perhaps in a single block mode). Once the pro-


There is nothing wrong with such a method of program- gram is verified and debugged, the heavy feedrate in the
ming, providing the cutting tool is properly set and the part
non-cutting motion will speed up the operation and at the
height is consistent from one part to another, as it should be. same time provide an extra safety clearance. The program
The clearance of .05 inches (1.27 mm) allows very little with the split Z axis motion can always be optimized later,
amount of unproductive cutting. On the other hand, an in- although this may not be the best approach for repetitive
experienced CNC operator may not feel quite comfortable jobs, since the setupis always ‘new’ for any repetition at a
with such a small clearance, particularly during the early later date. However, it may be very useful when running

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

The ability of a control system to return a cutting tool


from any position to the machine reference position is a
of all modern CNC systems. Programmers
critical feature Z = UP (TOP)
'§7
and operators understand the term machine reference posi-
tion as synonymous with the home position or machine
MACHINE ZERO
zero position. This is the position of all machine slides at
POSITION


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
|

MACHINE REFERENCE POSITION 1 i

The existence of machine reference position is for refer- Figure 21-1

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

we need some unique location that can be considered the


origin point of the machine - a zero position - a home posi- So far, any reference to the Z axis in the description was
tion. Machine reference position is exactly such a point.
quite intentional. The Z axis machine zero position for a
vertical machining center is always where the Automatic
Tool Change (ATC) takes place. "Iliis is a built-in location,
Machine zerois a fixed position on a CNC machine that

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

Upper right corner of the machine XY = UPPER LEFT I

It is quitp common, normal, to start the first part of


in fact Y-
a new program from the machine zero position. Often, it is WORK AREA
also necessary to make a tool change at machine zero posi- I
tion and return there when the program execution is com-
pleted. So, several of the four alternatives arc not very
convenient for setup of the part on the machine table and its Figure 21-2
removal when the machining is done. Machine zero position located at the upper left XY corner
of a CNC vertical machining center
The most common and standard machine reference posi-
machining centers is
tion for vertical at the upper right cor- As Figure 21-2 illustrates, some CNC vertical machining
ner of the machine, looking perpendicularly towards the centers have the machine zero position at the upper left cor-
XY plane - Figure 21-1. ner of the XY plane.

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

tion known as overtravel - compare the two possibilities:


Setting the Machine Axes
Tool motion from machine zero, if machine zero is located
at the upper right corner: From the previous sections, remember that there is a di-
rect relationship between the CNC
machine, the cutting
X+ Y+ Z+ ... tool motion will overtravel tool and the part itself. The work reference point (program
zero or part zero) is always determined by the CNC pro-
Tool motion from machine zero, if machine zero is located
at the upper left corner:
grammer, the tool reference point is determined by the tool
length at the cutting edge, also by the programmer.
X- Y+ Z+ ... tool motion will overtravel
Only the machine reference point (home position) is de-
The other two corners (lower left and lower right of the termined by the manufacturer of the machine and is located
XY view) are not used as machine zero. at a fixed position. This is a very important consideration.

Lathes Fixed machine zero means that all other


references are dependent on this location.
The machine referenceposition for two axis CNC lathes
is logically no from the reference position of the
different In order to physically reach the machine reference posi-
machining centers. An easy access by the CNC operator to tion (home) and set the machine axes, for example, during
the mounted part is the main determining factor. Both, the the part or fixture setup, there are three methods available
X and the Z axes have their machine reference position at to the CNC operator:
the furthest distance from the rotating part, which means
away from the headstock area, consisting of the chuck, col- Manually - using the control panel of the system
let, face plate, etc.
The machine operator will use the XYZ (machining centers)
For the X axis, the machine zero reference position is al- or the XZ (lathes) switches or buttons available for that

ways extreme limit of the travel away from the spin-


at the purpose. One or more machine axes can be activated
dle center line. For the Z axis, the machine reference posi- simultaneously, depending on the control unit.

tion is always at the extreme travel away from the machine


headstock. In both cases, it normally means a positive di-
Using the MDI Manual-
Data Input mode
rection towards the machine zero, the same as for the ma-
chining centers. The illustration in Figure 21-3 shows a This method also uses the control panel. In this case, the
machine zero for a typical CNC lathe. machine operator sets the MDI mode and actually
programs the tool motion, using the suitable program
commands (G28, G30).

In the CNC program -


during a cycle operation

Using the same program commands as for the


MDI operation, the CNC programmer, not the machine
operator, includes machine zero return command (or
commands) in the program, at desired places.

When the operator has performed the actual machine


zero return, it is always a good idea to set the relative and
absolute positions to zero on the display screen. Keep in

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

shows G28 programmed by itself in the block - this is an


G27 Machine zero reference position return check incomplete instruction. At least one axis must be specified
with the G28 command, for example,
Return to the primary machine zero
G28
reference position N67 G28 Y..

G29 Return from the machine zero reference position


which will only send the Y axis to the machine zero refer-
ence position, or ...
Return to the secondary machine zero
G30
reference position (more than one is possible)
N67 G28 Z..

Of the four listed commands, G28 used almost exclu


is
will only send the Z axis to the machine zero reference
sively in two and three axis CNC programming. Its only position, and ...

purpose is to return the current tool to the machine zero po-

sition and do it along the one or more axes specified in the N67 G28 X.. Y. . Z.

G28 program block.


will send all three specified axes to the machine zero ref-
erence position. Any multiaxis motion requires caution -
Command Group
watch for the infamous ‘hockey stick’ motion.
All four preparatory commands G27 to G30 belong to the
group 00 of the standard Fanuc designation that describes Intermediate Point
the non modal or one-shot G codes. In this designation,
One of the elementary requirements of programming
each G code of the 00 group must be repeated in every is
the alpha numerical composition of a word. In the program,
block it is used in. For example, when G28 command is
every must be followed by one or more digits. The
letter
used in one block for the Z axis and then it is used in the
question what values will the axes in G28 have? They
is
next block for the X and Y axes, it has to be repeated in
will be the intermediate point for machine zero return mo-
each block as needed:
tion. The concept of the intermediate motion in G28 or G30

is one of the most misunderstood programming features.


N230 G28 Z. . (MACHINE ZERO RETURN Z AXIS)
N231 G28 X. . Y. (MACHINE ZERO RETURN XY AXES)
.
Commands G28 and G30 must always contain the inter-
mediate point (tool position). By Fanuc design and defini-
The G28 command in block N231 must be repeated. If
tion, the G28/G30 commands have a built-in motion to an
thecommand is omitted, the last motion command pro-
intermediate point, on the way to machine zero. An anal-
grammed will be effective, for example, GOO or G01
ogy can be made to an airplane flight from Los Angeles,
USA to Paris, France, that temporarily stops over in New
RETURN TO PRIMARY MACHINE ZERO York City. It may not be the most direct route, but it serves a
certain specific purpose, for example, to refuel the aircraft.
Any CNCmachine may have more than one machine
zero reference point (home position), depending on its de- The coordinate values of the axes associated with G28 and
sign. For example, many machining centers with a pallet G30 commands always indicate an intermediate point.
changer have a secondary machine reference position, that
is often used to align both the left and right pallets during The purpose of the intermediate point, or position, is to
pallet changing. The most common machine tool design is shorten the program, normally by one block. This reduc-
the one that uses only a single home position. To reach this tion is so marginal that the philosophy behind the design
primary home position, the preparatory command G28 is may be debated. Here is how the concept of the intermedi-
used in the program and can also be used during the MDI ate point (position) works.
control operation.
When the G28 or G30 command is used in the program,
The G28 command moves the specified axis or axes to at least one axis must be specified in the block. The value of
the home position, always at a rapid traverse rate. That that axis is the intermediate point, as interpreted by the con-
means GOO command is assumed and does not have to be trol system. Absolute and incremental modes G90 and G9
programmed. The axis or axes of the desired motion (with a make a great difference in interpretation of the G28 or G30
value) must always be programmed. Only the programmed behavior, and will be described shortly.
axes will be affected.
152 Chapter 21

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

id / tool position in the absolute mode - or - by specifying a


X X12.0

/ zero tool motion in the incremental mode.


/
JiaL [fei[_
TO nrr] / Absolute and Incremental Mode
/
/
j. There is a major difference in programming the machine
Y4.0
zero return command G28 or G30 in the absolute and in-
V
cremental modes. Remember the basic difference between
^ [U1
pi INTERMEDIATE two similar statements:

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:

( > G28 USED IN THE ABSOLUTE MODE)


The same program with an intermediate point at a safe lo- G90
cation will change slightly:
N12 G01 Z-0.75 F4.0 M08
G90
N25 G01 X9.5 Y4.874
N26 G28 Z-0.75 M09 (G28 IN ABSOLUTE MODE)
GOO X5.0 Y4.0 (MACHINED HOLE)
G28 X12.0 Y4.0 (MACHINE ZERO MOTION)

(---> G28 USED IN THE INCREMENTAL MODE)


Earlier examples have shown the reason behind this dou-
G90
ble motion. It is very simple - only to save a single program
N12 G01 Z-0.75 F4.0 M08
block that is all. Its intended purpose is to use one block of
-

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

be known. The disadvantage of this method is that G91 is


most likely a temporary setting only and must be reset back
to produce the same final result, but with an extra block.
to G90 mode, used by the majority of the program.
For example, using the intermediate position, the tool can
be programmed to avoid an obstacle on the way to the ma- A failure to reinstate the absolute mode may result

chine zero. If programmed with care, the intermediate posi- in an expensive and possibly serious error.

tion may be quite useful. Normally, it is more practical to


MACHINE ZERO RETURN 153

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.

programming mode, for the majority of programs.


G90
There is one time, where the incremental mode of ma-
chine zero return has some very practical advantages. It N12 GOO X5.0 Y1.0
happens in those cases when the current tool position is not N13 G28 X5.0 Y1.0
known to the programmer. Such a situation typically hap-
pens when using subprograms, where incremental mode is
By this modification, the intermediate point becomes the
used repeatedly to move the tool incrementally to different
current too! position which results in direct motion to the
XY where exactly is the cutting
locations. For instance -
,

machine zero. The reason is that the intermediate tool posi-


tool located when is completed in the N35
the drilling cycle
tion coincides with the current tool position. This program-
block of the following example?
ming format has nothing to do with modal values of axes.
In the part program, X5.0Y1.0 in the block N13 must be
G90
repeated, while the absolute mode G90 is still in effect.

N32 G99 G81 XI. 5 Y2.25 R0.1 Z-0.163 F12.0


(REPEAT 7 TIMES) In cases when the current tool position is not known, the
N33 G91 X0.3874 Y0.6482 L7
N34 G90 G80 Z1.0 M09 (CANCEL CYCLE) machine zero return has to be done in incremental mode. In
N35 G28 (X???? Y????) Z1.0 (UNKNOWN POSITION) this case, change temporarily to incremental mode and pro-
gram a zero length motion for each specified axis:

Is it worth the extra effort to find the absolute location at G90


all costs? Probably not. Let’s look at some other examples.
While in the absolute mode G90, the axis coordinate values N12 GOO X5.0 Y1.0
define the intermediate point location. When incremental
N13 G91 G28 X0 Y0
N14 G90 ...
mode G9 is programmed, the coordinate values define the
1

actual distance and direction of the intermediate motion. In


both cases, the intermediate tool motion will be performed
Again, an important remainder is in place here - always
first. Then - and only then - the final return to the machine
remember to switch back to the absolute mode as soon as
zero reference position will take place. possible, in order to avoid misinterpreting the consecutive

Take the current tool position as X5.0 and Y .0 (absolute 1


program data.

position). In the program, the XY values of the G28 com-


In a brief overview, the intermediate point cannot be eli-
mand that follows the position block are very important:
minated from the G28/G30 block. If situation demands a
return to machine zero without going through a separate in-
G90
termediate point, use a zero tool motion towards the inter-
mediate point. The method depends on the active G90 or
N12 GOO X5.0 Y1.0
N13 G28 X0 Y0 G9 mode
1 at the time:

In G90 absolute mode motion to machine zero, the current


must be repeated for each
tool coordinate location axis
In this example, the G28 command specifies that the cut-
specified with G28 command.
ting tool should reach the machine zero position - identified
as X0Y0 in the block N 3. Since the G28 command relates
1 InG91 incremental motion to machine zero, the current tool
to the machine zero only, it would be reasonable to assume motion must be equal to zero for each axis specified with
that the X0Y0 relates to the 'machine zero, rather than the
the G28 command.
part zero. That is not correct.
Return from the Z Depth Position
The X0Y0 refers to the point through which the tool will

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

course, is not likely to be the intended motion. be simulated in separate blocks:


154 Chapter 21

N24 GOO Z-0.43


N21 G90 GOO G54 X9 5 Y4.874 S900 M03
. N25 GOl Z-0.75
N22 G43 ZO.l HOI M08 N26 GOO ZO.l MO
N23 GOl Z-0.45 F10.0 N27 G28 ZO.l M05
N24 GOO Z-0.43 N28 G28 X9.5 Y4.874
N25 GOl Z-0.75 N29 M01

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:

must retract first. Several options can be selected, but three


of them are the most common: N26 G28 Z-0.75 M09

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,

then return the XY axes in the next block


The complete program for Option 2 will be:
Return XYZ axes to machine zero directly
from the current tool position (at the depth)
N21 G90 GOO G54 X9 5 Y4 874 S900 M03 . .

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

To return all three axes XYZ to machine zero directly


from the current tool position (while the tool is still at the
ZO.l = INTERMEDIATE POINT
hole full depth), only one zero return block will be needed:

Y/Yfy/Y/ Z ‘ 0 J5 = CURRENT POSITION N26 G28 X9.5 Y4.874 ZO.l M09


Hole location in XY axes is X9.5 Y4.874
This is the intended method of programming, as Fanuc
Figure 21-5 controls are designed. Some programmers may disagree
Machine zero return from a hole depth - milling with Fanuc on this issue, but that is how it works.

O Option 1
Here is the complete program for Option 3:

To retract the Z axis above work in one block first, then


return the XYZ axes to the machine zero position, would be N21 G90 GOO G54 X9 5 Y4.874 S900 M03
.

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

The complete program for Option I will be:


Step 2: All axes will return to machine zero

Also note the rearrangements of M09 and M05 miscella-


N21 G90 GOO G54 X9.5 Y4.874 S900 M03 neous functions. Turning the coolant off first is more prac-
N22 G43 ZO.l HOI M08
tical than stopping the spindle.
N23 GOl Z-0.45 F10.0
MACHINE ZERO RETURN 155

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.

OPTION 3... N78 G28 UO


N79 G28 WO
... is the most efficient in terms of program cycle time,
but any error in position could result in a collision. These two blocks will return the cutting tool to the ma-
chine zero in incremental mode, there is no intermediate
Axes Return Required for the ATC motion applied. It is safer to move the X axis first, using the
incremental mode U, Z axis,
using the incremental
then the
If the only purpose of machine zero return is to make an
mode W. If the work area is clear (watch for the tailstock),
automatic tool change, only certain axes must be moved for both X and Z axes can be returned to the machine zero at
that purpose. For a vertical machining center, only the Z the same time:
axis is required to make the tool change:

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:

G91 G28 YO ZO M06

In both examples, the tool change function M06 will not


be effective, until the machine zero reference position has
been physically reached. The M06 function can be pro-
grammed in a separate block later, if desired.

Indexing or r'otary own reference


axes also have their
point and are used with G28 command the same way as lin-
ear axes. For example, a B axis will return to the machine
zero reference position in the following block:

Machine zero return from a hole depth - turning application


G91 G28 BO

If safe, the B axis may be programmed simultane- When using position register command G50, the XZ
it is

ously with another axis:


setting must always be known for this command. In this
case, the programming rules for machine zero return are

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

Q Example 1 : The format for G27 command is:

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 .

N2 G50 X7.85 Z2.0 (OLDER METHOD ONLY)


N65 X10.0 Z3.0 T0300
N3 GOO T0400 M42
N66 M01
N4 G96 S350 M03
N5 GOO G42 X4.125 Z0.1 T0404 M08
© Example 2
N6 GOl Z-1.75 F0.012
N7 U0.2 F0.04
The second example will use G28 machine zero refer-
N8 G27 G40 X7.85 Z2.0 T0400 M09
ence command, to achieve the same target position:
N9 M01

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

In this case, the control system will return an error condi-


The less common preparatory command G27 performs a tion. The displayed automatically on the control
error is
checking function - and nothing else. Its only purpose is to screen (as an alarm). The system will not process the re-
check (which means to confirm), if the programmed posi- mainder of the program, until the error is corrected. The
tion in the block containing G27 is at the machine zero ref- light indicating Cycle Start condition will turn off and the
erence point or not. If it is, the control panel indicator light source of the problem has to be found. When looking for
for each axis that has reached the position will go on. If the the source of the problem, always check both positions, the
reached position is not at the machine zero, the program start position block, as well as the end position block. The
processing is interrupted by an error condition displayed on error is quite easy to make in either block. Also note that
the screen as an alarm. any axis not specified in the block will not be checked for
its actual position.
If the tool starting position is programmed at the machine
zero reference (home), it is a good practice to return there Another important point is the cancellation of the cutter
as well, when com-
the machining with that cutting tool is The G27 preparatory com-
radius offset and the tool offset.
pleted. This is quite commonly done for CNC lathes, where mand should always be programmed with the G40 com-
(he tool change (indexing) normally takes place in the same mand and the TxxOO in effect (G49 or H00). If the tool off-
position, although this position does not always have to be set or the cutter radius offset is still in effect, the checking
the machine zero. Usually, it is a safe position near the ma- cannot be done properly, because the tool reference point is
chined part. displaced by the offset value.
MACHINE ZERO RETURN
157

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

N58 G50 X10.0 Z3.0 S1000


G29 command is issued in the program.
(OLDER METHOD ONLY)
N59 GOO T0300 M42 A schematic sketch of the tool motion is illustrated in
N60 G96 S400 M03
Figure 21-7.
N61 GOO G41 X4.0 Z0.15 T0303 M08
N62 G01 Z-2.45 F0.012
N63 X3.0 MO
N64 GOO G40 X3.5 Z0.15 M05
N65 G27 X10.0 Z3.0 T0300
N66 M01

The machine reference point return check can be done in


either the absolute or incremental mode. The absolute sta-
tement in block N65 (in the last example) can be replaced
with the incremental version:

N65 G27 U6.5 W2 85 T0300 .

There is a drawback to this command. A small price to


pay when using this checking command is a slight cycle
time loss. Because the deceleration of tool motion is built
into the command by the control system, about one to three
Automatic return from machine zero position
seconds may be lost when G27 command is implemented.
Thismay be a significant loss if a large number of tools use
The illustration shows a tool motion from point A to
G27 check in every program.
point B first, then to point C, back to point B, and finally, to
The G27 command seldom used with geometry offset
ip
the point D. The point A is the starting point of the motion,
setting of the tools, which is the current modem method. point B is the intermediate point, point C is the machine
The G50 command is older and not used anymore on the zero reference point, and point D is the final point to reach,
newest CNC lathes, but many lathes are still used in indus-
the actual target position.

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:

G28 U18.6 W6.8


The preparatory command G29 is the exact opposite of
G28 or G30 command. While G28 will automatically re-
G29 U-14.86 W7.62
turn the cutting tool to machine zero position, G29 com-
mand will return the tool to its original position - again, via Of course, there would be some appropriate action pro-
an intermediate point. grammed between the two blocks, for example, a tool
change or some other machine activity.
In normal programming usage, the command G29 usu-
ally follows G28 or G30 command. The rules relating to G27 command, there is only a weak support
Similar to
the absolute and incremental axis designation are valid for for G29 among CNC programmers. It is one of the com-
G29 in exactly the same respect as to the G28 and G30. All mands can be very useful in some rare cases, but virtu-
that
programmed axes are moved at the rapid traverse rate to the ally unnecessary for everyday work. However, it is always
intermediate position defined by the preceding G28 or
first, an advantage to know what ‘tools of trade’ are available in
G30 command block. An example for a lathe application il- CNC programming. They may come handy.
lustrates the concept:
158 Chapter 21

RETURN TO SECONDARY MACHINE ZERO cs” where ...

G30 = indicates the selection of a


In addition to theG28 machine zero command, specific secondary reference position
CNC machines also have the G30 command. In this chap- P = can be P2, P3 and P4 to identify
ter, and the handbook generally, many examples apply the secondary position (2-4)
equally to G28 and G30 commands and were sometimes XYZ = is the intermediate point definition
identified as G28/G30 to cover both. So what is different in (one axis minimum must be specified)
G30 and why is this command needed in the first place?
it

The most common use of a secondary machine zero ref-


By G30
definition, preparatory command is a machine erence point in CNC programming is for pallet changing.
zero return command to the secondary machine zero posi- In the control unit parameter setting, the distance of the sec-
tion. That position must be available on the machine at the ondary reference point is set from the primary reference
time of purchase. Note the descriptive word is secondary , point and is not normally changed during the working life
not second. In virtually all respects, G30 is identical to the of the machine and the pallet changer.
G28, except that it refers to a secondar program zero.
To distinguish between multiple secondary machine zero
This secondary program zero can be the physical second, positions, address P is added in the G30 block (there is no P
third, or even fourth reference point, as specified by the ma- address used for G28). If the CNC machine has only a sin-
chine manufacturer. Not every CNC machine has a second- gle secondary machine reference
position, the address P is
ary machine zero reference position, and not every CNC usually not required in the program, and PI is assumed in
machine even needs one. This secondary machine refer- such a case:
ence point serves only some very special purposes, mainly
for horizontal machining centers. 630 X. . Y.

The programming format for G30 command is similar to is the same as


theG28 command, with an addition of the P address:
G30 PI X. . Y.

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

often called the target position. The of a linear motion


start
Linear interpolation is used in part programming to make
is defined by the current tool position, the end is defined by
a straight cutting motion from the start position of the cut to the target coordinates of the current block. It is easy to see
its end position. It always uses the shortest distance the cut-
that the end position of one motion will become the start
ting tool path can take. The motion programmed in linear
position of the next motion, as the tool moves along the
interpolation mode is always a straight line, connecting the
part, through all contour change points.
contour start and end points. In this mode, the cutter moves

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

Vertical motion ... single axis only

Angular motion ... multiple axes

The term linear interpolation means that the control sys-


tem is capable to calculate thousands of intermediate coor-
dinate points between the start point and end point of the
cut. The result of this calculation is the shortest path be-
tween the two paints. All calculations are automatic - the
control system constantly coordinates and adjusts the feed-
rate for all cutting axes, normally two or three.

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

The program block that starts the linear interpolation


first tool motions that are parallel to the table edges are single
mode must have a feedrate in effect, otherwise an alarm axis motions. On the CNC lathes, many external and inter-
will occur during the first run, after power on. Command nal operations, such as facing, shoulder turning, diameter
G01 and feedrate F are modal, which means they may be turning, drilling, tapping and others, are programmed as
omitted in all subsequent linear interpolation blocks, once single axis motions. In all cases, a single axis motion can be
they have been designated and providing the feedrate re- along either the vertical or the horizontal axis, within the
mains unchanged. Only a change of coordinate location is current (working) plane. A single axis motion can never be
required for the axis designation in a program block. In ad- an angular motion, which requires two, three, or more axes.
dition to a single axis motion, a linear motion along two or Another name for a motion that is parallel to a machine axis
three axes may be also programmed simultaneously. is orthogonal - horizontal or vertical only.

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
,

on modern computer technology combined with machin-


nA and to
ing know-how. This type of programming is using desktop
301 (X) X6.0 Y3.0
o computers and is affordable by virtually all machine shops.
o 1

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-

C 1 2 v. £ e 7 £ lustrated in Figure 22-4.

Figure 22-2

Single axis linear interpolation motion

Figure 22-2 illustrates a single axis linear interpolation


motion, one along the X axis and the other along the Y axis.
Two Axes Linear Interpolation

A linear motion can also be programmed along two axes


simultaneously. This is a very common situation when the
start point of the linear motion and its end point have at
least two coordinates that are different from each other,
while in mode G01. The result of
the linear interpolation
this two-axis motion
a straight tool motion at an angle.
is

The motion will always be the shortest distance between


the start point and the end point and results in a straight line
at an angle calculated by the control - Figure 22-3.

Three axes simultaneous linear interpolation motion

PROGRAMMING FORMAT
program a tool motion in the linear interpola-
In order to
tion mode, use preparatory command GO along with one,I

two, or three axes of tool motion, as well as a cutting feed-


rate (F address) suitable for the job at hand:

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

Individual Axis Feedrate


LINEAR FEEDRATE
The subject of actual cutting feedrate per axis is not cru-

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

no need to know the following calculations at all - the CNC


... per time mm/min or in/min
system will do them every time, all the time, accurately and

... 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.

out typical ranges a normal CNC system can support. The


first table is for milling, the second table is for turning. All

units used in part programming are represented.

Minimum motion increment MILLING

0.001 mm 0.0001 - 240000.00 mm/min

0.001 degree 0.0001 - 240000.00 deg/min

.0001 inch .0001 -240000.00 in/min

Minimum motion increment TURNING


Data for the calculation of individual axis linear feedrate
0.001 mm 0.00001 - 500.00000 mm/min
Evaluate the following example of a linear motion and try
0.001 degree 0.00001 - 500.00000 deg/min to apply the formulas listed afterwards:

.0001 inch .000001 - 50.000000 in/min GOO X10.0 Y6.0 (START POINT)
G01 X14.5 Y7.25 F12.0 (END POINT)

It may appear that the maximum feedrate that can be used


The linear motion takes place between two end points,
However, from the starting point at XI 0.0 Y6.0 to the end point at
is unusually high. For actual cutting, that is true.
X14.5 Y7.25 - the feedrate is programmed at 12 in/min as
keep in mind that these ranges are relative to the control
FI 2.0. That means the actual travel motion along each axis
system, not to the machine. The machine manufacturer will
is either known or it can be calculated:
always limit the maximum feedrate, according to the ma-
chine design and its capabilities. Control system only pro-
Xc = 14.5 - 10.0 = 4.5
vides the theoretical range, that is more for the benefit of
Yt = 7.25 - 6.0 = 1.25
the machine manufacturer than the actual user. The intent
Zt = 0
in this case is to allow the machine manufacturers flexibil-
ity within current technological advances. As technology The length L of tool total motion (as illustrated) is the ac-
changes, the control system manufacturers will have to re- tualcompound motion, and can be calculated by using the
spond to the changes as well, by increasing the ranges. well known Pythagorean Theorem
162 Chapter 22

2 ! 1
L = V X, + Y, + Z,

The above formula is quite common, based on the square

root of the total sum


of squares of sides, that will result in
the value of 4.6703854 as the travel length in the example:

2 2 2
L = ^ 4.5 + L25 + 0 = 4.6703854

The control system will internally apply the formulas and


calculate the actual motion along the X axis (4.25), as well
as along the Y axis ( 1 .25), plus the length of the motion it-
self (4.6703854). From these values, the computer system
will calculate the X and Y axis feedrate - there is no motion
Example illustration for a simple linear interpolation
that takes place along the Z axis:

F
X,
© Example 1 :

L x F
(CLOCKWISE DIRECTION

F x = 4.5 / 4.6703854 x 12 = 11.562215 G90 ... (ABSOLUTE MODE)


G01 XI. 0 Y3.0 F... (PI TO P2)
X3.0 Y4.0 (P2 TO P3)
Y.
F
r - X4.5 (P3 TO P4)
v
L x F X6.5 Y3.0 (P4 TO P5)
X7. (P5 TO P6)
Y1.5 (P6 TO P7)
Fx = 1.25 / 4.6703854 x 12 = 3.2117263 X4.5 Y0.5 (P7 TO P8)
XI. 0 Y1.0 (P8 TO PI)

Z.
Fz
r -
L x F O Example 2

(COUNTERCLOCKWISE DIRECTION FROM PI)


Fx = 0 / 4.6703854 x 12 = 0.0
G90 .. . (ABSOLUTE MODE)
In this example, there is no Z axis motion. If the Z axis G01 X4.5 Y0.5 F. (PI TO P8)
were part of the tool motion, for example, during a simulta- X7.5 Y1.5 (P8 TO P7)
neous three dimensional linear motion, the procedure will Y3.0 (P7 TO P6)
be logically identical, with the inclusion of Z axis in the
X6.5 (P6 TO P5)
X4.5 Y4.0 (P5 TO P4)
calculations.
X3.0 (P4 TO P3)
XI. 0 Y3.0 (P3 TO P2)
PROGRAMMING EXAMPLE Y1.0 (P2 TO PI)

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

one block to the next - is not repeated in the subsequent


wise direction, the other program example will start at the
block or blocks.
same PI location, but will continue in the counterclockwise
direction.
23 BLOCK SKIP FUNCTION

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

tion, but a single program that covers both options is a


N6 ...
better choice - but only if the block skip function is used in N7 GOO X50.0 / MO
such a program. N8 G01 . .

This challenge illustrates a situation, where two conflict-


ing options are required in a program at the same time. The In those cases, when the control system does allow the
most obvious solution would be to prepare two separate block skip within a programmed block, all instructions be-
programs, each properly identified as to its purpose. Such a fore the slash code will be executed, regardless of the block
task can be done quite easily, but be a tedious, time
it will skip toggle setting. If the block skip function is turned ON
consuming and The only
definitely an inefficient process. (block skip function is active), only the instructions follow-
other solution is to write a single program, with tool mo- ing the slash code, will be skipped. In the Example 2, the
tions covering facing cuts for both possibilities. To avoid coolant function M08 (block N7) will be skipped. If the
air cutting for those parts that require only one cut, a block block skip function is turned OFF (block skip function is

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 :

the control panel is irrelevant, but OFF mode is strongly


recommended. The switch setting becomes very important, N5 GOO X10.0 Y5.0 Z2 .

if the program contains even a single block containing the


/ N6 G01 Z0.1 F30.0 M08
N7 Z-1.0 F12.0 (G01 AND M08 MISSING)
slash symbol. The active setting ON will cause all instruc-
N8 ...
tions in a block following the slash code to be ignored dur-
ing program processing. The inactive setting OFF will
cause the control to ignore the slash code and process all in-
O Example B - Modal commands are repeated :

structions written in the program. N5 GOO X10.0 Y5.0 Z2 .

/ N6 G01 Z0.1 F30.0 M08


Block skip function set to ON position means N7 G01 Z-1.0 F12.0 M08
"Ignore all block instructions following the slash." N8 ...

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

The processing result will be different for each program-


To understand the way how modal values work with ming example shown. If the block skip function is active
skipped blocks, recall that modal commands can be speci- (ON) - the block instructions following the slash code will
fied only once in the program, in the block where they oc- not be processed. The next example A yields an unaccept-
cur first. Modal commands are not repeated in the subse- able result, with a fairly possible collision. The example B
quent blocks, as long as they remain unchanged. uses careful and thoughtful approach with very little extra
work. These are the results when block N6 is skipped:
In programs where the block skip function is not used at
all, there is nothing to do. When the block skip function is
O Example A Modal commands
- are not repeated :

used, watch carefully all modal commands. Remember that


a command established in a block using the slash code will N5 GOO X10.0 Y5.0 Z2 . 0 (RAPID MOTION)
not always be in effect. It depends on the setting of block N7 Z-1.0 F12.0 (RAPID MOTION)
skip switch. Any modal command that has to be carried N8 ...
over from a section with slash codes to the section without
slash codes may be lost if the block skip function is used. © Example B - Modal commands are repeated :

Overlooking modal commands when programming block


N5 GOO X10.0 Y5.0 Z2.0 (RAPID MOTION)
skip function can result in a program with serious errors.
N7 G01 Z-1.0 F12.0 M08 (FEEDRATE MOTION)
N8 ...
BLOCK SKIP FUNCTION 165

Note motion G01, the feedrate F30.0 and


that the linear If the program is designed in such a way that there is only

the coolant M08 skipped in the example A. The X


are all one roughing or facing cut, problems may occur during
and Y axes have not been updated in cither example and machining of heavy stock. Programming two cuts for all
will remain unchanged. The conclusion is that the example parts produces a safer program, but will be inefficient for
A will result in a Z axis rapid motion in two consecutive parts with a minimum stock. There will be too many tool
blocks, causing a potentially dangerous situation. In the motions known as ‘cutting air’, when the stock is minimal.
correct version, listed as example B, the programmed repe-
tition of all commands - GO 1, FI 2.0 and M08 - assures the O Example - Variable stock face :

program will be run as intended. In the next section of this


A face cutting of a stock that varies in size is a common
chapter we will look at the principles of program design for
problem in CNC work. A suitable solution is identical for
different practical applications.
turning and milling - the program should include tool mo-

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.

Here is a lathe example of a typical face cut, when the


Always program all the instructions, even if it means repeating
facing stock varies between .08 (2 nun) and .275 (7 mm).
some program values and commands that have to be preserved.
After considering several machining options, the program-
mer decides that the reasonable maximum stock that can be
The slash symbol can be placed into the program after the a single cut will be .135 (3.5 mm) - Figure 23-1.
faced in
program has been designed both options. Just place the
for
slash in those blocks that define the optional skip of all se-
lected program blocks. Always check program!

Any CNC program containing block skip


function should be checked at least twice.

The result of this double check must be always satisfac-


tory, whether processed with the block skip in effect or
without it. If an error is detected, even a very minor error,
correct it first! After the correction, check the program at
least twice again, covering both types of processing. The
reason for the double check is that a correction made for
one type of processing may cause a different error for the
other type of processing.

PROGRAMMING EXAMPLES
The block skip function is very simple, often neglected,
yet, ita powerful programming tool. Many programs can
is

benefit from a creative use of this feature. The type of work


Variable stock for facing in a turning application - program 02301
and some thinking ingenuity are the only criteria for its suc-
cessful implementation. In the following examples, some
02301 (TURNING)
practical applications of the block skip function are shown. (VARIABLE FACE STOCK)
Use the examples as start points for a general program de- N1 G20 G40 G99
sign or when covering similar machining applications. N2 G50 S2000
N3 GOO T0200 M42
Variable Stock Removal N4 G96 S400 M03
N5 G41 X3.35 Z0.135 T0202 M08
Removal of the excessive stock material is typical during / N6 G01 X-0.05 F0.01
a rough cutting. When
machining irregular shapes (cast- / N7 GOO Z0.25
ings, forgings, etc.) or rough facing on lathes, it may be dif- / N8 X3.35
number of cuts. For example, some
N9 G01 ZO F0.05
ficult to determine the
N10 X-0.05 F0.01
castings for a given job may have only the minimum exces-
Nil GOO Z0.1
sive material, so one roughing or facing cut will be suffi- N12 X3.5
cient. Other castings for the same job may be larger and N13 G40 X12.0 Z2.0 T0200
two roughing or facing cuts arc needed. N14 M30
%
166 Chapter 23

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.

Variable stock for facing in a milling application - program 02302

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).

tial position of groove 2 at Z-50.0, in N19 the groove is cut.


Block N23 will always drill hole number 6.

In the block N20, the tool retracts from the groove to a


A variation of this application is in the program 02305.
clearance position.
There are five hole positions, but the block skip function is
The milling example shown in Figure 23-4, also in met- used within a block, to control only the Y position of the
hole. Top of Figure 23-5 shows the pattern when block skip
ric, is represented in program 02304. The program handles
two similar patterns that have four identical holes for both function is OFF, the bottom shows the pattern when skip

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

02305 (MILLING EXAMPLE)


N1 G21

N16 G90 GOO G54 X30.0 Y25.0 M08


N17 G43 Z25.0 S1200 M03 H04
N18 G99 G81 R2 5 Z-4.0 F100.0
. (HOLE 1)
N19 X105.0 (HOLE 2)
N20 Y75.0 (HOLE 3)
N21 X67.0 / Y54.0 (HOLE 4)
N22 G98 X30.0 Y75.0 (HOLE 5)
N23 G80 G28 X30.0 Y75.0 Z25.0
N24 M01

The hole 4 in block N21 will be drilled at the location of


X67.0 Y75.0, if the block skip mode is ON. The address
Y54.0 in block N2 will not be processed. If the block skip
1 ,

mode is OFF, the hole 4 will be drilled at coordinate loca-


tion of X67.0 Y54.0. In that case, the Y75.0 position from
the block N20 will be overridden. In order to guarantee the
proper drilling at Y75.0 in block
position 5, the coordinate
N22 must be written. If it is omitted, the Y54.0 from block Application of a trial cut for measuring on a lathe - program 02306
N22 will take precedence in block skip OFF mode.
02306
Using the block skip feature is the simplest way of de- (TRIAL CUT - LATHE)
signing a family of similar parts. The applications are lim- N1 G20
ited with the block skip function alone, but they offer the
fundamentals of a powerful programming technique and an
N10 G50 S1400
Nil GOO T0600 M43
example of logical thinking. Many detailed explanations
N12 G96 S600 M03
and examples of programming complex families of parts
/ N13 G42 X2.0563 ZO.l T0606 M08
can be found in a special Custom Macro option Fanuc of- / N14 G01 Z-0.4 F0.008
fers on most control systems. / N15 X2.3 F0.03
/ N16 GOO G40 X3.0 Z2.0 T0600 MOO
Trial Cut for Measuring / (TRIAL DIA IS 2.0563 INCHES)

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
-

even two decimal number instead - the choices are open.


BLOCK SKIP FUNCTION 169

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 .

/ (T02 TRIAL CUT DIA IS 4.46 INCHES)

/ N8 G50 S1750 T0400 M43


/ N9 G96 S550 M03
/ N10 GOO G42 X4.428 ZO.l T0404 M08
/ Nil G01 Z-0.4 F0.008
/ N12 U0.2 F0.03
/ N13 GOO G40 X10.0 Z5.0 T0400 MOO
/ (T04 TRIAL CUT DIA IS 4.428 INCHES)

/ N14 G50 S1750 T0200 M42


Trial cut for a taper cutting on a lathe - program 02307
/ N15 G96 S500 M03
N16 GOO G42 X4.6 ZO.l T0202 M08
In program 02307, the finished shape of the part is a
N17 G71 P18 Q20 U0.06 WO. 005 D1500 F0.01
taper, a feature difficult to measure when completed. Ad- N18 GOO X3.875
justing the tool offset in a trial and error way is not the right N19 G01 X4.375 Z-0.73 F0.008
solution. Programming a trial cut within an area of the solid N20 X4.6 F0.012
material, along a straight diameter, enables the operator to N21 GOO G40 X10.0 Z5.0 T0200 M01
check the trial dimension comfortably and to adjust the off-
set before cutting the finished taper.
N22 G50 S1750 T0400 M43
N23 G96 S550 M03
N24 GOO G42 X122.0 Z3.0 T0404 M08
02307
N25 G70 P18 Q20
(TRIAL CUT FOR TAPER - ONE TOOL)
N26 GOO G40 X10.0 Z5.0 T0400 M09
N1 G20 G99 G40
N27 M30
N2 G50 S1750 T0200 M42
%
N3 G96 S500 M03
/ N4 GOO G42 X4.428 Z0.1 T0202 M08
The example 02308 can be improved further by includ-
/ N5 G01 Z-0.4 F0.008
ing the control of taper on the width, for example. Pro-
/ N6 U0.2 F0.03
/ N7 GOO G40 X10.0 Z5 0 T0200 MOO .
gramming a trial cut is useful but often a neglected tech-
/ (TRIAL CUT DIA IS 4.428 INCHES) nique, although it does present many possible applications.

/ N8 G96 S500 M03 Program Proving


N9 GOO G42 X4.6 ZO.l T0202 M08-—
N10 G71 Pll Q13 U0.06 WO. 005 D1500 F0.01 The block skip function can also be useful to prove a new
Nil GOO X3.875 program on the machine, to check it against obvious errors.
N12 G01 X4.375 Z-0.73 F0.008 CNC operators with limited experience may be a little un-
N13 X4.6 F0.012
easy to run a program for the first time. One of most
the
N14 S550 M43
N15 G70 Pll Q13
common concerns of operators is the initial rapid motion

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.

When the program proving is completed and the safe tool


approach confirmed, the block skip can be set ON, to pre-
is
Identical rules apply for selective block skip function as

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:

Barfeeder Application / N3 ...


/ N4 ...
On a CNC lathe, the block skip function can be used in
barfeeding, for a continuously running machining. If the Numbered block skip function is not available on all controls.

barfeeder allows it, the techniques is quite simple. The typi-


cal program have two ends - one will use the
will actually Programs using the selective block skip function can be
M99 function, the other end will use the M30 function. The very clever and even efficient, but they may place quite a
M99 block will be preceded by the block skip symbol and burden on the machine operator. For the majority of jobs,
will be placed before the M30 code in the part program. there will be a plenty of programming power available by
This special technique is detailed in Chapter 44. using the standard block skip function.
24 DWELL COMMAND

Dwell is another name for a pause


the program - it is an
in Applications for Accessories
intentional time delay applied during program processing.
In this period of time - specified in a CNC program - any The second common application of the dwell command
axis motion is stopped, while all other program commands is after certain miscellaneous functions - M functions. Sev-
and functions remain unaffected. When the designated eral such functions are used to control a variety of CNC
time expires, the control system resumes processing the machine accessories, such as a barfeeder, tailstock, quill,
program with the block immediately following the block part catcher, custom features, and others. The programmed

that contains the dwell.


dwell time will allow the full completion of a certain proce-
dure, such as the operation of a tailstock. The machine
spindle may be either stationary or rotating in these cases.
PROGRAMMING APPLICATIONS Since there will be no contact of the cutting tool with part
material in this category, it is not important whether the ma-
Programming a dwell is very easy and can be quite useful chine spindle rotates or not.
in two main applications:
On some CNC machines, the dwell command may also
During actual cutting, be required when changing spindle speed, usually after a
when the tool is in contact with material gear range change. This is used mainly on CNC lathes. In

For operation of machine accessories,


these cases, the best guidance as to how and when to pro-
when no cutting takes place gram a dwell time is to follow the recommendation of the
CNC machine manufacturer. Typical examples of a dwell
Each application is equally important to programmers, used for lathe accessories are described in Chapter 44, cov-
although the two are not used simultaneously. ering the subject.

Applications for Cutting


DWELL COMMAND
When cutting tool is removing material, it is in contact
with the machined part. A dwell can be applied during ma- G04 Dwell command
chining for a number of reasons. If the spindle is running,
the spindle rotation is very important
The common preparatory command for dwell is G04.
In practice, the application of a dwell during a cut is
G commands, G04 used by
Like other only will do
itself
mainly used for breaking chips while drilling, counterbor- nothing. It must always be used with another address, in
ing, grooving or parting-off. Dwell may also be used while
this case specifying the amount of time to dwell (pause).
turning or boring, in order to eliminate the physical marks The correct addresses for dwell are X, P or U (address U
left on the part by end thrust of the cutting tool. This thrust can only be used for a CNC lathe). The actual time duration
is the result attributed to the tool pressures during cutting.
specified by the selected address is either in milliseconds,
In many other applications, the dwell function is useful to or in seconds, depending on the selected address. Some
control deceleration of the cutting feed on a corner during control systems use a different address for programming
fast feedrates, for example. This use of dwell could be par- dwell altogether, but the main purpose as well as the pro-
ticularly useful for older control systems. In both cases, the
gramming methods remain identical.
dwell command ‘forces’ the machining operation
be to
fully completed in one block, before the next block can be Some fixed cycles for machining centers also use dwell.
executed. The programmer still has to supply the exact pe- This dwell programmed together with the cycle data, not
is

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

function and is not modal. During dwell execution, the cur-


rent status of program processing is unchanged, but the
overall cycle time will be affected.

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

P100 P0100 ... 100 milliseconds


s = second
ms = millisecond
Depending on the programming format for dwell, the
Examples of practical application of the dwell format are: range of programmable time varies. For the format using
five digits in front of a decimal point and three digits fol-
lowing it, the range is between 0.001 of a second and up to
G04 X2.0 ...preferredfor long dwells
99999.999 seconds. That presents a range from the mini-
G04 P2000 ...preferredfor short or medium dwells
mum of 1/1 000th of a second, up to 27 hours, 46 minutes
GO 4 U2.0 ...lathe only -in seconds and 39.999 seconds.

In this 2 seconds or 2000 millisec-


example, the dwell is Dwell programming applications are identical to both
onds. All three formats are shown. The next example is machining centers and lathes, but the U address can only be
similar: used programs. The selection of either metric or
in lathe
English dimensional units has no effect on the dwell func-
G04 X0.5 tion whatsoever, as time is not dimensional.
G04 P500
G04 U0.5
DWELL TIME SELECTION
This example illustrates a dwell of 500 milliseconds, or
one half of a second. Again, all three formats are shown. Seldom ever the dwell time will exceed more than just a
few seconds, most often much less than only one second.
In a CNC program, the dwell function may appear in the
Dwell is always a nonproductive time and it should be se-
following way - note the dwell as a separate block:
lected as the shortest time needed to accomplish the re-
quired action. The time delay for completion of a particular
N21 G01 Z-1.5 F12.0
(DWELL COMMAND 0.3 SEC) machine operation or a special machine accessory is usu-
N22 G04 X0.3
allyrecommended by the machine manufacturer. Selecting
N23 Z-2.7 F8.0
dwell time for cutting purposes is always programmer’s re-
Programs using X or U addresses may cause a possible sponsibility. Unfortunately, some programmers often over-

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-

grammed dwell of one second. If the minimum dwell is


used rather than the estimated dwell, the cycle time will in- Minimum dwell, programmed in seconds, can be calcu-
crease by only 6.25 seconds, rather than the original 50 sec- lated, using a simple formula:
onds - a significant improvement in programming effi-

ciency and productivity improvement on the machine.


Minimum dwell (sec) =
Minimum dwell calculation and other issues related to it r/ min
are described shortly.

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

millimeters per minute - mm/min). Lathe applications are


normally programmed in feedrate per revolution, as inches 60 / 420 = 0.143 seconds dwell
-
per revolution - in/rev - or millimeters per revolution
The format selection of dwell block in the program will
mm/rev. On many Fanuc controls, a parameter setting al-
vary,depending on the machine type used and a particular
lows programming a dwell in either the elapsed time in sec-
programming style. All following examples represent the
onds or milliseconds - or the number ofspindle revolutions.
same dwell time of 0.143 of a second:
Each application has its practical uses and benefits. De-
pending on the system parameter setting, the dwell com-
G04 X0.143
mand will assume a different meaning with each setting: G04 P143
G04 U0.143
Time Setting
Regardless which format is used, all dwell values in the
This is the common and
normal default setting for virtu-
example specify dwell time of 143 milliseconds, which is
ally all CNC units. For the elapsed time setting, the dwell is
0.143 of a second. It is allowed to mix different formats in
always programmed in seconds or milliseconds, within the
one program, but such a practice does not represent consis-
range allowed by the control unit, for example, from 0.001
tent programming style.
to 99999.999 seconds, a typical range for Fanuc and many
similar control systems: For practical dwell applications in a CNC program, the
calculated minimum dwell is only mathematically correct
G04 P1000 and may not be the most practical value to use. It is always
V
better to round off the calculated value of the minimum
... represents the dwell ofone second, equivalent to 1000 dwell slightly upwards. For example, the G04 X0. 143 may
milliseconds. become G04 X0.2, or - if a double value is used - then G04
X0.143 will become G04 X0.286, or even G04 X0.3 to
Number of Revolutions Setting round off the value.

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 . .

tions, it may be desirable to program a delay for a certain


number of spindle revolutions, rather than duration for a 60 = Number of minutes (translation factor)
n = Required number of spindle revolutions
specific time.
r/min = Current spindle speed (revolutions per minute)
In a lathegrooving application, for example, a tool mo-
tion programmedto the bottom of a groove will require the O Example
grooving tool to remain in that position for a period of time
To calculate the dwell time in seconds for full three spin-
to clean up the groove bottom. Of course, calculating the dle revolutions, at spindle speed of 420 r/min, the formula
time in seconds (see below) would solve the problem, but
can be applied:
an alternative approach could be very attractive. Many con-
trols offer programming the required number of spindle
Dwellsec = 60 x 3 / 420 = 0.429
revolutions directly, providing a system parameter is set.

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:

System Setting G04 X0.429


G04 P429
If the control system is set to accept the dwell as the num- G04 U0.429
ber of spindle revolutions, rather than as time in seconds or
milliseconds, the programming is very straightforward. All It may also be a good idea to work backwards and calcu-
that is needed is to call the dwell command G04, followed late the equivalent ofdwell time, represented as the number
by the number of required revolutions: of spindle revolutions. Usually, the result will not be an in-
teger number and will require rounding to the nearest value
G04 X3.0 upwards. The above formula can be easily reversed:
G04 P3000
G04 U3.0
r/min x Dwells
Dwell rev
Each format represents the same result - a dwell in the du- 60
ration of three spindle revolutions. How
can we tell from
the program whether the value means time or revolutions?
Wc cannot. We have to know the control settings. The only O Example
clue may be the rather large input values of the dwell input.
To confirm that the formula is correct, use the value of
3.0 revolutions are usually much shorter than 3.0 seconds
0.429 of the previous example and calculate the number of
of dwell. Note that the decimal point is still written, to al-
revolutions for a dwell of 0.429 seconds at 420 r/min:
low fractions of a revolution, such as one half or one quar-
ter of a revolution, for example.
Dwell rev = 420 x 0.429 / 60 = 3 .003 revolutions

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-

ready rounded, for example, to one half of a second:


ately and even between programs, the mix is difficult. The
CNC system parameter can be set to only one dwell mode
at a time. Since control parameters are normally set for the Dwell rev = 420 x 0.5 / 60 = 3.5 revolutions

dwell in seconds or milliseconds, rather than the dwell ex-


pressed by the number of spindle revolutions, the equiva- The dwell time based on a required number of revolu-

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

Dwell is programmed one half of a second duration,


for O Example - Machining Centers - Spindle test
with the spindle rotation set to 80 r/min. The number of
revolutions for one half of a second will be: S100 M0 (100 R/MIN INITIAL SPEED)
G04 X600.0 (600 SECONDS IS 10 MINUTES)
S500 (SPEED INCREASED TO 500 R/MIN)
80 x 0.5 / 60 = 0.6666667
GO 4 X1200.0 (1200 SECONDS IS 20 MINUTES)
S1500 (SPEED INCREASED TO 1500 R/MIN)
which is less than one complete spindle revolution. The
G04 X1800.0 (1800 SECONDS IS 30 MINUTES)
reason for programming the dwell function in the first (SPINDLE STOP)
M0 5
place is not honored here and the dwell time has to be in-
creased. Dwell of 0.5 seconds is therefore not sufficient. The example for machining centers starts with the initial
The minimum dwell has to be calculated, using the for- spindle rotation of 100 r/min. That selection is followed by
mula presented earlier: the dwell of 600 seconds, which guarantees a 10 minute
constant run. The spindle speed is then increased to 500
60 x 1 / 80 = 0.75 seconds r/min and the dwell time to 1200 seconds, for another 20
minutes. The 1500 r/min spindle speed run-
last selection is
Generally, there is not much use for this type of calcula-
ning for 1800 seconds, or another 30 minutes, before the
tions most programming assignments can be handled very
-
spindle finally stops.
well with the standard dwell per time calculations.

G Example - Lathes - Spindle test


LONG DWELL TIME
M43 (GEAR RANGE SELECTION)
G97 S100 M0 (100 R/MIN INITIAL SPEED)
For machining purposes on CNC machines, an unusually GO 4 X600.0 (600 SECONDS IS 10 MINUTES)
long dwell time is neither required nor necessary. Does that S500 (SPEED INCREASED TO 500 R/MIN)
mean long dwell times are not needed at all? G04 X1200.0 (1200 SECONDS IS 20 MINUTES)
S1500 (SPEED INCREASED TO 1500 R/MIN)
A long dwell time is the programmed time that is well G04 X1800.0 (1800 SECONDS IS 30 MINUTES)
above the established average for most normal applica- M0 5 (SPINDLE STOP)
tions. Seldom ever there is a need to program dwell time
during a part machining in excess of one, two, three, or four This lathe example is very similar to the one for a ma-

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 !

consist of running the spindle at various speeds, for a cer-


tain period of time of each speed selection.

In a typical example, the maintenance department re- Machine Warm-Up


quires a small CNC program, in which the machine spindle
A similar program (typically a subprogram) that uses a
will rotate for 10 minutes at 100 r/min, then for another 20
long dwell time is favored by many CNC programmers and
minutes at 500 r/min, followed by the spindle rotation at the
CNC machine operators, ’

‘warm-up the machine before


to
highest rate of 1500 r/min for additional 30 minutes. The
running a critical job. This machine warming activity takes
program development is not an absolute necessity, since the
place typically at the start of a morning shift during winter
maintenance technician may do the test by manual meth-
months or in a cold shop. This programming approach al-
ods. The manual approach will not be very efficient but it
lows the machine to reach a certain ambient temperature
will still serve the purpose of the maintenance test.
before any precision components are machined. The same
A better choice in these cases is to store the testing proce- approach can also be used to gradually reach the maximum
dure as a small program, directly into the CNC memory. spindle speed for high-speed machining (5000 r/min and

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.

tives will remain the same.


176 Chapter 24

X Axis is the Dwelling Axis


FIXED CYCLES AND DWELL
The control display screen shows how much time is still

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

(there is no Y axis) and wire EDM uses XY axes (there is


The dwell address in fixed cycles is always P, to avoid du-
no Z axis). Other machines are similar.
plication of the X address in the same block. The address U
Safety and Dwell and the command G04 are never programmed in a fixed cy-
cle - the dwell function is ‘built’ into all fixed cycles that al-
Several safety reminders have been mentioned already. low the dwell parameter (technically all cycles do). The
Always exercise a great degree of caution when using pro- rules for calculating the dwell time remain the same for
grams with long dwell times, particularly for service or fixed cycles, as for any other machining application.
maintenance purposes. The CNC machine should never be
leftcompletely unattended. In case of long times needed O Example
for testing, proper warning signs should be prominently
posted to prevent a potentially unsafe situation. If the signs N9 G82 XI. 2 Y0.6 R0.2 Z-0.7 P300 F12 .

are not practical, someone else should supervise the ma-


In theexample, dwell of 300 milliseconds - 0.3 seconds -
chine serviced.
is specified by the address P. The dwell will become effec-
Stillon the subject of safety - the dwell function should tive upon completion of the motion along the Z axis (actual
never be programmed for the single purpose of allowing cutting motion), but before the rapid return motion.
the machine operator a certain time to perform certain
manual operation during program processing. Manual jobs
If a G04 P. is programmed as a separate block in a fixed

such as polishing, filing, deburring, part reversal, tool or in-


cycle mode, for example between the block and the G82
G80 block, no cycle will be executed in that block and the
sert change, chip removal, inspection, lubrication, etc.,
value of P in the fixed cycle definition is not updated. On
must always be done - if absolutely necessary during pro-
the latest controls, a system parameter setting enables or
gram execution - as a manual operation, never under the
program control!
disables this usage. If this method is used, the command
G04 P. will be active before the tool rapid motion from the
location just completed. The dwell function will always be
Never use dwell to perform manual operations on the machine !

executed while the cutting tool is out of a hole, in the clear


space. This feature is seldom required.
25 FIXED CYCLES

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

from the hole to the clearance position, motions along the


When we think of what machining holes means, we X and Y axes resume and proceed to a new location of the
probably think first of such operations as center drilling,
part. There, the Z axis motions are repeated. Usually, this
spot drilling and standard drilling, using common tools.
sequence of motions occurs at many locations. The hole
However, this category is much wider. Other related opera-
shape and diameter is controlled by the cutting tool selec-
tions alsobelong to the category of machining holes. The
tion, the cutting depth is controlled by the part program.
standard center drilling, spot drilling and drilling are used
This method of machining is typical to fixed cycles for
together with related operations such as reaming, tapping,
drilling, reaming, tapping, boring and related operations.
single point boring, boring with block tools, countersinking
and counterboring, spotfacing and even backboring. The elementary programming structure for point-to-
point machining can be summed up into four general steps
Machining one simple hole may require only one tool but (typical drilling sequence shown in the example):
and complex hole may require several tools to be
a precise
completed. Number of holes required for a given job is im- Step 1 : Rapid motion to the hole location
portant for selection of proper programming approach. ... along the X and/or Y axis

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.

Possibly the most time consuming task in programming


Machining holes is generally not a very sophisticated
point-to-point operations is the amount of repetitive infor-
procedure. ITiere no contouring required and there is no
is
mation be written into the CNC program. This
that has to
multiaxis cutting motion. The only motion when actual problem was solved by the introduction of fixed cycles.
cutting takes place is along a single axis - virtually always
These cycles are also known as canned cycles because a lot
the Z axis. This type of machining is commonly known as
of repetitive information is canned (or fitted) into a rela-
point-to-point machining.
tively small space of a computer chip.

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.

FIXED CYCLE SELECTION

The been designed by control manufac-


fixed cycles have
manual programming
turers to eliminate the repetition in
and allow an easy program data changes at the machine.

For example, a number of identical holes may share the


same starting point, the same depth, the same feedrate, the
same dwell, etc. Only the X and Y axes locations arc differ-
ent for each hole of the pattern. The purpose of the fixed cy-
cles is to allow for programming necessary values only
once - for the first hole of the pattern. The specified values
become modal for the duration of the cycle and do not have
Simple hole pattern - programs 02501 and 02502 to be repeated, unless and until one or more of them
change. This change is usually for the XY location of a new
02501 (EXAMPLE 1) hole, but other values may be changed for any hole at any
(PROGRAM USES INDIVIDUAL BLOCKS) lime, particularly for more complex holes.
N1 G20
N2 G17 G40 G80 A fixed cycle is called in the program by a special prepa-
N3 G90 G54 GOO X5.9 Y1.89 S900 M03 ratory G command. Fanuc and similar control systems sup-
N4 G43 Z1.0 HOI M08 port the following fixed cycles:
N5 ZO.l MO
N6 G01 Z-0.6813 F4.5
N7 G04 P200 G73 High speed peck drilling cycle
N8 GOO ZO.l
N9 X3.87 Y3.4 G74 Left-hand tapping cycle
N10 G01 Z-0.6813
G76 Precision boring cycle
Nil G04 P200
N12 GOO ZO.l Fixed cycle cancellation (any cycle)
G80
N13 X2.047
N14 G01 Z-0.6813 G81 Drilling cycle
N15 G04 P200
N16 GOO ZO.l MO G82 Drilling cycle with dwell
N17 G28 X2.047 Y3.4 Z1.0
N18 M30 G83 Peck drilling cycle
%
G84 Right-hand tapping cycle

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

The list is only general and indicates the most common


Z = Z axis end position = Z depth
use of each cycle, not always the only use. For example,
certain boring cycles may be quite suitable for reaming, al-

though there no reaming cycle directly specified. The


is
Position at which the feedrate ends
next section describes programming format and details of
The Z depth position can have an absolute value or an in-
each cycle and offers suggestions for their proper applica-
cremental value.
tions. Think of fixed cycles in terms of their built-in capabi-
lities, not their general description.
P = Dwell time
PROGRAMMING FORMAT
Programmed in milliseconds (1 second = 1000 ms)

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

order of the usual block appearance):

Q = Address Q has two meanings


N = Block number
When used with cycles G73 or G83,

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

Orjly one of the following G commands can be selected:


The I shift may be used instead of Q - see above.

G73 G74 G76 G81 G82 G83


G84 G85 G86 G87 G88 G89 J = Shift amount

X = Hole position in X axis


o Must include the Y 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 = Hole position in Y axis F = Feedrate specification

Y value can be an absolute or incremental value Applies to the cutting motion only

This value is expressed in in/min or mmJmin, depending


R = Z axis start position = R level on the dimensional input selection.

Position at which the cutting feedrate is activated


L (or K) = Number of cycle repetitions
The R level position can have an absolute value or an in-

cremental value. Must be within the range of L0 - L9999 (K0 - K9999)


LI (K1) is the default condition
180 Chapter 25

GENERAL RULES Caution: In case of combining a fixed cycle command


and a motion command of Group 01 in the same block, the
order of programming those commands is very important:
Programming is a very controlled discipline - it means
there are rules, there are strict conditions, there are limita-
GOO G81 X.. Y. . R.. Z.. P. . Q. . L. . F. .

tions,and there are restrictions. CNC programming is not a


language programming but shares a lot with it. We talk fixed cycle is processed, while in
about a Fanuc or Siemens programming, a Cincinnati pro-
gramming, a Mitsubishi or Mazatrol programming, for G81 GOO X.. Y.. R.. Z.. P.. Q. . L. . F. .

example. Fixed cycles are miniature programs.


fixed cycle is not processed, but the X and Y motions will
Consider fixed cycles as a set of small condensed mod- be performed; other values will be ignored, with the excep-
ules - modules that contain a step-by-step series of prepro- tion of the F feedrate value, which is stored. Avoid such sit-
grammed machining instructions. The cycles are called uations at all costs!
‘fixed’, because their internal format cannot be changed.
These program instructions relate to the specific kind of In this chapter, the individual fixed cycles are described
predictable tool motion that repeats from job to job. The ba- in detail and each cycle has an illustration of its structure.
sic rules and restrictions relating to fixed cycles can be The illustrations use shorthand graphic symbols, each with
summed up in the following items: a specific meaning. In Figure 25-2, the meaning of all sym-
bols used in the illustrations is described.
Absolute or incremental mode of dimensioning can be
established before a fixed cycle is programmed or
— —— — i> Rapid motion and direction
anytime within the fixed cycle mode.

G90 must be programmed to select the absolutemode, the


— Cutting motion and direction

G91 command is required to select the incremental mode. Manual motion and direction

Both G90 and G91 modes are modal

one of the X and Y axes is omitted in the fixed cycle


— Boring bar shift and direction
If

mode, the cycle will be executed at the specified location


-V Programmed coordinate
of one axis and the current location of the other axis.
Q Shift value / depth of peck
If both X and Y axes are omitted in the fixed cycle mode,
Clearance value
d
the cycle will be executed at the current tool position.

If neither G98 nor G99 command is programmed for a fixed


CW/CCW Spindle rotation

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

programmed in milliseconds. Symbols and abbreviations used in fixed cycles illustrations

If LO is programmed in a fixed cycle block, the control


system
will
will store

not execute them


the data of the block for a later use, but
at the current coordinate location.
ABSOLUTE AND INCREMENTAL VALUES
The command G80 will always cancel any active fixed
Like all machining processes, hole machining uses either
cycle and will cause a rapid motion for any subsequent
the absolute programming mode G90 or the incremental
tool motion command. No fixed cycle will be processed
mode G9 1 for programming fixed cycles. The selection will
in a block containing G80.
mainly affect the XY position of the hole, the R level and
the Z depth - Figure 25-3.
O Example :

In the absolute method of programming, all values are re-


G80 Zl. 125 is the same as lated to the point of origin - the program zero. In the incre-

mental method, the XY position of one hole is the distance


G80 GOO Zl. 125 or from the XY position of the previous hole. The R level is
the distance from the last Z value, one established before
GOO Zl. 125 calling the cycle, to the position where the feedrate is acti-
vated. The Z depth value is the distance between the R level
Preparatory G codes of the Group 01 namely GOO, G01 , and the termination of feedrate motion. At the start of any
G02, G03 and G32 commands, are the main motion com- fixed cycle, tool motion to the R level will always be in
mands and will also cancel any active fixed cycle. rapid mode.
FIXED CYCLES 181

From the practical point of view, always select this posi-


tion as the safe level - not just anywhere and not without
some prior thoughts. It is important that the level to which
the tool retracts when G98 command is in effect is physi-
cally above all obstacles. Use the initial level with other
precautions, to prevent a collision of the cutting tool during
rapid motions. A collision occurs when the cutting tool is in
an undesirable contact with the part, the holding fixture, or
the machine itself.

O Example of the initial level programming :

The following program segment is a typical example of


programming the initial level position:

Absolute and incremental input values for fixed cycles


Nil G90 G54 GOO X10 0 Y4.5 S1200 M03 .

N12 G43 Z2.0 HOI M08 (INITIAL LEVEL AT Z2.0)


INITIAL LEVEL SELECTION N13 G98 G81 X10.0 Y4.5 R0.1 Z-0.82 F5.0
N14 ...
There are two preparatory commands controlling the Z
axis tool return (retract) when a fixed cycle is completed.
N20 G80

... will cause the cutting tool to retract to


G98 = Z address designation
the initial position The fixed cycle (G81 in the example) is called in block

... will cause the cutting tool to retract to


N13. The last Z axis value preceding this block is pro-
G99
the R level position = R address designation grammed inblock N1 2 as Z2.0. This is setting of the initial
position - two inches above ZO level of the part. The Z level
can be selected a standard general height, if the programs
at
G98 and G99 codes are used for fixed cycles only. Their are consistent, or it may be different from one program to

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,

Z axis coordinate in the program - before a fixed cycle is


called - Figure 25-4.
The cutting tool position from which the feedrate begins
is Z axis. That means a fixed cycle
also specified along the
block requires nvo positions relating to the Z axis - one for
X * the start point at which the cutting begins, and another
the end point indicating the hole depth. Basic programming
for

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.

Since the Z axis is closely associated with depth, it retains


this meaning in all cycles. The replacement address is used

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

reference to this positionis the R level. Think of the R level


Figure 25-4 in terms of ‘Rapid to start point’, where the emphasis is on
Initial level selection for fixed cycles the phrase ‘Rapid to and the letter ' see Figure 25-5.
182 Chapter 25

Z DEPTH CALCULATIONS

Each must include a depth of cut. This is the


fixed cycle
depth which the cutting tool stops feeding into the mate-
at
rial. Depth is programmed by the Z address in the cycle

block. The end point for the depth cut is programmed as a Z


value, normally lower than the R level and the initial level.
Again, the G87 cycle is an exception.

To achieve program of a high quality, always make a


a
special effort to program the calculated Z depth accurately -
i.e., exactly without guessing its value or even rounding it
,

off. It maybe tempting to round-off the calculated depth of


.6979 to .6980 or even to .70 - avoid it! It is not a question
/? level selection for fixed cycles of triviality or whether one can get away with it. It is a mat-
ter of principle and programming consistency. With this ap-
The R level is not only the start point of cutting feedrate, proach and attitude, it will be so much easier to retrace the
it is also the Z level to which the cutting tool will retract cause of a problem, should one develop later.
upon cycle completion, if preparatory command G99 was
programmed. If G98 was programmed, the retract will be Z depth calculation is based on the following criteria:
to the initial level. Later, the G87 backboring cycle will be
Dimension of the hole in the drawing (diameter and depth)
described as an exception, due to its purpose. This cycle
G99 retract mode, only G98! However, for all
does not use Absolute or incremental programming method
R level value must be selected carefully. The
cycles, the
Type of cutting tool used + Added tool point length
most common values are .04-.20 of an inch ( -5 mm) above 1

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

The initial level in the example is in block N30, set to


Q Example of Z depth calculation :

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:

The R level position is normally lower than the initial


.3 x .75 = .225
level position. If these two levels coincide, the start and end 2.25 + .225 = 2.475
points are equivalent to the initial position. The R level is
commonly programmed as an absolute value, in the G90 Based on the result, the total Z depth of 2.475 inches can
mode, but changed into an incremental mode G91, if the be written in the CNC program:
application benefits from such a change.
G99 G83 X9.0 Y-4.0 R0.1 Z-2.475 Q1.125 F12.0
FIXED CYCLES 183

Z depth calculation for a drilling fixed cycle


G81 fixed cycle - typically used for drilling
A peck drilling cycle G83 is used example for best
in the
machining, although the R and Z values would be the same G82 - Spot-Drilling Cycle
for G81, G82 or G73 cycles. The tool point length calcula-
tion is described in detail in Chapter 26. G98 (G99) G82 X.. Y.. R.. Z.. P.. F..

DESCRIPTION OF FIXED CYCLES Step Description of G82 cycle

1 Rapid motion to XY position


In order to understand how each fixed cycle works, it is
2 Rapid motion to R level
important to understand the internal structure of each cycle
and details of its programming format. In the following
3 Feedrate motion to Z depth
descriptions, each fixed cycle will be evaluated in detail.
The cycle heading indicates the basic programming format 4 Dwell at the depth - in milliseconds (P-)
of the cycle, followed by the explanation of the exact opera-
Rapid retract to initial level (with G98)
tional sequences. Common applications of each cycle will 5
or Rapid retract to R level (with G99)
also be described.

All these details are important and should be a help in un-


WHEN TO USE G82 CYCLE - Figure 25-8

derstanding the nature of each cycle, as well as which cycle


Drilling with a dwell - tool pauses at the hole bottom. Used for
to select for the best machining results. As a bonus, the center drilling, spot drilling, spotfacing, countersinking, etc. -

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

on the hole cylinder during retract.


G81 - Drilling Cycle

G98 (G99) G81 X.. Y.. R.. Z.. F..

Step Description of G81 Cycle

1 Rapid motion to XY position


2 Rapid motion to R level

3 Feedrate motion to Z depth


Rapid retract to initial level (with G98)
4
or Rapid retract to R level (with G99)

WHEN TO USE G8 1 CYCLE - Figure 25-7 :

Mainly for and center drilling, where a dwell at the


drilling

Z depth is If used for boring, the G81 cycle will


not required.
G82 fixed cycle - typically used for spot drilling
produce a scratch mark on the hole cylinder during retract.
184 Chapter 25

G83 - Deep Hole Drilling Cycle - Standard


Rapid retract by a clearance value
(clearance value is set by a system parameter)
G98 (G99) G83 X.. Y.. R.. Z.. Q.. F..
Feedrate motion in Z axis by
Description of G83 cycle the Q amount plus clearance
Rapid motion to XY position Items 4, and 5 repeat until the
programmed Z depth is reached
Rapid motion to R level
Rapid retract to initial level (with G98)
Feedrate motion to Z depth or Rapid retract to R level (with G99)
by the amount of Q value

4 Rapid retract to R level WHEN TO USE G73 CYCLE - Figure 25- 10

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

G73 fixed cycle - typically used for deep hole drilling


(this cycle does not retract to R level after each peck)

Number of pecks calculation


Figure 25-9

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

Step Description of G73 cycle


G83 and G73 fixed cycles. Calculation of the number of
pecks in cycles G83 and G73 is based on the value of the Q
1 Rapid motion to XY position address and the total distance between the R level and Z
depth - not from the top of part! Dividing this distance by
2 Rapid motion to R level the programmed Q value will produce a number of pecks
Feedrate motion to Z depth the tool will make at each hole location. The number of
3
by the amount of Q value pecks in a cycle must be an integer and fractional calcula
tions must always be rounded upwards:
FIXED CYCLES
185

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

The many decimal places and cannot be


result has too Total 56 mm
used as because most controls only accept four decimal
is,

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 this example, the distance between the R level and Z


G Example 2 - Metric data :
depth is and four pecks are required:
2.5 inches

G90 G99 G73 X.. Y. . R2 . 5 Z-42.5 Q15.0 F. Q = 2.5 / 4 = .625

example, the distance between the R level and Z


In this In this case, no rounding is necessary, and Q0.625 will re-
depth exactly 45
is mm
and the Q value is 15 mm. The sult in exactly four pecks, each of identical depth.
number of pecks will be 45 divided by 15, which equals to
the exact value of 3. No rounding is necessary and the num- The peck drilling value of Q setting cannot be changed
ber of pecks executed per hole will be three. for a single hole - all pecks in a hole will have an equal
length, with the possible exception of the last peck. If the

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

G Example 3 - Metric data :


tool can withstand.

example, the distance between the R level and Z


In this The goal in peck drilling is to make an efficient part pro-
depth is 56 mm, and exactly three pecks are required. The gram under safe conditions. That means programming the
calculation of each peck depth is simple: deepest Q amount that is reasonable and practical for the
particular job and its setup. Always jeep in mind that there

56 / 3 = 18.666667 are two fixed cycles available, the standard G84 and the of-
ten neglected G73 cycle.
186 Chapter 25

G84- Tapping Cycle -Standard


Step Description of G74 cycle

G98 (G99) G84 X.. Y.. R.. Z.. F..


1 Rapid motion to XY position

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.

Description of G84 cycle


for the

D 5
Spindle rotation stop

Spindle normal rotation (M03)


and feedrate puck to R level

SB Rapid motion to XY position 6


/
Spindle rotation stop

2 Rapid motion to R level Spindle rotation reverse (M04)

4
Feedrate motion to

Spindle rotation stop


Z depth
0WHEN
and retract to initial level (with G98)
or remain at the R level (with G99)

TO USE G74 CYCLE - Figure 25- 12


Spindle reverse rotation (M04) and
5 Only for tapping a hand thread. At the
feedrate back to R level left start of cycle,
the reverse spindle rotation M04 must be in effect.

6 Spindle rotation stop


Chapter 26 describes various techniques of hole machin-
Spindle rotation normal (M03) and ing, including tapping.
7 retract to initial level (with G98)
or remain at the R level (with G99) The following notes cover only the most important tap-
ping and programming issues and apply equally to both
WHEN TO USE G84 CYCLE - Figure 25- 1 1 G84 and G74 tapping cycles:
Only for tapping a right hand thread. At the start of cycle, R level should be higher in the tapping cycle than in the
the normal spindle rotation M03 must be in effect. other cycles to allow for the stabilization of the feedrate,
due to acceleration.

Feedrate selection for the tap is very important.


In tapping, there is a direct relationship between the
spindle speed and the lead of the tap - this relationship
must be maintained at all times.

The override switches on the control panel used for


spindle speed and feedrate, are ineffective during
G84 or G74 cycle processing.

Tapping motion (in or out of the part) will be completed


even if the feedhold key is pressed during tapping cycle
processing, for safety reasons.

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..

The sequence of G74 fixed cycle is based on the reverse Z DEPTH


t
initial spindle rotation - M04. SPINDLE GW
The tap design must be of the left hand design for the G74 Figure 25- 12
cycle with M04 spindle rotation in effect.
G74 fixed cycle - exclusively used for left hand tapping
FIXED CYCLES
187

G85 - Boring Cycle WHEN TO USE G86 CYCLE - Figure 25- 14

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.

Rapid retract to initial level (with G98)


5
or remain at R level (with G99) G86
i

WHEN TO USE G85 CYCLE - Figure 25- 13 1

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

a tiny amount of stock may be removed while the cutting tool |

feeds backwards. This physical characteristics is due to the


released tool pressure during retract. the surface finish gets
— ZSPINDLE
DEPTH
If

worse rather than improves, try using another boring cycle. ! *


STOP
G85
Figure 25-14

G86 fixed cycle - typically used for rough and semifinish


G98 boring operations

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):

_U i Z DEPTH G98 G87 X.. Y.. R.. Z.. Q.. F..

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

1 Rapid motion to XY position


G86 - Boring Cycle
2 Spindle rotation stop
G98 (G99) G86 X.. Y.. R.. Z.. F..
3 Spindle orientation

Step

2
Rapid motion

Rapid motion
Description of

to

to
XY
R
G86 cycle

position with spindle on

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

Shift in by the Q value

D 3

5
Feedrate motion to

Spindle rotation stop


Z depth

Rapid retract to initial level (with G98)


or Rapid retract to R level (with G99)
n
6

8
or shift back in the opposite direction of

Spindle rotation on (M03)

Feedrate motion to Z depth


I and J
188 Chapter 25

9 Spindle rotation stop Spindle rotation stop (feedhold condition is

generated and the CNC operator switches to


10 Spindle orientation 5 manual operation mode and performs a manual
back to memory mode).
task, then switches
Shift out by the Q value
11
and
CYCLE START will return to normal cycle
or shift by the amount and direction of I J

Rapid retract to initial level (with G98)


12 Rapid retract to initial level 6
or Rapid retract to R level (with G99)
Q value
13
Shift in by the
or shift back in the opposite direction of I and J El Spindle rotation on

14 Spindle rotation on WHEN TO USE G88 CYCLE - Figure 25- 16

The G88 cycle is rare. Its use is limited to boring operations


WHEN TO USE G87 CYCLE - Figure 25- 15
with special tools that require manual interference at the
bottom of a hole. When such a operation is completed, the
This is a special cycle. It can only be used for some (not all)
tool moved out of the hole for safety reasons. This cycle
is
backboring operations. Its practical usage is limited, due to the
may be used by some tool manufactures for certain operations.
special tooling and setup requirements. Use the G87 cycle only
if the total costs can be justified economically. In most cases,

reversal of the part in a secondary operation is an option. G88


NOTE - The boring bar must be set very carefully. It must be
preset to match the diameter required for backboring. Its SPINDLE ON -G98
cutting bit must be set in the spindle oriented mode, facing A*j
the opposite direction than the shift direction. l
SPINDLE ON-G99
- •

T Z.U

DWELL -y nrnTU
SPINDLE STOP

Figure 25-16

G88 fixed cycle - used when manual operation is required

G89 - Boring Cycle

G98 (G99) G89 X.. Y.. R.. Z.. P.. F..

Figure 25-1 Step Description of G89 cycle


G87 fixed cycle - exclusively used for backboring
1 Rapid motion to XY position
G88 - Boring Cycle 2 Rapid motion to R level

Feedrate motion to Z depth


G98 (G99) G88 X.. Y.. R.. Z.. P.. F..

Step Description of G88 cycle 19 Dwell at the depth - in milliseconds (P-)

5 Feedrate motion to R level


1 Rapid motion to XY position
Rapid retract to initial level (with G98)
Rapid motion R 6
2 to level or remain at R level (with G99)
3 Feedrate motion to Z depth
WHEN TO USE G89 CYCLE - Figure 25- 1 7

4 Dwell at the depth - in milliseconds (P..)


For boring operations, when the feedrate is required for the in
and the out directions of the machined hole, with a specified
dwell at the hole bottom. The dwell is the only value that
distinguishes the G89 cycle from the G85 cycle.
FIXED CYCLES
189

G89 G76

G98
sp c*.^, G98
Q —
? < 399
X
r r ZO
jl

ZO

DWELL DWELL,
j <
Z DEPTH /~\0 O Z DEPTH

Figure 25-17 Figure 25-18

G89 fixed cycle - typically used for boring or reaming 676 fixed cycle - typically used for high quality boring

G76 - Precision Boring Cycle FIXED CYCLE CANCELLATION

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.

Spindle rotation stop


A combination of the two examples is also a good choice:
5

6 Spindle orientation N34 G80 GOO X5.0 Y-5.75

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)

Shift in by the Q value


9
or shift back in the opposite direction of 1 and J
FIXED CYCLE REPETITION

10 Spindle rotation resumes


When a selected fixed cycle is programmed for many
holes, this cycle processed only once at each hole loca-
is
WHEN TO USE G76 CYCLE - Figure 25- 18
tion within a part. This is the normal condition, based on
the assumption that most holes require only one cycle per
Boring operations, usually those for hole finishing, where the
quality of the completed hole is very important. The quality tool. In the CNC program, there is no self-evident special
may be determined by the hole dimensional accuracy, its command that would indicate how many times to process
high surface finish, or both. the fixed cycle. That is hue, the command is not evident,
The G76 cycle is also used to make holes cylindrical and
but it does exist. In fact, the assumption is that the fixed cy-
parallel to their axes. cle is to be done just once - i.e., not repeated at all.
190 Chapter 25

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:

limes (more than once), program a special command that


‘tells the CNC system how many times you want the
fixed N33 G90 G99 . .

N34 G81 X17.0 Y20.0 R0.1 Z-2.4 F12.0


cycle to be executed.
N35 G91 X5.0 L3 (K3)
N36 G90 G80 GOO . .

The L or K Address
With advantage of a feature ‘hidden in
that change, the

The command number of repetitions


that specifies the
the first example is emphasized - the equal increment be-
(sometimes called loops ) is programmed with the address
tween holes being exactly 5.0 inches. By using the incre-
L or K for some controls. The L or K address for the fixed
which is mental mode, on a temporary basis in block N35 and em-
cycle repetition is assumed to have a value of one,
Kl.The LI or K1 ploying the power of the repetitive count L or K, the CNC
equivalent to a program statement LI or
program can be shortened dramatically. This method of
address does not have to be specified in the program.
programming is very efficient for a large number of hole
For example, the fixed cycle call of the following drilling patterns in a single program. A further enhancement is to

sequence, combine the L or K count with subprograms or macros.

N33 G90 G99 . . LO or KO in a Cycle


N34 G81 X17.0 Y20.0 R0.15 Z-2.4 F12.0
N35 X22.0 In previous discussions, the default for a fixed cycle repe-
N36 X27.0 tition was specified as LI or Kl, that does not have to be
N37 X32.0 specified in the program. Any L or K value other than LI or
N38 G80 ... Kl must always be specified, within the allowable range of
the L or K address. That range is between LO and L9999 or
is equivalent to:
KO and K9999. The lowest L/K word is LO or KO - not LI
or Kl Why would
! we ever program a fixed cycle and then
N33 G90 G99 ...
say do not do it'. The address LO or KO means exactly that
N34 G81 X17.0 Y20.0 R0.15 Z-2.4 F12.0 LI (Kl) - ‘do not execute this cycle'. The full benefit of the L0/K0
N35 X22.0 LI (Kl)
N36 X27.0 LI (Kl) word will be apparent in the examples listed under the sec-
N37 X32.0 LI (Kl) tion for subprograms, in Chapter 39.
N38 G80 ...
By programming the LO or KO in a fixed cycle, what we
Both examples will provide the control system with in- are really saying is not ‘do not execute this cycle’, but 'do
structions for drilling four holes in a straight row - one at not execute the cycle yet, just remember the cycle parame-

the location of XI 7.0 Y20.0, the other holes at locations ters for future use ’.

X22.0 Y20.0 and X27.0 Y20.0, and X32.0 Y20.0 respec-


For most machining, fixed cycles are quite simple to
tively - all to the depth of 2.4 inches.
learn.They do, however, have some complex features,
waiting to be discovered and used in an efficient manner
-
If the L or K value in the second example is increased (or
rather added to the first example), for instance, from LI to even for a single hole.
L5 (or Kl to K5), the fixed cycle will be repeated five times
26 MACHINING HOLES

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 ...?

and single point boring. A typical machining procedure


may be to center drill or spot drill a scries of holes, then Tooling Selection and Applications
drillthem, then tap or bore them. Machining even a single
hole will benefit from using the fixed cycles - G81 to G89, Based on the drawing information alone, it may seem
G73, G74 and G76, all described in Chapter 25. only two tools will be needed to program this hole. In real-
ity, the implied information must be interpreted - it is not

the purpose of the drawing to describe how to machine the


SINGLE HOLE EVALUATION hole - only the hole requirements related to its functionality
and purpose. A good CNC machinist will most likely select
Before machining even a single hole on a machine, all re- four tools for the best machining results. If four tools are
quired tool paths have to be programmed. Before that, cut- selected, the first tool could be a 90° spot drill followed up ,

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)

u Tool 4 - T04 - 7/16-14 UNC tap

Tool 1 - 90° Spot Drill

The first be a 90° spot drill. Its purpose is dual - it


tool will
will act as a centering drill and starts up the hole at a highly
accurate XY location. A center drill or a spot drill are much
more rigid tools than a twist drill and either one will startup
the hole, so the drill that follows will not deviate from its
path (basic hole location and concentricity requirements
are guaranteed). The second purpose of the spot drill is its
chamfering capabilities. The design of this tool allows a
chamfer to be made at the top of the hole, providing the
spot drill diameter is larger than the chamfer diameter re-
quired. In this case, a 05/8 spot drill will be used, suitable
to chamfer the 07/16 hole.

Evaluation of a single hole - programming example 02601

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%

23/64 .3594 84%

U .3680 75%

3/8 .3750 67%

V .3770 65%

In general terms, for thin material stock, 75 to 80% full


thread depth is recommended, for very thin stock even
100%. A thread that has 53% depth will, in most cases,
break the bolt before it strips it. A full 100% thread is

Spot drill operation detail - TO I in program 02601


stronger by only 5% than a 75% thread, but the machine
power required for tapping is three times higher.

Note, that for a 90° the depth of cut will be exactly


drill,
The programmed Z depth of the tap drill has to be deep
one half of the chamfer diameter (0 x 0.5): enough to guarantee the required full thread depth of .875.
That means the full diameter of the drill has to reach a little
.4675 / 2 deeper, for example, to .975 depth. That allows the end
or .4675 x .5 = .23375 chamfer length of the tap to be below the full tap depth of
or Z-0.2338 .875, specified in the drawing. Figure 26-3 shows the tap
drill values graphically.
Drill point length is discussed later in this chapter.

Tool 2 - Tap Drill

Logically, the second tool will have to be a drill. In the ex-


ample, two drills have to be used for the job - one for the
through hole (05/16 = 0.3125), the other one for the tap
(letter U drill = 0.368). The question is - which one first?
Does it really matter?

It does matter which drill is programmed first.


certainly
The key here is the difference between the two drill dia-

meters. It is a very small difference, only .0555 measured


on diameter, in fact. From a machining point of view, it
makes sense to use the larger drill first, than the smaller
drill. The tap drill is larger than the through hole drill, so the
T02 will be the tap drill. If the smaller drill is programmed
first, the larger drill that follows may produce an inaccurate
hole, due to a very small amount of material to remove.
Tap drill operation detail - T02 in program 02601
Now comes the question of the first drill size. The drill in
question is called a tap drill. It is the drill that will create a The actual programmed depth for the tap drill will have to
round hole of proper size ( diameter and depth) that can be take into consideration one more factor - the drill point
used for the tap that follows the sequence of operations. length. The drill or - tool - point length is sometimes abbre-
Since the machining operation calls for tapping, it makes a viated as TPL or just by the letter P. This chapter contains a
MACHINING HOLES 193

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

Depth = 1.5 + .094 + .05


Tool 3 - Through Drill
= 1.644 or Z- 1.644 in the program

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.

A through-hole most forgiving for the Z depth cal-


is the
culation, closely followed by the semi-through hole. A
blind hole has very little latitude, if any, and has to be pro-
grammed with a maximum care.

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

not really a calculation but an ‘intelligent guess’ - there is


P = .3125 x .300 = .09375 = .0938 = .094 not much done and extensive experience
else that can be
helps. This completes the section on tooling application for
For the through hole in the example, the drawing depth of
a typical hole and provides enough data to write the actual
1 .5 inches plus the calculated depth of .094 seems to be suf-
program. Some of the procedures used in the example will
ficient to drill the hole using the selected tap drill.
now be explained in more detail.
194 Chapter 26

Program Data Drilling one of the oldest operations in a typical ma-


is

chine shop. By definition, drilling


is a removal of solid ma-
In the example, only one hole is machined. If more holes
terial to form a circular hole of the same diameter as the
are needed, they can be added by modifying the following
cutting tool (drill). The material removal is achieved by ei-
program. For one hole used in the example, the program in-
ther rotating the drill (on milling systems) or by rotating the
cludes all considerations for the four tools selected earlier.
part itself (on turning systems). In either case, a vertical or
The spindle should be empty at the beginning of program:
horizontal machining application is possible. In a rather
loose sense of the word, drilling operations also cover the
02601 (SINGLE HOLE EXAMPLE)
(T01 - 5/8 DIA - 90 DEGREE SPOT DRILL) extended areas of reaming, tapping and single point boring.
N1 G20 Many programming principles that apply to drilling opera-
N2 G17 G40 G80 T01 tions, can be equally applied to all the related operations.
N3 MO 6
N4 G90 G54 GOO X3.5 Y5.0 S900 M03 T02 Types of Drilling Operations
N5 G43 Z0.1 HOI M08
N6 G99 G82 R0.1 Z-0.2338 P300 F4.0 The drilling operation is determined by either the type of
N7 G80 Z1.0 MO hole or the type of tool:
N8 G28 Z1.0 MO
N9 M01
By the type of tool By the type of hole :

(T02 - LETTER U DRILL - 0.368 DIA DRILL)


N10 T02 Center drill Through hole
Nil MO 6
Spot drill Chamfered hole
N12 G90 G54 GOO X3.5 Y5.0 SHOO M03 T03
N13 G43 Z0.1 HO 2 MO Twist drill (HSS, cobalt, etc.) Semi-blind hole
N14 G99 G83 R0.1 Z-1.086 QO 5 F8.0 .

N15 G80 Z1.0 MO Spade drill Blind hole


N16 G28 Z1.0 MO
Carbide indexable drill Premachined hole
N17 M01
Special drill ...
(T03 - 5/16 DRILL THROUGH - 0.3125 DIA)
N18 T03
N19 MO 6 Types of Drills
N20 G90 G54 GOO X3.5 Y5.0 S1150 M03
N21 G43 Z0.1 HO 3 M08 Drills are categorized by their design and by their size.
N22 G98 G81 R-0.986 Z-1.644 F8.0 The oldest and the most common design is a twist drill,
N23 G80 Z1.0 MO usually made of high speed can also be
steel. Twist drill
N24 G28 Z1.0 MO made of cobalt, carbide and other materials. Other drill de-
N25 M01 signs include spade drills, center drills, spot drills and in-
dexable insert drills. The distinction in size is not only be-
(T04 - 7/16-14 TAP)
tween metric and English drills, but also a finer distinction
N26 T04
N27 MO 6 within the category using English units. All metric drills
N28 G90 G54 GOO X3 . 5 Y5.0 S750 M03 T01 are designated in millimeters. Since the English (imperial)
N29 G43 Z0.4 H04 M08 dimensioning is based on inches (which is rather a large di-
N30 G99 G84 R0.4 Z-0.9 F53 57 (F = S x LEAD)
. mensional unit), finer distinctions are necessary. The inch
N31 G80 GOO Z1.0 MO dimensions of standard drills in English units are divided
N32 G28 Z1.0 M05 into three groups:
N33 GOO X-1.0 Y10.0 (PART CHANGE POSITION)
N34 M30 FRACTIONAL SIZES
%
1/64 minimum, in diameter increments of 1/64
This rather detailed example shows that even a simple
single hole requires a lot of thought and a great deal of pro-
NUMBER SIZES:

gramming and machining skills.


Drill size number 80 to drill size number 1

DRILLING OPERATIONS LETTER SIZES:

Drill size letter A to drill size letter Z


The example 02601 provides a good illustration of what
kind of programming and machining conditions are neces- Metric sizes do not need any special distinctions. For
sary for a typical hole. Next, let’s look at the details of drill- English sizes, a listing of the standard drills and their deci-
ing operations in general, as they relate to various tools. mal equivalents is available from many sources.
MACHINING HOLES 195

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.

Normally, the drill diameter is selected based on the infor-


mation in the drawing. If the drawing calls for a hole that Drill Point Length
needs only drilling and does not need any additional ma-
The second important consideration is the length of the
chining, the drill is a standard drill. Its diameter is equiva-
drill point. This length is very important to establish the
lent to the size specified in the drawing. A drill size of this
cutter depth for the full diameter. With the exception of a
kind is called a nominal or ‘off-the-shelf’ size.
fiatbottom drill, all twist drills have an angular point whose
Most applications involve holes that require other specifi- angle and length must be known in programming. The an-
cations in addition to their diameter - they include toler- gles are considerably standard and the length must be cal-
ances, surface finish, chamfer, concentricity, etc. In those culated rather than estimated, because of its importance to
cases, a single regular drill cannot be used alone and still the accurate hole depth - Figure 26-6.
satisfy all requirements. A nominal drill alone, even if the
size
to
is due
available, will not guarantee a high quality hole,
machining conditions. Choosing a multitool technique to
0D — 0D = Drill
diameter
machine such a hole is a better choice. The normal practice A—
in those cases is

hole diameter, then use one or


to use a drill size a bit smaller than the final

are capable of finishing the hole to the drawing specifica-


more additional tools, which < \
]
P
A = Tool point
angle

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

Effective Drill Diameter


On indexable insert drills this length is different, due to
In many cases, a drill
used to penetrate its full diameter
is the drill construction. The indexable drill is not and its
fiat
through the part. In many other cases, only a small portion drill point length must also be considered in programming.
of the drill end point is used - a portion of the angular drill A tooling catalogue shows the dimensions.
tip - Figure 26-5.
The drill point length can be found quite easily, providing
the diameter of the drill (nominal or effective) and the drill
NOMINAL point angle are known. From the following formula and the
DRILL DIAMETER table of constants, the required drill point length for stan-
dard drills can be calculated. Basic formula is:

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.

The most common constants are listed in this table:


Many programmers only estimate the depth of a center
drill, rather than calculate it. Perhaps a calculation is not
Tool Point Angle Exact Practical
necessary for a temporary operation. What is a reasonable
(degrees) Constant Constant (K)
compromise between guessing and calculating is a data ta-

.866025404 ble, similar to that in Figure 26-7.


60 .866

82 .575184204 .575
i "T
90 .500000000 .500
no
D2 / n m
D 1

\
118 .300430310 .300
r i.
f

120 .288675135 .289


- L
125 .260283525 .260
Number D1 D2 D L
130 .233153829 .230 # 1 0.125 0.047 0.100 0.106

135 .207106781 .207


#2 0.188 0.078 0.150 0.163
#3 0.250 0.110 0.200 0.219
140 .181985117 .180 #4 0.312 0.125 0.250 0.269

.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

value .300430310. The constant value has the advantage


is

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

1.25 + (.750 x .300) = 1.4750

In the part program, the block will be

N93 G01 Z-1.475 F6.0

or - in case of a fixed cycle,

N93 G99 G85 X5.75 Y8.125 R0.1 Z-1.475 F6 .

Metric holes are treated exactly the same way. For exam-
ple, a016 mm
drill is used to machine the full diameter

depth of 40 mm. The calculation uses the same constant as


for the size in English units:

40 + (16 x .300) = 44.8

The depth specified in the drawing will have to be ex-


tended by the calculated drill point length. The pro-

depth calculation data


Drill
grammed block will have the Z axis value equal to the total
Through hole (top) and Blind hole Ibottom of the 40 mm
specified depth, plus the 4.8 calculated mm
point length:

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.

Blind Hole Drilling Flat Bottom Drilling

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.

02602 (FLAT BOTTOM - 1)


As an example, if a standard 03/4 drill (0.750) is used to
N1 G21
drill a full diameter hole depth of 1.25 of an inch, the pro- N2 G17 G40 G80
grammed depth will be: N3 G90 G54 GOO X. Y. S850 M03 . .

N4 G43 Z2.5 H01 M08


198 Chapter 26

N5 GOl Z-25.0 F200.0 From the machining viewpoint, programming a center


N6 GO 4 X0.5
drill or a spot drill first to open up the hole may be a better
N7 GOO Z2.5 MO
choice. This extra operation will guarantee concentricity
N8 G28 Z3.0 M05
N9 M30 for both the standard drill and the flat bottom drill. Another

% possible improvement would be to use a suitable end mill


instead of a flat bottom drill. An end mill is usually more

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.

Indexable Insert Drilling


The next example shows a program for two tools - a 0 1/2
inch standard drill and a 01/2 inch flat bottom drill. The re- One of the great productivity improvement tools in mod-
quired finished depth is Z-0.95 at the flat bottom: ern machining is an indexable insert drill. This drill uses
carbide inserts, just like many other tools for milling or
02603 (FLAT BOTTOM - 2) turning. It is designed to drill holes in a solid material. It
(T01 - y, INCH STANDARD DRILL) does not require center drilling or spot drilling, it is used
N1 G20 with high spindle speeds and relatively slow feedrates and
N2 G17 G40 G80 T01
is available in a variety of sizes (English and metric). In
N3 MO 6
most cases, it is used for through holes, although blind
N4 G90 G54 GOO X. Y.. . S700 M03 T02
N5 G43 ZO.l HOI M08 holes can be drilled as well. This type of a drill can even be
N6 GOl Z-0.94 F9.0 used for some light to medium boring or facing.
N7 GOO ZO.l MO
N8 G28 ZO.l The design of the indexable insert drill is very precise,
N9 M01 assuring constant tool length, as well as elimination of
regrinding dull tools. Figure 26-9 shows the cutting portion
(T02 - V, INCH FLAT BOTTOM DRILL
/ END MILL) of a typical indexable drill.
N10 T02
Nil MO 6
N12
N13
G90 G54 GOO X. Y.
G43 ZO.l HO 2 M08
S700 M03 T01
. . r ^"7

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
,
© \\

N18 G28 ZO.l MO


N19 M30
% - D = DRILL DIAMETER
H
H = DRILL POINT LENGTH
There are three blocks of special interest in program
02603. The first block is N6, indicating the depth of the
Figure 26-9

standard drill. The drill stops short of the full depth by .010 Cutting end of a typical indexable insert drill

of an inch. Z-0.94 is programmed instead of the expected


Z-0.95. A little experiment as to how short may be worth it. D of the drill is the hole
In the illustration, the diameter

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

of any interrupted cut. The Figure 26-10 shows the areas


Cleanup of chips accumulated on the flutes of the drill
where the feedrate should be slower.
Frequent cooling and lubricating of the drill cutting edge

Controlling the drill penetration through the material

In all cases, the drilling motions of the G83 or G73 cycle


produce an interrupted cut that can be programmed very
simply by specifying the Q address value in the cycle. This
value specifies the actual depth of each peck. The smaller
the Q value, the more pecks will be generated and vice
versa. For most deep hole drilling jobs, the exact number of
pecks is not important, but there are cases when the peck-
ing cycle needs to be controlled.

Typical Peck Drilling Application

For the majority of peck drilling applications, the peck


drillingdepth Q needs to be only a reasonable depth. For
example, a deep hole (with the depth at Z-2.125 inches at
the tool tip) is drilled with a .250 diameter drill and .600
Uneven entry or exit surface for indexable drills feedrate: peck depth. The G83 cycle may be programmed like this:
F = normal feedrate, F/2 = reduced feedrate (one half of F)
N137 G99 G83 X.. Y. . RO 1 Z-2.125 QO
. . 6 F8.0
In the illustration, the letter F identifies the area that is cut
with the normal feedrate (normal entry/exit), and the F/2 These programming values are reasonable for the job at
indicates the area that requires a reduced feedrate. For the hand - and that is all that matters. For most jobs, the number
reduced feedrate, programming one half of the normal of pecks is usually not too important.
feedrate is sufficient.
Calculating the Number of Pecks
a shows a tilted surface entry
In the illustration, the frame
(inclined surface), the b frame shows an uneven surface, If the number of pecks the G83/G73 cycle will generate is
and the frames c and d show convex and concave surfaces important, it has to be calculated. The knowledge of how

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.

Q divided into the travel distance is the number of pecks:


200 Chapter 26

The result of .339/3 is .446333333 - a number that has to


1

be rounded to the maximum of four decimal places (Eng-


lish units). Mathematically correct rounding to four deci-

mal places will be .4463. Follow individual peck depths to


n5g= where ...
see what will happen:

Peck 1 .4463 accumulated depth ... .4463


P„ = Number of pecks Peck 2 .4463 accumulated depth ... .8926
Td = Total tool travel distance Peck 3 .4463 accumulated depth ... 1.3389
Q = Programmed peck depth Peck 4 .0001 accumulated depth ... 1.3390

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

the total drill travel distance


calculated Q value upwards in this case to the minimum of
,

is 1.350, divided by .500, .4464 or even to .447:


which yields Since the number of pecks can only be
2.7.
positive, the nearest higher integer will
be the actual N14 G99 G83 X.. Y. . R0.1 Z-1.239 Q0.447 F12 .

number of pecks, in this case 3.


Always remember, the cutting tool will never go past the
Selecting the Number of Pecks programmed Z depth, but it could reach this depth in a very
inefficient way that should be corrected.
Much more common is the programming of a desired
number of pecks. If only a certain number of pecks will do
Controlling Breakthrough Depth
the job in the most efficient way, the Q value has to be cal-
culated accordingly. Since the Q value specifies the depth Less frequent programming method, also very powerful,
of each peck and not the number of pecks, some simple isto use the peck drilling cycle to control the breakthrough
math will be needed to select the depth Q, so it corresponds of the drill through the material, regardless of the drill size
to the desired number of pecks. or material thickness. Here is some background. In many

tough materials, when the drill starts penetrating the bot-


For example - we require 3 pecks in the following cycle -
tom of the part (for a through hole), it creates potentially
what will the Q depth be?
difficult machining conditions. The drill has the tendency
to push the material out rather than cut it. This is most com-
N14 G99 G83 X,. Y. . R0 1 Z-1.238 Q.
. . F12 .
mon when the drill is a little dull, the material is tough, or
The from the R level to the Z depth is
total drill travel
the feedrate is fairly high. These adverse conditions are also
1.338. To calculate the peck depth the result of heat generated at the drill edge, the lack of lu-
Q value, the new for- brication reaching the drill cutting edge, worn-off flutes
mula is similar to the previous one:
and several other factors.

The possible solution to this problem is to relieve the drill


pressure when it is about half way through the hole, but not
completely through - Figure 26-11.

eg* where ...

Q = Programmed peck depth


Td = Total tool travel distance
P„ = Number of required pecks

Using the above formula, the result of 1.338/3 is .446.


Therefore, G83 block Q depth will be Q0.446:

N14 G99 G83 X.. Y. . R0 1 Z-1.238 Q0.446 F12


. .

No rounding
is necessary in this case. Now, let’s have a

close look another situation, where the travel distance


at
has changed very slightly:

N14 G99 G83 X.. Y. . R0.1 Z-1.239 Q. . F12 .

Controlled breakthrough of a hole using G83 peck drilling cycle


MACHINING HOLES 201

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.

The reamer size is always important. Reamers are often


made to produce either a press fit or a slip fit. These terms
are nothing more than machine shop expressions for cer-
tain tolerance ranges applied to the reamed hole.

Programming a reamer requires a fixed cycle. Which cy- &XJ*.


most suitable? There is no reaming cycle de-
cle will be the
D = EFFECTIVE
fined directly. Thinking about the traditional machining ap- - D — BORE DIAMETER
plications, the most accepted reaming method is the feed-in
and feed-out method. This method requires a feedrate mo-
Figure 26-12
tion to remove the material from the hole, but it also re-
Effective diameter of a single point boring tool
quires a feedrate motion back to the starting position, to
maintain the hole quality - its size and surface finish. It may
The same programming techniques are applied to the
be tempting to program a rapid motion out of a reamed hole
to save cycle time, but often at the cost of quality. For the
boring bars of other designs, for example, a block tool. A
block tool is a boring bar with two cutting edges, 180°
best machining, the feed-out of the reamed hole is neces-
apart. If the adjusting mechanism for the diameter is not
sary. Suitable fixed cycle available for the Fanuc controls is
available on the tool holder, the effective boring diameter
G85, which permits feed-in and feed-out motions. The cut-
must be preset, using either a special equipment, or the
ting feedrate of the cycle will be the same for both motions.
slow but true and tried trial-and-error method. This trial
Any feedrate change will affect both motions - in and out.
and error setup is not that unusual, considering the setup
methods that are available for a single point boring bar.
MACHINING HOLES 203

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

more. Block tools are generally available in diameters from


about 0.750 inch and up.

BORING WITH A TOOL SHIFT

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.

Precision Boring Cycle G76

The G76 cycle is used for holes requiring a high quality


Figure 26-13 of the size and surface finish. The boring itself is normal,
Single point boring bar and the spindle orientation angle however, the retract from the hole is special. The boring bar
stops at the bottom of the hole in an oriented position, shifts
Spindle orientation is factory designed and fixed. Pro- away by the Q value in the cycle and retracts back to the
grammer considers its length and, usually, its direction. starting position, where it shifts back to its normal position.
204 Chapter 26

The G76 cycle has been described in detail in the previ-


ous chapter. In this chapter is an actual programming ex-
ample, shown as a single hole in Figure 26-14 - 025 mm.

Figure 26-15

Setup considerations for a backboring tool

Drawing for G76 and G87 programming example - program 02604


Programming Example
From the drawing, only the 25 mm hole is considered,
and the program input will be quite simple: In order to show a complete program, four tools will be
used - spot drill (T01), drill (T02), standard boring bar
N.. G99 G76 X0 YO R2.0 Z-31.0 Q0.3 F125.0 (T03) and a back boring bar (T04). Program is 02604.

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,

plus the standard minimum Q value (0.3 mm)


Always watch for the body of the boring bar, so itdoes
not hit the hole surface during the shift. This can happen
with large boring bars, small holes, or a large shift amount.

Always watch the body of the boring bar. so it does not


hit an obstacle below the part. Remember that the tool
length offset is measured to the cutting edge, not to the
actual bottom of the boring tool.

G87 is always programmed in G98 mode,


never in G99 mode !!!

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:

Spotfacing SF, S.F., or S/F on drawings .78 DIA CSINK - 82 DEG


13/32 DRILL THRU
All three machining methods will enlarge an existing
hole, with one common purpose - they will allow the fitting
206 Chapter 26

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:

Figure 26-17 illustrates an example of a countersink re-


e = . 1875 x. 575 (K for 82° = .575)
quirement, shown in a typical drawing. e = .1078

The Z depth for a tool with a sharp end will be:

Z depth = .78 x .575 = .4485

Since that depth includes the height of sharp end, all that

has to be done to find out the Z depth, is to subtract the e


value from the theoretical Z depth:

Z depth = .4485 - .1078 = .3407

This is the programmed Z depth and the program block


for the countersink in the drawing may look something like
this:

N35 G99 G82 X0.75 Y0.625 R0.1 Z-0.3407 P200 F8.0

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

N34 G43 Z0.1 H03 M08 (0.1 IS INITIAL LEVEL)


N35 G98 G82 X0.75 Y0.625 R-0.2 Z-0.3407 P200 F8.0

DO NOT make the R value too deep !

Counterboring

Counterboring is an operation that enlarges an existing


hole in a cylindrical shape to the required depth. Counter-
boring used for holes that have to accommodate a round
is

bolt head. It is often used on uneven or rough surfaces, or

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

are no extra calculations required. Figure 26-19 shows a


Data required for calculating the 1 depth of a countersink, typical counterboring description.
for given diameters D and F and the angle A
MACHINING HOLES 207

Handling programming problem is not difficult, once


this

The options are two


the available options are evaluated.
preparatory commands - G98 and G99, used with fixed cy-
cles exclusively. Recall that the G98 command will cause
the cutting tool to return to the initial level, the G99 com-
mand will cause the cutting tool to return to the R level. In
practical programming, the G98 command is used only in
cases where an obstacle between holes has to be bypassed.

Programming example of a counterboring operation

For the example, the 01/2 inch hole had been machined
earlier. The program block will be quite simple:

N41 G99 G82 X.. Y. . R0 1 Z-0.25 P300 F5.0


.

if a relatively slow spindle speed and


In counterboring,
fairlyheavy feedrates are used, make sure the dwell time P
in G82 cycle is sufficient. The rule of thumb is to program
the double value or higher of the calculated minimum
dwell. Minimum dwell Dm is:

Tool motion direction between holes at different heights

60
Figure 26-20 illustrates two programming possibilities,
r/ min
in a symbolic representation. Tlie front view of a stepped

part shows the direction of tool motion between holes. On


For example, if the spindle speed is programmed as 600 the left, the motion from one hole to the next could cause a
r/min, the minimum dwell
will be 60/600=0. and doubled 1 ,
collision with the wall and G98 is required for safety. On
to 0.2 in theprogram, as P200. Doubling the minimum the right, with no obstacles, G98 not required and G99
is ,

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.

Many programmers choose to use a slightly longer dwell


time, for more than one or two revolutions at the bottom.
A practical example of this technique is illustrated in Fig-
ure 26 21 and program 02605.

Spotfacing

Spotfacingis virtually identical to counterboring, except

that the depth of cut is very minimal. Often, spotfacing is


called shallow counterboring. Its purpose is to remove just
enough material to provide a flat surface for a head of a
bolt, a washer, or a nut. Programming technique is exactly
the same as that for counterboring.

MULTILEVEL DRILLING

On many occasions, the same cutting tool will have to be


programmed to move up and down between different
heights (steps on a part). For example, a drill will cut holes
that have the same depth, but start at different heights.

This kind of programming requires two major conditions


-the tool should be programmed efficiently (no time loss)
and must be programmed safely (no collision).
Multilevel drilling - programming example 02605
208 Chapter 26

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-

N1 G20 ciently. It would be easy program one motion through all


to

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
.

N12 G98 YO 375 .

N13 G99 XI. 6875 R0.1 Z-0.108


N14 YO .75
N15 Yl. 625
N16 X2.4375 Y1.125 R-0.3 Z-0.508
N17 YO 375
.

N18 G80 Z1.0 MO


N19 G28 Z1.0 MO 5
N20 M01

(T02 - 3/16 DRILL THRU)


N21 T02 Tool point length = 0.075 Clearance = 0.05
N22 MO
N23 G90 G54 GOO X2.4375 Y0.375 S1000 M03 T01 Figure 26-22
N24 G43 Z1.0 H02 M08 Web drilling example Ifront view) - program 02606
N25 G99 G83 R-0.3 Z-1.106 Q0.35 F10.0
N26 G98 Yl 125 .
In the program, X1.0Y1.5 is used as the hole position.
N27 G99 XI. 6875 Y1.625 RO.l Drawing will not show the R levels or Z depths, they have
N28 YO .75 example, clearances above and be-
to be calculated. In the
N29 YO 375
.
low each plate are .05, except the first R level (RO. 1). The
N30 X0.875 R-0.05
length of the 01/4 drill point is .3 x .25 = .075.
N31 Yl 125.

N32 Yl. 625


N33 X0.25 R-0.4 02606 (WEB DRILLING)
N34 Yl. 125 (T01 - 90-DEG SPOT DRILL - 0.5 DIA)
N35 YO 75 .
N1 G20
N36 YO 375.
N2 G17 G40 G80 T01
N37 G80 Z1.0 MO N3 MO 6
N38 G28 Z1.0 M05 N4 G90 G54 GOO XI. 0 Y1.5 S900 M03 T02
N39 GOO X-2.0 Y10.0 N5 G43 Z1.0 HOI M08
N40 M30 N6 G99 G82 RO.l Z-0.14 P250 F7.0
% N7 G80 Z1.0 MO
N8 G28 Z1.0 MO
Study the program in detail. Watch the direction of tools - N9 M01
T01 starts at the lower left hole and ends at the lower right
(T02 - 1/4 DIA DRILL)
hole, in a zigzag motion. T02 starts at the lower right hole
N10 T02
and ends at the lower left hole, also in a zigzag motion.
Nil MO
Note there are more G98 or G99 changes for the first tool N12 G90 G54 GOO XI. 0 Y1.5 SHOO M03 T01
than the second tool. In multilevel hole machining under- N13 G43 Z1.0 HO 2 MO
stand three areas of program control, used in 02605: N14 G99 G81 RO.l Z-0.375 F6.0 (TOP PLATE)
N15 R-0.7 Z-1.25 (MIDDLE PLATE)
G98 and G99 control N16 G98 R-1.575 Z-2.0 (BOTTOM PLATE)
N17 G80 Z1.0 MO
R level control
N18 G28 Z1.0 MO
Z depth control N19 M30
%
MACHINING HOLES 209

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

The quality of the tapped hole is also important, but it is


The following example shows that programming a tap- not influenced solely by the correct selection of speeds and
ping for one hole is similar to other fixed cycles. All the feeds, but by several other factors as well. The material of
tool motions, including spindle stop and reversal at the hole the tap, itscoating, its geometry, the flute clearances, the
bottom are included in the fixed cycle: helix configuration, the type of the start-up chamfer, the
material being cut - and the tap holder itself - all have a very
profound effect on the final quality of the tapped hole. For
N64 G90 G54 GOO X3.5 Y7..125 S600 M0 3 T06
best results in tapping, a floating tap holder is mandatory,
N65 G43 Z1.0 HO 5 M0
unless the CNC machine supports rigid tapping. The float-
N66 G99 G84 R0.4 Z-0..84 F30.0
N67 G80 . . .
ing tap holder design gives the tap a ‘feel’, similar to the
feel that is needed for manual tapping. A floating tap holder

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

intentionally. command and block-by-block method.


210 Chapter 26

CNC lathe tapping is different but not mop; difficult than


tapping forCNC machining centers. Because does not it

use fixed cycles, programmers make some common errors.


This chapter uses examples for tapping on CNC lathes in a
sufficient depth.

Tap Geometry

There are literally dozens of tap designs used in various


CNC programming applications. A whole book would eas-
ily be filled just on the topic of tapping tools and their appli-

cations. For CNC programming, only the core basics of tap


geometry are important.

There are two considerations in tap design that directly


influence the programming and the data input values:
Typical tap end - chamfer geometry configuration

Tap flute geometry


The major difference between the taps is the length of the
Tap chamfer geometry
tap chamfer. Figure 26-23 shows how the characteristics of
Tap Flute Geometry the drilled hole will influence programmed depth of the se-
lected tap.
The flute geometry of a tap is described in tooling cata-
logues in terms such as ‘low helix’, ‘high helix’, ‘spiral The tap chamfer length c measured as the number of
is

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

most likely break in the part.


os? where ...

F, = Feedrate per time (per minute) Pipe Taps


r/min = Spindle speed
= Pipe taps are similar in design to standard taps. They be-
TPI Number of threads per inch
long to two groups:
A similar formula will produce an identical result:
Taper taps NPT and API
Straight taps (parallel) NPS
F t
= r/min x F r

Their size designation (nominal size), is not the size of


i@- where ... the tap, but the size of the pipe fitting. American National
Standard pipe taper (NPT) has a taper ratio of 1 to 1 6, or
F, = Feedrate per time (per minute) 3/4 inch per foot ( 1 .78991061° per side) and the tap cham-
r/min = Spindle speed fer is 2 to 3-1/2 threads.
F, = Feedrate per revolution
Programming for pipe taps follows the usual considera-
For example, a 20 TPI thread lead for a mill will be: tions for standard threads. The only common difficulty is
how to calculate the Z depth position at least as a reason-
1 / 20 = .0500 inches able one,if not exactly. The final depth may be a subject of

some experimentation with a particular tap holder and typi-


and the programmed feedrate has to take into considera-
cal materials.
tion themachine spindle speed, for example, 450 r/min:
A proper tap drill size is very important. It will be differ
F = 450 x .05 = 22.5 = F22.5 (in/min) ent for tap holes that are only drilled and for tap holes that
are drilled and reamed (using a 3/4 per foot taper reamer).
A same logic. For example,
metric tap on a lathe uses the
a tap of .5 mm lead (pitch) using 500 r/min is programmed
1 The following is a table of taper pipe thread sizes for NPT
with the feedrate of 750 mm/min: group and recommended tap drills, data that is useful for
CNC programming:
F = 500 x 1.5 = 750.00 = F750.0 (mm/min)
NPT Group Drilled Only Taper Reamed
The key to successful tapping is to maintain the relation-
ship of the tap lead and the spindle speed. If the spindle
Pipe Tap Dec. Tap Dec.
speed changed, the feedrate per time ( in/min or mm/min)
is TPI
Size Drill Size Drill Size
must be changed as well. For many tension-compression
type tap holders, adjustment of the feedrate downwards (so 1/16 27 D .2460 15/64 .2344
called underfeed) by about five percent may yield better
results. because the tension of the tapping holder
This is is
1/8 27 Q .3320 21/64 .3281

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

1- 1/4 11 - 1/2 1 - 31/64 1.4844 1 - 15/32 1.4688


In the program, the new tapping feedrate will be:
1 - 1/2 11 1/2
- 1 -47/64 1.7344 1 - 23/32 1.7188
F = 27.5 - 5% = 26.125
2.0 11 -
1/2 2 -1
3/64 2.2031 2 - 3/16 2.1875
212 Chapter 26

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

3/8 18 37/64 .5781


The rigid tapping mode must be supported by
/> 14 23/32 .7188 the CNC machine before it can be used in a program

3/4 14 59/64 .9219

1.0 11 - 1/2 1 - 5/32 1.1563 HOLE OPERATIONS ON A LATHE


1 - 1/4 11 - 1/2 1 - 1/2 1 .5000
Single point hole operations on a CNC lathe are much
1 -
1/2 11 1/2
- 1 - 3/4 1.7500
more limited than those on a CNC machining center. First,
2.0 11 - 1/2 2 - 7/32 2.2188 the number of holes that can be drilled or tapped in a single
operation on a lathe is only one per part operation (two are
The tapping feedrate maintains the same relationships for rare), while the number of holes for a milling application
pipe taps as for standard taps. may be hundreds and even thousands. Second, the
in tens,

boring (internal turning) on a lathe is a contouring opera-


Tapping Check List tion, unlike boring on a milling machine, which is a point-
to-point operation.
When programming a tapping operation, make sure the
program data reflect the true machining conditions. They All the point-to-point machining operations on a CNC
may vary between setups, but the majority of them are typi- can be machined with the cut-
lathe are limited to those that
cal to any tapping operations on any type of CNC machine. ting tool positioned at the spindle centerline. Typically,
Here is a short list of items that relate directly to the tapping these operations include center drilling, standard drilling,
operations in CNC programming. reaming and tapping. A variety of other cutting tools may
also be used, for example, a center cutting end mill (slot
Tap cutting edges (have to be sharp and properly ground)
drill) to open up a hole or to make a flat bottom hole. An in-
Tap design (has to match the hole being tapped) ternal burnishing tool may also be used for operations such
as precise sizing of a hole, etc. To a lesser degree, other op-
Tap alignment (has to be aligned with tapped hole)
erations, such as counterboring and countersinking may be
Tap spindle speed programmed at the lathe spindle centerline, with a special
(has to be reasonable for the cutting conditions) point-to-point tool - not a contouring tool. All operations in

Tap feedrate (has to be related to the tap lead and


thisgroup will have one common denominator - they are all
used at the spindle centerline and programmed with the X
the machine spindle speed)
position as XO in the program block.
Part setup
(rigidity of the machine setup and the tool is important) The spindle speed for all centerline operations on a CNC
lathe must be programmed in actual revolutions per minute
Drilled hole must be premachined correctly
important) ( r/min ), not in the constant surface speed mode (CSS). For
(tap drill size is
that reason, G97 is used - for example,
Clearance for the tap start position
(allow clearance for acceleration) G97 S575 MO
Cutting fluid selection
will assure the required 575 r/min at the normal spindle
Clearance at the hole bottom rotation (at 100% spindle speed override).
(the depth of thread must be guaranteed)
What will happen if CSS mode is used with G96 com-
Tap holder torque adjustment (ease of cutting)
mand, rather than the proper G97 command? The CNC
Program integrity (no errors) system will use the given information, the spindle speed
address S, in the program (given in peripheral - or surface -

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 . .

of the mathematical laws), it will do the exact opposite (be-


cause of the control design). Spindle speed will reach the This programming method splits the tool approach along
maximum r/min that the current gear range will allow. Be the Z axis into two tool positions - one is the safe clearance
very careful here - make sure that the centerline operations for approach, the other one is the safe clearance position for
on a CNC lathe are always done in the G97 (r/min) mode the drill start.There is a minor alternative to this motion -
and not in the G96 mode (CSS) mode. the last Z axis approach will be at a cutting feedrate, rather
than at a rapid motion rate:
Tool Approach Motion
N36 T0200 M42
A typical geometry offset configuration setup (or the G50 N37 G97 S700 M03
values) on a CNC lathe often have a relatively large X value N38 GOO XO Z0.5 T0202 M08
and relatively small Z value. For example, the geometry N39 G01 Z0.1 F0.05
offset for a tool may be X-l 1.8Z-1.0 (or G50X1 1.8Z1.0).
N40 . .

This location indicates a suitable tool change position ap-


For the last approach motion, the Z axis motion has been
plicable to a drill. What does it mean to the tool motion for
changed to a linear motion, with a relatively high feedrate
a drilling operation?
of .05 in/rev (1 .25 mm/rev). Feedrate override can be used
It means that the rapid motion will complete the Z axis for setup, to control the rate of the feed. During actual pro-

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

The same logical rules of motion in space that apply to


N36 T0200 M42
the tool approach, apply also to the tool return motion. Re-
N37 G97 S700 M03
N38 GOO X0 Z0.1 T0202 M08 member that the first motion from a hole must always be
N39 . . . along the Z axis:
To avoid a potential collision during the tool approach to-
wards the part, use one of the following methods: N40 G01 Z-0.8563 F0.007
N41 GOO Z0.1
Move the X axis first to the spindle centerline,
then the Z axis, directly to the start location
for the drilling In block N40, the actual drill cutting motion takes place.

Move the Z axis first to a clear position,


When the cut is completed, block N4I is executed. The
then the X axis to the spindle centerline,
drill will rapid out of the hole to the same position it started

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

Once of ihe hole, it has lo re-


the culling lool is safely out Peck Drilling Cycle - G74
turn to the tool changing position. There are two methods:
On Fanuc
and compatible controls, there is a multiple re-
Simultaneous motion of both axes G74 available, that can be used for two differ-
petitive cycle
ent machining operations:
Single axis at a time
Simple roughing with chip breaking
Simultaneous motion of the X and Z axes does not pres-
ent the same problem as it did on the approach - on the con- Peck drilling (deep hole drilling)

trary. The Z axis will complete the motion first, moving


In this section, the peck drilling usage of the G74 cycle is
away from the part face. Also, there is no reason to fear a
described. The roughing application of the G74 cycle is a
collision during a return motion if the approach motion was
contouring operation and is very seldom used.
successful and the programming style was consistent:
In peck drilling, just like in any ordinary drilling, select
the spindle speeds and cutting feedrates first, then deter-
N70 G01 Z-0.8563 F0.007 mine and finally, its depth posi-
the hole starting position
N71 GOO Z0.1
tion. In addition, establish (or even calculate) the depth of
N72 X11.0 Z2.0 T0200 M09
each peck. The lathe cycle G74 is rather limited in what it
can do, but it has its uses. Its format for peck-drilling is:
If in doubt, or if an obstacle is expected to be in the way of
a tool motion, for example a tailstock, program a single G74 X0 Z. . K.
axis at a time. In most cases, that will move the positive X
axis first, as most obstacles would be to the right of the part:
cs3 where ...

G74 = Peck drilling cycle selection


XO = Indicates cutting on centerline
N70 G01 Z-0.8563 F0.007
N71 GOO Z0.1 Z = Specifies the end point for drilling

N72 X12.0 K = Depth of each peck (always positive)


N73 Z2.0 T0200 M09
The following program uses illustration in Figure 26-24,
and shows an example of drilling a 3/16 hole (0.1875)
The programming example illustrates the return motion with a peck drill depth of .300 inches:
with theX axis programmed first. The fact that the tool is
.100 off the front face is irrelevant - after all, the tool started
N85 T0400 M42
cutting from that distance without a problem.
N86 G97 S1200 M03
Other, less traditional, methods for the tool motion
N87 GOO XO Z0.2 T0404 M08
to-
N88 G74 XO Z-0.8563 K0.3 F0.007
wards and away from the part are also possible.
N89 GOO X12.0 Z2.0 T0400 M09
N90 M01
Drilling and Reaming on Lathes

Drilling on a CNC lathe is also quite common operation,


mainly as means for a hole opening to be used with other
tools, such as boring bars. There are three basic kinds of
drilling, typical to a CNC lathe machining:

Center drilling and spotfacing

Drilling with a twist drill

Indexable insert drilling

Each method follows the same programming techniques


as those described in the milling section earlier, except that
there are no fixed cycles of the milling type used for the
lathe work. Keep in mind that on a CNC lathe, the part is
rotating, whereby the cutting tool remains stationary. Also Sample hole for the peck drilling lathe example
keep in mind that most lathe operations take place in a hori-
zontal orientation, causing concerns about coolant direc- The peck drilling motion will start from the Z0.2 position

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

Z-0.4 pression features, known as the tap floating holder. Never


Z-0.7 use a drill chuck or a similar solid device - it will break the
Z-0.8563 tap quickly and possibly damage the part as well.

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.

Translated into a CNC program carefully, this step by


Tapping on Lathes step procedure can be used in everyday programming as a
Tapping on CNC lathes is a common operation that fol-
general guide to tapping on CNC lathes.

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) ,

the feedrate override willbe ineffective by default (auto-


matically). The second problem will be solved if the spin-
N42 M01 dle M functions are programmed in the same block as the
tool motion. That means joining the block N46 with N47,
(T03 - 9/16-12 PLUG TAP) and block N48 with N49. This much improved version of
N43 T0300 M42 the tapping example is in the new program 02608.
N44 G97 S450 M03
N45 GOO XO Z0.5 M08 T0303 02608 (TAPPING ON LATHES)
N46 G01 Z-0.875 F0.0833 (PRACTICALLY CORRECT VERSION)
N47 MO
N48 MO 4 (T02 - TAP DRILL 31/64)
N49 Z0.5
N50 MO 5
N51 GOO X12.0 Z2.0 T0300 M09 N42 M01
N52 M30
% (T03 - 9/16-12 PLUG TAP)
N43 T0300 M42
A program 02607 does not show that
brief look at the N44 G97 S450 M03
anything wrong. After all, the program covers all the nec-
is N45 GOO XO Z0.5 M08 T0303
essary motions and is, therefore, correct. Yet, this program N46 G32 Z-0.875 F0.0833 M05
contains major flaws N47 Z0.5 MO
N48 MO 5
All earlier tapping steps have been carefully followed. N49 GOO X12.0 Z2.0 T0300 M09
Conducting a more in-depth study of the program will re- N50 M30
veal two areas of potential difficulty or even danger. The %
first problem may arise if the feedrate override setting
The block (N48 in the example) containing the spindle
switch is not set to 100%. Remember, the tapping feedrate
is always equal to the thread lead (F0.0833 is the feedrate
stop function M05, is not required if the tap is the last tool
in the program, although it does no harm in any other pro-
for 2 TPI). If the override switch is set to any other value
1

gram. Compare this program 02608 with program 02607.


but 100%, the thread will be stripped at best and the tap
broken at worst with related part damage.
Program 02608 is a great deal more stable and the possibil-
ity of any significant problem is virtually eliminated.
The other problem become evident only in a single
will
block mode run, during setup or machining. Look at blocks Other Operations
N46 and N47. In the N46 block, tap reaches the 7, axis end
position - while the spindle is still rotating! True, the spin-
There are many other programming variations relating to
machining holes on CNC machining centers and lathes.
dle will be stopped in block N47, but in the single block
This chapter has covered some of the most important and
mode it will be too late. A similar situation will happen dur-
the most common possibilities.
ing the feed-out motion. The spindle reverses in block N48,
but does not move until the N49 block is processed. There- Some less common applications, such as machining op-
fore, the program 02607 is a very poor example of tapping
erations using tools for backboring, or block boring tools,
on CNC lathes.
tools with multiple cutting
edges and other special tools for
machining holes may be quite infrequent in programming.
These are some details usually not considered for a fixed
However, programming these unusual operations is no
cycle application (such as the G84 tapping cycle), when
more difficult then programming the ordinary everyday
used for milling programs. For milling, all tool motions are
tool motions, using ordinary everyday tools.
built-in, so they are contained within the fixed cycle. To
eliminate the first potential problem of the feedrate over- The real ability of a CNC programmer is measured in
ride, programming the M48/M49 functions will tempo-
terms of applying the past knowledge and experience to a
rarily disable the feedrate override switch. Even way
better new problem. It requires a thinking process and it required
is to replace the feed-in and feed-out tap motion command a degree of ingenuity and hard work.
from the current G01 mode to G32 mode (G33 on some
27 PATTERN OF HOLES

In (he point-to-point machining operations, consisting of Grid pattern

drilling, reaming, tapping, boring, etc., we are often re-


Arc pattern
quired to machine either a single hole or a series of holes
with the same tool, usually followed by other tools. In prac- Bolt circle pattern

tice, several holes are much more common than a single


Some groups may be divided further into smaller sub-
hole. Machining several holes with the same tool means
machining a pattern of holes or a hole pattern. An English
groups. Athorough understanding of each pattern group
should help you to program any similar hole pattern.
dictionary defines the word ‘pattern' as a ‘characteristic or
consistent arrangement or design Translated to the hole
’.

There are several control systems available that have a


machining terms, any two or more holes machined with the built-in hole pattern programming, for example for a bolt
same tool establish a pattern. The desired hole pattern is
circle pattern. These programming routines simplify the
laid out in the part drawing either randomly (characteristic hole pattern programming quite substantially, but the pro-
arrangement or design) or in a certain order ( consistent ar- gram structure is usually unique to that particular brand of
rangement or design). Dimensioning of a hole pattern fol- control and cannot be applied to other controls.
lows standard dimensioning practices.

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.

From the dictionary definition above, we have to estab-

lish what makes a hole pattern characteristic or consistent.


Simply, any series of holes that are machined with the same
tool, one hole after another, usually in the order of conven-
ience. That means all holes within a single pattern have the
same nominal diameter. It also means that all machining
must start at the same R level and end at the same Z depth.
Overall, it means that all holes within a pattern are ma-
chined the same way for any single tool.

TYPICAL HOLE PATTERNS

Hole patterns can be categorized into several typical


groups, each group having the same character. Every hole
pattern encountered in CNC programming belongs into
one of the following pattern groups: Random pattern of holes - program example 02701

Random pattern
There are no special time saving techniques used in pro-

Straight row pattern gramming a random only a selected fixed cycle


pattern -

used at individual hole locations. All XY coordinates


Angular row pattern
within the hole pattern have to be programmed manually;
Corner pattern the control system features will be no help here at all:

217
218 Chapter 27

02701 (RANDOM HOLE PATTERN) Two program 02702 should be emphasized.


features of
N1 G20 In block N6, the dimensioning mode was changed from the
N2 G17 G40 G80
absolute G90 to the incremental G9 to take advantage of 1 ,

N3 G90 G54 GOO XI. 4 Y0.8 S900 M03


the equal pitch distance. When all ten holes have been ma-
N4 G43 Z1.0 HOI M08
chined, the program has to include return to the machine
N5 G99 G81 RO 1 Z-0.163 F3. .

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.

ANGULAR ROW HOLE PATTERN

Pattern of holes in a row at an angle is a variation of a


straight line pattern. The difference between the two is that
the incremental pitch applies to both X and Y axes. A hole
pattern of this type will be established on the part drawing
as one of the two possible dimensioning methods:

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

N3 G90 G54 GOO XI. 18 YO 6 S900 M03 .


delta Y is measured along the Y axis). Such a calculation
N4 G43 Z1.0 HOI M08 can be done in two equally accurate ways.
N5 G99 G81 RO 1 Z-0.163 F3.0
.

N6 G91 X0.95 L9 The first calculation method can use a trigonometric


N7 G80 MO method, but it is much easier to use the ratio of sides in-
N8 G28 ZO MO stead. In the Figure 27-3 the pattern length along the
, X
N9 G28 XO YO axis is 10.82 and along the Y axis it is 2.0:
N10 M30 (2.625 - .625 = 2.0)
%
PATTERN OF HOLES 219

N7 G80 M0 9
N8 G28 Z0 M0
N9 G28 X0 Y0
N10 M30
%

Note program structure is identical to the exam-


that the
row pattern, except the incremental move
ple of the straight
with L5 (K5) address is along two axes instead of one.

Pattern Defined by Angle

An angular line pattemcan also be defined in the drawing


Angular hole pattern with two sets of coordinates - program 02703 by the X and Y coordinates^ the first hole, the number of
equally spaced holes, the distance between holes and the
Pattern of this kind has all the holes spaced by equal dis- angle of pattern inclination - Figure 27-4.
tances along X and Y axes. As all holes are equally spaced,
the ratio of the sides for individual holes is identical to the
ratio of the whole pattern. When expressed mathematically,
the increment between holes along the X axis is equal to the
overall distance of 10.82 divided by the number of X axis
spaces; the increment along the Y axis is equal to the over-
all distance of 2.0 divided by the number of Y axis spaces.

The number of spaces for a six hole pattern is five, so the X


axis increment (the delta X) is:

10.82 / 5 = 2.1640

and the Y axis increment (the delta Y) is:

2.0 / 5 = .4 Figure 27-4

Angular hole pattern with coordinates, pitch and angle - 02704


The other calculation method uses trigonometric func-
tions, which may also be used as a confirmation of the first In order to calculate the X and Y coordinate values, use
method, and vice versa. Both results must be identical, or trigonometric functions in this case:

there is a mistake somewhere in the calculation. First, es-


tablish some temporary values: X = 4.0 x cosl5 = 3.863703305
Y = 4.0 x sinl5 = 1.03527618
A = tan’ 1 (2.0 / 10.82) = 10.47251349°
Program can be written after you round off the calculated
C = 2.0 / sinA = 11.00329063 values - program 02704:

Cl = C / 5 = 2.20065813 02704 (ANGULAR RCW 2)


N1 G20
Now, the actual increment along the two axes can be cal- N2 G17 G40 G80
culated, using C 1 dimension as the distance between holes: N3 G90 G54 GOO X2.0 Y2 0 S900 M03 .

N4 G43 Z1.0 HOI M08


Cl x cosA = 2.1640 N5 G99 G81 R0.1 Z-0.163 F3.0
X increment =
N6 G91 X3.8637 Y1.0353 L6 (K6)
Y increment = Cl x sinA = .4000
N7 G80 MO
N8 G28 ZO MO 5
The calculated increments match in both methods, calcu- N9 G28 XO YO
lationis correct, and can now be used to write the program
N10 M30
(02703) - block N6 contains the values: %

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 .

N6 G91 X2.164 Y0.4 L5 (K5)


220 Chapter 27

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

normal solution is to move the tool to the first position, call


Find the absolute coordinates XY of the last hole: the required cycle and remain within that cycle:

X = 2.0 + (4.0 x 6 x cosl5) 02705 (CORNER PATTERN)


= 25.18221983 = X25.1822 N1 G20
N2 G17 G40 G80
Y = 2.0+(4.0x6x sinl5) N3 G90 G54 GOO X2.2 Y1.9 S900 M03
N4 G43 Z1.0 H01 M08
= 8.211657082 = Y8.2117
N5 G99 G81 R0.1 Z-0.163 F3.0
N6 G91 XI. 5 Y1.8 L2 (K2)
O Step 2 N7 XI. 8 L6 (K6)
N8 Y-1.8 L2 (K2)
Compare these new XY coordinates with the previously
N9 G80 M0
calculated increments as they relate to the last hole of the
N10 G28 Z0 M0
pattern (using rounded values): Nil G28 X0 Y0
N12 M30
X = 2.0 + 3.8637 x 6 = 25.1822 %
Y = 2.0 + 1.0353 x 6 = 8.2118
The program offers no special challenges. In block N6,
Note that both X and Y values are accurate. When round- the angular row of holes is machined, starting from the
ing, particularly when a large number of holes is involved, lower left hole, in N7 it is row of holes, and
the horizontal
the accumulative error may cause the hole pattern out of in N8 the vertical row of holes
machined. The order is
is

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

holes is not the same as the spacing of all horizontal rows,


the resulting grid pattern is a rectangle. A grid pattern is

sometimes called a rectangular hole pattern - Figure 27-6.

Figure 27-5

Corner pattern of holes - program example 02705

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

A grid pattern is very similar to a series of corner patterns,


using similar programming methods. The major considera-
programming is in its efficiency. Each
tion for a grid pattern
H r*.
16°

row can be programmed as a single row pattern, starting,


for example, from the left side of each row. Technically,
that is correct, although not very efficient due to the loss of
OOOOOf- i
4.6
time, when the tool has to travel from the last hole of one
row, to the first hole of the next row.
oooooe ~
More efficient method will look like a zigzag motion. To oooooo
program a zigzag motion, program the row or column
first

starting at any corner hole. Complete


then jump to the nearest hole of the next row
row (column),
that
(column) and
©ooo e-e _ 1

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
. .

The unknown increment in the drawing is the distance


N6 G91 Y2.1 L6 (K6)
measured along the X axis, from a hole in one horizontal
N7 XI.
N9 Y-2.1 L6 (K6) row to the next hole in following horizontal row:

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

ARC HOLE PATTERN © STEP 1

Start with the calculation of a hole that is nearest to 0° lo-


Another quite common hole pattern is a set of equally cation (3 o’clock position or East direction), then continue
spaced holes arranged along an arc (not a circle). Such an for other holes in the counterclockwise direction of the arc.
equally spaced set of holes along any portion of a circle cir-
cumference creates an arc hole pattern. © STEP 2

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

coordinates for? Perhaps starting at 0° (3 o’clock or East


Figure 27-8
X = 1.5 + 2.5 x cos20 = 3.849231552 (X3.8492)
position) would be better? The illustration in
Y = 1.0 + 2.5 x sin20 = 1.855050358 (Y1.8551)
shows a typical layout of an arc hole pattern.

© STEP 3

e Use the same trigonometric formulas as in Step 2 and cal-

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

—H 1.5 — X = 1.5 + 2.5 x cos 60 = 2.750000000 (X2.75)


Y = 1.0 + 2.5 x sin60 = 3.165063509 (Y3.1651)
Figure 27-8

Arc hole pattern - program 02708 Hole #4

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.

A number of calculations is needed to find the X and Y


© STEP 4

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

N9 G80 MO First, select the machining location to start from, usually


N10 G28 Z0.1 MO at program zero. Then find the absolute XY coordinates for
Nil G28 XI. 9341 Y3.462 the center of the given circle. In the illustration, the bolt pat-
N12 M30
tern center coordinates are X7.5Y6.0. There will be no ma-
%
chining at this location, but the center of the circle will be

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)

Figure 27-9 is a typical bolt circle drawing. The program- #3


Hole
ming approach for a bolt circle is similar to arc pattern.

X = 7.5 + 5.0 x cosl50 = 3.16987298 (X3.1699)


Y = 6.0 + 5.0 x sinl50 = 8.50000000 (Y8.5)

Hole #4

X = 7.5 + 5.0 x COS210 = 3.16987298 (X3.1699)


Y = 6.0 + 5.0 x sin210 = 3.50000000 (Y3.5)

Hole #5

X=7.5+5.0x cos270 = 7.50000000 (X7.5)


Y = 6.0 + 5.0 x sin270 = 1.00000000 (Y1.0)

Hole #6

X = 7.5 + 5.0 x cos330 = 11.830127 (X11.8301)


Figure 27-9
Y = 6.0 + 5.0 x sin330 = 3.500000 (Y3.5)
Bolt circle hole pattern - program 02709
224 Chapter 27

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.

etc. Figure 27-10 shows the basis for such a formula.

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

POLAR COORDINATE SYSTEM

So mathematical calculations relating to the arc or


far, all
have been using lengthy trigono-
bolt circle pattern of holes
metric formulas to calculate each coordinate. This seems to
be a slow practice for a modem CNC system with a very
advanced computer. Indeed, there is a special program-
ming method available (usually as a control option) that
takes away all the tedious calculations from an arc or bolt
circle pattern- it is called the polar coordinate system.

There are two polar coordinate functions available, always


recommended to be written as a separate block:

G15 Polar coordinate system cancel OFF


Three basic characteristics of polar coordinates
G16 Polar coordinate system ON
In addition to the X and Y data, polar coordinates also re-
quire the center of rotation. This is the last point pro-
Program input values for bolt hole or arc patterns may be grammed before G16 command. Earlier, data in program
programmed with the polar coordinate system commands. 02708 and Figure 27-8 were calculated using trigonomet-
Check first the options of the control before using this With the polar coordinates control option,
ric functions. the
method. The programming format is similar to that of pro- program can be much simplified - 02710:
gramming fixed cycles. The format is, in fact, identical - for
example: 02710 (ARC PATTERN - POLAR)
N1 G20
N. . G9 . . G8 . . X.. Y.. R. . Z. . F. . N2 G17 G40 G80
N3 G90 G54 GOO XI. 5 Y1.0 S900 M03 (RDTOT PCUNT)
Two factors distinguish a standard fixed cycle from the N4 G43 Z1.0 HOI M08
same cycle used in the polar coordinate mode. N5 G16 (POLAR COORDINATES ON)
N6 G99 G81 X2.5 Y20.0 R0.1 Z-0.163 F3.0
The first factor is the initial command G that precedes the N7 X2.5 Y40.0
cycle no special G code is required for a standard cycle.
- N8 X2.5 Y60.0
For any cycle programmed in the polar coordinate system N9 X2.5 Y80.0
N10 G15 (POLAR COORDINATES OFF)
mode, the preparatory command G 1 6 must be issued to ac-
Nil G80 MO
tivate the polar mode (ON mode). When the polar coordi-
N12 G91 G28 ZO M5
nate mode is completed and no longer required in the pro-
N13 G28 XO YO
gram, the command G1 5 must be used to terminate it (OFF N14 M30
mode). Both commands must be in a separate block: %

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)

The second factor is the meaning of the X and Y words.


In the standard fixed cycle, the XY words define the posi-
tion of a hole in rectangular coordinates, typically as an ab-
solute location. In the polar mode and G17 in effect (XY
plane), both words take on a totally different meaning -
specifying a radius and an angle:

The X word becomes radius of the bolt circle

The Y word becomes angle of the hole, measured from 0°

Figure 27-12 illustrates the three basic input require-


ments for a polar coordinate system. Polar coordinate system applied to bolt hole circle - program 027 1
226 Chapter 27

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

Note that the center of polar coordinates (also called pivot =


G18 ZX Z radius X = angle
point) is defined in block N3 - it is the last X and Y location
programmed before the polar command G16 is called. In G19 YZ Y = radius Z = angle
the program example 02711, the center is at XOYO loca-
tion (block N3) - compare it with program 02710.
Most polar coordinate applications take place in the de-
Both, the radius and angle values, may be programmed in fault XY plane, programmed with the G17 command.
either absolute mode G90 or incremental mode G9 1

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.

Chapter 29, and particularly Chapter 31, describe the


This feature is quite significant for efficient program-
subject of planes. There are three mathematical planes,
ming approach, number of various
particularly for a large
used for variety of applications, such as polar coordinates.
bolt hole patterns. For example, a center drilling or spot
drilling operation can be programmed very efficiently with
G17 XY plane selection positive angular values (counterclockwise order). The start
will be at the first hole and, after the tool change, the drill-
G18 ZX plane selection ing can continue in the reverse order, starting with the last
hole. All angular values will now be negative, for the
G19 YZ plane selection clockwise order of a subsequent tool. This approach
requires a lot more work in standard programming, when
the polar coordinates are not used. The polar coordinate
Selection of a correct plane is extremely critical to the
application using the G16 command eliminates all unnec-
proper use of polar coordinates. Always make it a habit to
essary rapid motions, therefore shortening the cycle time.
program the necessary plane, even the default G17 plane.
28 FACE MILLING

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.

Double Negative Geometry

Double negative geometry can be used only if the ma-


chine has sufficient power rating and both the cutting tool
and the machined part are firmly mounted within a rigid
setup. Cast iron or certain hard materials will usually bene-
fitfrom using double negative geometry. The chips do have
the tendency to concentrate towards the machined part and
do not fly away from the part with ease, possibly causing a
Nominal diameter of various face mill cutters chip jamming against the insert or wedging themselves in
confined areas. Positive/negative inserts should eliminate
Insert Geometry this clogging problem.

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

geometry and insert mounting into the cutter body


Insert before deciding on the most suitable choice for a particular
isdetermined by a design that controls the position of the work. Face mills and their inserts come literally in hun-
insert in the material during a cut. These factors strongly in- dreds of varieties and each manufacturer claims superiority
fluence quality of the cutting. There are typically three gen- over the competition.
eral categories, based on the cutting rake angle of the face
mill (known as the rake angle): CUTTING CONSIDERATIONS
/Positive geometry . . . single or double
To program a cutting motion for a face mill, it is impor-
O' Negative geometry ... single or double
tant to understand how a face mill works best under differ-

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

may be more suitable on CNC


than negative cutters, so they part surface finish suffers as well. In some more severe
machines with limited power rating, usually small ma- cases, the insert may have to be discarded prematurely, in-

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

A neutral angle of entry (not shown) has the cutter center


line coincident with the part edge. Needless to say, when
the cutting insert enters material, a certain force is required.
During positive entry angle, the weak cutting edge has to
absorb most of the forces. Since insert edge it is the weak-
est part of the insert, a positive entry angle may cause a
breakage or at least some insert chipping. Normally, this
entry method is not recommended.

Negative entry angle of an insert absorbs the entry force


at themiddle, at the strongest point of the insert. This is the
preferred method, as it increases the insert life. It is always
a good idea to keep the face mill center within the part area,
rather than away from it. That way, the insert will always
Schematic relationship of the cutter diameter and the part width. enter at the preferred negative angle.
Only the cutter size (a) is desirable, although not its position.
All these examples assume a solid part material being
The illustration shows only relationship of the cutter dia-
machined. If the face mill has to travel over some empty
meter to the part width - it does not suggest the actual spaces, the cut will be interrupted. The entry into and the
method of cutter entry into the material. The most impor- exitfrom the part during interrupted cut will cause the cutter
tant consideration for CNC programming of a face mill is entry angle to be variable, not constant. As many other fac-
the angle the milling cutter enters into the material. torshave to be considered in face milling, take these rec-
ommendations and suggested preferences only as guide-
Angle of Entry Always consult
lines. a tooling representative on the best
method of handling a particular face milling job, particu-
The face mill entry angle is determined by position of the
larly for materials that are difficult to machine.
cutter center line relative to the part edge. If a part can be
milled with a single cut, avoid situations where the cutter
center line position matches the part center line. This neu-
Milling Mode
tral position causes a chatter and poor finish. Offset the cut-
In milling, the programmed cutting direction, relative to
ter away from part center line, either for a negative cutter the table motion direction is always very important. In fact,
entry angle, or a positive cutter entry angle. Figure 28-3 this factor so important that it is discussed in several sec-
shows both types of entry angles and their effects.
tions of this handbook and covers a subject called the mill-
ing mode.

Traditionally, there are three milling mode possibilities


available in milling operations:

Neutral milling mode

Conventional milling mode

Climb milling mode

A neutral milling mode is a situation where the cutter fol-


lows the center line of a slot or a face, climb milling on one
side and conventionally milling on the other side of center
line. The conventional milling mode is also called the 'up'
mode and the climb milling mode is also called the ‘down’
mode. These are all correct terms, although the terminol-
ogy may be a little confusing. The terms climb milling and
conventional milling are more often used with peripheral
milling than with face milling, although exactly the same
principles do apply for all milling. For most face milling
cuts, the climb milling mode is the best overall choice.

In Figure 28-4, example (a) illustrates the neutral cutting


mode, example (b) shows the so called down cutting mode
Insert entry angle into the part. W = width of cut (or climb milling mode) and example (c) shows the so
lal at the strongest insert point - negative entry angle
called up cutting mode (or conventional milling mode).
(b) at the weakest insert point - positive entry angle
230 Chapter 28

As an overall general type, a coarse density cutter is usu-


Programmed ally a suitable choice. The more cutting inserts are engaged
direction
v '
>> in material simultaneously, the more machining power will
be required. Regardless of the insert density, it is important
to have sufficient cutting clearances - the chips must not
clog the cutter, but fly out freely.

:c At all times, at least one cutting insert must be in contact

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:

Always plunge-in to the required depth

Programmed away from the part (in the air)

direction
If surface finish is important, change the cutter
direction away from the part (in the air)

Keep the cutter center within the part area

l / , A"
for better cutting conditions

Typically, select a cutter diameter that is about


1.5 times larger than the intended width of cut
Table
direction
Figure 28-5 shows a simple plate used for examples.

Figure 28-4

Face milling modes:

0
(a) Neutral milling mode i
(b) Climb or 'down' milling mode
(cl Conventional or 'up' milling mode
Width

Number of Cutting Inserts I


/
Depending on the face mill size, the common tool is a
Insufficient overlap
a
multi tooth cutter. A traditional tool called fly-cutter has
usually only a single cutting insert and is not a normal tool
of choice in CNC. The relationship of the number of inserts
in the cutter to the effective cutter diameter is often called
the cutter density or cutter pitch. ~T
Typical face mills will belong into one of these three cate- (' Width of cut
gories, based on the cutter density: f L
Coarse density . . . coarse pitch of inserts

Medium density medium pitch of inserts


T
...
k 25-30% of cutter diameter
Fine density ... fine pitch of inserts
Figure 28-5

Width of cut in face milling - (b) is the recommended method


FACE MILLING 231

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

Multiple Face Mill Cuts

The general principles applying to a single face cut do ap-


ply equally to multiple face cuts. Since the face mill dia-
meter is often too small to remove all material in a single
pass on a large material area, several passes must be pro-
grammed at the same depth.

There are several cutting methods for a large area to be


face milled and each may produce good machining condi-
tions under certain circumstances. The most typical meth-
ods are multiple unidirectional cutting and multiple bi-
directional cutting (called zigzag) - at the same Z depth.
ROUGHING FINISHING
Multiple unidirectional cuts start from the same position Figure 28-9
in one axis, but changes the position in the other axis, above
Bidirectional approach to a multiple face cut
the part. This a common method of face milling, but it
is
for rough and finish face milling
lacks efficiency, because of frequent rapid return motions.
There is another fairly efficient method that cuts only in
Multiple bidirectional cuts, often called zigzag cutting,
one mode, normally in climb milling mode. This method
are also used frequently; they are more efficient then the
may remind of a circular or a spiral motion (along the XY
unidirectional method, but cause the face mill to change the
axes) and is the most recommended method. It combines
climb milling method to the conventional method and vice
the two previous methods and is illustrated in Figure 28-10.
versa. This method may work for some jobs, but is not gen-
erally recommended.

In the next two illustrations, Figure 28-8 shows schemati-


cally a unidirectional face milling. Figure 28-9 shows a
bidirectional face milling.

Schematic tool path representation for the climb face milling mode,
applied to a unidirectional cutting

The illustration shows the order and direction of all indi-


Figure 28-8
vidual tool motions. The idea is to make each cut approxi-
Unidirectional approach to a multiple face cut mately the same width, with only about 2/3 of the diameter
for rough and finish face milling
cutting at any time, and always in climb milling mode.
Compare the XY motions of these two methods. In addi-
tion, a tool path difference (cutter position) between rough- - 13
ing and finishing is also shown. The cutting direction may
be either along the X or along the Y axis, but the principles
of the cutting motion will remain the same. 1

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

Example of a multiple face mill cut - program 02802


FACE MILLING 233

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.

02802 USING POSITION COMPENSATION


(MULTIPLE FACE MILLING CUTS)
N1 G20
N2 G17 G40 G80 In both previous examples, the starting XY
position of
N3 G90 G54 GOO X0.75 Y-2.75 S344 MO 3 (POS 1) the face mill has been calculated, considering its diameter
N4 G43 Z1.0 HOI and a suitable clearance. To use 02801 program as an ex-
N5 G01 Z-0.2 F50.0 MO ample, the starting position was XI. 15 Y1.0. The part was
N6 Y8.75 F21.0 (POS 2)
5.0 inches, plus a clearance of .25, plus the 2.5 inches cutter
N7 GOO X12.25 (POS 3)
(POS 4) radius - total of X7.75 absolute value of the cutter center.
N8 G01 Y-2.75
N9 GOO X4.0 (POS 5) The big disadvantage of this method is apparent when
N10 G01 Y8.75 (POS 6) using a face mill that has a different diameter than the one
Nil GOO X8.9 (POS 7 - 0.1 OVERLAP) expected by the program. A last minute change of the face
N12 G01 Y-2.75 (POS 8 - END) mill at the machine may cause problems. Either there will
N13 GOO Z1.0 MO be too much clearance (if the new tool is smaller) - or worse
N14 G28 X8.75 Y-2.75 Z1.0 - there will be not enough clearance (if the tool is larger).
N15 M30 There is another way to solve this problem.
%
As the of this section suggests, the solution is to use
title
In program 02802, all relevant blocks are identified with
the ‘obsolete’ Position Compensation feature of the control
tool positions corresponding to the numbers in an earlier
system, already described in Chapter 17. It is probably the
Figure 28-10. only practical application of the position compensation on

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.

— 0.1 OVERLAP In a face milling


of the following forms:
program, this situation will take on one

S' ''

/ N6 bnoyNi 1 N7 The face mill radius is programmed using the actual values
YRU. 7*5
1 /

X 1/ I Position compensation method is used


\/ t

JXJ 13.0 WIDTH,


In the first case, the program 02801 may be the result,
A
•f QPC2MPMTQ
OCOIVICI'I 0 1

with the following content:


,

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 \

N3 G90 G54 GOO X7.75 Y1.0 S344 M03


N4 G43 Z1.0 HOI
N5 G01 Z-0.2 F50.0 M08
0
0 m c0
cD
0
05
m
CM N6 X-2.75 F21.0
d d <T CO c\i
05.0 CUTTER N7 GOO Z1.0 MO
r N8 G28 X-2.75 Y1.0 Z1.0
N9 M30
Figure 28- 12
%
Multiple face milling details for program example 02802
234 Chapter 28

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

position compensation G46, which is a single contraction


in the programmed direction by the compensation amount
contained in the register of D01 offset. Note that the pro-
grammed coordinate value is X5.25, which is the total of
the part length (5.0) and the selected clearance (.250). The
face mill radius is totally disregarded in the program. The
main benefit of this method is that, within reason, the pro-
Example of the position compensation as applied to face milling - grammed coordinates will not change, even if the face mill
program 02803 diameter changed. For example, if a 03.5 inch face mill
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

In the majority of CNC programming applications, there


are only two types of tool motions related to contouring.
One is the Linear Interpolation, discussed earlier, the other
one is the Circular Interpolation, discussed in this chapter.
The programming method of controlling a tool path along
an arc is similar to the method of programming a tool path
along a line. The method of circular contouring is called
circular interpolation.It is commonly used in profiling on

CNC vertical and horizontal machining centers, as well as


on lathes and many other CNC machines, such as simple
milling machines, routers, burners, water jet and laser pro-
filers, wire EDM, and others.

Circular interpolation is used for programming arcs or

complete circles in such applications as outside and inside


radii (blend and partial), circular pockets, spherical or coni-
cal shapes, radial recesses, grooves, corner breaks, helical
cutting, even large counterbores, etc. The CNC unit will in- Basic elements of a circle
terpolate a defined arc with a very high precision, if the
necessary information is given in the program.
Radius and Diameter
ELEMENTS OF A CIRCLE In the simplest mathematical terms, a circle is defined by
its center point andits radius. Two of the most important

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-

lationship to the quadrants. Although it is not a subject of


The area of a circle is defined by this formula:
the current chapter, mirroring and quadrants must be con-
sidered together. What happens to the tool path when it is
2
A = Tt x R mirrored is determined by the quadrant where the mirrored
tool path is positioned. In the Chapter 41 are more details

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

many materials used in CNC machining, because climb


C = tt x D
milling in Quadrant I will turn into conventional milling in
Quadrants II and IV - a situation that is not always desir-
car where ...
able. Similar changes will occur for other quadrants.

C = Circumference of the circle


Quadrant Points
D = The circle diameter
71 = Constant (3.1415927) From the earlier definition should be clear that quadrants
consist of two perpendicular lines that converge at the arc
It is important to note that both the area and circumfer-
center point and an arc that is exactly one quarter of a circle
ence of a circle (its actual length) are seldom used in CNC
circumference. In order to understand the subject deeper,
programming, although understanding their concepts pres-
draw a line from the center of an arc that is parallel to one of
ents a rather useful knowledge.
the axes and is longer than the arc radius. The line created

an intersection point between the line and the arc. This


QUADRANTS point has a special significance in programming. It is often
known as the Quadrant Point - or the Cardinal Point - al-

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

nature, while most arcs are programmed within one or two


quadrants. When programming the arc vectors I, J and K
90 NORTH 12 o'clock 1 and II

(described later), the angular difference between the arc


start and end points is irrelevant. The only purpose of arc
180 WEST 9 o’clock II and III

vectors is to define a unique arc radius between two points.

For many arc programming projects, the direct radius can 270 SOUTH 6 o'clock III and IV

be used with the R address, available for majority of control


systems. In this case, the angular difference between the
At of learning, it may be a good idea to refresh
this point
start and end points is very important, because the com- some terms of the angle direction definition. The estab-
puter will do own calculations to find the arc center. The
its
lished industry standard (mathematics, as well as CAD.
arc with the angular difference of 180° or less measured ,
CAM and CNC) defines an absolute angular value as being
between the start and end points, uses an R positive value. positive in the counterclockwise direction and always start-
The arc in which the angular difference is more than 180 °, ing from zero degrees. From above
zero degrees
the table,
uses an R negative value. There are two possible choices correspond to the East direction or three o 'clock position of
and the radius value alone cannot define a unique arc. an analog clock - Figure 29-2.
CIRCULAR INTERPOLATION 237

In a typical program format, the first statement of a circu-


lar cutting motion block is the cutting direction. This direc-
motion along the programmed
tion defines the cutting tool
arc.which is either clockwise or counterclockwise. The
motion direction along an arc is programmed using pre-
paratory commands in the block.

Circular Interpolation Block

There are two preparatory commands associated with


programming an arc direction:

G02 Circular motion clockwise CW


G03 Circular motion counterclockwise CCW

Mathematical definition of the arc direction


Both the G02 and G03 commands are modal, therefore
program or until can-
they remain in effect until the end of
There is another reason why the quadrant points are im- celed by another command from the same G code group,
portant in CNC programming. In some cases, the quadrant usually by another motion command.
points will be used as the arc end points even if the circular
,

The preparatory commands G02 and G03 are the key


cut covers more than one quadrant. This is particularly true
words used in programming to establish circular interpola-
for many older control systems, where crossing the quad-
tion mode. The coordinate words following the G02 or G03
rants in a single block is not allowed. The modern controls
command are always designated within a selected plane.
can generate arc of any length in a single block, with virtu-
The plane is normally based on the available axes combina-
ally no restrictions.
tions of XY. ZX and YZ for milling or similar applications.
Normally, there is no plane selection on a lathe, although
PROGRAMMING FORMAT some control indicate it as G18, the ZX plane.

The plane selection and the combination of circular mo-


The programming format for a circular interpolation tool
tion parameters and the arc cutting direction determine the
path must include several parameters, without which the
arc end point, and the R value specifies the arc radius. Spe-
task of cutting an arc would be impossible. The important
cial arc (known as vectors)
center modifiers are also avail-
parameters are defined as:
able, if the programmer requires them.
Arc cutting direction (CW or CCW)
When the G02 or G03 command is activated by a CNC
Arc start and end points program, any currently active tool motion command is au-
tomatically canceled. This canceling motion is typically
Arc center and radius value
GOO. G01 or a cycle command. All circular tool path mo-
The cutting feedrate must also be in effect, discussed in tions must be programmed with a cutting feedrate in effect,
more detail later in this chapter. Special modal G codes are applying the same basic rules as for linear interpolation.
used for circular motion programming and additional pa- That means the feedrate F must be programmed before or
rameters related to the circle radius are also required. within the cutting motion block. If the feedrate is not speci-
fied in the circular motion block, the control system will
Arc Cutting Direction automatically look for the last programmed feedrate. If
there is no feedrate in effect at all, many controls usually re-
A cutting tool may move along an arc in two directions -
turn an error message (an alarm) to that effect. The feedrate
clockwise (CW) or counterclockwise (CCW). These two may be specified one of two ways. Either directly, within
in
terms are assigned by convention. On most machines, the the arc cutting block only or indirectly, by assuming the last
motion direction is determined by looking perpendicularly active feedrate. Circular motion in a rapid mode is not pos-
at the plane in which the circular motion is programmed. sible. Also not possible is a simultaneous three axes circu-
The motion from the plane vertical axis towards the plane lar motion. For more details on this subject, look up Chap-
horizontal axis is clockwise, reverse motion is counter-
ter 45 describing helical milling.
clockwise. This convention has mathematical origins and
does not always match the machine axes orientation. Chap- On the majority of older controls, direct radius address R
ter 31 describes machining in planes, this chapter will only cannot be specified and the arc center vectors I, J and K
take a brief look. must used instead:
238 Chapter 29

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
.

G03 X.. Z.. . R. . Turning program - CCW


command - Figure 29-3.
Why is the arc center location or the arc radius needed at
CENTER START CENTER START all? It would seem that the end point of an arc programmed
POINT POINT POINT POINT in combination with a circular interpolation mode should

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.

The start point of an arc is the last position of the cutting


Arc Center Vectors
tool before the circular interpolation command.
Figure 29-4 shows the signs of arc vectors I and J in all

possible orientations. In different planes, different pairs of


Here is an example: vectors are used, but the logic of their usage remains ex-
actly the same.
N66 G01 X5.75 Y7.5
N67 GO 3 X4.625 Y8.625 R1.125 Arc vectors I, J and K are used according to the following
N68 G01 X. Y. . .
definitions (only I and J are shown in the illustration):
CIRCULAR INTERPOLATION 239

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 Y axis.


designation of arc center. It is the definition of relative posi-
tion of the arc center from the start point, programmed with
K a directional sign - absence of the sign always assumes a
Arc center vector is the distance, with specified direction,
measured from the start point of the arc, minus sign indicates a negative direction
positive direction,

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.

The distance between and the


the start point of the arc
IJK
Arc in Planes
center point of the arc (as specified by the vectors) is al-

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..)

The lack of a standard in this respect creates a major dif-


ference in the programming format, so be careful to avoid a
240 Chapter 29

G17-XY PLANE G18 -ZX PLANE G19-YZ PLANE


Y X Z

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

If the programmed plane is machine


not aligned with the The simplest form of a blend radius is between two per-
axes, or if program are selected without
the axes used in the pendicular lines that are parallel to the machine axes. Cal-
a plane designation, the circular motion will take place ac- culation of the start and end points requires only a few addi-
cording to the axis selection in the program. Always watch tions or subtractions. More complex calculation is required
when the modal axis motion is omitted. The safest method when even one line is at an angle. In this case, trigonomet-
of avoiding this potentially harmful problem is to follow a ric functions are used to calculate the start or the end point,
simple precaution - never count on modal values. or both. Similar calculations are required for blends be-
tween other entities as well. A blend arc is also known as a
In nonstandard planes, the circular program block should fillet arc or a. fillet radius.
always contain specifications for both axes as well as both ,

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

possible selections, however, the part drawing should be

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:

Blend radius FULL CIRCLE PROGRAMMING


Partial radius
All Fanuc systems and many other controls support a full
Each radius may be programmed in the or CCW di- CW circle programming. Full circle is an arc machined along
rection and each may be external or internal, as well as in 360°. Full circle cutting is possible on the lathes in theory
any orientation that the cutting tool can handle. only, since the type of work does not allow it. For the mill-
ing work, full circle programming is fairly routine and is re-
Blend Radius quired for common operations, such as:

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

Thisan example of a four block programming that cov-


is

The arc start and end points are both


ers a full circle cutting.
located at a quadrant point of the axis line, which is an im-
portant programming consideration. The quadrant point in
the example is equivalent to 3 o’clock position (0°). Note
that the G02 is repeated in each block only for the example
emphasis and does not need to be repeated in a production
program. The same applies to the occurrences of 10 and JO -
they do not have to be written unless they change.

Try not to make the job more difficult by establishing the


starting position of the cut away from any of the four quad-
- 2.00 - rant points, which are at 0°, 90°, 80° and 270°. For exam-
1

ple, if the cutting starts at 33°, there will be five circular

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

Full circle programming using five blocks of program code

G90 G54 GOO X3.0483 Y2.6808 S800 M03


G01 Z-0.25 F10.0
G02 X3.25 Y2.0 1-1.0483 J-0.6808 (BLOCK 1 OF 5)
GO 2 X2.0 Y0 .75 1-1.25 JO (BLOCK 2 OF 5)
G02 X0 .75 Y2.0 10 J1.25 (BLOCK 3 OF 5)
G02 X2.0 Y3.25 11.25 JO (BLOCK 4 OF 5)
G02 X3.0483 Y2.6808 10 J-1.25 (BLOCK 5 OF 5)
2.00 - GOO Z0.1

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

As an example of a full circle cutting, a simple boss will


X = 2 + xs = 3.0483382 = X3.0483
be used, as illustrated in Figure 29-10.
Y = 2 + ys = 2.6807988 = Y2.6808

system supports a full circle program input


If the control
in one block the output program will be shorter, but will re-
,

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:

G90 G54 GOO X3.0483 Y2.6808 S800 M03


G01 Z-0.25 F9.0
G02 X3.0483 Y2.6808 1-1.0483 J-0.6808
GOO Z0.1

The I and J modifiers cannot be arbitrarily replaced with


the address R. The next example is not correct:

G90 G54 GOO X3.0483 Y2.6808 S800 M03


G01 Z-0.25 F9.0
GO 2 X3.0483 Y2.6808 R1.25 F12 0 (* WRONG . *)
GOO Z0.1

The reason? Mathematically, there are many options for a


full circleprogramming. If an R value is programmed for a
Boss milling example - drawing for program 02901
360° arc, no circular motion will take place and such a
block will be ignored by the control. This is a precaution Boss or spigot milling are terms used for external milling
built into the control software, to prevent from cutting an
of a full circle. The opposite is an internal milling of a full
incorrect arc because oflhc many existing possibilities. In circle, such as a circular pocket. The cutter used will be
Figure 29-9, only a handful of the possible arcs is shown. 0.75 inch end mill programmed at .375 depth:
The circles share the same cutting direction, start point, end
point, and radius. They do not share center points. 02901
(0.75 DIA END MILL)
N1 G20
N2 G17 G40 G80
N3 G90 G54 GOO X-1.0 Y1.5 S750 M03
N4 G43 Z0.1 H01
N5 G01 Z-0.375 F40.0 M08
N6 G41 Y0.906 D01 F20.0
N7 X0 F14.0
N8 GO 2 J-0.906
N9 G01 XI. 0 F20.0 M09
N10 G40 Y1.5 F40.0 M05
Nil G91 G28 XO YO Z2 .

N12 M30
%

In program 02901, the tool moves first to the XY posi-


tion and depth, then the cutter radius offset was started.
When made a straight
reaching the cutting depth, the tool
climb milling motion to the top of boss. Then it swept
around the circle to the same point, moved away straight,
and by reversing the initial motions, it returned to its Y axis
Many mathematical possibilities exist lor a full circle cutting with R start point - Figure 29-11 shows the block numbers.
CIRCULAR INTERPOLATION 243

N8 G01 G40 XO F20.0 M09


N9 G91 G28 XO YO Z2.0 M05
N10 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.

A cutter radius offset cannot start or end in a circular mode.

This is true for almost any circular application, except the


N7 very few that use a special cycle.

Figure 29- 1 Internal Circle Cutting - Circular Start


Boss milling example - tool motions for program 02901
The simple linear approach programming method in the

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

depth of .250 inch, in program 02902. A simple linear mo-


tion will be used for the startup, where the entry point blend
is not too important. The cutting tool is a center cutting end

mill (also known as a slot drill) - Figure 29-12:

0.25
r A
"T
I 01.25 — ^/y
Figure 29-13

Internal circle cutting - linear and circular approach

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
.

N2 G17 G40 G80 N7 G03 XO YO 625 R0.3125


.

N3 G90 G54 GOO XO YO S900 M03 N8 J-0.625


N4 G43 Z0.1 HOI N9 X-0.3125 YO 3125 R0.3125
.

N5 G01 Z-0.25 F10.0 M08 N10 G01 G40 XO YO F20.0 M09


N6 G41 YO 625 D01 F12.0
.
Nil G91 G28 XO YO Z2.0 M05
N7 G03 J-0.625 N12 M30
%
244 Chapter 29

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

systems has the User Macro option and many


If a control
uncompensated circle center position is circular to the
circular pockets are required, the 02903 example could compensated start point on the arc circumference. This is
also be adapted to a macro. Some controls do have a circu- all built into the control and there no choice is offered. Con-
lar pocket milling cycle built-in.
sider this situation as a special case, definitely not as a rule.

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.

There is a logical relationship between G02 and G12, as


well as between G03 and G13:

G12 Full circle cutting cycle CW

G13 Full circle cutting cycle CCW

A typical programming format for using these two spe-


cial commands is quite simple:

G12 I.. D.. F.. Full circle CW


G13 I.. D.. F. . Full circle CCW

In this format description, the I address is the radius of


Figure 29- 14
finished circle and is programmed as an incremental value
with a sign. If the sign is positive (plus sign is assumed), the Full circle cutting using G12/G13 cycles - program 02904

start point of the cut will be at 0°, which is equivalent to the


3 o’clock position or East direction. If the sign is negative, 02904
the start point of the cut will be at 180° position, which is
(0.5 DIA CENTER CUTTING END MILL)
The N1 G20
equivalent to the 9 o’clock position or West direction.
N2 G17 G40 G80
command cannot be forced to a start in the Y axis direction. N3 G90 G54 GOO XO YO S900 M03
D address is the control register number for N4 G43 Z0.1 HOI
Progranuned
N5 G01 Z-0.25 F10.0 M08
the cutter radius offset and F is the feedrate address. There
N6 G13 10.625 D01 F12.0 M09 (IF AVAILABLE)
are alternate versions of this cycle on some controls, but all
N7 G91 G28 XO YO Z2.0 M05
very similar in nature. N8 M30
%
Other conditions must also be accepted for successful us-
age of this programming shortcut. The cutting tool must al- The program is only two blocks shorter, but it is much
ways start at the center of a circular pocket, the cutting simpler to develop. The cutter radius offset is automatic
plane must be set to the XY
plane and the arc starting posi- (built-in) and the editing at the machine is much easier.
tion is usually built-in, generally at 0° or 180° (Y axis start There is also an additional bonus - since the start point on
is not possible). There is also a built-in cutter radius offset the circle is not a result of a straight line, but a lead-in arc,
(G 1 2 to the right, G 1 3 to the left). Never program the com- the surface finish quality will be better than using other
mands G4 and G42 when using
1 2 or G 1 3 command. If G 1
types of tool approach. This is a preferable method when
the cutter radius is in effect, it be overridden by the se- will
the machined surface quality is important. There is also a
lection of G 2 or G 1 3. The safest approach is to program
1
built-in lead-out arc in the cycle, similar to the lead-in arc.
these two cycles in G40 mode (cutter radius offset can- that is effective when the circle cutting is completed.
celed) at all times.
CIRCULAR INTERPOLATION 245

ARC PROGRAMMING

With a full arc cutting, which means the complete 360°


motion, the R address cannot be used at all. The arc center
vectors I and J have to be applied, even on latest controls.

What if the circle is 359.999°? Well, at first, circle must


have 360°, therefore the word 'circle' is incorrect. Even a
small difference of 0.001° does make a difference between
a circle and an arc. Although this difference is much more
important mathematically than for practical programming,
the distinction is very important. In circular interpolation
terms, an incomplete circle is nothing more than an arc.
Look at this arc a little differently. If a 90° arc is made, the
R address can be programmed, for example:

G01 X2.0 Y5.25 F12.0


G02 X3.75 Y7.0 R1.75

If an arc that covers exactly 80° 1 is programmed, the pro-


gram will not be much different: Sign of R address for circular cutting - only the center is different

G01 X2.0 Y5.25 F12.0


The following example is identical to the previous one,
G02 X5.5 Y5.25 R1.75
except for the R address sign.

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
.

G02 X13.125 Y6.0 R-2.625 (270 DEGREES)


not have to be repeated, it is used here only for illustration.

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-

G01 X10.5 Y8.625 F17 .


ated with the R address sign error.
G02 X13.125 Y6.0 R2.625
FEEDRATE FOR CIRCULAR MOTION
The blocks appearbe correct. The calculations, the for-
to
mat, individual words, they all appear to be right. Yet, the
program is wrong! Its result will be a 90° arc, not 270°. Inmost programs, the feedrate for circular interpolation
is determined the same way as feedrate for linear interpola-
Study the illustration in Figure 29-15. It shows that there tion. The cutting feedrate for arcs is based on established
is not just one, but two mathematical possibilities when the machining conventions. They include the work setup, ma-
R address is used for arcs. The solid contour is the tool path, terial machinability, tool diameter and its rigidity, program-
the dashes identify the two possible radii. mer’s experience and other factors.

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.

In normal programming, the linear feedrate is used for


F, x ( R + r)
arcs as well, as determined by the machinability rating for
the given material. The formula for linear feedrate is:

F, = r/ min x Ft x n m- where ...

F0 = Feedrate for outside arc


use where ... F, = Linear feedrate
R = Outside radius on the part
F| = Linear feedrate (in/min or mm/min) r = Cutter radius
r/min = Spindle speed
F, = Feedrate per tooth Based on the linear feedrate of 14 in/min, an outside .375
n = Number of cutting edges arc radius requires an upward adjustment for a 0.50 cutter:

A linear feedrate for1000 r/min, .0045 in/tooth load and


F0 = 14 x (.375 + .25) / .375 = 23.333333
two cutting edges, the feedrate is 9 in/min. Using a rela-

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.

F0 = 14 x (0.375 + 0.75) / 0.375 = 42.0


The elementary rule of feedrate adjustment for arcs is that
the normally programmed linear feedrate is increased for
The feedrate changed from 14 in/min a 3 to 42 in/min -
outside arcs and decreased for inside arcs - Figure 29-16.
times increase. Here, use previous experience to determine
whether the adjustment is justified or not.

Feedrate for Inside Arcs

For inside arcs, the adjusted feedrate will be lower than


the linear feedrate, calculated from this formula:

F, x (R - r)

is? where ...

F, = Feedrate for inside arc


F, = Linear feedrate
R = Inside radius on the part
r = Cutter radius

Based on the linear feedrate of 14 in/min, the feedrate for


.8243 inch inside radius with 01.25 cutter, must be ad
Feedrate adjustments for circular tool motion
justed downward

An outside arc of a tool path is longer than the drawing arc Fi = 14 x (.8243 - .625) / .8243 = 3.384932

An inside arc of a tool path is shorter than the drawing arc


The result is a feedrateof 3.38 in/min. In the program,
this will be the applied feedrate for the F address.
30 CUTTER RADIUS OFFSET

The contour of a part - also known as a profile - is nor- MANUAL CALCULATIONS


mally programmed for milling applications by establishing
the depth in the Z axis first, then moving the cutting tool in-
Some should become apparent from the Figure
realities
dividually along the X axis, Y axis, or both axes simulta-
30-1. The most
noticeable observation is that the machined
neously. For turning applications, either the X axis or the Z contour must always take place with the tool path compen-
axis, or both axes can be used to face, turn or bore a con- which means
sated by its radius, its center point must be lo-
tour. For both types of machining, each contour element cated in positions shown in the lower example. This ma-
contour requires one block of cutting motion. These mo- chining requirement is not matched by the reality of the
tions between contour change points can be programmed
engineering drawing. In a drawing, all dimensions refer to
in inches or millimeters and they can use an absolute value
the part contour, not the contour of the tool center. In fact,
position or an incremental distance. In either case, keep in
the drawing dimensioned to the tool positions illustrated
is
mind of programming uses the center line of
that this type
in example of the illustration. The question is -
the upper
the spindle as the X and Y or X and Z tool movements. Al-
how do the tool center positions get from a drawing to the
though the center line programming is a very convenient
part contour?
method for program development, it is also a method unac-
ceptable for machining. During contact with the material, The answer is - they have to be calculated. Actually, they
the edge of the cutting tool must touch the programmed do not have to be. if the CNC system is equipped with an
part contour, not its center line. advanced built-in feature called the cutter radius compen-
sation or cutter radius offset. On the CNC turning systems,
The tool path for all contouring operations is always
nose radius compensation or
this feature is called the tool
equivalent to the cutting tool motion. Whether used on a
the tool nose radius offset. This advanced and common
CNC machining center or on a CNC lathe, the cutting tool
control feature enables the programmer to apply the offset
edge must always be tangent to the contour, which means command, program the part contour as per drawing dimen-
the tool motion has to create a path where the center point
sions and let the control do all the necessary calculations
of the cutter is always at the same distance from the con-
and adjustments automatically.
tour of the part. This is called the equidistant tool path.
At this point, the current chapter could continue and
The illustration in Figure 30-1 shows two types of a tool
concentrate on the automatic method of program-
strictly
path. One is not compensated, the other is compensated.
ming, using this exceptional feature. After all, all modern
Both are applied to a particular contour, with the cutter dia-
CNC machines do have a cutter radius offset built-in. Once
meter shown as well, including its positions. several basic rules are followed, the feature is easy to use.

In order to automate something, we have to first under-


stand how it works. If something is automated already, the
knowledge of how it works makes the job so much easier,
particularly when encountering a difficulty that has to be
resolved very quickly. To really understand cutter radius
offset - many programmers and machine operators do not -
it is important to understand the principles built in the sys-
tem, principles that are very much based on basic mathe-
matical calculations, including the often unpopular trigo-
nometry calculations. A very simple drawing is shown in

Figure 30-2 for that purpose.

The program zero


will be selected at the lower left corner
of Since
the part. the cutting will be external, in a climb
milling mode, the tool will start along the Y direction first.
At the moment, the start and end tool position is not impor-
Figure 30-1 tant. only calculations of the individual contour points at
Tool path not compensated /above) and compensated (below), intersections and tangency points.
by the cutter radius

247
248 Chapter 30

All five points can be summed up in a small table:

18° Point No. X coordinate Y coordinate

! 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

of ten values will be required. Tool Path Center Points


The drawing always offers some points that need no cal- The cutting tool for milling is always round. An end mill,
culations. It is a good idea to get well organized and mark
for example, has a diameter of a certain size. Even tools
the points from the drawing first. Then, make a chart in the used for turning and boring have a round end (called the
order of tool path. Study Figure 30-3 carefully - it shows all
tool nose radius ), even if it is relatively small. Of course,
live points and all the values that need no calculation, per-
we all know that any round object has a center. Milling cut-
haps some addition or subtraction only. ter or a lathe tool tip are round objects, so they have a cen
ter. This evaluation may sound a bit too elementary and it

is, but it is also the basis, the key element the ,


whole con-
Pt X-AXIS Y-AXIS cept, of cutter radius offset. Every control system takes it

PI X0.0000 Y0.0000 into consideration.


P2 X0.0000 Y 1 .1250
P3 X2.2500 ? Take, for example, an electric router tool to cut a shape
P4 X2.2500 Y0.6250 out of wood - how is it used? Using a pencil outline of the
P5 XI. 6250 Y0.0000 desired shape, the router bit is placed into the tool and starts
cutting. Where? It starts cutting outside of the outlined
shape, otherwise the piece cut will be either too large or too

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

This activity is might have been even done


so simple, it
Out of the ten values required, nine of them are given.
automatically, without serious thinking. The radius of the
The missing Y value for P.3 is not expected on the drawing.
router bit (or the width of the saw) was compensated for be-
Regardless of whether the cutter radius offset is used or not,
fore and during the cut. Just like the outline of the shape in
some calculations will always be necessary and this is one wood followed, the outline of the machined part, outline
is
of them. After all, manual programming is done by hand.
that is offset by the cutter radius is followed as well.
Figure 30-4 shows the trigonometry method used.
The tool path generated by the cutting tool center always
keeps the same distance from the part contour (outline).
There is even a special name for this type of tool path - it is
T which means ‘distant by
a called the equidistant tool path,
the same amount’. Figure 30-5 shows the sample drawing
L
with the applied equidistant tool path.
a = 2.25 x tan18
a = 0.7311 The question now is - what to do about the point coordi-
nates that have just been calculated and stored in the above
P3(Y) = 1.125 + a table. Are they useful? Can they be used in a program? Yes
P3(Y) = 1.8561 to the first question, but not yet to the second. A few addi-
tional conditions have to be taken into consideration.
Figure 30-4

Trigonometric calculations to find unknown Y coordinate


CUTTER RADIUS OFFSET 249

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
.

points cannot be calculated at all, without knowing the cut-


ter radius first.

Cutter Radius

The nominal is always known on new


radius of the cutter
have been physically measured. For high
tools, or tools that
precision work, the radius of the cutter must be known al-
most 100%, say within .0001" (0.0025 = 2.5 micron). mm
That is not always possible for reground tools, tools previ-
ously used, or tools that are undersize or oversize for some
reason. All this means that programming the centerline of
Calculation of P2 for the cutter center point
the cutter requires the exact tool radius to be known at the

lime of programming, in all cases.

Center Points Calculation

Coordinate points illustrated in Figure 30-5 above, repre-


sent the center of the cutter radius at each contour change
point. Now, another requirement can be brought into the
picture, the cutter radius size. A new coordinate set of five
points can be developed. For the example, a brand new cut
ter of 0.750 will have .375 radius.

Which points can be 'read’ from the illustration directly,


without any trigonometric calculations? Look at and evalu-
ate Figure 30-6. Out often values required, only eight have
been identified, but also realize that the previous ten calcu- Calculation of P3 for the cutter center point

lations had to be done earlier as well, adding to the overall


programming effort.
Now, all XY coordinates are known, for all the center
points around the part contour.
These points are in the order
In order to finish the discussion on programming of the of machining and they will appear in that same order in the
cutter center, the two Y values for P2 and P3 have to be cal- program. Not just the point locations but also various G
culated. Let’s start with point P2. codes, M
codes, feedrates, and other data.
250 Chapter 30

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

dius offset feature at all. The tool path was developed in


Adjusting for the cutter wear
such a way that the contour change points had to be calcu-
lated with the cutter radius in effect. This method of pro- Adjusting for the cutter deflection
gramming added a great amount of time to the part devel-
Roughing and finishing operations
opment process, greatly increased the possibility of
programming errors and disallowed any Ilexibility during Maintaining machining tolerances ... and many others
machining. Even a small difference between the pro-
grammed cutter radius and the actual cutter radius required Every contouring requires the consideration of a cutter radius.
recalculation, a correction of the program and the creation
of a new punched tape (there was no CNC memory in those Some applications may not be too clear at the moment,
days). With the development of numerical control technol- but with increased knowledge of this topic, it will be easier
ogy, and the addition of a computer to the control system to understand the subject. The suggestions are only some of
(the modern CNC systems), the cutter compensation meth- the possibilities the automatic cutter radius offset offers.
ods have been made not only possible but also greatly sim- Now let’s look at its actual use in programming.
plified for the programmer.

Types of Cutter Radius Offset


PROGRAMMING TECHNIQUES
As the CNC
technology developed, so did the cutter ra- In order to program the. cutter radius in a compensated
dius offset methods. This development has taken three mode, the three items mentioned earlier must be known:
stages. Today, they are known as the three types of a cutter
the Type A. the Type B. and the Type C: Points of the drawing contour
radius offset -

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

Type B offset - old - uses only G40, G41 and G42


These items are the actual data sources. Computers only
in the program, but it does not look ahead.
work with data and the data has to be provided by the user.
Overcutting is possible for Type B offset.
For the purposes of this chapter, we assume that all data for
Type C offset - current - uses only G40, G41 and G42 the contour change points are based on the drawing the
in the program, but with the look ahead feature. XY drawing coordinates.
Overcutting is prevented for Type C offset.
CUTTER RADIUS OFFSET 251

Direction of Cutting Motion '/////////////////Z,.

Whenever an external or an internal tool path is pro-


grammed, there always be a choice of two directions.
will (7) ^
%///////////////Z^ 1
For now only, the directions can be called the clockwise and
a b
the counterclockwise direction around the part contour.
'/////////////////a.
This general motion direction is compounded by the fact r
if
that there is a specific motion of the table (in milling), or the LEFT
-*
motion ol'the tool (in turning). These are two very separate L J
vW//////////////y
groups that need to be clarified - which one to consider -
motion of the table or motion of the tool? Keep in mind, c LEFT*” “C

that regardless of the CNC machine type it is imperative to , V///////////////Z/,.

follow one basic rule of CNC programming:


RIGHT
InCNC programming, always consider the cutting tool ^//////////////^
moving around the part, never the other way around.
“‘right f
External tool motion Internal tool motion
This statement is true for CNC lathes, where it is obvious,
Figure 30-9
but it is also true for CNC machining centers, where it is

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

sition of an object with respect to a certain previously es-


tablished viewing direction. A moving object is said to be to G41 or G42 mode is canceled by the G40 command:
the left or to the right of a stationary object, depending on
the direction of its movement.
G40 Cutter radius offset mode CANCEL
In CNC programming, there is no difference. The com-
pensated cutter tool path is positioned to the left or to the
Figure 30-10 shows all three radius offset commands:
right of the stationary contour, when looking into the cutter
path direction, as illustrated in Figure 30-9.

The illustration shows all three options - a cutter without


a direction, a cutter with direction specified and positioned
to the left of the contour, and a cutter with direction speci-
fied and positioned to the right of the contour.

Out of the two compensation options, which one is bel-


ter? Compensation to the left is preferred on CNC machin-
ing centers, because it produces a climb milling mode of
cutting, assuming that a standard right-hand tool is used
with M03 rotation. There might be a case for the compen-
sation to the right, causing so called conventional milling
mode of cutting. This mode should be used only in special
cases, after consultation with a tooling specialist. This only
applies to milling systems, not to turning.
Application of G41, G42 and G40, to the cutter path
252 Chapter 30

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:

Type A - lowest level of flexibility

Type B - medium level of flexibility

Type C - highest level of flexibility

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

llexibility is very limited, because this offset type shares the


question at this stage is - if the actual cutter radius is not
where tool length values with the cutter radius values in a single
specified in the program, is it specified?
column. Because of the data sharing for two different off-
First, look at Figure 30-12 -
it illustrates the effect of dif- sets. it is often called the shared offset. In practice it means
ferent cutter radii applied to the same part contour. that the tool length offset value is stored in the same control
registry area as the tool radius value.Addresses H and/or D
can be used, with details covered later. Controls equipped
with this type of tool offset memory are the most economi-
cal type in their class.

Tool Offset Memory Type B

While the Type A offset has only a single screen column.


Type B has two columns. Now - do not assume! The two
columns are not separate columns for tool length values
and tool radius values at all. They are separated for the Ge-
ometry Offset in one column and the Wear Offset in the sec-
ond column. Apart of this distinction, the Type B is still a
shared type of offset for both, tool length and tool radius
values. Again, the program uses addresses H and/or D.
Effect of the cutter radius on the actual tool path
CUTTER RADIUS OFFSET 253

Tool Offset Memory Type C Address H or D ?

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.

tinctionof the Geometry Offset and the Wear Offset, as the


Both the Type A and the Type B are shared type offsets,
Type B does. That means the control display will now 2+2
with only a single register, where the tool length offset val-
columns - yes, four columns in total. In this type, normally
ues are stored along with the cutter radius offset amounts.
addresses H and D will be used for their unique purposes.
Normally, the Type A and Type B are associated with the ad-
It is relatively easy to tell which offset type is available - dress H only. That means the H address is used with the
just look at the control display. Figure 30-/3 shows the typ- G43 command, as well as with the G4 or G42 commands. 1

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

For the offset Type two columns available, but


B, there are
Figure 30-13
it is still a shared offset. The entry in the offset screen will
Fanuc tool offset memory types A, B, C from the top down be similar to the Type A, shown in Figure 30-15:

Programming Format Offset Geometry Wear


No.
The minimum information supplied to the control system
in the CNC program is the offset command G4 1 or G42, al-
05 -8.6640 0.0000
ways combined with the H or D address in effect, usually
applied during a single axis motion (multi-axis motion is
35 0.3750 0.0000
also allowed, if programmed carefully):

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:

Always apply the cutter radius offset

-8.6640 together with a tool motion


05 0.0000 0.3750 0.0000

These two rules are not arbitrary - rules can be broken.


Figure 30-16 The suggestion here is to follow the rules until a better way
Unique offset register screen for tool offset memory Type C is found. When selecting a startup tool position, a few ques-
tions are worth asking:

Geometry and Wear Offsets What is the intended cutter diameter?

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.

APPLYING CUTTER RADIUS OFFSET

All programming aids required to apply the cutter radius


offset in an actual CNC program are now known. The ac-
tual application, the use the offset in a CNC pro-
way to
gram, as well as the methods of proper usage, will be dis-
cussed next. There are four major keys to a successful use
of the cutter radius offset feature:

1 .To know how to start the offset

To know how to change the offset

To know how to end the offset

To know what to watch between the start and end

Each item is important and will be discussed in order.


Start position of the cutter before radius offset is applied

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:

Nil G01 X-0.625


N. . G01 G41 X0 D01 F15.0
N. Yl. 125 (P2)
.
Now the cutter has left the part contour area and the cutter
N
radius offset is not required anymore. It will be canceled

The option (b) is technically correct, but requires three shortly, but a little review of the startup may help.

motions, whereas two motions are quite sufficient. This


The cutter radius was known for this job, which is not al-
version will not be selected for the final program, although
ways the case. The programmer needs a suitable tool, be-
the program would still be correct:
cause the cutting values depend on it. Within reason, a
O. 750 or 0.875 cutter are not far apart - except for clear-
N. G01 G41 Y0 D01 F15.0
.
ances. The clearance of .250 was selected for .375 cutter
N. X0.

radius. That means the program is still good for cutters up


N.. Yl. 125 (P2)
N to and including 01.25. CNC operator has this freedom,
because the only change is to the D01 offset amount in the
256 Chapter 30

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?

N6 G41 XO D01 F15.0

It is not as simple as it looks. We cannot evaluate just one


block, such as N6, and know
exactly what happens. The
programmer has to understand what the control will do.
Computers do not think, they only execute the programmed
instructions and follow these instructions very diligently.
Block N6
an instruction: Move to XO, apply the radius
is

value stored in DO I to the left, during a linear motion at 15


in/min. This is the program instruction to the control
system. Where does the tool stop? Look at Figure 30-20 :

Figure 30-1

Cutter radius offset cancellation - program 03001

03001 (DRAWING FIGURE 30-2)


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. 125 <P2)
N8 X2.25 Yl 8561 . (P3)
N9 Y0.625 (P4)
N10 G02 XI. 625 YO R0.625 (P5)
Nil G01 X-0.625
N12 GOO G40 Y-0.625 (CANCEL OFFSET)
N13 Z1.0 MO
N14 G28 X-0.625 Y-0.625 Z1.0
N15 M30 Ambiguous startup for a cutter motion in radius offset mode
%
CUTTER RADIUS OFFSET 257

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 :

N17 G90 G54 GOO X-0.75 Y-0.75 S800 M03

N20 G01 XO D01 F17.0 (START OFFSET)


N21 MO 8 (NO MOTION BLOCK)
N22 Y2.5 (MOTION BLOCK)

What is the difference in the program structure? Ignore


the reason for the coolant ON function in block N21. If it

can be justified, there is nothing wrong with it. The fact re-

o Y-1.125 mains - there is no axis motion in block N21, which is the


same block ahead to for the di-
the control system will look
rection of the next tool motion. Look at one more program
Figure 30-21 selection - again, as a new example:
Importance of the next tool motion for cutter radius offset.
Y+ next direction on the left, Y- next direction on the right O Example - two NO MOTION blocks :

N17 G90 G54 GOO X-0.75 Y-0.75 S800 M03


Look-Ahead Offset Type
N20 G01 XO D01 F17.0 (START OFFSET)
The block N6 alone does not contain sufficient amount of N21 MO 8 (NO MOTION BLOCK)
data to successfully apply the radius offset. The next motion N22 G04 P1000 (NO MOTION BLOCK)
- in fact, the direction of the next motion - must be known to N23 Y2.5 (MOTION BLOCK)
the control system at all times!
258 Chapter 30

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.

One simple - but very basic - rule should help to make


sure the cutter radius offset will not fail:

The radius of the cutter should be smaller


than the programmed length of the tool travel.

in the program 03001 the tool starting po-


For example, ,

sition X-0.625, the target position is XO. That means


is at

the programmed length of the tool travel is .625. The radius


selected was .375, which is smaller and adheres to the rule.

There are two other possibilities - one, where the cutter


radius is the same as the programmed length of the tool

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

N3 G90 G54 GOO X-0.25 Y-0.625 S920 M03

N6 G41 XO D01 F15.0 (START OFFSET)


N7 Yl. 125 (P2)

What will happen here? As usually, the control calculates


the difference between the programmed travel length of .25
and the cutter radius .375. check the direction of the
It will
next travel as Y positive and determines that because the
cutter is positioned to the left of the intended motion, it has
to move 125 in the
. X
minus direction! That does not seem
to be a problem, because there is a plenty of free space. But
there is a problem - the control does not recognize the fact
that there a free space! Programmer knows it, but the
is

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.

Figure 30-24 shows a start position where the cutter is


Radius Offset Interference
partiallyon the other side of the target position. This is defi-
nitely not allowed and the control system will respond with The last example illustrated only one of several possi-
an alarm warning - the infamous 'Cutter radius inteifer- bilities, when the cutter radius offset alarm may occur. An-
ence' alarm or ‘CRC interference’ message, Alarm #041. other cause for this alarm is when a cutter radius is trying to
enter an area that is smaller than the cutter radius, stored as
the D offset amount. To illustrate, evaluate the next pro-
gram 03003, for a simple part shown in Figure 30-25.

~"
Scale 1:1
R0.20
“*• 100

Cutter start position is smaller then the cutter radius

The following program sample is very similar to the pre-


vious examples, except the X axis start position is too close
to the target position, if the cutter is stored in the D01 regis- Figure 30-25
ter in the amount of .3750: Simple drawing for program 03003
260 Chapter 30

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
%

The program is quite simple, it is correct and it follows all

rules discussed so far. The key to success is the selection of


the cutter diameter and the entry amount of the D address
into the control system. Let’s see what happen - the will
same cutter is used as before, a 0.750 inch end mill. The
amount of D01 stored in the control will be .3750. GOUGE AREA
The control unit will process the information from the
D01 = 0.375 SCALE = 1:1

program combined with the offset amounts to determine Figure 30-26


the tool motion. Then, it executes the blocks as it moves the Effect of overcutting fgouging) in cutter radius offset mode.
tool along the part. Suddenly, at block N7 alarm No. 041 Type C radius offset (look ahead type) does not allow overcutting
occurs - cutter radius interference problem.

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

gram is OK. Check the offset input in D01. The amount of


no problems. Now we look at internal cutting.

.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.

Always evaluate the relationships between:


— —H
b" 1.5 h-— 1.5—
Drawing dimensions . . . and . . Program input

Program input ... and .. . Offset amounts

Offset amounts ... and .. . Drawing dimensions

This circular advice may take a while getting used to. It

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 :

side of the illustration contains the following blocks - only


the starting program blocks are listed: N1 G20 (CORRECT APPROACH WITH ONE AXIS)
N2 G17 G40 G80
N1 G20 (CORRECT APPROACH WITH A SINGLE AXIS) N3 G90 G54 GOO X-0.625 Y-0.625 S920 M03
N2 G17 G40 G80
N3 G90 G54 GOO XO YO S1200 M03 N6 G41 XO D01 F15.0 (START OFFSET)
N4 G43 Z0.1 HOI M08 N7 Y1.125 (P2)
N5 Q01 Z-0.25 F6.0 (FOR 0.25 POCKET DEPTH)
N6 G41 Y-0.75 D01 F10 0 (START OFFSET)
.

N7 XO .75 O Correct approach - multiaxis motion :

N8 YO 75 .

N1 G20 (CORRECT APPROACH WITH TWO AXES)


N2 G17 G40 G80
There is no internal radius in the program to worry about, N3 G90 G54 GOO X-0.625 Y-0.625 S920 M03
so the amount stored in the offset register D01 does not
have to consider it and will represents the cutter radius as is. N6 G41 XO YO D01 F15.0 (START OFFSET)
N7 Y1.125 (P2)

O Incorrect approach - multiaxis motion :

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-

N3 G54 GOO XO YO S1200 M03


G90 ence’ is of no consequence - it takes place while in the air.
N4 Z0.1 HOI M08
G43
N5 Z-0.25 F6.0
G01 (FOR 0.25 POCKET DEPTH) There will always be a problem that cannot be solved in
N6 G41 XO 75 Y-0.75 D01 F10.0
. (START OFFSET) any handbook, regardless of how comprehensive that book
N7 YO 75 .
may be. The subjects and examples included in this hand-
book present common basis for a better understanding of
the subject. With growing experience, the understanding
There is no way the control system can detect the bottom
wall of the pocket at Y-0.75. The startup for the offset is ex-
becomes much deeper. Before going any further, let’s re-
view some general rules of the cutter radius offset feature.
actly the same as for external cutting, but more damaging.

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

started with a single axis motion, the result is shown at the


side illustration in Figure 30-28. If the offset is started
Reminders and rules are only important until a particular
left
shown subject is fully understood. Until then, a general overview
with a two-axis motion, the result is at the right side

illustration in Figure 30-28.


and some additional points of interest do come handy. Pro-
gramming the cutter radius offset is no different. The fol-
lowing items arc marked [M] for milling, [T] for turning,
and [M-T] for both types of control systems:

[
M-T ]
Never start or cancel the radius offset in an

arc cutting mode (with G02 or G03 in effect). Between


the startup block and the cancel block, arc commands
are allowed and normal, if the job requires them.

[
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).

Two axis approach - shown on the right


262 Chapter 30

[
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),

watch for blocks that do not contain an axis motion.


Avoid non-motion blocks if possible (missing X, Y and Z).

[
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

understood is the difference between the programmed and


Undersize ... will be scrap for external cutting
the measured part size.
The first outcome is always ideal, regardless of whether
Part Tolerances the external or internal cutting takes place. If the measured
dimension is on size - that is within the specified tolerances
When the machining is completed on a CNC machine - there is no need to do anything, the part is good. The sec-

(sometimes even before that), the part has to pass through


ond outcome (oversize) and the third outcome (undersize)
some inspection process. Thatmeans drawing require- all
have to be considered together.
ments have to be met for the part to pass the inspection.
One of the requirements is to maintain dimensional toler- In both cases, the measured dimension is outside of the
ances, either as specified in the drawing, or as implied in specified tolerance range. This situation requires a look at

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

Condition External Internal

Oversize Recut Possible Scrap Likely

On Size No Action Required No Action Required

Undersize Scrap Likely Recut Possible

Looking at the table, it is clear that no action is necessary


ifthe measured part size is within tolerances, regardless of
whether the external or the internal cutting took place. For
the oversize or undersize results, a recut may be possible or
a scrap will be the likely result.

A part machined externally (02.500 inch OD in the ex-


ample) that is measured as larger than the allowed toler-
ance can likely be recut, but a size that is smaller than the
allowed tolerance range will result in a scrap.

A part machined internally (02.000 inch ID in the exam-


ple) that is measured as smaller than the allowed tolerance
can likely be recut, but a size that is larger then the allowed
tolerance range will result in a scrap. Detail for external tool path shown in example 03004

Programmed Offsets

The most attractive feature of the cutter radius offset is


that it allows to change the actual tool size right on the ma-
chine, by means of the offset register function D. In the pro-
gram example, only one tool is used - .750 inch diameter
end mill - and one single cut for each contour (external and
internal). The program X0Y0Z0 is at the center of the cir-
cles and the top of the part:

03004 (T01 - 0.75 DIA END FINISHING MILL)

(**** PART 1-2.5 DIA EXTERNAL CUTTING **** )

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

The of machining is that a zero diameter cutter is


reality

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

ter radius registered in offset 1 D02 to the radius registered


options. In both cases, the cutting tool moves from the
,

starting position, within the clear area, to the target posi-


in offset 2, etc. What actual amounts are in these registers?
tion of the machining contour. This is the motion where the
Since no radius of the cutter is included anywhere in the cutter radius offset is applied, so this motion is critical. In
program, the offset register D must normally contain the fact, this is the motion that determines the final measured
cutter radius actual value. Be careful - some machine pa- size of the part. Each method can be considered separately.
rameters may actually be set to accept the cutter diameter .

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 :

NEGATIVE increment to the cutter radius offset will cause


the cutting tool to move CLOSER to the machined contour. 2.5010 with D01 = 0.3750

This is - no offset adjustment is necessary.


the ideal result
Note the word 'increment' it means that the current ra-
dius offset amount will be changed or updated - but not re-
The edge touches the intended machining sur-
tool cutting

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 :

the external and internal adjustments has two alternatives:


2.5060 with D01 = 0.3750
To ADD more material TO the measured size,
The measured diameter is .005 oversize. The tool edge
use LARGER setting amount of the D offset
has not reached the contour and has to move closer to it.
The radius offset amount has to decrease by one half of the
To REMOVE material FROM the measured size,
oversize amount, which is on the diameter or width but the
use SMALLER setting amount of the 0 offset offset amount is entered as a radius, per one side. Offset
D01 is adjusted incrementally by .0025, to D01=0.3725.
Experienced CNC operators can change offset settings at
the machine, providing the program contains the cutter ra- O External measured dimension - Example 3:
CUTTER RADIUS OFFSET 265

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

amount has to be increased by one half of the undersize


offsets in the program needed or a will a single offset do?
amount. The undersize is measured on the diameter (or
width) of the part, but the offset amount is entered as a ra- Keep in mindfew examples evaluated only
that the last
dius, per side only. The D01 offset is adjusted incre- possibilities thatwere independent from each other, with
mentally by .004. to DO 1=0.3790. no common connection. Program 03004 presents a com-
mon connection between the two diameters. It is one 0.750
Offset for Internal Cutting end mill, used for cutting both diameters.

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

This is no offset ad justment is necessary.


the ideal result -
The CNC operator should always be aware of the offsets
The edge touches the intended machining sur-
tool cutting
used in the program and understand about the stored offset
face exactly. All is working well and the offset setting is ac- amounts, especially if more than one offset is used for one tool.
curate. Only normal monitoring is required.

O Internal measured dimension - Example 5 :


In the
ways list
setup or tooling sheet, the programmer should
the offsets used in the program and suggest
al-

the
starting values for each offset as a professional courtesy.
2.0060 with Dll = 0.3750

The Preventing a Scrap


The measured diameter is edge
.005 oversize. tool
has reached beyond the intended machining surface and When it comes to initial offset amounts, some creative
has to move away from it. The radius offset value has to be techniques can be used here. The goal is to use offset set-
increased by one half of the oversize amount. The oversize tings in such a way be a scrap,
that the part will not likely
is on the diameter (or width), but the offset amount is en-
even with an unproven tool. A good operator can prevent
tered as a radius, per side only. The D1 offset must be 1
scraps caused by wrong offsets, at least to some degree.
incremented by .0025, to D1 1=0.3775. The key is to create some temporary offset settings. The
goal to force a cut that oversize externally or undersize
O Internal measured dimension - Example 6 :
is

internally, measure it, adjust


is

it, then recut to the right size.

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-

tered as a radius, per side only. The Dl offset must be in-


1
In internal contour machining, the diameter can be cut in-
cremented by .004, to Dl 1=0.3710. tentionally smaller than required, in a controlled way. In
this case, the risk that the diameter will be too large is pres-
ent. Either case offers benefits but some drawbacks, too.
266 Chapter 30

In the last few examples, the solution is to move the tool


away from the intended external machined surface by a
positive offset increment. The increment amount must be
greater than the expected error of the tool radius, as well as
being suitable for a recut.

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.

Program Data - Nominal or Middle?


Tool reference point for turning and boring - (a) turning, (b) boring
Many coordinate locations in the program reflect actual
dimensions that are taken from the drawing. The question Radius Offset Commands
is - what happens if the drawing dimension specifies a tol-

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.

TOOL NOSE RADIUS OFFSET

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)

Tool Tip Orientation


Because the tool cutting edge is often called a tool nose,
the term tool nose radius offset became common. The center of a circle symbolizing an end mill must be
equidistant to the contour by its radius. In milling, cutting
Tool Nose Tip edges are part of the tool radius, on lathes, they are not.
Lathe tools do have a radius but separate cutting edges. The
The tool nose is usually the corner of the tool, where two
shows nose radius center is also equidistant from the contour, and
cutting edges blend into a nose radius. Figure 30-32
the edges change their orientation, even for the same insert.
typical corners of a turning tool and a boring tool.
Additional definitions are needed in a form of a vector
The nose reference point in turning is often called the
tool pointing towards the radius center. This vector is called the
command point, the imaginary point and. lately, even the tool tip orientation, numbered arbitrarily. Control uses this

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

single axis motions are part of a contour that also includes


radii, chamfers and tapers. In nose radius
this case, the tool
offset is needed, otherwise all radii, chamfers and tapers
will not be correct. The illustration in Figure 30-37 shows
what areas of the part would be undercut or overcut, if the
tool nose radius offset were not used during machining.

Figure 30-34

Relationship of the tool reference point and the nose radius center

The tip orientation is entered during the setup, according


to arbitrary rules. Fanuc controls require a fixed number for
each possible tool tip. This number has to be entered into
the offset screen at the control, under the T heading. The
value of the tool radius R must also be entered. If the tool
tip is0 or 9, the control will compensate to the center. Fig-
ures 30-35 and 30-36 show the standard tool tip numbering
for CNC lathes with X+ up and Z+ to the right of origin.

Effect of tool nose radius offset - (a) offset not used (b) offset used

Sample Program

The following program example 03005 shows a simple


application of the tool nose radius offset on an external and
internal contour, based on the drawing in Figure 30-38.
Figure 30-35 Only the finishing cuts are shown - roughing is also neces-
Arbitrary tool tip numbers for nose radius offset - rear lathe shown sary, but would most likely use the special G7 1 multiple
repetitive cycle, described in Chapter 35.
6
2 1 oo
Nm in in
CM CM
O
CM
/ \ CO CM
cmcm
T
T“ O
*0
c
/ \
*
?o
NN NN NN
9 X4.750
7- - -yM— - - —
5 X4.510
0
X3.250
TLR — \ '

/ 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

Effect of Tool Nose Radius Offset


c\i cmcm’ o
Some programmers do not bother using the tool nose ra- N nn N
dius offset. That is wrong! Theoretically, there is no need
Figure 30-38
for the offset if only a single axis is programmed. However,
Simplified sample drawing for program example 03005
268 Chapter 30

03005 In tool nose radius offset, programming the minimum


clearance of at least .100 inches per side (2.5 mm), provides
N31 T0300 (EXTERNAL FINISHING) a sufficient clearance for all three standard tool nose radii -
N32 G96 S450 M03
N33 GOO G42 X2.21 ZO.l T0303 M08
1/64, 1/32 and 3/64 (0.40, 0.80 and 1 .20 mm respectively).
N34 G01 X2.65 Z-0.12 F0.007
N35 Z-0.825 F0.01 Change of Motion Direction
N36 X3.25 Z-1.125
N37 Z-1.85 On CNC lathes, a change in cutting direction is used
N38 G02 X4.05 Z-2.25 R0.4 much more often than on machining centers. The following
N39 G01 X4.51 example shows a facing cut on a solid face with G4 in ef- 1

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

N44 T0400 (INTERNAL FINISHING) o


CD
'TOO
u.
N45 G96 S400 M03 N I

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. .

Face cutting is a single axis motion and the offset


is used

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,

N21 T0100 (INCORRECT VERSION)


N22 G96 S400 M03
N23 GOO G41 XI. 7 ZO T0101 M08 (START)
Minimum clearance for tool nose radius offset
N24 G01 X-0.07 F0.007 (FACE OFF)
N25 GOO G42 XI. 0 ZO.l (*** WRONG ***)
Figure 30-39 shows minimum clearances when set at the
Make sure the nose radius fits into the N26 G01 XI. 4 Z-0.1 F0.012 (CONTOURING)
start and end of cut.
N27 Z-0.65
clearance two or more times. Symbols >TLR x 2 and x 4
N28 X.
mean the clearance should be greater than twice or four
times the nose radius. Double radius per side becomes a ... the face will never be completed! Think about it.

quadruple radius on a diameter.


31 PLANE SELECTION

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

any number of axes simultaneously, as long as the resulting


tool motion is safe within the work area. No special consid-
MACHINING IN PLANES
erations are required, no special programming is needed.
The path of a cutting tool is a combination of straight
That is not the case for the following three programming lines and arcs. A tool motion in one or two axes always
procedures, where the various considerations change quite takes place in a plane designated by two axes. This type of
significantly: motion two-dimensional. In contrast, any tool motion
is

that takes place in three axes at the same time is a three-


Circular motion using the G02 or G03 command
dimensional motion.
Cutter radius offset using the G41 or G42 command

Fixed cycles using the G81 to G89 commands, Mathematical Planes


or G73, G74 and G76 commands
In CNC machining, the only planes that can be defined

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:

WHAT IS A PLANE? XY plane ZX plane YZ plane

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

This international standard based on the mathematical


is

of the plane designation al-


Y X Z
rule that specifies the first letter
ways refers to the horizontal axis and the second letter re-
fers to the vertical axis when the plane is viewed. Both axes
are always orthogonal (horizontal and vertical) and per-
pendicular (at 90°) to each other. In CAD/CAM. this stan-
dard defines the difference between the top and bottom, TOP-XY LEFT-ZX RIGHT -YZ
front and back, etc.
STANDARD DEFINITION OF PLANES
A simple way to remember mathematical designation of
axes for all three planes is to write the alphabetical order of
Y Z Z
all three axes twice and isolate each pair with a space:

XYZXYZ ... becomes ... XY ZX YZ


-X J— —*OC 1
Y
In mathematical terms, the planes are defined as: TOP-XY FRONT XZ
RIGHT - YZ -

PLANES ON A VERTICAL MACHINING CENTER


Plane Horizontal Axis Vertical Axis Figure 31-1

XY X Y Comparison ol standard mathematical planes (above),


and planes on a CNC machining center (below)
ZX Z X
In programming, the selection of planes is extremely im-
YZ Y Z
portant, yet often neglected and even misunderstood by
programmers and operators alike. The main reason is that
Note the emphasis on the word 'mathematical'. The em- the majority of tool motions (particularly for contouring)
phasis is intentional, and for a very good reason. As will are programmed and machined in the standard XY plane.
soon be apparent, there is a great difference between the On all CNC machining centers, the spindle is always per-
mathematical planes and the machine planes, as defined by pendicular to the XY plane. Vertical and horizontal appli-
the viewing direction of the machine. cations are the same in this respect.

Machine Tool Planes Program Commands for Planes Definition

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:

u The top view ... XY plane


G17 XY plane selection
The front view ... XZ plane

The right side view ... YZ plane G18 ZX plane selection

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

- a very important distinction. plane selection is very critical.


PLANE SELECTION 271

Default Control Status


CIRCULAR INTERPOLATION IN PLANES
If the plane is not selected by the program, the control de-
faults automatically to G17 XY plane in milling and G18 In order to complete a circular motion correctly, the con-
ZX plane in turning. If the code is pro-
plane selection G trol system has to receive sufficient information from the
grammed, it should be included at the program beginning. part program. Unlike rapid positioning with GOO in effect
Since the three plane commands only have affect on circu- or linear interpolation with G01 in effect, the circular inter-
lar motions cutter radius offsets and fixed cycles the plane
, , polation requires a programmed direction of motion. G02
selection command G 7, G 8 or G 9 can be programmed
1 1 1
is the command for CW direction and G03 is the command
before any of these machining motions take place. for CCW direction. According to generalmathematical
rules, the clockwise direction is always viewed from the
Always program the appropriate plane selection command. vertical axis towards the horizontal axis in any selected
Never rely on the control settings !
plane. Counterclockwise direction is always viewed from
the horizontal axis towards the vertical axis.
Any plane selection change is programmed as desired,
prior to actual tool path change. Plane can be changed as When we compare the mathematical axes designation
often as necessary in a program, but only one plane can be and the actual orientation of the machine axes (based on a
vertical machining center), the XY plane (G 17) and the YZ
active at any time. Selection of one plane cancels any other
plane, so the G17/G18/G19 commands cancel each other. plane (G19) correspond to each other. These two planes

Although true in an informative sense, it is most likely that


normally present no problems to CNC programmers. The

the opportunities to mix all three plane commands a sin- in


ZX plane (G 8) may cause a serious problem if not prop-
1

erly understood. Mathematically, the horizontal axis in


gle program are remote. From all three available motions,
only the circular motion is affected by plane selection, but G18 plane is the Z axis and the X axis is the vertical axis.

let’s have look at the programming of a rapid and linear


On a vertical machining center, the order of machine axes
motions as well, at least for comparison purposes. orientation is reversed. It is important to understand that the
clockwise and counterclockwise directions only appear to
be reversed, but in reality, they are the same. If the mathe-
STRAIGHT MOTION IN PLANES matical axes orientation is aligned with the machine axes,
they will indeed match. Figure 31-2 shows the steps of
Both rapid motions GOO and linear motions G01 are con- aligning the mathematical planes with the machine planes:
sidered straight motions when compared with circular mo-
tions. Straight motions can be programmed for a single axis >(
a
or as a simultaneous motion along two or three axes. The
*^503
STANDARD
following examples only show typical unrelated blocks:
MATHEMATICAL
O Example - Rapid positioning - GOO :
G02\\ ZX plane
-Z
GO 0 X5 0 Y3 0
. . XY plane 2D rapid motion
- >( b

GOO X7.5 Z-1.5 XZ plane -2D rapid motion STANDARD


GOO Y10.0 Z-0.25 YZ plane -2D rapid motion ZX PLANE
GOO X2.0 Y4.0 Z-0.75 XY7. - ID rapid motion
f/soo MIRRORED
s-*—
O Example - Linear interpolation - G01 :

L1 CO
c

G01 X-1.5 Y4.46 F15.0 XY plane 2D linear motion


-
\8
G01 X8.875 Z-0.84 F10 . 0 ZX plane - 2D linear motion
O
PLANE ROTATED
G01 Y12.34 Z0.1 F12.5 YZ plane -2D linear motion X AFTER MIRRORING
G01 X6.0 Y13.0 Z-1.24 F12 . 0 XYZ 3D linear motion
-
2
7
IS THE G18 PLANE
ON THE MACHINE
The examples
axes. Plane selection
any straight
refer to tool

motion (along a single


motion along the programmed
command does not need to be used
axis), unless the cutter
for >\ G02 *
G °3
*

radius offset or a fixed cycle is in effect. All tool motions -X


will be interpreted correctly by the control, regardless of
Figure 31-2
any plane in effect. The rules that apply to linear motions
Progressive steps in aligning the mathematical ZX plane
are not the same for circular motions.
with the machine XZ plane, using G18 plane selection
272 Chapter 31

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).

On horizontal machining centers, the situation is similar.


Some older control systems do not accept the direct ra-

The XY plane (G17) and the ZX plane (G18) match be-


dius designation specified by the R address. Instead, the arc

tween mathematical designation and the actual axes orien-


vectors 1, J and K must be used. For programming circular
motion within a selected plane, correct pair of arc vectors
tation. It is the G 19 plane (YZ) that appears to be reversed
must be selected:
and may cause some problems before the logical structure
of the planes is well understood.
G17 G02 (G03) X.. Y. . I.. J.
1'he proper selection of a machining plane will enable
programming various contouring operations using circular
G18 G02 (G03) X.. Z.. I.. K.

and helical interpolation, cutter radius offset and fixed cy-


G19 G02 (G03) Y. . Z.. J. . K.
cles. The most common applications of this type of ma-
chining are filleted (blend) radii, intersecting radii, circular
From the previous topics, remember that:
pockets, profiled counterbores, cylinders, simple spheres
and cones, and other similar shapes. XY axes - G17 plane - I and J arc center modifiers

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

The programming format described here contains com-


plete data for the end point of a circular motion. In practice,
however, an experienced programmer does not repeat the
modal values from one block to another. The major reason
for this approach is saving programming time, shortening
the program length and increasing the available memory
space in the control system.

The portion of the following program example shows a


typical application in a program where modal axes values
are not repeated in subsequent blocks:

N. . G20 English writs

N40 G17 XY plane selected


N41 GOO X20.0 Y7.5 Z-3.0 Stan position ofthe tool
Figure 31-3 N42 G01 X13.0 F10.0 Plane selection irrelevant
Actual circular tool path direction in all three machine planes. N43 G18 G02 X7 0 R3 . . Z axis is asswned as absent
Note the apparent inconsistency for the G18 plane
N44 G17 G01 X0 Plane selection irrelevant

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
. .

N120 G90 GOO G41 X50.0 Y100.0 Z20.0 D25


An interesting situation will develop if the plane selection N121 G01 X90.0 Y140.0 Z0 F180.0
command G18 in block N43 is absent, but the circular in-
terpolation block contains two axes coordinates for the end The compensated tool position when block N 120 is com-
point of the circular motion: pleted, will depend on the plane G 1 7, G 1 8 or G 9 currently
1

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

programmed. This is because of the special control feature


If G1 8 command is programmed with three axes :

called complete instruction or complete data priority, pro-


vided in block N43 of the last example. The inclusion of
G18X.. Y.. Z.. ZX motion will be compensated
two axes for the end point of circular motion has a higher
priority rating than a plane selection command itself. A
complete block is one that includes all necessary addresses If G19 command is programmed with three axes :

without taking on modal values.


G19X.. Y.. Z.. YZ motion will be compensated

Two axes programmed in a single block


The following practical programming example illustrates
override the active plane selection command.
both circular interpolation and cutter radius offset as they
are applied in different planes.

Cutter Radius Offset in Planes


PRACTICAL EXAMPLE
The plane selection for rapid or linear motion is irrele-

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

03101 The last programming item relating to plane selection is

N1 G20 the application of planes in fixed cycles. For cycles in the


N2 G18 (ZX PLANE SELECTED) G 17 plane (XY hole locations), G 17 is only important if a
N3 G90 G54 GOO X-O.l YO S600 M03 switch from one plane to another is contained in the same
N4 G43 Z2.0 HOI M08
program. With special machine attachments, such as right
N5 G01 G42 Z0.5 D01 F8.0
angle heads, the drill or other tool is positioned perpendic-
N6 XI.
N7 G03 X2.5 10.75 (= G03 X2 5 ZO 5 10.75 KO)
. .
ular to the normal spindle axis, being in G 1 8 or G 1 9 plane.
N8 G01 X3.6
Although the right angle heads are not very common, in
N9 G91 G41 YO 05 .

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

Facing operations for thin walls


The solid carbide end mills and end mills with replace-
able carbide spiral flutes or inserts are frequently used for Counterboring
many different jobs. Most typical are jobs requiring a high
Spotfacing
metal removal rates and when machining hard materials.
The HSS end mill is still a common cutting tool choice for Chamfering
everyday machining.
Deburring
Many machining applications call for a harder tooling
End mills can be formed by grinding them into required
material than a high speed steel, but not as hard as carbide.
shapes. The most common shapes are the flat bottom end
As becomes an issue, the frequent solution
the tooling cost
mill (the most common type in machine shops), an end mill
is employ an end mill with additional hardeners, for ex-
to
with a full radius (often called a spherical or a ball nose end
ample a cobalt end mill. Such a tool is a little more expen-
mill), and an end mill with a corner radius (often called the
sive than a high speed steel tool, but far less expensive than
bull nose end mill).
a carbide tool. Cobalt based end mills have longer cutting
tool life and can be used the same way as a standard end Each type of an end mill is used for a specific type of ma-
mill, with a noticeably higher productivity rate. chining. Standard flat end mill used for all operations that
is

require a flat bottom and a sharp corner between the part


Solid carbide end mills arc also available in machine
wall and bottom. A ball nose end mill is used for simultane-
shops and commonly used as regular small tools. Larger
ous three dimensional (3D) machining on various surfaces.
toolsmade of solid carbide would be too expensive, so spe-
An end mill similar ro a ball nose type is the bull nose end
end mills with indexable inserts are the tools of choice.
cial
mill, used for either some 3D work, or for Hat surfaces that
They can be used for both roughing operations and preci-
require a corner radius between the part wall and bottom.
sion finishing work.
Other shapes are also required for some special machining,
at some technological consid-
This chapter takes a look for example, a center cutting end mill (called a slot drill), or
erations when the CNC program calls for an end mill of any a taper ball nose end mill.

type or for a similar tool that is used as a profiling tool for


Figure 32-1 shows the three most common types of end
peripheral cutting and contouring. This is an operation
mills used in industry and the relationship of cutter radius
when the side of the cutter does most of work.
to the cutter diameter.

275
276 Chapter 32

Relief Angles

It is always important to select the proper tool relief angle


for different materials being cut. Relief angle is also called
the clearance angle. For HSS milling cutters, the recom-
mended flute relief angles become larger for softer materi-
als.For example, the primary relief angle for steel is 3° to
5°, whereby the primary angle for aluminum is 10° to 12°.
The cutting tool representative will supply additional infor-
mation for a particular machining application.

End Mill Size

Three very important criteria relating to the size of an end


mill have to be considered for CNC machining:

End mill diameter

End mill length

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.

for CNC machining. When using a double end mill, make


The length of an end mill projected from the tool holder is
sure the unused end is not damaged in the tool holder, when
also very important. A long projection may cause chatter
mounted. On a CNC machine, all end mills are normally
that contributes to the wear of cutting edges. Another possi-
held in a collet type tool holder, providing the maximum ble side effect for a long tool is deflection. Deflection will
grip and concentricity. Chuck type holders are not recom-
negatively influence the size and surface finish quality of
mended for end mills of any kind. the finished part. Flute length is important for determina-
tion of the depth of cut.
Solid Carbide End Mills
Regardless of the overall tool length (the tool projection
In essence, the solid carbide end mills have the same
length from the spindle), the length of flutes determines the
characteristics as HSS types and vary only in the type of
cutting depth. Figure 32-2 shows a useful ratio of width vs.
material they are made of. Using a solid carbide end mill
depth of a rough side cut in milling:
requires special machining circumstances. The tool itself is
fairly expensive, and from the metallurgical point of view,
solid carbide is a brittle material that chips easily, particu-
larly atsharp corners, or when it is dropped or improperly
stored. When handled properly, it can remove metal with a
great efficiency and produce superior surface finishes.

Indexable Insert End Mills

The indexable insert end mills provide all the benefits of


solid carbide end mills, but with the added convenience of
replaceable carbide inserts. Many designs are available in

this category as well. The holders for these tools match


their internal diameter to the tool diameter. The tool has a
Figure 32-2
ground flat area where the holder mounting screw prevents
the tool from spinning. Flelationship of the end mill diameter to the depth of cut
for rough side cuts in milling
PERIPHERAL MILLING 277

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 ...

It is the area of small and medium end mill diameters that


requires the most attention. In this size range, the end mills r/min = Spindle speed (revolutions per minute)
1 2 = Constant to convert feet to inches
come in two-, three-, and four-flute configurations. So what
ft/min = Surface speed in feet per minute
are the benefits of a two-llute versus a three-flute versus a
7t = Constant for flat to diameter conversion
four-flute design, for example? The type of material is the -
D Diameter of the tool in inches
guiding factor here.
For the metric system, the formula is similar:
In this area material compositions, there is the expected
give and take situation or a trade off. On a positive side, the
fewer flutes an end mill has, the better conditions exist to
avoid a chip buildup between the flutes during heavy cuts.
Simply, there is more room. On the negative side, the fewer
flutes that work in the material, the slower feedrate has to
be programmed as each flute works harder. When cutting isf where ...

soft, nonferrous materials, such as aluminum, magnesium,


even copper, preventing a chip buildup is important, so a r/min = Spindle speed (revolutions per minute)

two-flute end mill type is practically the only choice, even


000
1 = Constant to convert mm to meters
m/min = Surface speed in meters per minute
if the feedrate has to be somewhat compromised. =
n Constant for flat to diameter conversion

A different scenario is presented for harder materials, be-


D = Diameter of the tool in millimeters

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

What about end mills? They seem to be


the three-flute - same material is used, just find out the ft/min rating for the

and in fact they are - compromise between the


a reasonable
material, which is applicable to any cutter size. The next
formula will do exactly that (tool diameter is in inches):
two-flute and four-flute types. Three-flute end mills have
never become a standard choice, even if their machining
capabilities are often very good to excellent. Machinists ?tx Dx r/min
ft/min =
have a difficulty to measure their diameter accurately, par-
12
ticularly with common machine shop tools such as a ver-
nier or a micrometer. However, they do work very well in
most materials. Metric formula is similar, but the tool diameter is in milli-
meters (mm):
Regardless of the number of flutes, an end mill with a
larger diameter will deflect less than a similar end mill with D
it x x r/ min
a small diameter. In addition, the effective length of the end m/min =
mill (measured as its overhang from the holder face) is im- 1000
portant. The longer is the tool, the greater is the deflection -

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:

the spindle speed in r/min must be known first. Also known


has to be the number of llutes and the chip load on each in/min
f
-
flute (suggested chip load is usually found in tool cata- 't

logues). For the English units, the chip load is measured in


r/min x N
inches per tooth (a tooth is the same as a flute or an insert),

with the abbreviation of in/tooth. The result is the cutting


Metric units formula very similar,
is it calculates the feed
feedrate that will be in inches per minute - in/min.
per tooth f in mm/toot h:

For a lathe feedrate using standard turning and boring


number of llutes is not applicable, the result is di-
tools, the - mm / min
f
't
rectly specified in inches per revolution (in/rev) or millime- r/min x N
ters per revolution mm/rev.

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,

listed for English units:


if used at high spindle speeds = high r/min

Carbide insert cutters will chip or even break,


mm /min = r/min x ft x N if the spindle speed is too low = low r/min

us? where ...

Coolants and Lubricants


mm/min = Feedrate in millimeters per minute
r/min = Spindle speed in revolutions per minute Using a coolant with a high speed steel (HSS) cutter is al-
f, = Chip load in millimeters per tooth
most mandatory for cutting all metals. Coolant extends the
N = Number of teeth (flutes)
tool life and its lubricating attributes contributes to the im-

As an example of the above formulas, a 0.750 four flute


proved surface finish. On the other hand, for carbide insert

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:

r/min = (12 x 100) / (3.14 x .750)


r/min = 509 Tool Chatter

There are many reasons why a chatter occurs during pe-


Cuttingfeedrate:
ripheral milling. Frequent causes arc weak tool setup, ex-
cessive tool length (overhang from tool holder), machining
in/min = 509 x .004 x 4
in/min = 8.1 thin walls of material with too much depth or too heavy
feedrate, etc. Cutter deflection may also contribute to the
For safety reasons, always consider the part and machine Tooling experts agree that well planned experi-
chatter.

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

Although peripheral milling is mainly a semifmishing


and finishing machining operation, end mills are also suc-
cessfully used for roughing. The flute configuration (flute
geometry) and its cutting edge are different for roughing
and finishing. A typical roughing end mill will have corru-
gated edges - a typical example is a Strasmann end mill.
Strasmann is said to be the original designer and developer
of roughing cutters and the trademarked name is now used
as a generic description of this type of roughing end mill.

Good machining practice for any stock removal is to use


large diameter end mill cutters with a short overhang, in or-
der to eliminate, or at least minimize, the tool chatter and
Typical entry angle for a ramping infeed into a solid material
tool deflection during heavy cuts.

For deep internal such as deep pockets, it is a


cavities, Direction of Cut
good full depth (or at least to the
practice to pre-drill to the
almost full depth), then use this new hole for an end mill The direction of a cut for contouring operations is con-
that is smaller than the drilled hole. Since the end mill trolled by the programmer. Cutting direction of the end mill
penetrates to the depth in an open space, the succeeding for peripheral milling will make a difference for most part
cuts will be mainly side milling operations, enlarging the materials, mainly of material removal and the
in the area

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.

Ramping is another process where the Z axis is used for


penetrating (entering) into a solid part material. This time,
however, the X axis or the Y axis are programmed simulta-
neously with the Z axis. Depending on the end mill diame-
ter, the typical ramping angle is about 25° for a 1 .000 inch

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.

Always be very careful from which XYZ tool position


the cutting tool will start cutting at the top part. Con-
of
sidering only the start point and the end point may not pro-
duce the best results. It is easy to have a good start and good
end tool positions, but somewhere during the cut, an un-
wanted section of the part may be removed accidentally. A
few simple calculations or a CAD system may help here. Direction of the cut relative to material, with M03 in effect
280 Chapter 32

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

In many applications for a CNC machining center, the PROGRAMMING SLOTS


material has to be removed from the inside of a certain area,
bounded by a contour and a flat bottom. This process is
Slots are often considered as special types of grooves.
generally known as pocketing. To have a true pocket, the
These ‘grooves' usually have one or two radial ends. If
contour that defines the pocket boundary must be closed. there are two ends, they are joined by a straight groove. A
However, there are many other applications, where the ma-
slot can be either open or closed, with the same si/.e radius
has to be removed from an open area, with only a par-
terial
on both ends, two different radii, or one radius only. A typi-
tial contour defined. An open slot is a good example of this
cal slot that has only one end radius is a keyway.
type. This chapter looks at applications of closed pockets,
partial pockets, slots and various programming techniques Slots can be open or closed, straight, angular, circular,
for internal material removal. with straight walls or shaped walls (using a tapering end
mill). Programming slots with accuracy in mind usually re-

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
-

walls of the slot are contoured under program control.


Open Boundary
Figure 33-1 shows a drawing of a typical open siot. This
An openboundary is not a true pocket, but belongs to a drawing will be used to illustrate the programming tech-
related category. Machining of this kind of a contour is niques of an open slot.

quite flexible, as the tool can reach the required depth in an


open space. Any good quality end mill in different varieties
can be used to machine an open boundary'.

Closed Boundary

The excessive material within a closed boundary can be


removed in two ways, depending on the cutting operation.
One way is to use an external tool and move it towards the
outside of the boundary, another way is to use an internal
tool and move it towards the inside of the boundary. In both
cases, the actual machining follows. Cutting along the out-
side of a part is not considered pocketing but peripheral
milling Chapter 32). Cutting on the inside of a closed
( An open slot programming example 03301
boundary is typical for machining pockets of various regu-
lar and irregular shapes. Some typical examples of regular
Open Slot Example
shape pockets are closed slots, rectangular pockets, circular
pockets, and so on. Irregular shape pockets can have any Before programming any tool motion, study the drawing.
machinable shape, but they still use the same machining That way, the machining conditions can be established, as
and programming techniques as regular pockets. well as setup and other requirements. The program zero
can be determined quickly - dimensions are from the lower
One of the most commonly machined boundary shapes
left corner (XY) and top (Z) of the object. That location
in manufacturing is milling of a simple cavity, usually quite
will become the program zero.
small, called a slot.

281
282 Chapter 33

Next considerations will relate to machining subjects: Maximum Cutting Depth

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

will be easy to calculate:

Contouring details for the open slot example 03301


( W- D )
To create the program is not difficult at all. The tool is in
2
the spindle and all typical methods explained throughout
the handbook are used.
3
I® where ...

03301 (OPEN SLOT)


S = Stock left on material N1 G20 (INCH MODE)
W = Width of slot (
= slot radius times two )
N2 G17 G40 G80 (START UP SETTINGS
D = Cutter diameter N3 G90 G54 GOO X3.875 Y0.885 S950 M03 (START)
N4 G43 Z0.1 HOI M08 (START POSITION ABOVE)
Stock left on the slot wall in the example will be: N5 G01 Z-0.2 F50.0 (0.01 LEFT ON BOTTOM)
N6 XI. 8 F8.0 (CUT TO SLOT RADIUS CNTR)
S = (.600 - .500) / 2 = .050 N7 GOO Z0.1 (RETRACT ABOVE WORK)
N8 X3.875 (RETURN TO START)
This is a suitable stock for finishing with one cut. N9 G01 Z-0.21 F50.0 (FEED TO FULL DEPTH)
N10 G41 Yl. 185 D01 F8 0 (APPROACH CONTOUR)
.

Speeds and Feeds Nil XI. (CUT TOP WALL)


N12 GO 3 Y0.585 R0.3 (CUT SLOT RADIUS)
Spindle speeds and cutting feedrates will depend on the N13 G01 X3.875 (CUT BOTTOM WALL)
exact situation at the CNC machine, so the example only N14 GOO G40 Y0.885 (RETURN TO START POINT)
uses a reasonable speed of 950 r/min and cutting feedrate of N15 Z1.0 M0 (RETRACT ABOVE WORK)
N16 G28 X3.875 Y0.885 Z1.0 M0 5 (M/C ZERO)
8 in/min.
N17 M30 fE'!D OF PROGRAM)
SLOTS AND POCKETS 283

The example is quite self evident and the included block


comments will offer better understanding of the
program-
ming order and procedure. example, only one tool
In this
has been used. For high precision machining, using two
tools will be better, even if it means a longer program.

Closed Slot Example

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).

This method works, but when approaching an inner con-


tour it is better to use a tangential approach. An internal

contour approached at a tangent requires an auxiliary ap-


proach arc (so called lead-in arc), since the linear approach
towards the contour is not a choice.

Although the tangential approach using an arc improves


the surface finish of the part, this preference creates another
serious problem. The cutter radius offset cannot be started
ina circular interpolation mode! Therefore, a non-circular
A closed slot programming example 03302 motion has to be added- there will be two motions from the
current tool location at the slot radius center to the start
The second example is based on the drawing shown in point of the contour:
Figure 33-3. The drawing is a modification of the open slot
First, a linear motion with cutter radius offset applied
drawing. Many considerations already established will ap-
ply equally to the closed slot. A 0.500 inch end mill will be Second, the tangential approach arc motion
used, this time with a center cutting geometry that allows
plunging into a solid material. This technique is illustrated in Figure 33-5.

Apart from the different tool geometry required for the


plunging cut, only the method of cutting will change. Fora
closed slot (or a pocket), the tool has to move above work,
to a certain XY start location. In the example, it will be the
center of one of the slot radii. Portion of slot on the right is

selected arbitrarily. Then, a plunge at a reduced feedrate


will be to the required depth (leaving .010 on the bottom)
and, in a linear motion, the slot will be roughed out be-
tween the two centers - Figure 33-4.

Retracting the tool is not necessary, it can be fed into the


final depth at the same tool location. The stock is .050 all

around the At the final depth, and from the


slot contour.
center location of the part of the slot, the finish contour
left

will start. Contouring will be more complex this time, be-


cause the tool is in a rather tight spot.
Detail of tangential approach towards an inner contour
284 Chapter 33

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 ...

Pocket milling is also a typical and common operation on


R, = Radius of the cutting tool CNC machining centers. Milling a pocket means to remove
R0 = Radius of the approach arc (lead-in arc) material from an enclosed area, defined by its boundary.
Rc = Radius of the contour (slot radius) This bounded area is further defined by its walls and bot-
tom, although walls and bottom could be tapered, convex,
Supply some numeric data and the approach radius can
concave, rounded, and have other shapes. Walls of a pocket
be calculated. The formula shows the relationships of all
create the boundary contour. Pockets can have square, rec-
three radii. The slot contour radius (ft) is assigned by the
tangular, circular or undefined shape, they can be empty in-
drawing. Once the cutting tool size is selected, that radius
side or they may have islands.
becomes fixed as well (ft). That leaves the lead-in ap-
proach radius (Ra). That one has to be calculated and calcu- Programming pockets manually is usually efficient only
lated accurately. for simple pockets, pockets of regular shapes, such as rec-
tangular or circular pockets. For pockets with more com-
From the formula, it is clear that the approach radius arc
plex shapes and pockets with islands, the assistance of a
must be greater than the cutter radius (.250), while both
computer is usually required.
must be smaller that the contour radius (.300). That means
the range (within three decimal places) is .251 to .299. If
General Principles
only increments of .0 0 are considered, which one is better
1

- .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

not available. Ramping requires the Z axis to be used to-


03302 (CLOSED SLOT) gether with the X axis. Y axis, or both. This motion will, of
N1 G20 (INCH MODE)
course, be a 2 axis or a 3 axis linear motion. All modern
N2 G17 G40 G80 (STARTUP SETTINGS)
N3 G90 G54 GOO X3 0 Y0.885 S950 M03 (START)
.
CNC machining centers support it.

N4 G43 Z0.1 HOI M08 (START POSITION ABOVE)


The method of removing the majority of material from
N5 G01 Z-0.2 F4.0 (0.01 LEFT ON BOTTOM)
the pocket is called roughing. The roughing method selec-
N6 XI. 5 F8.0 (CUT TO SLOT RADIUS CENTER)
N7 Z-0.21 F2.0 (FEED TO FULL DEPTH) tion can be a little more complex. The location where to

N8 G41 XI. 22 Y0.865 D01 F8 (LINEAR APPROACH) .


start the plunge or ramped cut is important, so is the width

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.

In theprogram example 03303, the lower left corner of the


Rectangular and square pockets are quite easy to pro-
pocket will be used.
gram, particularly if they are parallel to the X or Y axes. As
an example of a rectangular pocket, the one illustrated in There are three important factors the programmer has to
Figure 33-6 will be used. consider when selecting start location for the cutting tool in
an enclosed area:

Cutter diameter (or radius)

Amount of stock left for finishing

Amount of stock left for semifinishing

There are also very important dimensions of the part, as


defined in the drawing. They are the length the width and , ,

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.

In the Figure 33-7, the starting point is identified as XI


and Y1 distance from the given corner (lower left), and all
additional data are shown as well.

The letters identify variable settings that must be done;


the programmer chooses their values, depending on the job.
Sample drawing of a rectangular pocket - program 03303
Figure 33-7 Figure 33-8

Pocket roughing start point in the corner - zigzag method Result of a zigzag pocketing, without a semifinish cut

ny The meaning of the description letters is :

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:

of a rectangular pocket, without the semifinishing cut. Note


the uneven stock (scallops) left for the finishing tool. The
high spots create the heaviest obstacles for a subsequent
tool, so semifinishing tool path is highly recommended.
SLOTS AND POCKETS 287

In the formula, N is the number of selected stepovers and


all other variables have the same meaning as before.

G Example

In the example, five equal stepovers are needed, based on


the pocket width of 1 .500 inches, tool diameter 0.250 (TLR
is 0.125), finishing stock S as 0.025 and semifinishing stock
C as 0.010. The stepover size will be:

Q = (1.5 - 2 x 0.125 - 2 x 0.025 - 2 x 0.01) / 5


Q = 0.2360

may be a little too much for a 00.250 end mill, but


That it

will make the example a bit shorter. Seven stepovers would


result in a more reasonable amount of 0. 1 686 (rounding to
three decimal places to 0.169 does no harm). Figure 33-9

Semifinishing tool path begins at the last roughing location,


The above formula may be modified to use the pocket and leaves equal stock for finishing operation
length, rather than the pocket width. This may be a better
choice if the pocket is narrower along the X axis, than it is

along the axis. Y


L, = L - 2 x TLR - 2 x S
Length of Cut

Before the semifinishing, the length, the incremental dis-


W t
= W - 2 x TLR - 2 x S
tance D of each cut, have to be calculated.

In many respects, the formula to calculate the length of G Example


cut is very similar to the stepover calculation:
Ll = 2.0 - 2 x 0.125 - 2 x 0.025
TLR -2xS-2xC LI = 1.7000
D = L - 2 x

W1 = 1.5 - 2 x 0.125 - 2 x 0.025


In this example, the D value will be:
W1 = 1.2000

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

End C pocket (with the start at the pocket center).


between the Start position and the position, is the
value, along both axes.
Some conditions do apply in these cases. One is that the
leading arc radius must be calculated, using precisely the
The formula for the length and width of semifinishing
cut, its actual cutting distance, is listed next:
same method as for slots:
288 Chapter 33

03303 (RECTANGULAR POCKET)


Ra > R, < Rc N1 G20
N2 G17 G40 G80 T01 (.250 ROUGHING SLOT DRILL)
u3r' where ...
N3 MO 6
N4 G90 G54 GOO X0.66 Y0.66 S1250 M03 T02
Ra = Radius of the approach arc
N5 G43 Z0.1 HOI M08
= N6 G01 Z-0.15 F7.0
R, Radius of the cutting tool
(-- ROUGHING START - )
Rc = Radius of the corner
N7 G91 XI. 68 F10.0 (CUT 1)
N8 Y0.236 (STEPOVER 1)
N9 X-1.68 F12.0 (CUT 2)
N10 Y0.236 (STEPOVER 2)
Nil XI. 68 (CUT 3)
N12 YO .236 (STEPOVER 3)
N13 X-1.68 (CUT 4)
N14 YO 236 . (STEPOVER 4)
N15 XI. 68 (CUT 5)
N16 YO 236 . (STEPOVER 5)
N17 X-1.68 (CUT 6)
<
—SEMIFINISH START - )

N18 X-0.01 (SEMIFINISH STARTUP X)


N19 Y-0.01 (SEMIFINISH STARTUP Y)
N20 Y-1.19 (LEFT Y- MOTION)
N21 XI. (RIGHT X+ MOTION)
N22 Y1.2 (UP Y+ MOTION)
N23 X-1.7 (LEFT X- MOTION)
N24 G90 GOO Z0.1 MO
N25 G28 Z0.1 MO
Figure 33- 10
N26 M01
Typical finishing tool path for a rectangular pocket

N27 T02 .250 FINISHING END MILL)


(

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 ,

N30 G43 ZO.l HO 2 MO


of the contour. N31 G01 Z-0.15 F12.0
— FINISHING POCKET - — -)
O Example
(

N32 G91 G41 X-0.375 Y- 0.375 D02 F15.0


N33 G03 X0.375 Y-0.375 R0.375 F12.0
To calculate the approach (lead-in) radius for the example
N34 G01 X0.8437
drawing, start with the corner radius. That radius is given as N35 G03 X0.1563 YO 1563 R0.1563
.

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
.

In the example, N44 G01 G40 X-0.375 YO .375 F15.0


N45 G90 GOO ZO.l MO
Ra =W/4= 1.5/4 N46 G28 ZO.l MO
Ra = -375 N47 X-2.0 Y10.0
N48 M30
Condition is approach radius is larger than
satisfied, the
the tool radius, and can be safely used in the program.
Study the program carefully. It follows all the decisions
Rectangular Pocket Program Example made earlier and offers many details.

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

The other common types of pockets are so called circular


or round pockets. Although theword pocket somehow im-
plies a closed area with a solid bottom, the programming
method relating to circular pockets can also be used for cir-
cular openings that may have a hole in the middle, for ex-
ample, some counterboring operations.

To illustrate a practical programming application for a


circular pocket, Figure 33-1 shows the typical dimensions
Condition:
of such a pocket.
d < D

> D
3

Figure 33- 12

Relationship of the cutter diameter to the pocket diameter

For example, the pocket diameter in the sample drawing


01.500 is 1.5 inches. Using the formula, select a plunging cutter
(center cutting end mill), that has the diameter larger than
1.5/3, therefore larger than .500. The nearest nominal size
suitable for cutting will be 0.625 (5/8 slot drill).
,/

immmm ,
0.25
1

The
Method

next step
of Entry

is to determine the method of the tool 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 ...

Minimum Cutter Diameter


In the next block (N6), the cutting tool will move from
In the following illustration Figure 33-12, the relation-
- the pocket center towards the pocket diameter, and apply
cutter radius offset along the way. This motion can be done
ship of the cutter diameter to the pocket diameter is shown.
There is also a formula that will determine the minimum in two ways:
cutter diameter as one third of the pocket diameter. The
As a simple straight linear motion
milling will start at the circular pocket center, with a single
360° tool motion. In practical terms, selecting a cutter As a combined linear motion with a circular approach
slightly larger than theminimum diameter is a much better
choice. The major benefit of this calculation is when the Linear Approach
pocket has to be done with only one tool motion around.
The linear departure from the pocket center can be di-
The formula is still valid, even if cutting will be repeated
rected into any direction, but a direction towards a quadrant
several times around the pocket, by increasing the diameter
point is far more practical. In the example, a motion along
being cut. In that case, the formula determines the maxi
the Y positive direction is selected, into the90° position.
mum width of the cut.
290 Chapter 33

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.

Linear and Circular Approach

For this method, the cutting motion will be changed.


Ideally, a small one half-arc motion could be made between
the center and the pocket start point. That is possible only if

the cutter radius offset is As a matter of fact, some


not used.
controls use a circular pocket milling cycle G12 or G13,
doing exactly that (see an example later in this section). If
Figure 33- 13
the Fanuc control has the optional User Macros, custom
Linear approach for a circular pocket milling - program 03304 made G 1 2 or G 1 3 circular pocket milling cycle can be de-
veloped. Otherwise, a step-by-step method is the only way,
The graphic representation can be followed by a corre-
one block at a time.
sponding program segment approach a quadrant point,
-

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
%

This method is very simple, but may not always be the


best, particularly for very close tolerances or high surface
finish requirements. Drawing tolerances may be achieved
by roughing operations with one tool and finishing opera-
tions with one or more additional tools.

A possible surface tool mark, left at the contact point with


the pocket diameter, is a distinct possibility in a straight ap-
proach to the pocket diameter. The simple linear approach
is quite efficient when the pocket or a counterbore is not too

critical. Here is the complete listing for program 03304:

03304 (CIRCULAR POCKET - VERSION 1)


Combined linear and circular approach for a circular pocket milling -

N1 G20 -program example 03305


N2 G17 G40 G80
N3 G90 G54 GOO XO YO S1200 M03 This example uses an approach radius of .625. Any radius
N4 G43 Z0.1 HOI M08
that is greater than the cutter radius (.3125) and smaller
N5 G01 Z-0.25 F8.0
than the pocket radius (.750) is correct. The final program
N6 G41 YO .75 D01 F10.0
N7 G03 J-0.75 03305 complements the above illustration in Figure 33-14.
SLOTS AND POCKETS 291

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 .

N10 G01 G40 XO YO F15.0


Nil G28 Z-0.25 M09
N12 G91 G28 XO YO M05 us- where ...

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:

ternal contour finishing.


O Example
Roughing a Circular Pocket
R = 1.5/2=. 75 Diameter D= 1.5
Often a circular pocket is too large for a given tool to
TLR = .375 / 2 = .1875
guarantee the bottom cleanup in a single cut around. In this S = .025
case, the pocket has to be enlarged by roughing it first, in N = 3
order to remove all excessive material, then the finishing
tool path can be applied. Some controls have special cycles, Using the above formula, the stepover amount Q can be
for example, a spiral pocketing. On Fanuc controls, custom found by calculation:
cycles can be created with the User Macros option.
Q = (.75 - .1875 - .025) / 3
As an example, the same pocket drawing
be used as will
Q = .1792
illustrated earlier in Figure 33-11, but machining will be
done with a 0.375 cutter - Figure 33-15. Final roughing program is quite simple and there is no
cutter radius offsetprogrammed or even needed. Note the
benefit of incremental mode G91 It allows the stepover Q .

to be easily seen in the program, in the G01 linear mode.


Every following block contains the arc vector J, cutting the
next Each circle radius
full circle. (J) is increased by the
amount of stepover Q:

03306 (CIRCULAR POCKET ROUGHING)


N1 G20
N2 G17 G40 G80
N3 G90 G54 GOO XO YO S1500 M03
N4 G43 ZO.l HOI M08
N5 G01 Z-0.25 F7.0
N6 G91 YO 1792 F10.0 . (STEPOVER 1)
N7 GO 3 J-0.1792 (ROUGH CIRCLE 1)
N8 G01 YO 1792 . (STEPOVER 2)
N9 GO 3 J-0.3584 (ROUGH CIRCLE 2)
Roughing out a circular pocket - program 03306 N10 G01 YO 1792 . (STEPOVER 3)
Nil GO 3 J-0.5376 (ROUGH CIRCLE 3)
The 0.375 end mill is a small tool that will not cleanup N12 G90 G01 XO F15.0
the pocket bottom using the earlier method. The method of N13 G28 Z-0.25 M09
N14 G91 XO YO MO
roughing is shown in Figure 33-15 and the value of Q
,
is the
N15 M30
equal stepover amount, calculated from the number of
%
steps N, the cutter radius TLR and the stock amount S, left
for the finishing tool path.
292 Chapter 33

CIRCULAR POCKET CYCLES

In Chapter 29, circular pocketing cycles were described


two more examples will provide ad-
briefly. In this chapter,
ditional details. Fanuc does not have the useful G12 and
G13 circular pocketing cycle as a standard feature. Con-
trols that do have it, for example Yasnac, have a built-in

macro (cycle), ready to be used. Fanuc users can create


their own macro (as a special G code cycle), with the op-
tional User Macro feature, which can be developed to offer
more flexibility than a built-in cycle.

The two G codes are identical in all respects, except the


cutting direction. The meaning of the G codes in a circular
pocket cycle is:
Circular pocket cycles G12 and G13

G12 Circular pocket cutting CW N2 G17 G40 G80


Circular pocket cutting CCW N3 G90 G54 GOO XO YO S1200 M03
G13
N4 G43 ZO.l HOI M08
N5 G01 Z-0.25 F8.0
Either cycle always programmed with the G40 cutter
is
N6 G41 XO 625 Y0.125 D01 F10.0
.

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.

N10 G01 G40 XO YO F15.0


G12 I.. D.. F.. (CONVENTIONAL MILLING) Nil G28 Z-0.25 M09
N12 G91 G28 XO YO M05
or N13 M30
%
G13 I.. D.. F.. (CLIMB MILLING)
If the G12 or G13 cycle or a similar macro is available,
bsp where ... the following program 03306 can be written, using the
same tool and climb milling mode:
I
= Pocket radius
D = Cutter radius offset number 03306 (CIRCULAR POCKET - G13 EXAMPLE)
F = Cutting feedrate N1 G20
N2 G17 G40 G80
Typically, the cycle and the bottom
is called at the center
N3 G90 G54 GOO XO YO S1200 M03
of a pocket. All cutting motions arc arc motions, and there N4 G43 ZO.l HOI M08
are three of them. There are no linear motions. The arbi- N5 G01 Z-0.25 F8.0
trary start point (and end point) on the pocket diameter is at N6 G13 10.75 D1 F10.0 (CIRCULAR POCKET)
0° (3 o’clock) - Figure 33-16. N7 G28 Z-0.25 M09
N8 G91 G28 XO YO M05
Previous example in Figure 33-11 can be used to illus- N9 M30
trate the G
2 or G 3 cycle. For comparison, here
1 1 is the pro- %
gram 03305, using a 0.625 end mill:
Macros are very powerful programming tools, but their

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.

turning tools is in th e format of the T address. The format


Leading zeros in the tool function can be omitted for the
for turning system is T4, or more accurately, T2+2. The
tool number selection, but not for selection of the wear off-
first two digits identify the turret station number and geom-
setnumber. T0202 has the same meaning when written as
etry offset, the last two digits identify the wear tool offset
T202. Eliminating the leading zero for tool wear offset will
number for the selected tool station - Figure 34-1.
result in an incorrect statement:

722 means T0022, which is an illegal format.

T XX Y Y In summary, the active side of the turret (tool station) is


programmed by the first pair of digits, the wear offset num-
ber is programmed by the last pair of digits in the tool func-
L Tool WEAR offset tion command:

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:

in the previous section describing the tool function, it is a


As a command independent of the tool motion
very important feature for turning systems and some re-
view will be beneficial. As a command applied simultaneously
with a tool motion statement
The geometry offset is measured for each tool as the ac-
tual distance from the tool reference point to the program Independent Tool Offset
zero (Z axis distance will be stored as a negative value and
so will be the X
diameter) - Figure 34-2. For an independent offset entry in the program, the tool
offset is applied together with the tool indexing:
Geometry offset identifies the position
of the tool from program zero N34 GOO T0202

This command is usually programmed as the first block


Wear offset is used for fine-tuning dimensions
for each tool (in a clearance position). If the older G50 po-
sition register is used, the offset is programmed together
The best way to illustrate the importance of tool wear off- with, or immediately following, the coordinate register
set, is to consider a program that does not use it. All pro-
block. At this point, the tool is still at its indexing position.
grammed dimensions are ideal values, based on the draw- When the tool offset is activated, it will cause a physical
ing. Variable insert tolerances are not considered, neither is
motion by the value of the offset, as stored in the offset reg-
the tool wear. Any deviation from programmed dimensions ister. Note the preparatory command GOO before the tool
caused by the actual tool size will produce an incorrect di- function. This is a very important command, since it will
mension when the part is machined, a very important con- enable the physical offset motion to actually take place.
cern for jobs with tight tolerances. The tool wear offset is
GOO is more important for the first tool, but should be pro-
used to ‘fine tune’ the actual machined dimensions against grammed for any tool. In Chapter 5, covering the control
intended programmed dimensions. system, the status of the control when the power is turned

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

Most lathe programs require one offset for each tool. In


Note the tool change in the first block N 1 - it uses no off-
some cases, however, the program can benefit if two or
set number - just the tool number that is also the geometry
even more offsets are assigned to the same tool. Needless to
offset number. The offset is applied two blocks later in N3.
say, only one offset can be active at one time. The current

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.

tool 2, it 2 into the working position, but


will also index tool
it any offset (T0200 means index for tool 2
will not activate The project is very simple - program and machine three
without tool wear offset). Gear range function may be diameters as per drawing, and maintain tolerances at the
same time. One rule at the beginning - the program will not
added as well, if required. Such a block will normally be
followed by the selection of spindle speed, and rapid ap- use the middle tolerance of the X or Z value. This is an un-
proach to the first position, close to the part. That is the fortunate practice that makes changes to the program much
block where the tool wear offset will be activated - on the more difficult at a later time, if the tolerances are changed
way towards the first position: by engineers or designers.

In the drawings, the following tolerances can be found:


N34 T0200 M42
N35 G96 S190 M03 Tolerances only on the diameter
N36 GOO G41 X12 0 Z0 T0202 M08
.

N37 G01 XI. 6 F0.008 Tolerances only on the shoulders (faces)

Tolerances on the diameters and shoulders


296 Chapter 34

General Approach Here is the complete program - 03401:


The tolerances in all three examples are for training pur-
03401
poses only and will be much smaller in reality. All chamfer
(1.5 ALUMINUM BAR - EXTEND 1.5 FROM JAWS)
tolerances are ±0.010, and non-specified tolerances are
±0.005. That will allow concentration on the project. Mate- (T01 - FACE AND ROUGH TURN)

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. )

N20 G96 S750 M03


N21 GOO G42 XI. 7 Z0.1 T0313 M08
(-- OFFSET 13 FOR THE 0.625 DIAMETER )

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

(T05 - 0.125 WIDE PART-OFF)


N32 T0500
N33 G97 S2000 M03
N34 GOO XI. 7 Z-1.255 T0505 M08
N35 G01 XI. 2 F0.002
Figure 34-3
N36 GOO XI. 45
Multiple offsets - example for diameters - 03401 N37 Z-1.1825
N38 G01 XI. 315 Z-1.25 F0.001
The programming solution is to include two offsets for N39 X-0.02 F0.0015
finishing, for example, T0313 and T0314. In the control, N40 GOO X5.0
correct offset amounts have to be set before machining - the N41 Z5.0 T0500 M09
ideal amounts for middle tolerance are shown: N42 M30
%
13 X-0.003 Z0.000
This is the complete program, using all three tools re-
14 X+0.003 Z0.000
quired. Since TO and T05 do not change for any forthcom-
1

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

Shoulder Tolerances Diameter and Shoulder Tolerances

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:

13 X0.0000 Z+0.0030 13 X-0.0030 Z+0.0030


14 X0.0000 Z-0.0030 14 X+0.0030 Z+0.0030
15 X+0.0030 Z-0.0030
Note that in this case, the X offset (which controls size of 16 X-0.0030 Z-0.0030
the diameters) must be the same for both offsets. Here is the
T03 for prograrrt 03402: This is the most intensive version. Not only it is ex-
tremely important where exactly the offsets appear in the

03402 program, but their input amount is also critical.

(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 )

N22 X0.365 (T03 - FINISH TURN)


N23 G01 X0.625 Z-0.03 F0.002 N19 G50 S3500 T0300
N24 Z-0.4 (-- OFFSET 00 AT THE START OF TOOL )

N25 XI. 0 C-0.03 (K-0.03) N20 G96 S750 M03


N26 Z-0.75 T0314 N21 GOO G42 XI. 7 Z0.1 T0313 M08
(-- OFFSET 14 FOR THE 0.75 SHOULDER ) (-- OFFSET 13 FROM Z OVER TO Z UNDER ONLY ---)
N27 XI. 375 C-0.03 (K-0.03) N22 X0 .365
N28 Z-1.255 N23 G01 X0.625 Z-0.03 F0.002
N29 U0.2 N24 Z-0.4
N30 GOO G40 X5.0 Z5.0 T0300 N25 XI. 0 C-0.03 (K-0.03) T0314
(-- OFFSET 00 AT THE END OF TOOL ) (-- OFFSET 14 FROM X UNDER TO X OVER ONLY ---)
N31 M01 N26 Z-0.75 T0315
(-- OFFSET 15 FROM Z UNDER TO Z OVER ONLY )
298 Chapter 34

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

the first two examples, programs 03401 and 03402, one


Depending on the CNC lathe size, one, two, three, or four
group of offsets must always remain the same (X or Z off- gear ranges may be available. Small lathes, or those de-
sets) For instance, in the program 03401, offsets 03 and
.
signed with ultra high spindle speeds, may have no pro-
1 3 control diameters. That means the Z offset value must be grammable gear range at all, which means only a single de-
the same - always! That also means, if there is a need to fault gear range available. Very large lathes may have all
is
shift the shoulders .002 to the left, all shoulders must he
four gear ranges - and the maximum available spindle
shifted by the same amount: speed is usually low in comparison. The most common av-
erage is two gear ranges.
13 X-0.0030 Z-0.0020
14 X+0.0030 Z-0.0020 Miscellaneous functions for gear ranges, are typically
M4I M42, M43 and M44,
, and assume the definition rela-
Failure to do that will result in inaccurate dimensions. tive to the number of gear ranges available:

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

OFFSET (GEOMETRY) Medium - - M42 -

- M43
NO. X AXIS Z AXIS RADIUS TIP

01 0.0000 0.0000 0.0000 0


High - M42 M43 M44

02 0.0000 0.0000 0.0000 0


Once a certain gear range is selected, the spindle speed
0.0000
range is limited. If the exact range of spindle speed is im-
03 0.0000 0.0000 0
portant, always make an effort to find out the available

... ... ...


spindle speeds in each range. Don't be surprised to find out
that on most CNC machines, one rpm ( r/min) is very rare. 1

Typical lowest spindle speed may be around 20 to 30 r/min.


X axis and Z axis are often shown just as X and Z, Radius Also, don’t be surprised to find that there is an overlap, of-
is shown as R, and Tip is shown as T.
ten quite large, for spindle speeds in two ranges. For exam-

The NO. is the offset first pair of the T


number, either the ple. if the Gear 1 has a range 20 to 1400 r/min, Gear 2 may

address - for the Geometry


second pair - for
offset, or the have a range of 750 to 2500 r/min. When using spindle
the Wear offset. X axis and Z axis are the columns where speeds available in either range, such as 1000 r/min, selec-
the offset values are entered for each number, the Radius tion of gear range is not critical, but low gear range will

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

AUTOMATIC CORNER BREAK 03404 (MANUALLY CALCULATED CORNER BREAK USED)

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.

tion is not difficult but can be time consuming for some


As always in manual work, the possibility of errors can
jobs, such as shaft turning with many different diameters.
be significant. For example, one very common error in this
type of programming is the target value of X axis. In turn-
ing, it is easy to forget to double the chamfer or radius value
02.5
(or half it for boring). The result is that block N56 may be:

01.875
N56 GO 2 XO .725 Z-0.5 R0.1 (ERROR IN X)

01.25 instead of the correct block

00.625 N56 GO 2 XO 825 Z-0.5 R0.1


. (X IS CORRECT)

So what can be done in the program in order to imple-


X0
ment the automatic comer break?
o
d N Fanuc control system offers two programming methods
that relate to automatic comer breaking on lathes:
ALL CHAMFERS 1/16 x 45° ALL FILLETS R0.1 Chamfering method ... for a 45° chamfer

Figure 34-6 Blend radius method ... for a 90° blend


Example for an automatic corner break (chamfers and radii
Both methods work in a very similar manner and certain
The drawing Figure 34-6 shows a simple external part
in ruleshave to be observed in both cases.
that contains several comers that will benefit from the auto-
matic comer break programming feature (not all comers in Chamfering at 45 Degrees
the drawing qualify).
The automatic comer chamfering will always take place
Compare the two methods, to better understand the dif- in dieG01 mode, and two special vectors I and K are avail-
ferences applied in programming. If the programmer does able for this purpose or a C vector on some models.
not use the automatic comer break feature, each contour
For the automatic chamfer generation, the vectors I and K
change point must be calculated manually and the result
specify the directionand the amount of cutfor the required
will be program 03404:
chamfer:
300 Chapter 34

The vector
is used to create
I

chamfer starting from the X axis,


a
c- c+
into the X+Z-, X-Z-, X+Z+, or X-Z+ direction

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

The I and K vector definition is illustrated in Figure 34-7.

c-
K- K+

Figure 34-8

Vectors C for automatic corner chamfering

In either case, the sign of I or K vector defines the direc-


tion of the chamfer cutting within the coordinate system:

Positive value of I or K vector indicates the


chamfering direction into the plus direction
of the axis not specified in the chamfering block

Negative value of I or K vector indicates the


chamfering direction into the minus direction
of the axis not specified in the chamfering block
Figure 34-7

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

the active programmed tool path length by the value of the I


the I+, I-, K+ and K- vectors - Figure 34-8. This is a much

simpler programming method and its applications are the


or K vector, as specified ii^the program. If not sure whether
same There is
as for the blend radius R. described shortly.
the I or the K vector should be programmed for automatic
no distinction between axes vector selection, just the speci-
chamfering, consult the above illustration, or apply the fol-
fied direction:
lowing rules:
The C vector is used
The vector I indicates the chamfering amount and motion
direction when the tool motion is in the order of Diame- ... to create a chamfer starting from the X axis,
ter-Chamfer-Shoulder, which means cutting along the Z into the X+Z-, X-Z-, X+Z+, or X-Z+ direction
axis before the chamfer. The chamfer deviation can only be - or-
from the Z axis towards the X axis, with the I vector pro- ... to create a chamfer starting from the Z axis,
grammed: into the Z-X+, Z-X-, Z+X+, or Z+X- direction

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

watched. The two previous examples will be:


The vector K indicates the chamfering amount and mo-
tion direction when the tool motion is in the order of Shoul- G01 Z-1.75 CO. 125 (CUTTING ALONG Z AXIS)
der-Chamfer-Diameter, which means cutting along the X X4.0 (CONTINUING IN X AXIS AFTER CHAMFER)
axis before the chamfer. The chamfer deviation can only be
from the X axis towards the Z axis, when the K vector is G01 X2.0 C- 0.125 (CUTTING ALONG X AXIS)
Z-3.0 (CONTINUING IN Z AXIS AFTER CHAMFER)
programmed:

G01 X2.0 K-0.125 (CUTTING ALONG X AXIS)


As was the case with the I and K vectors, the C vector 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

A blend radius between a shoulder and diameter (or vice


the X axis, when the R vector is programmed:
versa) is programmed in a similar way as the automatic 45°
G01 Z-1.75 R0.125 (CUTTING ALONG Z AXIS)
chamfer. also takes place exclusively in the G01 mode!
It
X4.0 (CONTINUING IN X AXIS AFTER RADIUS)
Only one special vector R is used. For automatic blend ra-
dius, the vector specifies the direction and the amount of In either case, the sign of the R vector defines the direc-
cut for the radius: tion of the radius cutting within the coordinate system:

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:

t flX+ Chamfer or radius must be fully contained in

a single quadrant - 90° only

v 2
„ l* J- Chamfers must have a 45° angle and radii

f \ must have a 90° angle between a shoulder and


a diameter or a diameter and a shoulder
'
X-
The values of chamfering vectors and K or C,
Ir
I

R- - as well as the radius vector R, are always single values -

j meaning per side values, not diameter values

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

tive programmed by the value of the R vec-


tool path length
Both chamfering and blend radius corner breaking
tor, as specified in the program. If not sure whether the R
takes place in G01 mode (linear interpolation mode)
vector should be programmed for automatic blend radius,
consult the above illustration or apply the following rule: When writing the CNC program, only the known
intersection from the drawing - the sharp point -
is needed.
The vector R indicates the radius amount and motion di- That is the point between the shoulder and the diameter,
rection when the cutting is in the order of Shoulder- without the chamfer or radius being considered
Radius-Diameter, which means cutting along the X axis
before the radius. The same vector is also used when the ra-
These rules apply equally to turning and boring CNC
lathe operations. Study them carefully to avoid problems at
dius amount and motion direction is in the opposite order
the machine later.
of Diameter- Radius-Shoulder, which means cutting along
the Z axis before the radius.
Programming Example
The radius deviation can be from the X axis towards the Z
The following program 03405 combines the use of the
axis, when the R vector is programmed:
chamfering and blend radius vectors into a complete exam-
ple. The same drawing is used for this version, as for the
G01 X2.0 R-0.125 (CUTTING ALONG X AXIS)
Z-3.0 (CONTINUING IN Z AXIS AFTER RADIUS) traditional method, illustrated earlier in Figure 34-6.
302 Chapter 34

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

Although the program is a little shorter, the five blocks


saved in the program offer the least benefit. Where are the

G02s and G03s, where are the calculations of each contour


change point? Where are the center point calculations?

Except for the contour beginning and end. this type of


programming greatly enhances program development and
allows for very fast and easy changes during machining, if
necessary. If a chamfer or a blend radius is changed in the
drawing, only a single value has to be changed in the pro-
gram, without any recalculations. Of course, the rules and
conditions mentioned earlier must be always observed. The
Tool orientation and cutting direction for roughing.
main benefit of the automatic contouring are the ease of
Upper row shows external tools, lower row shows internal tools.
changes and the absence of manual calculations.

Although a number of tools can be programmed in sev-


ROUGH AND FINISHED SHAPE eral directions, some directions are not recommended at

all. or only for light or medium light cuts.

The vast majority of material removal on CNC lathe is


In practice, always follow one basic rule of machining -
done by using various cycles, described in detail in the next
this rule is valid for all types of machines:
chapter. These cycles require input of data that is based on
machining knowledge, such as a depth of cut, stock allow-
Always do heavy operations before light operations
ance, speeds and feeds, etc.

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 ...

toolremoves the stock to cut a desired shape, it can only


D = Actual depth of cut at the face
handle a certain amount of it at a time. The insert shape, its
A = Lead angle of the insert
orientation toward the part and its cutting direction, the in-
R = Radius of the insert
sert sizeand thickness, all have a profound effect on the al-
lowable stock to be removed. This is especially important
W = Stock left on face for finishing
XP0S = Target position for the X axis
in semifinishing and finishing operations. Stock allowance ZP0S = Target position for the Z axis
304 Chapter 34

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.

O Example: Figure 34-13 shows a simple drawing of a roller. In the


middle of the object, there is an undercut (recess) between
The amount of stock left on face is .030, the tool radius is the 01 .029 and the 0.939. The objective is to calculate, not
and the 3°:
.031 tool lead angle is to guess, what is the maximum back angle tool that can be
used for cutting the recess in a single operation.
W = .030, R = .031, A = 3

There is enough data available to calculate the unknown R9/16 (2)


depth D, using the above formula: V
D = tan3/2 x .031 + .030 / tan3 + .031
D = .60425

For an insert with a 0.500 inch inscribed circle (such as


DNMG-432, for example), the actual depth of cut at the
face will be .60425 - more them any reasonable amount!

Since the earlier suggestion was no more than .006, recal-


culate the example for the largest depth, if the W=.006:
— 1.25 —
D = tan3/2 x .031 + .006/tan3 + .031
D = .14630 ROLLER
Figure 34- 13
That is a more reasonable depth of cut at the face, so the Z
Back angle clearance calculation example
axis stock allowance of .006 can be used. For facing in the
opposite X direction or for not unidirectional faces, leave
The first is to consider the drawing - that is always
step
stock much bigger, usually close to the tool radius.
the given and unchangeable source of data. The difference
between the diameters and the recess radius will be re-
PROGRAMMING A RECESS quired. Figure 34-14 illustrates the generic details of the
provided data (except the angle b ) from the drawing.

Another very important aspect of programming for CNC


lathes is the change of cutting direction. Normally, program

a tool motion in such a way that the motion direction from


the starting point will be:

Positive X direction for external machining


... and/or...
Negative Z direction for external machining

Negative X direction for internal machining


... and/or...
Negative Z direction for internal machining

There are also back turning or back boring operations


used in CNC programming, but these are just related and
less common variations of the common machining. In the Data required to calculate angle 'b'

most common machining on CNC lathes, any change of di-


rection in a single axis into the material constitutes an un-
The formula required to calculate the angle b uses simple
trigonometric formula. First, calculate the depth of the re-
dercut, a cavity, or more commonly known - a recess.
cess D, which is nothing more that one half of the differ-
A recess is commonly designed by the engineers to re- ence between the two given diameters:
lieve - - a certain portion of the part, for exam-
or undercut
ple, toallow a matching part to fit against a shoulder, face, LARGE DIA - SMALL DIA
or surface of the machined part.
2
TURNING AND BORING 305

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

dercuts and special clearances, whether programmed with


the rapid travel rate, the cutting tool has to move 1 1 .400
the aid of cycles or developed block by block. The example
inches and - at the same time -
change the spindle speed
only illustrates one possibility, but can be used for any cal-
from a slow 73 r/min, to a fast 2455 r/min. Depending on
culations where the back angle clearance is required.
the control system and its handling of such a situation, the
tool may actually start cutting at a slower spindle speed
SPINDLE SPEED IN CSS MODE than was originally intended.

If such a situation docs happen and presents a problem,


From several earlier topics, remember that the abbrevia-
done is to preprogram the expected
the only step that can be
tion CSS stands for Constant Surface Speed. This CNC
spindle speed in r/min. before the cutting tool approach
lathe feature will constantly keep recalculating the actual
motion, then switch to the constant surface speed (CSS)
spindle speed in revolutions per minute (r/min), based on
mode and continue.
the programmed input of surface speed. The surface speed
is programmed in feet per minute - ft/min (English system)
03407
or in meters per minute - m/min (metric system). N1 G20 T0100
N2 G97 S2455 M03 (R/MIN PRESET)
In theprogram, the 'per minute' input uses the prepara-
N3 GOO G41 X0.7 Z0 T0101 M08
tory command G96, as opposed to the direct r/min input N4 G96 S450 M03
using the command G97. N5 ...

The Constant Surface Speed a powerful feature of the


is
What had been done requires more evaluation. What had
control system and without it, we would
look back many
been done is that the spindle was started at the final ex-
years. There is a rather small problem associated with this pected r/min, before the tool reaches the part, in block N2.
feature, often neglected altogether, or at least not consid-
In block N3, the tool moves to the start of cut, while the
ered important enough. This rather ‘small problem’ will be spindle is already at the peak of the programmed speed.
illustrated in a simple program example.
Once the target position along the X axis has been reached
(block N3), the corresponding CSS mode can be in effect
The program example covers only a few blocks at the be-
for all subsequent cuts.
ginning,when the cutting tool approaches the part. That is
enough data to consider the question that follows.
This is an example that does not necessarily reflect every-
day programming of CNC lathes. In this situation, some
03406
additional calculations have to be done, but if they solve the
N1 G20 T0100
problem - they are worth the extra effort! Some CAD/CAM
N2 G96 S450 M03
N3 GOO G41 X0.7 Z0 T0101 M08 system can be set to do exactly that, automatically. If the
N4 ... current X position of the tool is unknown, estimate it.
306 Chapter 34

Approach to the Part


LATHE PROGRAM FORMAT
An important part of any lathe program structure is the
In a review of the already presented examples, a certain method of approaching a revolving part. If the part is con-
consistency can be seen in the program output. This may be centric. the approach can be similar to the A option in Fig-

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.

General Program Format

To view enough will forge a mental im-


the format often
age in the programmer’s mind. The details that are not un-
derstood yet will become much clearer after acquiring the
general understanding of the relationships and details used
in various programming methods. Here is a suggested tem-
plate for a CNC lathe program.

O General Program Pattern - Lathe :

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

In the last chapter, several lathe procedures described Complex Cycles


programming of a turning and boring tool path. A number
of different techniques have been introduced, mainly de- With the advancement of computer technology, control
scribing the finishing tool path. Virtually no attention has
manufacturers have developed cutting cycles capable of

yet been given to the removal of an excessive stock, in such


very complex lathe operations and made them an integral
operations as rough turning and rough boring. It is a subject
part of the lathe control systems. These special cycles are
in its own and this chapter describes various methods
right
called by Fanuc the Multiple Repetitive Cycles. Their major
of stock removal for roughing and finishing. improvement over simple cycles is in their excellent flexi-
bility. Some of these advanced cycles cover turning and

boring, others grooving and threading.


STOCK REMOVAL ON LATHES
Don’t get misled by the description 'complex'- these cy-
One of the most time consuming tasks in manual pro- cles are only complex in the mathematical sense and even
gramming for a CNC lathe is the removal of an excessive then, only internally. They are complex within the control

typically from a cylindrical material, known as


system only. In fact, these very advanced machining cycles
stock,
are much easier to program than their simple predecessors.
rough turning or rough boring - or simply roughing.
In addition, they can also be very easily changed at the ma-
To manually program a roughing tool path requires a se- chine control, to optimize them for best performance, right
ries of coordinated rough passes, with one block of pro- on the job.
gram for each tool motion. For roughing of a complex con-
tour, such a method is extremely time consuming and very
PRINCIPLES OF LATHE CYCLES
inefficient, as well as prone to errors. Some programmers
programming quality for speed, by leaving
try to sacrifice
an uneven stock for finishing, causing the cutting tool to Similar to drilling operations for CNC machining cen-
wear out prematurely. The surface roughness of the fin- ters, all cycles for lathes are based on the same technologi-
ished profile often suffers as well. cal principles. The programmer only enters the overall data
(typically variable cutting parameters), and the CNC sys-
It is of rough stock removal where the modern
in the area tem of individual cuts. These cal-
will calculate the details
lathe controls are very useful and convenient. Almost all culations are based on the combination of the fixed and
CNC lathe systems have a feature that allows the roughing variable data. Return tool motions in all these cycles are au-
tool path to be processed automatically, using special cy- tomatic, and only the values to be changed are specified
cles. Roughingis not the only application for these cycles, within the cycle call.
there are also special cycles available for threading and
Simple cycles are designed exclusively to cut a straight
simple grooving. The grooving and threading cycles are
cut, with no chamfers, tapers or radii and also with no un-
outside of this chapter, but will be covered in detail in the
dercuts. The simple cycles can only be used to cut verti-
next three chapters.
cally, horizontally, or at an angle, for taper cutting. These
original cycles cannot do the same cutting operations as the
Simple Cycles
more modern and advanced multiple repetitive cycles - for
Fanuc and similar controls support a number of special example, they cannot rough out a radius or change direc-
lathe cycles. There are three rather simple cycles that have tion of the cutting. Simply, they cannot contour.
been part of Fanuc controls for quite a while. They first ap-
peared with the early CNC units and were limited by the In the category of simple turning cycles, there are two

technological progress of the time. Various manuals and


thatdo allow removal of rough stock from a cylindrical or
conical part. Each block of these cycles replaces four regu-
textbooks refer to them as the Fixed Cycles or Simple
lar blocks of the part program. In the category of multiple
Cycles or even Canned Cycles similar in nature to their
,

cousins for drilling operations on CNC mills and machin-


repetitive cycles, there are several cycles designed for com-
plex roughing, one for finishing, as well as cycles for
ing centers. Two of these early cycles are used for turning
grooving and threading. Multiple repetitive cycles are ca-
and boring, the third cycle is a very simple threading cycle.
This chapter covers the first two cycles. pable of some very complex contouring.

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 is absolute mode for milling,


X and Z axes are absolute mode for turning

G91 is incremental mode for milling,

U and W axes are incremental mode for turning

A cycle identified by G90 preparatory command (Type A


group of G codes) is called the Straight Cutting Cycle (Box
cycle). Its purpose is to remove excessive stock between the
start position of the cutting tool and the coordinates speci-
fied by the X and the Z axes. The resulting cut is a straight
turning or boring cut, normally parallel to the spindle cen-
terline and the Z axis is the main cutting axis. As the name
of the cycle suggests, the G90 cycle is used primarily for re-
moving a stock in a rectangular fashion (box shape). The G90 cycle structure - taper cutting application

G90 cycle can also be used for a taper cutting. In Figure


35-1 , the cycle structure and motions are illustrated. Format 2 (two versions):

G90 • w
X(U). z ( )- . I.. F..
G90 X(U). z(w).
• . R.. F..

os' where ...

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)

In both examples, the designation of axes as X and Z is


used for the absolute programming, indicating the tool po-
sition from program zero. The designation of axes as U and
W used for the incremental programming, indicating ac-
is

tual travel distance of the tool from the current position.


G90 simple cycle structure - straight cutting application
The F address is the cutting feedrate, normally in inches per
revolution or millimeters per revolution. The I address is

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-
-
,

G90 X(U).. Z(W).. F..


monly, it will be the GOO rapid motion command:

csr where ...


G90 X(U) . . Z(W) . . I.. F.

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

Straight Turning Example N10 X2.28 (PASS 6)


Nil GOO X10.0 Z2.0 T0100 M09
To a practical application of G90 cycle, study
illustrate N12 M01 (END OF ROUGHING)
Figure 35-3. shows rather a simple diameter turning,
It

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)

This cycle is quite simple in both versions - all that is

needed is to calculate the new diameter


for each roughing
cut. If the same roughing had been programmed
tool path
Figure 35-3 using the block-by-block method (without G90), the final
Example of G90 cycle in straight cutting - programs 03501 6 03502 program would be more than three times longer.

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:

(4.125 - 2.22) / 2 = .9525

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

The difference is the of an I parameter to the cycle


addition
call, indicating the taper amount and its direction per side.

This value is called a signed radius value. It is an I value be-


cause of its association with the X axis. For straight cutting,
the value will always be zero and does not have to be writ-
I

ten in the program. Its only significance is for taper cutting,


in which case it has a non-zero value - Figure 35-5.

Figure 35-6

Known and unknown values for taper cutting - program 03503


Amount T is known, amount T has to be calculated

The I amount used for G90 turning cycle - external and internal

The illustration shows that the I amount is calculated as a


single distance, i.e., as per single side (a radius value), with
specified direction, based on the total traveled distance and
the direction of the first motion from the start position.

There are two simple rules for G90 taper cutting:

If the direction of the first tool motion in X is negative,


the I value is negative

If the direction of the first tool motion in X is positive,

the I value is positive

On a CNC lathe with the X axis positive direction above


the spindle center line, the typical I value will be negative

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.

Two triangles are similar, if the corresponding sides


In the example, a clearance of 0. 1 00 will be added at each
of the two triangles are proportional.
end of the taper, increasing its length along the axis from
2.5 to 2.7. The I amount calculation requires the actual
length of tool travel, while maintaining the taper angle at In programming, quite often there is a situation that can

the same method of similar triangles or the


time. Either the be solved by more than one method. Choose the one that
trigonometricmethod can be used for such calculation (see suits better a certain programming style, then try the other

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

O Using Similar Triangles Method

First, calculate the difference * between the two known


diameters, as per drawing:

i = (4-2.25) / 2 = 0.875

therefore, the ratio of similar triangles will be

I / 2.7 = i / 2.5

We know * to be 0.875, so the relations can be modified


by filling in the known amount:

I / 2.7 = 0.875 / 2.5


I = (0.875 x 2.7) / 2.5
I = 0.945 ... is the required amountforprogranuning

Example of G90 cycle used on a taper to a shoulder - 03504


O Using Trigonometric Method
Using the simple cycle G90, the machining requires a ta-
The second method of calculating the I amount requires
pered cut towards a straight shoulder. A single G90 cycle
trigonometry. At this point, it is known that
can be used in this case as well, but could result in some ex-
cessive or insufficient cutting (too much or too little stock).
I = 2 .7 x tan a
The best approach is to use two modes of the cycle - one for
the straight roughing, the other for tapered roughing.
and the tangent value has to be calculated first:

Similar to the previous example, the I taper amount has to


tan a = i / 2 .5 be calculated, using the same law of similar triangles as be-
tan a = 0.875 / 2.5
fore. The height i of the original triangle over the length of
tan a = 0.350
2.5 is calculated as one half of the difference between the

The amount of I can be calculated using the result: 02.750 and the 01.750:

I = 2.7 x 0.35 i = 2.75 - 1.75 / 2


i = 0.500
I = 0.945 ... is the required amountfor programming

For the extended taper length, 0.005 stock amount is left


In both cases, the calculations have the same result, con-
finning accuracy of the process. The I amount calculation is
at the shoulder for finishing and the taper is extended by
0.100 at the front face, for the total taper length of 2.595:
shown in Figure 35-6 and detailed in Figure 35-7. Program
03503 is the final result - five cuts with 0.03 X-stock left:
2.5 - 0.005 + 0.100 = 2.595
03503
The I amount can now be calculated, based on the origi-
(G90 TAPER TURNING EXAMPLE 1 - W/0.03 X-STOCK)
nal and the extended values:
N1 G20
N2 T0100 M41
N3 G96 S450 M03 I / 2.595 = 0.500 / 2.5
N4 GOO X4.2 Z0.1 T0101 M08 (START) I = (0.500 x 2.595) / 2.5
N5 G90 X3.752 Z-2.6 1-0.945 F0.01 (1) I = 0.519 ... negative direction
N6 X3.374 (2)
N7 X2.996 (3) For roughing, a 0.030 stock will be left per side along the
N8 X2.618 (4) X axis, which is 0.060 on diameter.
N9 X2.24 (5)
N10 GOO X10.0 Z2.0 T0100 M0 9 (CLEAR POS.) In roughing operations, it is always important to select a

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

G94 - FACE CUTTING CYCLE

A cycle that is very similar to G90 is another simple turn-


ing cycle, programmed with theG94 command. This cycle
is called the face cutting cycle. The purpose of G94 cycle is
to remove excessive stock between the start position of the
cutting tool and the coordinates specified by the X and Z
axes. The resulting cut is a straight turning cut, normally
perpendicular to the spindle center line. In this cycle, it is

the X axis that is the main The G94 cycle


cutting direction.
is used primarily for facing cuts and can be used for simple
vertical taper cutting as well, similar to the G90 cycle.

The G94 cycle is logically identical to the G90 cycle,


except the emphasis is on the X axis cutting,
rather than the Z axis cutting.

Depth ot cut calculation for program example 03504


As the cycle description suggests, the G94 is normally
For the calculation, all that is required is to divide the dis- used to perform a rough face-off of the part, towards the
tance per each side by the number of required cuts. The re- spindle center line or to face-off a shoulder.
sult will be an equal depth of cut for the whole roughing op-
eration. If the cutting depth is too small or too large, just Cycle Format
recalculate it with a different number of cuts. Knowing
what is a suitable depth of cut is a machining knowledge, Similar to all cycle, the face cutting cycle G94 also has a
expected from CNC programmers. predetermined programming format. For straight facing,
the cycle format is:
In Figure 35-9 there are four cuts of 161 for the straight
,
.

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:

G94 X(U).. Z(W).. K.. F..


03504
(G90 TAPER TURNING EXAMPLE - 2) The axes X and Z are used for absolute programming, the
N1 G20 axes U and W are used for incremental programming, and
N2 T0100 M41 the F address is the cutting feedrate. The K parameter, if
N3 G96 S450 M03
greater than zero, used for taper cutting along the vertical
is
N4 GOO X4.1 ZO.l T0101 M08 (START)
direction. Figure 35-10 shows all programming parameters
N5 G90 X3.778 Z-2.495 F0.01 (STRAIGHT 1)
N6 X3.456 (STRAIGHT 2) and cutting steps. Apply the same process as for G90 cycle.
N7 X3.134 (STRAIGHT 3)
N8 X2.812 (STRAIGHT 4)
N9 GOO X3.0 (CHANGE STRAIGHT TO TAPERED)
N10 G90 X2.812 Z-0.765 1-0.173 (TAPERED 1)
Nil Z-1.63 1-0.346 (TAPERED 2)
N12 Z-2.495 1-0.519 (TAPERED 3 - FINAL)
N13 GOO X10.0 Z2.0 T0100 M09 (CLEAR POS.)
N14 M01 (END OF ROUGHING)

In a review, to calculate the amount of I or R parameter


used in G90 for the taper cutting - external or internal, use
the following formula:

SMALLER DIA - LARGER DIA


KR) =
2

The result will also include the sign of the / amount. G94 turning cycle structure - straight and tapered application
LATHE CYCLES 313

Cycle Format Types


MULTIPLE REPETITIVE CYCLES
Each cycle is governed by very specific rules and has its
Unlike the fixed cycles for various drilling operations on do's and don’ts. The following sections describe each of
machining centers, or the G90 and G94 simple cycles for them in detail, except the G76 threading cycle, which will

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.

NC machines controlled by a punched tape, cannot benefit


from them. In tape operation, the control unit reads the tape Cutting Cycles and Part Contour
codes sequentially, in a forward direction only. A CNC
Probably the most common multiple repetitive cycles in
control, on the other hand, is far more complex. It can read,
turning and boring are those that are used for profile cutting
evaluate and process information stored in the memory in
or contour cutting. There are three cycles available within
both directions, forwards and backwards - at all times. It
the roughing category:
can process mathematical instructions internally in a split
of a second, simplifying the programming effort. G71, G72 and G73

General Description and one cycle is available for finishing:

In total, there are seven multiple repetitive cycles avail- G70


able, identified by a preparatory command address G:
The finishing cycle is designed to finish profile generated
Profile cutting cycles - Roughing: by any one of the three roughing cycles.

In some respects, there is an interesting situation in pro-


G71 Rough cutting cycle - Horizontal emphasis gramming multiple repetitive cycles. So far, the emphasis
was to program roughing cuts before finishing cuts. This
G72 Rough cutting cycle - Vertical emphasis
approach makes perfect sense - it is also the only logical
G73 Pattern repeating roughing cycle way from the technological point of view. Don’t be sur-
prised if this ‘rule’ is suddenly broken when computer cal-
culations take over. Yes, the implication here is that when
Profile cutting cycles Finishing:
programming the three multiple repetitive roughing cycles,
the finished contour must always be defined first, then its
G70 Finishing cycle for G71, G72 and G73 machining specifications can be applied to the roughing cy-
cle. Sounds strange? At first, perhaps. When working with

these cycles longer, it will be easy to see that it is actually


Chipbreaking cycles:
quite a clever and ingenious method, although hardly a re-
cent breakthrough.
G74 Peck drilling cycle in Z axis - horizontal

Chipbreaking Cycles
G75 Peck grooving cycle in X axis - vertical

The two remaining ‘chipbreaking' cycles are designed to


Threading cycle: produce an interrupted cut, either along the Z axis (G75),
or along the X axis (G74). In practice, the G74 cycle offers
more practical applications than G75. The G74 cycle al-
G76 Threading cycle - straight or tapered
lows to peck-drill on a CNC lathe. Although the need for
peck drilling is much lower on a lathe than on a machining
The G76 threading cycle is described separately and in
center, it is not that rare. However, the G75 cycle, which is

sufficient detail in Chapter 38. really a ‘peck-grooving’ cycle, is used rarely, as it does not
produce a precision groove.
314 Chapter 35

Start Point and the Points P and Q


CONTOUR CUTTING CYCLES
The point A in the illustration is the start point of any pro-

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

all, programming languages were using this


several early The generic points B and C in the last illustration will be-
method, such as the Compact II, a very popular language come points P and Q in the program, respectively:
based programming system of the 1970’s.
Point P represents the block number of
The two defined boundaries create a fully enclosed area the first XZ coordinate of the finished contour.
that defines the excessive material. From this isolated area,

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

implied. between points A and B, and points A and C.


It is contour R and the last XZ coordinate of the contour Q,
Material boundary can not contain any other points; it must must have a sequence number N, not duplicated
be a straight line, but not always a line parallel to an axis. anywhere else in the program.

The part boundary is defined between points B and C,


and may have any number of points between. For CNC
programming, different descriptions will be used rather
than the generic ABC points in Figure 35-1 1.
LATHE CYCLES 315

Programming Type and Type Cycles


TYPE AND TYPE I II CYCLES I II

If the control system supports the Type II metal removal

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

35-12 compares the two types


cavities (undercuts). Figure
and shows a disallowed contour change in two directions G71 U. R. . .

within a cycle. The example applies to G7 1 external cutting G71 P10 Q. U. . . W. F. . S.


cycle, but can be modified for any internal cutting. N10 GOO X.. (ONE AXIS FOR TYPE I)

TYPE CYCLE 1
O Example - Type II

... is roughed out G71 U. R.. .

in a single depth G71 P10 Q. U. . . W. . F. . S.


N10 GOO X. Z. . (TWO AXES FOR TYPE II)
TYPE II CYCLE
is roughed out
If there is no motion along the Z axis in the first block af-
...
ter the cycle call and the Type II cycle is still required, just
in several depths
program WO as the second axis.
BI-DIRECTIONAL Cycle Formatting

... 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.

Type II allows a continually increasing profile or continu-


ally decreasing profile from the point P to the point Q. A G71 - STOCK REMOVAL IN TURNING
change into the opposite direction is allowed for a single
axis only depending on the active cycle. Rough out process
, The most common roughing cycle is G7 Its purpose is 1 .

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 Cycle Format- 10T/1 IT/1 5T m o o


The one-hlock format for the G7 1 cycle is:

G71 P.. Q.. I.. K.. U.. W.. D.. F.. S..

u®” where ...

P = The first block number of the finishing profile


Q = The last block number of the finishing profile

I = Distance and direction of rough


semifinishing in the X axis - per side
K = Distance and direction of rough
semifinishing in the Z axis
U = Stock amount for finishing on the X axis diameter
W = Stock left for finishing on the Z axis
D = The depth of roughing cut
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 CHAMFERS 0.05 x 45° - CORE 09/16
speeds between the P block and the Q block
Figure 35-13
The I and K parameters are not available on all machines. Drawing example to illustrate G7 1 roughing cycle - program 03505
They control the amount of cut for sermfinishing, the last
continuous cut before final roughing motions.
G71 for External Roughing

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.

G71 U.. R.. Program 03505 covers these operations.


G71 P.. Q.. U.. W.. F.. S..

03505 (G71 ROUGHING CYCLE - ROUGHING ONLY)


US’ where ...
N1 G20
N2 T0100 M41 (OD ROUGHING TOOL + GEAR)
First block:
N3 G96 S450 M03 (SPEED FOR ROUGH TURNING)
N4 GOO G41 X3.2 ZO T0101 M08 (START FOR FACE)
U = The depth of roughing cut N5 G01 XO .36 (END OF FACE DIA)
R = Amount of retract from each cut N6 GOO Z0.1 (CLEAR OFF FACE)
N7 G42 X3.1 (START POSITION FOR CYCLE)
Second block: N8 G71 P9 Q17 U0.06 WO. 004 D1250 F0.014
N9 GOO XI. 7 (P POINT = START OF CONTOUR)
P = The first block number of the finishing profile N10 G01 X2.0 Z-0.05 F0.005
Q = The last block number of the finishing profile Nil Z-0.4 F0.01
U = Stock amount for finishing on the X axis diameter N12 X2.25
W = Stock left for finishing on the Z axis N13 X2.5 Z-0.6
F = Cutting feedrate (in/rev or mm/rev) overrides N14 Z-0.875 R0.125
feedrates between the P block and the Q block N15 X2.9
S = Spindle speed (ft/min or m/min) overrides spindle N16 G01 X3.05 Z-0.95
speeds between the P block and the Q block N17 U0.2 F0.02 (Q POINT = END OF CONTOUR)
N18 GOO G40 X5.0 Z6.0 T0100
Do not confuse the U in the first block, depth of cut per N19 M01
side,and the U in the second block, stock left on diameter.
The I and K parameters may be used only on some controls The external roughing has been completed at this point in

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

G71 for Internal Roughing Cutting direction


Q
SP
The face has been done with the previous tool and the
roughing boring bar can continue the machining:

N20 T0300 (ID ROUGHING TOOL)


T <A !

!
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
.

N28 Z-0.75 Q Cutting direction


N29 XO 625 Z-1.25
.
-i-
N30 Z-1.55
Figure 35-14
N31 U-0.2 F0.02 (Q POINT = END OF CONTOUR)
N32 GOO G40 X5 0 Z2 0 T0300
. . External and internal cutting in G7 1 cycle
N33 M01

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.

Direction of Cutting in G71


G72 Cycle Format - 1 0T/1 1 T/1 5T
The last programming example 03505, shows that G71
can be used for roughing externally or internally. There are The one-block programming format for the G72 cycle is:
two important differences:
G72 P.. Q.. I.. K.. U.. W.. D.. F.. S..
Start point relative to the P point (SP to P versus P to SP)

esp where ...


Sign of the U address for stock allowance on diameter

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

car where ... N8 X5.9 Z-0.8 F0.008


N9 X2.5
First block: N10 XI. 5 ZO
Nil X0.55
W = The depth of roughing cut N12 WO.l F0.02 (Q-POINT = END OF CONTOUR)
R = Amount of retract from each cut N13 GOO G40 X8.0 Z3.0 T0100
N14 M01
Second block:
The concept of G72 cycle is illustrated in Figure 35-16.
P = The first block number of the finishing profile Note the position of the point P as it relates to the start point

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

In the G7 1 cycle for the double block definition, there


were two addresses U. In the G72 double block definition
cycle, there are two addresses W. Make sure you do not
confuse the W
in the first block - depth of cut (actually it is

a width of cut), and the W


in the second block - slock left on

faces. The I and K parameters may be available, depending


on the control.

An example program 03506 for the G72 cycle uses the


drawing data in Figure 35-15.

Basic concept of G72 multiple repetitive cycle

G73 - PATTERN REPEATING CYCLE

The pattern repeating cycle is also called the Closed Loop


or a Profile purpose is to minimize the
Copying cycle. Its
cutting time for roughing material of irregular shapes and
forms, for example, forgings and castings.

G73 Cycle Format- 1 0T/1 IT/1 5T

The one-block programming format for G73 cycle is

similar to the G7 1 and G72 cycles:

G73 P.. Q.. I.. K.. U.. W.. D.. F.. S..

Drawing example to illustrate G72 roughing cycle - program 03506


use where ...

In this facing application, all the main data will be re-


P = The first block number of the finishing profile
versed by 90°, because the cut will be segmented along the
Q = The last block number of the finishing profile
X axis. Roughing program using the G72 cycle is logically
=
I X axis distance and direction of relief - per side
similar to the G71 cycle:
K = Z axis distance and direction of relief
U = Stock amount for finishing on the X axis diameter
LATHE CYCLES 319

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

Ifyour control system requires a double block entry for


D . . . number of cutting divisions or number of repeats
the G73 cycle, the programming format is:
Use this cycle with care - its design assumes an equal
G73 U.. W.. R.. amount of rough stock to be removed along both the X and
G73 P.. Q.. U.. W.. F.. S.. the Z axes. That is not the typical reality for forgings and
castings, where the stock varies all over the material - see
ns* where ...
the illustration in Figure 37-17. The cycle can still be used
with a reasonable efficiency, but some 'air' cutting may be
First block:
an unwanted side effect for odd shaped parts.

U = X axis distance and direction of relief -per side


In the example, the largest expected material amount per
W = Z axis distance and direction of relief
side will be chosen as .200 (10.2) and the largest expected
R = The number of cutting divisions
material amount on the face as .300 (K0.3). The number of
divisions could be either two or
so the program will
three,
Second block:
use D3. Some modification on the control may be neces-
P = The first number of the finishing profile
block sary during actual setup or machining, depending on the
Q = The last block number of the finishing profile exact condition and sizes of the casting or forging.
U — Stock amount for finishing on the X axis diameter
W = Stock left for finishing on the Z axis
This cycle is suitable for roughing contours where the
F = Cutting feedrate (in/rev or mm/rev) overrides finish contour closely matches the contour of the casting or
feedrates between the P block and the Q block forging. Even if there is some 'air’ cutting, this cycle may
S = Spindle speed (ft/min or m/min) overrides spindle be more efficient than the selection of the G7 1 or G72 cy-
speeds between the P block and the Q block cles. The program 03507 shows roughing and finishing
with the same tool (as an example):
In the two-block cycle entries, do not mix up addresses in

the first block that repeat in the second block (U and W in


03507 (G73 PATTERN REPEATING CYCLE)
the G73 example). They have a different meaning! N1 G20 M42
N2 T0100
G73 Example of Pattern Repeating N3 G96 S350 M03
N4 GOO G42 X3.0 Z0.1 T0101 M08
Pattern repeating cycle G73 program example uses the N5 G73 P6 Q13 10.2 K0.3 U0.06 WO. 004 D3 F0.01
drawing in Figure 35-17. N6 GOO X0.35
N7 G01 XI. 05 Z-0.25
N8 Z-0.625
N9 XI. 55 Z-1.0
N10 Z-1.625 R0.25
Nil X2.45
N12 X2.75 Z-1.95
N13 U0.2 F0.02
N14 G70 P6 Q13 F0.006
N15 GOO G40 X5.0 Z2.0 T0100
N16 M30
%

The number of passes D3 may be necessary to accommo-


date some rotating eccentricity, normally associated with
castings and forgings. On the other hand, D2 may be neces-
sary for the heavier cut. to ‘bile under the skin’ of the mate-
rial, for better tool life. Schematically, Figure 35-18 shows
three programmed cutting divisions.

Figure 35-17

Pattern repeating cycle G73 - program example 03507


320 Chapter 35

For safety, use the same start point for G70


as for the roughing cycles.

The roughing program 03505, using the G71 re-


earlier
rough turning and rough boring, can be
petitive cycle for
completed by using another two tools, one for external, one
for internal finishing tool path:

(03505 CONTINUED . . .)

N34 T0500 M42 (OD FINISHING TOOL + GEAR)


N35 G96 S530 M03 (SPEED FOR FINISH TURNING)
N36 G42 X3.1 Z0.1 T0505 M08 (START POS.)
N37 G70 P9 Q17 (FINISHING CYCLE - OD)
N38 GOO G40 X5 0 Z6.0 T0500 .

N39 M01

N40 T0700 (ID FINISHING TOOL)


Schematic representation of G73 cycle
N41 G96 S475 M03 (SPEED FOR ROUGH BORING)
N42 GOO G41 X0.5 Z0.1 T0707 M08 (START POS.)
Note that the pattern repealing cycle does exactly that - it
N43 G70 P24 Q31 (FINISHING CYCLE - ID)
repeats the machining contour (pattern) specified between N44 GOO G40 X5 0 Z2.0 T0700 .

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

The programming format for G70 cycle is:


will be a waste of lime, since the .007 in/rev feedrate will
never be used. It will be overridden by the feedrate defined
G70 P.. Q.. F.. S..
between blocks N9 and N17 of program 03505). On the
other hand, if there is no feedrate programmed for the fin-
csr where ...
ishing contour at all, then

P = The first number of the finishing profile


block
= N. . G70 P. . Q. . F0.007
Q The last block number of the finishing profile
F = Cutting feedrate (in/rev or mm/rev)
= will use .007 in/rev exclusively for the finishing tool path.
S Spindle speed (ft/min or m/min)

The same logic described for G71 cycle, applies equally


The cycle G70 accepts a previously defined finishing
contour from either of the three roughing cycles, already
to the G72 cycle. The roughing program 03506, using the
G72 cycle for rough turning of the part face, can be com-
described. This finishing contour is defined by the P and
pleted by using another external tool for finishing cuts
the Q points of the respective cycles, and is normally re-
peated in the G70 cycle, although it can change.
using the G70 cycle:
LATHE CYCLES 321

(03506 CONTINUED ...) G74- PECK DRILLING CYCLE


N15 T0500 M42 (OD FACING TOOL + GEAR)
N16 G96 S500 M03 (SPEED FOR FINISH FACING) The G74 cycle is one of two cycles usually used for non
N17 GOO G41 X6.25 Z0.3 T0505 M08 (START POS.) finishing work.Along with G75 cycle, it is used for ma-
N18 G70 P6 Q12 (FINISHING CYCLE) chining an interrupted cut, such as chips breaking during a
N19 GOO G40 X8.0 Z3 T0500 .
long cutting motion. G74 cycle is used along the Z axis.
N20 M30
% This is the cycle commonly used for an interrupted cut
along the Z axis. The name of the cycle is Peck Drilling Cy-
The rules mentioned earlier also apply for the contour
cle, G73 peck drilling cycle, used for machin-
similar to the
finishing defined by the G72 cycle. Program 03507, using
ing centers. For the lathe work, G74 cycle application is a
the G73 cycle, can be also be programmed by using another
little more versatile than for its G73 equivalent on machin-
external tool for finishing, applying the same rules.
ing centers. Although its main purpose may be applied to-
wards peck drilling, the cycle can be used with equal
BASIC RULES FOR G70-G73 CYCLES efficiency for interrupted cuts in turning and boring (for ex-
ample, in some very hard materials), deep face grooving,

In order to make the multiple repetitive stock removal cy-


difficult part-off machining, and many other applications.

cles (contouring cycles) work properly and efficiently, ob-


serving the rules of their use is very important. Often a
G74 Cycle Format- 10T/11T/15T
small oversight may cause a lengthy delay.
The one-block programming format for G74 cycle is:

Here are the most important rules and observations:


G74 X..(U..) Z..(W..) I.. K.. D.. F.. S..
Always apply tool nose radius offset
before the stock removal cycle is called esp where ...

Always cancel tool nose radius offset =


X(U) Final groove diameter to be cut
after the stock removal cycle is completed
Z(W) = Z position of the last peck -depth of hole

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

G71 cycle, and along one axis only (WO)


G74 Cycle Format - OT/1 6T/1 8T/20T/21
Stock allowance U is programmed on a diameter,
and its sign shows to which side of the stock it is to The two-block programming format for G74 cycle is:

be applied (sign is the direction in X, to or from the


spindle centerline) G74 R..
G74 X..(U..) Z..(W..) P.. Q.. R.. F.. S..
Feedrate programmed for the finishing contour
(specified between the P and Q points) will be
er where ...
ignored during roughing

D address does not use decimal point, and must be First block:

programmed for leading zero suppression format:


R = Return amount (clearance for each cut)

D0750 or D750 is equivalent to .0750 depth


Second block:

X(U) = Final groove diameter to be cut


Only some control systems do allow a decimal point
Z(W) = Z position of the last peck (depth of hole)
to be used for the D address (depth of cut)
P = Depth of each cut (no sign)
in G71 and G72 cycles.
Q = Distance of each peck (no sign)
R = Relief amount at the end of cut
(must be zero for face grooving)

F = Groove cutting feedrate (in/rev or mm/rev)


S = Spindle speed (ft/min or m/min)
322 Chapter 35

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)

cal peck drilling operation, only the Z, K and F values are


(for multiple grooves only)

programmed D = Relief amount at the end of cut


- see Figure 35-19.
(must be zero or not used for face groove)
F = Groove cutting feedrate (in/rev or mm/rev)
S = Spindle speed (ft/min or m/min)

G75 Cycle Format - OT/1 6T/1 8T/20T/21

The two-block programming format for G75 cycle is:

G75 R..
G75 X..(U..)Z..(W..)P.. Q.. R.. F.. S..

cg= where ...

Schematic format for G74 cycle example


First block:

The following program example illustrates G74 cycle:


R = Return amount (clearance for each cut)
03507 (G74 PECK DRILLING)
N1 G20 Second block:
N2 T0200
N3 G97 S1200 M03 (SPEED IN RPM) X(U) = Final groove diameter to be cut
N4 GOO XO Z0.2 T0202 M08 (START POSITION) Z(W) = Z position of the last groove
N5 G74 Z-3.0 KO F0.012 . (PECK DRILLING) P = Depth of each cut (no sign)
N6 GOO X6.0 Z2.0 T0200 (CLEAR POSITION) Q = Distance between grooves (no sign)
N7 M30 (END OF PROGRAM) R = Relief amount at the end of cut
% (must be zero for face grooving)
F = Groove cutting feedrate
Drilling will take place to a three inch depth, in depth in- (usually in/rev or mm/rev)
crements of one half of an inch. Note the depth of the first S = Spindle speed (usually ft/min or m/min)
peck is calculated from the start position. Programming of
an interrupted groove is very similar in format. If both the Z(W) and K (or Q) are omitted in the cycle, the
machining is along the X axis only (peck grooving).

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

example for breaking chips during a long or deep cutting


Several notes are common to both cycles:
motion. C75 cycle is used along the X axis.
In both cycles, the X and Z values can be programmed
This is also a very simple cycle, designed to break chips either in the absolute or incremental mode.
during a rough cut along the X axis - used mainly for a
grooving operation. The G75 cycle is identical to G74, ex- Both cycles allow an automatic relief.

cept the X axis is replaced with the Z axis. The relief amount at the end of cut can be omitted -

in that case it will be assumed as zero.


G75 Cycle Format - 10T/1 IT/1 5T
Return amount (clearance for each cut) is only
The one-block programming format for G75 cycle is: programmable for the two-block method. Otherwise,
it is set by an internal parameter of the control system.

G75 X..(U..)Z..(W..)I.. K.. D.. F.. S..


If amount is programmed (two-block method),
the return
and the amount is also programmed, the
relief
us where
-
...
presence of X determines the meaning. If the X value
is programmed, the R value means the relief amount.
X(U) = Final groove diameter to be cut
Z(W) = Z position of the last groove
(for multiple grooves only)
36 GROOVING ON LATHES

Groove cutting on CNC lathes is a multi step machining Grooving Criteria


operation. The term grooving usually applies to a process
of forming a narrow cavity of a certain depth, on a cylinder,
For a CNC programmer, grooving usually presents no
cone, or a face of the part. The groove shape, or at least a
special difficulties.Some grooves may be easier to pro-
significant part of it, will be in the shape of the cutting tool.
gram than others, yet there could be several fairly complex
grooves found in various industries that may present a pro-
Grooving tools are also used for a variety of special ma-
chining operations.
gramming or machining challenge. In any case, before a
groove can be programmed, have a good look at the draw-
The grooving tool is usually a carbide insert mounted in a ing specifications and do some overall evaluations. Many
special tool holder, similar to any other tool. Designs of grooves may appear on the same part at different locations
grooving inserts vary, from a single tip, to an insert with and could benefit from a subprogram development. When
multiple tips. Inserts are manufactured to nominal sizes. planning a program for grooving, evaluate the groove
Multi tip insert grooving tools are used to decrease costs carefully. In good planning, evaluate the selected groove by
and increase productivity. at least tliree criteria:

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
-

finishing cut. Another grooving tool may be used for fin-


ishing, if the tolerances or excessive tool wear make it more
practical - Figure 36-2.

Typical groove locations on a part

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

is to modify an existing insert in-house.


depth clearance of the insert or tool holder. However, there
is usually no problem
using a narrow grooving insert to
in
Generally, in CNC programming, off-the-shelf tools and make a wide groove with multiple cuts. The same applies
insertsshould be used as much as possible. In special cases, for a deep cutting insert used to make a shallow groove. The
however, a standard tool or insert can be modified to suit a dimensions of a groove determine the method of machin-
particular job. For grooving, it may be a small extension of ing. A groove whose width equals the insert width selected
the insert cutting depth, or a radius modification. Try to for the groove shape, requires only one cut. Simple feed-in
modify the groove shape only as the last resort. Modi-
itself and rapid-out tool motion is all that is required. To program
fication of standard tools slows down the production and a groove correctly, the width and depth of the groove must
can be quite costly. be known as well as its position relative to a known refer-
ence position on the part. This position is the distance to

GROOVE LOCATION one side - or one wall - of the groove.

Some extra large grooves require a special approach. For


Groove location on a part is determined by the part draw- example, a groove that is 10 wide and 8 mm deep can- mm
ing. The locations can be one of three groups: not be cut in a single pass. In this case, the rough cuts for
the groove will control not only its width, but also its depth.
Groove cut on a cylinder ... diameter cutting
It is not unusual to even use more than one tool for such an
Groove cut on a cone ... taper cutting operation. Program may also need to be designed in sec-
tions. In case of an insert breakage, only the affected pro-
Groove cut on a face ... shoulder cutting
gram section has to be repeated.
GROOVING ON LATHES 325

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.

Deep grooves are usually grooves that have a reasonably


normal width but also have a much deeper ratio between
the groove top diameter and its bottom diameter.

SIMPLE GROOVE PROGRAMMING

The simplest of all grooves is the one that has the same
width and shape as the tool cutting edge - Figure 36-6.

Groove position dimensioning - two common methods

In the example 36-4a, the dimension L is measured to the


left side of the groove. For programming purposes, this di-
mension is more convenient, because it will actually appear
in the program as specified in the drawing. Normally, the

standard tool reference point of a grooving tool is set to the


left side of the grooving insert.

The example in Figure 36-4b , the dimension L is to the


right side of the groove. The left side dimension can be
found easily, by adding the groove width W. The program-
ming considerations will be slightly different, particularly
if the dimensional tolerances are specified. Always take the
approach that the specified dimension indicates the more
important dimension. If a tolerance range is specified for
any dimension, the tolerance must always be maintained on
the finished groove, and it will affect the overall program-
Simple groove example - program 03601
ming method. A groove may also be dimensioned from an- Insert width is equal to the groove width
other reference location, depending on its purpose.

The program such a groove is very straightforward. In


Groove Depth rapid mode, move the grooving tool to the starting position,
feed-in to the groove depth, then rapid out back to the start-
In Figure 36-5, there are two typical methods of dimen-
ing position, and - the groove is finished. There are no cor-
sioning the groove depth.
ner breaks, no surface finish control, and no special tech-
niques used. Some will say, and no quality either. A dwell
at the bottom of the groove may be the only improvement.
True, the quality of such a groove will not be the greatest,
but a groove it will be. Such a groove is strictly a utility type
groove and is hardly ever required in precision manufactur-
ing. At the same time, programming such grooves is a good
start to learn more advanced techniques.

The following program 03601, uses a standard .125 inch


square grooving insert, for the groove of the same width.
The groove depth is the single difference between the two
diameters given in the drawing:
Figure 36-5
( 2.952 - 2 . 637 ) / 2 = .1575
Groove depth dimensioning -
two common methods
326 Chapter 36

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:

(3.1 - 2.952) / 2 = .074

The coolant is applied in the same block, during the tool

motion. Block N36 contains the actual groove plunging


cut, ata slow feedrate of .003 in/rev. Block N37 is a dwell
time of 0.4 seconds, followed by the tool return to the start-
ing diameter and completion of the program. BREAK CORNERS 0.012 x 45°

Although grooving example was very sim-


this particular Figure 36-7

ple, let’s evaluate the program a


little more. It contains sev- Drawing for a precision groove example 03602
eral important principles that can be applied to the method
of programming any groove, where its precision and sur- What is method? One plunge rough cut
the best cutting
face Finish are very critical. and two one for each wall, are reasonable; so is
Finish cuts,
the .006 stock added to the bottom diameter. Also, sharp
Note the clearance before the groove cutting begins. The
corners will be broken with a .012 chamfer at the 04.0.
tool is positioned .074 inches above the part diameter, at
Figure 36-8 shows the distribution of the cuts.
03.100. Always keep this distance to a certain safe mini-
mum. Grooves are usually cut at a slow feedrate and it may
take too much time just to cut in the air. Also note the actual
cutting feedrate has increased from .003 in/rev in block
N36 to a rather high feedrate of .050 in/rev in block N38.
Rapid motion command GOO could have been used instead.
Feeding out at a heavier feedrate (rather than using a rapid
motion), may improve the groove surface Finish by elimi-
nating the tool drag on the walls (sides).

The width of .125 never appears in the program, di-


tool
That means the shape and width of the
rectly or indirectly.
insert will become the shape and width of the groove. It
also means a different groove width, if another insert size is
used, although the program structure remains unaffected.
The structure will remain unaffected even if the grooving
tool shape is changed. Combination of the shape and the
size change will offer endless opportunities, all of them be
ing possible without a single change to the program.
Precision groove - distribution of cuts for the example 03602
GROOVING ON LATHES 327

Before the block can be programmed, selection of


first chined with a .1250 wide grooving insert, will need at least
the cutting tool and machiningmethod is a sign of a good two grooving cuts. But what about a groove that is much
planning. These are important decisions because they di- wider than the groove in the example?
rectly influence the final groove size and its condition.
There is an easy way to calculate the minimum number of
Groove Width Selection grooving cuts (or plunges), using the following formula:

The grooving tool selected for the example in program


03602 be an external tool, assigned to the tool station
will
number three - T03. Tool reference point is selected at the
left edge of the insert, which is a standard selection. The in-
sert width has to be selected as well. Grooving inserts are
where ...

available in a variety of standard widths, usually with an in-


crement of 1 mm for metric tools, and 1/32 or 1/16 inch for C mln = Minimum number of cuts
tools in the English system. In this case, the non-standard Gw = Groove width for machining
groove width is .1584 inch. The nearest standard insert T„ = Grooving insert width
width is 5/32 inch (0. 15625 inch). The question is - should
we select the 5/32 inch insert width? In a short answer, no. Applying the formula to the example, the starting data are
In theory, this insertcould cut the groove, but because the the groove width of 584 of an inch and the grooving insert
. 1

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.

grooving tool is selected, the initial values can be assigned -


Even if only an acceptable quality groove is produced
the offsetnumber (03), the spindle speed (400 ft/min), the
during machining, such a result does not give the program-
gear range (M42) - and a note for the setup sheet:
mer much credit. What can be actually done to assure the

T0303 = .1250 SQUARE GROOVING TOOL highest groove quality possible?

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)

N41 T0300 M42


How can this suggestionbe applied to the example? The
N42 G96 S400 M03 key is knowledge of machining processes. Machining
the
experience confirms that removing an equal stock from
each wall (side) of the groove will result in better cutting

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.

detailed description is necessary.


If at least three grooving cuts are used to form the groove
One simple programming method is not an option - the rather than the minimum two cuts, the CNC programmer
basic in-out technique used earlier. That means a better will gain control of two always important factors:
method must be selected, a method that will guarantee a
Control of the groove POSITION
high quality groove. The first step towards that goal is the
realization of the fact that a grooving insert with the width Control of the groove WIDTH
narrower than the groove width, will have to be plunged
into the groove more than once. How many times? It is not
In precision grooving, these two factors are equally im-
portant and should be considered together.
difficult to calculate that a groove .1584 wide and ma-
328 Chapter 36

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:

(.1584 - .1250) / 2 = .0167

The tool Z position will be .0167 on the positive side of


the left wall. If this wall is at Z-0.625, the grooving tool
start position will be at Z-0.6083. When the tool completes
the first plunge, there will be an equal amount of material
left for finishing on both walls of the groove.

Do your best to avoid rounding off the figure .0167, for


example, to .0170 inch. It would make no difference for the
machining, but it is a sound programming practice to use
only the calculated values. The benefit of such approach is
in eventual program checking, and also with general con-
sistency in programming. Equal stock amounts offer this
consistency; .0167 and .0167 is a better choice than .0170

and .0164, although the practical results will be the same.


Precision groove - groove data used in program 03602
GROOVING ON LATHES 329

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 .

tively high but non-cutting feedrate:


probably a more common way of specifying a tolerance.
Only the dimensional value that falls within the specified
N49 X4.1 Z-0.6083 F0.04
range can be used in a program. In this example, the aim is

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

a tool wear. As the insert works harder and harder, it wears


to change the G50 coordinates in the program, if this older
setting is still used, or use a different work coordinate off-
off at its edges and actually becomes narrower. Its cutting
capabilities are not necessarily impaired, but the resulting
set. The method used here is probably the simplest and also
the safest. All motions relating to the right chamfer and the
groove width may not fall within close tolerances. Another
right side groove wall will be programmed in the incremen-
cause for an unacceptable groove width is the insert width.
Inserts are manufactured within high level of accuracy, but
tal mode, applied to the Z axis only, using the W address:
also within certain tolerances. If an insert is changed, the
groove width may change slightly, because the new insert
N50 WO. 0787 T0313
N51 X3.976 W-0.062 F0.002
may not have exactly the same width as the previous one.
To eliminate, or at least minimize, the possible out of toler- In block N50, the tool travels the total distance equivalent
ance problem, use quite a simple technique - program an sum of the
to the right wall stock of .0167, the chamfer of
additional offset for finishing operations only.
.012 and the clearance of .050. In the same block, the sec-

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

At complete program 03602 can be de-


this point, the
Groove Surface Finish
veloped. Note program blocks where the offset has been
Programming just about any precision groove should be
changed, they are identified in the comment section:
fairly easy from now on. Only a few last notes on the sub-
ject of groove cutting as they relate to the surface finish.
03602 (PRECISION GROOVE)
(G20)
Just by following the suggested methods of equal cut distri-
bution, proper spindle speeds and feedrates, good condition
N41 T0300 M42 (NO OFFSET) of the cutting tool and insert, suitable coolant, and other
N42 G96 S400 M03 techniques used in the example, the surface finish will al-
N43 GOO X4.1 Z-0.6083 T0303 M08 (OFFSET 03) most take care of itself.
N44 G01 X3.826 F0.004
N45 GOO X4.1 Keep in mind, that the term ‘precision groove’ does not
N46 Z-0.687 only describe the precise groove position and its precise di-
N47 G01 X3.976 Z-0.625 F0.002 mensions, it also means a high quality look, a look that of-
N48 X3.826 F0.003 ten means much more than just a cosmetic feature.
N49 X4.1 Z-0.6083 F0.04
N50 WO. 0787 T0313 (OFFSET 13)
N51 X3.976 W-0.062 F0.002 MULTIPLE GROOVES
N52 X3.82 F0.003
N53 Z-0.6247 T0303 (OFFSET 03)
Multiple grooving is a common term used for cutting the
N54 X4.1 Z-0.6083 F0.04
(NO OFFSET) same groove at different positions of the same part. In these
N55 GOO X6.0 Z3 0 T0300 M09 .

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

to control the groove width, not its diameter.


When cutting multiple grooves, more material will be re-
moved. On external diameter grooves, there are no special
Always follow these precautions, based on the example considerations necessary, gravity will take care of the extra
program 03602: chips. This is not the same situation for internal grooves.
The moment several grooves are machined internally, there
Start machining with identical initial amounts assigned to
is a small pile of cutting chips accumulated in the bored
both offsets (the same XZ values for offsets 03 and 13).
hole. in the way of a smooth cutting op-
These chips can be
The X amounts of 03 and 1 3 must always be the
offset eration and could damage the bored diameter and even the
same. If the X setting of one offset is changed, the setting grooving tool itself. To solve this problem, consider ma-
of the other offset must be changed to the same value. chining of only a few grooves, move the tool out and blow
Adjust both X offsets to control the groove depth tolerance. out the chips from the internal area. Using the optional stop

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.

To adjust the groove left side wall position,


change the Z offset 03. FACE GROOVES
To adjust the groove right wall position,
change the Z offset 13.
Face grooving (sometimes incorrectly called trepanning)
is a horizontal groove cutting process, with the tool moving
Do not cancel the current offset -
along the Z axis. The tool is programmed along the same
- change from one to the other offset directly.
principles as vertical grooving along the X axis. Because of
Make sure the tool number (the first two digits the nature of such a grooving cut, the tool orientation pres-
of the T address) does not change, otherwise, ents the most important single consideration in face groov-
THERE WILL BE A TOOL CHANGE! ing. The issue is the radial clearance of the cutting insert,
during a cut. There is no need worry too much about ra-
to
Other precautions can be added, depending on the exact dial clearance for vertical grooving, because the cutting
conditions. Use common sense, and always check the pro-
edge of the insert is on the same plane as the machine cen-
gram carefully, before it is released to production.
ter line. However, in horizontal grooving, the insert clear-
ance along the cut radius is of utmost importance.
GROOVING ON LATHES 331

The next example shows how to program a typical face


groove, and is illustrated in Figure 36-10.

Figure 36- 1

Interference of a standard grooving insert on a face groove

Face grooving example - program 03603

Although both the external and internal groove diameters


are engineering choices in the drawing, the actual groove
width is necessary for programming as well. To calculate
the groove width, use a simple calculation - find one half of

the difference between the two grooving diameters - that is:

(2.625 - 2.075) / 2 = .275

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.

03603 (FACE GROOVE)


Radial Clearance (G20)

Many grooving inserts are high, in order to give them


N21 T0400 M42
strength. The grooving insert for face grooving operations N22 G96 S450 M03
is mounted at 90° towards the part face (parallel to the spin- N23 GOO X2.1 Z0.05 T0404 M08
dle center line). A standard grooving insert has virtually no N24 G01 Z-0.123 F0.003
radial clearance and most likely will interfere with the part N25 Z0.05 F0.04
at its lower end - Figure 36-11. N26 XI. 951
N27 X2.075 Z-0.012 F0.001
From obvious that the grooving insert
the illustration is N28 Z-0.123 F0.003
cannot be used as is and has to be modified. Such a modifi- N29 X2.1 Z0.05 F0.04
cation is usually done by grinding a suitable radial clear- N30 U0.149
ance, as illustrated in Figure 36-12.
N31 U-0.124 Z-0.012 F0.001
N32 Z-0.125 F0.003
This is a simple operation, providing the proper grinding N33 X2.0755
N34 X2.1 Z0.05 F0.04 M09
tools are available. Make sure that the grinding does not af-
N35 GOO X8.0 Z3.0 T0400
fect the insert width and only minimum necessary material
N36 M30
is removed, otherwise the tool loses strength. %
332 Chapter 36

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

The grooving insert may also be a standard type insert,


of the neck. The block N220 can also be programmed as an
placed into a 45° angle tool holder. The purpose of this type
incremental motion:
of a groove is to allow machining of recesses and under-
cuts, usually in a corner of the part. It assures a shoulder N220 G01 U-0.162 W-0.081 F0.004
match of two assembled components. N221 GO 4 X0.1
N222 U0.162 WO. 081 F0.04
To program a corner groove (neck groove), the radius of
the grooving insert must be known, .031 (1/32) of an inch
in the example. The cutting depth is established from the GROOVING CYCLES
drawing data. Normally, the corner groove is specified as a
‘minimum undercut’. In this case, the center of the under- Fanuc controls for lathes offer two multiple repetitive cy-
cut will be at the intersection of the shoulder and the diame- cles G74 and G75 that can be used for an interrupted cut-
ter. The and out of the groove must be at
cutting motion in ting along an axis. The programming formats for both cy-
45°, meaning amount of travel in both X and Z
the identical cles were described in the previous chapter. G74cycle is
axes. Figure 36-/3 illustrates a corner groove with a .031 used for cutting along the Z axis and used mostly for
is

radius minimum undercut. peck drilling, the G75 is used for cutting in the X axis, and
is used mostly for simple grooving.

G75 Cycle Applications


Although used mainly for grooving, G75 cycle can also
be used for an interrupted cut in facing. This cycle is quite
simplistic to be of any use lor high quality surface finish,
but it does have its benefits. Its main purpose is to break
chips while cutting along the X
axis. This is useful for some
grooving and part-off operations, as well as face cutting.
Another use is for roughing the core out of deep grooves, so
they can be finished later by more precise methods.

In G75, the chip breaking is done by alternating between


a cutting motion in one direction and a rapid retract motion
in the means that one cutting mo-
opposite direction. This
tion always followed by an opposite rapid motion, on the
is

basis offeed-in-rapid-out principle and a built-in clearance.


Figure 36-14 illustrates the concept.

Corner groove - undercut program example 03604

The program itself has no hidden surprises and is not


difficult to complete or interpret:

03604 (CORNER GROOVE)


(G20)

N217 G50 S1000 T0500 M42


N218 G96 S375 M03
N219 XI. 08 Z-0.95 T0505 M08
N220 G01 X0.918 Z-1.031 F0.004
N221 G04 X0.1
N222 XI. 08 Z-0.95 F0.04
N223 GOO X6.0 Z3 0 T0500 M09 .

N224 M30
% Schematic representation of the G75 cycle
GROOVING ON LATHES 333

The motion retract amount is built within the


cycle and is
setby an internal parameter of the control system. In Figure
36-14 it is identified by the value d, (usually set to approxi-
mately .0 0 to .020 inches in the control). The next two ex-
1

amples illustrate the practical use of G75 grooving cycle.

Single Groove with G75

A single groove requires the X and Z coordinate of the


starting point, the finalgroove diameter X. and the depth of
each cut I. For a single groove, the Z axis position and the K
distance cannot be programmed. The Z position is given by
the starting point and does not change.

Multiple groove example using the G75 cycle program 03606


-

The program example 03606 for multiple grooves, using


G75 cycle, is based on Figure 36-16.

03606
(G75 MULTIPLE GROOVES)
(G20)

N82 G50 S1250 T0300 M42


N83 G96 S375 M03
N84 GOO XI. 05 Z-0.175 T0303 M08
N85 G75 X0.5 Z-0.675 10.055 K0.125 F0.004
N86 GOO X6.0 Z2 0 T0300 M09
.

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.
%

Note that the value is .055. This is not a value without a


I
SPECIAL GROOVES
meaning. In fact, it is a carefully calculated depth of each
groove peck. The tool travel will be from .050 to 0.500, 0 1 There are many more types of grooves than can be de-
or .275 per side (1.05-.50)/2=.275. There will be exactly scribed in this handbook. They are mainly grooves of spe-
five grooving pecks of .055 each (.275/5-.055). cial shapes, used by specific industries - grooves that serve

a certain purpose. The most typical grooves of this type are


Multiple Grooves with G75 round grooves, pulley grooves, O ring grooves, and several
others. Certain grooves, usually those that conform to
It is possible to program multiple grooves very easily, us- common industrial standards, can be machined with read-
ing the G75 cycle. In this case, the groove spacing, the pitch ily available inserts. A typical example of this kind of
between grooves must always be equal, otherwise the G75 grooving is a pulley groove. The programming principles
cycle cannot be used. The clearance specification d in Fig-
for 'nonstandard' grooves are no different than those de-
ure 36-14 is normally not programmed. scribed in this chapter.
334 Chapter 36

GROOVES AND SUBPROGRAMS 03607 (GRV W/SUB-PROG)


(T01 - 55 DEGREE DIAMOND INSERT)
N1 G20 T0100
Programming multiple grooves with the G75 cycle is N2 G96 S500 M03
usually not the preferred method for precision work. The N3 GOO XI. 2 ZO T0101 M08
two main drawbacks are the groove quality and the require- N4 G01 X-0.07 F0.006 (FACE OFF)
ment for an equal spacing between the grooves. There is N5 GOO ZO.l
N6 G42 X0.7 (START OF CHAMFER)
another method to program multiple grooves, a more effi-
N7 G01 X0.95 Z-0.025 F0.003 (CHAMFER)
cient method - one that uses subprograms.
N8 Z-2.285 (TURN OD)
N9 U0.2 F0.03
Multiple grooves can be programmed very efficiently
N10 GOO G40 X4.0 Z4.0 T0100 M09
and with much increased precision by using the technique Nil M01
of subprograms, described in Chapter 39. The guiding
principle is to program all common groove motions in the (T05 - 0.125 PART-OFF TOOL)

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)
(

Figure 36-17 N4 G01 X0.9 WO. 05 F0.002 (LEFT CHFR)


Multiple grooves programming using a subprogram - N5 X0.66 F0.004 (FEED TO ROUGH OD)
03607 is the main program and 03657 is the subprogram N6 XI. 0 WO. 0375 F0.03 (BACK TO START)
N7 WO. 0875 (SHIFT TO RIGHT CHFR)
N8 X0.9 W-0.05 F0.002 (RIGHT CHFR)
In the Figure 36-17 is a simple example of a multiple
N9 X0.65 F0.004 (FEED TO FINISH OD)
groove programming, using a subprogram. Only two cut- N10 W-0.075 (SWEEP BOTTOM)
ting tools are used - a turning tool used for facing and turn- Nil XI. 0 WO. 0375 F0.03 (BACK TO START)
ing and a 0. 125 wide part-off tool that machines the four N12 M99 (RETURN TO MAIN)
grooves, cuts the back chamfer and parts-off the finished %
part. Part-off operations are described in the next chapter
and subprograms are discussed in Chapter 39. Note that all This example completes the chapter related to grooving.
the tool motions related to the position of the groove are Although grooving is a relatively simple machining opera-
programmed in the mam program 03607, all the tool mo- tion, programming grooves can become a significant chal-

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; sometimes called a cutoff ;


.
is a machining opera- At the end of the metal blade is usually a carbide insert,
tion typical to lathe work, usually using a barfeeder attach- with clearance angles on both sides. The cutting end of the
ment. During a part-off, the cutting tool (or part-off tool) tool is available in several different configurations, always
separates the completed part from the bar stock. The com- atthe end tip of the carbide portion. The most typical tool
pleted part will fall off the bar, usually into a special bin to end configurations are shown in the following illustration -
protect it from damage. Figure 37-2:

PART-OFF PROCEDURE

Programming procedure for a part-off tool path is very


similar to the grooving procedure. In fact, part-off is an ex-
tension of grooving. The purpose of part-off is somewhat
different,because the objective is to separate the completed
part from the stock material, rather than create a groove of
certain width, depth and quality. The material bar stock is

usually a long round rod that is 8, 10, 12 or more feet long.

Two most important considerations in part-off are the


same as those for standard grooving. One is the chip con-
trol, the other is coolant application.

Parting Tool Description


Part-off tool - cutting tip configurations

Part-off uses a special cutting tool. Such a tool used for


Note the two kinds of each grooving insert design shown
part-off is called a parting tool ora part-off tool. Sometimes
- dimple (items a, h and c), and the se-
the series without a
the term cutoff is used for this kind of a tool, as well as the
ries with a dimple (items d, e and f). The dimple is an inten-
machining method; it has the same meaning as the term
tional dent pressed in the middle of the cutting edge that de-
part-off. The part-off tool is similar in design to a grooving
forms the chip and helps in coiling it. The result is a chip
tool, with one major difference. The length of the cutting
that is narrower than the width of the cut. Such a chip does
blade is much longer than that of a grooving tool, making it
not clog the generated groove and extends the tool life, al-
suitable for deep grooves. A typical example of a part-off'
though it may cost a little more.
tool is illustrated in Figure 37-1.
Also note a slight angle on h, c, e and / styles. The angle
PART-OFF TOOL helps in controlling the size and shape of the stub left on the

part when it is separated from the solid bar. It also controls


the rim size that over on the part when parting-off a
is left

tubular bar. Although all designs have their special applica-


tions, probably the most versatile choice would be the style
f particularly for large cutting diameters. Unlike in the
~r
other types of machining, the cutting chips for part- off
EFFECTIVE should coil, not break. The cutting insert with a dimple or a
— CUTTING RADIUS similar design is the best suited for that purpose.

1 1 L It is a common practice amongst programmers to use


only one parting tool for all the work. They select the part-
- TOOL WIDTH ing tool long enough to accommodate the maximum bar
diameter and leave it permanently mounted in the tool
Figure 37-1 holder, even for small diameters. The reasoning for this ap-
Part-off tool - cutting end configuration proach is that it saves a setup time. That is true to some
extent but has a downside as well. The long part-off tool

335
336 Chapter 37

usually has a wider insen than a short tool, in order to com-


pensate for strength and rigidity. When the bar size is large,
a long part-off tool is necessary, with its relatively wide in-

sert. If such a tool used for short parts, such as rings or


is

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.

A generous supply of coolant should always be made


A water
available at the cutting edge, just like for grooving.
soluble coolant is a good choice, since it offers both the
cooling and lubricating qualities. A typical mixture would
be one part of soluble oil for 5-20 parts of water or as rec-
1

ommended by the coolant manufacturer. Make sure the


coolant is supplied at full pressure, particularly for larger
diameters. The pressure helps the coolant to reach the cut- Part-off tool approach - right side tool reference - program 03702
ting edge and flush off the chips that may accumulate in the
opening. In the examples, the tool change position and the final re-
sults are identical. Comparison of both programs shows the
Tool Approach Motion values of X axis unchanged, but the values for Z axis are
different (blocks N 1 22 and N 1 25). This reflects the cutting
The first step to program a part-off tool path is to select a
side of the tool tip.
part-off tool that has enough capacity to completely sepa-
rate the part from a solid bar. The next decision is to select 03701 (PART-OFF / LEFT SIDE TOOL EDGE)
the insert width and the location of the tool reference point.
A part-off tool that is too short will not reach the spindle N120 G50 S1250 T0800 M42
centerline safely. A tool too long may not be rigid enough, N121 G96 S350 M03
may cause vibrations, even break during the cut. The width N122 GOO X2.65 Z-2.0 T0808 M08
of the insert is also important for good cutting conditions. N123 G01 X-0.03 F0.004
N124 GOO X2.65 M09
The width of the tool is directly proportionate to the cutting
N125 X5.5 Z2.0 T0800
depth capacity.
N126 M30
%
Selection of the part-off tool reference point follows the
same rules as those for a grooving tool. It is definitely ad-
This example is consistent with the previous suggestions
vantageous to have the same side for both, grooving and
for precision grooving. Setting up the tool reference point
parting, to maintain setup consistency. The following pro-
grams illustrate the difference between the tool reference
on the left side of the tool is easier for the CNC operator. If
there is a good reason, set the tool reference point on the
point on the and on the right side of the tool tip - Figure
left
right side and program according to the Figure 37-4.
37-3 for program 03701 and Figure 37-4 for program
03702). In both cases, the program zero is the front face of
03702 (PART-OFF / RIGHT SIDE TOOL EDGE)
the finished part.
N120 G50 S1250 T0800 M42
N121 G96 S350 M03
TOOL SETTING POINT N122 GOO X2.65 Z-1.875 T0808 M08
N123 G01 X-0.03 F0.004
i
GOO N124 GOO X2.65 M09
0.125 N125 X5.5 Z2.125 T0800
H- N126 M30
02.65
%
02.50 05.5
02.40 The weakness of the left side tool setting is that the insert
width has to be always added to the Z position in the pro-
XO gram. In the second example, the final length of the part is

0.125 1.875 ZO 2.0


- I
used directly, but a possible collision with the chuck or col-
let docs exist. Take care selecting the X axis tool approach

position and program the tool above the stock diameter,


even if the previous turning operations removed most of the
Figure 37-3
stock. Figure 37-5 shows correct and incorrect approaches
Part-off tool approach - left side tool reference - program 03701
of a part-off tool.
PART-OFF 337

Part-off with a Chamfer

Not always the machined part will be done during a sec-


ondary operation. When the machining has to be com-
pleted with a part-off tool, it will require the best quality
overall finish possible. One requirement of a good surface
finish isbroken sharp corners. In the example, the sharp
corner is at the intersection of X2.4 and Z- 1.875. If the
turning tool cannot cut the chamfer during turning opera-
tion, part-off tool can be a better choice. Most part-off tools
are not designed for cutting sideways (along the 7 axis), but
Correct and incorrect approach to stock diameter
chamfering removes only a small amount of material that is
within the tool capabilities. Avoid chamfers that are wider
than about 75% of the insert width or take several cuts if
Stock Allowance needed. The chamfer has to be cut before the part-off and it
Part-off operation does not always mean all the machin- should be cut from outside in, not from inside out. The cor-
rect programming technique for machining a chamfer dur-
ing has been completed. Often, part-off may complete only
the first operation and additional machining will be neces- ing part-off is summed up in the following steps:

sary on the such an event, some extra ma-


machined part. In
Position the tool further in the Z axis
terial on the back face, for subsequent
(stock) has to be left than would be normal for regular part-off
finishing. Leave a stock amount of about .010 to .020
Start the part-off operation and terminate just
inches (0.3 to 0.5 mm). In that case, the block N122 would it

below the diameter where the chamfer will end


be changed in both programs - for example, from Z-2.0 to
Z-2.01 in the first program example 03701 and from Return to the starting diameter and
Z- .875 to Z- .895 in the second program example 03702.
1 1 move to the chamfer start position

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

will leave . 1 25 inches actual clearance above the 02.400. If


To illustrate the programming technique, study the fol-
that seems a little too much, think again. Always consider
lowing program example 03703 and illustration shown in
the actual stock diameter, for safety reasons. In the exam-
Figure 37-6 - the tool reference point is on the left side, and
ple, the 2.500 inches and the actual
bar stock diameter is
the required chamfer is .020 inches at 45°:
clearance will be a more reasonable .075 of an inch per side
of the stock.

Tool Return Motion

Another safely aspect of programming a part-off tool is


the method of returning to the tool change position, when
the parting operation is completed. It may be very templing
to replace the two program blocks N124 and N125 with a
single block, then return to the tool change position imme-
diately after the part-off:

N124 GOO X5.5 Z2 . 0 (or Z2.125) T0800 M09

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

should have been removed by the tool and it should have


fallen into the bin but has all this actually happened? A va-
-
Corner breaking with a part-off tool - example 03703
riety of reasons may cause an incomplete part-off. The re-
sult is a broken tool, scrapped part, possibly a damage to
the machine itself. 03703 (PART-OFF CHFR)
(G20)

Always return in the X axis first,


N120 G50 S1250 T0800 M42
and always above the bar stock diameter.
N121 G96 S350 M03
N122 GOO X2.65 Z-2.015 T0808 M08
338 Chapter 37

N123 GOl X2.2 F0.004 small, rigid grooving tool can do


groove and the
the startup
N124 X2.46 F0.03 chamfer, then the part-off tool can do the At the com- rest.
N125 Z-1.95 (LEFT SIDE OF TOOL)
pletion of the part-off, the bar stock projecting from the
N126 U-0.1 W-0.05 F0.002
spindle will have a small step. Make sure to program a fac-
N127 X-0.03 F0.004
ing cut for each subsequent part to take this step into con-
N128 GOO X2.65
N129 X5.5 Z2.0 T0800 M09 sideration.
N130 M30
% Preventing Damage to the Part

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.

The value of 1.875 back face of the part (as per


is the In any case, always follow the safety rules of the com-
drawing), the .020 value is the chamfer size; .030 is the pany - they exist for protection.

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.

For part-off, just like for grooving operations, always


N126 X2.36 Z-2.0 F0.002
make sure there an adequate supply of inserts on hand.
is

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.

In some cases, two tools can be justified for part-off


operations. The setup of the two tools has to be accurate. A
38 SINGLE POINT THREADING

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.

Fastening devices . . . screws and nuts

Measuring tools ... micrometer barrel

Motion transmission .. . lead screw, camera lenses

Torque increase ... lifting or supporting jacks

A thread cutting is a very versatile manufacturing pro-


cess. There are two main groups of thread production -
metal cutting and plastic molding. It should not be a sur-
prise that it is the plastic molding method that dominates
the manufacturing industry. Given the number of detergent
bottles, pop bottles and other plastic products we consume,
the number of threaded products employing this method is
astronomical.

In the metalworking area of thread production, the group


Comparison of the thread form and the threading tool shape
that is the subject of special interest, there are smaller sev-
eral subgroups:
By definition, a single point threading is a machining
Thread rolling or thread forming process of cutting a helical groove of a specific shape with a

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.

Single point thread turning


Form of a Thread

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

Threading Operations INTERNAL THREAD


This section contains a detailed list of the threading op- ... is a thread that is cut on the inside of the machined part,
erations that can be programmed for a typical CNC lathe. for example as a nut
Several operations require a special type of threading insert
HELIX ANGLE
and some operations can only be programmed if the control
system is equipped with special (optional) features: ... is the angle made by the helix of the thread at the pitch

diameter with a plane perpendicular to the axis


Constant lead threads
LEAD
Variable lead threads
... is the distance the threading tool will advance along an axis

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)

... is the smallest diameter of the thread


Single start 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

ANGLE OF THREAD SHIFT

... 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

always equal to the pitch of the thread. The number of shifts


CREST is always one less than the number of starts

... 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

THREADING PROCESS A better approach is to cut the thread in several passes,


each pass increasing the thread depth.

Threading is most automated programming


one of the For this purpose of multi-pass cutting, the machine spin-
tasks in modern machine shop, yet
it could be one of the dle rotations must be synchronized for the start of each
more difficult operations done on a CNC lathe. Initially, it pass, so each thread depth is at the same position on the
may seem an easy procedure to make a program for a tool threaded cylinder. A quality thread will
be completed when
path that has the cutting parameters very clearly defined, the last cutting pass produces the proper thread size, shape,
such as threading. Practical applications, however, could surface finish and tolerances. Since the single point thread-
present a big departure from theory. This comment may be ing consists of several passes to cut a single thread, pro-
arguable, at least until it is time to start searching for solu- grammers must understand these passes well.
tions to unusual threading problems or even regular threads
that just don't seem to be coming out right. An experienced In programming, the structure of each pass remains the

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):

applies equally to threading problems.


Motion 1 From the starting position, move the tool
to the thread diameter in rapid motion mode
What makes threading a difficult operation is the
often
cutting tool application. The single point threading tool is Motion 2 Cut the thread - one axis thread cut
unlike any cutting tool. Although the holder is mounted in (at the feedrate equal to the lead)
the turret just like other tools, the cutting insert is unique.
Threading tool not only cuts, it also forms the thread shape. Motion 3 Rapid retract from the thread

Frequently, the threading insert has the shape of finished


Motion 4 Rapid return to the starting position
thread. The mounting of a threading tool in the turret can be
at 90° to, or parallel with, the machine spindle centerline, Expending on these brief descriptions, the four step tool
regardless of thread being cut. The decision which way to motion process will typically include the following consid-
mount the tool is determined by the angle of the thread, rel- erations that are critical to the CNC program.
ative to the spindle center line. It is important that the tool is

mounted square in Even a small angular devia-


the turret. Threading Motion 1

tion will have an adverse effect on the finished thread.


Before the first step, the threading tool must move from
its indexing position to the position close to the machined
Steps in Threading
part. This is a rapid motion, in the air. Make sure to calcu-

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

Threading almost sharp edge


the part, but close to the thread, as the intersection of the X
Turning typical average is .0313 radius (0.8 mm) axis clearance and the Z axis clearance.

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

Typical depth of cut:


When the tool reaches the cutting diameter for a given

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 3 When programming coarse threads, the front clearance


amount required will generally be much greater than the
In the third motion when the thread cutting diameter is
amount for fine or medium threads. For example, a com-
completed, the tool must retract away from the thread, at
mon thread with 8 TPI requires feedrate of 250 in/rev If . 1
X
!

the machine rapid rate, to the axis clearance position.


the Z axis clearance is too small, the machine acceleration
This tool position is normally a diameter programmed out-
process will be incomplete when the tool contacts the ma-
side of the threaded area.
terial. The result will be an imperfect and unusable thread.

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

mode. All remaining passes are programmed in the same


way, just by changing the thread cutting diameter (thread This is only a rule of thumb and works well in every day
depth control). practice. Control manuals may offer a scientific way of cal-
culating the minimum clearance.
Note only Threading Motion 2 will be programmed
that
in the threading mode, using a proper G code. Threading In some cases, the Z axis clearance must be reduced be-
motions 1, 3 and 4 will be in GOO (rapid) mode. cause of space shortage, such as when the threading starts
very close to a tailstock or machine limits. Since the accel-
eration timedepends directly on the spindle speed, the only
remedy case is to lower the
for imperfect threads in this
spindle speed (r/min) - the feedrate must not be reduced!

For complex methods of infeed, the starting position is

changing for each cut by a calculated amount.

Thread Cutting Diameter and Depth

For cylindrical and conical thread cutting using the block


method of programming (no cycles), select the cutting dia-
meter for each pass of the threading tool in the program.
From the thread starling position, the cutting tool will move
towards spindle centerline for external threads and away
from spindle centerline for internal threads. The actual cut-
Figure 38-2
ting diameter for each pass must be selected not only with
Basic steps in single point thread cutting respect to the thread diameter, but also with respect to ma-
chining conditions.
This typical description illustrated in Figure 38-2, is only
In threading, the chip load on the insert becomes heavier
general in nature and usually not sufficient by itself for high
quality thread cutting.
as the cutting depth increases. A damage to the thread, to
the insert, or both, can be averted by maintaining a consis-
tent chip load on the insert. One way to achieve the consis-
Thread Start Position
tency is to decrease each subsequent depth of the thread,
The clearance position. For a
tool starting position is a another way is to apply a suitable infeed method. Both

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
.

To calculate the depth of each pass, complex formulas are


coarse threads. For a tapered thread, the clearance is the
not required, just common sense and a bit of experience.
same, but applied over the larger diameter.
All threading cycles have an algorithm (special process)
As for the clearance along Z axis, some special consider- system that calculates each depth auto-
built in the control

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.

considered when deciding the front clearance amount.


SINGLE POINT THREADING
343

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 ...

Threading diameter #5 2.9230 - 2 x 0.0050 = 2.9130


D = Single depth of external thread Threading diameter #6 2.9130-2 x 0.0045 = 2.9040
TPI = Number of threads per inch Threading diameter #7 2.9040 - 2 x 0.0031 = 2.8978
P = Pitch of the thread (1/TPI)
The advantage of this method is that once the last diame-
According to another thread specification standard (UN found (2.8978 in the example), add the double depth
ter is

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

When the cutting tools reaches the threading pass depth


Ifseven threading passes are selected, with the last pass
the thread is cut. The cutting starts at the Z axis clearance
of 0.0031 (for programming convenience), the individual position and ends at the end of thread with cutting feedrat
depths can be distributed the following way: in effect. Although the threading cut is, in effect, a linea
344 Chapter 38

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:

N61 GOO X3.3 Z0.3 (START POINT XZ)


N62 X2.972 (THREAD DIA START)
N63 G32 Z-1.75 F0.0833 (THREAD TO END)

Retract from Thread Figure 38-5

Thread pullout and clearance diameter (external example)


The moment the thread has reached the end position
along Z axis, the tool must leave the material immediately,
to avoid making a damage to the thread. This is the third Return to Start Position
motion in the basic threading process. The retract motion
can have two forms - straight away in one axis (normally
Regardless of how the tool retraction from the thread is

along the X axis), or a gradual pullout in two axes (simulta-


programmed, straight or gradual, the last step in the thread-
ing process always a return to the starting position. This
neously along XZ axes) - Figure 3S-4. is

tool motion is entirely in the open space, therefore pro-


grammed in the rapid motion mode GOO. Normally, the re-
turn motion along one axis only,
to the starting position is

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

ple in a relieve or a recess groove. For threads that do not


end in an open area, the gradual pullout is a better choice.
THREADING FEED AND SPINDLE SPEED
Gradual pullout motion produces better quality threads and
prolongs life of the threading insert. To program a straight
pullout, the threading mode G32 must be canceled and re- In threading, the choice of the cutting insert, the spindle

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

The programmed threading feedrate


is always the lead of the thread, never the pitch!

PITCH = —
TPI

From the last two formulas is easy to deduct that if the


number of starts is one, both the lead and pitch will always
have the same value.

The following formula should be applied for threading


feedrate calculation:

Comparison of turning and threading feedrates


F = L = P x n
Threading Feedrate Selection
tsr where ...

The selection of feedrate for general turning or boring is

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- ,

For threading programs that use English units, the above


nal diameter (for example, the major diameter) is 03.750.
formula is equally valid, since
All single start metric threads have the pitch standardized,
depending on the thread diameter. For instance, a thread
described as
pitch of 3
M24x3 is a single start metric thread with the
mm on a 24 mm diameter. A description M24xl
P = —
TPI
means a single start thread with the pitch of one millimeter.

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

threading earlier in this chapter). In a common machine require feedrate of

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
.

in the correct way:


(CSS). That means the preparatory command G97 must be
used with address S. specifying the number of revolutions
No. of starts per minute. For example, G97S500M03, will result in 500
LEAD F
r/min spindle speed. It is true that single point threading
TPI
lakes place over several diameters between the first pass
346 Chapter 38

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

threads, the difference between the first and last diameter is


If the thread lead L is .125 and the maximum feedrate for
insignificant. Second - and this reason is even more impor- the X axis Ftmax is 250 in/min then , the maximum threading
tant - the thread cutting routine requires a perfect spindle
speed Rmax will be:

and feedrate synchronization at the start of each pass. Such


R™* = 250 / .125 = 2000 r/min
synchronization can be more accurately achieved only with
constant r/min rather than constant surface speed (CSS).
O Metric example
For the majority of threads, the selection of r/min requires
only consideration of general machining conditions, simi-
If the thread lead L is 2.5 mm and the maximum feedrate

lar to other turning operations. At the same time, select the


for the X axis Ftmax is 6350 mm/min, then the maximum
Rmu threading speed will be:
spindle speed with some consideration of the feedrate. Be-
cause of the heavy feedrates used for threading, there is a
= 6350 / 2.5 = 2540 rpm
distinct possibility that certain threads cannot be cut at any
available spindle speed. If this is confusing, keep in mind The maximum allowable r/min only reflects the capabili
that the feedrate is determined not only by the lead, but also tiesof the CNC machine. The feedrate actually used in a
by the overall capability of the machine. Every CNC lathe program must also take into account the various machining
has a programmable feedrate value, specified in either and setup conditions, just like any other tool path operation.
in/min or mm/min, up to a certain maximum for each axis.
In practice, the majority of actual programmed spindle
speed (r/min) will be well below the maximum capacity of
lake a typical maximum programmable feedrate for the
X axis may as 250 in/min (6350 mm/min); the maximum
the CNC machine tool.

for the Z axis may be 450 in/min ( 1430 mm/min). Recall


1

that there is a direct relationship between the spindle speed


Maximum Threading Feedrate
and the feedrate per revolution. The result of this relation-
The selection of cutting feedrate in general was discussed
ship is actually feedrate expressed in terms of time, not per
earlier, in Chapter 13. After studying the section on the
revolution. The always the result of the
feedrate per time is
maximum r/min selection (spindle speed), it should not be
spindle speed in direct r/min multiplied by the feedrate per surprising that similar limitations apply to the determina-
revolution in in/rev or mm/rev.
tion of a maximum threading feedrate for a given spindle
speed (programmed as r/min). Again, the limits of the CNC
© English example :

machine tool are very important, so be aware of them when


writing the thread cutting program.
700 r/min x .125 in/rev = 87.500 in/min
Maximum programmable threading feedrate for a given
O Metric example :
spindle speed (in r/min) can be calculated from the follow-
ing formula:
700 rpm x 3 mm/rev = 2100 mm/min

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:

If the maximum machine feedrate along X axis is 250


in/min and the spindle speed S is selected as 2000 r/min,
then the maximum programmable feedrate will be:
isr where ...

250 / 2000 = .125 in/rev


R max = Maximum allowable r/min
Ftmsx = Maximum feedrate per time (X axis) Therefore, the maximum thread lead that can be cut at
L = Lead of the thread 2000 r/min is . 125 inches, which allows R threads per inch
or liner.
SINGLE POINT THREADING 347

Changing the spindle speed (feedrate remains the same)


Le = - Fp) X TPI
will allow programming coarser threads on the same CNC 0=a
lathe. For example, if only 1500 r/min is selected instead of
the 2000, the maximum lead will increase to .1670 inches bs5 where ...

or 6 threads per inch.


L„ = Maximum lead error per inch
© Metric example F„

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

for metric threads (F3.3 format). The majority of threads


What a difference for only one ten-thousandths of an inch
are short and this accuracyis quite sufficient. There is never
rounding.

problem for metric threads, regardless of the thread length,


The manufacturers of Fanuc controls recognized this po-
because the thread is defined by its lead already in the
tentialproblem and introduced the address E for threading
drawing. For threads programmed in the English units, the
feedrate on their earlier CNC controls. The benefit of using
thread lead must be calculated from the given threads per
the E address for threading is that it allows programming
inch (TPI) in the drawing. For many English threads, the
with six decimal places instead of the standard four for
lead is accurately calculated within the four decimals avail-
English threads (increased accuracy allowed for metric
able for the F address. A 10 TPI requires programmed
threads using the E address is seldom used). With proper
feedrate of F0. 1, 16 TPI requires programmed feedrate of
rounding, the accumulative error is virtually negligible.
F0.0625, etc. These are threads that divide the TPI into one
within the four decimal places accurately, such as 8, 10, 16, Using the same illustration of 14 TPI over 50 inches, the
20, 40 to name the most common number of threads. error for the whole length will only be .0003 of an inch, if
the F0.0714 is replaced by F.0.071429. The second exam-
Not all threads fall into this rather convenient group. For
ple, using a thread with 1.5 threads per inch, should be
1

many other threads, the calculated value must be properly


programmed with the feedrate of E0.086957. The accumu-
rounded off.
lated error over fifty inches will be only 0.000275 inches, a

The exact threading negligible error.


Take a 14 TPI thread, for example.
feedrate should be 1/1 4=.07 1 42857 inches per revolution.
1

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.

On the plus side, the programmer has an absolute pro-


gramming control over the thread. Such control placed into
capable hands can often be applied to some special thread-
ing techniques, for example, cutting a thread shape with a
threading tool much smaller than the thread itself or mak-
ing large knuckle threads with a round grooving tool.

Thread programming method using the block technique


is available on all CNC lathes that
for a constant lead thread
support threading.

G32 Thread cutting command


Figure 38-7

Typical reference points for setup of threading tools


The preparatory command for this type of threading is

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-

ting, regardless of the thread ending. It is also the safest at


Pass #5 depth = .0050 Total depth .0435
the same lime. In some cases, an allowance must be made
Diameter 2.9130
for the difference between the programmed edge and the
actual edge. The tooling catalogs list this value precisely, or
=
Pass #6 depth .0045 Total depth .0480
one half of the threading insert width (if applicable) can be
Diameter 2.9040
used instead.
Pass #7 depth = .0031 Total depth .0511
BLOCK-BY-BLOCK THREADING Diameter 2.8978

Always make sure all diameters are calculated carefully


The oldest method of single point thread programming is
without errors. Small error can cause big scraps.
to calculate each and every motion associated with the
threading and write it as an individual block of the pro- The threading operation in program 03801 will use the
gram. This method is called block-by-block threading tool and offset number 5 (T0505), at 450 r/min spindle
method, or just a block threading method. speed (G97S450):
SINGLE POINT THREADING 349

03801 BASIC THREADING CYCLE - G92


(N45 G50 X12.0 Z4.5)
N46 T0500 M42 The control systems can perform many internal calcula-
N47 G97 S450 M03 tions and store their results in the control memory for fur-
N48 GOO X3.2 Z0.25 T0505 M08 ther use. This feature is especially useful for threading,
since the repetitiveness of block-by-block tool motion can
Now, the thread start point has been reached. The next
be avoided and the program shortened significantly.
stage is to implement all four steps, one step per block, for
the first pass: We use the same program example that illustrated
will
the G32 command and apply it to a simple threading cycle.
N49 X2.972 (PASS 1) This cycle is usually called the G92 threading cycle on
N50 G32 Z-1.6 F0.0833 (or F/EO. 083333) Fanuc controls. Incidentally, G92 in the threading context
N51 GOO X3.2
has nothing to do with the command of the same name, the
N52 Z0.25
traditional and now old-fashioned G92, the position regis-

The remaining six passes can be programmed next, just


ter setting command. If the lathe control uses G92 for sim-

by changing the diameters. Note that the threading feedrate


ple threading cycle, use G50 for the position register com-
mand. This applies for older controls only, since modern
does not repeat - it is modal from block N50 on.
controls use advanced geometry offsets.

N53 X2.952 (PASS 2)


The schematic illustration of a G92 thread cutting cycle is
N54 G32 Z-1.6
shown in Figure 38-8.
N55 GOO X3.2
N56 Z0.25
N57 X2.9360 (PASS 3)
N58 G32 Z-1.6
N59 GOO X3.2
N60 ZO .25
N61 X2.9230 (PASS 4)
N62 G32 Z-1.6
N63 GOO X3.2
N64 ZO .25
N65 X2.9130 (PASS 5)
N66 G32 Z-1.6
N67 GOO X3.2
N68 ZO 25.

N69 X2.9040 (PASS 6)


N70 G32 Z-1.6
N71 GOO X3.2
N72 ZO .25
N73 X2.8978 (PASS 7)
N74 G32 Z-1.6
N75 GOO X3.2
G92 - simple thread cutting cycle
N76 ZO .25
For a comparison with the G32 programming method,
Block N76 terminates the threading routines and the pro-
the same thread will be programmed, 12 threads per inch
gram can be closed as well, if there are no more tools used.
on a 3.000 inch external diameter. The program will do ex-
N77 X12.0 Z4.5 T0500 M09 actly the same job, except it will have a noticeably different
N78 M30 structure.

%
Using the G92 cycle, the following list shows the calcu-

What should odd in the example, is the abun-


strike as
lated diameters for each thread pass, as they will appear in

dance of Observe the three blocks following


repetitions. the program (no change at this stage):

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.

The format for the G92 straight threading cycle is:


MULTIPLE REPETITIVE CYCLE - G76

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

G76 P.. Q.. R..


G76 X.. Z.. R.. P.. Q.. F..

1
i® where ...

First block:

P = ... is a six-digit data entry in three pairs:


Digits and 2- number of finishing cuts (01-99)
1

Digits 3 and 4 - number of leads for gradual pull-out


(0.0-9. 9 times lead), no decimal point used (00-99)
Digits 5 and 6 - angle of thread
(00, 29, 30, 55, 60, 80 degrees only)
Q = Minimum cutting depth
(positive radial value - no decimal point)
R= Fixed amount for finish allowance
(decimal point allowed)

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

On Fanuc controls OT, 16T and 18T, the G76


the popular N20 G76 P011060 Q050 R0.05
cycle is somewhat changed from the 10/1 1/1 5T models. Its
N21 G76 X76.0 Z-30.0 P812 Q250 FI .

purpose and function remain the same, the difference is only


in the way how program data input is structured. Fanuc
Programming Example
10/1 1/1 5T use a single line cycle input, described earlier.
The example of the thread, with 12 TPI on an ex-
earlier
Fanuc 0/1 6/1 8T control models require a two line input.
ternal diameter of 3.000 inches, can be easily adapted to the

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 ]

cle. It represents the end position of the thread and controls


The total thread depth [
K value ]
the thread length.
The first thread depth [ D value ]

parameters unique to G76 cycle are the I and the K


Two
values. The value is always a zero if a straight diameter
I
Based on the supplied values, the first diameter 7} of the
thread is cut. A non-zero value
used for taper threads, is thread will be calculated as:
where it represents the single difference between the start
diameter of the cut and its end diameter (described later in
T f
= X + (K x 2) - (D x 2)
the section dealing with a tapered thread).
SINGLE POINT THREADING 353

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.

The result of a radial infeed motion is that both insert


edges of the threading tool are removing material at the
same edges are opposite to each other, the
time. Since the
curling of the chips will also be opposite to each other. In
many applications, this will cause high temperature and
tool wear problems related to heat. Even decreasing depth
for each infeed may not eliminate the problem. If the radial
infeed does not produce a high quality thread, a compound
infeed approach will generally do a much better job.

Compound Infeed

Compound infeed method, also called a flank infeed


method, uses an angular direction of the tool that moves to-
Figure 38-10 wards the threading pass diameter. The chip shape pro-
Radial and Compound infeed for thread cutting duced by compound threading method is similar to the
shape of a chip produced by turning. Only one edge of the
One common method
infeed in thread programming is threading tool does the actual cutting, so the heat dissipates
the plunge method, sometimes called the radial method, away from the tool edge and the chips curl away, extending
also known as the straight or perpendicular infeed; the the tool life. The depth of the chip can be heavier and fewer

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

On Fanuc controls (higher level), there is the P


the latest
parameter for the G76 cycle, that works very closely with
the A parameter and defines the cutting type.

Thread Cutting Type - Parameter P

In the G76 threading cycle, the threading infeed can be


programmed with the address P, in addition to the address
A. The purpose of the threading parameter A is to control
Figure 38- 1 1 the threading infeed method - up to a certain extent - based

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):

AO A29 A30 A55 A60 A80

m Straight or plunge infeed

ACME type of thread ANSI


ISO

A30 Metric Trapezoidal thread DIN 103

A55 Whitworth 55° thread BSW, BSP

A60 Standard 60° V-thread English or Metric

A80 German PG thread Panserrohrgewinde

As an additional information and further reference re-


garding the above listed thread forms, an ACME thread
(29° included angle) is very commonly used for transmis-
sion of motion, for example a lire changing carjack uses an
ACME thread. Some programming notes are described
later in this chapter. A Metric Trapezoid thread is the metric Cutting types for G76 threading cycle /parameter P)
version of the ACME thread, with 30° included angle. A Used on Fanuc 10/1 1/15T models
Whitworth thread has an included angle of 55°, and has its
roots in Great Britain: its usage had declined even there, as PI One edge cutting ... with constant cutting amount
metric threadsbecome standard worldwide. As far as the P2 Two edges cutting ... with constant cutting amount
A80 PG thread, it is a special German pipe thread (Panser- P3 One edge cutting ... with constant cutting depth
rohrgewinde), with the included angle of 80°, not common P4 Two edges cutting ... with constant cutting depth
in North America.
SINGLE POINT THREADING 355

On Fanuc lathe controls manufactured before the model


10T, the P parameter in the G76 cycle was not available.
The equivalent of what is now the P parameter was the de-
1

fault. On do support the P parameter, if the


the controls that
P number is omitted in G76 cycle call, P cutting method is
1

assumed as a default. This is the most common threading


application and will be suitable for many jobs. It will apply
one cutting edge of the threading tool and the constant cut-
ting amount. That will result in equal chip volume removal.
Feel free to experiment with the other three options as well.

ONE-BLOCK METHOD CALCULATIONS

The compound infeed does not present programming


problems when using the advanced G76 threading cycle. If
a CNC system has the G76 cycle available, it can be used
for about 95% of all work. What about the remaining 5%?
What if the G76 cycle cannot be used and a program needs
fully controlled compound infeed? How to control other
infeed methods available for G76, without having the G76
cycle available or impractical to use?
Compound infeed calculations for G32 block-by-block threading
Unfortunately, there is only one way - take a pocket cal-
culator and calculate each and every tool position and tool Pass #1 depth at 0 2.9720 ( single depth .0140 )

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.

Theoretically, it makes no difference which direction the


Initial Considerations
shift is programmed - towards the thread or away from the
thread. Practically, it is always better to program the shift
The thread used for the examples in this section is a
3.0-12 TPI external thread. All individual diameters for away from the thread, if possible - the tailstock may be in
the way, so watch its position. This way, the distance for the
each threading pass had been calculated earlier, and all sin-
feedrate acceleration will increase , rather than decrease.
gle depths for each pass had been established as well at the
same time. These values will be used in this example as
Although another approach may also be chosen, the S
well. In total, there are seven diameters and seven depths to
distance will be calculated first. The total thread depth is
program the Z value (total depth accumulation is .05 per 1
1
.05 1and the selected compound infeed angle is 29°, so us-
1

side), as illustrated in Figure 38-13.


ing a standard trigonometric formula will provide the S dis-

shows tance value:


The illustration the distribution of each single
threading depth for the seven threading passes and matches
the table following the illustration: S = .0511 x tan29 = .028325193
356 Chapter 38

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.
,

#1 = s - SI = .2783 - .0078 .2705


#2 = .2705 - S2 = .2705 - .0055 = .2650
Sx = D x tan29 #3 = .2650 - S3 = .2650 - .0044 = .2606
#4 = .2606 - S4 = .2606 - .0036 = .2570
#5 S .2570 - S5 = .2570 - .0028 = .2542
us* where ...
#6 = .2542 - S6 = .2542 - .0025 = .2517
#7 = .2517 - S7 = .2517 - .0017 = .2500
S,, = Shift for the current thread pass - incremental
D = S ingle depth of the current thread pass
This example shows the initial position offset away from
Calculation for each pass uses the same formula, chang- the thread, then moved one step at a time back to the origi-

ing the D depth input. Keep in mind that the purpose of this nal Z0.25 position. Using this method offers confidence

process is to find a new Z start position


each threading
for that the originally set .250 inches minimum clearance will
pass - i. e. , the Z value for a given thread diameter. Figure never be smaller. Only the Z axis value will change - other
38-14 illustrates the process. programmed values are not affected by this programming
method at all.

The complete program is not short (which is typical with


G32 programming), but docs illustrate the compound
it

method of threading when no cycle is available or is practi-


cal to use. Only the threading tool is shown in the example.

03805
(COMPOUND INFEED EXAMPLE)

(N45 G50 X12.0 Z4.5)


N46 T0500 M42
N47 G97 S450 M0
N48 GOO X3.2 Z0.2705 T0505 M08 (START 1)
N49 X2.972 (PASS 1)
N50 G32 Z-1.6 F0.0833 (or F/E0. 083333)
N51 GOO X3.2
N52 Z0 .265 (START 2)
N53 X2.952 (PASS 2)
N54 G32 Z-1.6
Calculation of thread start position - Z axis N55 GOO X3.2
N56 Z0 .2606 (START 3)
Once the modified Z axis start position is known for the
N57 X2.9360 (PASS 3)
first pass depth, it is each
easy to find start positions for N58 G32 Z-1.6
subsequent pass depth. We know
modified Z axis that the N59 GOO X3.2
starting position for the threading tool will be the already N60 Z0.257 (START 4)
established Z0.25, plus the .0283 shift S, rounded from the N61 X2.9230 (PASS 4)
calculated value of .028325193. The theoretical starting N62 G32 Z-1.6
N63 GOO X3.2
position will be Z0.2783, calculated at the 03.000, but
N64 Z0 .2542 (START 5)
never used in the program itself. This initial value is needed
N65 X2.9130 (PASS 5)
for all the others. For each subsequent calculation, the S.< N66 G32 Z-1.6
value has to be subtracted from the current Z starting posi- N67 GOO X3.2
tion. The following list shows the individual shift values (as N68 Z0 .2517 (START 6)
rounded numbers in English units): N69 X2.9040 (PASS 6)
N70 G32 Z-1.6
.91 .0140 X tan29 = .0078
= N71 GOO X3.2
.0100 X tan29 = .0055
=
N72 Z0.25 (START 7)
S2
N73 X2.8978 (PASS 7)
S3 II o o CO o X tan29 SS .0044
N74 G32 Z-1.6
S4 = .0065 X tan29 = .0036
N75 GOO X3.2
S5 = .0050 X tan29 = .0028 N76 Z0 .25 M0
S6 = .0045 X tan29 = .0025 N77 X12.0 Z4.5 T0500
S7 = .0031 X tan29 = .0017 N78 M30
Total . .0283 . %
SINGLE POINT THREADING 357

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:

methods of retracting the tool from the thread - a straight


motion along a single axis, and a gradual simultaneous mo-
03806
tion along two axes. Both are used in thread programming.
N45 (G50 X12.0 Z4.5) M24 (THREAD PULLOUT OFF)
In fact, their frequent applications even justify special mis-
N46 T0500 M42
cellaneous functions built into the control system as a stan- N47 G97 S450 M03
dard feature. These thread retract functions are called the N48 GOO X3.2 Z0.25 T0505 M08
thread chamfering functions or thread finishing functions. N49 G76 X2.8978 Z-1.6 10 K0.0511 D0140 A60
P4 F0.0833 (or F/EO. 083333)
Thread Pullout Functions N50 GOO X12.0 Z4.5 T0500 M09
N51 M30
When G92 and G76 for the
using the threading cycles %
CNC end of the thread (the Z axis value)
lathe work, the
will either be in a material that has been previously re-
The M24 function appears in block N45, the only block
cessed, or in a solid material. The actual pullout can be pro-
that was available without another function.M
grammed along a single axis, or along both axes simultane-
ously. Typical Fanuc functions designed for this purpose Two-Axis Pullout
are M23 and M24. They control the pullout of the threading
Two-axis pullout is a gradual angular tool motion along
tool at the thread end:
two axes, away from the thread (thread finishing ON). The
example 03807 is similar to the previous example:
M23 Thread finishing ON (two axes)
03807
M24 Thread finishing OFF (one axis)

N45 (G50 X12.0 Z4.5) M23 (THREAD PULLOUT ON)


N46 T0500 M42
Other machine controls may have similar functions. The
N47 G97 S450 MO
purpose of these functions is to enable or disable the auto-
N48 GOO X3.2 Z0.25 T0505 M08
matic insertion of a pullout motion between threading mo- N49 G76 X2.8978 Z-1.6 10 K0.0511 D0140 A60
tion sequences 2 and 3, as described earlier in this chapter. P4 F0.0833 (or F/EO. 083333)
Figure 38-15 illustrates the comparison of the threading N50 GOO X12.0 Z4.5 T0500 M09
motion with and without the pullout. N51 M24 (CANCEL M23)
N52 M30
%
i
M23
In this case, M23 was applied in block N45 and an addi-
dl T
tional block N5 was used to cancel the pullout. The can-
\ cellation
1

was not necessary in this program, but it is a good


d —- practice to cancel functions used only for specific purposes.

There are some conditions that apply to the M23 func-


- M24 tion. InFigure 38-15, the finishing distance d is set by the
f
control parameter, within the range of 1 OOx to 1 2.700x the
.

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

HAND OF THREAD THREADING TO A SHOULDER

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:

Recess groove is too narrow or non-existent

Threading insert is too wide

Thread is too deep

The first problem of threading towards a shoulder, a nar-


row width of the recess groove, is easy to correct - just in-
crease the recess width in the program. The majority of re-
cess grooves can be adjusted for the threading tool, without
damaging engineering intent behind the design. This may
be a justified case of ‘overruling’ the drawing - but check
first anyway!

The second and third problems may not be related, but


the solution is usually the same for both. If the threading in-
sert is too wide or the thread is too deep, try to increase the
recess width first, if possible. If the recess width cannot be
increased, for whatever reason, then there is another choice
- decrease the width of the threading insert. The obvious
to
solution is to change the threading tool for a smaller one
that can still cut the required thread depth. This may be an
insert one size smaller, which usually requires a different
tool holder as well.

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.

The cutting direction - Z+ or Z-


Always use care with modified tools

Tool tip orientation in the turret


Insert Modification
Theoretically, either hand of thread can be cut with any
threading tool, but this approach is not right. A poor choice There is a number of standard threading inserts in every
affects the thread quality, life of the threading insert, addi- tooling catalogue and chances of finding one suitable for
tional costs involved, etc. When a thread starts close to a hand are good. In case a standard threading insert
the job at
shoulder (in a recess), the clearance for acceleration is lim- needs modification, the following example illustrates a few
ited. The only method to prevent imperfect threads due to programming considerations - incidentally, it is irrelevant if
acceleration in a small area is to decrease the spindle speed. there is or there is not a recess groove on the part.
SINGLE POINT THREADING 359

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.

The modification requires grinding of the insert in the


W = WIDTH OF INSERT non-critical areas, to allow the tool to complete the mini-
A = ANGLE LENGTH mum .650 thread length. In theory, the minimum amount to
R = TIP RADIUS OR FLAT be ground off the insert is .030. the difference between the
H = MAXIMUM DEPTH required and the actual thread lengths. This modification
does not provide for any clearance at the thread shoulder or
Both of these clearances are essential for
at the insert tip.

Even a minor setup error on the


the best threading results.
60° V-THREAD machine can cause a serious difficulty.

Figure 38-17
Always calculate the modification amounts, never guess them
Essential dimensions of a threading insert

In the example, insert dimension W is .250 and A dimen- In the


the
example, there are three dimensions that influence
amount of insert modification. The sum of all three will
sion is .130, The included angle of the threading insert is
be the amount to be ground off the insert. One, the thread
60° and the insert fiat or tip radius R is .012, not relevant in
length has to be extended by .030 to achieve the .650 mini-
this case. The dimension H indicates the maximum thread
depth and is normally measured to the sharp point of the in-
mum length. Two, the clearance from the shoulder will also
be .030, and three, the clearance past the thread end will be
sert tip. It is calculated using a trigonometric function:
.020. The two last clearances are the arbitrary decisions by

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

length of .050. Always make sure the depth of thread can be


The problem is illustrated in Figure 38-18. achieved with the modified insert. The part program will
reflect the modification in the thread end position of the Z
axis, which will be written as Z-0.8 (setup position of the
insert does not change), and is illustrated in Figure 38-19.

Modified threading insert provides enough clearance in the recess

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

Switch to the HANDLE mode for the Z axis


TPI and coarser, the thread depth formula is:
While watching the XZ position display, move the handle
in the same direction as the thread, until the tool reaches
Td = .500 x P + .010
theprogrammed Z value, or it cannot move any further,

whichever comes first


For the ACME threads 12 TPI and finer, the thread depth
If the tool reached the programmed Z position first,
formula is modified only slightly:
the tool setup is safe for the threading

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 ...

some additional clearance


Td = Thread depth
There arc other methods available, for example, to
testing P = Thread pitch
use temporarily the G01 linear motion command, instead
of the G32 threading command without a part mounted in
,
Other threads in the trapezoidal group are Stub ACME or
the spindle. a 60° Stub ACME. Programming trapezoidal threads is no
more difficult than programming any V-shape thread, pro-

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.

There other threads that can be encountered outside of the


By reading the current tool position on the screen display 60° category - the Square threads, API threads (used in the
and comparing it with the programmed position, it will be
petroleum industry), Buttress threads, Aero threads, Darde-
possible to know whether the collision will happen or not.
let self locking threads, Round threads, Lebus threads (re-
During the test, the feedrate can be slowed down or stopped quire special control features), and several others. Thread
anytime. The purpose of the program test is to establish and threading data can be found in various tooling cata-
safe working conditions before the threading takes place. logues and technical publications.
SINGLE POINT THREADING 361

Depth and Clearances


TAPERED THREAD
From the previously established formula, the external

Programming procedure for a lapered thread is not sig- depth D of the thread used in the program will be:

nificantly different than that for a straight thread. Tapered


threading motion is along two axes simultaneously, rather D = .61343 / 8 = .0766788 = .0767
than a single axis. The four basic motion steps are, there-
The thread depth is measured axially and is not related to
fore, almost identical to those for a straight thread:
the thread angle. Once the depth is established, clearances
Motion 1 Rapid from the start position can be set - one and one at the end of the thread.
in the front
to the thread diameter The Z axis clearance amount will
depend on the tool accel-
eration speed. Since the threading feedrate will be pro-
Motion 2 Cut the thread (cutting along two axes)
grammed as F0.125, four times the lead rule of thumb
Motion 3 Retract from the thread
would require the clearance to be .500 of an inch. Only .400
of an inch is slow spindle speed
sufficient with a relatively
Motion 4 Return to the start position of 450 r/min. The end clearance can be smaller - there is
enough open space at the thread end, and .200 is a reason-
When compared program-
to a straight thread, the only
able clearance at the thread end, although a smaller value
ming first two
differences for a tapered thread are in the
could be used as well.
motions - Motion 3 and Motion 4 remain unchanged. In the
Motion 1, the starting tool position is determined by the For a tapered thread, consider the total length of the tool
physical orientation of the threading tool - whether it is travelalong each axis, not the actual thread length as per
used for an external or an internal thread. drawing - this is no different than for a single axis thread.
The example will be the combina-
tool travel length in the
For external thread forms, the starting position of the tion of the two selected clearances plus the given thread
threading tool must always be above the largest diameter
length (along the Z axis):
of the thread. For internal thread forms, the starting posi-
tion must always be below the smallest diameter of the .400 + 2.500 + .200 = 3.100
thread. This is the same requirement as for a straight thread,
but for a tapered thread it takes on an additional impor- The next step may not be always necessary, depending on
tance. For examples of a tapered thread, evaluate the sim- the method of programming. If the block threading method
plified drawing in Figure 38-20. is used, both the start diameter and the end diameter of the

thread will be needed for each pass. If a threading cycle


G92 or G76used - the single distance between the start
is

and end diameter of the tapered thread is needed. This dis-


tance will be programmed as parameter I of the threading
cycle and is the part of a taper calculation. All previous ex-
amples were straight threads and the I value was zero (10).

Taper Calculation

A thread taper has to be calculated to establish its start

and end diameters. The calculation method depends on the


way the taper is defined and dimensioned in the drawing.
Hardly any part drawing will show the dimensions required
for programming - they have to be calculated as part of the
programming process, using one of two common methods.

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

A standard North American pipe thread is a good exam-


ple of a tapered thread. It is defined by a taper ratio of 1:16.
which is equivalent to a 3/4 of an inch per fool taper, mea-
sured on the diameter and perpendicular to an axis. A pipe
thread may also be defined with a given angle per side -

one degree, forty seven minutes, twenty three seconds (plus


some leftover), or /. 789910608 decimal degrees. For CNC
programming, the decimal degrees are preferred to the de-
grees-minutes-seconds method, and many drawings al-

ready reflect this preference. To understand the principles


of a taper defined as the ratio of its sides, a definition fol-
lowed by an example should help.

RATIO indicates the relationship


between two values, expressed as a fraction

Both values in the ratio must be expressed in the same


units and should be used in their lowest form of application
(1/4 instead of 2/8 or 4/ 16). For example, the ratio of 3 units
to 4 units may have these forms:
Taper thread calculations - clearances excluded
3:4 = 3/4
In terms of a taper definition, it means that for every 3
units change along one axis, there will be 4 units change
along the other axis.

TAPER PER FOOT indicates the difference between two


diameters over the length of one foot or 1 2 inches

The example of a 3 inch taper per foot is equivalent to a


1 :4 taper ratio, because

3/12 = 1/ 4 = 1:4 Calculated values for the tapered thread program example 03808

In CNC programming, we are only interested in calculat-


ing the diameters at the beginning and at the end of the Block by Block Taper Thread
thread.These calculations can be done either by means of
In block threading, the taper thread programming is just
trigonometric functions, or by means of ratio calculations -
as simple as programming a straight thread. To simplify the
Figure 38-21.
example, a straight infeed and nine threading passes will be
Based on these principles, the required values for the ex- used, for the total depth of .0767. The following nine

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-

tions, only one of the methods described will be needed -


umn lists the front thread diameter, the third column is the

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)

N62 G32 XI. 944 Z-2.7 N54 XI. 916 (PASS 6)

N63 GOO X2.5 N55 XI. 908 (PASS 7)


N64 Z0.4 N56 XI. 902 (PASS 8)

N65 XI. 153 (PASS 5) N57 XI. 8966 (PASS 9)

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

N72 Z0.4 meter of 2 6, divided by 2. The result is:


1 . 1 1

N73 XI. 133 (PASS 7)


N74 G32 XI. 908 Z-2.7 (1.8966 - 1.1216) / 2 = .3875
N75 GOO X2.5
N76 Z0.4 This I value (.3875) must have a directional sign, to indi-
N77 XI. 127 (PASS 8)
from the end point).
cate the taper orientation (its direction
N78 G32 XI. 902 Z-2.7
In theexample, the I value will be negative because the start
N79 GOO X2.5
N80 Z0.4 diameter of the taper is below the end diameter of the taper
N81 XI. 1216 (PASS 9) as viewed on a typical rear lathe. In the program, the entry
N82 G32 XI. 8966 Z-2.7 will be 1-0.3875.
N83 GOO X2.5
N84 Z0.4 Tapered Thread and a Multi Repetitive Cycle
N85 GOO X12.0 Z4 5 T0500 M09
.

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

The I value in the cycle specifies the difference per side, so


In the example, a straight infeed and pullout is used for between the
called radial distance, as well as the direction
clarity. The program will not change very much if a com-
start and the end diameter of the taper.
pound infeed is used and/or the angular pullout from the
thread. Of course, more calculations will be needed.. Remember that the X diameter is always programmed at
the end of thread and the I value supplies the taper height
Tapered Thread Using a Simple Cycle and its inclination (taper ratio per side). On CNC lathes
with the X+ axis direction upwards from the center line
In a G92 threading cycle, the thread taper is programmed
(rear lathes), an increasing taper diameter will require a
as the radius I value, with specified direction from the end
negative and a decreasing taper will require a posi-
I value,
diameter to the start diameter:
tive I I value is always a single value, measured
value. The
on a radius, not a diameter - Figure 38-23 illustrates the
G92 X.. Z.. I.. F concept for rear lathes.
364 Chapter 38

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

Tapered thread inclination direction I used in G76 threading cycles

The basic G76 cycle will be maintained but the I value


will be added - a non-zero value must be programmed:

03810

(G76 - TAPERED THREAD)


(N45 G50 X12.0 Z4.5) Representation of multistart threads (dots indicate thread starts)
N46 T0500 M42
N47 G97 S450 M03 examples of the cross sections
In the illustration are four
N48 GOO X2.5 Z0.4 T0505 M08 and the end views (right) of a single start thread (top),
(left)
N49 G76 XI. 8966 Z-2.7 1-0.3875 K0.0767 D0140 double start (one below), triple start (two below) and a
F0.125 quadruple start (three below).
N50 GOO X12.0 Z4.5 T0500 M09
N51 M30 Although the examples are represented only symboli-
% cally. the thread pitch ismaintained in all examples. Also
note the equal distribution of each thread start, represented
If this method can be used for threading. G76 cycle is the
by the heavy dots. Each angle value is the angular spacing
best choice. It offers the fastest program generation as well
of individual starts, when the threaded part is viewed along
as the best opportunities for on-machine editing.
its center line. The spacing is automatic and only the cor-

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

lor is in such a location, that when viewed from


each thread the lead of the thread will double to .1250. Therefore, the

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:

- Shift amount = Pitch


PITCH
LEAD - The shift has to be programmed for each start above the
first one. That means the number of shifts in the program is
the one less than the number of starts:
Figure 38-25

Relationship of the pitch and the lead of a double start thread


Number of shifts = Number of starts - 1
In Figure 38-25, the relationship of pitch and lead of a
double start thread is shown. The same logic that applies to
Note that the formula is valid even for a single start
a double start thread, also applies to triple, quadruple, etc.,
thread, but there is no shift required (1-1=0).
threads. The feedrate calculation is identical for all threads:
A few methods can determine when the tool shift is to be
Number of starts programmed. The first method, for a double start thread, is
Feedrate = to program one thread to its full depth, then shift out and cut
TPI
the second thread to its full depth. The second method, for
the same thread, is to cut one pass of the first thread, shift
Figure 38-26 shows the relationships of the pitch and the out. cut the same pass for the second thread, shift in. cut the
lead for some common multistart threads - the same second pass for the first thread, shift out again and repeat
pitch-lead relationship is maintained proportionately. the process until both threads are completed to the full
depth. This approach applies to any number of starts.

0.5P The obvious advantage to the first method is the ease of


programming. On the negative side, if the tool cutting edge
AAA/W\ wears out on the first thread, the second thread will not be
as accurate. The advantage of the second method is that the
_U_U L tool wear will be equally distributed over both threads, al-
TTTlF
though the programming will require a lot more effort,

l/VWWN which presents the negative side. Additional problem is


that in many hard materials, the thread edge life may suffer
- p from extensive material removal.

p - 1 .5P — - To illustrate a sample multistart thread application, the


following general thread specifications will be used:
/Wv\M /WVW\ The number of threads per inch is twelve ( 1 2 TPI)
\\\\\\\\\\\

wt
VvvnXai
A \\ \ \ \y \\
v \\
lAyVWVNj
' I \\ \

_)
The number

The thread is
of starts

The calculated thread depth


is two (double

is
start thread)

cut as external at 3.000 nominal diameter

.0511 (.61343/ 12)


2P - 3P
The number be seven
of passes will (for G92 cycle)

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

Double start thread Lead = 2P


G92 or G76 cycles, with less programming, as well as the
( b )
( Triple start thread Lead = 3P gain of easier editing at the machine.
c )
366 Chapter 38

Application Example N60 G92 XI. 944 Z-2.7 (T1 - P4)


N61 GOO Z0.525 (START 1)
The previous thread TPI on a 03.00 will be used,
with 1 2 N62 G92 XI. 944 Z-2.7 (T2 - P4)
but as a double start thread. The number of passes will be N63 GOO Z0.4 (START 2)
seven, with the same depths as before. The first program N64 G92 XI. 928 Z-2.7 (T1 - P5)
038 shows the completion of one thread before the other
1 1
N65 GOO Z0.525 (START 1)
(the feedrate is F0.25. not F0.125). In the comments. P is N66 G92 XI. 928 Z-2.7 (T2 - P5)
the pass number, T is the thread number, first or second:
N67 GOO Z0.4 (START 2)
N68 G92 XI. 916 Z-2.7 (T1 - P6)
N69 GOO Z0.525 (START 1)
03811
N70 G92 XI. 916 Z-2.7 (T2 - P6)
N71 GOO ZO 4
. (START 2)
(G92 - DOUBLE START THREAD - 1)
N72 G92 XI. 908 Z-2.7 (T1 - P7)
(N45 G50 X12.0 Z4.5)
N73 GOO ZO 525
. (START 1)
N46 T0500 M42
N74 G92 XI. 908 Z-2.7 (T2 - P7)
N47 G97 S450 M03 N75 GOO ZO 4
. (START 2)
N48 GOO X2.5 Z0.4 T0505 M08 (--- THREAD 1)
N76 G92 XI. 902 Z-2.7 (T1 - P8)
N49 G92 X2.017 Z-2.7 F0.25 cn - PI) N77 GOO ZO 525
. (START 1)
N50 XI. 988 (T1 - P2)
N78 G92 XI. 902 Z-2.7 (T2 - P8)
N51 XI. 964 (T1 - P3)
N79 GOO ZO 4
. (START 2)
N52 XI. 944 (T1 - P4)
N80 G92 XI. 8966 Z-2.7 (T1 - P9)
N53 XI. 928 (T1 - P5)
(START
N81 GOO ZO 525
. 1)
N54 XI. 916 (T1 - P6)
N82 G92 XI. 8966 Z-2.7 (T2 - P9)
N55 XI. 908 (T1 - P7
N83 GOO X12.0 Z4.5 T0500 MO
N56 XI. 902 (T1 - P8)
N84 M30
N57 XI. 8966 (T1 - P9)
(--- THREAD 2)
%
N58 GOO X2.5 Z0.525
N59 G92 X2.017 Z-2.7 (T2 - PD The G92 cycle and GOO motion cancel each other. That is
N60 XI. 988 (T2 -
P2)
N61 XI. 964 (T2 - P3) the reason for the G code repetitions. The only value that
N62 XI. 944 (T2 - P4) remains in effect is the F0.25 feedrate, which is program-
N63 XI. 928 (T2 - P5) med only once for each example.
N64 XI. 916 (T2 - P6)
N65 XI. 908 (T2 - P7)
N66 XI. 902 (T2 - P8)
THREAD RECUTTING
N67 XI. 8966 (T2 - P9)
N68 GOO X12.0 Z4 5 T0500 M09.
When threading is done, it should be checked for quality
N69 M30 before the part is removed from the machine. Once the part
% is removed, any subsequent reclamping will need a great
between thread-
effort in order to recut the thread. The
threading pass first
This version can be modified to alternate
will start at a random place of the cylinder circumference.
ing cuts of the first thread and the second thread, as shown
Each subsequent pass will be automatically synchronized
in program 03812. Applying this technique, the tool wear
to start at the same position. As long as the threaded part re-
will be evenly distributed between all threads.
mains clamped, this synchronization is assured.

03812 There are two methods to prevent recutting. First, pro-


gram a tool wear offset. Second, program MOO function at
(G92 - DOUBLE START THREAD - 2)
the end of each threading operation, before any other ma-
(N45 G50 X12.0 Z4.5)
N46 T0500 M42 chining, even for the last tool. If the thread has to be recut
N47 G97 S450 MO after removal, the operator has to follow several steps:
N48 GOO X2.5 Z0.4 T0505 M08 (-- - THREAD 1)
1 . Reclamp the threaded part to run concentric w/spindle
N49 G92 X2 017 Z-2.7 F0.25
. (T1 - PI)
N50 GOO Z0.525 (START 1) 2. Set the X axis offset large enough, so the threading
N51 G92 X2.017 Z-2.7 (T2 - PI) tool moves above the thread (external threading) or
N52 GOO Z0.4 (START 2) below the thread (internal threading)
N53 G92 XI. 988 Z-2.7 (T1 - P2)
N53 GOO Z0.525 (START 1) 3. Visually align the threading tool tip with the thread

N54 G92 XI. 988 Z-2.7 (T2 - P2) already completed (only as accurate as one's eye)

N55 GOO Z0.4 (START 2)


4. Repeat the steps in the air while carefully adjusting
N56 G92 XI. 964 Z-2.7 (T1 - P3)
the offset so the tool will eventually recut the thread
N57 GOO Z0.525 (START 1)
N58 G92 XI. 964 Z-2.7 (T2 - P3) Thread recutting should be prevented. The difficulty to
N59 GOO Z0.4 (START 2)
reset the part precisely is the major quality concern.
39 SUBPROGRAMS

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

Special functions ... and others

Structurally, subprograms are similar to standard pro-


grams. They use the same syntax rules and look and feel the
same. Often, it may not be easy to see the difference be-
tween program and a subprogram at a casual
a regular
glance. A
subprogram can use the absolute or incremental
data input, as necessary. Subprograms are loaded into the
CNC system memory just like other programs. When prop-
erly implemented, they offer several benefits:

Program length reduction

Program error reduction

Programming time and effort reduction

Quick and easy modifications

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

Identification of Subprograms For example, a typical subprogram call block includes

The first step towards a successful application of subpro-


the M98 function and the subprogram number:
grams is and isolation of repetitive pro-
the identification
N167 M98 P3951
gramming sequences. For example, the next six program
blocks represent a machine zero return for a typical hori- In block N167, the subprogram 03951
is called from the
zontal machining center, at the start of program:
CNC memory, to be repeated once LI (Kl) counter is the
-

default, depending on the control. The subprogram must be


N1 G20
stored in the control before being called by another program.
N2 G17 G40 G80 (STATUS BLOCK)
N3 G91 G28 ZO AXIS RETURN)
(Z
The M98 blocks that call subprograms may also include
N4 G28 XO YO (X AND Y AXES RETURN)
additional instructions, such as rapid tool motions, spindle
N5 G28 BO (B AXIS RETURN)
N6 G90 (ABSOLUTE MODE) speed, feedrate, cutter radius offset number, etc. On most
N7 •
controls, if included in the same block as the subprogram
call,the additional data will be passed to the contents of the
These blocks represent a typical sequence of commands subprogram. The following subprogram call block also
that willbe repeated every time a new program for that ma- contains a tool motion in two axes:
chine is written. Such a program may be written many
times a week, each time repeating the same sequence of in- N460 GOO X28.373 Y13.4193 M98 P3951
structions. To eliminate die possibility of an error, the fre-
quently used order of blocks can be stored as a separate
The block executes the rapid motion first, then it calls the
program and identified by a unique program number. Then, subprogram. The order of words in a block makes no dif-
ference to the block execution:
it can be called up at the top of any main program. This

stored programming sequence will become a subprogram -


N460 M98 P3951 GOO X28.373 Y13.4193
a branch or an extension of the main program.

results in the same machining order as if the tool motion


SUBPROGRAM FUNCTIONS preceded the subprogram call, but looks illogical.

A subprogram must be recognized by the control system Subprogram End Function


as a unique type of program, not as a main program. This
When the main program and the subprogram coexist in
distinction is accomplished with two miscellaneous func-
the control, they must differ by their program numbers.
tions, normally applicable to subprograms only:
During processing, they will be treated as one continuous
program, so a distinction must be made for the program end
M98 Subprogram call function function as well. The end of program function is M30 or,
less frequently, M02. The subprogram must be terminated
M99 Subprogram end function
by a different function. Fanuc uses M99 for that purpose:

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 . ..

and the subprogram 03952 is terminated by

03952 (SUB)

M99 P70
%

the calling program processing will continue from the


N70 block (the main program in the example), bypassing
N68 and N69. This kind of application
blocks is not very
common - it requires suitable type of work, in addition to
the thorough understanding of subprogramming principles.

The address P has a different meaning


when used with M98 and M99 functions

Daily applications of this powerful programming method


Flow of a program processing with a single subprogram are not common, but the feature is an item to be explored
by inquisitiveprogrammers. The associated applications
Block Mumber to Return to will include other programming tools, such as a combina-
tion with a block skip function, using the slash code /.
Inmost programs, the M99 function is programmed as a
stand alone entry and as the last instruction in the sub- Number of Subprogram Repetitions
program. Usually, there are no other commands included
with it in the block. The M99 function causes the subpro- A very important subprogram call feature is the address L
gram to terminate and transfers its execution to the next or K, depending on the control model. This address specifies

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.

Number of repetitions for some control models range be-


tween L0 and L9999 and the L address other than LI must
always be programmed. Some programmers write the full
block, even for a single repetition, rather than counting on
the default conditions of the control system. The choice is a
personal preference.

Repetition Count Variation

Some Fanuc controls do not accept the L/K address as the


number of repetitions and use a different format. On these
controls, a single subprogram call is the same:

N342 M98 P3952

This block calls the subprogram only once, as no special


request has been used. In order to repeat the subprogram
call four times, instead of programming

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

(TOOL 3 - 5/8-12 TAP) (TOOL 2 - 35/64 DRILL)


N26 T03 N10 MO 6
N27 MO 6 Nil T02
N28 G90 GOO G54 X2.0 Y2.0 S500 M03 T01 N12 G90 GOO G54 X2.0 Y2.0 S840 M03 T03
N29 G43 HO 3 Z1.0 M08 N13 G43 H02 Z1.0 M08
N30 G99 G84 R0.4 Z-1.4 F41.0 N14 G99 G81 RO.l Z-1.214 F11.0 LO
N31 X8.0 N15 M98 P3953
N32 Y8.0 N16 G28 Z1.0 MO
N33 X2.0 N17 M01
N34 X5.0 Y5.0
N35 G80 Z1.0 MO (TOOL 3 - 5/8-12 TAP)
N36 G28 Z1.0 M05 N18 MO 6
N37 G28 X5.0 Y5.0 N19 TO
N38 M30 N20 G90 GOO G54 X2.0 Y2.0 S500 M03 T01
% N21 G43 H03 Z1.0 M08
N22 G99 G84 RO 4 Z-1.4 F41.0 LO
.

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.

This subprogram can be called from the main program, in


Control unit directory of programs does not distinguish
between program numbers and subprogram numbers. The
this example, from a new program 03902. The LO prevents
double cutting of the first hole: control system recognizes a subprogram call only by its
programmed format, the miscellaneous function M98, fol-

03902 (MAIN PROGRAM) lowed by the P.. subprogram number statement.


(TOOL 1 - 90 -DEG SPOT DRILL - 3/4 DIA)
N1 G20 means that the subprogram number is assigned at
All this

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,
:

followed by up to four or five digits, depending


book, complete with detailed descriptions, independently
on the control system setting from all programs of origins. This way, the subprograms
can be used when needed, often at a short notice, regardless
The main program number - 0 or : - cannot be of the program for which they have been originally written.
negative or equal to zero Such a method allows to organize all the subprograms by
The subprogram number cannot be negative their series number (i.e., 1000, 2000, 3000, etc., or 1100,
or equal to zero 1200, 1300, etc.), for either the type of CNC machine, the
type of subprogram, or the type of machining operation.
Within the allowed range, any number can be assigned to
any main program or a subprogram. Some programmers do Individual subprograms have to have assigned program
not use program numbers at all. This approach is accept- numbers that are unique. The program number assigned to
able for some controls, but only if the application does not a subprogram is called together with the M98 function and
require subprograms. In most cases, the main program the P address. Such a combination of the two words, M98

numbers can be assigned by the machine operator. On the P... is the minimum requirement for a subprogram call from

other hand, to maintain control of subprograms, program another program.


numbers become very important. The first step is to get or-
Using the example (early in this chapter) of the machine
ganized. This is even more important if the subprograms
zero return sequence for a four axis vertical machining cen-
are designed to be called up by many other programs at dif-
ter, a subprogram can be created (with an assigned number
ferent times. There is no one best method, but some proven
03954) for the blocks representing all needed commands -
how to approach the subject of
suggestions offer an idea
program numbering and develop a personal approach.
units selection G20 or G21 is not included:

For example, main programs are


in this handbook, all 03954 (MACHINE ZERO RETURN)
numbered consecutively, with two digits corre-
the first
N101 G17 G40 G49 G80
N102 G91 G28 ZO
sponding to the chapter number. In this chapter, the method
N103 G28 XO YO
also applies to subprograms, but the last two digits are arbi-
N104 G28 BO
trarily increased by fifty, for example 03953 will be the
N105 G90
third subprogram example in the chapter. Feel free to adapt N106 M99
this method to any reasonable format. %

Organized Approach The main program,


units selection should be used in the
for flexibility. Once
machine zero return subprogram
the
The suggested programming approach is based on the has been designed and stored into the memory, every main
understanding that the CNC memory is not used as a stor- program can start by calling the subprogram 03954:
age media for all part programs made. The control system
memory capacity is always limited. At one point, this limit 03903 (MAIN PROGRAM)
will be reached and there will be no more space left to ac- (PART ABC- 12 3)
commodate more programs. A good program organization N1 G20 Units usedfor this program
isone that uses the CNC system memory only for the cur-
N2 M98 P3954 Subprogram 03954 call
rent program, perhaps a few more that are to be used soon.
N3 G90 G54 GOO X. . Y. NonnaI program start
If the unique program number
assigned by the machine
is N4 ...
tool operator during setup, the situation needs some con-
trol as well. On some main program number
controls, the < ... Machining ... >
on the written copy always load automatically, so it
will not
is not really needed. That means, if an arrangement is made
N45 M30 Main program end
with the shop supervisor that the CNC operator stores the
main programs using only three digits for the regular pro- %
gram numbers -999; then there will be the four digit num-
1

To visualize the execution of the two programs by the


bers (XK)-9999 available for subprograms. This available
1

range is more than enough for most manufacturing applica-


CNC system, follow all operational steps in the order of
program execution. During the program 03903 execution,
tions. Such an approach presents a good control over those
the control system will follow the following order of opera-
subprograms whose numbers selected. All four-digit sub-
tions (instructions):
program numbers can be documented, logged and subse-
SUBPROGRAMS 373

1 Set program number 03903 as the


.

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.

To illustrate the described concept, here is an example. In


a simple application, where a main program calls a single SUBPROGRAM DEVELOPMENT
subprogram, there should be no problem in block number-
ing. Even if the sequence numbers are duplicated in both Before a subprogram can be developed, it must be well
the main program and the subprogram, it is not likely there thought out and planned. Since the most common applica-
will be any confusion. On the other hand, when several tion for subprograms is repetitive pattern of machining, the
subprograms are called from the same main program, the programmer should have the ability to recognize the ma-
duplicated block numbers appear during the main program chining pattern to be used in a subprogram.
processing, as well as when subprograms are processed.
Such a situation may confuse the CNC operator to the ex- Repeating Pattern Recognition
tent of losing track of what is really happening in the con-
This ability to recognize a repealing pattern is a matter of
trol system at any given time.
experience. The first indications come when writing a con-
To avoid this problem, consider assigning unique block ventional program block by block. Visually scan the writ-
numbers to each subprogram, thus preventing a duplica- ten copy first. If there are repealing clusters of consecutive
tion. One method is to identify the subprogram numbers in blocks containing the same data, it is a very good reason to
the high thousands series, for example 06100, 06200, evaluate the program more carefully and possibly develop a
06300, etc. Then, the block numbering in a subprogram subprogram.
can be based on the subprogram number. For example:
An experienced programmer will not write a program the

06100 (SUB l) long way That is a waste of time. The programming


first.

N6101 . . experience enhances the ability to recognize a potential for


N6102 . . . subprograms at the early stages of the program planning.
N6103 ... ...cmdsoon However, for a programmer with limited experience, there
374 Chapter 39

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.

Tool Motion and Subprograms

One of the most common subprogramming applications


is a tool path machined at different locations of the part. For
example, a ten hole rectangular pattern needs to be pro-
grammed - Figure 39-4.

h* - 0.75(3)

L
4©OO
0.60
-

(2)
O o Figure 39-6

Subprogram 03955 processing flow

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:

03904 (MAIN PROGRAM)


(FOUR -CORNER PATTERN)
N1 G20
N2 G17 G40 G80
N3 G90 GOO G54 XI. 88 Y1.25
N4 G43 Z1.0 S350 M03 HOI
N5 G99 G81 RO.l Z-0.269 F3.5 (LL HOLE 1)
N6 M98 P3955 (LL PATTERN)
N7 G90 X6.25 Y1.88 (LR HOLE 1)
N8 M98 P3955 (LR PATTERN)
N9 G90 X6.25 Y5 . (UR HOLE 1)
N10 M98 P3955 (UR PATTERN)
Nil G90 XI. 88 Y5.0 (UL HOLE 1)
N12 M98 P3955 (UL PATTERN)
N13 G80 G90 G28 Z1.0 M05
Figure 39-5 N14 G91 G28 XO YO
Hole pattern layout for program examples 03904 and 03905
(both using subprogram 03955)
SUBPROGRAMS 375

Only one cutting was used for this example, other


tool M98 P. . D.
tools will follow the same programming procedure. This
method of the last example is more common - in the abso- This way, the offset number D can be changed anytime
lute mode from the main program, the tool is positioned at the subprogram is called, without change to the subpro-
the lower left hand corner of the pattern and the first hole of gram itself. This method is useful if the programmed con-
the pattern is drilled at that location. Then the subprogram tour requires two or more different offset values, but it does

is called and the remaining nine holes arc drilled, using an


not work on all controls. Here is the content of a simple

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.

N564 G01 XI. 875


acceptable for most control systems:
N565 YO
N566 X-0.75
03905 (MAIN PROGRAM) N567 GOO G40 Y-0.75
(FOUR- CORNER PATTERN) N568 M99
N1 G20 %
N2 G17 G40 G80
N3 G90 GOO G54 XI. 88 Y1.25
For contour finishing, the subprogram will be called by
N4 G43 21.0 S350 M03 HOI
normal means, from the main program:
N5 G99 G81 RO 1 Z-0.269 F3 5 M98 P3955
. .

N6 G90 X6.25 Y1.88 M98 P3955


N7 G90 X6.25 Y5.0 M98 P3955 M98 P3956
N8 G90 XI. 88 Y5.0 M98 P3955
N9 G80 G90 G28 Z1.0 M05 The same subprogram can be used for finishing as well as
N10 G91 G28 XO YO for semifimshing, leaving some material stock, but two D
offsets have to be used, such as D5 and D52. In this case,
1

offset D5stores the amount of the cutter radius and con-


1

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:

All modal values in effect when the subprogram is called will


03957 (CONTOUR SUBPROGRAM - B)
remain in effect for that subprogram, unless changed within. N561 G41 G01 XO F10.0 (D. . NOT INCLUDED)
N562 Y1.75
N563 G02 XO 25 Y2 0 R0.25. .

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:

address. If the same subprogram is to be used for semi-


finishing and leave some slock, for example, it will not M98 P3957 D51 ...forsemifbuslmg
work. The reason is that the D address is fixed and is stored M98 P3957 D52 ...forfinishing
in the control as the full cutter radius. The solution? Use

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-

gram is always a branch of another program - it is a con-


Two Level Nesting
tinuous extension of the program of origin and its integral
part. All modal values set anywhere in the program are The processing of a subprogram that is nested two levels
valid until changed or canceled by a command of the same deep also of the main program. When the con-
starts at top
group. The M99 subprogram end function will not cancel trol encounters a subprogram call for the first level, it will

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)

M98 P21 M98 P22


M98 P21
M99
M99 M99 %
M30 1
% M30 %
% %
<END> <END>

Figure 39-7 Figure 39-8

One level subprogram nesting Two level subprogram nesting


SUBPROGRAMS 377

Three Level Nesting


<START>
The nesting up to three levels deep is the next logical ex- OlO
tension of the two level nesting. As before, starting at top (MAIN) 1

021 022 023 024


of the main program (program OlO in the example illus-
(SUB) (SUB) (SUB) (SUB)
trated in Figure 39-9), the first branch will be to the first
level (021), another branch follows (022) and there is an
additional branch to 023. Each subprogram is processed
up to the next subprogram call, or the end of subprogram.
M98 P23
The program processing will always return to the block fol- M98 P21
lowing the subprogram call, ending in the main program. M98 P22 M98 P24

<START> M99
M99
OlO r- M30 %
% M99 M99
(MAIN) %
021 022 023 '
—% L- %
(SUB) (SUB) (SUB) <END>
Figure 39-10

M98 P22 Four level subprogram nesting


M98 P23
M98 P21 nested subprograms. Such a programming approach may
result in a short program, but at the cost of a long develop-
M99 ment time. The program preparation time, its development
M99
% and debugging often take more time than writing conven-
M30 M99 tional programs. Not only the logical development is com-
% % plex and more time consuming, a significant portion of
%
programming time must be spent on careful and thorough
<END> documentation of the process flow of all programs, setting
up the initial conditions, checking the validity of data, etc.
Figure 39-9

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 -

use it only in those cases, when the frequency of their future


Considering the reality that each subprogram can be re-
deployment justifies the extra time spent for their develop-
peated up to 9999 limes in any program that calls it, shows
ment. Like anything else, many nesting levels offer advan-
the enormous programming power available to use and ex- tages and the inevitable disadvantages.
plore.Always be aware of potential difficulties, even dan-
gers, when developing subprograms with several multi
378 Chapter 39

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

special one - at There


the end of this chapter, so look for it). incremental plunge cut and the 360° circular cut. All other
are other examples found throughout the handbook that motions will be in the main program 03906. Note the word
make generous use of subprograms. incremental for the plunge depth. The .010 must be pro-
grammed incrementally, otherwise it will cut at the abso-
Here one more example relating to this chapter, this
is
lutedepth of Z-0.01 - all twenty five times! Here is the
time applying a simple XY contouring work to a multiple Z
complete main program 03906, followed by a single re-
depth - evaluate Figure 39-1 1.
lated subprogram 03958 (tool TO I is assumed to be in the
spindle):

03906 (MAIN FOR SIMPLE DEEP GROOVE)


(T01 - 0.250 DIA CENTER CUTTING END MILL)
N1 G20
N2 G17 G40 G80
N3 G90 G54 GOO X2.875 Y1.5 S630 M03
N4 G43 Z0.1 HOI M08
N5 G01 ZO F10.0 (START Z POSITION AT ZO !)
N6 M98 P3958 L25 (CALL SUBPROGRAM 25 TIMES)
N7 G90 GOO Z1.0 M09
N8 G28 Z1.0 MO
N9 M30
%

03958 (SUB FOR 03906)


N581 G91 G01 Z-0.01 F0.5 (INCREMENT BY -0.01)
N582 GO 3 1-0.875 F2.0 (FULL CIRCLE CONTOUR)
N583 M99
%
D2 TOOL STEEL
Intentionally, the presented program is simple. It does
Figure 39-1
show, however, two important considerations that have to
Main program 03906 using subprogram 03958
be maintained in any subprogram development. These con-
siderations relate to maintenance ot a continuous relation-
The job requires a groove with a 0 1 .750 pitch to be ma-
ship between the main program and the subprogram. They
chined to the depth of .250. It is a utility or rough groove, so
can be described as special requirements:
there is no need for precision tolerances, or even the high
quality of the surface finish. All needed is a 0.250 center ... to maintain a transfer from the main program to
cutting end mill (slot plunge to the depth, program a
drill), a subprogram (before subprogram is called)
360° circular tool path, and job is done. Weil, almost.
... to maintain a transfer from the subprogram, back

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).

gramming for a simple tool change sequence. To make the


programming easier, develop a subprogram that includes ROW 10000
all seven operations, then call it in the main program when- COLUMN 10000
ever a tool change is required:
—— n - — — o
03959 (TOOL CHANGE VERTICAL MACHINING CENTER)
N1 MO 9 X
N2 G80 G40 M05
\
N3 G91 G28 ZO XX
N4 G49 DOO HOO
N5 G90 MO Lx>
/O
N6 M99 V
% ATT
XX
This example can be easily modified for a different ma-
XX l'
chine design or for a CNC horizontal machine. It may even Y
include special requirements, such as certain manufac-
X
8 u _ XT
turer’s options. The tool change may even be programmed r\ N

at machine table position. The only modification


a certain
S/
— 1 -
1
XA 1 “r™

would be the addition of a G53X..Y.. block before the tool


change block. Another example is a special code for tool
N SUBPROGRAM START
change and the coolant ON function. Some machine manu-
facturers create a special M
function, combining the two
ROW1 HOLE GRID:
standard functions, for example, M
6 - which is the combi- 1
COLUMN 1 x= 0.12 Y= 0.12

nation of M06 and M08 standard functions. Figure 39- 13

100 000 000 holes - rectangular grid pattern


380 Chapter 39

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

subprogram pattern repeals 5000 times in the body of the


each location is 0.030 seconds, translated into minutes will
main program: take another 50,000 minutes.

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.

The grand of all results is 9,054,473.6837 minutes,


total
03907 (MAIN PROGRAM)
N1 G20 which is 150,907.8947 hours, which is 6,287.829 days,

N2 G17 G40 G80 T01 (SPOT DRILL) which is 17.2269 years. Believe it or not, it will take more

N3 M0 6 than seventeen years of uninterrupted machining, to spot


N4 G90 GOO G54 XI. 0 Y1.0 S3000 M03 T02 drill and one hundred million holes - and all that can be
drill
N5 G43 Z1.0 H01 M08 done with the main program and a subprogram totaling just
N6 G99 G82 R0.06 Z-0.04 P30 F5.0 L0 over two dozen blocks of input.
N7 M98 P3960 L5000
N8 G90 G80 Z1.0 Going into related details, size of the plate without mar-
N9 G28 Z1.0 gins would have to be 100 x 100 feet, so the actual machine
N10 M01
travel would have to be greater than 100 feet along the X
Nil T02 (5/64 DRILL)
axis as well as the Y axis. Hardly any CNC machine on the

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

meters) thick. Enough of that - subprograms do work.


40 DATUM SHIFT

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.

This chapter describes advanced subject of


in detail the For simple jobs, there is no need for special or creative

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 SHIFT WITH G92 OR G50 Program Zero Shift

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.

view these commands now, before continuing further. In


To illustrate the concept of the program zero shift, a sim-
particular, recall that these commands do not cause any di-
ple but relevant drawing will be used. The drawing is illus-
rect tool motion, but they do influence any tool motion that
trated in Figure 40-1.
follows it. Also keep in mind that the position register com-

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).

The next critical block is N10. At this point in the pro-


gram, the Part A is completed, but the Part B has not yet
Figure 40-2 been started. Think a little now and see where exactly the
tool is after executing block N9. It is at the position of
Program zero shift using G92 command for two parts - 04001
X2.5Y5.0 of Part A. If the tool has to move to the first hole
X distance from the part zero of Part B, which is also the position of X2.5Y1.5, the pro-
The G92 X(A) indicates the
of Part A to the machine zero, G92 Y(A) indicates the Y gram has to ‘tell' the control where the tool is at that exact
distance from the part zero of Part A
machine zero.to the
moment - but in relation to Part B\ That is done by a simple
arithmetic calculation:
Note that the distances are from program zero to machine
zero. They could terminate anywhere else if necessary, but
G92 (X) = 11.5 + 2.5 - 22.7 = -8.7
must start from part zero. In order to use G92, the distances
G92 (Y) = 9.8 + 5.0 - 19.5 = -4.7
between both parts must be known. Rounded values are
used to simplify the example: Evaluate Figure 40-3 to visualize the calculation. The di-
rection of arrows in the illustration is important for deter-
Part A: G92 X22.7 Y19.5 Z12.5
mining the axis sign in the G92 block.

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

22.7- However, if the bolt pattern is within a rectangular area, the


part zero maybe at the edge comer of the work.
—8.7 — Normally, absolute locations of the bolt holes will have to
be calculated from program zero, unless either a shift of the
Y5.0 o o program zero is used (using G92 described earlier), or a
special coordinate system is selected.


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:

Use the center of the bolt circle as program zero.


o o This will be convenient for the CNC programmer only,
as it causes more work during setup
X2.5
X2.5 Y5.0 the last
is
Use two different work offsets in the program,

- 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 -

the programmer uses calculations relating to the bolt circle


G92 (X) = 11.2 + 2.5 - 22.7 = -9.0 center coordinates, directly in theCNC program, without
G92 (Y) = 9.7 -* 5.0 - 19.5 = -4.8 the need of extra additions and subtractions. This method
may even simplify setup on the machine. Which method is
Both programmed coordinates X and Y will be negative. better to select and when is addressed next.

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.

many cases, when a drawing is dimensioned in


There are Local coordinate system is a supplement, or a subset, or a
such a way that the work offsets G54 to G59 become some- ‘child’ of the current work offset. It must be programmed
what A good example is a bolt hole pattern. If
impractical.
only when a standard or additional work offset has been se-
the overall machined component is round, chances are that lected. There are many applications that can take advantage
the program zero will be selected at the center of the bolt of tins powerful control feature.
hole pattern, which offers a certain benefit in calculations.
384 Chapter 40

G52 Command The modal G52 command is active until it is canceled in


the program. To cancel a local coordinate system and to re-
What exactly is the local coordinate system, and how
turn to the previously active work offset mode, all that has
does it work? Formally, it can be defined as a system of co-
to be done is to program zero values with G52:
ordinates associated with the active work offset. It is pro-
grammed by the preparatory command G52.
G52 X0 Y0 ... last example

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.

t 04002 (G54 AND G52 EXAMPLE)


G52(Y) N1 G20
I
N2 G17 G40 G80 T01
N3 M0 6
N4 G90 G54 GOO X8 0 Y3 0 S1200 M03 T02
. (CNTR)
.

N5 G43 Z1.0 H01 M08


N6 G52 X8.0 Y3 0 (TEMP PRG ZERO AT BC CNTR)
.

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

It is only used in the absolute mode (G90) N13 T02


Current work coordinate system (work offset)
N14 MO 6 (ACTUAL TOOL CHANGE)
is not canceled by G53 command
M15 G90 G54 GOO X53.0 Y13.0 S780 M03 T03
N16 G43 Z1.0 HO 2 MO
Cutter radius offset should always be N17 G99 G81 R0.1 Z-0.836 F12.0
canceled prior to G53 command N18 X26..0 Y25.0
N19 G80 G28 Z1.0 MO 5
At one possible usage emerges from these rules. The
least N20 G53 GOO X- 170.0 Y-50.0 (TOOL CHANGE POS)
machine coordinate system can be used to guarantee tool N21 M01
changes at the same machine table location every time the
tool change is programmed, regardless of which work is on
N22 T03
N23 MO 6 (ACTUAL TOOL CHANGE)
the table and which work offset is active. This can be ap-
plied to a single program, or as a standard for all programs
%
for a particular machine tool. Remember, the tool change
position will always be determined by the actual tool dis- The fourth item of the rules mentioned earlier states that
tance from the machine zero position, not the program zero the current work
not canceled by the machine co-
offset is
and not from any other position. On many machines, or ordinate system command. Since the programming exam-
during complex setups, it is advisable to establish a fixed ple04003 does not illustrate this situation, the following
tool change position, regardless of the part position. A good sequence of tool motions (not related to program 04003)
example is the machining with a rotary table or any other shows the independence of G53 from G54:
permanent or semi-permanent fixture located on the ma-
chine table. N1 G21 (METRIC)

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...)

The machining sequence in the program is quite simple.


The cutting tool moves to the XY position of the part in
N250, performs the required machining operation, such as
drilling to depth in N251, rapids to a clear Z position in
N252, then moves to the fixed tool change position in
N253. In the next block, the CNC operator changes the tool
manually, in block N254, then the spindle speed and rota-
tion are re-established in N255. In the block N256 only the
X and Y coordinate positions are specified. All other values
are default values, including the G54 work offset com-
mand. The previous block N256 has the same meaning as:

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-

DATA SETTING ample, work offsets as opposed to tool length offsets.

Examples in this section are for typical Fanuc controls,


In a small or medium machine shop, job shop, or any and have been tested on Fanuc 16 Model B, a common
other environment where stand alone CNC machines are milling and turning control.
used, the machine operator typically sets all offset values
that have to be input into the CNC system during the job Coordinate Mode
setup. This common method is very useful when CNC pro-
grammer does not know the setting values - the actual val- Selection of the absolute or incremental programming
ues - of various offsets at the time of program development.
mode has a great impact on the offset values input through-
out the CNC program. Regardless of which type of offset is
manufacturing environment, for example ag-
In a tightly entered with the G10 command, the programmed offset
ile manufacturing or very large volume production, this amount will replace the current offset amount stored in the
method is very costly and inefficient. An agile or large vol- control, if the program is in absolute mode (G90 for milling
ume production uses modern advanced technology, such as controls and XZ for turning controls).
CAD/CAM systems for design and tool path development,
concept of cells, robots, preset tools, automatic tool chang- In G91 incremental mode for milling controls and UW
ing and tool life management, pallets, programmable auxil- axes for turning, the programmed offset amount does not
replace but update the offset amount stored in the control:
iary equipment, machine automation, and so on. In such an
environment, there cannot be any unknown elements - rela-
tionships of all reference positions are always known and
G90 with G10 = offset amount will be REPLACED
the need for offsets to be found and set at each individual
eliminated. All offset values must be always
G91 with G10 = offset amount will be UPDATED
machine is

known to the programmer, before the actual machine and


G90 or G91 can be anywhere
set in the program, as long
tool setup takes place.
as the block containing the selected command is assigned
There is an advantage in such information being known - before the G 1 0 data setting command is called.
the offset data can be included in the program and be chan-
All types of available offsets can be set through the pro-
neled into appropriate registers through the program flow.
gram, using G 10 command:
There no operator’s interference and machining is fully
is

automated, including the maintenance of tools and related Work offsets G54 to G59 and G54.1 P..

offsets. All offsets are under constant program control, in-


Tool length offsets G43 and G44
cluding their updates required for position changes and
changes in tool length or radius. Cutter radius offsets G41 and G42

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.

Data Setting Command


Standard Work Offset Input
To select the data setting option and to set offset data
through the program, Fanuc offers a basic G command: The standard six work offsets G54 to G59 are available
for both the milling and turning controls. Due to the ma-
chining requirements, they are typically associated with
G10 Data setting milling controls. The programming format is the same:

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

grammed. If it is needed in any subsequent blocks, it has to


be repeated in that block.
DATUM SHIFT 387

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

Z amount has not been


coordinate offset register. Since the
programmed, the current amount of the Z offset is retained. Input 1: Separate Geometry offset value

L2 = Standard work offsets Values 1 Values set by G10 L10 R. R.. block

Input 2: Separate Wear offset value

Additional Work Offset Input


Values 2: Values set by G10 LI 1 R. R.. block

In addition to the standard six work offsets for milling


controls, Fanuc offers an optional set of additional offsets, Memory C - two columns for tool offset and
G54.1P1 to G54. 1P48. G 10 command can also be used to two columns for radius offset

input offset values to any one of the 48 additional work off-


sets and the command is very similar to the previous one: Input 1: Separate Geometry offset value

Used for: H offset code


G10 L20 P. . X. . Y. . Z.

Values 1 Values set by G10 LI OR.R.. block


Only the fixed offset group number has changed to L20,
which only selects the additional work offsets. Input 2: Separate Geometry offset value

L20 = Additional work offsets Used for: D offset code

Values 2: Values set by G10 LI 2 R. R.. block

External Work Offset Input


Input 3: Separate Wear offset value

Another offset that belongs to the work coordinate sys-


Used for: H offset code
tem is called either External or Common. This offset cannot
be programmed with any standard G code and is used to Values 3: Values set by G10 L11 P.. R.. block
update all work offsets globally, affecting all work offsets.
Input 4: Separate Wear offset value
To input offset settings into the external offset, G10 uses
the L2 offset group and P0 as the offset selection: Used for: D offset code

G90 G10 L2 P0 X-10.0 Values 4: Values set by G10 LI 3 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-

ditional axis as well). In practice, when using the shown


ister number in the CNC system. The R value is the amount
setting,each work offset used in a particular program will
of the offset to be set into the selected offset number. Abso-
lute and incremental modes have the same effect on tool
be shifted by 10 mm
into the X negative direction.
length programmed input as for work offsets.
388 Chapter 40

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

Note the G91 incremental mode. If two examples


the last Tool length offset does not apply to the lathe controls, be-
are used in the order listed, the final amount of offset cause of a different offset structure. G 10 command can be
number 5 will be -467.5 mm. used to set offset data for a lathe control, using this format:

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-

Valid Input Range


able, using the standard G codes of the A Group.

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:

P10001 be geometry offset number


± 999.999 mm Metric Geometry offset input will 1

PI 00 12 will be geometry offset 1 2 ...and so on

± 99.9999 inches English Geometry offset input


If the value of 0000 is not added, the P number
1 will then

± 99.999 mm Metric Wear offset input


become the number of the wear offset.

Here are some typical examples of offset data setting for


± 9.9999 inches English Wear offset input
a CNC lathe, along with expected results. All examples are
consecutive, based on the order of input:
The number of available offsets is also limited, depend-
ing on the control model. There is a minimum 32 offset G10 P10001 X0 Z0 R0 Q0
numbers available. Optionally, the CNC system can have
64, 99,200 or 400 offsets available (even more), most of
. . . clears all geometry offset for G 01 settings
(Geometry offset register 1)
them as a special option.
G10 PI X0 Z0 R0 Q0
CUTTER RADIUS OFFSETS
. . . clears all wear offset for W 01 settings
(Wear offset register
memory type C, the amount of the cutter ra-
For the offset 1

may be input through the program, using


dius offset (D)
number G
Note - Q0 also cancels value of tool tip in 01
G10 command with L12 and L13 offset groups:
G10 P10001 X-200.0 Z-150.0 R0.8 Q3
G90 G10 L12 P7 R5.0
. . . sets the contents of G 01 geometry offset to:
will input 5.000 radius value into the cutter radius ge-
X-200.0 Z-150.0 R0.8 T3
ometry offset register number 7.

. . . also sets T3 in the wear offset - automatically !!!


G90 G10 L13 P7 R-0.03

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

Note, that it may be safer to program: PROGRAMMABLE PARAMETER ENTRY


G10 PI R0.8 Q3 Current setting not assumed
This section covers yet another aspect of programming
the G10 command - this time as a modal command. It is
G10 PI X-0.12
used to change a system parameter, through the program.
This command is sometimes called the ‘Write to parameter
. . . wear offset W 01 is set to X-0.12,
regardless of its previous setting
function ’, and is definitely not very common in daily pro-
gramming. Timid programmers should skip this section
altogether. It is very important to understand the concept of
G10 PI U0.05
control system parameters, otherwise this section will not

. . . 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!

safety that attempts to eliminate data entry error.

Typical uses of this command are common to changes of


MDI DATA SETTING machining condition, for example, spindle and feedrate
lime constants, pitch error compensation data, and others.
This command usually appears in the so called User Mac-
Programming various offset values through the program
ros (applied by the G65 command) and its purpose is to
setting requires full understanding of the input format fora
control certain machine operations. The concept and expla-
particular control system. It is too late when an incorrect
nation of User Macros is not covered by this handbook.
setting causes a damage to the machine or the part.

One method can be used to make sure the offset data


that Modal G10 Command
setting is correct, is a simple test. Test the G 0 entries in the 1

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:

G91 G10 L10 P12 R-1.0 G10 L50


Press INSERT (... data setting ...)

Press CYCLE STAR I


Gil

Again, to verify, check the setting of tool length offset The data setting block has three entries:

H12 - it should have the new value of -107.475.

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
-

see examples further in this section.


G10 Data setting mode
L50 Programmable parameter entry mode fixed R Address
.. P.. R.. Data entry specification
G1 Data setting mode cancel
1
The address R new value to be registered into the
is the
select parameter number and must always be entered. The
Between the block G 0L50 and the
1 block G 1 1 is the list
valid range listed above must be observed. Note the lack of
of system parameters that are to be one parameter per set,
decimal points in the entries.
block. The parameter number uses the N address and the
data use P and R addresses. There are several types of pa-
Program Portability
rameter input:
Programs containing even a single programmable param-
Type of parameter input Allowed input range be used only with the machine and control
eter entry should
for which they were designed.
Bit type 0 or 1

Use extreme care when a program that modifies system


Bit axis type 0 or 1 parameters is used on several machines.

Byte type 0 to ±127


Parameter numbers and their meaning on different con-
Byte axis type 0 to 255 trolmodels are not necessarily the same. The exact control
model and its parameter numbers must be known during
Word type 0 to ±32767 programming. For example, on Fanuc control Model 15.
the parameter controlling the meaning of an address with-
Word axis type 0 to ±32767 out a decimal point is number 2400 (Bit #0). The parameter
controlling the same selling on Fanuc control Model 16
Two word type 0 to ±99999999
will use number 3401 (Bit #0).

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:

where Number is the four digit parameter number and the


#7 to #0 are individual bit positions - note the order of num- Setting R-value Description
bering and the counting method. Other, non bit type param-
1 50 baud
eters are input as a byte, word, or two word entries (there
are axis and non axis versions).
2 100 baud

P Address
3 110 baud

The P address is used only for parameters relating to axes


4 150 baud
byte axis, word axis and two word axis). If the pa-
(bit axis,
rameter does not relate to an axis, the P address is redun- 5 200 baud
dant and does not have to be programmed.
DATUM SHIFT 391

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

12 19200 baud will generate an error condition. The next example is

changed for two axes input:

In the previous example,


G90
G10 L50
G10 L50
N1221 PI R-250000
N0103 RIO
N1221 P2 R-175000
Gil
Gil
4800 characters per second baud rate has been selected.
If this example is used on a lathe control, P 1 is the X axis,
In another example, the parameter #5130 controls the P2 is the Z axis. On a machining center, the PI is the X axis,
chamfering distance for thread cutting cycles G92 and G76 P2 is the Y axis and P3 will be the Z axis, if required. In ei-

(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)

or write to a parameter, also for a milling control:


This program segment will change parameter #5130 to
the value of 1 The chamfering amount will be equivalent to
.

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

so on. P refers to the X axis, P2 refers to the Y axis, and so


1
On Fanuc 6 Model B 1 (and most of the other models as
well) is a feature that allows automatic entry of sequence
on, up to 8 axes. Because the valid range of a long integer
numbers, if the program is entered from the keyboard. This
(two word type) is required, a decimal point cannot be
feature is intended as a time saving device for manual entry
used. Since the setting is in metric system and one micron
of program data. In order to enable this feature, select the
(0.(X)1 mm) is the least increment, the value of -250.000
will be entered as -250000. The following example is NOT parameter that controls the ON
and OFF status of the fea-
ture.On Fanuc 16 it is a parameter number 0000 (same as
correct and will result in an error:
0). This is a bit-type parameter, which means it contains
392 Chapter 40

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-

current setting of parameter 0 is as follows:


ble parameter entry mode is that more than one parameter
can be set as a group. Since the two parameters are logi-
SEQ INI ISO TVC cally connected, a singleprogram segment can be created,
with the same two smaller segments ear-
final results as the
0000 #7 #6 #5 #4 #3 #2 #1 #0 lier. The modal G10 command comes handy here:
0 0 0 0 1 0 1 0
G10 L50
N0000 R00101010
Specificmeaning of the other parameters is irrelevant for N3216 R5
this bit #5 is set to 0, which means the auto-
example. The Gil
matic block numbering is disabled.
As neither parameter is the axis type, the address P was
The following program segment will turn on the bit #5,
omitted. The N0000 is the same as NO, and was used only
without changing the other bits:
for better legibility.

G10 L50 Note to Fanuc 15 users (Fanuc 15 system is higher than


NO R00101010 Fanuc 16) - the parameter number that selects whether the
Gil
automatic sequencing will enabled is 0010, bit #1 (SQN).
There is more flexibility on Fanuc 15 - the starting se-
The resulting entry in the parameter screen will reflect
quence number can be controlled with parameter #0031,
that change:
and the parameter number that stores the increment amount
is #0032, with the same program entry styles as shown.
SEQ INI ISO TVC
Also, on Fanuc 15. the allowable range of sequence num-
0000 #7 #6 #5 #4 #3 #2 #1 #0 bers is up to 99999. This is a typical example of a difference
between two control models, even whey were produced by
0 0 1 0 1 0 1 0
the same manufacturer.
Note that all bits had to be written. The job is not done
yet,however. Fanuc offers an additional feature - the incre-
Effect of Block Numbers
ment for the numbering can be selected as well, for exam- Many programs include block numbers. It would be per-
ple, selectionof 10 will use N10, N20, N30 entries, selec- fectly natural to assign block numbers to the last example:
tion of will use N 1 N2, N3, and so on. The example will
1
,

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

N3216 R5 handle this situation? Rest easy - there will be no conflict.


Gil In case of two N
addresses in a single block within the G10
to Gil segment, the first N address is the block number, the
Once these settings are completed, there will be no need second one in the same block will be interpreted as the pa-
to enter block numbers in any program entered via the con- rameter number.
41 MIRROR IMAGE

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.

Mirror image is based on the principle of symmetrical


parts, sometimes known as the Right Hand (R/H) and the
Left Hand (L/H) parts < Figure 41-1).

Figure 41-2

The right hand / left hand principle applied a machined part

It was also established earlier that each quadrant requires


different sign of axes. Mirror image function allows the re-
versal of axes and other directional changes automatically.

Tool Path Direction


Figure 41-1

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

Not all activities are affected at the same time. If there is


Y+
no circular interpolation in the program, there is no arc di- QUADRANT II (Q2) QUADRANT I (Q1)
i
rection to consider. Figure 4 1-3 shows the effect of the mir- MIRROR AXIS FOR
ror image on the tool path, in all four quadrants.
Q1 to Q2
Q2 to Q1
QUADRANT Y+ QUADRANT Q3 to Q4
Q4 to Q3
M
^ G42 G41^
I

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

Y- IV Programmable mirror image must be


supported by the control system
Figure 41-3

Effect of mirror image on tool path in different quadrants


Normal machining follows the program as is. For exam-
Original Tool Path ple. if the programmed path takes place in the second quad-
rant (using absolute mode G90), the normal X values will
The program may be developed in any
original tool path be negative and the normal Y values will be positive. The
quadrant. If there is no mirror image applied (the default sign of coordinate points is always normal within the origi-
condition), the tool path is machined in the defined quad- nal quadrant programmed, when no mirror image is used.
rant only. how the majority of all applications is
This is Once the machining takes place in a mirrored quadrant, one
programmed. Once mirroring is started, it always mirrors or both signs will change.
the original machining pattern - the original tool path - re-
gardless in which quadrant it has been defined. Sign of Coordinates

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

Mirrored in Quadrant III ... Climb mode Control Setting


Mirrored in Quadrant IV ... Conventional mode Most controls have a screen setting or switches dedicated
to mirror image set at the control. Both designs allow the
important to understand the machining mode when
It is
operator to set certain parameters in a friendly way, without
using mirror image. A conventional machining mode may
the danger of overwriting other parameters by error. In case
not yield good results. In may negatively affect the surface
of a screen setting, a display similar to this will appear:
finish and the dimensional tolerances.

MIRROR IMAGE X-AXIS = 0 (0:OFF 1:0N)


Arc Motion Direction MIRROR IMAGE Y-AXIS = (0:OFF 1:0N)
0

Another change to the tool path that will happen only


This is the default display, where mirroring for both axes
when a single axis is mirrored, is the rotation direction of
is turned off (cancel mode). To apply X axis mirroring only,
an arc. Any clockwise arc programmed will become coun-
make sure the display shows
terclockwise arc when mirrored along one axis, and vice
versa. Here is the result of the arc motion direction, again,
MIRROR IMAGE X-AXIS = 1 (0:OFF 1:0N)
based on Quadrant I:
MIRROR IMAGE Y-AXIS = 0 (0:OFF 1:0N)
Quadrant I Original arc is CW:
To apply only the Y axis mirror, the display must show
Quadrant II - cutting CCW
Quadrant III - cutting CW MIRROR IMAGE X-AXIS = 0 (0:OFF 1:0N)
Quadrant IV - cutting CCW MIRROR IMAGE Y-AXIS = 1 (0:OFF 1:0N)
Quadrant I
- Original arc is CCW:
And finally, in order to mirror about both axes simulta-
Quadrant II - cutting CW neously, the setting will be ON for both axes:
Quadrant III - cutting CCW
Quadrant IV - cutting CW MIRROR IMAGE X-AXIS = 1 (0:OFF 1:0N)
MIRROR IMAGE Y-AXIS = 1 (0:OFF 1:0N)
The control system will automatically perform G02 as
G03 and G03 as G02 when required. For the majority of
To cancel the mirror image and to return to the normal
machining applications, the arc motion direction change
program mode, the setting for both X and Y axes is zero:
should not affect the machining quality. For both the mill-
ing direction and the arc direction, refer again to the earlier MIRROR IMAGE X-AXIS = 0 (0:OFF 1:0N)
Figure 41-3. MIRROR IMAGE Y-AXIS = 0 (0:OFF Is ON)

Program Start and End

When a part is programmed with the intent to use the mir-


ror image, make sure to use a carefully thought out pro-
gramming method, that uses a slightly different technique
than when programming in a single quadrant (without the
mirror image). During the mirror image, all motions in the

program, with the exception of machine zero be


return, will
mirrored, when image is turned
the mirror on. That means
the following considerations do matter:

1 . HOW the program is started


2. WHERE the mirror image will be applied
3. WHEN the mirror image will be canceled

Start and end of the program that is to be mirrored is usu-


ally at the same location, typically at the part XOYO.
Toggle switches for manual setting of mirror image
396 Chapter 41

Figure 41-5 shows mirror image settings using toggle


switches ON/OFF mode. Most machines have a confirma-
tion light that is turned ON for the currently mirrored axis.
Programming - Manual Mirror Setting
Figure 41-6 is a drawing with 3 holes to be machined in

all four quadrants. used to illustrate the process of


It will be
setting and programming of the mirror image.

O
poo
C\i 't CO

Programmed tool motion for the three holes located in Quadrant I

Figure 41-6

Drawing to illustrate manual mirror image programming

For a manual mirror image, the tool motion will be in one


quadrant only - Figure 41-7 then mirrored into the other
,

quadrants - Figure 41-8 and example 04101

04101 (CENTER DRILL THREE HOLES)


N1 G20
N2 G17 G40 G80
N3 G90 G54 GOO XO YO S900 M03 (XOYO)
Resulting tool motion in all four quadrants using mirror image
N4 G43 Z1.0 HOI M08
N5 G99 G82 X6.0 Y1.0 RO.l Z-0.269 P300 F7.0
N6 X4.0 Y3.0 Control settings are automatic by the program. The actual
N7 X2.0 Y5.0 program codes for mirror image vary between machines,
N8 G30 Z1.0 MO but the application principles are the same.
N9 G28 Z1.0 MO
N10 GOO XO YO (MUST RETURN TO XOYO)
Nil M30 Mirror Image Functions
%
In the examples, these functions will be used:

Look motion in N3. It locates the cutting


at the first tool
tool at XOYO, where is no hole! This is the most im-
there M21 Mirror image along the X axis

portant block in the program for a mirror image, because it


M22 Mirror image along the Y axis
is this location that is common to all four quadrants'.

M23 Mirror image cancel (OFF for either axis)

PROGRAMMABLE MIRROR IMAGE


Mirror image is set for each axis by an M function. If one
Most controls have mirror image that can be set but not function is in when another function is programmed,
effect
programmed. Mirror image activated by the control setting they will both be effective. To make only one axis effective,
is done on CNC machine, not in the program. On the other the mirror function must be canceled first.

hand, programmable mirror image uses the functions (or M


sometimes G codes) and almost always uses subprograms. Cancel mirror image mode when the tool motion is completed
MIRROR IMAGE 397

Simple Mirror Image Example N2 G17 G40 G80


N3 M23 (MIRROR OFF)
Program 04102 for the 3 holes in Figure 41-6, can be N4 G90 G54 GOO XO YO S900 M03 (XOYO)
changed lo the programmable mirror image. Holes abso- N5 G43 Z1.0 HOI MO
lute locations are stored in subprogram 0415 1 N6 G99 G82 RO.l Z-0.269 P300 F7 0 LO .

N7 M98 P4151 (QUADRANT I)


04151 N8 M21 (X-MIRROR ON)
N1 X6.0 Y1.0 N9 M98 P4151 (QUADRANT II)
N2 X4.0 Y3.0 N10 M22 (Y-MIRROR ON)
N3 X2.0 Y5.0 Nil M98 P4151 (QUADRANT III)
N4 M99 N12 M23 (MIRROR OFF)
% N13 M22 (Y MIRROR ON)
N14 M98 P4151 (QUADRANT IV)
The main program 04 02 1 calls the subprogram 04151 in N15 G80 Z1.0 MO 9 (CYCLE CANCEL)
different quadrants, using the mirror image functions. Note N16 M23 (MIRROR OFF)
N17 G28 Z1.0 MO 5 (Z MACHINE ZERO)
the XOYO location is common to all four quadrants.
N18 GOO X4.0 Y6.0 (CLEAR ATC LOCATION)
N19 M30 (PROGRAM END)
04102 (MAIN PROGRAM)
%
N1 G20

1.50
01/8 DRILL
0.25 DEEP 0.50 -
12 HOLES - -
0.125 R1.00 R0.15 (3)

0.25 SLOT DEPTH

0.50
I
!_
4.00
1

0.125

ALL QUADRANTS ARE


SYMMETRICAL ABOUT
THE CENTER LINE

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

Complete Mirror Image Example (T01 - 1/8 DIA SHORT DRILL)


N1 G17 G20 G40 G80 G49 (STARTUP BLOCK)
A complete example of a mirror image application with N2 T01 MO 6 (TOOL CHANGE)
more involved tool motions will use two cutting tools to de- N3 G52 X2.0 Y2 0 M23 . (MIRROR OFF)
velop the program as per drawing in Figure 41-9. Program N4 G90 G54 GOO XO YO S1800 M03 T02
will also use coordinate shift G52, automatic tool change, a N5 G43 Z1.0 HOI M08
fixed cycle, interpolation motions and cutter radius offset. N6 G99 G81 RO 1 Z-0.269 F4 0 LO
. .

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 )

Rotation and Scaling Function.


42 COORDINATE ROTATION

A programmed tool motion creates a pattern, contour or a ROTATION COMMANDS


pocket that can be rotated about a defined point by speci-
fied angle. With this control feature, there are many oppor-
The coordinate rotation uses two preparatory commands
tunities to make the programming process much more flex- to turn this feature ON or OFF. The two G commands con-
ible and equally efficient. This very powerful programming
trolling the coordinate rotation are:
feature, usually a special control option, is called the Coor-

dinate System Rotation or just Coordinate Rotation.


,

G68 Coordinate system rotation ON


One of the most important applications of coordinate ro-
tation is a program that is defined in an orthographic orien- G69 Coordinate system rotation OFF
tation but machined at an angle (as required by the drawing
specifications). Orthographic mode defines only horizontal
The G68 command will activate the coordinate system
and vertical orientation, which means that the tool motion
rotation, based on the center of rotation (also known as the
takes place parallel to the machine axes. To program ortho-
pivot point) and the degrees of rotation :

graphic mode is much simpler than calculating tool posi-


tions for many contour change points in an angular orienta-
G68 X.. Y.. R.
tion. Compare the two rectangles shown in Figure 42-1.

US’ where ...

X = Absolute X coordinate of the center of rotation


Y = Absolute Y coordinate of the center of rotation
R = The angle of rotation

Center of Rotation

The XY coordinates are normally the center of rotation


which the rota-
(pivot point). This is a special point about
tion takes place - by two differ-
a point that can be defined
ent axes, depending on the selected working plane. X and Y
is the absolute rotation center selection for the G 17 active
plane. G18 will use XZ as the rotation point coordinates
and G 19 will use YZ as the rotation point coordinates. The
plane selection command G17, G18 or GI9 must be en-
tered into the program anytime before the rotation com-
mand G68 is issued.

If the X and Y coordinate locations are not specified with


Original orthogonal object (a) and a rotated object (b)
the G68 command as the center of rotation (in the G17
plane), the current tool position will be used as the default
center of rotation. This method is neither a practical nor
The above figure (a) shows an orthogonal orientation of a
recommended approach in any circumstances.
rectangle, the figure below (b) shows the same rectangle,
rotated by 10° in the counterclockwise direction. Manually,
Radius of Rotation
it is much program the tool path for figure (a) and
easier to
let the control system change it to a tool path represented in The G68 angle representation is specified by the amount
figure (b). The coordinate rotation feature is a special op-
of R. The units are degrees, measured from the defined cen-
tion and must be the part of the control system. ter. The number of decimal places of the R amount will be-

Mathematically, the coordinate rotation is a feature that


come the amount of the angle. Positive R defines a CCW
requires only three items to define a rotated part - the center
rotation, negative R defines a CW rotation - Figure 42-2.

of rotation, the angle of rotation, and the tool path to rotate.

399
400 Chapter 42

For a moment, ignore the rotation angle and program the


it were oriented in an orthogonal position, that is
part as if
perpendicular to the axes, as shown earlier in Figure 42-4.
\
For actual cutting, decide whether the approach tool mo-
ccw = +
tions will be included in the rotation or not. Thisis a very

important decision. In Figure 42-5 are the two possibilities


/ 1

a X CENTER OF ROTATION and the effect of coordinate rotation on program zero. In


both cases, the approach tool path starts and ends at the
same location of X- 1 .0 and Y- 1 .0 (clearance location).

/
/
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 )

( b ) Clockwise direction has a negative angle R

For a basic programming example, we use a simple part


shape that is easy to visualize, such as a rectangular shape
with a fillet corner radius - Figure 42-3. CENTER OF
ROTATION = XO YO
%
i
V !

P V
PROGRAM ZERO
15°

(UNCHANGED)

Figure 42-5

Comparison of the programmed tool path Isolid line)


and the rotated tool path I dashed line):
I a ) Program zero included in the rotation

(b) Program zero not included in the rotation

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 .

N7 G68 X-1.0 Y-1.0 R15.0


N8 G41 X-0.5 Y-0.5 D01 F20.0
N9 Y3.0
5.0
N10 X3.5
Nil G02 X5.0 Y1.5 R1.5
Figure 42-4 N12 G01 Y0.5
N13 X-0.5
Part oriented as per program, using the G68 command
COORDINATE ROTATION 401

N14 G40 X-1.0 Y-1.0 M09


N15 G69 (ROTATION CANCELED)
N16 G28 X-1.0 Y-1.0 Z1.0 M05
N17 M30
%

The program is developed for an orthogonal orientation


of the part (= 0° rotation), but machined at 15°. using the
coordinate system rotation option.

In the example, block N8 contains cutter radius offset


G41 Any tool offset or compensation programmed
. will be
included when the coordinate rotation takes place.

Coordinate Rotation Cancel

Command G69 cancels the coordinate rotation function


and returns the control system to its normal orthogonal
condition. Always specify the G69 command in a separate
block, as in the 04201 example.

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.

If there is a short X and/or Y travel on the machining center


and the part is positioned on table at a known angle, PRACTICAL APPLICATION
because of the limited machine travel.

The second very useful example of the co-


application is In many cases, subprograms can be used very efficiently
ordinate system rotation, provided that two major condi- together with coordinate rotation. Applications such as
tions are satisfied: milling polygonal shapes or machining at bolt circle loca-
tions are only typical possibilities. The following detailed
Rotated part must fit within the work area example Figure 42-7 shows a part drawing that looks
in

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

Comprehensive example of coordinate system rotation - program 04202

The main program 04202 will be developed with the aid


of four subprograms. Although some parts may be a little
difficult to understand, one key element is absolutely criti-
cal. In two subprograms will be the following block:

G91 G68 XO YO R51.429

Its purpose is to shift to the next pocket, at an angle. The


XOYO remain the same - they
always be absolute, only
will
the angle will increment, because of the G91.

This example is not only a good illustration of the coordi-


nate system rotation, but also shows more advanced tech-
niques of using subprograms and several additional fea-
tures. Without the advanced programming techniques, the
program could be done as well, but it would take much lon-
ger and it would be virtually impossible to optimize it at the
machine. The complete program that follows (04202) is
heavily documented and should present no problem to fol-
Figure 42-8 low its progress and structure.
Top and front view of the pocket detail for program 04202
COORDINATE ROTATION 403

04202 (COORDINATE SYSTEM ROTATION)

(7 POCKETS - PETER SMID - VERIFIED ON FANUC 15M CNC SYSTEM)


(PARAMETER #6400 BIT #0 - RIN - MUST BE SET TO 1 TO ALLOW G90 AND G91)
(MATERIAL 4 X 3 X 1/2 ALUMINUM PLATE - HORIZONTAL LAYOUT)
(X0Y0 IS CENTER OF 2 0 DIA CIRCLE - Z0 AT THE FINISHED TOP OF THE PLATE)
.

(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 )

N18 G43 Z1.0 HO 2 M08 (Z CLEARANCE FOR SETUP - COOLANT ON)


N19 G01 Z0.02 F30.0 (CONTROLS 0.005 LEFT ON THE POCKET BOTTOM)
N20 M98 P4252 L7 (ROUGH AND FINISH MILLING OF SEVEN POCKETS)
N21 G69 (CANCEL COORDINATE ROTATION IF ACTIVE)
N22 G90 GOO Z1.0 M09 (Z AXIS RETRACT - COOLANT OFF)
N23 G28 Z1.0 M05 (Z AXIS HOME FOR TOOL CHANGE)
N24 M01 (OPTIONAL STOP)

(T03 - 3/8 DIA CHAMFERING TOOL - 90 DEGREES)


N25 T03 (SEARCH FOR TO 3 IF NOT READY)
N26 M0 (T03 TO THE SPINDLE)
N27 G69 (CANCEL COORDINATE ROTATION IF ACTIVE)
N28 G90 G54 GOO X-2.5 Y-2.0 S4000 M03 T01 (XY START POSITION FOR PERIPHERAL CHAMFERING)
N29 G43 Z1.0 H03 M08 (Z CLEARANCE FOR SETUP - COOLANT ON)
N30 G01 Z-0.075 F50.0 (ABSOLUTE DEPTH FOR CHAMFERING Z-0.075)
N31 G41 X-2.0 D53 F12 . (APPROACH MOTION AND RADIUS OFFSET)
N32 Y1.5 (CHAMFER LEFT EDGE)
N33 X2.0 (CHAMFER TOP EDGE)
N34 Y-1.5 (CHAMFER RIGHT EDGE)
N35 X-2.5 (CHAMFER BOTTOM EDGE)
N36 GOO G40 Y-2.0 (RETURN TO START POINT AND CANCEL OFFSET)
N37 Z0.1 (CLEAR ABOVE PART)
N38 XI. 0 Y0 (MOTION TO THE CENTER OF POCKET 1)
N39 M98 P4254 L7 (CHAMFER SEVEN POCKETS)
N40 G69 (CANCEL COORDINATE ROTATION IF ACTIVE)
N41 G90 GOO Z1.0 M09 (Z AXIS RETRACT - COOLANT OFF)
N42 G28 Z1.0 M05 (7. AXIS HOMF. FOR TOOL CHANGE)

N43 X-2.0 Y8.0 (PART CHANGE POSITION)


N44 M30 (END OF MAIN PROGRAM 04202)
%
404 Chapter 42

04251 (POCKET TOOL PATH AT ZERO DEGREES - POCKET 1)


N101 G91 Z-0. 05 (START AT POCKET CENTER - FEED-IN BY 0.05)
N102 M98 P4253 (POCKET CONTOUR - 04253 USED FOR ROUGHING)
N103 M99 (END OF SUBPROGRAM 04251)
%

04252 (SUBPROGRAM FOR MILLING POCKETS)


N201 M98 P4251 D51 F5.0 L5 (ROUGH TO ABS. DEPTH Z-0.230 IN FIVE STEPS)
N202 Z-0..005 (FINISH TO FINAL ABSOLUTE DEPTH Z-0.235)
N203 M98 P4253 D52 F4 . (POCKET CONTOUR - 04253 USED AT FULL DEPTH)
N204 G90 GOO Z0.02 (RETURN TO ABS. MODE AND Z AXIS CLEAR POS.)
N205 G91 G68 XO YO R51.429 (NEXT POCKET ANGLE INCREMENT)
N206 G90 XI. 0 YO (MOVE TO NEXT ROTATED XY AXES START POSITION)
N207 M99 (END OF SUBPROGRAM 04252)
%

04253 (POCKET TOOL PATH AT ZERO DEGREES - POCKET 1)


N301 G41 X-0.2 Y-0.05 (LEAD-IN LINEAR MOTION)
N302 GO 3 X0.2 Y-0.2 10.2 JO (LEAD-IN CIRCULAR MOTION)
N303 G01 XO 225 YO
. (CONTOUR BOTTOM WALL ON THE RIGHT)
N304 GO 3 XO 15 YO 15 10 JO. 15
. . (CONTOUR LR CORNER RADIUS)
N305 G01 XO YO . (CONTOUR RIGHT SIDE WALL)
N306 GO 3 X-0.15 YO 15 1-0.15 JO
. (CONTOUR UR CORNER RADIUS)
N307 G01 X-0.45 YO (CONTOUR TOP SIDE WALL)
N308 GO 3 X-0.15 Y-0.15 10 J-0.15 (CONTOUR UL CORNER RADIUS)
N309 G01 XO Y-0.2 (CONTOUR LEFT SIDE WALL)
N310 GO 3 XO 15 Y-0.15 10.15 JO
. (CONTOUR LL CORNER RADIUS)
N311 G01 XO 225 YO
. (CONTOUR BOTTOM WALL ON THE LEFT)
N312 GO 3 XO 2 YO 2 10 JO.
. . (LEAD-OUT CIRCULAR MOTION)
N313 G01 G40 X-0.2 YO 05 . (LEAD-OUT LINEAR MOTION)
N314 M99 (END OF SUBPROGRAM 04253)
%

04254 (SUBPROGRAM FOR CHAMFERING POCKETS)


N401 G91 G01 Z-0. 175 F50.0 (CHAMFERING DEPTH FOR POCKET AT ABS. Z-0.075)
N402 M98 P4253 D53 F8 . (POCKET CONTOUR - 04253 USED FOR CHAMFERING)
N403 G90 GOO ZO.l (RETURN TO ABS. MODE AND Z AXIS CLEAR POS.)
N404 G91 G68 XO YO R51.429 (NEXT POCKET ANGLE INCREMENT)
N405 G90 XI. 0 YO (MOVE TO NEXT ROTATED XY AXES START POSITION)
N406 M99 (END OF SUBPROGRAM 04254)
43 SCALING FUNCTION

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

The control system applies a specified scaling factor to all


programmed motions, which means the programmed value
of all axes will change. Scaling process is nothing more
than multiplying the programmed axis value by the scaling
factor, based on a scaling center point. The programmer
must supply both the scaling center and the scaling factor.
Through a control system parameter, scaling can be made
effective or ineffective for each of the three main axes, but Comparison of a part reduction Ileft) and magnification (right)
not for any additional axes. The majority of scaling is ap- with a part in full scale (middle)
plied to the X and Y axes only.

It is important to realize that certain values and preset PROGRAMMING FORMAT


amounts arc not affected by the scaling function, namely
various offsets. The following offset functions are not To supply the control unit the required information, pro-
changed if the scaling function is active:
grammer must provide the following data of information:
Cutter radius offset amount ... G41-G42/D Scaling center ... Pivot point

Tool length offset amount ... G43-G44/H Scaling factor ... Reduction or Magnification

Tool position offset amount ... G45-G48/H


The most common preparatory command for the scaling
In fixed cycles, there are two additional situations also function is G51, canceled by ihe command G50:
not affected by the scaling function:

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.

us= where ...


In order to understand a contour shape that is somewhat
more complex, compare the original and the scaled con
I = X coordinate of the scaling center (absolute) tours in an overlay in Figure 43-3. It shows two machine
J = Y coordinate of the scaling center (absolute) tool paths (A and B) and the scaling center C. Depending
K = Z coordinate of the scaling center (absolute) on the scaling factor value, the result will be either path A
P = Scaling factor (0.001 or 0.00001 increment) to A8 or path B 1 to B8.

1'he G51 command should always be programmed in a


Commands related to the machine zero re-
separate block.
turn, namely G27, G28, G29 and G30 should always be
programmed in scaling OFF mode. If the G92 is used for
position register, make sure it is also programmed in scal-

ing OFF mode. Cutter radius offset G41/G42 should be


canceled by G40 before scaling function is activated. Other
commands and functions can be active, including the work
offsets commands G54 through G59.

Scaling Center

Scaling center determines the location of the scaled tool path

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.

O If the tool path A1 to A8 is the original path,

then tool path B1 to B8 is the scaled tool path


about center C, with a scaling factor LESS than 1

O If the tool path B1 to B8 is the original path,


then tool path A1 to A8 is the scaled tool path about
center C, with a scaling factor GREATER than 1

The dashed lines connecting individual points are used


for easier visualization of the scaling function. Starting
from the scaling center C, the line always connects to the
contour change point. The B point is always a midpoint be-
tween the center point C and the corresponding A point. In
practice, it means that the distance between C and B5 and
B5 and A5 is exactly the same.

Scaling Factor

Scaling factor determines the size of the scaled tool path

The maximum scaling factor is related to the smallest


The more advanced CNC systems can be set
scaling factor.
internally through a system parameter - to preset the
-

smallest scaling factor to either 0.001 or 0.00001. Some


older models can only be set to 0.001 as the smallest scal-
ing factor. Scaling factor is independent of the units used in
Comparison of scaled part location based on the scaling center
the program - G20 or G21
SCALING FUNCTION 407

When the smallest scaling factor is set to 0.001 the largest


, Q Using 0.00001 minimum scaling factor:
scale that can be programmed is 999.999. When the smallest
scaling factor is set to 0.00001, the largest programmable mm > Inch = 12.7 mm x 0.03937 . .
.
preferred
scale is only 9.99999. Given the choice, the programmer has = 0.499999 mm ... error of 0.000001
to decide between large scales at the cost of precision and mm > Inch = 12.7 mm x 0.03938
precision at the cost of large scales. For the majority of scal- = 0.500126 mm ... error of 0.000 126
ing applications, the 0.001 scaling factor being the smallest, mm > Inch = 12.7 mm x 0.03936
is quite sufficient. Common terms for scaling factors are: = 0.499872 mm ... error of 0.000 28
1

Scaling factor > Magnification


1 . . .

These examples are rather extreme applications. If a 5%


Scaling factor = 1 No change shrinkage factor is to be applied, for example, the scaling
. . .

factor of 1 .05 (magnification) or 0.95 (reduction) is well


Scaling factor < 1 Reduction
. . .
within the expected accuracy of the final part precision.

If the P address is not provided within the G5 1 block, the


system parameter setting will become effective by default. PROGRAM EXAMPLES
Rounding Errors in Scaling The first example is very simple - Figure 43-4.

Any conversion process should be expected to result in at


least some due to rounding of calcu-
inaccuracies, mainly
lated values. For example, the inch-to-metric conversion
uses the standard multiplying factor of 25.4, which is an ex-
act conversion factor. In order to convert a programmed
value of 1.5 inches to its equivalent in millimeters, the
value in inches must be multiplied by the constant of 25.4:

mm = 1.5 inches x 25.4 = 38.1 mm

The conversion in this case is 100 percent accurate. Now


try to convert the value of 1 .5625 inches:

mm = 1.5625 inches x 25.4 = 39.6875 mm


-
So far, there is no problem. The resulting metric value as
Figure 43-4
shown is also 100 percent accurate within the four decimal
places for normal programming in English units. Drawing to illustrate scaling function - programs 04301 and 04302

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:
.

N9 G02 X2.5 Y0.75 10 J-1.0


N10 G01 Y-0.75
mm > Inch =12.7 mm x 0 039 . . .
.
preferred Nil X-1.25
= 0.4953 inches ... error of 0.0047 N12 G40 Y-1.25 MO
mm > Inch = 12.7 mm x 0.038 N13 GOO Z1.0
= 0.4826 inches ... error of 0.0 174 N14 G28 Z1.0
mm > Inch = 12.7 mm x 0.040 N15 G28 X-1.25 Y-1.25
= 0.5080 inches N16 M30
... error of 0.0080
%
408 Chapter 43

Program 04302 is a modified version of 04301. It in-


cludes a scaling factor value of 1 .05 - or 5% magnification -
and scaling center at X0Y0Z0. KO can be omitted in G5 1

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
%

Program 04303 is more complex. Figure 43-5 is the orig-

inal contour. Figure 43-6 shows contour details with new


scales and depth. Program starts with the smallest scale and
works down. Note the very important blocks N712 and
N7 1 3. Each contour must start from the original start point!

04303 (MAIN PROGRAM)


(SCALING FUNCTION - VERIFIED ON YASNAC 180)
(T01 =1.0 DIA END MILL)
N1 G20
N2 G50 (SCALING OFF)
N3 G17 G40 G80 T01
N4 MO 6
N5 G90 G54 GOO X-1.0 Y-1.0 S2500 M03
N6 G43 Z0.5 HOI M08
N7 G01 Z-0.125 F12.0 (SET DEPTH)
N8 G51 12.0 J1.5 P0.5 (0.5X AT Z-0.125)
N9 M98 P7001 (RUN NORMAL CONTOUR)
Figure 43-6
N10 G01 Z-0.25 (SET DEPTH)
Nil G51 12.0 J1.5 P0.75 (0.75X AT Z-0.250) Scaled contours at three depths

N12 M98 P7001 (RUN NORMAL CONTOUR) N705 G02 X4.0 Y2 5 RO . .

N13 G01 Z-0.35 (SET DEPTH) N706 G01 Y0.5


N14 G51 12.0 J1.5 P0.875 (0.875X AT Z-0.350) N707 GO 2 X3.5 YO RO .

N15 M98 P7001 (RUN NORMAL CONTOUR) N708 G01 X0.5


N16 MO N709 G02 XO YO 5 RO . .

N17 G28 Z0.5 M05 N710 GO 3 X-1.0 Y1.5 R1.0


N18 GOO X-2.0 Y10.0 N711 G01 G40 Y-1.0 F15 .

N19 M30 N712 G50 (SCALING OFF)


% N713 X-1.0 Y-1.0 (RETURN TO ORIGINAL START)
N714 M99
07001 (SUBPROGRAM FOR G51 SCALE) %
(D51 = CUTTER RADIUS)
N701 G01 G41 XO D51 The scaling function offers many possibilities. Check the
N702 Y2.5 F10.0 related control parameters and make sure the program re-
N703 G02 X0.5 Y3 0 RO . .
flects the control settings. There are significant differences
N704 G01 X3.5
between various control models.
44 CNC LATHE ACCESSORIES

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

accessories and require a certain amount of time to under-


o o
stand them well. Many CNC lathes are also equipped with t * t 4
a number of additional accessories that are usually quite
simple to program. Some of the most noteworthy and typi-
1 4 t
cal programmable additions (or features) of this kind tire:
Y/k
Chuck control

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

Tailstock body and quill Chuck Functions


Steady rest / follower rest Although the assigned numbers (normally miscellaneous
Part stopper
functions) may vary for different machines, the program-
ming application is exactly the same. One function cancels
... others as per machine design the other. Typical M
functions related to chuck control arc:

Some of these accessories are fairly common, so it is

worth looking them in some detail and with a few exam-


at M10 Open chuck
ples of their programming applications.
Mil Close chuck

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.

A very few CNC lathe manufacturers offer a programma-


blechucking pressure. If they do, it is in the form of two
non-standard miscellaneous function, for example:

M15 Low chucking pressure


Bored Diameter Bored Diameter Bored Diameter
M16 High chucking pressure CORRECT TOO LARGE TOO SMALL
Figure 44-3

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.

When changing chucking pressure


TAILSTOCK AND QUILL
- manually or through the program -

always make sure the part is safely clamped.


Tailstock is a very common accessory on a CNC lathe. Its
Chuck Jaws main purpose is to support a part that is too long, too large,
or needs to be pressed extra firmly against the jaws, for ex-
This section is not directly related to programming, but ample. in some rough turning operations. A tailstock may
does covers tips useful to the programmer. Most chucks also be used to support a finishing operation of a thin tubu-
have three jaws, spaced 120° apart - see Figure 44-2. lar stock, or to support a part that has a shallow grip in the
jaws, to prevent it from flying out. On the negative side,
tailstock is usually in the way of tool motions, so make sure
to avoid a collision. A typical tailstock has three main parts:
Tailstock body

a Quill

Center

All parts are important in programming and setup.

Tailstock Body

Tailstock body is the heaviest part of the lathe tailstock. It


is mounted to the bed of the lathe, either manually during a
setup, or through a programmable option, hydraulically.
Programmable tailstock normally available only as a fac-
is
Figure 44-2
tory installed option and must be ordered at the lime of ma-
Typical three-jaw chuck for a CNC lathe chine purchase.
CNC LATHE ACCESSORIES 411

Quill Programmable Tailstock

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.

Here is a typical programming procedure to move a tail-


stock towards the part, do some machining and move it
back. Rather than presenting an actual programming exam-
ple, let this procedure serve as a guide - fill-in the M func-
tions required for a particular CNC lathe:

1. Unclamp the body


tailstock
2. Move body forward
tailstock
Figure 44-4
3. Clamp the tailstock body
Typical tailstock for a CNC lathe: 4. Move quill forward into the part
1 1 ) Tailstock body 1 2 1 Quill - OUT (retracted for work change)
(3) Center (4) Quill - IN (in work support position) 5. ... do the required machining operations ...

6. Move quill backward from the part


Quill Functions 7. Unclamp the tailstock body
8. Move tailstock backward
Programming the tailstock quill motion is just about the 9. Clamp the tailstock body
same for the majority of CNC lathes. There are two miscel-
laneous functions that work the same way for a program- Some procedures take certain amount of time to com-
mable and non-programmable tailstock body. The two typ- even if the time is measured in seconds. It is generally
plete,

ical functions are:


recommended to program a dwell function to guarantee the
completion of one step, before the next step starts. A review
of Chapter 24 may help.
M12 Tailstock quill IN or ON = active
M13 Tailstock quill OUT or OFF = inactive Safety Concerns

When programming a job that uses the tailstock, safety is

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.

N17 X15.0 Z3.0 T0800


N18 MO 5 (SPINDLE STOP FOR TAILSTOCK)
N19 M01 (OPTIONAL STOP)

N20 M21 (TAILSTOCK FORWARD)


N21 G04 U2.0 (2 SEC. DWELL)
N22 M12 (QUILL IN)
N23 G04 U1.0 (1 SEC. DWELL)

N24 G50 M17 (NO MAX RPM - SET INDEX FORWARD)


N25 T0100 (SHORT FROM T08 TO T01 WITH M17)
Figure 44-5
N26 G96 S500 M03
Programmable bi-directional turret indexing N27 GOO G42 X3.385 ZO 1 T0101 M08
.

N28 G01 X3.685 Z-0.05 F0.008


In an example, a programmer is working with a lathe that N29 Z-2.5 F0.012
N30 U0.2
has an eight station turret. Tool T01 will be used first, then
N31 GOO G40 X10.0 Z5.0 T0100
tool T08 and then back to tool TO again. There is no prob-
I

N32 M01 (OPTIONAL STOP)


lem to index from TO to T08 or from T08 toTOl. using the
I

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

N39 GOO G40 X15.0 Z5.0 T0200


tion. then from T08 to T01 in forward direction.
N40 MO 5 (SPINDLE STOP FOR TAILSTOCK)
N41 M01 (OPTIONAL STOP)
If the automatic bi-directional indexing is not built in the
machine, it has to be programmed, assuming the control al-
N42 Ml (QUILL OUT)
lows that. Otherwise, in normal programming, when going N43 G04 U1.0 DWELL)
(1 SEC.
from T08 to T01, the indexing motion will pass all other N44 M22 (TAILSTOCK BACKWARD)
which is rather an inefficient method. The next
six stations, N45 G04 U2.0 (2 SEC. DWELL)
example shows how and where to place the functions. M N46 M30 (END OF PROGRAM)
%
CNC LATHE ACCESSORIES 413

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

design of the particular barfeeder.


At the end of the job, T02 is in the active position. That
means M8 has to be programmed at the program begin-
1
The functions controlling chuck opening and closing,
the

ning, to get a short indexing from T02 to T01


the block skip function, the M99
function and several spe-
cial functions, are typical aids and tools available for pro-
Watch how the M 1 M
8 functions are programmed -
7 or 1 gramming barfeeders. Many of these functions had been
their location in a particular block is very important. Either discussed earlier.
function by itself will not cause the turret to index - it only
sets the direction! TxxOO will make the actual indexing. Bar Stopper

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.

Although the tendency on modern CNC lathes is to incor-


porate the automatic turret indexing direction into the con-
BAR
trol system (which means that the control system makes the
TRAVEL
decision), there are some benefits in having the program-
mable method available for special
As an example, think of an oversize tool mounted on the
machining occasions.
T
turret. The tool is perfectly safe, as long as does not index it BAR
the full swing of the turret. Automatic indexing has no pro- STOPPER
vision for such a situation!

With a programmable indexing, the programmer has a ir


complete control. Programming such a setup in a way that v>
c
will never cause the turret to index full 360° at any time is '

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

Bar stopper position for bar travel


BARFEEDER ATTACHMENT
The program is quite simple. It will use the M 1 0 and M 1

Barfeeder is an external attachment to a CNC lathe that


functions, but also another two functions that may or may
not be required for a particular barfeeder. These non-stan-
allows small and medium machined
cylindrical parts to be
dard miscellaneous functions are (in the example):
without interruption, up to the number that can be ma-
chined from a single bar of several feet long. There are
many advantages of using barfeeders, particularly those of M71 Barfeeder ON - start

the modern hydrodynamic design type, rather than the old


M72 Barfeeder OFF - stop
mechanical design. For example, sawing operations are
eliminated (replaced with a much more precise part-off
tool), no soft jaws to bore, unattended operation is possible These functions are only examples and may be different
an extended period of time), stock material
(at least for for a certain barfeeding mechanism or unnecessary alto-
economy and high spindle speeds can be achieved on many gether. Here is the sample program:
models with many other advantages.
414 Chapter 44

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.

helpful to develop a better program:


04403
Tool station (T01 holds the bar stopper (N1
1 )
N1 G20 (TOP OF PROGRAM)
Initially, the chucking of the bar (for each
first piece from the bar) is done manually N81 T0700 (PART-OFF TOOL ACTIVE)
N82 G50 S1500 (LIMIT MAXIMUM RPM)
Spindle rotation must be stopped prior N83 G96 S350 M03 (SPINDLE SPEED)
to the chuck opening N84 GOO X2.2 Z-2.625 T0707 M08 (START POS.)
N85 M73 (PART CATCHER ADVANCE)
All miscellaneous functions related to the barfeeding N86 G01 X-0.01 F0.004 (PART-OFF MOTION)
should be programmed as separate blocks N87 GOO X2.2 M09 (MOVE ABOVE STOCK DIA)
Dwell should be sufficient for the task but
N88 X10.0 Z5.0 T0700 (SAFE XZ POSITION)
N89 M74 (PART CATCHER RETRACT)
not excessive
N90 M01 (OPTIONAL STOP)
These are some general considerations for programming / N91 M30 (CONTROLLED END OF PROGRAM)
N92 M99 (RESTART FROM THE TOP OF PROGRAM)
a bar stopper, but always check the recommended proce-
%
dure for the barfeeder design.

The T07 in the program is a 125 wide part-off tool, part-


.

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

Parts Counter In programming terms, the general structure will be simi-


lar to this format (item numbers correspond the list):
This kind of unattended lathe machining often uses an-
other feature of the control system - parts counter. Parts
04404
may be counted program (usually a user macro), or by
via a
setting the number of required parts on the control system. N
They may also be programmed by non-standard miscella- N. . Txx. .M0 (ITEM 01)
neous functions, for example: N. . GOO X0 Z. (ITEM 02)
N. G98 G01 Z. . F. (ITEM 03)
Count up
N. . G04 U0.5 (ITEM 04)
M88 ... ascending order
N. . M10 (ITEM 05)
M89 Count down . . . descending order N. . GOl Z. F.. (ITEM 06)
N. . G04 U0.5 (ITEM 07)
N. . Mil (ITEM 08)
The number for the count is usually the bar capac-
preset N. . G04 U1.0 (ITEM 09)
ity or the required number of parts from a single bar. The
N. . GOO Z.. (ITEM 10)
programming example at the end of this chapter will illus- N. . X.. Z.. TxxOO (ITEM 11)
N. . G99 (ITEM 12)
trate the counter function and other features.
N
Pull-Out Finger Feel free to modify the program structure to suit the re-
quirements of any unique setup in the machine shop.
As the name suggests, a pull-out finger is a device (CNC
lathe accessory) that grabs and pulls the bar out of the bar-
feeding guide tube (while the chuck a typi- is open). This is PROGRAMMING EXAMPLE
cal method for barfeeders of the 'pull-type'. Normally, the
pull-out finger is mounted in the turret, either as a separate
The following programming example illustrates a com-
‘tool’,or as an add-on to an existing tool, in order to pre- plete program an unattended barfeeding operation, until
for
serve the number of available tool stations. Since these ac-
the number of parts have been machined. The lathe opera-
tivities cannot be used with the spindle rotating, yet they of- tor sets the required number of parts when starting a new
ten need a feedrate, they arc programmed in the G98 mode
bar stock. This program requires a careful study. It does
- feedrate per time (in/min or mm/min). contain some very practical and advanced features, all of

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.
.

N23 G04 U1.0 (1 SEC. DWELL)


1 2. Reinstate the 'feed-per-revolution' mode.
N24 M71 (BARFEEDER ON)
N25 G04 U1.0 (1 SEC. DWELL)
416 Chapter 44

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

Helical milling uses an optional control system feature Helical Interpolation


called helical interpolation. In its simplest definition, heli-
Helical interpolation is usually a special control system
cal interpolation is an operation where a circular interpola-
option that designed to be used for cutting a circle or an
is
tion uses three axes simultaneously. This could be a mis-
arc with a third dimension. The third dimension is always
leading statement because it implies a three dimensional
determined by the active plane:
arc or a circle. Such an arc or circle does not exist anywhere
in the field of mathematics. Yet, it is true that the G02 or In G17 XY plane - the third dimension is the Z axis
G03 circular interpolation command does use all three axes
- for example, In G18 ZX plane - the third dimension is the Y axis

In G19 YZ plane - the third dimension is the X axis


G03 X. . Y. . Z. . . . F. .

I n the active plane G 7 (X Y), the third dimension is the Z


1

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.

In all cases, the third dimension - the third axis motion -


HELICAL MILLING OPERATION will always be a linear motion that is perpendicular to the
active plane.
What exactly is helical milling? Essentially, it is a form of
a circular interpolation programming technique to
- it is a A more formal definition of a helical interpolation can be
machine arcs and circles combined with a linear interpola- made, based on the previous statement:
tion in the same block, during the same motion .

Helical interpolation is a simultaneous


Previous topics that were related to circular interpolation two-axis circular motion in the working plane,
presented one major feature of that subject. In circular in- with the linear motion along the remaining axis.
terpolation, there are two primary axes used within the se-
lected plane, with the intent to program an arc motion or a The three axis motion is always synchronized by the con-
circular motion. trol and all axes reach the target location at the same time.

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:

G02 X.. Y.. I.. J.


G03 X. Y. I.
. J. . .
.

.
F..
F. .
© Using arc centers UK for CW and CCW motion :

© Using radius R for CW and CCW motion :

G02 X. . Y. . R. . F. .

GO 3 X. . Y. . R. . F.

Note that there is no Z axis programmed. As a matter of


fact, if the Z axis were included in the same block as a cir-
cular milling, it will not work - normally. That means it will The plane selection programmed before the helical inter-
not work, unless the control system has a special feature polation block determines which axes will be active in the
called the helical interpolation option. program and what their function will be.

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)

Smoother and more accurate thread generation


Active Circular Linear Arc
(only thread grinding can be more accurate)
Plane motion motion vectors
Combination of thread milling within a single
G17 X and Y Z 1 and J setup eliminates secondary operations

G18 X and Z Y 1 and K Full depth thread can be cut

G19 Y and Z X J and K Tap is not available

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

Applications and Usage J Left hand and right hand threading


has to be done with one tool
Although the helical interpolation option is not the most
External and internal threading has to be
frequently usedprogramming method, it may be the only
done with one tool
method used for a number of rather special machining ap-
plications: Thread deburring minimized or eliminated

Thread milling Gain of high surface finish quality,


particularly in softer materials
Helical profiling
Extended life of the threading tool
Helical ramping
u Elimination of expensive tapping heads
From the three groups, the thread milling is by far the
Elimination of expensive large taps
most common method of helical interpolation applied in
industry and is described next. The last two applications are No need for spindle reversal (as in tapping)

quite similar, although used less frequently and will be de-


Better power rating of the tool versus the cut
scribed later in this chapter as well.
(about 1/5th is not unusual)

One tool holder can accept inserts for


THREAD MILLING different thread pitch size

Reduction of overall threading costs


There are two familiar methods of producing a thread on
a CNC machine. On machining centers, the predominant Thread milling enhances other threading operations, it
method of thread generating is tapping, normally using does not replace them. It uses special threading cutters,
fixed cycle G84 or G74. On CNC lathes, a tap is also used called thread hobs or special multi tooth thread milling
,

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

Thread Milling Tool Clearance Radius

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.

A great deal of influence on thread milling productivity


will be the total length of travel and the selection of cutting
feedrates. A large diameter cutter can cut more efficiently
(heavier feedrates), but cannot fit into confined areas.
Small diameter cutter has the opposite effect - it can be
used in a tight areas, but at lower feedrates. A smaller cutter
may also be used with higher spindle speeds and the corre-
sponding feedrate - the combined effect may shorten the
cutting cycle time.

THE HELIX

The words helical and helix are quite common in CNC


programming and appear in this and other publications
quite frequently. Perhaps it is time to look at the terms relat-
ing to thread milling in more detail.

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

A helix is a machine motion that has four varieties:

Clockwise circular cut with positive linear motion

u Clockwise circular cut with negative linear motion

Counterclockwise circular cut with positive linear motion

Counterclockwise circular cut with negative linear motion

The typical helix illustration in Figure 45-2, shows a


common helix (which is a three-dimensional object) in four
standard views. The helix is shown in these views:

The top view (XY) shows only a circle.

The front view (XZ) shows the helix from the front.

The side view (YZ) shows the helix from the standard
right side view.

The isometric view (XYZ) shows a three-dimensional


appearance of a two-turn helix.

Another view of a helix that is often very useful, is the


flatview (also called the flat layout). This view is com-
monly used to illustrate a helix as a flat object that can wrap
around a cylinder. Figure 45-3 shows a flat layout of a right
hand helix (one revolution). Flat view representation of a right-hand helix.
One revolution of 360° is illustrated
HELICAL MILLING 421

THREAD MILLING EXAMPLE Item 4 is the threading cutter size. Two main characteris-

ticsof a threading cutter must be considered - its diameter


and the pitch of cutting edges (teeth). Selecting a cutter dia-
A thread milling operation on CNC machining centers
meter must be done carefully - it must be smaller than the
can be programmed very efficiently by using the helical in-
bored diameter. Another challenge is to choose a thread
terpolation feature of the control system. The easiest way to
milling cutter that has the correct number of teeth per inch
describe and explain the straight thread milling, is to show
(pitch). The thread mill diameter is more important for in-
an illustrated example - Figure 45-4.
ternal threads but the pitch of threading cutter must be
maintained, regardless of whether the thread cutting is in-
ternal or external.

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

mind that the diameter machined for an internal thread cut-


ting must be smaller than the thread nominal size - just like
predrilling a hole for tapping. That introduces the last item -

Item 6.

Item 6 lists the bored diameter as 2.9000 inches. Why this


number and not other? Remember that the internal thread
depth is established by a common formula. A generic for-
mula to calculate the depth D of an internal thread multi-
plies the pitch by a constant:
~T
0.75
D = PITCH x .54127
_L
If the formula is applied to a 03.000, with 12 TPI thread
(1/12 = .0833333 pitch), the single depth of the thread is:
Figure 45-4

Internal thread milling example - program 04501


.0833333 x .54127 = .0451058

Straight Thread When the formula is applied to the calculation of a pre-


bored diameter, this amount has to be subtracted twice for
The following information is the collected initial data,
the required nominal diameter:
based on the given drawing and the available tools:

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

3. 12 TPI = 12 threads per inch 02.9098 inches.

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

Starting Position Motion Rotation and Direction

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)

1 xn At this point, the tool is in a position when the complete


j\ 360° helical motion can begin. Always try to start lead-in
% / and lead-out arcs at quadrant positions (0°, 90°, 80° and 1

270°). These calculations are much easier to work with.


\/
R1.45 Thread Rise Calculation
THREAD
START/END
Some technical brochures or product catalogues may
Figure 45-7 base their calculations on the helix angle of the threading
insert, but one fact still remains unchanged. The thread
Lead-in and lead-out motions for thread milling example 04501
I top view is shown milling cutter must advance by the distance that is equiva-
lent to the pitch amount in one revolution (360°). If a
lead-in arc is used, only a portion of the pitch is pro-
However, this programming approach would bring the
grammed. The amount of be calculated
linear travel has to
threading cutter into the material straight! Since the cutter
as a ratio per degrees traveled (see previous example). Fol-
has the threading teeth parallel, it would cut a series of
lowing formula is another version of the earlier one. It also
grooves, not threads. This, of course, is unacceptable.
calculates the amount of linear travel, this time based on the
To make a better cut, start with a helical motion for the number of threads per inch (TPI):
lead-in arc. That means adding the Z axis to the circular
motion, in the upwards direction. The amount of the Z tar-
get position must be calculated not guessed. Helical ap-,

proach has to consider the thread pitch and the degrees of


travel on the circumference of the lead-in arc.

isp where ...


The thread pitch in the example is

L, = Linear travel in helical interpolation


1 / 12 = .0833333 =
A Amount of degrees interpolated (angle)
TPI = Threads per inch
and the degrees traveled on the circumference total 90°,
from X0.75Y-0.75 to X1.5Y0.
Milling the Thread
Considering that the thread mill has to advance .0833333
Because of the cutter size and the thread size, two full rev-
for every 360°,it has to advance one quarter of that distance
olutions have been selected to complete the specified
for each 90°.
thread. For each revolution, that is for each 360°, the linear
The calculation of the linear travel can be made from the position of the cutter must be changed by the pitch amount.
following formula: That is the .0833333 value in the example. Thread motion
is a helical milling and either absolute or incremental pro-

gramming method can be used.


- < X Q_

4
|

360 First, the absolute method will be selected, then the incre-
mental method:

os’ where ...


N8 G90 GO 3 XI. 5 Y0 Z-0.8459 1-1.5 (TURN 1)
N9 G03 XI. 5 Y0 Z-0.7626 1-1.5 (TURN 2)
L, = Linear travel in helical interpolation
A = Amount of degrees interpolated (angle) The repetitious data will not appear in the final program.
P = Thread pitch (1 /TPI) For comparison, try to program the two motions in incre-
mental mode:
The advance for 90° in the example will be:
HELICAL MILLING 425

N8 G91 G03 XO YO Z0.0833 1-1.5 (TURN 1) N13 G28 XO YO Z1.0 M05


N9 G03 XO YO Z0.0833 1-1.5 (TURN 2) N14 M30
%
When the two motions are completed, the cutter
helical
had traveled .1666 along the positive direction of the Z axis This program is only a small sample of one thread milling
and the total of 720° (two revolutions). The last part of the method. The calculations are logical and program code is
program will be the ending of the cut. clear. Reading various technical specifications for a thread
milling cutter presents a wealth of information (including
Lead-Out Motions programming tips), suggested by the tool manufacturer.
These recommendations always take on a more important
For the same reason why the tool approached the thread role than any other method.
using helical interpolation over a 90° arc, the exit from the
thread will be treated the same way. This departure from Figure 45-8 illustrates isometric view of the sample
the completed thread (lead-out motion) will move the thread milling program 04501.
threading cutler away from the finished thread, again using
a quarter turn motion that is still in the helical mode. The
calculation is the same as before and so is the amount:

L = 90 x .0833333 / 360
fc

L t = .0208333

This incremental value will bring the tool up and away


from the thread (programmed in absolute mode):

N10 G03 X0 .75 Y0.75 Z-0.7418 R0.75


or (1-0.75 JO)

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:

Nil G40 G01 XO YO


N12 GOO Z1.0 MO
N13 G28 XO YO Z1.0 M05
N14 M30 Figure 45-8
%
Isometric view of tool motions for the thread milling example

The thread cutting job is done and the complete program


can be written. External Thread Milling

The external thread milling is often used for large threads


Complete Program with a carbide indexable threading insert. The lead-in and

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

N12 GOO Z1.0 MO simulation of the helical milling (software is required in


426 Chapter 45

of the helical motions requires a simultaneous three-axis


linear cutting motion, within the acceptable tolerance of
the thread. That means each motion will be a very small
Y and Z axes). The
three-axis linear motion (using the X,
more accurate thread needed, the longer program will be
generated. This method is practically impossible to do
manually, as the development time could hardly be justified

V.
X0Y0

V / in

do
any case. What is needed is

the calculations in a matter of seconds.


turers of thread milling cutters provide
or for only a small cost.
a program software that will
Many manufac-
such a software free

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.

Feedrate selection is similar to the feedrate for outside


and inside arcs described in the Circular Interpolation XI. 4967 Y-0.0697 Z-0. 9304
chapter ( Chapter 29). Since a precision thread is the goal, XI. 4992 Y-0.0350 Z-0. 9298
the cutting feedrate will be 10 to 30 percent slower. A good XI. 5000 Y0.0000 Z-0. 9292
start is at about .001 per tooth and up by experimenting.

What the program output shows is a series of very small


THREAD MILLING SIMULATION METHOD line segments, in a very precise order and increment. Fol-
low at least a few blocks and visualize the actual motion.
There is an interesting way to mill a thread without the By the way, it took about three seconds to generate the 463
benefit of helical interpolation option available on the con- blocks of code in CAD/CAM. Knowing a high level lan-

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

Regardless of the method used to generate the tool path O Example


for thread milling, this is a machining and programming
area that deserves a lot more attention than it normally gets
To illustrate the programming technique for this type of
in many machine shops. milling application, a standard, fiat bottom, 0.500 inch end
mill will beused (there is no need for a center cutting type)
and open the start hole to the 0.750. The pocket depth is
HELICAL RAMPING .250 and in each helical motion the tool will be moved by
.050. The pocket center is X0Y0 and the start Z position
Although the thread milling is probably the most com- (clearance) is .050 above the lop of part (which is the Z axis
mon application of helical interpolation, it is not the only program zero). The total number of helical motions (revo-
one. One very useful application of this control feature is above the top of work, plus another
lutions) is six (one five
called helical ramping. below the top of work).

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-

cutting tool of the center cutting type (using the so called


is
ier to program. The cutting will be done in the climb mill-

slot drill). Well, there is another possibility - helical ramp-


ing mode - program 04502.
-
ing that allows using any flat cutter and reach the required
04502 (HELICAL RAMPING)
Z depth as a series of relatively small helical cutting mo-
N1 G20
tions. The cutter can be flat and non-center cutting, because
N2 G17 G40 G80
all the cutting action is done by the cutter sides, not its bot-
N3 G90 G54 GOO XO YO S700 M03
tom. Once the required Z depth has been reached, a full cir- N4 G43 Z1.0 HOI M08
cular interpolation is often used to clean up after the last N5 G01 ZO .05 F50.0 (APPROACH TO Z- START)
helical cut. A high level CAD/CAM software can do this N6 G41 XO 375 D01 F15.0
. (START COMPENSATION)
very efficiently. N7 G91 GO 3 1-0.375 Z-0.05 (CUT ABOVE WORK)
N8 1-0.375 Z-0.05 (CUT 1 BELCW TOP FACE)
N9 1-0.375 Z-0.05 (CUT 2 BELOW TOP FACE)

XY

xz

Figure 45-10

Schematic illustration of a helical motion used for ramping - program 04502


428 Chapter 45

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,

but cannot be used simultaneously with any kind of


it
comparison of the axis orientation.
cutting motion. This type supports a positioning motion.

A rotary table will also rotate the part that is mounted on it,

but a simultaneous cutting action is possible. This type


supports a contouring motion.

The most common fourth axis on a horizontal machining


center is the indexing type, called the B axis.

INDEXING TABLE (B AXIS)

Indexing axis, as the name suggests, is used to index a ta-


ble, if the machine is equipped with this feature. The hori-
zontal machining centers and boring mills have an indexing
table as a standard feature. A full rotary table is an option
on a both types of machining centers.
Axis orientation differences between vertical
and horizontal machines Units of Increment

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

Direction of Indexing Indexing in Absolute and Incremental Mode


The B axis can be programmed to index either clockwise Just like any other axis, the B axis can be programmed in
or counterclockwise, looking from top down at the table, the absolute mode or incremental mode, with the same be-
which is the XZ plane - Figure 46-2. havior as the linear axes.

The following example is in the absolute mode, showing


two table columns. The first column is the programmed in-
dexing motion in G90 mode, the second column shows the
actual resulting indexing motion (Distance-To-Go) and its
direction. All rotational directions are based on the perpen-
dicular view to the XZ plane.
O Absolute Mode consecutive
- indexes :

Programmed motion in G90 Actual indexing motion

G90 G28 BO Machine B zero position

GOO B90.0 CW 90 degrees


B180.0 CW 90 degrees
-X+ B90.0 CCW -90 degrees
SPINDLE
B270.0 CW 180 degrees

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

B42.0 No motion (0 degrees)


Table Clamp and Unclamp Functions
B-63.871 CCW -105.871 degrees
In order to maintain a rigid setup, the indexing table must
be clamped to the main body of the machine during a cut.
The next table is similar. The first column is the pro-
For indexing motions, the table must be unclamped. This is
grammed indexing motion inG91 mode, the second col-
true of most machining centers. For this purpose, manufac-
umn shows motion directions and the actual resulting
the
turers offer special miscellaneous functions - two functions
absolute position. All rotational directions are based on the
will be used in the examples:
perpendicular view to the XZ plane.
Table Clamp ... for example M78
Table Unclamp ... for example M79
G Incremental Mode - consecutive indexes :

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

Some designs require other M codes, for example to con-


B125.31 CW 755.310
trol the clamping pin or a table ready confirmation. B-180.0 CCW 575.310
The B axis is programmed logically the same way as the
B-75.31 CCW 500.000

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

zero degrees again. That is something to watch. If indexing


(in the incremental mode) takes place twice around, the ab-
Cutter radius offset is not affected by the B axis and is

solute table position will be 720.000°. Indexing twice will


programmed the same way as in vertical machining.

also be necessary in the opposite way in order to reach ab-


The relationship of offsets to the machined face of a part
solute zero. A small example is illustrated in Figure 46-3.
is very important and is also more complex than for the ver-
tical approach.

Work Offset and B Axis

The work offset measured the same as before - from the


is

machine zero to the program zero. What is different now is


the reality of several faces used for machining rather than
just one. That means the tool path for each face has to have
its own program zero, therefore its own work offset. Figure

46-4 shows a typical setting, looking at the part from the di-
rection of the spindle.

G54 (X)
Machine
Zero

B axis direction from B0 to B45.0 in the absolute mode 04601 -

To program two positions shown,


the the typical block
sequence would be, for example 04601:
G54 (Y)

04601
G90 G54 GOO X. . Y. . Z. .

M79
BO
M78
PART
:• w
...

< DRILL HOLE AT BO > TABLE

G90 G55 GOO X. . Y. . Z.


FRONT VIEW
M79 Figure 46-4
B45.0
M78 Work offset for a horizontal application - front view shown

< 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

When changing from one face to another, remember to o


change the work offset. For example, if there are four faces N
to machine, each face will have its own work offset, such as
G54, G55, G56 and G57. The B axis is usually not depend- Q.
ent on work offset, so the best block to program a new off- t-
during the rapid motion. The previous short ex-
o _j
set is first
m o O
ample illustrates the method. The next section describes the V evi O
work offset setting for the Z axis and tool length offset. N N 1-

Tool Length Offset and B Axis Z-298.0

It should easy to understand the concept of multiple work


offsets for multiple faces. Setting the tool length can be -4 c
quite complicated, depending on many factors that influ-
ence the decision. The first factor is the method of setting
tool length. There are at least two methods to set the tool PART h -300.0

length offset. Both have already been covered in Chapter


19, but now they take on a new significance.
TABLE
Touch-Off Method
H = NEGATIVE VALUE
One method is to touch-off the Z0 of the machined face
Figure 46-6
and register the distance from the tool tip as a negative
length offset. This was the preferred method for vertical Touch-off tool length offset method - example with H as negative
machines. The touch-off method may be acceptable for a
Preset Method
small number of tools and indexes. Although it is possible
to select the center of indexing table as Z0, it is not a practi-
Tool length set on vertical machining centers is often a
cal solution. Figure 46-5 shows the principle of touch-off
touch-off method but it could also be the preset method.
setup in general terms, and Figure 46-6 shows a practical
The preset method uses a special tool length presetter
example. Note that the setup is exactly the same as for ver-
device and done off machine. There is a good reason why
is
tical machining. A program block
the preset method is much more practical for horizontal
machining than for vertical machining.
G43 Z2.0 HOI
Recall that one tool normally requires one tool length off-
will move the tool Z-298.0, if HOI is set to -300.0.
Now, consider
set. a very typical situation for a horizontal
machining a single tool has to machine six faces, followed
-

o by other four tools that also do machining on the same six


N
Z faces. Each of the five tools requires a unique tool length
for each face - for the total of 30 different length offsets!
LU a. This is not an isolated example, but there are several solu-
OH
0 < i- tions to such a situation.
tr 111 _i
< _i o
o o All solutions use the preset tool length measurement and
N N 1-
one additional setting. The
mounted into the holder is
tool
placed in the presetting device. Through a computerized
DIST-TO-GO optical reader, the presetter is calibrated to match the ma-
chine gauge line. Then, the tool length is accurately mea-
sured. It is a positive value representing the actual tool
4 C length from its machine gauge line. This is
tool tip to the
the amount be input into the corresponding tool
that will
length offset register. There is only one problem - where is
PART
h H
the relationship of this measured amount to the part posi-
tion? In the touch-off method, the tool touches the part and
the relationship is direct. The preset method has no contact
TABLE
- one additional setting mentioned earlier has to be made.

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

Figure 46-7 Figure 46-9

Preset tool length offset to Z0=face - layout with H as positive Preset tool length offset to Z0=center - layout with H as positive

The last example was measured to the ZO position at the


part front face. Another option exists if ZO is set as the cen-
ter of indexing table. In fact, it is only the perception of a
change, the example is the same in reality. Figures 46-9 and
46-10 show the apparent change from the last two figures.

The setup has changed only because of the additional di-


mension W, specifying the distance from the program zero
to the part face. The Z axis values in the program will also
change, as all dimensions arc taken from ZO at the table
center, not the face of part.

Figure 46-8

Preset tool length offset to Z0=face - example with H as positive

The illustration shows the offset amount entered into the


Z register of G54 work offset as -500.0. This is the distance
from gauge line to part zero. To prove the method works,
use H01=200.0 and the Z clear position as G43Z2.0H01.
The distance-to-go is calculated the same way as always:

G54 (Z) + Z clear + HOI =


= -500.0 + 2.0 + 200.0
= -298.0
Figure 46-10
The tool then continues normally to the Z-15.0 depth. Preset tool length offset to Z0= center - example with H as positive
434 Chapter 46

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

in this case, include the W


distance that must always be
To describe
known during setup (fixture drawing or actual measure- combinations of various setup methods
all

and on the program format is virtually im-


their influence
ment). That makes the W= 150.0, no change for the length
possible. The subject of horizontal machining, particularly
offset HO I =200.0, but an important change to the G54 -
the setup portion, can be quite complex and requires some
now it is measured from the table center (ZO). The Z clear
position includes the W length and the physical clearance experience. The layout presented in this chapter should

of 2 mm, same as in the previous case. In this example, the


offer at least the general understanding of the subject. A
suitable programming example may help.
amount of Z-650.0 for G54 is used:

illustrate how indexing can be used in an efficient way,


To
G54 (Z) + Z clear + H01= the program example in this section will spot drill and drill
= -650.0 + 152.0 + 200.0
= -298.0
612 holes on a cylinder - Figure 46-11. The spot drill will
also break a chamfer of .400 x 45°, measured from the high

The tool then continues normally to the Z- 135.0 depth. spot of the cylinder. All the depth calculations are real.

Overall, this setup application is exactly the same as the


previous one. The operator must know where is Z0 located
for every job. This information always originates from the
CNC programmer in the form of a program comments or -

even better - through a setup sheet.

RETURN TO MACHINE ZERO

In vertical machining, the return to machine zero has


been programmed after every tool in majority of cases. The
return was along the Z axis only. The reason was simple -
on a vertical machining center, Z axis machine zero is syn-
chronized with the automatic tool changer. This is not the
case on a horizontal machining center.

Due to its design, the required machine zero return mo-


tion before each tool change is along the Y axis. In all other
respects, programming of the machine zero commands is
exactly the same.

Here is a comparison of a typical ending before a tool


change for the two machine types:

Vertical: G9i G28 zo

Horizontal: G9i G28 yo zo

The question is what is the Z axis return doing in the


block when only the Y return is required. The answer is a
one word - safety. Although only the Y axis is required to
make a successful automatic tool change, the tool has to be
away from the part at the same lime. The return along the Z
axis makes it easier. Of course, programming only a suffi-
cient clearance in the Z axis would also achieve the same
goal. That may prove more difficult than it appears. With Practical example for indexing using subprograms - example 04602

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 %

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) .

N205 Y13.75 L16 (16 MORE HOLES IN Y PLUS)


N206 G80 GOO Y6.875 (MOVE UP BY PITCH)
N207 G90 Z275.0 (CLEAR Z)
N208 G91 B10.0 (ROTATE BY 10 DEGREES)
N209 G99 G83 R-148.0 Z-15.84 Q7 0 (1 HOLE) .

N210 Y-13.75 L16 (16 MORE HOLES IN Y MINUS)


N211 M99 (END OF SUBPROGRAM 04652)
%

The initial level of Z275.0, used in all three programs, is

reasonable for safe indexing. To select a suitable Z axis


clearance is very important and knowing the indexing table
size and the size of its corners is imperative. For the record,
the table for this job will be 400 x 400 mm square with 50 x
Figure 46-13 50 mm corners. The part setup is concentric with the index-
Flat cylinder layout - both ends shown for subprogram development ing rotation and there are no interfering elements.
436 Chapter 46

Figure 46- 14

A typical multi sided part suitable for a horizontal machining operation - program 04603 (subprograms 04653 and 04654)

COMPLETE PROGRAM EXAMPLE


04653 (SUBPROGRAM FOR 8 HOLES AT 148 MM BCD)
N101 X74.0 YO
A typical part for a horizontal machining center requires N102 X52.326 Y52.326
material removal from several sides in the same setup. Such N103 XO Y74.0
a part, a type of a housing, is shown in Figure 46-14. N104 X-52.326 Y52.326
N105 X-74.0 YO
For the example, only the holes will be machined at three N106 X-52.326 Y-52.326
two drills and a tap
different faces. For the tools, a spot drill, N107 X-0 Y-74.0
will be used. The first step is to decide where to locate pro-
N108 X52.326 Y-52.326
N109 M99
gram zero. For the ease of programming and setup, the cen-
%
ter of each bolt circle and the front of each face (Z) is a
good selection. Each face will have its own work offset - 04654 (SUBPROGRAM FOR 6 HOLES AT 99 MM BCD)
G54 for face A, G55 for face B and G56 for face C. The N201 X49.5 YO
second step is to develop two subprograms for the for the N202 X24.75 Y42.868
hole locations. All dimensions have been calculated accu- N203 X-24.75 Y42.868
rately but no details are necessary. First tool is in the spin- N204 X-49.5 YO
dle at startup. The part is located in a fixture mounted on
N205 X-24.75 Y-42.868
N206 X24.75 Y-42.868
the indexing table. Pallet changing has been omitted from
N207 M99
the example, but is explained in the section that follows.
%
The subprograms contain bolt pattern coordinates.
HORIZONTAL MACHINING 437

04603 (MAIN PROGRAM) N51 G80 Z300.0


(FACE A = G54 = BO = 8 HOLES) N52 M79
(FACE B = G55 = B90.0 = 6 HOLES) N53 B270.0
(FACE C = G56 = B270.0 = 6 HOLES) N54 M78
N55 G56 X49.5 YO Z10.0
(T01 - 15 MM DIA SPOT DRILL) N56 G99 G84 R5.0 Z-23.0 LO
(T02 - 8.4 MM TAP DRILL) N57 M98 P4654 (TAP FACE C)
(T03 - M10 X 1.5 TAP) N58 G80 Z300.0 M09
(T04 - 11 MM DIA DRILL) N59 G91 G28 YO ZO M05
N60 M01
(T01 - 15 MM DIA SPOT DRILL - ALL HOLES)
N1 G21 (T04 - 11 MM DIA DRILL)
N2 G17 G40 G80 N61 T04
/N3 G91 G28 ZO N62 MO
/N4 G28 XO YO N63 M79
/N5 M79 N64 BO
/N6 G28 BO N65 M78
/N7 M78 N66 G90 G54 GOO X74.0 YO S800 M03 T01
N8 G90 G54 GOO X74.0 YO S868 M03 T02 N67 G43 Z10.0 H04 MO
N9 G43 Z10.0 HOI M08 N68 G99 G81 R2.0 Z-20.3 P200 F225.0 LO
NO G99 G82 R2.0 Z-5.8 P200 F150.0 LO N69 M98 P4653 (DRILL FACE A)
Nil M98 P4653 (SPOT DRILL FACE A) N70 G80 Z300.0 M09
N12 G80 Z300.0 N71 G91 G28 XO YO ZO M05
N13 M79 N72 M30
N14 B90.0 %
N15 M78
N16 G55 X49.5 YO Z10.0 Only a few comments to the example. Both the main pro-
N17 G99 G82 R2 0 Z-5.3 P200 LO
.
gram and the two subprograms are quite plain. Compared
N18 M98 P4654 (SPOT DRILL FACE B) to verticalmachining applications, the Z axis safety clear-
N19 G80 Z300.0
ance may seem a little too high with Z300.0 programmed
N20 M79
before each indexing. Large clearances are for safety - they
N21 B270.0
N22 M78 allow the part and the indexing table to index within a safe
N23 G56 X49.5 YO Z10.0 area, without any obstacles in the way. It is not convenient
N24 G99 G82 R2 0 Z-5.3 P200 LO
. to actually calculate the minimum Z clearance, but it is im-
N25 M98 P4654 (SPOT DRILL FACE C) portant that it is far enough for all faces. A CAD software
N26 G80 Z300.0 M09 can help here quite a bit. Other features and programming
N27 G91 G28 YO ZO M05 techniques are the same as used elsewhere in the handbook.
N28 M01

(T02 - 8.4 MM TAP DRILL) AUTOMATIC PALLET CHANGER - APC


N29 T02
N30 MO
N31 G90 G56 GOO X49.5 YO S1137 M03 T03 One of the greatest concerns in CNC machining is the un-
N32 G43 Z10.0 H02 M08 productive time required for the initial part setup and re-
N33 G99 G83 R2 0 Z-24.8 Q6 0 F200.0 LO
. .
mounting the part when running a batch job. Many features
N34 M98 P4654 (TAP DRILL FACE C) incorporated in the control system or the machine design it-

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.

Although a two pallet system is the most customary for


horizontal machining centers, designs with up to twelve
pallets are not uncommon.

Working Environment

For a typical dual pallet changer, two major areas should


be distinguished:

Machining area ... within the machine

Setup area . . . outside of the machine

One pallet is in the machining area, the


normally located
other in the setup area. When
program starts, it normally
a
starts with Pallet # (with the part) located in the machining
I

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

Pallet Also popular is the shuttle type. This design incorporates


double rails between the load area and the receiver inside
Machine locator
the machine - Figure 46-16. Its programming is still simple
Transfer System but more involved than for the rotary type.

Pallet is the portable work table with a ground surface to


which we mount the fixtures and parts. The table can have
T slots, tapped holes or both.

Machine locator (also known as a receiver) is a special


device located inside of the machine. Its purpose is to ac-
cept and lirmly hold the pallet loaded with a part ready for
machining. Its design must be very robust and accurate at
the same time.

Transfer system (also known as a pallet loader) is the sys-


tem that transfers pallets between the load area and the
machine work area.

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

There are two general types of pallets, based on their


Typical shuttle type of a pallet changer
transfer system:

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

Y axis ... column


M60 Automatic Pallet Changer (APC)
Z axis ... spindle quill

This command works properly only when the pallet posi-


W axis ... table traverse

tion is at one of two machine reference points: B axis ... indexing or rotary table

Machine return to the primary reference point


Settings are similar to a machining center, plus the W
G28 axis. During setup, typical work offset values will be set as:

G30 Machine return to the secondary reference point


G54 X = Negative
Y = Negative
Z = Zero
G28 command a familiar command. G30 command
is is
W = Negative
used exactly the same, except it moves the selected axes to B = Zero
the secondary machine reference position.
As many horizontal boring mills do not have an auto-
Pallet Changing Program Structure matic tool changer, the G30 position should be set conve-
niently for the operator to perform a tool change manually
The following program emphasizes changing the pallet
(X,Y,W axes). This position is set by a system parameter. Z
on a typical shuttle pallet system. It can be easily adapted to axis value is the length of quill travel out of the spindle.
a rotary pallet system. In both cases, one pallet is in the ma-
chining area, the other is in the setup area. Programming format is based on the principle that all
motions into the depth arc done in the axis, rather than W
04604 the Z axis. The quill that is controlled by the Z axis, is
G91 G28 XO YO ZO pulled out only for clearance purposes; its extension from
G28 BO the spindle must be long enough to guarantee enough clear-
M60 (LOAD PALLET 1)
ance for the shortest tool used in the program.
<... machining on Pallet 1 ...>

Typical programming format is followed by a more de-


G91 G28 XO YO ZO
G28 BO tailed explanation, [nn] lines are for reference only and
M60 (UNLOAD PALLET 1) match the comments that follow:
G30 XO [11]
M60 (LOAD PALLET 2) [01] 04605 (PROGRAM NAME)
<... machining on Pallet 2 ...> [02] (MESSAGE OR COMMENT)
[03] N10 G21
G30 XO
[04] N20 G91 G30 WO
M60 (UNLOAD PALLET 2)
[05] N30 G90 S. M03 .
M30
[06] N40 G54 GOO X. Y. . .
% N50 G30 ZO
[07]
[08] N60 G43 W. H. . .

HORIZONTAL BORING MILL [22]


[09] N70 G01 W. F. . .

[ 10 ] . . .

. . .

The chapter on horizontal machining would not be com-


[ 12 ] . . .< machining >
plete without at least some comments relating to the ma-
[13]
chine called a horizontal boring mill. A CNC boring mill is
. . .

[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 ] . . .

Six work offsets ...G54toG59 . . .

[23] . . .
Two machine reference points ... G28 and G30
[24] N600 M30
[25] %
440 Chapter 46

The following comments reference the line identification [14]


[12] . . (
machining the part ) . .

numbers in the example: [13] ...


...

[
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

(incremental motion for safety) of tool length offset

05 Selection of absolute mode and spindle functions 1 19 ]


Rapid motion to the tool change position along the X
[ ]

[
06 ]
Rapid motion to the starting position in XY within and Y axes - in incremental mode for safety

the G54 work coordinate system [ 20 ]


Manual tool change
[ 07 ]
Quill pulls out by the value of parameter 1 241 (Z) [21 ] ...
08 Tool length offset (set from the tool tip to the ] 22 ] ... (additional machining, following the above format .
.
[ ]

program zero) and motion to the clearance level [ 23 ]


. .

[
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

wonders, but it is a method that will not disappear any time


Both factors can be adapted simultaneously in a single
soon. Writing a part program manually requires time and is
program - they are fully compatible. It is unreasonable to
always subject to errors. Manual work means work by
expect any industry or world-wide standards relating to the
hands, so it seems that a need for special computer skills is
various techniques of developing a program. It may be even
not required. Is that a correct assessment?
less reasonable to %et any company based standards, unless
way, a program can be written with a
In the traditional there is a general set of rules and recommendations already
pencil and a paper (and a five pound eraser, as an old car- in existence.

toon claimed). Its final form is transferred to the control


The final result is that the first guiding factor - company
unit, a shortprogram may be keyed into the system directly,
standards - is replaced by the second factor - personal style.
by pressing various keyboard keys. For long programs, this
From an objective point of view, there is nothing wrong at
approach is a waste of time. The modern alternative to a
allwith a personal style of programming. If the program
pencil is the keyboard of a computer, using a simple text
works, who cares how it was done. From a revised point of
editor to make a plain ASCII text file, with no formatting.
view, it needs to be acknowledged that a CNC programmer
The computer creates a CNC program as a file stored on the
can never succeed in isolation. Programming involves at
hard drive. This file can be printed or send directly to the
least one user of the final program - the CNC operator - and
CNC machine. The only difference is that the computer
that makes it. in effect, a team work.
keyboard has replaced the pencil and the editing features of
the text editor have replaced the eraser. Even today, a great The most common problem with uncontrolled personal
amount of manual programming work in is still done in styleis inconsistency. Any CNC machine shop that em-

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

In the early years of numerical control, special program-


o LETTER 0
ming forms were popular with pre-printed columns for 1 DIGIT ONE
each address in the block. Those were the days when only
the numerical values were entered into the appropriate col- I LETTER 1

umn and the column position itself determined the address


2 DIGIT TWO
meaning. These programming forms were often issued by
control and machine manufacturers, as an aid to program Z LETTER Z
writing and a little promotion on aside. Today, a ruled sheet
of a standard size paper is fully sufficient. No special col- Figure 47-1
umns needed and if a column or two is justified, it can
are
Special form of characters written to prevent ambiguity
be drawn easily enough. Modern programs use alphanu-
meric representation, writing the whole word - alpha char- The illustration in Figure 47-1 shows some suggested
acters as well as numeric characters and special symbols. methods of common character distinction in handwriting.
This process is much more economical, hardly any ma- Find a personal way to write any characters that may im-
chine manufacturers print programming forms any more. prove handwriting legibility. Regardless of which method
is selected as personally preferable, adhere to it - be consis-
CNC programmers in some companies do not necessar-
tent. There nothing worse than adopting different ‘stan-
is
ily do the final program version themselves. Many manag-
dards’ for every new program. The programmer or the per-
ers consider such work a secretarial responsibility. That
son who prepares the program final version, will be more
means somebody else (a clerk or an assistant) will read the
than confused and eventually may make a serious error.
hand written copy and has to be able to read it correctly, the
way it was intended. Such a person may have absolutely no Handwritten method can be bypassed entirely by keying
knowledge of CNC programming and may not be able to in the program data via control keyboard. The program can
detect even simple syntax errors. then be optimized, the part machined and verified program
sent out when the job is finished. This procedure may tie up
Confusing Characters the machine for a while and is not recommended as an eve-
ryday method of inputting programs into the control sys-
The legibility of programmer’s handwriting is very im-
tem. The best and fastest method is to prepare the program
portant. Make a special effort when writing certain charac-
in a text editor on a computer and send it directly to the
ters (alphabetical or numeric) that can be interpreted in
CNC machine, through a cable connection.
more than one way. Depending on personal handwriting,
some characters can be confusing to the reader. For exam- The majority of CNC users today do not use a punched
ple, a handwritten letter O and digit 0 can look the same. tape anymore, and if they still do, it is usually for old ma-
Digit 2 and the letter Z can be also confusing. The letter I chines only. More modern methods are available, such as
and the digit as well as a low case letter / are other exam-
I disk storage of a desktop or laptop computer. Through an
ples. These are only some of the most obvious examples, interface between the computer and the machine, data can
but many other characters can also be confusing, depend- be transferred either way very reliably, thus eliminating the
ing on each person’s handwriting. Try develop a consis-
to punched tape and other methods altogether. Whichever
tent writing technique to distinguish potentially confusing method is selected as preferable, the program still has to be
characters (confusing is a relative term, of course). properly formatted.
WRITING A CNC PROGRAM 443

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 :

paper or screen of the computer. It will evaluate four ver-


sions of the same program. Identical in every respect, ex- N1G20
cept the outward appearance. Feel free to be the judge as to N2G17G40G80G49
which of the four format versions is the most suitable and N3T01M06
why. A rather long program is presented - intentionally - N4G90G54G00X-3 25Y0S900M03T02 .

this is an actual program. It is not important what it does,


N5G43Z1.0H01M08
N6G99G82X-3 25Y0R0 1Z- 0 39P0500F8
. .
only how it looks when printed or displayed. Each new ver-
. .

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 .

G90G54G00X-32500Y0S900M03T02 N15G28Z1 0M05 .

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 . . . .

YO N35X3 25Y3 .25


.

Y-32500 N36X0
XO N37X-3.25
X32500 N38Y0
G80GOOZ10000M09 N39Y-3.25
G28Z10000M05 N40X0
M01 N41X3.25
T03M06 N42G80G00Z1 0M09 .

G90G54G00X-32500Y0S600M03T01 N43G2 8X3 2 5 Y- 3 2 5Z1 0M0 5


. . .

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 .

N6 G99 G82 X-3.25 YO RO.l Z-0.39 (HOLE 1)


N7 X3.25 Y3.25 N7 X3.25 Y3.25 (HOLE 2)
N8 XO N8 XO (HOLE 3)
N9 X-3.25 N9 X-3.25 (HOLE 4)
NIO YO NIO YO (HOLE 5)
Nil Y-3.25 Nil Y-3.25 (HOLE 6)
N12 XO N12 XO (HOLE 7)
N13 X3.25 N13 X3.25 (HOLE 8)
N14 G80 GOO Z1.0 MO
N14 G80 GOO Z1.0 M09
N15 G28 Z1.0 MO N15 G28 Z1.0 MO
N16 MOl N16 MOl
N17 T02 MO
N18 G90 G54 GOO X-3.25 YO S750 M03 T03 (T02 11/16 TAP DRILL - THROUGH)
-

N19 G43 Z1.0 HO 2 M08 N17 T02 MO


N20 G99 G81 X-3.25 YO RO.l Z-2.2563 F12 .
N18 G90 G54 GOO X-3.25 YO S750 MO 3 T03
N21 X3.25 Y3.25 N19 G43 Z1.0 HO 2 MO
N22 XO N20 G99 G81 X-3.25 YO RO.l Z-2..2563 F12.0
N23 X-3.25 (HOLE 1)
N24 YO N21 X3.25 Y3.25 (HOLE 2)
N25 Y-3.25 N22 XO (HOLE 3)
N26 XO N23 X-3.25 (HOLE 4)
N27 X3.25 N24 YO (HOLE 5)
N25 Y-3.25 (HOLE 6)
N28 G80 GOO Z1.0 M09
N26 XO (HOLE 7)
N29 G28 Z1.0 M05
N30 MOl N27 X3.25 (HOLE 8)
N31 T03 MO N28 G80 GOO Z1.0 MO
N32 G90 G54 GOO X-3.25 YO S600 M03 TOl N29 G28 Z1.0 MO
N33 G43 Z1.0 H03 M08 N30 MOl
N34 G99 G84 X-3.25 YO RO 5 Z-1.3 F37.5
.

(T03 - 3/4-16 PLUG TAP)


N35 X3.25 Y3.25
N36 XO N31 T03 MO
N37 X-3.25 N32 G90 G54 GOO X-3.25 YO S600 MO 3 TOl
N38 YO N33 G43 Z1.0 HO 3 MO
N39 Y-3.25 N34 G99 G84 X-3.25 YO RO 5 Z-l..3 F37 5 . . (HOLE 1)

N40 XO N35 X3.25 Y3.25 (HOLE 2)

N41 X3.25 N36 XO (HOLE 3)

N42 G80 GOO Z1.0 M09 N37 X-3.25 (HOLE 4)

N43 G28 X3.25 Y-3.25 Z1.0 M05 N38 YO (HOLE 5)

N44 M30 N39 Y-3.25 (HOLE 6)


N40 XO (HOLE 7)
%
N41 X3.25 (HOLE 8)
N42 G80 GOO Z1.0 MO
This version is much improved. It uses all improvements
N43 G28 X3.25 Y-3.25 Z1.0 MO 5
of the previous version, yet adds a significant improvement
N44 M30
- spaces between words. Still, it is difficult to visually iden-
%
tify the start of a tool. The next version will add a blank line
between tools. The spaces do not impose an extra drain on The final version (Version 4) may be a luxury for some
the CNC memory, yet the program is much easier to read. users, but it is the most elegant of adds initial de-
all four. It

scriptions and messages to the operator. It includes pro-


© Program Version 4 :
grammer’s name and the date of the last update. It also in-
cludes the description of all tools at the program beginning.
(DRILL-04. NC)
It also uses the same tool descriptions for individual tools,
(PETER SMID - 07 -DEC-01 - 19:43)
at the beginning of each tool section, where it matters most.

(TOl - 1.0 DIA - 90DEG SPOT DRILL)


Some lower level controls do not accept comments in the
(T02 - 11/16 TAP DRILL - THROUGH)
(T03 - 3/4-16 TPI PLUG TAP) program. If there are comments in the program, such a con-
trol system will strip them automatically during loading.
WRITING A CNC PROGRAM 445

LONG PROGRAMS To illustrate some of the shortcut methods, compare the


two following examples - both will have the same results -
well, almost the same results:
Those who ever worked with a punched tape, used to run
the program directly in a reel-to-reel operation. The maxi- 04701 (TYPICAL PROGRAM)
mum program length was the maximum length of tape that N10 G21 G17 G40 G80 G90
fitted on the reel, about 900 feet - or 275 meters - or 08000 1
N20 G54 GOO X120.0 Y35.0
characters. With today's modern equipment, there is no N30 G43 Z25.0 HOI
need for a tape anymore, most part programs will run from N40 S500 MO
memory of the CNC system. Unfortunately, that memory N50 MO
capacity is finite as well, often well below what the tape ca- N60 G99 G81 X120.0 Y35.0 R3 . 0 Z-10.0 F100.0
N70 X150.0
pacity used to be. It all means that a situation may arise,
N80 Y55.0
when a particularly long program will not fit into the mem- N90 G80 GOO Z25.0
ory. In addition to a good directory cleanup, there are two N100 MO
other possibilities to eliminate this problem. N110 G28 X150.0 Y55.0 Z25.0
N120 M30
Program Length Reduction %

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:

Eliminate all unnecessary leading or trailing zeros


04702
(GOO = GO, X0.0100 = X.01, ...)
G90 GO X120. Y35
Eliminate all zeros programmed G43 Z25. HI S500 M3
for convenience (ex.: X2.0 = X2.)
M8
G99 G81 R3. Z-10. F100.
Eliminate all or most of the block numbers X150
Y55
If using block numbers, increments
G80 Z25. M9
by one will make a shorter program
G91 G28 XO YO ZO
Join several single tool motions into
M30
a multiaxis tool motion, if safety allows %

Use default control settings, but check them first A total of 54.12% of the program length have been saved

Do not include program comments


in a rather very short program. Shortening the program
and messages to the CNC operator length may become useful in some cases, so here are sev-
eral methods that have been used in the above example:
Use comments and various descriptions on
a separate piece of paper Program description has been eliminated

Block numbers have been eliminated


Organizing the programming process will definitely help
- for example, include as many instructions in a single G21, G17 and G54 have been eliminated
block as possible, rather than dividing them into many indi- (correct settings assumed on the control - be careful !)

vidual blocks. Use subprograms if possible, use fewer tool


Zeros following a decimal point in a
changes, even fewer tools, if that is possible, etc. At the
full number have been canceled
same time, watch for undesirable side effects when elimi-
nating or deviating from an established program format. Some blocks were joined together

There is no doubt that many of these measures will result


G80 GOO has been replaced by G80 only
(GOO is redundant, although commonly used)
in some compromise between convenience and necessity.
When thinking well ahead and organizing the work prop- Leading zeros in GOO, M08, M09, HOI,
erly, the results will be worth the effort. and M03 have been removed

Machine zero return has been changed


These methods are shortcuts and should be used for emergency
from absolute mode to incremental mode
situations only, not as standard programming procedures.

... Keep in mind, this is a no-frills program


446 Chapter 47

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-

reasons. If machining conditions allow, these two motions


nect the computer with the CNC is also required. The com-
can be combined into one. The G43 and G54 commands
puter may be a ‘abandoned’ slower computer from the of-
fice - all that is needed is a minimum configuration, nothing
can work together in the same block, without a problem:
fancy. On the software side, an inexpensive communica-
tions software is necessary, to send the program from the
G90 GO G43 G54 X120. Y35. Z25. HI S500 M3
computer to the CNC and back.
Always be careful to consider the setup and guaran-
first
Once everything is configured to work together, store the
tee a safe approach towards or away from the part. If any
obstacles come in the way because of the shortcut, the con-
CNC program or programs on the hard disk of a personal
computer, load the software and work with the CNC sys-
densed example would be a wrong programming method.
tem as usually! The major difference is in editing. Since the
Program preparation and its actual writing will become a program actually resides on the hard disk of the PC, use the
routine very soon after establishing a personal program- computer and a text editor to edit the CNC program, not the
ming style. If using a computer, learn how to write the pro- control system. The capacity of current hard drives is
gram directly at the keyboard - it is a waste of time to write x-times more than will ever be needed. Aircraft companies,
it by hand first. It may lake a little time getting used to, but it mold shops, tool and die shops and other industries that re-
is well worth it. quire extremely long programs have embraced this tech-
nology a while ago, and very successfully, loo.
Memory Mode and Tape Mode
Also consider this method for the High Speed Machining
Most CNC system have a special Mode Switch selector to programs. This relatively new technology uses very high
choose from at least two options - the MEMORY mode and spindle speeds and feedrates but very small depths of cut.
the TAPE mode. The Memory mode is used the most This combination means extremely long programs, many
frequently - program is loaded into the CNC memory, it is that will not fit into any memory configuration of any CNC

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

During the program preparation, quite a number of vari- DATA FILES


ous pieces of documentation will accumulate. All sketches,
calculations, setup sheets, tooling sheets, job descriptions,
A complete part program is not only a hard copy of the
instructions to the operator and related notes contain valu-
program or the program data (usually stored on a disk). The
able information. This information should be stored as part
examples of the important documents mentioned here are
of the program documentation folder. Any changes to the
all a vital part of the program. They create a set of all files
finished program at a later date, for whatever reason, can be
used for programming, called the data files.
done much easier if the documentation is complete, well

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.

Machine operator gets copies of relevant files only


A simple definition relating to program documentation
can be presented: These two rules guarantee that the ultimate responsibility
for the program remains with the CNC programmer. There
Program documentation is a set of all records is no need to duplicate every piece of documentation for the
necessary to retrace the program development machine shop - only those items that relate to the actual
machining have a place in the shop. Unnecessary duplica-
Many CNC programmers, even machine shop supervi- tion is counterproductive and should be avoided. The only
sors,underestimate the importance of good program docu- items of documentation needed in the machine shop are:
mentation. Their main arguments are that the paperwork is
Part drawing
not worth the time, that it lakes too long to collect all docu-
ments and prepare the documentation, that it is essentially a Program printout
nonproductive effort, etc. These arguments are true, to a
Setup sheet
point - in order to make a good documentation, yes, some
time will be required. Not an excessive amount of time, but Tooling sheet
enough time to do a good job. If there are prepared blank
forms available, they just need to be filled. It does not take The part drawing serves as a reference for comparison of
any more lime than writing the same information on any the intended shape, dimensions, tolerances, etc., with the

other piece of paper - it can actually take a lot less time. If a


actual product. Only the drawing version that was actually
used for programming should be considered. The program
CAD system is available, use it to develop a customized
tooling library and setup sheet. A variety of blank forms
printed copy is the program listing made available to the

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.

The difference between an external and internal program


The biggest advantage of internal documentation is the
documentation deserves some explanation. Is one better convenience offered to the machine operator. The only dis-
advantage is that when loaded into the CNC memory, the
than the other? Which one should be used?
comments do occupy memory space. If the available mem-
The best documentation is the one that combines both ory is scarce, be modest with program comments and place
types for maximum effect. To distinguish between the two more emphasis on the external instructions. All program
types, let’s evaluate them individually. comments, messages, directions and instructions must be
enclosed in parentheses:
External Documentation
(THIS IS A COMMENT, MESSAGE OR INSTRUCTION)
External documentation of a CNC program generally
consists of several items and always of their latest version -
This is the required program formatting. Either comment,
this last statement is very important. message or instruction can be an individual block in the
program or it can be part of a program block. The control
The following items are typical to any program docu-
system will ignore all characters between the parenthesis.
mentation. They can be used as desired:
To avoid long descriptions internally, use pointers to exter-

Program copy printout nal documentation instead - for example:

Methods sheet, if available


N344 ...
Part drawing
N345 MOO (SEE ITEM 4)
N346 ...
Working sketches and calculations
The ITEM 4 in the program comment section will be a
Coordinate sheet
detailed description that relates to block N345, somewhere
Setup sheet program documentation, such as in a setup sheet.
else in the
This kind of reference is useful when the message or com-
Tooling sheet
ment would be too long to be stored in the program body.
Program data (disk or other media)
For example, the CNC operator may find the referenced
Special instructions
ITEM 4 in the setup sheet, under the heading of Special In-
structions:
The program copy printout is the final version of the
programming process. It should be the exact contents of the
program stored on a disk or other media. In those machine ITEM 4. - Remove part, clean the jaws, reverse and
shops that use routing or methods sheets, the programmer clamp on the 120 mm diameter
should make it a policy to include a copy of the methods
sheet in the documentation as well. Part drawing (or its
Properly prepared internal documentation should always
copy) is extremely important to be kept together with the briefly describe each cutting tool used:
program. It is the ultimate reference source in the future.
All sketches and calculations, together with a sheet of coor- N250 TO
dinates, are also useful at a later date, particularly if the pro- N251 MO
gram has to be revised for some reason. The setup sheet and (T03 = 1 INCH DIA 4-FLT E/M)
the tooling sheet will be discussed shortly. N252 ...

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

comment is written as a separate line, the block


If the dividual operations. The tooling sheet usually
lists only the

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.

do. Distinct messages translate into a time saving by the


The ongoing question many programmers always have
CNC operator or the setup person and they contribute to a
reminds one of a Catch 22 situation:
quicker turnaround between individual jobs.
‘Do I make the setup sheet and the tooling sheet before or
Program Description after writing the CNC program?'
On many Fanuc systems, program description can also As is usual in many programming applications, adherents
be documented. This is a special kind of a comment, also and foes can be found on both sides of the issue. The favor-
included in parentheses. There are some conditions that ite reasoning for making the documentation before writing
make the program description special. a single line of a program is quite simple. The setup sheet
and tooling sheet are the guiding forces for writing the pro-
The description must be included in the
gram, the forces of being well organized. Adhering to this
same block as the program number
method implies a well organized programmer or a team, it
The description must have no more than 1 5 characters implies that everything is under control. It also suggests
that all fixtures and tools and holders and inserts and other
Low case characters will not be accepted
tools are already available in the machine shop, ready and
A typical example of program description may include a waiting to be used. No doubt, if possible, always make
drawing name and/or number in the comment section: both, the setup sheet and the tooling sheet, before starting
the program. The logic behind the reasons for this method
04801 (FLANGE-DWG. 42541) is very strong indeed.

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

The freedom programming is considerable but it is not


in sheet may have to be donefor every machine or at least for
unlimited. A normal part program cannot be written with- every machine type. A very simple setup sheet is shown in
out knowing the machine setup and the tooling to be used. Figure 48-1. Feel free to improve it as necessary.
In many cases, the nature of the job offers many solutions.
Even if the exact setup or the exact tool to be used are not
,
Setup Sheet
known, think of some ideas, have some opinions - but have Program reference: Dale: Programmer. Sheet:

ideas and opinions based on experience. The compromise


ANGLE BRACKET 07-Dec-01 Peter Smid 1 oM
does not rest with the 'now or later’ situation, it rests in the TOP FRONT
selection of the most likely possibility. If something has to - G54 X L-_ i —
A
be changed, make sure the changes will be minimal. In any
case, it is quite possible that the setup sheet and/or the tool- f
ing sheet will have to be modified after the program has
been proven and optimized.

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

The main purpose of a setup sheet is to document all de-


a separate set of data, that may or may not fit on the setup
sheet. If the setups and tools used are constantly simple, it
tails of how the part is mounted on the machine. That
part holding method and reference
may be more convenient to have only one sheet, describing
means it has to cover the
them both. However, for large or complex setups, making a
point relationships (part, machine, and the cutting tool). It
separate tooling sheet is more practical. Both, the setup
has to describe the positions of auxiliary devices used, for
example, a tailstock, a barfeeder, a vise, a face plate, hard
sheet and tooling sheet, are part of the same documentation
and complement - not replace -
each other.
and soft jaws, and many others. A master form for a setup
PROGRAM DOCUMENTS 451

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:

Machine and program identification

Type of the cutting tool

Tool coordinate data

Tool diameter

Insert radius and the tip number

Offsets associated with the tool Figure 48-3

Simple coordinate sheet form - only basic data shown


Tool length

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.

Basic speed and feed of the tool

Tool holder description


DOCUMENTATION FILE FOLDER
Tool number and/or tool station number
All records that have been collected during program pre-
Special instructions paration are quite likely important enough to be kept for fu-
ture reference. They may be stored allover the place, some-
In addition to the most common items, also include any
times very hard to find. So, now is the time to put them all
unique information in the tooling sheet, for example, to in- together and organize them. It is time to make a file folder,
form the operator about non-standard tools, tools that re- identify it, fill it up and store it properly.
quire modification, premachined condition of the material,
etc. An example of a simple tooling sheet is in Figure 48-2. Identification Methods
Tooling Sheet Before some better methods of identifying program doc-
Program reference: Date: Programmer. Sheet:
umentation can be suggested, think about a very popular,
ANGLE BRACKET 07-Dec-01 Peter Smid 1 of 1
yet quite an impractical method. Some programmers use
T# Tool Description Tool0 RPM Feed h.. |
a. the program number as a reference for all related material.
T01 12 mm Spot Drill 8.7 1650 100.0 H01 — The basic thinking behind this idea is that the available pro-
T02 7.5 mm Drill 70 [1800 220.0 H02 — gram number range between and 9999 will take forever to
1

T03 10 mm End Mill - 4 flute 10.0 1210 300.0 H03 D03


use up, therefore becomes very useful for other purposes.
Thisis a shortsighted thinking, usually by not a very busy

programmer who has only one machine to take care of.

Look at possible problems with this thought. True, to


make almost ten thousand programs for one machine, it
would take 'almost forever'. Even if more machines are
available, at a rate of 25 programs a week, numbers will run
Figure 48-2 out in a little more than 7 years. Is that the time to scrap the
Simple tooling sheet form - only basic data shown machine and buy a new one? And if 25 programs a week
seems a bit steep, remember that each program will have to
Coordinate Sheet have a number. That may be three or more separate opera-
tions for a single job, there may be dozens and dozens of
The idea of a coordinate sheet is not new. It has been used
subprograms that also need their own program number. So
in programming from the beginning and it was mentioned
the figures are not so unreasonable after all, and some
in this handbook many times already. A simple printed
better method should be sought from the beginning. It
form containing the X, Y and Z axes can be used for both
could be a manually generated method, or a comprehensive
machining centers and lathes. Figure 48-3 shows an exam-
computerized database.
ple of a simple coordinate sheet.
452 Chapter 48

The point of this evaluation program number is that all


Operator's Suggestions
assignment (with the exception of subprograms), should be
When the CNC machine operator runs the job, he or she
left to the CNC operator, if possible. That means, another
may have comments, ideas, corrections and variety of other
way has to be found to identify the documentation contain-
suggestions. It may be a good idea to consider establishing
ing all records.
computer database, or a similar
a log book, a card system, a

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.

be for example - P000000I. the next program would be


-
If using any kind of computer media for storing the part
P0000002, etc. If the zeros are removed from this format,
programs, make sure they are safely stored in a separate
the files will not be listed in a correct alphabetical order on
container, rather than the Magnetic devices
file folder itself.
a computer display. No practical limit is imposed. The sec-
are particularly sensitive to adverse conditions
and should
ond approach would be to use the drawing number as the
be stored away from any heat source and magnetic field
basis of documentation identification. This may a good
(including a telephone, for example). They should be kept
method for the many companies that are not jobbing shops.
in a dry and dust free environment. Keeping duplicates (or
Dealing with many different customers also means dealing
even triplicates) in a separate place is also a good and safe
with many different types of drawing numbers. The variety
procedure. A very practical - and much less bulky - is stor-
may be so great that it is almost impossible to find some
age of proven programs on a CD (Compact Disk) or a DVD
common ground for standardization. Another variation on
(Digital Versatile Disk), using a special recording hardware
the same theme is a job number, rather than a drawing num-
and software. Although these disks still require to be stored
ber. In many jobbing shops, each job gets a number the mo-
away from all heat sources, they are not a subject of mag-
ment the order is received. This Job Number is always
netic fields.
unique, therefore a good candidate to be used as the num-
ber identifying the program documentation. program documen-
Individual sheets or pages of the part
tation should be eithernumbered consecutively, or have a
Hopefully, the presented ideas will stimulate many addi-
reference number on each page. Drawers of the filing cabi-
tional ideas that will suit a particularwork environment.
nets should be identified as to their contents. These are
There are no given rules on the methods of identifying an
common enough requirements, but very often ignored all
individual program; there are no rules governing the stan-
together, usually because there is no time. The main phi-
dard of part program documentation. The old reliable rule
losophy behind an orderly filing system is the speedy ac-
is always use the old fashioned common sense that is often
cess to a required program that provides instant and accu-
not so common. Common sense and foresight help any
rate information.
standardization effort. The quality of any standard is meas-
ured by its usefulness in the future. For the longer period of
time a particular standard can be useful, the better quality
of thought has gone into its development.
49 PROGRAM VERIFICATION

When the program is completed, there will be a written Preventive Measures


copy or a file copy stored somewhere on a computer. Now,
All errors should be detected and corrected by the pro-
the program development is completed. It may be a perfect
program with no errors. Of course, that was the intent from grammer, who has taken a certain amount of preventive
the beginning - to make an error free program. What hap-
measures. The first preventive measure is to get organized.
Set up procedures, set up standards, set up rules. Then, fol-
pens if - in spite of the best efforts - there is an error? Even a
low them diligently. Errors that can be found before the
small typing error can cause a severe problem when the
program runs on the machine. Could an error be prevented? program is used on the machine are numerous. Yet, it takes
And if so, how ? some techniques to become successful in their detection.

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.

guarantee that the program is error free, but when it does


The second method can be used when working with other
leave the programmer's desk, the effort should be to make it
programmers. Ask a co-worker to look through any new or
error free. All programs arriving at the machine should gain
changed program. Do not be surprised to see mistakes such
the confidence of CNC operator. The operator should be
a check can reveal. A fresh, detached, and impartial look is
free to concentrate all efforts on proving the program se-
often very productive. Sometimes, even taking a little break
quences and run the first part. The operator has no time to
or fresh air first will rejuvenate the brain cells.
check for program errors that could - and should - have
been detected in the office. To do all program proving on With a computer and a special simulation software, there
the machine is very nonproductive and should be avoided. is a third option - make a graphic representation of the tool
path, either on the screen or on paper.
DETECTION OF ERRORS A major part of preventive measures is finding syntax er-
rors. A syntax error is one that can be detected by the con-
Before an error of any kind can be corrected, it must be trol unit. For example, if a dollar sign appears in the pro-

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

help eliminate errors in a CNC program are of two types:


uncover it. An error that is found at the machine slows
down production. It forces the machine operator to take
Preventive measures ... proactive measures corrective measures and eliminate the error. The operator
Corrective measures ... reactive measures can take one of two actions. One will be to return the pro-
gram programmer, the second action will be to cor-
to the
Preventive measures are those that all parties involved rect the error at the machine. Which choice is belter de-
should participate in with suggestions and constructive pends on the seriousness of the error. An error can be soft or
criticism. On the other hand, corrective measures require hard. A soft error is one that does not require stopping the
certain skills, knowledge, and even authority. program from being processed by the CNC system.

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.

Whenever a program has been changed machine,at the


AVOIDING ERRORS
the program documentation must reflect these changes,
particularly if they are permanent. Even a small permanent The goal of every programmer is to write error free pro-
change should be always be documented in all copies of grams. That is almost impossible, since any human activity
program documentation. is subject to errors. Programmers with all levels of experi-

ence make mistakes, at least once a while.


GRAPHIC VERIFICATION Since the prevention of errors should be the main goal of
any programmer, this section looks at the subject in more
Programming errors can be costly, even if their cause is a depth. The most common mistakes will be evaluated, along
minor human error. Omitted minus sign, a misplaced deci- with suggestions to prevent, or at least to minimize, their
mal point, an illegal character - all arc minor oversights that happening. First, what exactly is a program error?
cause major errors. Although a visually checked program
should be error free, that may not always happen. The hu- Program error is the occurrence of data in a program
man eye is weaker when it evaluates nongraphic elements. that will cause the CNC machine to work contrary
to the intended plan or not to work at all.
One of the most reliable methods of part program verifi-

cation is a graphic display of the tool path as it appears in


All errors can be classified into two groups:
the program. Almost all errors relating to the tool path can
be detected early, by one of three available graphic verifica- Syntax errors
tion methods.
Logical errors
PROGRAM VERIFICATION 455

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-

ter Y in a lathe program, it will reject it as a syntax error and


the program won’t The same result will happen when
run.
There are three errors in the 04901 example. Try to iden-
the letter U is programmed for most milling controls. Some tifythem before studying any further.
other letters cannot be used with either system - for in-
The first error should be easy - a tool offset is missing. In
stance the letter V - it is an illegal character for most milling
the block N2, tool T0400 is selected without an offset. This
and turning controls. Yet, is very legal character in a four
it
block is correct. Block N 1 1 is the return to the indexing po-
axis wire EDM control. sition and the tool offset cancellation, which was never pro-
Syntax errors also occur if valid characters are used in
grammed. The error is in block N4 - it should be:
combination with an option not supported by the control. A
N4 GOO G41 X12.0 Z0.1 T0404 M08
good example is a custom macro, an option on most Fanuc
controls.Custom macro uses a number of standard letters,
The second is rather hidden and requires a trained
error
digitsand symbols, but also a number of special symbols,
eye to spot Note that a block skip symbol was used in
it.
for example a sharp sign #, brackets ], asterisk *, etc. [
blocks N5, N6 and N7. When running the program with the
Macros also use special words, such as COS, SIN, GOTO setting of the block skip function ON, the cutting feedrate is

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

Logical errors are more serious than syntax errors. A 04902


logical error is defined as an error causing the machine tool (EXAMPLE WITHOUT ERRORS)
to act in a way contrary to the programmer's intentions. If a
N1 G20 G40 G99
N2 G50 S2500 T0400 M42
motion is programmed to the absolute coordinate of X .0, 1

N3 G96 S530 M03


but program states X 10.0, the control will go ahead but the N4 GOO G41 X12.0 Z0.1 T0404 M08
tool position will be wrong. The same error will happen / N5 G01 X-0.06 F0.012
when Z 10.0 is programmed, although the intent was X 0.0. 1
/ N6 GOO ZO .

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

COMMON PROGRAMMING ERRORS represent a serious error.

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’

parts for one batch is not productive either.


Wrong! Every CNC programmer should make an effort
to be in constant touch with the actual production. In the Generally, there are two groups of CNC programs, each

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

formed about what is actually going on in the machine


Program integrity
shop. It is in programmer’s interest to know how the CNC
operators feel about the program, the programming style
and the approach to programming overall. Do exchange

457
458 Chapter 50

These two considerations are equally important - if only Control Settings Check

one of them is weak, the final result is not satisfactory. Al-


ways aim at the highest level in either category. Also keep Is the coordinate setting registered (for G54 to G59)
in mind that the setup integrity has to be established again
Are all the offsets entered correctly
with each run in the future. Hie program integrity has to be
established correctly only once. Is coolant necessary

What is the status of the BLOCK SKIP switch


Setup Integrity
Is the optional program stop M01 active (ON)
The machine setup is only a general description of the
Is the DRY RUN off if the part is mounted
type of work actually done to get the CNC production go-
ing. The whole process covers the setup of the cutting tools, Do you start with a SINGLE BLOCK mode set to ON
as well as the part setup and many related tasks. No single Do you start with spindle speed and feedrate
check can ever cover all points that have to be consid-
list overrides set to LOW
ered during a CNC machine setup. The major look here is
at the most important considerations, in a form of a brief
What is the status of MANUAL ABSOLUTE switch
(if applicable)
check list. Adjust the individual points according to the ma-
chines and CNC systems in the shop. Adjust the list to re- Has the position read-out on the screen been set
flect personal working methods and/or programming style. from zero (origin preset)

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)

Cutting Tools Check Is the coolant tank filled

a Is the chuck and tailstock pressure set correctly (turning)


Are the tools properly mounted in holders
Has the machine been zeroed before running a job
Are the proper inserts used - is the read-out set to zeros
(radius, grade, chipbreaker, coating)
Is there enough pressure for the air attachments
Are all the tools the right size (air hose, etc.)

Are the tools placed in the proper magazine station


Program Integrity
Are the offsets set correctly
(set zero to unused offset values) Any new and unproved program is a potential source of

Is there an interference between individual tools


problems. In manual CNC programming, mistakes are a lot
more common than in a CAD/CAM program. A good way
Is the boring bar properly oriented (milling) to look at a new program is through the machine operator’s
Are all the tools sharp
eyes. Experienced CNC operators take a direct approach
when running a new program - they take no chances. That
does not mean the CNC programmer is not to be trusted - it
Part Setup Check
simply reflects the fact that the machine operator is ulti-
mately responsible for the expected quality of the work and
Is the part mounted safely is aware of it. He or she has a sense of great responsibility.

Whether the damage to the part or even the scrap is caused


Is the part properly oriented on the table (milling)
by the program or for some other reason is a little consola-
Is the projection of the part from tion when the work is rejected.
the chuck safe (turning)
What does the CNC operator look for in a new part pro-
Is the part lined up for squareness (milling)
gram? Most machine operators would agree that the first
Are the clearances sufficient and the most important thing is the consistency in program-
ming approach. For example, are all tool approach clear-
Are all the clamps away from the cutting path
ances the same way as always? If not - is there a reason? Is
Is the machine at its start (home) position the basic programming format maintained from one pro-
before you press Cycle Start gram to another program and from one machine to an-
other? A good operator scans the written program twice -
Does the tool change take place in a clear area
once on the paper copy, the second time when the program
CNC MACHINING 459

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.

STEP 7 - Make a trial cut


The CNC
machine operator usually starts a new job by
studying the documentation included with the program, An actual trial cut may be required in order to establish
mainly the drawing, setup sheet and tooling sheet. The next whether the programmed speeds and feeds are reasonable
few steps describe the standard setup procedures that will or not and if the various offsets are set properly. Trial cut is
vary occasionally, but generally, they will remain the same a temporary or an occasional cut that is designed to identify
for most jobs. minor deviations in the offset settings and allows their
change. Make sure the trial cut leaves enough material for
STEP 1 -
Set the cutting tools actual machining. Trial cut also helps to establish tool off-
sets to keep dimensional tolerances within limits.
This first step uses the tooling sheet or the tooling infor-
mation from the part program. The CNC operator sets the STEP 8 -Adjust the setup
cutting tools into their holders and respective tool stations
and registers all toolnumbers into the control memory. At this point, any necessary adjustments are finalized in

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.

The fixture that holds or supports the part is mounted on STEP 9 -


Start the production batch
the machine, squared and adjusted, if necessary, but the
part is not mounted at this point. Setup sheet serves as the A full batch production can now. Again - a quick
start

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

and accurate, and offers a lot of confidence before actual


Place the part into the fixture and make sure it is safely machining. This test can be done with a variety of override
mounted. Check for possible interferences and obstacles in modes in effect, for example. Machine Lock or Single
the setup. This step represents the end of the most initial Block. Do not underestimate features such as Zero Axis Ne-
steps of CNC machine operation. glect and Dry Run, when testing a new program.

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

easier to follow. Experiment with new cutting materials


CNC MACHINING 461

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

Even with the best planning, things can go wrong, at least


Consider upgrading the CNC system
occasionally. What happens machine shop when the
in a
only CNC machine is suddenly out of commission? Of
This check list is a typical sample only, although devel- course, this never happens, except when a rush job is just

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.

program upgrading (optimization), the rea-


In contrast to Usually a job programmed for a specific machine and a
is

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

MACHINE WARM UP PROGRAM N18 G28 XO YO


/ N19 M30
N20 G04 P1000
Any precision equipment guaranteed by its manufac-
is N21 M99 P5 (REPEAT FROM BLOCK 5)
turer to work accurately not only if it is handled properly, %
hut also if it operates within a certain environment. Com-
puters - CNC systems included - are particularly sensitive The example is simple in structure, yet well thought out.
to rapid changes in temperature, humidity, dust level, exter-
There are several intentional programming techniques con-
nal vibrations, etc. All potential hazards are clearly speci-
tained in the sample program:
fied in the manufacturers’ literature. Every CNC operator
The whole program is in the incremental mode
knows from experience that the part precision depends a
great deal on the spindle temperature. Some ultra high pre- The first motions are to the machine zero

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

repeated every day in the winter months, it may be worth to


Each repetition of the program starts at block N5
automate it. A short program will do the job.
Several program versions can be developed, depending
To write such a program is simple, but there are several
on the machine and the type of work expected on that ma-
important points to consider. First, make sure that the ma-
chine. For example, if developing a warm up program for a
chine motions will always be in the area where there is no
possibility of a collision. This program will be used with
CNC lathe, incorporate functions that are typical to a CNC
lathe - example, changing the gear range, moving the
for
many jobs and modifying it every time a new job is set up is
tailstock in and out, opening and closing the chuck jaws,
not an option. Another point to consider is the spindle
doing a tool change, etc. On a horizontal machining center,
speed in r/min. Avoid programming an excessively high
include the indexing table motion; on a boring mill, the in
r/min - a tool mounted in the spindle for the warm up could
and out spindle quill motion may also be programmed.
have a small or large diameter. To make the program to re-
Modify the program to suit any particular purpose, but keep
peat itself indefinitely, use M99 function at the end. Pro-
in mind its goal - to warm up a machine that had been idle
gram also function M30 program end, but with a
for the
for a relatively long period of time in a cold temperature.
block skip symbol [ / ]. When
warm up is to terminate,
the
Also keep in mind the safety of operations - the goal is a ge-
simply turn the block skip switch off. All machine motions
neric program for a specific machine type, a program that
will be completed and the program will end naturally.
can be used with all jobs, without modifications.
The example 05001 is a typical warm up program for a
milling system and uses English units. The program can be CNC MACHINING AND SAFETY
easily adapted to any other machine:

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

N2 G40 chapter of this handbook. The programmer has to apply


N3 G91 G28 ZO safely at the programming level, the operator at the CNC
N4 G28 XO YO machine, and so on. Many companies have established
N5 S300 M0 numerous safety rules and procedures that work well. Fol-
N6 GOO X-10.0 Y-8.0 low them and try to improve them.
N7 Z-5.0
N8 S600 Generally, the safety concerns of a machine operator are
N9 G04 P2000 almost the same as those operators running conventional
N10 X10.0 Z5.0
equipment. Safety starts with a clean work place and organ-
Nil Y8.0
ized approach to programming, setup and machining.
N12 S750
N13 G01 X-5.0 Y-3.0 Z-2.5 F15.0 Many do’s and don’ts can be itemized, but no list will sat-

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

Personal Safety Do not alter design or functionality of


the machines or controls
Wear suitable clothing (tucked-in shirt,
buttoned-up sleeves) Electrical or control maintenance should
be done by authorized personnel
Remove watches, rings, bracelets, and
similar jewelry before machine operation Do not use a grinding machine near the
CNC machine slides
Keep long hair under a net or tied up
Do not use a welding equipment on CNC
Protect your feet by wearing approved safety shoes
machine under power
Protect your eyes - wear approved safety glasses li Behave responsibly - do not engage in
with protective side shields at all times pranks and horseplay around machinery

Wear an approved safety helmet if that is


These are only some common sense suggestions, not a
the company policy
comprehensive list for CNC machining safety.
Always protect your hands - never reach
towards the part while the spindle is rotating Always observe the company safety policies,
as well as safety laws of a particular jurisdiction
In some cases, protection may also be needed
for head and ears, perhaps even nose

Never remove cutting chips by hand,


SHUTTING DOWN A CNC MACHINE
with or without gloves on

Do not use rags or gloves around moving


When the CNC machine is not used for an extended pe-
or rotating objects
riod of time, it should be shut down. Many users assume
that shutting down a CNC machine means just to turn the
When lifting heavy objects, ask for help, power off. There more than that
is to shutting down a ma-
use a crane or do not lift
with a power switch.
chine tool

Machine Environment Safety


Emergency Stop Switch
Make sure the floor is swept, free from oil, water,
chips, and other hazards The purpose of the emergency switch is to stop all ma-
chine motions immediately regardless of the current opera-
,

Check the walkways, so they are not blocked


tionalmode. When pressed, it will lock in place and must
from any direction
be rotated manually in the opposite direction to release. It
See whether all the material is safely stored and should be used sparingly and only in real emergencies,
finished parts are in proper containers such as when:

Machine Tool Safety An imminent situation that is unsafe to


the human being is about to occur
Do not remove guards and protective devices
An imminent collision of the machine
Read and follow operating manuals tool elements is about to occur

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

Use only a suitable coolant mixture, and keep


WARNING!
the coolant tank clean at all times
Although the emergency stop switch disconnects
Never use a file for breaking corners or a sand paper all power to the machine axes, the electrical power
for surface polishing during the program execution is still supplied to the CNC machine.

Deburr sharp edges before handling a part


For a complete safety shut-down, always follow proper
Stop all machine power for maintenance procedures as enacted by company policies.
Do not operate a faulty machine
464 Chapter 50

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

position will be always different. To maintain a CNC equipment is a professional disci-


pline of own. In general, it is better to leave any kind of
its

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

A completed CNC program, debugged and optimized for RS-232C INTERFACE


the best performance, should be stored for future use or ref-
erence. Before such a program can be stored, it must be first
Data transfer between two electronic devices (computers
loaded into the CNC memory, tested
and optimized. There
and controls) requires a number of settings that use the
are many ways of loading the completed part program into
same rules for each device. Since each device may be
the CNC memory. The most basic, and also the most time
manufactured by a different company, there must be a cer-
consuming, method is to simply key in the program at the
tain independent standard that all manufacturers adhere to.
machine directly, using the control panel and the keyboard. The RS-232C is such a standard - the letters RS stand for
Without a doubt, this is also the least efficient method,
Recommended Standard'. Almost every CNC system, a
prone to errors. It is true, that Fanuc controls offer a feature
computer, a tape puncher and tape reader, has a connector
called Background Edit. This is a standard feature on the
(known as a port) that is marked RS-232C or similar. This
majority of controls that allows the CNC operator to key in
port exists in two forms, one with a 25 pin configuration,
(and/or edit) one part program, while the control runs the
the other with a 25 socket configuration. The one with the
machining operations for another part program. In practice,
pins is known as the DB-25P connector, the one with the
however, the majority of operators simply don’t take ad-
socket as DB-25S connector (male/female respectively).
vantage of this feature for various reasons.
Figure 51-1 illustrates the layout.

In order to load a part program into the CNC memory or


unload a program from the CNC memory, a hardware con-
nection called a data interface is needed. An interface is
usually an electronic device that is designed to communi-
cate with the computer of the CNC unit.
Typical interfaces and storage media are:

Tape reader and tape puncher Figure 51-1

Data cassettes Typical 25-pin RS-232C port - DB type

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

feet long (about274 meters) in a single roll, manufactured


Since the beginning of the numerical control technology, to exact standards. The most useful descriptions and di-

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.

A punched tape is fragile and often It can get dirty


bulky.
easily, but it had been very popular.economical to use
It is

and is still available (although the price per roll could be


high). The ma jority of new CNC machines do not have tape
reader any more. Used older machines may have it. Many
of these old controls accept tape only as an input device, not
to run the job from the tape. The tape only loads the CNC
memory. Changes to the program can be done through the
CNC and a corrected tape may be punched out later.
Tape Reader and Puncher

One of the original facilities for data transfer was a tape


reader built into the old NC and CNC machines. Its func- Punched tape detail - basic dimensional standards

tion CNC machine is quite different than on the early


on a
Paper tape is generally available in black color, for its
non CNC equipment. Rather than using the tape reader as
100% opacity was required by most tape readers. Tape ma-
the source for running the program, the tape reader on a
terials other than paper are also used, such as Mylar®,
CNC machine is used to load the program stored on a paper which a paper tape sandwiched between two layers of
is
tape into the system memory. Once loaded, the program is
plastic. The
plastic makes the tape stronger, which is an im-
executed from the memory, in the Memory mode setting,
portant factor when the tape is to be used constantly, for ex-
and the paper tape is no longer needed. There is one great
ample, in a reel-to-reel operation. An aluminum - or metal -
weakness with this method. Working on a CNC machine
tapes are also available. Both types of tape, Mylar® and
often means some inevitable changes to the program after
metal, are relatively expensive and are used only for critical
ithad been loaded. Since these changes cannot be readily
jobs and long programs. This was typical to the aircraft, de-
reflectedon the tape, there can be confusion at a later date,
fense, nuclear and mold industries. Many companies also
possibly when the job is repeated. This is an organizational
used the durable tape material for storing programs that
problem and can be resolved relatively easily.
have been proven on the machine.
One option is to make all the necessary changes and cor-
The punched tape is generally available in a roll form, al-
rections on the CNC unit, then punch out a new tape, using though a folded strips version may still be available. It has
the RS-232C port. The difficulty of this approach is that
two main purposes:
while a built-in tape reader was common, a built-in tape
puncher was virtually non-existent. A significant amount To store the program data for use at a later date
of money had to be spent on an external portable tape
puncher, that usually incorporates the tape reader anyway, To serve as a media for transferring the program data into

and causing duplication.


the control system via a tape reader
INTERFACING TO DEVICES 467

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.

On ISO tapes (even format), a pair of punched codes rep-


resenting parenthesis identifies a section that is not to be
processed by the control system. Whatever information is

contained between the parenthesis will be ignored by the


control. This is a section that may include program com-
ments; they will appear in the hard copy printout, but will
not be processed when the tape is read.

Blank Tape

Blank tape is the tape purchased and is completely free of


any holes. Often, it may be overprinted with directional ar-
rows, to indicate the feeding direction or the top of tape.
The new blank tape is sometimes called a virgin 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

end (trailer) of a punched tape, to make it easier to handle.


The blank section also provides protection to the coded
Tape coding standards section when the tape is stored rolled up.
Even parity (ISO) on the left, odd parity (EIA) on the right
Significant Section
Even of the punched tape corresponds to the Inter-
parity
national Standards Organization coding, called ISO in a The section of punched tape that contains the program
common abbreviation, formerly known as the ASCII code data is often called the significant data section. Another

(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

The occurrence of a carriage return (caused by the


first
Non-printable Characters
Enter key on a computer keyboard) is the first occurrence
Most program characters stored on a punched tape will
of the end-of-block character. This signal identifies the be-
print normally. They are called the printable characters and
ginning of the significant data section - section where the
include all capitals A to Z, the numerals 0 to 9, and most
actual program is stored. The significant data section is ter-
symbols. Although alpha numerical characters are print-
minated by a stop code, identified usually by a percent sign,
able, these symbols cannot be printed:
acting as the end-of-file character. When the stop code is
read by the reader, tape reading is completed. That is why Stop code in EIA format
no information is ever placed past the percent sign.
Delete character

Leader and Trailer Carriage return (or Enter key)

The blank section of a punched tape is used as a leader Line feed

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.

Tapes can be damaged if placed into the tape reader in-


correctly. Long tapes require more care than short tapes.
Grease and dust are the worst enemies of paper tapes and
should be guarded against. Any tape that is to be used many
times over, should be duplicated or even triplicated.

DISTRIBUTED NUMERICAL CONTROL


Example of readable characters on a punched tape
port RS-232C on a CNC machine
The Input/Output (I/O)
These special characters are actual punched holes repre-
is used send and receive data. The external sources are
to
senting real characters, namely letters, digits and symbols,
usually a hard disk or a paper tape. In many shops, pro-
rather than tape codes. An end-of-block character or the
grams are transferred through the means of DNC, which
stop code may not be used in the readable section, if that
means Distributed Numerical Control. The control has fea-
section will go through the tape reader.
tures available to make data transfer possible.
INTERFACING TO DEVICES 469

To communicate between one CNC machine and one Parity


computer using the RS-232C port, all equipment required
Parity is a method of checking that all transmitted data
is a cable between the two devices and a software. To com-
were sent imagine what would happen if
correctly. Just
municate with two or more machines, using the same sin-
some characters or digits of a CNC program were not trans-
gle RS-232C port, each machine must be connected to a
ferred correctly or not transferred at all. Parity can be even,
split box with a cable. The split box is available with two or
odd, or none, and even is the most common selection for
more outlets, selectable by a switch. This is the simplest
CNC communications.
form of DNC. It requires well organized procedures to
make it work efficiently. DNC is not a part of the control
Data Bits
unit and is not covered here. Commercial packages DNC
are available at various levels of sophistication and cost. A an acronym for Binary digit, and is the smallest
bit is
unit that can store information in a computer. Each binary
Some DNC software also allows a useful feature called
digit can have a value of either one (1) or zero (0). One and
‘drip-feeding’, which is a method used when the program
is too large to fit into the CNC memory.
zero represent the ON and OFF status respectively, so a bit
is something like a toggle switch that can be turned on and
off as needed. In the computer, every letter, digit, and sym-
TERMINOLOGY OF COMMUNICATIONS bol used in the CNC program is represented by a series of
bits, eight bits to be precise, that create a unit called a byte.

Communications have their own terminology. There are


many terms, but five terms are commonly used in CNC: Start and Stop Bits

Baud Rate To prevent


loss of data during communication, each byte
is preceded by a special bit called the start bit, which is low
Parity
in voltage level signal. This signal is sent to the data receiv-

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.

rates are only available in fixed values. Typical rates for


older Fanuc controls are 50, 00, 200, 300, 600, 200,
Many terms exist in communications. With growing in-
1 1 1 0, 1

terest, this is a very rich field to study.


2400, 4800 and 9600 bps. Modern controls can have the
baud rate set to 2400, 4800, 9600, 19200, 38400, 57600
and 76800 bps. In terms of time, the higher the rate, the DATA SETTING
faster the transmission. Single data bit transfer rate will be
the result of one divided by the baud rate:
The data used for communications must be set properly
before the data transfer can begin. The setting at one end
(computer or the CNC system) must match the setting at
the other end. For baud rate, consult the machine manual - a
good start is at 2400 bps. Newer models have a higher de-
fault. Typical software setting is done through the configu-
Bsr where ...
ration at the computer end and through the CNC system pa-
rameters at the CNC end. Settings at both ends must match.
Sb = Time required to transfer a single bit in seconds
Typical Fanuc settings are:
B = Baud rate in seconds
4800 bps baud rate
A single bit transferred at 300 bps will take 0.03333 of a
second, but a single bit transferred at 2400 bps will take Even parity

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)

240 cps (characters per second). 4800 bps is a good setting


Proper connection depends mainly on the configuration
once everything is working well. Higher settings are neces-
of the connecting data cables.
sary for ‘drip-feed’ methods.
470 Chapter 51

CONNECTING CABLES

The most common cable for communication between a


CNC machine and a computer is a shielded and grounded

cable, containing several small wires (at least eight), each


one enclosed in a colored plastic sleeve. The purpose of
making a communication cable is to connect the CNC port
(usually 25 sockets) with the computer port (usually 25
pins), using a properly configured cable. Always use a ca-
ble of high quality. Shielded cables can reach farther dis-
tances and are generally better choice to withstand interfer-
ences during data transmission. Wires are identified by
their gauge value, for example a 22-gauge or a 24-gauge
wire is a good choice for communications.

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

5 4 Regardless of what cable configuration will be used, a


good communication software that will run the whole oper-
7 7
ation is also needed. Some companies use a software
6 and 8 20 specially designed for CNC work, others purchase very
inexpensive communications software, sold by the major-
20 6 and 8 ity of computer stores.

Figure 51-5

Null modem pin connections


52 MATH IN CNC PROGRAMMING

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-

sary to handle typical programming calculations for man-


Arithmetic and Algebra
ual program preparation.
The subject of arithmetic deals with handling numbers
First, the basic arithmetic functions - addition, subtrac-
involving the four basic operations:
tion, multiplication and division - are at the core of any
mathematical activity. Going a bit further, the knowledge Addition
of common algebraic functions is definitely useful, mainly
Subtraction
square roots and powers of a number.
Multiplication
Second, since CNC programming is based on the rela-
tionship of points within a system of rectangular or polar Division

coordinates, a good knowledge of basic geometry is also


Algebra is an extension of arithmetic and deals with han-
imperative. The scope of this knowledge should cover un-
dling numbers in terms of equations and formulas. Typical
derstanding many principles of angles, the concept of de-
usage will involve:
grees and their subsets, tapers, polygons, properties of an
arc and circle, the pi constant (tc), and other associated top- Square roots
ics. Knowledge of planes and axial orientations is impor
Powers of a number
tant in many cases as well.
Trigonometric functions
Without a doubt, the most important part of geometry,
one that absolutely must be mastered, is the solution of Solving formulas and equations

right angle triangles, using trigonometric functions. Very Variable data


seldom there will be a problem or calculation that will re-
quire a solution using oblique triangles, although these In algebra, typical work involves several known values
problems may arise. and one or two unknown values. Using various formulas
and equations, unknown values can be solved (calculated)
The knowledge of trigonometry is essential to achieve the desired result.
to any serious CNC programming.

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

3 + 8x2 = 3 + (8x2) =19 Circle

Circle is mathematical curve, where every point on the


The multiplicationalways performed first, regardless
is
curve has the same distance from a fixed point. This fixed
of whether it is enclosed in parentheses or not. If addition
point is called a center.
must be done first, it must be enclosed within parentheses:
Several terms are directly related to a circle - Figure 52- P.
(3 + 8) x 2 = llx 2 = 22
CENTER - is a point from which a circle or

These two examples show that an innocently looking an arc is drawn with a given radius.

small omission may have significant consequences.


RADIUS (radii in plural) - is a line from the
center to any point on the circumference
GEOMETRY of the circle.

DIAMETER - is a line through the center between two


For all practical purposes, there are only three entities in points on the circumference of the circle.

the engineering drawing:


CHORD - is a straight line joining any two points on the
circumference of the circle.
Points

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)

dinates in a 2D plane or by XYZ coordinates in 3D space.


TANGENT - is a point where a line, an arc or another circle
Points arc also created by an intersection of two lines, two touches the circumference of the circle but does not cross
circles or arcs, and a line and a circle or arc. it. This point is known as the point of tangency.

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:

Circles and Arcs are curved elements that have at least a


center and a radius.

Other elements such as splines and suifaces are too com-


plex for manual programming, although they are also based
on the same fundamental elements.

Segment and sector of a circle

SECTOR is an area within a circle formed


-

by two radii and the arc they intercept

SEGMENT - is an area within a circle formed


by the chord and its arc

Neither the sector nor the segment of a circle play any


significant role in CNC programming.

Basic elements of a circle


MATH IN CNC PROGRAMMING 473

PI Constant Quadrants

PI a Greek letter used in mathematics to represent the


is Quadrant - is the part of a circle formed by the system of
ratioof the circle circumference to the circle diameter. Its rectangular coordinates, described in Chapter 4. where the
symbol is 7t, it is pronounced 'pie’, and has the value of axes pass through the center of the circle. There are four
3.141592654...., and regardless of how many decimal equal quadrants in a circle, identified by Roman numerals
places will be used, it will always represent only an approx- 1. 11. Ill and IV, starting at the upper right quadrant along the
imate value. For programming purposes, use the value counterclockwise direction - Figure 52-3.
returned by a calculator or computer, usually with six to
nine decimal places. In both cases, the internal value is a lot

more accurate than the displayed value. In many cases, the


rounded value of 3. 14 is sufficient for most results.

Circumference of a Circle

The length of a circle - or its circumference - is seldom


needed for programming and is included here only to en-
rich the general theory. It can be calculated from the fol-

lowing formula using the pi constant:

Quadrants of a circle and the mathematical definition of


angular direction

Each quadrant is exactly 90°, crossing at circle quadrant


C = Circle circumference
points. Therefore, a circle has the sum of all four angles
7t = Constant 3.141 592654...
equal to 360°. Angles are counted counterclockwise as
r = Circle radius
positive, starting from zero degrees (0°).
D = Circle diameter

Individual quadrant points (also known as the cardinal


Length of Arc points) are often compared to a hand direction on the face
of an analogue clock or as a direction of a compass pointer.
The length of an arc is also a rare requirement and can be
0° is arbitrarily located at the equivalent position of 3
calculated from the following formula:
o’clock or East direction, 90° at 12 o’clock or North direc-
tion, 180° at 9 o’clock or West direction, and 270° at 6
2 x n x r x A o'clock or South direction - Figure 54-4.
360

U3° where ...

C = Circle circumference
n = Constant 3.141 592654...
r = Circle radius

A = Arc angle

There are two other very important calculations relating


to a circle. They are used in programming very often and
should be understood well. One is based on the chord of a
circle, the other on the tangency of a circle. As both calcu-
lations require the knowledge of trigonometry, they will be
described later in the chapter.

Angles and quadrants - 0° is East direction or 3 o'clock direction


on the face of a standard analogue clock
474 Chapter 52

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

For example, a six sided polygon (commonly known as


the hexagon) has a single angle of 120°:
Sum of angles in a polygon
A = (6 - 2) x 180 / 6
The sum of all angles in a polygon can be calculated from A = 120°
the following formula:
A regular polygon is quite often defined by the number of
itssides and its center, located within an inscribed or cir-
S = (N - 2) x 180
cumscribed circle. Figure 52-6 above illustrates the con-
cept of inscribed and circumscribed polygon, as it applies
i®- where ...
to a hexagon.

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-

tion has the total sum of angles:


Number of sides Common name
s = (5 - 2) x 180
S = 540°
3 Triangle

There are several different polygons used in geometry,


4 Square (Quadrilateral)
but only one special kind is of interest to CNC program-
ming. This polygon is called a regular polygon, all others
are irregular polygons. Regular polygon is a polygon where 5 Pentagon

all sides are of equal length, called equilateral sides, and

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

oar where ...

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

c units is a taper perfoot. Metric system is much simpler, us-

/ 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

C = F / cos22.5° Diameter at both ends and the length with taper


description or note
C = S/sin22.5°
If a single diameter is defined, it is often the larger one.
~T F = C x cos22.5°
c S F = S/tan22.5° The description of the taper is a note with an arrow point-
_L ing to the taper. In English measurements, the note may
\ / S = F x tan22.5°
S = C x sin22.5°
identify a standard taper or a taper per foot (TPF). In met-
ric. the taper is always a ratio. Figures 52-8 and .52-9 show
the differences between the two units, which is only within
Figure 52-7
the taper identification.
The most common regular polygons - square, hexagon and octagon

In Figure 52-7 are three most common regular polygons -


a square a hexagon and an octagon. Calculations of the
,

distance between opposite corners C, the distance between


flats F and the length of each side S are given. Note that a

hexagon may have two different orientations (two horizon-


tal sides or two vertical sides), which have no effect on the

calculations. Hexagon orientation can be compared in Fig-


ure 52-6 with the hexagon orientation in Figure 52-7.

TAPERS

All taper calculations are virtually confined to the lathe


machining exclusively. Infrequently, tapers also appear in
Circular taper - English description
milling applications. All tapers in this section relate to the
lathe applications (so called circular tapers), but can be
modified to milling. The main purpose of tapers is to pro-
vide a match between assembled parts. By definition.

A taper is a uniformly created conical


surface on a pin or in a hole.

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-

ters have the following meaning:


To calculate the small diameter d, with D, L and TPF:
ns* Dimensions ...

D = Diameter at the large end in millimeters d = D J^Q*


d = Diameter at the small end in millimeters
12
L = Length of taper in millimeters
X = Ratio value X
1 :
To calculate the large diameter D, with d, L and TPF :

All formulas in this section use these designations.


n LxTPF
D= + h
d
Taper Per Foot 12
Taper per foot is defined as:
To calculate the length L, if D, d, and TPF are known:
Taper per foot is the difference in diameter in inches
over one foot of length.
|_ = (D-d)x —
For example, a taper defined as 3.000 inches per foot, ab-
breviated as 3.0 TPF or 3 TPF in the drawing, is a taper that
Taper Calculations - Metric Units
will change the conical diameter by 3 inches for every 1

foot of length. Missing drawing dimensions in Figure 52-9 may be cal-


culated from the given data. In metric system, the taper ra-
Taper Ratio tio is normally known, other dimensions can be calculated.

Metric definition of a taper is similar:


To calculate the small diameter d, with D, L and X:

Taper is defined as the ratio of difference between


the large diameter and the small diameter d = D --
over the given length of the cone. X
1
The metric specification of a taper is the ratio: To calculate the large diameter D, with d, L and X:

D =d+ —
X

The ratio 1 X means that over the length of X mm, the


:
To calculate the length L, if D, d, and X are known:
diameter of the cone will change (either as an increase or as
a decrease) by 1 mm.
For example, a taper specified as 1 : 5 will increase 1 mm
on diameter, every 5 of length. mm
For milling, the taper is defined as the difference in width
over a given length (per side).
MATH IN CNC PROGRAMMING 477

CALCULATIONS OF TRIANGLES

The most common geometrical entity in programming is

a triangle. All triangles are polygons, but not all triangles


are regular polygons. All triangles have three sides, al-
though not always of the same length. There is a number of
different triangles in geometry, but only a handful are used
in everyday CNC programming.

Types of Angles and Triangles Sum nf all angles in a triangle is always 180 degrees

The main groups of triangles can be grouped together by


The oblique triangle - and its close cousin the isosceles
their angles - Figure 52-10.
triangle - seldom ever needed in pro-
are types of triangles
gramming. However unlikely, it is always possible. These
triangles can be solved only if at least three dimensions are
known, and one of them must always be a side:

One side and two angles must be known

Two sides and the angle opposite one of them

Two sides and the included angle

Three sides

Isosceles triangle has two sides of equal length. Each side


- or leg joined by a line called the base. The two angles
- is

at the base are always equal - Figure 52-12.

Typical triangles
/a) Right triangle I bI Acute triangle Icl Obtuse triangle

Some more detailed definitions may be useful:

RIGHT angle means that the given angle is equal to 90° Isosceles triangle

ACUTE angle means that the given angle is

greater than 0° and smaller than 90°


A triangle that has all sides of equal length is called an
equilateral triangle. An equilateral triangle is also always
OBTUSE angle means that the given angle is an equiangular triangle, because all internal angles are the
greater than 90° and smaller than 180° same - each angle is 60° - Figure 52-13.
A right triangle is also called a right angle triangle.
It defines a triangle that has one right angle (90°)

An acute triangle is also called an acute angle triangle.


It defines a triangle that has three acute angles.

An obtuse triangle is also called an obtuse angle triangle.


It defines a triangle that has one obtuse angle.

In addition, there is also an oblique angle, which is not a


new type of an angle, just a new definition:

OBLIQUE angle can be either an acute or an obtuse angle,


which means it cannot be 90° or 180°

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

Right Triangles An inscribed angle in a semicircle is always 90°, as


A right triangle - or a right angle triangle - is triangle that shown in Figure 52-16. Line AB is the circle diameter.

has one angle equal to 90° (a triangle with two or more


right angles is impossible). As there are 1 80° in any triangle
(sum of all angles), that means the sum of the two remain-
ing angles must also be 90°. There is a number of mathe-
matical relationships that form the base of all calculations.
Here is a look at those that are important in CNC program-
ming. Learn these relationships well enough to be able to
apply them to daily situations. Keep in mind that 99.9% of
all triangles to be solved are right triangles.

The side of a right triangle that is opposite the right angle


is called the hypotenuse and is also the longest side of the
triangle. The other two sides are called legs. The illustration Inscribed angle in a semi-circle
in Figure 52-14 shows a right triangle, where C angle is the
right angle (90°) and the side c is the hypotenuse. The sides In Figure 52-17 is a line from point A to the center of cir-
opposite to angles have a low case identification corre- cle B. A line from point A to the tangency of the circle will
sponding to the angles described in capital letters. create either a point C or point D. The angle a is created be-
tween lines AC and AD, where the line AB is a bisector of
the angle a, creating two equal angles. The two angles al
and a2 as well as triangles ABC and ABD are identical.

Right angle triangle and the relationship of angles

Bisector creates two equal angles


A circle drawn inside of a right triangle that is tangent to
all three sides a, b. c - Figure 52-15 - has a diameter D cal-
Similar Triangles
culated from this formula:

Triangles are considered similar if they have their corre-


sponding angles equal and their corresponding sides pro-
portional. Two triangles arc similar, if:

Two angles of one triangle are the same


as two angles of the other triangle

An angle of one triangle is the same


as the angle of the other triangle and
the including sides are proportional

Both triangles are similar to another triangle

The corresponding sides of the two triangles


are proportional

Circle inscribed in a right triangle In CNC programming, mathematical relationship of tri-


angles are used quite often, for example, when machining
D = a + b - c
tapers or similar angular items. A taper specified in the
drawing must frequently be extended at one or both ends,
to allow for the necessary tool clearances.
MATH IN CNC PROGRAMMING 479

Similar triangles -

The illustration in Figure 52-18 shows the relationship


between two similar triangles. The same illustration also
Similar triangles - 2
shows several important dimensions:

Bsr where ...

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

The bottom part of the figure shows the relationship of


the opposite sides H and U to the adjacent sides L and W.
The formula of the relationship is:

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.

To calculate the side U, the above formula is reversed:


Trigonometric functions sine, cosine, and tangent
480 Chapter 52

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

Inverse Trigonometric Functions Therefore,

From the definitions, the value of sine, cosine and tangent


64°48 27" l
...is equivalent to:
is expressed as a ratio of two sides. The angle that depends
on this value is the result of an inverse trigonometric func- 64 + (48 / 60) + (27 / 3600) = 64.8075°
tion. An inverse function is sometimes symbolized with the
The abbreviations DMS/D-M-S and DD/D-D are com-
word preceding the normal function. For example
arc,
arcsin of an angle A is the angle whose value is the ratio of
monly used on scientific calculators. Much less useful con-
version is to change decimal degrees to DMS. It is not
the side a to the hypotenuse c.
needed in CNC programming, except perhaps to perform a
Most pocket calculators indicate the inverse function as double check, to verify that the original converted result is
sin, cos and tan raised to the power of minus I as the sec- correct. The calculation of DD to DMS is nothing more

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 ... sinA = a / c grees-minutes-seconds format, three steps are necessary.

Then ... A = arcsin (a / c)


The first step is to isolate the whole degrees amount from
!
Or... A = sin (a / c) the decimal degrees:

If ... cosA = b / c 29.545021 - 0.545021 = 29°


Then ... A = arccos (b / c)
Or... A = cos (b / c) 1
The seconds step is to take the decimal portion and multi-
ply it by sixty, to get the minutes:

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"

sine of 45°, as well as the sine of 135°.


The final DMS
value of the example will be 29°32'42",
Degrees and Decimal Degrees with a slight rounding error.

Another type of calculation used in programming is con- Pythagorean Theorem


version of angles. It relates to a drawing using minutes and

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:

and use DD or D-D, which means decimal degrees. Deci-


In any right triangle, the square of the hypotenuse
mal degrees are needed for calculations of coordinate
equal to the sum squares of the other two sides
points, so DMS must always be converted to DD.
is of
MATH IN CNC PROGRAMMING 481

Pythagorean Theorem is used in programming to find the Q Example...


length of any side in a right triangle, if two other sides are If the length of hypotenuse c is 3 units and the side b
known. Figure 52-21 shows tire calculation of side a or is 2.75 units, the side a can be calculated - the c
side h or the hypotenuse c in a right triangle. squared is 9.0, b squared is 7.5625, so the side a is:

a = V(3 x 3 - 2.75 x 2.75)


a = V(9 - 7.5625) = Vl.4375
a = 1.1989579

The symbol V represent the square root.

Solving Right Triangles

The solutions of right triangles using the Pythagorean


Theorem or any other method are equally important. These
common methods use the sin, cos and tan trigonometric
functions. As always, start with the known data. In trigo-
nometry, any triangle can be solved, providing one of the
two data sources is known:

Two sides of a right triangle

One side and one angle of a right triangle

The 90° angle is always given and never used in calcula-

tions.Figure 52-22 covers all right triangle solutions. If


more than a single solution is available, use both methods
to double check the result.
Pythagorean Theorem

Trigonometric functions - formulas for solving right angle triangles


482 Chapter 52

ADVANCED CALCULATIONS CONCLUSION

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

CHORD of a circle - calculations of chord, radius and deviation

Figure 52-24

TANGENT of a circle - calculations of tangent, radius, angle and deviations


53 CNC AND CAD/CAM

Up to this point, all topics related to manual program- CAM Software


ming of CNC machines - all fifty-two chapters. In the last
chapter, we look briefly at an area where manual program- Current CNC software, commonly known as CAM soft-

ming is replaced by a computer, a suitable software and


ware, has many features that translate into a CNC program,
corresponding to individual ideas of how the part program
some additional skills. Note the word additional. Studying
should be written. It can produce a program closely match-
the handbook has certainly not been a waste of time. On the
ing a particular direction of thinking, closely matching a
contrary - the handbook covers subjects that every CNC
programmer should know, regardless of the programming particular programming style. But closely does not always
method used. Programming with a computer is always de- mean close enough. Here comes the second reason.

sirable but to know the basic skills is the most important


The second reason is that when programming manually,
prerequisite. The basic skills are in understanding the man-
theprogrammer understands the programming process and
ual process. All subjects and methods learned do not have
the resulting output. A program generated by a computer
to be applied by a pencil and paper. They could be applied
has to be format compatible with the CNC machine
in the
by a CAD/CAM - or just CAM
- programming. A simple
and its control system. If all goes well, there is no need to
statement may summarize it all:
look at the program there, in the files, ready to be
at all - it’s

loaded into the CNC


machine. On the other hand, what if
Top class programming using CAM software requires
there is a problem - what then? Going back to the computer
solid knowledge of manual programming methods.
and reprogram the part may solve the problem on hand.
The question is at what price. Ability to read the CNC pro-
PROGRAMMING MANUALLY? gram code, to really understand it, also means the ability to
change Spending a valuable computer time just to add a
it.

forgotten coolant function seems excessive. Would it not be


In the area of CNC programming application techniques,
better just to edit the program by adding M08 function in
computers from a personal computer to work-
at all levels,
the right place? Although the example is oversimplified, it
stations arc capable to produce most CNC machine pro-
also shows that real understanding of the programming
grams in a time much shorter than any manual program-
ming method. So, why is the high importance of manual process is very important. The best way to understand the
process bypass the computer and get the same
is to results.
programming methods so emphasized? Is the manual pro-
gramming still alive, and if so, how healthy is it? That can be achieved with manual programming.

It would be unfair to compare or promote manual pro-


There are two important reasons why manual pro-
at least

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

new on the market and are of-


tools arc constantly arriving TOOL PATH GENERATION
fered to users in both areas.Because hardware and software
has to be considered together, the first question is what to
select first - the hardware or the software?
The key requirement of a CNC software is to produce a
program of an accurate tool path for a specific CNC ma-
Such a decision must be based on the required applica- chine. The tool path creation, with all its calculations, is the
tion. What will the computer be used for? What kind of most time consuming task in manual programming. It
work needs to be computerized, automated? What results makes sense to make it the most important item to consider
are expected? These are the primary considerations - not when planning to automate the CNC programming pro-
the kind of monitor or printer or the capacity of hard disk. cess. Only high level CNC software supports a large variety
They are also very important - but only after establishing of tool paths. For example, helical milling or a full 3D ma-
the application needs. chining are not always standard features in the software.

Certain programming ma-


applications are typical to all One mistake in software selection is to consider only the

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

Tool path generation more accurate estimate of future needs.

Complete programming environment The computer technology has grown a lot, yet it is so new

that it is in the state of constant development. Nobody can


Post processing
predict with absolute accuracy what the future will offer in
Training and technical support terms of CNC machining and CNC programming. If the
current and the future needs are well established before
It is important to understand why these features are im-
purchasing a programming system, there is a good chance
portant. Before investing into a technology that is all or par-
to beat obsolescence for a long time. CNC software devel-
tially new to the user, it helps to know what tools the soft-
opers offer periodical updates to their product, with more
ware offers and how they can be used in everyday work.
features added as computing power increases. The updates
(new versions of the software), usually reflect develop-
TOOL PATH GEOMETRY DEVELOPMENT ments of the technology, both on the hardware and software
sides. It does not mean purchasing every new update of-

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

When it comes geometry, two scenarios must


to tool path
COMPLETE ENVIRONMENT
be faced. One will bework form a paper drawing, the other
from a CAD drawing stored in the computer. Although
there arc differences in approach, the fact remains that ei-
A CNC programming software al-
typical high quality

ther a new geometry is created or an existing geometry is


lows programming and relating tasks to be done from a
all

modified. structured menu, using a mouse or similar pointing device.


The important thing is that once the software is loaded, it
Modern CAM systems allow drawing in a CAD like can complete all tasks without returning to the operating
manner - using editing features such as trim, fillet, break, system level. Some programming systems are based on
copy, move, rotate, offset, mirror, scale, and so on. modules and files that are not accessible from a menu, or
they do not cover all the steps in programming.
Typically, programmer will define what is normally not
on the drawing, at least not on a two dimensional represen- The following list is meant only as a very brief guide to
tation of the part. Adding depth, separating entities by some of the main features that apply to CNC programming
color, by levels (layers), adding clearances or a special on personal computers. These are the expected features
lead-in and lead-out tool motion, and so on. from any CAM
software:
CNC AND CAD/CAM 485

Multi machine support (machining centers, lathes, EDM) Associative Operations

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

works the other way as well - many tooling parameters can


Printing capabilities (text and graphics)
be changed quickly, on demand.
Pen plotting (plotters)
Job Setup
Interface with CAD software (DXF, IGES, CADL, STL, ...)

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

Each described item will point out its significance. Al-


Tooling List and Job Comments
though all items are useful in a programming system, it
CNC programming is a process covering several steps.
does not mean that all items are always necessary. Some Whether programming manually or with a computer, the
features require an additional hardware equipment, such as
selection of cutting tools is a manual task. Once selected,
a printer, plotter, cabling, small peripherals, etc.
each tool is assigned its identifications, speed and feed val-
ues. Several tools can be grouped into a tooling library file
Multi Machine Support and stored. Then, the order of their usage within the pro-
When gram is selected. Some parts require more than one ma-
it comes to support of different machine types,
CNC software can be divided into two groups: chining operation. Complex setups require special instruc-
tions to themachine operator (setup sheet), describing the
Dedicated software programmer’s intents. All these programming decisions
must be recorded and the documentation sent out to the ma-
Integrated software
chine shop. It is only reasonable to expect that any CNC
The dedicated software supports only one kind of ma- programming software will support a tooling list, perhaps
chines. For example, a software that is designed specifi- in a form of a tool library file and the process list. Material
cally to produce programs for CNC fabrication equipment, library file is can store surface speeds
also very useful, as it

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

Program Text Editor Pen Plotting

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

is otherwise completely accurate. quality CAD/CAM system is the avoidance of duplication.


Without CAD system, the CNC programmer has a lot of
Many programmers use various external text editors or extra work to do, much of it is duplicated.
even word processors in text mode. These types of editors
are not oriented towards the CNC programming, since they
A high quality CNC software also allows the existing

lack some features typical to the CNC program develop-


program file to be translated the other way, to a file that a
ment. Only a CNC oriented text editors can handle auto- CAD system can accept. This option is called reversed
matic block number sequencing, removing the block num- processing, and can be a benefit to companies that want to
translate existing programs generated manually to an elec-
bers, adding cosmetic spaces in the program and other
functions. The editor should be accessible from the main tronic form. Usually some additional work is required in
these cases.
menu or from within the software.

High level CNC software


a stand alone type. Stand
is
Printing Capabilities
alone software means that does not need an access to a
it

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

Software Specifications RAM and Data Storage

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.
,

Some languages are still on the de-


available but heavily Every software specification identifies the minimum avail-
cline. Modern interactive graphics programming has virtu- able RAM required. RAMof today high level computers
ally eliminated the need for languages in just about all man- around the gigabyte range is not uncommon. Any extra
ufacturing fields. The more popular kind of programming memory will speed up processing quite significantly. The
is based on interactive graphics. The programmer defines data in the RAM is volatile, which means the data is lost

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

device. The user points at the menu item desired, presses a


Computer Speed
button on the device and the menu item is executed. The

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.

higher the number, the faster the computer can process


Both the printer and plotter are theoretically optional, but
data. To make the comparison easier, the original IBM PC. generally worth some consideration. For CNC work alone,
model year 1983, had a 4.77Mhz processor speed. Later a printer is more important than a pen plotter. If the setup is
model AT had 6mhz processor speed, improved further to 8 a true CAD/CAM. both peripheral devices may be needed.
and OMhz. Later, computers used the so called 386 micro-
1

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

Typical Hardware / Software Requirements Utilities and Special Features

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)

High central processor speed - higher = better POST PROCESSORS


(measured in MegaHertz units - MHz)

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, ...)

A top quality post processor is probably the most impor-


High resolution graphics adapter (graphics card)
(should have a rapid refreshing for the video output)
tant customized feature of a CNC software. When entering
data into the software, values describing the part shape,
Large high resolution color monitor - non-interlaced cutting values, spindle speeds, and many other data are
(measured in pixels - the more pixels per screen size, stored for further processing. The software analyzes this
the finer the display, and the smaller the pixel size,
data, sorts it and creates a database. The database repre-
the better the display)
sents the part geometry, the toolpath geometry and other
Pointing device - normally a mouse - is a current standard functions. The CNC system cannot understand the data, re-
gardless of its accuracy. To complicate things even more,
Pen plotter is required only in special circumstances
every CNC system is different. Some program codes are
(notneeded for CNC work) - B size maximum is usually
unique to a single machine, some are quite common to
enough, if needed
many machines. The purpose of a post processor is to pro-
Working real time calendar clock (stamps all created cess the generic data and convert them to the machine code
files with the current date and time - standard feature) for individual control systems.

A good quality printer with a parallel or USB port


(for hard copy documentation)
Customizing Post Processor

CD or DVD drive & various multimedia features Typically, a supplied post processor more or less ge-
is

(sound card necessary) neric and has to be customized, some extent. To


at least to
develop a post processor in-house, usually means to cus-
Access to additional global information
(Internet, E-mail, user groups, newsgroups, ...)
tomize the generic post processor supplied with the CAM
software. The depends on the type of post
typical process
Two or more serial and USB ports processor and its format. Snail changes may take minutes,
large changes days. Post processors can be very expensive.
Text editor - usually part of the software (or optional)

It issmart to keep abreast of the micro computer technol-


The CNC programmer must know the machine and con-
trol features extremely well. A deep and thorough knowl-
ogy. It develops rapidly and even a few weeks may change
edge of manual programming methods is a must - how else
some fundamental approaches and decisions. Following
can a useful programming format be developed? Also im-
the development of computer technology creates aware-
portant is the knowledge of machining methods. Finally,
ness of the latest improvements, therefore a more educated
knowing any high level language can make the post pro-
user and/or buyer.
cessor development much more efficient and powerful.
CNC AND CAD/CAM 489

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™.

cles is very important in a CNC software, as it provides


The DXF Drawing eXchange Format
( or Data eXchange
easy editing at the machine.
Format) is considered by many to be the standard of draw-
ing file exchange between micro computers. It has been de-
User Interface
veloped by Autodesk™, Inc., the developers of the popular
Customizing the display is also a useful feature. It is not AutoCAD™, the most widely used PC based CAD in the
as critical as others, but a facility to customize fonts, colors, world. DXF format is suitable only for common geomet-
toolbars, even menus adds the extra power to the software. ric elements, such as points, lines, arcs and a few others.

Colors are very important in CAD/CAM work. The color


settings should be changeable to provide better distinction.
The CNC software should also support an interface be-
tween the neutral files generated by a CAD system. De-
The screen appearance may be changed by a different com-
pending on the nature of a particular programming applica-
bination of colors for the foreground, background and the
tion. the DXF interface may be needed for simpler jobs,
text. The result is the visual emphasis on what is important.
and IGES for more complex geometries. High quality CNC
The last user interface feature is the selection of verifica- software offers at least these two formats, usually many
tion options in the software. When the tool path simulation more. Keep in mind that the format and structure of the
is shown on the screen, a circle represents the tool diameter translators, such as DXF or IGES. is not in the hands of the

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 Technical Support

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-

ter the first level completion. most critical level of


It is the dexing techniques of the machining centers. This would in-
the three. It should include a systematic approach to all crease the number of cutting tools available and keep inac-
software features, with special emphasis on features relat- tive tools away from the machining area. Also watch for

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

Decimal inch Fraction 62



.0059 6
.0063 1.00
.0067
.0071
.0075
.0079
.0083
.0087
.0091
.0095

.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

Straight Pipe Taps NPS

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

TPI Tap Drill Decimal Size

27 1/4 .2500

27 .3438

18 7/16 .4375

18 37/64 .5781

14 23/32 .7188

14 59/64 .9219

11-1/2 1-5/32 1.1563

11-1/2 1-1/2 1.5000

11-1/2 1-3/4 1.7500

11-1/2 2-7/32 2.2188


Appendix 495

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

2 Vi-8 Metric Fine Threads


3-8

Nominal 0 x Pitch (mm) Tap Drill 0 (mm) Inch equivalent


Drilled Only Taper Reamed M3 x 0.35 2.65 .1043
M3.5x0.35 3.15 .2283
M4 x 0.5 3.50 .1378

^
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

1/4 18 7/16 .4375 27/64 .4219 M8 x 1

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
.

Slash symbol 163


Used for program proving 1 69
.168
Used for trial cut

Used with modal commands


Bolt hole circle pattern
.

.
... .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
....
.

Approach to the part 306


ATC 8, 95-96
....
. . .

Automatic corner break 299


....
.

Automatic corner override 89


Automatic pallet change. . . .
437-439 CAD/CAM 32-33, 483-490

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
....
.

Keeping track of tools . 99 General features ... 489


Manual interference .101 Geometry development . . . 484
....
.

Maximum tool diameter 97 Postprocessors . .


488
Maximum tool length .... 97 Support and training ... 489
....
.

....
.

Maximum tool weight 97 Toolpath generation . . 484


....
.
.

No tool in the spindle . . . . . 101 Calculation of triangles . . . 477


Programming ATC . . 98 Calculations . . 40
....
. .

...
.

Several tools . 99-102 Calculator type input 76


....
. . .

Using a single tool 98 Canned cycles 177-190,314-320


Using oversize tools . 102 Cartesian coordinate system . ... 15
....
. . . .

Auxiliary functions lock . . . . 28 Center cutting end mill . . . 197


Axes and planes . 16 Centerline tools . . . 129
....
. .

...
.

Axis orientation - milling 17 Chamfering 299


.... ....
.

Axis orientation - turning .


18 Chamfer diameter . . . 191

Character . . . 41

Chuck functions 409


Circle cutting cycle 244
Circular interpolation .... . . 235-246
Arc center and radius ... 238
Arc center vectors .... ... 238
Arc cutting direction . . . 237
Background edit 465 Arc in planes . . 239.271
Ball nose end mill . . 273 Arc programming . . 245
....
.

Barfeeder 170,413 Blend radius 240

B-axis 429-436 Boss milling 242


...
.

Bitwise input . . 24 Circular motion direction .


271

Blend radius . 301 Elements of a circle . . . . 235


...
.

Block 25,41.61-68 Feedrate for circular motion 245

Block format .
. . 63 Full circle programming 240, 244

Block numbering .
. . 63 Lead-in and lead-out path .
. 243

Block numbers increment 64 Partial radius .


. 240

Block structure . . 61 Programming format . ... 237


Conflicting words . . . 66 Quadrants .236
End-Of-Block (EOB) . . 64 Radius programming . . . 240
Sequence block 61-68 Start point and end point . 238
....
. .

Single block . . . 25 Circumscribed circle 474

Status block . . 65 Clamp and unclamp functions .


. 430
....
.

Block skip 21.163-170 Climb milling 280, 423


....
. .

Barfeeder application 170 CNC machine tools . . 4


....
.
. . .

Numbered block skip .


. . 170 Four-axis lathe . . . 13
Horizontal boring mill . . . 10.439

497
498 Index

Horizontal machining center . 9 Cycle start 21.57.170


Lathe accessories 409-415 Cycle time 4

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

Types of CNC lathes ... 11 Datum shift . .


381-392

Typical specifications 9-10, 13 Cutter radius offset 388

Vertical machining center 8 Data setting .... . . . 386


457-464 Lathe offsets. 388
CNC machining . . . . 2. . .
.

461 Program zero change 381


Alternate machine selection
. .
. .

Machine shutdown ... 463 Tool length offset 387


389
New workpiece 457 Using MDI control mode . . . .

464 Using parameters 389


Preventive maintenance
. . .

Program integrity .... 458 Work offsets. .

...
. . 386
75
Running the part 459 Decimal point programming

Safety issues
first

...
.

411,462 Defaults ... 23


458 Delta increment . . . 250
Setup integrity
462 Departure position 159
Warm-up program .
. . .

5 Depth of cut 182


CNC programmer . . .

Conflicting commands 50 Descartes, Rene .... . . 15

Connection to external devices 30 Diameter programming . . . 73


Distance-To-Go , . 132, 176
Contouring .

Continuous path 39 DNC ... 468

Equidistant path 39 Drawing . . 31,34

Control system 31 Changes and revisions .


... 36
20 Dimensioning methods . . 34
Control panel
.

Defaults 23 Special instructions ... 36

Features 14 Surface finish .... ... 35

Memory capacity 24 Title block .... ... 34

Optional features 29 Tolerances .... ... 35


Conventional machining .... 2 Drawing dimension input .
30
194
Conventional milling 280 Drilling operations .
. . .

Conversions Blind holes .... ... 197

HP to kW ... 39 Center drilling . . . 196

kW to HP ... 39 Drill point length .


... 195

Coolant functions . 21.58.278 Effective drill diameter ... 195


15. 17 Flat bottom drilling 197
Coordinate geometry .
. .
. . .

Coordinate system rotation 399-404 Indexable drills .


. . . 198

.... ...
.

206 Multilevel drilling 207


Counterboring
...
.

Countersinking .... ... 205 Nominal drill diameter.


199,214
195

CSS .
. 82, 305 Peck drilling . .

Cutter path determination. ... 38 Reaming . . 201,214


247-268. 271-273 Through holes . . . 196
Cutter radius offset.
Applying radius compensation ... 254 Web drilling .... . . . 208

Cutter direction change ... 256 Drip-feeding .... . . 24, 469

D amount setting. ... 263 Dry run .

...
. 21,143

Direction of motion ... 251 Dummy tool 95

Intel ference error.


.

. . . 259 Dwellcommand .... 171-176. 179.411

Look-Ahead type ... 257 As TAB alternative . . . 176

Offset cancellation ... 256 Dwell in number of revolutions . . . 174

Offset commands G40-G42 ... 251 Dwelling axis ... 176

Practical example ... 262 Long dwell time .


... 175

Programming format .
... 253 Minimum dwell .
. . 173,207
250 Safety issues . 176
Programming techniques . .

...
. . .

...
.

260 Setting mode 173


Startup methods
Tool nose radius offset ... 266 Time selection . . . ... 172

Toolpath center points 248 Used in fixed cycles ... 176


...
. . . .

250-252 DXF files 33


Types of offset . .

.... ...
.

Cutting mode 90
Cutting tool animation ... 30
Index 499

Emergency stop 21,25 GOO command 50, 143

Empty tool 95 G01 command 50,159


End of block 64 G02-G03 commands 237
English units 69 G04 command 171,439
EOB 64 G09 command 88
Errors in programming 453 G10 data setting command 386, 389, 392

Calculation errors 456 G12-G13 cycle 244, 292

Hardware errors 456 G1 5 command 225


Input errors 456 G1 6 command . . . 225

Logical errors 455 G17-G1 9 commands 418

Miscellaneous errors 456 G20 command 52. 69

Syntax errors 455 G21 command . . 52, 69

E-switch 463 G27 command 151.156


Exact stop check 89 G28 command 151-155, 157

Exact stop check mode 89 G29 command 151.157


Execution priority 68 G30 command 151.158
G32 thread cutting command 348-349, 352
G40 command . 251,266
G41-G42 commands . 251,266
G43 command 123,132
G44 command 123,132
G45-G48 commands 119,122
G49 command . . . 132

Face milling 122,227-234 G50 command 79, 83, 113, 381

Cutter selection 227 G50-G51 scaling commands . . . .


405

Cutting considerations 228 G52 command . . 224, 384

Programming techniques 230 G53 machine coordinates command . . . 384

Using position compensation 233 G54.1 command .... . . . 124

Family part programming 166 G54-G59 work offsets .


123-130, 383-384

Feedrate control 87 G61 command


Circular cutting motion 245 G62 command
Circular motion feedrate 90 G63 command
Constant feedrate 90 G64 command .... 89-90

E address threading 92 G68-G69 commands 399


Feed per minute
in

87 G70 cycle .... 313,320


Feed per revolution 88 G71-G73 cycles .... . . 313,315,317-318
Feedhold 21,25,91 G73 peck drilling cycle . . . . . 178, 184

Feedrate override 21,27,92 G74 tapping cycle - left hand . . . 178,186,209


Inverse time feedrate 87 G74-G75 lathe cycles . . . . 214,313
Maximum feedrate 91 G76 precision boring cycle . . . . 178,189,203
Selection . .
88 G76 threading cycle . . . 313,350,352,355
240 G80-G89 commands 178
Fillet radius
Fixed cycles 177-190,314-320 G81 drilling cycle .... 183

Absolute and incremental applications 180 G82 spot drilling cycle . 183
177 G83 peck drilling cycle 184
Basic format structure .

Cancellation of a cycle 189 G84 tapping cycle - right hand . 178,186,209


....
. . .

Cycle repetition 179,189 G85 boring cycle 187

Detailed description 183 G86 boring cycle .... 187

180 G87 backboring cycle 187, 204


General rules
G88 .... 188
Initial level selection

L0 parameter
Plane selection
... 181
190
274
G89
boring cycle

boring cycle

G90 absolute position


....
command . 71-72, 152-153, 160, 385, 388
188

Programming format .... 179 G90 lathe cycle ... 308


181-182 G91 incremental motion command 71-72,152-153,160,381
R-level selection

Selection 128 G92 position register command. . , 113,124,381,383

Shift amount .179 G92 threading cycle .


. .
349-350, 363

Z-depth calculations .... 182 G94 feedrate command .

.312
88

Format notation 43 G94 lathe cycle

Milling system format 43 G95 feedrate command .


88
44 G97 command 84
Turning system format
G98-G99 commands 181,207
500 Index

Gauge line 131

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

Using in a block ... 50


With decimal point. 52
Gear ranges 21,60,298
Geometry
Geometry offset 104,128,157,254
472
L-address .... 179,190
307-322
Lathe cycles
Graphic display 29 320
Contour finishing cycle . .

Grooving and part-off 323-334 312


.... Face cutting cycle .
.

Corner groove 332 313


Multiple repetitive cycles . .

Grooving applications 323 314,316-321


.
P and Q blocks .

Grooving dimensions 324 318


Pattern repeating cycle
....
.
. .

Multiple grooves 330 307


Principle of cycles
....
. .

Part-off 335-338 314


Profile cutting cycle
...
.
.
.

Precision groove 326 308


Straight cutting cycle
....
. .
.

Simple groove 325 294


Lathe offsets .
. .

Master tool setup 129


Multiple offsets .
. . 295
Offset change . . 295
Offset entry . . . 294, 298

Offsets and tool motion , . 295


Lathe program format 306
Least increment . . 73
Handle 21-22 159, 161,271
Linear interpolation
Helical milling
417-428 161
Cutting feedrate .
.
.

Helical interpolation 417 160


Multiaxis motion .
. .

Helix 4 ’9 160
Programming format .
. .

Ramping 427 159


Single axis motion . .

Thread milling 4 '8 159


Start and end of motion . .

Thread milling example 4 21 5


Live tooling . . . . .

Hockey stick motion 146,151 224, 383


Local coordinate system
Home position 108,149-158
Horizontal machining centers 127,429-440

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 .

Indexing axis 430-431,434 59, 79


M04 function .

429-436 80
Indexing table .

M05 function 59,


level selection . 181 60, 95
Initial .
M06 function .

In-process gauging 30 58
.
. . .

M07 function .

69-76, 429 58
Input of dimensions .

M08 function
...
. . .

Input format 73 58
M09 function . .

Zero suppression . 74 409


.
. .

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 .

Ml 9 function 60, 80, 102


DNC 468 411
. . .

M21-M22 functions.
Punched tape .... 466
M23-M24 thread finishing functions 60. 357
RS-232C interface 465, 467, 469 58
M30 program end function . .

Terminology of communications . . 469 298


M41-M44 functions.
.

Intermediate point 151 92


. . . .

M48-M49 functions
...
. . .
. .
. . . .

Inverse time feedrate. 87


Index 501

M60 function . . .... 60. 439 Mirror image ... 393-398

M71-M72 function 413 Control setting . 395

M73-M74 functions. 414 Lathe applications . 398

M88-M89 functions 415 Programmable setting. .


396

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

379, 384 Description 53


Machine coordinate system .
.

17 Machine related functions 53. 58


Machine geometry .

28 Program related functions 53. 56


Machine lock
175 Special MDI functions 54
Machine warm-up .

108 Modal commands 50, 67


Machine zero . . .
. . . .

mode 152 M-S-T lock . 28


Absolute and incremental
. . .

151 Multilevel drilling 207


Intermediate point
Machine zero return 149-158 Multiple repetitive cycles .... . . . 307-322. 350-355

Primary machine zero 151

Program commands 151

Return from machine zeiu 157

Secondary machine zero


Zero position check
Machine zero return 149-158.434
'58
156 N
Machining a workpiece 2
30 Numerical control 1-6
Machining cycles
Machining holes 191-216 Advantages 2
Definition 1
Drilling 'S'5

Hole enlargement 205 Hardwired controls

Lathe applications 212 Softwired controls 1

Peck drilling 199,214


Reaming 201.214
Single point boring 202
Tapping 209
Tooling selection 191,193
Web drilling ... 208
Machining sequence 37
Manual absolute 28 Offsets 298,315
Manual data input 26, 389 Operation panel 20

Manual programming 32-33 Optional stop 21,57


Material specifications 36 Orthographic orientation 399
Math in programming 310 Overtravel 108, 122, 150

Calculations of triangles 477


Circle elements 472
Order of calculations 471

M-codes 53-60

Machine related 53. 58

MDI functions . . 54
M-function duration . 56
Milling applications 54 Pallet changer . . . .
429. 437

Program related . 53. 56 Pallet types . . .


438

Turning applications .
54 Parameters. 22. 389
21,26, 389 Parsons, John

Memory capacity . . 24 Part catcher or unloader 414

Messages in a program 66, 452 Part complexity .


32
Methods sheet 36 Part reference point 109
....
.

Metric units . . 69 Part setup 38

Milling - G-codes. 47 Setup sheet 38


....
.

Milling - M-codes . . 54 Part-off 335-338

Milling operations Parts counter .


415
Direction of cut . Pattern of holes 21 7-226

End mills Angular row hole pattern 218

Peripheral milling Arc hole pattern .


222

Slots and pockets Bolt hole circle pattern 223

Speeds and feeds Corner pattern 220


Stock removal Grid pattern . 220
Width and depth of cut Random hole pattern .
217
Minimum axis increment . Straight row hole pattern 218
502 Index

217 Lathes . 112


Typical patterns . . .

....
.

199,214 Machining centers . 110


Peck drilling

42, 58 Selection methods 109


Percent sign .

81 Programming formats 42
speed
.

Peripheral spindle . .

....
.

473 Format notation . 43


PI constant . .

269-274 Word address format 42


Planes
data 272 Programming procedure 33
Absence of axis .
. .

271 Programming terms 41


Circular interpolation in planes . .
.

273 Pull-Out finger .


415
Cutter radius offset . .

....
.

. 16,269 Punched tape . . . 466


Definition

Fixed cycles .... . .

269-270
274 Pythagorean Theorem 161,480

Machining in planes
Mathematical planes .
. . 269
Selection of planes 226, 269-274

....
.

Pocket milling . 281-292

Circular pocket cycles . .


292

Circular pockets .
. . 289
Rectangular pockets .
. . 285

Point of origin ... . . 16 Quadrants 16, 236


40
Point-to-point machining. . . 177 Quality in CNC programming
Polar coordinate system . 225

Position compensation .
. 119-122

Incremental mode . . 120


Motion length calculation .
. . 120

Programming commands .
. . 119

Z-axis . . 122

Position register commands 113-118

Definition .... 113


115
Radius programming
143-148,271,294
240

Lathes .
. . Rapid positioning . . . . .

113 Approach to the part .


148
Milling . .

113 Hockey stick motion 146,151


Turning . . .

115 Motion formulas 147


Z-axis setting . . .

33. 488 Reduction of rapid rate. 26, 147


Postprocessing. .

Power rating .... . . 39


47-52
Tool path motion
number system
144
15
Preparatory commands Real .

Process sheet .... . . 36


42
Reaming operations 201,214
304
Program . . Recess programming
Program changes. . . 460 Rectangular coordinate system 15

66 Reference points 107-112.471-479,481-482


Program comments .
.
. .

....
.

Program end .
. . 58 Fixed point 108

Program header . . 45 Flexible point. 108

Program length reduction .


. . 445 Machine zero .
107-111, 149-158, 471-479, 481-482
46 Machine zero (home) 108
Program structure .
. .

447-452 Part reference point 109


Program documents .

451 Reference point groups 107


Documentation file folder .

Documenting a program .
. 448 Tool reference point .
112

Setup sheet .... . . 449


449
Register commands. 113-118
109
Tooling sheet . . Return to machine zero .

Program identification . . 62 Rigid tapping .... 209,212


179,181-182
Program name . . 62 R-level selection . .

62 Roughing and finishing 302-303. 307


Program number .
. . .

3140 RS-232C interface 30, 465, 468


Program planning . . .

Program stop . .
56

Program verification. . 453-456

Avoidance of errors .
. . 454

Detection of errors . . 453


Graphic method . . 454
....
.

Input errors . . 456

Thread cutting . . 360

Program writing 441-446 Safe block 65


442 Safety CNC work 6
Confusing characters .
.
in

445 Scaling function 405-408


Long programs . .

Output formatting . . 443 G50-G51 commands 405

Programming forms . .
442 Scaling center 406

....
.

16. 109, 273 Scaling factor 406


Program zero
Index 503

Screen display 21 Target position .


39, 159

Sequence block ... 61-68 Technological decisions .


.
38
Sequence return 28 Thread milling 418
SETTINGS screen 170 Example . 421

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

Slots and pockets 281-292 Forms of thread 339


....
. .

Speeds and feeds . . 277, 305. 344-345 G76 cycle 350-355


Spherical end mill . . . 273 Hand of thread . . . . 358
Spindle control 77-86 Infeed methods . . . . 353
Constant surface speed .... 82 Lead error ... 347

Empty spindle 101 Maximum feedrate .... 346


Maximum spindle speed setting 84 Multistart threads 364

Spindle rotation 77 Pitch vs. lead 345


Spindle speed - CSS 305 Program testing 360

Spindle speed - RPM 81.277 Retract from thread 357


339
Startup
Spindle functions
Spindle orientation .
... . .
21.59.77
21.60.80.203
79 Single point threading

Speeds and feeds


Tapered thread
. . . .
344-345, 364
361

Spindle speed formulas 82 Terminology 340


English version 37 Thread forms 360
Metric version 37 Thread recutting 366
Spindle speed override 21. 27 Threading process 341

Spindle stop 80 Threading to a shoulder .... 358-359


Spotfacing 207 Tooling reference 348
Status block 65 Tool function 93-106

Stock allowance 202. 303 Chip-to-chip time 95

Stock removal 307 Lathes 103

Stored stroke limits 30 Machining centers 93

Subprograms 367-380 Tool indexing - lathes 103

100 000 000 hole grid 379 Tool length offset . . . 126,131-142.387
Development strategies .... 373 Cancellation 141

Grooving applications 334 Change of offset 140

Identification 368 Datum shift 387


M98-M99 functions .... 368 Distance-To-Go calculation 133
Multi-level nesting 377 G43-G44 difference 136
Numbering methods 371 Horizontal application 141.432
Protected subprograms .... 373 Offset commands 132

Repetition 369 Used with G54-59 139

Subprogram call .... 368, 370 Used with G92 138


Subprogram end 58. 368 Tool length setup ....... 133

Using B-axis 434 Off-machine 134,432


Symbols in programming 4b Offset register 134
On-machine 133,432
Preset tool length 135
Using master tool 136

T Tool magazine

Tool memory
Fixed type
type
.... ......
8, 93

94
94
Random memory type . .

Tailstock functions . . . . . 410 Tool nose radius offset 266

Taper programming 309.311 Change of motion direction 268

Tapers ... 361-363.475-476 Radius offset commands 266


Tapping .... . 209 R-settmg
....
. . . 106

Check list ... 212 Tool tip orientation . . 266


106
Pipe taps . 211 T-setting

210 Tool number registration 94


Speeds and feeds
Tap chamfer geometry 210 Tool offset registers 104

geometry 210 Geometry offset 104


Tap flute

Tap geometry ... 210 Wear offset 105


114
Tapping mode 89 Tool position setting . . . .

215 Tool setup groups 116


Tapping on lathes . .
504 Index

Center line tooling 116 Web drilling 208

External tooling .
117 Word address format 42

Internal tooling 117 Multiple addresses 45


38 Order of words in block 51
Tooling selection.

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 - G-codes 49 Additional work offsets 124,387


54 Common offset (COM) 128
Turning - M-codes
293-306 Datum shift 387
Turning and boring .

Turning tools .
130,293 Defaults 174,386

Turret indexing .
412 External offset (0a) 128,387
G54-G59 commands 1 23- 1 30. 386

Horizontal machine application 127,431


Lathe applications ... 128
Startup 124
Work areas available 123
Work offset change 125
Z-axis application 126

160 Work sketch 40


U/W commands
Undercut programming .
. 304

Z-axis neglect 28

W-axis 10

Wear offset 105,129,254


Adjustment 106
NOTES 505
506 NOTES
NOTES 507
Programming Handbook
Second Edition

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

To install, close all applications and follow on-screen instructions.

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.

Peter Smid is a professional consultant, educator, and speaker, and has


many years of practical, hands-on experience with CNC and CAD C AM applications on all levels.

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.

INDUSTRIAL PRKSS INC.


989 Avenue of the Americas, New York. \Y 10018
TLL: 212-889-6330 TOLL-I RFF 1-888-528-7852
FAX: 212-545-8327
Web Address: wvvvv industrialpress.com
I mail: info(« industrialpress.com

You might also like