Hotline: +84 (0) 8686 21 553  


CNC verifying a program manually

For reference, it is apparent from the last illustration that when viewing a vertical CNC machining center, that motion directions can be easily determined: 

Motion to the left: X-positive I Motion to the right: X-negative | Motion away: 


| Motion towards: 


Motion up: 


| Motion down: 


Manual Verification 

Verifying a program manually means to physically read the program and interpret it. Every operator ap- proaches this task in a unique way, but there are many common methods. 

Common methods are too numerous to list, but a short list may provide some ideas what to look for: 

Syntax accuracy 

• Program consistency I Tool usage 

I Clearances 

Spindle speeds Cutting feedrates 

Depth of cut I Width of cut 

Optional stops Program and setup relationship … and many others 


Production machining is the ultimate objective of all CNC work – it is its final phase. After the part had been machined, additional activities may take place, such as inspection, but the CNC work itself is completed. 

Production machining starts when all setup, testing and proving had been done. What are the duties and re sponsibilities of the CNC operator? That largely de pends on the type of work assignment. Some operators are not required to do anything else but to load the part, push the Cycle Start button, and unload the part when the cycle is completed. This type of work requires the least amount of skill. Operators on this level are common in production of large volume of a single part, where liter ally thousands and thousands of parts in the same batch have to be machined. In such environment, if the opera tor requires assistance, there is usually a much more qualified person available, who is generally responsible for overall setup, offsets adjustment, and troubleshoot ing. Such person is typically responsible for several CNC machines and belongs to the setup and support group. 

Memory Mode 

The internal method of program processing is the most common. Memory mode means that the whole pro gram is entered into the control system memory and pro cessed from there. All changed to the program (if necessary) are done in the memory, using the Edit mode. 

To load a program to the memory can be done by typ ing the program manually, which is the least efficient method. Normally, the program is loaded from an exter nal computer (a desktop or a notebook), via a special ca ble, through the communication ports. 

While it makes no difference of how the program is entered and stored in the internal memory of the control system, what matters is that the program uses the inter nal storage, rather than an external storage. 

Keep in mind, that positive/negative direction relates to the tool motion, not the machine table motion. 

Some operators may ask somebody else to look at the program, with the possible outcome that another person may see what the operator may miss. 

If the control system has a graphic option, the toolpath can be shown on the control screen. However, this is not a common option and relating on the manual program verification itself is the only way. 

Programs Generated by Software 

You may also encounter a decimal point error in part programs generated by computer software. These errors usually indicate a poorly configured post processor. The purpose of a post processor is to output program in the format compatible with a particular CNC machine. For example, the post processor may output a quarter second well in G82 fixed cycle as PO.25 or P. 25. As most Fanuc controls do not accept this input with decimal point, the post processor has to be updated. 

It is not uncommon to correct part program generated by computer software at the control. For example, if the programmer forgot to turn on the coolant, there will be no M08 in the program. It is simple to add it to the pro gram in Edit mode, but this should be done as a tempo- rary measure only. Keep in mind that the source of the omission is still erroneous and must be changed. 

DNC Mode 

DNC method is the external method of program pro cessing. The common abbreviation DNC may mean ei ther Direct Numerical Control or Distributed Numerical Control. Both really mean the same thing, but the direct type is often used for connection of a computer with a single CNC machine, while the distributed type is used for connection with several CNC machines. In both cases, a suitable software and setup must be done at both ends – at the computer (PC) and the control (CNC). Apart from the external computer, a suitable cable is re quired between the PC and CNC. 

In DNC mode, the program is stored on the PC and sent to the control system in chunks of data at a time. When the data is processed, it is flushed from memory and a new chunk of data is sent over. This is a continuous activity and there is no delay in program execution. Any changes to the program must be made at the PC side, not the CNC side of the operation. 


In smaller shop or for production with low batches, the CNC operator is often responsible not only for the setup but also for the machine activity during produc tion. Generally, the responsibilities of the operator are: 

Loading and unloading parts 

Loading and unloading programs 

• Monitoring each part run 

• Performing periodical part inspection 

Checking tools for wear and other flaws 

Replacing insert or tool when necessary 

• Adjusting offsets for optimum part dimensions 

• Deburring sharp edges if necessary 

Interaction with the programmer … and many others 

Software Verification 

The current software market offers quite a selection of programs that do a visual verification of CNC programs. They vary from almost free to very expensive. Unfortu nately, the software cost does not always reflect the qual ity and power of the software itself. It is quite common to find an expensive verification software that uses solid model type of display, yet it fails to support many pro gramming features. While solid type display is very at tractive in many ways, it also requires data related to the stock and tools. Software that is based on a wireframe display is very fast, does not need any special defini tions, and in the majority of cases, it does the job very well. In all cases, the software includes an text editor geared to CNC work that can be used to write and/or edit part programs. One powerful and reasonably priced soft ware is NCPlot® ( Most software ven dors offer a time limited evaluation version. 

Part Setup and Tooling 

Part setup is a multi-level process. It covers setup of work holding device on the machine table (milling) or preparing the chuck and jaws (turning). It also covers a great amount of various tasks and procedures, such as tooling, offsets, drawing and program evaluation, etc. This handbook was developed for the purpose of provid ing details about control setup as it relates to a part to be machined. Check various chapters for more details. 

A number of additional duties and responsibilities could be added to the list, depending on company re quirements. One such responsibility that should defi nitely be on the list is ‘thinking of improvements’. An experienced CNC operator is at the end of all work done ahead of machining, such fixture design, tool selection, programming, etc. In this position of direct contact with the actual machining, thinking of improvements at all levels will make the same part or similar parts more ef ficient next time. 


In the majority of cases, a part program is developed away off the CNC machine (often called off-line). In or- der to machine the part, the control system has to be able to process it. There are two common methods of pro- cessing the part program – internal and external. 


CNC programmers make an honest effort to develop their programs error-free. They have several ways to check the program before it reaches the machine shop. If the part program had been developed by a computer software, the verification is different than if the same program was developed manually. Programming soft ware of this kind provides quite accurate visual verifica tion in several forms, as a graphic toolpath displayed on the computer screen. Visually verifying a part program developed manually is much more difficult to do. 

The main purpose of program verification is to detect program errors before they affect the part 

CNC Control Setup for Milling and Turning 



CNC Control Setup for Milling and Tuming MACHINING A PART 

• Providing a trial cut (test cut), using block skip function 

or some other method – see Chapter 21 Including Program Stop function MOO 

or Optional Program Stop function M01 in the program 

· Including messages or comments in the program 

Making a setup sheet with a sketch Splitting a tool motion for single block operation Programming sufficient clearances 

Conversational programming is an attractive method of program generation. The current leader in this field is the Yamazaki Corporation and their Mazak® machine tools and controls. Many other control manufacturers (Fanuc included) also offer conversational program ming. 

What exactly is conversational programming? 

Conversational part programming is based on the real time interaction of a CNC operator with the control sys tem, done right at the CNC machine. 

This reality alone should be enough to dispel the myth that manual programming is obsolete. In the area of con versational programming, Mazak has taken the lead early and has been the leader for many years. Fanuc also had an early conversational programming system called FAPT, but it never caught on as a stand alone system. Other controls, Fanuc included, do offer very high qual ity conversational programming on several models. 

These are just some methods that can be used by the program to make the operator’s work easier. 

CNC operators at the machine also have a number of ways to prevent a scrap from any cause – which really means to identify a potential problem before it becomes a real problem. The first method is to truly understand the program – to be able to interpret it and know what it does. Mistakes made during tool or fixture setup are also a common cause of scrap. Errors also happen during data entry into the control system. Placing the right settings into a wrong offset register is quite a common cause, as are errors of decimal point entry, in the form of a missing decimal point or a decimal point in the wrong place. 

Even after a few parts have been machined success fully, scrap can happen for any number of reasons. Typ ical errors happen when changing offsets, cutting tools or inserts, modifying program, etc. 


Part inspection after the whole batch had been com pleted is not a constructive approach. As precise as CNC work can be, there are factors that have to be considered – factors that directly influence the part quality. These factors include dimensional accuracy, surface finish quality, overall appearance, ease of handling, etc. In specting the part during machining is important, as any changes required can be done immediately. There are methods of preventing a scrap (see page 109) that should be applied for any job. 

Part inspection at the machine generally requires only a minimum number of inspection tools – typically a ver nier (caliper) for general dimensions and micrometer for precise dimensions. Other measuring instruments in clude a height gage, thread gauges, plug gauges, and a variety of special instruments. 

Some CNC machines are equipped with a feature called ‘in-process gaging’, which includes a built-in electronic probe and a special macro program designed to inspect a part automatically while it is still part of the overall setup. Macros programs can also be used to ad- just offsets automatically as well. 

What is a difference between machining a part gener ated by a traditional manual method of programming and a part generated by computer software? 

Some CNC programmers and operators falsely as sume that a CAM generated program is always perfect or at least always correct. After all, we all know that computers don’t make mistakes, right? Well, this as sumption is far from the truth. Hardware problems aside, computers are reliable and always give back what the user asked for. Of course, if the initial input is wrong, the final output – the result – will be wrong as well. There is an old computer acronym relating to such situations – it is called GIGO – “Garbage In, Garbage Out’. 

It is true that errors are more frequent in manual pro gramming, but there are plenty of possibilities of making an error when working with a software based program ming system. On a small scale, it could be nothing more than a forgotten coolant function (M08 missing) – you don’t ask for it during program development, you don’t get in the final program output. Errors can also be of more serious nature – for example, inputting a wrong di mension may be overlooked on a busy computer screen, but the program output will include it nevertheless. 

Some errors in a software generated program can be attributed to a flaw in the post-processor. Post processor is an integral part of the CAM software and has one pur pose – to format generic toolpath instructions to match the requirements of a particular CNC machine. If you find that you frequently make the same changes in a soft ware generated part program, chances are great that the culprit is the post processor itself (although it could also be an input error). Post processors of today are very so phisticated, and there is no reason to make any subse quent changes to the program after it has been processed by the computer software. Of course, common changes such as speeds and feeds can still be changed, if re quired, depending on the actual machining conditions. 


Without a doubt, the major goal of a CNC operator should always be to make any part to drawing specifica tions in all respects. At the same time, the operator should also make an effort to prevent making a scrap. It is not uncommon to scrap a few small pieces made of a long bar, before making the ‘perfect piece, for example. This leisurely approach often leads to a certain level of complacency, and may prove costly when the number of parts is limited, for example, when a customer provided the exact number of stock material. 

Let Offsets Work for You 

A verified program is no reason to decrease your at tention at the machine. When working with offsets, there are ways to let them work for you, First, look at the fol lowing table – it shows how a measured part dimension influences the whole part. The table is best to be used for external or internal contours: 


Part programs can be developed by using different methods – manual method and software based method have been already mentioned. Although the final pro gram should do the required job well regardless of how it was developed, for the CNC operator the actual method of development may mean focus on different features of the program. The two methods already cov- ered can be supplemented by two additional methods – here is a list covering all four methods: 

Manual programming – Standard Manual programming – Custom macros 

Computer generated programs . Conversational programming 

Causes of Scrap 

There are only a few reasons for scrap to happen in the first place. On the human side, it is either negligence or it is incompetence. On the machine site, it is a hardware or software failure, Needless to say, the human errors are in great majority as causes for scrapped part, 


at machine 








Treat each part program equally, regardless of how it was developed 







Steps to Eliminate Scrap 

There are several methods how CNC programmers and operators can prevent a scrap. Some have to be in cluded in the program, others can be done at the machine directly. Programmers often include extra features in their programs that help to eliminate scrap. Typical methods include: 

Considering what measurement constitutes which re sult, the operator can take precautions by intentionally manipulating cutter radius offset (G41 or G42). Take the following simplified program as an example – it does nothing more than uses a contour toolpath to machine a small simple rectangle 75 x 50 mm. Concentrate on the concept rather than the part itself: 

CAM Programs and Machining 

Although the manual method of CNC programming is still very common in many machine shops, using dedi- cated CAM programming software, such as Master- cam®, Edgecam®, and many others, has grown at a rapid rate. Software of this kind is usually sold in a mod- ular form, meaning that you only purchase the module you need for the work you do. 

Conversational and Macro Programming 

Both conversational and macro programming are out side the scope of this handbook. Conversational pro gramming is performed at the machine and any training program reflects that. Macros are basically manual pro grams with many powerful features. For learning and understanding, check Fanuc CNC Custom Macros book for details. It is published by Industrial Press, Inc. ( 

CNC Control Setup for Milling and Tuming MACHINING A PART 

N1 G21 N2 G17 G40 G80 T01 (10 MM END MILL) N3 MO6 N4 G90 G54 GOO X-7.0 7-7.0 51000 M03 N5 G43 22.0 H01 M08 N6 G01 Z-5.0 F500.0 N7 641 X D51 N8 Y50.0 F150,0 NO X75.0 

N10 YO 

N11 X-7,0 N12 G40 GOO Y-7.0 M09 N13 G28 Z2.0 M05 N14 M30 

Keep in mind that the 200 microns is distributed over the contour width, so it is only 100 microns per side! That means changing the offset to 5.100, NOT to 5.200! It would not be a disaster if you make this mistake, but the main purpose of the process would be lost. The result is that upon completion of Item 3, the D51 setting will contain temporary 5.100 mm offset. 

Now, to Item 4. When the cutting is completed, mea sure the 75 mm width. One of three possibilities will be the result: 


Width will be exactly 75.2 mm I OVER SIZE Width will be greater than 75.2 mm 

UNDER SIZE Width will be smaller than 75.2 mm 

The tolerance on the 75 mm width of the part is quite tight, 30 microns plus, nothing minus. Even if you use a brand new cutter, there is a good chance that the width will be right at zero or slightly under. Of course, the width may also end up slightly larger, too. Rather than taking a chance, a simple procedure may be helpful in all situations that require change of offset setting: 1 Identify the normal offset value for D51 2 Estimate the amount of possible error 3 Temporarily increase the offset 4 Cut, measure and adjust offset 

Now for the details. For Item 1, the answer is 5.000 mm. The end mill has a diameter of 10 mm, so the ‘nor mal’ setting of offset 51 will be 5.000. Item 2 may need a special attention – you don’t want to either overestimate or underestimate. Quality of the tool is important. For a new cutter the error should be extremely small – let’s as sume no more than 10-15 microns. Take this possible de viation into account for Item 3 – you want to change the offset, so the part will be wider than 15 microns. If stock to be removed allows, you may decide that you want to leave 200 microns on the width. 

Even if the width is smaller than 75.2 (under size), it still should be greater than the 75.03 maximum size. Ifit is not, you made a mistake in Item 2 – estimating the amount of error. Let’s look at the three possible out comes and the offset adjustments, but first you have to decide what the final width should be – for the example, let’s aim for the middle of the tolerance, which means 75.015 width. 

Measured sizes are examples only: 

• ON SIZE result = 75.200: 

(75.015 – 75.200)/2 = -0.0925 Use 0.093 to match three decimal places. We have to subtract 0.093 from the current setting of the offset 51: 

5.100 -0.093 = 5.007 is the final setting 

. OVER SIZE result = 75.243: – (75.015 – 75.243)/2 = -0.114 

5.100 -0.114 = 4.986 is the final setting 

Offset Adjustment – Example 

UNDER SIZE result = 75.185: (75.015 – 75.185)/2 = -0.085 5.100 -0.085 = 5.015 is the final setting 

What will the temporary offset setting be? Correct answer to this important question is the real key to understanding the concept of offsets. 

From the earlier chart it is clear that a measured exter- nal width that is greater than the drawing width can be cut again to final size. That means adding a stock to the toolpath. Adding a stock means increasing the offset from 5.000 to – to what? You want to end up with a width that is 200 microns larger – 5.200 mm. 


One clear lesson can be learned from these examples – the process of establishing the final offset amount is the same, regardless of the actual size of the test measure ment. To learn these methods requires practice – paper instructions may give you the necessary start, but actual doing makes a big difference. Try to learn on a scrap piece of material first. 

The ultimate objective of CNC machining should be to eliminate scrap, not to minimize it