Hello Guest it is August 07, 2020, 12:36:04 AM

Author Topic: Changing Offset With G-code  (Read 4029 times)

0 Members and 1 Guest are viewing this topic.

Changing Offset With G-code
« on: September 27, 2011, 09:58:18 PM »
I frequently do things in a sequence that would make it desirable to change work offsets on-the-fly.  For example, I might face-mill the entire top surface of a piece of stock, before machining in all the features.  It would be convenient to reset the Z zero to the "new" top of part, after doing the facemilling.  I am doing that now, using the sequence:

G91
G10 L2 P1 Z-0.025 (Assuming I faced 0.025" off...)
G90
...  (Other operations here)
G91
G10 L2 P1 Z0.025 (Restore original offset)
G90
M30

Is this the right way to do this?  Is there a better way?

BTW - Got a full enclosure, and flood coolant going on my knee mill!  Woo-Hoo!

Regards,
Ray L.
Regards,
Ray L.

Offline Graham Waterworth

*
  • *
  •  2,113 2,113
  • Yorkshire Dales, England
    • View Profile
Re: Changing Offset With G-code
« Reply #1 on: September 27, 2011, 10:21:36 PM »
normally the finished face of the part is Z0 and any stock is allowed for in the set up of the Z datum. E.g. touch on with datum tool zero out Z then adjust Z datum by the stock amount to be removed.  This way any following tools can be set from the top face.  Or if working with standard tools with known tool lengths they can just be put in and used without needing to set new offsets.

Graham
Without engineers the world stops

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: Changing Offset With G-code
« Reply #2 on: September 27, 2011, 10:56:27 PM »
Ray that is as good as it gets. You could use the G52 but stay away from the G92 it is the evel  stepchild (;-) Even the G52 can catch you sleeping when it tries to unwind the offset.

(;-) TP
Re: Changing Offset With G-code
« Reply #3 on: September 28, 2011, 12:08:09 AM »
normally the finished face of the part is Z0 and any stock is allowed for in the set up of the Z datum. E.g. touch on with datum tool zero out Z then adjust Z datum by the stock amount to be removed.  This way any following tools can be set from the top face.  Or if working with standard tools with known tool lengths they can just be put in and used without needing to set new offsets.

Graham


Graham,

I would normally do that, but sometimes the facing operation comes in the middle of the program, not the beginning.

Regards,
Ray L.
Regards,
Ray L.

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: Changing Offset With G-code
« Reply #4 on: September 28, 2011, 10:08:14 AM »
RUT ROW, Ray that is a different story now. Changing the offsets in the MIDDLE of the program.  THAT will make keeping track of where you are a lot harder. ND make it a lot easier to crash the machine if you forget where you are OR forget what comp you have active.

 Normally all your work would be done from one datum point(origin). (simple part)

The only reason I could see for that is IF you are running your knee as the tool comp for really long tooling. Then it would make sense to use it as a knee mill is NOT blessed with a lot of Z travel for long tool comp. EVEN then I would just use a Fixture Change G54-G55 to a setpoint then when you need to return just G55-G54.


BUt as always your mileage may vary, (;-) TP
« Last Edit: September 28, 2011, 10:10:50 AM by BR549 »

Offline BR549

*
  •  6,932 6,932
    • View Profile
Re: Changing Offset With G-code
« Reply #5 on: September 28, 2011, 11:43:07 AM »
RAY Sense you brought up the subject(;-) You will FIND that ONE of the FAILINGS with the MACH3 G10 code IS it will NOT allow you to use a #var in the P parameter call. It requires an Integer between 1-255. 

Sounds OK unitll you need to set the G10 in a Gcode program. THEN  "YOU" have to know what offset you are in OR run the risk of messing up big time.

IF the P call allowed a #var to be used then you could easily use

G91 G10 L2 P#5020 Z#101
G90

The #5020 references the CURRENT fixture Number

Just a thought, (;-)TP
Re: Changing Offset With G-code
« Reply #6 on: September 28, 2011, 12:29:52 PM »
RUT ROW, Ray that is a different story now. Changing the offsets in the MIDDLE of the program.  THAT will make keeping track of where you are a lot harder. ND make it a lot easier to crash the machine if you forget where you are OR forget what comp you have active.

 Normally all your work would be done from one datum point(origin). (simple part)

The only reason I could see for that is IF you are running your knee as the tool comp for really long tooling. Then it would make sense to use it as a knee mill is NOT blessed with a lot of Z travel for long tool comp. EVEN then I would just use a Fixture Change G54-G55 to a setpoint then when you need to return just G55-G54.


BUt as always your mileage may vary, (;-) TP

Terry,

I AM using the knee for tool comp.  I realize if I interrupt the program, I have to be careful about *which* zero I'm at, but that doesn't concern me too much, since I always start by touching off on the part anyway.  The only time I'd interrupt a program is if something has gone wrong, in which case, all bets are off anyway, so this, at worst, is a very minor additional inconvenience.

Yes, it would be nice if G10 allowed vars.  Then I would do exactly what you suggest.
Regards,
Ray L.