top of page

Some G codes that have run their course

There are several G codes that are rarely used. Some are options, meaning you’ll have to pay extra to have a machine equipped with them. Others simply don’t apply to your application. And yet others are Fanuc’s “first attempt” at handling a problem or function. Other methods or G codes have been subsequently added that replace them. G codes in this third category will be the topic of this article.

Fanuc controls are – for the most part – backward compatible. This means that program written for older machines can be run in newer machines without modification. While it is unlikely that you’ll have any need for them, it may be helpful to understand why they were created and why they’ve been replaced. We’ll go through them in numerical order.

G22 and G23 – Interference zone check (G22 instates and G23 cancels). These G codes allow the programmer to set up a zone into which a cutting tool cannot move. While they are still active, over the years I haven’t seen very many CNC users that actually use them. It is quite

cumbersome to determine the values that set up the interference zone (specified within the G22 command) – and this zone must be determined for every program that is to be protected. For turning centers, this problem is further compounded by the fact that each tool requires its own G22 instating command. While these G codes have not been replaced by anything better, again, they are seldom helpful.

G27 – reference (zero return) position return check. This is a testing command to ensure that the machine is at the zero return position at the end of a motion. If G27 is included in a motion command that sends the machine to the zero return position, the machine will perform at test. If the axes included in the motion command including the G27 are at the zero return position, the related axis origin lights will come on and the machine will continue. If an axis is not at the zero return position, the machine will stop and go into alarm state. G27 was helpful on turning centers prior to when geometry offsets became popular for assigning program zero (over twenty years ago) – when G50 was used to assign program zero. G27 could help a programmer determine that the machine was where it was supposed to be and that wear offsets were appropriately canceled before the next tool’s G50 command was given.

G29 – return from reference (zero return position). G29 will cause a motion that moves through the intermediate position specified in the most recently executed zero return (G28 command). This can actually be dangerous, especially when cutting tools are not run in the same sequence in which the program is written – like when a cutting tool is re-run by itself after the program completed a cycle. Nothing has been developed to replace G29. In my opinion, it was never a very helpful G code.

G44 – tool length compensation minus. G43 has become the universal G code (among Fanuc controls) for tool length compensation. G44 works just like G43, except the polarity for the value specified in the tool length compensation offset register must be reversed. If, for instance, you use tool length compensation as I recommend (tool length is the offset value), you know that with G43, the offset value must be positive. If for some reason you wish to enter the offset value (again, the tool’s length) as a negative value, G44 would correctly instate tool length compensation.

  • G45 – G48 offset expansion and reduction. They are named as follows:

  • G45: offset expansion

  • G46: offset reduction

  • G47: offset double expansion

  • G48: offset double reduction

G45 was used for tool length compensation prior to G43 (about thirty years ago). The four of them were used together in Fanuc’s first attempt at cutter radius compensation – again, before G41 and G42. While there may be some times when you wish an axis motion to expand or contract by the amount of an offset (which G45 can accomplish), most CNC users have no need for these G codes.

G50/G92 – coordinate system setting. G50 is for turning centers – G92 is for machining centers. These G codes were required prior to geometry offsets on turning centers and fixture offsets on machining centers. They were quite cumbersome to use, requiring the machine to be in a specific position before a program could be run. If it was not, the most likely result would be a crash. Note that G50 is still used on turning centers to set a maximum spindle speed.

101 views0 comments

Recent Posts

See All

Tapping on a turning center (without canned cycles)

Unless your Fanuc controlled turning center came with live tooling, it’s likely that you don’t have canned cycles (G80-G89) like those you find on machining centers. You might have G74 and G75, the mu

Can you speed up your tool change time?

Machining centers, of course, have automatic tool changing devices to automate the tool changing process. Current models boast very fast tool changing times and you may be quite satisfied with tool ch


bottom of page