You are on page 1of 529

CNC

Programming
H ndbook
Second Edition
c C
Programming
Handbook
Second Edition
A Camp hensiv uid Practical CNC rogramming

t r mi

989 ue York, NY lOO 18


.com
Li of Congress Cataloging-in-Publication Data

Smid, Peter.
CNC programming handbook: comprehensive guide to practical CNC programming!
Smid.

11-3158-6
1. Machine-louls--Numerical control--Programming --Handbooks, manuals,etc ..I.
Title.

TJ1189 .S 2000
1.9'023--dc21
00-023974

Second on

CNC Programming Handbook

Industrial Press Inc.


989 ue of Americas, w York, NY 10018

Copyright 2003. in the United States America.

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


system. or transmitted in any form without tbe permission of publishers.

5678910
Dedication
To my my mother dmila,
who never to give
Acknowledgments
In this second edition of the CNC Programming Handbook, I would like to express my
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 I might have missed otherwise. To Ed Janzen, I thank for the many suggestions he of-
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 eNC Software Inc.,


Tolland, CT, USA

• 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
Smid is a professional consultant, educator and with many of practi-
experience, in the industrial and ed his career, he has
an extensive experience with CNC and CAD/CAM on all levels. He
to manufacturing industry and educational ns on practical use of Com-
Numerical Control technology, part programm
ro.-.'7iOl"'I CAD/CAM, advanced ma-
chining, tooling, setup, and many other related comprehensive industrial back-
ground in CNC programming, machining and company training has assisted
hundred companies to benefit from his wide-rang knowledge.
Mr. long time association with advanced companies and CNC ma-
chinery vendors, as well as his affiliation with anum of Community and Technical Col-
industrial technology programs and skills training, have enabled him to
broaden his professional and consulting areas of CNC and CAD/CAM training l

computer applications and evaluation, system benchmarking.


programming, hardware and operations management.
Over the years Mr. Smid has
l hundreds of customized
tional programs to thousands of at colleges and universities
.rliOTtTc.'

across United States, Canada and as well as to a large number of manufacturing


companies and private sector individuals.
He has actively participated in many shows, conferences, workshops
various seminars, including delivering presentations a
of speaking engagements to organizations. He is also the author
and many in-house publications on of CNC and CAD/CAM. During his
years as a professional in the CNC educational field, he has developed tens
of thousands of pages of high quality training materials.

The author suggestions and other input and industria! users.


You can e-mail him through the publisher of this handbook of the CD.

You can also e-mail him from the CNC Programming Handbook at www-industriaipress.com
TABLE OF CONTENTS
1 ~ NUMERICAL CONTROL 1 Axes and Planes 16
Point of Origirl 16
Ouadrarlts. 16
DEFINITION OF NUMERICAL CONTROL
Right Hand Coordinate System 17
NC and CNC Technology.
MACHINE GEOMETRY. 17
CONVENTIONAL AND CNC MACHINING 2 Axis Orientation - Milling . 17
NUMERICAL CONTROL ADVANTAGES 2 Axis Onenlation - Turning. 18
Setup Time Reduction 3 Additlona! Axes. 18
Lead Time Reduction. 3
Accuracy and RepealabiliJy 3
Contouring of Complex Shapes. 3 5 - 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
Mills and 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 Parameter Settings 22
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
Vertical Machining Centers. 8
Rapid Motion Override. 26
Spindle Speed Override 27
Horizontal Machi ning Centers 9
Feedrale Override. 27
HOrIZontal Boring Mill 10
Typical Specifications 10
Dry Run Operation 27
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 G raphlD 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
13
Machining Cycles. 30
Four-axis Lathe.
Six-axis Lathe 13 Cutting Tool Animation. 30
Connection \0 External DeVices 30
FEATURES AND SPECIFICATIONS 13
Typical Machine Specifications. 13
Control Features 14 6 - PROGRAM PLANNING 31

STEPS IN PROGRAM PLANNING 31


4 - COORDINATE GEOMETRY 15
INITIAL INFORMATION 31
REAL NUMBER SYSTEM 15 MACHINE TOOLS FEATURES. 31
Machine Type and Size. 31
RECTANGULAR COORDINATE SYSTEM. 15

ix
X Table of Contents
---------~-.-. - --------_.-... --- - --

Control System. 31
PART COMPLEXITY 32 8 - PREPARATORY COMMANDS 47
MANUAL PROGRAMMING 32
DESCRIPTION AND PURPOSE. 47
Disadvantages . 32
Advantages 32 APPLICATIONS FOR MILLING. 47
CAD/CAM AND CNC 32 APPLICATIONS FOR TURNING 49
Integ ration 33 G CODES IN A PROGRAM BLOCK 50
Future of Manual Programming 33 Modality of G-commands. 50
TYPICAL PROGRAMMING PROCEDURE 33 Conflicting Commands in a Block 50
Word Order in a Block 51
PART DRAWING 34
GROUPING OF COMMANDS 51
Title Block. 34
Dimension ing 34 Group Numbers 51
Tolerances. 35 G CODE TYPES. 52
Surface Fintsh 35 G Codes and Decimal POln! _ 52
Drawing ReVisions 36
Special InSHucllons 36
METHODS SHEET. 36 9 - MISCELLANEOUS FUNCTIONS 53
MATERIAL SPECIFICATIONS 36
Malerial Unlformit)' 36 DESCRIPTION AND PURPOSE. 53
Machinability Rating. 37 Machine Related Functions . 53
MACHINING SEOUENCE 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 MOl Functions. 54
TECHNOLOGICAL DECISIONS 38 Application Groups 54
Cutter Path 38 M FUNCTIONS IN A BLOCK 55
Machine Power Rating. 39 StarlU p of M Functions. 56
Coolants and Lubricants 39 Duration of M Functions .sf)
WORK SKETCH AND CALCULATIONS 40 PROGRAM FUNCTIONS 56
Identification Methods. 40 Program Stop 56
QUALITY IN CNC PROGRAMMING 40 Oplional Program Stop. 57
Program End. 58
Subprogram End !'iR
7 ~ PART PROGRAM STRUCTURE 41 MACHINE FUNCTIONS 58
Cooiant Functions 58
BASIC PROGRAMMING TERMS 41 Spindle Functions. 59
O-lsr3cter 41 Gear Range Selection 60
l/-Jcr0 41 Mil r. hi n e Ac:r.ess ori flS flO
41
42
PROGRAMMING FORMATS 42
10 - SEQUENCE BLOCK 61
WORD ADDRESS FORMAT 42 BLOCK STRUCTURE 61
FORMAT NOTATION 43 8u ildlng the Block Structure 61
43 Block Structure for Milling 61
System Formal 43 PROGRAM IDENTIFICATION 62
System Format·
44
Word Addresses'
45 Program Number 62
ProgrClm Nome. 62
SYMBOLS IN PROGRAMMING 45
SEQUENCE NUMBERS 63
and ivli nus Sign. 45
Sequence Number Command. 63
PROGRAM HEADER 45 Sequence Block Format 63
TYPICAL PROGRAM STRUCTURE. 46 Numbering Increment 64
Long Program:> Dnd Block Numbers. 64
END OF BLOCK CHARACTER. 64
STARTUP BLOCK OR SAfE BLOCK 65
xi

PROGRAM COMMENTS Exact Command 89


CON NG WORDS IN A BLOCK 66 Exact Mode Command 89
Automatic Corner Override 89
MING VALUES 67 Mode 89
ITY. 68 Mode 90
90
Circular Morion Feedrates 90
11 - INPUT OF DIMENSIONS 69
MAXIMUM 91
Maximum Feedrate Considerations, 91
AND METRIC UNITS 69
Unit Values 70 AND OVERRIDE
Feedhold SWitch 91
AND INCREMENTAL MODES 70 Feedrate Override Switch 91
Commands G90 and G9l . 71 Feedrate Override Functions 92
Absolute Oats G90 72
- G91 72 E IN THREADING 92
Combinations in a Block 72
PROGRAMMING 73 14 - TOOL FUNCTION 93
MINIMUM MOTION INCREMENT.
DIMENSIONAL INPUT 73 T FUNCTION FOR MACHINING 93
FuJI Address Forma! , 74 Tool Storage Magazine 93
Zero 74 Fixed Tool Selection, 94
Decimal Point Programming, 75 Random Memory Tool Selection 94
Input 76 Regist8T1flg Tool Numbers 94
Programming Format 95
CALCULATOR TYPE INPUT 76
Empw Tool or Dummy Tool 95
TOOL CHANGE FUNCTION - M06 . 95
12 • SPINDLE CONTROL Conditions for Tool 95
AUTOMATIC TOOL 96
SPINDLE FUNCTION 77 ATC System 96
Spindle Speed Input, 77 MaXimum Tool Diameter 97
DIRECTION OF SPINDLE ROTATION 77 Maximum Tool Length 97
MaXimum Tool Weight. 97
Direction for Milling 78 ATC Cycle, 98
Direction for Turning. 78 MDIOperatlon 98
Direction Specilication , 79
Spindle Startup 79 PROGRAMMING THE 98
Single Tool Work 98
SPINDLE STOP. 80
Programming Several Tools. 99
ORIENTATION 80 Keeping Track of Tools, 99
SPEED - R/MIN 81 Any Tool in Spindle - Not the First. 99
First Tool in the 100
81 No Tool in the 101
Material 81 First Tool In the Spindle with Manual 101
Spindle Speed - Units 82 No Tool In the Spindle With Manual 102
Spindle Speed - Metric Units 82 First Tool In the Spindle and an Oversize Tool 102
CONSTANT SURFACE 82 No Tool in the Ie and an Oversize Tool 102
Maximum Spindle SpAAri 84 T FUNCTION FOR 103
Part Diameter Calculation in 85 Lathe Too! Station 103
Tool 103
TOOL 104
13 - FEEDRATE CONTROL 87 Offset. 104
WAil( Off<:;At 105
FEEDRATE CONTROL < 87 Wear Offset 106
The Rand T 106
FEEDRATE FUNCTION. 87
Feedrate per Minute, 87
Feedrate per Revolution 88
15 - REFERENCE POINTS 107
FEEDRATE SELECTION 88
ACCELERATION 88 POINT G
xii

Relatlonshi p. 108 129


POINT Center Line Tools 129
Tools 130
Zero, . 109 Tools 130
POINT 109 Command Point and Tool Work Offset 130
109
Centers. 110
112 19 ~ TOOL LENGTH OFFSET 131
TOOL POINT 112
PRINCIPLES 131
131
16 - RE MMANDS 113 131
Face. 132
POSITION REG COMMAND 113 OFFSET COMMANDS 132
Position Definition 3 Distance-Ta-Go in Z AXIs. 132
Proqrammlnq Format 13 SETUP
Tool Position 114
On-Machine Tool Length Selting 133
MACHINING 114 Off·Machlne Tool Setting 134
Tool Set at Machine Zero 114 Tool Offset Value Register. 134
Tool Set Away from Machine Zero. 114
Z AXIS 1
Position in Z )\xis . 115
Pres~t Tool "135
115
Tool length Touch Off 135
LATHE APPLICATION. 115 a Master Tool 136
Tool Setup . 116 Drfference 136
Three-Tool Setup Groups 116
PROGRAMMING 137
Center line Tools Setup. 116
External Tools Setup 117 Tool Offset not Available. 137
Internal Tool Setup. 117
Tool Length Offse1 and G92 138
Tool Offset and G54·G59 138
Corner Tip Detail . 117
Programmtr'\g Example 117 Tool Length Offset and Tools 139
CHANGING TOOL OFFSET. 140
HORIZONTAL APPLICATION. 141
17 - POSITION COMPENSATION 119
TOOL LENGTH 141
DESCRIPTION. 119
Programming Commands 119 20 - RAPID POSITIONING 143
Programming Formar 119
Incremental Mode 120
Motion Length Calculation. 120 RAPID TRAVERSE MOTION 143
Position Compensation Along the Z axis 122 GOO Command 143
G47 and G4B. 122 RAPID MOTION TOOL 144
Face Milling. 122
Single Axis MOllon . 144
Multiaxis Motion. 144
Angular Motion. 146
18 WORK OFFSETS
d 1 Reverse Rapid Motion 146
TYPE OF MOTION & 146
WORK AREAS AVAILABLE 123
124
OF RAPID MOTION 147
Additional Work Offsets
WORK OFFSET DEFAULT AND 24
MOTION FORMULAS, 147
Work Offset Change 125 TOTHE PART 148
Z Axis Application 126
HORIZONTAL MACHINE APPLICATION. 127
21 - MACHINE ZERO RETURN 149
OFFSETS. 128
1 MACHINE REFERENCE POSITION
of Offsets. 128 Machining Centers. 149
Offset 128 lathes. 150
Offset 129 the Machine Axes 150
and Offset Numbers 129 Program Commands 151
Command Group 151
xiii

RETURN PRIMARY MACHINE 151 LONG 175


Intermediate Point . 151 Machine 175
Absolute and Incremental Mode 152 X AXIS is the Axis, 176
Return from the Z Depth Position 153 and Dwell, 176
Return Required for the ATe, 155
Zero Return for CNC Lathes 155
FIXED AND DWELL. 176
POSITION CHECK COMMAND. 156
FROM MACHINE RO POINT. 157 CYCLES 177
SECONDARY MACHI 158
POINT-TO-POINT MACHINING 177
Tool Motions VS, Fixed Cycles, 178
- LINEAR INTERPOLATION 159 FIXED SELECTION 178
FORMAT 179
LIN COMMAND 159
180
Starr and End of the Linear Motion 159
Single Axis Linear Interpolation . 159 AND 180
Two Axes Linear Interpolation 160 INITIAL LEVEL SELECTION 181
Three Axis Linear Interpolation 160
R LECTION . 181
PROGRAMMING FORMAT 160
Z CALCULATIONS 182
LINEAR FEEDRATE 161
Feedrate Range 161
PTION OF FIXED CYCLES 183
Individual Axis Feedrate , 161 G81 Drilling Cycle, 183
G82 Spot-Drilling Cycle, 183
PROGRAMMING EXAMPLE 162 G83 - Hole Drilling Cycle Standard 184
G73 Hole Drilling 184
G84 Cycle - Standard 186
~ BLOCK SKIP FUNCTION 163 G74 - Tapping Cycle - Reverse 186
G85 - Cycle, 187
G86 Cycle, 187
TYPICAL APPLICATIONS, 163
G87 Backboring Cycle , 187
BLOCK SKIP SYMBOL 1 G8S - Boring Cycle , 188
CONTROL UNIT SETTING 163 G89 Boring Cycle, 188
G76 P(€cision Bonng 189
SKIP AND MODAL COMMANDS 164
F CYCLE CANCELLATION 189
1
Variable Stock Removal 165
FIXED CYCLE REPETITION 189
Machining Pattern 166 The L or K Address. 190
Trial Cut for 68 LO or KO in a Cycle , 190
Program Proving, 69
Barfeeder Application, 170
Numbe(ed Block Skip, 170 26 - MACHI HOLES 191
SINGLE HOLE EVALUATION. 191
24 - DWELL COMMAND 171 Tooll ng Selection and Applications, 19i
Program Data , 194
PROGRAMMING APPLICATIONS 171 DRILLING 0 194
for 171
Types of Drilling 194
for Accessories 171
Types of Drills 194
DWELL COMMAND 171 Progiamming ConsIderatIons, 195
Dwell Command Structure, 172 Nominal Drill Diameter 195
Effective Drill D,ameter 195
DWELL 172 Drill Pomt 195
SETTING AND DWELL 173 Center 196
Through Hole 196
Time 173
Number of Revolutions Setting 173
Blind Hole 197
Flat BoHom 197
MINIMUM 173 198
REVOLUTIONS 174 PECK DRILLING 199
174 Typical Peck 199
174 Calculating the Number of Pecks 199
xiv Table of Contents

Selecting the Number of Pecks _ 200


Controlling Breakth rough Depth. 200 28 - FACE MILLING 227
REAMING 201
Reamer Design 201 CUTTER SELECTION . 227
Sprndle Speeds for Reaming 201 Basic Selection Criteria 227
Feeorates for Reamir\~ 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 Milling Mode 229
Spindle Orientation_ 203 N uJrloer of Cuttiny IIlSl:;rls 230
Block Tools 203 PROGRAMMING TECHNIQUES 230
BORING WITH A TOOL SHIFT 203 Single Face Mill Cut 231
Precision Bormg Cycle G76 203 Multiple Face Mill CU1S 232
Backboring Cycle G87,
USING POSITION COMPENSATION. 233
Programming Example 204
Precau1ions in Prog ramming and Sew p_ 205
ENLARGING HOLES 205 29 ~ CIRCULAR INTERPOLATION 235
Counters inking 205
Counterborlng , 206
ELEMENTS OF A CIRCLE, 235
Spotfacing 207
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 Feedra1e . 210
Arc Cutting Direction 237
Pipe Taps. 2 1
Ci reular Interpolation Block. 237
Tapping Check List. 2'12
Arc Start and End POlntS_ 238
HOLE OPERATIONS ON A LATHE 212 Arc Center and Hadius 238
Tool Approach Motion 213 Arc Center Vectors, 238
Tool Return Motion, 213 Arc Planes 239
alld Reaming on Lathes, 214 RADIUS PROGRAMMING 240
Cycle - G74, 214
Blend Radius 240
Tapp!ng on Lathes 215
Partial Radius 240
Other Operations 216
FULL CIRCLE PROGRAMMING 240
80ss Milling 242
27 - PATTERN OF HOLES 217 Internal Ci rcle 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
FEEDRATE FOR CIRCULAR MOTION 245
STRAIGHT ROW HOLE PATTERN 218
Feedrate for Outside Arcs 246
ANGULAR ROW HOLE PATTERN 218 Feedrate for InSide Arcs. 246
Pattern Defined by Coordinates, 218
Patlern Defined by Angle L1~

CORNER PATTERN 220 30 - CUTTER RADIUS OFFSET 247


GRID PATTERN 220
Ang ular 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 Seleclion 226 PROGRAMMING TECHNIQUES 250
Order of Machining, 226 Direction of Cutting Motion 251
Table of Co ntents xv

or Right - not CW or CCW 251 Steel End Mills 276


=,f(set Commands 251 Solid Carbide End Mills 276
of the Cutler 252 Indexable Insen End Mills 276
of Offset Types 252 Relief Ailgles 276
Format 253 End Mill Size 276
r\ddr8ss H or D 7, 253 Number of Flutes 277
and Wear Oifsets L5Ll
SPEEDS 277
APPLYING CUTIER OFFSET 254 Coolants and Lubricants, 278
Methods, 254 Tool Chatter 278
Cffset Cancellation, 256
::::utter Direction 256
STOCK 279
Infeed . 279
WORKS 256 In and OUI Ramping 279
~:lok-Ahead Offset 257 Direction of Cut 279
for Look-Ahead Cutter Radius Offset 257 Width and of CUI 280
258
259
LOO 33 - SLOTS AND PO KETS 281
:JVERVIEW OF RULES 261
PRACTICAL EXAM . MILLING 262 OPEN AND
Part Tolerances 262 281
\,leasu red Part Size, ?fi2 Closed Boundary, 28
Offsets 263 RAMMING SLOTS
Amount General Selting, 263
Slot Example. 281
264
264
Closed Slot Example 283
265 MILLING.
2GO General Principles 284
265 Pocket 285
Data Nominal or Middle) 266
RECTANGULAR 285
TOOL NOSE US OFFSET 266 Stock Amount, 286
Nose 266 ",,,,,'nm!,,,r Amount 286
Offset Command!:: 266 of Cut _ 287
266 Semifinishing Motions 287
Offset 267 Tool Path 287
267 ular Pocket Program Example 288
268
268 CIRCULAR POCKETS,
Minimum Cutter Diameter _ 289
Method of 289
31 - PLANE SELECTION 269 Linear 289
Linear and Circular Approach, 290
ng a Circular Pocket, 291
WHAT A 269 CIRCULAR POCKET 292
MACHINING IN PLANES 269
Mathematical Planes 269
Machine Planes, 270 - TURNING AN BORING 293
Program Commands for Planes Definition, 270
Default Control Status 271
FUNCTION - TURNING 293
STRAIG MOTION IN 271 T Address 293
CIRCULAR INTERPOLATION IN LATHE OFFSETS 294
G 17-G 18-G 19 as Modal Commands 272 Offset Entry 294
Absence of Axis Data in a Block, 272 Independent Tool Offset. 294
Cutter Radiu:J Otr~et in Planes 273 Tool Offset With Motion. 295
PRACTICAL EXAMPLE 273 Offset 295
FI D IN PLANES MULTIPLE 295
296
296
32 - PHERAL MILLIN 275 Shoulder Tolerances 297
Diameter and Shoulder Tolerances, 297
OFFSET SETTING, 298
XVI of

FUNCTIONS RANGES 298 G70 Cycle Format - All Controls, 320


AUTOMATIC BASIC RULES FOR G70-G73 1
299 G74 - PECK DRILLING CYCLE 1
301
301 G74 Cycle Format· lOT111T/15T 32
301 G74 Cycle Formal- OT/lOT/18T/20T/21 321

302 G75 • GROOVE CUTTING


302 G75 Cycle Formal 10T/l1T/15T 322
Fillish 303 G75 Cycle Format· aT /16T/18T/20T/21T 322
Stock and Stock Allowance 303 BASIC RULES FOR G74 AND 322
A 304
IN CSS MODE 305 36 - GROOVING ON LATH 323
FORMAT. 306
306 GROOVING OPERATIO 323
306 Main Grooving AP~)IICEmOflS 323
306
Grooving Crltena , 323
GROOVE 323
307 Nominal Insert S]ze. 324
Insert Mool fit;i1tion 324
REMOVAL ON LATHES 307 GROOVE LOCATION 324
307 GROOVE 324
307 Groove Position 325
307 Groove 325
- STRAIGHT CUTTING CYCLE 308 325
Format 308 326
Turning Example 309 Groove Width Selection 327
Cutting 309 Method 327
ht and Taper Cutting Example 311 328
. FACE CUTTING CYCLE. 312 Groove Tolerances 329
Format 312 Groove Surface Finish, 330

MULTIPLE REPETITIVE CYCLES. 313 330


313 330
313 Radial Clearance 33
and Part Contour. 313 331
Ch,pbreaking Cycles 313
/ NECK GROOVES
CONTOUR CUTTING CYCLES
GROOVING CYCLES. 332
Boundary Definition 314
Stan Point and tile Points P and 0 . 314
Applications , 332
Groove with G75 . 333
TYPE I AND TYPE II CYCLES. 315 Multiple Grooves with G75. 333
Programming Type I and Type II 315 GROOVES
315
GROOVES AND SUBPROGRAMS
G71 . STOCK REMOVAL IN TURNI 315
G7 Format- OT/llTI15T 316
G71 Format - OT/16T/18T/20T/21T 316 - PART-OFF
G71 for External Roughing. 316
G71 for Internal 317
Direction of G7 . 317 PART-OFF PROCEDURE 335
G72 - STOCK REMOVAL IN FACING. Parting Tool Description. 335
317
Tool Approach Motion 336
G72 Cycle Format - 10TI1 317 Stock Allowance. 337
G72 Cycle Format - OT/16TI18T/20T/21 318 Tool Return IVlotion . 337
G73 - PATTERN REPEATING 8 Part-off with a Chamfer 337
G73 Cycle Form<:lt - 10T/1 H/15T .il R Preventing Damage to the Part 338
G73 Cycle Format· OT/16T/18T/20T/21T 319
G73 Example ot Panern 9
G70· CONTOUR FINISHING
38 - SINGLE POINT THREADING 339
Table xvii

TH ON CNC LATHES 339


Form of a Thread. 339 39 - SUBPROGRAMS
Operations. 340
TERMINOLOGY OF THREADING 340 MAIN PROGRAM SUBPROGRAMS
PROCESS 341 Subprogram Benefits . 367
ItJtJll\iflci;ltiull (.)f n::; 368
in 341
Thread Starl Position 342 SUBPROGRAM FUNCTIONS.
Thread Diameter and 342 ram Call Function . 368
Thread Cutting Motion 343 Subprogram End FunClion. . 368
Retract from Thread 344 Block Number to Return to. . 369
i1eturn to Stzlrt Position 344 Number of ram Repetitions 369
THREADING FEED AND SPINDLE 344 LO Call. 370
Feedra1e Selection. 345 1
Ie Speed Selection. 345 372
Maximum Threading Feedrate 346 373
Lead Error 347
SU DEVELOPMENT.
REFERENCE POINT 348 Pattern Recognition 373
BLOCK-BY-BLOCK THREADING 348 Tool Motion and Subprograms . 374
349 Modal Values and Subprograms. 375
THREADING
MULTI NESTING
MULTIPLE REPETITIVE 350
G76 Format- lOT/11T/15T 350
One Level Nesting 376
G76 Format· OT/16T/18T . 351
Two Level 376
Three Level 377
Programming Example 351
Four Level Nesting . 377
First Thread Calculation 352
377
THREAD INFEED 353
378
Radial Infeed . 353
Compound Infeed 353 CHANGE SUBPROGRAM 379
Thread Insert Angle· Parameter A 354 100000 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 357 DATUM SHIFT WITH G92 OR 381
Thread Pullout Functions 357 Zero Shift. 381
Single AXlS Pullout 357 COORDINATE SYSTEM 383
Two-Axis Pullout 357 G52 Command 384
HAND OF THREAD COORDINATE 384
THREADING TO A S 358
386
Insert iv'lod Ification . 358 Dat<'l Command 386
Program Testing. 360 Coordinate Mode 386
OTHER THREAD RMS. WORK OFFSETS . 386
Thread Depth . 360
Slandard Work Offset 386
TAPERED 361 Additional Work Offset Input. 387
Depth and Clearances 361 External Work Offset Input. 387
Taper Calculation 361 LENGTH OFFSETS. 387
Block Block 362 Valid Input Range 388
Tapered Thread a 363
Tapered Thread and a MultI Cycle. 363 CUTTER RADIUS 388
MULTISTART 364 LATHE OFFSETS 388
Threading Feedrate Calculation, 364 MOl DATA SETTING 389
Shift Amount 365
366
PROGRAMMABLE ENTRY, 389
Modal G10 Command. 389
THREAD Parameters Notation 390
Program Portability, . 390
Bit Type Parameter. , 391
Effect of Block Numbers 392
xviii of ntenls

ATIACHMENT. 413
41 - MIRROR IMAGE 393 Bar 413
ADDITIONAL OPTIONS 414
RULES OF MIRROR IMAGE 393 4 '14
393 414
394 4'15
394 415
394
395
PROGRAMMING EXAMPLE 415
395
395
45 - HELICAL MILLING 417
MIRROR IMAGE BY 395
Control Setting 395
. Manual Mirror Setting 396
HELICAL MILLING OPERATION 417
417
E 396 Format, 417
Mirror Functions 396 Arc Modifiers for 4'18
Mirror Image Example 397 and 18
Mirror Image Example 398
THREAD MILLING, 418
MI IMAGE ON CNC 398 Thread 418
Conditions tor Thread 418
Thread 4'19
42 ~ COORDINATE ROTATION 399 419
Clearance Radius 419
Productivity of Thread 419
COMMANDS. 399
Center of Rotation , 399 THE HELIX, 419
Radius of Rotation 399 THREAD MILLING 421
Coordinate Rotation Cancel 401
Straight Thread 421
Common Applications 401
In itial Calculations 421
APPLICATION 401 Starting Position 422
Motion Rotation and Direction 422
Lead'in Motions , 423
43 - SCALING FUNCTION 405 Thread Rise Calculation 424
Milling the Thread 424
Lead-Out IV" 1,lIn." 425
PTION. 405 425
Function Usage . 405 425
PROGRAMMING FORMAT 405 425
426
406
406 THREAD MILLING SIMULATION METHOD 426
407 HELICAL RAMPING 427
407

46 - HORIZONTAL MACHINING 429


44 - CN LATHE ACCESSORIES 409
INDEXING AND ROTARY 429
CHUCK CONTROL INDEXING TABLE (8 AXIS) 429
Chuck Functions 409 Units 01 Increment _ 429
Chucking Pressure 410 ,130
Chuck Jaws, L110 and Unclamp Functions 430
TAILSTOCK AND 410 .nl'l,<'Vlrv't in Absolute and Incremental Mode, 430
TSllslock 410 B AND OFFSETS 431
Quill. 11 Work Offset and B Axis 431
Center, 41 I Tool Length Oflset and B Axis 432
Quill Functions 411
Programmable Tailstock 411 TO MACHINE ZERO 434
Safety Concerns, 411 INDEXING AND A SUBPROGRAM 434
81-DIRECTIONAL INDEXING 412 COMPLETE PROGRAM EXAMPLE 436
Programming 412
MATIC PALLET CHANGER· 437
Tab Ie of Contents XIX

438 RUNNING THE FIRST PART 459


438 PROGRAM CHANGES 460
439
Program Upgrading 460
Program StruclU re 439
Program Updating . 461
BORING MILL. 439 Documentation Change, 461
ALTERNATE MACHINE SELECTION. 461

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


eNC MACHINING AND SAFETY. 462
WRITING. 441 SHUTTING DOWN A CNC MACHINE 463
442 Emergency Stop Switch, 463
442 Parking Machine Slides 464
442 Setting the Control System, 464
'JGRAM OUTPUT FORMATTING 443 Turning the Power Off, 464

445 EQUIPMENT MAINTENANCE 464


PROGRAMS
Length Reduction. 445
Mode and Tape Mode 4<16
51 - INTERFACING TO DEVICES 465
48 - PROGRAM DOCUMENTS 447 RS~32CINTERFACE . 465
PUNCHED TAPE 466
- '~,A FILES 447 Tape Reader and Puncher 466
- -- DOCUMENTATION 448 Leader and Trailer 468
Tape Iden11fication 468
Documentation, 448 Non-printable Characters 468
.- Documentation . 448 Storage and Handling, 468
DeSCription 449
DISTRIBUTED NUMERICAL CONTROL 468
AND TOOLING SHEETS. 449
Sheet 450 TERMINOLOGY OF COMMUNICATIONS 469
450 Baud Rate 469
451 Parity 469
Data Bits" 469
_.::UMENTATION FILE FOLDER 451 469
Start and Stop Bits ,
:, ',-:atlon Methods 451
'":'''llor'S Suggestions 452 DATA SEITING 469
and Storage 452 CON NECTING CABLES 470
Null Modem 470
Cabling for Fanuc and PC 470
w PROGRAM VERIFICATION 453
CTION OF ERRORS. 453 52 - MATH IN CNC PROGRAMMING 471
Measures 453
Measures 453 BASIC ELEMENTS 471
VERIFICATION, 454 Arithmetic and Algebra . 471
Order of Calculations, 471
ERRORS 454
455 GEOMETRY 472
Errors .
Errors. 455 Circle 47?
PI Constant" 473
',iMON PROGRAMMING ERRORS 456 473
Circumference of a Circle
Input Errors 456 Length of Arc , 473
"dation Ermrs 456 Quadrants 473
Errors . 456
456 POLYGONS 474
: 'i!ilncous Error:J ,
TAPERS 475
Taper Definition 475
- eNC MACHINING 457 Taper Per Foot 476
Taper Ratio. 476
:HJNING A NEW PART 457 Taper Calculations - English Un its 476
Taper Calculations - tv-letnc 476
458
Integrity 458 CALCULATIONS OF TRIANGLES. 477
XX

477 Hardware Specifications. 487


478 Hardware Requirements, 488
478 and Features, 488
S;ne ~ Cosine - Tangent 479
Inverse Trigonometric Functions 480
Degrees and Decimal 480 Post Processor L188
Pythagorean Theorem 480 IMPORTANT FEATURES. 489
Solvfng Rjght 481 489
ADVANCED CALCULATIONS 482 489
User Interlace, 489
CONCLUSION. 482 CAD Interface, 489
MANAGEMENT,
53 - CNC AND CAD/CAM 483 490
490
490
PROGRAMMING MANUALLY? 483
483 THE END AND INNING.
483
TOOL PATH GEOMETRY PMENT 484 A - RE NeE TABLES 491
TOOL PATH GENERATION 484
COMPLETE ENVIRONMENT 484 491
Multi Machine Support , 485 494
Associative Operations 485
Job Setup 485 494
Tooling List and Job CommenlS, 485 495
Connection Between Computers 485
Text Editor 486 Metric rse Threads 495
486 Metric Fine 495
486
486
for Solids 486 Index 497
Software Specifications , 487
NUMERICAL CONTROL

Numerical Co~trol technology as it is known today, • Ne and eNC Technology


emerged nud 20th It can be traced to the year
of1952, u.s. Air Force, names Parsons In ~trict to the terminology. there is a
and the Massachusetts of Technology in ence m the meaning abbreviations NC and CNC.
MA, It was not production manu- NC for the original Numerical Control
facturing until 1960's. real boom came technology, whereby abbreviation stands for the
of CNC, the of 1972, a decade newer Co~nputeriz~d Numerical Control technology, a
v.:ith introduction of micro computers. The mode~ spm-off of lts older However, practice,
hIstOry and development of this fascinating technology has eNC IS the abbreviation. To clarify the proper us-
been well documented publications. af each tenn, look at the major between
CNC ,.."~ ..~~,,
In the manufacturing field, and particularly in the area of
working, Control has . . "' . . ."''"' .... Both perform the same tasks,
SOlnethuJll"Z of a revolution. in the computw bon of the purpose machining a
ers became standard in every company and in cases, the internal design of the system the
the machine equipped with Numerical logical instructions that process the data. At this point
SVS1leIn fOWld their special place in the
ends.
shops. recent evolution of electronics the The system (as to the CNC system) uses a
never ceasing computer development, including its impact fLXed logical functions, that are built-in and
on Numerical Control, brought changes to nently wired the control These LI..llI',",U'JJJ"
the manufacturing sector in general metalworking in- not be changed by the programmer or machine
dustry in particular. tor. Because of t?e ftxed wiring logic,
control IS synonymous with the term 'hardwired',
DEFINITION OF NUMERICAL CONTROL The can interpret a part program, but it does not al-
VH...."AF>.~.., to the using the
In publications and articles, descriptions away from the
have been used during the to defme what Numerical typically in an environment. the NC
Control It would be to try to yet another quires the compulsory use of punched tapes for
defInition, just the purpose this handbook. Many of information.
defmitions the same same basic COl1lcer:)t. The CNC but not the NC system,
use different uses an internal micro (i.e., a computer). This
The of all the known definitions can be summed storing a variety of
simple statement: routines that are capable logical
That means programmer or the machine '"'''"'''....,.~,''..
can change the on the control itself (at ma-
chine), with instantaneous results. flexibility is
greatest advantage of CNC systems probably
key element that to such a use of the tech-
UI.-UUHl) are of the of alpha- nology in modern manufacturing. The CNC programs and
selected symbols, for a decimal the logical are stored on special computer chips,
sign or the parenthesis symbols. All in- as software rather by
"'''''HV''':> are urn·.......... in a logical a predetermined c.onnections, such as that control the logical
collection of all instructions necessary to ma- hOns. contrast to the system, the system is syn-
a part is called an NC Program, Program, or a onymous with the term 'softwired'.
""w,t:rY,I'1'" Such a can be for a future When describing a particular that to the
repeatedly to identical machining re- control technology, it is customary to use
or in mind NC can also mean
CNC 1n everyday talk, but can never to the

1
2 Chapter 1

technology, described in this handbook under the abbrevia- Ish quality are the most typical problems in conventional
tion ofNe. The 'C'stands for Computerized, and it is machining. Individual machinists may own
not applicable to hardwired All 'proven' methods, different from a f their feHow
manufactured today are of the design, Abbreviations leagues. Combination of and other factors create a
such as C&C or C 'n are not correct and reflect poorly on great amount of
anybody uses them
machining under numerical control does away with
the majority of inconsistencies. It does not require the same
CONVENTIONAL AND CNC MACHINING physical as machining. Numerically
contToned machining does not need any levers or dials or
What makes 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 chining does. the has it
benefits? If the CNC and the conventional machining pro- can used number of over,
cesses are a common general approach to ma- consistent That does not mean there are no limiting
chining a part will -....-.M- cutting tools do wear out, material blank in
one batch is not identical to the material another
1. Obtain and study drawing batch, the setups may vary, etc. factors should be
2. Select the most suitable machining method considered and compensated for, whenever lICI.'C~~ru
3. Decide on the setup method (work holding)
4. Select the cutting tools emergence of the numerical control technology does
5. Establish and not mean an instant, or even a long tenn, demise of all man-
6. Machine part ual There are times when a traditional machin-
ing method is preferable to a computerized method. For ex-
This same both types of macrun- ample, a simple one time job may be done more efficiently
mg. IS m way how data
on a machine a CNC machine. Certain
are input. A feedrate 10 inches per minute (10 mlmin) is
of machining jobs will beneHt from manual or semiauto-
the same in manual or CNC applications, but the method of machining, rather than controlled ma-
applying it is not. The same can be about a coolant it
chining. CNC machine are not meant to replace
can be activated a knob, pushing a switch or every manual machine, only to supplement
programming a special All will result in
a coolant rushing out of a HV"........... In many the whether
a certain amount of knowledge on part user is ing will be done on a CNC machine or not is based on
required. alL working, particularly meta! cut- number of required parts and nothing Although the
ting, is mainly a skill, but it is also, to a great an art volume of parts machined as a is always an important
and a profession of large number of people. So appli~ criteria, it should never be the only factor. Consideration
of Computerized Numerical Control. Like any skill should be to complexity, tolerances,
or art or profession, it to the detail is neces- the required of fmish, etc. Often, a
sary to be successful. It takes more than technical know 1- complex part will benefit from CNC machining, while
to be a CNC machinist or a CNC Work relatively parts will not.
I>v?,"'....."...... ,'... and what is called a
'gut-feel', is a much needed supplement to any skill. Keep in mind that numerical control has never machined
a single part by Numerical is only a process
In a conventional machining, the operator sets or a method that enables a machine tool to used in a pro-
up the machine and moves each cutting using one or ductive, accurate and consistent
both hands, to produce the required part. The design of a
machine tool offers many features that help the NUMERICAL CONTROL ADVANTAGES
process of machining a - levers, and
a15, to name just a few. same body are re-
peated by the every in the batch. However, What are the advantages of numerical control?
the word 'same this context really means 'similar
It is important to know which areas of machining will
than 'identical '. Humans are not capable to every
benefit from it which are done the conventional
the same at all times - that is the of ma-
It is absurd to think that a two power mill
People cannot work at the same per[orrnam;e leve!
'-'UU.H..." .
win over jobs that are currently done on a twenty times
all the without a rest. All of US have some good and
more powerful manual mill. Equally unreasonable are ex-
some bad moments. The results these moments, when
applied to a part, are to predict. There of improvements cutting speeds
over a conventional machine. the machining
will some differences and within each
and tooling conditions are the same, the cutting rime will be
batch of The parts will not always be exactly the
same. dimensional tolerances and <""""f",,,,,, close in cases.
NUMER CONTROL 3

of the areas the CNC user can and lead time, required to and manufacture sev-
expect improvement: eral fixtures for conventional machi.nes can
be by preparing a part program the ~se of
o Setup time reduction
plified fixluring.
Cl lead reduction
o Accuracy and repeatability
• Accuracy and Repeatability
o Contouring of shapes high degree and repeatability of
has the single major benefit to
o Simplified tooling and work holding users. Whether the part program is stored on a disk or in the
o cutting time ~omputer or even on a tape (the method),
Il ah~'ays the same. program can changed
o General productivity increase at wlll, but on.ce proven, nO are usually required
area offers only a potential improvement. Individ-
more. A gIven can be reused as many times as
ual users will different of actual improve- nec:de,:t without a single bit it conlains.
ment, depending on the oil-site, the
program to allow such changeable factors as tool
CNC used, setup methods, complexity of wear and operating temperatures. it has to stored safely,
fixturing, or cutting tools, management philosophy but generally very little' from CNC pro-
engineering level of grammer or will required. The high accuracy of
individual attitudes, etc. CNC machmes and repeatability allows high quality
to produced consistently lime.
• Setup Time Reduction
• Contouring of Complex Shapes
CNC and machining centers are capable of con-
a variety of shapes. Many CNC users acquired their
only to able to handle A
are CNC applications in and automo-
tive , , ,The use of some form of computerized pro-
gramming IS Virtually mandatory for any dimensional
tool path at''''''''''''
shapes, as can be
of the the serup time :virhou.t the additional expense of making a model trac-
should not Modular lixturing, SI<l,n{llU'{l mg. Mirrored parts can achieved literally at the switch of
tooling, locators, automatic tool pallets and a bulton, of programs is a lot simpler than storage
other advanced features, the setup time more efficient of patterns, models, olher pattern
a comparable of a conventional With a making tools.
good knowledge modern manufacturing, productivity
can be increased significantly. • Simplified Tooling and Work Holding

, The of parts machined under one setup is Nonstandard and 'homemade' looling that clutters the
Important. order 10 assess the cost a time. If a benches and drawers around a conventional machine can
beelimin~led by looling, designed
number of is machined in one setup, the setup
cost per part can very" A very re- . num~ncal applications. Multi-step such as
pilot dnlls, step combination tools, counter borers
d~ctio~ can b~ achieved by grouping several different oper-
and are with several individual ;:'l<lIIU<l1
Dtlons IOto a .smgle setup. Even if the lime is longer, it
may be Justified when compared to time required to tools. tools are cheaper and to
setup conventional machines. than special and nonstandard tools. measures
have many tool to keep a low or even a
nonexistent inventory, increasing delivery to the
• lead Time Reduction
customer. Standard, off-the-shelf looling can usually ob-
a part program is written and proven. it is ready 10 tained faster then nonstandard LVVi""J'.,

!n the even at a nOtice. Although


l~e lead tor the run is usually it is virtually
. and work holding for CNC machines have only
ml for any run. if an one. ~aJor purpose - to hold the part rigidly in the same
to be modified. it pOSitIOn for all within a batch. Fixtures for
part requires
CNC work do nOI normally jigs, pilot and
can be done usually quickly, the lead
hole locating
4 pter 1

• Cutting Time and Productivity Increase Cl mills and Profilers


machine is commonly Cl EDM machines
is consistent. Unlike a
o Punch presses and Shears
the operator's skill, experi-
to changes) the CNe Cl cutting machines
machining is under control a computer. The small Cl
amount of manual work is restricted to the setup and load-
ing and unloading batch runs, the high o Water and Laser profilers
cost of the unproductive time is spread among many parts, o Cylindrical grinders
making it less main benefit of a consistent
Q
cutting time is jobs, where the production
scheduling and work to individual machine tools Cl and Spinning machines, etc.
can be done very "'v"''''''''''''''
centers and lathes dominate
The main reason COlnp:anlces ma- industry. These two groups share
chines is strictly prr,nnrn invesilmellt. Also, market just about equally. Some industries may a
having a competitive on of every higher need one of machines, depending on their
plant manager. technology offers needs. One must that there are many different
excellent means to a improvement in kinds of lathes and equally many different kinds of ma-
productivity the overall chining centers. the programming process for a
of the manufactured Like any means, it has to vertical is to the one for a horizontal ma-
wisely and When more and more chine or a simple mill. Even between different ma-
companies use the CNC just having a CNC chine groups, there is a amount of general
machine does not offer the extra anymore. The com- hons and the is generally the same.
panies that get forward are who how to use the For example, a contour with an end mill has a lot
technology efficiently and it to competitive in common with a contour cut a
the global economy.
To reach the goal of a
• Mills and Machining Centers
essential that users understand the h""";",,,,,,,... nM Standard number axes on a milling machine is three -
on which CNC technology is the X, Y and Z axes. set on a milling system is al-
many forms, for example, un(jen.tarldulg ways stationary, on a machine table. The
cuitry, complex ladder diagrams, \.-UI.IILJIL,lll;;;1 cutting tool it can move up and down (or in and
ogy, machine design, machining onnC11Dles out), but it does not physically follow the tool path.
and many others. Each one has to
by the person in charge. In this Hil11UUIUU.I\.. CNC mills - sometimes CNC milling machines -
on the that relate directly to the are usually small, simple without a tool changer
understanding the most common or other automatic features. is often
Machining Centers and the lathes quite low. In industry, they are
the Turning Centers). The maintenance purposes, or small
should be very important to every ma- usually designed for contouring,
tool operator and this goal is also reflected in the
handbook approach as well as in numerous CNC machining centers are far more
drills and mills,
benefit the user gets out
TYPES OF CNC MACHINE TOOLS ability to several diverse operations
drilling, boring, counter
ni1ffef'ent kinds of CNC machines cover an ChllClllCH facing and contour milling can be
variety. Their numbers are rapidly CNC program. In addition,
developmentadvances. It is . automatic tool changing,
applications, they would minimize idle time, indexing to a different side
of some groups CNC a rotary movement of additional axes,
CNC machining centers can
with special software that controls the speeds and
Cl and Machining centers of the cutting tool, automatic in-process ",,,,,,oil'''''
Cl and Turning Centers adjustment and other production "XU'I'Ul'.... Ul'J;:,
devices.
Cl Drilling machines
NUMERICAL CONTROL 5

There are two basic machining PERSONN FOR eNC


center. They are the machining
centers. The major difference two types is the
nature of work that can be on them efficiently. For a machine tools have no
CNC machining center, most suitable type of cannot evaluate a
work are flat parts, either mounted to with skills and
ble, or held in a vise or a chuck. control, sk1lls are usually
cbining on two or more in a - one doing the
sirable to be done on a CNC horizontal U14'.llll.lll machining. Their
example is a pump and depend on the company
shapes. Some multi-face ULa...'U.llllli,!:; as product manufactured
done on a CNC vertical machining center ...'-I ..... I-'IJ ....... is quite distinct, although many
a table. companies the two functions into a one, often
called a CNC ProgrammerlOperat01:
prc)gr.:imrnulg process is the same both designs,
an (usually a B axis) is added to the hori- • CNC Programmer
design. Ths axis is either a
lHU';;;1\.U.1J;:. axis) for the table, or a fully rotary
The CNC programmer is the person who the
taneous contouring. most responsibility in shop. This person
is often responsible for numerical control
handbook concentrates on the CNC technology in the plant. is held respon-
centers applications, with a special ""... 'CIVIl sible for problems operations. Although
horizontal setup and machining. duties may vary, the ~ ..",rr..-.,_... ""~ is also responsible for a
melmO(lS are also applicable to the small variety of tasks usage of the CNC
tapping machines, but the "",.r'rr,..,'..,......... " ... machines, In fact, this accountable for the
restrictions. production and quality of operations.

• and Turning Centers


is usually a machine tool with two axes,
the horizontal Z axis.
distinguishes it from a mill is that
machine center line. In addition, cut-
is normally stationary, mounted in a sliding twTet.
follows the contour of programmed
tool path. the CNC lathes with a milling attachment, so analyze,
called live tooling. the milling tool has its own motor dam into a
\"Ullv\"lvU

rotates while spindle is stationary. the CNC pro-


01"1!1 ....... ",..I",. must be to decide upon the best manufactur-
lathe design can be horizontal or
I"nn,"I>',..,.., methodology in all respects.
more common than the
purpose in In addition to the machining skills, programmer
for either For has to have an understanding of mathematical principles,
horizontal group can be mainly application of equations. arcs and an-
as a bar type, chucker type or a Equally important is the of trigonometry.
to combinations are ac- with computerized progranuning) knowledge of
a CNC lathe an extremely flexible ma- manual programming methods is absolutely to the
accessories such as a tailstock, steady thorough understanding of the
rests or fol1ow#up part catchers, pullout-fingers control this output.
even a third milling attachment are popular compo-
nents of the CNC ~ lathe can be very versatile important quality of a truly
"'''''1'">'\''''''P1'" is his or her ability to listen to
so versatile in that it is often caUed a CNC Turning
Center. AU text examples in this handbook the CNC operators,
use the more tenn CNC lathe, yet still are the first prerequisite to h"""'(lI"'I"""
ing aU its rr'ln,('Ip.1m h"",,,,,,h ..u,,, programmer must be flexible
ClllLHll1t);!, quality,
6 Chapter 1

• CNC Machine Operator panies talk about safety, conduct safety meetings, display
The CNe machine tool operator is a complementary po- posters, make speeches, call experts. This mass of informa-
sition to the CNe programmer. The programmer and the tion and instructions is presented to all of us for some very
operator may exist in a single person., as is the case in many good reasons. Quite a few are based on past tragic occur-
small shops. Although the majority of duties performed by rences - many laws, rules and regulations have been written
a conventional machine operator has been transferred to as a result of inquests and inquiries into serious accidents.
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. 111ere 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, u 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 a large subject but a few points that relate to the
CNe machine operator is to report fmdings about each pro- CNC work are important. Every machinist should know
gram to the programmer. Even with the best knowledge, the hazards of mechanical and electrical devices. The fIrst
skills, attitudes and intentions, the 'fmal' 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
SAFETY RELATED TO CNC WORK infractions, is dangerous in machining environment. Pro-
tection of eyes, ears, hands and feet is strongly recom-
mended.
On the wan 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
The heading of this section does not indicate whether the are pallet changers, chip conveyors, high voltage areas,
safety is oriented at the programming or the machining hoists, etc. Discollllectillg allY interlocks or other safety
level. The reason is that the safety is totally independent. It features is dangerous - and also illegal, without appropriate
stands on 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-
Safety is the most important element in programming, teristics, all have a profound effect on overall safety.
setup, machining, tooling, ftxturing, 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~
CNCMILLING

Many types machines are in indus- • Types of Milling Machines


try, the majority of them are machining centers
and CNC lathes. They are by wire EDM, fabricat- Milling machines can divided imo Ihree categories:
ing machines and machines special Although o By the number of axes - two, three or more
the this handbook is on the two that domi-
nate the market, many can be applied to o By the orientation of axes - vertical or horizontal
equipment. o By the presence or absence of a tool ...h ..... "',"r

CNC MACHINES - MILLING Milling machines where the spindle motion is up and
down, are categorized as vertical machines. Milling ma-
chines where the spindle motion is in out, are catego-
The description of CNC milling is so it as horizontal machines - see Figure 2-1 and
can fill a thick book all by itself. All machine tools from a
knee lype milling machine up to a five profiler
can included in (his They in features,
suitability for work, etc., but they do all one
common denominator - their primary axes are the X and Y
axes - this reason, they are called machines.
the category of the machines are also wire EDM
machine tools, laser and water jet cutting name
cutters. burners, routers, etc. Although do not qualify
as milling type machine tools, we mention them because
the majority of programming techniques applicable to the
mills is to machines types as well. The
example is a contouring operation, a common La
many CNC machines.
the purpose this handbook, a milling machine can
be defmed: Figure 2-/
Schematic representation of a CNC vertical machining center
Milling machine is a machine capable of a simultaneous
cutting motion, an end mill as the primary cutting
at least two axes at the same time
'I"
j'>
I
This definition eliminates all CNC presses, since
covers pOSItioning not profiling. The
nition also eliminates wire EDM machines a of
burners, they are capable of a profiling action but not
an end mill. Users these machine tools will still
from m:tny covered The
ciples are adaptable to the majority of machine tools.
For EDM uses a very small cutter
in the of a A cUlling machine uses
beam as its cutter, also having a known diameter bUL
term keifis used The will be concentrated
on metal cutting machine of end
mills as the primary tool contouring. mill
can be in many ways, first look will Figure 2·2
or available machines. Schematic representation of a CNC horizontal machining center

7
8 2

simplified not really reflect reality machining center is described by its specifications
current state of art in .a...... "'... tool manufacturing. as provided by the machine tool manufacturer. manu-
machine tool industry is changing. New and lists many as a quick method of
more powerful machines are V_'''"",'' __ and produced by comparison between one machine and another. It is not un-
manufacturers worldwide. more features. usual to find a slightly information in the
brochure - after all, it is a tool.
The majority of modern machines designed for milling
are capable of doing a multitude of machining tasks, not In the area of systems, three most common ma-
only the traditional milling. machines are also capa- chine tools are
of many other metal operations, mainly drill-
Q eNC Vertical Machining Center - VMC
ng, thread cutting
many others. They may with a multi-tool Q CNC Horizontal Machining Center· HMC
azine (also known as a a fully
Q CNC Horizontal Boring Mill
changer (abbreviated as ATC) a pallet
viated as APC). a powerful computerized conlrol unit
brevlated as CNC), and so on. Some machine may type, except
have additional features, as adaptive control. the major differences will the
terface, automatic loading unloading, probing ",,,,,,rpo..,... axes, additional for indexing or full rotary
high speed machining and other mod- the type of work suitable for individual
ern technology. The is - can machine tools of lion of the most common type of a machining center - the
capabilities be as simpleCNC milling Vertical Machining Center (VMC) - a fairly accu-
In two words - certainly not. Milling machines that have at rate sample other group.
some of built-in. have ,."u·"'''''""
new breed of tools - CNC An/l,r".,,·, • Vertical Machining Centers
This lenn is strictly related - a manual machining
cel1Jer is a description thal does nul exist. Vertical for flat type
of work, of machining is
• Machine Axes done on setup.
Milling machines and machining centers have at least A vertical machining center can be used with
axes - X, Y The machines become more flexi- an optional axis. usually a head mounted on
iflhey usually an the main table. The rotary head can mounted either ver-
lary axis (the A tically or horizontally, depending on the results and
horizontal models). higher the type. This fourth can either for in-
found on with five or more axes. A dexing or a full rotary molion. In combination with a
chine wilh five ;'lxes. he a hnring mill that supplied), the fourth in the vertical
jor axes, plus a axis (usually the B "nr""",,, can be long parts that
parallel to the Z (usually the W axis). true need support at both ends.
complex and flexible five-axis profiling [ling machine is
the type used in industry. where a multi-axis. simul- maJonty vertical centers most
taneous is necessary to complex tors work with are those with an empty table and three-axes
shapes and and various configuration.

two and a machine or a From the programming perspective, there are at least two
At times,
machine is used. terms refer to mentioning:
three and a
the type of where simultaneous o ONE· programming always takes from the viewpoint
of all axes limitations. For a spindle, not the means the view is
vertical Y and Z axis as primary axes. plus as if looking straight down, at ninety degrees towards
designated as an A The indexing ta- the machine table for development of the tool motion.
ble is used posllioning. but il cannot rotate simulta- Programmers always view the top of part!
neously with the motion of primary axes. That type of a Q TWO· various markers located somewhere on the machine
called a 'three and a half axIS ' machine. show the positive and the motion of the machine
a more complex but machine Ihal is axes. For programming, markers should be ignored!
a table, is as a four These indicate operating directions, not programming
can move simultaneously directions. As a matter of fact, typically the programming
with the motion of the axes, is a good directions are exactly the opposite of the markers on the
example of a true 'four ax.is· machine tool. tooL
CNC MILLING 9

Vertical and Horizontal Machining - Typical Specifications


.- ...... _- ... m __ ,

Description Vertical Machining Center Horizontal Machining Center


1= I~

Number of axes 3 axes IXYZ) 4 axes IXYZB}

780 x 400 mm 500 x 500 mm


Table dimensions
31 x 16 inches 20 )( 20 inches

Number of tools 20 36

575 mm 725mm
Maximum travel- X axis
22.5 inches 28.5 inches

380 mm 560mm
Maximum travel- Y axis
15 inches 22 inches

470 mm 560 mm
Maximum travel- Zaxis
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 11/8 kW
Spindle output
AC 10/7 HP AC15/11HP

Spindle nu:>t:-tlJ-t~1.1 distan ... ", - Zaxis 150 - 625 mm 150 - 710 mm
6- inches 6 - 28 inches

430mm 30 560 mm
Spindle center-to-column distance· Y axis
17 inches 1.2· inches

Spindle taper No. 40 No. 50

Tool shank CAT50

2 - 10000 mm/min 1 - 10000 mmlmin


0.100 - 393 in/min 0.04 - 393 in/min

30000 mm/min (XY) - mm/min IZl 30000 mm/min (XYI - 24000 (2)
Rapid traverse rate
1181 in/min IXY) 945 in/min (Z) 1181 in/min (XV)- 945 iI\Imin

Tool selection memory Random memory


...
80 mm (150 w/empty pockets) 1 mm
Maximum tool diameter
3.15 inches (5.9 w/empty pockets) 4.1 inches

300mm 350 mm
Maximum length
11.8 13.75 inches

6 kg 20
Maximum tool weight
131bs 44

• Horizontal Machining Centers There arc many applica£ions in lhis area. Common exam-
are large as pump housings, cases,
Horizontal CNC Machining Centers are also
manifolds, blocks and so on. machining
as multi-tool and versatile machines. and are
centers always include a special ing table and arc
bieal paris, where majority of machining has to
on more than one in a single setup.
equipped with a pallet and other
10 Chapter 2

Because their flexibility and complexity, CNC parl of the way towards spindle. bOlh meet in the
zonlal machining centers are priced significantly area the part Ihal be machined using all the ma-
than vertical CNC machining centers. chine tool resources.
the programming point view, there are several Horizontal boring mill may be called a
eli mainly relating to the Automatic Tool machine, but certainly nol as-axis CNC
the indexing table, - in some cases - to the ad- the count of the axes is Programming
ditional for example, the changer. All CNC mills are similar to Ihe horizontal and
differences are relatively minor. Wriling a program for machining centers.
horizontal machining centers is no different than writing a
for venical machining center!'.. • Typical Specifications
• Horizontal Boring Mill On the preceding page is a comprehensive chart showi
the typical specifications a CNC Vertical Machining
Horizontal boring mill is another machine. It Cellterand a CNC Horizontal Machining Centel:
closely resembles a CNC horizontal machining center, but ifications are side by side in two
have its own Iy, a horizontal not for any comparison are two
mill is by the lack some common fea- different types and comparison is no\ possible
tures, such as Automatic Changer. As Ihe name of all features. In order to compare individual machine tools
the machine its primary purpose is boring opera- within a category, machine tool prov-
tions, mainly lengthy that reason, the reach of ided by the machine manufacturer serve as the basis
the is extended by a specially designed quill. An- for comparison. specifications are contained a of
other typical feature is an axis parallel to the Z axis, called verifiable data, mainly technical in nature, describes
Ihe W axis. Although is, in the fifth lhe individual machine by main features. Machine tool
nation (X, y, W), a horizontal boring mill cannot be buyers frequently compare many brochures of several
called a true axis machine. Z axis (quill) and the W fcrcnt machines as parr of the pre process.
axis (table) work in the (awards agers process planners compare individual machines in
other. so Ihey can be used large parts and hard-to-reach the machine shop and assign the available workload 10 the
areas. It means, that during drilling, the machine table most suitable machine.
moves an quill. quill is a physical part
of the spmdle. It is in the spindle where the culling 1001 ro- A fair and accurate comparison can be made between two
"'lies - but in-nnd-out motions are done by the table. vertical ining centers or between two horizontal ma-
Think of the method offered on horizontal chining centers, but cannOI be done to compare
mills - if the quill were to be very it would lose (ween two differenl types.
strength and rigidity. belter way was to split the tradI- In 11 typical sped chart, additional dala
tional single Z axis movement into two - the quill extension may be listed, not included in earlier chart In this hand-
the Z axis will move only of the way £Owards lhe book, the focus is on only those specifications Ihat are
and the table itself, the new axis, will move another interest \0 the CNC and the CNC operator.
CNC TURNING

CNC MACHIN • TURNING • of Axes


The most common distinction CNC lathes is
or it turret IS a common
by the number of programmable axes. Vertical CNC lathes
In machine shop. A lathe is used have two axes in almost all The much
machimng or conical work, as shafts. more common CNC horizontal commonly designed
wheels, bores, threads, etc. The most common lathe with two programmable axes, are available wilh three,
operation is removal material from a round four or axes, adding extra to manufactur-
Illrning tool for external culling. A lathe can ing of more complex parts.
ror internal operations such as boring, as well as for
threading, etc., if a cutting tool is A lathe can funhcr described by the
are usually in machining power type
lathes, hutlhey do have a carousel that holds
cutting tools. An lathe has often one o FRONT lathe ... an engine lathe type
or two CUlling tools at a lime, but has more ma- oREAR ... a unique slant bed
chining power.
SIan! bed type is very popular
Typical lathe work controlled by a CNC system uses ma- its design allows chips to
known in industry as the CNC Turning - or operator and, in case an accident,
more commonly - the CNC down a area, towards the chip
term 'turning is Between the of flat bed and type lathes,
curate overall descnption of a front and rear lathes, horizontal and venicallalhe designs,
can be used for a number of machining op- there is another variety of a lathe. This describes
during a example, in addition to CNC lathes by number of axis, which probably the
lathe as turning and a simplesl and most common method identification.
lathe can be used for drilling, grooving,
knurting and even burn It can also be used in AXES DESIGNATION
ent modes, such as chuck work,
centers. Many other combinations also exist
are designed to hold tools in special A typical CNC is designed with two standard axes -
can have a milling indexable chuck, a sub one axis is the X other axis is lhe Z axis. Both axes
a tailstock, a steadyrest many other features are perpendicular to other and represent the
associated with a lathe design. two-axis lathe motions. X axis also represents
more than four axes ore common. With I ravel of the cutting tool, Z represents
constant advances in machine technologies, more nal morion. All varieties of tools are
CNC appear on the market that are designed to do a turret (a special too) can be or
number of operations in a many of them Because of this lurret loaded with all CUI-
(tonally reserved for a mill or a center. Z axes, which means all

• Types of eNC lathes Following the established of the milling ma~


lathes can by the type of and machining the only machine
the number of a xes. two types are of making a hole by of drilling, boring.
lathe and the horizontal CNC lathe. Of or punching, is the Z
the two, horizontal type is by the most common in
CNC lathe work, the oriemation a
manufacturing and machine shops. A CNC lathe type of lathe is downwards motion
(incorrectly called a vertical boring mill) is somewhat less
axis, and left and motion for the Z axis, when
common but is irreplaceable for a work. For
looking from the machinist's position. This view is shown
a CNC there are no differences in
. following three illustrations Figure 3-1, Figure
the approach between two lathe types.
3-3.

11
12 Chapter 3

In addition to the X and Z primary axes, the


HEADSTOCK lathes have individual of each additional axis,
I CHUCK
/
example, the C axis is usually third axis,
milling operations, using so called live tooling. More
for

/ tails on the subject of coordinate system and machine ge-


JAWS
!". ---- TOOL ometry are available ill Ihe next
. X+

.....t
I ! TAILSTOCK
• Two-axis Lathe
This is the most common type of CNC The work
holding u!\ually a chuck, is on the left

Figure 3-1
"
x- QUILL
of
with
work.
machine (as viewed by the operator). The rear type,
slant bed, is
some special
most popular design for general
for in the petroleum
industry (where turning tube ends is a common work). a
bed is usually more suitable. The CUlling lools are held
Typical configuration of a two axis slant bed eNG lathe - rear type
in a specially designed indexing turret that can hold
x+ six, eight, len, more tools. Many such lathes
t
Z- . . . . . Z+
also have two turrets.
Advanced 1001 designs incorporate tool storage

"
X-

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

.....t • Three-axis Lathe


Three~axls lathe is essentially a two-axis lathe with an

Figure 3-2 "


X+

Typical configuration of a CNC lathe with two turrets


ditional
C
This has own
in absolute mode (H
usually as a
in incremental mode), and
is fully programmable. Normnlly, the third axis is used for
cross-milling
ing,
slot CUlling. bolt circle holes drill-
helical slots, etc. axis can re-
place some simple operations on a milling machine, reduc-
ing setup time for the job. Some limitations apply (0
many models, example, the milling or drilling opera-
tions can (ake place only at positions projecting from the
tool center La the spindle center line (within a machin-
plane), although adjustments.
The third has own power source but the power raL-
is relatively lower when compared with the majority of
machining centers. Another limitation may the smallest
increment of the third axis, particularly on the three
axis lathes. Smallest increment of one degree is certainly
more useful an increment of two or five (j"'l'rf"'~
better is an increment of 0.1'\ 0.01 0, and commonly 0.00 1°
on the models. Usually the lathes with three axes of-
a fine radial increment that allows a simultaneous
Figure 3-3 rotary motion, with low increment values are usually
Schematic representation of a vertical eNC lathe
designed with an oriented spindle stop only.

is true for both the front and rear lathes and for lathes From the perspective ofCNC part programming, the
with or more axes. The chuck is verti- ditional knowledge required is a subject not difficult to
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 gramming features are also available, for fixed
90°, where the chuck face is oriented horizontally to the and other
vertical spindle center line.
CNC TURNING 13

• four-axis lathe There is more in promotional brochure than


a four-axis CNC lathe is a in fact, in a well
a three-axis lathe. As a matter of to pro- technical information,
(he machine tool. are the features and
lathe is nothing more than programming
lathes at the same time. That may sound the CNC machine tool manufacturer considers .m.,Art..:. ... !
the principle of a CNC lathe the customer.
In the majority of brochures, there are practical
are actually two controls can b e ' a particular CNC machine, a
one each pair (set) axes. lathe in the
used to do the external - or
(OD) and another program to do the
- roughing (ID). Since a
• Machine Specifications
A typical lathe, with two axes and a slant
pair of axes independently, and can be bed may
at the same time, doing two different operations from an actual
simultaneously. The main keys to a 4-axis lathe
programming is coordination of the (ools and their opera- Description Specification
tions, liming of the tool motions a sense of
compromise. Number of axes Two (X, Z) or three (X, Z and C)

reasons, both cannot work all the Maximum swing over bed
Kf':.c.ml<,e of this programming fea- diameter
lUres as synchronized (typically Miscel-
laneous Function), the ability to how much (ime length
each tool requires to complete etc., are re-
quired. There is a level of l"(wnnr'l"Im because only
one spindle speed can be both active cuuing tools,
although feedrate is both pairs of axes.
12
This means that some operations simply cannot
be done simultaneously.
Not every lathe job benelits from the 4-axis machining.
are cases when it IS more costly to run a job on a
lathe inefficiently it very efficient to run Indexing time 0.1 second

on a 2-axis Axis travel in Xaxis

• Six-axis lathe Axis travel in Z axis

Six-axis CNC lathes are Rapid traverse rate X axis


twin turret and a set of axes per turre!. This mm/min
in/min
corporales many tool of them power
0,01 • 500 mm/rev
as well as back-machin Programming these ,0001 • 19.68 in/rev
lalhes is similar to programming a three-axis lathe twice.
The control system automatically provides synchroniza-
tion, when IIvl.,'V~~<'l.1 Main spindle motor
A small \0 CNC lathe is popular Spindle speed 35·3500 rpm
and industries with simi Minimum input increment
applications.
Motorized
FEATURES AND SPECIFICATIONS Number of rotating tools 12

Rotating tool speed 30 . 3600 (Imin


A look at a promotional brochure a
CNC machine useful in many respects. In most Milling motor AC 3.7/2.2 kW
AC 5/2.95 HP
is impressive, the printing,
and the use of colors is
well done. IS the purpose of the brochure La make a • M16 metric
·5/8 inches
marketing tool and attract the potential buyer.
3

It is very important to understand the specifications and Q of various forms (including taper and
of the CNC machine lools in shop. Many fea- circular) can performed, depending on the control model
to the control system, many others to the ma- Q Dwell can use the p. U or X address (G04)
tool itself. In CNC programming, many imponanl
are based on one or of features, for Q Tool uses 4-digit identification
example number of tool stations available, maximum spin- Q 1=,,,,,£1.,,.,,, s~!lection (normal) in mm/rev or in/rev
others.
a Feedrate (special) in mlmin or inlmin
• Control Features a Rapid traverse rate different for X and Z axes
in understanding the description of a Q Multiple repetitive cycles for turning, boring, facing, contour
lathe is the look at some control unique 10 repeat, grooving, and threading are available
how they differ form a typical control. a Feedrate is common from 0 to 200% in 10%
of control features is described in more detail increments (on some lathes only from 0 to 150%)
5,
o X axis can
At some fealures and codes nOI make
Q Tailstock can be programmable
sense - they are included for ,,,r,"'''''1> only. Com-
mon typical features are listed: a Automatic 2m" .. "rv, and corner rounding
R and II Kin
Q X a diameter, nat a radius
a Thread available with six-decimal
Q Constant surface speed leSS) is standard control place accuracy (for inch units)
(G96 for CSS and G97 for r/min)
a Least input increment in X is 0.001 mm or .0001
Q Absolute programming mode is X or Z or C inches on diameter· one half of that value per side
Q nr:rl~m,.'ntlll nrn"'''"rnnllnn mode is U or War H
COORDINATE GEOMETRY

The length of division on the scale re[>re~,e


unit of measurement in a convenient and
a in ceptcd It may come as a surprise that
/lates. System of coordinates is on a used day. example, a simpJe ruler used in
mathematical principles dating over four on the number scale concept, regardless of mea-
most important of are those that Weight scales using lons, pounds,
can be applied to Ihe CNC technology today. In various of mass are other
publications on mathematics and these princi- uses the same
pies nrc lisled under the headings the rea/number sys- as
(ell! and the rec/angular coordinates.

RECTANGULAR COORDINATE M
REAL NUMBER SYSTEM
coordimlte system IS a to
key to understanding 2D point, using the XY coordinates, or a spa-
(he knowledge of arithmetic. point, using the XYZ coordinates. [t was first
key knowledge in this area is 17th century by a French and
/lumber system. Within ......... ,"'" Rene Descartes (I I
ten llvuiluble numerals , _ ' " , , " ' v l us an alternative to the rectangular
can be used in any of the called Coordinate System
o Zero integer.. . 0
r:J Positive integers ... L 2, 10,12943, +45
(with or without sign)
-381, ·25,-77
" ..T
o Negative integers ...
(minus sign required) T
o Fractions ... 1/8, 3/16. 9/32, 35/64
o Decimal fractions 0.1 .546875. 3.5
-, .
At! groups are used

the mainstream of just
modern life. In CNC programming, primary goal is to
usc the numbers to 'Iranslate' the drawing, based on its
-;
menslons, into t). cutter

Computerized Numerical Control means control by the Figure 4-2


numbers using a All information in a drawing Rectangular coordinate system
has to be translated into a program, using primarily
numbers. are used Lo describe commands, The concepts used in design, and in numerical
functions, comments, so on. The mathematical rn.,r,·'n. control are over 400 years old. A point can be mathe-
of a real number can he expressed graphically on a matically defined on a plane (two coordinate values) or in
straight line, scale, where all divisions space (three coordinate values). defin ition of one point
have the same 4-1. IS !O another poinl as a distance parallcl with one of
axes that are perpendicular to each olher. In a plane,
only two axes are required, in the space, all three axes must
specified. In programming, represents an exacllo-
If such a location is on a the point is defined
as a 20 point, along two axes. the location is in a space,
Figure 4·1 lhe poilH is defilled as a three axes,
Graphical representation of the Number Scale

15
16 4

When two number scales that intersect at right angles are • Point of Origin
used, mathematical for a recTangular coordinate sys-
Another term that emerged from the rectangular
tem is terms from
nate is called poil11 of origin, or just origin. 11 is
tion, and all have an important role in CNC programming.
the point where lhe two perpendicular axes intersect. is
understanding is very important for further point a zero coordinate value in each {lxis, fled a.<;
planar XOYO and XOYOZO - 4-4.
• Axes and Planes
of number an axis. AY
-I
This old principle, when applied to programming,
means that at least two axes nvo number scales - will be
mathematical definition of an

1'1 1--+ 1 1 1-1-1" 1- -1-1- .... X axis


T

I ORIGIN
definition can enhanced a statement thaI an
axis can also be a line of reference. In CNC programming,
an as a reference all the lime. The definition
contains word '. A plane is a term 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

This intersection has a special meaning in CNC program-


ming. acquires a new name, lypically the
gram reference point. Other terms are also program
the top viewpoint of the looking straight zero, poim, 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.
A plane is a 2D entity - letter X identifies horizon- • Quadrants
Viewing the two intersecting axes and the new four
Yaxis distinct areas can be clearly identified. area is
bounded by two axes. areas are called quadrants.
Mathematically dcfincd,

I I- 1- '1--1-" I -I -I 1 +-1- X axis


The word quadrant (from the Latin word quadrans or
quadrall1is, the fourth parI), suggests four
uniquely defined areas or quadrants. Looking down in the
top at the two intersecting axes, the following defini-
apply to quadrants. are mathematically correct
and are used in CNC/CAD/CAM applications:
Figure 4-3 Quadrant I UPPER RIGHT
Axis designation· viewing plane
Mathematical is fully implemented in CNC Quadrant II UPPER LEFT
Quadrant III LOWER LEFT
lal the Jetter Y identifies its vertical axis. 111is plane IS
called XY plane. Defined mathematically, (he horizon- Quadrant IV LOWER RIGHT
tal axis is always listed as the first of the pair. In
and CNC programming. this plane is also known as the quadrants are defined in the
Top View or a Plan View. Other planes arc in lion from horizontal X axis and the naming convention
CNC, but not to the same extent as in CAD/CAM work. uses Romal! numbers, not Arabic numbers normally used.
GEOMETRY 17

counting starts at the positive of the horizontal Y+


4-5 illustrates the definitions. .,
P2+
... Yaxis
t
II _ Quadrant I x- -r--I-~1~~I-~-r-I--~.. I- x+
X+Y+ ..,.. P1

I 1--1'- -+ -I -u'+
" -1--1-+ --i--I-JiIo. X - ---- .....
P4
+
.. I

Quadrant III - Quadrant IV T


x-y- X+Y-

P1 ::: XQ.Q ::: X4.0 Y-3.0

Figure 4·5 - P2- ::: XQ.Q


---""""
::: X-S.O Y-4.S
Quadrants in the and their identification
P3 ::: X5.5 YS.O P6 ::: X-5.0 YO.Q
Figure 4-7
Any point value can be positive,
Coordinate definition of points within the rectangular coordinate
zero. Any is determined solely system (point PI = Origin XOYO)
cation of the point in a particular quadrant and its
distance relative to the origin - Figure If these directions were over a
hand, they would "",..r"''',... ''" from root
COORDI of thumb or finger would point
POINT ON
,
X AXIS
""""""""~,--"--
Y AXIS in the X direction, the Y direction and
QUADRANT I , ..
,-""""",
+
,,--"""""""""""""''''''
middle
majority of CNC are programmed using
QUADRANT II the so called absolute method, that is based on
QUADRANT III the point of origin XOYOZO. This absolute method of
gramming follows very of rectangular co-
+ ordinate geometry and aU covered in this chapter.

Figure 4·6
MACHINE GEOMETRY
Algebraic signs for a point location in plane quadrants

o IMPORTANT: Machine geometry is the


... If the defined point lies exactly on the Xaxis, tween the fixed point of the TTlU,' TlU,,",

it has the Yvalue to zero (YO). a/the part. TypicaJ machine uses
o If the point
• 0 on the Y axis, hand coordinate system. and negative
it has the X value to zero (XO). is determined by an
UH'"",,,,'VlI VIewing con-
... If the point lies on both X and Yaxes, vention. The basic rule for the Z it is always the
both X and Yvalues are zero IXO YO). along which a simple hole can machined Wilh a sin-
XOYOZO is the point In part programmmg, point tool, such as a drill, reamer, or a laser beam.
itive values are written W",UlIlI the plus sign - Figure Figure 4-8 illustrates the standard orientation of an
type machine tools.
• Right Hand Coordinate System
• Axis Orientation - Milling
In {he illustrations of the number scale, quadrallfs and
axes, the origin into two portions. The A typical 3-axis machine uses controlled axes of
zero point - the point of origin - separates the positive sec- motion. They are defined as and the Z
tion of the axis from the section. In the right-hand X to of the
coordinate system, the at the origin and is parallel to dimension
is directed towards rig III upwards for the the Z axis is the spindle movement. On a
Y axis and towards lhe viewpoint for Z machining center, the X axis is longitudi-
Opposite directions are the Y axis is the saddle cross direction and
Chapter 4

, X+
• REAR LATHE

, FRONT LATHE

VERTICAL

~--I"""- X+

Figure 4-10
Typical machine axes of a eNe lathe (turning

Figure 4-8 Another variety. a venical CNC lathe, is basicaHy a hori-


Standard orientation of planes and eNe machine tool axes zan tal lathe rotated 90 0 • Typical axes for the and
vertical machine axes, as applied to turning, are illustrated
the Z axis is the spindle direction. horizontal machining in Figure 4-10.
centers, the terminology is changed due to the design of
these machines. The X axis is table longitudinal direc- • Additional Axes
tion, the Y is the column direction the Z axis is the
spindle direction. Horizontal machine can be as a A CNC machine of any type can designed with one or
machine rotnted in space by ninety degrees. The more additional axes. normally designated as second-
additional feature of a horizontal machining center is the ary axes using the U, V and W letters. These axes are nor-
indexing B axis. Typical machine axes applied to CNC ver- mally parallel to primary X, Y and Z axes respectively.
tical machines are illustrated in 4-9. For a or an indexing applications, additional axes
are defined as A, B and C axes, as rotated about the
X, Y and Z axes, in their respective order. Positive di-
rection of a rotary an indexing) is direction re-
quired to advance a right handed screw in the positive X. Y
or Z axis. The relationship of the primary and the second-
ary (or supplementary) axes is shown 1.

Primary
r~~"'-"""" axes
__ Secondary
axes
TOP VIEW ISOMETRIC VIEW Arc center
1..\--+---+--+--+--+ - - vectors
Figure 4-9
Rotary
Typical machine axes of a vertical eNe machining center axes
,
• Axis Orientation· Turning I
X axis Yaxis Zaxis
Most CNC lathes have two axes, X and Z. More axes are related related related
available, but they are not important at this point. A special
third axis, the C axis. is designed for milling operations 4-11
(live tooling) and is an option on typical CNC lathe. Relationship of the primary and the sec:oncfarv axes
What is more common for CNC lathes in industry, is the center modifiers (sometimes the arc center
double orientation of axes. Lathes are distinguished vectors) are not true axes, yet they are also to the
as front and a rear lathes. An example of a lathe is primary axes This subject will described in the
similar to the conventional engine lathe. All the slant bed section on Circular Interpolation, in Chapter
types a lathe are the rear kind. Identification of the
axes have often not followed principles.
CONTROL SYSTEM

A unit equipped witn a In order to fully understand CNC programming pro-


control system is commonly known as a cess, it is important to understand not only the intricacies of
an analogy of the machine tool as the to machine a pan, what tools to select, what speeds
system, control unit is its to use, how to many other fea-
are no levers, no knobs and no tures. It is equally the computer, the
machine the way they function on COniVCr1lIIO£ CNC unit, actually to be an expert
and lathes. All the machine in electronics or a I shows an
and hundreds of other tasks are by a actual Fanuc control
programmer and controlled by a computer that is ma-
of the CNC unit To make a program for a CNC ma- The machine own
chine tool means to make a program for system. panel, with all the and button needed to operate
the machine tool is a major as well, but the CNC machine and all its features. A typical operation
it is the unit thai of the pro- panel is illustrated in Another item required
structure and its syntax. the system. the handle, will be described as well.

HELP KEY
\.
GE Fanuc Series 16-M

(OFF
I
I

1--1
\
OPERATION
MENU

ON I OFF BUTTONS,

Figure 5·1
A typical example of 8 Fanuc control panel. actual layout and features will vary on different models (Fanuc 16M)

19
20 5

GENERAL DESCRIPTION control unit - the


work in conjunction
anything useful on its own.
a brief look at any reveals that there are if the program itself
two basic components - one is operation paJlel, full tons and keys are by
rotary switches, toggle and push buttons. The
other component is the display screen with a keyboard or a control over the program "''''''''''''''.'''
keypad. The programmer who does not normally work on • Operation Panel
CNC machine will if ever, have a reason to use
the operation panel or the display screen. They are Depending on CNC machine,
at the machine to the machine operator. and ing table covers most typical and common
the as well as to control the activi- found on the modern operation panel. There are some
of the machine. differences for the of a machining center a
but both operation are similar. As with any
Should the CNC interested in ma- reference book, it always a good idea to double
chine operation? Is for the to with specifications and recommen-
know and understand all of the conlIol system? dations. It is common machines In
is only one answer to both questions - definizely have some special

CYCLE D ERRORS
x y z 4 MOO M01 M30 ALARM
o 0 o 0 o
OPTIONAL BLOCK M-S-T MACHINE DRY
STOP SKIP LOCK LOCK RUN
ON ON ON ON ON
@ @ @ @ @ OFF
OFF OFF OFF OFF OFF OFF AUTO

ID MDI 90
80
TAPE 175 70
150 60
125 50
1 40-
EDIT 80 400 30
60 20
MODE 40 600 10 0
30 - 800
20 1000
Y Z 15 1200
X 10 1500
5 2000
0 4000 ccw
D
EDIT ...! ,-_._-

80 90

110 0
120 CYCLE START FEEDHOLD
OVERRIDE %, N OVERRIDE % AUTO EMGSTOP

Figure 5·2
A typical operation panel of a CNC macnmlllO center actual features wiN vary on different models
CONTROL 21

Feature Description Feature Description


ONI Power and control switch for AUTO Mode 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
Start
Or MDT command
Allows program execution from an
Emergency all machine and external device, such as a desktop
mode
Stop turns off power to the control unit computer or a punched tape
Feedhold motion of all axes EDlT Allows to bt: made to a
program stored in the CNC memory
Single Block Allows program run one block at a time
MANUAL
Temporarily stops the program Allows manual
Optional Stop Mode
execution (MOl required in program)
JOG Mode Selects
Ignores blocks preceded with
Block Skip
a forward slash (I) in the program RAPID Mode mode for setup
Enables program testing at fast Memory
Dry Run (switch) to allow program editing
feedrales (without a mounted part) Access
Spindle Overrides the programmed spindle Error lights Red an error
Override usually within 50-120% range
Feedrate Overrides the programmed feedrate, is some may not be listed, vinual\y all of
Override usually within 0·200% range those in table are somewhat related to the CNC pro-
Many control systems unique of their
Chuck Shows current status of the chuck own. These features must known to
Clamp (Outside I Inside The program supplied to the machine should
not rigid - it should 'user friendly'.
Clamp Shows current status of table

Coolant • Screen Display and Keyboard


Coolant control ON I I AUTO
Switch The screen display is 'window' to the computer. Any
Gear Shows current status of working program can be viewed, including the status the
Selection gear range selection control, current tool position, various offsets, parameters,
even a graphic representation of the Tool Path. On all CNC
Spindle Indicates spindle rotation direction units, individual monochrome or color screens can be se-
Rotation or counterclockwise) lected to have the desired display at any time, using the in-
keys (keyboard pads and soft keys). Setting for interna-
Spindle tionallanguages is also possible.
Manual orientation of [he spindle
Orientation
The keyboard pads and soft keys are used to input in-
Tool Change Switch allowing a manual tool structions to control. can modi-
fied or deleted, new programs can Using key-
Switches and relating to setup of board input, not only the machine axes motion can be
Position the machine from reference position controlled, but the spindle speed and feed rate as well
Manual Generator (MPG). Changing internal evaluating various
Handle used for Axis Select and Handle diagnostics are more specific means of control, often re-
Increment switches stricted to service people. Keyboard and screen are used to
set program origin and to hook up to devices,
Tailstock Tailstock and/or switch to manually as a connection with another computer. There are
Switch IJUOUI'v"1 the tails!ock many other options. keyboard allows use of
fers, 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 setup symbols. Some control panel keys have a description of an
operatiol1, rather than a letter, digit or symbol, example,
MOl Mode mode
Read Punch or the Offset
22 Chapter 5

• Handle SYSTEM fEATURES


machine has a rotary
handle that can move one by as little as the The CNC unit is more than a sophisticated spe-
least increment of the control system. The official Fanuc purpose computer. 'special purpose' in this case is
name for the handle is Manual Pulse Gen.erator. Associ- a computer capabll' of controlling the of a ma-
with the handle is the Axis Select switch dupli- tool, such as a lathe or a machining center. It means
cated on the operation as well as on the handle) and the computer to designed a company has ex-
the range of increment is the least increment X I, X 10 pertise in Ihis type of special purpose computers. Unlike
X I(0). The X in this case is the multiplier and many business types each CNC unit is made
stRnds for limes'. One handle division will move the se- a particular customer. customer is typically ma-
axis by X times the minimum increment of the active chine manufacturer, not the end user. The manufacturer
of measurement. In Figure and the following table certain requirements that the control system to
are the details a typical handle. requirements that reflect the uniqueness of the ma-
chines they build. The basic conlrol does not change, but
some customized features may added taken away)
y Z for a specific the system IS to
X ...... AXIS the manufacturer, more features are added to the
SELECT system. They mainly relate to the design capabilities of
the machine.

x1 x10 A example is a CNC unit for two machines that are


the same in all except one. One a
x100 manual lool changer, the other an automatic 1001
changer. order to support the automatic tool changer, the
CNC unit must have special features . that are not
for a machine without Ihe rool changer. The more
complex the CNC system is, the more expensive it Users
that do not require all sophisticated features, do not pay
a for they do not need.

• Parameter Settings
infonnalion that establishes the built-in connection
between the control and machine tool is stored as
special data in called the system parame-
ters. Some of the in this handbook is quite ~pe-
cialized listed for reference only. Programmers with
limited experience not to know parameters
in a great depth. The original factory are sufficient
for most machining jobs.
When (he parameter screen is displayed, it shows the
rameler number with some data in a row. Each row num-
5~3
one bYle, digit in the is called a
An example of a detached handle, called the Manual Pulse word bit is the Binary digiT
Generator (MPG), With a typical fayout and features. is smal unit of a parameter input. Numbering
Layout and features may vory on different machine models.
starts with O. from the to the left:
II
One handle division motion is ...
Handle
Multiplier Metric units for English units
" The Fanuc control system parameters belong to one of
Xl 0.001 mm .0001 inch three groups, specified within an allowed range:
"
Xl0 0.010 mm .0010 o codes

Xl00 : 0.100 mm .0100 inch o Units inputs


o Setting values
CONTROL SYSTEM 23

The groups use different input values. binary input Parameters related to High-Speed Skip Signal Input
can only have an input of a 0 or I for the bit data format, 0 Parameters to Automatic Tool Compensation
10 +127 for byte type. Units inpur has a broader scope - Parameters related to T001 life Management
the unit can in mm, mmimin, in/min, Parameters related to Turret Axis Control
milliseconds, etc. A value can also be specified within a Parameters related to High Precision Contour Control
given range, for example, a number within the of Parameters related to Service ... and other parameters
0-99, or 0-99999, or + 127 to -127, etc ..
Quite a parameters have nothing to do with daily pro-
A typical example of a binary input is a selection be- gramming and are listed only as an actual example, All sys-
tween two options, instance, a feature called dry run tem should be set or only by a quali-
can set only as effective or ineffective. To select a fied person, as an experienced technician. A
ence, an arbitrary bit number of a parameter has be set to 0 programmer or operator should not modify any parameter
to make the dry run effective and to I to make it ineffective, settings. These changes require not only qualifications but
authorization as well. Keep the list of
UniTs inpur, for example, is used to selthe increment sys- settings away from control, in a safe place, just in case.
tem - the dimensional units, Computers in general do no!
distinguish between inch and metric, just numbers, It is up
to the user and the setting, whether the control
will 0.00] mm or .0001 inches as the Many parameters are periodically updated pro-
menL Another example is a parameter selling that stores gram processing. The CNC operator is usually not aware
the maximum feedrate each axis, the maximum spindle that this activity is going on at aiL There is no real need to
speed, etc. Such values must never be set higher than the monitor this activity. The safest to observe is that once
machine can support. An indexing axis with a minimum have set by a qualified technician, any
crement of 1°, will not become a rotary with ,00 I 0 in- temporary changes required for a given work should be
crement, just because the parameter is selto a lower 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 assigned to do
cause serious damage! them - nobody
To better understand what the CNC system parameters
can do, is an abbreviated Ilsting of parameter classifi- • System Defaults
for a typical comrol system (many them are Many parameter settings in the control at the time
meaningful to the technicians only); of purchase have been entered by the manufacturer as ei-
Parameters related to Setting ther the only the most suitable choices, or the most
Parameters related to Axis Control Data common selections. That not mean they will be the
Parameters related to Chopping settings - it means they were selected on the
Parameters related to the Coordinate System their common usage, Many settings are rather conserva-
Parameters related to Feedrate tive in values, for safety reas»ns.
l-':::Ir'Am;::tT",r<: related to Acceleration/Deceleration Control

Parameters related to Servo The set of parameter values established at the time of in-
Parameters related to DVDO stallation are called the default seHings. The English word
Parameters related to MOl, EOIT. and CRT 'default' is a derivative of a word 'defalu', that can
Parameters related to Programs be translated as 'assumed'. When main to the
Parameters related to Serial Spindle Output control is turned on, there are no set values passed to pa-
Parameters related to Graphic Display rameters from a program, since no program has yet been
Parameters related to I/O interface used. However, certain active automati-
Parameters related to Stroke Limit without an external program. a culler ra-
Parameters related to Pitch Error Compensation dius offset is automatically canceled at the startup of (he
Parameters related to Inclination Compensation control system, Also canceled are the fixed cycle mode and
Parameters related to Straightness Compensation tool length offset. The control 'that certain condi-
Parameters related to Spindle Control tions are preferable to others, Many operators will agree
Parameters related to Tool Offset with most of these initial settings, although not necessarily
Parameters related to Canned Cycle with of them. Some settings are customizable by a
Parameters related to Scaling and Coordinate Rotation of a parameter settings. Such settings will . . """"''''''A
Parameters related to Automatic Corner Override permanent and create a /lew 'default'.
Parameters related to Involute Interpolation
I-'::lr::!mpte:>r!:! related to Uni-directional Positioning

Parameters related to Custom Macro IUser Macro)


Parameters related to Program
24 5

A computer is fast and accurate but has no intelligence. Modem methods measuring memory capacity prefer
People are slow and make elTors, but have one unique to use 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 capacity and is
not assume anything, does not consider, does not feel - very roughly equivalent to one character in the program.
computer does nOl think. A computer not do anything
that a human effort and ingeolli.ty has not during the The memory capacity of the control system should
design process, in form of hardware and software. enough to store the longest CNC program '"''',. . '''£''''''''
on a regular basis. That requires some planning
When the the soft- machine is purchased. example, in three dimen-
ware sets certain existing to their default condi- sional mold work or high speed machining, the cost of ad-
tion, by engineers. Not all system parameters, ditional memory capacity may very high. Although any
only parameters can have an assumed condition - a cost is a relative term, there are reliable and inexpensive al-
condition that is known as the default value (condition). well worth looking into.
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 An communication software
default motion is controlled by a parameter. Only and cabling is required to connect the computer with the
one setling can be active at the startup. Which one? The an- CNC system. simplest version is to transfer the CNC
swer depends on the parameter setting. Many parameters program from ODe computer to the other. More sophisti-
can be to a desired state. Only the rapid or the linear cated possibility includes software and cables that can actu-
mode can be set as default in the example. Since the rapid ally run the machine from the personal computer, without
motion is the first motion in {he program, it seems to make luading it 10 the memory of CNC first This method is
sense La make it a default - wail' often called 'dripleeding' or 'bitwise input', When oper-
from the personal computer, the CNC program can be
Most controls are set (0 the linear motion as Ihe default as long as the capacity of the storage device, typically the
(GO I command), to be in at the start - strictly for hard drive.
safety reasons. When the machine axes are moved manu-
ally, the parameter selling 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- control system. Many controls use the of avail-
gram or from the control panel, a tool motion results. If the able or the equivalent length of are
motion command is nm 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 mate memory capacity calculations:
parameters. the default mode is a linear motion GO I,
the is an error condition, faulting the system for the C) Formula 1 :
lack of a Jeedrate! is no cutting feed rate in effect,
which the GO I requires. Had the default setting been the find the program length in meters,/When the capacity
rapid motion GOO, a rapid motion would be performed. as it
is known in use the following formula:
no! programmed
It is beneficial to know the default settings of all controls
in the shop_ Unless there is a good reason to do nrn.... n>Jl
~ where ...
defaults for similar controls should be the same.
Sm = Storage capacity in meters
• Memory Capacity No = Memory capacity (number of characters)
CNC programs can be stored in the control
C) Formula 2 .
size is only limited by the capacity of the control.
",rr\('l""'1"1"1

capacity is in a variety of ways, originally as To find the length program in/eel. when the capacity is
the equivalent length of tape in meters or feet, lalely as the known in charaCters, use the following fOlTnula:
number oj bytes or the number of screen pages. A common
minimum capacity of a CNC lathe control is 20 m
of tape (66 ft). is an old fashioned method thal some-
how persisted in staying with us. On CNC milling systems,
the memory requirements based on the same criteria are
generally and the typical minimum memory capacity
is 80 m or ft Optionally, larger memory capacity IG'i" where ...
can be added to the control system. The minimum memory
5, Storage capacity in feet
capacity the control varies from one machine to another- No :: Memory capacity (number of characters)
always control specifications carefully.
CONTROL SYSTEM 2S

~ Formula 3 . block are processed as a single inSlrllClion. The blocks are


received by 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: NormaDy, a CNC machine is run in a continuous mode,
while blocks are processed automatically, one after an-
other. This contim1ily I!; important for production, but not
practical when proving a new for example.
disable the continuous program execution, a Single
Block switch is provided on the operation panel. In sin-
lIE where ...
block only one block of the program will be
C Number of available characters time the C)'cle is On the op-
m == Memory capacity in meters eration panel, the single block mode can used separately
or in combination with other that make
Virtually the same results can be achieved by a slightly provmg and more accurate.
restructured formula:
• feedhold
Feedhold is a special push button located on operation
panel, usuatly dose to the Cycle Start bulton. When this
button is pressed during a linear or circular axes mo-
Q Formula 4: tion, it will immediately SLOp the motion. action ap-
plies to all axes active at the lime. is convenient
To find of characters, if the system memory for a machine setup or a first run. Some types of mo-
is known in feer, use the following formula: lion the function of feedhold or disable it alto-
gether. For example, threading or tapping modes make the
switch inoperative.
Activating feedhold at the machine will not change any
IGf' where ... other program values - it will only affect motion. The
feedhold will illuminated (in light), as long as
C = Number of available characters It IS The CNC programmer can override the feed-
f == Memory capacity in feet hold from within the program, for special purposes.
Latest 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
push bUHon, red in color, that is located in an acces-
In cases the available memory capacity is too sible place on the machine. It is marked the Emergency
small to accept a program, several techniques are SLOP or E-Sl0p. When this buuon is pressed, all machine ac-
available to minimize the problem, for example, the pro- /ivities will cease The main power will
length reduction methods, in Chapter 50. interrupted and the will have to restarted.
emergency stop 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 needs Lo interrupted in the middle of pro- or even the only way LO 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-
the operation panel. The most common fea- signed to prevent a collision between a cutting tool and the
tures of this type are toggle or push buttons for a part or fixture. Previously discussed feedhold button is only
single block operation,feedhold and the emerge/lcy SlOp. one option, along with other features. If the emergency stop
must be used at all, it should be as the resort, when
• Single Block Operation any other action would require unacceptably time.
normal purpose of a program is to control the ma- There is no need panic, if something does wrong.
chine tool automatically and sequentially in a continuous some machine the effect of Emergency Stop
mode. Every program is a of commands - is not always apparent. example, the spindle requires a
or instructions - written as individual of code, certain time deceleration to slap.
blocks. Blocks and their conct!pts will be described in the
following chaplers. All in a
26 5

MANUAL DATA INPUT - MOl Override can used individually or together.


They are availahle on control to make the work
for both the operator and the programmer. operator
A CNC is not always operated by the means of a
does not need 10 'experiment' with speeds and feeds by
program. During a pan setup, the CNC operator has to do a constantly editing the program and tne programmer has a
number of that require physical movements of
certain latitude in seuing reasonable values for the cuttino
the machine slides, rotation spindle, tool change) etc. fcedrales and the spindle speed. The presence of the over~
There are no mechanical devices on a CNC machine. The switches is not a licence to program unreasonable
handle (Manual Pulse GeneralOr) is an electronic, not a cutllng values. The overrides are fine tuning tools only -
unit. In to operate a CNC machine with- program must always renee! the machining conditions of
out conventional mechanical devices the control system the work. The usage of switches does nut make
fers a feature eaHed the Manual DaTa inpUl - or MOL any program changes, but the CNC operator the
The Manual Data Input the input of a program port,unily to edit the program later to the optimum
into the system one program inSTruction at a time. If cuttmg Used properly, the switches
(00 instructions were to be input repeatedly. such as a can save a amount of valuable programming time as
long program, the would be very inefficient. well as the setup time-at the CNC machine.
During a setup and similar purposes, one or a few
structions at a time will benefil from the MDL • Rapid Motion Override
access the MDI !.he MDI key on the operation Rapid motions are selected in (he CNC by a pre-
panel must be selected. That opens the screen display with paratory command without a specified If a ma-
the current status of the system. Not all, but the majority of ~hine is d~siglied to move at 500 in/min (12700 mm/min)
codes are allowed in the MDI mode. Their 10 the rapId mode, this rate will never appear in the pro-
is identical to the of a CNC program in writ- gram. Instead. you call the rapid motion mode by
ten form, This is one area where the CNC operator acts as a ming a special preparatory command GOO. During pro-
CNC programmer. It is important that the operator is gram execution, all motions in the GOO mode will be at the
trained at least in the CNC programming, cer- manufacturer's fixed rate. The same program will run faster
tainly to the point of being able to handle the setup instruc- on a with high motion rating then on a ma-
tions for Manual Data Input. chine with low rapid motion
During setup, the rapid motion rare may some
PROGRAM DATA OVERRIDE control for program proving. when high rapid rates are un-
comfortab~ 10 work with. After the program had been
All CNC units are designed with a number of special ro- proven, raptd rate can be applied at its maximum. CNC ma-
tary swttches that one common feature - they allow chines are equipped with a rapid override switch to allow
the CNC operator to override the programmed of the temporary rapid motion settings. Located on the control
spindle or the programmed speed of axis motion. For panel, this switch can be st![ 10 one of the four
example, a 15 in/min feedrate in the program produces a Three of them arc as the percentage of the max
slight 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 ~o one of them. the rapid motion rate changes. For example,
chaner may be eliminated. It is possible to Ihe )fthe maximum rapid rate is 500 inJmin or 12700 mm/min,
or the spindle by editing the program, but the reduced rates are inJmin or 6350 mmlmin at
this method is not very A certain 'experimenta- the 50% selling and 125 in/min or 31 mm/min at the
tion' be necessary duri the actual cut to find the opti- 25% setting. oflhe reduced rates is more comfonable
mum value. The manual override switches come to to work with setup.
the rescue, they can be by trial during The fourth position of the switch offen has no percentage
operation. There are four override switches found on most and is identified as an F I or by n small symbol. In
control panels: this seLting, the rapid motion rale is even slower than that
o Rapid feedrare override (rapid traverse) Why is it not idenli fled as or 1 for ex-
(modifies the rapid motion of the machine toof) ample? The reason is simple - the control system allows a
selection as to what the value will Jt may he
o Spindle speed override a setting of between 0 and 100%. default seuin a is
(modifies the programmed spindle T/min)
the mOSI logical - usually 10% of the maximum r:pid tra-
o Feedrate override (cutting feedrate) verse rate. setting should never be higher than 25%
(modifies the programmed feedrate) can be done only through a setting of a system
o Dry run mode ler. Make sure that all persons who work on such a machine
(changes cutting motions to a variable speed) are aware of the
CONTROL SYSTEM

• Spindle Speed Override • Feedrate Override


same logic used for the application the rapid rate The most commonly used override switch is one that
override can be used the spindle speed override. The re- changes FOT milling controls,
quired can be established during the actual the feed rate programmed in in/min or mlmin. lathe
by using the spindle speed override switch, located on the controls, the feed rate is programmed in itt/rev or in mnt/rev.
control panel. For example, if the programmed spindle The [ceurate per minute on is used only in cases
speed of 1000 rlmin is loa high or LOa [ow, it may be when the spindle is not rotaling and the needs to be
changed temporarily by switch. the actual cut- controlled.
ting, the CNC operator may experiment with the spindle
speed switch to tind the optimum speed for the The new feedrate calculation, based on the
given cutting conditions. method is a much faster thall ""A/~r""'"
selling, i~ similar to that for spindle speed:
'experimenting' with the program values.
spindle speed switch can on
some controls or selectable in increments of 10%, typically
within the 50-120% of the programmed spindle ~ where ...
A programmed at 1000 r/min can be over-
ridden during machining to 500, 600, 700,800,900,.1000, Fn = Optimized - or new-
Fp Originally programmed tP'j>,fifl'llh"
1100 and! 200 r/min. This range allows the CNC op-
p == Percentage of feedrate
erator flexibility the spindle rotation to
suit the CUlling conditions. is a catch, however. The can overridden within a large range, Iypically
optimized spindle speed chnnge may apply \0 only one tool from 0% to 200% or at least 0% to 150%. When the
of Ihe many used in the No CNC operator can be '·"'"..n ...... ,.,. override is set to 0%, the CNC machine
to watch for that tool and switch the will stop the cutting motion. Some CNC machines do nOI
speed up or down when A simple human oversight have the 0% percent setting and start at 10%. maxi-
may ruin the part, the cutting 1001 or both. recom- mum of 150% or 200% CUlling feedrate will cut I or
mended method is to find out the optimum speed for than the value.
1001. write it down. then change the program
so all the tools can be at the 100% spindle override There are situations, where the use of a feed rate
for production. would the pari or the cutting tool - or both. Typical
examples are various tapping cycles and single point
Comparison of on the threading. These operations require spmdle rotation syn-
switch with the increments on switches for the rapid tra- chronized with the feed rate. In such cases.
verse override earlier) and the feedrate ",,,,,,.lt1,, override will ineffective. The override will
next), more limited The rea- effective. if standard motion commands 000 and GO I
son spindle speed range of 50% to I is safety. are used to program aoy lapping or tread cutting mOlions.
illustrate with a rather example. no operatOr poimilireading command G32, tapping fixed cycles
would want La mill, drill or cut any material at 0 and G84, as well as lathe threading cycles 092 and
spindle rotation), possibly combined a heavy feedrate. 076 havc the feedrate override cancellation built into the
software. All these and other related are de-
]n to into 100%
in the handbook, in more
speed in the program, D. new spindle has to be calcu-
lated. If a programmed spindle speed of 1200 rlmin a
• Dry Run Operation
tool is always set to 80%. it should be edited in the
\0960 r/min, then at 100%. The formula is quite Dry run IS a special kind of override. II is activated from
pie: /' the control by the Dry Run switch. It only has a direct
effect on and allows much higher feedrate
that used for actual machining. In praaice. it means the
program can be executed much faster than using a feedrate
at the maximum No actual
~ where ... place when the dry run is in effect.
So ::::: Optimized - or new r/min What is Ihe purpose of the dry run and what are its
Sp Originally programmed r/min tits? Its purpose is to test the integrity of program
p = Percentage of spindle override CNC operator cuts the first The benefits are
Overriding the programmed spindle speed on the CNC mainly in Ihe time saved during program proving when no
machine should have only one purpose to the machining takes place. a dry run. the part is nor-
spindle rotation for best cutting conditions. mally 1101 mounted in the lfthe part is mounted in
5

the device and dry run is used as well. it is very • Sequence Return
important to provide sufficient clearances. Usually, it
Sequence Return IS a function controlled by a switch or a
means moving the tool away from the parr. program is
key on the control panel. purpose is to enable the CNC
then executed 'dry', without actual cutling. without a
operator to start a program from the middle of an inter-
ant, just in the air. Because of the heavy feed rates in the dry rupted program. Certain programmed functions memo-
run, the part cannot he machined safely. a run,
(usually the last and feed), have to be In-
the program can be checked all possible errors except
put by the Manual Data Input key. The operation of this
those that to the actual contact of the tool with function is closely lied to the machine tool design. More
the material.
formation on the can be in the machine tool
The dry run is a very efficient setup aid to manual. This function is very handy when a tool breaks
all integrity of the CNC program. Once the is during processing of long programs. It can save valuable
proven during a dry run, the CNC operator can concentrate production time, if properly.
on sections of the program that contain actual machin-
ing, Dry run can used in combination with • Auxiliary Functions lock
features of the operation panel. ore three available to the operation of a
CNC machine that are part of the 'auxiliary junctions'
group. These functions are:
• Z Axis Neglect
Miscellaneous functions lock Locks M functions
Another very useful tool for testing programs
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 Neglecr or
Tool functions lock Locks T functions
Ignore. As when this switch is
activated, any motion for the will not
be performed. Why the axis? Since the X and Y axes are described in this chapter, auxiliary functions
used to profile a of the part most common con- generally relate to the technological aspects of the CNC
touring operations), would make no sense to temporarily They control such machine functions as
cancel either one of axes. neglecting (disabling) spindle rotation, spindle orientation, coolant selection, tool
Z temporarily, CNC operator can concentrate changing, indexing table, pallets and many others. To a
on the 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 SLOp. 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 or disable the switch at (he right time. When auxiliary functions are locked, machine re-
lf the Z axis motion is disabled before the Cycle Start key is lated miscellaneous functions M, all spindle functions S
all following Z commands will ignored. If all 1001 functions T will be suspended. Some machine
motion is enabled or disabled during program ",.I"\"I'C<'_ 1001 manufacturers the name MST Lock rather than
ing, the position the Z may inaccurate. Auxiliary Functions Lock. MST is an acronym the
first letters from the words Miscellaneous, Spindle and
Z switch may be in bolh manual Tool, LO the program functions that will be locked.
and automatic modes of operation, Just make sure that the
motion along the Z axis is returned Lo the enabled mode, The applications of these locking funclions are limited to
once the program proving is Some CNC ma- the job setup and program proving only and are not used for
chines require resetting of the Z axis position production machining.

+ Manual Absolute Setting • Machine lock


If this feature is on the control (some controls Machine Lock function is yet another control feature
use it automatically), it (he operator to re- program provi So far, we have looked at the Z axis Ne-
sume a program in the middle of Manual abso- glect function and the locking of the auxiliary functions.
lute can save particularly wIlen processing long Remember that the Z Neglect function will the
Manual Ahsolure setting switch is not a typical motion of the Z axis only and the Auxiliwy Functions Lock
some extent, it is functionally to the Se- (also known as Ihe MST lock) locks the miscellaneous
quence Return setting. Check machine tool documenta- functions, the spindle functions lool An-
tion 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 to test
CONTROL SYSTEM 29

a locking all the tool motions, but there is a the machine operator finds what values must be
good reason to use this It CNC operator changed in the program itself, the program must edited
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 repetition of the job in Ihe fu-
lUre. After all, it should be the goal of every programmer
When the machine lock is enabled, only the axis motion and CNC operator to run any job at one hundred ef-
is locked. All other program functions are ficiency. This efficiency is most likely as a com-
mally, including the tool and spindle bined effort of operator and the programmer. A good
This function can used alone or in combination with CNC programmer will always make the effort to
other functions in order to dlscover possible program er- 100% efficiency at desk and then improve the
rors. Probably the mostlypical errors are errors and even
the various toot offset functions.

• Practical Applications SYSTEM OPTIONS


Many of the control features described in Optional features on a system are like options on a
used in conjunction with each other. A is car. Whal is an option at one dealership, maybe a
Run used in conjunction with the Z Neglect or the feature at another. Marketing and corporate phi-
Auxiliary Functions Lock. By knowing what function are losophies have a lot to do with this
available, the CNC operator a to
needs of the moment There are many areas of equal impor- Here is a look al some conlrol features Ihal mayor may
lance on which the CNC operator has to concentrate when nol be as optional on a system. BUI
setting up a new or Many some important disclaimer first:
lures of the control unit are to the operator's
easier. They allow concentration on one or two items at This handbook covers the subject matter relating
than (he complexity of the whole program. to the majority of control features, regardless of whether they
These have in a reasonable are sold as a standard or an optional feature ofthe system.
now is the lime 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 maHer of • Graphic Display
facL Forexample, the first part of the job will mosllike!y 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 most important, as well as sought after,
ator to monitor the integrity of the program processing, as control options. Do not confuse (his oplion with any type of
well as specific details. The details may include items such conversational programming, which also uses a ,..,.,."'''.~
as a possibility of insufficient between tool tool path interface, In the absence a computer
and the material, checking if the Path looks reason- programming (CAM), a display on the conLrol
able, and so on. panel is a major benefit. Whether in monochrome or in
color, the convenience of seeing the 1001 motions before ac-
The CNC operator will have a number of tasks to perfonn maChining is much appreciated by CNC and
simultaneously. Some the Lasks include monitoring the alike.
spindle feed rate , tool motions, tool changes, cool-
ant, etc. A careful and conscious approach results build- A typIcal graphics option shows the 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 second or even the third pan of the job when the vidual tools are distinguished by different colors, if avail-
CNC operator starts thinking of the optimization cut- able or different intensity. Rapid motions are represented
ling values, such as spindle speed and the culting by a dashed line lype. cutting motions by a line
This optimization will truly reflect the ideal speeds lype. If the graphics function is applied during machining,
a particular workpiece under setup. the lool motions can watched on the display screen -
very helpful CNC machines oily
A production supervisor should not arbitrarily an and scratched safety shields.
override selling than 100%. Many consider
the CNC program as an unchangeable document They Upwards or downwards the display allows for
the attitude that what is wrilten is infallible - which is evaluation of a tool motion or detail areas. Many
not always true. Often, the operator may no controls include actuallOol path simulation, where the
other choice bur 10 override the programmed values. What shape of the part and cuLting 1001 can be set first, then
is mosl imporranl, is the modification the program that seen on the screen.
reflects the optimized cutting conditions.
Chapter 5

• In-Process Gauging • Machining Cvcles


During many unattended machining operations, such as Both the milling and the turning controls offer a variety
in manufacturing cells or Agile manufacturing, a periodic of machining cycles. Typical machining for milling
checking and adjusting dimensional tolerances of the part operations are calJedfixed cycles, also known as the canned
IS imperative. the cUlling 1001 wears out, or perhaps be- cycles. They simplify simple poinl-Io-point machining op-
cause causes, the dimensions may fa!! into the erations such as drilling, reaming, boring, backboring and
'out-of-tolerance' zone. Using a device a suitable CNC cycles for face
program, the In-Process Gauging option quite a sat- ing, pocket milling, patterns, etc.
isfactory solution. The CNC part program for the
In-Process Gauging option will 'Some quite unique CNC lathes have many machining cycles available
formal features - it will written and will to remove material by roughing, profile finish-
be using another option of the control system - the Custom ing, facing, taper cutting, grooving and threading. Fanuc
Macros (somt!iimes called the User Macros), which offer conlrols call cycles Multiple Repetitive Cycles.
variable lype Allihese are designed for programming and
I f a company or a CNC machine shop is a user of the In- faster dlanges at the machine. They are built in Ihe conlrol
Gauging option, there are good chances that other and cannot be changed. Programmer supplies the cutting
control options are installed and to the CNC during the program by using appro-
programmer. Some of Ihe most typical options are probing priate cycle call command. All the processi ng is done auto-
software, tool life management. macros, etc. This technol- matically, by the CNC system. Of course, there will always
ogy goes a lillie too far beyond standard CNC program- special programming that cannol use any cycles
ming, although it is closely related and frequently used. and have to be programmed manually or with the use of an
Companies that already use numerical control technol- external computer.
will be well advised to look into these options to re-
competitive in their lield, • Cutting Tool Animation
Many of the graphic tool path displays delined earl icr, are
• Stored Stroke limits represented by simple lines and arcs. The currenltool posi-
Definition an area on a CNC lathe or a on a tion is usually the location of line or arc endpoinl on
machining center that is \0 work within, can be stored
screen. Although this method of displaying the motion of
as a control system sTored stroke limit. the CUlling tool graphically is certainly useful, there are two
These stored stroke are designed to a colli- to il. The of lhe cutting tool and the
sion between the cutting tool and a fixture, machine tool material being removed cannot be seen on the screen and a
or the part. The area (2D) or the cube (3D) can be defined 1001 path simulation may help a bit. Many modern controls

as either enabled for cutler entry or disabled for the cut- incorporate a feature called CUllillg Tool Allima~
ler entry. It can set manually on the or, if lion. If on the il shows Ihe blank of the
able, by a program input. Some controls allow only one part, the mounting device and the tool shape. As the pro-
area or cube to be defined, others allow more. gram is executed, the operator has a very accurate vis-
ual aid in program proving. Each graphic element is
When this option is in effect and the unit a by a different color, for even a better
motion in (he program that takes place within the forbidden blank the mounting device and
zone, an error condition results and the machining is inter- preset for exact proportions and a variety tool shapes can
rupted. A typical applications may include zones occupied be stored for repetitive use. This option is a good example
by a tuilstock, a fixture, a chuck. a rotary table, even an of CAD/CAM-like features built into a stand-alone control
unusually shaped part. system.

• Drawing Dimensions Input • Connection to External Devices


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

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

STEPS IN PROGRAM PLANNING MACHINE TOOLS fEATURES


The required in program planning are decided by No amount initial information is useful if CNC
the nature of the work. There is no useful fonnula for all is nOI suitable for job. program
jobs, but some basic should considered: nlng, programmer concentrates on a parlieu/ar machine
tool, a particular Each part has to be
o Initial information / Machine tools features (he machine has LO large
o Part complexity to handle the of the part, the pan should nOl be heavier
than the maximum weight allowed. control system
o Manual programming / .nfTmllr... programming
must be capable to provide the needed path, so on.
o Typical programming procedure
In most cases, the CNC equipment is already available in
CJ drawing / data the shop. Very companies go buy a new CNC ma-
o Methods sheet / Material specifications chine just to suit a particular job. Such cases are rather rare
and happen only if moke economic scnse.
o Machining sequence
o Tooling selection • Machine Type and Size
o Part The most important considerations in planning
o Technological decisions are the type and the size the machine, partIcularly
ils work or work area. Other equally'
o Work sketch and calculations machine power rating, spindle speed
o Quality considerations in CNC I'IT/'Inflllmrn"nn number of 1001 stations, 1001 changing sys-
tem, accessories. etc. Typically, small CNC ma-
steps in the list are suggestions only - a guideline. have higher spindle speeds lower power
are quite tlexible and should be adapted for large machines lower spindle speeds available,
job and to the specific conditions the work. their power

INITIAL INFORMATION • Control System


The control system is the of a CNC Being
Most drawings define only shape and of the com- familiar wilh all standard and oplional features avail-
pleted part and nonnally do not specify data about the ableren all controls is a must. This knowledge allows
Initial blank material. For progrnmmi a good knowledge use of a variety of programml
of the is an essential start - mainly in terms of its as machining subprograms, macros
size, type, shape, condition, han.lness, etc. The and timesaving features a modern CNC system.
material data are the primary information about the part. At
(his point, program can be planned. objective of A programmer not to physically run a CNC
such a plan is to use the inilial information and establish the machine. Yet, the programs will become better and more
most efficient method of machinmg. with all con- with good understanding of the machine and its
- mainly part accuracy, productivity, san~ty and control system. Program development program-
converHcnce. knowledge of the CNC machine operation.

31
32 Chapter 6

of the main concerns in program plannin o should be • Disadvantages


the operator's perception of the . To a la~ge degree,
There are some disadvantages associated with manual
such a perception is quite subjective, in (he sense that
program~ing. Perhaps the most common is the length of
operators will express their personal preferences. On reqUIred to actually develop a fully functioning CNC
the other hand, every operator appreciates an error-free, program. The manual calculations, verifications and other
well documented and professionally part related activities in manual programming are very time
p.rogram, consistently and one after A poorly de-
Other also very high on the list,
Signed program is disliked by any operator, of
~re a large percentage of errors, a lack of tool path verifica-
personal tion, (he difficulty in making to a and
many others.
PART COMPLEXITY
• Advantages
At the drawing, material and the available CNC On positive side, manual part programming does have
equipment are the complexity of the qUi,le a few un~atched qualities. Manual programming is
ming task become,s much How difficult to pro- so Intense that It requIres the total involvement the CNC
gram the part manually? What are the capabilities of 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
before starting the manually does have some disadvantages, it teaches a
Simple progr(lmming jobs may be assigned to a tight discipline in program development.
experienced or the CNC operator. It makes It forces the programmer to understand programming tech-
sense from management perspective it is a niques to the lasl detail. In fact, many useful skills learned
good way to gain experience. in manual programming are directly applied to CAD/CAM
programmIng. Programmer to know what is happening
Difficult or will from a computer- at all times and why it is happening, Very important is the
ized programming 'technologies such as Computer tn-depth understanding of every detail during the program
Aided Design (CAD) and Computer Aided Manufacturing development.
(CAM) have been a part of the manufacturing
cess for many years. The cost of a CAD/CAM system is Contrary to many beliefs, a thorough knowledge of man-
only a fraction of what il used to be only a few years ago. ual programming methods is absolutely essential effi-
small shops now find that the benefits offered bv mo- cient management of CAD/CAM programming,
dern technology are too significant to ignored. J

programming systems are availahle various computers and CAD/CAM AND CNC
can virtually job. For a typical machine shop, a
Windows based programming soft ware can very benefi-
The nee~ for i efficiency and accuracy in CNC
A typical example of this kind of application is the
programming has been major reason for development
popular and powerful Masfercam™, from CNC Soft-
of a variety of methods that use a computer Lo prepare part
ware, Inc., Tolland, are others. Computer assisted CNC programming has been
around for.many years. in the form of language based
MANUAL PROGRAMMING programming, such as APyrM or Compact IITM. Since the
late 1970's, CAD/CAM has played a significant role by
Manual programming (without a computer) been the adding the visual aspect to the programming process. The
most common method preparing a program for acronym CAD/CAM means Computer Aided Design and
many years. The fatest CNC controls make manual Computer Aided Manufacturing. The first three letters
gramming much easier than ever before by using or (CAD) cover the area of engineering drafting.
repetitive machining variable type programming, "' ........ 'u .. '" three (CAM), cover the area
graphic tool motion simulation, standard mathematical in- crized manufacturing, where programming is only a
put and other time saving features. manual program- sman whole subject of CAD/CAM covers much
ming, all calculations are done by hand. with the aid of a more just design. drafting and programming. It is a
pocket no programming i~ used. Pro- part of modern also known as ClM - Computer
grammed data can transferred to the CNC machine via a Integrated Manufacturing.
cable, an inexpensive desktop or a laptop computer. In area of have
is and more rellable than other methods, major role for a long Machine controls have
Short programs can manually, by keyboard more sophisticated, incorporating latest techni,ques of
entry; directly at the machine. A punched tape to data tool path graphics, machining
the popular media of the past but has virtually disappeared can now be prepared with the usc
machine shops.
PROGRAM PLANNING 33

computers, using graphical interface. is the price, may handle to an absolute If the con-
no an even small machine can afford a trol system can handle il, manual programming is the way
programming system in house. systems are also to the ultimate control over such a project, when other
popular because of their flexibility. A typical computerized methods may not suitable.
programming system not have to be dedicated only to
programming - all related tasks. often done by the pro- with a well customized and computer-
""lnr'ln"l'''r can implemented on the same computer. For ized system, how can the program
example, cuning tool inventory managemenl, 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 knowing its and
used for uploading and downloadIng CNC programs.

• Integration
The keyword in the acronym CIM is - integration. It TYPICAL PROGRAMMING PROCEDURE
means putting all the elements of manufacturing together
work with them as a single unit and more efficiently.
The main behind a successful integration is to avoid Planning 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 - it must
CAD/CAM computer software is: in a logical methodical The first
sion~ relate to what tasks have to be done and what goals
have to be reached. The other decisions relate to how to
achieve the set goals in an efficient and safe manner. Such a
progressive method not only isolates individual problems
When a drawing is made in a CAD software (such as
as they develop, it also forces their solution before the next
AutoCAD), then done again in a CAM software (such as
step can be taken.
Mastercam), there is a duplication. Duplication breeds er-
rors. In order to avoid duplication, most of the CAD foHowing 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
CAM system to be for CNC programming. are only in a offered for further
Typical transfers are achieved through special DXF or This order may changed to reflect special conditions or
lOES files. The DXF stands for Data Exchange Files or working habits. Some items may be missing or redundant:
Drawing and the IGES abbreviation is a
short form of Initial Graphics Specification 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. a kind of formatter), 4. Control system features
the computer 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 is on the 10. Working sketches and mathematical calculations
cline. terms of actual use, this is probably true. 11. Program writing preparation for to CNC
il is necessary to keep in perspective that any computerized 12. Program testing and debugging
technology is on already well established melh- 13. Program documentation
of manual programming. Manual programming for
There is only one in CNC program planning and that
CNC machines serves as the source new technology
is the completion all instructions in the form of a pro-
- it is (he very concept on which computer-
that will result in an error-free, and efficient CNC
programming is opens the
machining. suggested procedures some
door for developmem of more powerful and soft~
changes for example, should the tooling selected be-
ware applications.
fore or after the pall setup is determined? Can the manual
The manual programming may somewhat part programming methods efficiently? the
frequently today and eventually will be used even less - but worki 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 the key (0 control the power of CAM software. given job, QT permanently. to reflect a particular CNC pro-
computers cannot everything. are some special style. Remember, there are ItO ideal procedures.
programming projects that a CAM software, regardless of
34 Chapter 6

PART DRAWING visions. special instructions, etc. Data in title block sup-
ply crucial information for CNC programming can be
used for program documentation to make easier cross
The parl drawing is the single most important document Not all title block information is needed in pro-
used in CNC programming. It visually identifies the shape, gramming, but may used for program documentation.
dimensions, tolerances, tinish and many other re-
quirements for the completed item. Drawings of complex Revision dates in a drawing are 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 carrent is the version. Only the latesl ver"
data first, then isolates Ihose that are relevant for the de- sian of part design is important to manufacturing.
velopment of a particular Unfortunately, many
drafting methods do not the actual CNC manufac- • Dimensioning
turing They reflect the designer's thinking, rather
than the method manufacturing. Such drawings are Dimensions on the part drawing are either in
erally correct in technical sense, but they are harder to study metric units. Individual dimensions can be
by the and may need to 'interprered'to be a certain datum point or they can he
of any in CNC programming. Typical examples are from the previous dimension. Often, both types of dimen-
methods of applying dimensions, of a datum point sions are mixed in the same drawing. When writing the
that can be used as a program reference point and the view program. it more to all con-
orientation in which the part is drawn. In the CAD/CAM secutive - or incremental dimensions intO datum - or abso-
environment, traditional between design, draft- lute - dimensions. Most CNC programs benefit from draw-
ing and CNC programming mUSI be eliminated, Just as it ings using datum, or absolute Similarly,
helps the programmer to understand designer's intentions, when developing a subprogram for tool path translation, an
it helps the designer to understand the basics of CNC pro- incremental method of programming may ,be the right
gramming, Both, the designer and the programmer have to choice - and the choice depends on the application. The
understand other's methods and find common ground mosl common for CNC machines
that makes the whole process of design and manufacturing uses the absolute dimensioning method (Figure 6-2),
,...",,,"',."',.... and mainly because of the editing ease within the CNC system.

• Title Block
The title block - 6- / - is typical to all professional
---- 170

drawings. lts purpose is to collect all infor-


mation related to the particular drawing.

a
170
By , 110 .-
l-
I

bl
Dr.: Date: 6-2
Program using ABSOLUTE dimensions
Chk.: Drawing number: Only one change in the program is necessary
App ..
With the absolute system of dimensioning, many pro-
6·1 gram changes can be done by a single modification. Incre-
A title block 8xa'mDIB of an .mn,iflFlF!rinn drawing mental method requires alleast two modifications. dif-
ferences between the two dimensioning systcms cnn be
and contents of a title block com- compared in 6-2, using the absolute dimensioning
an the eype of manufacturing and inter- method, and in using the incremental dimen-
nal usually a recl.angular box, positioned in sioning word incremel1tal is more common in
the corner of the drawing, divided into several boxes, CNC. in drafting the equivalent word would be relative.
The contents of the title block include such items as the pari Both illustrations show the a) figure before revision, and
name and part number. drawing number, material data, rc- the b) figure after revision,
PROGRAM PLANNING 35

60 ---,60 ._",......:
e A drawing dimension specifies a hole as
I 075+0.00/-0.05 mm. What actual dimension
should appear in the program?

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


mlly be programmed as X75,0 and X74,95 on the low
." of the A middle value of X74,975 is also a
70! ----.--' 40 ---' 60 --- Each selection is mathematically correct A creative
programmer looks not only for the mathematical points,
but for the technical points as well. cutting of a
tool wears out wilh more parts machined. That means the
machine operator has to fine-tune the machined size by us-
Figure 6-3 ing the tool wear available on most CNC systems,
Program using INCREMENTAL dimensions Such a manual during machining is
Two (or more) 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 contain fractions, A A particular programming approach can control the fre-
tional dimension was sometimes used to identify a im- quency of such manual adjustments to a great Con-
portam dimensional tolerances (such as :1:,030 inches from sider the mm mentioned If il is an external dia-
the nominal number of digits following (he 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-
fied, the the tolerance range). methods are nal diameter, the actual dimension will become smaller as
not an ISO standard are nO use in programming. the CUlling wears out By programming X74,95 for
Fractional dimensions have to be changed inlo their deci- the external (the bottom Iimil) or X75,O for the in-
mal equivalents, The number of decimal places in the lerna] diameter (the top limi!), the wear of the cutting
is determined by minimum increment of {he con- will move into the tolerance range, rather than away
IroL A dimension of 3-3/4 is as and a it The lool offset adjustment by machine oper-
dimension of 5-11/64 inches is programmed as 5,1719, its ator may still be required, but frequently. Another ap-
closest rounding. Many companies have upgraded their proach is to select the middle of the tolerance
to the ISO system and to prin- this method will also a positive effect but more man-
ciples of CNC dimensioning. In this respect, drawings us- ual adjustments may necessary during machining,
the metric units are much more practicaL
• Surface finish
Some dimensioning problems are related (0 an improper
use of a CAD software. such as AutoCAD. 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 finish for
dimension ends up with four decimal various features (he part drawings indicate the
places (inches) or three decimal (metric), This is a in micro inches, where micro inch =, 00000)",
poor practice and should be avoided. The best approach is Metric drawings use specifications expressed in microns.
to for all dimensions where 1 micron:: 0,001 mm, Symbol for a micron is a
require them. and even use Geometric Diflumsioning and Greek letter )1. Some drawings use symbols - Figure 6-4,
Tolerancing standards (GDT) ,

• Tolerances
For quality machining work, most part
have a range of acceptable deviaLion fTom
the nominal size, within its system of reference, exam-
ple, an English of +,0011-,000 will be dif-
ferent from a mel ric tolerance +0.1/-0.0 mm. Dimen-
sions of this type are usually critical dimensions mu,<;1
be maintained during CNC machining. It may be true thai
CNC operator is ultimately responsible maintaining
the part within the tolerances (providing Ihe program
is correct) - but it is equally true, that the CNC programmer
can the operatoro's task Consider the Figure 6-4
following example for a CNC lathe: Surface finish marks in a drawing:
English (top) and metric (bottom)
36 6

The most important factors influencing the quality of sur- METHODS SHEET
face finish are spindle speed, cutting tool radius
and amount of material removed. Generally, a larger
cuLter radius and slower contribute towards finer Some companies have a staff qualified manufacturing
surface finishes. The time will be longer but can often technologists or process planners for determi-
be by elimination of any subsequent operations such of the manufacturing process. people dcvc\op
as grinding, honing or lapping. a of machining . detailing the route of
each part through the manufacturing steps. They allocate
• Drawing Revisions the work to individual machines, develop machining se-
and setup methods, tooling, etc. Their
Another important section the drawing, often over- structions arc written in a methods (routing that
looked by CNC programmers, shows the accompanies the part through all of manufacturing,
..... ,,<u,!",'''''' (known as revisions) made on the drawing up to a typically in a plastic folder. If a is available,
date. or the de- copy should become a part of the documentation. One of
signer identifies such changes, usually with both purposes of a methods sheet is to provide CNC pro-
the previous and the new value - exampl~: grammer with as much information as possible to shorten
the turnover between programs. greatest advantage of
REV' • 3 / DIMENSION 5.75 WAS 5. 65 a methods sheet in programming is its comprehensive cov-
of all required operations, both CNC
Only the latest are important to the program de- tional, thus offering a overview the
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 some of decisions - it is made by a manufacturing who
unique way to distinguish it from any previous specializes in work detailing. The ideal is
versions. Many programmers keep a copy of the part one recommended manufacturing process
ing corresponding to the program in the files, thus prevent- closely matches establlshed part programming methods.
ing a possible misunderstanding later.
For whatever reason, a large number of CNC machine
• Special Instructions shops does not use methods sheets, routing sheets or
lar documentation. CNC programmer acts as a . . . H ..' ' - ' ' - ' ' ' "

Many drawings also include special instructions and as well. Such an environment offers a certain de-
comments that cannot with the traditional gree of flexibility but demands a large degree of knowl-
drafting symbols and are spelled out mClleoeml- edge, skills responsibility at same time.
enlly, in words. Such instructions are very important for
CNC program planning, as they may significantly influ- MATERIAL SPECIFICATIONS
ence the example, an I"ll"mpn!
the part is identified as aground or diameter.
drawing dimension always shows thejinished In the Also important consideration in program planning is eva-
program, this dimension muSI be adjusted for any grinding luation of the malerial stock. Typical material is raw and
allowance necessary - an allowance by the pro- unmachined bar, billet, plate, forging. etc).
grammer and written as a special instruction in the pro- Some may already premachined, routed from
Another example of a special instruction required in another machine or operation. It may solid or hollow,
program to machining performed part with a small or a amount to removed by CNC ma-
assembly. example. a certain hole on the drawing chining. The shape of the material the
should be drilled and tapped and is dimensioned same setup mounting method. The of malerial (steel, cast
way as other hole, but a special instruction indicates the iron, brass, will influence not only the of cul-
drilling and tapping must done when part is tools, but cutting conditions for machining as well.
during assembly. Operations relating to such a hole are not
programmed and if any overlook of a small instruction
such as this, may in unusable pan.
Many drawing instructions use a special pointer called a
Usually it is a line, with an arrow on the point- • Material Uniformity
ing towards ar~ that it to. For a leader
may be pointing to a with the caption: Another important consideration, often neglected by
and alike, is the uniformity material
~12 - REAM 2 HOLES specifications Within a particular batch or from one batch to
another. For a ' ordered two suppli-
is a to ream 2 holes with a reamer that ers La slightly different
has 12 mm
PROGRAM PLANNING 37

even A similar example is a ma- MACHINING SEQUENCE


cut into sjngl~ pieces on a saw, where the length of
varies beyond an acceptable range. This incon-
sistency between blank parts makes programming more Machining sequence
difficult and lime consuming. It also creates potentially un- Technical skill
machining conuiLions. If problems are encoun- help in program some common sense
the best planning is to place emphasis on proach is equally sequence of
safety than on time. At worst, there must have a logical example. drilling must
will some air Ctming or needed cutting feed, programmed before roughing operations before
but no cuts will be too heavy to handle. finishing. first operation second, etc. Within this
order, further of the order of individual
approach is to non-uniform material motions is required for a particular tooL For example,
groups and make programs for each group, in turning, a face cut may be on the part first,
properly identified. The method is to cover all known then roughing all material on wili take place.
predictable inconsistencies program control, for method is to program a roughing for the
using the block skip function. meter, then face and with of the dia-
a center drill
• Machinability Rating for some but in another
a drill may be a
important aspect of IS on which method is CNC program-
machinability. Charts with SUj;(g<::ste:a feeds for ming assignment has to be considered individually, based
most common major tooling on Ihe criteria of safety and
in programming, par-
when an unknown is used, The suggested approach for machining se-
values are a starting point, and can be optimized later, is the evaluation of all In gen-
when the material properties are known. "'''~'''r''''''''' should be planned in a that the cut-
once selected, wi1l do as much as possible,
Machinability rating in the English is given in units a tool On most CNC less time is
per minute (ftimin). Often terms surface feet np.p,(1p('l for positioning the tool than for a tool change. An-

per minute; constant sUlface speed or CS), periph- other is in benefits by programming
eml or just surface speed are For metric all heavy first, then the semifinishing or
designation of the machinability meters per min- finishing operations. It may mean an extra tool change or
ute (m/min) are used. In both cases, spindle speed two, but this method minimizes any shift of the material in
(r/min) lOol diameter (for a or a given part the holding while machining. Another important
a lathe) is calculated, common formu- factor is the current position of a tool when a opera-
I-<n,,,,I1<", system, the spindle can be calcu- tion is completed. For example, when a pattern
per minute (r/min): holes in of 1 the next tool as a boring
bar, reamer or a tap) should be order of
4-3-2-1 to Figure 6-5.

T02::: Drill
Hole4
For a calculation, the

Hole 4
Figure 6-5
Il3r' where ...

r/min = Revolutions per minute (spindle


12 feet to inches ""''''"1''''!'1' may have to be
1000 = meters to millimeters tools and the setup method. re-
fVmin = Peripheral speed in feet per minute verse not be practical in subprograms.
mlmin = Peripheral speed in meters per minute
n: (pi) = value of 3.141593 .... Program planning is not an independent
D (milling) or dividual - it is a very interdependent and
(turning) - in inches or mm cally coherent approach to achieve a certain
6

TOOLING SELECTION are designed to


more productive. Mulfispmdle '''''~'''III'''~
can handle two or more parts at the same
tool holders and cutting is another impor-
tures, such as barfeeder for a lathe, an
tant in planning a CNC category of tool- or dual setup on the table,
ing covers n lot more than Ihe cutting lools and 1001 holders added as well.
- it includes an extensive line of including nu-
fixlures, chucks, indexing tables, clamps, • Setup Sheet
many other holding Cutting lools re-
attention, due to variety available At this of program planning, once the setup is de-
In making a setup sheet is a good A setup sheet
can a simple sketch, designed mostly the use at the
cutting tool itself is selec- machine, that shows the part orientation when mounted in a
tion. It should be selected by two tool offset numbers by the program,
o Efficiency of usage of course, all idenlifica-
Other information in setup sheet
Q Safety in operation to some establ ished
Many supervisors responsible CNC programming try planning stages of
to make the existing tooling work at all times. Often they of clamps, bored jaws 1"I ...n"' ... <"
the fact that a suitable new lool may do the job faster Setup sheet and tooling can
and more economically, A knowledge of tooling source of Information. Most ,"", ..,,,,.~h_
and its applications is a technical profession - the own various versions.
should know principles of cut-
tool applications. cases, a tooling .."' ......&>~'~M TECHNOLOGICAL DECISIONS
tive may provide additional assistance.
The arrangement of of usage is also a The next stage of CNC "',." ...... ,,'""
subject of serious in CNC program planning. lection of spindle speeds,
On CNC lathes, each tool is assigned to a application, etc. All
turret station, making sure disTribution of lools is tors will have their Influence.
anced between short and tools (such as short of spindle speeds is
tools versus long This is important for of the cutter and
of a possible during CUlling or tool speeds and feeds. the
Another concern should be the order in which help determine what amount can be removed
particularly for machines that ~afely, elc. Other factors (he program design
indexing. Mos:t mclude tool extensions, setup rigidity, culling tool material
where the and its condition. Not to be overlooked is the proper selec-
tion of cutting fluids and lubricants - they, too, are
1ant for the part quality.

All tool offset and other program • Cutter


be documented in a known as the looling sheel.
a document serves as a guide to the operator job
setup. It should include at least the basic re-
lating to the tool. For example, the documentation
may include its length and diameter,
the number and offset and
feed selected and other relevant information.

PART SETUP The key factor understanding this principle is to visu-


alize the tool ",,,,,,\.1,,, not (he machine mOllon. most
Another in program planning to noticeable programming a machining
setup - how to mount the raw or premachined material, to a lathe is the cutter rotation com-
what supponing tools and devices should how In both cases, the
many operations are required to complete as machin- in terms of the cutter .nn,lJ111'U
ing sequences as possible, where (0 select a
etc. is necessary and it should be done
PLANNING 39

require more than


roughing and
is to isolate the area that
tool do both operations? Can all
'-UlIklll'"

Is the lool wear a problem?


the surface finish achieved? When programming oon-
cutting rapid motions, take the same care as with
motions. A particular should be lO minimize
tool motions and ensure

Figure 6-6
• Machine Power Rating
Contouring too! path motion - as intended (lathe or miff) Machine tools are power. Heavy cuts re-
quire more power than cuts, A depth or width of a cut
The tool path all profiling tools has to into con- that is too large can tool and stall the machine.
Such cases are 1I1"1<~f"f"f'nl must be prevented, The
sideration the cutter radius. either by
equidistant path center of the radius or CNC machine specifications the power rating of the
ler radius offset. machines for milling and motor at the machine rating is in kW (kilo-
provided with linear interpolation and wans) or HP (horsepower). Formulas are available for
lar interpolation, all as features. To more power ratings, calculating removal rate, tool wear
complex paths, as a helical milling motion, a special faclors, etc. Useful is ofkWandHP
option has to in the control unit Two of on I HP = 550 foot-pounds second):
typical tool
1 kW= 1.341 HP
o Point-to-paint 81so called Positioning
o Continuous a/so called Contouring

a point location operations, such of in can be com-


as drilling, and similar operations; con- is not always in everyday programming.
rinuous path generates a profile (contour). case, experience is often a bener teacher than formulas.
the programmed data to the po~ition of the culter
when a certain is This position is called • Coolants and lubricants
the tool 6-7.
When the lool contacts the for an extended pe-
of Lime, a great amount of M.!,;;.l''vU''''vIJ. The cut-

overheated. becomes and may break. To


1 possibilities. a must be used.
Water soluble oil is the most common coolant. A prop-
(\End coolant dissipates the cUlting edge

T
r"
-i:-- ,6
it acts as a lubricant
lion is to reduce friction and make the
flood of the coolant should at
of lubrica-
removal easier.
cutting edge,
/. with a pipe or through a coolant in the tool.

6-7
Contouring too! path motion with tdefltifil~d contour change points

start and end positions profile are identified operator is responsible for a """""VI"
and so are (he positions fQr contour change. Each tar- the machine. coolant should
position is called the contour change point, which has r'f'r'f'lIT,m,f'n(lp.t1 proportions. Water
to be cnIcuiated. The order of locutions in the pro- to preserve the
gram is very important. That means the tool position] is CNC n"I"\Or~lmYrlpr
the target position commencing at the Start point, position not. Ceramic
2 is the target position beginning at point I, position 3 is the nn,r"'CfIl'-Jl'(f dry, without a cast
from point 2 and so on, until the End is flood coolant, but air blast or oil mist
.-.,.,,,,,,,., If the contour is be in X may be allowed. coolant functions vary between ma-
Y axes. In turning, Z axes. chines. so check the machine reference details.
40 Chapter 6

• Identification Methods
A sketch can be done directly in the drawing
or on paper, Every is associated with mathematical
The of cUlling fluids outweigh their incon- calculations. Using color or point numbering as
veniences. CUHing are often messy, the cutting edge identification methods offers and organizat-
cannot seen, may wet and old ion. Rather (han writing coordinates at contour change
coolant smells. proper all problems re- pain! in drawing, use point reference numbers and cre-
lated to coolants can tie controlled. ate a coordinate sheet fonn
numbers, as illustrated in Figure
A coolant related programming is when to turn the
coolant on in the As the coolant function MOS Position I X axis Yaxis Z axis
only turns on tbe pump motor, sure the coolant actu-
ally reaches the tool edge contact with work. Pro-
gramming the coolant on is better than late.

WORK SKETCH AND CALCULATIONS


Manually progTams require some mathematical
calculations. part of preparation intimidates
programmers but is a necessary Many
contours will require more calculations, but not more com-
plex calculations. Almost any math problem in CNC 6-8
gramming can be solved by the use of algebra Coordinate - blank form Ino data)
and trigonometry. Advanced of mathematics - ana-
geometry, spherical trigonometry, calculus, surface Such (\ sheet can be used for milling or turning, by filling
calculations, etc. - are required for programming complex only the icable The aim is to develop a con-
molds, similar In such cases, a CAD/CAM sistent programming style from one program to another.
system is necessary. Fill-in all values, even those that do not A com-
pleled coordinate sheet is a reference 6-9,
Those who can a right Lriangle can cal-
culations for almost any CNC program. At of the
handbook is an of some common math problems.
When working with more difficult contours, it is often not
the solution i{selfthat is it is the ability to arrive at
the solution, The must have the ability Lo see
exactly what triangle to be It is not to
do intermediate calculations before the required co-
point can be established.
Calculations any lype often benefit from a pictorial
representation. Such calculations usually need a working
sketch. sketch can done by should
in an approximate Larger sketch scales are to
work with. Scaling sketch has one great advantage - you Coordinate sheet example - filled form for milling tool path
can immediately see rhe dimensions
should be smaller or larger the others, the relationship QUALITY IN CNC PROGRAMMING
of individual elements, the ~hape of an extremely small
tail, etc. However, you should never An important consideration in is a per-
use the sketch for: approach and attitudes, attitudes a signifi-
cant influence on the program development. Ask yourself
er use a scaled sketch to some questions. Are you attentive to detail, well
Can a be improved, is it safe, it
Scaling a sketch is a and unprofessional cient? program quality is more than writing an error
that creates more problems than it program. complexity is only related to your
ness or incompetence. knowledge and wilr to solve problems. It
should be a goa! to a program is the
program Set your standards high!
PART PROGRAM STRUCTURE

A program is composed of a series of sequentiaJ in- Digits


structions related to machining of a parI. Each
tion is specified in a format the CNC system can accept, There are ten digits, 0 10 available for use in a program
terpret and Each· must also conform to to create numbers. The are used in two modes - one
the machine tool specifications. This input method of a pro- for integer values a point),
can be defined as an arrangement of machining for real (numbers with a decimal
related inSlrUCliolls. written in formal the CNC Numbers can positive or negative values.
and aimed at a particular tool. controls, numbers can with or without the deci-
mal pOint. Numbers applied in either mode can only be en-
have a different format. bUI most are tered within the range that is allowed by the control system.
differences among
manufacturers, even those Letters
same control This is common,
The 26lelters English alphahet are 1)11 available for
demands individual machine plac.e upon the
programming, at leasl in theory. Most control
control manufacturer 10 accommodate many original
accept only letters reject others. For example. a
machine features. Such variations are usu-
CNC la(he control will the letter as Y axis is
ally minor but programming.
unique to milling (milling machines and ma-
chining centers). Capital letters are normal designation in
BASIC PROGRAMMING TERMS programming, but some controls accept low case
ters with the same meaning as their case equivalent.
field of CNC its own terminology and
terms and its jargon. It has its own abbreviations ex- If in doubt, use CAPITAL letters only!
pressions Ihal only the people in the. field lmderstand. CNC
programming is only a of the 'zed Svmbols
machining and it has a The
majority of them the program. Several symbols are used for programming. in addition (0
the digits letters. The most common symbols are the
There are fOllr terms used in decimal point, minus percent sign, parenthesis and
They appear in professional books, others, depending on the options.
lUres and so on. These words are the key to
the CNC • Word
A program word is a combination of alpha-numerical
Word .... Program creating a single to the sys-
tem. Normally, each word begins with a letter that is
Each term is very common important in pro- followed by a number representing a code or the
gramming deserves own detailed explanation. value. Typical words indicate axes position, fee-
speed. preparatory misceLlaneous ftme-
• Character lions and many Olhcr definitions .

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


have one of
Just like the word is as a single instruclion to
o Digit block is used as a multiple instruction. A
o Letter the control consists individ-
in a logical
o Symbol a sequence or simply a block - is com-
posed one or several words and each word is composed
Characters are combined into meaningful words. This
combination of digits, and symbols IS led the
or two or more
alpha-/wmerical program input.

41
42 Chapter 7

In the control system, must be


allOlhers. iOlhe MDI (Manual II/-
c
pur) mode al the control, block (0 end with a 6 IF
cial End-Of Block code (symbol), This is as
EOB on the control panel. When preparing the program on Words
a computer, (he EHler key on the keyboard will terminate
the block the same result (similar to the old Carriage F2 7 5'. 0' 011 N15,
on typewrirers). When writing a program on paper
each block should occupy only a single line Block
on paper. program block contains a series of sin-
gle instructions that are executed together. N 5 GO: 1~y - '6 ~~~_L-"!..~_~_ 2J.!' 5 . ~_O:
• Program Figure 7·'
The parI program structure varies different controls, Typical word address programming format
but logical approach not one control The !cHer in block
to A CNC program usually with a program of the word and mllst always written
number or similar identification, followed by the blocks is correct, is no\. No spaces characters.)
Instructions in a logical order. program ends with a are allowed wlthill a but are only allowed before
SlOp code or a program termination symbol, as the the word, meaning [he
percent sigll %. Internal clocumentation and
(he operator be placed in strategic places wi numerical assignment. This
The format has evolved varies greatly and on the preceding <1UlHC;~.:>.
cantly during the formats emerged. It may represent a sequence number N, a n ...""1"I" . ."'I," .... '
mand a function M, an
PROGRAMMING FORMATS number D or H. a coordinate word Y or the feed rate
function F, the spindle function S, the tool function etc.
the early days of control, three formalS one word is a series characters (at least two) that
had become significant in their time. They are listed in the define a single instruction to control and the ma-
order of their original introduction: chine. above typical have the fol-
lowing meaning in a
o Tab Format NC only no decimal
o Fixed NC only· no decimal point G01 PreparaJOI)! comml1J1ti
o Word Address Format NC or eNC - decimal point IDO Miscellalleous funCTion
D2S Offiel nwnber selecfion mills
Only the very' early control use the tab sequen-
tial or jixed formats. Both of them disappeared in the early XS.75 Coordinale word value
1970's and arc now They have been replaced by mos Sequence Illlmher(block Illunber)
the much more convenient Word Address Formal. HOI Tool length IIwnber
YO CoordiJlaJe word· zero l/aJue
WORD ADDRESS FORMAT 92500 SpiJuUe speedjuJlctioJl
z-s .14 CoordflllJJe word - Jleg(llive value
The word address formal is on a combination of F12.0 Feedmlejunction
one JeHer and one or more digits - Figure 7-1. TOSOS Tool funclioll . kl1hes
In some applications, such a combination can be TOS TooljilJlClioll- mills
mented by a symbol,' such as a minus or a /MO 1 ",:!block skip symbol
point. Each teller, or symbol represents one character B180.0
in the and Ihe control memory. This unique al-
creates l) word, where the letter Individual arc instructions grouped together to
the address, lowed numerical with or without form sequences of programming code. Each
symbols. The word address \0 a specitic register of will process a of instructions simullaneously,
the memory. Some arc: unit a sequence block or simply a block. The
blocks arranged in a logical that is required to ma-
GOI M30 D2S XS.75 NiOS HOI YO S2500 chine a complete part or a complete operation is the part
Z-S.14 F12.0 TOSOS T05 /MOl B180.0 program known as a program.
PART PROGRAM STRUCTURE 43

The next block a rapid tool motion to (he Address X accepts positive or negative data with the maximum
position X 13.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 Xl3.0 Y4.6 MOS
The of a decimal point in the notation means the
decimal point is not used; the absence of a plus sign in
t6f' where ...
the notalion means that the value cannot be nega-
Sequence or block number tive - a lack means a positive value implication.
N25
G90 Absolute mode These samples format notalion explain the shorthand:
GOO motion mode G2 Two digits maximum, no decimal point or sign
X13.Q Y4.S Coordinate location
MOB ON function N5 digits maximum, no decimal point or sign

The control will process anyone block as a complete unit Five digits maximum, no decimal point or
- never partially. Most controls a random word order F3.2 Five digits maximum, digits maximum in front of
in a block, as long as the block lS first the decimal point, two digits maximum behind the
decimal point, point is 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 written in a specific The manufacLUrers use the same methods, so the
number of digits allowed In a word, depending on ad- the short forms may vary significantly. list
dress and maximum number of decimal places, is set by the dresses, format and description is listed in the
control manufacturer. No! all can be Only following tables. They 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 word is Some are • Milling System Format
used in custom macros. Control limitations are impor-
tant. Symbols supplement the and letfers and provide The description for
with an additional Typical pending on the input units. The table below lists
formal descriptions (metric format is in parenthesis, ap-
symbols are sign, decimal point,
a few others. All symbols are listed in a plicable). Listed are format notations for milling units. The
first column is the address, the column is the format
• Short Forms notation and third column is a description:

Control manufacturers often specify the input format in Address Notation Description
an abbreviated - Figure 7-2.
Rotary or
A A+5.3 degrees·
X ± 5 3 Rotary or Indexing axis - unit is
4I·-iII-iII-4I-e B 8+5.3 - used about the Y axis
Number of digits
-- decimal pOint Cutter radius offset number
0 02 (sometimes uses address H)
-- Decimal paint allowed
F F5.3 Feedrate runction - may vary

-----.. _- Number of digits


decimal point G

---.- Positive or negative


value possible
Described address
H 1001
number (tool position
length
Arc center modifier for X axis
and/or

1+4.4 Shift amount in fixed (X)


Figure 7-2 (1+5.3) 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 full description each would J+4.4 Shift amount in fixed cycles
unnecessarily too long. Consider the following complete J (J+5.3) Corner vector selection for
nnd not abbreviated description of the address X· as a coor- Y axis type of controls)
dinate that is in (he metric system:
7

Notation Description
,,~,"~,~ ~"""~"~~'" "

K+4.4 04 Number of divisions in G73


K Arc center modifier for Z axis
(K+S.3) Depth of Cul in I and
D 044
Fixed cycle repetition count Relief amount in G74 and G75
(053)
L Subprogram repetition COUnt Depth of first thread in G76
E2.6 Precision feedrate for '''p,>",....~
M M2 Miscellaneous function
F F2.6 Feedrale function may vary
N Block number or sequence number
Program number (EIA)
G G2 Preparatory commands
or (:4 for ISO) Arc center modifier X axis
Taper height in X for
Subprogram number call 1+4.4
P4 X axis relief in G73
Custom macro number call (1+5.3) Direction of
p Work offset number - used with G 10 Motion amount in X in G74
Arc center modifier for Z axis
Dwell time in milliseconds Taper height in Z for cycles
Block number in main program when Z axis relief in G73
K Direction of chamfering
used with M99
Motion amount in Z in G75
Depth of peck in fixed cycles Thread depth in G76
G73 and G83
Q L L4 Subprogram repetition count

M M2 Miscellaneous function

in fixed cycles N N5 Block number or sequence number


R Arc radius designation Program number (ErA)
o 04 or (:4 for ISO)
s S5 Spindle in r/min
Subprogram number call
T 14 Tool function Custom macro number call
p Offset number with G I0
X axis coordinate value -----ooi
conds
designation
x

Y+4.4 value
y
(Y+5.3)
Z+4.4
z IZ+5.3}

• Turning System ............. ,'+ u axis

Similar chart as for Ihis one is for lalhe systems. US.3 Dwell function with G04
A number of definltions are same are included only
Incremental value in Z axis
W+4.4
for convenience. Notation is in the met~ w (W+S.3) Stock allowance in Z axis
ric notation is in parenthesis, if to the address.
X+4.4 Absolute value in X axis
Address Notation Description x (X+5.J)
X5.J Dwell function with G04
A A3 input

c C+4.4
(C I 5.3)
Chamfer for direct input z
PART PROG RAM 45

• Multiple Word Addresses table lists


One that is in both
symbols are only with
dance different meanings for some This is a custom macro option. These symbols cannot used in
necessary feature of a word address format. After all, there s(andard programming, as they would cause an error. Typi-
are only 26 in the English but more than cal standard symbols are found on the computer keyboard.
that number of commands and functions. As new contTol Crrl, and All character combinations are not allowed.
features are added, even more variations may be necessary.
Some the addresses an established meaning
• Plus and Minus Sign
(for example, X, Y and Z are coordinate that giving One of the most common
them an additional would be confusing. Many - plus or
ters, on the other are not used very often and a multi- can be either or negative. conven-
meaning for is quite (addresses I, J, K, ience, virtually all systems allow for an omission of
for example). In addition, the meaning of var- for all values. This IS
Ies the milling and turning systems. positive the control Positive
The system has to have sam!; means of accepting lerm i nrlicating an MS\lmed positive value, if no
a particular word with a precisely defined meaning in the grammed in a word:
In most cases, the preparatory command G will
the at other times it will be the X+125.0 is {he same as X125.0
or a setting of parameters.
must always be programmed. If the
the number becomes positive, with
""''','''ES, an
SYMBOLS IN PROGRAMMING (in this case the tool position):

In addition to the basic symbols, X-12S.0 Negative value


symbols for applic(ltions. Xl2S.0 Posimte value
scribes all symbols available on the
X+12S.0 Positive value (-+- sign is ignored)

Symbol Description Comment Symbols supplement the and digits and are an inte-
gral part the program structure.
Fractional of a number
Positive value or PROGRAM HEADER
addition sign in Fanuc macros
Negative value or Comments or messages
Minus sign providing are enclosed in of in-
subtraction in Fanuc macros
lernal documentation is to both the programmer and
Multiplication Multiplication in operator. A series of comments at the top is de-
* Fanllc macros fined as the program where
Block skip function symbol or lures are identified. next
/ divisioll sign in Fanuc macros sample of items that may be used in

(FILE m:ME ••.•••.••..••...••••••••• 01234. NC)


(LAST VERSION DATE ................ 07-DEC-Ol)
VERSION TIME •••••...•••••••••• ,. 19: 43)
(PROGRAMMER ...................... PETER
(MACHINE ••••••••.••..••••••••••••• OKK - VMC)
(CONTROL •••••••••••.•••••••••••••• F.ANOC 15M)
(UNITS ••••••.•••.•••.••..••••.••••...
!I (JOB NUMBER •••••••••••••••••••••••••••• 4321)
(OPERATION ••.•••••••••••.••.. DRILL-BORE-TAP)
;1 SelmiCI)lon (STOCK MATERIAL ...•............ H.R.S. PLATE)
SIZE •••••••••••••••••••• 8 X 6 X
Variable definition or call in Fan ".-,J"'"......... ZERO ••••••••••...••• XO - LEFT
I # I Sharp sign ( YO - BOTT EDGE)
macros ( ZO - TOP FACE )
Equality in Fanuc macros (STATUS • • • • . • • • • • • • • • • • . • • • • • •• NOT VERIFIED)
46 Chapter 7

Within the program, each tool identified as well. the X Y axes. If Ihe absolute position is unknown,
change block to the incremental verSlon:
(*** T03 - 1/4-20 PLUG TAP ***)
N88 G91 G28 XO YO
Other comments and to the operator can be
added La the program as required. If a 1001 has 10 repeated, make sure not 10 include the
1001 change block for the current tool. Many CNC systems
TYPICAL PROGRAM STRUCTURE will an alarm if the 1001 change command cannot
find tool in the the following program ex-
ample, the lOa! repeat blocks will be NS, N38 and N67.
Although iL may be a bit early to show a complete pro-
gram, it wiH do no harm to look at a typical program struc- The program structure is a machine with
ture. Developing a structure is absolutely es- random tool selection mode a typical control system,
sential it is going to be lime. Each block of the with some minor changes to be expected, Study flow of
program is identified with a comment the program, rather than its exact contents. Note the
tiveness of blocks for lool and note the addition of
Note - Program blocks use only sample block numbers. a blank line (empty block) between individual eas-
Blocks in parentheses are not required for fixed cycles. The ier orientation in the program.
XY value in the block N88 should be current position

00701 MAX 15 CHARS) (PROGRAM NUMBER AND IDl


(SAMPLE PROGRAM STRUCTURE) (BRIEF PROGRAM DESCRIPTION)
SMID - 07-DEC-01} (PROGRAMMER AND DATE OF LAST REVISION)
(BLANK LINE)
N1 G20 (UNITS SETTING IN A SEPARATE BLOCK)
N2 G17 G40 GSO G49 (INITIAL SETTINGS AND CANCELLATIONS)
N3 T01 (TOOL TOl INTO ~TING POSITION)
N4 MOG (TOl INTO SPINDLE)
N5 GSO G54 GOO X.• Y.• S .• MOl T02 (TOl RESTART BLOCK - T02 INTO WAITmG POSITION)
NG G43 Z2.0 H01 MOB (TOOL LG OFFSET - CL.E.AR ABOVE WORK - COOLANT ON)
(N? GOI Z-.. F •. ) (FEED TO Z DEPTH IF NOT A cYCLE)
(--- CUTTING MOTIONS WITH TOOL TOl ----)

N33 GOO GaO Z2.0 MOS (CLEAR ABOVE PART - COOLANT OFF)
N34 G2S Z2.0 MOS (HOME IN Z ONLY-SPINDLE OFF)
N3S MOl (OPTIONAL STOP)
(-- BLANK LINE --)
N36 T02 (TOOL T02 INTO WAITIN'G POSITION - CHECK ONLY)
N37 M06 (T02 INTO SPINDLE)
N38 G90 G54 GOO X.. Y.. S .. MO) T03 (T02 RESTART BLOCK - T03 INTO WAITmG POSITION)
N39 G43 Z2.0 H02 MOB (TOOL LG OFFSE.'T - CLEAR ABOVE WORK - COOLANT ON)
(N40 GOl Z- •• F •• ) TO Z DEPTH IF NOT A
(-- - CUTTING MOTIONS WITH TOOL TOA ---)

N62 GOO GSO Z2.0 M09 (CLEAR ABOVE PART - COOLANT OFF)
N63 G2B Z2.0 MOS (HOME IN Z ONLY - SPINDLE OFF)
N64 MOl {OPTIONAL STOP}
(-- BLANK LINE --)
N6S T03 (TOOL T03 INTO WAITIN'G POSITION - CHECK ONLY)
N66 M06 , (T03 INTO SPINDLE)
N67 G90 G54 GOO X •• Y •• S .• M03 TOl (T03 RESTART BLOCK - TOl INTO WAITING POSITION)
N6S G43 Z2.0 H03 MOS (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) ----}

Na6 GOO GSO Z2.0 M09 (CLEAR ABOVE PART ~ COOLANT OFF)
NB7 G28 Z2.0 MOS (HOME IN' Z ONLY - SPINDLE OFF)
NBS G2S X •. Y .. (HOME IN XY ONLY)
Na9 M30 (END OF PROGRAM)
% (STOP CODE - END OF FILE TR.1\NSFER)
PREPARATORY COMMANDS

The program address G identities a preparClfory com- C Example C:


mand, often called the G code. This address has one and
only objective - that is to or to prepare the control N3 G90 GOO
system to a certain desired condition, or (0 a certain mode N4
or a state of operation. example, the address GOO pre- NS •••
sets a rapid motion for machine tool, the address N6
N7 X13.0 YlO.O
G81 the drilling cycle. etc. term preparatory
command indicates meaning a G code will prepare the
control to accept the programming instructions fol/.owing C Example 0:
the G in a specific way.
N2 G90
DESCRIPTION AND PURPOSE N3 GOO
N4 , ••
NS .••
A one block example will illustrate the purpose of the N6 ••.
commands in the following program entry: N7 X13.0 YlO.O

N7 X13. 0 Y10.O All four examples have the same machining result, pro-
viding that there is no change of allY G code mode between
a look at this block shows that the coordi- blocks N4 and N6 in the examples B, C and D.
nates X J3.0Y 10.0 relate to the erul position of cutting
tool, when the block is executed (i.e., processed by Ihe
control). The block does no! indicate whether the coordi-
nates are in the Clbsohl{e or the mode. It
not whether the values are in English or the Modal and non-modal will described shortly.
metric units. Neither it indicates whether the motion to this Each conlrol has own list available G
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 the of ally all controls. others are unique to the particular control
the block contents, neither can Ihe control system. The sup- even the machine tooL Because of the nature of
plied information in such a block is incompleTe, therefore machining applications. the of lypical G codes Will
unusable by itself. Some additional for the different for the milling systems and Ihe turning systems.
block are required. The same applies for other types of machines. Each group
G codes must kept "pn,"'r~IP
For in order to make the block N7 a tool desti-
nation in a rapid mode using absolute dimensions, all these
Check machine documentation for available G codes!
instructions - or commands - must be specified before
block or within block:

APPLICATIONS FOR MILLING


C Example A :

N7 G90 GOO X13.0 Y10.O The G code table on the next page is a considerably
tailed list of the most common preparatory commands
C Example B. for programming CNC milling 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 control manual to make sure. Some
NS G codes listed are a option that must available on
N6 the machine and in the control system.
N7 GOO X13.0 Y10.O

47
Chapter 8

G code G code
GOO Rapid positioning Local coordinate
GOl Li near interpolation
G02 Circular intcrpolallon clockwise Work coordinme
G03 Circular interpolation counterclockwise G55 Work coordinate
G56 Work coordinate offset 3
G57 Work coordinale offset 4
GlO G58 Work coordinate offset 5
Gll Data Seni ng mode cancel G59
G15 Polar Coordinate Command cancel GSO
G16 Polar Coordinate Command G61

G17 G62 Automatic comer override mode


G18 G63 Tappi ng mode
G19 G64 CUlling mode
G20 English units or input G65 Custom macro call
G21 G66
G22 check ON G67
G23 Stored stroke check OFF G68
G25 Spindle fluctuation detection ON G69
G26 Spindle fluctuation detection OFF G73
G27 Machine zero position check G74 Lert hand threading cycle
G76 Fine
GSO Fixed cycle cancel
2)
G31 Skip function
G40 Culler radius compensation cancel eep hole drilling cycle)

compensation - decrease
compensation - double increase

G48
G49 Tool length offset cancel
Scoling funclion cancel G98
runction G99 Return 10 R level in a fixed
PREPARATORY COMMANDS 49

G code Description

APPLICATIONS FOR TURNING


Fanuc lathe controls use three G code group Lypes - A, B G54 Work coordinate offset I
and Type A is most common; in this handbook, Work coordinate offset 2
all examples and explanations are A group, including
table below. Only one type can set at a Types A G56 Work coordinate offset 3
~nd B. can be sel by a control but lype C G57 Work coordinate offset 4
IS optIOnal. Generally, mOSl codes arc identical, only a
few are different In the A and B types. More details on the Work coordinate offset 5
G code is listed at the of this
G59 Work coordinate offset 6

G code Description G61 stop mode

GOO Rapid posilioning G62

GOl Linear illterpolation G64

Circular clockwise
Custom macro modal call
G03 Circular interpolation counterclockwise
G04 Dwell (as a separate block)
G09 Exact Stop check - one block only
Programmable data input for double turrets cancel
Gl0 Setting)

Gll Data Selling mode cancel


- Z axis direction
units of input

G23 Stored stroke check

G25 Spindle speed fluctuation detection ON


s
G26 Spindle nuctuation detection OFF
(Group type A)
Machine zero posilion check

G28 Machine zero return (reference poinl I) G90 Absolute command (G roup type B)

G29 Return from machine zero G91 Incremental command (Group IYpe B)

point 2) G92
Toul pUSilioli

- conSlant lead G94 CUlling cycle B (Group type A)

G35 Circular threading CW G94 fvpe D)

Circular CCW
895
G36
G40 Tool nose radius offset cancel G96 Constant surface speed mode

G41 Tool nOse radius offset lefl


Ie per minute
G42 osc radius compensation
50 8

Most of the preparatory commands are Ul~'i..U::'::'c;u Note rapid motion command GOO -
individual applications, for does it in the program? Just once - in
Inrerpolation, G02 and G03 under Interpolation, In fact, so is command for absolute
etc. In this section, G codes are described in general, re- reason neither GOO nor G90 has been is v ....... QI.I,)1.-
of the type of machine or unit. both remain active from the moment of their
first in the program. The cerm is to
G CO IN A PROGRAM BLOCK this characteristic.

Unlike the miscellaneous


and described in next cm~ptl:r
rator·y commands may be used in a block, providing to repeat a
they are not in a logical con with each other: example
interpre-
N25 G90 GOO G54 X6.75 Y10.S
tation
This method of program writing is severa! blocks shorter
~ Example C - modified (as processed I :
single block
N3 G90 GOO xso.o Y30.0
N25 G90 N4 G90 GOO XO
N26 GOO N5 G90 GOO Y2QO.O
N27 054 N6 G90 GOO XlSO.O Y:220.0
N28 X6. 75 Yl0.5
N7 G90 GOO X130.0 YlOO.O
Both methods will during a '-v........ .. program does not have any practical application by
processing. However, example, when from one location to another at a rapid rate, but it
in a single block mode, block will require pressing the the modality commands. The
Cycle Start key to activate the The shorter method is of modal values is to unnecessary duplica-
more practical, not only length, but for the of programming modes. G are used so often. thal
connection between individual commands within writing them in the program can tedious. Fortunately.
block. (he majority of G codes can only once, providing
rules of application general considerations they are modal. In the control specifications, prepa-
to G codes used with other data in a block. The most ratory commands are as modal and unmodal.
of is of modality.
• Conflicting Commands in a Block
• Modality of The purpose of preparatory commands is to select from
Earlier, the following C was used to two or more modes of If the rapid motion com-
the general placement of G codes into a program block: mand GOO is it command to a
tool mn'!,nn [0 have a rapid motion and

~ Example c· original: same time, it is to

N3 G90 GOO
N4
N5
N6 N74 GOl GOO X3.S Y6.125 F20.0
N7 X13.0 YlO.O
In the example. two commands GO 1 and GOO are m
If the structure is changed slightly and filled with conniCL As GOO is the latter one in the block. it will
data, these may be the result: come feedrale is ignored in this block.
~ Example C - modified (as programmed) : N74 GOO GOl X3.S Y6.12S F20.0
N3 G90 GOO XS.O Y3.O This is exact of the previous Here.
N4 xo
the GOO is in front, therefore the G01 will prece-
NS Y:2O.O
N6 XlS.O Y22.0 motion will take place as a motion at
N7 Xl3.0 YlO.O of 20.0 in/min.
PREPARATORY 51

• Word Order in a Block GROUPING OF COMMANDS


G codes are normally programmed at Ihe beginning of a
block, after the block number, other significant data: of conflicting G codes in one
forefront. Il makes sense,
N40 G91 GOl Z-O.62S Fa.S motion commands as GOO, , G02 and
same is not so
This is a traditional order, on that if the or€~oarat;orv commands. For example, can the lool
purpose of the G codes is to the control command G43 be programmed in the same
to a cenain condition, the ",,..c,,,,,..,,...,I,,,,,,,,,
as cutter offset command G41 or
always be placed The answer is but leI's look at the reasOn why.
that only non~conflicting
block. Strictly there is recognizes preparatory commands
to: into arbitrary groups. Each
has a Fanuc assigned
N40 G91 Z-O.62S Fa.S GOl two-digit governing the
codes in one simple. If two or more G codes
unusual, but quite correct. is nol the case from the same the same block, they are in con-
next method of positioning a G in a block: f1icl with
N40 Z·O.625 F8.S GOl G9l • Group Numbers
Watchfor situations like this! What case IS The G are typically numbered from 00 to
Ihat cutting motion G01, the depth Z different control models,
will combined and executed using the current tealtur(~s It can even be higher for the new-
If current mode is absolute, Z est controls or more G codes are required. One of
executed as an absolute value, not an mcrernell1- these groups - the most one and perhaps the mosl
reason for this exception is important as well - is the Croup 00.
values in the same block. can a
feature, jf used carefully. A typical correct All preparatory commands in the 00 group are not modal,
feature can be illustrated in this example: sometimes using [he unmodal or non-modal.
They are only active in in which they were pro-
(G20) grammed. If unmodal G are to be effective in
N45 G90 GOO G54 Xl.O Yl.0 51500 M03 (G90) consecutive they must programmed in
N46 G43 ZO.l H02 those blocks. In majority of unmodal this
N47 GOl Z~0.25 F5.0 titian will not
N48 X2. 5 G91 Yl. S (G90 MIXE:D WITH G91)
N49 pause measured in
duration within the
no longer. is no need to pro-
through N47 are all in the aU:'U1Ul\.,
dwell in two or more consecutive blocks. After all,
N48 is executed, the absolute
what is the benefit of the next three blocks?
the axes X Y is 1.0,1.0. the
target location is "V"'VIUl.... position of X2.5 combined
N56 G04 P2000
with of 1,5 inches along the Y axis. NS7 G04 P3000
will be X2.5Y2.5, making a NS8 G04 PlOOO
45" motion. this case, the G91 will remain in effect for
all subsequent blocks, unlil the G90 is programmed. Most All three blocks contain the same
likely, the block N48 WIll be written in absolute mode: another. The program can
by simply entering the total dwell
N48 X2. 5 Y2. S
N56 G04 P6000
Normally, is no reason to switch between the two following groups are typical for the control
modes. It can in some unpleasant surprises. Applications for milling and turning
There are some V""'''......HV. when this special distinguished by the M and T letters
brings benefits. for in subprograms. column of the table:
52 Chapter a

Type Group 01 is 1101 byO from Group 09. In a


summary ...
G04 G09 GIO MIT
GIl G27 G28 G29 MIT
G30 G31 G37 MIT
G45 G46 G47 G48 MIT
Unmodal
00 G52 G53 G65
G codes GSl G60 G92 M
G CODE TYPES
GSO T
G70 G71 G72 G73 T Fanuc control system a nexible selection of pre-
G74 G75 G76 T paratory commands. This fnct distinguishes Fanuc from
GOO GOI G02 G03 MIT many other controls. the fact that Fanuc con-
Motion Commands, trols are used it only sense to the
01 G32 G35 G36 T
Cutting Cycles G90 G92 G94 standard control configuration to follow established style
T
-----+---1 of each A typical example is the selection of di-
02 Selection Gl9 M mensional In Europe, Japan and other coun-
G90 G91 M metric system is the standard. In America,
03 Dimensioning Mode common system of dimensioning still uses {he English
(U and W for lathes) T
both are substantial in the world trade, a
04 Stored Strokes G22 G23 MIT clever control manufacturer tries to reach them both. Al-
05 Feedrate G93 G94 G95 T most all control manufacturers offer a selection the di-
mensional But and similar controls also
G20 G2l MIT selection programming codes that were in
Radius Fanuc reached the worldwide market.
G40 G41 G42
Offset
The Fanuc controls use is a simple method of pa-
Tool Length G43 G44 G49 rameter By the speci fie system parameter,
08 Offset
M
one of two or three 0 types can selected, one
G73 G74 G76 GSO M is typical a particular geographical user. Although
G81 G82 Ga3 GB4 M majority of the G codes are same for lype, the
09 Cycles most typical iIluslIation are G used English and
Ga5 Ga6 G87 GSS M
Ga9 M metric selection of units. Many earlier US controls used
070 for units and G71 for units.
10 M
tern has 020 and 1 codes for
M and metric
11 T
Setting up a parameter, the G type is the most
Coordinate 5 G56 G57 practical can be Such a practice, if done at all.
12 System GSa G59
should done only once and only when the conlIol is in-
G6l G62 G64 MIT stalled, any programs have been wriuen il.
13 Cutting Modes
G63 M Change of G code type at random is a guaranteed way
G66 G67
to create an organizational nightmare. in mind that a
MIT
of one code meaning will affect the meaoing of an-
G6a G69 M
other Using units for a lathe, if G70
means an English input of dimensions, you cannot use it to
17 G96 G97 T program a roughing Fanuc provides a code.
Always with the G code All G
18 Input GlS GI6 M this handbook use the default group of Type A, and
Speed the most common group.
24 Fluctuation
G25 G26 MIT
• G Codes and Decimal Point
group relationship makes a perfect sense in all cases. include a G code with a
One possible exception is Group aI for Motion Commands 1 (Rotation copy) or
and Group 09 for The relationship these (Parallel copy). Several preparatory commands 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 ofthe fixed cycle 09, the is immediately ical to described in this handbook.
but opposite is not true. In words, an ac-
tive motion command is nO! by a cycle.
MISCELLANEOUS FUNCTIONS

..'"".... '"'.~., M a CNC a miscella- All for metal removal by


neous jUnction, sometimes a Not have certain common features and capabilities. For exam-
all functions are related to of a ple, can three - and only three -
CNC machine - quite a few are related to of ble
the itself. The more sui tab Ie term miscellaneous
Q normal rotation
lun'-UIJfI.\ is used throughout this UW1UL'VVr....
o Spindle reverse rotation
DESCRIPTION AND PURPOSE o Spindle

three possibilities, there is a


the structure ofa CNe prclgr(!Jlt.progl1lmmers of-
ten some means of certain aspects of the "'''''.,,"', .... orientation, also a machine
tion. example is a coolant. Coolant can only
machine operation or controlling flow. With-
controlled as being ON or being OFF.
out availability of such means, program would be
mcomplete and impossible to run. let's look at the operations are typical to most CNC All
18neOlIS functions to operation of the ma- with an M function, fonowed by no more
- the true machinefonctions. although some control allow the
M function, Fanuc 16/18, example .
• Machino Related Functions
spe-
Various physical machine must be two
controlled by the program, to ensure fully automated ma- other
chining. These functions use the M address and and
include the following
0 Spindle rotation CW Of CCW
0 Gear range change low 1 Medium 1High • Program Related Functions
0 Automatic tool change ATC In addition to the machine some M functions
0 Automatic are to control the execution program. An in-
terruption of a program execution an M function,
0 Caolant operation or OFF
during the change such as a part
0 Tailstock or quill motion IN or OUT Another example is a where one pro-
one or more subprograms. In such a case, each
These operations vary be1:'wef~11 machines, due to the dif- to have a program the number of
ferent designs by various manufacturers. A ma- etc, M functions
chine design, from the point of view, is
on a certain primary application. A CNC mill- previous "'''''''Ull-''.... ''', miscellane-
ing machine will functions related to ous falls lnto two on a partic-
machine than a center or a CNC lathe, A ular application:
numerically controlled wire cutting machine will
o Control of the machine functions
many unique typical to that kind of ma-
chining and on no other machine. o Control of the program execution

Even two ........"..&L.......... for the same type of work, TIlls handbook covers only the most common miscella-
for example, two vertical machining center, will neous functions, used by the majority controls, Unfortu~
have functions ditterjent each other, if they have a nately, there are many functions that vary between ma-
ferent CNC SlgOJ.tllCaIltly different I'InlMI'ITHI and the control system. functions are called
ferent the same manutactlmer machine specific junctions. reason, always consult
also have functions, even with the same the documentation for the machine model and its
model of the CNC <II'UC!,rpTn control system
54 9

TYPICAL APPLICATIONS M04 Spindle rotation reverse


MOS Spindle stop
learning the functions, note type of activity
these functions regardless of whether such activity re- Mo;-r Coolant mist ON
lates to machine or program. Also nOle Ihe ahun-
dance two way toggle modes, such as ON and OFF, IN MOS Coolant ON (coolant pump molar ON)
OUT, Forward and Backward, etc. Always check your M09 Coolam OFF (coolant pump motor OFF)
manual - for reasons of consistency, M func-
tions in this hoodbook are based on the following table: Ml0 open
Ml1 Chuck close
• Applications for Milling
M12 il<;lo{'k quill IN
M code :ription M13 TailSlock quill OUT
"""'=
MOO Compulsory program stop Turret indexing rurward
M17
MOl Optional program stop
MIS Turret indexing reverse
M02 End of program (usually with reset. no rewind)
M19 ;pi oriental ion (optional}
M03 ~ rotation normal M21 Tailstock forward
M04 Spindle rotation reverse
M22 Tailstock backward
MOS Spindle stop
M23 Thread gradual pull-out ON
6 Automatic lool change (ATC)
M24 Thrcad gradual pull-om OFF
M07 Coolant mist ON
M30 Program end (always with reset and rewind)
MOS Coolant ON (coolant pump motor ON)
M41 Low gear selection
M09 Coolant OFF (coolant pump molor OFF)
M42 Medium gear selection 1
M19 ;pindle 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 FeedralC override cancel OFF ( deactivated)
M49 Feedrate override cancel ON (activated)
M49 Feedrate override cancel ON (activated)
M60 Automatic pallet change (A
M9a ;ubprugl"uB call
M78 B axis clamp (nonstandard) I
M99 Subprogr{lm end
M79 B axis unci amp (nonsfandard)

M98 Subprogram call • Special MDI functions


M99 end '''''IF''"'''' M functions cannot be used in CNC n,..r,or~m
at all. This group is in the Manual Data Input mode
• Applications for TurRing exclusively (MDl). An example of such a: function is a step
by tool for machining for service
'rnr\<'tH" only, never in the program. These functions are
M code Description outside of the scope of this handbook.
MOO Compulsory program stop
• Application Groups
MOl Optional program stop
The two major categories, described can further
End of program (usually with reset, no rewind) be into several groups, on the specific
of the miscellaneous functions within each group. A
M03 Spindle rotation normal
(ypical distribution is contained in the following table:
MISCELLANEOUS FUNCTIONS 55

Group Typical M-functions method of programming certain


is in a block that contains a tool
..... "·uv,, •.)
turning the coolant on and - at the same time -
Program
the cuuing tool to a certain part location
there is no conflict between
4 MOS
Spindle may look something like this:

Tool change M06 N56 GOO X12.98S4 Y9.474 MOB

Coolant M07 MOB M09

M10 M11
Ml.2 M13
or
Accessories Ml.7 MiS
at this combination - a Z mo-
M21 M22
M78 M79
with the program stop function

Threading M23 M24


NG19 GOl Z-12.S4S6 F20.0 MOO
Gear ranges M44
This is a more situation and two answers are
M48 M49
needed. One is what exactly will happen. the other is when
M98 M99 exactly it will when the MOO function is activated.
There are and three questions to
M60
1. place immediately, when
.""y,,,,U,,,,,, - at the start of the block?
The table does nOI cover aU M functions or even all possi-
ble groups. Neither it between machmes. 2. Will the place while the tool
On the other hand, il does indicate types of applications is on the way - during a motion?
the miscellaneous functions are for in everyday CNC
programmIng. 3. Will the program place when the motion
command is - at the end of the block?
The miscellaneous functions
used throughout the book. One of the - but which one?
than olhers, reflecting Even if a practical examples may nol be
functions that do not l"""",......".·~ ..-.r\nn apparent at this to know how the control
control system are not system interprets a tool motion and a
However, the concepts for their miscellaneous function.
most control systems 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.
in significant detail. Remaining The actual startup of a M function is into two
are described in the sections covering individual ap- groups - not three:
At this stage. the stress is on the and
of the most common miscellaneous Q M function activates at the start of a
(simultaneously with the tool
M FUNCTIONS IN A BLOCK Q M function activates at of a
(when the tool motion has been cOl1nDl~!ted

If a miscellaneous function is programmed in a block ""''''",n will be during execu-


with no other data supplementing it, only there is no logic to it. What is the logical startup
itself will be executed. For example, ON function M08 in the block N56
correct answer is that the coolant will be at
N45 MOl same time as the tool motion begins. The correct answer
the example block N319 is that the MOO
block is correct - an M function function will be activated after the tool ~,., .. ,.". .
entry. Unlike the preparatory com-
completed. Makes sense? Yes, but what about
only one M function is allowed in a block functions. how do they behave in a block?
allows multiple M functions in the same
them next.
error will occur (latest controls only).
Chapter 9

• Startup of M Functions
M functions completed in ONE BLOCK
""='"'=~==-==9
Take a look at the list of typical M functions.. Add a tool
motion to try to determine the way lhe function is
going to behave, based on the previous nOles. A bit of logi-
cal thinking provides a good chance to arrive at righ! t. no rewind)
Com pare) he two following groups to confirm:

Mfunctions activated at the START OF A BLOCK

UNTil CANCELED or ALTERED


Automatic too! change (ATC)

Coolant mist ON
Spindle rolation reverse
Coolant ON (coolant pump motor ON)

M functions activated at the OF A BLOCK


lVIUV Compulsory program stop

M01 Optional SLOp


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

M30 Program end (always with resel and rewind) PROGRAM fUNCTIONS
M60 Automalic pallet change (APC)
Miscellaneous functions that control program processing
can used either to interrupt temporarily
If there is an uncertainty about how the function will in- (in Ihe middle of a program) or permanently the end of a
teract with the lool motion, safest choice is to program program), Several functions are available for Ihis purpose.
the M as a separate That way the function
will always be processed before or after relevant pro- • Program Stop
gram block. In the majority of applications this will be a
SOltllion. The MOO function is defined as an unconditional or com-
pulsory program stop. Any time the control system en-
• Duration of M Functions counters lhis function during program processing, all auto-
matic operations of the machine tool will stop:
Knowledge of when the M function effect is logi-
cally followed by the question about how long the function o Motion of all axes
will be active. Some miscellaneous functions are active o Rotation of the spindle
only in the block they appear. Others will continue to in
until canceled by another miscellaneous function. o Coolant function
This is similar to the modality the preparatory G com- o Further program execution
however the word modal is not usually used with M
functions. an example of a function duration, take mis- Thc control will ItO! be reset when the MOO function is
cellaneous functions MOO or MOl. Either one will active prclce:5scQ, All program data currently active are
for one block only. The coolant ON function M08, will be (feedrate. spindle etc.).
until a canceling or an altering function is pro- program processing can only resumed by activating
grammed. anyone of the following functions the Cycle Starr key. The MOO function the spindle
will cancel the coolant ON mode - MOO, MO l, M02, M09 rotation coolant function they have to be
and M30. Compare these two tables: grammed in subsequent blocks.
FUNCTIONS 57

MOO function can be as an individual o In the program itself, issue a comment section with the
block or in a block commands, usually' necessary information. comment section must be
motion. If the MOO is programmed together enclosed in (three versions shown):
with a motion command, the motion will be completed
then (he program stop will effective: [Al 109 MOO (REMmr.E CHIPS)

c::> MOO programmed after a motion command " [8] N39 Xl3. 5682 MOO (REMOVE CHIPS)

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


(REJM'O'.i'E CHIPS)
N39 MOO

c::> MOO programmed with a motion command: Anyone of the methods will give Ihe operator
the necessary information. From the two options, the sec-
N39 GOO X13.5682 MOO ond one [B], the comment section in the program, is
The built-in can be read directly from the
In both cases, the motion will screen control paneL
first, before the program is executed. The
between the two examples is apparent only in a • Optional Program Stop
block processing mode (for example, during a trial
will be no practical difference in aula mode pro- The miscellaneous MO I is an optional or a COII-
(Single Block switch set to OFF). dirional program stop. It is similar to MOO function,
one diffe.rence. the MOO function, when MOl func-
Practical Usage lion is encountered in the program, the processing
will nOl SlOp, the operator the control
program stop panel. The Optional SlOP toggle switch or a button key lo-
CNC operator's job cated on the Clln be set to either ON or
common use is a When the in the program is
the part is still During the stop, the part setting of will determine
sions or the lool condition can be checked. Chips accumu- will or continues to
lated in a bored or drilled hole can be removed, for exam-
ple, before another operation can start, as
blind hole tapping. program stop function is also nec- Optional Stop switch setting Result of MOl
essary to the current setup in the middle of a ON
for to reverse a part. A tool
also requires the in the OFF

The control an optional program stop MO I,


described next. The main rule of using MOO is need of a When the MOl function behaves
manual every parl machined. Manual lool the MOO function. The motion of
change in a qualifies for MOO. part coolant and any further execution will be
needs it. A check may oOl if is infre- temporarily interrupted. Feedrate, coordinate settings,
quent. MOl will choice. Although spindle setting, etc., are . The further pro-
between the two is slight, the actual program can only be reactivated by (he Cycle
cycle time can significant for large All programming rules for the MOO function also
MOl function.
When usi'ng the MOO function, always inform the opera-
tor why the function been used and what purpose is. is to program MOl function at the end of
Make the known to avoid a This intent followed by a blank line with no If the pro-
can be to the operator in two ways: gram processing can continue witham Slopping, the Op-
tional Stop switch will be set to and no production
refer to the block that contains time is lost. If there is a need to program tempo-
MOO describe the manual rarily at the end of a tool, the switch will be set to ON and
stops at the end of 100i. The lime loss is
under the for example, to
BLOCK N3 9 •..••. REMOVE CHIPS
a dimension or the
58 Chapter 9

• Program End Percent Sign


program must include a percent sign (%) after M30 is a special stop code.
the of current program. are two This symbol terminates the loading of a from an
M functions available - M02 and are similar, external It is the
but a distinct The M02 function will ter-
minate the program, will cause no return to the first • Subprogram End
block at the program top. The function M30 wililerminate
the program as well but it will cause a return to the last M a is M99.
lOp. The word t return' is often replaced by word 're- mary usage is in the subprograms. Typically, the M99 func-
wind'. It is a leftover the limes when a reel-to-reel tion will a subprogram and return to process-
tape was common on NC tape had to ing of the previous program, If M99 is in a standard
be rewound when the program has completed for program, it creates a program with no end such a situation
M30 function provided this capability. is called an endless loop, M99 should be used only
not in standard
When the control reads the program end function M02 or
M30, it all axis motions, spindle rotation, coolant
function usually resets the system to default condi-
MACHINE FUNCTIONS
tions. On some controls the reset may not be automaTic
any programmer should be aware of it. Miscellaneous functions relating to operation of the
tool are of another group. This section
U the program with the M02 function, the control the most important of them in detail.
remains at the program end, ready for the next Cycle Stan.
On modem CNC equipment there is no need for M02 at all, • Coolant Functions
except for backward compatibility. This function was
in addition to M30 those machines (mainly NC Most metal removal operations that the cUlting
had tape without using a short tape. tool is flooded with a suitable coolant In order to control
(railer of tape was spliced 10 the tape creat- the flow of coolant in program, are three
ing a closed loop. When the program was finished, the start neous functions usually provided for (his purpose:
of the was next to the so no rewind was necessary.
Long could not use loops and and M30. M07 Mis! ON
So for the history or M02 - just
Is M02 the Same 8S M30 ?
Flood ON

On most controls, a system parameter can be set Mist or Flood OFF


to make M02 function the same meaning as that of
M30, setting can It rewind capabilities,
in situations where an old program can be used on a ma- Misl is combination of a small amount of cutting oil
with a new without mixed with compressed It depends on machine tool
manufacturer whether function is standard for a partic-
Tn a if the end of is terminated by the ular machine tool or not. Some
M30 function, the rewind performed; if the M02 mixture oil and air with air only. or with oil only,
function is used, the rewind will not be performed. etc. In these cases, it is typical that an additional equipment
is built into machine. If this option exists on the ma-
When writing program, make sure the last chine, the most common miscellaneous function to
program contains nothing else but M30 as the the oil or air is M07.
end (sequence block is allowed to start the block):
function similar to M07 is M08 - coolant flooding .
N65 . . . .This is by far the most common application in CNC
N66 G91 G2S xo YO programming. It is standard for virtually all machine.
N67 mo (E:tiID OF PRQGR.ll.M) The coolant, usually a mixture oil and
% water, is premixed and in the tank of the ma-
chine tool. Flooding cuning edge of tool is impor-
On some controls, the M30 function can be used together tant for three reasons:
with the axes motion - NOT recommended !:
o Heat dissipation
N65 . . .
N66 G91 G28 XO YO M30 OF PRQGR.ll.M) o Chip removal
% o Lubrication
FUNCTIONS

primary reason La use a coolant flood aimed at the Coolant should always be programmed with two
cutting is to dissipate lant considerations in mind:
cutting. reason is to remove
cutting area, using coolant pressure, Finally, a There will be no coolant splashing outside of
also acts as a lubricant to ease the friction work area (outside of the machine)
cutting tool and material. Lubrication helps to extend tool a will never be a situation when
life and the surface finish. the coolant reaches a hot edge of the tool

initial tool approach towards the part or during IS


nal return to the tool change position, the coolant is nor- function is programmed in the
mally not turn off (he cootant function, use an inconvenience. wet area
M09 function - coolant off. M09 wi lllurn off the oil mist or chine may present unsafe working
supply and nothing else. In reality, the M09 function quickly corrected. Even more "Pro"""
will shut off (he coolant pump motor. when the coolant suddenly starts
that has already entered the material.
the rhree coolant related functions may perature at the cutting edge may cause
in blocks or together with an damage the part. Carbide tools are
are subtle but important differences in by temperature changes than
of the program processing. The possibility can be prevented
explain the differences: the M08 function a few blocks the actual cutting
block. Long pipes or insufficient coolant pressure on the
C) A - oil mist is turned ON, if
machine may delay the start of flooding.
N110 M07
• Spindle functions
C) Example B - coolant is turned ON : Chapter 12 - Spindle all aspects of con-
trolling the machine program. Miscella-
N340 MOS
neous functions that are
= Example C - coolant is turned OFF:
rotation and
Most spindles can rotate in
the spindle control its

clockwise
NSOO M09 (CW) and of rota·
Lion is always relative to a point of view. The
0\.L1,llV<.U\J
C) Example 0 - axis motion and ON: viewpoint is spindle as the
lion along the spindle center towards itsface. CW rota-
N230 GOO Xll.5 Y10.O MOS

= E - axis motion and OFF.


lion in such a view is
as M04. assuming the
as M03, CCW direction
rotated either way.
The drilling and milling Lypes of machines use this estab-
N4QO GOO Zl.O M09 lished convention commonly. The same convention is
LO lathes. On a CNC milling machine or a
The examples show pro- machining center, it is more practical to look towards the
cessing. The gen;;ral rules part from the spindle side rather than from the
o Coolant ON or OFF in 8 :>e:IJ'I1TClIe:
horizontal type), the more
the block in which it is the tailstock towards the spindle, because that
(0 how the CNC machine operator stands in
o Coolant ON, when programmed with the axes motion, nu.H'l/p, M03 and M04 spindle
becomes active simultaneously with the axes motion the same way as for machining cen-
(Example 0) is the fact that left hand tools
o Coolant OFF, programmed with the axes motion, are In more than in
becomes effective only upon completion of milling applications. Make an to
the axes motion {Example E) manual for a machine carefully -
in 12.
The main purpose M08 funclion is to turn the coolant
pump motor on. It that the CUlling Spindle function (0 program a spindle is
receives any coolant On large machines with function will stop the spindle from rotating,
long coolant pipes, or with low coolant pump the rotation direction. On many machines.
is to expected before the coolant neous MOS must also be programmed
pump and cutting lOol. the spindle rotation:
60 9

M03 CW) For example, most rougbing " ....",..".i"'.~"


the spindle more than the
<: ••• Machining at the current location .•• :> low range is usually a better selection.
medium or high range is better, high
M05
<:. • • a tool change ... :> can be more beneficial to the metal removing
M04 (SPDmLE CCW)
distribution of (he miscellaneous functions
<. . . at the current location ... :> entirely on the number of gear ranges the CNC has
available. Number of ranges IS I, 2, 3 or 4. foJlowi
shows typical distribution of the M
may also be required the actual commands in a machine tool manual.
on CNC lathes. A spindle SLOP
. an axis motion, will take Ranges M function Gear
completed.
N/A None programmed
spindle control function is the function M 19,
spindle orienTation. Some control M41 Low range
call it the spindle key lock function. Regardless of the 2 available
M42 High range
the M 19 function will cause the spindle to SLOp in
position. This function is used mostly during M41 Low range
seldom in the program. The spindle must be 3 M42 Medium range
in two main situations: M43 High range
o Automatic tool change (ATC)
M41 law range
o Tool shift during a boring ",",or<>+i,," M42 Medium range 1
and boring cycles only) M43 Medium range 2
M44 High range

thumb is that the higber (he gear range, the


sequence and is possible and less spindle power is re-
cutting tool hold- is also true. Normally, the ."pindle ro-
the M 19 with the ta be stopped to change a gear, but con-
anyway. In doubt, stop the spindle
first, the then restart the spindle.
is necessary for certain boring • Machine Ar.r.fHrt~n
on mill To exit a bored hole with a
1001 away from the finished cylindrical wall, the The majority of " .. ,,,"'''',,<.1, functions is used for some
spindle must the tool cutting bit must be physical operation of the tool <.>"'\..""""Ul
aQd then the tool can be from the hole. A this group, the more common
similar approach is back boring operations. How- ready covered, specifically
ever, use fixed cycles in the changes. The remaining M
program, where is built in. For more scribed in delail elsewhere in
details, Chapter description is offered
chine related M are:
In conclusion. the M 19
gram. It IS aVailable as a ... r~''''''''''''''''
chine operator for M function Description

• Gear Range Selection M06 M

M60 Automatic M

M23 M24 Thread gradual pull-out ON I OFF T

M98 M99 Subprogram call J Subprogram


SE~UENCE BLOCK

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


terminology established a block was as a o Preparatory commands G
single instruction processed by CNC system.
a Auxiliary functions M
A block, a n block -
is normally one written line in copy, or a o Axis motion commands XYZABCUVW ...
line typed in a text and terminated by the Enter key. o Words related to axes I J K R Q ...
This line can contain one or more program words - words
that result in definition a single i to the o Speed, or tool function S FT
machine. Such a program instruction may contain a contents of tile program block will between ma-
of commands, coordinate words, tools of di kinds. but the majority of
(001 functions coolant function, speeds and general rules will be followed, regardless of
commands, position registration, offsets of different CNC system or the tool
kinds, etc. In English, (he contents of one block will
be as a single unit before the control • BuHding the Block Structure
block. When the whole CNC program is pro-
the system will individual instructions program has to built with the
(blocks) as one complete machine step. Each same thoughts the same care as any other important
program consists of a series of necessary to com- structure, for a building. a car, or an It
plete a machining process. overall program starts with planning. Decisions to be as lO
length will always depend on number of blocks what and what will not of the program block,
and their to a building, car, or other structure. Also,
have to as to what order commands -
BLOCK STRUCTURE instructions - nrc to be established within thc block
many other
As many program words as are allowed in a The next few examples compare a typical structure
block. Some controls impose a limit on the number blocks milling operations and blocks for opera-
in one is only a maxi- tions. block is as a separate
mum Fanuc and controls, in practice.
The only restriction is that two or more duplicated words • Brock Structure for Milling
(functions or commands) cannot in the same block
(with the of G example, only one In milling operations. the structure of a typical
miscellaneous M function do exist) or only one block will renee! the realities of a machining center
coordinate word for the X in a 5i block are or a machine.
al The order of words within a block fol-
lows a fairly free required words C Milling block examples:
may be in providing that block (the
Nll G43 Z2.0 S780 M03 HOl {EXAMPLE
N address) is written as (he firs! Although or-
der of individual words in a block is allowed to be in or- N98 GOl X2.1S Y4.575 F13.0 (EXAMPLE 2)
der, it is a standard practice to place words in a or-
a block. ft the CNC to The first milling example in block NIl, is an illustration
and understand. of a 1001 length offset applied with the
block slructure is dependent on dIe speed and ndle rotation
and the type of the eNC machine. A example in block shows a typical pro-
may conlain the following inslructions, in the ng instruction for a simple linear CUlling motion.
Not all data are to be the linear interpolation method and a suitable CUlling
specified every lime.

61
62 Chapter 10

<:> Turning block examples: rectory more descriptive useful. The program descrip-
tion can be read on display screen provides an eas-
N67 GOO G42 5 ZO.l T0202 MOS 1) identification of program stored.

N23 G02 X7.5 Z-2.8 RO.5 FO.012 (E.XAMPLE 2) If program name is than the characters
recommended, no error is generated, hut only the firsl six-
In lathe examples. block N67 a rapid mo- teen will be displayed. Make sure 10 avoid
tion to an XZ position, as well as a few other ("''''''nm,<ln,'l<: names that can ambiguous when displayed.
the tool nose offset startup activation of the tool these two names, they appear 10 be
(T0202), the coolant ON function M08. The ex-
ample in block is a typical circular interpolation block OJ.005 (LOWER SUPPORT A.RM: - OP 1)
with a 01006 (LOWER SUPPORT A.RM: - OP 2)

the control screen display can show only the


PROGRAM IDENTIFICATION siXfeen characters the name, the "'''IV'''!H'''''
names will be ambiguous when
A CNC can identified by its and, on
some controls, also by its name. The identification by 01005 SUPPORT
number is in order to store more than 01006 (LOWER SUPPORT AR)
in the CNC memory. name, if
can be used to make a brief description of pro- eliminate this problem, use an
readable on the control screen display. that is within the characters
data:
• Program Number
01005 (LWR SOPP ARM OP1)
The is commonly a 01006 (LWR SUPP A.RM: OP2)
Ihecontrol system from the
are available for the If a more detailed description is the description
number - the letter a for formal, co- to split over one or more comment lines:
lon l : J for ASCII (ISO) formal. In memory operation,
01005 (LWR SOPP A.RM:
the control system always displays program number with (OPERATION 1 - ROUGHING)
the letter The block containing the number is
not always necessary to include in the The comments in the block or blocks following the
If the program uses program numbers. number will not appear on screen lisl-
specified within an allowed range. Programs typical but still will be a useful aid to CNC operator.
Fanuc controls must be within the range of I - 9999, pro- be displayed during the execution and,
gram zero (00 or 00000) is not allowed. Some course, in a hard copy printout.
controls allow a 5-digit program number. not allowed Keep the names short and descriptive - their pur-
are decimal poim or a negative sign in the program pose is to the CNC in of programs
of leading zeros is - for '-'h<"JJ~J'\;'. in the control memory. The data to
I, 0001. 00001 are all entries, in this in program name are the drawing number or
case for a program number one. number, parl name. operation, etc. Data not
are the name, control mo.del,
• Program Name name, date or company or customer's name and simi-
lar descriptions.
the latest control systems, the name of Ihc
can bc i in addition to program On many controls, program into the
not instead of the program number, The program name (or memory, the CNC the num-
a brief of the program) can to sixteen on the the in the
long (spaces and symbols are The pro- CNC program. It can be a that just bappens \0 be
gram name must be on same line (in same block) as available in (he system, or it can be a number that has a
the program number: unique meaning, perhaps indicating a group (for ex-
all programs that begin with belong to
01001 (DWG. A-124D IT. 2) the group associated with a single customer). Subprograms
must always stared under number specified by the
This has the advantage that when directory of
CNC Innovative use of program numbers
Ihe memory is displayed on the screen, the name of the pro- may also serve 10 keep track of programs developed for
appears next to the program making di- each or part.
SEQUENCE 63

SEQUENCE NUMBERS • Sequence Block format


program input format notation for a
Individual sequence blocks in the program can be using the address N. is N5 for (he more
referenced wilh a number for orientation within and N4 or even N3 older controls. number is
program. The program address a block number is the not allowed. neither is a minus a fractional number or
leuer followed by up to five digits - from I to a block number using a point. Minimum block in-
9999 or 99999, depending on the crement number must be an integer -
block number be N I to for the older allowed is one (N 1, N4, N5. etc.). A In-
controls and N I Lo for the newer controls. Some crement is allowed its seleclion on the
rather old accept block in the three personal programming style or established
only, NI - N999. within the company. The typical sequence block
ments then one are:
N address must be the firs! word in the block.
an easier orientation in programs that use SUbprograms,
there should be no duplication of the between the Program
lwo lypes of For example, a program start- 2 N2, N4, N6, NS,
ing with N I a subprogram also starting with Nl
cause a confusing situation. Technically, there is nothing 5 N5, N10, N15, N20, .••
with such a designalion. Refer to for 10 N10, N20, N30, N40, .•.
on In
100 N100, N20Q, N300, N400,
• Sequence Number Command
In the following table, the column represents se- like to start with of the
quence numbers the way are used normally. sec- NIOO, usually programmed in the incre-
ond column shows the numbers in a for- menLS of I 10, or less. There is nothing wrong with this
mal acceptable to ine control system, as applied to a large start and increment. but the CNC
a CNC program: too long, too soon,

Increment block number In all cases of block incremenLS than one, the pur·
- I~ - - <- " " " " - « - <

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


blocks to be filled-in between blocks, jf a
2 N2 comes, The need may while proving or optimiz-
ing the program on the machine, where an addition to
5 NS
the existing II be required. Although new
10 N10 blocks (the ones inserled) will not be in the oruer ur an
equal increment, at least they will numerically ascend-
50 N50 ing. For a face cut on a lathe one cut (Exam-
100 N100 ple A) was by the operator for two cuts
. (Example
99999 N99999

numbers (block numbers) in a CNC


= Example A - one face cut:

several advantages al least one likely N40 GOO G41 Xl.S zo T0303 Moe
NSO GOl X-0.07 FO.Ol
N60 GOO WO.l M09
On the positive the block mo G40 Xl. S
program search greatly simplified
repetition on (he machine. They
to read on
the program
CNC display screen
= Example B - two cuts:

or on the copy. That means both N40 GOO G4l Xl.5 ZO.05 T0303 MOS
N50 aOl X-O.07 FO.Ol
programmer the operator benefit N60 GOO WO.1
On the side, block will the N61 X3.5
N62 ZO
available computer memory of the That means a N63 GOl X-0.07
of programs can stored in the memory, N64 GOO WO.l M09
programs may not fit in their entirety. mo G40 Xl.S
64 10

"""'1"1"''' inN40 and N6l to block sequence number not affect the order of
this handbook is 10 I"Il"f,a!"lOlm program processing, regardless of the increment. if
if an addition is needed, the blocks are numbered in a or mixed
will have no numbers at all (check if the control the part will always be sequentially, on
system allows block numbers to be omitted, most do), the of the block nO!
mcnt of 5 or lOis the most
Q Example A - one face cut: to 4 to 9
That should more than sufficient for the
N40 GOO G4l X3.5 zo T0303 MOS program modifications.
N41 GOl X-O.07 FO.Ol
N42 GOO WO.l programmers who use a computer hased
N43 G40 X3.S programming system, just a few relating to (he
gramming of sequence numbers. Although the computer
Q Example B . two face cuts: programming allows start number of the block
and its to almost any adhere to the
N40 GOO G4l X3.5 zo.os T0303 MOS start and numbers of on.e (N I, N2, N3, ... ). The
N41 GOl X-D.07 FO.Ol
N4.2 GOO WO. 1
computer based is (0 keep an ac-
X3.S \"""""U<X.J,, of the part geometry the cutting tool
ZO program is modi manually, the part
GOl X-O.07 Ua.'·LlV''''''" is not accurate any more. Any CNC
GOO WO.l program should al ways be reflected in the source of
N43 G40 X3.5 the program, as well as its result - never in result alone.
Note that the program is a lillie smaller and the additional • long Programs and Block Numbers
arc quite visual and noticeable when or
displayed on the screen. are always to into a CNC
limited capacity. In such cases, the program
Leading zeros may (and should) be omitted in lenoth may be shortened by omitting the block numbers al-
- for example. NOOOO8 can tog~ther or - even - by programming them only in the
(he zeros reduce the significant blocks. The significant blocks are those that
zeros must always be written, to have to be numbered for the purpose of search, a
for sl1ch similnri 8S N08 and N80. (001 repetition, or procedure Lha[ on program
use of block numbers in a program is optional, as numbers, such as a machining cycle or tool In these
shown in the earlier example. A program containing cases, select of two or the operator's
is easier to CNC operator, convenience. limited use of numbers will
functions in program editing can be used Increase the length, but for reason.
depend on the num- rr all block numbers have been omitted in the
u"..... ..,.'" repetitive cycles
program, the search on the machine control will
the significant blocks ralher difficult. The CNC will have no
lion but to search for next occurrence of a particular
dress within (l bJock. Y, Z, etc., rather than a se-
• Numbering Increment quence block method
Block numbers in a prog(am can in any physical order unnecessarily prolong
- they can also be
programming Of BLOCK CHARACTER
UI..,",<l ..",,,, they are logical

numbers in of the control specifications,


serves no useful purpose neither do dupli- ual sequence blocks must separated by a special
numbers. If the program contains dupl icate known as Ihe characler or by its
and a block number is initiated at the EOB or E-O-B. most computer
control system will only for the first ""h~'''''''IP!" is generated by key on the
the particular block number, which mayor the program is input to control by MDI
block required. search will have the EOB on the control
'""1-"_"'"........ from the string found reason for the the block. The symbol on
in the sequence numbering-is to appears as a semicolon [ ; ].
to the CNC operator the program has
into the
SEQUENCE BLOCK 65

The semicolon symbol on the screen is only a graphic The name safe block - which is another name for the
representation of the end-or-block character and is never startup block - does not become
entered literally in the CNC program. nuuie safe. Regardless of name,
stances it should be included in the program tain control settings for the program or
older control systems have an asterisk [ * J as slart the program in a state.
symbol for the end-of-block, rather then the ... m,,..."'" tries that set the initial status are the
Many controls use other symbols. that (English/metric and absolute/incremental),
of block, for example, some use the any active cycle, cancellation of the cutter
any case, remember the symbol is only the offset mode, the plane selection for milling, the
!he end-of-block character, not its actual fault selection for lathes, etc. The presented
some blocks for both milling and turning 1'1"\">11"1'\1
STARTUP BLOCK OR SAFE BLOCK At the beginning of the program for milling, a startup
may be programmed with the following contents:
A startup block (sometimes called a or a slalUS
block) is a sequence block. It one Of more Nl GOO G17 G20 G40 G54 G64 GSO G90 G98
(usually preparatory commands of
thal the control system into a N I block is the first sequence number, GOO
state. This block is placed at the rapid mode, G 17 establishes the XY plane selection,
or even allhe beginning of each is selects the English units, G40 cancels any active cutter ra-
processed duriog a repetition of a program offset, G64 sets a continuous cutting mode, G80 can-
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 G98 will retract to the initial level in a
as well as the tool change or tool index block. conditions apply only when the startup
to be searched for, if the program or as the first major block in the CNC
n"""',o,f1 cutting 1001 is to be repeated during a machine op- "LlIJ""'I..ILII"'''' program changes will become
Such a block will be slightly different for the mill- block in which the change is
and systems, due to the unique requirements of command is effective by any subsequent
of GOO. G02, or cancel the GO I command.

in this handbook, in. the Chapter 5, one cov- a CNC lathe program, the startup
state of {he control system when the main G codes:
on, which sets the system default condi-
should never count on Nl G20 GOO G40 G99
they can be easily changed by
without the programmer's knowl- block number, G20 selects the English
the rapid mode, 040 cancels any
set-
the machine tool nose radius offset, and the G99 selects feed rate per rev-
who designed the con- olulion mode, to Ihe absolute or incremental
system is usually not the controls use
addresses X and Z absolute dimensioning and the
should always assume addresses U and W for incremental dimensioning. For
approach and will not lathe controls that do nol U and W addresses,
programmer will try to pre- (he standard G91 is values in X
conditions under the program control, and Z axes. As in the of the words
rather that ng on the defaults of the CNC system. programmed in by subse-
Such an approach is not only much safer, it will also result quent change of
in the that are 10 use during the setup, the
tool path provi ng and tool repetition due to the tool
Some controls """'AM"" o on
the same line. For or not be pro-
breakage, dimensional adjustments, etc. It is also very
grammed with other G are not sure, place the
beneficial to the CNC particularly to
(hose with limited applications listed, G codes in separate
the startup block will not machining cycle time Nl G20 017 G40 G49 Gao
at all. Another block is that the pro-
one machine tool to an- two or more blocks can
default setting of a par-
Nl G20
N2 G17 G40 G49 GSO
66 10

PROGRAM COMMENTS CONFLICTING WORDS IN A BLOCK


Various comments and messages in the program can be In a program
included within (he program body as blocks, or as not impossible. For' the first block of
parts of an existing block, mostly in cases when the mes- the following words:
is short. In either case, the must enclosed
in parenthesis (for ASCIIIISQ Nl G20 G21 G17

e Example A : What contains is simpJy not logically possible.


It instructs the control to:
NJ30 MOO (REVERSE
'Set the English system of dimensions, also set the
e 8: system of dimensions and set the XY plane'.

N330 MOO (REVERSE PART / CHECK


Definitely not
actually happen a
e Example C: statement? The
lection of
N330 MOO possible, the
PART / CHECK TOOL) mensional
Fanuc systems
of a message or comment IS unit will
the machine operator of a words within same
every time the program rpClrn,>" groups have been the section dealing with the
such message ~nr\P<~lrc ;omnlents preparatory commands - G codes, in Chapter 8.
understanding the at a
for documenting the program. If the computer system two or more words that be-
long to the same group, it will not return an error
11:.'.:>~.al::.\;;':>
and comments relate (0 it will automatically the last word of the group. In
changes, chip removal from a hole, dimen- the example of conflicting dimensional selection, it will
cutting tool condition check and others. the preparatory G21 - of metric
or a comment block should be only if sions - thal becomes That not the se-
1'P-1T11,,"'n task is not clear from the program lection required. than
to what happens in each block. 1Vle~ssages sive luck,
comments should be brief and focused, as a program
memory in the CNC memory.
the example illustrating and metric
perspective, a tion, the preparatory command G was used. What would
nrrn,u'PrI at the happen if, for example. the address X was used? Consider
drawing information following example:
This subject has
7 - here is just a reminder: N120 GOl X11.774 X10.994 Y7.0S0 F1S.O

01001 (SHAFT DWG B451) are two X addresses in the same control
(SHAFT TOOLING - OP 1 - 3 J1U'J CHUCK) will not accept the second X value. but it will
an alarm (error). Why? Because there is a difference
(TOl - ROUGH TOOL - 1/32R - 80 DEG) "''''.',,,''',>,.. the programming rules for a G as such and
(T02 - FINISH TOOL 1/32R - 55 DEG) the coordinate system words. allow to
(T03 - OD GROOVING TOOL - 0.125 WIDE)
as many G codes in the same block as provid-
(T04 - OD THREADING TOOL - 60 DEG)
are not in conflict with each other. But the same
"""",11"1'\1 system will not allow to program more one co-
Nl G20 G99
N2 ••• ward of the same address for block.
rules may also apply. For example, the words io
CNC unit is limited, a block may programmed in any providing the N
usi ng comment aa(lre~;S is the first one listed. For example, following
cal. It will block is (but very nontraditional in its
listed in proper
required details. Nj40 Z-O.75 Yll.56 Fl0.0 x6.S45 GOl
SEQUENCE 67

practices, be sure to answer may be surprising - in both cases, the f'("\",lfV'Il


block in a logical order. the 1and J values and will only the
word and is usually fol- R. order of address definition is irrelevant in
axes in their alphabetical or- case. The address R has a higher control
axes or modifiers (1.., L, K..), ity I and J addresses, if programmed in same
miscellaneous [unctions words. and the feedrate word block. All examples assume that the conlrol
as the last item. Select only those words needed for the indI- ports R radius input.
vidual block:

N340 GOl X6.84S Yl1.S6 Z-O.7S F10.O


MODAL PROGRAMMING VALUES
Two other possibilities that may require a special at- are modal. The word modal is
tention in programming how word 'mode' and means that the com-
the following block be in this mode after it has been used in the
once. It can be canceled by another modal com-
N150 GOl G90 X5.5 G9l Yi.7 F12.0 mand of the same group. Without this feature, a
using interpolation in absolute mode with a
There is an the absolute and in- of J 8.0 in/min, would contain the absolute command
modes. Most Fanuc controls wi I] process this the linear molion command GO I and the F 18.0 in
exactly the way it is written. X axis target posi- every block. With modal values, the programming out-
tion will be reached in absolute but the Y axis will put is much Virtually all controls accept modal
be an incremental distance, from (he current po- commands. two examples illustrate the
sition of the cutter. It may not approach, but it ferences:
offers advantages in some cases. - the sequence
block following the block N ]50 will in the incremental e Example A without modal values:
mode, since G91 is specified command!
Nl2 G90 GOl Xl 5 Y3.4 FIB.O
The other programming Nl3 G90 Gal XS.O Y3.4 F18.0
block programmed in the N14 G90 GOl XS.O YO.S F1B.O
dealing with this subject NlS G90 G01 Xl.S Y6.5 F18.0
that an arc or a circle can Nl6 G90 GOl Xl.S Y3.4 F18.0
modifiers I, J and K (depending or a turn- Nl7 G90 GOO Xl.S Y3.4 Zl.O
that a direct ra-
control system is used). It also
input, using the address R, can Both of the e Example B - with modal values:
following examples are correct, in a 90° arc with a
Nl2 G90 GOl Xl.S Y3.4 F18.0
1.5 radius: Nl3 XS.O
e With I and J arc modifiers: N14 YO.S
Nl5 X1.5
Nl6 Y3.4
N21 GOl XlS.3S Yll.348 Nl7 GOO Zl. 0
N22 G02 XlS.as Y12.848 11.5 JO
N23 GOl ... Both examples will identical result.. , Compare
each block of the corresponding block
e With the direct radius R address: of the B the modal commands are
not to ..... ,..,"'""'11"/1 in the CNC program. In fact,
N2l GOl X1S.35 Yll.348
N22 G02 Xl6.85 Y12.848 Rl.5
in everyday programming, program commands used
N23 GOl are modal. The exceptions are program Instructions,
whose functionality starts and in (he same block (for
example dwell, machine zero certain machining in-
structions, such as tool table. etc.). The M
functions behave in a example, if the
program contains a machine zero return two consecutive
N22 G02 Xlo.85 Y12.848 11.5 JO Rl.S blocks (usually for safety it look like this:

or N83 G2B Zl.O M09


N84 G28 XS.37S Y4.0 MOS
N22 G02 Xl6.85 Y12.848 Rl.5 11.5 JO
G28 cannot be removed from N84, because the
command is not repeated.
68 Chapter 10

EXECUTION PRIORITY Functions (hat will be executed simultaneously with the


cutting tool motion:
There are special cases, mentioned earlier, where the or- M03 M04 M07 MOS
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 has been completed:
Here are two unrelated blocks used as examples: MOO MOl MOS M09 M98
N410 GOO X22.0 Y34.6 S8S0 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
NS60 GOO ZS.O MOS
effect (spindle is rotating). Other miscellaneous functions
In the block N4J 0, the rapid motion is programmed to- should be programmed in separate blocks, many of them
gether with two spindle commands. What will actually for logical or safety reasons:
happen during the program execution? It is very important
to know when Ihe spindle will be activated in relationship
to the cutting tool motion. On Fanuc and many other con-
Functions indicating the eod 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-
(ZS.O), this lime together with the spindle stop function tivity of the machine tool (M06, M 10, Mil, MI9. 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. 1n the case of M 19 (spindle orientation), the spindle
completed. Chapter 9 covering Miscellaneous Func/ions rotation must be stopped first, otherwise machine may get
explains this subject. damaged. Not all M functions are lisled in the examples,
but they should provide a good understanding of how they
Similar situations exist with a number of miscellaneeus 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 particular machine and control system han- lhe 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 funClions are oriented mainly
towards the machine setup.
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.
nate words are X ,Y, Z, L J, K, R, etc. They are the basis of Once a command is issued in the MDI mode or in a pro-
all dimensions 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.
o Dimensional units ... English Dr Metric That can be done either through the MOl mode, a program
block, or a system parameter. This applies even for situa-
D 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 a 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 mefers G20 Selects English units (inches and feet)
are used as units, in the English format it is incites andfeet
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 10 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 a code remains active
ENGLISH AND METRIC UNITS until [he opposite G code is programmed - so the meuic
s~stem 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
to some extent in Canada and one or two other clluntries. between the two units anywhere in the program, almost at
The metric system is common in Europe, Japan and the rest random and indiscriminately. This is not true. All controls,
of the world. With the economy reaching global markets, it including Fanuc, are based on the metric system, partially
is imponant to understand both systems. The use of metric because of the Japanese influence, but mainly because the
system is on the increase even in countries that still use the metric system is more accurate. Any 'switching' by the use
English units of measurement, mainly the United Slates. of the G20 or 021 command does not necessarily produce
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
rilmeter setting of the control system, but can be overridden on some - bul 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
manufacturers or disuibutors (sometimes even by the CNC result of changing G21 to G20 and 020 to 021 WIthin the
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 11

c::> Example 1 - from metric to units: • Comparable Unit Values


are many units available in the metric and
G21 IniTial wUt selection (metric) In CNC programming, only a very small
GOO X60. 0 X value ,,. arrPI,,)(p/J of them is used. The are based on a mil-
G20 Previous value will change into 6.0 incites application. The Eng-
(real translalion is 60 I'I1m 2.3622047 inches) depending on
for the different
c::> Example 2 - from English to units:
Millimeter mm
G20 1niJ.ial unit seleclion
GOO X6.0 X value Meter m
G21 Inch in
Foot ft
Both examples illustrate problem by
switching between the two dimensional units in the same Many programming terms use abbreviations.
program. For this reason, always use only one unit of next table shows the terms between the two
dimensioning in a If the program calls a mensional systems (older terms are in
subprogram, the rule to subprograms as well:
Metric English
mlmin (also MPM) ftlmin (also FPM or SFPM)

In it is unwise to even if the mm/min in/min (also IPM or fpm)


control system aTe n ..",';.",; selection of the
system will difference how some con- mm/rev in/rev {also IPR or ipr}
trol functions will work. following functions will mm/tooth (also IPT or ipt)
fecled by the change one system of units to the
kW HP
o Dimensional words (X, Y, Z axes, I, J, K modifiers, etc.)
o Constant Surface (eSS - for CNC lathes)
ABSOLUTE AND INCREMENTAL MODES
o Feedrate function F
o Offset values Hand 0 offsets for milling A dimension in either input units must have a rn",."h"-",
and tool preset a point of reference. example, if X3S.0 In

o Screen position number of rlol"i..,.,,,1 program and the units are millimeters, state-
ment does nol i where the dimension of mm has
o Manual pulse generator· the HANDLE (value of flllIll<;!II'lII1'l. needs more information to
a Some control system parameters correctly.

The initial selection dimensional units can There are two In

done by a system setting. The control status o Reference to a common point on the part
when the power turned on is the same as is was at ... known as the for ABSOLUTE input
the time of the power shut off If neither G20 nor I is
programmed, accepts the dimensional units se- o Reference to a point on the part
lecled by a .-.<;>'-""',1"1 ..:J"",,,H.,,,. If G20 or G21 is ""lI.lU\AJ ... known as the last tool position for INCREMENTAL input
the program, the command will always In the example, the dimension X35.0 (and any as
ority over system parameter "'.... LUIl;"'. well) can from a selected fixed point on the
mer makes - the control ""<:1"""'" part, called or program zero, or program
preting them, but it point - all terms have the same meaning.
Always the units setting in a ",,, ... ,,r,,t value can be measured from
fore any motion, offset selection, or the tool
nate system and G54 La G59). current position for the next
low this produce incorrect results. cannot distinguish one two
when frequently ng unils for different jobs. statement alone, so some
added to the program.
INPUT OF DIMENSIONS 71

All dimensions in a CNC program measured from the • Preparatory Commands 690 and G91
common poinl (origin) are absolute dimensions. as illus-
There are I wo preparatory commands available for the in-
trated in Figure JJ-J, and al I dimensions ina program mea-
put of dimensional values, G90 and G91. to distinguish be-
sured from the current position (last point) are incremental
tween two availabJe modes:
dimensions, as illustrated in Figure J /-2.
G90 Absolute mode of dimensioning
3
0 , I
G91 Incremental mode of dimensioning
2
0 - -
'4
---

0 Both commands are modal, lherefore they will cancel

cF~ 1r1_
each other. The control system uses an initial default setting
1
0 when powered on, which is usually the incremental mode.
This setling can be changed by a system parameter that pre-
sets the computer at the power startup or a reset. For indi-
,/I~ vidual CNC programs, the system setting can be controlled
/
/: • I
by including the proper preparatory command in the pro-
--- '
I gram, using either one of two available commands - the
ORIGIN,I
-
• G90 or G91.
Figure 71·1 It is a good programming practice to always inclurle the
Absolute dimensioning - measured from part origin required setting in lhe 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. absolute programming has a lot more advantages
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-
-- -01 low this reasoning:
,/L-______________________ __ _
~

Consider a typical start of a new program loaded into the


machine control unil. The control had just been turned on,
//~/ :J:. :_~:_:_ _ =I===:I==I==.! 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 mosllikely 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 progrom
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 are 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'lhe mode as incremental, which is the default value
motion from the current location of the system parameter. The lool 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
us X35.0, is programmed the same way for either point of amOlJnl, in the case of neg<1li ve target values. In either case,
reference, some additional means must be available \0 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 selling of a system parameter, not always reflecting gram with safety 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 are many Fanuc the absolute and incremental
measured from Ihe of origin. origin is the pro- modes can be combined in a single nrr'O'f':~rn
gram poinT also known as program zero. The ac- cial programming purposes. This
tual the is the di fference bet ween usual, but are significant benefits this advanced
current absolute position the tool and the previous abso- plication. Normally. the is in one mode only -
position. The [+] plus or H refer either in the absolute mode or incremental mode. On
to the quadrant of coordinates, nor direction controls, for to the opposite mode, the
motion. Positive does not have to written for any motion command must programmed in a block.
address. AI! z.ero values. such as XO. YO or ZO to Such controls, for do not to program an in-
the at program point, not to the cremental motion along one axis and an absolute motion
motion itself. The zero value of any axis must written along other axis in the same block.
Most do allow to program both
The preparatory command G90 absolute in the same All that needs to be done is to
mode remains modal until the command 091 specify the G90 or the G91 preparatory before
is programmed. the absolute there will no mo- the significant address.
tion for that is omitted in the program.
For lathe work, where G90 G91 are not
main advantage programming is tbe ease is between the X U axes and the Z and Waxes.
of modification by the programmer or CNC opera- The X and Z contain the absolute values. U Ware the
tor. A change of one dimension does not any other incremental values. Both types can be wriuen in the same
menslOns m program. block without a problem. Here are some typical examples
for both applications:
lathes with Fanuc controls, the common repre-
of the absolute is the axis as X C Milling example;
command. Some lathes
Fanuc controls. N68 GOl G90 X12.5031 G91 Y4.S111 Fle.S

• Incremental Data Input - G91 The milling shows a motion the cutter has
La reach the absolute position of 12.5037 inches and - at
programmmg, a the same rime - to move Y axis by
rPI,'7TH'P mode, all program dimensions are as de- 177 inches in the Note position
"'<:l,elln-", distances into a specified direction (equivalent to
commands G90 and G91 in the block - it is Im-
'on the control The actual mo- portant, but it may not work on all
tion of the is the speC! fied amount along
with the direction indicated as or negative. C Turning example:
signs + or - specify direction of the tool motion, not N60 GOl X13.S6 W-2.S FO.013
the quadrant of rectangular coordinates_ Plus for posi-
tive values does not have to be written, but sign must example a lathe shows a tool motion,
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 aiong that axis, and do not have inches and - at/he same time - to move 2.5 inches into
to written at all. If a zero axis value is programmed in in- the Z direction. by the neremer
mode, it will preparatory com- tal address W. or G91 is not nonnally
incremental is G91 and remains modal un- the Group A G codes is the most common
til the absolute is programmed. will be no one ~nd does not G code of dimen-
motion for any axis omitted in the block. sional mode selection.
The main advantage of programs is their is a switch the absolute
portability between individual of a An mode in a CNC program, me programmer
program can called at different locations of must be careful not to remain in the 'wrong' mode
the part, even in different programs. It is mostly when man The switch (he modes is Iy tem-
developing or repealing an equal distance. porary, for a specific It may one block or
several blocks. thatLhe original selling for (he pro-
For controlled CNC lathes, the common represen- Remember that both the absolute and
tation incremental is the axis designation as U .nf'rp,...,pnt,:; modes are modal- remaIn In un-
and W, without the G91 command. Some lathes use by the opposite
I, but not those with controls.
IN OF DIMENSIONS 73

DIAMETER PROGRAMMING MINIMUM MOTION INCREMENT


All dimensions along on a CNC lathe can be Minimum increment (also called the leas! increment) is
as This approach simplifies the smallest amount of an a.:ds movement the control sys-
programming and the program to read. lem is capable supporting. The minimum increment is
Normally, the defauh controls is the smallest amount thai can be programmed within the se-
ler programming. The system parameter can lected input. Depending on the dimensional
changed to interpret the X as a radius inpul: Ihe minimum increment is ex-
in millimeters system or in
GOO X4. 0 Dia.me/erdimellsioll , .. when sel 17)' {J {Ifl1'ffJl1l'lf'Y system.
GOO X2. 0 R(Jf/ilis ... when set by (j paroJlleler
Units system Minimum increment
value is rnrrpt·,
setting. The diameter is easier to Metric 0.001 mm
by both the programmer and operator,
use the diameter di for cylindrical .0001 inch
suring diameters at machine is common. cer-
lain caution - if the diameter programming is used, all tool
wear offsets for X must be treated as applicable to In the of minimum most com-
the diameter oJfhe not to il$ single (radius value). are O.OOl mm 0.0001 inches for met-
units respectively. a typical CNC
Another consideration, very impor- increment for the X axis is also 0.00 I mm or
Lant, is the the absolute or the incremental but is measured on the diameter - that means a
mode of dimensional input. The diameter programming, mm or .00005 inches minimum increment per
where the X represents the part IS machining is much more tlexjble
much more common in the absolute mode. In those cases. the metric than in the English
when an incremental is required. that all
incremental dimensions in the program must be speci-
fied per dial1letel; lIot radius. Minimum increment Converted equivalent
- .~

Inlhe mode, the intended X mOlion will 0.001 mm .00003947 inches


be programmed as U as a distance and ..
direction to on n .0001 inches 0.00254

For example, two sections of the following metric


programs are - note Ihal Ihey bOlh starr in the ab~
solute mode and only the diameters different:
the metric system J54% more accarale
Q Example 1 - Absolute diameters: system, which the English system
less accurale metric system,
GOO G42 X8S.0 Z2.0 T0404 MOS (ABSOLUTE START)
GOl Z-24.0 FO.3
X9S.0
FORMAT OF DIMENSIONAL INPUT
Z-40.0
X1l2.0 year of 1959 is considered to be the
Z-120.0 numerical Since that lime,
X116.0 that intluenced the nrr,ot":lm
......."'''''~'"' have taken
GOO .. format of dimensional
Q Example 2 - Incremental diameters: Even to this day, data can be in
one of the four possible ways:
GOO G42 X85.0 Z2.0 T0404 MOS (ABSOLUTE START)
GOl z-24.0 FO.3 Q Full address format
mo.o (X95.0)
o leading zeros suppression
Z-40.0
ill 7 . 0 (Xll.2 • 0) o zeros
Z-120.0
U4.0 (Xl16.0) o Decimal
GOO ..
74 Chapter 11

In to understand format Since leading zeros suppression and the trailing zeros
back some years may be beneficial. control suppression are mutually exclusive. which one be
(mainly the old NC systems as compared to the more mod- programmed for Without a decimal poim? As it
ern CNC were nOl able to accept the input depends on setting the control system or
of dimensions - the decimal point formal - but the (he designation of (he status by the control manufacturer,
accept all the earlier formats, the actual stnLuS must be known. status deter-
even decimal format is most common. The reason mines which zeros can suppressed. It may be the zeroes
iscompatjbility with lheexisting programs (old programs). allhe beginning or zeros allhe end of a dimension with-
decimal point programming method is latest of out a decimal poin!. In the extremely unlikely evenl the
available, systems thaI allow point system is with zero suppression feature
programming can also accept programs written many years as the only programming the decimal point will not
earlier (assumed that the control and machine tool are also be possible. illustrate results of zero suppression.
compatible). The reverse is nor true. earlier will be
is a very imponant issue, knowing how the Jr the English input .625 inches is to programmed in
interprets a number that 110 decimal poim is the leading zero suppression format applied to the X
for all motion commands and it will in the program as:

• fun Address format X6250

The full format of a dimensional The same dimension inches with the trailing ze-
notation of +44 in English met- rOssuppressed, will in Ihe as:
That means ali eight digits have to
len for the words X, y, Z, I. J, K, etc. For example, the X0000625
English of .625, applied to X axis, will
be written as: The metric units input of 0.42 mm, also applied 10 the
axis, is written with the lending zeros suppressed as:
X00006250
X420
dimension of 0.42 mm, when to
the X axis, written as: The same dimension of 0.42 mm with the zeros
suppressed will appear in the program a,,\:
X00000420
X0000042
full formal programming is applicable only to
early control un its, but is correct even today. pro- Although the examples above illustrate only one small
grammed was usually without the desig- ieation, the impression leading zero suppres-
nation, which is determined by position of the dimension is more practical than the trailing zero suppression is
within the block. For modern CNC programming. the full quite Many older control systems are indeed set
format is obsolete and is used here reference (rarily 10 the zero suppression as the default,
comparison. Yes, format will quite because its practicality. 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
On other hand. if even one decimal point is
• Zero Suppression omitted (forgOlten) in the program, this knowledge beco-
mes very useful and subject is not trivial any more.
Zero suppression is a great improvement over
full programming It was <ldaptation of a new Preference for Leading Suppression
format that reduced the number of zeros in thedimensional
the dimensional input the
input Many controls still support the method of
7~ro suppression. but only for reasons of compatibility with
syslem can accept eight digits, withoUl a
decimal point, ranging from 00000001 to 99999999:
old and proven programs.
o Minimum: 0000.0001 inches or 00000.001 mm
Zero suppression means that either leading or
trailing zeros of maximum input do not o Maximum: 9999.9999 inches or 99999.999 mm
have [0 be written in the CNC The result is a great
reduction in program The default has is nol written. If the program uses zero
been done by the control manufacturer, although de- suppression either type, a comparison of input values
fault mode can be optionally set by a parameter. should be useful:
Don 'I allY WiThoul a reason!
INPUT OF DIMENSIONS 75

Input - inches the I can programmed with the X fo!lowed by


the of eight digits, always positive. If control
leading zeros Trailing zeros system the decimal point, there is no confusion. If
Decimal point the leading or the trailing zeros have to
suppression suppression
is very important
XO.OOOl Xl XOOOOOOOl
dwell
XO.OOl XIO XOOOOOOl

XO.Ol XIOO XODOOOl


a X0000050
XO.l X1000 00001
a No zeros X500
Xl. 0 XlODOO 0001 a No trailing zeros X000005
XOOl a Decimal point XO.5 or X.5
XOI Note thaI the format is the same
dwell as for the words. The programmed formal
XI0000000 Xl
will always adhere to the notation of the address.
dentally, in some dwell is expressed by the
leading zero suppression is much more common, be- P address, which a decimal point at all and
bencfits numbcrs with a small parI must be programmed the leading zero suppression
than a large integer part. mode in effect. will be equal to P500.
the metric input the resulls will
• Decimal Point Programming
Input value comparison - millimeters All modem will use the decimal point for
dimensional input the decimal point, par-
Leading zeros ticularly for program a fractional portion,
point
suppression makes the CNC program much to develop and to
read at a later date.
XOOOOOOOl
From all the available nT"""""'"",
XOOOOOOl
used. not all can be
XOOOOOl The ones that can arc those
millimeters or seconds
Xl-O XlOOO XOOOOl
The following two thedeci-
XIO.O XIOOOO XOOOl mal point is allowed in and tum-
controls:
XlOO.O XlOOOOO XOOl

XlOOO.O X1000000 XOl control programs:

XIOOOO.O XIOOOOOOO Xl X, Y, Z, I, J, K, A, R

time.
=> Turning control programs:
important for example, X, Z, U, W, I, K, R, C, F
programmer forgets to the
point or CNC operator forgets to punch it in? The control system that supports option of program-
- and common - errors that can be avoided ming the decimal point, can also dimensional values
good knowledge. without a decimal poin£, to allow with older
programs. In such cases, it is the
complete the section on zero suppression, let's look at principles of programming and
a program input that uses an axis letter but no/ as a the traiJing zeros. If they are used rrw'r",1'" ex-
nate word. A command will be to explain. planations). there will be no problem to the various
Chapter 24 covers the delails relating to the dwell dimensional formats to any other old or
gramming. use the basic format and one sec- new. If possible, program the as a standard
ond dwell The dwell formal is approach.
the dwelling This format tells us that
76 11

compatibility enables many users to load • Input Comparison


their old in format), into the new
Differences in the input format for both and
not the other way around usually with
metric dimensioning can be seen clearly. One more time,
or no modifications at all
the same examples will shown. as before:
Some units do not have the ability to
an paper tape they have no tape convert Q English 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 if No leading zeros X6250
possible and (probably not). No trailing zeros X0000625
to store the contenls of a tape in the memory Decimal point XO.625 or X.625
computer.
much better Q Metric example input of 0.42 mm :
able software Full format X00000420
possible. No leading zeros X420
cializing in No trailing zeros X0000042
in the metric system assume 0.00 I Decimal point XO.42 or X.42
mm mInImUm while in the English the
increment is .000 I an inch (leading zero suppression CALCULATOR TYPE INPUT
mode is in effect as a default);
In some such as woodworking or
Y12 • 56 is Yl25 600 ..Jor English units (especially metric)
Y12.56 is Y12560 .. .jormefriculliis not require decimal only whole numbers. In these
cases, the decimal point would always be followed with a
without the decimal zero. Fanuc provides a solution to such situations by the
the same block: feature called calculator input. Using this feature can
shorten program size.
N230 X4.0 Y-10
calculator type input selling of a system
This may be beneficial extreme conservation of parameter. Once the parameter is the decimal point and
system memory. For X4.0 word WIll the trailing zeros do not to they will as-
H l r . . . ",,, -

fewer characters than the X40000 - on the other hand, example, will as X25.0, not
the Y-IO is shorter decimal poin! equivalent of the normally expected
y-o.OO I (both examples are in English units). If all
before or after the decimal are zeros, (hey do not In case the input value the decimal point, it
10 wriUen: can written as usually. means the values with a dec-
imal point will be interpreted correctly and numbers with-
xO.s ::: X.5 ou( decimal point will be treated as major units only
Y40.0 X40. or millimeters). Here are some
Z-O.l Z-.l
F12.0 ;:; F12. Standard Input Calculator Input

RO.125 ::: R.12S ... etc. X345.0 X345
Any zero value must be written - example, XO cannot XL 0 Xl
written as X only. In this all the program ex-
YO.67 YO.67
amples use the decimal point whenever possible.
Many programmers prefer to nrr"',"'!\rT\ zeros as in the left Z7.4B Z7.48
of the example. They
memory. but they are Normally, the control system is set to the
for learning. suppression mode and the non-decimal
preted as of the smallest units.
Z 1000 in I mode will be equivalent to .0
SPINDLE CONTROL

machines, machining centers On CNC lalhes, all three alternatives may


use spindle rotation when removing mate- on the control system. For the CNC mill'
I-'..... JJIUllII5
a rotation may be that of the cutting tool terns, peripheral spindle speed is not applicable,
or itself (lathes). In both cases, the. spindle speed code number and the direct spindle speed
spindle and the working feed rate of the are. spindle speed selection by special code number is
to be strictly controlled by the program. an obsolete concept, no! required on modern controls.
require instructions that relate to the
selection of a suitable speed of the machine spindle and a ndle speed designation S is not
a given job.
",,..,,,,.,,,,,,,,,,,,,,.rl by itself. In addition to the
additional
methods to control the spindle and cut- are attributes that control
ting they all depend mainly on the type of the if the spindle is
CNC the current machining application. In programming instruction is not
this chapter, we look at the spindle control ancl its program- spindle function stands by itself in
ming appl '('<lInn,,,,! not include all information {he control
for spindle data. A spindle speed
SPINDLE FUNCTION example, to 400 r/min or 400 mlmin or 400
on (he machining application), does not
information, namely,lhe spindle rota-
to spindle speed is con-
S. The program-
is usually within the range of Most can be rotated in two directions -
point is allowed: clockwise or counterclockwise, depending on the type and
setup of the cutting tool used. The spindle rolation has to be
51 10 59999 specified in in addition to the spindle speed
are two miscellaneous functions provided by
For many high machines is not unusuaJ to that controllhe direction of tile spindle-
have spindle available to five digits. in the range
of I to 99999, within S
DIRECTION OF SPINDLE ROTATION
51 to 599999
and left, up and down. clock-
and similar directional terms, is
/lIe relative to some known reference.
VLa'UUll as clockwise (CW), or as
some established and standard
this case a reference point of

The direction rotation is always relative to the


• Spindle Speed Input poim of view that IS ",;) ••:lUlI',. from the spindle side of the
machine. This part a that contains the spindle.
The address S relates to spindle function,
and is generally called headstock. Looking
and must always numeric value in
from the machine area the direction along
the CNC program. are alternatives as to what
spindle center line and towards establishes the cor-
the numeric value (input) of the function may be:
rect viewpoint for and CCW rotation of the
o Spindle speed code number .. old controls· obsolete spindle. For CNC CNC ma-
chining centers, is quite simple
o Direct spindle speed .. r/min to understand. are exactly the
o Peripheral spindle speed .. ftlmin or mlmin same, and will

77
78 Chapter 12

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

To establish spindle rotation as CW and CCW,


look from the headstock towards the spindle face.
M03 M04
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 orea, 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
R/H tool- CW R/H tool - CCW view from the tailstock and arrows must be reversed.

Figure 12-1
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 venical machining center.
Figure 12-2 shows a front view of a typical CNC lathe.
CW= M03 CCW= M04

Headstock Figure 12-3


Spindle rotation direction as viewp.d from the headstock

cw

ccw
y Tailstock

CW= M03 CCW= M04


Figure 12-2
Figure 12-4
Typical view of a slant bed two axis CNC larhe.
CWand CCW directions only appear to be reversed Spindle rotation direction as viewed from the taifstock
SPINDLE CONTROL 79

• Direction Specification second example B is technical1y correct, but logi-


If spindle rotation is clockwise, M03 function is used cally flawed. There is no benefit in splitting spindle
in the program - if the rotation is counterclockwise, M04 speed and spindle rotation into two blocks. This
function is used in the program. makes the program harder to interpret.

the spindle speed S in the program is dependent on e C - Milling application:


the spindle rotation function M03 or M04. their
ship in a CNC program is important N1 G20
N2 G17 G40 GBO
spindle speed S and spindle function N3 GOO G90 G54 X14.0 Y9.S M03 (ROTATiON SET)
M03 or M04 must always accepted by the control sys- N4 G43 Zl.O HOl (NO ROTATION)
N5 GOl ZO.l FSO.O S600 (ROTATION STARTS)
tem together. One without the other will not mean anything N6 ••.
to the control, particularly when the machine is switched
on. There are at leasllwo correct ways to program tbe spin- Again, the C example is not wrong, but it is not
dle and spindle rotation: tical either. There is no danger. if the machine pewer has
o 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 the spindle rotation, if an-
rotation will start simultaneously other program was processed earlier. This could create a
possibly dangerous situation, so foHow a simple rule:
o If the spindle speed and rotation are programmed in
separate blocks, the spindle will nat start rotating until both
the speed and rotation commands have been processed

• Spindle Startup
e Example 0 - Turning application with GSO :
The following examples demonstrate a number of correct
starts for the spindle speed and rotation 10 N1 G20
All examples assume that is no active setting of N2 GSO X13.625 Z4.0 T0100
spindle speed either through a previous program or N3 G96 S420 M03 (SPEED SET - ROTATION STARTS)
N4 •.•
through the Manual DaJa Input (MDI). On machines,
there is no or default speed when the ma- This is the preferred example for lathes, if the
chine power turned on.
G50 setting method is used. Because spindle is
se~ as CSS - Constant Surface Speed, the control system
<:> Example A - Milling application:
WIll calculate the actual revolutions per minute (r/min)

m G20 based on the CSS value of 420 (ftlmin) and current part
N'2 G17 G40 GSO at XI The next example E is correct but not
NJ G90 GOO G54 X14.0 Y9.S recommended caution box above).
N4 G43 Zl. 0 Hal S600 M03 (SPEE.'O WITH ....".·A·'·'
N5 ••• e Example E Turning application with G50 .

This example is one the preferred for milling N1 G20


applications. Both the spindle speed and spindle rotation N2 GSO X13.62S Z4.0 TOlOO M03 (ROTATION SET)
are set with the Z axis mOlion towards the Equally N3 GOO X6.0 ZO.l (NO ROTATION)
popular method is to start the spindle with the motion- N4 G96 GOl ZO FO.04 T010l S420 (ROTAT. STARTS)
NS ...
in the example:

Nl G90 GOO GS4 X14.0 Y9.S S600 M03


Q Example F - Turning application without G50 :
N1 G20 T0100
Selection is a matter of personal preference. 020 in a N2 G96 5420 M03 (SPEED SET - ROTATION
separate block in not necessary for Panuc controls. N3 GOO •••
e Example B - Milling application: In more contemporary example (GSO is not used as a
position command anymore), the machine spindle
N1 G20
speed will be calculated for a tool offset stored in the
N'2 Gl' G40 GSO
N3 G90 GOO G54 Xl4. 0 Y9. 5 S600 (SPEED ONLY) Work Geometry Offsel register of the control system.
N4 G43 Zl.O HO 1 MO) (ROTATION STARTS) system will perform the ca1culation of actual r/min when
N5 ... the block N2 is
80 Chapter 12

These examples are only correct methods for method may result in a slightly longer
a spindle start. All contain rotation at the begin- but it will easier to read and maintain it, mainly
ning of a program milling and turning ap- with limited experience.
plications. The beginning of a program has
been selected intentionally, IJ"'-''"'''''''-' for any first tool in the can be asa
program. there is no active or rotation in effect (nor-
mally carried on from a tool). However, the con-
Nl.20 MaS
trol unit may still store and rotation from the
last tool of the previous
block containing the tool motion, such as
Any toolfollowing
programmed speed "'-:I<::L"'"
Nl.20 Z1.0 M05
tool. If onJy the 31..1'11"":''-'
for the next tool,
The motion will always be completed first, then the spin-
assume the last rotation direction. If only the
direction code M03 or M04 is programmed, the dle will be This is a safety feature built inlo
speed S will the same as the previous tool. control remember to program M03 or
.,.n .... rlll", rotation,
Be careful if a program program stop func-
tions MOO Or MOl, or the function M05. Any SPINDLE ORIENTATION
one of them will automatically stop the spindle. It means to
be absolutely sure as to when rotation will take
place and what it will be. spindle The last M relates to a spindle activity,
speed selection and its rotation the same block and for is M 19, is most commonly used to set a ma-
tool. Both functions are connected and plac- chine spindle an position. Other M codes may
ing within a sing1e block w i l l ' and be valid, on the control system. for example
logical program structure. M20 on same spindle orientation function is
a very specialized seldom appearing in the pro-
gram itself. MI9 function is used, it is mainly during
SPINDLE STOP setup, in the Manual Data Input mode (MDI). This func-
tion is exclusive to milling systems, because only spe-
NormaHy, most work requires a cially eqllipped may require it. The function
speed. In some cases, a can only be used when spindle is stationary, usually
desirable. For example, before ter the spindle When the control system exe-
change or reverse a part in the middle a program, the cutes the M 19 function, the following action will
spindle must be stopped first. The spindle must also be
The spindle will tum in both
during a tapping operation and at of pro-
Some miscellaneous functions will stop the spindle clockwise and a short period.
rotation automaticaHy (for example, the functions MOO, the internal activated. In some
MOl, M02 and M30). Spindle rotation will cases, the is audible. The spindle
during certain fixed cycles. will be locked in a and rotating it by hand,
will not be exact locking position is deter-
the spindle stop should always
by the machine tool indicated by the
Counting on other functions to
programming practice. is a setting angle - Figure
in programming, to slop the
spindle rotation. use function MOS.
the clockwise or the counterclockwise
V\(l,lIV'1. Because M05 does not do anything

(unlike other functions that also stop the spindle, such as


MOO, MOl, M02, M30 and others), it is used for situations,
must be stopped without
other programmed activities. Some typical
in tapping. tool motion to the . ".".,AlI."
tion, turret position, or after machine zero
depending on the application. Using one of the
cellaneous functions that automatically stop Figure 12-5
the is not required. On tile Spindle orientation angle is defined bV the ma,~fll'I'"
......t,nT<;Ifn exactly what is required, in a particular manufacturer and cannot be changed
SPINDLE CONTROL 81

In CNC machine lool operation, the MI9 function en- SPINDLE SPEED - R/MIN
ables machine to place a tool into the
manually and guarantees a proper 1001 holder orientation.
Later chapters will provide more about Ofl- programming CNC machining centers, designate
and applications, example. in point the spindle directly in revolutions per minute (rlmin).
boring A basic that contains spindle speed 200 rlmin, for
require this enu-y:

N230 S200 M03

format is typical to milling controls, nO pe-


CNC centers (oat all) use tool holders ripheral speed is used. There is no need to use ~ sp~i~l pre-
that can be placed into magazine only one way. To paratory command to the rlmin setllng. It IS the
~chieve this goal, the 1001 holder has a special notch control default. The r/min value must a mInimUm
built-in, matches internal of the spindle - crement of one. or values are not al-
Figure In order to find the the holder that has lowed the r/min must always within the range of any
the there is a small dimple on notch side. de-
is intentional.
A few machining centers may be equipped with the op-
tion of a spindle selection - direct r/min a
peripheral speed. In this case, as as for all
gramming, a proper preparatory command is used to.
guish which is active. is used penpheral
speeds, G97 direct 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 part diameter (lathes). rule is
that the larger the the slower the spindle r/min
must Spindle speed should never guessed - it
always be calculated. a calculation will
the spindle is directly proportional to the pro-
grammed An incorrect spindle speed will have a
Figure 12-6 negative on both the tool and the
Built-in notch in 8 tool holder used for correct tool
orientation in the spindle - not a/l machines this feature • Material Machinability

tools with flutes (cutting edges), as


spindle speed, each material a sug-
machinability rating for a tool material. This
drills, end mills, reamers, face mills, etc., the orientation of
is either a percentage of some common material,
cutting edge to the spindle is not
such as mild , or a direct rating in terms periph-
that important. However, . point . such a~ eral or sUiface speed. Surface speed is specified in
ing bars, orienlation of cuttmg edge dunng setup lS ex-
feet per minute (ftlmin) in units, in meters
tremely important, when fixed
minute (nt/min) in system.
are used. The two cycles that use the built-in
for jtlmin is FPM, meaning Feet Per Minute. The
orientation, G76 G87, the retracts from ma-
amounts of speeds indicate level of machining
hole without rotating. In to prevent damage to
difficulty with a given tool material. The (he surface
the finished the tool retraction must controlled.
speed, the more difficult it is LO machine the material.
Spindle orientation guarantees that the tool will shift away
from the finished bore into a clear direction. An accurate Note the on the words 'given fool material'. To
setup is ne1ces,sary comparisons meaningful fair, they must be
with the same type of cutting tool, for
Those machines tool holder the
speeds for high speed tools will much
spindle either way still proper setting tools that
lower then for cobalt tools and. course, for
shift when or G87 cycles are programmeu.
carbide tools_
Chapter 12

on the surface speed (he cutler diameter (or


part diameter for lathes), machine spindle speed can be cal-
culated in revolutions per one mathematical
for English units another when
are programmed.
Itir where ...

r/min = Spindle speed in revolutions per minute


1000 = Multiplying - meters to mm
m/min = Peripheral in mlmin
1t = Constant3.1415927
o = Dia.meter in mm (cutter diameter
or part diameter for

• Spindle Speed - English Units


speed is 30 mlmin the cutting tool
To calculate the spindle peripheral
meter is 15 mm:
the material type must
as well as the tool or the part:
= (1000 x 30) I .1415 x 15)
= 636.6
= 637 r/min

A version of the is an acceptable allema-


tive and almost as accurate as formula:
n",,'I"'(''''

Itir where ...

rim in Spindle speed in revolutions


12 Multiplying factor - feetto
ft/min Peripheral speed in
1t ::: Constant 3.1415927 Again, by replacing the constant 31 with constant 320
D Diameter in inches (cutter for milling, (or even 300), the r/min will somewhat inaccurate, but
or part diameter for turning) most within an acceptable

CONSTANT SURFACE
Peripheral for the selected is 150 fUmin,
and the cutting tool diameter is I
lathes, the machining is different
from process. The turning tool has no diameter
::: (12 x 150) / (3.1415 x L 75)
327.4 and the diameter of a boring bar has no to the
327 r/m.in spindle It is the part diameter that is
used for calculations. As the
Many applications can use a machined, changes constantly.
mula, without losing any significant accuracy: during a cut or during roughing operations
eterchanges in Figure 12-7.
3.82 x ft I min the spindle is not practical -
r I min = of the many should be selected to
D r/min? The is to use the sUrface
the lathe
ILl."" .. " . the 3.82 constant may
To select a is only a half of the
as an easier calculation a
The other half is to communicate this selection to
units must be applied "'Y'r,nG>rl
trol system. The has to be set to the surface
not be correct.
mode, not the rlmin Operations IlS drilling,
tapping, etc., are common on a lathe and
direct r/min in the distinguish between
the choice of
• Spindle Speed - Metric Units face speed or per minute must be
When metric is in the program, This is done with preparatory commands G96 and
previous formula is same, but units are prior 10 the spindJe function:
SPINDLE CONTROL 83

G96 S •• M03 Swface speed selected o Example 1 :


G97 S •• M03
""rl-""c> speed is set right after coordinate setting,
GSO (or command:
milling. this distinction normally does not and
spindle speed in rlmin is always assumed. N1 G20
~ GSO X16.0 ZS.O T0100
By the G96 for N3 G96 MOO MOl
turning boring, the control enters a special
known as the ConstaJlt Surface Speed or CSs. In this
the spindle revolutions will and In this quite common application, the actual spindle
automatically, depending on diameter cut (cur- speed will be on the current diameter of 16 inches,
rent diameter). automatic Constant Surface Speed is In r/min in block In some cases, this will
built in systems for most CNC lathes. be too low. Consider another example:
It is a feature that not only saves programming time, it
allows tool to remove constant amount of material at all o 2:
cutting too) excessive wear
"".-/''''"'''' finish. On large CNC lathes, GSO of the X diameter
is quite large, 024.0 the previous example,
a typical example, a facing cut target diameter the next tool motion was nat impor-
starts at (06.2), and faces the part to the centerline (or tant, but in case it is. example:
slightly below). G96 was used program.
6000 was the spindle of the N1 G20
N2 GSO X24.0 ZS.O T0100
N3 G96 S400 M03
ftlmin N4 GOO X20.0 TOIOl MOB
06.20 231 r/min
8375
-""'-- 06.00 :::; 239 r/min 6000 r/min In the 2, the 1001 position is at X24.0
:::: 260 r/min max. spindle the tool motion terminates at X20.0, both values are
05.00:: 286 r/min speed ters_ translates to an actual motion of only
,~,- 04.50:: 318 r/min
the X24.0, the spindle will rotate at 64 r/min, at X20.0 it
,,'~- 04.00 :::; rIm in will rolate at 76 r/min. The difference is very to war-
:::; 409 r/min rant any programming. [t is different, however, if
- 03.00:::; 477 r/min the starting position is at a diameter, a tool moves
- - - 02.50 :::; 573 r/min to a much smaller diameter.
02.00 :::: r/min
01.50 :::; r/min o Example
01.00:: 1432 r/min
- ' ' ' - 00.50 2865 ,!min From initial position of 024.0 . the tool will
00.25 := 5730 r/min move to a small of 2.0 .
~ 00.00 ::::; 6000 r/min :: spindle max.
N1 G20
Figure 12-7 N2 GSO X24.0 ZS.O TOIOO
i-IfR1Tlnlll at a cut using constant surface speed mode 696 N3 G96 S400 M03
N4 GOO X2.0 TOlOl MOB
Althougb only selected diameters are shown in the illus-
tration, along with their revolutions per
Spindle speed at the start of program (block N3) will
ute, the updating is constant. Note the sharp in-
the same as in previous example, at 64 r/min. In the next
crease in r/min as tool moves to machine center
block (N4), the calculated for inch will 764
When the reaches XO (00.0), the speed will be at
rfmin, automatically calculated by the control. This rather
its maximum, within the current gear As this speed
large in spindle speeds may have an effect
may be too high in some cases, the control system allows
on some What may happen is that cutting
setting of a maximum, described
tool will reach the 02,0 inch before the spindle speed fully
a speed a lathe, are to the 764 rfmin. tool may start re-
options. In following examples, most moving material at a speed much slower than intended. In
important ones will be examined. The gear func- order La correct the problem, the CNC program to be
tions are omitted for all examples. modified:
84 12

e Example 3b : Whenever the mode is active


reaches spindle center at XO) the result will LLY"''''...........
The modification in block N3.lnstead be the highest spindle possible, within the
gramminga speed mode, program gear range. It is but that is exactly what will
rect rlmin for the inches, based on 400 happen. Such when the part is weD
surface speed. The to calculated first, mounted, does not chuck or fIXture lOO
setting will be .... ,..("~'ml1nprl a subsequent out, the tool is strong and so on. When
is mounted in a special or an eccentric setup is
N1 G20 the part has a long or when some other ad-
N2 G50 X24.0 Z5.0 TOIOO verse conditions are present, maximum spindle at
N3 G97 S764 M03
N4 GOO X2. 0 TOIOl MOe
center line may be too high for operating safety.
N5 G96 S400 is a simple solution to this problem, using a
E>"_'~L~O feature available and other ""_"rA'~
mode can be highest limit,
the example, at the 024.0 (X24.0 in N2), the actual
would be only 64 r/:min. the 02.0 (Xl.O in N4),
mrevolutions per program function
.. _,,~.,~~ spindle setting is normally G50.
will be 764. The tool may reach X2.0 po- ma:u.mlUI11 setting is called maximum spin-
before the spindle speed accelerated to full 764 clamping. Do not this G50 with its other
if it is not calculated and programmed earlier. position register is an example:
CNe lathe does not
modern lathes have a 01201 (SPINDLE SPEED c::t.AWP)
to wait before ac-
Nt G20 TOIOO
N2 G50 X9.0 Z5.0 S1500 (1500 R/MIN MAX)
until the spindle fully accelerated. N3 M42 SPINDLE RANGE)
N4 G96 8400 M03 AND 400 Fl' /MIN)
Modern CNC lathes today do not use the G50 setting and NS GOO G41 X5. 5 ZO TOIOl MOB
use the Geometry Offset setting In this case, the ac- N6 GOl X-O. 07 Fa. 012 ,~._. CENTER L.I.NE)
tual diameter at machine zero position is normally N7 GOO ZO.1
not known. Some experience can this case, N8 G40 X9.0 Z5.0 TOIOO
program a short dwell the actual cutting. N9 M01

• Maximum Spindle Speed :t8t[lng What actually happens in program 0120 I? Block N 1 se-
.......0 ....' ... units of measurement. critical block N2
CNC lathe operates Constant Suiface
the spindle speed is to the cur-
diameter. The smaller diameter is, the o only the tool coordinate position, as in:
spindle speed will be. natural question is
GSa X9. 0 ZS. 0
- what happen if the tool diameter is It may seem
impossible to ever program a zero but there are at o Also sets the maximum to as
least two cases when that is the case.
GSa X9.0 ZS.O 81500
the first case, zero diameter i~ t'lT'l'1,~,ml'1nl"l1
ter line All drilling, center
similar are programmed at
(XO). are always n"'(,'C1T~ITT1Tnf"n
using 097 con:uru:ma. a
is controlled directly, not change. During motion, tool nose
ant function are activated. The spindle
case of a zero diameter is when facing off a
"'..."'."4.....
be a formula described
solid part all the; way to the center is a different ter~ N6 is the actual cut.
situation. all operations at XO, the diameter 0.012 inlrev, the tool tip
does not because a direct r/min is proi gramnle<1 reality, the end point is
During a cutting operation., the aIa1meter V'lX<U1.5"'" spindle center line. The
the material removal continues must be taken into consideration programming
center line. No, with the tool nose offset and to the machine center
eX~Ha.:ullea .......... ,,....... Any calculation
line. A later explains what will hap-
zero, will result in
~ at the center line tIl
pen during
. .'".....,. . . . ~ to Figure 12-7 for H'W'UU""~'"
SPINDLE CONTROL

Block N7 moves the tool tip .J 00 inches away from the N1S GSO XS.S Z2.5 Single meaning
face, at a rapid rate. ]n the remaining two blocks, the tool
will rapid to the indexing position with a cancellation of ra-
N40 GSO Z4.75 S700 Double meaning
dius offset in N8 and an optional program stop is provided
in block N9. From lhese examples. G50 command should be easy to
Now, think of what happens in blocks N5 and N6. The understand. There are two, completely independent, mean-
spindle will rotate at the speed of 278 rlmin at the 05.5. ~ngs?f the G50 command. Either one can be programmed
In a StOgIe block, or they can be separated into two individ-
Since the CSS mode is in effect, as the tool tip faces off the
part. the diameter is becoming smaller and smaller while ual blocks.
the r/min is constantly increasinJr ~f the CNC lathe supports G92 instead of G50, keep in
Wirhout the maximum spindle speed limit in block N2, mmd that they have exactly the same meaning and purpose.
the spindle speed at the center line will be equivalent \0 the On lathes, the G50 command is more common than the
maximum rlmin available within M42 gear range. A typical G92 command but programming method is the same.
speed may be 3500 rlmin or higher.
• Part Diameter Calculation in CSS
With the preset maximum spindle speed limit of 1500
rlmin (GSa S 15(0), the spindle will be constantly increas- Often, knowing at what diameter the spindle will actually
ing its speed, but only until it reaches the 1500 preset rlmin, be c1~mped can be a useful information. Such knowledge
then it will remain at that speed for the rest of cut. may mfluence the preset value of spindle speed clamp. To
find oul at what diameter the Constant Surface Speed will
At the control, CNC operator can easi Iy 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.
12 x ft I min
Spindle speed is preset (or clamped) to the maximum D =
Y/min setting, by programming the S [unclion together wilh 11 x r I min
the GSO preparatory command. If the S function is in a
block not containing GSa, the control will interpret it as a
new spindle speed (eSS or r/min), active from that block I@" where ...
on. This error nwy be very costly!
o = Diameter where CSS stops (in inches)
Use caution when presetting maximum r/min of the spindle!
12 = Multiplying factor - feet to inches
ftlmin = Active surface speed
1t = 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 0120 I, block N2 con- o Example - English units:
tains both settings. Typically. the combined setting is useful
at the beginning of a tool, the separate block selling is use-
If the preset value in the program is GSO S 1000 and the
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) / (n x 1000).
To program the GSa 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 GSa command.
The following examples are all correct applications of G50 3.82 x ft I min
command for both, the coordinate setting and/or the maxi- D ==
r I min
mum spindle speed preset:

N12 GSO X20. 0 Z3. 0 SlSOO Double mealling For completeness, the formulas based on the English sys-
tem, can be adapted to a metric environment:
N38 GSO S1250 SillglemeaniJlg
D ::= 1000 x m I min
1t x r I min
86 12

I1iilf' where ... If these requirements are met, the most important source
data is spindle speed actually used during machining.
D = Diameter stops (in optinrum spindle speed is known, the cutting
1000 = Muftiplying - meters to mm (eSS) can be calculated and used any other tool
mlmin = Ac:t:ive surface speed requirements are met
1t = 3.1415927
r/min :::: maximum spindle speed In a nutshe14 the whole subject can be quickly
up by categorizing it as a - that of Constant
Just the English version, you may shorten met- Suiface Speed, also as the Cuting Speed (CS), when
ric formula as well: tool or part diameter the spindle are known.
there on, it is a simple matter of IV1..111UllQ.

- Metric ft I min =
the preset value in the program is S1200 and the
surface speed is selected as G96 S165, the ess will be
damped when it reaches the mm
e EXAMPLE:
drill works very at 756 IS
D = (1000 x 165) / (1t x 1200) speed in ftlmin?
:::: 43.767609
:::: 043.768 nm : (3.14 x 0.625 x 756) / 12 : 123.64

• CSS Calculation
The Constant Suiface (CSS) is required most
tunung and boring on a CNe lathe. It is also the
cutlnng data, from spindle speed
is calculated for all machining center operations.
Now - consider a very common scenario - the CNe
tor has the current conditions, J.U....'! ..."'W.1J:l; C EXAMPLE:
the speed., so they are favorable. Can
COlllQl1nOIlS be applied to subsequent jobs? well at 1850 -what
is
they can - ........'VlF' .." that certain requirements
will be satisfied: m/min = (3.14 x 7 x 1850) / 1000 = 40.66
Q Machine part setup are equivalent
Q tools are equivalent DeD.em ofusing is a significant re-
spent at the CNC machine, usully required
Q Malerial conditions are equivalent to find and 'fine-tune' optirmnn spindle speed during
Q Other common conditions are satisfied or part opttI1lli!:aU()D
FEEDRATE CONTROL

Feedrate is the closest programming companion to the FEEDRATE FUNCTION


spindle function. While spindle function controls
spindle speed and the rotation direction. feedrate word in the program is
controls how fast the move, usually to remove ex- the address F, followed a of digits. The number
materiaJ (stock). In handbook, the rapid of digits following the 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 feed rate and be de- allowed.
scribed in Chapter 20.
• feed rate per Minute
FEEDRATE CONTROL
For miHing applications, aJl cutting feedrale in linear
and interpolation mode is programmed in inches
Cutting feed rate is the at which the
ing tool removes the m"f"YI~1 bV cutting action.
(in/min) or in millimeters per minute (mmiminJ.
of the is the a cutting tool
travel in one minute. This value is modal and is
The cutting action be a rotary motion of the only by another F address word. main of the
(drilling and milling. for example), the molion of feedrale minute is thai it is not dependent on spindle
part (lathe operations), or other action (flame cutting. makes it useful in milling operations, us-
cutting, water electric etc.). The feedrale ing a large variety of tool diameters. Standard abbrevia-
function is in the CNC to select the feedrate minute are:
value. suitable for the
CJ Inches per minute in/min (or older
Two feed rate types are in CNC ......nil'Y"1:Ilm""
CJ Millimeters per minute mm/min
o Feedrate per
most typical format for feedrate minute is F3.1
o Feedrate per revolution for English system and F4.1 for metric system.
The most common of machines. CNC machining For example, of 1 inches per
centers and lathes, can programmed in either feed rate be programmed as 5.5. In metric system,
mode. In practice, it is much more common to use the amount of mm/min will in the
jeedrale per minute on machining centers and the jeedrate F250.0. A different programming
revolution on lathes. expected special machine designs.
There is a significant in G codes for ma- important item to remember feedrate is tbe
chining centers and lathes. range of the feedrate values. feedrate range
of the control always that of the machine
Turning Turning Turning servo system. example, the feedrate range a Fanuc
FEED RATE Milling CNC is between .000 I and 24000.0 jn/min or
Group A Group B Group C
0.0001 and 240000.0 mm/min. Note that difference
Per minute G94 G98 G94 G94 tween two umts IS a decimal point not an ac-
tual translation. In programming, only feedrates that
revolution G99 G95 belong within specified can be used. Such a
feed rate wHi smaller than the control
In milling, the programming command (0 code) for the
per minute is For most it is set au-
tomatically, by the default and not have to
type of a feedrate is the inverse written in the For lathe operations, feed rate per
time jeed rate. It is is not discussed in seldom. In A, the 0 for
handbook. is G98, Groups Band C it is G94.
use primarily jeedraJe per revolution mode.
88

• Feedrate per Revolution o speed - in rev/min


For CNC lathe work, the feedrate is not measured CI Tool diameter! M J or the tool nose radius [ T J
terms lime, as the distance the tool in o requirements of part
one spindle revolution (rotation). ThisJeedrate per revolu-
tion is common on lathes (099 for Group A). Its vaJue is o Cutting tool geometry
modal and another feed rate cancels it (usually the o Machining forces
G98). Lathes can be programmed injeedrate per min-
ute (098), to control the feedrate when the spindle is sta- o Setup of the part
tionary. standard abbreviations are used for JeedraJe o Tool overhang (extension)
per revolution:
o Length of the cunlng motion
a Inches per revolution in/rev ~or older ipr)
o Amount of material removal or width of cut)
o Millimeters per revolution mrn/rev
o Method of milling (climb or conventional)
feedrate per revolution is four o Number of flutes in the material (for milling cutters)
decimal places in thc system three decimal
places in the metric system. This format means the feed rate o considerations
of 0.083333 inJrev wili be applied jn the CNC program as
FO.0833 on most The metric example of The last item is safety, a programming responsi-
0.42937 mrnJrev will be programmed as F0,429 on most bility number one, to assure safety the people and
controls. Many modern control systems accept fecdratc of equipment. Safe speeds and are only two aspects of
up to decimal for English units five safety awareness in CNC programming.
for metric
ACCELERATION AND DECELERATION
careful when rounding feedrate values. For
boring operation, reasonably feedrates are
quite sufficient. Only in' point threading, the feed rate During a contouring operation, the direction of the cut-
is critical for a proper thread lead, particularly for ting motion is changed quite often. is nothing un-
long or very can pro- usuaJ about it, with all the intersections, points
grammed with up to decimal places feedrate precision and In contouring, it means that in to
for threading only. gram a sharp comer on a the tool motion aJong X
axis in one block will to into a motion along
The programming for the feedrate per revolu- the Y axis in next make the change one
tion is G99. For most lathes, this is the system default, so it cutting motion to another, the control must stop X mo-
does not have to written in the unless the opposite tion first, then start Y motion. Since it is impossible to
command G98 is also start at a full instantly, without an acceleration,
and equally impossible to stop a feedrate WIthout a deceler-
It is more common to program a feedrate per ation, a possible error may occur. error
minUle (098) for a lathe program, than it is to pro- cause corners on the profile to be cut with an un-
afeedrate per revolution (095) in a milling program. desirable overshoot, particularly during very high TO"'''''''',,"
reason is that on a CNC lathe, command controls or extremely narrow angles. It only occurs during a cutting
the feed rate while the spindle is not rotating. example, motion in 001, 003 modes. not the rapid motion
a barfeed operation, a part stopper is used to 'push' mode 000. During the rapid mOlion, the deceleration is au-
the to a position in chuck or a collet, or a tomatic - and from the part.
pull-put to 'pull' the bar OuL Rapid feed would be too
and feedrate revolution is not applicable. In a routine CNC machining, is a small chance of
per minute is instead. In cases G98 ever encountering such an error, if the error is
099 commands are used in the lathe program as required. it will likely within
Both commands are modal and one cancels the other.
controls provide
two commands problem:
FEEDRATE SELECTION
To the feed rate, one that is most suitable a
given job, some general knowledge of machining is useful.
is an important of process and
be done A depends on
many factors, most notably on: Exact stops increase For used
on older machines, they may be required in some cases.
FEE CONTROL 89

• Command 01304 CUTTING)

of two commands that control the feedrate N13 GOO X1S.0 Y12.0
machining comers is G09 command - Exact Nl4 G61 GOl X19.0 F90.0
This is an unmodal command and has to be repealed in ev- N15 Y16.0
ery block. it is required. N16 XlS.O
Nl7 Y12.0
0] 30 I, there is no provision Nl8 G64
That may cause uneven cor-
A'""''''.... ' ... A''' of F90.0 (in/min);
in re-
01301 (NORMAL CUTTING)

~3 GOO X1S.0 Y12.0


N14 G01 X19.0 F90.0
N15 Y16.0
N16 Xl5.0
N17 Y12.0

By adding the GOg exact


the motion in that will
motion in the will start.

01302 (G09 I'"'r'l"I""l'TU':!'

f\
~3 GOO X1S.0 Y12.0
N14 G09 G01 X19.0 F90.0
N15 G09 Y16.0
~6 G09 X1S.0 point Target point
N17 Yl2.0

Example 01302 11 comer Ilt all three po-


sitions of the part. only one corner is for sharp-
GOg I G61 USED
ness, program the G09 command in the block that termi-
nates at that corner (program 0 I Figure 13-1
01303 (G09 C'U'I'T1NG
Feedrate control around comer Exact Stop commands
The overshoot is for clarity
N13 GOO X1S.0 Y12.0
N14 G01 X19.0 F90.0 • Automatic Corner Override
N15 G09 Y16. 0
N16 X15.0 While a cutter radius is in for a milling cutter,
Nl7 Y12.0 the feed rate at the contour points is normally not
overridden. In a case like this, command
G62 can be used to automatically the cutting feed-
The G09 command is useful only if a rate at the corners of a part. This command is active until
require the deceleration for a sharp corner. the G61 command (exact stop the com-
all corners must be the constant mand (tapping mode), or G64 (cutting mode)
the G09 is not very efficient. is programmed.

• Exact Stop Mode Command • Tapping Mode


The second command that corrects an error at
ners is G61 - Exact SlOP Mode. It is
than G09 and functions identically. The
that G61 is a modal command that remains in
is canceled by the G64 cutting mode
ens the programming time. but not the cycle
when the G09 would be too
same program, making it too
90 Chapter 13

• Cutting Mode It is important to understand that the effeclive ra-


When the cutting mode G64 is programmed or is active will decrease in for all internal arcs
by system it represents the normal cutting mode. crease in size for arcs. Since the
rate does not change automatically during cutter radius
When command is active. exact stop check 061
will not be performed, neither will the automatic corner offset it must adjusted in program. Usually.
G62 or the mode G63. That means the ac- this adjustment is not necessary, in cases where the
celeration and will be done and the surface finish is of great importance or the culler radius is
feedrate will be effective. is the most com- This consideration applies only to mo-
tions. not to linear
mon default for the control
The CUlling mode can be • Circular Motion feedrates
(exact stop G62 command
feedrates for circular motions is generally
corner override mode) or G63 command (tapping mode).
same as linear feedrates. In fact, most programs do not
The G64 is not usualJy programmed, unless feed rate for circular tool motions. If the
one or more of the other feed rate are used in the part surface finish is important. the 'normal' must
same To compare the 064 modes, be adjusted or lower. with consideration of (he cutter
see il in Figure radius, the radius cutting or arc) and
the cutting conditions. The cutter radius,
more reason cutting feed rate programmed arcs will
some correction,

In case of arc (after ap-


plying cutter may be much larger or much
smaller than the arc programmed to drawing dimensions.
The for compensated arc motions is
on the linear motion Look for a more
explanation in 29, with an and
First, is (he standard calculating
a linear feedrate:
G62 USED G64
Figure 13·2
Corner override mode 662 and default 654 cutting mode lEi" where ...

CONSTANT fEEDRATE FI == feedrate (in/min or mm/min)


r/min : : : Spindle speed
F. Feedrate per tooth (cutting edge)
In Chapter 29, n :::; Number of cutting edges (flutes or inserts)
chapter are explanations
wining Q constant cutting feed rate inside and outside
arcs, [rom practical of view. At this point, the
eus is on the understanding the constant "''''''',n''''''''>
than its applicaJion.
In programming, normal process is to the coor- outside arcs, the up-
dinate values for all the contour paints, based on the wards. to a higher
part The cutter produces the center
line the tool path is typically disregarded. When
gramming arcs to the drawing dimensions, rather than to
the center line of the cutter, the feed rate applied to the pro-
grammed arc relates to the radius, no'
the actual cut at the tool center, lEi" where ...

the cutter radius is and the path F.


arc is offset the cutter radius, the actual arc radius F~ =
that is cut can be smaller or larger. depending on the R Outside radius of the part
offset value for tool motion. = Cutter radius
FEEDRATE CONTROL 91
\ ......
\

arcs, the is generally adjusted dOW~ fEEDHOlD AND OVERRIDE


wards, to a lower value:
While running a program, programmed
x (R r) be ~emporarily suspended or changed by using one of two
R avatlable features of system. One is
jeedhold switch. the is a jeedrate override
Both switches are standard allow the CNC operator to
Ilii" where ...
control the feedrate during program
F, Feedrate for arc
They are operation panel.
F, Linear feedrate
R Inside radius of the part • Feedhofd Switch
r = Cutter radius
FeedhoLd is a push button can be toggled between
ON and Feedhold
i"P,'I'II1.f'l11'l It can be
MAXIMUM fEEDRATE modes.
rate revolution. On many
maximum programmable jeedrate for the CNC ma- not only a cutting feed with 00l, 003 in effect-
is determined by the machine manufacturer, not stop the rapid motion GOO. program func-
manufacturer. For will remain active during a feedhold state,
machine may although machining operations, the feedhold function
several times is automatically disabled and ineffective. This is
to all but there are addi- tapping and threading, G84 and 074
considerations for CNC lathes, where cycles on machining centers threading opera-
revolution is the main method of program- the 032, 092 and
tool.
• feed rate Override Switch
• Maximum feed rate Considerations
is nonnally by means of a
The maximum cutting feedrate per switch. located on the control panel of the
rp.;:tr./"'tpl1 by the programmed spindle
13-3.
maximum rapid traverse rate of It is quite
to the feed rate per revolution too high with-
it. This problem is most common in sin- Q,iJ 100 110
'O~ I '<0
'\~",\ \ // ~
A cannot deliver heavier than the
maximum it was designed for, the results will not be accu-
rate. results could be unacceptable, When un-
usually heavy and fast spindle are used in
the same progF.dffi, it is advisable to the final
feedrate does not exceed the maximum
the given It can be
drare per revolution, according to

Figura 13-3
Typical feedrare override switch

Jri" where ... This rotary switch has marked settings or indi-
cating the oj programmed jeedrate, A typical
Max. allowed feedrate per revolution in/rev range of a override is 0 to 200%, 0 may be
of the maximum feedrate, no motion at all or the slowes( motion, depending on the
' '>I •• I''1'''1'l from the X and the Z machine. 200% doubles all programmed
r/min = in revolutions per minute
rates. A programmed of 12.0 in/min (FI is the
The Rmtlx is in in/min or mmlmin. depending on the 100% feedrate. If override switch is set to 80%, the ac-
input units In 38 nre details to tual cutting will 9.6 in/min, If the
feedrate limits for threading, 110%, the actual will be 13.2
92 Chapter 13

simple logic to metric "'\f<'I''''f'''n M48 function the CNC nn,"'"",,'nr to use the
programmed feed rate 300 mmlmin, it ....... rrlm/ a
", rate override switch freely; the function will cause
An 80% override results in 240 mm/min cutting to be of the
feed rate and a 110% setting is on the control panel. The
to 330 mm/min cutting tool. most common usage of two functions is tapping or
threading without a cycle, where the exact programmed
feed rate override switch works equally well forfeed- feed rate must be maintained. The following exam-
rates revolution. example, the programmed feed- shows the teChnique:
rate .014 in/rev will in actual feedrate of .0126
in/rev with 90% feed rate and .01 in/rev with mo 8500 M03 (usnro TAP 12 TPI)
130% override. If a feed rate
revolution is required, be the set- N14 GOO X5.0 Y4.0 Moe
For example, programmed is FO.0I2, in N15 ZO.25
revolution. A change by one division on the N16 M49 (DISABLE FEEDRATE OVERRIDE)
,,'"" ....... '1... dial will increase or the pro- N17 GOl Z-O.62S F41.0 MOS
N18 ZO.25 M04
grammed by a full 10 Therefore, feedrate N19 M48 (ENABLE FEEDRATE OVERRI:DE)
will be .0108 at 90%, .0120 at 100%, .0132 at I etc. In mo GOO X.• Y•• M05
feedrate is not required, bUl in N21 MOl
will not for exam-
a feedrate of .0 I in/rev, because of fIxed 10%
crements on the override switch. The tapping occurs between blocks N 16 and N]9 the
override is disabled for
threading
Feedrate ",,"'.......... ,,'"
UI.:lUL/I/::U.

tapping and G74 on E ADDRESS IN THREADING


single point threading G92 and
tapping mode is used milling Some older lathes use feed rate address E for
mand G63, both the feedrate the feedhold rather the more common address F.
functions are disabled - through the program .I
feed rate function E is similar to the F function. It also
offers two
<"""Ip.rn override functions thread lead per revolution, in in/rev
for cutting other than tapping or threading or in mmJrev, hut it ha.." a decimal place accuracy.
They are M48 and M49. These are programmable func- control system model 6T, for the
tions, may not be for all

• feed rate Override functions e English - Fanuc control:


Although the function uses the address F. two F 0.0001 /() 50.0000 in/rev
miscellaneous functions M can be used in the
gram to set the feed rate override ON or On the opera- E :::: O. 000001 10 50.000000
lion panel, a switch is provided for feed rate override. If the
CNC decides that programmed feedrate has to be
e Metric - Fanuc control:
or decreased, this switch is very
handy. On other hand, during machining F '" 0.001 to 500.000
the cutting feed rate must be as programmed, E ::0 0.0001 10 500.0000 rrm/rev
"uj.. ......,'np switch to set to I 00% only. not to any
On the newest models, FS-OII 011 J/1S/16T, the
are similar is no E address), the safest way
A good are special tapping operations without the available is to lookup specifications
cycles, using GOl and GOO preparatory commands. control system.
Lions M48 and are used precisely for such
The E address is redundant on the newer controls and is
Feed nil t! cancel function is OFF, retained only compatibility with older programs that
which means feed rate override is active be used on machines equipped with newer controls.
available feedrate ranges between
Feedrate override cancel function is ON.
M49 ferenl control systems, depend on type of feed
which means feedrate override is inaclive screw input units in the
TOOL FUNCTION

ly controlled machine using an automatic


must have a special tool functlon (f7ifnc£ion)
used in the program. This function controls the
of the cutting tool, depending on the Iype of ma-
chine tool. are noticeable differences between T
on CNC machining centers and those used
are also differences between si
Ihe same machine type. The normal program-
.,rlri ..",-.- for {he tool function uses the address T.

machining centers. the T function


the tool number only. For the
indexing to (he tool stalion
number.

T FUNCTION FOR MACHINING CENTERS


All vertical and horizontal CNC machining centers
a called the All/omalic Tool
In the program or MDI mode on
uses the function T, where the T
tool number selected by the programmer.
describe the tool number itself. On TOOL READY POSITION
with a manual tool change. the tool
required al all. F;gure 14-1
programming for a particular Typical side view of a 20-tool ma(,aZifle
center begins, the type of the (001 selection for that machine
as small as len or
must be known. Thert~ are twu major Iypes uf luul selCX:lion
on special
in automatic tool change
cenler may
o Fixed type machines will
or oval (larger
o Random memory type
It consists of a
To understand the where the tool holder
is to understand the general setup. Each pocket is
tool selection, available for many rnn,nJ>'"""
is important to know
centers. for each pocket The
during and aulo-
• Tool Storage Magazine or MOL The number
of tools that
A typical CNC machining center or horizontal)
is designed with a special 100/ called
""... rn"",nH'<"

a 1001 carousel), [hat contains all by the pro- Within the travel of is one special posi-
gram. This magazine is not a for the lion, used Cor position is
tools, but many (he commonly aligned with the tool the
used tools there at all limes, If typical 20-tool waiting position, tool-ready posi-
magazine is illustrated in tion, or just the lool (,1U11HJ'P

93
94 Chapter 14

• fixed Tool Selection position the too! This can


A machining center that uses a fixed tool selection re- simultaneously, the machine using another to
cut a part. Actual tool change can take place anytime later.
the CNC to place all into
The is concept of next tool waiting where the T
that match the tool numbers. example. (001
function to the next tool, not the current tool. In the
number I (called as TO I in the must be
into the magazine pocket number I, lool 7 (cal~ed the next tool can made by
simple blocks:
as T07 in the program) must be placea-~b.e magazme
pocket 7, and so 00. T04 (MroCE TOOL 4 READY)
magazine pocket is mounted on a side of the
)..."""uu~,
usually from the work area (work <... Mac:i111'unf! wiIh previous 1001 ... >
With the fixed selection, the control system no way
of determining which 1001 number is in which magazine M06 (ACTUAL TOOL CHANGE - T04 m SPDmLE)
pocket at any The CNC has to T15 (MAKE NEXT TOOL
match the numbers with the magazine numbers
during setup. This of a tool selection is commonly <... fVU7r""'I1'" with 10014 - 7D4 ... >
found on many older machining centers, or on some
inexpensive centers.
In first block, the 1'04 tool was called into the walting
the lool is easy - the T of the tool while previous was
function is used in program, that will the tool CUlling. When machining been completed, ac-
number selected during a tool change. example, tual tool will take place, where T04 will become the
active tool. Immediately, system will for
N67 T04 M06 the next tool (TIS in the example) and it into the
waiting position, while T04 is cutting.
or
example illustrates that the T function will not
N67 M06 T04 any physicallool change at a!1. For that, the ~utomatic ~ool
change junction - M06 - also later In secMn,
or is needed and must be programmed.
N67 T04 Do not confuse the meaning of T with the
N68 M06 tool selection the same T used with the
random tool The former means the actual num-
means to bring number 4 into the spindle (the ber of the pocket, the latter means the tool num-
las( is preferred). What will to the (001 that ber of next tool. The call is programmed earlier
is in the spindle at The M06 cha~ge . than it is needed. so the sysl~m can for that
will cause the tool to return to the magazme pocket It tool while another tool is productive work.
came from, the new tool will be loaded. the
tool takes the way to select new tool, • Registering 1001 Numbers
Today, this type of a tool selection is considered impracli- and CNC in "",,..,.rll
and in a long run. There is a significant time can process data quickly and with
during tool because the tool has to wait precision. the CNC work, the required
until the lool is found in magazine and placed input first, to make the computer work in our . In the
into the The programmer can somewhat improve random tool selection method. the CNC operator lS to
the by selecting and tool num- any tool into any magazil1e as long as ac-
not necessarily in the order Exam- tual setting is into the unit, in the form
in this handbook are based on a more modern type of control is no need to worry too
tool selection, the random memory. much about system parameters,just acceplthem as the col-
lection various system Registering tool num-
• Random Memory Tool Selection its own entry screen.
This is the most common on modern machining operator will
centers. It also stores alltool5 required to machine a part in the required tools into writes down the
the tool magazine away machining area. numbers (which tool number is in which pocket number),
CNC identifies by a T and the information into the system. Such an op-
usually in order of usage. Calling the required tool eration is a normal of machine tool and vari-
number by program will physically move the tool to the ous shortcuts can used.
TOOL FUNCTION 95

• Programming Format Q Example:


Programming format for the T function used on milli~g
systems depends on the maximum number of lools aVaIl- N81 TOl ... Innkes T01 ready =loaded in the wairi.ng posilion
able for the CNC machine. Most machining centers have N82 M06 ... brings TO) imD the spiJulJe
number of available tools under 100, although very large N83 TO 2 , .. rnakes 7D2 ready = Irxuled in the wailing position
machines will have more tool magazines available (even
several hundred~. In the ex~m~l~s, two-digit tool function The three blocks appear to be simple enough, but let's ex-
will used, covenng tools wlthm~ range of TO J to T99. plore them anyway. In block N81, the tool addressed as
TOl in the program will be placed to the waiting position.
In a typical program, the TOI tool command will call the The next block, N82, will activate the actual tool change -
1001 identified in the setup sheet or a tooling sheet as tool tool TO I 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, elc. Leading zeros for tool number designation is T02 in block N83. This block will cause the control sys-
may be omitted, if desired - TOI can be written as Tl, T02 tem to search for the next (001, T02 in the example, to be
as 1'2, etc. Trailing zeros must always be .written, for exam- placed into the waiting position. The search will ~ake place
pJe, T20 must be written as T20, otherwIse the system WIll simultaneously with the program data followmg block
assume the leading zero and call the tool number 2 (T2 N83, usually a too! motion to the culling 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-
Ihis 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 (001 changes from N81 TOl
one part to another. This nonexistent tool is often called the N82 M06 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 wilJ not accept the shortened two-block
chining center has 24 tool pockets, the empty 1001 should be version and the three-block version must be programmed.
identified as TIS 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-
mal. For example, with a two digit format, the empty tool
should be identified as 1'99, with a three digit format as
T999. This number is easy to remember and is visible in the • Conditions for Tool Change
program. Before calling the M06 tool change function in the pro-
As a rule, do not identify the empty tool as TOO - alllools gram, always create safe conditions. Most machines have a
light located on the control panel for visual confirmation
not assign.ed may be registered as TOO. There ~re, howeve.r,
machine tools that do allow the use of TOO, WIthout POSSl- thai the tool is at the tool change position.
ble complications. The safe automatic tool change can take place only if
these conditions are established:
TOOL CHANGE FUNCTION - MOS o The machine axes had been zeroed

The tool function T, as applied to CNC machining cen- o The spindle must be fully retracted:
ters, will not cause the actual 1001 change - the miscella- ( a) In Z axis at machine zero for vertical machines
neous function M06 must be used in the program to do thaL ( b) In Y axis at machine zero for horizontal machines
The purpose of tool change function, i~ to exc.h.ange the tool
in the spindle with the tool in the wallmg pOSItIon. The pur- U The X and Y axis positions of the tool
pose of the T function for milling systems is La. r?tate th.e must be selected in a clear area
magazine and place the selected tool into the wall!n~ POSI- o The next tool must be previously
tion, where the actual tool change can lake place. ThIS next selected by a T function
tool search happens while the control processes blocks fol-
lowing the T function call.
Chapter 14
---- . - - - - - - -
A program sample illustrates the tool Q Example for illustrations:
(ween tools in (he middle of tile program
illustrated in Figures 10 N51 ( • •• T02 IN SPJlNDLE)
N52 T03 ( • •• TO 3 READY FOR TOOL c:.Hll1NGl~)
(MACHINING WITH
MAGAZINE SPIN E N75 GOO Zl. 0 (RETRACT FROM ",,,,,,,,,,,,,,,\
N76 G28 Zl.0 MOS (T02
N77 MOl (OPTIONAL
(BLANK LINE BETWEEN
N78 T03 (T03 CALL REl?E1!,TElDI
N79 M06 OUT - T03 IN THE SPJCNDLE)
NBO G90 G54 GOO X-lS.S6 Y14.43 9700 M03 T04
N81 . . (MACHINING WITH T03)

"4
t ..
zero
N76 represents the end of machin-
It will cause tool T02 to move
ATe
same optional program stop
lows in the block N77.
Front view of the machine
In the following block N78, the can for
14·2 this is not necessary, but may come very
ATC - Blocks N51 to N78 tool Block N79 is the actual tool
in the spindle will be replaced with T03 that
TOOL MAGAZI SPINDLE rently in the posluon.
in block N80. the rapid motion in X and Y axes
first motion of T03. with ON. Note
T02 at block end. To save lime. the next tool should
placed into the waiting position as soon as possible after
(he tool 1''''''''''''''
note that when T02 is """'''1.1'''''' N77. il is
still in the spindle! There are who not fol-
low If the tool change is right after
block (machine zero return) the MOl
it will be more difficult for " . . ..,'.. ot,...... to repeat the
tool that just finished working, if it n .. (·r\Tm~'"
Front view
Figure 14-3 AUTOMATIC TOOL CHANGER - ATC
ATC example - Block N79
references to Automatic Changer (ATe)
TOOL MAGAZI SPINDLE were made in some examples. designs of
on various machines and from one
to to say, the
method of programming
times quite a bit. The machine
\ / '
will automatically index 10
the proper order. Everything under program control.
Programmer and operator thoroughly familiar
with the type of ATC on all centers in the shop .

• Typical ATC System


A typical Automatic Tool system may have a
double swing arm, one the .... I""fYI. tool, another for
Front view of machine outgoing tool. IL will on Random Mem-
01)' selection (described which mean:-.; the next 1001
Figure 14-4
can be moved to a and be ready for a tool
ATC example - Block NBD (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
lime for the tool changing cycle can be very fast on modern
a cUlling 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 thaI C(ln be 10(lded into attention to the Z axis clearance during the 1001 change.
the tool magazine varies greatly, from as few as IOta as Any physical contact of the tool with the machine, the fix-
many as 400 or more. A small CNC vertical machining ture or the part is extremely undesirable. Such a condition
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-

Of~toOI
gency Switch, which is usually too late. Figure 14-6 illus-
Apart 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 \00\ change under pro-
gram control. They relate to the physical characteristics of
cutting tools when mounted in the tool holder:
o Maximum tool diameter GAUGE LINE

o Maximum tool length


o Maximum tool weight TOOL NGTH

• Maximum Tool Diameter


The maximum tool diameter that can be used without any
special considerations is specified by the machine manu-
facturer. It assumes that a maximum diameter of a certain Figure 14·6
size may be used in every pocket of the lool magazine. The concept of too/length
Many machine manufacturers allow for a slightly larger
tool diameter to be used, providing the two adjacent maga- • Maximum Tool Weight
zi ne pockets are empty (Figure 14-5).
Mosl programmers will usually consider the tool diame-
J (
I,
\ 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 cutling tool does nol
generally makes a difference in programming, because the
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 lool is always the combined weight of the
cutting tool and the tool holder, including collets, screws,
pull studs and similar parts.
i OVERSIZE TOOL; I
/ Do not exceed the recommended tool weight during setup!
/ Empty pocket

For example, a given CNC machining center may have


Figure 14-5
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. (l 0.8 Kg), the ATC should not be
tool diameter with adjacent lools 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 tooJ 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 Lool change, providing
Adjacent pockets must be empty for oversize tools! lhe tool weight is safe.
98 ..........
-.~~- .....
Chapter 14

• ATC Cycle • MDI Operation


A programmer not have to know every related Incidentally, step of the tool can usu-
to the automatic tool changer actual operation. It is not a vi- ally executed through the MDI (Manual Data Input), us-
tal knowledge, although it may quite a useful knowledge special M functions. functions are only for
in many applications. On the other hand, a CNC !>ervice via the MDl operation and cannot be
operator should know each and eVel) step of the used in a program. The benefit of this feature is that a
inside oul. \001 changing problem can be traced to its cause and cor-
rected there. Check instructions for each machine to
an example, the following is to a get details about functions.
typical CNC vertical machining center and may a little
different for some machines. Always study individual steps
of lh~1:C operalion - often, that knowledge will resolve a PROGRAMMING THE ATC
problem on lool jam during the tool changing. This is a
possible time loss that can be Some machines A number of possibilities exists in relation to the auto--
have a step-by-step cycle with a rotary marie tool Some of the important ones are
switch, usually localed near the 100\ magazine. number of tools used. what tool number is to the
spindle (if any) at the start of ajob, whether a manual tool
In the following example, a tool changer with a double change is required, whether an extra large tool is elc.
arm swing system is used. It will the cutting (001 from
the waiting position and exchange it with the tool currently In (he next several examples. some typical options will be
in the machine examples can be used directly. if the CNC
(001 uses exactly the same formal, or they can be
ATC is a process that will execute the following or- adapled to a particular working environment. For the fol-
of steps when the tool change function M06 is pro- lowing examples, some conditions must be established that
grammed. All steps are quite typical, bUI not nec- will help to understand the subject of programming a lOoi
essarily standard for CNC machining center. so change much better.
them only as a close example:
To program ATe successfully, that is needed is
1. Spindle orients programming format for three tools - theftrs! tool the
2. T00\ 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. make the whole concept even eas-
4. Tool is unclamped lin the magazine and spindle) to understand. examples will use only four tool num-
5. Arm moves down bers - tool number will represent one of the four avail-
6. Arms rotates 180 degrees CW
able programming formats:
7. Arm moves up
8. Tool is clamped o TOl tool designation represents the
9. Arm rotates 60 degrees CW first tool used in the CNC program
10. The rack returns
11. Tool pot moves up o T02 '" tool designation represents any tool in
the CNC program between the first and
example is only presented as general information - the last tool
its logic has 10 adapted to each The in- o T03 tool designation represents the
struction manual for the machine usually lists relevant dc- last tool used in the CNC program
about Ihe ATC.
o T99 ... tool designation an empty tool
Regardless of the machine 1001 used, two conditions are (dummy tool) as an empty tool pocket
always to perform the ATC correctly: identification

o The spindle must be stopped (with the M05 function) In all examples, the tools will always used,
the empty tool only if required. Hopefully, these examples
o The tool changing axis must be at the home position will illustrate the concept of many possible applica-
(machine position)
lions. Another situation is in situations only
For CNC vertical machining centers, the tool changing one tool is used in CNC program.
aXIs IS Z axis. for the horizontal machining centers it is
the Y axis. The M06 function will also stop the spindle. • Single Tool Work
never count on it. It is strongly recommended to stop the
Certain jobs or special operations may only one
spindle with the MOS function (spindle stop) before the tool
1001 to do the job. In this case, tool is generally mounted
cycle is
in the spindle during setup and no tool t:alls Uf 1001 changes
are required in the program:
TOOL FUNCTION

01401 (FIRST TOOL


N1 G20 . .,,,,,lo,,~c~k~N=u~m~b~er~'"==T=oO=I~W=.a,.,,i.,,t,i.n..•g..... LT 001 in Spindle
B
I .........
N2 G17 G40 G80
N3 G90 G54 GOO X •• Y •• S •• M03
N4 G43 Z •• HOl MOB

< ... TO) working ... :> fill the table, start from the program top and
occurrence of the T address and M06 function. All
N26 GOO Z •• M09 (TO 1 MACHINING DONE) are irrelevant. In the example 01402, the will
N27 G2B Z •• MOS (TOl TO Z-li0111E filled as a practical sample of usage.
N28 GOO X .• Y •• (SAFE Xi!'
N29 M30 (END OF PRC)GRAM) • Any Tool in Spindle - Not the first
%
is the most common method of nr/"\"'r'lln1,1"Y1,
lool is in the way of part changing, it remains The operator sets aU tools in the magazine,
In "I.u ............ permanently for the job. settings but leaves the last tool measured in the "1-"""" . . .
most machines, this tool should not the tool.
• Programming Several Tools matches this too! changing method within
following example is probably the one that
using several tools is the most typical the most useful for everyday work. All are
work. Each tool is loaded into the spindle comments.
various ATe processes. From the
viewpoint. the various lool changing meth- 01402 (ANY TOOL IN SPINDLE AT START)
the cutting section of the program, only (**** NOT THE FIRST TOOL ****)
the start tool (before machining) or the end of the N1 G20 (INCH MODE)
tool (after machining). N2 G17 G40 GSO Tal (GE.'T TO 1 READY)
N3 M06 (TO 1 TO SPINDLE)
As the required tool can be changed N4 G90 GS4 GOO X •• Y •• S.. M03 '1'02 ('1'02 READY)
automatically, only if the Z axis is at machine zero (for ver- NS G43 Z•• Hal MaS (APPROACH WORK)
tical or the Y axis is at machine zero
(for horizontal machining tool position in < ... TO} .. >
axes is only important to the safety the
is no tool contact with the the N26 GOO Z •• M09 (TOl MAClUNING OONE)
are formatted N27 G28 Z.. MOS (TOl TO Z HOME)
programs use machine N28 GOO X .• Y •• (SAFE XY POSITION)
zero return of last tool, for example: N29 MOl (OPTIONAL STOP)

N30 T02 (T02 CALL REPEATED)


N3l M06 (T02 TO SPINDLE)
N393 GOO Z •• M09 TOOL WORK DONE)
N32 G90 GOO GS4 X.. Y •• S.. M03 T03 (T03 READY)
N394 G28 Z •• MOS TOOL TO Z HOME)
N33 G43 Z •• H02 MOS ' .......·rfiJu....'..n WORK)
N39S G28 x.. Y •• TOOL TO XY HOME)
N396 M30 (END OF PROGRAM)
% < ... T02 working .. . :>

with this practice, but N46 GOO Z •• M09 MACHINING DONE)


a large volume of NS7 G28 Z .• M05 TO Z HOME)
N48 GOO X •• Y •• (SAFE XY
N49 MOl

N50 '1'03
N51 M06
N52 G90 GOO GS4 X •• Y ••
N53 G43 Z .. H03 MOS
• Keeping Track of Tools
< ... 7rJ3 working .. . :>
If the lool is easy
to keep a track of where tool is at moment.
N66 GOO Z.. M09 (T03~
In later examples, more complex (00\ will (ake N67 G28 Z •• MaS ('1'03 TO Z
place. Keeping a track which tool waiting and N68 GOO X •. Y •• XY POSITION)
which tool is in the spindle can with a 3 column ta- N69 mo (END OF PRCiGRAM)
ble with block number, 1001 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-
first part only. '?' represents any 1001 number. gram MO I optional S!OP before a tool change - it will be
easier to repeat the tool, if necessary. Also note beginning
Block Number Tool Waiting in Spindle of each tool, containing the next tool search. The tool in the
-
block containing (he first motion has already been called -
Nl ? ? compare block N4 with N30 and bluck N32 with N50, The
N2 Tal ? repetition of the (001 search at the start of each tool has lwo
reasons. It makes the program easier to read (tool is coming
N3 ? TOl imo the spindle will be known) and it allows a repetition of
N4 T02 TOl the tool, regardless of which tool is currently in the spindle.

T01 WORKING • First Tool in the Spindle


N30 T02 TOI Program may also start with the first tool in the spindle.
N31 TOl 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
T02 WORKING waiting station (ready position) during the last tool - not the
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
N51 T02 T03 must be firs! for all parts within the job batch.

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


N1 G20 (INCH MODE)
T03 WORKING N2 G17 G40 GSa TO::! (GET T02 READY)
N3 G90 G54 GOO X .• Y •. S •• M03
When the second part is machined and any other part af- N4 G43 Z.. HOI MOB (APPROACH WORK)
ter that, the tools tracking is simplified and consistent.
Compare the next table with the previous one - there are no < ... Wl working ... >
question marks. The table shows where each tool is.
N26 GOO Z •• M09 (Tal MACHINING OONE)
Block Number Tool Waiting Tool in Spindle N27 G28 Z.. MOS (Tal TO Z HOME)
~
N2S GOO X •. 'l .. (SAFE XY POSITION)
Nl TOl T03 N29 MOl (OPTIONAL STOP)

N2 Tal T03 mo T02 (T02 CALL REPEATED)


N31 M06 (T02 TO SPINDLE)
N3 T03 TOl N32 G90 G54 GOO X .. Y .• S •• M03 T03(T03 READY)
N4 T02 T01 N33 G43 Z.. H02 MaS (APPROACH WORK)

TOl WORKING < ... m2 working .. _>


N30 T02 TOl
N46 GOO Z.. M09 (T02 MACHINING OONE)
N31 TOl T02 N47 G28 Z •• MaS (T02 TO Z HOME)
N4S GOO X •. Y •• (SAFE XY POSITION)
N32 T03 T02 N49 MOl (OPTIONAL STOP)
T02 WORKING
NSO T03 (TO 3 CALL REJr"EATED )
N50 T03 T02 N51 M06 (T03 TO SPINDLE)
NS2 G90 G54 GOO X •• Y.. S •• M03 TOl (TOl READY)
N51 T02 T03 N53 G43 Z.. H03 MO] (APPROACH WORK)

N52 TOI T03


< .. " m3 working . .. >
T03 WORKING
N66 GOO Z •. Ma9 (T03 MACHINING OONE)
Examples shown here use this method as is or slightly N67 G28 Z .. MOS (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 Ma6 (TOl TO SPINDLE)
stacles. Study this method before the others. It wiJl help to mo IDO (END OF PROGRAM)
%
see the logic of some more advanced methods a lot easier.
FUNCTION 101

method is not without a ",,,u.,,,,,,. Since there is • first Tool in the Spindle with Manual Change
a tool in the spindle, it "",,.'nIT'" an obstacle dur':
In the next example,
or part changing. is program the
lO
dIe tool in the program
in such a way that is no IDol in the spindle
may 100 heavy or too
part setup (spindle condition).
through the ATe must
tool change can be done by
• No Tool in the Spindle gram supports manual tool cl1tmf!e.
spindle at the start and end of each machined to use MOO program
productive than with the first tool in the scribing the reason
eXlr;1 Ihe cycle time. An good selection - MOO is a
empty spindle at start used if the program- the machine without
mer has a valid reason, to recover space above Follow the next carefully, to understand how a
the part that would otherwise occupied by tool change can perfonned when the firsllOoJ is
recovered space may be for removing the in the 1'02 in example will be changed manu-
with a crane or a programming ally by the CNC
situation is not much from the previous ex-
ample - except that there is an extra tool change at the 01405 TOOL IN SPINDLE AT START)
program. This tool brings the first tool N1 G20 (INCH MODE)
into the spindle, for of each program run. N2 G17 G40 GBO T99 (GET T99 READY)
NJ G90 G54 GOO X .• Y •• S .• M03
01404 {NO TOOL IN SPINDLE AT N4 G43 Z •• HOI MOS (APPROACH WORK)
N1 G20 {INCH
N2 Gl7 G40 GSO TOl {GET TOl < ... 1D J working . .. >
N3 M06 (TOl TO SPJlNDLE)
N4 G90 GS4 GOO X •• Y.... Sit.. M03 T02 (T02 DVJ\"",,r\
(APPROACH N26 GOO Z •• Ma9 (TOl MAanNING OONE)
N5 843 Z.. HOI MOS
N27 Gl8 Z.. MOS (TOI TO Z HOME)
N2e GOO X •• Y •• (SAFE XY
< ... 10) working, .. > N29 MOl (OPTIONAL STOP)

N26 GOO Z •• M09 (TOl MAcmNING DONE) NJO T99 (T99 CALL REI)Rl\,TTi:l))
N27 G2B Z •• M05 (Tal TO Z HOME) N31 M06 (T99 TO SPINDLE)
N28 GOO X •• Y •• (SAFE XY POSITION) N32 TO) READY)
N29 MOl STOP) NJ3 MOO (STOP AND LOAD T02 MANUALLY)

NJO T02 (T02 CALL REPEATED) N34 G90 G54 GOO X .• Y.. S .• M03 (NO NEXT TOOL)
NJl M06 (T02 TO N3S G43 Z.. HO:;! MOS WORK)
N32 G90 G54 GOO X •• Y •. S •• M03 T03(T03 READY)
NJ3 G43 Z •• NO.2 M08 (APPROACH WORK) <, T02 >

<. ""7D2 working > N46 GOO Z.. M09 (T02 MAan:NING DONE)
N47 G28 Z •• MOS TO Z
N46 GOO Z •• Mag (T02 MACHINING OONE) N48 GOO X •• Y •• (SAFE XY POSITION)
N47 G28 Z •• MOS (T02 TO Z HOME) N49 MI9 (SPINDLE ORIENTATION)
N48 GOO X •• Y •• (SAFE XY POSITION) N50 MOO (STOP AND UNLOAD TOl MANOALLY)
N49 MOl (OP"l'I(JN.!!,L STOP)
N51 TO) (TO) CALL REPEATED)
NSO T03 (TOl CALL REPEATED) N52 M06 (T03 TO SPINDLE)
N5l M06 (T03 TO SPJlNDLE) N53 G90 GS4 GOO X .• Y •• S.. M03 TOl (TOI READY)
N52 G90 G54 GOO X.. Y •• S .. M03 T99 (T99 READY) N54 G43 Z.. H03 MOB (APPROACH WORK)
N53 G43 Z .. HO) MOS \.n.t:",t"J:\,.JJ:'i.....n WORK)

< . 103 working, . , >


< ... 103 working .. " >
N66 GOO Z •• M09 MACHINING DONE)
N66 GOO Z •• M09 (T03 MACHINING OONE) N67 G2S Z.. MOS (T03 TO Z HOME)
N67 G28 Z •• M05 TO Z-HOME) N68 GOO X •• Y •• (SAFE XY POSITION)
N6S GOO X •• Y •• (SAFE XY' POSITION) N69 MOl (OPTIONAL STOP)
N69 M06 (T99 TO SPJlNDLE) mo M06 (TOl TO SPINDLE)
mo ICO OF PROGRAM) NIl M30 (END OF PR.OGRAM)

%
%
1 Chapter 14

Note the M19 function in block N49. miscella- • First Tool in the Spindle and an Oversize Tool
neous function will orient the spindle to exactly the same
Sometimes it is necessary to use a little larger
position as if the automatic tool changing were used.
tool than the machine specifications allow. In that case, the
The CNC operator can then replace the current tool with
oversize 1001 must return to same pocket in the tool
next tool and still maintain the tool position orientation.
it came from and two adjacent magazine
This consideration is mostly important for certain boring
must empty. Do not use a tool that is too heavy!
cycles, where the tool bit cutting has to be positioned In [he example 01407, the large tool is
away from the machined surface. a boring bar is used. it
is to Its cutting tip. 01407 (FIRST TOOL IN SPINDLE AT START)
N1. G20 (INar MODE)
• No Tool in the Spindle with Manual Change N2 G17 040 GBO T99 (GET '1'99 RE1IDY)
N3 G90 G54 GOO X .• Y •• S •• MU3
The following program is a variation on the previous ex- N4 G43 Z •. HOl MOB (APPROACH WORK)
ample, except that there is no tool in the spindle when the
program starts. < ... 7rJJ working . .. >
01406 (NO TOOL IN SPINDLE AT START)
N26 GOO Z •• M09 (TOl MACHINING DONE)
N1. G20 (INCH MODE)
N27 G28 Z .. MaS (TOl TO Z HOME)
N2 G17 G40 G80 TOl (GET TOl READY)
N28 GOO X •• Y •• (SAFE XY POSITION)
N3 M06 (TOl TO SPINDLE)
N29 MOl (OPTIONAL STOP)
N4 G90 G54 GOO X. _ Y.. S •• M03 T99 (T99 READY)
N5 G43 Z.o HOl Moa (APPROACH WORK)
N30 T99 (T99 CALL REPEATED)
001 MOG TO SPINDLE)
< ... 7rJl ... > N32 T02 ('1'02 READY)
N33 M06 (T02 TO SPINDLE)
N26 GOO Z •• M09 (TOl MACHINING DONE) N34 G90 G54 GOO X •• Y.. S •• M03 (NO NEXT TOOL)
N27 G28 Z •• M05 (Tal TO Z N3S 043 Z.. H02 M08 (APPROACH WORK)
N28 GOO X •• Y •• (SAFE XY POSITION)
N29 Mal (OPTIO:N1\L STOP) < ... 7rJ2 working .. . >
N30 T99 (T99 CALL REPEATED)
N46 GOO Z •• MU9 ('1'02 MACHINING OONE)
N3l MU6 (T99 TO SPINDLE)
N47 G28 Z •• M05 (T02 TO Z HOME)
N32 T03 (T03 READY)
N48 GOO X •• Y •. (SAFE XY POSITION)
N33 MOO (STOP AND LOAD T02 MANUALLY)
N49 Mal (OPTIO:N1\L STOP)
N34 G90 G54 GOO X •• Y •• S •• M03 (NO NEXT TOOL)
N35 G43 Z .• H02 MOB (APPROACH WORK)
N50 MOG (T02 OUT OF SPINDLE TO THE SAME POT)
N5l T03 (T03 READY)
< ... 7rJ2 worJdng ... > NS2 M06 (T03 TO SPIND1..E)
N53 G90 G54 GOO X •• Y •• S .. M03 Tal ('1'01 READY)
N46 GOO Z .• M09 (T02 MACHINING DONE) N54 G43 Z •• H03 MOB (APPROAOi WORK)
N47 G28 Z •• MOS (T02 TO Z HOME)
N48 GOO X •• Y •• (SAFE XY < .. . workiJlg .. . >
N49 MJ.9 (SPINDLE ORIENTATION)
NSO MOO (STOP AND UNLOAD '1'02 MANUALLY)
(T03 MACHINING DONE)
N66 GOO Z •• M09
N67 G2B Z •• MOS (T03 TO Z HOME)
NSl '1'03 ('1'03 CALL REPEATED)
N68 GOO X.. Y .• (SAFE XY POSITION)
NS2 M06 (T03 TO SPINDLE)
N69 MOl (OPTIONAL STOP)
N53 G90 GS4 GOO X .. Y •. S •• M03 T99(T99 READY)
N54 G43 Z •• HOJ MOS (APPROACH WORK)
mo M06 (TOl TO SPINDLE)
N7l lOa (END OF PROGRAM)
%
< ... 7rJ3 working . .. >
• No Tool in the Spindle and an Oversize Tool
N66 GOO Z •• M09 ('1'03 MACHINING DONE)
N67 G28 Z •. MaS (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) 1001 is target" than the maximum recommended diameter,
N70 M06 ('1'99 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 pocket.,;; are both empty.
TOOL FUNCTION 103

• lathe Tool Station


A slant bed uses a polygonal turret holding
all external and internal cutting tools in special holders.
In (he 01408 example, the tool. These tool stations are similar to a tool on a ma-
chining center. design 8, 10, 12 or more cut-
01408 (NO TOOL m SPINDLE AT START) ting tools - Figure 14-7.
N1 G20 (INCH MODE)
N2 G17 G40 GSO TOl (GET Tal READY)
N3 M06 (1'01 TO SPINDLE)
N4 G90 G54 GOO X •• Y •• S •. M03 1'99 (1'99 READY)
NS G43 Z.. Hal MOB (APPROACH WORK)

< ... TOI wor/dng .. . >

N26 GOO Z •• M09 (TOI MACIaNING DONE)


N27 G28 z..MaS (Tal TO Z HOME)
N2e GOO X •. Y •. (SAFE XY POSITION)
N29 Mal (OPTIONAL STOP)

N30 1'99 (T99 CALL REPEATED)


N3l M06 (T99 TO SPINDLE)
N32 1'02 READY)
N33 M06 (T02 TO SPINDLE)
N34 G90 GS4 GOO X.. Y.. S.. MO) (NO NEXT TOOL)
N3S G43 Z.. H02 MO 8 (APPROACH WORK) Figure 14-7
Typical view of an octagonal lathe turret
< ... T02 working.. >
Many CNC lathe models start adopting the tool
type to with many more
N46 GOO MACHINING
N47 G28 (T02 TO Z HOME)
tools available away from work area.
N48 GOO X .• Y •. (SAFE XY POSITION)
Since all tools are held in a single turret, the one
N49 MOl (OPTIONAL STOP)
selected cutting will always carry along all other tools
NSO M06 (1'02 OUT OF SPINDLE TO THE SAME into the work area. This may be a design whose has
N51 T03 (T03 READY) but il is still commonly used in industry.
N52 MOo (1'03 TO SPINDLE) cause a possible between a tool and the ma-
N53 G90 G54 GOO X •• Y.. S •• M03 1'99 READY) or part, care must be taken not only of the active cut-
NS4 G43 Z •• HOJ MOS (APPROACH WORK) ting tool. but all orher tools mounted in turret,
for ail collision
< ... T03 working .. . >
• Tool rndexing
N66 GOO Z .• M09 (TO 3 MACHINING DONE)
N67 G2B Z •• MOS (1'03 TO Z HOME) To program a tool change, or rather to index the cutting
N68 GOO X .. Y •• XY POSITION) tool into the position, the T function must be pro-
N69 MOl (OPTIONAL STOP) grammed according to its proper formal. For the CNC
NiO M06 (1'99 TO SPINDLE) lathe. this format calls for the address followed four
Nil M30 {END OF PROGRAM} digits - Figure 14-8.
%

illustrate some of ATe programming


methods. The is not difficult once the tool changing
mechanics of the machining center are known. Tool number
is tool WEAR number
T fUNCTION fOR LATH
r•••• _ _ __ Tool station number
So rhe tool function was as it applied to the is GEOMETRY offset number
CNC machining centers. CNC lathes use the tool func-
tion T, but with a completely different structure.
Figure 14·8
Structure of a 4-digit tool number for eNC lathes
104 Chapter 14

It is important to understand this function well. Think display of a typical Fanuc control, there
about the four digits as two pairs of ralher than four is a two screens, both very in appearance.
single digits. Leading zeros within omit- One is called the Geometry Offset screen, the other is called
ted. Each pair has its own meaning: lhe Wear Offset screen. Figure 14-9 and Figure 14-10 show
examples of both screens, with typical (Le., reasonable)
The first pair (the first and the second digits). control the sample entries.
index station and the geometry offset.
1001

~ Example:

TOl xx - selects the tool mounted in position one


and activates geometry oHset number one
The second pair (the third and the fourth digits), control
the tool wear offset used with the selected tool.

~ Example.

Txx01 - "''''P'''.'' wear offset register number one Figure 74·9


It is customary, not arbitrary. La the pairs, if Example af rhe GEOMETRY offset screen display
ble. For example, tool function TO 10 I will select 1001 sta-
tion number one, geometry number one and the asso- OFFSET - WEAR
tool wear offset number one. This format is
easy 10 remember and be used every time, if only
one number is assigned to the tool number.
If two or more different wear ~l!sets~e used for the same
Lool, it is not possible to malch Ihe pairs:In such a case, two
or more different wear offset numbers must be
grammed the same 1001

Q Example: figure 14-10

T0101 for turret station , Example of the WEAR offset screen dispfay
geometry offset 01 and wear offset 01
• Geometry Offset
Q Example:
Geometry the same as the turret
T0111 for turret station 01, station number. operator measures and fills-in the ge-
geometry offset 01 and wear offset 11 ometry for all tools used in the program.

The first pair is always tool station number and the


geometry offset number. The examples assumed that tool
wear offset 11 is not by another tool. If tool ! 1 is
~with the offset II, another suitable wear offset number The from the zero position will
must be selected, for example 2J, and program it as TOI2l. the distance from the tool reference point to the part refer-
Most controls have 32 or more offset for 14- J 1 shows a typical measurement
and another wear olfsets registers. applied to a common tool.
offset can be applied to the CNC All X values will normally have diameter values and are
by registering value into the stored as a typical rear lathe of the slant bed
type. The axis values will normally be
TOOL OffSET REGISTERS (positive are but impractical). How to actu-
ally measure the geometry offset is a subject of CNC ma-
word offset has been mentioned already several times chine lOol operation training, not
with two adjectives - with the expression geometry offset Figure} 4- 12 shows a lypical measurement of the geome-
and the expression wear offset. What exactly is an offset? try offset applied to a common internal tool.
What is the difference between one offset and the Olher?
TOOL FUNCTION 105

tty relating to the geometry off-


13. It shows geometry offset
on the spindle center line (at XO
center drills, drills, taps,
will always be the same.
Tool tip
• Wear Offset
if-r---' TO 101
program, the same are used
as in the finished drawing. For exam-
of 3.0000 is programmed as
,, not reflect any implied dimensional
X3.0, X3.00, X3.000 and X3.0000
same result. What is needed to maintain
Geometry particularly when they are
offset X (0)
to be done with a worn out tool that is still good
to cut a few more parts? The answer is that the pro-
path must be adjusted,fine-tuned, to match
tr(:JnmJ'>f,rvofiset for external (turning) tools the machining conditions. The program itself will not be
but a wear offset for the selected tool is

difference between the


measured size of the part.

J4- 14 ill ustrales the principle of the tool wear


tip detail the is exaggerated for prnnn<l,""

!
Geometry
offset X (0)
I
II
14·12 1/
I

geometry offset for internal (boring) tools I J

1/ ;- PATH
I PROGRAM

Figure 14-14
/
Programmed tool path and tool path with wear offset
Tool tip
The wear offset only one purpose - il compen-
sates between the programmed value, for example of the
3.0 the as measured
The differential
register. This is
of the (001

Geometry
X (0)

figure 14-13
Typical geometry offset for center line (drilling) tools
1

• Wear Offset Adjustment The principle of the wear offset adjustment is logical. If
illustrate the concept offset adjustment on a rear the machined diameter IS larger then the drawing dimen-
lathe, T0404 in the program will be used as an exam- (he wear is changed the minus direc-
The is to achieve an outside diameter of 3.0 inches tion, towards the spindle center line, and versa. This
and tolerance ±.OOOS. starting value the wear off- principle applies equally to external and internal
set in the Txx04 will be zero. The relevant section The only practical difference is an external
{he program look something like this: diameter and internal diameter can be recut (see
the lable above). Chapter 34 presents several practical ex-
N31 MOl amples using the wear offset creatively,

N32 T0400 M42 • The Rand T Settings


N33 G96 S450 M03
N34 GOO G42 X3.0 ZO.! T0404 Moa The last items are R T columns (Geometry and
N35 GOl Z-l.S FO.Ol2 Wear). The offset screen columns are only useful during
N36 ••• The R column is (he radius column. the T column is
the (001tip orientation column (Figure 14-
When the machined part is inspected (measured), it can
have only one of possible inspection results:
i

m
o
o dimension
Q Undersize dimension
If the part is measured on is no need to inler-
fere. The tool setup and program are working correctly.
If the is oversize. it can usually be recut for machining
an outside diameter. an inside diameTer. the exact oppo-
will apply. recut may damage the finish,
which could a concern. If (he part is undersize, it be-
comes a The aim is to prevent all subsequenl parts
from being as well. The following table shows RADIUS
Inspection results all existing possibilities:

Measurement External diameter Internal diameter


ON size Size OK Size OK

OVER size SCRAP


Figure 14-15
UNDER size Recut possible Arbitrary tool tip orientation numbers used with tool nose radius
compensation (G41 or G42 mode)

Let's go a little further. Whether the pan will be The rule of R T columns is (hat they are
or...JJJldersized, 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 is (hal this is an vant. If G411G42 command is used, non-zero values for
example of an outside diameter. that tool must be set in both columns, R column re-
quires the tool nose radius the cutting loot the T column
The diameter X3,0 in the example may result in the tool tip orientation number of the tool.
3,004 diameter That means il is 0.004 over- Both are described in Chapter 30, in more detail. 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 04 to -0,0040. The subsequent 1/64 of an inch =: .01 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
3/64 of an inch == .0469 or 1,2 mm
specified tolerances.
If the part in the example is undersize, say at 2.9990 tool lip numbers are arbitrary and indicate the tool
inches. the wear offset must adjusted by +,0010 in the X orientation number used to calculate the nose
positive direction. The part is a of tool setting in the turret.
REFERENCE POINTS

The common point here is that all environments


cannot useful without some 'leam . They have to
environment, work they have to interact.
importance.
purposes, these relationships and inter-
are three major "'.\\Ilrrm n1o""",",,n that actions are based on one common denominator of each en-
an established mathematical - a reference point.
A is a fixed or "''''"",,",,,,,.,, arbitrary location
Relationship
machine, on the rool A fixed refer-
is a precise location two or more axes, de-
Machine tool + Control system (CNC unit)
during manufacturing reference
are established by the during the pro-
Workpiece + Drawing + Material
gralmrmnlg process. In these three ref-
+ Cutting tool erence points are needed - one point for each of
Tool
available groups:

environment maiep!~nOent of the other a Machine reference point .. Machine zero or Home
two. If the relationship right away, consider a Part reference point .. Program zero or Part zero
(he sources of each ,..n'Jlrrm
a Tool reference point .. Tool or Command point
a MACHINE TOOL is made by a company specializing in
machine tools, usually not or cutting tools In a typical language of a shop. these reference
have somewhat more meamng. Home posi-
... this ellvironment is combined with . .. or a machine zero are terms for machine
a CONTROL SYSTEM is made by a company specializing reference point. A program zero,
in the application of electronics to machine tools. are terms commonly used
do not normally manufacture machine tools reference point. And name tool tip or a tool com-
or cutting mand point are commonly used {he tool reference point.
o PART {workpu~cells a engineering design
developed in a company that does not manufacture REFERENCE POINT GROUPS
machine tools, control systems, or cutting and
holders. The
a CUTTING TOOLS are a specialty of tooling companies, for short.
which mayor may not make cutting tool holders. the control
These companies do not manufacture machine tools CNC machine tool H ......... ""'"

or CNC C:\J<::rl>nH: ratings, etc. a


table or mounted into a
\hese sources meet when a customer buys a or other work holding
CNC machine. A engineering design (part). must of numbers to consider. The parr
machined on a 1001 from one manufacturer, using
size, its height, diameter, shape,
a control manufacturer. tools Finally, the third group of num-
from yet another and 1001 tools. Each CUlling tool its indi-
fourth source. sources are similar to a as features that are with the
tet of first who never played .~"'_ ... _,
both cases is a need to create a harmony.
All have a - they are
By itself, environment is not very useful. A machine they are actual values program-
withoultools will not yield any profit; a 1001 that cannot be to work with individually as well
used on any is not going to benefit manufac- as
turing cannot be machined without tools.

107
108 Chapter 15

• Reference Point Groups Relationship


The key 10any successful CNC program is (0 make all
to work in a coordinated way. This goal can
achieved by understanding principles of
ence points and how Ihey work. reference point can
have two
o Fixed reference
o Flexible. or floating reference point
A point is set by the machine
Lurer as part of hardware design cannot be physi-
cally by the user. A CNC machine has at
fixed point. When it comes to
ence points for the part or the cutting tool, programmer Figure 15-1
of freedom. A reference point (pro-
Machine and axes orientation for a vertical machine
gram is a flexible point, actual
silion is in programmer's hands. The point for the The cubical shape shown is useful only for under-
cutting tool can either or flexible, de- standing the work area. programming and
pending on machine design. 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 at the machine the top (XZ machine
plane) and from Ihe (YZ plane). Figures
The machine zero point, often called the machine zero, J5-2 J5·3 illustrate both views.
home or a machine position, is the
of machine coordinale location this
may between the manufacturers, but
most obvious is individual machine
types, namely the vertical and horizontal models.
MACHINE
In general terms, a CNC machine two, or more
axes, depending on the type and model. has a
maximum range of travel that is fixed by manufacturer.
range is usually for If the CNC
erator exceeds the range on an error condition
known as over/ravel will occur. Not a serious problem, but view
one that could be During setup, particu-
larly after the power has been turned on, the position of all 15·2
axes has to preset to be the same, from day to Top view of a vertical machine as viewed towards the table
day, from one part to another. On older this pro-
is done by setting a grid, on machines, by
performing a machine zero return command. Fanuc and Spindle /'0 ...." 0 .. 1

m~flY control systems prevent automatic operation of


a machine tool, unless the machine zero return command
Gauge line
been performed at least once - when the power to the
has been on. A safety feature.
On all CNC machines that use typical coordinate system,
the machine zero is located at the end of each
For a lypical vertical machining
center, at the pan in the plane, is straight down
from the tool position (tool tip). Also look into the XZ FRONT view
plane (operator's front of the machine), or into YZ Figure 15-3
plane (operator's right-side view of the
front view of a vertical machine as viewed from the front
three planes are perpendicular to other and together
creale su t:alled work cube or work space - Figure 15-1. the two views. In top view, the right cor-
the spindle center line shown in front view.
REFERENCE POINTS 109

Also note that in front there is a dashed idenli- This vital reference point will be used in a ....,."IT,.".."
as the gauge line. This is an imaginary for the the relationship with reference
proper fit of the holder tapered body and is set by the ence point of {he and the drawing dimensions.
machine The inside spindle is a
taper that tool holder with The part is commonly known as a pro-
Any (001 holder in the spindle will gram zero or a part zero. Because the coordinate point that
In the same position. Z motion illustrated will represents program zero can selected by the
shortened by the tool projection. subject of anywhere, it is not a fixed point, but ajloQling
tool referencing is later in this this point is more details can cov-
- after all, it is programmer who part zero.
• Return'to Machine Zero
• Program Selection
In manual mode, the operator physically moves the
axes to the machine zero position. The operator IS ng the program zero, often in the comfort of
to register inlo the control if office, a is that will
necessary. turn power to the while the the efficiency setup and its machining in
machine are at or very close to the machine zero po- the shop. Always allenlive (0 all are for
Silion. too close will make manual machine zero and against a zero selection in a
return more difficult later, power had re- zero point may be selected
A clearance 1.0 inch (25.0 mm) or more each not much of an advice, although true
IS
machine zero is usually sufficient. A typical pro- in terms. Within practical restrictions
to physically the machine zero position will the mach.ine operations, only the most advantageous possi-
follow these bilities should be considered. Three such considerations
1. Turn power on and control} should govern of program zero:
2. Select machine zero return mode
3, the first to move (usually Z axis) [) Accuracy of machining
4. Repeat for the all axes o Convenience of setup and operation
5. Check the in-position indicators
6. Check the position screen display o Safety of working conditions
7, display to zero, if necessary
Machitli"q Accuracy
safety reasons, the selected axis should
machining centers and the X Machining accuracy is paramount all parts must be ma-
In bolh cases, either axis will be moving away work, exactly to the same specifications.
into the clear area. When the axis has reached machine zero is also important repeatability. All the
position, a small indicator light on control panel turns in the balch must the same and all subsequent jobs
on to confirm that axis actually machine zero. must be the same as well.
The machine is now at its reference position, at the machine
Convenience of Setup Bnd Dperation
zero, or at the machine point, or at home-
ever term is used in the The indicator light is con- Operating setup can only be considered
firmation for each the machine is ready for once (he machining accuracy is assured. Working
use, a good will go one step further. On the posi- desire. An experienced CNC nrl".O'r~imrnl"r
lion display screen, Ule actual position should be think of the has in
set to roreach axis, as a standard practice, ifil Defining program zero that difficult to set on the
is not to zero automatically by control. The but- machine or difficult to check is not convenient. It
control panel the position screen slows down the setup process even

PART REfERENCE POINT Working

Safety is always important to whatever we do machine


A part for machining is within the machine and part setup are no different. Program zero has a
motion \lmils. Every must mounted in a that lot to do with the
IS suitable for required operation and not
change position other part of the job run. The fixed We look allhe lypical considerations of program zero se-
location of the very important for consistent re- vertical centers and lathes
sults and It is also very important to guarantee ally. Differences in part influence the zero
thaI of the job lS set the same way as the first selections as well.
is established, part reference can
110 Chapter 15

• Program Zero - Machining Centers part are both parallello machine axes and perpendicular
CNC machining centers allow a variety of meth- zero (part
IJvr\<Tr"' ...... is at (he intersection
ods. Depending on the type of work, some most common two edges.
setup methods usc vises, chucks, subplates hundreds of The concepl is common for virtually all setups,
special fixtures. In addition. CNC milling systems allow a actual If a part is mounted in a
setup, increasing available options. In vise jaws must be parallel to or
to select a program zero, all machine axes must perpendicular with machine axes the fi;ced location
considered. Machining centers with additional axes re- must be established with a stopper or other fixed
quire zero point each of these axes as well, for
the or rotary axes. Since a machine most common work holding
device parts, use it as a practical example of
What are the most common setup methods? Most ma- how to program zero. Figure 15-5 illustrates a lypical
chining is done clamped on table, in a simple engineering drawing, with all the expected dimen-
or a fixture mounted on Ihe table. These basic methods can descriptions material
be adapted to more complex applications.

programmer the setup method for any 1210 75


given perhaps in cooperation with machine 3 . \
THRU
tor. programmer selects the program zero
tion for each program. The process of selecting pro-
zero starts with drawing evaluation, but two steps
to be first:
Step 1. Study how drawing is dimensioned,
which dimensions are critical and which are not 1.0 r-~
Step 2. Decide on the method of part setup and holding

Program zero almost presents ilselfin the any


--....
!

4.0
make sure all critical dimensions and tolerances are 1020 x 0.5
from one part to another. dimensions
are usually not critical. Figure 15·5
Sample used lor selecting program zero """::,,.... nltJ
simplest on a machine table involves
the part, some clamps and surfaces. When selecting a zero, study the
ing surfaces must be fixed during run and The designer's dimensioning style
measured from. The most typical setup of this kind is flaws, but it still is the engineering drawing. In the example,
on pin Two pins form a single row dimensioning alJ holes is the lower left corner of
the third pin is offset away at a right creating a the work. the program zero of the part itself?
setup corner as two locating surfaces - Figure 15-4.
For this example, should be no question about pro-
gramming the point except at
lower left corner the part. the drawing origin and
it will become the part origin as well. It also satisfies Step 1
MACHI PART of the program zero selection The 2, dealing
with work holding device is next. A typical setup
CNC machine vise could be the one iIlust.rated
15-6.

In the setup identified as Version 1, the part has posi-


tioned the vise a left pan stopper. The
part orientation is the same as drawing. so all drawing
N LOCATORS will appear in the program using these drawing
dimensions. It seems that this is a winning setup - yet, this
Figure 15·4
is actually poor.
Three-pin concept 01 a parr setup (all pins have the same diameter)
What is in the IS any of
Since part touches only one point on each pin, the the actual size of The drawing specifies a
setup is very accurate. Clamping is usually done with top rectangular stock of 5.00 x 3.50. The~e are open dimen-
clamps and The left and bottom of the sions they can vary 10 or more and be acceptable.
REFERENCE POINTS 111

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


and make sure all negative signs are programmed correctly.
FIXED JAW
Is there another method? In most cases there is. The final
o Version 3 will offer the best of both worlds. Part program
will have all dimensions in the first quadrant, as per draw-

o 0
ing. Also, the part reference edge wiU be against the fix.ed
jaw! What is the solution? Rotate the vise 900 and position
the part as shown - Figure 15-8) if possible.

MOVING JAW
y
l ~
I ~ <:
<: -:I
--x -:I
0
(!)
Z
Figure 15-6
LU
X
0 >
A sample part mounted in a machine vise· Version 1 u.. 0
0 0 ::E
Combine any acceptable tolerance with the vise design, ,'"
y
where one jaw is a fixed jaw and the other one is a moving i
jaw, and the problem can be seen easily. The critical Yaxis !
reference is against a moving jawl --x
The program zero edge should be the fixed jaw - a jaw Figure 15-8
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 (al! 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 a normal case). VersiOIl 1 setup can be the face. Another method is to select the bottom face of the
improved significantly by rotating the part 1800 and align- part, where it IS located in the fixture.
ing the part stopper to the opposite side - Figure J5-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-
FIXED JAW sition may be built into the fixture, away from the part.

o 0 Selecting a program zero for round parts or paHerns (bolt


circles, circular pockets). the most useful program zero is at
the center of (he circle - Figure J5-9.
o
)

MOVING JAW nr--9--~


x:..; I '

(2) ~ ,----- PROGRAM ZERO


y f I ~
1 -Q- -.-- ·¢-----~--cB· -
--x h\! 0
figure 15-7 ~_¢_0
A sample part mounted in a machine vise - Version 2

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


orientation by 1800 has introduced another problem - the Figure 15-9
part is located in the third quadranti 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', forget the minus signs. many problems associated with program zero at the center.
112 Chapter 15

• Program -lathes is setting program zero on the


On zero selection is simple, This is not a perfect selection
are only two axes to consider - the vertical X axis and the other advantages. The only disadvan-
there is no finished face. Many op-
horizontal Z axis. Because of the lathe design, the X axis
program zero is always the spindle center line. face to the setup or cut a

On eNC lathes, the program zero for the X axis What are the zero at the front
MUST be on the center rine of the spindle One is that many dimensions along Z axis
can be directly into program, normally with
z three popular methods are used: value. A depends on the
of cases, the CNC programmer
o Chuck .. , main face of the chuck
probably the most important, is a
o , ., locating face of the jaws a tool motion indicates the work area, a
o is in the clear area. During program devel·
, ., front of the finished part
opment It IS to forget a minus sign for the Z cut-
an error, ifnotcaught in time, will posi-
tool away from part, with the tails tack as a possible
Stock X
,_[tp
__l / J obstacle. It is a wrong position, but a better one than hilling
pari. Examples in this handbook use program zero at
'. _. - - - -...1 ---
thefrontfinishedface, unless otherwise specified.
, .
-- -- ---
CHUCK
TOOL REFERENCE POINT
Stock x referenc~ point is related to the lOol. In milling
• operations, the reference point of tool is
the intersection of the tool centerline the
culting lip (edge).

JAW turning and boring, the most common (001


point is an imaginary tool point of the cutting
Stock X cause most tools have a cutting with a built-in

~
---

!
- - • - < _.' )",,~ ~ -
For tools such as drills and other point-to-point tools
in milling or lurning. the reference point is
- - - -~ -
Ireme tip the tool, as measured along Z
P,ART 15-1 J shows some common tool tip points.

Common program lero options for 8 eNC lathe· center line is XD

a chuck
with the
On a nega-
additional
drawing

Jawor fixture face presents more


face can also be touched with tool
all parts. This location may
shapes, such as castings,

Many lathe pariS During tool reference toofs


the first operation, material operation
must always be added to Z value. is the main
All are connected. An error
on another. The
reason why CNC programmers away from program
to understand
zero located on jaw or fixture in special cases.
REGISTER COMMANDS

reference points CNC program- • Position Register Definition


harmonized to correctly. Hav-
rPt,"'rPlnrppoints for program zero) and A little more verbose defi of the position rell~ISli:::r
tool (i.e.• tool tip) there has to be some could be way:
means to associate them to fit them together.
must be some means LO 'teU'the control syslem ex- Position register location
actly where each tool is physically within the ma- as
FROM the program zero,
work area, before it can oldest method TO ..• the tool current position,
to do all lhis is to register the current of the measured along the axes
control system
.", .. 'nr.n r,'{"wlt ..p'n a
Note that the definition does not mention the machine
zero at all - instead, it mentions current tool position.
POSITION REGISTER COMMAND is a very important distinction. The current tool posi-
tion may be at machine zero, it may
The command for the tool position register is within travel limits of axes.
092 for machining centers and lathes:
note the emphasis on from-to By defini-
distance is unidirectional. between the program
ition register command (used in milling) the current tool location. direction is always
zero, 10 lool never reversed. In a
ilion regisler command in turning)
correct sign of each value (positive, nega-
or zero) is always required.
lalhe5: also lise G92 but lathes
!-'v" .. " " , register is only applicable in the absolute
supplied with and similar controls normally use G50 mode programming, while G90 command is jn effect. It
command instead. In practical applications, both 092 and has no use in the incremental G91. In
G50 have identical meaning and the following programmmg,
discussion to both commands In the first do begin in
part of this the focus will applica- toullocation.
tions using command, lathe using G50
command will explained later. • Programming Format
As the name (he command suggests,
by a much more data associated with the G92 command will
and called the Work Offsets to U59), (i. e., stored) into 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 command is as
few older machine tools in shops that do not the
ury of the of commands. There are many
compames developed years but still
running on equipment. In cases, In all cases, the of each axis specifies
standing the registration command is an from the zero to the tool reference point (tool tip).
skill. This been one some Programmer provides all coordinates based on the
grammers and found a little difficult to reference point (program discussed earlier.
stand. In reality, is a very simple command. ditional axis will also have to be registered with
First, a look at some more detailed definition this com- example the B axis the indexing table on
mand. A typical description only specifIes Position Regis- chining centers.
ter Command, which by itself is not very

113
114 Chapter 16

• Tool Position Setting


MACHINE
only purpose of command is to register the cur- ZERO
rent 1001 posilion imo the control memory - nothing

effect of can be seen on the absolute position


screen display. AI all the position display
some values for each They could zero or any
other values. When G92 command is current
values of the display will with the values
fied with G92. H an axis was not specified with there
will no change of display for that At the machine.
the has a major responsibility - to match the actual
tool seHing with the specified in the command. 18-1
Current tool position machine zero
(only XY axes shown)
MACHINING CENTERS APPLICATION
Fig ure 16-/ a G92 setup on tool sel at
In programming for CNC machining centers without the machine zero position. 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 Register must be for each example, if a special fixture is permanently attached to the
axis and each lOol. There are two methods: machine A subplate with a grid is a common
example. Permanently set one or more vises may also ben-
o The tool position is set at machine zero
efit. There are numerous variations on this lype of setup.
o The tool position is set away from machine zero
• Tool Set Away from Machine Zero
Which method is better? We look at both them.
second method eliminates the difficulty of the
• Tool Set at Machine Zero ous It allows the programmer to sel XY 1001
anywhere within the machine travel limits (considering
The first method requires that the machine zero position safety first) and use that position as the lool position
will be tool change position for all axes. This is not for XY axes. there is no for machine zero itself.
necessary and definitely very impractical. Consider il 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
A program is usually done away from the machine. but axes. Figure 16-2 shows an a set at a
the part position on the tabJe must be speci live X axis and a positive Y axis.

G92 X12.0 Y7.5 ZS.375


IN1TIAL MACHINE
Numbers in the example look innocent enough. But con- TOOL ZERO
CNC al the machine, trying 10 setup POSITION
part (without a fixture), to 12.0 inches
away from machine zero in the X axis. the same lime,
the operator must the same exactly inches
away from machine zero Y axis. The same effort has
to be done for the Z axis as well.
It is an almosl impossible task, at without some spe-
cial fixtures. It is definitely an extremely unproductive
There is no need those numbers. they are strictly
X 12.0 could have easily been 12.5. with no
benefit All this difficulty is encountered
only has chosen the machine zero
reference poi nt tool change position (mainly in the X Figure 18·2
andY Current tool position set away (rom machine zero
(only XY axes shown)
REGISTER 115

In order to place tool into the change posi- • Programming Example


tion, the operator physically moves the 1001 from the pro·
To illustrate how to use the position
gram zero by amounts in statement. This
a part program for vertical
is a lot easier job and also much more that
have to be followed:
jng setup to the machine zero.
o The cutting tool should be changed first
Once the lool change posilion is
the program will return to this position a o G92 must be established before any tool motions
The Z axis automatic tool change position on o Tool must return to the G92 position when
chining centers musl be programmed at all the cutting is completed
the only automatic tool change
really applies 10 XY axes only. All three rules are followed in a
tion, the 092 selling will be the same for all
[here is a good reason to change it. 01601 (PROGRAM NUbmElR)
N1 G20 (SET ENGLISH )
The only major disadvantage of this method is N.2 G17 G40 GBO G90 TOl (GE.'T TOOL 1 READY)
new tool change position is only N3 M06 (TOOL 1 TO SPJCNDLE)
system while the power is on. When the power to N4 G92 X9.7S Y6.S Z11.0 (SE.'T CURRENT XY)
N5 GO 0 XL 0 YO. S S800 M03 (MOVE TO
chine is turned off. the tool change position is lost.
No ZO.l NOS (MOVE TO CLEAR ABOVE)
nprlpn,~p.n CNC operators solve this problem by
N'7 GOl Z-0.55 F5.0 (FEED TO DEPTH)
finding the actual distance from the machine zero to N8 X).O Y4.0 F7.0 (CUT A SLOT)
tool position. register it once for particular ~ GOO Z11.0 N09 (RAPID TO Z MACHINE ZERO)
then move the tool by that distance NlO X9. 7 5 Y6. 5 MaS (RAPID TO XY SET POSITION)
for example, at the start of a new day. Nll NOl (OPTIONAL STOP FOR TOOL 1)

• Position Register in Z Axis


example to write but more difficult to set-
a typical vertical machine, the Z axis must be fully re- Don't worry about unknown program
[0 the machine zero, in order to make (he automatic explanations should be
tool change. The position register value is measured from
the zero of the Z axis (usually the top of finished setting position must always
to the tool reference lip, while the Z axis is at ma- at It not maHer the tool
zero position. There is no other option. In is made, at machine zero or away from it - the pro-
will same, of the values
Normally, each tool will have a different Z value of the Only one but normally, each
command, assuming the tool length is different for Z value as the position register,
tool. a rule. the XY settings will not change. length.
shows a typical for 092 command along
o 1601 ill ustrates the concept. LATHE APPLICATION
the with Fanuc and similar controls. 050
092 command:

MACHI

If 092 is a the command is similar:

same definition and


program

Figure 76-3
machine zero fDr the Z axis
8 different setting)
116

Commands G50 and are identical, except that they • Three-Tool Setup Groups
belong to two different G groups. Fanuc actually of-
On a typical slant bed CNC lathe, equipped with a
fers three G code for lathe controls. Based on his-
Iygonal turret (6 to 14 stations), all cutting
tory,typical Japanese made controls use GSO, whereby typ-
individual stations of the turret. During tool
ical US made controls G92. A cooperative US and
the tool is in the active station.
Japanese venture known as Fonuc (General Electric
the used for CNC lathe
and Fonuc) produces controls that are the most common in three groups
North American' the G50 command. normally do:
for lathe applications is o Tools lAtn'''''tn on the part center line
very similar to that for the mills. However, due to
design of CNC lathes, where all tools are mounted in Q Tools working externally on the part
turret, the projection from the Q Tools working internally on the part
turret holder must possible in-
terference must be mounted inaclive for each group is understood well,
tools move one that is used for it to any tool within a group,
cutting. In all are safely out of tools used.
placed in a tool magazine. Several new designs of
lathes are available, where tool on the lathe • Center line Tools Setup
resembles the milling type.
as center line tools are typically
• Tool Setup standard twist drills, car-
reamers, and so on. Even an end mill can
The most important lathe center line. All tools in this group
work relates to the op- have a common denominator, whereby the tool tip is
tions to select from, some are .....,..,C"" .. " always on spindle cenler line, while they cut
These must be setup exactly at 900 to the work
Probably the most face (parallel to
to have the tool change
to the machine zero position. POSI- The position value in the X axis is from the spin-
to move the turret 10, just control panel dle center line to the center line of the tool. For the Z
The position registcr to machine zcro axis, the position value is measured from program
have one major disadvantage it /00 far for zero Lo the tool Iy, the center line tools will have
most jobs, particularly on larger lathes the Z axis. a fairly large that means their GSO value
imagine a tool motion ono inches or more the Z the Z axis wm small, when compared to
only to index the turret and than (he same 30 inch mo- external tools, which generally do not project too much.
buck to continue the cutting cycle. It is not efficient at
is a solution, however. Figure 16-4 a for center line tools.
using an indexable drill as an
Much more efficient method is to select tool indexing
position as close lO the part as possible. position
should always be based on the longest tool mounted in the TOOL
turret (usually internal tools), whether the tool is in the
or not. If there is enough clearance the IV"!:;'-""
will also be enough clearance

of two
position at the X
not too distant) and JUS!

On a lathe, do not forget to keep in mind


layout of all tools in the turret, to prevent a collision with
the chuck, or the machine.
are other, but less common, methods to a tool 16-4
the GSO command.
Typical 550 setting for center line lathe tools
REG COMMANDS 117

• External Tools Setup


external machining operations such as TOOL
diameters, taper cutting,
threading, part-off and
and approaches

register value is
zero to tool tip of the
this chapter). In case of tools
tool, G50 amuunl is usually
the insert, for safety reasons,
16-5 illustrates a typical position for
tool (turning tool shown in example).
Figure 16·6
AT
TOOL CHANGE POSITION Typical G50 for internal lathe tools

For reasons, no 1001 should extend from a turret


into the Z minus zone that is to the left of part front
Many lathes a fairly long travel beyond Z
zero (about I inches or 25-50 mm).
times, this zone can entered to make a safe tool
for very tools. (his is a more advanced
strict safety COI1Sllaer'an,ons
no extended zone for the X axis above
(only about .02 inches or
concern relating to long tools is {"lp~r~lnt'p
in the area, mcluding chuck
sure to those tools where the

• Corner Tip Detail


G5D setting for external farhe tools
Typical turning tool contains an indexable with a
• Internal Tool strength and surface finish When
command is used for a Lool that a
Internal tools are built-in, the programmer has to know (and also tell
inside of a part, in a premachined core or other operator), which edge corresponds to, In
Typically, we may first a boring bar, but cases, the choice is simple. value is mea-
can be used as well for various internal operations. For ex- program zero to the intersection of
ample, an internal and i nlemal threading are com- X and Z tool shape and
mon operations on a setup rules Ihe in the will vary. Figure
Z axis apply in the same way for internal tools as for exter- next page shows settings for the
nal lools of the same most common orientations of a a corner radius,
including two grooving tools.
Along the X axis, the position register setting must
be made to the tip the insert. Figure J6-6 • Programming Example
shows a typical setup for an internal 1001
(boring bar shown in 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 iIIuslrations 16-4, 16-5 and /6-6) chining center. First, the tool change is made, followed
a possible order operations (drill - tum - with G50 setting for the tool. When the machining
for a typical Note that the turret position is is with (ha( tool, it to return to the same absolute
identified as a tool position. not necessarily as position as specified in the The following sim-
machine zero That means G50 may be set plified example is two the fir.sl 1001 is pro-
where within of the machine, even at the ma- or",mnC'lPt1 to cut a the tool is programmed to
chine zero. cut a 2.5 inch diameter:
118 Chapter 16

Figure 16-7
Position setting G50 for common tool tip orientations - the heavy dot indicates XZ coordinates set by GSO X. Z. for the tool above

01602 Note blocks N2 and N7 first tool, and N 10 and


N1 TOlOO N 15 the second tool. For tool. pairs of
N2 GSO X?4S ZS.5 are exactly same. What program is
N3 G96 S400 M03
the system here is that block N2 only registers the
N4 GOO X2.? ZO TOlOl MOB
N5 GOl X-O.01 FO.OO? current tool position, but block N7 actuaJly returns that tool
N6 GOO ZO.l M09 to the same posilion it came from. For second tool.
N7 X7.4S ZS.5 TOlOO block NIO registers the current tool position, block N15
NB MOl forces the tool to return there.

N9 T0200 important blocks to together are the


NlO GSO XB.3 Z4.B blocks N7 and N 10. Block N7 is the tool change position
Nll G96 S425 M03 for the tool. block NIO is the tool register for
Nl2 GOO X2.S ZO.l T0202 MOB the toot - both tool are at the same physical position
Nl3 Z-1.75 FO.OOS of file turret! The difference in the XZ values reflects the
N14 GOO X2. 7 H09 difference in the projection of each tool from the
N15 X8.3 Z4.B T0200
N16 !rOO
turret station. All that is done G50 command is telling
% the control where currenr is from program zero -
always that in mjnd~
POSITION COMPENSATION

In this handbook, term is used in the same meaning


programming are expressed as as the majority of users interpret it. Ppsition compensation
than not, these numbers, can also be used for a limited replacement of the culler
well before the actual is not covered at all for its obsoles-
part programming, many are will be on positioning of the
exactly, others are known approximately and there t~"."r,"~ the part.

are also many that are not known at all known di-
mensions are subject to variations Without Like IJV~"LJ\.)" compensation is
facility available to (he it will that requires mput the CNC ma-
almost impossible to setup precisely and ef- specifies the
D .. An ..."' ..... ,.,,.," ..

ficiently. Fortunately, modem controls offer many features number, the operator enters
to both programming and machine an easier, machine, using appropriate
and more precise activity. A coordinate screens, setup.
offsets and compensations are typical support
in programming for • Programming Commands

One of the oldest programming l""".IJlIl ..... U~~;) available in and similar controls. there are four preparatory
is called a position As the available to program position com-
name suggests, using position functions, the
actual tool position is compensated to its Iheoreli-
or assumed position, increase in the programmed direction
compensation amount
It is only one of several methods available to
the programmer and machine On modern CNC decrease in the 1pro,gn,lmrne(
systems, this method is still compatibility with pensation amount
older programs. Today, this technique is not really needed. Double increase in the Iprogr~lmrne(
It been replaced by the much more flexible Work Off- G47 by double the compensation amount
sets (Work Coordin.ate Syslem), in the next chap-
ter handbook. The current chapter'describes some Double decrease in the programmed direclio1n I
G48 by double the compensation amount
typical programming can benefit from us-
ing the old-fashioned method.
definilions are based on
'- DESCRIPTION stored in the control
meaning of all
The maIn purpose compensation is to correct are inverted. None of
any difference between machine zero and program zero is and are
1001 positions. In it is in those cases, where which they appear. If required in
the distance between the two reference points is subject to \;;~";Lll\;;,U in any subsequent block, if
vanations or is not known at all. For example, when work-
ing with castings, the zero taken from the cast sur- • Programming Format
face will be subject to change. Using position
Each G code (G45 to G48) is with a unique
compensation will the need to make constant
position compensation number, programmed with the ad-
program of the fixture setup.
H. The H address points to the memory area storage
mally, the part in a fixture on the table
of the control system. On most Fanuc control sys-
whole setup is this reason, the position
tems. the programmed leuercan be D, with exactly the
compensation is called fixture offset or
same meaning. Whether the H or D is used in the
offset. The an offset and a cornlJ(!ns:a-
program, depends on the of a control system
lion is often and for any practical purposes,
parameter.
(Wo terms are sami!.
120

A typical programming format for position compensa- • Incremental Mode


tion function is:
The question may arise why the compensated motion [s
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-
or tance between machine zero and program zero. The normal
use is when starting the tooJ motion from machine zero po-
G9l GOO G45 X •• D .. sition. By default, and without any offsets, coordinate set-
tings or active compensations. the machine zero [s 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' allhe time,
storage area (using H or D address).
Take the following example of severa! blocks, typically
Note that the example uses incremental and rapid mOlion programmed at the beginning of a program with position
modes and only one axis. Normally, the compensation has compensation:
to be applied to bolh X and Y axes. However, only a single
measured amount can be stored under either H or D num- N1 G20
ber. Since it is most probable that the compensation value N2 G17 GSa Tal
will be different for each axis, it must be specified on sepa- N3 M06
N4 G90 GOO G45 XO H31 (NO x MOTION)
rate blocks, with two different offset numbers H (or offset N5 G45 YO H32 (NO Y MOTION)
numbers D), for example: N6

G91 GOO G45 x .. H31 (illl STORES THE X VALUE) This example illustrates a motion from machine zero (the
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 090 in block N4. Assume that the control system is set (0
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 VALOE) 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 offser (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 091,
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 G9 J only.
ples. more common address H will be used - Figure 17-J.
• Motion length Calculation
MACHINE Let's look a little closer at how the control system inter-
TABLE 1
'-....
11111--_ _ H31--- ZERO prets a position compensation block. Interpreting the way
how the control unit manipulates numbers is important for

T
understanding how a particular offset or compensation
works. Earlier definition has stated that a single increase is
programmed with G45 command and a single decrease
H32 with 046 command. Both G47 and G48 commands are of
no consequence at the moment. Since both commands are

J"'"
.\ _. _ _ ~ _ J
\ PART
tied up with a particular axis and with a unique H address,
all possible combinations available must be evaluated:
o Either an increase or a decrease is programmed
(G45 or G46)
PROGRAM ZERO o Axis target can have a lero value, or a positive value,
or a negative value
figure 17- 7 o Compensation amount may have a lero value,
Position compensation - general concept or a positive value, or a negative value
POSITION COMPENSATION 121

In programming. it is important to set cenain standards


and consistently abide by them. example, on vertical
machiningcenlers, the compensation is measured/rom ma- 9
ne zero to program zero. means a negative
lion from the operator's viewpoint.
decision 10 set
result is a
as
r
'-1 H99
It is cruc1al to understand how the control interprets 17
information in a block. In compensation, it evalu- "j,--
l .'
ales Ihe value in memory called by
D). If the value is zero. no compensation
address H (or
place. If the
13 ,
value of H is stored as a negative it adds this 10
the the axis position and the is the
motion length and direction. example, assume the
memory I stores value of -15.0 inches. and --15 ;-'"
machine current location is at zero position and
setting on Ihecontrol is also set to zero. Then the 17-2
Position compensation applied to different target locations:
G91 GOO G45 xo H31 zero, positive and negative - see 01701 program Pll::l'mn/I'!

will be interpreted as
Figure 1 shows for the following
-15.0 + 0 = -15.0000 example 701, The applies to the X and Y axes ex-
actly (he same way. In written in metric units and has
resulting the Iota I motion of negative \5.0 inches along tested on [ I M, the H address would
the X axis. the same way). The compensation values
and H99 were set to:
value of axis target is a non-zero and
the same formula H98
H99 = -150.000
G91 GOO G45 Xl.S H31
the X and Y axes respectively. The modal
will interpreted as were not repealed

-15.0 + 1.5 = -13.5000 01701 AND G46 TEST}


Nl G21 G17
However, next example is 1/01 correct: N2 G92 XO YO ZO
N3 G90 GOO G45 XO H98 (ABS xo TARGET)
G91 GOO G4S X-l.5 H31 N4 G46 YO H99 (ABS YO TARGET)
NS G28 XO YO
the motion will try 10 the X axis di-
N6 G91 GOO G45 XO H98 (INC' XO TARGET)
rection and result will be overtravel. Since [he N7 G46 YO H99 (INC' YO TARGET)
value of X is G45 command cannol be used and N8 G28 XO YO
G46 command must instead:
N9 G90 GOO G45 X9.0 H98 (ABS X+ TARGET)
G91 GOO G46 X-l.S H31 NlO G46 Y17.0 H99 (ABS Y+ TARGET)
Nl1 G28 XO YO
will be r",'or,,'/] as
N12 G91 GOO G4S X9.0 H98 X+
-15.0 + (-1.5) '" -15.0000 - 1.S 16.5000 N13 G46 Y17.0 H99 (INC' Y+ TARGET)
Nl4 G28 XO YO
G45 in the ....."" .. ":1',.....
value could been value. NlS G90 GOO G45 X-1S.O 898 (AES X- TARGET)
Nl6 G46 Y-13.0 H99 Y- TARGET)
could be quite confusing and N17 G28 XO YO
but it would work quite well. To see the possibili-
program 0 J70! is not dOl ng very much, exCCrl mov- Nle G91 GOO G4S X-1S.0 H98 (INC' X- TARGET)
ing from machine zero 10 different positions and back to Nl9 G46 Y-13.0 H99 (INCY-TARGET)
machine zero (G28 command refers 10 a machine zero re- N20 G28 XO YO
turn and is explained separately in Chapter 2/ ). N21 M30
%
122 17

control syslem will each motion block method is described in Chapter 19 of the handbook. If the
the way it was or the wrong way Z axis is programmed with G45 or G46 commands, i( will
(symbol orr means an condition, preceded WiLh also be affected.
the and direction of
• Using G41 and G48
N3 G90 -> G45 -> 0 no motion
N4 G90 -> G46 -> 0 no motion In the examples, compensation feature was used
N6 Gn -> G45 -> 0 X-2S0.0 only between the zero and program zero, as a
N7 G9l -> G46 -> 0 Y+ OIT method exactly is the part on
the table. The single mClrea~;e using G45 and the
N9 G90 -> G45 -> + X-241.0 crease using G46 were used, because
NlO G90 -> G46 -> + Y+ OjT
the only commands npPflP{"I
N12 G91 -> G4S -> + X-241. 0
Nl3 G9l -> G46 -> + Y+ Commands G47 (double increase) and G48 (double de~
crease) are only for a very simplified cutter ra-
Nl5 G90 -> G4.5 -> X+
Nl6 G90 Y-163.0 dius olfsel and are not covered in this handbook of
-> G46 ->
N1e G9l -> G45 -> X+ OjT their obsOlescence. However, they can still used.
Nl9 G91 -> G46 -> Y-163.0
• Face
• Position Compensation Along the Z axis In a later (Chapter 28), mill-
i ng wi II be explained in more detail. In thai chapter is a very
Position compensalion usually appl to the
X Y axes and will nol normally be used with the good example of how to apply position to
In most cases, the Z to be controlled by another offset the face mill in a regard-
of compensation known as the too/length This less of its This is probably the only use of
G45 and 046 commands in contemporary programming.
WORK OFFSETS

In position compensation, to switch machining


part to another within the same setup. the n1"I'''',,-';'rn
contain a different compensation number
zero of the previous part. Using the work
program zeros are measured from the machine zero
lion, normally up to six. but more are
The six work coordinate systems
are available on
Fanuc control
lowing preparatory commands:

When the control unit is


is normally
Basically, the work to independ-
the most modem methods to coor-
"'lU~I.n''-'' rl,r;.c{'nhlf'c
ent work areas as a values input into
relationship between machine zero reference the unit are measured from the ma-
the program zero reference point. We will use are up to six work
Work Coordinate System feature of any modern control zero positions can be
whether it is called the Work Coordinate System or relationships, using
the Work Offsets. lalter term seems to be more popular
because it is a little shorter. Think of the work offsets as an
alignment bctwcen two or more coordinate systems.
[X] MACHINE
WORK AREAS AVAILABLE ZERO

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
to a part away from the CNC machine, without
knowing its exact position on the machine table. is a
very SImIlar approach as in the position compensation
method, but much more advanced and flexible. In work
system, up to six parts may be set up on the machine
each having a different work offset number.
can move the tool from one part to with
aV"Vluc,-, ease. To achieve this goal, a preparatory AXES MOTION LIMITS
for the active work offset is needed in Figure 18·1
control system will do rest. Basic relationships of the work offset method
will automatically make any adjustment for
between the two part locations.
The same relationships illustrated for the def~ult
Un1ike the position cmnOlens:aU'OI apply exactly the same way for the other
more axes may be able work offsets 055 to G59. The values siored in the con-
offsets. although the Z trol system are always physically measured from the rna-
controlled independently, zero position 10 the program zero of the as
offset commands. Commands determined hy lhe CNC programmer.
are fully described in the next

12
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 J 8-2 shows the same part set with t.he older method jobs that may require machining with more program refer-
of G92 {lnd m{lchine zem a<; a ~tart point. Note the opposite ence points, for example, a multi-~irlerl part on a horizonttll
arrows designation. indicating (he 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, anyone of the 48 work offsets can be ac-
cessed by programming a special G code:
t GS4.1 P..
Selection of additional work offset,
>- where P = I 1048
N
0)
o (!) Q G54.1 P.. example:
PART l G54.1 Pl
G54.1 P2
Selection of additional work offset 1
Selection of additional work offset 2
PROGRAM\ GS4.1 P3 Selection of additional work cffset 3
ZERO \. G54 1 Px.. Selection of additional work offset x..
G54.1 P48 Selection of additional work offset 48
AXES MOTION UMITS
Figure 18-2
The utilization of additional work offsets in the program
is exactly the same as that of the standard commands:
Basic relationships of the Position Register cDmmand G92
N2 G90 GOO GS4.i Pi XS.S Y3.1 SlOOO 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 ponion 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 Pl X5.S Y3.1 S1000 M03

The presence of PI to P48 function within a block will


01 (GS4) select an w.1Ji/ional work offset. If tbe PI to P48 parameter
is missing, the default work offset command G54 will be
X -12.5543 selected by the control system.
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-
Typical data entry for the G54 work coordinate system
ically select G54 - that is the normal default selection. In
programming, it is always a good practice to program the
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
trol system selects the stored measured distances and the another. The machine operator will have a better feel for the
CUlling 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 the program, 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
startup block, usually at the head of program or at the be- The whole calculation is so consistent, il can be assigned
into a simple fonnula. For simplicity, the seuings of the
ginning of each tool:
EXT (external or common) offset are not included in the
N1 G17 G40 GBO G54 formula. but are explained separately. later in the chapter:

The most common application is to program the appro-


priate work offset G code in the same block as the first cut-
ting tool motion:
II3f' where ...
N40 GOO G90 G54 X5.5 Y3.1 SlSOO M03
A == Actual motion length (distance-to-go displayed)
M = Measured distance from machine zero
Figure J8-4 illustrates this concept. In (he above block
P == Programmed absolute target position (axis value)
N40, the absolute position of the tool has been established
as XS.5Y3.1, within the GS4 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:
.all G54 [X]--'
PLUS and PLUS becomes
a + (+ b) == a + b
PLUS

PLUS and MINUS becomes


a + (- b) = a - b
0--r MINUS
I 3. 1
WoJ+------'-----I _t MINUS and PLUS becomes
a - (-I- b) == a - b
1-- -5.5 --1 MINUS

MINUS and MINUS becomes


Figure 18-4 a - (- b) ::: a -I- b
Direct too/ motion to a given location using G54 work Dffset PLUS
Note thaI 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 10- negative calculation:
calion 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. If any 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-12.5543
and Y-7 .4462. The computer will determine (he actual mo- • Work Offset Change
tion by a simple calculation - it will always add the pro-
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. offsets available. In all mulli-offset cases, the work offset
setting stores the distance/rom the machine zero to the pro-
The actual tool motion in'the block N40 will be: gram zero 0/ the each part in the setup.
126 Chapter 18

For example, if there are three parts mounted on the table, Nt G56 XS.5 Y3.1 (SWITCH TO GS6)
each individual part will have its own program zero posi- NB GBO ZI.0 M09
lion associated with one work offset G code. N9 G9I G54 G2a ZO MOS (SWITCH TO GS4)
NlO MOl

r--- G56 X
,... G55X Blocks N3 through N5 relate to the tirst part, within the
G54X - 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 - it is only a sug-
gested good practice when the tool operation is completed,
The work offset selection is modal - take care of the transi-
I
tions between tools from one work offset to another.
i Bringing back the default offset G54 may always be helpful
at the end of each tool.
If all these blocks are in the same program, the control
unit will automatically determine the difference between
Figure 18-5
the current too! position and the same tool position within
Using multiple work offsets in one setup and one program. the next work offset. This is the greatest advantage of using
Three parts shown in the example,
work offsets - an advantage over the position compensation
and the position register alternatives. All mounted parts
Compare all possibJe motions in Figure 18-5:
may be identical or different from each other, as long as
(hey 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 theftrst part. So far, there was a conspicuous absence of the Z axis
from aU discussions relating to the work offset. That was no
G90 GOO GSS XO YO
accident - it was intentional. Although any selected work
... will rapid from the current tool position. 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 axis, The method used for Z axis is in the
G90 GOO GS6 XO YO form of G43 and GM commands that relate speci fically to
the too/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 chapler. In the majority of program-
ming applications, the work offset is used only within the
Of course, the target position does not have to be part zero Xy plane. This is a typicaJ control system selling and may
(program zero) as shown in the exampJe - nOr1liaJly, 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 exampJe will
illustrate that concept. (G54) X-S.76l Y-7.819 ZO
(GSS) X-1S.387 Y-14.122 zo
In the example, a single hole will be spot drilled on each (GS6) X-22.733 Y-8.3S2 zo
of the three parts to the calculated depth of Z-0.14 (pro- (GS7)
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
OlSOl of the part) does not change from one part to another, even
Nl G20 if the XY setting does.
N2 G17 G40 GSO
N3 G90 GS4 GOO XS.5 Y3.1 S1000 M03 (G54 USED) The only time there is a need to consider Z axis within the
N4 G43 ZO.l HOl ~8 work offset setting is in those cases, where the height of
NS G99 GB2 RO.l Z-O.14 P100 FB.O each part in the setup is different. So far, only the X Y posi~
N6 G55 X5. 5 Y3. 1 (SWITCH TO GSS) tions were considered, as they had been the ones changing.
WORK OFFSETS 127

If the 2 amouot changes as well, that change must be con~_ HORIZONTAL MACHINE APPLICATION
sidered by modifying the coordinate register selling of the
control. This is the responsibility of the CNC operator, but
the programmer can learn an important lesson as well. Machining several parts in a single setup is done quite
frequently on CNC vertical machining centers. The multi-
ple work offset concept is especially useful for CNC hori-
zontal machi ning 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
CNC horizontal machining center is a typical everyday
work in many companies. For this purpose, the work offset
selection is a welcome tool. For example, the program zero
at the pivot point of the indexing table can be set for the X
and Y axes. Program selling of the Z axis may be in the

~:!'~-:-Dr;c
,...----, - r
-- same position (the pivot point of the indexing table) or it
can be on the face of each indexed position - either choice is
acceptable. The work offset handles this application very
nicely, up to six faces with a standard range of the G codes.
G56 , G54
" _ _ M. ........ .. ................. "" . . . . .,

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 {Dr a variable part height chining applications. The only change is that the 2 axis will
be retracted (0 a clear position and the table indexing will
Figure 18-6 shows some typicaJ and common possibili- usually be programmed between the work offset change.
ties used for special parts that have a variable height within
the same tool setup. The difference between part heights
Figure 18-71l1ustrates a typical setting for four faces of a
has to be always known, either from the part drawing speci- part, where 20 is at the top of each part face. There could be
as many faces as there are table indexing positions. In ei-
fications or from actual measurements at the machine.
ther case, Ihe programming approach would be similar if
If the previous multi-offset example for XY setting are 20 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 axis surfacc for one part and thc mcasured 2
axis surface for the other parts. Based on the data in the pre-
vious example, combined with the 2 values shown in Fig-
ure 18-6, the control system settings may look like this:

(054) X-S.761 Y-7.819 ZO 8180


(GSS) X-lS.387 Y-14.122 Z-O.40S

~~8~,g
(056) X-22.733 Y-S.3S2 ZO.356

The important thing to know about the control of the Z -...j i I t:O
axis within the selected work offset is that It works in very 0,
- A
close conjunction with the tool length offset, discussed in 1""._ _-""-,""""--,-""-,""""""
the next chapler (Chapter 19). Stored amount of the Z axis 80
setting within a work offset will be applied to the actual tool
motion and used to adjust this malian, according (0 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 is measured as 2-10.0, the actual motion of such a
tool to the program zero along Z axis will be -10.0 Inches
within the 054 work offset, -10.408 within the G55 work Figure 18-7
offset. and -9.644 within the 056 offset - all using the ex-
Example of work offsets applied fo a horizontal machining center
amples in the previous illustration, shown in Figure J8-6.
128 Chapter 18

EXTERNAL WORK OFFSETS work offsets, as well as any additional


will be by the values set in the exter-
nal offset, based on the setting .
A careful look at a typical work screen display all programmable coordinate systems will
reveals one offset that is identified by one of the fol- name for special offset is Work or more
lowing often, the External Work Offset.
o 00 (EXT)
o 00 (COM) LATHE APPLICATIONS
The two zeros - 00 - that this work offset is not Originally, work coordinate ~ystem was designed f~r
one of the standard six G54-G59. offsets are CNC machining centers only. It did not take to apply It
identified by numbers 0 I 06. The designation to CNC lathes as well. The operation, logically and physi-
also implies that this is nol a programmable at least is identical to that for machining centers. work
not by using the CNC program~ing . offsets CNC lathes eliminates awkward use
Fanuc Macro B option allow programming thIS or (;92 and makes the lathe setup operation much
The abbreviation EXT means External, the abbrevia- and
tion COM means Common. machine will have
one or the other but not both. a maHer of • Types of Offsets
curiosity, the COM designation is found on older main difference in applying work offsets on a is
UJ!'!'''I"I-'r\v the EXT designation is more recent. The
that seldom will there a need for more than one
With computer market, COM offset. work offsets are a possibility, three or more are
abbreviation become facto standard abbreviation used for some special and complex G54 to
for the word communications. Fanuc also sup- commands are available on all modern lathes
several communication methods, including the con- customary to ignore the work
with a personal computer, some time ago, COM in program, more !han one offset is
designation has replaced with the designation means the CNC lathe programmer on the
EXT, to prevent possible confusion between the two G54 setting as a rule.
viations in computing.
Two special offset features found on the control
Either ahhreviation to the same and has the systems nre (he Geometry Wear offsets, on the
same purpose. On screen this special is same screen dispJay, or on screens, depending on
usually located before or above for G54. ex- the control model.
ample, as illustrated in Figure 18-8:
• Geometry Offset
00 (EXT) 01 (G54) Geomerry is the equivalent of a
known from milling controls. It rpl"lf"PCf'ntc
X 0.0000 X -12.5543 tool reference poinllo program zero, measured from
the zero along a selected Typically, on a
Y 0.0000 Y 7.4462 bed CNC lathes, with the tool turret above the spindle cen-
0.0000 Z 0.0000 terline, the geometry offset both X and Z axes will be
negative. Figure /8-9 illustrates reasonable geometry val-
ues for a drill, turning tool and bar (TO I , T03).
of an feXl'emi~IJ work offset display (EXT ::::: COM)
t:){tlll/ul/::
GEOMETRY OFFSET
difference between an or common No.. X _. _TIP'
_ ...1
work is that it is not programmable with any particu-
G code. ly set to zero for all axes. 01 . 0.0000 0
Any nOll-zero work offset in a very 02' -8.6470 0.0469 3
important way: -9,0720 0.0313 2
04 0.0000 0,0000 0
05 0.0000 0.0000 a
18·9
Typical data emries 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 GSO regis-
ter method (position register command used in the pro-
On the CNC lathes, the purpose of the wear ofrsel is iden-
gram). Compare the TWO illustrations!
tical to that for machining 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 posicion measuring.
for a given tool is set, lhat setting should be Jeft unchanged. All illustrations in the applications also match the reason-
Any adjuslments and fine lunillg of actual pan dimensions able data entered In the too! 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), lypical values along the Z axis are
No.j X OFFSET. Z OFFSET RADIUS TIP usually negative. A positive value is also possible, but thaI
_M··t
means the tool is above work and tool changing can be very
01 0.0000 0.0000 0.0000 0 dangerous. Watch OUf for such situations'!
02 -0.0060 0.0000 0.0469 3
0.0000 0.0040 0.0313 2 The actual selling procedures are subject of a CNC ma-
03
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- 70 tools relative to the mas/er tool.
Typical data entries for a lathe tool WEAR offset
• Center line Tools
Figure J8-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-
seHings appear in both displays and the display in both
ing. This area covers all center drills, spot drills, various
screens is automalic after the oifset value input. The tool
drills, reamers, laps, 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.
their tool tip does not normally lie on the spindle center line
during machining. Center line tools are always measured
• Tool and Offset Numbers
from the center tine of the tool to the center I ine of the spin-
Just like tools on CNC machining centers have numbers, 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, 1'0404: TURRET AT
TOOL CHANGE POSITION
o The first two digits select the tool indexing station (turret
station) and the geometry offset number. There is no T01
choice here. Tool in station 4, for example, will also use GEOM (Z)
geometry offset number 4.
o 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
~
Depending on the control model and the display screen ~
size. the tool offset register may have a separate screen dis- o
LU
play (page) for (he 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-1 7
Typical geometry offset setting for CENTER liNE tools
130 Chapter 18

• Turning Tools • Boring Tools


Turning tools - or Boring tools - or tools - are measured
imaginary tool tip to program zero, the imaginary tip to program zero, along the X
a negative diameter) and along the Z axis (typically as a diameter) along the Z axis,
ative as well. Keep in if the culling tool typically as a value as well. In majority of cases.
sen (for turning or boring) is changed from one radius to the X value of a boring tool will
another radius in the same Lool holder, the setup that for a turning or other
change marginal,
change is enough to cause a scrap, so a boring operations, same as for turning operations,
good care is For turning, be extra careful for a tool also be extra for a lool nose that changes
nose thaLchanges from a larger to a smaller from a larger to a smaller It is (he same as a
for example, from 3/64 (RO.0469) to lJ32 (RO.03l turning 1001. The scrap can be made very easily.

• Command Point and Tool Work Offset


TURRET AT
CHANGE POSITION various reasons, it is quite common to
ting insert in the of work. primarily to fa-
vorable CULLing conditions and to keep dimensional toler-
ances within drawing specifications. Cutting inserts are
(0 very high but a certain
anee devialion should be expected between inserts ob-
tained from different sources. If changing an it is
to adjust the wear for precision work. in order
to prevem the part.
Tool inserlS of same shape and but
with a different nose radius. Always cautious when re-
an insert with an that has a
tool nose radius. to be
by the proper amount.
Figure 18·12
geometry offset setting for EXTERNAL tools
··0.0016 -1~- 0.0016
Figure 18-12 a typical geometry for a
turning (external) tool and Figure 18-13 illustrates a typical
geometry setting

TOOL
a boring (internal) tool.
RO.0156 RO.0313

b J
I

GEOM (2) 0.0136 0.01

Figure 18·14
Setting error caused by a different insert radius in the same holder

example in Figure for a


1/32 ( .0313) nose radius (middle). and the error for
a radius that is (left) and one that is larger (right).
The dimensions the amount for the partic-
ular in the example.

Figure 18·13
Typica/g8ometry offset setting for INTERNAL tools
TOOL LENGTH OFFSET

far. we have looked at two methods of compensation out, the rest is hidden in the holder. tool holder is
for the actual position of the cutting tool in relation to the mounted in by means of a standardized tooling
machine reference point. One method was the type, Tool designations. such as the common sizes
position compensation, the other was the contempo- HSK63, HSKlOO, BT40 and are examples of es-
rary work coordinate system method (work offset). In both tablished European Any tool
cases, the emphasis was only on the X and Y axes, not on 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 isjust one more precision fea-
with method, would not have been very ture built inlo the CNC machine.
practical. main reason is the nature of CNC work.
length of a tool for the purposes CNC program-
decides on setup of a part in ming must always be associated wilh the tool holder and in
the fixture appropriate location of XYZ relation to machine design. For that purpose, manufac-
program z.ero (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 zero position. By a
strict definition, the same rule applies (0 the Z The • Gauge Une
major is that the measured values will re-
main unchanged for all tools, whether there is one tool used When the 1001 holder with the cutting lool is mounted in
or one hundred tools. That is not the case with the Z the spindle of a CNC machine, own taper is mounted
against an opposite taper in the spindle and held in tightly
The reason? tool has a different length. by a pullbar. The precision manufacturing allows for a
constant location of the tool holder (any tool holder) in
GENERAL PRINCIPLES spindle. position is used for reference and is com-
called the gauge line. the name it is an
line for
The length of cutting tool has to be accounted for in Figure 19-1.
every program for a CNC machinIng center. Since (he
earliest applications of numerical control, various tech~
niques of programming tool length have They
GAUGE LINE
belong into one of two basic groups:
AT MACHINE w
()
o Actual tool length is known «
I.L
a Actual tool length is unknown
Needless to say, each group requires its own unique pro-
gramming technique. To understand concept of tool
t W
.J

.
SPINDLE co
length in CNC programming, it is important to understand MOTION «
I-;-
meaning of the phrase actual length. This length is I

known as the physical tool length or just tool


length and has a very specific meaning in CNC program-
ming and setup.
Fjgure 19-1
• Actual T001 length Typical front view CNC vertical machining center
tool By holding a typical
drill, we can physical length with a measuring We use the gauge line for accurate measuring of lOa!
device. In human terms, a six inch long drill has a length of length and tool mali on along the Z axis. Gauge is
inches, measured from one to the other. In CNC by machine manufacturer is closely re-
programming that is still true, but not quite as relevant. A lated to another precision face, called the machine rabIe,
drill - or of her cutting 1001 - is normally mounted in a
actually, the table top face. The gauge Ii ne is one of a
tool holder and only a portion of the actual tool projects that is with another plane - table

131.
132 Chapter 19

• labia lop Face is also a convenient block to add coolant function


Every machining center a built-in machine ta- MOS for the current tool:
on which the fixture and part are mounted. Top of the
N66 043 Zl.O H04 MUS
table is precision to flatness and
for located The resulting motion in the example will be to 1.0 inch
In addition, the table is located a certain fixed distance above part zero. The control system will calculate the
from the gauge line. like the position of tool holder distance to go, based on the value of H offset stored by the
in the spindle cannot be changed, the position of table operator during setup.
for a removable table using a palette system) cannot /9-2 shows a Lypical screen for the tool length
be of the table creates another
reference plane that is related to the line and parallel
to il as well. This arrangement allows to accurately pro- TOOL OFFSET (LENGTH)
gram a tool motion along the Z
No. GEOMETRY WEAR
The tool length offset (compensation) can be defined: 001 -6.7430 0.0000
002 8970 0.0000
003 -7.4700 0.0000
004 0.0000 0.0000
005 0.0000 0.0000
The most significant benefit of tool length in CNC 006 0.0000 0.0000
programming is that it enables programmer to design a
complete program. using as many tools as necessary. with-
out actually knowing the actual length of any Figure 79·2
Typical too/length offset entry screen
TOOL lENGTH OFFSET COMMANDS set entry. Note that the actual display will vary from one
control to and the wear offset may not be
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 adjustments to tMllength as a separate screen entry.
G commands:
044 command is hardly ever used in a program - in
fact. it has the dubious distinction of being the least used
commands of all Fanuc G codes. Its comparison with G43
All three commands are only applicable to the Z is described later in this chapter.
Unlike the work offset commands G54-G59, G43 or G44
cannot without a further specification. They can Many CNC programmers and operators may not reaJize
only be used wilh an offset number designated by the that the Z axis setting in a work offset (054-G59) is
dress The address H mUSI be followed by up 10 three vel)' important for the tool offset. The reason why
digits, on the number of offsets available within will be clear in the coming descriptions of different meth-
the ods of 1001 length setting.
programming manuals suggest the or
G43 G46 commands can also used for tool length offset. Al-
G44 offset though this is still (rue Loday and may have had some
in the early days, il is best to avoid them. First, the
G49 position commands are not used very much anymore and,
HOD offset cancel second. they can be used with the X and Y axes and do
not truly represent the Z axis
H.. Tool length offset number selection
• Distance-lo-Go in Z Axis
Tool length offset should always programmed in the In order to interpret how the CNC system uses tool
absolute mode G90. A typical program entry will be the length command, the programmer or operator should
043 or 044 command, followed by the Z axis able 10 calculate distance-fo-go the cutting tool. The
tion and the H number: logic behind the tool length is simple:
N66 G43 Zl.O H04
TOOL LENGTH 1

a The value of the H offset will be added \0 the target Z position G43 z-O. 625 H07 .....
if G43 is used, because G43 is defined as the positive tool
length offset 054 along Z is set to 0.0500, Z axis target is -0.625
o The value of the Hoffset will subtracted from the target the H07 is -8.28. The distance-to-go calculation uses the
Z position if G44 is used, G44 is defined as the same fonnula. but with values:
negative tool length offset
Za == (+0.05) + (-0. + (-8.28)
target position in cases is the absolute Z = 0 . 05 - O. 625 - 8 ~ 28
COOirQulate in the prognun. Z setting of the == -8.855
(G54-G59), the H value, the Z axis target are all
,_ ....- distance-to-go. can accurately calculated. Again., the fonnula works and can be used
control system will use any distance-to-go calculation along the Z axis. '"'yr.....n_

mentmlg with other settings may be useful.

Zd :::: Wz + +H TOOL lENGTH SETUP


S' where ...
of a tool used for (consisting of the
= Distance-to-go along Z axis and the tool holder), can be set directly on the
Work coordinate value U"\.,~1.J.J.L'" or away from it. These setup options are of-
~ position in Z (Z coordinate) on-machine or off-machine tool length setups.
H of the applied H offset number an advantage and it corresponding
disadvantage. They both share a relationship to the
e Example - Wz = 0: as it applies to the tool or its pro-
two setup options are to
G43 ZO.l H01 ..... where: and often cause (or at
some friendly disagreements) progrnm-
G54 Z is set to lO, Z axis '"''"'"..........'... is 0.1 and HO 1 each setup option its advan-
is set to then the distance-to-go will disadvantages. Which one appears to be
will depend on many factors as well.
~ == 0 + (+0.1) + (-6.743)
o + 0.1 - 6.743 options require involvement of two people, or at
::::: -6.643 least two professional skills - the CNe programmer and the
CNe operator. The question narrows down to who is going
The distance-lo-go will be to do what when. To be fair, both have to do
In sure the fomru1a is always correct, try to something. programmer has to •__ ~~, T

tools their number (the T address)


offset for G43 or the H ad-
e Example Wr = 0.0200: dress operator to physically set the
register the measured values of H
In this ,,"'..... i}, ....., the program contains CNC system memory,
G43 Zl. 0 H03 ..... where: • On-Machine Tool length Setting
Z is set to 0.0200, Z axis is .0 and the the bulk: of on-machine re-
value of H03 is CNe operator. Typically,
places a tool spindle and measures the d1S~t.an(~e
~ = (+0.02) + (+1.0) + (-7.41) tool travels from machine zero to part 'Zero (nf',nor~m
= 0 . 02 + 1.0 - 7.47 This work can only done between jobs definItely
"'" -6.45 nonproductive. It can justified under
stances, jobbing shops and jobs
The result is ",.., ...."""l"1t the tool will travel or for with very few people. Although the
towards the distance-to-go will setting of a number of tools will take longer
In the last a negative target IJU"......'-,.u is than setting a tools, there are setup methods avail-
able to the CNe that allow reasonably speedy
e Example - Wz 0.0500: on-mach ine tool setup, namely using the master tool

The program contalns a negative Z coordinate: -' method, descnbed


efit of this
in this section. The one major ben-
it does not require
additional a skilled person to op.:!ralte
\
1 Chapter 19

• Off-Machine Tool length Setting The figure a common setup a CNC vertical
In technical terms~ the off-machine 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. column is located
seltln o is done away from the machine, a special equipment a1 machine zero position. This limit switch
is req~ired, adding to overall cost of manufacturing. tion positive Z axis travel and is necessary for the auto-
This equipment can a simple fixture with a height gage tool change on vil1ually all machining centers. All
(even made or a more expensive, commercially four illustrated dimensions are either known, can found
available digital display device. in various instruction or service manuals, or can be physi-
cally They are always considered as known
• Tool Length Offset Value Register or dimensions and used as critical
for uceurate machine
Whichever method the tool length setting is used, it Q Distance between the tool gauge line and
U\JI., ....... '" a value that represents the length the the tool cutting point
selected lOol. This value is by and must be
somehow supplied to the program, before the job is ma- ... dimension A in the illustration
chined. The must register meusured value into
the system, the heading on the control panel. Q Distance between the tool cutting point and the ZO
(program zero of the part)
The control syslem contains a special registry for the tool
usually under of tool set- '" dimension B in the illustration
length o.{fset, toollenglh compensation off Q of the part (distance between
of the exact heading, the sellmg procedure the table and ZO of part)
measured length is entered into Ihe con-
trol, so it can by the program. The ... dimension C in fhe iJlustration
is always well within Z aXIs travel limits of the ma-
Q Total of all three previous dimensions
chine. yet still allows for clearances for the part (distance between the tool gauge line and the table top}
and the tool Chan2,f:S.
To the tool length offset, try to fully ... dimension Din the illustration
stand theZ motion geometry orthe machine It is rather rare that the programmer or the operator would
first. On vertical and horizontal machining centers, look at always know all four dimensions. Even If that were possi-
1he XZ plane, which is the top part for both. The ble, some calculations would not be worthwhile The
pies are identical, but will be on the 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 known,


cause it is distance determined by the machme manu-
facturer. It not possible to know the C
To understand the general principles of tool length (height of part with clearances), but with planning
let's look at the schematic illustration of a typical for common setup, this dimension can be known as well.
a vertical machining center - Figure
That leaves A - the between the (001
gauge line and the tool cutting point. There is no ~ther
LINE method to find this dimension, but to actually measure It. In
'i 1- - earller of numerical control, this A had to
r
MACHINE ZERO
A always known embedded in the program. D<;;;""a'J"""
of the inconvenIences involved in finding this dimension,
Olher methods have later.
0 Today, three methods are considered in programming
B length setup, including the original method:
I
Q Preset tool method is the original method
... it is based on an external tool setting device
Q Touch-off method is the most common method
"-..Y' it is on the measurement at the ma,r.mfle
Figure 19-3 o Master tool method is the most efficient method
Z axis relatio