The way a G-code program is formatted directly affects the productivity of the CNC people who use them. Design CNC programs that make CNC setup people and operators’ jobs easier.
#cnctechtalk
Most companies that use CNC use CAM systems to create G-code programs that run on their CNC machines. This provides countless advantages over preparing them manually. That said, most CAM systems deal only with the primary goal of creating a workable program that will machine acceptable workpieces. But the way a G-code program is formatted directly affects the productivity of CNC people who use them. A secondary goal for CNC programs must be to help CNC setup people and operators. Here are some operation-enhancing techniques that most CAM systems do not address — at least not without extensive customization.
Program header
Use messages at the beginning of your programs to provide information about the program.
Header information helps the operator confirm that they are running the correct program and, based upon the part’s revision number, that they are running the correct version of the program. They can tell whether the program has been run before and whether it is a proven program. And operators will know who to contact should there be issues during setup or the production run.
Document important commands
Use messages at the beginning of each tool to name the tool and provide component information for perishable items, such as inserts.
If you include program stop commands (M00) for any reason, like re-clamping the workpiece or applying tapping compound, be sure to include a documenting message explaining what the operator is supposed to do when the machine stops.
Provide stopping points and identify restart commands
It is commonly necessary to measure machined surfaces while running a cycle, especially when machining the first workpiece. With machines that use just one tool at a time, like machining centers and single spindle turning centers, providing the stopping point is as easy as including an optional stop (M01) at the end of every cutting tool. The operator can simply turn on the optional stop switch when they want the machine to stop after the cutting tool is finished.
With machines that run more than one tool at a time, like sub-spindle turning centers, providing stopping points will require you to consider the timing of each tool. Indeed, one cutting tool may have to wait for the other to finish before the stopping point can be specified. This requires more programming effort.
After the program has stopped and the surface is measured, an adjustment may be necessary. If it is, the cutting tool(s) must be re-run. Rerunning tools requires that all commands necessary to get the machine running, like spindle start and coolant on, are included at the beginning of each tool, even though they would not be required if the machine runs the entire program without being stopped.
Rerunning tools is simple with machines that can use just one tool at a time. Operators will search out the cutting tool’s first command and run the program from there. Still, you could use unique sequence numbers in each tool’s first command (like N10001 for tool one, N10002 for tool two and so on) to further simplify the task.
Programming to allow cutting tools to be rerun is more difficult for machines that can use more than one tool at a time. With FANUC CNCs, it requires the operator to search out each cutting tool’s first command in two programs. Providing unique restart sequence numbers is much more important.
Structure programs consistently
Ensuring that all programs are structured in the same manner will help setup people and operators get comfortable with the programs they run. Programs created by one programmer and/or one CAM system tend to naturally be consistent and require no further consideration. It can be more difficult to maintain a consistent program structure over a long period of time as more programmers get involved or as new CAM systems are purchased.
Additionally, certain CNC features can be programmed in multiple ways. Be especially concerned with those features that affect tasks that CNC people must perform. The tool path for cutter radius compensation, for instance, can be specified as the milling cutter’s centerline path or the work-surface path. With one method, the offset must be the milling cutter’s radial deviation from the planned cutter size. With the other, the offset will be the cutter’s radius. Pick the method that works best for you and stick with it.
Program offset entries
This is especially helpful with qualified workholding setups on machining centers. These are setups that can be replaced on the machine table in the same position over and over. Once program zero assignment values are determined, they will remain the same each time the setup is made. Including commands in the program that enter the related fixture offset values keeps the setup person from having to remeasure and reenter them every time the setup is made.
Program trial machining operations
Most CNC people are expected to recognize workpiece surfaces that require trial machining. If a CNC operator can recognize this need, so can you. You can dramatically simplify the trial machining process by programming related tasks, from modifying the offset, which allows extra stock to be left on the surface, to rerunning the cutting tool after the sizing adjustment has been made. Use the block-delete function to let the operator specify whether trial machining is required or not. Better yet, develop a custom macro to perform trial machining operations.
After 122 years of working with manual mills and lathes, this fifth-generation shop acquired assets of a local CNC machining business and hired the owner. Here’s how it’s going a year later.
Explore five crucial ways equipping 5-axis CNC machines with Air Turbine Spindles® can achieve the speeds necessary to overcome manufacturing challenges.
Take a look inside James Engineering, a high-end CNC Deburring OEM that became a job shop when they decided to produce their own parts in-house.