Sunteți pe pagina 1din 37

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools &

Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article The Key Concepts Of Computer Numerical Control


Mike Lynch President, CNC Concepts, Inc.

Today, computer numerical control (CNC) machines are found almost everywhere, from small job shops in rural communities to Fortune 500 companies in large urban areas. Truly, there is hardly a facet of manufacturing that is not in some way touched by what these innovative machine tools can do. Everyone involved in the manufacturing environment should be well aware of what is possible with these sophisticated machine tools. The design engineer, for example, must possess enough knowledge of CNC to perfect dimensioning and tolerancing techniques for workpieces to be machined on CNC machines. The tool engineer must understand CNC in order to design fixtures and cutting tools for use with CNC machines. Quality control people should understand the CNC machine tools used within their company in order to plan quality control and statistical process control accordingly. Production control personnel should be abreast of their company's CNC technology in order to make realistic production schedules. Managers, foremen, and team leaders should understand CNC well enough to communicate intelligently with fellow workers. And it goes without saying that CNC programmers, setup people, operators, and others working directly with the CNC equipment must have an extremely good understanding of this technology. In this text, we will explore the basics of CNC, showing you much of what is involved with using these sophisticated machine tools. Our primary goal will be to teach you how to learn about CNC. For readers who will eventually be working directly with CNC machine tools, we will show you the basics of each major CNC function. Additionally, we will make suggestions as to how you can learn more about each CNC function as it applies to your particular CNC machine(s). At the completion of this presentation, you should have a good understanding of how and why CNC functions as it does and know those things you must learn more about in order to work with any style of CNC machine tool. For readers who are not going to be working directly with CNC equipment in the near future, our secondary goal will be to give you a good working knowledge of CNC technology. At the completion of this presentation, you should be quite comfortable with the fundamentals of CNC and be able to communicate intelligently with others in your company about your equipment. To proceed in an organized manner, we will use a "key concepts" approach to all presentations. All important functions of CNC are organized into ten key concepts. Think of it this way. If you can understand these ten basic principles, you are well on your way to becoming proficient with CNC. While our main focus will be on the two most popular forms of CNC machine tools (machining centers and turning centers), these ten key concepts can be applied to virtually any kind of CNC machine. With so many types of CNC machine tools in existence, it is next to impossible for this presentation to be extremely specific about any one particular type. The key concepts allow us to view the main features of CNC in more general terms, stressing why things are handled the way they are even more than the specific techniques used with any one particular CNC machine tool. With this broad background, you should be able to easily zero in on any kind of CNC machine tool you will be working with. As yet a third goal, this presentation should help instructors of CNC. The key concepts approach we show has been proven time and time again during live presentations in CNC courses. This method of presentation will help instructors organize CNC into extremely logical and easy-to-understand lessons. Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Key Concept #10


Verifying CNC Programs Safely

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article Key CNC Concept #1The Fundamentals Of CNC


Here are but a few of the more important benefits offered by CNC equipment. Mike Lynch President, CNC Concepts, Inc. Though the thrust of this presentation is to teach you CNC usage, it helps to understand why these sophisticated machines have become so popular.

The first benefit offered by all forms of CNC machine tools is improved automation. The operator intervention related to producing workpieces can be reduced or eliminated. Many CNC machines can run unattended during their entire machining cycle, freeing the operator to do other tasks. This gives the CNC user several side benefits including reduced operator fatigue, fewer mistakes caused by human error, and consistent and predictable machining time for each workpiece. Since the machine will be running under program control, the skill level required of the CNC operator (related to basic machining practice) is also reduced as compared to a machinist producing workpieces with conventional machine tools. The second major benefit of CNC technology is consistent and accurate workpieces. Today's CNC machines boast almost unbelievable accuracy and repeatibility specifications. This means that once a program is verified, two, ten, or one thousand identical workpieces can be easily produced with precision and consistency. A third benefit offered by most forms of CNC machine tools is flexibility. Since these machines are run from programs, running a different workpiece is almost as easy as loading a different program. Once a program has been verified and executed for one production run, it can be easily recalled the next time the workpiece is to be run. This leads to yet another benefit, fast change-overs. Since these machines are very easy to set up and run, and since programs can be easily loaded, they allow very short setup time. This is imperative with today's just-in-time production requirements.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Motion ControlThe Heart Of CNC


The most basic function of any CNC machine is automatic, precise, and consistent motion control. All forms of CNC equipment have two or more directions of motion, called axes. These axes can be precisely and automatically positioned along their lengths of travel. The two most common axis types are linear (driven along a straight path) and rotary (driven along a circular path). Instead of causing motion by manually turning cranks and handwheels as is required on conventional machine tools, CNC machines allow motions to be

Key Concept #9
Key Sequences Of Operation

Key Concept #10


Verifying CNC Programs Safely

Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

Figure 1. A conventional machine's slide is moved by an operator turning the handwheel. Accurate positioning is accomplished by the operator counting the number of revolutions made on the handwheel, plus the graduations on the dial.

actuated by servomotors under control of the CNC, and guided by the part program. Generally speaking, the motion type (rapid, linear, and circular), the axes to move, the amount of motion

and the motion rate (feed rate) are programmable with almost all CNC machine tools. Figure 1 (above) shows the motion control of a conventional machine tool. Figure 2 (below) shows the makeup of a linear axis of a CNC machine. A CNC command executed within the control (commonly through a program) tells the drive motor

to rotate a precise number of times. The rotation of the drive motor in turn rotates the ballscrew. And the ballscrew drives the linear axis. A feedback device at the opposite end of the ballscrew allows the control to confirm that the commanded number of rotations has taken place. Though a rather crude analogy, the same basic linear motion can be found on a common table vise. As you rotate the vise crank, you rotate a leadscrew that, in turn, drives the movable jaw on the vise. By comparison, a linear axis on a CNC machine tool is extremely precise. The number of revolutions of the axis drive motor precisely controls the amount of linear motion along the axis.

How Axis Motion Is CommandedUnderstanding Coordinate Systems


It would be unfeasible for the CNC user to cause axis motion by trying to tell each axis drive motor how many times to rotate in order to command a given linear motion amount. (This would be like having to figure out how many turns of the handle on a table vise will cause the movable jaw to move exactly one inch!) Instead, all CNC controls allow axis motion to be commanded in a much simpler and more logical way by utilizing some form of coordinate system. The two most popular systems used with CNC machines are the rectangularor "cartesian"coordinate system and the polar coordinate system. By far, the most common is the rectangular coordinate system, and we'll use it for all discussions made during this presentation. Figure 2. A CNC machine takes the commanded position from the CNC program. The drive motor is rotated a corresponding amount, which in turn drives the ballscrew, causing linear motion of the axis. A feedback device confirms that the proper amount of ballscrew revolutions have occurred.

One very common application for the rectangular coordinate system is graphing. Almost everyone has had to make or interpret a graph. Since the need to utilize graphs is so commonplace, and since it closely resembles what is required to cause axis motion on a CNC machine, let's review the basics of graphing. Figure 3 (at left) is a graph of a company's productivity for last year. As with any twodimensional graph, this graph has two base lines. Each base line is used to represent something. What the base line represents is broken into increments. Also, each base line has limits. In our productivity example, the horizontal base line is being used to represent time. For this base line, the time increment is in months. Notice this base line has limitsit starts with January and ends with December. The vertical base line represents productivity. Productivity is broken into ten percent increments and starts at zero percent productivity and ends with one hundred percent productivity. The person making the graph would look up the company's productivity for January of last year and at the productivity position on the graph for January, a point is plotted. This would Figure 3. Graph illustrates the use of base lines, the increments used for each base line, and the origin point used when graphing. then be repeated for February, March, and each month of the year. Once all points are plotted, a line or curve can be drawn through each of the points to make it more clear as to how the company did last year.

Let's take what we now know about graphs and relate it to CNC axis motion. Instead of plotting theoretical points to represent conceptual ideas, the CNC programmer is going to be plotting physical end points for axis motions. Each linear axis of the machine tool can be thought of as like a base line of the graph. Like graph base lines, axes are broken into increments. But instead of being broken into increments of conceptual ideas like time and productivity, each linear axis of a CNC machine's rectangular coordinate system is broken into increments of measurement. In the inch mode, the smallest increment may be 0.0001 inch. In the metric mode, the smallest increment may be 0.001 millimeter. (By the way, for rotary axis the increment is 0.001 degrees.) Just like the graph, each axis within the CNC machine's coordinate system must start somewhere. With the graph, the horizontal base line started at January and the vertical base line started at zero-percent productivity. This place where the vertical and horizontal base lines come together is called the origin point of the graph. For CNC purposes, this origin point is commonly called the program zero point (also called work zero, part zero, or program origin). Figure 4 (at right) shows how axis motions are commonly commanded on CNC machines. For this example, the two axes we happen to be showing are labelled as X and Y, but keep in mind that program zero can be applied to any axis. Though the name of each axis will change from one CNC machine type to another (other common names include Z, A, B, C, U, V, and W), this example should work nicely to show you how axis motion can be commanded. As you can see, the lower left hand corner of the workpiece has been made to correspond to the zero position for each axis. That is, the lower left-hand corner of the workpiece is the program zero point. Prior to writing the program, the programmer determines the position of the program zero point. Typically, the program zero point is chosen as the point where all dimensions begin.

With this technique, if the programmer wishes the tool to be sent to a position one inch to the right of the program zero point, X1.0 is commanded. If the programmer wishes the tool to move to a position one inch above the program zero point, Y1.0 is commanded. The control will automatically determine how many times to rotate each axis drive motor and ballscrew to make the axis reach the commanded destination point. This lets the programmer command axis motion in a very logical manner. With the examples given so far, all points happened to be up and to the right of the program zero point. This area up and to the right of the program zero point is called a quadrant (in this case, quadrant number one). It is not uncommon on CNC machines that end points needed within the program fall in other quadrants. When this happens, at least one of the coordinates must be specified as minus. Figure 5 (below) shows the relationship of the four quadrants as well as the plus and minus representations required for each. Figure 6 (below) shows one common application of when end points fall in all four quadrants and negative coordinates must be specified. Figure 4. Rectangular coordinate system for X-Y plane. The program zero point establishes the point of reference for motion commands in a CNC program. This allows the programmer to specify movements from a common location. If program zero is chosen wisely, usually coordinates needed for the program can be taken directly from the print.

Absolute Versus Incremental Motion


All discussions to this point assume that the absolute mode of programming is used. In the absolute mode, the end points for all motions will be specified from the program zero point. For beginners, this is usually the best and easiest method of specifying end points for motion commands. However, there is another way of specifying end points for axis motion. In the incremental mode, end points for motions are specified from the tool's current position, not from program zero. With this method of commanding motion, the programmer must always be asking, "How far should I move the tool?" While there are times when the incremental mode can be very helpful, generally speaking, this is the more cumbersome and difficult method. Figure 5. If an end point needed within a CNC program falls in any quadrant other than quadrant number one, a minus sign must be included in at least one of the axis designations.

Be careful when making motion commands. Beginners have the tendency to think incrementally. If working in the absolute mode (as beginners should), the programmer should always be asking "To what position should the tool be moved?" This position is relative to program zero, not from the tool's current position. Figure 7 (below) shows two identical series of movements, one in the incremental mode and the other in the absolute mode.

Absolute Versus Incremental Motion


Aside from making it very easy to determine the current position for any command, another benefit of working in the absolute mode has to do with mistakes made during motion commands. In the absolute mode, if a motion mistake is made in one command of the program, only one movement will be incorrect. On the other hand, if a mistake is made during incremental movements, all motions from the point of the mistake will also be incorrect.

Assigning Program Zero


Keep in mind that the CNC control must be told the location of the program zero point by one means or another. How this is done varies dramatically from one CNC machine and control to another. An older method is to assign program zero in the program. With this method, the programmer tells the control how far it is from the program zero point to the starting position of the machine. This is commonly done with a G92 (or G50) command at least at the beginning of the program and possibly at the beginning of each tool. A newer and better way to assign program zero is through some form of offset. Machining center control manufacturers commonly call offsets used to assign program zero fixture offsets. Turning center manufacturers commonly call offsets used to assign program zero for each tool geometry offsets. More on how program zero can be assigned will be presented during key concept number four. Figure 6. In this example, program zero is placed in the center of the ring. Notice that any coordinates to the left of, or below, program zero are specified as ngative positions.

Other Points About Axis Motion


To this point, our primary concern has been to show you how to determine the end

point of each motion command. As you have seen, doing this requires an understanding of the rectangular coordinate system. However, there are other concerns about how a motion will take place. For example, the type of motion (rapid, straight line, circular, etc.), and motion rate (feed rate) will also be of concern to the programmer. We'll discuss these other considerations during key concept number three.

The CNC Program


Almost all current CNC controls use a word address format for programming. (The only exceptions to this are certain conversational controls.) By word address format, we mean that the CNC program is made up of sentence-like commands. Each command is made up of CNC words, each of which has a letter address and a numerical value. The letter address (X, Y, Z, etc.) tells the control the kind of word and the numerical value tells the control the value of the word. Used like words and sentences in the English language, words in a CNC command tell the CNC machine what it is we wish to do at the present time. One very good analogy to what happens in a CNC program is found in any set of stepFigure 7. It is very easy to tell the precise location of the tool in any command given in the absolute mode. In the incremental mode, it can be very difficult to determine the tool's current position for a given motion command.

by-step instructions. Say, for example, you have some visitors coming in from out of town to visit your company. You need to write down instructions to get from the local airport to your company. To do so, you must first be able to visualize the path from the airport to your company. You will then, in sequential order, write down one instruction at a time. The person following your instructions will perform the first step and then go on to the next until he or she reaches your facility. In similar manner, a manual CNC programmer must be able to visualize the machining operations that are to be performed during the execution of the program. Then, in step-by-step order, the programmer will give a set of commands that makes the machine behave accordingly. Though slightly off the subject at hand, we wish to make a strong point about visualization. Just as the person developing travel directions must be able to visualize the path taken, so must the CNC programmer be able to visualize the movements the CNC machine will be making before a program can be successfully developed. Without this visualization ability, the programmer will not be able to develop the movements in the program correctly. This is one reason why machinists make the best CNC programmers. An experienced machinist should be able to easily visualize any machining operation taking place. Just as each concise travel instruction will be made up of one sentence, so will each instruction given within a CNC program be made up of one command. Just as the travel instruction sentence is made up of words (in English), so is the CNC command made up of CNC words (in CNC language). The person following your set of travel instructions will execute them explicitly. If you make a mistake with your set of instructions, the person will get lost on the way to your company. In similar fashion, the CNC machine will execute a CNC program explicitly. If there is a mistake in the program, the CNC machine will not behave correctly. At right is a short example program that drills two holes in a workpiece on a CNC machining center. Keep in mind that we are not stressing the actual commands in this program (though the messages in parentheses should make it relatively clear as to what is happening in each command). Instead, we are stressing the structure of a CNC program and the fact that it will be executed sequentially. While the words and commands in this program probably do not make much sense to you (yet), remember that we are stressing the sequential order by which the CNC program will be executed. The control will first read, interpret and execute the very first command in the program. Only then will it go on to the next command. Read, interpret, execute. Then on to the next command. The control will continue to execute the program in order for the balance of the program. Again, notice the similarity to giving any set of step-by-step instructions.

O0001 (Program number) N005 G54 G90 S400 M03 (Select coordinate system, absolute mode, and turn spindle on CW at 400 RPM) N10 G00 X1. Y1. (Rapid to XY location of first hole) N015 G43 H01 Z.1 M08 (Instate tool length compensation, rapid in Z to clearance position above surface to drill, turn on coolant) N020 G01 Z-1.25 F3.5 (Feed into first hole at

Other Notes About Program Makeup


As stated, programs are made up of commands and commands are made up of words. Each word has a letter address and a numerical value. The letter address tells the control the word type. CNC control manufacturers do vary with regard to how they determine word names (letter addresses) and their meanings. The beginning CNC programmer must reference the control manu-facturer's programming manual to determine the word names and meanings. Here is a brief list of some of the word types and their common letter address specifications. O - Program number (Used for program identification) N - Sequence number (Used for line identification) G - Preparatory function (See below) X - X-axis designation Y - Y-axis designation

Z - Z-axis designation R - Radius designation F - Feedrate designation S - Spindle speed designation H - Tool length offset designation D - Tool radius offset designation T - Tool Designation M - Miscellaneous function As you can see, many of the letter addresses are chosen in a logical manner (T for tool, S for spindle, F for feed rate, etc.). A few require memorizing. There are two letter addresses (G and M) which allow special functions to be designated. The preparatory function (G) specifies is commonly used to set modes. We already introduced absolute mode, which is specified by G90 and incremental mode, specified by G91. These are but two of the preparatory functions used. You must reference your control manufacturer's manual to find the list of functions for your machine. Like preparatory functions, miscellaneous functions (M words) allow a variety of special functions. Miscellaneous functions are typically used as programmable switches (like spindle on/off, coolant on/off, and so on). They are also used to allow programming of many other programmable functions of the CNC machine tool. To a beginner, all of this may seem like CNC programming requires a great deal of memorization. But rest assured that there are only about 30-40 different words used with CNC programming. If you can think of learning CNC manual programming as like learning a foreign language that has only 40 words, it shouldn't seem too difficult.

3.5 inches per minute) N025 G00 Z.1 (Rapid back out of hole) N030 X2. (Rapid to second hole) N035 G01 Z-1.25 (Feed into second hole) N040 G00 Z.1 M09 (Rapid out of second hole, turn off coolant) N045 G91 G28 Z0 (Return to reference position in Z) N050 M30 (End of program command)

Decimal point programming


Certain letter addresses (CNC words) allow the specification of real numbers (numbers that require portions of a whole number). Examples include Xaxis designator (X), Y-axis designator (Y), and radius designator (R). Almost all current model CNC controls allow a decimal point to be used within the specification of each letter address. For example, X3.0625 can be used to specify a position along the X axis. On the other hand, some letter addresses are used to specify integer numbers. Examples include the spindle speed designator (S), the tool station designator (T), sequence numbers (N), preparatory functions (G), and miscellaneous functions (M). For these word types, most controls do not allow a decimal point to be used. The beginning programmer must reference the CNC control manufacturer's programming manual to find out which words allow the use of a decimal point.

Other programmable functions


All but the very simplest CNC machines have programmable functions other than just axis motion. With today's full blown CNC equipment, almost everything about the machine is programmable. CNC machining centers, for example, allow the spindle speed and direction, coolant, tool changing, and many other functions of the machine to be programmed. In similar fashion, CNC turning centers allow spindle speed and direction, coolant, turret index, and tailstock to be programmed. And all forms of CNC equipment will have their own set of programmable functions. Additionally, certain accessories like probing systems, tool length measuring systems, pallet changers, and adaptive control systems may also be available and will require programming considerations. The list of programmable functions will vary dramatically from one machine to the next, and the user must learn these programmable functions for each CNC machine to be used. In key concept number two, we will take a closer look at what is typically programmable on different forms of CNC machine tools.

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
If you already know basic machining practice as it relates to the CNC machine you will be working with, you already know what it is you want the machine to do. Mike Lynch President, CNC Concepts, Inc.

Key CNC Concept #2Know Your Machine

A CNC user must understand the makeup of the CNC machine tool being used. While this may sound like a basic statement, a CNC user must be able to view the machine from two distinctly different perspectives. Here in key concept number two, we will be viewing the machine from a programmer's perspective. Much later, in key concept number seven, we will look at the machine from an operator's point of view.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Basic Machining PracticeThe Key To Success With ANY CNC Machine


The first goal of any CNC beginner should be to understand the basic machining practice that goes into using the CNC machine tool. Think of it this way. If you already know basic machining practice as it relates to the CNC machine you will be working with, you already know what it is you want the machine to do. It will be a relatively simple matter of learning how to tell the CNC machine what it is you want it to do (learning to program). This is why machinists make the best CNC programmers, operators, and setup personnel. Machinists already know what it is the machine will be doing. It will be a relatively simple matter of adapting what they already know to the CNC machine. For example, a beginner to CNC turning centers should understand such things as rough and finish turning, rough and finish boring, grooving, threading, and necking. Since this form of CNC machine can perform multiple operations in a single program (as many CNC machines can), the beginner should also know the basics of how to process workpieces completely so a sequence of machining operations can be developed. This point cannot be overstressed. Trying to learn about a particular CNC machine without understanding the basic machining practice related to the machine would be like trying to learn how to fly an airplane without understanding the basics of aerodynamics and flight. From a programmer's standpoint, as you begin to learn about any new CNC machine, you should concentrate on four basic areas. First, you should understand the machine's most basic components. Second, you should become comfortable with your machine's directions of motion (axes). Third, you should become familiar with any accessories equipped with the machine. And fourth, you should find out what programmable functions are included with the machine and learn how they are programmed.

Key Concept #1
The Fundamentals Of CNC

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Machine Components
While you do not have to be a machine designer to work with CNC equipment, it is important to know how your CNC machine is constructed. This will help you to gage the limits of what is possible with your machine. Just as the race car driver should understand the basics of suspension systems, breaking systems, and the workings of internal combustion engines (among other things) in order to get the most out of a given car, so must the CNC programmer understand the basic workings of the CNC machine in order to get the most from it.

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Key Concept #10

For a universal style, slant-bed turning center, for example, the programmer should know the bed, way system, headstock and spindle, turret construction, tailstock, and workholding device. Information regarding the machine's construction, including assembly drawings, is usually published right in the machine tool builder's manual. As you read the manual, here are some of the machine capacity and construction questions to which you should find answers.

Verifying CNC Programs Safely

Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone

1. What is the machine's maximum RPM? Visit MMS' CAD/CAM Software Zone 2. How many spindle speed ranges does the machine have and what are the cut-off points for each range? Link a Friend to This Page Via E-mail 3. What is the spindle and axis drive motor horsepower? 4. What is the maximum travel distance in each axis? 5. How many tools can the machine hold? 6. What way construction does the machine incorporate (usually square ways, dovetail, and/or linear bearing ways). 7. What is the machine's rapid rate (fastest traverse rate)? 8. What is the machine's fastest cutting feed rate? These are but a few of the questions you should be asking yourself as you begin working with any new CNC machine. Truly, the more you know about your machine's capacity and construction, the easier it will be to get comfortable with the machine.

Directions Of Motion (Axes)


The CNC programmer must know the programmable motion directions (axes) available for the CNC machine tool. The axes names will vary from one machine tool type to the next. They are always referred to with a letter address. Common axis names are X, Y, Z, U, V, and W for linear axes and A, B, and C for rotary axes. The beginning programmer should confirm these axis designations and directions (plus and minus) in the machine tool builder's manual. As discussed in key concept number one, whenever a programmer wishes to command movement in one or more axes, the letter address corresponding to the moving axes as well as the destination in each axis are specified. X3.5, for example tells the machine to move the X axis to a position of 3.5 inches from the program zero point in X (assuming the absolute mode of programming is used). Rotary axis departures still require a letter address (usually A, B, or C) along with the end point for the motion. However, the end point for a rotary axis motion is specified in degrees (not inches or millimeters). A rotary axis command given in the absolute mode of B45., for example, would rotate the B axis to an end point of 45 degrees from the program zero.

The Reference Point For Each Axis


Most CNC machines utilize a single position along each axis as a starting or reference point. Some control manufacturers call this position the zero return position. Others call it the grid zero position. Yet others call it the home position. Regardless of what it is called, the reference position is required by many controls as an accurate point of reference. CNC controls that utilize a reference point for each axis require that the machine be sent to its reference point in each axis as part of the power up procedure. Once this is completed, the control will be in sync with the machine's physical position. The specific reference position for each axis will vary from machine to machine. Most machine tool builders make the reference position the extreme plus side of each axis. You must reference your machine tool builder's manual for more on whether your machine incorporates a reference position and, if it does, its precise location.

Accessories To The Machine


The third area a beginning CNC user should address is related to other possible additions to the basic machine tool itself. Some of these accessories may be made and supported by the machine tool builder, and should be well documented in the builder's manual. Other accessories may be made by an after-market manufacturer, in which case a separate manual may be involved. Examples of CNC accessories include probing systems, tool length measuring devices, post process gaging systems, automatic pallet changers, adaptive control systems, bar feeders for turning centers, live tooling and C axis for turning centers, and automation systems. The list of potential accessory devices goes on and on.

Programmable functions
The programmer must also know what functions of the CNC machine are programmable (as well as the related commands). With low cost CNC equipment, oftentimes many machine functions must be manually activated. With some CNC milling machines, for example, about the only programmable function is axis motion. Spindle speed and direction, coolant and tool changes may have to be activated manually by the operator. With full blown CNC equipment, on the other hand, almost everything is programmable and the operator may only be required to load and remove workpieces. Once the cycle is activated, the operator is freed to do other functions.

Reference the machine tool builder's manual to find out what functions of your machine are programmable. To give you some examples of how many programmable functions are handled, following are a few of the most common programmable functions along with their related programming words. Spindle Control. An "S" word is used to specify the spindle speed (in RPM for machining centers). An M03 is used to turn the spindle on in a clockwise (forward) manner. M04 turns the spindle on in a counter clockwise manner. M05 turns the spindle off. Note that turning centers also have a feature called constant surface speed which allows spindle speed to be specified in surface feet per minute (or meters per minute). Automatic Tool Changer (Machining Center). A "T" word is used to tell the machine which tool station is to be placed in the spindle. On most machines, an M06 tells the machine to actually make the tool change. Tool Change (On Turning Centers). A four digit "T" word is used to command tool changes on most turning centers. The first two digits of the T word specify the turret station number and the second two digits specify the offset number to be used with the tool. T0101, for example, specifies tool station number one with offset number one. Coolant Control. M08 is used to turn on flood coolant. If available, M07 is used to turn on mist coolant. M09 turns off the coolant. Automatic Pallet Changer. An M60 command is commonly used to make pallet changes.

G G

Other Programmable Features


As stated, programmable functions will vary dramatically from one machine to the next. The actual programming commands needed will also vary from builder to builder. Be sure to check the M codes list (miscellaneous functions) given in the machine tool builder's manual to find out more about what other functions may be programmable on your particular machine. M codes are commonly used by the machine tool builder to give the user programmable ON/OFF switches for machine functions. In any case, you must know what you have available for activating within your CNC programs. For turning centers, for example, you may find that the tailstock and tailstock quill are programmable. Chuck jaw open and close may be programmable. If the machine has more than one spindle range, commonly the spindle range selection is programmable. And if the machine has a bar feeder, it will be programmable. You may even find that your machine's chip conveyor can be turned on and off through programmed commands. All of this, of course, is important information to the CNC programmer. MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
Effectively commanding motion on most CNC machines requires more than describing how the CNC machine determines the end point position for each motion. Mike Lynch President, CNC Concepts, Inc.

Key CNC Concept #3Understanding CNC Motion Types

During key concept number one, we discussed how end points for axis motion are commanded utilizing the rectangular coordinate system. During that presentation, however, we were only concerned with describing how the CNC machine determines the end point position for each motion. To effectively command motion on most CNC machines requires more than that for positioning movements. CNC control manufacturers try to make it as easy as possible to make movement commands within the program. For those styles of motion that are commonly needed, they give the CNC user various types of interpolation.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Understanding Interpolation
Say for example, you wish to move only one linear axis in a command. You want to move the X axis to a position one inch to the right of program zero. In this case, the command X1. would be given (assuming the absolute mode is instated). The machine would move along a perfectly straight line during this movement (since only one axis is moving). Now let's say you wish to include a Y axis movement to a position one inch above program zero in Y (with the X movement). We'll say you are trying to machine a tapered or chamfered surface of your workpiece in this command. For the control to move along a perfectly straight line to get to the programmed end point, it must perfectly synchronize the X and Y axis movements. Also, if machining is to occur during the motion, a motion rate (feed rate) must also be specified. This requires linear interpolation. During linear interpolation commands, the control will precisely and automatically calculate a series of very tiny single axis departures, keeping the tool as close to the programmed linear path as possible. With today's CNC machine tools, it will appear that the machine is forming a perfectly straight line motion. However, Figure 1 (at right) shows what the CNC control is actually doing during linear interpolation. In similar fashion, many applications for CNC machine tools require that the machine be able to form circular motions. Applications for circular motions include forming radii on turned workpieces between faces and turns, and milling radii on contours on machining centers. This kind of motion requires circular interpolation. As with linear interpolation, the control will do its best to generate as Figure 1. Actual motion generated with linear interpolation. Notice the series of very tiny single axis movements. The step size is equal to the machine's resolution, usually 0.0001 inch or 0.001mm.

Key Concept #2
Know Your Machine

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Key Concept #10


Verifying CNC Programs Safely

Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

close to a circular path as possible. Figure 2 (below) shows what happens during circular interpolation. Depending on the machine's application, you may find that you have other interpolation types available. Again, CNC control manufacturers try to make it as easy as possible to program their controls. For example, many machining center users perform thread milling operations on their machines. During thread milling, the machine must move in a circular manner along two axes (usually X and Y) at the same time a third axis (usually Z) moves in a linear manner. This allows the helix of the thread to be properly machined. This motion resembles a spiraling motion

(though the radius of the spiral remains constant). Knowing that their customers need this type of motion for thread milling, CNC machining center control manufacturers offer the feature called helical interpolation. Yet another type of interpolation may be required on turning centers that have live tooling. For turning centers that can rotate tools (like end mills) in the turret and have a C axis to rotate the workpiece held in the chuck, polar coordinate interpolation can be used to mill contours around the periphery of the workpiece. Polar coordinate interpolation allows the programmer to "flatten out" the rotary axis, treating it as a linear axis for the purpose of making motion commands.

The Three Most Basic Motion Types


While your particular CNC machine may have more motion types (depending on your application), let's concentrate on the three most common types available on almost all forms of CNC equipment. After briefly introducing each type of motion, we'll show an example program that stresses the use of all three. These motion types share two things in common. First, they are all modal. This means they remain in effect until changed. If, for example, several motions of the same kind are to be given consecutively, the corresponding G code need only be specified in the first command. Second, the end point of the motion is specified in each motion command. The current position of the machine will be taken as the starting point. Figure 2. This drawing shows what happens during circular interpolation.

Rapid Motion (Also Called Positioning)

This motion type is used to command motion at the machine's fastest possible rate. It is used to minimize non-productive time during the machining cycle. Common uses for rapid motion include positioning the tool to and from cutting positions, moving to clear clamps and other obstructions, and in general, any non-cutting motion during the program. You must check in the machine tool builder's manual to determine a machine's rapid rate. Usually this rate is extremely fast (some machines boast rapid rates of well over 1000 ipm!), meaning the operator must be cautious when verifying rapid motion commands. Fortunately, there is a way for the operator to override the rapid rate during program verification. The command almost all CNC machines use to initiate rapid motion is G00. Within the G00 command, the end point for the motion is given. Control manufacturers vary with regard to what actually happens if more than one axis is included in the rapid motion command. With most controls, the machine will move as fast as possible in all axes commanded. In this case, one axis will probably reach its destination point before the others. With this kind of rapid command, straight line movement will not occur during rapid and the programmer must be very careful if there are obstructions to avoid. With other controls, straight line motion will occur, even during rapid motion commands.

Straight Line Motion


This motion type allows the programmer to command perfectly straight line movements as discussed earlier during our discussion of linear interpolation. This motion type also allows the programmer to specify the motion rate (feed rate) to be used during the movement. Straight line motion can be used any time a straight cutting movement is required, including when drilling, turning a straight diameter, face or taper, and when milling straight surfaces. The method by which feedrate is programmed varies from one machine type to the next. Generally speaking, machining centers only allow the feed rate to be specific in per-minute format (inches or millimeters per minute). Turning centers also allow feed rate to be specified in per-revolution format (inches or millimeters per revolution). A G01 word is commonly used to specify straight line motion. Within the G01, the programmer will include the desired end point in each axis.

Circular Motion
This motion type causes the machine to make movements in the form of a circular path. As discussed earlier during our presentation of circular interpolation, this motion type is used to generate radii during machining. All feed rate related points made during our discussion of straight line motion still apply. Two G codes are used with circular motion. G02 is commonly used to specify clockwise motion while G03 is used to specify counter clockwise motion. To evaluate which to use, you simply view the movement from the same perspective the machine will view the motion. For example, if making a circular motion in XY on a machining center, simply view the motion from the spindle's vantage point. If making a circular motion in XZ on a turning center, simply view the motion from above the spindle. In most cases, this is as simple as viewing the print from above.

Additionally, circular motion requires that, by one means or another, the programmer specify the radius of the arc to be generated. With newer CNC controls this is handled by an "R" word that simply states the radius. With older controls, directional vectors (specified by I, J, and K) tell the control the location of the arc's center point. Since controls vary with regard to how directional vectors are programmed, and since the R word is becoming more and more popular for radius designation, our examples will show the use of the R word. If you wish to learn more about directional vectors, refer to your control manufacturer's manual. MMS

Example Program Showing Three Types Of Motion


In this particular example, we are milling around the outside of a workpiece contour. Notice that we are using a one-inch diameter end mill for machining the contour and we are programming the very center of the end mill. Later, during key concept number four, we will discuss a way to actually program the workpiece contour (not the cutter centerline path). O0002 (Program number) N005 G54 G90 S350 M03 (Select coordinate system, absolute mode, and start spindle CW at 350 RPM) N010 G00 X-.625 Y-.25 (Rapid to point 1) N015 G43 H01 Z-.25 (Instate tool length compensation, rapid tool down to work surface) N020 G01 X5.25 F3.5 (Machine in straight motion to point 2) N025 G03 X6.25 Y.75 R1.0 (CCW circular motion to point 3) N030 G01 Y3.25 (Machine in straight motion to point 4) N035 G03 X5.25 Y4.25 R1.0 (CCW circular motion to point 5) N040 G01 X.75 (Machine in straight motion to point 6) N045 G03 X-.25 Y3.25 R1.0 (CCW circular motion to point 7) N050 G01 Y.75 (Machine in straight motion to point 8) N055 G03 X.75 Y-.25 R1.0 (CCW circular motion to point 9) N060 G00 Z.1 (Rapid away from workpiece in Z) N065 G91 G28 Z0 (Go to the machine's reference point in Z) N070 M30 (End of program) While you may not understand all commands given in this program, concentrate on understanding what is happening in the motion commands (G00, G01, and G02/G03). With study, you should be able to see what is happening. Messages in parentheses are provided to document what is happening in each command. Keep in mind that CNC controls do vary with regard to limitations with motion types. For example, some controls have strict rules governing how much of a full circle you are allowed to make within one circular command. Some require directional vectors for circular motion commands instead of allowing the "R" word. Some even incorporate automatic corner rounding and chamfering, minimizing the number of motion commands that must be given. Though you must be prepared for variations, and you must reference your control manufacturer's programming manual to find out more about your machine's motion commands, at least this presentation has shown you the basics of motion commands. You should be able to adapt to your particular machine and control with relative ease.

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
Though applied for different reasons on different machine types, all forms of compensation allow the CNC user to allow for unpredictable conditions related to tooling. Mike Lynch President, CNC Concepts, Inc.

Key CNC Concept #4The Forms Of Compensation

All types of CNC machine tools require some form(s) of compensation. Though applied for different reasons on different machine types, all forms of compensation allow the CNC user to allow for unpredictable conditions related to tooling. Before discussing how compensation applies to CNC usage, let's look at compensation in general terms. Compensation is used in many facets of everyday life. Consider, for example, how a marksman firing a rifle compensates for the distance to the target. The marksman analogy is amazingly similar to what happens with many forms of compensation on CNC equipment, so let's discuss it further. Say a marksman is standing 50 yards from a target. By one means or another, he would adjust the sight on the rifle to allow for the distance. But until the first shot is fired, the marksman would not know for sure whether the initial sight adjustment was perfectly correct. Once the first shot is fired and the marksman sees the resulting hole location, the sight might have to be fine tuned to adjust for minor imperfections with the initial adjustment. In similar fashion, the CNC user will be faced with several situations when it will be impossible to predict exactly the result of certain tooling related problems. So one form or another of compensation will have to be used to handle the problem. But just as the marksman may have to fine tune after the initial shot, so may the CNC user have to fine tune the initial compensation entry. More on how and why in a little while.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Key Concept #8 What Are Offsets?


All forms of compensation work with offsets. You can think of CNC offsets like memories on an electronic calculator. If your calculator has memories, you know you can store a constant value into each memory for use during a calculation. This keeps you from having to enter the number over and over again with redundant calculations. Like the memories of an electronic calculator, offsets in the CNC control are storage locations into which numerical values can be placed. From the marksman analogy, you can think of the values stored in CNC offsets as like the amount of adjustment required on the sight of the rifle. Keep in mind that the rifle only needed adjustment for one purpose, to adjust for the distance to the target. With most CNC machine tools, there is a need for at least one offset per tool. Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Key Concept #10


Verifying CNC Programs Safely

Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

Reasons For Tool Offsets

Offsets can be used for several purposes, depending on the style of machine tool and type of compensation being used. Here are some of the more common applications for offsets. To specify each tool's length. For machining center applications, it would be very difficult for the programmer to predict the precise length of each tool used in the program. For this reason, the tool length compensation feature allows the programmer to ignore each tool's length as the program is written. At the time of setup, the setup person measures the length of each tool and inputs the tool length value into the corresponding offset.

To specify the radius of the cutting tool. When milling on the periphery of the cutter, it can be cumbersome and difficult for the programmer to create tool path based on the size of the milling cutter being used. Also, if the cutter size must change (possibly due to resharpening), it would be impractical to change the program based on the new cutter size. For this reason, the cutter radius compensation feature allows the programmer to ignore the cutter size as the program is written. The setup person inputs the size of each milling cutter into its corresponding tool offset. Similarly, turning centers have a feature called tool nose radius compensation. With this feature, an offset is used to specify the radius of the very tip of the turning or boring tool. To assign program zero. Machining centers that have fixture offsets (also called coordinate system shifting) allow the user to specify the position of the program zero point within offsets, keeping the assignment of program zero separate from the program. Many turning centers also allow the assignment of program zero with offsets (this feature is commonly called geometry offsets). To allow sizing on turning centers. Tool offsets are used on all turning centers to allow the operator to hold size with tools used within their programs. This allows the operator to adjust for imperfections with tool placement during setup. It also allows the operator to compensate for wear during each tool's life.

Organizing Offsets
With some CNC controls, the organization of offsets is very obvious. Some machining center controls, for example, automatically make the offset number correspond to the tool station number. With this kind of machine, when tool station number one is commanded, the control will automatically invoke offset number one. Within offset number one, the operator can store a tool length value as well as a tool radius value. Figure 1 (below) shows the offset table for this kind of machining center. But, not all controls make it this simple. In some, each offset contains only one value and the offset number has no real relationship to the tool station number. In this case, the programmer must cautiously organize which offsets are used with each tool.

Figure 1. Offset tables in CNCs allow users to compensate for unpredictable conditions related to tooling. The table at right provides an offset position for both tool length and diameter. With a simpler table (middle) that only allows one entry per offset, the programmer must make it quite clear as to the function of each entry. On a popular turning center control, four values can be entered for each offset (at left).

For example, the tool length compensation offset numbers can be made the same as tool station numbers. Cutter radius compensation offset numbers can be made equal to the tool station number plus a constant value larger than the number of tools the machine can hold. If the machine can hold 25 tools, tool station number one could be made to use offset number one to store its length compensation value and offset number thirty-one could be used to store its cutter radius compensation value. With this method of offset organization, the programmer and operator are constantly in sync. Figure 1 (above) shows an offset table for this kind of machining center. The offset table on most turning centers incorporates at least two values per offset. Generally speaking, the programmer will instate the offset number corresponding to the tool station number for each tool offset used. That is, tool number one will use (only) offset number one, tool two will use offset two, and so on. Typically the tool nose radius (R column of the offset table) and the tool type (the T column of the offset table) can be specified within the turning center's offset table. Figure 1 (above) also shows this sort of offset table for a popular turning center control.

Types of compensation
Now let's discuss the compensation types in a little more detail. Keep in mind that while the actual use of these functions can vary dramatically from one machine to the next, the basic reasoning behind each compensation type remains remarkably similar. With an understanding of why the compensation type is required, and with an elementary understanding of how it is applied to one specific control, you should be able to adapt to any variations that you come across.

Tool length compensation


This machining center compensation type allows the programmer to forget about each tool's length as the program is written. Instead of having to know the exact length of each tool and tediously calculating Z axis positions based on the tool's length, the programmer simply instates tool length compensation on each tool's first Z axis approach movement to the workpiece. At the machine during setup, the operator will input the tool length compensation value for each tool in the

corresponding offset. This, of course, means the tool must first be measured. If tool length compensation is used wisely, the tool can be measured off line (in a tool length measurement gage) to minimize setup time. Figure 2 (at right) shows one popular method of determining the tool length compensation value. With this method, the value is simply the length of the tool. A popular command to instate tool length compensation is G43. Within the G43 command, the programmer includes an H word that specifies the number of the offset containing the tool's length value. Here is an example program that utilizes tool length compensation with two tools. The program simply drills two holes (one with each tool). Notice that tool length compensation is being instated in lines N015 and N055. Program O0001 (Program number) N005 T01 M06 (Place tool number one in the spindle) N010 G54 G90 S400 M03 T02 (Select coordinate system, absolute mode, start spindle CW at 400 RPM, get tool number two ready) N010 G00 X1.0 Y1.0 (Rapid to first XY position) N015 G43 H01 Z.1 M08 (Instate tool length compensation on first Z move, turn on coolant) N020 G01 Z-1.5 F4. (Drill hole) N025 G00 Z.1 M09 (Rapid out of hole, turn off coolant) N030 G91 G28 Z0 M19 (Return to tool change position, orient spindle) N035 M01 (Optional stop) N040 T02 M06 (Place tool number two in spindle) N045 G54 G90 S400 M03 T01 (Select coordinate system, absolute mode, start spindle at 400 RPM, get tool number one ready) N050 G00 X2. Y1. (Rapid to first XY position) N055 G43 H02 Z.1 M08 (Instate tool length compensation on tool's first Z move, turn on coolant) N060 G01 Z-1.2 F5.5 (Drill hole) N065 G00 Z.1 M08 (Rapid out of hole, turn off coolant) N070 G91 G28 Z0 M19 (Return to tool change position, orient spindle) N075 M30 (End of program) As stated, this feature varies dramatically in use from one control model to the next. You must reference your control manufacturer's programming manual to learn more about how tool length compensation applies to your particular machining center. Figure 2. With tool length compensation, the tool's length compensation value is stored separate from the program. Many CNC controls allow the length of the tool to be used as the offset value.

Sizing With Tool Length Compensation


Earlier, we said that the marksman would not know for sure whether the initial sight adjustment is perfectly correct until the first shot is fired. In similar fashion, the CNC operator will not know for certain whether the tool length compensation value is perfectly correct until the first workpiece is machined. Say, for example, the tool length measurement was made incorrectly. During the measurement, the operator finds the tool to be 6.5372 inches long. But the actual tool length is 6.5355 inches. In this case, the tool would machine slightly shallower in Z than it is supposed to. After machining, the minor depth change can be made by adjusting the offset, not the program. In some cases, even if the tool length value is measured perfectly, other problems may cause the tool to not machine to the proper depth. If, for example, the workpiece or setup is quite weak, tool pressure may cause the workpiece to deflect from the tool during machining.

For critical surfaces or when the effects of tool pressure are unpredictable, the operator can even trial cut the workpiece under the influence of an offset slightly larger than the measured value to ensure that some excess stock will be left. After machining, the operator can measure the surface to determine precisely how much offset change is necessary to machine the workpiece to size.

Cutter Radius Compensation


Just as tool length compensation allows the machining center programmer to forget about the tool's length, so does cutter radius compensation allow the programmer to forget about the cutter's radius as contours are programmed. While it may be obvious, let us point out that cutter radius compensation is only used for milling cutters and only when milling on the periphery of the cutter. A programmer would never consider using cutter radius compensation for a drill, tap, reamer, or other hole machining tool. Let's begin by discussing four reasons why cutter radius compensation is not only required, but also very helpful to the CNC user.

Program Coordinates Are Easier To Calculate


Without cutter radius compensation, machining center programmers must program the centerline path of all milling cutters. An example program using this technique was shown during our discussion of motion types (key concept number three). When programming centerline path, the programmer must know the precise diameter of the milling cutter and calculate program movements accordingly. This can be difficult enough with simple motions, but when contours become complicated, it can be very difficult to calculate centerline path. With cutter radius compensation, the programmer can program the coordinates of the work surface, not the tool's centerline path. This eliminates the need for many calculations. Keep in mind that we are now talking about manual programming. If you have a CAM (computer-aided manufacturing) system, it can probably generate centerline path just as easily as work surface path.

Range Of Cutter Sizes


Say you do program centerline path for a given workpiece contour and do not use cutter radius compensation. Also say you have programmed based on a one-inch diameter tool. But when the job is to be run, you find that your company does not have any one-inch end mills. The closest you have is a 0.875-inch cutter. In this case, the entire cutter path would have to be changed in the program to match the new cutter size. With cutter radius compensation, handling this problem is as simple as changing an offset value.

Easy Sizing
As with tool length compensation, the operator can use the cutter radius compensation offset to help with sizing. If the contour is not coming out to size (possibly due to tool pressure), an offset can be changed to allow for the imperfection.

Roughing And Finishing


This is also a manual programming related reason for using cutter radius compensation. If contours must be rough and finish milled, cutter radius compensation allows the programmer to used the same programmed coordinates to execute each operation. This keeps the programmer from having to calculate two sets of milling coordinates (one for roughing and one for finishing). To leave stock for finishing during the rough milling, the operator will simply make the cutter radius compensation offset value slightly larger than the cutter's actual size. This will keep the cutter away from the final surface and leave the desired amount of stock for finishing.

How To Program Cutter Radius Compensation


The use of cutter radius compensation does vary from one control to the next. Additionally, each control will have a set of strict rules that specify how cutter radius compensation is instated, used, and cancelled. Here we just show the basics of how it is programmed and give an example for how it is used on one popular control model. You must refer to your CNC control manufacturer's manual for more on your particular control. Most controls use three G codes with cutter radius compensation. G41 is used to instate a cutter left condition (climb milling with a right hand cutter). G42 is used to instate a cutter right condition (conventional milling). G40 is used to cancel cutter radius compensation. Additionally, many controls use a D word to specify the offset number used with cutter radius compensation. To determine whether to use G41 or G42, simply look in the direction the cutter is moving during

machining and ask yourself if the cutter is on the left or right side of the surface being machined. If on the left, use G41. If on the right, use G42. Figure 3 shows some examples that should help you understand how to determine whether to use G41 or G42 to instate. Once cutter radius compensation is properly instated, the cutter will be kept on the same side of all surfaces until the G40 command to cancel compensation. Figure 4 (below) shows the drawing to be used for our example program. In line N025, cutter radius compensation is being instated. From this point on, work surface coordinates can be used for the cutter path. The tool will be kept away from all surfaces by the value stored in offset number thirtyone. Program O0001 (Program number) N005 G54 G90 S350 M03 (Select coordinate system, absolute mode, start spindle CW at 350 RPM) N010 G00 X-.6 Y-.6 (Rapid to point 1) N015 G43 H01 Z.1 M08 (Instate tool length compensation, move to clearance position in Z, turn on coolant) N020 G01 Z-.25 F30. (Fast feed to work surface) N025 G42 D31 Y.25 F4. (Instate cutter compensation to point 2) N030 X4.25 (Feed to point 3) N035 G03 X4.75 Y.75 R.5 (Circular move to point 4) N040 G01 Y2.25 (Feed to point 5) N045 G03 X4.25 Y2.75 R.5 (Circular move to point 6) N050 G01 X.75 (Feed to point 7) N055 G03 X.25 Y2.25 R.5 (Circular move to point 8) N060 G01 Y.75 (Feed to point 9) N065 G03 X.75 Y.25 R.5 (Circular move to point 10) N070 G00 Z.1 M09 (Rapid away in Z, turn off coolant) N075 G40 (Cancel cutter radius compensation) N080 G91 G28 Z0 (Return to reference position in Z) N100 M30 (End of program) Figure 4. Sample part for cutter radius compensation.

Figure 3. Drawings show how to determine whether to use G41 or G42 to instate cutter radius compensation.

Fixture Offsets
Just as tool length and cutter radius compensation allow the programmer to forget about cutting tools as the program is written, fixture offsets allow the programmer to forget about the workholding setup. As you know from key concept number one, the programmer will be calculating all coordinates for the program from the program zero point. The CNC control must be told the location of program zero in order to make positioning movements properly. And this must be done before the program can be run. One very convenient way to specify position of the program zero point is with fixture offsets. Within the fixture offset, the setup person will store the distance between the machine's reference position and the program zero point for each axis. This usually requires that a measurement be taken to determine the required distances.

CNC controls vary dramatically with regard to the words used to instate the fixture offset. Some controls allow only one program zero point to be assigned per program and no special CNC command is needed to instate the fixture offset. This kind of control simply assumes the values have been stored correctly. Other controls allow multiple program zero points to be specified (with multiple fixture offsets). These controls require that the programmer specify which fixture offset to use. One popular control uses the set of G codes ranging from G54 through G59 for this purpose. G54 instates fixture offset number one, G55 instates fixture offset number two, and so on through G59. Any axis coordinates specified will be taken from the current program zero position. With this kind of control, the setup person must know which fixture offsets are being used in the program in order to store the measured values into the correct locations.

Dimensional tool offsets


This compensation type applies only to turning centers. When setting up tools, it is infeasible to expect that each tool will be perfectly into position. It is likely that some minor positioning problems will exist. And even if all tools could be perfectly positioned, as any single-point turning or boring tool begins cutting, it will begin to wear. As a turning or boring tool wears, it will directly affect the size of the workpiece being machined. For these reasons, and to allow easy sizing of turned workpieces, dimensional tool offsets are required (also simply called tool offsets). Dimensional tool offsets are instated as part of a four-digit T word. The first two digits indicate the tool station number and the second two digits indicate the offset number to be instated. The command T0101, for example, rotates the turret to station number one and instates offset number one. It is wise to always make the number of the primary offset used with a tool the same as the tool station number. When a tool offset is instated, the control actually shifts the entire coordinate system by the amount of the offset. It will be as if the operator could actually move the tool in the turret by the amount of the offset. Each dimensional offset has two values, one for X and one for Z. The operator will have control of what the tool does in both axes as the workpiece is being machined. Here's an example that should help you understand how dimensional tool offsets work. Say you have written a program to use tool number one (with offset number one) to turn a three-inch diameter. After machining the three-inch diameter, it is measured and found to be 3.005 inches. That is, the workpiece is 0.005 inch oversize. In this case, the X value of offset number one will be reduced by 0.005 in. When the program is run again, tool number one will machine the workpiece 0.005 inch smaller.

How To Guarantee Your First Workpiece Comes Out On Size


If working on an engine lathe, manually turning a precise diameter, you would first allow the tool to skim cut to find out exactly where the tool is located. After skim cutting, you can determine precisely how much to adjust the cross slide to make the tool turn the desired diameter. In the same way, you can use dimensional tool offsets to ensure that a tool will not violate the workpiece on its first full cut. Outside diameter turning tools, for example, can be offset slightly plus in X to ensure that some excess stock is left. Inside diameter bored holes can be offset slightly minus in X for the same purpose. In either case, the first time the tool is run, the operator can rest assured that the workpiece will come out with some excess finishing stock and it will not be scrapped. After machining the first time, the surface can be measured. The operator will then adjust the corresponding offset accordingly and remachine. This time the surface will be machined perfectly to size. Using this technique on each tool in the program will almost guarantee that the first workpiece will be machined correctly.

Tool Nose Radius Compensation


Just as cutter radius compensation allows the programmer to program work surface coordinates, so does tool nose radius compensation. Figure 5 stresses why tool nose radius compensation is required. As you can see, when work surface coordinates are programmed, the tool's radius will cause deviations from the work surface on circular and angular motions. To determine G41 or G42, simply look in the direction the tool is moving during the cut and ask yourself which side of the workpiece the tool is on. If the tool is on the left, use G41 (this would be the case when boring toward the chuck). If the tool is on the right, use G42 (turning toward the chuck). Once you determine which to use, include the proper G code in the tool's first approach to the workpiece. Once tool nose radius compensation is instated, it remains in effect until cancelled. Keep in mind that the tool nose radius is quite small (usually 1/64, 1/32, 3/64, or 1/16 inch), meaning the deviation from the work surface caused by the tool radius will also be quite small. It is possible that if you are only chamfering corners to break sharp edges, you may not need tool nose radius compensation. However, if the surfaces being machined are critical (morse taper, for example), you must compensate for the radius of the tool. Also, you should only need tool nose radius compensation when finishing. It can cause problems if used during roughing operations due to the Figure 5. Notice that the tool nose radius will cause deviations from the required work surface if not considered during programming.

constant reversals in direction.

Do You Have A CAM System?


If your company uses a CAM (computer-aided manufacturing) system to help with CNC programming, keep in mind that it may eliminate the need to use tool nose radius compensation. You can have the CAM system output a CNC program that bases all movements on a previously determined tool nose radius. If, for example, a 1/32 inch tool nose radius is to be used, the CAM system will modify the tool path in the CNC program accordingly. This, of course, requires that the planned tool nose radius be used.

Other Types Of Compensation


The compensation types shown to this point have been for machining centers and turning centers. But all forms of CNC equipment have some form of compensation to allow for unpredictable situations. Here are some other brief examples. CNC wire EDM machines have two kinds of compensation. One, called wire offset, works in a very similar way to cutter radius compensation to keep the wire centerline away from the work surface by the wire radius plus the overburn amount. It is also used to help make trim (finishing) passes using the same coordinates. Laser cutting machines also have a feature like cutter radius compensation to keep the laser the radius of the laser beam away from the surface being machined. CNC press breaks have a form of compensation for bend allowances based on the workpiece material and thickness. Generally speaking, if the CNC user is faced with any unpredictable situations during programming, it is likely that the CNC control manufacturer has come up with a form of compensation to deal with the problem.

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
Simplicity and consistency are the hallmarks of good programming.

Key CNC Concept #5The Importance Of Program Formatting


Mike Lynch President, CNC Concepts, Inc.

As stated in key concept number one, the CNC control will execute a part program exactly as it is written so all commands necessary to make the machine do the required operations must be sequenced in the proper order. And of course, part of learning how to program is understanding the program structure a CNC machine requires. One of the main reasons to strictly format CNC programs has to do with making it easy to write your first few programs. When writing your first program, the related commands will by no means be memorized. However, if you have good example formats to go by, those first few programs will be much easier. It's like driving a car. It is unlikely that any driver can recite from memory all road signs used to direct traffic. However, when a driver sees a road sign, it is quite likely he will recognize its meaning. In the same way, it is unlikely that even an experienced CNC programmer can recite every word used with CNC programming. But when even a relative newcomer to CNC sees a command, it is likely its meaning will be remembered. One of our intentions with program formatting is to keep you from having to memorize all commands needed for programming. Instead, you will be looking at an example and simply recollecting the function of each command. A second reason for strict program formatting is consistency. Once you have a format that works, use it. If you use the same format (or structure) for all programs you write, you will be able to repeat past successes. If all programmers in your company use the same format for a given CNC machine, each programmer will be easily able to work on another's program. The third (and most important) reason for strictly formatting programs is related to multiple tool jobs. Almost all CNC machining center and turning center programs require more than one tool in the program. For this kind of program, there will be many times when it will be necessary to rerun only one tool in the program a second, third, or fourth time. Say, for example, you have a machining center program that uses ten tools. After running a workpiece, you determine that the fifth tool in the program did not go quite deep enough. After fixing the problem (changing tool offset or Z position in the program), you will need to run the fifth tool again. However, you would not want to run the entire program just to get to tool number five. Doing so would be a waste of time and may actually cause unwanted problems with workpiece ac-curacy and finish. Instead, you will want to be able to run only tool five a second time. To do so will require that all information necessary to get the machine running (just like at the beginning of the program) is included at the beginning of tool five. If the programmer makes certain assumptions related to modal information from a previous tool, it may not be possible to run tool number five by itself (without editing the program). Here is an example of a time when the programmer must include some redundant information at the beginning of a tool in order to provide the operator the ability to rerun the tool. As in our previous ten-tool example, we still wish to run tool number five a second time. Say that tools four and five both happen to run at 500 rpm. Say the last tool in the program (tool number ten) runs at 1500 rpm. Spindle speed is modal. While writing the program, say the programmer decides to leave out the S500 word at the beginning of tool five, expecting it to carry over from tool four. Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Key Concept #10


Verifying CNC Programs Safely

Visit MMS' Machining Centers Zone

If the program is run in the normal (sequential) manner, everything will work just fine. But when the operator attempts to rerun tool number five it will start at the same spindle speed as the last tool in the program (1500 rpm), not 500 rpm! To alleviate this problem, the programmer must include all information necessary to begin the tool, even if it means including some redundant information. In essence, the programmer must treat each tool as a miniprogram that can run separate from the rest of the program. When you think about it, this actually simplifies the programming task, allowing the programmer to break a seemingly complicated multitool program into smaller and easier-to-handle pieces.

The Four Kinds Of Program Format


For machines that have the ability to perform operations with several tools, there are four kinds of program format: program startup format, tool ending format, tool startup format, and program ending format. The programmer will begin every program with program startup format. Then come the cutting operations with the first tool. When finished cutting, the programmer will follow the format to end the tool (tool ending format), then the tool startup format to begin the second tool. The programmer will then toggle among cutting information, tool ending format and tool startup format until finished cutting with the last tool. At this point, the programmer will follow the format to end the program. For an example of the four kinds of program format, refer to the program given during our discussion of tool length compensation (key concept number four). This program uses two tools and follows the strict format we are now discussing. Let's determine what commands are related to each kind of format. The first four commands (beginning with the program number) make up the program startup format. At the completion of line N015, the tool is ready to begin machining. Lines N020 and N025 make up the cutting commands for the first tool. (In line N030, the feed rate should be considered part of program startup format.) Lines N030 and N035 form the tool ending format. Lines N040 through N055 are tool startup format. (In line N060, the feed rate should be considered part of tool startup format.) Lines N060 and N065 are the cutting commands for the second tool. And lines N070 and N075 are program ending format. Note that there are only four commands that do any cutting in this program. The bulk of the program is just format. By breaking up the program in this manner, you can see just how much of it is nothing more than standard format that can be copied from one program to another. Of course, certain word values like spindle speeds, feed rates, axis positions, and tool station and offset numbers will change with each program. But the basic structure can be copied, keeping you from leaving out important information.

How Do You Come Up With Program Format Information For Your Machine?
The best way is to take an example program that is currently running successfully and break it up in the manner shown above. When doing this, analyze just what each tool is doing to determine the various types of format. Ensure that each tool contains all information needed to run independently. If you are working from scratch with a new CNC machine and have no examples to go by, contact your machine tool builder to gain an understanding of how your programs should be formatted. You may also find examples given within your machine tool builder's programming manual.

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
Presented here are three methods of developing CNC programs, manual programming, conversational (shop-floor) programming, and CAM system programming. Mike Lynch President, CNC Concepts, Inc.

Key CNC Concept #6Methods For CNC Programming

To this point, we have exclusively stressed manual programming techniques at G-code level in order to ensure your understanding of basic CNC features. In this key concept, however, we will explore the various methods of creating CNC programs. We will give applications for each method to determine which is best for a given company. While we do tend to get a little opinionated in this section, you should at least understand the basic criteria for deciding among the programming alternatives. We will discuss three methods of developing CNC programs, manual programming, conversational (shop-floor) programming, and CAM system programming. Keep in mind that no one of these alternatives is right for all companies. Each has its niche in the manufacturing industry.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Manual Programming
As you have seen, manual programming tends to be somewhat tedious. Admittedly, the words and commands involved with manual programming can be somewhat cryptic. However, all CNC programmers should have a good understanding of manual programming techniques regardless of whether or not they are used. We relate this to performing arithmetic calculations longhand as opposed to on an electronic calculator. Math teachers unanimously agree that students must understand how to perform arithmetic calculations manually. Once the student possesses a firm understanding of how to perform calculations manually, a calculator can be used to expedite the calculation procedure. For the right application, manual programming may be the best programming alternative. There are still a great number of companies who exclusively employ manual programming techniques. If, for example, only a few machine tools are used, and if the work performed by the company is relatively simple, a good manual programmer will probably be able to outperform even a very good CAM system programmer. Or say a company dedicates the use of their CNC equipment to a limited number of jobs. Once these jobs are programmed, there will never be a need to create more programs. This is another time when manual programming may make the best programming alternative.

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Key Concept #10


Verifying CNC Programs Safely

Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone

Even if a CAM system is used, there will be times when the CNC program (at G-code level) must be changed to correct mistakes during the verification of the program. Also, there will usually be an opportunity to optimize programs after running of the first few workpieces. If the programmer must use the CAM system to perform these very elementary changes to the CNC program, a great deal of production time can be wasted.

Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

Conversational (Shopfloor) Programming


This form of programming has become quite popular in recent years. With conversational programming, the program is created at the CNC machine. Generally speaking, the conversational program is created using graphic and menu-driven functions. The programmer will be able to visually check whether various inputs are correct as the program is created. When finished, most conversational controls will even show the programmer a tool path plot of what will happen during the machining cycle.

Conversational controls vary substantially from one manufacturer to the next. In most cases, they can essentially be thought of as a single-purpose CAM system, and thus do provide a convenient means to generate part programs for a single machine. Be forewarned, though, that some of these controls, particularly older models, can only be programmed conversationally at the machine, which means you can't utilize other means such as offline programming with a CAM system. However, most newer models can operate either in a conversational mode or accept externally generated G-code programs.

The Application For Conversational Controls


There has been quite a controversy brewing over the wisdom of employing conversational controls. Some companies use them exclusively and swear by their use. Others consider them wasteful. Everyone involved with CNC seems to have a very strong opinion (pro or con) about them. Generally speaking, companies who employ a limited number of people to utilize their CNC equipment and run a wide variety of different workpieces tend to use and like conversational controls. In this kind of company, one person may be expected to perform many CNC-related tasks. In many job shops, for example, the CNC operator may be expected to set up tooling, make the workholding setup, prepare the program, verify and optimize the program, and actually run production. In this kind of company, anything that can be done to help the operator will streamline production. Conversational controls can dramatically reduce the time it takes the operator to prepare the program as compared to manual programming. In many larger manufacturing companies, the goal is to keep the CNC machine running for as much time as possible. This kind of company employs a staff of support people to keep the CNC machines running. Down time for any reason will be perceived as wasted time. One person may be setting up tools for the next job while the current job is running. Another person may make the workholding setup. Yet another writes and verifies the program. In this case, the operator may only be expected to load and unload workpieces. The support staff minimizes the setup-related work that must be done online, while the machine is sitting idle. As you can imagine, this kind of company does not want their programs developed on-line, while the machine is not producing. There are two other factors that contribute to whether a conversational control is a wise investment. The first has to do with operator incentive. The person running a conversational control must be highly motivated. This person has a great impact on the success of the company. With motivation, a conversational programmer can outperform a manual programmer by a dramatic margin. This is another reason why conversational controls are so popular among small companies like job shops. In small companies, the person programming conversationally usually has a high interest in the success of the company. Another factor that affects the wisdom of employing conversational controls is the number of different work-pieces that must be programmed. If only a limited number of different workpieces are required of the CNC machine, conversational programming may not be the best programming alternative.

CAM System Programming


CAM systems allow CNC programming to be accomplished at a much higher level than manual programming and are becoming very popular. Generally speaking, a CAM system helps the programmer in three major areas. It keeps the programmer from having to do math calculations, makes it easy to program different kinds of machines with the same basic language, and helps with certain basic machining practice functions. With a CAM system, the programmer will have a computer to help with the preparation of the CNC program. The computer will actually generate the Gcode level program much like a CNC program created by manual means. Once finished, the program will be transferred directly to the CNC machine tool. CAM systems fall into two basic categories, word address CAM systems and graphic CAM systems. Word address systems require that programs be written in a language similar to BASIC, C Language, or any other computer programming language. These CAM systems require that the program be written in much the same way as a manual program. While some of the most powerful CAM systems are word address systems, they also tend to be the more difficult to use. Graphic CAM systems are commonly programmed interactively. The programmer will have visual feedback during every step of the programming task. Generally speaking, this makes graphic CAM systems easier to work with than word address systems.

Steps To CAM System Programming


While CAM systems vary dramatically from one system to the next, there are three basic steps that remain remarkably similar among most of them. First, the programmer must give some general information. Second, workpiece geometry must be defined and trimmed to match the workpiece shape. Third, the machining operations must be defined.

General Information
Information required of the programmer in this step includes documentation information like part name, part number, date, and program file name. The programmer may also be required to set up the graphic display size for scaling purposes. The workpiece material and rough stock shape may also be

required.

Define And Trim Geometry


Using a series of geometry definition methods, the programmer will describe the shape of the workpiece. With graphic CAM systems, the programmer will generally be shown each geometric element as it is described. The programmer will have the ability to select from a series of definition methods, choosing the one that makes it the easiest to define the workpiece shape. Once geometry is defined, most CAM systems require that the geometry be trimmed to match the actual shape of the workpiece to be machined. Lines that run off the screen in both directions must be trimmed to form line segments. Circles must be trimmed to form radii.

Bypassing The Geometry Creation


Keep in mind that most CAM systems allow geometry defined within CAD (computer-aided design) systems to be imported to the CAM system. This is especially helpful with very complicated parts, keeping the CAM system programmer from having to duplicate the effort of creating geometry. However, there are four warnings we give to companies who anticipate the need to do this. First, the drawing created in the CAD system must be to scale. Design engineers are notorious for fudging dimensions on their drawings to make the print look nice. If they have a 0.005 inch step on the workpiece, they know the step of this size will not even show up on the drawing. In this case, they may draw the step as a 0.050 in step and dimension it as 0.005 in. If this is done, the drawing is not truly accurate, and the CAM system programmer will end up creating an incorrect program. Second, there will be only a portion of the CAD system drawing that will be of use to the CAM system programmer. If the entire drawing is imported to the CAM system, a great deal of time can be spent deleting geometry elements within the CAM system. While most CAD systems allow the user to easily specify the section of the drawing to be exported, doing so does take time. Third, the CAD system design engineer will give little consideration to the location of the CAM system pro-grammer's program zero point. The origin of the drawing may be the drawing's lower left hand corner. In this case, when the drawing is imported to the CAM system, it must be shifted accordingly. While most CAM systems allow this, this step does take time. Fourth, most CAM systems expect geometry to be in a certain format for machining. For example, turning center CAM systems will expect threads to be defined in a certain manner. It is quite unlikely that the CAD system drawing for threads will match what the CAM system expects the threads to look like. In similar fashion, turning center CAM systems usually expect only the top half of the workpiece to be described. Again, this does not match what the design engineer does with the CAD system. For these reasons, many CAM system users feel that it is sometimes easier to redefine the drawing within the CAM system (for simple workpieces) than it is to import drawings directly from the CAD systems. As workpieces get more complicated and more difficult to define (especially for 3D work) the ability to import geometry from the CAD system becomes more important.

Define The Machining Operations


In the third step to CAM system programming, the programmer tells the CAM system how the workpiece is to be machined. CAM systems vary dramatically with regard to how this step is handled. Many give a menu of machining operations to choose from and the programmer fills in the blanks as each operation is described. During this step, usually a tool path or animation will be shown, giving the programmer a very good idea of what will happen as the program is run at the machine tool. This ability to visualize a program before it gets to the machine tool is a major advantage of graphic CAM systems. At the completion of all operations, the programmer can command that the G-code level CNC program be created.

What About Program Storage And Retrieval?


Regardless of how a CNC program is prepared, companies who run any repeat jobs are highly concerned with storing and retrieving CNC programs. (Even if a CNC machine is dedicated to running only one job, it will be necessary to back up the program in case of machine problems.) Of course, once a program is verified (at the machine), the user will want to store the program in its corrected state for future use. This can be done with a variety of techniques. Program storage and retrieval devices used for this purpose include magnetic cassette tape recorders/players, paper tape reader/punches, portable floppy diskette drives, RAM (random access memory) devices, notebook and lap-top computers, and desktop computers. By far, personal computers (notebook, laptop, and desktop) are the most popular form of program transfer device. Let's briefly discuss how they can be used for program transmissions.

All current model CNC controls come with an RS-232-C communications (serial) port. All current model personal computers come with a serial communications port. By connecting a properly configured cable to the computer and CNC , the user can command that transmissions of CNC programs take place. Some form of communications software is required within the computer to allow transmissions. After invoking this software, the user can specify whether a CNC program is to be sent or received to or from the CNC. Note that most CAM systems come with this form of communications software to allow program transfer. Moreover, there are a number of vendors who specialize in these communications networksusually referred to as "DNC systems." Once transferred to the computer, the communications software will automatically store the program on the computer's hard drive (or floppy diskette). Once the program is transferred to the CNC, the program will be ready for activation within the control itself.

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
This perspective for a good programmer is a practical one, since the CNC operator must understand the machine's basic components, its directions of motion, and all buttons and switches available on the machine tool itself. Mike Lynch President, CNC Concepts, Inc.

Key CNC Concept #7Know The Machine From An Operator's Viewpoint

To this point, we have been discussing CNC from a programmer's viewpoint. We are now going to switch the emphasis to looking at CNC from an operator's viewpoint. Our first operation-related key concept parallels key concept number one, understanding the machine tool itself. However, a CNC operator must be much more intimate with the CNC machine tool than the CNC programmer. He or she must, of course, understand the machine's basic components, its directions of motion, and all buttons and switches available on the machine tool itself. Keep in mind that this presentation is intended to simply acquaint you with common machine functions. You must reference your machine tool builder's manual for more specific information related to the buttons and switches on your machine. Just what the operator of a CNC machine will be expected to do will vary from company to company. While there are exceptions to this general statement, larger manufacturing companies tend to segment the responsibilities related to their manufacturing. One person will set up tooling. Another will make the workholding setup on the CNC machine tool. Yet another will verify the program. Once the program is deemed correct and safe, it is turned over to the CNC operator who runs the workpieces to be produced. In this case, the opera-tor's responsibility may be limited to simply loading and checking workpieces and making the necessary offset changes to keep workpieces on size. Smaller companies cannot afford the luxury of having so many people involved with any one job and thus tend to expect more of each person. These companies may expect the operator of a CNC machine to do all functions related to the machining of a workpiece including writing the program, setting up the tooling, making the work-holding setup, verifying the program, and running the production. The more the operator is expected to do, the better their knowledge level should be. In any event, knowing more than may be required can never hurt. The more the operator knows, the better the CNC environment. The Two Most Basic Operation Panels Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Key Concept #10


Verifying CNC Programs Safely

The Two Most Basic Operation Panels


When the beginning operator views a CNC machining center control panel for the first time, it can be somewhat intimidating. There will appear to be so many buttons and switches to learn, the beginner can be tempted to give up before getting started.

Do not let the control panel intimidate you. As we go on, you will find that the CNC machine's buttons and switches are quite logical and aptly named. While it may take some memorizing, once you are exposed to a CNC machine on a regular basis, we think you will agree that operation is not difficult to master. There are two distinctly different operator panels for most CNC machine tools. The control panel is designed and built by the control manufacturer, and the machine panel is designed and built by the machine tool builder.

While there are some exceptions, the control panel is primarily used to manipulate data through the display screen and can be thought of as the keyboard of a personal computer. The machine panel is used to make physical adjustments as to how the machine tool behaves. The control panel can be used to enter programs into memory. While there are faster ways to do this through the communications port, many CNC users enter their programs in this manner. Once entered, the control panel can be used to edit or modify a program stored in the control's memory. The display screen will constantly show the program being entered or modified, much the same as the display screen of a personal computer when using a word processor. Tool offsets are also entered and modified by using the control panel. Once the operator selects the offset mode, the display screen will show the table of offsets, all of which can then be adjusted. Yet another use of the control panel is to access all functions of the display screen. Axis position, control diagnostics and parameters, and other data are manipulated in this manner. By comparison, buttons and switches on the machine panel are used to activate machine functions. For example, the machine panel is used to manually jog the axes of the machine. Some form of joystick or combination of push buttons can be used to make the desired axis motion. Almost all CNC machine tools even have a handwheel on the machine panel that can be used in much the same way as the handwheels on manually operated machine tools. For most machines, the machine panel can be used to manually turn the spindle on and off. Some machines even have a rheostat that allows the operator to manipulate the speed of the spindle. The machine panel also includes many conditional switches that control how the machine behaves during automatic operation. Features like single block, dry run, and optional stop are among those controlled by these conditional switches (more on these features a little later). Buttons And Switches Found On The Control Panel As mentioned, many of the same keys found on a typical personal computer are also found on the CNC machine's control panel. Following are the most important functions along with a brief description of their use.
G

Power Buttons. To avoid surges, most CNC machines have at least two different power buttons, one for power to the control and another for power to the machine tool itself. The control panel power button must be pressed first, and activates the control screen and control panel. Once the control is on, then the machine power can be turned on. Machine power is usually labelled as hydraulic on or machine ready. Display Screen Control Keys. You can think of these keys as like the channel selector on a television set. They allow the operator to select which function of the display screen he or she wants to view. Position Button. This selector button allows the operator to look at the machine's position display. In this mode, the display screen shows pertinent information about where the machine is currently positioned. Program Button. This display screen selector button allows the operator to monitor the active program in the control's memory. This key is pressed when editing CNC programs and when monitoring programs in automatic operation. Offset Button. This display screen selector button allows the user to display and manipulate the tool offsets. Along with the cursor control buttons, the operator can use this button to find and change offsets in memory. Letter Keys. This keypad allows alphabetical character entry. Some CNC control panels allow only those alpha keys (N, G, X, and so on) needed for CNC programming on the keyboard. On others, the full character set (A through Z) is available. Knowing a CNC's buttons and Number Keys. These keys allow numeric entry. Normally located close to the letter keypad, most CNC switches unlocks the mystery of controls have number keys positioned in much the same way as on the keypad of an electronic its operation. Photo courtesy of calculator. Cincinnati Milacron. The Input Key. This key is pressed to actually enter data. Examples of when this key is pressed include entering offsets and setting parameters. Cursor Control Keys. The display screen of the CNC control will often show a prompt cursor that indicates the current entry position. The prompt cursor usually appears as a blinking square or underlined character. It is at the current position of the cursor that data will be entered. Cursor control keys (usually in the form of arrows) allow the operator to position the cursor to the desired location on the display screen. Program Editing Keys. There are many times when a program stored in the control's memory must be altered. The most common example is during the verification of a new program. These keys allow program entry and modification. Reset Button. On most controls, this button usually serves three basic functions. First, while editing CNC programs, this key will return the cursor to the beginning of the program. Second, this key will clear the look-ahead buffer and stop execution of the program. This is required when it is determined that there is something wrong in the program and you wish to stop. However, it can be dangerous to press this key during a program's execution in other cases. If the program is executed immediately after the reset key is pressed, the control will have forgotten the commands in the look-ahead buffer. In effect, this will cause several commands to be skipped. The control will pick up and continue running, but severe problems could arise due to the missing commands. When in automatic operation, be careful with this key. Third, when in alarm state, this key will cancel the alarm once the problem has been solved.

Buttons And Switches Found On The Machine Panel


Now let's look at buttons and switches found on a the machine panel of a typical CNC machine. Mode Switch. The mode switch is the heart of any CNC machine tool. It should be the very first switch an operator checks prior to performing any function on the machine. In many cases, the mode switch must be positioned properly and according to the operation to be performed. If it is not, the control will not respond to the operator's command. You can think of the mode switch on a CNC machine as being like the function selector for a stereo sound system. Most stereo systems allow you to select from tuner, CD player, phonograph, and cassette tape player. Before you can activate any of the sound generating devices, the function selector must be positioned accordingly. In a similar way, the mode

switch of a CNC machine must be positioned correctly before any function can be activated. For example, if the operator wishes to make a manual movement by jogging the machine with a handwheel, the mode switch must be positioned in a manual mode. If the mode switch is not in the correct position, usually the worst that can happen is that the machine will not respond to the operator's command. H Edit Mode. The edit mode allows an operator to enter and modify CNC programs through the keyboard and display screen in much the same way a word processor is used on a personal computer. The edit mode is also used to scan within the active program to a position at which the cycle is to be started. For example, the operator may wish to skip to the beginning of the third tool and execute the program from that point. The edit mode is used to get there. H Memory or Auto. This is one the modes from which a program can be executed. The operator is allowed to begin the automatic cycle, executing the active program from within the control's memory. H Tape Mode. This mode is similar to Auto or Memory, except the program is executed from a tape on the tape reader, not from within the control's memory. It only applies, of course, to machines so equipped. H Manual Data Input Mode. This mode switch position allows the operator to enter program commands through the keyboard. Machine tool builders do their best to place sufficient buttons and switches on the machine to allow easy operation. However, given the almost limitless possibilities with a CNC machine, it is next to impossible to give a button or switch for every machine function. For this reason, control manufacturers provide a way for the operator to make CNC commands manually, in the Manual Data Input mode. H Manual or Jog Mode. In this mode, the CNC machine behaves like a man-ual machine tool. This mode activates many of the machine panel's buttons and switches related to machine functions. For example, almost all CNC machines incorporate a handwheel for manually moving each axis. Most CNC machines also have a jog function, allowing axis motion to be caused by a joystick or push button. Most have a button to turn the spindle on and off, as well as a rheostat to control spindle speed. All of these functions are activated manually, through the Manual or Jog mode. Cycle Button. This button is used to activate the program currently in the control memory, causing the machine to go into automatic cycle. Feed Hold. This button allows the operator to halt axis motion temporarily. The cycle start button can be used to reactivate the cycle. Note that all other functions of the machine (coolant, spindle, etc.) will continue to operate. Think of this button as your first panic button. If you are verifying a program, you should always have a finger on this button. If you suspect any mishap, press feed hold, then check for mistakes. If a problem is found, you will take the program out of cycle (by pressing the reset key), fix the problem, and start over. If a mistake is not found and you wish to continue, you can do so by pressing cycle start. G Feed Rate Override. This multiple position switch allows the operator to change the programmed feed rate during cutting commands (G01, G02, G03, etc.). Notice we said feed rate. Under normal conditions, this switch has no control over rapid motion. The feed rate override switch is usually segmented in 10 percent increments that range from 0 percent through 200 percent. This means the operator can slow down programmed feed rates to nothing, stopping motion in feed rate movements, and increase the feed rate to double the programmed value. G Rapid Traverse Override. This switch is used to slow the rapid motion rate. It can come in two different forms. In one form, it is a simple on/off switch. When on, all rapid motion is slowed to 25 percent of the normal rapid rate. In its second and more useful form, rapid override is a four position switch and can be adjusted to 5 percent, 25 percent, 50 percent, and 100 percent of the normal rapid rate. It makes sense to use rapid override during program verification to assure that rapid movements toward the workpiece are correct. G Emergency Stop. This button will turn power off to the machine tool. Usually, power to the control remains. G Conditional Switches. These on/off switches control how the machine behaves during automatic and manual operation. They can be toggle switches, locking push buttons, or even set through the display screen and keyboard. Though the location and style of these switches vary, their meaning and usage stays amazingly similar from one type of CNC machine to the next. These switches are very important. If one or another is improperly set, the machine may not perform as expected. The operator should get in the habit of checking each of these switches before the CNC program is executed.
G G G

Dry Run. This conditional switch is most used with the verification of new programs. When this switch is on, it gives the operator control of the motion rate at which the machine will traverse. This is extremely helpful during rapid motions. The rapid rate of current CNC machines is very fast, ranging from 100 inches per minute to 800 inches per minute or more. At these extremely fast rates, the operator will not be able to stop the machine in time in case of a mishap. Single Block. This conditional switch can be used to force the control to execute one command of the program at a time. When turned on, the control will stop at the completion of each command. To execute the next command, the operator must push the cycle start button. This switch is most helpful during program verification. With a new program, the operator will cautiously check each motion the machine makes, one at a time. Machine Lock. This conditional switch keeps all axes of the machine from moving. Many other functions of the machine will continue to operate. For example, the turret will still index, the spindle will still run, coolant will still come on, etc. But axis motion will not occur. Machine lock can be used during automatic operation and manual operation. If a motion of any kind is commanded, the position displays on the display screen will act as if the machine is moving, but in reality, no motion occurs. Optional Block Skip (Also Called Block Delete). This conditional switch works in conjunction with slash codes (/) in the program. If the control reads a slash code at the beginning of any CNC command in the program, it will look to the position of the optional block skip switch. If the switch is on, the control will ignore the command in which the slash code is included. If the optional block skip switch is off, the control will execute the command. Optional Stop. This conditional switch works in conjunction with an M01 code in the program. When the control reads an M01 and the optional stop switch is on, the control will halt the execution of the program. The operator must press the cycle start button to reactivate the program. If the optional stop switch is off, the control will ignore the M01 and continue executing the program.

Manual Controls
The machine panel for all CNC machining centers will also include several buttons and switches related to manual control of the machine tool's functions. These buttons and switches vary dramatically from one builder to the next. Common manual functions include spindle control, coolant control, manual tool change control, and control of axis movements.

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
This concept introduces the three basic modes of operation, presents examples of when they are used, explores more about the mode switch, and categorizes each position of the mode switch into one of the three basic modes. Mike Lynch President, CNC Concepts, Inc.

Key CNC Concept #8The Modes Of Machine Operation

During key concept number seven, we discussed the mode switch found on the machine panel. We said this switch was the heart of the CNC machine and that the operator must first look at this switch before any function can be performed. The most common mistake on the operator's part is having the mode switch in the wrong position. Also during key concept number seven, you found that the mode switch has several positions. However, during this key concept, you will find that there are really only three basic modes of operation. Here we will introduce the three modes and give examples of when they are used. We will also discuss more about the mode switch, categorizing each position of the mode switch into one of the three basic modes.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Manual Mode
In the manual mode, the CNC machine behaves like a standard or conventional machine. A CNC machining center behaves like a manual milling machine. A CNC turning center behaves like an engine lathe. The physical positions of the mode switch that are included as manual modes include manual or jog, handwheel, and reference return. With the manual mode, the operator of a CNC machine is allowed to press buttons, turn handwheels, and activate switches in order to attain the desired machine function. The activation of each button or switch in the manual mode has an immediate response. For example, if the correct mode switch position is selected and if the correct button is pressed, the spindle will start. If a switch is turned on, the coolant will come on. If a joystick is held in one direction or another, the corresponding machine axis will move. Note that those things that cannot be done in the manual mode must be done in the manual data input mode, the second mode of operation.

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Visit MMS' Machining Centers Zone

Manual Data Input Mode


This mode includes two positions on the mode switch, the edit position, and the manual data input (MDI) position. In each case, the operator will be entering data through the keyboard on the control panel and display screen. Though these mode switch positions have substantial differences, we consider them together for two reasons. First, both mode switch positions involve entering data through the keyboard.

Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

With the edit position of the mode switch, a program is entered or modified. With the MDI position of the mode switch CNC commands are entered and executed. Second, both provide manual capabilities that can also be done in a more automatic way. In edit mode, an operator can enter CNC programs into the control memory. This can also be accomplished by loading the program from some outside device, such as a computer or tape reader. In MDI mode, CNC commands are entered through the keyboard and display screen manually and can be executed once. If the command must be executed a second

time, the operator must enter the MDI command a second time. However, if the same command is included in a program, it can be executed automatically, over and over without having to be re-typed.

Manual Data Input


Almost anything that can be done within a CNC program can be done in the MDI mode. If an operator is proficient with CNC commands, many times they can perform functions more quickly with MDI than they can by other manual means. For example, the reference return position can be attained through manual means (the reference return mode of the mode switch) and through MDI commands. A good operator can perform this operation faster in the manual data input mode. But the most important reason for the MDI mode is to allow the operator to perform manual operations that are not possible by using the manual mode. For example, some machining centers have no manual buttons or switches to select the spindle speed, direction, and turn the spindle on and off. With this type of machine, if the operator needs to manually turn the spindle on for any reason, they must use MDI to do so. In the same way, some turning centers have no manual means with which to change tools and thus must use MDI commands. The manual data input mode switch position can even be used for machining a workpiece. Since almost all CNC commands are possible by MDI (including G00, G01, G02, and G03), the operator can make machining commands in a way similar to how they are commanded in a CNC program. However, the operator must be very careful when using MDI to machine work-pieces. The command will be executed as entered. If the operator makes a mistake in the MDI mode, disaster could result. There is no chance to verify a CNC command executed by MDI as can be done with a CNC program.

Edit Mode
If you have ever worked with a word processor, you will find the use of the edit mode of a CNC control familiar and easy to work with. In this mode, the operator is allowed to do two basic things. He can enter CNC programs into the control memory and modify current programs. Almost all CNC controls allow the operator to store multiple programs. Programs are typically organized by program number (commonly the O word). The operator will be allowed to call up the desired program from within the control's memory, making it the active program. All true CNC controls give the user the ability to do at least three basic things in the edit mode. The operator can insert new information into the program, alter the current information in the program, and delete information from the program. Some CNC controls also allow the operator to do global editing, meaning they can cut and paste, and find and replace data. Along with these basic features, the operator will be allowed to search or scan the program for key information. For example, the control can quickly search to the next occurrence of any programming word. If the programmer used sequence numbers (N words) the operator could use the sequence number of an incorrect command as the word used to search.

Program Operation Mode


The third mode of operation involves actually running programs. The two positions of the mode switch are memory (or auto) and tape. The operator uses this mode to verify programs and run production. The memory (or auto) mode is used to execute programs from the control's memory. As long as the control's memory is of sufficient size to hold the entire CNC program (as it almost always will be), the memory mode should be used to execute the program. While there could be several programs stored in the control's memory, only one is active. This is the program that will be run when the cycle start button is pressed. On most controls, the edit mode is used to choose the active program. With most CNC controls, while a program is being executed from memory, the programmer is allowed to see one full page of the program on the control's display screen. As the program is executed, the cursor will scroll through the program, letting the programmer see the commands that follow the command currently being executed.

Tape Mode
At one time, the tape mode was the only way to activate programs. But with the advent of the computer, the need for the tape mode switch has decreased. In fact, many CNC controls do not even come with the ability to run programs from the tape reader. While they may equip the control with a tape reader, its sole purpose is to load programs into the control's memory. For those CNC controls that still allow programs to be executed from the tape mode, there are only two occasions when this is helpful. Both involve programs that are too long to fit into the control's memory. First, a program can be run directly from the tape reader (if the control allows this function). However, the tape reader also has a limitation in the length of program it can run. For those extremely long programs, some CNC controls allow programs to be run from an outside device like a personal computer. With this technique,

the control is fooled into thinking it is running a program from the tape reader, but in reality it is running a program being transmitted through the control's communications port. To accomplish this, the mode switch position is set to the tape mode while the program is executed. But the control's parameters are set in a way that tell the control to run from the communications port. The main application for this technique is for three dimensional sculpturing CNC programs generated from a CAM system. With these programs, very tiny motions are generated to machine elaborate contoured shapes. Direct numerical control (DNC) is the term used to describe this technique of running programs from an external computer. Keep in mind that this is an extremely necessary feature for certain applications, like machining dies and molds. The tape position of the mode switch has two severe limitations. First, the operator will only be allowed to see one or two commands of the program at a time on the display screen. In memory mode, the operator will be allowed to monitor a whole page of the program. This is most helpful during the program's verification, when the operator wishes to check the commands coming up. The second limitation of the tape mode is that modification of the program is not possible from within the CNC control. This means the program must be perfect before it can be run. If changes must be made, they must be made away from the CNC control. When programs are stored in the control's memory, it is easy to make changes right at the control.

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article
This concept examines the sequences of operation of a CNC machine by way of reference material related to key operational procedures. Mike Lynch President, CNC Concepts, Inc.

Key CNC Concept #9The Key Sequences Of Operation

Experienced operators would agree that running any CNC machine tool is little more than following a series of basic procedures. From powering the machine up in the morning to turning it off at night, the operator will be following these sequences in a step-by-step manner. From the beginning operator's standpoint, half the battle of learning how to operate a CNC machine is simply knowing when each procedure is required. Then, it will be a simple matter to follow the basic sequence to attain the machine's desired function. For example, if an operator wishes to load a program into the control memory, there are a series of switches and buttons that must be activated in the proper order. If the operator wishes to change an offset, a specific procedure must be followed. While the actual buttons and switches will vary depending on the control model, once the operator has documented the most important sequences, it is relatively easy to make the machine function in the desired manner. Too many companies that utilize CNC expect their operators to memorize all key procedures needed to run the machine. We strongly recommend that the CNC user develop an operation handbook in order to help operators become comfortable with each CNC machine tool (one per machine). This will give the operator the step-by-step procedures needed for critical machine operations.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

The Most Important Sequences


Procedures like powering up, powering down, loading tools, setting offsets, and editing programs are among the things an operator will be doing on a regular basis and should strive to memorize. However, there are also procedures that are used less often that should also be documented. Again, the operations handbook should give the operator every procedure needed to run the machine. These procedures make it very easy to operate your CNC machine. They provide quick and easy reference material related to key operational procedures. While it would be nice if each CNC machine tool builder incorporated this kind of handbook for every machine they sell, few builders do. For most CNC machines, you will have to develop this information on your own. You can divide your procedures into logical categories. Here is a specific list of procedures we would recommend you develop for a typical CNC machining center. Very similar procedures would be required for any form of CNC machine tool. If the operator has this kind of information at his or her fingertips while learning to run a CNC machine tool, running the machine will be much easier!

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Key Concept #9
Key Sequences Of Operation

Visit MMS' Machining Centers Zone Visit MMS' CNC & DNC Zone Visit MMS' CAD/CAM Software Zone Link a Friend to This Page Via E-mail Print this article

Manual Sequences
G G G G G G

To To To To To To

start machine do a manual reference return manually start spindle manually jog axes use the handwheel to cause axis motion manually load tools into spindle

G G G G G G

To To To To To To

manually load tools into magazine manually turn on coolant make axis displays read zero or any number enter tool offsets (length and radius) manually turn on mirror image manually select inch or metric mode.

Manual Data Input Sequences


G G G G

To To To To

use use use use

MDI MDI MDI MDI

to to to to

change tools turn on spindle do a reference return move axes.

Program Loading And Saving Sequences


G G G G

To To To To

load programs into memory by tape load programs into memory by RS-232 port load programs into memory through keyboard punch programs from memory to tape punch or computer.

Program Display And Editing Sequences


G G G G G G G

To To To To To To To

display a directory of the programs in memory delete a whole program from memory search other programs in memory search to words inside a program alter words in memory delete words and commands in memory insert words and commands in memory.

Setup Sequences
G G

To measure program zero positions To measure tool length information.

Program Running Sequences


G G G

To verify programs To run verified programs in production To run from the beginning of any tool.

MMS MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

| Home | Article Archive | Latest Issue | Talk To Us | Previous Page (or Use Back Button) | | Online Tools & Calculators | Subscribe To MMS' OTW Infoletter |

Feature Article Key CNC Concept #10Verifying CNC Programs Safely


mistakes, the CNC control will rarely be able to tell if a mistake has been made. Mike Lynch President, CNC Concepts, Inc. For the most part, CNC controls will follow the instructions given in a program to the letter. With the exception of basic syntax (program formatting)

For the most part, CNC controls will follow the instructions given in a program to the letter. With the exception of basic syntax (program formatting) mistakes, the CNC control will rarely be able to tell if a mistake has been made. While verifying any new program, the operator must be ready for anything. If, for example, the programmer made a mistake which tells the control to drive a tool at rapid into the workpiece, the control will follow the commands causing what is commonly referred to as a crash. With a manually prepared program, just about anything could be wrong. The manual programmer might have meant to type X but instead typed Z. In this case, the resulting motion the machine makes will be totally unexpected. Literally every command in a manually prepared program may have a mistake and should be treated as suspect. If a computer-aided manufacturing (CAM) system was used to prepare the CNC program, the basic syntax of the program will usually be correct. The basic motion commands the control is given should also be correct. However, even CAM generated programs will not be perfect. While they tend to be more correct than manually generated programs, problems could still exist with feeds, speeds, workholding, depth of cut, and so on. Conversationally generated CNC programs should be treated with the same respect as CAM generated programs. Keep in mind that even perfect programs will behave poorly if mistakes are made during setup such as with tool length measurements or the program zero measurement. We cannot overstress the need for safe procedures when working with CNC equipment. While we are not trying to scare the beginner, we want to instill a high level of respect for this very powerful and potentially dangerous equipment.

CNC Intro
Back To The CNC Key Concepts Introduction Page

Key Concept #1
The Fundamentals Of CNC

Key Concept #2
Know Your Machine

Key Concept #3
CNC Motion Types

Key Concept #4
Forms Of Compensation

Key Concept #5
Program Formatting

Key Concept #6
Methods For CNC Programming

Key Concept #7
Know The Machine

Key Concept #8
Modes Of Machine Operation

Safety Priorities
There are three levels of priority that you should always adhere to when working with any machine tool.

Key Concept #9
Key Sequences Of Operation

Visit MMS' Machining Centers Zone


G

Operator Safety. Every step should be taken to ensure the safety of the person operating the CNC machine. As we give the actual procedures to verifying CNC Visit MMS' CNC & DNC Zone programs a little later, you will see that each procedure stresses operator safety. As the beginner gains experience, the tendency will be to short cut these procedures in Visit MMS' CAD/CAM Software Zone order to save some time. But if the recommended verification procedures are not followed, the operator is opening the door to a very dangerous situation. Link a Friend to This Page Via E-mail Machine Tool Safety. The second level of safety priority is the CNC machining center itself. Each operator must do his best to ensure that no damage to the machine can occur. CNC machine operation time is very expensive. When a CNC machine goes Print this article down for any reason, the actual cost of repairing the machine is usually very little compared to the lost production time. There is no excuse for a crash on the CNC machine due to operator or programmer mistakes. If the verification procedures we give are followed, you'll run much less risk of placing the machine in dangerous situations. Workpiece Safety. The third priority to CNC machine safety is making all workpieces to size. The cost of rough stock to be machined varies dramatically based on the user's application. In some cases, for very small parts being machined from completely rough stock, the cost of the material coming to the CNC machine may be as little as ten cents per part. In this case, the company may be willing to sacrifice several workpieces in order to verify the program. However, there are also times when the cost of the rough material coming to the CNC machine is very high. Possibly the material itself is very expensive, and/or previous operations might have been performed on the workpiece prior to the CNC machine operation. The user may have several hundred dollars (or more) invested in each workpiece prior to the CNC machine operation. In this case, the company cannot afford to lose even one workpiece during the program's verification. It is never necessary to scrap the first

workpiece on any CNC machine. If the verification procedures we give are followed, the workpiece will come out with excess stock after each cut. Following the given techniques will allow the operator to sneak up on all critical dimensions being machined.

Typical Mistakes
Before discussing the actual techniques to verify programs, let's first examine the kinds of mistakes the programmer tends to make that will cause a program to fail. Knowing these common mistakes will help you diagnose problems as they occur. Syntax Mistakes. A control will not even be able to execute the command with a syntax mistake. For example, the programmer may have meant to type a G code as G01, but by mistake typed G101. Most CNC controls do not even have a G101 command. With this kind of mistake, the control will go into alarm state the moment the erroneous command is read. If the machine is moving through its motions, the motions will stop and the program will halt. The display screen generally will show a message related to the cause of the problem. Syntax mistakes are usually silly mistakes the manual programmer makes while writing or typing the program. They are easy to diagnose because it is likely that as soon as the programmer sees the command generating the alarm, the mistake will be very obvious. Motion Mistakes. This kind of mistake can be a little more difficult to diagnose. While motion mistakes may still be silly mistakes on the programmer's part (transposing numbers or axis letter addresses for example), generally they are caused by incorrect coordinate calculations. For example, maybe the programmer misinterpreted the dimensions on a drawing and came up with incorrect coordinate values for the tool to move through. In this case, the control would follow the program's instructions without generating an alarm. But the tool path would not be correct. Other mistakes in this category include forgetting to instate or cancel tool offsets, reversing clockwise and counter clockwise commands, and improper mode selection for incremental versus absolute. This kind of mistake can be very serious if not found prior to machining. In many cases, it means the program is telling the control to, at best, not machine properly, or at worst, crash the tool into the workpiece, workholding device, or machine. Set-up Mistakes. Even a perfectly written CNC program will behave poorly if mistakes are made during setup. In most cases, the operator will have some measurements to make related to the setup and numbers to enter into the control before the program can be executed. For example, almost all CNC machining centers require that program zero be measured at the machine. Once this measurement is made, either the program must be modified, or the program zero values must be entered into fixture offsets (depending on how program zero is assigned). If these numbers are incorrectly measured or if mistakes are made during their entry, the control will not truly know where the program zero point is. All motions the program commands will be incorrect. In similar manner, tool lengths and diameters (for milling cutters) must be measured and entered correctly. If mistakes are made in this regard, the control will not truly know the length or diameter (radius) of each tool. Mistakes Of Omission. Most beginning manual programmers have the tendency to leave things out of the program. They forget to program a decimal point or they forget to turn on the coolant. They forget to program the feed rate. And so on. Knowing that you are prone to these mistakes of omission should help as you begin verifying programs.

Procedures For Program Verification


Now that you have an idea of the kinds of things to watch out for, let's discuss the actual procedures to verify programs. One technique you will want to get in the habit of using has to do with the feed hold button. Every time you press the cycle start button to activate the program, always have a finger resting on the feed hold button. If an unexpected rapid motion takes place, you will not have to go looking for the feed hold button. Your finger will be ready to press it. No matter what you are doing, until you have the program verified, use this technique. We guarantee it will save a crash some day!

The machine lock dry run


All CNC machines that have a conditional switch labeled machine lock allow this procedure. It allows the control to scan the program for syntax mistakes. Once the setup is made and all information related to the program is entered into the control (tool offsets, program zero, etc.), the operator will turn on the machine lock and dry run switches and will also turn up the dry run motion switch (usually feed rate override or jog feed rate) to its highest position to allow the control to move quickly through the program. When the cycle is activated, the control will quickly scan the program for syntax mistakes. During the program's execution, the spindle will come on, the turret will index, and the control will appear to be actually running the program. However, the axes (X, Y, and Z) will not move. This procedure allows the operator a relaxed way of ensuring the control can execute the program. Once the operator has confirmed that no axis motion is occurring (machine lock is truly on), they can rest easy until one of two things happens. Either the control will generate an alarm or it will complete the program without generating an alarm. If the control finds a syntax mistake in the program and generates an alarm, the operator must diagnose the alarm, fix the problem and execute the program again. This must be repeated (with machine lock on) until the entire program can be executed without generating alarms. When the control completes the execution of the entire program without generating an alarm, the operator will know that the control can accept the program. While there still may be serious motion mistakes within the program, at least the program can be executed from beginning to end without generating an alarm. If a CAM system is used to prepare the CNC program, this procedure should not be required since there should be no syntax mistakes in the CNC program.

Free Flowing Dry Run


Once the machine lock dry run procedure has been successfully completed, the operator is ready to allow the program to cause axis motion. However, there could still be very serious mistakes in the program. In fact, the main reason for doing a free flowing dry run is to check for motion problems. The

operator must be very careful indeed. At this time, the workholding setup has been made, but no workpiece is in position. To execute this procedure, the operator will turn off the machine lock switch, turn down the dry run motion rate switch (typically jog feed rate) to its lowest position, and set the rapid override switch to its slowest motion rate. When the cycle is activated, the operator must have a finger ready to press the feed hold button. With the jog feed rate switch set to its lowest position, the axes will barely creep along. As the operator increases the setting on this switch, the axes will move faster. The operator will increase the motion rate to a comfortable setting. As each tool comes close to the workpiece or workholding device, the dry run motion rate can be turned down. If the operator is worried and wants to check something, the feed hold button can be pressed to temporarily stop the cycle. After pausing, pressing the cycle start button gets the machine moving again. If the operator wishes to cancel the cycle due to a motion mistake in the program, after pressing feed hold, the reset key can be pressed, the machine can be sent back to its reference point, and the problem can be corrected. Aside from severe problems, the operator must also check for less serious problems. For example, the operator must check that the spindle is rotating in the correct direction for each tool and that basic motions the program generates appear to be correct. In many cases, the operator will not be quite sure the program is correct after doing only one free flowing dry run. The first time the program is executed in this way, the operator may be so concerned with serious mistakes that could cause damage to the machine, they pay little attention to the details of each movement. For this reason, many times the free flowing dry run must be repeated several times until the operator is satisfied that the motions are correct. It is possible that the free flowing dry run will cause the machine to go into alarm state even though a machine lock dry run has been completed. Axis overtravels and problems related to offsets and other forms of compensation are among the things that can generate alarms in such a case.

Normal Air Cutting Cycle Execution


Before actually trying to run the first workpiece, there is one more important procedure to follow. The operator must execute the cycle one more time with the dry run switch turned off (and no part in position). This will allow the operator to see one thing that could not be seen during a free flowing dry run. The free flowing dry run allowed the operator to take control of all motion rates with the dry run motion rate switch. This means when dry run is turned on, the operator will not be able to tell the difference between rapid motions and cutting motions. They all appear the same. Here is an example of a problem the normal air cutting cycle will allow the operator to correct. Suppose the programmer rapids a drill up to the workpiece to drill a hole. But in the command to drill the hole, the programmer leaves out the G01 word by mistake. Since the machine is currently in the rapid mode, the hole would be drilled at rapid, breaking the drill and possibly injuring the operator. For this reason, we recommend running the program one more time as if a part were being machined, but without a part in position. This way the operator can confirm that the machine is rapiding where it is supposed to and machining where it is supposed to. For extremely long cycles, the operator can toggle the dry run switch on and off. Once the operator is sure the current command is a cutting command, he can temporarily turn on the dry run switch to allow the balance of the command to be completed quickly. Then, dry run can be turned off again. Repeating this technique allows the operator to go through a lengthy program quickly, yet assure the cutting commands are where they are supposed to be.

Running the first workpiece


At long last, the operator is finally ready to run the first workpiece. Yet each tool in the program includes at least one movement that poses a potentially dangerous situation. Most programmers rapid each tool within 0.100 inch of the workpiece surface before machining. This very small distance is impossible to check during the previous verification procedures. For this reason, the operator must be very careful with each tool's first approach to the workpiece. Also, if the tool rapids several times to different surfaces, the operator must be cautious with these motions as well. For this reason, we recommend turning on dry run and single block during each tool's approach to the workpiece and during rapid motions to new machining surfaces. With dry run and single block on, the operator will have control of the motion rate during each tool's approach. As the tool gets close to the surface to be machined, the rate can be turned down to a very slow rate. And, since single block is on, the operator can rest assured the motion will stop at the end of the command. When the motion stops, the operator can check the clearance approach amount (usually 0.100 inch). If everything appears to be correct, the operator can turn off the dry run switch (never machine with dry run on!) and leave single block on. At the end of each command, the motion will stop and the operator will press the cycle start button to continue to the next command. When the coming command is a rapid move to another clearance position, the operator can turn on dry run to take control of the motion rate again. This procedure is repeated for every tool in the program. On most controls, there is a position display that will help during each tool's first approach movement. It is commonly called the distance to go page. This page will show how much further a motion is going to be. For example, say the tool is currently approaching the workpiece. Motion is slowed by dry run and the operator has single block turned on to ensure that the machine will stop before cutting. As the tool comes within about 0.500 inch or so,

the operator gets worried. He or she is concerned that the tool may not stop before it hits the workpiece, so feed hold is pressed to stop motion. At this point, the operator can check the distance to go. This distance can be compared to the tool's actual position relative to the workpiece.

Making good parts


The above discussions had operator safety as the primary concern. Yet the operator must also make good parts. While machining the very first workpiece, there are things the operator can do to ensure the first workpiece will come out to size. If the operator considers what each tool is going to be doing during its machining operation, the tool offsets can be adjusted in a way that forces the tool to leave excess stock on the surface being machined. After machining with the trial offset, the machined surface can be measured and the operator will know exactly how much stock is yet to be machined. The offset can be adjusted accordingly, and the tool can be rerun. This time the tool will machine precisely to size. This sequence can be repeated for each tool in the program to assure that the first part will come out to print dimensions. Here's the procedure again in list form: 1. 2. 3. 4. 5. 6. 7. Consider what the tool will be machining Adjust the tool offsets for the tool in the direction of leaving excess stock Allow the tool to completely machine the workpiece Measure what the tool has done Adjust the offsets to machine to size Rerun the tool Measure to confirm that the new offset values are correct.

Running Production And Optimizing


Once the first part has been successfully completed, the operator is ready to run the production quantity of work-pieces. It may be wise to keep the machine from rapiding for the first few workpieces with rapid override until the operator is comfortable with the cycle. If many workpieces must be run, it is worthwhile to monitor the first few parts being run. Many times the operator will find areas of the program that can be improved to minimize cycle time. Also, cutting conditions (feeds and speeds) can be adjusted to improve cycle time or lengthen tool life. However, if major changes are made in the program during optimizing, we recommend verifying the program again.

Conclusion
While the verification procedures we have given may seem like a great deal of work, we urge the beginner to use them. While it does take time it can easily be justified when compared to the possible consequences. Without verification procedures, CNC machining centers are very dangerous to operate. Even if no operator injury occurs during a crash, the time and expense during machine repair easily justifies being cautious while new programs are checked out. It is common that a beginning operator is very cautious with the unfamiliar CNC machine. But after gaining experience, the operator becomes a little over confident. Then the operator starts short cutting the verification procedures. This is where problems begin. We liken this to a person learning how to snow ski. At first, the beginning skier is very concerned about hurting himself. No tricks or hot dogging are attempted. But after gaining confidence, the skier may attempt to do more than they are capable of. This is how legs get broken. The same can be said for the beginning CNC operator. As you gain confidence, you may be tempted to forego a procedure you would have done as a beginner. Watch out!

MMS Online is a trademark of Gardner Publications, Inc, copyright 1997-2006. MMS Online and all contents are properties of Gardner Publications, Inc. All Rights Reserved.

S-ar putea să vă placă și