Okuma
Updated Published

Five Areas of CNC Machining to Simplify With G Code

Optimizing G code to make CNC setup and operation simpler is a great way to improve CNC productivity and sometimes prevent errors.

Share

CNC programmer
Photo Credit: Getty Images

Simple tasks can be performed faster than complex tasks — and with less potential for making time-wasting mistakes. This includes tasks required to run CNC machines. Simplify the complex tasks that setup people and operators perform and, in turn, CNC productivity improves. Conversely, if people are required to perform complicated tasks, productivity will likely suffer. This is especially disconcerting if there is something that could be done to simplify the complex task.

There are countless things that can be done within G-code programs to simplify things for a setup person or operator. Indeed, when a CNC user is struggling with a task, it should be taken as a signal that something can probably be done to help. I offer a few suggestions in five disciplines here, but my primary intention is to inspire some aggressive awareness. Instead of waiting to see someone struggling, actively seek out tasks that could be simplified and dig in.

Documentation

All CNCs allow users to document messages in the program and most use parentheses to delineate them. CNC users commonly waste time trying to understand what is happening in a program when a clarifying message would have quickly answered questions.

Here are a few suggestions:

  • Always start a program with a series of messages that tell users what the program does. Include information like part and revision number, operation number and name, programmer name, date created and run time.
  • Provide tool names at the beginning of each tool, including the perishable component (insert) number.
  • Specify what the tool should have done (include surfaces to measure) at the end of the tool.

Program Zero Assignment

If your machining center workholding setups are qualified, include G10 data-setting commands at the beginning of the program to enter the program zero assignment values into fixture offsets. This will keep the setup person from having to reenter them every time the job is run.

If setups are not qualified, be sure to make it as easy as possible to perform the task of program zero assignment. The best way to do so is to have setup people use spindle probes that measure and enter the program zero assignment values. But if a machine does not have a spindle probe, know that anything done with a spindle probe can also be done with a conductivity-type edge finder. The only difference is that the setup person will have to manually move the edge finder into contact with each program zero surface. The G-code program will do everything else, including positioning the edge finder, determining program zero assignment values and entering them into fixture offsets.

Cutting Tools

With machining centers, if tool lengths are assembled and measured off-line, be sure to have the tool length measuring device create a G-code program including G10 commands that specify tool lengths. The setup person will load this program and run it once to enter all offsets. This will eliminate the time-consuming and error-prone task of entering offsets through the keyboard.

With turning centers, eliminate the setup task of entering tool nose radius compensation offsets. Manual programmers that include G41/G42 in their programs can use G10 commands to enter the related offset values. Those using a CAM system should make sure it generates tool paths based on the tool nose radius intended for use in setup.

Trial Machining

For machines that allow cutting tools to be rerun, like machining centers and fixed headstock turning centers, setup people know they must test cut surfaces with small tolerances. This involves adjusting the tool’s offset, letting the tool cut, measuring the surface, adjusting the offset and rerunning the tool.

Knowing a surface must be trial machined, users can include a test cutting command in the program using the block delete function (/). If block delete is off, the machine will test cut. If on, it will not. Include block deleted commands that initially set the trial machining offset, machine enough of the surface for a measurement, move to a convenient measuring position and stop (M00).  At this point, the setup person measures the surface, adjusts the offset and restarts the cycle.

Completing the Production Run

One production run task that can benefit from help from the G-code program is making sizing adjustments (though there are surely others).

  • For long-running jobs and especially for bar-fed lathes, users can program the sizing adjustments after observing how the cutting tools behave as they wear. Set up a counter that counts the number of parts that can be run before an adjustment is required. Use G10 to increase/decrease the offset and keep counting. The counter can also track how many parts can be machined until the tool is dull and stop the machine.
  • Eliminate the need for an operator to use a calculator to determine how much to adjust the sizing offset. Instead, let the operator enter the measured value (in a special offset or a permanent common variable). The G-code program can determine the amount of deviation and modify the tool’s offset accordingly.
YCM Alliance
Okuma
MMS Top Shops
Hurco
Gravotech
DN Solutions
World Machine Tool Survey
To any Measurement Question there is an Answer
Gardner Business Intelligence
The view from my shop.
Kennametal
VERISURF

Related Content

SPONSORED

How to Reduce Cycle Times by 70% and More on Your Existing CNCs and Dramatically Improve Tool Life Too

By employing advanced high efficiency milling techniques for the entire machining routine, SolidCAM’s iMachining technology can drastically reduce cycle times while vastly improving tool life compared to traditional milling.

Read More
Basics

8 Ways to Increase Productivity on the Manufacturing Floor

When it comes to machine shop productivity, continuous improvement depends on efficient employees, equipment and processes. 

Read More
Basics

Understanding G27, G28, G29 and G30

Take a closer look at these reference position commands.

Read More
Basics

Selecting The Right Welder

Many machine shops, on occasion, have a need for welding. It may be for maintenance purposes, repair or to fill the odd contract. This story is a welding process primer for those shops whose main business isn't welding but need to know some basics.

Read More

Read Next

3 Mistakes That Cause CNC Programs to Fail

Despite enhancements to manufacturing technology, there are still issues today that can cause programs to fail. These failures can cause lost time, scrapped parts, damaged machines and even injured operators.

Read More
Large Part Machining

The Cut Scene: The Finer Details of Large-Format Machining

Small details and features can have an outsized impact on large parts, such as Barbco’s collapsible utility drill head.

Read More
YCM Alliance