What's new
What's new

G code to increment a work offset?

Azoth

Aluminum
Joined
May 10, 2019
Location
Houston, TX
On a Mazak Nexus 700D-II VMC using eia, The programmer has the X0. on the wrong side of the part (the free tolerance side instead of the datum side).

The programmer's programs are never to print and will create scrap parts or break tools, so I can't just ask him to set the other face as X0. and repost the code because I'm not using his program, I'm using an extremely modified version of his program that corrects his mistakes, uses different tools, has the previous (recently retired) operator's notes, etc.

I have a renishaw probe. The probe is able to modify work offsets so there must be some way to edit a work offset in g code.

I want to probe the correct (Datum) face and have the g-code automatically shift the new work offset by X-2.5

So far I've only found G52 which is modal, but I want to directly modify the G54 coordinate like the Renishaw probe does.

Does anyone know how to do this?
 
Last edited:
If your machine has the Renishaw GoProbe cycle installed. (9901)

T30M6 (PROBE)
G17G20G40G49G54G80G90G98

G0X3.Y-0.5
G43Z0.5H30
G65P9901M1.C0.A-1.X3.Y-0.5Z-0.35 I0.S54.
G53Z0.
M30

I0. Is telling the Macro to update the measured surface as X0. Even though the current G54 X position is at X2.5. The XYZ coordinates are your measurement start position. Adjust to suit your part and setup.

In the manual it says I= the Position of the feature in X relative to the Active Work Coordinate System. If I was I 2.5, the probe cycle would would only change G54X by whatever small amount it happened to be off from nominal or assumed position. I0 makes the measured position your new home in X.
 
Last edited:
On my Doosans, HAAS and DMC Lathes ive run if you get one offset in G54 you can add a different offset to G55, G56 and so on. The HAAS has its own control but is basically a FANUC.
Yes this has those. I'm trying to edit one of those using g code. So with the part in the 4th axis chuck, instead of touching off the front face and manually adjusting for part variance (if a part is 2.503, I'd have to shift it X+.003 and every part could be different off the lathe) I'd rather touch off the back face and shift the nominal X-2.500 and the part variance/unparallelism on the front can be ignored.
 
Last edited:
If your machine has the Renishaw GoProbe cycle installed. (9901)

T30M6 (PROBE)
G17G20G40G49G54G80G90G98

G0X3.Y-0.5
G43Z0.5H30
G65P9901M1.C0.X3.Y-0.5Z-0.35 I0.S54.
G53Z0.
M30

I0. Is telling the Macro to update the measured surface as X0. Even though the current G54 X position is at X2.5. The XYZ coordinates are your measurement start position. Adjust to suit your part and setup.

In the manual it says I= the Position of the feature in X relative to the Active Work Coordinate System. If I was I 2.5, the probe cycle would would only change G54X by whatever small amount it happened to be off from nominal or assumed position. I0 makes the measured position your new home in X.
right before my shift ended today I disabled the 9000 program display protect parameter and was tracing through the macros trying to find out how renishaw did it.

I don't remember if it has that one but I'll check tomorrow.
 
Last edited:
Work coordinates are stored in macro variables. You can either edit the macros directly or use G10. Some people prefer using macros. I prefer G10 because I find it easier to catch typos.

Important: when experimenting, take a picture of all your existing work and tool length offsets first, so if you accidentally overwrite something, you can manually set it back.

The following code (on machines that will take G10) will set G54 to X0 Y0 Z0.

Code:
G90 G10 L2 P1 X0 Y0 Z0

G90 - absolute coordinates
L2 - work coordinates
P1 - G54 (you can also use P2 for G55, P3 for G56, and so on)

If you were modify G54 directly via macros, it would look something like this:

Code:
#5221 = 0 (G54 X);
#5222 = 0 (G54 Y);
#5223 = 0 (G54 Z);

Back to G10. It also works in G91 incremental mode.

The following code will add +1.0 to the existing X value of G55.

Code:
G91 G10 L2 P2 X1.

You can do other things with G10 too.

Want to dynamically change a tool length offset? Use L10. The following code will change the tool length offset (i.e. H value) of T31 to 12.0:

Code:
G90 G10 L10 P31 R12.

If you use L11, it'll write into the length wear offset rather than the length geometry offset.

Don't be confused by the R parameter. It's not changing the radius/diameter offset (that's done with L12/L13).
 
Last edited:
Belonging to group 0, it is non-modal.
Of course, it remains active till cancelled.
Oh, guess I got those mixed up. I meant I didn't want to call up G52 every time the program calls G55 (every tool change).

...Back to G10. It also works in G91 incremental mode.

The following code will add +1.0 to the existing X value of G55.

Code:
G91 G10 L2 P2 X1.
That's what I was looking for, thank you.
So if I want to use G58, now I can just probe
Code:
G65 P9023 A6 S5
G91 G10 L2 P5 X-2.5
and not have to manually increment 2.5 or compensate for variance from the lathe
 
Last edited:
If X0 is the right side aren’t all the X in the program negative? Won’t you just cut air off to the left side of the stock?

Put your stop on the left like you want. Pick up the left edge and adjust the G54 X by 2.5. Any extra stock will still be hanging off the right side but won’t affect the locations.
 








 
Back
Top