CNC | Program Planning

Each part program need some preparation to produce high quality parts. In this article, we describe all steps of task list before start programming.

0
486

Development of any CNC program should always begin with a very carefully planned process. Such process typically starts with an engineering drawing (also called a blueprint or a technical print) of the required part, released for production. Before any machining process can be completed, several steps have to be considered and carefully evaluated. Placing a greater effort into program planning will yield better program and better machined part.

Steps in Program Planning

Individual steps required in program planning are generally determined by the nature of part to be machined. There is no magic overall formula available for all jobs, but some basic steps are quite common and should always be considered carefully:

  • Initial information provided / Machine tools features
  • Part complexity / Evaluation of machining features
  • Manual programming / Computerized programming
  • Typical programming procedure / Program structure
  • Part drawing / Engineering data
  • Methods sheet / Material specifications
  • Machining sequence – Operations / Tool order
  • Tooling selection / Cutting Holders / Inserts / HSS Tools
  • Part setup / Part holding / Fixtures
  • Technological decisions / Cutting conditions
  • Work sketch and individual calculations
  • Quality considerations in CNC programming

All steps in the list are suggestions only – they are guidelines. Individual steps should always be flexible, so they can be adapted for any job and its unique requirements.

Initial Information

The main purpose of most engineering drawings is to define the part shape, individual dimensions, and relationships between part features. Some drawings may also include data about the initial blank material (stock), such as type, size, and shape. In CNC programming, good familiarity with various materials is important. For programming purposes, materials used to machine a part are evaluated by their size, type, shape, condition, hardness, etc.
Part drawing and material data are the primary sources of information about a specific part to be machined. They define the starting point of program planning. The objective of such a plan is to collect all available data and use all initial information for one purpose – to establish grounds for the most efficient method of machining, along with all related considerations – mainly part accuracy, productivity, safety and convenience.
Drawing and material data provide much of initial information, but they are not the only source. A great part of what is needed to develop a part program is not found in the drawing directly, but in other documentation. For example, a process sheet (routing sheet) provides many engineering requirements not covered in the drawing, such as pre- and post- machining operations, grinding allowances, assembly features, requirements for hardening, next machine setup, and many others. Collecting relevant information from all available sources provides enough groundwork to start planning a CNC program development.

CNC Machine Features

No amount of initial information is much useful if the selected CNC machine is not suitable for a particular job. During program planning, CNC programmer concentrates on a particular machine tool with a particular CNC system. These two major parts of a CNC machine are always connected and they must always be considered in any single CNC machine definition. It is just not enough to select a special fixture or a special setup – the CNC machine itself has to be suitable to handle any required setup.
Modern technology offers a large number of special features that can be purchased as options for the selected CNC machine. These options are too numerous to list, but any manufacturer’s or dealer’s web sites specify all details. When a CNC machine is purchased and delivered, the machine shop needs and requirements should be satisfied, at least for a few years.Very few companies go and buy a new CNC machine just to suit a particular job, although that is not an uncommon situation. Yet, such cases are rather rare and happen only if they make strong economic sense.

Machine Type and Size

Possibly the two most important steps in program planning relate to the type and size of CNC machine, particularly its work space or work area. Other features, equally important, are machine power rating, spindle speed and feedrate range, number of tool stations, tool changing system, available accessories, etc. Typically, small CNC machines have higher spindle speeds and lower power rating, large machines have lower spindle speeds available, but their power rating is higher.

Control System

Control system is the heart of a CNC machine. Being familiar with all standard and optional control features available is a must. This knowledge enables using a variety of advanced programming methods, such as different machining cycles, subprograms,macros and other time saving features of a modern CNC system.
A programmer does not have to physically run a CNC machine. Yet, part programs will become better and more creative with good understanding of the machine and its control system. Program development reflects programmer’s knowledge of various CNC machine operations.
One of the main concerns in program planning should be how the CNC operator perceives the part program. To a large degree, such perception is quite subjective, at least in the sense that different operators will express their personal preferences, often in opposite terms. On the other hand, every operator appreciates an error-free, concise, well documented and professionally prepared part program, written is a consistent way, one after another. A poorly designed program is disliked by any operator, regardless of personal preferences.

Part Complexity

When all initial information, such engineering drawing, material stock, available tools and CNC equipment are evaluated, the complexity of programming task becomes much clearer. How difficult is to program a given part manually? What are the machine capabilities? What are the costs? Many questions have to be answered before starting actual program development.
Many simple programming jobs may be assigned to a less experienced programmer or even to a CNC operator. It makes sense from the management perspective and it is also a good way to gain valuable experience.
Difficult or complex jobs will benefit from a computerized programming system. Technologies such as Computer Aided Design (CAD) and Computer Aided Manufacturing (CAM) have been a strong part of the manufacturing process for many years. The cost of a CAD/CAM system is only a fraction of what it used to be only a few years ago. Even small shops now find that benefits offered by modern technology are too significant to be ignored. Several programming systems are available and can handle virtually any job. For a typical machine shop, a Windows based programming software can be very beneficial. A typical example of this kind of application is the very popular and powerful Mastercam or EdgeCam. There are several others. All major software vendors offer three-axis milling, standard lathe, multi-axis milling, turning with milling axes (live tooling), five axis machining, wire EDM, etc.

Manual Programming

Manual programming (without a computer) has been the most common method of preparing a part program for many years. The latest CNC controls make manual programming much easier than ever before by using fixed or repetitive machining cycles, variable type programming, graphic tool motion simulation, standard mathematical input and other time saving features. In manual programming, all calculations are done by hand, with the aid of a pocket calculator – no computer programming is used. Programmed data can be transferred to CNC machines using a memory card or via a cable, using an inexpensive desktop or a laptop computer. Either process is faster and more reliable than other methods. Short programs can also be entered manually, by keyboard entry, directly at the machine. A punched tape used to be common media of the past but has virtually disappeared from machine shops.

Disadvantages

There are some disadvantages associated with manual programming. Perhaps the most common is the length of time required to actually develop a fully functioning CNC program. Manual calculations, verifications and other related activities in manual programming are very time consuming. Other disadvantages, also very high on the list, are a large percentage of errors, the difficulty in making changes to a program, a lack of tool path verification (simulators are available, such as NCPlot), and many others.

Advantages

On the positive side, manual part programming does have quite a few unmatched qualities. Manual programming is so intense that it requires total involvement of CNC programmer and yet offers virtually unlimited freedom in actual development. Programming manually does have its disadvantages, but it teaches a tight discipline and organization in program preparation. It forces the programmer to understand programming techniques to very last detail. In fact,many useful skills learned in manual programming are directly applied to CAD/CAM programming. Programmer has to know what is happening at all times and why it is happening. Very important is the in-depth understanding of every detail during the program development.
Contrary to many beliefs, a thorough knowledge of manual programming methods is absolutely essential for efficient management of CAD/CAM programming.

CAD/CAM and CNC

The need for improved efficiency and accuracy in CNC programming has been the major reason for development of a variety of methods that use a computer to prepare part programs. Computer assisted CNC programming has been around for many years. First, in the form of language based programming, such as APT™ or Compact II™. Since the late 1970’s, CAD/CAM has played a significant role by adding visual aspect to the programming process. The acronym CAD/CAM means Computer Aided Design and Computer Aided Manufacturing. The first three letters – CAD – cover the area of engineering design and drafting. The second three letters – CAM – cover the area of computerized manufacturing, where CNC programming is only a small part. The whole subject of CAD/CAM covers much more than just design, drafting and programming. It is a part of modern technology also known under yet another acronym – CIM – Computer Integrated Manufacturing.
In the area of numerical control, computers have played a major role for a long time. Machine controls have become more sophisticated, incorporating the latest techniques of data processing, storage, tool path graphics, machining cycles, etc. Programs can now be prepared with the use of inexpensive computers, including sophisticated graphical interface. Initial cost should no longer be an issue, even small machine shops are able to afford a programming system in house. These systems are also popular because of their flexibility. Typical computer based CNC programming system does not have to be dedicated only to programming – all related tasks, often done by the programmer, can also be implemented on the same computer. For example, cutting tool inventory management, database of part programs, material information sheets, setup sheets and tooling sheets, etc. The same computer could also be used for uploading and downloading CNC programs.

Integration

The key letter in acronym CIM is – integration. It means putting all elements of manufacturing together and work with them as a single unit and more efficiently. The main idea behind successful integration is to avoid duplication. One of the most important rules of using a CAD/CAM computer software (and CNC) is:

Never do anything twice!

When a drawing is developed in CAD software (such as AutoCAD), then done again in CAM software (such as Mastercam), there is duplication. Duplication breeds errors. In order to avoid duplication, most of CAD systems incorporate a transfer method of the design to a selected CAM system to be used for CNC programming. Typical transfers are achieved through special DXF or IGES files. The DXF stands for Data Exchange Files or Drawing Exchange Files, and the IGES abbreviation is a short form of Initial Graphics Exchange Specification files. Once the geometry is transferred from CAD system to CAM system, only the tool path related process is added. Using a post processor (special kind of formatter), the computer software will prepare part program, ready to be loaded directly to the CNC machine.
In most cases, both DXF and IGES methods have been replaced by direct translators, when CAD/CAM vendors provide a facility in their software to import a native file, without converting it first.

Future of Manual Programming

It may seem that manual programming is on the decline. In terms of actual use, this is quite likely true. However, it is necessary to keep in perspective that any computerized technology is based on the already well established methods of manual programming. Manual programming for CNC machines serves as the source of new technology – it is the very elementary concept on which computerized programming is based. This knowledge base opens doors for development of more powerful hardware and software applications.
Manual programming may be used somewhat less frequently today and eventually will be used even less – but knowing it well – really understanding it – is and always will be the key to harness the power of CAM software. Even computers cannot do everything. There will always be some special programming project that no CAM software, regardless of price, may handle to absolute satisfaction. If machine control system can handle such a project, manual programming is the way to have ultimate control, when any other methods may not be suitable or practical.
Even with a well customized and organized computerized programming system, how can the generated program output be exactly as intended? How can a CNC operator change any  program entry at the machine, without knowing its rules and structure?

Successful use of computerized programming requires understanding of manual programming methods.

Typical Programming Procedure

Planning a CNC program is not much different than any other planning – at home, at work, or elsewhere – it must be approached in a logical and methodical way. The first decisions relate to what tasks have to be done and what goals have to be achieved. All other decisions relate to how to accomplish these goals in an efficient and safe manner. Such a progressive method of approach not only isolates individual problems as they develop, it also forces their solution before any next step can be taken.
The list of following items forms a fairly common and logical sequence of tasks to be done in CNC programming. All items are listed in a suggested order only, offered for further and deeper evaluation. This – or any other – order should be changed to reflect special conditions or working habits. Some items may be missing from the list altogether, others may be somewhat redundant:

  • Study of initial information (drawing and methods)
  • Material stock (blank) evaluation
  • Machine tool specifications
  • Control system features
  • Sequence of machining operations
  • Tooling selection and arrangement of cutting tools
  • Part setup on the machine
  • Technological data (speeds, feedrates, etc.)
  • Tool path determination
  • Working sketches and mathematical calculations
  • Program writing and preparation for transfer to CNC
  • Program testing and debugging
  • Program documentation

There is only one goal in CNC program planning – to provide all instructions in the form of a program that will result in an error-free, safe and efficient CNC machining. Individual steps in the suggested procedures may require some changes – for example, should cutting tools be selected before or after the final part setup is determined? Can manual part programming method be used efficiently? Are any working sketches necessary? Do not be afraid to modify any so called ideal procedure – either temporarily, for a given job, or even permanently, in order to reflect a particular CNC programming style.

Remember, there are no ideal procedures!

Part Drawing

Part drawing is the single most important document used in CNC programming. It visually identifies the shape, important dimensions, tolerances, surface finish and many other requirements for the completed item. Drawings of complex parts often require many sheets, showing different views, details and sections. CNC programmer first evaluates all drawing data first, then isolates those that are relevant for a particular program development. Unfortunately, many drafting methods do not reflect the actual CNC manufacturing process. They reflect the designer’s thinking, rather than the method of manufacturing. Such drawings are generally correct in technical sense, but they are harder to study by the programmer and may need to be ‘interpreted’ to be of any value in CNC programming. Typical examples are methods of applying dimensions, absence of a datum point that can be used as a program reference point and the view orientation in which the part is drawn. In the CAD/CAM environment, the traditional gap between the design, drafting and CNC programming must be eliminated. Just as it helps the programmer to understand designer’s intentions, it helps the designer to understand the basics of CNC programming. Both, the designer and the programmer have to understand each other’s methods and find common ground that makes the whole process of design and manufacturing coherent and efficient.

Title Block

Drawing title block – Figure 6-1 – is typical to all professional drawings. Its purpose is to collect all descriptive information related to a particular drawing.

Figure 6-1 – A title block example of an engineering drawing

The size and contents of a title block vary between companies, depending on the type of manufacturing and internal standards. It is usually a rectangular box, positioned in the corner of a drawing, divided into several small boxes. Contents of the title block include such items as the part name and part number, drawing number, material data, revisions, special instructions, etc. Data in the title block supply crucial information for CNC programming and can be used for program documentation to make easier cross referencing. Not all title block information is needed in programming, but may be used for program documentation.
Revision dates in a drawing are associated with the title block. They are important to the programmer, as they indicate how current is the drawing version. Only the latest version of a part design is important to manufacturing.

Dimensioning

Part drawing dimensions are either in metric or imperial units. Individual dimensions can be referenced from a certain datum point or they can be consecutive, measured from the previous dimension. Often, both types of dimensions are mixed in the same drawing.When writing a program, it may be more convenient to translate all consecutive – or incremental – dimensions into datum – or absolute – dimensions. Most CNC programs benefit from drawings using datum, or absolute dimensioning. Similarly, when developing a subprogram for tool path translation, an incremental method of programming may be the right choice – and any choice depends on the application. The most common programming method for all CNC machines uses absolute dimensioning method – Figure 6-2, mainly because of editing ease within the CNC system (at the machine).

Figure 6-2 – Program using ABSOLUTE dimensions
Only a single change in the program is necessary

With the absolute system of dimensioning, many program changes can be done by a single modification. Incremental method requires at least two modifications. The differences between the two dimensioning systems can be compared in Figure 6-2, using the absolute dimensioning method, and in Figure 6-3, using the incremental dimensioning method. The word incremental is more common in CNC, in drafting the equivalent word would be relative. Both illustrations show the a) figure before revision, and the b) figure after revision.

Figure 6-3 – Program using INCREMENTAL dimensions
Two or more changes in the program are necessary

Fractions

Drawings (particularly older drawings) dimensioned in imperial units often contain fractions. A fractional dimension was sometimes used to identify a less important dimensional tolerances (such as ±0.03 inches from the nominal size). The number of digits following decimal point often indicated a tolerance (the more digits specified, the smaller the tolerance range). These methods of using implied tolerances are not an ISO standard and are of no use in CNC programming. Fractional dimensions have to be changed into their decimal equivalents. The number of decimal places in a program is determined by the minimum increment of the control system. A dimension of 3-3/4 is programmed as 3.75 without rounding, and a dimension of 5-11/64 inches is programmed as 5.1719, its closest rounding. Many companies have upgraded their design standards to the ISO system and adhere to the principles of CNC dimensioning. In this respect, drawings using metric units are much more practical.
Some dimensioning problems are related to an improper use of CAD software, such as AutoCAD. Some designers do not change default settings for the number of decimal places and every metric dimension ends up with three decimal places and every imperial dimension with four decimal places. This is a poor practice and should always be avoided. The most professional approach is to specify dimensional tolerances for all dimensions that require them, and even use Geometric Dimensioning and Tolerancing standards (GDT or GD&T). GD&T establishes relationship between two or more features of a drawing. For example, GD&T dimension will define concentricity of a hole with a surface. Before GD&T became part of design drafting, written messages and instructions cluttered the drawing. These drawings do not conform to international ISO standards.

Degrees

Angular dimensions should always be specified in decimal degrees (DD), according to modern standards. Older drawings will often contain angular dimensions specified in degrees-minutes-seconds (DMS or D-M-S). To convert DMS to DD:
DD = D + ( M/60 ) + ( S/3600 )
DD = Decimal degrees
D = Degrees (as per drawing)
M = Minutes (as per drawing)
S = Seconds (as per drawing)

Tolerances

For high quality precision machining work,many part dimensions are specified within a certain range of acceptable deviation from their nominal size. For example, imperial units tolerance of +0.001/0.000 inches will be different from metric tolerance of +0.1/0.0 mm. Dimensions of this type are usually critical dimensions and require special attention during CNC machining. It may be true in many companies that CNC operators are ultimately responsible for maintaining required part sizes within tolerances (providing the program is correct) – but it is equally true, that CNC programmers can make machine operator’s task a bit easier. Consider the following lathe example:
Drawing dimension specifies a certain size as dia75+0.00/-0.05 mm. What actual dimension should appear in the program?
Programmer has several choices here. High side of the dimensional range may be programmed as X75.0, low side as X74.95. A middle value of X74.975 is also an option. Of course, any other dimension between high and low value is also a possibility, although not a practical one. Each selection is mathematically correct. A creative CNC programmer looks not only for mathematical aspects, but for technical aspects as well. Cutting edge of a tool wears out with more parts machined. That means the machine operator has to fine-tune part sizes by using tool wear offsets, available on most CNC systems. Such a manual interference during machining process is acceptable, but when done too often, it slows down the production and adds to overall costs.
Properly focused programming approach can control frequency of such manual adjustments to a great degree. Consider the dia75mm mentioned earlier. If it is an external diameter, the tool edge wear will cause the actual dimension during machining to become progressively larger. In case of an internal diameter, the actual dimension will become smaller as the cutting edge wears out. By programming X74.95 for the external diameter (bottom limit) or X75.0 for the internal diameter (top limit), the cutting edge wear will move into the tolerance range, rather than away from it. Manual tool offset adjustment at the machine may still be required, but less frequently. Another approach is to select middle size of the tolerance range – this method will also have a positive effect but more manual adjustments may be necessary during machining.

Surface Finish

Precision machined parts always require a certain degree of surface finish quality. Related drawings indicate desired surface finish quality for various part features. Imperial drawings define surface finish quality in micro inches, where 1 micro inch = 0.000001”.Metric drawings use surface requirements expressed in microns, where 1 micron = 0.001 mm. Some drawings use standard symbols – Figure 6-4.

Figure 6-4 – Surface finish marks in a drawing:
Metric (top) and imperial (bottom)

The most important factors influencing quality of surface finish are spindle speed, feedrate, cutting tool radius and the amount of material removed. Generally, a larger cutter radius and slower feedrates contribute towards finer surface finishes, while the opposite is equally true. Overall cycle time will be longer but can often be compensated for by elimination of any subsequent operations such as grinding, honing or even lapping.

Drawing Revisions

Another important section of part drawings, often overlooked by CNC programmers, shows engineering changes (known as revisions) made on the drawing up to a certain date. Using reference numbers or letters (Figure 6-5), the designer identifies such changes, usually with both values – the previous and the new value – for example:

Figure 6-5 – Drawing revision example

Only the latest changes for each dimension are important to CNC program development. Make sure such a program not only reflects the current (latest) engineering design, but also is identified in some unique way to distinguish it from any previous program versions. Many programmers keep a copy of the part drawing corresponding to the stored program, thus preventing possible misunderstandings later.

Special Instructions

Many drawings also include special instructions and comments that cannot be expressed with established drafting symbols and are therefore spelled out independently, in words. Such instructions are very important for CNC program planning, as they may significantly influence the programming procedure. For example, a certain part element is identified as a ground surface or diameter. Drawing dimensions always show the finished size. During program development, this dimension likely has to be adjusted for any grinding allowance necessary. Actual amount of such allowance is selected by the programmer and should be written as a special instruction in the program. Another example of special instructions relates to any machining done during part assembly. For example, a certain hole should be drilled and tapped, and is dimensioned exactly as any other hole, but a special instruction indicates the drilling and tapping must be done when the part is handled during assembly. Operations relating to such a hole are not programmed and any overlook of small instruction such as this example, may result in an unusable part.
Many drawing instructions use a special pointer called a leader. Usually it is a line ending with an arrow, pointing towards the specific area that it relates to. For example, a leader may be pointing to a hole, with a worded caption:
DIA12 – REAM 2 HOLES – 20 DP
This is a requirement to ream 2 holes to the full depth of 20 mm with a reamer that has 12 mm diameter.

Methods Sheet

Some companies have a staff of qualified manufacturing technologists or process planners responsible for determination of all manufacturing processes. Their responsibility is to develop a series of machining instructions, detailing the exact route of each part through themanufacturing process. They allocate work to individual machines, develop machining sequences and setup methods, select tooling, etc. Their instructions are written in a methods sheet (also called a routing sheet) that accompanies the part through all stages ofmanufacturing, typically in a plastic folder (or as a computer file). If such a sheet is available, its copy should become part of CNC documentation. One main purpose of a methods sheet is to provide CNC programmer with as much information as possible to shorten turnaround between programs. One great advantages of methods sheets in programming is their comprehensive coverage of all required operations, both CNC and conventional, thus offering a complete overview of the manufacturing process. High quality methods sheet will save a lot of decisions – if it is made by a qualified manufacturing engineer, who specializes in work detailing. The ideal methods sheet is one where all recommended CNC manufacturing processes closely match established part programming methods.
For various reasons, many CNC machine shops do not use methods sheets, routing sheets or similar documentation. CNC programmer acts as a process planner as well. Such an environment offers a certain amount of flexibility but demands a large degree of knowledge, skills and responsibility from one person at the same time.

Material Specification

Also important consideration in program planning is evaluation of the material stock. Typical material is raw and unmachined (a bar, billet, plate, forging, casting, etc.). Some material may be already premachined, routed from another machine or operation. It may be solid or hollow, with a small or a large amount to be removed by CNC machining. The size and shape of material determines the setup mounting method. The type of material (steel, cast iron, brass, etc.) will influence not only the selection of cutting tools, but the cutting conditions for machining as well.

A program cannot be planned without knowing the type, size, shape and condition of the material.

Material Uniformity

Another important consideration, often neglected by programmers and managers alike, is the uniformity of material specifications within a particular batch or from one batch to another. For example, a casting or forging ordered from two suppliers to be used for the same part may have slightly different sizes, hardness and even shape. Another example is a material cut into single pieces on a saw, where the length of each piece varies beyond an acceptable range. This inconsistency between blank parts makes programming more difficult and time consuming. It also creates potentially unsafe machining conditions. If such problems are encountered, the best planning approach is to place emphasis on machining safety than on machining time. At worst, there will be some air cutting or slower than needed cutting feedrate, but no machining cuts will be too heavy for the tool to handle.
Yet another approach is to separate non-uniform material into groups and make separate programs for each group, properly identified. The best method is to cover all known and predictable inconsistencies under program control, for example, using the block skip function.

Machinability Rating

Also very important aspect of material specification is its machinability. Charts with suggested speeds and feeds for most common materials are available from major tooling companies. These charts are helpful in programming, particularly when an unknown material is used. The suggested values are a good starting point, and can be optimized later, when the material properties are better known.
Machinability rating in the imperial units is given in units called feet per minute (ft/min). Often the terms surface feet per minute, constant surface speed (CSS), cutting speed (CS), peripheral speed or just surface speed are used instead. For metric designation of machinability rating, meters per minute (m/min) are used. In both cases, the spindle speed (r/min) for a given tool diameter (for a mill) or a given part diameter (for a lathe) is calculated, using common formulas. For imperial units, the spindle speed can be calculated in revolutions per minute (r/min):

r/min = Revolutions per minute (spindle speed S)
12 = Converts feet to inches
1000 = Converts meters to millimeters
ft/min = Cutting speed in feet per minute
m/min = Cutting speed in meters per minute
(pi) = Constant value of 3.141593…
D = Tool diameter (milling) or Part diameter (turning) – in inches or mm

Machining Sequence

Machining sequence defines the order of machining operations. Technical skills and machine  shop experience do help in program planning, but a good quantity of common sense approach is equally important. Machining sequences must have logical order – for example, drilling must be programmed before tapping, roughing operations before finishing, first operation before second, etc. Within this logical order, further specification of the order of individual tool motions is required for a particular tool. For example, in turning, a face cut may be programmed on the part first, then roughing all material on diameters will take place. Another method is to program a roughing pass for the first diameter, then face and continue with the remainder of the diameter roughing afterwards. In drilling, a spot drill before drilling may be useful for some applications, but in another program a center drill may be a better choice. There are no fixed rules, no absolutes, that determine which method is better – each CNC programming assignment has to be considered individually, based on the basic criteria of safety, quality, and efficiency.

Machining sequence must follow logical order.

Basic approach for determining a machining sequence is careful evaluation of all related operations. In general, program should be planned in such a way that the cutting tool, once  selected, will do as much work as possible, before a tool change. On most modern CNC machines, much less time is needed for positioning a tool than for a tool change. Another consideration is in benefits gained by programming all heavy operations first, then the lighter semi-finishing or finishing operations. It may mean an extra tool change or two, but this method minimizes any shift of material in the holding fixture while machining. Another important factor is the current position of cutting tool when a certain operation is completed. For example, when drilling a pattern of holes in the order of 1-2-3-4, the next tool (such as a boring bar, reamer or a tap) could be programmed in opposite order of 4-3-2-1 to minimize unnecessary tool motions – Figure 6-6.

Figure 6-6
Typical machining sequence for three common hole operations

This machining sequence may have to be changed after final selection of tools and setup method. Although practical in many cases, the reverse machining sequence may not be practical when stored as subprograms.
Program planning is not an independent execution of individual steps – it is a very interdependent and very logically and coherent approach to achieve a certain goal.

Tooling Selection

Selecting tool holders and cutting tools is another important step in planning a CNC program. Category of tooling, their selection and usage, includes a lot more than just cutting tools and tool holders – it covers an extensive line of accessories, involving numerous vises, fixtures, chucks, sub-tables, steady-rests, tailstock, indexing tables, clamps, collets and many other holding and auxiliary devices. Cutting tools require special attention, due to the very large variety available and their direct effect in machining.
Cutting tool used for the job is usually the most important selection. It should be selected by two main criteria:

  • Efficiency of usage
  • Safety in operation

Many supervisors responsible for CNC programming try to make the existing tooling work at all times. Often they ignore the fact that a suitable new tool may do the job faster and more economically. A thorough knowledge of tooling and its applications is a separate technical profession – the programmer should know well all general principles of cutting tool applications. In many cases, a tooling company representative may provide additional valuable assistance.
Arrangement of tools in the order of usage is also a subject of serious consideration in CNC program planning. On CNC lathes, each cutting tool is assigned to a specific turret station, which requires consideration about the distribution of tools – how they are arranged between short and long tools (such as short turning tools versus long boring tools). This is important for prevention of a possible interference during cutting or tool changing. Another concern should be the order in which each cutting tool is called, particularly for machines that do not have a bi-directional tool indexing. Most machining centers use a random type tool selection, where the order of tools is unimportant, only the diameter of the tool and its weight has to be considered.
All tool offset numbers and other program entries should be documented in a form known as the tooling sheet. Such a document serves as a guide to the operator during job setup. It should include at least some basic documentation relating to the selected tool. For example, such documentation may include the tool description, its length and diameter, number of flutes, tool and offset numbers, speed and feeds selected for that tool and other relevant information.

Part Setup

Another decision in program planning relates to the actual part setup – how to mount the raw or premachined material, what supporting tools and other devices should be used, how many operations are required to complete as many machining sequences as possible, where to select a program zero, etc. Setup is necessary and it should be done efficiently.
Some types of machines are designed to make the setup time more productive. Multi spindle machining centers or lathes can handle two or more parts at the same time. Special features, such as tool offset settings, barfeeder for a lathe, an automatic pallet changer or dual setup on the table, also help. Other solutions can be added as well.

Setup Sheet

At this stage of program planning, once the setup is decided, making a setup sheet is a good idea, particularly for jobs with many tools and/or operations. A setup sheet can be a simple sketch, designed mostly for use at the machine, that shows part orientation when mounted in a holding device, tool offset numbers used by the program, datum points and, of course, all necessary identifications and descriptions. Other information in a setup sheet should relate to some unique requirements established during planning stages of the program (such as position of clamps, bored jaws dimensions, depth of clamping, limits of tool extension, etc.). Setup sheet and tooling sheet can be combined into a single source of information. Most programmers use their own various versions.

Technological Decisions

The next stage of CNC program planning involves selection of spindle speeds, cutting feedrates, depth of cut, coolant application, etc. All of the already considered factors will have their influence. For example, the available range of spindle speeds is fixed for any CNC machine, size of the cutter and material type will influence speeds and feeds, power rating of the machine tool will help determine what amount of material can be removed safely, etc. Other factors that influence program design include tool extensions, setup rigidity, cutting tool material and its condition. Not to be overlooked is the proper selection of cutting fluids and lubricants – they, too, are important for overall part quality.

Cutter Path

Main core of any CNC programming is the precise determination of cutter path – known as the tool path or toolpath. This process involves individual cutter movements in its relationship to the part.

In CNC programming, always look at the cutting tool as being moved around the work!

The key factor for understanding this principle is to always visualize the tool motion, not the machine motion. The most noticeable difference between programming a machining center as compared to a lathe program is the cutter rotation as compared to part rotation.
In both cases, the programmer always must think in terms of the cutter moving around the part – Figure 6-7.

Figure 6-7
Contouring toolpath motion – as intended for milling or turning

Toolpath for all contouring tools always has to take into consideration the cutter radius (tool nose radius for turning and boring), either by programming an equidistant toolpath for the radius center or by using cutter radius offset (also known as cutter radius compensation or tool nose radius compensation). CNC machines for milling and turning are provided with rapid motion, linear interpolation and circular interpolation, all as standard features. To generate more complex paths, such as a helical milling motion or program rotation, a special option has to be available in the control unit. Two groups of typical toolpaths are used:

  • Point-to-point also called Positioning
  • Continuous also called Contouring

Positioning is used for a point location operations, such as drilling, reaming, tapping and similar operations; continuous path generates a contour (profile). In either case, all programmed data refer to the cutter position when a certain motion is completed.
This position is called tool target position – Figure 6-8.

Figure 6-8
Contouring toolpath motion – target positions identified

The contour start and end positions are identified and so are the positions for each contour change. Each target position is called the contour change point, which has to be carefully calculated. The order of target locations in the program is very important. Based on the above illustration, it means that tool position 1 is the target position commencing at the Start point, position 2 is the target position beginning at point 1, position 3 is the target from point 2 and so on, until the End position is reached. If the contour is for milling, these targets will be in X and Y axes. In turning, they will be in X and Z axes.
Most contouring operations require more than just one cutting motion, for example, roughing and finishing. Part of the programming process is to isolate areas that need roughing. Can one cutting tool do all operations? Can all tolerances be maintained? Is the tool wear a problem? Can the surface finish be achieved? When programming non cutting rapid motions, take the same care as with cutting motions. A particular focus should be to minimize rapid tool motions and ensure safe clearances.

Machine Power Rating

Machine tools are rated by their power, as one important specification for CNC programming. Laws of physics define that heavy cuts require more power than light cuts. A depth or width of a cut that is too large can break the tool and stall the machine. Such cases are unacceptable and must be prevented. CNC machine specifications list typically identifies power rating of the motor at machine spindle. This rating is either in kW (kilowatts) or HP (horsepower). Several formulas are available for calculations relating to various power ratings, establishing metal removal rates, tool wear factors, etc.
One of the more useful formulas is the comparison of kW and HP(based on 1HP= 550 foot-pounds per second):
1 kW = 1.341022 HP or ~ 1.3 HP
1 HP = 0.7456999 kW or ~ 0.75 kW
The topic of power and forces in machining can be complex and is not always needed in everyday programming. There are publications devoted to this particular subject. Work experience is often a better teacher than formulas.

Coolants and Lubricants

When cutting tool contacts the material for an extended period of time, great amount of heat is generated. Cutting edges get overheated, become dull and an insert or the whole tool may break. To prevent such possibilities, a suitable coolant must be used.
Water soluble, bio-degradable, oil is the most common coolant. A properly mixed coolant dissipates heat from the cutting edge and it also acts as a lubricant. The main purpose of lubrication is to reduce friction and make the metal removal easier. Flood of the coolant should aim at the tool cutting edge, with a flexible pipe or through a coolant hole built into the tool itself.

Never use plain water as coolant – it may severely damage the machine tool.

CNC operator is responsible for a suitable coolant in the machine. Coolant should be clean and mixed in recommended proportions. Water soluble oils should be biodegradable to preserve the environment and properly disposed of. CNC programmer decides when to program coolant and when not. Ceramic cutting tools are normally programmed dry, without a coolant. Some cast irons do not require flood coolant, but air blast or oil mist may be allowed. These coolant functions vary between machines, so check the machine reference manual for further details.
Flood coolant may be used to cool down the part and gain better tolerances. It can also be used to flush away chips from congested areas, such as deep holes and cavities.
The main benefits of cutting fluids far outweigh their inconveniences. Cutting fluids are often messy, the cutting edge cannot be seen during operation, operator may get wet and sometimes old coolant smells.With proper coolant management, all problems related to coolants can be controlled.
A coolant related programming issue is when to turn the coolant ON in the program. As the coolant ON function M08 only turns on the pump motor, make sure the coolant actually reaches the tool edge before contact with work. Programming coolant ON earlier is better than too late.
In summary, using coolant on CNC machining centers and lathes serves three major purposes:

  • … to dissipate heat from cutting edge and part
  • … to lubricate area between tool edge and part
  • … to flush away chips

Work Sketch and Calculations

Manually prepared programs always require several mathematical calculations. This part of program preparation intimidates many programmers but is a necessary step, even for simple operations. Many complex contours will require more calculations, but not necessarily more complex calculations. Almost any mathematical problem in CNC programming can be solved by the use of arithmetic, algebra and trigonometry – that’s it!. Advanced fields of mathematics – analytic geometry, spherical trigonometry, calculus, surface calculations, etc. – are required for programming complex molds, dies and similar shapes. In such cases, a CAD/CAM programming system is necessary.
Those who can solve a right angle triangle can make calculations for almost any CNC program. When working with more difficult contours, it is often not the solution itself that is  difficult, it is the ability to arrive at the solution. CNC programmer must have the ability to see exactly what triangle has to be solved, what formula to use, what approach to select. It is not unusual to do several intermediate calculations before the required final coordinate point can be established.
Calculations of any type often benefit from a visual (pictorial) representation. Such calculations usually need a working sketch. A simple sketch can be drawn by hand and should be done in an approximate scale. Larger sketch scales are much easier to work with.  Making the sketch in at least approximate scale has one great advantage – you can immediately see various relationships – what dimensions should be smaller or larger than the others, the relationship of individual elements, the shape of an extremely small detail, etc. All that said, there is one purpose a sketch should never be used for, regardless how accurate it is:

Never use a scaled sketch to guess unknown dimensions!

Scaling a drawing is a poor and unprofessional practice, that creates more problems than it solves. It is a sign of either laziness or incompetence, commonly both.

Identification Methods

A sketch used for calculations can be done directly in the drawing, or on paper or even using CAD software. Every sketch is associated with several mathematical calculations – they make the sketch necessary in the first place. Using color coding or point numbering as identification methods offers benefits and better organization. Rather than writing coordinates at each contour change point in the drawing, use point reference numbers and create a separate coordinate sheet form using the reference numbers, as illustrated in Figure 6-9.

Figure 6-9
Coordinate sheet example – blank form (no data)

Such a sheet can be used for milling or turning, by filling only the applicable columns. The aim is to develop a consistent programming style from one program to another. Fill-in all values, even those that do not change.
A completed coordinate sheet is a better programming reference, as shown in Figure 6-10.

Figure 6-10
Coordinate sheet example – filled form for a milling toolpath

Quality in CNC Programming

All parts machined on CNC equipment are evaluated by their quality – usually after they are machined. Quality inspectors check many features – are the dimensions within tolerances? Is the surface finish up to standard? Is there a consistency between parts, etc.? Modern CNC equipment provides optional inspection related features during machining process, for example, in-process gaging. Many machine shops require their CNC machinists to be quality inspectors while the parts are being made. One subject that is equally important, yet not very often mentioned, is quality in CNC programming.
CNC programming starts with a plan. Although number one quality of a CNC programmer is knowledge and skill, there are at least two related and equally important considerations in program planning – programmer’s personal approach and professional attitude. How the CNC programmer approaches a certain job, assignment or project will have a great influence on the final outcome of parts produced by the CNC operator. Programmer’s attitudes have significant influence on program development and final results. They also have significant influence on the CNC operator – it’s just human nature.
Ask yourself some questions. As a CNC programmer – are you attentive to detail, are you precision minded, are you well organized, are you concerned if something is not done right? Do you ‘cut corners’ just to have the job done? Can a program you just developed, or an existing program, be improved further to make it safer and more efficient?
CNC program quality is much more than writing an error free program – that is the absolute prerequisite and goes without saying. Quality in programming includes concern as how a program effects the CNC operator,machine setup, and actual part machining. Quality in programming means constant effort at improvement and desire to make the next program even better.
Consistency in programming is one the best ways to achieve high quality programs. Once a certain method or process been found superior to others, stick with it. Use the same method again and again. CNC operators like nothing less than programs that vary in structure.
Part complexity should never stand in the way – it is only related to your knowledge level and willingness to solve problems. It should be a personal goal to make a program – every program – the best program possible.

Set your quality standards high!


Need to More?

Our volunteers have worked together and carefully prepared the articles published here in their native language without using machine translation. You can search the entire site for more information on the subject. You can start a discussion on CNCarea.com forums and join us to get support, ask questions, improve a published article or give your opinion.


Previous articleTypes of CNC Machine Tools
Next articleCNC | Control Systems Features