Multi-axis machining with Fusion
Published

Improving Program Compatibility Among Your CNCs

Put in the effort to eliminate machine-specific programming methods.

Share

Maintaining multiple, nearly identical CNC programs for the various machine tools your company owns is cumbersome and error-prone. Consider the delays/mishaps that occur when an operator uses the wrong program. While it requires effort, if you eliminate machine-specific programming methods, you will need but one program per workpiece regardless of how many machine tools can be used to produce it.

Some programming variations relate to CNC model differences. For example, Okuma CNCs require a G15 to specify work coordinate system setting and a G56 to specify tool-length compensation, whereas FANUC CNCs require a G54-G59 (or G54.1) to specify work coordinate system setting and a G43 to specify tool-length compensation.

Other variations relate to the machine tool builder’s selection of M codes. One turning center builder, for instance, uses M41 and M42 to specify low and high spindle ranges while another uses M23 and M25.

Most program syntax variations can be handled with relative ease (if FANUC CNCs are involved) with user-defined G and M codes. That is, you can cause a FANUC CNC to accept syntax from other CNCs/machines.

For example, you can easily create a user-defined G code for Okuma’s G15 on a FANUC CNC. After doing so, the FANUC CNC will execute the appropriate G54-G59 word whenever a G15 command is specified in the program. The format for Okuma’s G15 is:

  • G15 H01 (Invoke coordinate system number one)

First, set one of the parameters related to user-defined G codes on the FANUC CNC. These parameter numbers vary among FANUC models. For a FANUC 30i-series CNC, the first available user-defined G code is set by parameter number 6010. If this parameter is set to a value of 15, the CNC will execute program number O9010 whenever a G15 is executed. The value of H (the offset number) will be placed in local variable #11. Assuming the FANUC CNC uses G54-G59 (it does not have the expanded workpiece coordinate system option), here is an example of how program O9010 could be written:

  • O9010 (User-defined G15 program)
  • IF [#11 NE 1] GOTO 2
  • G54
  • GOTO 99
  • N2 IF [#11 NE 2] GOTO 3
  • G55
  • GOTO 99
  • N3 IF [#11 EQ 3] GOTO 4
  • G56
  • GOTO 99
  • N4 IF [#11 EQ 4] GOTO 5
  • G57
  • GOTO 99
  • N5 IF [#11 EQ 5] GOTO 6
  • G58
  • GOTO 99
  • N6 IF [#11 EQ 6] GOTO 98
  • G59
  • GOTO 99
  • N98 #3000 = 100(H-WORD OUT OF RANGE)
  • N99 M99

If the FANUC CNC has the expanded work coordinate system option (G54.1), program O9010 will be simpler.

  • O9010 (User-defined G15 program using G54.1)
  • IF [#11 LT 1] OR [#11 GT 48] THEN GOTO 98 (Test that offset number is appropriate)
  • G54.1 H#11 (Specify workpiece coordinate system setting command)
  • GOTO 99
  • N98 #3001 = 101(OFFSET NUMBER OUT OF RANGE)
  • N99 M99

Similar techniques are used with user-defined M codes. For the turning center spindle-range issue, you could cause the machine that uses M23/M25 to accept M41/M42 commands. First, set the appropriate parameters. For a 30i series FANUC CNC, the first available user-defined M-code parameter is parameter number 6071. If this parameter is set to a value of 41, the CNC will execute program O9001 whenever an M41 is seen in the program. If parameter 6072 is set to a value of 42, the CNC will execute program O9002 when M42 is seen.

  • O9001 (M41 program)
  • M23 (Execute the low-range M code)
  • M99
  • O9002 (M42 program)
  • M25 (Execute the high-range M code
  • M99

Other programming variations are related to programmer discretion. With machining center cutter-radius compensation, for instance, some programmers specify coordinates based on the work-surface path while others specify coordinates based on cutter centerline path. With the first method, the operator enters the cutter’s radius in the cutter comp offset. With the second method, he or she enters the radial deviation from the planned cutter size and the size of the cutter being used. When faced with this kind of variation, pick the method that works best for the application and stick with it for all programs.

Still other programming variations are related to machine repair issues. One machine may have a faulty check-valve in the coolant system that requires a programmed dwell to allow time for coolant to flow at full strength, or a turning center may have a misaligned headstock that requires the programming of taper movements to ensure that straight surfaces are machined. In these cases, proper machine tool maintenance is required so no special programming considerations are necessary to deal with maintenance issues.

One last programming variation is related to machine tool kinematics and is especially important for four- and five-axis machine tools. Traditionally, G-code programs for these machines specify axis movement for positioning the tool tip (X, Y, Z, A and B, for instance). With this method, programs will be specific to a given machine, and elaborate postprocessors are required to generate the required motion commands. Additionally, resulting motions tend to cause scalloping on finished surfaces.

With modern CNCs, it is possible to program all motions from workpiece coordinates that match your CAM system’s cutter location data. Compensations within each machining center, like G54.4 workpiece setting error compensation and tool center-point (TCP) control, deal with kinematic differences among machine tools. This means postprocessors will be much simpler, programs will be more universal and machined surfaces will be smoother.

ProShop
HCL CAMworks
Surface finishing in Fusion
SmartCAM
The Automated Shop Conference
World Machine Tool Survey
An ad for Formnext Chicago on April 8-10, 2025.
EZ Access - Have it all with Ez - Mazak
IMTS 2024
DNS Financial Services America
SolidCAM
BIMU 2024

Related Content

When Handing Down the Family Machine Shop is as Complex as a Swiss-Turned Part

The transition into Swiss-type machining at Deking Screw Products required more than just a shift in production operations. It required a new mindset and a new way of running the family-owned business. Hardest of all, it required that one generation let go, and allow a new one to step in.

Read More

Generating a Digital Twin in the CNC

New control technology captures critical data about a machining process and uses it to create a 3D graphical representation of the finished workpiece. This new type of digital twin helps relate machining results to machine performance, leading to better decisions on the shop floor.

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

6 Machine Shop Essentials to Stay Competitive

If you want to streamline production and be competitive in the industry, you will need far more than a standard three-axis CNC mill or two-axis CNC lathe and a few measuring tools.

Read More

Read Next

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

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
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
ProShop