Dealing with those kinds of situations is what work offsets were made for.

How Are Work Offsets Specified in G-Code?

Basic work offsets are very simple to specify: simply enter one of G54, G55, G56, G57, G58, or G59. Most machine startup with G54 selected. It’s a good practice to put a G54 into the safety line at the top of all of your g-code programs to make sure you know what work offset is being used unless you have reason to want to leave that aside.

When you execute the work offset g-code, the XYZ offset will be added to all of your coordinates from that point forward. Let’s return to our 4 vise setup. You might want to set 4 work offsets to be the coordinates of the left rear vise jaw corner of each vise. You want to choose the non-moving jaw because that one’s position is more accurate. Use and edge finder or probe to locate the position of that vise jaw corner and then set that work offset based on the way your machine controller sets up offsets. Once you have G54 through G57 set to the four vise jaw positions, you’re ready to go.

You could issue a work offset manually based on which vise you stick the workpiece in, but it’s more productive to do it right in the g-code. The overall scheme looks like this:

G54

( Code for part in first vise )

G55

( Code for part in second vise )

G56

( Code for part in third vise )

G57

( Code for part in fourth vise )

For now, you’ll probably just cut and paste copies of the code. Assuming your control supports them, once you learn to use subprograms, you can keep one copy of the part code, and call it as a subprogram from each work offset block. By way of example, here’s how a subprogram setup might look to make 4 identical parts with work offsets:

G54

( Call the part subprogram )

M98 P2000

G55

( Call the part subprogram )

M98 P2000

G56

( Call the part subprogram )

M98 P2000

G57

( Call the part subprogram )

M98 P2000

M30 (Stop the program )

O2000 (Part Subprogram)

( g-code to make a part )

M99 (Return to Main program)

As you can see, subprograms can make it very slick and easy for you to make a lot of identical parts.

Is Manual Machining Faster than CNC for Simple Parts?

Extending the Number of Work Offsets

With G54 to G59, you have 6 work offsets. That’s pretty helpful, but what if you have even more parts to be made. There might be room for dozens of small parts on a big fixture plate for a machine with long travels.

Over the years, the makers of CNC Controllers have come up with several ways to extend the syntax to allow a lot more work offsets. One common approach is to use “G54.1 Pxxx” where the “xxx” is a number. Typical ranges for the number are 1.48 or 1.300. You’ll want to look up the specifics in your machine’s programming manual. To use work offset #45, you’d simply issue the following g-code:

G54.1 P45 ( Use Work Offset #45 ) Eso event.

Some controls allow the “.1” to be omitted, so you could write “G54 P45”.

Using this new syntax, you get the original 6 work offsets plus however many more are available.

Extra Offsets for Haas Machines

Haas allows G110.G129 to reference offsets just as G54.1 Px does.

Setting Up G-Wizard Editor’s Work Offsets
GW Editor offers a number of Work Offset options that may be customized in the Post. Reading over them will give you a good overview of how the many g-code dialects handle work offsets.
War thunder air. Here are the relevant post variables:
Offsets.G54toG59Offsets
Set this checkbox if your controller allows G53.G59.
Ar 234 war thunder. Offsets.G54Mach3Offsets
Mach3 allows the syntax G59 P1.P255 for an additional 255 offsets.

Offsets.Okuma

Okuma controls use G15 H0.H50 for their work offset syntax.

Offsets.OkumaOneShot

These work offsets are used once and then the system goes back to the prior offset that was used. The syntax is G16 H0.H50 for a one shot work offset.

Offsets.Plus300Offsets and Offsets.Plus48Offsets

As mentioned G54.1 Pxx is a popular syntax for more offsets. xx may range from 1.300 or 1.48. You can also set the Haas G110.G1xx offsets on the 1.48 tab where they are called out.

Offsets.G110HaasOffsets

Haas allows G110.G129 to provide additional work offsets beyond the basic 6.

Offsets.G154HaasOffsets

In addition Haas allows the syntax “G154 Pxxx” where “xxx” is number from 1.99.

More G-Wizard Editor Tools for Work Offsets

The whole purpose of G-Wizard Editor is to make all this g-code programming easier, right? Well, here’s what we’ve added to make using work offsets easier:

War Thunder G56 Repair Cost

Work Offset Hints
The Hints feature in G-Wizard Editor tells you what a line (what’s officially called a “block”) of g-code does in plain English. It’s really handy when learning g-code, but it tells you all sorts of things that just aren’t in the g-code even if you know how to read it already. For example, on an arc, it calls out the arc center as well as a bunch of other information. In this latest release, when a new work offset is put in place, it tells you the XYZ coordinates of the Work Offset. Something like this:
This gcode sets several work coordinates as part of a loop and each of them is recorded in the hint…
That hint is particularly nifty because the workoffsets are being set as #variables. The line G#100 executes a gcode based on the value of variable #100. In this case, the value goes from 54 to 59, so we set all the work offsets from G54 to G59. You get to see the Work Offset XYZ coordinates for each value of the variable below. That can be really helpful in a sophisticated gcode like this one in helping understand what’s going on.
Work Offset Spreadsheets
Here’s on more goodie if you work with #variables a lot. GWE stores those variables in spreadsheet CSV files. This means you can open up the file to see all the variables laid out at once. You could even substitute a file to set up for different jobs. To find these files, go to the Setup Files tab. All the setup files are called Preferences files and that tab tells you the directory where they are kept.

G92: A Programmable Temporary Work Offset

Suppose you want a programmable temporary work offset. There are a lot of ways to accomplish this, but one that is tried and true is to use G92. G92 establishes a work offset based on the offset coordinates you provide. So, if that vise jaw corner we’ve talked about is located from the current tool position at offset X10Y10Z0, you could execute the following:

G92 X10Y10Z0

Now the coordinates of the vise corner are X0Y0Z0. You’ve just established your own work offset using G92.

Let’s consider another example where a G92 or one of the other ways of programming a work offset might be handy. Let’s suppose you have a fixture plate that has a grid of parts on it. You know in advance that the parts are 4 across and 2 down, so there will be 8 parts. The plate is made so that the X and Y distance between each part is constant (within tolerances of course). So, the parts are maybe 5 inches apart in X and 5 inches in Y.

Since G92 is an offset from the current tool position, we move the tool to part zero on the first part at the beginning of the g-code program. We can then use G92 to add offsets relative to that position, 5 inches in X and 5 inches in Y for each part as we step through them. Pretty handy, huh?

War Thunder G56

Thunder

Note that G92 is available on mills and some lathes, but most lathes use G50 for this function.

G52: Offset the Offsets

Given the number of features associated with offsets on CNC machines, it must be obvious how handy they can be. So much so that there are a lot of different ways to achieve similar results. Suppose you’ve set up work offsets for each part on the table. Now further suppose each part has some identical features located at different points on the part. You could use even more work offsets to identify those identical features so you can use the same g-code to machine them, or you could use G52 to create a temporary offset on the offset. That might look like this:

G54 (Select the work offset for the part)

G52 X10Y10 ( Select an offset from part zero for the first feature. That feature is now at part zero after G52. )

(Machine feature)

G52 X20 (select another offset from part zero for the second identical feature)

G52 X0Y0 (Turn off the G52 offset so things are back to “normal”)

I’ll bet you can see where G52 would come in handy right away, right?

War Thunder G56 Op

G10 is a handy g-code that lets you program the G54 style work offsets from within your g-code. The typical syntax would be:

G10 L2 Poo Xxx Yyy Zzz

Where “oo” is the work offset number, “xx” is the X offset, “yy” is the Y offset, and “zz” is the Z offset.

Tip:

If you have an older control that doesn’t have very many work offsets, you can use G10 to reuse the available work offsets with different coordinates.

War Thunder G56 Skin

Work Offsets and Macro Variables
On machines that allow parameterized programming, there are usually also macro variables that correspond to each coordinate of each work offset. On Fanuc, for example, the following variables are used for G54:
#5221 G54 X Offset
#5222 G54 Y Offset
#5223 G54 Z Offset
#5224 G54 Fourth Axis Offset
You can access these variables to see what the values are or to change them.

Stop Using Work Offsets Entirely With G53.

To stop using the work offsets, use G53. This forces the machine to use the machine zero coordinates with no offset whatsoever as part zero. This is not done very commonly, but it is possible to do so.

Conclusion
Now you know how to use Work Offsets, which make it easy to set up for making multiple parts or quickly accomodating multiple fixtures on your machines.
Thunder

Exercises

1. Set up GW Editor to use your controller’s work offset syntax.

2. Write a g-code program that uses multiple work offsets to create multiple identical parts. Set the values of the work offsets in G-Wizard Editor by changing the #variable values for the offsets so you can see all the parts on the backplot.

No credit card required–just your name and email.

Next Article:Helical Interpolation: Making holes bigger than any cutter you’ve got
2.5/5(6 votes )