Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
325 views

Computer Numerical Control Programming PDF

Uploaded by

Manu IC
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
325 views

Computer Numerical Control Programming PDF

Uploaded by

Manu IC
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 317
B Vaqe Computer Numerical Control Programming Computer Numerical Control Programming Michael Sava Joseph Pusztai Humber College, Toronto, Canada 2g Prentice-Hall International, Inc. TS a? 0-13-172800-8 S3 c.\ Loe O- Ins cation may be sold only he srivsonmipnat ty Prone tal te fhe resexporied ad it 1s not forsale ‘or Canada 6 199) by Prentice-Hall, lie AA Division of Simon & Schuster Englewoue Clits, New Jersey 07082 All rights reserved. Nu patt of this hook may be produced, in any form oF by siny MICS ‘eithout permission in writing fret the publisker Printed in the United States of Amerie woe Te S482 1 ISBN Q-13-172a00-8 Prentive-Hall latemnational (UK) Limited Lontis Prentice-Hall of Aaniaia Pay. Limited, Syd Prontioe Hall Cana Toronto eentice-Hall Hispanoamericana, S.A, Mevive Prentice-Hall ot Enda Private Viated), New Delhi Prentice-Hall of Japan, Ine. Tako non & Schuster Asia Pte. Ltd. Singapore Euitora Prentice-Hall Do Brasil, Ltda. Rio de fancier: Prentice-Hall, Ine.. Englewood Chis, New Jersey Contents PREFACE Chapter 1 TRENDS INCNC 1 Chapter 2 MATHEMATICS FOR COMPUTER NUMERICAL CONTROL 5 2.1. ‘The Numerics that CNC Machine Tools Understand, 5 Numbcring Systems: Decimal and Binary Number System, 7 Binary-Coded-Decimal Code (BCD), 14 CNC Tapes. 16 ‘Tape Punching Facilites, 18 2.3.1 Interfacing a PC to a Tape Punch, 19 2.4 Magnetic Tape Codes, 22 2.5 Mathematics for the Programmer, 22 2.5.1 Cartesian Coordinate System, 23 25.2 Polar Coordinate System, 24 2.6 Trigonometric Functions, 27 2.6.1. Pythagorean Theorem, 27 2.6.2 Similar Triangles, 27 2.6.3 Sine and Cosine Functions, 27 2.6.4 Tangent and Cotangent Functions, 28 2.6.5 Angular Relationships Between Trigonometric Functions, 28 a vi Contents Oblique ‘Tria Analytic Geometry, 30) 1 Equation of a Straight Line, 30) 8.2 Equation of Circle. 31 Intersection of Two Lines, 32 St Intersection of a Cirele and a Line. 33 8.5. Intersection of Two Circles. M4 ponometric Formulas, 36 9.4 Cutter Centerline Intersection Point of s Line Parallel with the X-Asis (Z for Lathe) and Line at an Angle Measured from the First Line. 86 9.2. Cutter Centerline Intersection Point of 2 Line Parallel to the Y-Axts (X for Lathe) and a Line at an Angle Measured trom the X-Awis, 37 2.9.3 Cutter Centerline Interscetion Point of Two Lines, 37 9.4 Cutter Centerline Intersection Point of a Line and a Cirete. 38 9.5 Cutter Centerline Intersection Point of a Cirele and a Line, 39 6 Cutter Taterseetion Point of a Line nt 4 Fwo Circles, 40 Unit Vectors and Direction Cosines. 40° Understanding the Fundamentals of Interpolation, 12 Chapter 3 COMPUTER NUMERICAL CONTROL SYSTEMS 46 Open-Loop Servodtives. 46 Closed-Loop Servodrives. 47 Velocity Feedback, 49 Point-to-Point Positioning Control. 32 Systems. 53 Straight-Cut Position Contouring, or Continuous Path CNC Systems. 55) Advanced ONC. 56 Binary Cutter Location (BCL). 60 Chapter 4 MACHINING FORCES 63 4.LL Cutting Speed (Ve, 65 1.1.2 Rate of Metal Removal, (Qu, 4 4.1.3. Florsepower at Spindle, 65 414 an Forque on Spindle due to Drilling (Ps). 68 5 Machining Tame. 64 Curning. 06 4.2.1 Cutting Speed (V1). 66 13.2 Rate of Metal Removal (01). 66 Contents vil 4.2.3. Horsepower, 67 4.2.4 Torque on Headstock due to Turning, 67 42.5 Surface Roughness, 67 4.2.6 Acceleration and Deceleration Distance for Thread Turning, 68 4.3, Milling, 69 4.3.1 Cutting Speed (Vim), 69 4.3.2. Rate of Metal Removal (Qin), 70 4.3.3 Horsepower, 70 4.3.4. Torque on Spindle. 70 Chapter 5 CUTTER CENTERLINE PROGRAMMING 71 5.1 Caleulating Cutter Centerline Distances. 73 1 Machine Part Surface “A” Between Point 1 and Point 2, 75 2 Machine part Surface “B” to Point 3 and Arc to Point 4, 76 4 Machine Part Surface “C” from Point 4 to Point 5, 79 -4 Machine Surface “D" from Point 5 to Point 6, 79 5 Machine Surface “E” to Point 7, 81 6 7 8 Machine Surface “F" from Point 7 to Point 8, 81 Machine Surface “G” from Point $ to Point 9, 81 Return Tool to the Machine Zero (“Home™) Position, 82 5.2. Tool Nose Radius Centerline Calculations for CNC Turning, 82 Start Up, 84 Move Tool to Point 2, 85 Turn Tapered Surface from Point 2 to Point 3. 86 ‘Turn 2.5-inch Diameter to Point 3 and 0.2-inch Radius to Point 5. 87 Turn Face to Dimension 1.8 inches and 4.0-inch Diameter to Point 6, Diam- eter to Point 7, and Tapered Surface to Point 8, 88 Chapter 6 TOOLOFFSETS 93 6.1, Tool Offset Codes Used for Too! Length Compensation. 94 6.2 Tool Offsets Used for Positioning of Fixture or Part. 97 6.3 Tool Offsets Used in Multiple Part Machining, 99 64 Tool Offsets Used in Diameter Compensation, 100 Chapter 7 CUTTER DIAMETER COMPENSATION AND TNR COMPENSATION: PROGRAMMING THE WORK SURFACE 101 7.1 Cutter Diameter Compensation, 101 71-1 Cutter Diameter Compensation Left—Gel (Exumple in inches). 102 712 Cutter Diameter Compensation Left—(Metric Example), 107 7.1.3. Cutter Diameter Compensation Right—G42, 110 Bu 82 83 a 10 10, 4 6 vi Contents ‘Tool Nose Radius Compensation, 111 2.1 Setting Up Tool Nose Radius Compensation, 114 32 Canceling the Compenvation—Ga0, 115 23. Tool Nose Radius Compensation Left —Gal, 116 24 7 7 1 7.2.4 Tool Nose Radius Compensation Right—G42, 117 Chapter 8 TOOL LENGTH COMPENSATION 119 ‘Tool Length Compensation Away from the Part—G43, 120 “Too! Length Compensation Toward the Part—G44, 121 Tool Length Compensation Cancelation G49, 122 Chapter 3 CANNED CYCLES 123 Fixed Canned Cycle Programming, 124 9.1.1 Machining Centers, Vertical or Horizontal. (24 9.1.2. Turning Centers, 137 9.1.3 Canned Cycles. 138 9.1.4 Multiple Repetitive Cyeles, 148 OLS. ‘Thread Cutting, 160 Chapter 10 OTHER CNC FEATURES = 171 Subroutine Programming. 171 Safety (Crash) Zone Programming, 174 Chapter 14 USER MACROS] =177 Definition of « Macro Variable. 178 Command Transfer: Program Flow Statements, 179 Custom Macros, 182 11.3.1 Subroutine Programming, 182 [13.2 Part Coordinate S¢ Ist 313.3. Custom Macro, 185 TERA Overview of variables, 186 Hole Cirele Pattern Application Drill Macro, 188 Outside Contour Milling Application Hexagon Macro, 190 Inside Contour Milling Application Pocket Macro, 195 118 a 122 123 124 12s 126 RI Rs 129 12.10 12.0 Contents ix Family of Parts Programming—Lathe Macro, 201 Slot Milling Application Cincinnati Milacron 850/950, 206 Chapter 12 COMPUTERIZED CNC = 210 Computerized Systems for Part Programming, 212 Selecting a Computer-Aided Programming Language, 213 ‘The Programming Process. 214 ‘The Part Geometry, 215 12.4.1 The Point, 215 12.4.2 The Line, 217 12.4.3. The Circle, 220 ‘Tool or Cutter Statements, 222 Motion Statements, 222 Compact I Milling—Sample Programs, 222 12.7.1 Example, 223 12.7.2 Example, 235 Compact I Turning—Sample Program, 242 12.8.1 Example, 242 12.8.2 Solution, 243 12.83 Writing the Part Program, 245, APT Part Programming, 252 12.9.1 Complete Listing of APT Source Program, 255 12.9.2 Machine Control Unit Data (Tape File) Corresponding to APT Source Program, 257 Cad-Cam Part Programming, 261 12.1.1, EQINOX Input/Output, 264 1210.2 EOINOX Solutions, 267 1210.3 EQENOX Output Program, 274 12.104 EQINOX Output Tape File, 276 In-Process Gaging, 279 12.11.1 Deviation Probing or Measurement, 281 12.112 Comparative Probing or Measurement, 283, 12.113 Center Measurement, 285 x Contents, APPENDIX A Table A-1 Miscellaneous Funetions (M Codes), 288 lable A-2 Preparatory Functions (G Coles), 291 ‘Table A-3 Preparatory Funetions (G Codes}, 293 Preparatory Funetions (G Cradles). 295 INDEX 297 Preface Islands of automation have brought about more changes in manufacturing in the last 5 years than in the previous 40 years, Microprocessors and computers now assist and direct more than 80 percent of our manufacturing processes, from design, through production engineering, to manufacturing and sales. The principles of CNC technology have been extended to the manufacturing industry at large from manufacturing cells and flexible manufacturing systems to the total concept of computer integrated flexible manufacturing (CIFM). Our pre- sent-day manufacturing systems are integrated with automatically guided vehicles (AGVs) and robotics, which can also be programmed off-line using standard, CNC- like languages The people who work in this environment face a continuous process of up- dating as the new technology unfolds. Learning must be regarded as a long-term investment. It is @ proven fact that there is a substantial cost associated with lack of training, in poor quality, costly accidents, low morale, and unacceptably low productivity, The greatest challenge faced by educators is training for a manufac- turing environment metamorphosed by a revolutionary technology ‘This text covers concepts and fundamentals, manual programming, offsets, compensation, canned cycles, and other standard features. In addition, it carries ‘out extensive coverage of the very latest computer-aided programming. The soft- ware described is used extensively by industry and educational institutions. The high potential of user macros is explored as well through detailed programs and explanations, and the reader will get a better perception of the exceptional capa: bilities of a shop floor system. Probing is discussed in detail through practical examples, leading into in-process gaging. The appendixes are a collection of the xi xii Preface most useful codes. Rather than using photographs, this new book uses drawings snd sketches in order to provide the interested reader with workin; “able 10 most current systems. The contents ave structured in response to an extensive market survey. The “fundamental” part of the book is written for industrial technology. engineering technology. undergraduate students, junior colleges, and trade schools, ay well as for technicians and operators in industry, or for use in courses offered by machine tool manufacturers and distributors, The “advanced” part is a natural followup of the fundamental part. The chapters dealing with user macros. parametric subrou- tines, computer graphics, and probing, ete.. are a unique collection of typi programs. They can be taught as a second-level course. enhanced by applicable questions and problems. The material is introduced inerementally, and the chapters are self-contained with respect to the new material presented. Interesting problems are presented and solved, such ay the interfacing of a PC with a tape punch All the progeams in this book were tested on equipment, ‘The extensive programming content has been checked and rechecked. ‘The reader encouraged fo pretest any program using normal safety procedures ‘The authors wish to thank all the readers of Computer Numerical Controt Progranuning who took the time and made the effort to contribute numerous suggestions based on their field experience. The various chapters are now concluded swith problems and assignments, and an Instructor's Guide ineludes suggestions and answers to the various assignments. We would like to acknowledge the many people who have originated the new knowledge, or made it available for inclusion in this book, We would like to express our appreciation to the support afforded advanced technology by the progressive administrators of Humber College. We wish to thank our colleagues, friends, past and present students from the college system. the manufacturing industry. and the machine-tool distributors for their help, cooperation, information contributed or useful suggestions. Some names that come to mind, by no means all, are Ken Pallery, Vice President Manufacturing, and 1, “Hank” Ankurs. CNC Manager, McDonnell Douglas of Canada: Andrew Orton and William Kwong from the Technology Division at Humber Coltege: Steve Pereira. Saley Manager. Ferro twehnique Lid; Ray White, General Manager, Cincinnati Milucron Canada, and Mike Jackson. Cincinnati Milaeron, Ine, We are most grateful to the Prentice-Hall editorial group for their continuous encouragement and long-distance support, And finally. we thank Livia Pusztai and Rena Sava, for putting up with more of the same, for so many years formation. not casily available, yet appl ix. however, Michael Sava Joseph Passat Computer Numerical Control Programming Trends in CNC The evolution of the machine tool industry could hardly be appreciated without a brief review of its birth and growth. John Wilkinson built his metal-cutting boring machine in the eighteenth century, but nearly two centuries of evolution were needed to produce the hydraulic tracer-controlied copy mills and lathes. The next stage, automation, was brought about by mass production of automobiles, agri cultural implements, household appliances, chemical products, as well as inventory and financial data handling. Three kinds of automation met the needs of society for a major part of the twentieth century: 1. Automotive or fixed assembly line automation (Detroit type), 2, Process control automation, primarily used in the manufacture of chemical and food products, 3. Data processing, first developed for processing payrolls, data collection, and inventory control. ‘The Second World War marked the turning point in the ability of the metal- cutting industry to cope with the requirements facing it, The ambitious aircraft and missile projects of the U.S. Air Force, combined with the demands for commercial jets, made it quite clear that conventional manufacturing could not fulfill future needs. A study of the U.S. government showed that the combined resources of 1 2 Trends in CNC Chap. 1 the entire U.S, metal- by the Air Force alone. Under contract to the U.S. Air Force. the Parsons Corporation undertook the development of a flexible. dynamic manufacturing system, designed to maxi- mize productivity by emphasizing details required to achieve desired accuracies. ‘This system would allow design changes without costly moditieations to tooling, and fixturing, and it would fit into a modern, productive manufacturing manage- ment for small-to-medium sized production runs. The Parsons Corporation sub- contracted the development of the contro! system to the Massachusetts Institute ‘of Technology (MIT) in 1951. A control, which could be applicable to a wide variety of machine tools, would drive a slide lead screw through un interface. as instructed by the output of a computer. MIT met the challenge successfully and in 1952 demonstrated a Cincinnati Hydrotel milling machine equipped with the new technology, which was named Numerical Control (NC) and used a prepunched tape as the input media. Since 1952. practically every machine tool manufacturer in the Western World has converted part or all of its product to NC. The first NC machines used vacuum tubes, electrical relays. and complicated machine-control interfaces. The second generation of machines utilized improved miniature electronic tubes and, later, solid-state circuits. As computer technology improved, NC underwent one of the most rapid changes known in history. The third generation used much-improved integrated circuits, Computer hardware be- came progressively less expensive and more reliable, and NC control builders troduced for the first time Read Only Memory (ROM) technology. ROM was typically used for program storage in special-purpose applications, leading to the appearance of the computer numerical control (CNC) system, CNC was successfully introduced to practically every manufacturing process. Drilling, milling, and turning were performed on “machining centers” and “turning centers.” CNC took over glass cutting, pattern making, electrical discharge machining, steel-mill roll grind- 1g, coordinate measuring, electron beam welding, tube bending. drafting, printed circuit manufacturing. coil winding. functional testing, robots, and many other processes. ‘A set of preprogrammed subroutines. named “canned cycles,” were devel- oped for use in routine operations. They were recorded into the ROMs and re- mained there even after power was shut off, For the first time, this concept made it possible to read the machining program into memory and to operate the machine from memory. In addition to the advan rroncous tape reading disappeared. ‘Along with the many canned cycle options, CNC builders introduced dispkays for visual editing of part programs in memory. Various in-cycle problems generated alarms and hundreds of diagnostic messages which could be displayed as applicable. Practically every function of the machine was tied into the system and monitored during operation. A constant surface speed control was incorporated into the lathe controllers and continuously anticipated the most efficient spindle speed for the next cut to minimize time lost for spindle acceleration. ‘The conventional linear cutting industry in 1947 could not produce the parts needed 1es of editing. the problems caused by Trends in CNC Chap. 1 3 and circular interpolation in cartesian (rectangular) coordinates were supplemented by polar coordinates and helical interpolation. Safe zones, which could be set through programmed codes or internal parameters, created an electronic crash barrier to prevent tool collision. The latter group of features marked the arrival of high technology to the manufacturing or metal-cutting industry. ‘The improvement in drives was as important for the system as the contribution of the microprocessor or the minicomputer. The feed drives, usually known as servodrives, consist of a motor and its control, which receives its motion instructions from the CNC. Their performance is essential to the accuracy, reliability, and flexibility of the CNC system. ‘The open-loop system is normally used in simple point-to-point, or position- ing, systems, although improvements in technology have made it possible to install the system in contouring systems as well. The closed-loop configuration is more accurate and reliable, as reflected by its higher cost Although many CNC systems still use hydraulic or pulse motors, the DC drives have gained dominance on a much larger scale. In most cases, the drive packages are purchased from specialized drive system builders. These direct current (DC) permanent-magnet wound field servomotors range from 3,000 revolutions per minute (rpm) to less than 1 rpm without stalling. They develop peak torque capabilities with high slide acceleration and low inertia for optimized system re- sponse. Most drive systems offer a choice between transistorized silicone-controlled rectifiers and pulse-width modulation over the full range of amplified voltages. These drives can now drive virtually any lead screw. Their high-response inner current loops provide reliable regulation of torque-load disturbances. They can also be built with high-gain preamplifiers to close high-bandwidth velocity loops, The DC drives provide the answer to the most essential needs of acceleration, deceleration, stopping, and constant velocity, with inherent shaft stiffness for suc- cessful operation of the CNC system. The same drive systems actuate robots, transfer lines, flight simulators, graphic plotters, ete. As these drives are infinitely variable and fully regenerative, they can provide for maximum performance and control over the whole range of the motor. By eliminating gearboxes and clutches, the cost of drives for the third-generation CNC systems was reduced substantially. “The fourth-generation microprocessor CNC incorporated in many cases the controversial bubble memory. The bubbles are magnetic garnet crystals grown on nonmagnetic substrate, ranging in size from 2 to 30 micrometres, and used as, nonvolatile data storage. Although at this stage it is not competitive in the large computers, the bubble memory is closing the cost gap with disk storage devices. Insensitive to adverse temperature changes, dust, and vibration, the bubble memory has demonstrated superior reliability in shop environment. General Numerics in- troduced its fourth-generation CNC using bubble memory. More rugged than the others, bubble memory is still expensive compared to hard disk, and slow compared to ROM. Among the strengths of the fourth-generation microprocessor CNC (MCNC) are added part program memory storage, reduction of printed circuit boards, pro- 4 Trends in CNC Chap. 7 grammable interface. faster memory access, parametric subroutines, and_ macro capabilities, The system user can now write specific canned cycles directed to particular applications (“user macros”), far more economical and efficient than conventional canned cycles, Mathematical calculations with do-loop subrout can now be incorporated in the part program, The microprocessor controls both computations and motion commands. Thus, following an in-process gaging of-tolerance condition will be fed back, and the tool offset will be autor: modified to achieve the desired part dimensions. The fourth-gcncration microcomputer CNC system has the ability to control typical robot functions such as loading and unloading parts. Using the teach-in Icarning mode, the robot can be programmed to change tools or to remove chips. Where will technology go from here? To a large extent it depends on the knowledge of the system users and the demands they will pose to the desig and builders of manufacturing systems. CNC will probably remain for a long time one of the most practical elements of computer-aided design and computer-aided manufacturing technology es using variables, 2 Mathematics for Computer Numerical Control ‘The previous chapter emphasized the extraordinary capabilities of the CNC ma- chine. However smart a CNC may be, it simply cannot think. It can perform unlimited numbers of activities and can repeat any number of operations contin- uously and consistently by the use of numeric directions and commands. In this chapter we will discuss two different types of mathematics: one which deals with and leads up to the tape codes, or Binary Coded Decimal (BCD) mathematics; and the other which is used by the programmer as an aid to calculate tool centerline dimensions. The latter type of mathematics, known as trigonometry and analytical geometry, will present useful formulas essential to every CNC programmer for writing efficient part programs 2.1 THE NUMERICS THAT CNC MACHINE TOOLS UNDERSTAND The basic hardware of the CNC consists of the input units, the computing or mathematics unit, the memory unit, the control unit, and the output units. ‘The function of any input unit is to provide data to the computer in the form of numeric instructions, Present CNC systems are designed to operate with different input media. The most common of these is the punched tape, mainly because it can be read inexpensively, is less sensitive to handling, is inexpensive to purchase, and 6 Mathematics for Computer Numerical Control Chap. 2 requires less equipment to make and less costly space for data storage. Hts dissd- vantage, however, is that it cannot be reused. The magnetic tape has limited use ay a CNC media, it requires sophisticated (expensive) equipment for program recording und reading, and the programmer oF operator cannot see the recorded codes and therefore cannot read them, Recording errors are aot as obvious and visible as they are in punched tape, Magnetic tape requires special storage space and must be handled carefully to avoid erasing the program. The typewriter, more commonly known as the keyboard, has limited use because of the operator's speed. Mt may not be used for long program input. but is used primarily for small programs Tis main use is to edit (correct) programs already in memory or to generate single ‘operations in the Manual Data Input (MDB) mode. The objective here is intro- duce the reader to the evolution of the codes we use in our input units wo com municate with the CNC computer ‘The part program, once read into the computer memory, hecomes a set of instructions to carry out specific commands which may be preparatory in nature or auxiliary to the machining process, in-process gaging. or just simple calculations to support the machining process. The most popular CNC memories are still the Semiconductor IC memory and the Magnetic Core memory. However. “bubble memories are being used now in some CNC systems, The internal CNC memory can only handle small amounts of data, but at a very fast rate. Because of this rate of speed, CNC can perform linear, circular. and parabolic interpolation (calcula tions) at a rate of 200 to 30 inches per minute (ipm) slide velocities, The “brain” or control unit of the CNC controls how these operations are performed. It translates the memory instructions and specifies what operations are to be performed in what sequence. The mathematical unit pertormssimple addition subtraction, multiplication, and division functions. “The results are fed back (© the memory for storage or read out to the various output units of the CNC, These output units are servodrives for slides or program readouts to teletype printe CRT, or tape punch unit. Tool changes or other miscellanous codes are not handled in the mathematies. The codes or numbering system of these calculations are different from the input code used in the punched tape. Later in this chapter we will discuss in detail how the different numbering systems function in the CNC. ‘The CNC is a special-purpose compitter, using special CNC commands simplified manner called programming. These commands are written instruc in schematic form. The programmer does not have to describe in every detail what steps the CNC is to perform. A few commands such as we use to instruct the machine to cut a 360° circular are will cause the computer to perform thousands of calculations involving additions, subtractions, multiplications, and divisions. A CNC that cannot do these types of calculations would have very litle use in complex parts manufacturing, The accuracy of the calculations is limited by the digits used for each number. In most CNCs the number length, called the number of binary digits, is fixed to 8 and 16 bits (binary digits). The precision of the CNC far exceeds the physical limitations of the mechanical devices such as lead serews and slides. In spite of all Sec. 2.1. The Numerics that CNC Machine Tools Understand 7 the glorious things said about the CNC, it is the programmer who does the thinking, and achieves the precision. The CNC is a very primitive piece of hardware; it can only understand numbers composed of ‘“1” and “0,” in electrical terms “on” or “off,” sensing the presence or absence of magnetism or voltage. 2.1.1 Numbering Systems: Decimal Number System In our everyday life we seldom think of, or analyze, the numbers we use and work with. For example, the number 649 should really be written as 6499, meaning base 10. The base 10 system has digits from 0, 1, 2,3. 4,... 9, but there is no 10. The 10 is not a basic digit in the system. The second important point to note is that the position of the digit in the number defines the value of units, tens, hundreds, thousands, ete. The number 6490) = 9X 1 + 4 x 10 + 6 x 102 =9x1+4x 10 +6 x 100 = 649,40) In general terms any number (V) can be expressed by the following general equa- tion: N= dR" + dy (RU) est dR + RY + dR where N is the number, d, is the digit of nth position, and R* is the base or radix of the nth position Since computers are simple electronic devices that can only sense voltage on (1) or off (0), a light being on (1) or off (0), a transistor on (1) or off (0), or magnetic field on (1) or off (0), they cannot work with the decimal system's complexity. 2.1.1.1 Binary number system. A numbering system that is made up of only the two basic digits “0” and “1” is called base 2 or binary number system. This is the basic system that computers work with; it is also the basis for our Punched tape codes. ‘Comparing the decimal and binary bases with their powers, we find no dif- ference in the principle: 10° = 1 wel 10' = 10 2 10? = 100 Bed 10° = 1000 B=8 ‘The latter is the base our punched tape codes of numerics operate on. The binary numbers can now be handled by on-off type of electronic circuits. The equivalence between decimal and binary numbers is shown in Table 2.1, 8 Mathematics for Computer Numerical Control Chap. 2 TABLE 2.1. DECIMAL AND BINARY NUMBERS Decimal — Binary | Decimal Binary 0 oven mn wu ' ova 2 Hoo 2 no 5 not 3 oot 4 10 4 ou 5 mn 5 om 16 ove 6 ono. "7 uml | 1 on Is rote 8 ne w wot 9 wor »” SOUR! | » ww 2.1.1.2 Converting decimal to binary Example Convert Decimal 327 to Bin Solution Remainder 1 (LSD) least significant digit t 1 0 0 0 I 0 1 (MSD) most sigy Read from the MSD to the LSD. the binary equivalent of 327 is LWMOOLIL (Nore = quotients.) at digit 9210 Binary Remainder uotsp u ' ' 0 1 Msb Read! from the MSD to the LSD. the binary equivalent of 92 iy LTE. Sec. 2.1 The Numerics that CNC Machine Tools Understand 9 2.1.1.3 Converting binary to decimal. Changing the base from 10 to 2 in the general equation discussed under the decimal section is a very simple op- eration. Example Determine the decimal value of the following binary numbers: 1 GOI): = Msn Solution ‘* Assign powers 0, 1, 2,3, to the binary numbers from right to eft (these powers are for the base) Per ge * Substitute these binary numbers into the general equation using the base or radix 2 instead of 10, at the power corresponding to the location of the digit, as shown above, and multiply each one by the corresponding binary digit. N=1x BLOX PH IXBe xD =8404241= (Ip 2. (MOLOOILI), = ro Solution 2 POTOOO EL? N=1XM4Ox Mei eHsOxBsoxD FORM HLK PH IK WHET XD © Canceling terms with zero digits NoUxPeix Me ix Bei x Bein = 256+ 64444241 B27) 2.1.1.4 Fractional binary numbers. Since most programmed numbers ate fractions of a whole (decimal), fractional numbers are as important as integers. The method of converting fractions to binary numbers differs from the integer method. Instead of dividing, we multiply the fraction by 2. The number to the left of the decimal point of the product will be the binary number, while the sum to the right of the decimal point will be used as multiplicand. This multiplication is repeated until the desired accuracy is attained. Example (0.37510 750 500 x2 x 2 x2 9750 1.500 1.000 T T Binary 0 1 i MSD is 0. ‘The answer is (0.011),, 10 Mathematics for Computer Numerical Control Chap. 2 Converting fractional binary to decimal is identical to the integer conversion ‘The general formula we have used for integers used positive powers of the base. For fractions, these powers will have to be changed to negative av: Nad x RY4 dX ROH XRG +d, xR" Example OLDS = C2 Solution # Assign powers, ont “These powers, as in our previous example, are transferred 10 the hase as NeOxD HLxDs HID? Canceling the zero terms and performing the summation ay showa below: 0.25 + 0.425 = (0379) Mixed numbers can convert just as easily from binary to decimal if we re- member that the powers of the base are positive to the left and negative to the right of the decimal point Example Convert (10111011), to decimal Solution: Let os Neix Deux de ix vex Flx2 4x2? HEM De IMME Lx MeL e BI ETD HIRD! BEVEL HOS +0125 + 0.025 ~ (L6875),, sxample Convert (29,1875), into binary. Sec. 2.1. The Numerics that CNC Machine Tools Understand " Solution: + Convert integers 229 aiid az “LSD 1 0 1 3 1 aun 1 MSD Integer answer is 11101 '* Convert the decimal digits as: ousts pe 3780 pe 7500 pare 3 3750 0.7500, 1.5000 t t t 0 0 1 Decimal answer is 0.0011 (29.1875)yo = (11101.0011), There are other number systems used in computer technology, such as the base 8 (N), called octal, and the base 16 (N);. or hexadecimal, in addition to the binary number system. Detailed discussion of other number systems would be beyond the scope of our objectives. However, a brief discussion of the four basic arithmetic operations with binary numbers will be a useful aid for the reader (programmer). In each operation, the reader must “memorize” only four combinations, as opposed to the decimal system where one had to “memorize” 100 combinations. For addition in binary numbers, see Table 2.2; Table 2.3 shows subtraction in binary numbers. 5 Ad 1 did <— carries Note: 1 a | yyy 5: is 4 B+ YP DDDT 4d ‘cca 4 A+B 101110 (48).o TABLE 2.2 ADDITION IN BINARY NUMBERS Auugend Addend Sum Carry Oo * 0 = 0 0 1 + 0 IL 0 oF 4 1 0 Tt o+ t= 0 1 12 Mathematics for Computer Numerical Control Chap. 2 TABLE 2.3 SUBTRACTION IN BINARY NUMBERS, Rorrow ' 0 o Example Borrows 000000 A Hoo B 1000) A- BOOM (17) Subtraction of large binary aumbers is difficult, especially for those who stre not familiar with the binary number system. Some of you may find it easier to work with, another method called Binary Complement Subtraction. ‘The method is described below, step by step, using the sume example as above, LA 4 1Luoot riovel -}uo0n +Ottiid Vv 2. Write down the minuend as shown on the right. Then weite down the com plement of the subtrahend below 3. Instead of subtracting. add the (vo numbers. Once the addition iy completed the carey mst he aed to the san show i » 32 Complement of 52 roo od Uw (Nore: The complement of binary Ois Fand the complement of binary 1 is 0.) 2.1.1.7 Binary multiplication. Most CNC systems do not perform multiplies tions, The multiplication is implemented by repeated addition, the same wa the addition of all partial products is performed to obtain the final sum (see Ta 2.4). The formation of partial products is easy (the same as the decimal multipli- cation), The addition of all the partial product is more difficult, You must count the number of ones in the column: If it is even. the sum of the column is 0, Fit is odd, the sum of the column is {. Kor every pair of ly there is one carry to the next higher position ble Sec. 2.1 The Numerics that CNC Machine Tools Understand 13 TABLE 2.4 MULTIPLICATION IN BINARY NUMBERS Mlipliand __Muliper Product rood 1 oF GY 6 bog 5 ee ee) Example BALTOLO1L x2 B xl O11 0 946 OL Litt Wo 0 cany . - ‘multiply by “0” Solution 00 0]0 0 0 san with LSD 04 0/441 —mutipy by 40h Oat) amutiply by 1 0 dea oaf'o | mutiny by 0 rotor multiply by 1 AB tro til 00 1 0 add (Nore: | )* = O with carry of 1.) ‘The only possible way to verify a large binary number such as our result is through binary-to-decimal conversion (discussed in the preceding pages) N=OXMHIXMFOX POX BE IX MeL xX BHO KD FIX DHLK BH LXD = 04240404 16432404 128 + 256 + 512 946). 2.1.1.8 Binary division. As in the case of multiplication, most CNC sys- tems perform divisions by repeated subtraction of the divisor from the dividend. ‘The division rules for 1wo 1-bit binary numbers are shown in Table 2.5, Example Dividend Divisor Quotient 6 10 0 Solution 11010 = 101 = 101.001 101 oor10 101 ‘do1000 101 1 4 Mathematics for Computer Numerical Control TABLE 2.5 DIVISION IN BINARY NUMBERS. Chap. 2 Dividend Divisor Quotient ' - 0 Undefined oe 4 0 of 4 wlelined EXERCISES 2.1.1. Convert the following decimal numbers to binary: a) 23D (3) 379 D 2) 09D (6) 27D @) 147 D 79D (@) 1897 D (8) 149 D 2.1.2. Convert the following binary numbers to decimal: a) LOLOL B (4) 1111101 B 2) 1000411 B () 1101 B (3) 1011 B (©) 00101 B Remainder Unehned Undefined o 2D (10) 88 D an 22D (12) 3638 D @ nin B (8) 100001 B (9) 110100 B 2.1.3, Convert the following fractional decimal numbers to binary (1) 0.6565 D (2) 0.8759 D 2.1.4, Convert the follow ay 0.1011 B (2) 0.110101 B . Convert the following decimal numbers to binary’ (1) 6.875 D @) 3.25 D (2) 11.235 D 4) 6.235 D ‘Add the following binary numbers: a) Hoon + 1 42) OOLIO + 1010 2.1.7, Subtract the following binary numbers: 1) 10010 ~ 110000 (3) 10011 = 01010 (2) 10131 ~ 1011 (4) 11101 ~ 0101 Multiply the following binary numbers: ay WUT x 110 () ILL = LOL 2) LOrIO) x JOLIOLL 4) LAL x 010 2.1.9. Divide the following binary numbers: qy Lon = 101 () MOLL = 110 2) toll = 11h @ 1 = 10 (3) 0.737 D (4) 0.4375 D 2.1.2. Binary-Coded-Decimal Code (BCD) fractional binary numbers to decimal 65) 13.4315 D (6) 22.595 D @) Wn 68) 10000 — 00110 (6) TOLL — FLO 48) 0140 OL (6) 1100 & 1010 (3) NOILOL = O11 (6) L101 = LIL We have understand simple" arlier established that the CNC system is an electronic device that can n” (1) oF “oft” (0) states. We have also showed that the base Sec. 2.1. The Numerics that CNC Machine Tools Understand 15 DECIMAL NUMBERS, Tape (CHANNELS Figure 2.1 BCD tape code. 2 or binary number system allows us to represent any decimal number in binary. All CNC systems use some sort of binary system for their arithmetic or internal operation, but externally the real world works with the decimal system. We have seen that conversion between decimal and binary can be long and erroneous for large numbers. As a compromise, a binary-coded-decimal (BCD) coding was de- veloped, based on the position of the numbers used to describe our CNC tape codes. The first, second, third, and fourth positions can be described as: 2 = 4and 2 = 8 Reading from right to left, the weight can be written as 8-4-2-1, For this reason, this system is often called the 8421 code. This code compresses the binary numbers so that they can be punched in tape to control our CNC system. The BCD (8421) codes are punched in rows across the 1-inch-wide standard tape; each row represents one digit in the tape and successive rows can represent any numbers. Figure 2.1 illustrates the BCD tape code principle. One of the main advantages of the BCD system is that once learned it is easy to read the values represented by punched holes. For example: Digit 1 is represented by a hole in channel 1 (2° = 1) Digit 2 is represented by a hole in channei 2 (2' = 2) Digit 5 has no code of its own, but is the sum of 2? = 4 plus 2° = Lhence 4 + 1 = 5. The reader can easily visualize the simplicity. The BCD codes are used in both Electronic Industries Association (EIA) and the American Standard Code for Information Interchange (ASCII) Systems, which will be discussed in more detail in the following pages. 16 Mathematics for Computer Numerical Control Chap. 2 2.2 CNG TAPES When punched or recorded (in the case of magnetic tape). these tapes ate pre- dominantly used by CNC systems as inputfoutput or controt media. ‘The reader may find many different makes and colors of [-inch-tape commercially available. All tapes are manufactured to an ELA standard (shown in Figure 2.2). whieh aso outlines the tolerances required by the manufacturers of tape punching and reading equipment. Selection of the tape material should be based on the type of tape reader and tape punching unit available. For mechanical tape readers (few in new systems), mylar base tapes should be used because mylar provides considerably longer fife under repeated rereading than the regular paper tape. Although it is more expensive, it does not require special punching facilities. has low wear rate, «nd provides excellent resistance to oil and grease. For photoelectric tape readers and systems with memory, the inexpen- sive paper tape should suffice. The primary requirement is to provide high opacity and low reflectivity. However. tape readers with 300 characters per second (eps) or higher reading speeds may damage this tape if repeated readings are re- quired. Because of the high acceleration and deceleration rates, these tape reud- ers are most reliable with laminated paper-mylar or a less costly aluminized-mylat tape BEI reer eeepc | 0° 0000 0000 0000 555 Oo 0 ee oo 0° oo eo oo oo 0° 0° e00 7 ° ° ro 9 0 © 009 0000000000000 e000 o 2) 00 O oo 0 00 00 0 © 00 0 Cr oOo 00 © 000 ~ ©0000000000000000000000000 ° sloo00000000 ° 000000 000 00 g)2}0 COD}D00000 00000000000 o 8° She °° 20000000 ©0000 00 oco0000 o Bloloo rs eccccccvcnccccce ooe eocccccen =e 0000 e000 ooo e000 990000 0° s| 00 00 00 00 00 008 00 00 00 00 oo {0 9 0 © 00 © 0 0 9 000 0 0 0 o 0 o 000 9 oo oO zfoteor otto rt op oat taro opauut one Ble Hetertvietaigeenet ' ele trtatanny Heitetet orate je) ue ut i 1 \° rere rere rie ' Is trot troort oat ote "4 - hob tt H ag Blonnneeencaeseverecena-Eeoacenes spurns csv eee BEBE Figure 2.3 ASCTT (ISO) and EIA punch tape codes used by CNC controls 7 18 Mathematics for Computer Numerical Control Chap. 2 2.3 TAPE-PUNCHING FACILITIES Several different manual tape punches are commercially available, However, with the drastic price reductions in the minicomputer field, we recommend the purchase of a minicomputer based tape-punching facility that works with a floppy disk drive, set Ue Screen Lar ‘Set Up Serial Come. 1 Read No. File Name Punch | Leeder Tape |" Reed Byte | 130 _ waz ta <> Lie] = set Up Souree File 70 Yes No, End of Job ‘Enor Procedure | 720 eae I iow AT] agp Files: Ret. DOS Kigure 2.4 Interfacing « PC to a tape punch Sec. 2.3 Tape-Punching Facilities 19 ‘The writers are using an IBM PC coupled with a tape punch and printer. This system provides an inexpensive trouble-free high-speed tape punch; the program is written on the screen and can be edited (corrected) before a tape is prepared. The diskette provides the lowest cost storage device available as dozens of programs can be recorded on a single diskette. For computer-aided programming, we should mention that editing software can be purchased with the hardware for most commercially available mini- computers. CNC systems use two different punched-hole codings: the ELA RS-244 stand- ard was developed and used predominantly by the North American industry; ASCII RS-358 standard was developed in the United States but is accepted and used throughout the world under the name ISO. While some older NC controls work with EIA, most current CNC systems accept both punched codes. Parity Code. To minimize the possibilities of errors during the internal handling of binary data within the CNC control, as well as during tape punching and reading, a Parity Check system has been implemented in the standardized coding. The Parity Check Code for the EIA consists of an extra hole in the fifth row, in addition to the BCD code if the holes would otherwise be even, so that the number of holes across the tape will always be “odd.” Holes in track five are used ‘exclusively for this purpose. The Parity Check Code for the ASCII requires “even” numbers of holes across the tape in every row. Holes in track eight are used exclusively for parity adjustment whenever it is required, Punched tape codes were also developed for alphabetic and other symbolic keyboard codes by ASCII. Both ASCII and EIA punch tape codes are illustrated in Figure 2.3, 2.3.1 Interfacing a PC to a Tape Punch ‘The following program will cause a program written and edited on the screen to be punched by a tape punch, serially connected to the PC PROGRAM This program can be written in a number of languages. BASIC was selected due to its widespread acceptance. 10 SCREEN 0.0 : WIDTH 80 Text mode, black and white, 80 charactersitine 20 KEY OFF : CLS: CLOSE Opening statement. Turn off function keys. clear : LOCATE 5 screen, assure that all files are closed, position Mathematics for Computer Numerical Control 30 OPEN "com? : 300, 6, 7,105, ds, 0d" AS #1 40 LOCATE 18,5 60 INPUT” Enter file name or ‘EX’ to exit OFFS 60 IF FS = “EX” OR FS ~ "ex" THEN 250 70 OPEN FS FOR INPUT AS. #2 80 IF EOF(2) THEN 230 90 XS ~ INPUTS(1,#2) 100 IF XS-<.- "96" THEN 80 110 GOSUB 170 120 1F EOF(2) THEN 220 190 X$ = INPUTS(1,#2} 140 PRINT #1,X8; Communication set up statement, Baul rate 300 bits per second, parity even, 7 data bits. Fstop bit RS 282 format serial transmission. The Iabeled #1. This isthe tile ygeatn will write to, oF tae ipa file Position cursor atthe intersection af rewe EN sind The anger 10 the prompt iy stoned 3s SU FS. 1 wishes to exit progeatn, Contra of to sequence 250 and prowess is terminated [A new file, labeled #2, ws opened. Thi e nsiver 1 the initia pr the one the pr Fp file, Label PS was asin This ine cheeks the input fife (#2) tor an Br ot File condition, 1 avoid 3 qi error, U end of fle was coached without reading 4°45 wn error hss taken place and aw ercor message iy required, Control is transferred te se, #230, Uke program ill read [byte from the input fi (42), The byte fenel will be stored as string data xs The tape tike must start with a This ewes the Program to agnore anything por %, suck as iman-readable messiges. UF the byte read i not 6) camnito ws iransterted 19 Seq SO) ed of tle rechecked. sind Byte read The byte real as war (F, The program is allowed to proceed in sequence, and control is transferred {o subroutine. seq, 19D, Leader tape is puneted rx! of input file is ehecbect again. 1 was reaehed. comteol i Hnsferned 49 220. where the prices of punching tales tape will be initiated. thew the one sion wil he terminated Ln of fle was not reached, ‘The prota is weil to proceed. The nest byte i read from input tie #2 Ihe byte real wats stored as NF in the previous Tris ow sent to the output ile #1. line tthe interlace) as slotined in se. Mie sand paced 19 tap he eam Chap. 2 Sec. 2.3 Tape-Punching Fat ies a 150 IF XS = te" THEN 220 IP the byte read was %, the program is now 160 GOTO 120, 170 FOR A = 1 T0200 180 PRINT #1,CHRS(O) 190 NEXT A. 200 RETURN 220 GOSUB 170 : PRINT” End of Punching ” CLOSE : System 230 CLS : LOCATE 10 240 PRINT ” Check for missing % sign in your program’. 250 CLOSE : SYSTEM legitimately ended, and control is transferred to 220 as in seq. 120. ‘This isthe end of the input fle reading loop, ‘operating in the range 120 to 160, The loop will check for end of file (CNC program), read the next byte, punch it to tape, cheek for %, etc ‘The sequence 170 to 200 is the leader, respectively trailer punching subroutine. 200 characters of “zero ASCTI” arc sent to the punch (output file #1). Accordingly. 200 fines ‘of blank Cape (20 inches) are put through the printer before and after the CNC program being punched. Closing statement. This instruction transfers ‘command to the subroutine and the trailer tape is punched. The programmer is advised on soteen that the process is over. All files opened by this program (#1, #2) are elosed, and control i returned to BOS. Error message : Sequences 230 and 240 advise the Programmer on the screen that “96” is missing, from theie program Close all files und return controt to DOS. This fine is used in conjunction with the Programmer's “Exit” request and the error message advisory. EXERCISES 2.3.1, Identify the code and decode the following punched tape codes: a 090 6 Q 8 e008 Sa0000 ~ 00 ° Figure 2.5 Punched tape. 22 Mathematics for Computer Numerical Control Chap. 2 % 0-900 006 0° 0000 oe 88 2000 9000000 & e090 ° Q_90 00 99805600 00006 oo Figure 2.6 Punched tape 2.3.2. Using the ASCIT code. draw the hole pattern of the following tape blocks (1) NULGOIMOLX 1. 3551-2.005CR (2) NO9GI7SL137X2.500¥6.97SMUSEOICR 2.4 MAGNETIC TAPE CODES Magnetic tape codes are also derived from the BCD system and in most CNC applications they are recorded (instead of punched) on half-inch-wide cartridged magnetic (mag) tape. The codes or data are recorded in seven parallel channels or tracks (Figure 2.3), using a character density of 800 to 4,800 per inch, Their reading speeds are expressed in inches per second (ips) or characters per second (cps). This speed is normally 160 ips of 45,000 eps on most CNC controls. The read-write heads may be of one- or two-gap types. The one-gap head is used for cither reading or writing, but only one at a time (more popular with CNC); the two-gap type can write a code (bit) and read it back, while the bit is still under the head, for parity check. Magnetic tape media was used by several U.S. control manufacturers during the late 1960s and 1970s, mostly by Bendix, Thompson-Rand-Wooldridge, and Kearney & Trecker for four- und five-axis contouring. In spite of the high reading characteristics and the lower basic cost of the control, mag tape never gained the wide acceptance that punched tape did. The codes cannot be seen by the naked eye: however, special optical viewing instruments are available on the market to view the recorded codes, as shown by Figure 2.3. The alphanumeric codes are shown by dashes (-). Interactive CNC controls with mag tape storage are period- ically coming to the market. 2.5 MATHEMATICS FOR THE PROGRAMMER The question most asked by persons wishing to learn CNC programming is “What level of mathematics do I need to be able to learn CNC programming?” Unfor- tunately there is no simple answer, However. it is safe to state that a part pro- Sec. 2.5 Mathematics for the Programmer 23 grammer for lathe and/or two-axis contour milling should have a working knowledge of coordinate systems, trigonometry, analytical geometry, and cutting forces. While the objective of this book is not to discuss lengthy mathematical deri ys, it will provide valuable information for those who wish to review areas of concern 25.1 Cartesian Coordinate System Most of you are familiar with the rectangular or cartesian coordinate system you have learned in high school. All the CNC systems are built to function and therefore must be programmed in terms of a coordinate system. The mathematies discussed here will be shown in coordinate systems whenever possible. A two-axis coordinate system is formed by two intersecting straight lines perpendicular to cach other (see Figure 2.7), hereafter called X and Y axes, ‘The sample programs in the book will refer to this two-axis system for po- sitioning and contouring. Drawing a third line, as shown by Figure 2.7, perpen- dicular to the ptane formed by the X-Y axis through the intersecting point will form a three-axis coordinate system. The intersection point is called the “Origin,” and the third or “Z” axis will be called the “tool” axis. Point. The simplest element is a point (PT) and it can be defined by its X-Y coordinates as PT1 (X, Y), shown by Fig. 2-7 using actual values as PT1 (8.5, 11). This notation refers to a two-axis coordinate system. PT2 and PT3 cannot be defined by this method because PT2 has no X and PT3 has no Y values. These points must therefore use a three-axis notation in the form of PT (X, Y, Z). This notation allows us to define the location of any point in space in terms of our coordinate system as PT2 (0, 6.2, 7), PT3 (5, 0, 6), and PT4 (8.5, 11, 2) Line. Any line can be defined by two points in a cartesian coordinate system. (There is another definition using a radius from the origin and an angle measured from the positive X-axis which wilt be discussed under Polar Coordinates.) Z-Axis Figure 2.7 Cartesian coordinate system. 24 Mathematics for Computer Numerical Control Chap. 2 Example Detine Line | (NI) and Line 2(1.N2) Soluti PTL (B.S. 11, 0) is defined! in Figure 2.7 Deline the second point, PTS as PTS (8.5. 0.0) Now Line can be defined as LNI (PTT, PTS). ora line goi PTL and PIS. Similarly. LN2. (PPL, PTO). where PTS (0. 11, Ob, rough points Plane. Better known in industry as surface, it can be defined by three points It can also be defined several other ways. However. plane definitions by rota and transfer are beyond the objective of this book. Some planes, such ws PLL, PL2 or PL3 are illustrated in Figure 2 Example Define Plane 3 lution Define the three points required for the plane definition: PTS (0, 4 0), PTA (0, 4, 6), PTS (0, 8, 6! Define the plane as PL3 (PTS. PTS, PTA}, 2.5.2 Polar Coordinate System ‘The nomenclature of the axis (X-Y-Z) is identical (o the cartesian system. However, the coordinate location of the point, line, or plane is defined in terms of a radius (distance from origin to 2 point) and the angle between the positive X-axis and Sec. 2.5 Mathematics for the Programmer 25 Figure 2.9 Polar andlor cylindrical co- ‘ordinate system. the geometric shape we wish to specify. The angle is positive (+) in the counter- clockwise direction (CCW) and negative when measured in the clockwise (CW) direction from the X-axis, See Figure 2.9. Some of the latest CNC controls are programmed in terms of polar coordi- nates, This simplifies the calculations when holes have to be drilled on a circular pattern Example Define the location of PT] in terms of polar coordinates. Solution PTH IR, A) PT (8.6023, 96.597) Points not located in the reference plane are defined by their “cylindrical coordinates.” PT3 must therefore be defined in terms of its radius “R,” angle “A.” and height “Z," in the form of PT3 (R, A, Z). Using the dimensions from Figure 2.9, the answer will be PT3 (8.6023, 35.937, 4.0). A typical CNC application of the cylindrical coordinate system is illustrated in Figure 2.10. In order to mill the cam groove on the cylinder (centerline of groove shown on drawing), we need first to define the start (PT1) and end (PT2) points in terms of the radius, angle, and height dimensions. The tool path from ~ 120° to +110° describes the rotation of plane 1 to plane 2 position. The rotation plane X-Y is circular, and the third axis motion (Z) is linear. In fact, the tool point will describe a helical motion along the surface of a perpendicular eylinder. 26 2.5.2. Draw the following lin Mathematics for Computer Numerical Control Chap. 2 .GOF caM GnoovE Y Figure 2.10 Cylindrical eoordinate system. EXERCISES Using Figure 2.8, define the location of the following geometry’ ay PT 3) LN? @) LNI a) PLL s in a coordinate system: Li = PI (04,0), P2 (4.4.0) 12 = P3 (4.0.0), PA (0.0.0) L3 = PS (4.0.2), P6 (0.0.2) La ~ P7 (0.4.2), P8 44.2) 2.8.3. Using the geometzy of the previous problem, draw the following planes: ay PLI (L1, L3) 2) PL2 (L2, Lay 2.8.4. Draw a plane using the following points: 2.8.5. Using polar coordi PI (0.0.0), P2 (0.4.2) and PS (4.4.0) ss, define the location of PT2 in Figure 2.9. 2.5.6. Using the cylindrical coordinate system in Figure 2.10, define the location of the following points: (i) PTI 2 PT? 2.5.7. Draw the following lines in a polar or cylindrical coordinate system: (a) LI = PI (65, 37.5), P2 (0.75, 185) Q) L2 = P3 (16.5, 180), P4 B.S, 90) (3) L3 = PS (6.0, 88). P6 (0, 45) ” Sec. 2.6 Trigonometric Functions 2 2.6 TRIGONOMETRIC FUNCTIONS The science of “triangle measurement” is commonly known as “trigonometry.” Trigonometric functions such as angles, sides of right-angle triangles, and their relationships will be discussed in this section. 2.6.1 Pythagorean Theorem ‘The square of the hypotenuse in a right-angle triangle is equal to the sum of the squares of the other two sides. See Figure 2.11 eo Vat eet Figure 2.11 Pythagorean Theorem. 2.6.2 Similar Triangles If the sides of any angle are intersected by two parallel straight lines, two similar triangles are formed. The ratios of the sides can be expressed as shown by Figure 2.12. This relation will hold for any number of parallel lines traced, i.e., ap, bay C2-Ay, bs, 6, ete Figure 2.12 Similar triangles. 2.6.3 Sine and Cosine Functions ‘We will only show the most frequently used functions (Figure 2.13). 28 Mathematics for Computer Numerical Contcol_ Chap. 2 em. sine a = SITE SIO ops» ee sinas $ bare. simas cnt cor de Bi bec.omaier aby Figure 2.13 Sine and cosine functions 2.6.4 Tangent and Cotangent Functions The most frequently used functions are illustrated in Figure 2.14. = OPPOSITE SIDE TANG = GRTACENT SIDE AREA TA) = Figure 2.14 cot and cotangent funetions 2.6.5 Angular Relationship Between Trigonometric Functions Wa e+ sim ecand = 6+ cosa from 2.6.3 and tan ee = F from 2.64 then by substitution sin tana = cos sin Sowa | 781 a = tama GOs a, and eos o@ = tana Sec. 2.7 Oblique Triangles 29 Similarly a . tan a B and b = a - cot « by substitution @ tan a = ——~— therefore tana a cote a sin 1 iftang = 2S 2 1 cosa cota then. 2.7 OBLIQUE TRIANGLES ‘Sometimes the programmer has to do calculations of angles or sides of triangles that do not have a 90° angle. Some calculation procedures for oblique triangles are shown by Figure 2.15. AREA (a) = 2-PRY Ean b posing _ sin y igure 2.18 Oblique triangles EXERCISE 2.7.1. Caleulate the three missing elements in oblique triangles using the following data () b = 2.35, B= 399 C= 118 @)a 30 Mathematics for Computer Numerical Control Chap. 2 2.8 ANALYTIC GEOMETRY Analytic geometry is the science that deals with the graphical representation of an ‘equation, We are mainly interested in introducing the reader to points, lines, and circles, their intersections and relationships in a coordinate system, The reason behind this interest is that outside and inside contours of most parts machined on CNC equipment can be defined in terms of lines and circles. Programmersinterested in studying more complex curves such as parabola, ellipse, hyperbola, and others. s well as three-dimensional analytic geometry will find specialized texts dealing exclusively with this topic. 2.8.1 Equation of a Straight Line A line may be defined through its Y-intercept (the point at which it intersects the Y-axis) and its slope in relation to the positive X axis. See Figure 2.16. The slope- intercept equation can be written as Where tan « and bas g 1 Example 1, Find the “y" dimensions for X= 60 and X= 80 ifa = 30° and b Figure 2.16 Linear graph Sec. 2.8 Analytic Geometry 31 Solution Both points are located on the above line. Their coordinate axes must therefore satisfy the requirements of the equation. Tan 30° = 0.57735; this is the slope m. Inserting the values of m and 6, we oblain the equation of the line: y = 05723548 For x= 6 y= 0S7735-6+8= 11.4641 and For x= 8 y= 057735-8 +8 ~ 126188 If, on the other hand, we know the coordinates (xy. y;) of a point P, and the slope of the line, its equation can be obtained from the foliowing formula: Yt mee 2. Find the slope-intercept form of the equation of a line defined by an angle @ = 30° and passing through a point P, of co- ordinates x, = 6.0 and y, = 11.4641 Solution tan 30° 0.57735 = m 11.4641 + 0.57735 + (x - 6.0) ¥ = 11.4641 + 0.57735 +x — 3.4661 = 0.57735 x + 8.0 y = 057735 x + 8.0 which is the slope intercept equation used at the start of this paragraph. Using the above equations, any y-coordinate can be found in terms of its x-coordinate 2.8.2 Equation of a Circle If the center of a circle is at the origin of the coordinate system (see Figure 2.17), the equation of the circle is: P+ y If the center of the circle is not in the origin of the coordinate system, but located in a point Q (Xp, Ya), the equation of the circle will be: @ XQ) + (¥ — Yo) Applying these basic principles, the programmer will be able to cal- culate the intersection point coordinates for line-line, line-circle, and circle-citcle relationships. 32 Mathematics for Computer Numerical Control Chap. 2 Figure 2.17 Circular seaph ersection point of the following two fines, given a slope-interexpt foo: IND ¥ = 0.5r 4 3.25 IND Y= 2a +7 If, and mare the slopes of the two Hines, and b, and bs their respective intercepts the coordinates x, and y,, of the intersection point PTL (see Figure 218) can be calculated as follows: by Figure 2.18 Interscetion of ne Lines Sec. 2.8 Analytic Geometry 33 Solution bb 7-325 _ 3.78 mm, TS = (2.3) 28 VOO4 Substitute this value of x, into the equation of LN1 as follows: Jp = OS + 1.6964 + 3.25 = 4.0982 2.8.4 Intersection of a Circle and a Line The coordinates of both points of intersection between the line and circle must satisfy both their equations (see Figure 2.19). Therefore, the equation of the line is equal to the equation of the circle as follows: Y, = m+X, +b = Yo* Vr Nore: Yo + Vi = (X— Xo)! was derived from the equation of the circle as shown: (Y= Yop Y-Yo= Y=¥o+ VP —-(- XP Example Find the coordinates (X,. X2, ¥\, ¥:) of the intersection points (PTL, PT2) from the system of equations of: Line (LNI) y= x +2 Circle (CIRI) y = 4 * a Figure 2.19 Intersection of a line and circle 34 Mathematics for Computer Numerical Control Chap. 2 Solution or 6+ VR rey roa edd yade2 and the answers are PTL (4. 6) and PT2 (2. 4). 2.8.5 Intersection of Two Circles Example Find the intersection points of the following, wo circles: Circle } of equation y = VF for r= 4 and Circle 2 of equation y = yy = VF for ayy <= ty on8 and r Solution Since the intersection points are common for both circles. we ean equate the two equations as: Squaring both sides: 16 Solving the equation: = Alor + 0.68 = 0 Duk + 1.91 Sec. 2.8 Analytic Geometry 35 Figure 2.20, Intersection of two circles. And the coordinates are: x = 208 + 1.91 = 3.99 and y, = VIG — 3.98 = 0.28 xy = 208 = LOL = 0.17 Vi6 = TIF = 3.99 ‘The two intersection points (see Figure 2.20) will therefore be: PI (3.99, 0.28) and P2 (0.17, 3.99) EXERCISES 2.8.1. Find the intersection point of the following two lines: y= 2 3:y = $(r—4) Q) y= - Ry -xt3 QB) y = 0.6r — 02: y = ~ ix + 1s 2.8.2, Find the intersection points of the following tine and circle: QM Usy=a; Cliy= + VB—e QLisy=2 Ciy=2* VB=e op @ Lisy=0; Cliy=-22 VO-0 4 DF 3. Find the intersection points of the following two circles y= = Vie yr tVB- 36 Mathematics for Computer Numerical Control Chap. 2 2.9 TRIGONOMETRIC FORMULAS Formulas discussed in this section will he most useful to the programmer for cal- culating cutter 's for milling applications and TNR centerline paths turning applications. In milling, “r,” will be used to identify end mill radius, while in turning, the same “y,”" will represent the tool tip radius. ‘The formulas and sample calculations are given in X-Y coor: The reader should have no difficulty in applying these formulas co turing in SZ for °X" and “X7 for “Y° dimensions. See F ater pant . : ow , _- bo) Milling, €b) Tuening 2.9.1 Cutter Centerline Intersection Point of a Line Parallel with the X-Axis (Z for Lathe) and a Line at an Angle Measured from the First Line te TOOL RAD. X= OFFSETS AT PTA ANOPTR | BY te DUE TO anoLe a x -rge TaN © 2 _- TOOL PATH Sec. 2.9 — Trigonometric Formulas 2.9.2 Cutter Centerline Intersection Point of a Line Parallel to the Y-Axis (X for Lathe) and a Line at an Angle Measured from the X-Axis x= area arene. tH 8B ATTA ove rg eta as = 38 Figure 2.23. Line parallel with the Y-axis. 2.9.3 Cutter Centerline Intersection Point of Two Lines 37 Neither line is parallel with the primary (X-Y) axes of the part or machine coor dinate systems. See Figure 2.24. cos G2 St bo bere EE co Figure 2.24 Lines not porsllel with primary axes, 38 Mathematics for Computer Numerical Control. Chap. 2 2.9.4 Cutter Centerline Intersection Point of a Line and a Circle ‘The line tangent to the cirele, not parallel to either X- or Y-asis of the coordinate ystem, See Figure 2 bce re. sin ae R. sine AY = re «cos Aj sR. cosa NOTES: FOR CIRCULAR INTERPOLATION THE PROGRAMMED UNIT VECTORS | AND) WILL HAVE TO BE CALCULATED AS: PROGRAMMED, Bax ai x aivav ai-ay Figure Sec. 2.9 Trigonometric Formulas 2.9.5 Cutter Centerline Intersection Point of a Circle and a Line: ‘The lines parallel to the X- or Y-axis, intersecting a circle. See Figure 2.26. a= x= 46 — Vir) 2 ine? . can axe Vinge? at PROGRAMMED | AND | CALCULATED AS: IeOi-Ax: irdi-av PROGRAMMED | AND] CALCULATED AS: FeAiFOx; 42Aie ow nem x2 (J ‘Ox="6 Avedi- Veg? Bie? é Ox aye Ving? ing A) PROGRAMMED | AND) CALCULATED AS: i=Ai~te AND|=Aj—A¥ PROGRAMMED) AND) CALCULATED AS: Ie AiSOX AND} BI+Y Figure 2.26 Intersection points of lines and circles. 40 Mathematics for Computer Numerical Control Chap. 2 2.9.6 Cutter Intersection Point of a Line Tangent to Two Circles A typical turning application is illustrated by Figure 2.27) ‘These formulas can only be useful to the programmer if a working knowledge is gained by solving numerous problems. Readers wishing to expand their math- ematical knowledge beyond the scope of this chapter should reter to specialized manuals of analytical geometry 4 0F PART © B= Ys Amys sin a (Bq - re) 7 AA ® Ry - cos aR - 7—) sin a(R + re) 5 Og = Ry 08 a(fy * Fe) mote Oty yg A Tet OZ” Figure 2.27 Line tangent wo ae eile, 2.10 UNIT VECTORS AND DIRECTION COSINES In & number of instances, the tool-part orientation has 1 he expressed mathe- matically for programming purposes. This is achieved by using unit vectors and their axis projections, the direction cosines. To lacilitate the understanding of the Sec. 2.10 Unit Vectors and Direction Cosines a Figure 2.28 Circular interpolation, above terms, we shall first consider a standard case of circular interpolation, coun- terclockwise. in the XY plane. See Figure 2.28, Circular interpolation is programming of the tool motion along a portion of a circular path. Dimensions i and j are the coordinates of the current location of the cutter, or “start point.” on the arc shown, measured from the center of the arc. Using Pythagora’s theorem in triangle ABC, the radius is calculated as follows: R=vPFP ‘The tool motion shown has a direction, shown by the arrow on the are, and a magnitude, given by the value of the radius. The values i and j can be secn as the projections of the radius R on the axes X, respectively. Y. Their magnitude and direction locates the starting position of the tool point with respect to the center of are. If we assume the resulting dimension of the radius R (the “magnitude”) to be 1, we have just introduced the unit vector (the radius R of magnitude 1) and the direction cosines i and j. The unit vector is therefore a “radius” or a “line.” starting out from the origin of the coordinate system. Its length is 1 inch (or 1 mm). It is the value 1—hence “unit” vector—which is the critical factor. The measuring system is not relevant in this case. See Figure 2.29 ‘The magnitude and the direction of the circular interpolation radius R had been determined by its projections / and j. The role of the unit vector is to quantify a ditection. To concentrate on the direction, the magnitude is removed from the Figure 2.29 Unit vector. 42 Mathematics for Computer Numerical Control Chap. 2 TABLE 2.6 allel to X-ais i © « allel to Y-axis 0 1 a Tool parallel to Z-skis 0 0 ' Tool a 49° an XY-phine osm | oz | ool 43° in YZ-ph 0 war | ase Pool 8° in XZ-phane om | 0 ool equidistant trom positive X.Y. and Zanes | 0.577 | 0877 ool or 30° wich respect to positive X axis in X= plane asin | ase | a picture by being made equal to one (hence the “unit” in the unit vector). The un vector expresses the direction by the values of its projections on the three axes, X,Y, and Z. These projections, labelled respectively as ij. and kK. are called ‘direction cosines.” Table 2.6 provides values for a few situations. Negative values indicate the ‘opposite direction, The values have been rounded off to three decimal places for simplicity. They can be calculated ac: rately if required by observing that VP TPR a1 cox b = whey k cose = -t=k oe i 2.11 UNDERSTANDING THE FUNDAMENTALS OF INTERPOLATION Linear interpolation represents the machining of a straight-line path between an initial and a terminal location of a cutting tool, These two locations, given by coordinates (x).y)) for the first point and (¥,y2) for the second one, will define a tool path given by the straight-line equation youth Sec, 2.11 Understanding the Fundamentals of Interpolation 43 Plugging in the two pairs of points, we obtain two equations, Ya = ax, + by Yo = aX, + by ‘These two equations will yield the two unknowns a and b, with the required ratios of pulses to the X and Y axis position control systems. At the programmer's level, all that is required is a block of information showing the end point of the straight- line path (the start point is known as it represents the end point of the previous tool motion). Circular interpolation has been developed as a standard control function, to generate an arc as a continuous curve, due to the high proportion of circular ares found in machined parts. As later examples in manual programming will show, the block of information required will contain the end point of the arc, information defining the radius size and position, as well as the direction of travel. If the center of the circle is located at point Q of coordinates xg and yg, and the circle radius has the value r, the general equation of the circle is P= (x - xoF + (9 ~ Yo)? Solving this equation for y, and inputting very smail increments for x, the control will guide the cutter along a circular path well within specified tolerances. Helical interpolation is a three-dimensional extension of circular interpolation. The block requires a plane statement, the end point in three-dimensional coordi- nates, the radius, and the direction of travel. The projection of the helix on the plane defined will be a circle of the radius specified, Parabolic interpolation is a synonym for curve fitting. A circle connected two positions of the tool, a start position and an end position. Its shape was given by the circle radius. The parabolic interpolation can connect three positions, using a parabolic curve. The parabola is usually defined as a set of points, each of which satisfies the condition that its distance from a fixed point (focus) is equal to that from a fixed line (directrix). A special purpose computer system will look at a number of positions. It will fit a parabola based on positions 1, 2, and 3 and store the data for the 1-2 portion. It will then fit a parabola over points 2, 3, and 4 and store the data for the 2-3 portion, and so on. If the distance between points is sufficiently small, smooth sculptured patterns or surfaces can be produced. To the same extent, the parabolic shape can be replaced by an elliptic shape, in which case we have elliptic interpolation. There is, however, nothing sacred about the various interpolation alternatives. They usually require the acquisition ‘of special control options, now superseded by special-purpose machine control ‘combinations. Advanced general purpose controls solve the problem by user macros (parametric subroutines). Any curve, no matter how complex, can be machined Re. 44 Mathematics for Computer Numerical Control Chap. 2 so long as it can be defined mathematically. This brings to the shop floor the ability to machine complex shapes. which used 10 require compute mming, assisted pro; based on one of the major computer graphies packages. User mi 1 in a later chapte examined in det EXERCISES 2.9.1, In Figure 2.22. p. 36, given « > 30’ and 7, ~ 11.75 in., ealeutate X and ¥ 2.9.2, In Figure 2,23 (point A). p. 37. given ~ 25 andy, ~ 2.625 in, caleulate AX and Ay. 2.9.3. In Figure 2.24. p. 37. given, = 45% ce) 1S and y, = 1.00 in., ealeulate AX and AY. 2.9.4. In Figure 2.25, p. 38, given w ~ 40° and 1, — 0.5 in. ealeulate AX. AY, AK AY andj 2.9.8. In Figure 2.264, p. 39. R, AX and AY 2.9.6, Calculate the coordinates of points A and B in Figure 2 ven AP = 40 in. AF — 3.0 in. andy, — LA in, calculate Figure 2.40 Intersection of ww cieles 2.9.7, Calculate the coordinates of points A.B, Cand 2 in’ Rio TvP igure 2.31 Connceting Wvo circular shapes 2.9.8, Calculate the coordinates of points A. B.C. D. Eand F, in Figure 2.32, 1s well as the distance AB Sec. 2.11 Understanding the Fundamentals of Interpolation 45 Figure 2.32 Connecting circles and calculating distance 2.9.9. Calculate the coordinates of points A, B, C, D. E, F, and G in Figure 2.33. Caleulate angles M,N, and P, Verify that M +N + P= 180", Figure 2.33 Complex shape. 3 Computer Numerical Control Systems In the previous chapter we discussed how the special-purpose CNC accepts infor- mation in the form of punched or magnetic tape codes. This input data must be transformed by the CNC into specific output codes in terms of voltages. or pulses per second (pps). The transformed data, output, is used to drive the motors to position the machine slides to the programmed position. These slides, or table drives, are commonly known as servodrives. The principal function of the CNC is the positioning of the tool or the machine table in accordance with the programmed data. Industry has developed two distinctly different types of drives based on how the CNC system accomplishes positioning. These are open-loop and the closed- loop drive systems. 3.1 OPEN-LOOP SERVODRIVES ‘An automatic washing machine is a typical example of an open-loop system. It will perform a fixed cycle regardless of the state of cleanliness of its contents, In the ‘open-loop servodrive control system. the power supply level is set to a position for which the desired speed is indieated by the input. Should the load on the machine slide vary, the servomotor speed would also be affected, However, the speed variance could not be sensed automatically because the system lacks feedback. For 46 Sec. 3.2 Closed-Loop Servodrives a7 ene . woos Figure 3.1 Open-loop CNC positioning conteo. this reason, open-loop control systems can only be used in applications in which there is no change in load conditions. A typical application of the open-loop control is the NC drilling machine. The function of the servodrive is to position the machine slide or table; therefore, the load condition remains constant. Changes in load due to the weight of the component being machined are taken care of by the design of the machine tool. Manufacturers will normally specify the maximum admissible weight of the parts that can be machined on their product. See Figure 3.1. In the open-loop servosystem, the motor continues to turn until the absence of power indicates that the programmed location has been attained and the driving mechanism is disengaged. There is no monitoring of this position, and if any movement takes place at this time, its magnitude would normally be unknown. Nevertheless, open-loop control systems have been refined to 0.0001 inch (0.0025 mm) resolution. The systems are reliable, considerably less expensive than closed- loop systems, and their maintenance is far less complicated. Periodic adjustments are required to compensate for wear, as well as deterioration of servodrive com- ponents, In surnmary, this system counts pulses, and it cannot identify discrepancies in position. 3.2 CLOSED-LOOP SERVODRIVES ‘The closed-loop system used in CNC is characterized by the presence of feedback. The term feedback is used to describe the various methods of transmitting positional information on the machine slide motion back to the information command section of the CNC. This information is continuously compared with the programmed slide motion data. CNC systems use two different feedback principles. The indirect feedback monitors the output of the servomotor, as shown in Figure 3.2a, Although this, ‘method is popular with CNC systems, it is not as accurate as direct feedback, which ‘monitors the load condition in the feedback loop, as shown in Figure 3.2b. “The feedback device is commonly known as “transducer,” and may be rep- resented by linear or circular electric scales, shaft digitizers, magnetic scales, or synchros. All these different feedback methods have one thing in common. If the system is digital, the feedback device is counting pulses. If it is analog, the feedback 48 Computer Numerical Control Systems Chap. 3 ‘reansoucen| Figuee 3.2. Sch Direct Iwedack tn of Feedhack systems. (2) lndiseet Feedback, 4h) is comparing varying voltage levels. A closed-loop system. regardless of the type of feedback device, will constantly try to achieve and maintain « given position by self-correcting to a zero pulse or a voltage null. The indirect feedback system (Fi 3.2) compares the command position signal with the drive signal of the servomotor This system is unable to sense backlash or leadscrew windup duc to varying loads The direct feedback. with its drive signal originated by the table. is the preferred system because it monitors the actual position of the table on which the part i mounted. The direct feedback system is also called “positional” feedback system. Itis more accurate; however. its implementation costs are higher. While the subject of feedback and servodrives is a science in its own right, a description of a rotary type transducer used in a digital system (see Figure 3.3) may illustrate a small portion of a control system. ‘The rotary disk is attached to the mov part of the machine table. The Prnton Figure 3.3 Rotary encoder for d Sec.3.3 Velocity Feedback 49 TABLE 3.1 DECIMAL-BINARY-GRAY CODES Decimal Binary Gray | Decimal Binary Gray ° 00000000 8 1001100 1 0001001 9 100101 2 10 ont 0 oo nn 3 ort ono n nol 1101 4 0100 Ono 2 1001010 5 or ont B nol 1011 6 0110 O10 16 no 1001 7 ont glee 5 ul 1000 pinion (disk) is rotated as the table movement takes place, and each light inter- ruption from the cells creates an electric pulse. If this pulse is the minimum pro- grammable increment, we have a direct one-to-one feedback to the drive command, The encoder is a rotary disk with clear and darkened areas, and it is designed so that for each fixed fraction of a degree, another binary combination is encoded. Figure 3.3 shows a 4-bit encoder using “Gray-code,” a cyclic code generating one change at a time. See Table 3.1. Binary encoders used on earlier systems produced erroneous readings because of ambiguity, or overlap, in reading a code position. The problem was compounded by higher accuracy requirements when 15- or 16- bit resolution was required with a small disk. A four-resolution segmentation is calculated as follows: 360/24 = 360/16 = 22.59 In the previous calculation, the power of 2, i.e., 4, represents the number of rings. The disk, when rotated clockwise, will read the Gray codes as marked. These codes can easily be converted to binary using a simple single flip-flop. Usually optical disks containing 2" to 2'° bits are used, For 2” = 1024, the segmentation would be 360/2" = 360/1024 = 0.3515°. This requires instrumen- tation manufacturing techniques for production, and, as a result, the disks become quite expensive, 3.3 VELOCITY FEEDBACK The positional feedback previously discussed can be implemented to a very high degree of accuracy. However, the system may not provide the required path or surface finish accuracy because no time constraints were provided to reach the programmed or final position. CNC systems used for contouring must have a velocity feedback as well, in order to produce linear, circular, and/or parabolic interpolation, at the same time as acceleration and deceleration velocities. Feedback is normally provided by an AC or DC tachometer coupled to the servomotor. The feedback of the tachometer is used to modify the positional 50 Computer Numerical Control Systems Chap. 3 feedback. The feedback schematics shown in Figure 3.1 and Figure 3.2 do not incorporate a velocity loop. Most actual CNC position feedback loops provide some kind of velocity control inside the positioning loop, even if it is not specifically expressed ‘The importance of the velocity loop can best be described by the example discussed below Example Calculate the displacement inaccuracy of a CNC pulse drive system without a velocity feedback for the following motion: Not9 Got x82.65 ¥44.45 F100 (in metric), or NO19 GOI X3.25 ¥1.75 F3.94 {in inches), where 'NOI9 is the sequence number of the tape block G01 is the preparatory code for linear interpolation X82.55 is the programmed displacement or address along X-axis ‘Y44.45 is the programmed displacement or address along Y-axis, F100 is the tool velocity. in mmvmin in the metric line. ‘The following assumptions are made: ‘+ The smallest programmable increment is 0.002 mm (0.0001 inches) # The CNC has pulse servodrives # To produce the tool path illustrated in Figure 3.4. both slides must start and stop simuttaneously. Solution 1. Caleulate the number of pulses required for both the X82.55-mm and Y44.45- mm displacements. 5 S22 — 41,275 pulses dai ~ 41275 pulse 44.45 or) 22,225 pulses Figure 34 ‘Too! path Sec. 3.3 Velocity Feedback 51 Since both slides must start and stop simultaneously, these calculated pulses corre- sponding to the total displacement must be distributed on a different time scale to produce the resultant tool path 2. Calculate the number of pps required to generate the tool path © X time interval 82.55 mm 82.55 mm__ 9 995 255 mE 0.4255 minutes 41,275 pulses _ vn 0.8235 min. — 52000 Pr 333.333 pps © Y time interval This is established as a function of the X-displacement, in a direct ratio of the two programmed values for X and Y. 44.45 55 0.538462 + $33.333 = 448.718 pps 3. Caleulate the error. ‘The CNC cannot generate fractional pulses. Therefore, the inaccuracy of the system can be calculated as follows: 0.538462 + Xerror 0.8255 minutes - 60 = 49.53 seconds motion time 49,53 - 833 pps = 41,258 pulses (compare with 41,275) 41,258 pulses - 0.002 mm = 82.5169 mm ‘The error = 82.55 ~ 82.5169 = 0.033 mm or 0.0012 inches. © Y-error 49.53 = 448 pps = 22,189 pulses (compare with 22,225) 22.189 pulses « 0,002 mm = 44.3788 mm ‘The error = 44.45 ~ 44.3788 = 0.071 mm or 0.0027 inches. In the case of the velocity feedback, the errors can be substantially reduced by applying @ larger time scale ‘The DC drive systems ean work with fractional voltages; therefore, this error would not occur, ‘Current CNC servosystems are refined to a degree that manufacturers can guarantee 0.002-mm accuracy without difficulty, ‘The control for circular or parabolic interpolation is a great deal more intri- cate. The pps must constantly be varied for both axes in order to generate an are. Readers who wish to study the control aspects of circular or parabolic interpolation should have no difficulty finding texts on the topic of servodrive design. 52 Computer Numerical Control Systems Chap. 3 EXERCISE 3.3.1. Caleulate the displacement insecuraey of a CNC pale drive system havi Feedback. for the following motions: NO6O GOI X3.756 YE.925 21.25 F6.0 {in inches), and Na70 GOI x62.05 ¥17.372 222.117 F221 (in mim) Por each axis. ealeulate the following date in inches and metre separately # Number oF pues requited to carey out pre 4 ‘The time corresponding 10 «eh SoC of pues 18 The respeetive puke fate in pulses'mén (ppm) and pulses'seennd (PPS) The ernie, or inagvursey 3.4 POINT-TO-POINT POSITIONING CONTROL The principal function of the point-to-point positioning control is to position the tool from one point to another within a coordinate system: therefore, the control ix most often referred to as a point-to-point NC system. The positioning may be linear in the X-Y plane, or Tinear and rotary if the machine has a rotary table Each tool axis is controtled independently: therefore, the programmed motion may be simultancous or sequential, but always in rapid traverse. Machining can only take place after positioning is completed. The most common applications of the point-to-point control are in drilling. boring. tapping, riveting. pipe bending, and sheet metal punching Figure 3.8 Too! pul ol point-to-point contra! Sec. 3.5 Straight-Cut Positioning Systems 53 TABLE 3.2 PATHS OF THREE DRILLED HOLES ‘Tool Path Motion Programmed Sequential Simuluneous | From To X25.00 ¥35.00 | Qhacl or Oct Ob 0 t 50.00 ¥-20.00 | 1-2 oF 1-62 2 I 2 20.00 ¥30.00 or B83 2 3 In addition to positioning, this system is capable of controlling auxil tions such as tool change, spindle and coolant on and off, part or fixture clamping, indexing, etc. These on/off type of relay functions do not require intricate control logic, nor do they have any velocity (feed) control. The tool path of point-to-point control is illustrated in Figure 3.5. If the positioning is sequential, the system will move in one axis at a time (as illustrated by the dotted lines). If the positioning is simultaneous, both axes start to move at the same time. Assuming that both drives have the same speed, the tool path will be approximately 45° to the point where the lesser of the two dimensions was completed (as illustrated by solid lines). From this intermediary point to the final programmed point, the motion will be parallel with the primary axis of the system ‘The paths described in Table 3.2 are an additional illustration of the drilling of the three holes shown in Figure 3.5. Most point-to-point NC systems are built with open-loop drives. 3.5 STRAIGHT-CUT POSITIONING SYSTEMS ‘The straight-cut positioning system provides a limited degree of control during the positioning of the tool trom one point to another. Most of the straight-cut systems are fitted with manually adjustable feed control. This feed control is shared by all the programmable axes of the NC machine, which allows the system to perform milling, in addition to the drillinglike operations outlined in the previous paragraph. Because of this shared feed control feature, the system can also perform milling operations at 45° to the primary axes of the machine Realizing this limitation, the programmer can reduce the programmed steps to small enough increments to mill any straight-line pattern and produce the re- quired surface finish and accuracy for most industrial applications. The accuracy this system can produce would most certainly be sufficient for any rough milling application. The tool path of the straight-cut system is shown in Figure 3.6 and by the following example: 54 Computer Numerical Control Systems Chap. 3 \arouinen r00l PATH Te ae a wo Ge He Be BP Wee via vo Figure 3.6 Tool path of sts ° system Example sic! Yo0.00 mm. sult at a took pa ‘The coordinates of point P2 are X1211.00 mm Programming these dimensions would with the following error he trom Ht 1 co PD Error distance la - 1s sine = Fesina VENT sine anda = 48° BAS 26.505" = 1845" Phe value of B was ubtained from the X-Y eourlinates of point P2 Continuing the calculation. Fervor — V2~0s)' + sin 18435) D> (ONE sin ENS 26.8328 mm This value of the error is obviously too Hare Reducing the programmed increments to X40.00 ma and Y2U-U0 mm would result ina tool path of Ot 2 to PR, and the error would be: Enror — VEOQY since = VEO ROP = sin 184359 8.944 mm This value is proportionally less, but stil far too. Using this method, we ean reduce the programmed increment to seps small enough to yield the desired aceursey It the programmed steps are XO. mn 1 Y0.25 mm. the ctor would be nor © V2 sin 18.435" = 0.039 mm, This value is sufficient for rough milling and for some finishing applications. The steps could be further reduced: however. the programm of the tupe would become: prohibitive L-cut positian Sec. 3.6 Contouring, or Continuous Path CNC Systems 55 drives, with programmable accuracies of 0.0022 mm (0.0001 inch). These systems are most often built with programmable spindle speed and with various preparatory (G) codes. 3.6 CONTOURING, OR CONTINUOUS PATH CNC SYSTEMS ‘The contouring system is the state-of-the-art, intricate of the CNC devices. It generates a continuously controlled tool path, by intepolating intermediate points or coordinates. By “interpolating” we mean the capability of computing the points of the path. All CNC contouring systems have the ability to perform linear interpolation. This feature is a computer subroutine, permanently recorded in the CNC computer under a G01 preparatory code. G01, programmed with X-Y or X-Y-Z dimensions, is an instruction to interpolate a tool path, in its shortest distance between two points, ‘The best way to illustrate the usefulness of this feature is to compare the programming effort difference between contouring and the previously discussed straight-cut system In order to program the tool path from 0 to PI in Figure 3.6, we would require a single tape block on a contouring system, as shown below: igh-technology, most versatile and N100 Got x120.00 60.00 F. This line will produce a tool path to 0.002-mm tolerance. Using the straight-cut system, the program shown below will require 240 tape blocks and will only yield a tolerance of 0.039 mm. NV... X0.50 0.25 from zero 0 X0.30, ¥0.25 N2..... X0.60 ¥0.25 to X1.00, Y0.50) NB... X0.60 0.25 to X1.80, Y0.75 N240 .. . X0.50 0.25 to X12, YE Most contouring systems also have a circular or parabolic interpolation feature. The programming of circular arcs is also doné in one tape block: however, in addition to the appropriate preparatory (G) code, :uiditional dimensions must be programmed to identify the relationship between the start point and the are center Most contouring systems have programming capabilities of four or five axes ‘A large percentage of contouring CNC systems are built with positioning and velocity feedback di 86 Computer Numerical Control Systems Chap. 3 3.7 ADVANCED CNCs CNC builders have taken full advantage of the capabilities of the microprocessors used in the modern controllers. ‘The proliferation of unity and features blurs the distinctions that used to exist among CNCs. Thus. for instance, the Allen-Bradley CNC mentioned above can be listed here as well, together with units trom well: known suppliees such as Cincinnati Milacron, Giddings & Lewis, Fanue, General Numeries. GE Fanuc. Kearney & Trecker. Yasnac, Mitsubishi, and many more Each manufacturer groups and describes the features of the equipment it produc posite of some of the more advanced features of a number of CNCS in different ways. The list below will attempt to provide a generic com- © Color graphies CRT display—size and resolution © Memory size-—standard and option © Too! life management with automatic cutter compensation of spare tool © Resident diagnostics. ¢ Environmental features—temperature. humidity, power. grounding, sealing, airconditioning, internal compartment separation The latest series of CNC systems have extensive new features. but their most meaningful contribution is in the way these features have been integrated. Some of the more significant controllers will be examined. in no particular ‘order. It should be noted that some are produced by fong-standing muchine-tool manufacturers. white others come from companies that are primarily eleetronie electrical, automation, or industrial control specialists Cincinnati Milacron. Cincinnati Milacron iy primarily a machine-tool man: ufacturer, producing machine-tools, robots, and their controls. Among others. it has a full range of CNC controllers. such as 850 TC CNC series tor turning, 880 MC and 950 MC for machining centers. 700 G CNC for grinding applications, ay well as robotics controllers and soltware packages for are and spot welding, ma- terials handling, plastic injection, and blow molding ancl extruders. ‘The use of ONC systems has been extended to waterjet cutting machines for control of not only the tool path but the entire technological process including a 60.04 psi waterjet processing system, Other areas are laser culting of composites, enyraving. trim, heat treatment, coordinate measuring machines and electrical discharge machines (EDM). all well-established areas where CNC proved itsell to be of primary im- porta ce. ‘Two of the most recent applications are in Flexible Manulucturing Systems, (EMS) and Composite Tape Laying (CTL). ‘The PMS uses CNC equipment en- hanced with spectal or added communications and material handling capabilities as well as some sort of process inspection. CTL. isa new technology. and the special purpose 975C CNC system can also handle other fiber plicement machinery ap plications. Up to ten axes may be used ty make automated layups of graphite Sec. 3.7 Advanced CNCs 87 epoxy, graphite/bismaleimide (BMI), and other composite pregregs. It is antici- pated that the use of thermoset materials will be accelerated by the requirements of the aircraft and aerospace industries. Cincinnati 850 Series. Cincinnati Milaeron Acramatic 850 MC was designed for high-performance machining centers. It provides control for three linear axes plus an optional fourth rotary axis. Some of its more advanced features are: ‘* Simultaneous machining and programming, with a true “foreground/back- ground” feature, provided by the new family of multitasking controllers, © The use of custom macros. © Resident diagnostics with a library of hundreds of errors and malfunctions. ‘© Multiple display pages providing more information for the operator and greatly reducing the misinterpretation of messages. ‘© Menu driven multicolor interactive display. ‘* New tool data management allowing the user to store information such as tool-length, diameter, flutes, etc., as well as the location of over 150 tools. The system also allows sharing the tools among various jobs, keeps track of tool life values, and warns the operator when a tool should be replaced ‘© Custom macros for contouring, pocketing, face milling, or hole-pattern ma- chining. The hole-pattern subprogram allows the user to define up to five processes, such as centerdrill, drill, ream, tap, and chamfer. It also provides many other time-saving features for the programmer when writing part pro- grams for rough, rough and finish, rough leave stock, and finish. © Using multiple G and M codes in the same block. © Built-in calculator, including trigonometric functions, for quick and easy pro- gramming. © Dry-run graphics, coordinate system rotation, workpiece alignment mode, ete « Process interruption no longer presents major problems due to the feature of “automatic return to cut.” Offsets are expanded from tool to fixture and pallets. Fillet/radius feature in menu allows for easy surface blending. Use of robots in conjunction with probes for settings or in-process gaging. Operator messages or alerts. color coded to emphasize the severity of the problem. « Record-keeping feature, with the ability to record 256 alerts and up to 995 start-ups, information that can be accessed at any time during the machining cycle. eee Cincinnati 950 Series. The 950 Controller is a true state-of-the-art five-axis CNC System, and the integration of its capabilities point to the requirements of 58 Computer Numerical Control Systems Chap. 3 the factory of the future. The high-performance Machine Mechanism Control allows it to follow instructions to give commands to other equipment or devices, such as robots or probes for setups or in-process gaging. Its programmable machine in- terface can expand to 192 K of code and work with up to three independent dedicated processors. Some of the most important features are: Touch screen and pop-up windows, activated by user * Wordprocessor type editing, allowing for quick scarch of characters (single, strings, or blocks). The programmer can insert, erase, copy. or define new or old programs. 20 MByte hard disk storage, allowing for storage of a large number of library subroutines. This also extends the too! management scope to 200-500 tools, as tables of tool data, location, and wear. # System efficiency has been increased to include automatic inch-metrie ca- pability, high-speed probing. and torque-controlled feed function. «System security through a password setup with several levels of access priv ilege: System accuracy enhanced through a 20 block look-ahead, allowi jon in sharp cornering. g tor timely acceleration and decclera ‘* System diagnostics monitor constantly all potential problem areas, particularly the servosystems that can be monitored and adjusted individually on the screen. Paper management information is optional. System communications have a high level of management flexibility. The user can interface CNC tape readers, high-speed computers or printers, har code readers, port counters, ete., including all necessary equipment for manage- ment information reports # System potential. ‘The open-ended design lends itself to FMS or CIM adap- tation, addition of axes, or BCL. or ACL implementation General Numeric. General Numeric is a sales and service organization for wo essentially electronic/clectrical companies, Siemens from Germany and Fanuc trom Japan. These well-known companies manufacture an almost endless range of products, available under the General Numeric (GN label), as well as their own individual models. The Fanuc Series (0/100/110/120/150 are the new series of CNCs, integrating three types of control function that require definition . Man-Machine-Control (MMC) refers to the human interface with the control system. Machine-tool builders integrating the control in their system ci create software to enhance the performance of the machine, develop and protect conversational mode screens using their choice of programming lan- guage, cle Sec. 3.7 Advanced CNCs 59 2. Computerized Numerical Control (CNC) is not a new label. What is new is the fact that it becomes now just one of the integrated parts of the new advanced control 3. Programmable Machine Control (PMC) refers to the control of auxiliary machine functions such as tool change, spindle control, work handling, etc., by developing, for instance, setup software tailored to a specific machine. High speed interchange of related information among the above functions allows for the best possible fit between machine-tool, control, and user-production needs. ‘The Fanuc Series 15 covers a selection of computers developed as Attificial Intelligence CNCs, incorporating the latest hardware advances. Its high speed makes possible the management of high speed and high precision digital servosys- tems, high-speed PMC functions (unaffected by the fluctuating mechanical loads), intelligent failure diagnostic guidance, etc. It allows programming in Pascal or Ladder language and has modularized inputsioutputs with 1024 input and 1024 output points (I/O). A number of the CNC functions have been enhanced to increase the efficiency of the machining cycle. The system can be further customized by judicious combination of custom macros and MMC, conversational automatic programming, and communications features allowing Local Area Networking (LAN) and connections to the Manufacturing Automation Protocol (MAP). Mitsubishi Meldas 300. ‘These have specifications and performance abilities fairly similar to Fanuc. The manufacturer emphasizes modularization and the abi of the machine-tool manufacturer or the user to put together from a very simple CNC to an ultra complex system. Some of the more distinct features are com- munications, advanced programmable logic controller features, such as automatic measurement, machine diagnostics, and adaptive control. Other special attributes are shop floor graphics, programming, data collection, and many more. Kearney & Trecker, This is another machine-tool manufacturer producing a wide product line. One of the more recent systems is the ORION, with its own Gemini Modular D CNC. For customers who have a particular control preference, the system has been designed to accommodate a wide variety of controls, including General Electric/Fanuc or Allen Bradiey. Some of the features of the Gemini are modularity. full tool management capabilities, adaptive control of speeds and feeds, hard disk memory for all data, as well as operator assistance through a set of menus and prompts. Giddings & Lewis. This company produces a comprehensive line of machine tools as well as the CNC 8000, its new microprocessor-based control. This control hhas a long list of features, some of which are tape cartridge storage, parametric subroutines, macro subroutines, previous control tape compatibility, 8-axis touring, ladder diagram logic machine interface, automatic “return to path. tomatic in-process gaging, adaptive control, tool retract-reentry. ete. con- 60 Computer Numerical Contra! Systems Chap. 3 Bridgeport. Bridgeport is a well-known machine-tool manulacturer. Its more recent product line is equipped with well-known CNC controllers trom Heidenhain and Fanuc. Allen-Bradley. This is an industrial control manufacturer which supplies & CNC controiter in addition to an extensive line of programmable controls. The series 8200 CNC with S00-Advanced Technology (AT) Option has features such ay a 12-axis capability. an enhanced human interface with sott keys. color CRT, and help files, additional memory and VO slots, paramacro programming. etc. The combination of additional memory and 1/O capacity of the 8000-AT and advanced communications of the 8200 facilitate features such as workcell and FMS integra tion. Allen-Bradley is also one of the pioncers of networking of its systems to the VistaMAP broadband Local Area Network (LAN). 3.8 BINARY CUTTER LOCATION (BCL) EIA Standard RS-494 defines BCL as @ "32 Bit Binary Cutter Location Exchange (BCL) format for Numerically Controlled Machine Tools.” Some of the features. of BCL are: # It defines input command records. # It outlines the response of the machine too! ‘* Torients the machine/control system to the part it implements part program portability among various machine/control sys- tems. It provides a standard interface to the various machine tools on the shop floor Iteliminates altogether the need for postprocessor purchase, installation, andl update/maintenance Part-Machine Connection, ‘The machineicontrol system has the machine co- ordinate system defined in a package that can be built in or retrofitted. depending fon the vintage of the machine. ‘This software also comprises the rekitionship be tween the part and machine coordinate systems. and their reciprocal position must be set at the beginning, Binary Files. These represent a collection of records. expressed internally in binary, and represented in the printouts i hex (short for hexadecimal, oF base 16 numbering system). ‘The file is called “sequential.” as it contains “records” in sequence, one after the other. These records, which may have variable lengths, are defined as groups of 32-bit words (a bit is a binary digit, either 0 or 1). The group starts with a 32-bit header, whieh could he FEDRAT. COOLNT. ete,. oF other terms familiar to APT users and easy to understind for nonusers. The se- quential file is in reality nothing but the old program, and the records are “program Sec.3.8 Binary Cutter Locations (BCL) 61 words,” grouped in blocks which used to be separated by an EOB (End of Block) code. Understanding BCL. A 32-bit number may be considered as comprised of two 16-bit parts. The first 16 bits (the “upper” 16 bits) contain the code for a “major” word, such as FEDRAT or SPINDL. The “lower” 16 bits contain the CL (cutter location) record number in the program. Other 32-bit words may represent “minor” words (such as FLOOD, MIST, etc.), directions, or coordinates. For instance, the Hex number 00E4 E1CO can be converted to decimal 15 000.000. As the multiplier is 10 000, the conversion has yielded 1500, representing 1500 RPM These conversions are built in the various computer systems, but for those desiring to try a conversion at least once, using a calculator, here is the method. The above hex number, using 16 digits (from 0 to 15, where beyond 9 we count A for 10, B for 11, etc.), has its digits multiplied by subsequent powers of 16 (hence the “hex”): 16° = 1: 16' = 16; 16? = 256; 16° = 4096; 16* = 65536, etc. O0E4 EICO [Le 0 x 16° = 0 12 x 16° = 192 1x 16 = 256 14x 16 = 57 344 4x 16'= 262 144 14 x 16° = 14 680 064 15 000 000 (Nore: C in hex corresponds to 12 decimal, and E to 14) Essentially BCL-formatied data allows the CNC program, once proven, to be used by the machine tool without the need for subsequent postpro- cessing. Some of the immediate advantages of this process are as follows: @ Standardization of formats for exchanging (transporting) programs between CNC, CAD-CAM, and PLController systems. © Elimination of need for postprocessors, with its logistic, programming, main- tenance and overall cost implications, incompatibility of some programs with some machines, etc. © Solving the problem of tape-based program storage needs, as the Lloppy disc stores the equivalent of 1000 ft of tape in a small fraction of the required space. © Solving the non-stop juggling of machine scheduling, when the machine avail able at a particular time is not the one for which the next part's program was post-processed. The solutions available to date, all costly, were waiting for the machine to become available, prepare a newly post-processed program for a different machine, or prepare several different programs for each part! machine possibility. 62 Computer Numerical Contral Systems Chap. 3 ‘¢ Most reasonably recent controllers can be converted 0 accept BCL data with, minimal problems and cost A sample of the BCL approach ean be illustrated in the followin, S274 (present stanshoecl) RS 494 - BCL 0 (or G7) Uninctnches 1 (or G71) UniteMetic N—_ Mos Cookint/Floo.! NFM Fedeats0 GIX 500 ¥R25 Z= 475 GOTO! s, BCL can be obtained as direct output of CADICAM. It uses the part coor dinate system, and its data “is” the CNC part program. It will output programs in the BCL part program mode (part cartesian coordinate system). This in turn is input to 2 BCL machine/control system (machine cartesian coordinate system) Trends. Work has becn done recently on a modification of BCL, ACL. where “B™ ay in Binary is replaced by “A” as in ASCIL 4 Machining Forces ‘The programming of feeds and speeds is the responsibility of the part programmer. While the programming accuracies relate to the dimensional accuracy of the work piece, the programing of feeds and speeds relates to the efficiency of the machining process. As a result, they carry equal importance in CNC programming, As in the previous paragraphs, we shall discuss only the most important formulas. The most important consideration in the selection of speed and feed is the available horse~ power of the CNC machine tool. Generally, the power required for drilling, milling, ‘or turning is expressed in terms of the average unit power. The average unit power is the power required to remove 1 cubic inch of metal in 1 minute. 4.1 DRILLING 4.1.1 Cutting Speed (Vc) See Figure 4.1 for illustration of drill area. At Point Az in inches: 8 a v, = 7" feet per minute (fpm) Machining Forces RAKE FACE JpowraNcue Recarive rie peor Figure 4.1. Drill ares in metric: _dewen = en Where Cutting velocity = Drill rpm d = Drill diameter (in inches or mm) 4.1.2, Rate of Metal Removal (Od) In inches: Qd = A-n-F in in%min In metric: oa - 4 iw in em'/min Where Qd = Volume of metal removed in inYmin or em"/nuin n= Drill rpm be Feed in inehes or mm per revolution of drill A= Area = in square inches or mm? Chap. 4 Sec. 4.1. Drilling 6 ‘CONSTANTS 0) onLUNG | wituNG | TURNING ILO STL. 25 RG 10 8 Mio STL. 25-9086 | ve i 7 ARO STL 50RC 15 ‘SOFT CAST IRON ® 7 5 HARD CAST IRON 10 "ALUMINUM 38 “ 2 BRASS 3 6 4 BRONZE @ 2 7 STAINLESS 400, 1 us STAINLESS 900 16 17 TITANIUM ut IGKEL ALLOYS 16 18 Figure 4.2. Table of constants 4.1.3 Horsepower At Spindle HPs = k + Qd at 100% efficiency Where HPs = Horsepower required for machining Qd = Volume of material removed in in‘’min or cm'/min k Since 100% efficiency is a theoretical value, we must in fact alter the above equation in view of the efficiency (E) of the spindle drive. In practice, E may vary from 0.7 ~ 0.85 depending on the condition of the machine tool. The practical formula for calculating the horsepower (HP) will therefore change to: _ k+Qd "OE where HPm represents the horsepower of the spindle drive motor. Material constant, as showa in Figure 4.2 HPm 4.1.4 Torque on Spindle Due to Drilling (Ts) _ 63030 + HPs Ts (Nore: Horsepower is the unit of power adopted for engineering use. HP = 33.000 ft Ib/min = 550 ft Ilvsec. Metric horsepower = 75 kg - misec = 542.5 ft Ibisec. While the International System (metric) unit of power is the watt, its applications haven't yet reached the usual engineering tables.) 66 Machining Forces 4.1.5 Mact g Time Machining time is expressed in terms of minutes, L re I where L. = Depth of drilling in inches or mm F — Feed in ipm or mm/min 4.2 TURNING 4.2.1 Cutting Speed (Vt) Sce Figure 4.3 for illustration of turning, Dian Vi = fpm in inch units or , Demn Ve = =" nimin in metric TOW 4.2.2 Rate of Metal Removal (At) or + Fen-e — ininYmin or em‘imin Figure 4.8 Tar Chap. 4 Sec. 4.2 Turning 67 Where Qt = Volume of material removed F = Feed in ipr or mm/rev n= Part rpm D- T = Depth of eut > C = Circumference D- 42.3 Horsepower HPm = ue HPm is the horsepower of the spindle drive motor. 4.2.4 Torque on Headstock due to Turning _ 63030 - HPs ~ n Ts 4.2.5 Surface Roughness The theoretical surface roughness (Sr) can be calculated by the formula below However, this should only be used as a programming guideline. Actual surface finish depends on a number of other factors, such as sharpness of tool, coolant, tool part rigidity, etc. Therefore, the calculated result may vary substantially if any or all of the above factors are not ideal. F . Sr= microinches, or 3000 F Sr = —~ micrometres Ber Where e " Feed rate in ipr or mm/rev Tool nose radius in mm or inches 68 Machining Forces Chap. 4 4.2.6 Acceleration and Deceleration Distance for Thread Turning ‘The programmer must allow a distance 4, for the (ol to accelerate 10 a constant (programmed) feed rate and a distance A igure 44. Since the tool point velocity (ized rate) will change from zero to the programmed rate in the A, interval, the thread cut on this distanee will be imperteet. ‘The same condition applies to the Ay distance. The formulas below can be used as a guideline if specific formukas are not provided by the manufacturer of your CNC system, “The value of the time constant ¢, of the system, provided by the manutacturer, is a function of the specific system dynamics, Factors such as the weight of the tool slide or turret, coetficient of friction, size and torque of the servodrive, servogain, etc. influence the specific CNC ‘The Fanuc 4NE system, used in our example, has a time constant 1, = 0.12, Muttiplying this by the linear velocity of the tool point, Ay = 4 ~ ¥, allows us calculate the distance required to decelerate the tool from the programmed feed (velocity) to zero. for deceleration. See me constant Example Caleulate the deceleration distance required to turm a H"-S api thread at ASU rpm. Solution Spi = 01.125 ipr ‘The linear velocity of the tool point will be (125 inch for exch revolution ‘The linear velocity of the tool point at 350 rpm: ¥, — O.125 350 = 43.75 ipm = 0.729 ips Ay = Vy = 012 = 0.729 ~ 0.0875 inches which is the deceleration distance. F Figure 4.4 ‘Too! point acceleration-de celeron Sec.4.3 Milling 69 ‘The acceleration distance calculation requires a value for the acceleration time constant, t,. This is calculated as follows: “ rane ncexe(2) wa Where EXP is the abbreviated version of “e at the power of...” where ¢ = 2+ 7182818. Using natural logarithms on both sides of the equation, we obtain = In 0.05 = =2,99573 (-2.99573) or 0.12 + 2,99573 = 0.3595 Substituting this value into the above equation we obtain: 0.3595 — 0.12 + 0.3594 + 0.05 = 0.2455 The acceleration distance can now be calculated from the formula: Aya VY, Example Calculate the acceleration distance required to turn a 144"-8 tpi threads at 350 rpm. Solution As in the preceding example, 8 tpi = 0.125 ipr V, = 0.125 - 350 13.75 ipm = 0.729 ips and Ay = t- V, = 0.2455 «0.729 = 0.1789 inches is the acceleration distance. ‘The A, distance varies between 2 to 4.4 times the A, for CNC systems, or Ay = 2~44-Ay 4.3 MILLING 4.3.1 Cutting Speed (Vm) Den vm = ae fpm, where the diameter D is expressed in inches. 70 Machining Forces Chap. 4 and Dian vm 1000 mvmin where D is in mm. 43.2 Rate of Metal Removal (Qm) O,, = We T > Fin'imin or Wet 9, = 1000 em*/min(metric) where Q,, = Volume of metal removed in in‘/min or m/min, as applicable: W = Width of cut in inches or mm 1 = Depth of cut in inches or mm F — Programmed feed in ipm or mavmin: 4.3.3 Horsepower Q HPm 4.3.4 Torque on Spindle Torque on the spindle can be calculated as 63030 - HPS " “The calculations and formulas presented in this chapter are for ideal machining conditions, The reader must adjust the calculated values if the rigidity of the setup is not as good as desired or if the tool deflection. due to the cuttin undesirable (destructive) vibrations. forces. create 5 Cutter Centerline Programming Before getting involved in the actual programming, we shall briefly review some of the very basic codes and principles. Absolute Programming. is a mode of programming in which an origin has to be selected for each axis prior to starting the program. Once this “part program origin” has been selected, all motions have to be stated with respect to this origin. What this means is that all motions defined in the program are in reality “locations” or “addresses” of the particular point defined in relation to the origin Usually this is the mode of programming selected by experienced programmers. as the programmed values match fairly closely the values defined on the engineering, drawing. The drawing’s datum point is a direct equivalent of the program origin. In milling programming, the absolute mode is established by the use of the preparatory code G90. In turning, the use of the tape words X and Z means that the cross direction and the longitudinal direction are programmed in absolute, without requiring a particular preparatory code. Incremental Programming. When programming in incremental, an origin need not necessarily have been selected. All motions are stated from the immediate last position of the tool. This means that all incremental motions are “displace- ments” from a given position. The immediate short-range advantage of incremental programming is that the programmed motion matches directly the actual motion n 72 Cutter Centerline Programming Chap. § of the tool. as both take plice from the last previous position of the cutter. Another advantage is that the sign of the motion is also directly related to the tool motion. In incremental programming. a positive dimension will cause a tool motion in the appropriate direction, and a negative one will take place in the opposite sense, In absolute programming. the sign depended on the quadrant the tool moved in, not in the dircetion of travel In milling programming, incremental is programmed using the preparatory code GOL. In turning. incremental may be programmed the same way. or using the letters U and W to repkice X und Z. in which case the preparatory code G9t is not required, Programming the Origin. Establishing. the origin of the part program for subsequent use in absolute programming is known under several terms such as register preset, work origin setting. program zero point, or position absolute coor. dinates seting. This proliferation of terminologies exists because NC technology is, fairly new, and yet it has expanded too rapidly to allow standardization to catch up with it ‘A program origin and a coordinate system are a must. The program origin preparatory code, G92 in milling and G30 in turning, will not cause any motion. ‘The code will tell the system where the tool is located at that given time in relation with the program zero. In reality, the machine knows where the tool is and does not know where the program origin is. Therefore. when we tell the machine where the tool is in relation with the work zero, we are really telling it where the work origin is in relation to the known position of the tool. From there on, absolut programming will give addresses from this datum point Rapid. ‘The G00 (G zero zero) will result in rapid positioning of the pro- grammed machine slides to the required location. ILis used for rapid approaching of the part, or for rapid moves between holes in drilling or boring applications. The tool or the table will always travel at the highest machine speed. It should be borne in mind, however. that regardless of the actual element of the machine that provides the move. in our progeaim itis the tool that moves in relation to the part In most controls (there are some recent exceptions). the rapid motion will follow the “point-to-point™ pattern, i.e.. all programmed axes will start simult neously, and as one is achieved, its motor will stop while the others will continu as required. A safety reminder may be in order for people who sometimes lean on machine components. Ht iy not unusual for a CNC machine to move in Rapid at 10 ips Capproximately 250: mms) Linear Interpolation. ‘This feature is programmed using the preparatory code GOL (G zero one), in conjunction with the appropriate dimensional tape words, as well asa programmed feed. The corresponding machine axes. with their own variable speed-controtied drive systems independent from each other, will produce the required straight-line motions by driving the slides at different speeds, Sec. 5.1 Calculating Cutter Centerline Distances 73 Circular Interpolation. ‘Two codes are used in programming a circular arc, G02 (clockwise) and G03 (counterclockwise). The CNC system has the capability to establish and maintain the relative positions and velocities of two machine slides, on a constantly changing basis, but starting and stopping at the same time. At the start of circular interpolation. the control knows the position of the cutter. It must be told the desired position at the end of the programmed are, in either incremental or absolute coordinates. The control also has to know the lo- cation of the center of arc and the value of the arc radius. This may be achieved using I and J or K tape words in older controls, or R (for radius) in the newer ones. Subsequent programming examples in this chapter will illustrate this partic- ular technique. This chapter will present, in some detail, cutter centerline programming. Its importance is underscored by the fact that older systems can only be programmed in cutter centerline. Newer systems, with advanced cutter compensation features, are much easier to comprehend if cutter centerline programming is known and understood. In addition, in some special cases, of very intricate parts, the use of the compensation features may present a complication, and the programmer can solve the problem and get the job done by using an “old-fashioned” programming method on a state-of-the-art CNC system, ‘The program will guide the cutter around the part contour. The cutter will have to follow the path at a set distance away from the part, at every point, corresponding to the cutter radius. Parts with complex geometry will require a certain level of calculations, mainly trigonometry, so a review of the math chapter may be necessary. 5.1 CALCULATING CUTTER CENTERLINE DISTANCES To write a part program for the outside contour milling of the job illustrated in Figure 5.1, we shall first have to select a cutter (end mill) diameter. In cutter centerline mode, the cutter center is programmed, yet the actual cutting is performed by the edge of the cutter. In order to obtain the required shape of the part, the cutter must be correctly placed at each point (1, 2, 3, to 8 and back to 9) and of course in between, as shown in Figure 5.1 ‘This placement is that of a circle (i.c., the cutter) tangent to a line or circle representing the part contour. ‘The line connecting the cutter center to the cutting edge at the part (cutter radius) will be perpendicular to the part contour being cut. This requirement of perpendicularity at a known location, combined with the knowledge of the cutter radius (half the cutter diameter) will enable us to calculate the cutter center location at each point by solving appropriate right triangles, as shown later in the chapter. The program drives the machine spindle where the center coincides with the cutter center. Bear in mind that regardless whether the cutting action is achieved by moving "4 Cutter Centerline Programming Chap. 5 Lorn (2) SURFACE CUTTER CENTERLINE TRACE “+ pe APIO (Cromer - — =X 7 Ete 500 DIA CUTTER: i. Figure 5.1 Cutter centerline proxy the cutter or the part, in programming it is the cutter that is assumed to be mobile and the part that is considered stationary. Always think tool? Having calculated these dimensions. we must then convert them into pro- grammable distances. ‘The actual values of these distances will be different de- pending on whether we use incremental or absolute programming, The calculation Of the values may take up more time than the actual programming, and the reader may be tempted to skip straight to cutter compensation or computer-assisted pro- gramming. However. neither can be properly understood and used without « strong, foundation in cutter centerline programming. In the following. we shall discuss the necessary steps required to calculate the center point locations of « 0.500-inch-diameter cutter, in “incremental” pro gramming mode. We will alyo assume that the part has been bandsawed to size. leaving approximately 0.150 inch for finish machining, and that the material is SAE 1030, ‘The programming methods illustrated below can be used for any similarly shaped part so tong as the machine codes have been double-checked for the actual system used. START UP NOOT0 G20 G40 GEO GOT Inch pro: ring (C20 or G20, sl cane eves. inevensentil ning, The cancels” ane tor Sec. 5.1 Calculating Cutter Centerline Distances 5 As mentioned at the beginning of this chapter, inexperienced program: should start programming in incremental (G91). The incremental motion is a placement” of the tool from its present location, as opposed to absolute, which takes the tool to an address or a location defined in relation to an origin. Incremental provides a direct correlation between programmed motion and tool motion. 10020 G92 XO YO ZO —_—_Set control display to zet0, to correspond to the machine "zer0" position Noo3o $800 Mos Spindle speed 800, spindle start clockwise NOO40 GOO X4.75 5.95 “Rapid” to part in X and ¥ No0s0 Z-6.4 Rapid to part in Z. leaving 0.1 inch clearance NOO6O Got Z-1.15 F3.0 Feed 0.05 inch past part at 3 ipm No70 x0.3 Mos Feed to point 1. coolant on 5.1.1 Machine Part Surface “A” Between Point 1 and Point 2 Since the necessary “Y* motion is not readily available on the part drawing, we shall have to calculate it from the given dimensions. There is no “X motion from point 1 to point 2, However, the “¥” motion will be longer than the 1.5-inch length of surface “A” by an amount AY2 (see Figure 5.2) This calculation is necessary in order to position the cutter radius pendicular to the upcoming surface “B” AY2 = r-tan (s -F (5-1) = 225 tana = FS = 0.75 ex = 36,8699" R= V3. + 2.25 = 3.750 sin o2 = 23 = 0.2 al = a + a2 = 36.8699 + 11,5369 = 48.4068" Substituting al into equation (5-1), we obtain AY? = r-tan (ss _% es) = 0.25 + tan 20.7966 = 0.0949 inch 76 Cutter Centerline Programming Chap. 5 4 to be pro: ¢ AY2 value, we can now derive the ¥2 value, motion from point 1 to point 2 S415 + 0.0049 = 1.8449 inches Having calculated th grammed as the © YIore154ay2=0. and the next program line will be Noog0 ¥1.8449 Move cutter. i feed, to point 2 5.1.2 Machine Part Surface “B” to Point 3 and Arc to Point 4 We must now calculate the dimensions V3 and YS from Figure $.3, prior wo programming the tool motion from point 2 to point 3. These dimensions again cannot be readily taken off the drawing, as iy the case in-most programming applications, Calculations similar to the ones above are required for ave to Sti line translations. From the previous calculationy we te al = 48.4068 AY2 = 0.0999 inch r= 0. radius) inch (the cutte R = 0.75 inch (the part radius) AYR = r- cased = 0,25 © cos XANGA? = 0.1659 inch AY = Re cos wt = 0.75 + cos ASAWOS = 0.4978 inch S + A+ ays ~ ay? V3 = 22 2.28 + OAOTS + 0.1659 (0.0049 — 2.STS8 inches Sec. 5.1 Calculating Cutter Centerline Distances Figure 5.3. Cutter centerline geometry at straight-line and circular arc inter~ section, This will be the ¥-motion from point 2 to point 3. AY = r- cos al (5-2) AX = r-sinal (53) Aj = R-cosal (5-4) and Ai= (555) j= aj + ay3 and i= Ai + AX3 AX3 = r+ sin al = 0.25» sin 48.6068" = 0.1875 inch. Aj = R> sin al = 0.75 - sin 48,6068" = 0.5625 inch X3 = 3.0 +r — (AX3- Ai) = 3.0 + 0.25 — (0.1875 + 0.5626) = 3.25 — 0.7501 = 2.4999 inches “This will be the X-displacement from point 2 to point 3, and the next program will be No0g0 X2.4999 Y 2.8188 To point 3 78 Cutter Centerline Programming Chap. 5 To machine the 0.750-ineh radius are, we have to program the X= and Y-displace- ments from the start of the are to the end point of the are. ay well ay the values nd “Yj.” required to position the center of are ia relation to the start point of the arc. Point 3 is not on cither of the primary axes (X or Y) of the system of coordinates. I may be worth pointing out at this time that ay NC systems changed, they became progressively easier to program. Unlike many of the old machines still in-use, the modern CNCs have no constraints of primary axes or Fand junit vectors for circular interpolation. trailing zeros. ete. Many of the newer systems accept the “old” formats as well. but the contrary is not true, Circular interpolation is normally programmed using direet radius programming. which is much easier This program, however. will be done the hard way ‘The calculations for the next tool motion are illustrated in Fi WH ined He 53 Na = Ai + AN3 = 5620 4 1875 = 0 ‘This will be the X-Jisplacement from point 3 to point 4 YR (AF 1 AY) © 0.75 + OAS (HAYTS 0.1659) Ya = 0.3363 inch This will be the ¥-displacement from point 3 to point + f= N4 = Ai + ANG = 0.7501 inch The dimension “7” is called a “unit vector.” and it is measured from the start point 3 of the are. where the cutter is located, to the center of the arc. to be measured parallel to the Manis. J = Aj + AY3 ~ O4NTR 1 0.1659 = 0.6637 inch cd parallel to the Y-axis who has. The dimension“), also called a “unit vector.” is measin from the start point of the cutter to the venter of the ate. For the read not at this point developed an understanding of the circular interpolation process. the following explanation may be helpful. The cutter is in position prior to the start of the are, and the control knows its position, since this was the end point of the previous (ravel motion. From the start point of the are, the cootrot will travel an imaginary path 2 then along “i.” AL this point the computer has found the center of the are, Using the values “and jas sides of a right-angle triangle, the control will compute the hypotenuse of the triangle, which is the radius of the are Knowing the center and the radius. the control will now trace an imaginary eiecular path, along which the cutter will travel a eval distance defined by the programmed dimensions Nand ¥ ‘The circultr interpolation motion block ean be written theretore as follows: lon N0100 G02 KO.7501 ¥O.3365 10.7501 J-0.6637 The unit vectors can be spelled in either lowercase or capital letters Sec. 5.1 Calculating Cutter Centerline Distances 79 Figure 5.4 Cutter centerline geometry at point 5, 5.1.3 Machine Part Surface “C” from Point 4 to Point 5 ‘The calculations for machining the part surface “C” from point 4 to point 5 will be identical to the ones corresponding to point 2. The offset will be in the X-direction by the amount AX5. AYS =r al AXS = rtan > (5-6) 0.66666, or al = 33.59" Using the triangle shown in Figure 5. and formula (5-6). al 33.59 AXS =r tan 5 = 0.25 + tan 0.0754 inch X5 = 2.50 + AXS = 2.50 + 0.0754 2.5754 inch This will be the X-motion from point 4 to point 5, and the correspon program line will read: No110 G01 2.5754 5.1.4 Machine Surface “D” from Point 5 to Point 6 To machine the surface “D” from point 5 to point 6, the cutter motion will require offsets in both X- and ¥-directions, since neither surface “D" nor “E™ is parallel with the primary axes of the system. The angles «1 and B will have to be measured 80 Cutter Centertine Programming Chap. 8 Fhure $8 Cuner centering svomenry bong sxpaines trom a theoretical Tine. parallel with the Xausis. ay shown in Kigure 5.5. From Fi S4,al = 33.59" , (8) Ls < 5 Tan B= 7 = 1S or 8 = 56.3099 og HLA B 33.59 + 50.31 AY6 = te 0.25 cos HS 0.25 = 0.180 ine © cos (= 11.36) bcogngng met al + sin 44.95 0.706489 AX6 = ——*—.-r — - * oo vox LB cos (= 11.36) (980400 = UAS0L inch XO = 154 3NG ANS — 15 + USOT 0.0754 — 1.6047 inch Sec. 5.1 Calculating Cutter Centerline Distances a1 and Y6 = 1.00 + r — Y6 = 1.00 + 0.25 ~ 0.1804 = 1.0696 inch ‘The next tape block will be: NO120 X1.6047 Y.1.0696 5.1.5 Machine Surface “E” to Point 7 The offset at point 7 can be calculated using equation (5-1). As an exercise, it is suggested the reader draw an enlarged figure of the geometry at point 7, while following the calculations below: avr reun(*- 22) — ppc a AY7 = 0.25 - tan (4s ~ S ) 0.25 « tan 16.845° = 0.0757 inch X7 = 1.00 + r — AX6 = 1.00 + 0.25 — 0.1801 = 1.0699 inches ¥7 = 15 + AY6 — AY7 = 1,50 + 0.1804 ~ 0.0757 = 1.6047 inches The program line will read: No130 X1,0699 Y-1.6047 5.1.6 Machine Surface “F" from Point 7 to P. X8=0 Y8 = 2.00 + r + AY7 = 2.00 + 0.25 + 0.0757 = 2.3257 inches it 8 ‘The program line is: No140 ¥-2.3257 5.1.7 Machine Surface “G” from Point 8 to Point 9 yo=0 X9 = 8.0 +r + 0.05 = 8.0 + 0.25 + 0.05 = 8.3 inches The part would be machine finished without the additional 0.05-inch-increment It is, however, a desirable practice to move the cutter past the finished surface by 0.01 to 0.1 inch. The line of program corresponding to surface “G" is NO160 X-8.3 ez Cutter Centerline Programming Chap. 5 5.1.8 Return Tool to the Machine Zero (“Home”) Position NO160 21.15 FO.4 MO Clea part, stop ewolant No170 G28 20.1 Reiwsn Z “home NO1BO G28 X-0.1 ¥-0.1 Return X omd ¥ “home The few basic calculations discussed so tar will not cover more complex part surface interse, to a line. These will come up later. when more complex part geo studied under CNC turning, ions. such as the Langency of Qwo circular ares oF an are tangent wetries will be 5.2 TOOL NOSE RADIUS CENTERLINE CALCULATIONS FOR CNC TURNING Tool nose radius (TNR) calculations are also known as “equidistance program- ming.” When CNC turning is first discussed, TNR is usually overlooked. However, the basics have been established. we must remember that every turning tool a radius, small as it may be. See Figure 5.6. This radius will have to be taken into consideration when the turned part surfaces are not parallel with the primary axes of the machine (X and Z in the case of the turning center), The error will be the greatest when turning a surface at 45° Irom the primary axes The actual inaccuracy or error. E, can easily be calculated if w radius r of the tool tip. Assuming a value of ¢ = 0,015 inch, for example, the error know the 0.015 — 0.015 = 0.00 h-H-r inch The value of Bineerion FinsHinG cRoovING ENLARGED view" oFyOut he igure $.6 ‘Typical corning 10) tips Sec. 6.2 Tool Nose Radius Centerline Caloulations for CNC Turning 83 results from Figure 5.6. The tapered part surface diameter at a 45° angle would therefore be larger by 2 - 0.0062 = 0.0124 inch. This deviation would not be acceptable from a quality control point of view. Tecan be scen at this stage that this inaccuracy problem is more complex in the case of turning than it is for milling, because of its variability. The error disappears completely when turning surtaces parallel to either the X- or Z-axis ot the turning center. For tapered surfaces, the error becomes proportional to the part surface angle, the deviation increasing from zero part surface angle to its maximum value at 45°, In addition, the error will further increase as the TNR becomes larger. To eliminate this tool tip error in CNC turning systems without programmable TNR compensation, we must. prior to programming, calculate the path of the tool tip radius center. The method of calculation is similar—in fact in many cases identical—to the one discussed in section 5.1 To illustrate the different steps to follow, the equidistance calculations will be carried out in parallel with the programming for the part shown in Figure 5.7. In the following, we have used the right-hand coordinate system. common to most CNC turning centers. In the right-hand system, +Z points away from the chuck, +X points away from the operator, G02 is circular interpolation clockwise, G03 is circular interpolation counterclockwise, Gi is tool nose radius compen- sation left and G2 is tool nose radius compensation right. The standard tool nose vector chart is as illustrated in Figure 7.6. = Equloistance Ro aeio Prep Figure 8.7 Samy anee tool tre. 84 Cutter Centerline Programming Chap. 5 Some tuming centers use the left-hand coordinate sxstem. The essential dit ference is that +X now points towards the opersitor. This change reverses GO2 which becomes counterclockwise, GOB which becomes clockwise. GL which be comes right. and G42 which becomes left, The changes in the chart [rom Fig 7.6 are as follows: point 2 changes place with 3, 1, with 4. and 6 with As in the ease of milling, it will be assumed that the part has been previously machined, in our case rough-turned. The calculationy will be performed and the program written for the turning of the finished contour a dimensioned. Equi- distance calculations are required from point | through to point 8, As we proceed with the calculations and the program, the geometry will be drawn in sufficiently enlarged seale so that the necessary trigonometric labeling can be clearly analyzed for cach step along the path 5.2.1 Start-Up 1c will be assumed that the Loo! slides have heen brought «0 “home” position Not G50 x0 Zo “Zee0 control wo nue Nos Mat Select midtdle speed N10 G38 G20 T0700 Feed in, ipny i oa postion 20 N15 $950 Mo3 Spindle spect 980 gpm), tus spindle on clockwive N20 G00 2-16.29 N25 X.9.2 in the machine coordinate INTHE MACHINE CO-ORDINATE SYSTEM Zoo -Zre*~ 1634 01> 1828 Mere To REMOVE xes “92 FIN, PART. (INTHE NEW PART COORDINATE SYSTEM contour 2201 wren SA Luisa at points thant Sec. 5.2 Tool Nose Radius Centerline Calculations for CNC Turning 85 system, we should, at this point, transfer the coordinate system onto the part as shown in Figure 5.8. This will allow us to program all the necessary slide motions in terms of the actual part dimensions. The calculated equidistances will thus be added to or subtracted from actual part dimensions, rather than worked out in terms of dimensions from the machine “home” position. N30 G50 X2.6 20.01 Established new coordinates in terms of the part coordinate system XpZp. There 1was no tool motion involved. N35 Gor X-0.01F2.0 Turn face 5.2.2 Move Tool to Point 2 ‘The next surface being tapered, the X-position of the tool must be calculated. As shown in Figure 5.9, no calculations are required for Z, whose position remains tangent to the part face ‘The following important geometric condition arises at point 2: The TNR must be tangent to both current and upcoming part surfaces. From equation (5-1), AX2 = r+ tan (= - 3) = 0.01 - tan (as - ne) = 0.0083 inch 3 2 (2.5-2.1)2 it InvTan 0.18181 = 10.305° where @ was calculated as a = InvTan and the next block of tape will be: N4o X 2.1166 F15.0 Move to point 2 (the value of the X- coordinate was calculated in Fig. $9) xO = 2.1 + (hxo)+2 f1 + (0.0085) +2 1108 Figure 5.9. Equidistance at point 2 86 Cutter Centerline Programming — Chap. 5 Figure 3.10 Fegusdistance ot point & be labeled Invian. Aretan, Faun |, or it may use, (Norn: Your calewlator m: /onometri¢ Lunetion is known.) function key to calculate anangle when the tig 5.2.3 Turn Tapered Surface from Point 2 to Point 3 ‘To maintain the cquidistance condition at point 3, the Z3 motion will have to be adjusted by a calculated S23, As the surface between points 3 and 4 is parallel 1 the Zaanis, the Xeade justment will be made by adding the value of the radiws 10 the correspond dimension. Since Y is programmed ay a diameter, the adjustment ill have to be The geometric conditions at point 3 are ay follows: # The tool tip radius ris perpendicular tu the Tine benween pointy 2 and 3 © The tool tip radius is tangent at both surfaves, current and next ¢ The too! motion between points 2 and 34s not parallel to either of the primary 5.10 axes. See F 10.305 AZ = rtan Ss yt 2 20,0009 inch 2.520 inches NR = 25 6 dps 25 + 0.000 This is the X-motion to point 3 ZR AL SZ 1 8.0009 = 4.0994 inches. This is the Z-motion to point 3. The next program block will theretore Na5 x22 2-1.0991 F7.5 The inquisitive reader has noticed by now that the A and Z-dimensions have been programmed all along in absolute mode, The caletlated values have been Sec. 5.2 Tool Nose Radius Centerline Calculations for CNC Turning 87 added to or subtracted from the actual part dimensions which are detined from two datum lines (axes) intersecting at the part origin (see Figure 5,7) 5.2.4 Turn 2.5-Inch Diameter to Point 4 and 0.2-Inch Radius to Point 5 X4 = X3 = 2,52 inches; there are no changes in the X-direction Z4 = 18— R= 18 ~ 0.2 = 1.6 inches The next program block will read: NSO X25 2-1.6 ‘The program is in absolute mode, and the same motion can be programmed as follows: N50 2-1,6 Note that usually “R™ refets to the 25+2:R= 25+ 04; part while “e" is the TNR, 2.9 inches 1a—6 02 18 — 0.01 = 1.79 inches The next block reflects the ability of an advanced control to perform circular interpolation (clockwise) in “radius” programming. We could have, of course, used Land J unit vectors, as in the milling example. with the same practical results. However. the additional calculations may increase the chances of errors, and the additional “characters” and “words” will lengthen the program tape. See Figure 5.11 N85 G02 X2.9 2-1.79 RO.2 Figure 5.11 Equidistance at points § x uINe————4— ands 88 Cutter Centerline Programming — Chap. yo Taansren EQUIDISTANCE LINE gure $.12 Laquichstanee at pons 7 and 8 5.2.5 Turn Face to Dimension 1.8 Inches and 4.0-Inch Diameter to Point 6, Diameter to Point 7, and Tapered Surface to Point 8 By now, calculating these points should not preseat any dlifficuty. ‘The intersecting points of the tool tip radius can easily be projected from the part surface Fines, The geometry of the part-tool relationship is illustrated in Figure 5.12 XO~ 40d ~ 4.0 = 0,02 ~ 4,02 inches %=AR- y= 18 OM = 1.79 inches The next block contains « GOL in order to return fo linear interpolation from the preceding circular interpolation. Overlooking this GOL is one of the most frequently made mistakes The program block will look as follows: Neo Gor X4.02 2.1.79 ‘There iy no “Z-address” change. ic.. no Z-motion is req to point 6, In absolute programming, the axis that Joes not contain a dispkicement can be left out, thus shortening the program, Accordingly, block 60 can be rewritten as shown below: xd from point 5 Neo Got xao2 Sec. 5.2 Tool Nose Radius Centerline Calculations for CNC Turning 89 Continuing the calculations, 5.75 — 4.0 Tana = = 1.75, or @ = 60.255° 29-24 — AZ7 = r+ tan$ = 0.01 - tan 30,1275" = 0,0058 inch Accordingly, ZT = 2.4 ~ AZT = 2.4 — 0.0058 = 2.3942 inches XT = X6, and the motion to poi it 7 can be programmed as follows: Nos 2-2.3942 The next block will be a linear interpolation in both axes. Therefore, the location of point 8 will also have to be calculated. If you observe the tool positions at points 7 and 8, you will note that the angle “a” is shared. AZ8 = AZ7. already calculated to be 0.0058 inch Hence 428 = 0.0058 inch X8 = 5.75 + 2r = 5.75 + 0.02 = 5.77 inch and finally ZB = 2.9 — AZ8 = 2.9 ~ 0.0058 = 2.8942 inches The tape block for the motion to point 8 will read: N70 X5.77 7-2,8942 To conclude the program, the motions from the part system will be retrans- ferred to the machine coordinate system as follows: N75 Goo 20.01 Motion to Z-transfer point N80 X2.5 Moo Motion to X-transfer point, coolant off N85 G50 X-9.2 2-16.29 No motion, just transfer of the datum point N30 G28 X0Z20M05 Return “home,” spindle off N95 M30 End of program 90 Cutter Centerline Programming Chap. § EXERCISES 5.1, Name some of the types of CNC machines that vould be part of tlesible manufacturing syste 5.2. Est metal-cutting machine mate the degree of aceuraey that could be produced by contemporary CNC What sare the (wo mnatjor assets of CNC machines? Project. Draw at list of major items t be checked prior to acquiring a CNC machine 1d moulels. Justity the Prepare a table of these items for three comparable makes seleetion For purchasing. Detine “absolute programming. Define “incremental programming | Expl (a) What is the differcs tb) Explain cach term in the following line of prog » “rapid” motion, nd circular interpekition? ran fe between linear NNO25 GOI X55 75 W 0.28" F075 13 Milling samp Sec. 6.2 Tool Nose Radius Centerline Calculations for CNC Turning i sony tune Tr “Re oS ping sample. (c) Explain each term in the following line of program: NO35 G02 X4.00 ¥5.25 11.5 J2.5 (d) Calculate the radius of are in sequence NO35 (question 8c). 5.9. List some “nondimension” words in a program. no 25" Figure 5.14 Milling, driling, and tap- cre] | p80" ne Figure 5.15 Turning sample. Cutter Centerline Programming — Chap. § List some dimension’ st prey words ia a program. ea safety procedure for ‘am ning thy tool “home” at the endl at a CNC milling What isa dry run? Give a few examples, 1 What is meant by M.D? J. Whit is the major advanta cand the major drawhack af cutter centerline program= ming. and what are some solutions to the problem? Prepare setup and S15 wl write cutter centerti programs tor the parts in Figures 5.13, 5.14 6 Tool Offsets Most CNC machines have a set location, sometimes two, known as the “home” position, the “machine origin,” ot the “machine absolute origin.” These expres- sions are used interchangeably. For the purpose of this book, we shall use the term “machine origin.” The location is physically established by the manufacturer usually by a dual-limit switch system. The first one sets the motion deceleration, and the second one stops it ‘The machine origin is used by manufacturers to synchronize the machine with the control, and to establish a start point for measuring the length of travel in the various axes. Some recent systems cannot even be started at all untit this synchro- nization, known as the “zeroing,” or “referencing,” has been performed. The zeroing is carried out by returning the machine to “machine origin” and initializing the control manually or through programmed statements, such as G92 X0 YO ZO, or others, as applicable. By machine we understand the table, column, saddle, gantry, tool post, or whatever moving parts are involved. Initializing the control means setting the X,Y. Z, A, B. etc. displays (counters) to zero. In addition to the machine origin, we have the following additional potential origins: «the fixture origin «© the part origin ‘the program origin 94 Tool Offsets Chap. 6 All these origins could be the Sune, o ditferent, or grouped in some way, To show the flexibility of the systems. we could have more than One fixture or more than one parton the machine. In the latter case. the parts could be the same or different ‘Over the years, as NC machines went through different phases. the term “vero offset” was used ay ain improvement over the “fixed zero,” and. sometimes, called “zero shill,” “full zero shift.” or “floating zero.” The objective Was. of course. the ability Lo position the part at some advantageous location on the machine lable and “offset” the “zero” to the right place. The word “ofiset” hay also been used in offset bunks oF offset registers. The terms “bank” and “register” are interchangeable, and they mean storage areas the electronic control, These registers can be used for a number of purposes. such as producing small numerical changes 10 compensate for minute setup adjustments, dimensional inaccuracies. or tool wear. But they can also be used to store specific cortections related to a particular tool. tool radius, tool length. or one or more values related to a particular setup situation In some manuals or texts, cutter diameter compensation and cutter length compensation are quite often called “tool offset.” “cutter offset,” “tool length offset.” ete In this chapter we will limit ourselves to the following uses of tool offsets Tool offsets used for length compensation Flexible positioning of holding fixtures or parts Multiple part macl ining (same or different) © Limited use in diameter compensation These features are common to a large number of types of machines. The specific offsetting related to the ability to program the part rather than the tool will be called: ‘* Cutter diameter compensation (including the ‘TNR compensation) # Cutter length compenss ion In these specific cases the term “compensation” will be used consistently in tieu of “offset,” and detailed discussion of these important features will take place in Chapters 7 and 8 6.1 TOOL OFFSET CODES USED FOR TOOL LENGTH COMPENSATION Tool offset codes for too! length compensation are a very uselul CNC programming feature that allow the operator to perform milling, drilling. tapping. or boring without presetting the tools to a specitic tength. As the name implies. this com- Sec. 6.1 Tool Offset Codes Used for Too! Length Compensation 95 pensation controls the tool or “Z=" axis of a CNC machining center. The length of the compensation is controlled by the value stored by the operator in a specific offset register programmed for a particular tool. It is a good technique to program a separate register for each tool length used. If the same tool is to be used in a different portion of the program requiring a different length, another register should be used. The basic principle is similar, in many cases identical, for most controls now being built Tool offsets used in tool length compensation essentially represent addition or subtraction by the CNC control. In the process of drilling, we program a specific rapid “Z-" motion to approach the part surface. In addition, we program a tool register number, such as H12, and a tool offset code G4S for lengthening (adding) Noo4o Goo Gas z-3.0 #12 The interpretation of this tape block is the following Noodo—Sequence Number G00—Rapid Motion G45— Addition (tool offset) Z-3.0— Programmed Length of Tool Motion H12-Assigned Tool Register This example is illustrated in the lower half of Figure 6.1 We shall assume that the operator entered 2,9 into H112. The drill point will move in rapid motion by the amount of programmed “Z” plus the distance con- tained in tool register H12. It should be remembered that the tool will move in the direction given by the sign in “Z”. When calculating, we add to the unsigned amount from “Z” the signed amount from the offset register. The resulting motion will take place in the direction of the sign resulting by combining the sign from “Z" with the sign of the added amounts. For example: Z-3.0 H12 contains 2.9; 3 + 2.9 = 5.9; motion —5.9 Z-3.0 H12 contains ~2.9, 3 - 2.9 = 0.1; motion —0.1 23.0 H12 contains 3.9; 3 + 3.9 = 6.9; motion ~6.9 Z-3.0 H12 contains -3.9, 3 — 3.9 = 0.9; motion +0.9 ‘The tool offset code G6 will shorten (subtract) from the programmed motion the amount entered in the appropriate offset register. NO0S0 Goo G46 2-6.75 H11 Illustrated in the upper part of Figure 6.1, this example can be interpreted as follows: The drill point will move in rapid motion by the programmed amount 96 Tool Offsets Chap. 6 remax hl: LAN scien 65. Toot LENGTH Lar REX Sa RR RAEN FEEDS “ae LEVEL 18 fan 8.000-— Mc TABLE Figure 6.1 ‘Toot otfsets seal in cost Renath compension ‘on L Eroorwowwee bac out or 6.75 inches. fess the distance 0.85 inch assumed entered in tool ¥ ter Hu In actual case, both programmed tape blocks in the examples ahove will result in the same tool point motion to “R™ level. or 5.9 inches. Even though the system accepts both tool lengthening or shortening codes, most programmers set 3 standard of using either one or the other, but not both This will avoid potential confusion that could result Using G less than or equal to 6.5 inches + 2.9) inches n expensive tool crashes. operator can use any tool Length Yat inches. A194 inches of tool length. the value of HI2 would be zero without haying had to change the pro- rammed Z-3.01 dimension Using G46, on the other hand, means that the operator can use any tool length less than or equal to 6.5 inches 5.9 inches ~ 12.4 inehes. AUT.5 inches of tool length. the value of HI] would be 1.85 inches. and at 10.5 inches of tool length the value of HI] would have to be changed to 4.85 inches. In other words. whatever we add to the tool Iength we haye to ack to the content of the tool " 5 in our example means that thi re By now the read code, Let us assume that the shortest possible tool length (e.. cutting tool and holder combination) is 6.5 inches. Phe clearaniee between tool and part at the end of the rapid approach is. for example. 0.1 inch, H we prog may have concluded that itis easier to work with the G45 nat rapid motion of Sand & particular tool offset register, the amount fo be entered by the operator in that register will be the Following 1.0 inch, in conjunction with ¢ ‘The distance from the tool point to the part surface, Less the progeammed 10-inch moti Less the 0.1 inch-clearance Sec. 6.2 Tool Offsets Used for Positioning of Fixture or Part 97 6.2 TOOL OFFSETS USED FOR POSITIONING OF FIXTURE OR PART Figure 6.2 illustrates a setup that requires the use of three different sizes of drills Since we know how to write a part program using tool length compensation, we can ignore the actual length of our tools during the programming process. The foliowing steps will outline the job: 1. The three drills specified are mounted in three different toot holders. The lengths are unimportant from a programming point of view, but rigidity, deflection, and proper grinding remain important and should not be over- looked 2. The plate shown in Figure 6.2 is mounted on the machine table. The exact location is unimportant since we will use tool offsets in the X-Y plane. It is important to maintain the part edge marked “A" parallel to the table surface. The risers should be located so as to avoid tool interference 3. The three tools are installed into the tool changer in the positions outlined by Figure 6.2. The distances between the tool tip and the part surface are found as follows: # Position tool No. 1 in spindle. © Zero “Z” axis in “home” position above part. * Start spindle @ 100 rpm. J CLEARANCE gYm 1 risen a merane obes — TOOL No.1 260 DRILL Sint? so omen z2"| p79 S100 no a ars omt Pats Figure 6.2 Sample part lor tool offsets. 98 Tool Offsets Chap. 6 * Jog tool tip to touch the part # Read und note “Z” displacement. For our program, this reading is labeled Zl. and we will assume the respective amount to be 7.9 inches. The same exercise for tools Nos. 2 and 3 will yiekl 22 — 6.879 and 23 = 5.695. 5. The program for the drilling of the three holes shown in Figure 6.2 is now written below: NNoo10 G20 G40 G80 G91 Initialization NNo020 G92 x0 YO Z0 Zeto” contzol 'No030 $1200 Mo3 Spine on, 124 rpm 0040 G48 Go0 x1.0 001 NGO50 Gas ¥1,0 002 Figure 6.2 shows two sets of coordinates. The origin of Xx and Yor is the machine origin, while the intersection of Xp and ¥p is the part origin, From the machine origin, the coordinates of point “1” can be calculated from the drawing as X = 6.L inches and Y = 7.5 inches. Had these dimensions been used in the program, the operator would have been required to set the part exactly to the dimensions 14,6000 and ¥5.0000, As it stands, the tool offset registers DOL and D02 have been used. Phe operator has the choice of positioning the part any place he wishes, as long as the edge “A” is parallel to the table. Once the part is positioned. the operator measures the X- and Y-dimensions of the actual location. Since a displacement of 1.0 inch has already been programmed in sequences NOO40, and N0OS0, the operator will subtract | inch from the X-amount and will enter the result in DOL. He will subtract { inch from the Y-amount and will enter this result in DO2. Due to GAS, the amounts in the offset registers combined with the pro- grammed motions will bring the tool to the required location If we assume that the part has been mounted at the operator's convenience and that the dimensions measured from the machine origin to the part origin are respectively. 4,6 and 5.0 inches. as shown on the drawing, we have the following, choices: Along X, 4OF1S = 61 Since we have programmed X10, we enter 5.1 in DOL Along ¥. s0e 15+ 1S 75 We enter 6.3 in DU2 Alternatively. we could have programmed Nooao G45 Goo X1.5 DOI 10050 Gas ¥2.5 DDZ The operator measures 4.6 and $.0 inches as before and enters them direetly Sec. 6.3 Tool Offsets Used in Multiple Part Machining 99 as measured in DO1 and D02. The results are the same. We can now continue the program in the Z-axis NO060 GOO G45 2-1.0HO3 Tool length compensation The value of the H03 offset register must at this point be calculated as: Z1 — 1.0 inch ~ 0.1 inch or 7.9 inches ~ 1.0 inch — 0.1 inch = 6.8000 where 1.0 inch is, the Z-value programmed in sequence N0060 and 0.1 inch is the clearance Noo70 GOT 2.0.5 F3.0 MoB Noogo Goo 205 Noos0 G28 Z0 Dnill hole 1, 0.250-ineh diameter, O-ineh deep Rapid return Return tool home No100 X1.5 Y-1.0 Mos: No110 Moé To2 1No120 $900 Mos NO130 G45 2-1.0 Hoa Rapid © 2nd hole ‘Too! change ‘Tool length compensation The value of the H04 offset register must be calculated exactly as in the case of HO03 above. No140 Got 2-0.63 F400 No150 Goo z0.63 No160 G28 Z0 Mos NOV70 X-1.5 ¥-1.0 NO180 MO6 To3 No1g0 $1060 Mos NO200 G45 2-1.0 HOS Drill 0,50 inch thru Rapid retuen Return tool home Rapid to 3rd hole Tool change ‘Tool length compensation The value of the HOS offset register must also be calculated as above. Noz10 Got 2-0.3 F350 No220 Goo 20.3 Noza0 Gze Zo Mos Nozd0 G28 x 0 Y 0 Moa Noz50 Mos Noz60 M30 6.3 TOOL OFFSETS USED IN MULTIPLE PART MACHINING This paragraph represents an extension of the preceding one. Let us assume that we're machining the part in Figure 6.2, but that in liew of having positioned the part using tool offsets, we have positioned a holding fixture for that part. We are now machining a small production lot. Ina jobbing shop. where production flexibility is vitally important, we have 100 Tool Offsets Chap. 6 the ability to locate a Second holding fixture in a different pltee on the table, ‘The first fixture was located using DAL and P02, We ean locate the second one using, different offset registers, such ay DLT and 1912. We can now interrupt the first cur, machine the second order. and then resume production. Where this type of te quirement is a frequent occurrence. it isu good practice to program the X= and Y~ motions first, with Z retracted all the way. This will avoid having to worry about crashing the tools for the second part while crossing the zane of the first one 6.4 TOOL OFFSETS USED IN DIAMETER COMPENSATION It is not recommended that offsets such as G45 of G46 be used in cutter diameter compensation. These codes will function in limited applications. for very simple cometries. Because errors may be introduced due to the design of the software it is preferable to use Gal and Ga2. which have been specitieally desiened for this purpose. On specific controls, Galt and G42 may be used én conjunction with an additional code. G39. Cutter diameter compensation codes and their applications are discussed in subsequent chapters EXERCISES Explain the term origin in programming context and list the diferent types ot origins fone cin encounter ina program: E What are the codes used in 100! | plain the term tool length compensation and justify the need for this process th compens Given the following line of progeam, N30 G00 GAS Z-2.5 HI. calculate the tool motion ister HO are (a) 2. and (bh) 2.0. Is it important to know the setwail length of the cutting tools before the start of the ifthe values entered in the machine tuble exactly acconing to the setup How can the compensated method of fixture positioning fucilitaty the flexibility of a sinall jobbing shop? 6.8. Write programs lor the parts in F tfsets for too! fength compensation ee S13 and Fi 5.14 on pp. 90 YE, using toot 7 Cutter Diameter Compensation and TNR Compensation: Programming the Work Surface 7.1 CUTTER DIAMETER COMPENSATION We have seen the complexities of cutter center programming in Chapter 5. While not difficult as such, programming the cutter center (sometimes called “program- ming the tool”) can become involved, and the probability of crrors increases with the number of calculations. We shall now look at an entirely different approach. This consists of “pro- gramming the part.” The programmer will write a part program tailored to the contour to be machined. This is equivalent to using an imaginary tool that has zero radius. As part of the program, the programmer incorporates a “compensation” tape block. While the compensation “offsets” the tool, to minimize potential confusion in terminology, the process discussed in this chapter is “cutter diameter compen- sation” and not “tool offset.” However, the numbered memory compartment where the value of the cutter radius will he stored is called “ofiset register.” Offset registers are used in conjunction with different procedures such as tool offset. cutter diameter ‘compensation, 1001 nose radius (TNR) compensation or tool length compensation. ‘The compensation tape block has the following functions . To assign a specific offset register to a specific tool. CNC systems are normally 101 102 Cutter Diameter Compensation and TNR Compensation Chap. 7 equipped with programmable tool registers, available usually in blocks of 16; that is. a control may have 16, 32. 64. or more registers, Prior to running the program, the operator has to input (other terms used are “punch” or “dial™) the desired compensation into the assigned offset register, This compensation is usually the radius of the tool 2. To simplily the programming process in terms of roughing oF finishing op: erations. Upon instruction, the operator can input in the offset register & radius that is Lirger than the actual radius of the tool wed. The amount of the ditfcrence will represent the stock Jeff on the part after the current pass. Fo allow the use of a cutter of a different diameter than specified should a specitie size become unavailable due to breakage. etc 4. To define the direction of the compensation. to the right or to the lett of the part. To define the direction of the machining following the tool compensation block, i.c., conventional or climb milling The basic functions described above are by and large the sume for most modern CNC systems. The tape block format may change, however, from one system to another. Ila programmer acquires a thorough knowledge and understanding of the compensation process in one system, there should be no difficulty in switching this knowledge toa Somewhat different format. Having looked at too! compensation ral terms, We will study several programs to bring the discussion to a more speciti¢ level 7.1.1 Cutter Diameter Compensation Left—G41 (Example in Inches} The compensation [eature will position the tool. prior to machining. to the left ot the part, by a distance equivalent to the tool radius input in the assigned tool offset revister. The part program will be written in a very simplitied cutter centerline mode. as if the tool radius were zero. The dimensions to be used for cutter motions Will therefore become the actual dimensions of the part drawing, which precludes the need for calculations. Che part shown in Figure 7.1 will be machined with a 0.50 ineh-diameter-end mill, in conjunction with offset register No. 03 (shoven in the program as DO3) 7.1.1.1 The direct approach Using this method, the tool is programmed 1 move diteetly to point [. The im- plication here is that the operator must set the holding fixture on the machine table exactly to the dimensions given in the setup drawing, NNoo10 G20 G40 Geo NNao20 G92 x0 YO 20 Sec. 7.1 Cutter Diameter Compensation 103 {pres ti 2.70) EE parr conroun — root cenrenuine TRACE 1200. 306.80) Figere 7.1 Cutter diameter compensation Noo30 $900 Mo3 Noo40 G31 G17 Goo Get X6.9 ¥4.45 42.1 DOS Sequence 040 will “rapid” the cutter from the machine origin to point 1 ‘* G91 represents incremental programming * GII7 indicates that compensation takes place in the X-Y plane. © G00 is rapid traverse. * Gal is the code for cutter diameter compensation left ‘* 03 is tool offset register No. 03, earmarked for X-Y plane programming. As shown later. for Z-axis motion (involving tool length or “height” com- pensation), the same register would be designated as HO3. is the word address indicating, as programmed, that the first motion in the X-Y plane will take place in the positive Y-direction. The control will be able to verify this intent as the program is being read ahead of the actual machine execution Should the control detect a conflict, an alarm signal will result. ‘The detailed setting up of compensation using unit vectors / or J will be explained later on in this chapter. For more recent controls, compensation has been greatly simplified, and or J are not required at all 104 Cutter Diameter Compensation and TNR Compensation Chap. 7 For a briel description, the cutter diameter compensation lett (G4l ) or right (G2) is & displacement of the cutter enter, by an amount usually: equal to its radius. perpendicular, respectively, to the lelt of right to the vectorial resultant of the programmed vectorial components J and J. This vectorial resultant is nothing else but the hypotenuse of a right-angle triangle whose rise is J and whose ran is F. In this case, Fis not programmed and is therefore considered to be 7610. J. ats the only component. is equal to the resultant, Being positive. it points upwards The cutter diameter compensation left, called in sequence 0040, will displace the cutter 94F to the left, as shown in Figure 7.1 No0s0 G18 Goo 2.5.3 apie down te 9.1 inch clearance boxe part Sues NOU6O G18 GOT Z-0.65 F2.0 Feel downto cutting dept The next block will have to specity a positive ¥-motion, ay required by se- quence NOOO 7.1.1.2 The indirect approach ‘This method is used by experienced programmers and is far superior to the pre- ceding one, As described previously in Chapter 6, the operator has the choice to position the holding fixture att any convenient location on the machine table long as it is set parallel to the machine axes. We arhitrarily seleet a point A, such as | inch away from the part. as shown in igure 7.1, This point will be reached using G43 tool offsets. The preceding program would now read: Noo10 G20 Gao Gao Noo20 G92 xo Ya zo Noo30 $900 Mos Noo32 G4s Goo Xo DoT Noo34 Gas Yo D2 Noodo G91 G17 Got Gat x1.0 Yo 32.1 DOs Noos0 G18 Goo 2.5.3 Noo60 G18 Go1 2.0.65 F20 Sequenves 10 £00030 and 20500 O60 are unchung program. The difference consists of sequences 052 and M34. where the operator will have to input, prior to the start of machining, the location of point A, Howe assume that the part shown in Figure 7.1 has been located on the machine and its “part origin™ measured at X6.9 and Y4.A5. the operator will input 6.9 inches LO inch = $9 inches in register DOL and 45 in register DO2. ‘The use of two blocks for this procedure gives the operator additional flexibility From here on. the program will be identical for both direct and indirect approaches. ed. ay is the rest of the NOO70 G17 GOI Y2.1 F20 MOB. — Motion om point La» pert 2 Sec. 7.1 Cutter Diameter Compensation 105 Most compensation systems operate in two ways, depending on their executive software. The older systems require an additional code, G39, whose purpose is to rotate the tool centerpoint, as shown in the transition from points 2 to 3. 4 to 5, 6 to 7, etc., on Figure 7.1. This occurs in conjunction with a change in direction of the linear interpolation, and it is required to bring the tool radius perpendicular to the new surface to be machined. As illustrated in Chapter 5. regardless of the programming method, the cutter radius will be perpendicular at all times to the surface being machined (which in its turn is permanently “tangent” to the cutter “circle”). In the newer systems, as indicated by their manuals, the CNC software will take care of this problem by “automatically” bringing the cutter center to the intermediate position where the cutter “circle” will be “tangent” to both directions, the current one being machined, and the next one in line. For the present program, G39 will be used, as illustrated in Figure 7.2. At the end of block 0070, the tool radius is perpendicular to part surface 1-2, between points | and 2, Prior to programming surface 3-4, we require a tape block to rotate the tool at point 2, so that its radius becomes perpendicular to the next surface, 3-4, It can be seen in Figure 7.2a that should this rotation not occur, the new surface will be cut to the right of the “true” line 3-4 and the part will end up smaller and scrapped. Noo8o G39 11.0 12.0 This tape block performs the reorientation of the tool radius. G39 is # prepro- grammed subroutine, stored in control memory. The values for [and J have been selected as follows: / = 1.0, which corresponds to the X-displacement from point 3 to point 4 as seen in Figure 7.1. J = 2.0is, in the same sketch, the corresponding, Y displacement. Zand J can be interpreted as the two component vectors whose resultant is line 3-4, or as the two sides of a right-angle triangle whose hypotenuse is line 3-4 ‘The two detinitions are geometrically identical. As Gl called in sequence 0040 for compensation “left,” our tool radius will now be oriented 94? to the new line 3-4, defined by I and J, as shown in NOO80. What the CNC minicomputer calculates is the slope of line 3-4, given by rise J, divided by the run I, As the result is a ratio, we could have programmed in NO080 any pair of values for F and J whose ratio is the same. We could have had, for instane N0080 G39 110 J20 or No080 G39 1100 J200 or N0080 G39 150 1100, ete. However, it is recommended as much as possible to use pairs of values, as found on Figure 7.1, to simplify possible debugging. The G39 vector setting code must be programmed prior to each change of direction. As seen in Figure 7.2b, illustrated for a 6M control, the motion programmed Chap. 7 106 Cutter Diameter Compensation and TNR Compensation NEW SURFACE {oO ‘CUTTER PERPENDICULAR SOTHe MEW SURFACE CINE 24 CUTTER Penpenoicutaa Fouoroub ano wow SUnraces, CUTTER PERPENDICULAR OuINe Na ZoC0 SURFACE a, SM coNTHOL b eM CONTROL, Figure 7.2. ‘Too radius vector set in sequence 0070 will bring the cutter center to a position where the tool rad while still perpendicular to the “old” surface, becomes perpendicular to the “new surface ay well. The software of the newer controls will automatically perform 9. or the extensive cal- caleu culations from Chapter 5. Continuing the program Noo90 GOT X1.0 ¥2.0 No100 G39 12.75 J1.15, NNO110 Got X2.75 1.15 No120 G39 12.25 As line 7 one. 0130, requires no ¥ No130 G01 X2.25 No140 G39 11.4 4-20 No150 GOI X1.4 ¥-2.0 NO160 G39 1-0.6 4-3.25 NO170 GO! X-0.5 ¥-3.25 NO1B0 G39 1.0.9 No190 GOI X09 No200 G39 1.0 Nozio Gor Y1.0 NO220 G03 X-2.0 11.0 jons and generate motions without the use of G3! bre Rotation around point + rom point 5 t point 6 Rotation aroand point 6 is parallel to the X-axis, sequence 0120 requires no J and the next From point 7 10 point & Rotation around point S From point # to point 10 Rovation From point 110 poin Rotation around point 12 rom po Rotation round point From pont 1810 point 1 Circular interpolation G02 or G03 will gradually rotate the tool radius as i€ machines the part surlace: therefore, no G39 is required at either point 16 or 17 0230 GOI ¥-1.0 Nozao G39 1-3.0 rom point 17 w point 18 ovation around! pout Sec. 7.1 Cutter Diameter Compensation 107 1N0250 GON X-3.0 From point 19 to point 20, NO280 G18 G00 20.65 ——_—Raise tool to U.L-inch clearance NO270 G17 G40 X-1.0 YO Cancel cutter diameter compeosation, Nozgo G28 20 Return Z “home No290 G2 x0 YO Return X and Y No300 M30 End ‘The process described above saves calculation time and eliminates calculation er- rors. 7.1.2 Cutter Diameter Compensation Left (Metric Example) ‘The sample part shown in Figure 7.3 is dimensioned in metric. As an observation, dimensions on metric blueprints may be shown without trailing zeros, as their dimensional tolerances are not normally related to the number of zeros after the decimal point The only significant change is the G21, replacing G20, which indicates to the control that the following dimensional values are given and should be reflected in Figure 7.3. Cutter diameter compensation—left (metric part). 108 Cutter Diameter Compensation and TNR Compensation Chap. 7 imetric dimensions. ‘The inch metric is usually programmed G20G21 on some con- trols, and G70/G71 on others. When CNC system works only’ in metric or only in inches, the above codes are not required No010 G21 Gao G80 G8T As Gall or Ga2 set up a cutter diameter compensation condition. G40 is the code that cancels it. An uncunceled compensation can generate @ Tot of problems. there fore. Gv is always used in the first block as a safety feature. GRO performs the same function for canned eyeles, to be discussed in detail in Chapter 9. No020 G92 x0 Yo 20 Nooo $800 Mo3 ‘vo040 G45 Goo Xo 001 apie te poiat A. using GS Noose G45 Yo DO2 Nao6o G18 2-302.0 Rapid to clearaanes Nog70 G18 GOI Z-16.0 F109 Fest to gutting level N000 G91 G17 GOI G41 X15.0 YO 468.5 003 For a control without the decimal point programming feature, the tape word X15,0 would be programmed X150 for an X5.2 tape format (which means th the largest programmable dimensional word on the respective system would be X9999V.99, oF 5 digits belore and 2 after the decimal points metrie value representing just over 328 ft). For a controf of this mature, iC may be helptul to mark the dimension [5 as 15.00, which allows for its direct transposition into the pro- gram, without the decimal point. of couse, but with the correet number of tr reros Noose G17 Got Y6e.5 F25 M08 Sta! As point of interest, one of the few applications of the “plane” codes G17. G8, and G19 occurs in cutter diameter compensation. As the compensation takes place in the X-¥ plane (G17). unless the programmed Z-motion is preceded by a G8, the control will assume that the departure from the -Y plane is aevidental and the software will generate the appropriate error message NO100 G02 X20.0 ¥20.0 120.0 Cireular interpaation, ame 6 NO110 Got x25.0, incur mterpolation, ae 7 NO120 GO? X140 ¥-140J-140 Zanes No130 Gor Y-150 Zoe 9 No140 GOs X140 ¥-14.01140 Zone 1 Na150 Gor x10.0 Yone 31 NO160 G39 120.0 3.22.0 Rotation af took, ome 12 NO170 Got x20.0 ¥-22.0 Pasae 13 Sec.7.1 Cutter Diameter Compensation 109 ESTABLISH TRIANGLE INVART GEOMETAY POSITION ROTATE THIS FRIANGLE Bown ASSIGNTHE 9 OxeseTM 8 intas Borate POSITION Figure 7.4 Unit vectors at rotated position For the cutter repositioning at zone 14 (Figure 7.4), it may be helpful to sketch an enlarged view of the part geometry in zone 15. ‘The cutter radius must rotate as shown at point 14 from an upper position perpendicular to zone 13, to a lower position perpendicular to zone 15. At this lower position, the cutter radius must be collinear with the radius R of zone 15. This rotated position of the tool radius must be at 90° to the left of the hypote- nuse (R) of the right-angle triangle whose sides are the [ and J programmed with G39. ‘* Draw a line from point 14 to the center of arc (R) * From point 14 draw a horizontal line (dimension 25) and a vertical one (dimension 5) The three lengths, R, 25, and 5 form a right-angle triangle * At this stage. R is collinear with the rotated position of the tool radius ‘* Rotate the whole triangle as shown, 90° clockwise. R is now perpendicular to the short arrow representing the cutter radius. Looking in direction of the arrow of R. the cutter radius arrow points to the left, according to G41. ‘Therefore, R is in correct position, and the triangle side parallel with the X- axis is J (shown on Figure 7.4 as i, positive), while the other side is J (shown as j, negative) ‘* The rotation of the triangle has not changed the values of its sides. it has only helped to assign correct signs. Accordingly, No180 Gag 15.0 4.25.0 Rotation. zone M4 NO190 GO3 X25.0 ¥-20.5 128.0 J8.0 Zone 15 Tt should be observed that as G39 precedes a circular interpolation, its / and J 110 Cutter Diameter Compensation and TNR Compensation Chap. 7 values are different from the ones in the subsequent motion statements, amd not the same, as we had observed repeatedly in the previous program No200 G39 J-12.0 Rotation. gone 1 No2i0 Gor Y-12.0 Zone 17 1No220 G33 1.20.0 Rostntion, game 1S Na230 GOI x-128.0 Zone No2a9 G18 GOO 216.0 oul up NO26O G17 G40 X-16.0 MOB Cancel compensation Noz60 G28 20 Mos 1No270 G28 x0 Yo ‘Noz80 M130 Asa closing comment. itis always advisable fo set up and cancel compensation in conjunction with a straight-line motio Most modern controls allow sinalt less your specific control completes the Z-motion prior to the start of the X-¥. in conjunction with a G28, it is recommended to program as in the above example: to assure that the tool is out of the way prior to any side motion neous return “home” on three aves. Un- 7.1.3 Cutter Diameter Compensation Right—G42 For simplicity, the tool k two preceding programs (sc ath and part setup will be assumed the same as for the Figure 7.5) No010 G70 G40 G80 G9t Noo20 G92 Xo Yo Zo Noo30 $900 M03 Nood0 Goo G45 x0 Do" Noos0 Gas Yo 002 Ho point Noosd G18 2.5.3 N0070 Gig Got 20.65 F2.0 NooB0 G17 Gat Gaz XO Y15 1§.0 003 No090 Got x5.0 F3.8 M03, fone No100 G39 17.0 J1.5 » Noto Got x1.0 V1.5 it NO120 G39 11.0. J1.5 mn No130 GOT X-1.0 Y1.5 Ib No140 G39 I-25 J1.0 1B NO1BO GOT X-25 Y1.0 4 N0160 G39 12.5, 1s No170 Got X25 to No1@0 G39 -40 " No190 Gor v.40 1s No200 G18 Goo 20.65 Moa Sec. 7.2 Tool Nose Radius Compensation m Figure 7.8 Cutter diameter compensation right —G42 No2t0 G17 Gao ¥-1.5 Mos No220 G28 zo No230 G28 XO YO Nozao M30 7.2 TOOL NOSE RADIUS COMPENSATION In principle, the turning center tool nose radius is no different from the milling cutter radius, In fact, though. it is much smaller, and it does not rotate. Accordingly. we must look at a “standard tool nose vector.” A vector is a quantity defined by its direction. or orientation, and its magnitude. or size ‘The “direction” is usually shown as an arrow from the center of the TNR to the intersecting point of the two cutting lines of the tool ‘The “magnitude” is equal to the tool nose radius when the compensation mode is activated. It is lengthened to the intersection of the two cutting lines when compensation is canceled In milling, the magnitude ranged trom zero, i.e.. cutter center, to the cutter radius, i.e., the cutter edge. ‘The vector of a standard tool nose is viewed from behind the tool during turning. in order to correctly assign the two directions, left or right. For example, the Fanuc 6T control provides eight different types of tool geometries. as shown in Figure 7.6. Depending on which cutter geometry suits a particular application, the programmer must also select this standard tool nose number together with its corresponding code 12 Cutter Diameter Compensation and TNR Compensation Chap. Not no? No.2 sugcesteo y Wa pimections SH GanNG vector Too 18a. = TURNING BACK BORING 16 BORING OD AND FACING IO AND FACING TAND FACING No.4 to 8 4 a cARBIDE TIP ACK TURNING 3 3 AND FACING FacINGoR PROFILING, FACING AND ROVING INTERNAL THREAD TURNING “

You might also like