Mitsubishi Electric
Published

Consistency and Compatibility Improve CNC Productivity

Consistency and compatibility among CNC machines can decrease setup time and confusion among operators. 

Share

Consistency and compatibility among all a shop’s CNC machines can improve productivity. 

The degree of consistency among G-code programs will have an impact, be it positive or negative, on the productivity of CNC machines. This is true for the commands of the various tools within a program, of commands for multiple programs for a given type of machine and even among programs for different machine types.

Consistency ensures that setup people and operators can easily become familiar with programming methods. They will be able to detect mistakes when they spot inconsistencies in the programming structure. On the other hand, inconsistencies will cause confusion among CNC users. They will use additional time struggling to determine how the program operates. Worse, they may make mistakes if they do not understand what the program is doing. People that know what will happen in the program will be more productive than those that do not.

Here are the four kinds of structure that make up any multi-tool program, along with a consistency-related recommendation:

  1. Program startup structure: Begin every program for similar machines with the same commands. While the values for CNC words will change from program to program, the structure must remain the same.
  2. Tool startup structure: Begin every tool for every program with the same commands. Again, CNC word values will change, but keep the structure consistent.
  3. Tool ending structure: End every tool for every program with the same commands.
  4. Program ending structure: End every program for a given machine with the same commands.

CAM systems are notorious for breaking these rules. While all the needed words and commands are included in the program, they tend to be in a randomized order. Most CAM systems do allow users to customize G-code output, but many ignore this important system-setup task. They stop working on G-code output as soon as the CAM system is generating workable programs. Again, the more consistent the structure, the easier it will be for CNC users.

Compatibility also impacts productivity. With similar machines provided by different machine builders, there are likely to be minor differences in programming commands for similar functions. And when running the same parts on these similar machines, operators must maintain a separate — though very similar — program for each machine. Finding a way to run the same program — without modification — on all similar machines will dramatically reduce the number of programs required to run parts. This, in turn, will eliminate the amount of time required to create and maintain them.

Often, major differences in programming commands for similar machines are related to M-code numbering. One turning center, for instance, may use M41 for low-spindle-range selection and M42 to select the high range. Another may instead use M23 and M25. If M-code numbering is the only difference among machines, this issue is easily overcome for FANUC CNCs with user-defined M codes, which make it possible to run the same program in the two similar machines.

I do not describe the process in detail here but, in essence, users should set parameters in such a way that, when the CNC sees a given M code (like M41), it will execute a program that performs another (like M23). In this way, it is possible to change the machine that uses M23 for low-range selection to run a program that includes an M41.

Other programming differences may be related to command structure and may be more difficult, though not impossible, to deal with. One machine may require circular commands to be specified with directional vectors (I, J and K) while another may allow them to be specified with an R word. One machine may have standard fixture offset specification (requiring G54-G59) while another may have the extended fixture offset option (requiring a G54.1 and a P word to specify the offset number).

Again, I do not provide the details here. In general, use Custom Macro to set up a machine flag with a permanent common variable that the program will key on to determine which machine is running the program. Logic within the program or, better yet, in a separate Custom Macro program, will determine, based on the machine flag, which machine is being run and execute the appropriate command(s).

Here are the commands related to fixture offsets mentioned above. We key on permanent common variable #510 to determine which machine is being run. If #510 is set to 1.0, it is machine A (G54). If #510 is set to 2.0, it is machine B (G54.1 P1).

  • .
  • IF[#510 EQ 1.0] GOTO 10 (Machine A)
  • G54.1 P1 (Machine B)
  • GOTO 15 (Skip the other possibility)
  • N10 G54
  • N15…
  • .

Again, it may be better to include these commands in a separate program, possibly a user-defined G-code program called by G54, to keep from having them in the machining (main) program.

In this manner and with a little ingenuity, it is possible to overcome almost any programming deviation among machines. The greater the number of machines and programs involved, the more one can reduce the number of programs that must be maintained.

Mitsubishi Electric
Gravotech
The Automated Shop Conference
JTEKT
Paperless Parts
High Accuracy Linear Encoders
Discover a variety of the best CNC machines
VERISURF
Hurco
Techspex
OASIS Inspection Systems
Formnext Chicago on April 8-10, 2025.

Related Content

CAD/CAM

Can ChatGPT Create Usable G-Code Programs?

Since its debut in late 2022, ChatGPT has been used in many situations, from writing stories to writing code, including G-code. But is it useful to shops? We asked a CAM expert for his thoughts.

Read More

5 Reasons Why Machine Shop Ownership Is Changing

Mergers, acquisitions and other ownership changes are an effect of Boomer-age shop owners retiring, but only in part. Also important: The way we think about machining has changed.    

Read More

Tips for Designing CNC Programs That Help Operators

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.

Read More
Basics

7 CNC Parameters You Should Know

Parameters tell the CNC every little detail about the specific machine tool being used, and how all CNC features and functions are to be utilized.

Read More

Read Next

Micromachining

A History of Precision: The Invention and Evolution of Swiss-Style Machining

In the late 1800s, a new technology — Swiss-type machines — emerged to serve Switzerland’s growing watchmaking industry. Today, Swiss-machined parts are ubiquitous, and there’s a good reason for that: No other machining technology can produce tiny, complex components more efficiently or at higher quality.

Read More

Encountering Surface Finishes in the Everyday World

Surface measurement is becoming increasingly important to ensure proper performance of a manufactured product. Advanced surface measurement tools are not only beneficial in the manufacturing industry but also have unconventional applications.

Read More
Basics

Obscure CNC Features That Can Help (or Hurt) You

You cannot begin to take advantage of an available feature if you do not know it exists. Conversely, you will not know how to avoid CNC features that may be detrimental to your process.

Read More
Mitsubishi Electric