How to Prepare CAD Files for CNC Machining

CAD files for CNC machines

Computer numerical control (CNC) machining is a manufacturing process. It relies on code to control the movement of tools, such as lathes, router bits, and milling bits, found in CNC machines, to produce parts with certain designed features. However, you have to accomplish several tasks before using these crucial machines and their built-in tools. You must create a 2D drawing or 3D model and convert it into a program written using G-code and M-code. Next, you then have to import this program file to the CNC machine for execution. To further guarantee success, preparing the CAD files for CNC machining is advisable. Especially considering that inefficient programs can lead to downtime, this article is dedicated to helping you learn how to prepare CAD files for CNC machining; more on this below. Therefore, this article is dedicated to helping you learn how to prepare CAD files for CNC machining. 

History of CNC Machining and Machining Approaches

Before going further, a little background is necessary. CNC was born circa 1970 when machines that RAM became commercially available; G-code, however, is much older. Later, around 1975, CAD and CAM began, driven by the affordability of PCs and the fact that programming had become a little bit simpler. However, it wasn’t until 1980 that fully-functioning graphic software and multitasking CNC machines were introduced and widely used. And by 2000, automated CAM software could now convert solid drawings into programs that CNC machines could execute to create physical representations of the drawings. 

This brief chronological history introduces the fact that CNC machines use programs to machine parts. At the formative stages, before computer-aided manufacturing (CAM) applications could convert 2D drawings or 3D models to programs, programming was handled manually by operators. These individuals manually wrote machine code and fed it into the machine. As part of their code-writing responsibilities, they planned and documented the sequential processing steps the machine should follow. These sequences included:

  • Tool movement, e.g., position, direction, and speed
  • Spindle rotation speed and direction
  • Tool selection, tool offsets, tool compensation, and tool change
  • Application of cooling fluid
  • Cutting speed

As computers’ processing capabilities improved, computer-assisted programming emerged. This approach was more simplistic and saved a lot of time. Operators no longer had to write machine code – G-Code and M-code. Rather, they simply wrote statements that followed an English-like syntax. Then, the computer compiled these statements, converting them to machine code. This approach was advantageous because it reduced the burden of knowing how to code extensively. However, it was disadvantageous because it used English-like commands to define geometry rather than graphical elements, which were more convenient. As technology advanced, in came CAD and CAM software, substantially improving the experience.

How CAD and CAM are Applied in CNC Machining

The CAD/CAM approach is currently the most popular method of creating code for CNC machines compared to other approaches. The process begins with creating a 2D drawing or 3D model of a part using CAD software like AutoCAD, SketchUp, and more. The procedure then follows these steps:

  1. Next, the model is imported into CAM software, a program that automates the manufacturing process.
    However, software applications such as SolidWorks and Fusion 360 combine CAD and CAM capabilities; they are known as CAD/CAM software. With these programs, all you have to do to use the built-in CAM capabilities is enter the manufacturing mode. Fusion 360, for instance, requires you to change the workspace from ‘Design’ to ‘Manufacturing.’ On the other hand, in SolidWorks, you have to open the SolidWorks CAM add-in. 
  2. Next, select the CNC machine, cutter, and coordinate system. 
  3. Create a manufacturing sequence, also known in SolidWorks as an operation plan.
  4. Next, prompt the software to generate a toolpath.
  5. Run a simulation to verify that the operation plan and toolpath selected by the software align with your machine shop practices.
  6. Generate the G-code file, also known as post-processing, and save it. Importantly, post processing builds all the information above into the program. And given that the post processor must be able to translate the code to the specific machine’s convention, selecting one that corresponds with your CNC machine is crucial. Such machine-specific processors utilize a library that contains machine-specific controls. This is partly why most CNC machines come with their own CAM systems. However, these manufacturers also accommodate conventional, popular CAM software.
  7. Lastly, import the file into the CNC machine for machining

It is worth pointing out that modern CAM software can automatically detect design changes and update the NC program. These are just some of the advantages of CAD/CAD programs. Overall, by combining this software with CNC machines and computer-driven feed drives, there is practically no 3D shape you cannot create.

CAD Design Considerations for CNC Machining

Every time you wish to create a design for CNC machining, you must first use CAD software. This makes design the first foundational stage. Machining operations are generally more expensive than other manufacturing processes, requiring skilled labor, substantial capital investments, significant amounts of energy, and relatively slow production. Therefore, it’s important to consider several factors when designing for CNC machining to save time and costs. These considerations help create a design that is suited for a particular machining process. In addition, they contribute to cost and time saving – more on this below, where we discuss the importance of the collaboration between designers and machinists. 

The CAD design considerations are generally regarded as design for machining rules; they include:

1. Optimize Tolerances

Geometric dimensioning and tolerancing (GD&T) provides machinists with greater control and flexibility downstream. Machining a feature, such as a drilling hole, requires the hole to be the right size and position. (A feature is any aspect of a part that is dimensioned and toleranced.) Depending on the utility, it must also have the right shape. Usually, these properties are defined by the nominal dimension and annotations, which provide additional information. 

Realistically speaking, though, it is impossible to achieve exactness or perfection. Even if it were possible to achieve exactness, it would require additional grinding or honing operations for specific surface finishes and reaming processes for specific diameter sizes, which would slow down the machining process and increase manufacturing costs. These additional operations slow down the machining process and increase the cost of manufacturing. 

For this reason, tolerances, which define the amount of allowable variation from the nominal dimensions, are used. Tolerances should be optimized based on the following factors:

  • Tool change schedule
  • Compensation capabilities of the tools
  • Part geometry
  • Supports built into the fixture
  • Tool guiding jigs

To understand the significance of these factors, designers should collaborate with machinists.

2. Type of Material

The type of material greatly impacts the quality of the machining operation as well as the cost. This is because it determines the tool materials, motor power, cutting speeds, tolerances, and surface finishes. To select the material, you must consider the chemical and physical properties as well as functional requirements outside of machining.

3. Minimize the Number of Machined Features

The general rule of thumb is that features should be machined only when they require tolerances (dimensional or surface finish tolerances) that other manufacturing processes cannot achieve. Machining is usually used for features that require:

  • Dynamic balance
  • Press fitting
  • Locating
  • Locking
  • Bearing
  • When subsequent assembly considerations call for a close dimensional tolerance

If possible, minimize the number of machined features through alternative methods such as undercutting, chamfering, and casting in holes, especially if the specified tolerances allow for it.

4. Minimize Machined Stock Allowance

Always minimize the material that needs to be machined away to produce the final part. This amount is known as stock allowance) Failure to do this increases costs such as the cost of replacing worn-out tools (tool wear per part increases with the increase in stock allowance), material costs, and equipment costs. It also increases the time taken to produce a part. 

Minimizing the stock allowance is achieved by optimizing the dimension based on the size of the material loaded into the CNC machine. The whole unmachined material is technically known as the stock, billet, or blank. 

5. Standardize Features

Make sure you standardize features as much as possible. You can achieve this by selecting hole diameters from a limited range of sizes. You should also limit the number of different diameters in a single part.

6. Surface Finish

The desired surface finish determines the machining operation used. However, certain operations such as diamond turning, precision grinding, lapping, and honing can achieve small surface finish tolerances (<0.4 micrometers) but increase machining costs.

7. Provide Adequate Strength and Stiffness

CNC machines are driven by powerful motors that, in turn, generate massive cutting forces. These forces can break, bend, or deflect the part. They can also cause unstable vibrations. This is particularly the case if the strength and stiffness are inadequate. Therefore, designers should ensure that the part has adequate stiffness and strength, particularly in the loading directions.

8. Provide Adequate Accessibility

Feature locations should be accessible with standard machining tools. Avoid locating features on remote faces or inside cavities. If the features are located in hard-to-reach areas, specialized tooling is necessary. However, such tools may create unstable vibrations or deflections. Furthermore, using these tools and attachments increases the machining costs and limits the allowable tolerances.

Preparing CAD Files for CNC Machining

Once the designer or engineer finalizes the product design process, which generally includes conceptualization, synthesis, analysis, evaluation, and documentation, the CAD file is sent to the machinist for CNC machining. As a machinist, you do not have to understand how the product or part works – that is reserved for the engineer or designer. However, there are a few things you need to know and do, including.

1. Remove Unwanted Layers

Dimensions and notes are ideally designed to help machinists visualize and understand the part. To put it simply, they provide additional information. Thus, they do not in any way contribute directly to the creation of the part. This means you should remove these informational elements as you prepare the CAD file for CNC machining.

2. Choose the CNC Machine

Most CAD/CAM programs will let you add a CNC machine to the database. And to further promote the accuracy of the program, this software also has dialog boxes where you can customize the settings to match your machine’s capabilities and features. For example, you can select a matching post processor and tool crib within this dialog box. Additionally, you can input values such as horsepower, maximum feed rate, and more.

SolidWorks CAM Machine Database Dialog Box

SolidWorks CAM Machine Database Dialog Box (source)

When preparing your CAD files for CNC, you must specify the exact machine you will use. This choice is crucial, as the designer envisioned a specific machining process when creating the design.

3. Assign Machining Data

Machining data includes the type of cutters, cutter size(s) – diameter and length – and the number of roughing and finishing passes. Assigning the data hardcodes it into the G-code, which guides the machine as it executes its machining operations. It is, however, worth mentioning that some machines come with a built-in database of tools. This means that you do not need to assign tool data contained. Even so, keep in mind that you must load these cutters before the machining process can commence. 

4. Undertake Element Sequencing 

You should undertake element sequencing when working with 2D wireframe line drawings and 3D wireframe geometries. Naturally, the CAM software does not know that the lines or arcs define the geometry or surface of a material. Instead, it views these geometric components as mare lines or arcs. In this regard, you must sequence these elements, i.e., point out using a mouse the individual elements of the drawing in the order in which they are to be machined. In addition, you must indicate the side of the line the machine should place the cutter.

However, if you are dealing with solid models, the software will automatically sequence the elements. SolidWorks CAM add-in, for example, achieves this by generating an operation plan. Here, an operation plan refers to the physical steps needed to create a suitable toolpath using which the CNC machine will turn the digital part and its features into a physical part.

5. Run Simulation

A simulation allows you to assess whether the operation plan generated matches your shop’s capabilities. If not, the CAM software has provisions that let you tweak the operation to match shop practices. The simulation enables you to check for errors. Furthermore, it helps you avoid wastage and the associated costs.

6. Post Processing

Post processing refers to the conversion of toolpath data (TPD), which describes the operations a CNC machine should follow, to numerical control (NC) code. It is worth pointing out that TPD is machine independent, while the code must conform to a particular machine’s conventions. For this reason, choosing a post processor designed for your specific machine and its unique needs is particularly vital.

Best Practices for CNC Machining Preparation

1. Study the Technical Drawing Carefully

By studying the engineering/technical drawing, you can identify issues and inconsistencies in dimensioning and tolerancing. Then, using this revelation, you can send the files back to the designer for clarification or revisions. 

Additionally, studying the drawing enables you to visualize the model. This way, you can better understand what the designer had in mind when coming up with the design. Sometimes, you can simplify the visualization process by relying on images of the CAD-drawn model of the part. CAD/CAM software makes visualization quite a breeze. 

In addition, studying the technical drawing enables you to locate the datum. A datum is a theoretically perfect axis or surface that is used as a reference. Datum ensures the exactness of measurements and machine operations. And given that there can be multiple datums in a drawing or CAD file, it is important to identify the primary datum, which is often used to start a machining job.

What’s more, studying the drawing allows you to check the number of parts, which can determine elements such as tooling. It also enables you to establish the material type, raw stock size, and how to avoid excessive stock allowances.

2. Understand Design Priorities and Functional Priorities

Design priorities tell you where to begin machining. On the other hand, functional priorities detail the order of importance of a part’s features. Together, they provide insights into how to position or hold the part for machining, the cuts to take first, and how to measure the results. 

3. Ensure the NC Code Comprehensively Captures all Operations

Typically, NC code is made up of commands that tell the machine what to do. These commands comprised words using six prefixes – G, M, F, T, S, and N – each representing a particular operation. G, for instance, represents motion words, F represents the feed rate, and M represents words that cause utility functions such as tool change and spindle on or off. Using some or all of these prefixes, you can ensure that your NC code captures all the operations. 

Fortunately, CAM software simplifies the code-writing process by generating the NC code. But these applications are not always perfect. For this reason, you should also be able to read the generated code to understand beforehand what the machine will do and make changes if need be. This brings us to the next crucial practice: optimizing the code. 

4. Optimize the Program

Inefficient programs are a leading contributor to manufacturing downtimes. Such programs may include unnecessary movements, e.g., traveling of the cutter without making contact with the workpiece, excessive tool changes, or moving parts between setups too many times. Of course, this increases the cost. This makes it extremely crucial to optimize the program for efficiency and safety. Some CAM software, such as MasterCAM, come with built-in editors that enable you to edit the G-code and even compare the new version with the old one. 

5. Create Clear, Detailed Instructions for CNC Operators 

Just as the programs should clearly and comprehensively outline what the machine should do, you should also prepare similarly detailed instructions for the CNC operator. Such instructions can take the form of remarks, which are notes embedded in the program. Additionally, notes found on the shop/technical drawings can guide the inspection and testing process. 

Collaboration between CAD Designers and CNC Machinists

A common thread that ties the above sections together is the needed collaboration between CAD designers and CNC machinists. Each can benefit from the other’s skill sets. For instance, machinists are conversant with the design for manufacturability (DFM) concept, which calls for the development and design of parts for efficient and cost-effective manufacture. However, they may lack the engineering knowledge to design robust products. Similarly, engineers may lack extensive machining knowledge.

Thus, engineers/CAD designers should consider machinists’ input during the product design phase. This is because the input will provide insights into how the design will impact the machining process and vice versa. Additionally, through collaboration, machinists will clearly communicate their shops’ capabilities. This collaborative approach ensures the designers do not come up with a design that is challenging to produce. Also, it clearly shows ways the design can be streamlined and modified to ensure it conforms to the DFM concept. 

Furthermore, the designers should make the machinists’ work easier by communicating more effectively. For example, they should deliver thoroughly annotated drawings, complete with detailed notes. Plus, they should ensure consistency in units of measurement. 

Conclusion

From the outset, machining is extremely expensive. Therefore, methods that bring down some of the costs are much appreciated. This is where preparing CAD files for CNC machining comes in. However, the making of the CAD files, i.e., the design phase, is foundationally crucial as it has a trickle-down effect. Thus, designers should embrace design for machining, which includes considerations such as strength and stiffness of the material, optimized tolerancing, standardizing features, and more. Afterward, the machinist should prepare the CAD files for machining by removing unwanted layers, choosing a machine and tool crib, undertaking element sequencing, running a simulation, and generating a program. Crucially, there are certain CNC best practices that machinists should follow. They should also collaborate with the designers for the best results possible. 

Note: Refer to this book for a comprehensive discussion of some of the sections herein, e.g., the history of CAD/CAM in CNC machining, the NC code prefixes, datums, and GD&T, discussed in this article; we have extensively used it as a reference.

scan2cad advert for free trial