What CNC programmers wish you knew

A crash course in CNC

The FABRICATOR March 2008
March 1, 2008
By: Gerald Davis

State-of-the-art CNC programming systems speed the first stage of CNC programming by allowing the programmer to import CAD models to define the geometry of the part. That's just the first part, however. To really speed up the design phase, CAD programmers should keep several tips in mind.


CNC stands for computer numeric control and refers to an electronic control system that is attached to a piece of machinery. These CNC systems are connected to the machine tool's electromechanical devices (for example, motors and clamps) to position the workpiece for manufacturing. The manufacturing sequence performed by the control system is established by a software program, or the CNC program.

Today CNC programming is involved in many manufacturing processes. Robotics, punching, laser, waterjet, plasma, milling, lathe work, and welding are examples.

In the early days (1950s) before the computer became a standard part of the control system, NC programs were simply lists of numbers that represented the physical relationship between the workpiece and the tooling. That's where the numeric in CNC comes from.

As the technology evolved, the control system's feature list expanded to include automatic cycles—such as bolt hole circles, rectangular patterns, and so forth—in addition to X, Y, and Z positioning and origin control commands. GE and FANUC were among the early pioneers in this technology, and their generic patterning functions were programmed using G-codes.

Some old-timers still can program using G-codes, but that is becoming an arcane art. A G-code program can run into several hundred lines of inscrutable text (see Figure 1). If you're familiar with computer programming, you know that G-coding is like using a low-level assembler to compile a program. It is more common today to use higher level tools to program the machine tool graphically.

The CNC program can be prepared either online at the machine's console or offline at a remote workstation. Programming a CNC is a detailed process; bottlenecking an expensive machine tool while slowly typing in a program is not the best use of capital equipment. For that reason, offline workstations commonly are used for preparing the CNC program.

The CNC programming process generally flows through three stages when performed at an offline workstation:

  • Define the geometry of the part to be manufactured.
  • Establish a tooling and clamping sequence.
  • Post a CNC program that is specific to a particular machine tool.

State-of-the-art, offline CNC programming systems speed the first stage of CNC programming by allowing the programmer to import CAD models to define the geometry of the part. Geometry simply defines the edges and holes and other features of the part to be manufactured.

For the sake of brevity, the following tips are related to sheet metal work. My intention is to offer suggestions that apply to virtually any CNC manufacturing process.

Tip No. 1: Make Data Compatible

If the geometry can't be imported, it must be drawn using the CNC programming system's graphical user interface. In many cases, the CNC geometry looks a lot like what is seen on a CAD engineering workstation. (See Figure 2 for a comparison between a CAD model and a CNC tool path for the same part.)

So, here's the first tip: Export the geometry from the CAD system to help the CNC programmer. The CAD staff and the CNC staff may need to meet to determine exactly which file formats to use and which information to include in the exported data.

Once the CNC system has the geometry set, the CNC programmer visually selects the sequence of features to process and which tools to use. At this stage the program exists in an interim state that might apply equally well to a variety of machine tools—for example, a plasma cutter, a waterjet, or a laser. Revisions are easy to make using the graphical interface. Validating the program is as easy as comparing the original CAD model to the CNC geometry. The methods used to validate the CNC program will vary from shop to shop.

Posting a program is the process of translating this interim geometry-based plan into a specific machine tool control program. Posting is generally a matter of a few mouse clicks; select the machine tool and a few operational parameters.

Once the CNC program has been posted, it can be downloaded to the machine tool whenever the production schedule requires it. Posting is a one-time commitment to a particular revision for a particular machine tool. If the posted CNC program produces a nest of parts (several parts on a blank of raw material), it will produce the same quantity of parts each time it is run. If a different quantity of parts is needed for the next manufacturing cycle, the CNC program will need to be reposted, but may use the same geometry.

Tip No. 2: Don't Keep Secrets

As hinted at earlier, if a revision is made to the part, the geometry must be updated along with the tooling plan, and then the CNC program must be reposted. Coordination of the revision of the CAD model, the CNC geometry, the posted CNC programs, and the CNC programs that are loaded in the CNC system is an important quality assurance function. Here's another tip: Make it easy to identify the part number and revision of all CAD models and related documentation.

The use of imported CAD data and CNC geometry as I've described is not mandatory. A CNC programmer can produce a fully functional program simply by using a text editor like Notepad™. However, it generally is much more efficient to use the geometry; it is easier to validate the program and to update the program if good CAD data is available.

If the program is prepared offline, then it needs to be transferred (downloaded) into the CNC's memory. This process is frequently referred to as DNC, or direct numeric control. This DNC transfer may use a wireless connection, an Ethernet cable, a serial RS-232 cable, or even paper tape depending on the age of the machine tool's controller.

CAD Consequences

A designer using CAD software makes decisions that have a direct impact on subsequent manufacturing. For example, the CAD system might be used to generate documentation that specifies the dimensions, tolerances, materials, and finishes. CNC programmers are frequently among the first people to review such documentation from the manufacturing point of view.

CAD professionals can do several things to make CNC programmers happier. Most of these suggestions generally come down to better communication, which leads to less time wasted. Because time is money, CAD professionals have a clear motivation to help the CNC staff in as many ways as they can.

CNC programmers are trying to accomplish several things:

  • Write an efficient program to make the best use of the machine tool's capabilities.
  • Minimize material waste.
  • Complete the program quickly.
  • Have parts emerge from production perfectly.

So, what can a CAD jockey do to help that CNC endeavor?

Tip No. 3: Avoid Missing Dimensions

Perhaps the most obvious thing is to answer all of the questions before they get asked. It is all too easy to miss adding a dimension to a drawing (see Figure 3). When that happens, the show stops while the chain of command gets the missing dimension added to the drawing.

Of course, CAD people would love to avoid the tedium of mechanical drawing altogether and just let the CNC people figure out the answers based on the 3-D CAD model. It seems like a great idea, but 3-D models provide only a limited range of answers. They are particularly good at providing details on size, a.k.a. the geometry. They are less efficient at communicating the subjective—things like tolerances, critical cosmetic surfaces, finishes, and colors.

Tip No. 4: Minimize the Complexity

When all things are equal, one easy trick the CAD jockey can perform is to reduce the number of distinct hole sizes. Look at Figure 4 and ask yourself, "Why not make all of the small holes the same size?"

A captive fastener might require a hole diameter of 0.191 inch, and the standard hole clearance for a #8 screw might be 0.194 in. Because the hole clearance provides only about 0.030 in. of air for the screw to float in, why not change the model so both holes are 0.191 in.? The part is still functional, and the CNC machine setup is simplified.

I've heard CAD jockeys ask, "Why can't the CNC programmers just apply the tolerances shown in the title block and figure out on their own how to minimize the number of unique tools to use?" Well, they can, but it takes time and a bit of judgment. When the first article gets inspected, the quality assurance and CNC staff may have a meeting to discuss the decisions made about how the tolerances were applied.

Tip No. 5: Know Thy Tooling Library

Speaking of hole sizes, your punching department probably has a finite number of tools available. The CNC turret library probably includes rounds, obrounds, rectangles, and a bunch of special shapes. When the CAD jockey works on the perfect design, an unusual feature size may result. Again, when all things are equal and there is latitude to allow it, the CAD jockey should adjust the feature to take advantage of available tooling.

For example, an arbitrary rectangular hole design might be 0.490 in. by 1 in. The closest available tool might be 0.500 in. by 1 in. If that satisfies the design requirement, then change the model to match the tooling (see Figure 5).

Tip No. 6: Don't Forget Lovely Overlaps

When cutouts are being programmed using multiple hits, the CNC programmer tries to avoid side loading the tooling. The goal is to keep the pressure as close to the centerline of the tool as is reasonable. This maximizes tool life and minimizes the strain on the machinery (which improves accuracy).

For example, the design might call for a hole that is 0.500 in. by 3 in. The CNC programmer would like to use the 0.500-in. by 1-in. punch. Normally, the first punch cycle would be programmed at one extreme end of the slot. The next punch cycle would be at the opposite end of the slot. The final stroke would be in the middle (see Figure 6).

The problem is that some overlap is needed on that last hit. Otherwise, nasty, needlelike burrs result. This is because the machinery positions with only a limited amount of precision, and the tooling wears away from the perfect size. It would be a far better thing if the slot was 0.500 in. by 2.990 in., allowing the final hit to overlap the previous two holes by 0.005 in. and helping to prevent the burring problem.

Tip No. 7: Pay Attention to the Knockout Nesting Scheme

One of the tricks CNC programmers employ to make efficient use of raw material is to nest several small parts on a larger sheet. Figure 7 shows an example of nested parts.

One of the benefits of this technique is that the parts are held in place for sanding to remove the burrs left by punching. The CNC programmer will create microjoints at the corners of the part to accomplish this. The microjoints are just strong enough to hold the part in position for punching and deburring. They are also just weak enough to be easy to break to remove the parts from the nesting frame.

Figure 8 shows an example of a microjoint; the tooling stops just short of punching out the corner. This matters to the CAD jockey because if the design calls for all rounded corners, the opportunity for corner microjointing is lost. The CNC programmer will resort to using string tags along the edges of the part. It is common for the string tags to require additional labor for final deburring.

So, if the design allows it, the CAD jockey can provide features that make microjointing easier.

Tip No. 8: Don't Call for the Impossible

The CAD jockey should be aware of some physical limitations. The smallest hole that can be punched is generally 0.040 in. or equal to the material thickness, whichever is greater. The reason for this is due to the way holes are punched. Basically, a pin (the punch tip) is forced through the sheet metal. If the punch tip is too slender, it bends before it perforates the workpiece.

There is also a limit to how closely holes can be spaced to each other. If they are too close to each other, distortion will result. My best advice for resolving such details is to hold a staff meeting with CAD and CNC personnel to establish preferences for feature size, feature positioning, nesting schemes, clamping methods, and so on, that are specific to the CNC manufacturing process.

Tip No. 9: Know the Process

Whether the design will be produced using a waterjet or a turret press, the CAD jockey should know the limits of the manufacturing process. We've talked a bit about minimum hole size and the distance between embossed features. CAD people should also consider the reasonable tolerances that the process can work within.

One set of considerations has to do with the machine tool's repeatability and accuracy. That might be something in the range of ±0.004 in. Another is the accuracy of the raw material. A typical sheet metal tolerance range is ±5 percent of the nominal sheet thickness.

If, for example, a design calls for 0.100-in. aluminum sheet, the actual thickness may be from 0.095 in. to 0.105 in.

CAD staff also needs to consider downstream processes. If the part will be formed using a press brake, another ±0.004-in. variable is introduced.

All too often a CAD designer will get lulled by the ideal precision of the parts as displayed on the CAD workstation and fail to design the necessary gaps to allow for manufacturing variables.

Gerald would love to have you send him your comments and questions. You are not alone, and the problems you face often are shared by others. Share the grief, and perhaps we will all share in the joy of finding answers. Please send your questions and comments to dand@thefabricator.com.

Gerald Davis

Gerald Davis

Contributing Writer
Gerald Davis Design and Consulting

Published In...



The FABRICATOR is North America's leading magazine for the metal forming and fabricating industry. The magazine delivers the news, technical articles, and case histories that enable fabricators to do their jobs more efficiently. The FABRICATOR has served the industry since 1971.

Preview the Digital Edition

Subscribe to The FABRICATOR

Read more from this issue