Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: angel tech on April 26, 2011, 07:38:32 AM

Title: tool offsets when writing your own gcode
Post by: angel tech on April 26, 2011, 07:38:32 AM
Ok, i'm just starting with tool offsets and i've got an 8 station tool changer. When i write gcode manually and have to make a tool change what do i have to put in to make the change and get mach to see the offset.

i can get the change done with m6txx but how do i get the offset to apply. Do i have to add g43 hxx before the m6txx.

If that works how do i get the second tool offset for tool 1 to work.?
Title: Re: tool offsets when writing your own gcode
Post by: Mishawaka on April 26, 2011, 02:33:27 PM
I don't have a multiple tool setup but you should be able to save offsets in the "Offset" tab in Mach. Then just call up the tool you need in the program code as usual.
Title: Re: tool offsets when writing your own gcode
Post by: derekbpcnc on April 26, 2011, 03:28:42 PM
Ok, i'm just starting with tool offsets and i've got an 8 station tool changer. When i write gcode manually and have to make a tool change what do i have to put in to make the change and get mach to see the offset.

i can get the change done with m6txx but how do i get the offset to apply. Do i have to add g43 hxx before the m6txx.

If that works how do i get the second tool offset for tool 1 to work.?


Hi,

Normaly I put:-

T1 M06
G43 H1

There was a bug in a previous version of mach that didn't like the tool change and apply offsets on the same block line.
You will need to set the tool length values in the tool table either manually or by using the settings page.

Not sure what you mean by "the second tool offset for tool 1 to work"
ATB
Derek
Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 26, 2011, 04:11:38 PM
Thanks Derek, i have the tool offsets stored and the g43 seems to work. The second tool offset is the multiple offsets on each tool position (m6 t0101) (m6 t0102), i take it you call them with the h1, h2, h3 ect.
Title: Re: tool offsets when writing your own gcode
Post by: derekbpcnc on April 26, 2011, 04:44:58 PM
Thanks Derek, i have the tool offsets stored and the g43 seems to work. The second tool offset is the multiple offsets on each tool position (m6 t0101) (m6 t0102), i take it you call them with the h1, h2, h3 ect.

Hi,

I think I see - you are using a lathe :-) I'm only the "milling department" so better hand you over to a lathe expert as i'd be more guessing than giving info based on experience.

As I understand though, each turret position can have multiple tools, so the T6 tool change calls the turret position then the tool and offset are then applied for the particular tool in use.

ATB
Derek

Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 26, 2011, 04:47:58 PM
No, i'm using a mill, it has an 8 station carousel. So i have 8 tool positions but i will have more than 8 tools the second 8 will have to be given the second offset, and the third set of eight ect.
Title: Re: tool offsets when writing your own gcode
Post by: BR549 on April 26, 2011, 06:19:44 PM
OK , IF you have an 8 tool  changer then you only have 8 slots available to use when running code.

To use the offsets the PROGRAMER must apply the offsets via Gcode  G43 applies the height correction and the G41/42 applies the inside and outside radius correction.

To use the tool change you must add the tool corrections to the tool table  tool1 will be slot1 tool2 will be toll slot 2 etc etc.

Once the tool table is up to date on all 8 slots then you tool change code and offset code can use these values for correction.

BUT you are the one responcible to add the correction via Gcode.

M6 T2              tool change for slot#2
G43 H2             appllies the height correction for slot#2
G1 Z0.000
G41                  applies the Radius correct for the current tool (tool#2)
G1 X1Y0            required leadin to comp the tool.
working code

Hope that helps,  I would suggest the Peter Smit book for more info.

(;-) TP


Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 27, 2011, 04:43:09 AM
ok, if i want to use a different set of eight tools in the carousel, i would call them as m6t1 to m6t8 for teh tool position and g43h9 to g43h16 for teh z offset to identify the offset.
Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 27, 2011, 04:53:07 AM
And g41 applies the stored tool diameter of the called g43hxx. To cancel this you call g40 before the next toolchange.?

Do you have to cancel the g43 before every toolchange, or does the next g43 override the previous one.
Title: Re: tool offsets when writing your own gcode
Post by: Mishawaka on April 27, 2011, 11:59:04 AM
G40 cancels all tool compensation. You will have to put the G41 and G43 for the next tool.
Title: Re: tool offsets when writing your own gcode
Post by: BluePinnacle on April 27, 2011, 04:09:31 PM
I thought it was g40 for tool radius offset cancellation and g49 to cancel the length offset. Or have I been wasting ink?
Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 27, 2011, 04:51:45 PM
I thought it was g40 for tool radius offset cancellation and g49 to cancel the length offset. Or have I been wasting ink?

I thought it was that way too.
Title: Re: tool offsets when writing your own gcode
Post by: Mishawaka on April 27, 2011, 05:06:36 PM
Sorry, your right about that G49. I thought G40 canceled all tool comp. as they never had us use a G49 in class. Next time I will check the cheat sheet.
Title: Re: tool offsets when writing your own gcode
Post by: ger21 on April 27, 2011, 05:28:33 PM
And g41 applies the stored tool diameter of the called g43hxx.

No.

G41 offsets by the radius of the current tool called with M6 Txx.

G41 Dx offsets by the radius of tool #x

G41 Px.xx offsets by radius x.xx

Call G40 to cancel the G41/G42 offset.
Title: Re: tool offsets when writing your own gcode
Post by: BR549 on April 27, 2011, 06:33:50 PM
How you use tool#s in you case will depend on HOW the person  wrote the code to run the tool changer, whether it is ladder logic in a plc and or VB macro in mach.

Remeber you have to write in a leadout on each comped move as well. Yes cancel the ToolComp Before you go to the tool change routine then reapply it after the tool change is complete.   IF NOT then strange things will happen as you come OUT of the tool change mode and mach tries to recomp the first position point.(;-)

(;-) TP
Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 27, 2011, 11:24:05 PM
the vb script for the toolchanger is an ongoing thing, and can be upgraded as problems occur. I thought the offsets would be called by the last two numbers on the m6 call. eg. M6T0101 with the red 01 as the offset, but it seems Mach doesn't see this.
Title: Re: tool offsets when writing your own gcode
Post by: BR549 on April 28, 2011, 10:09:40 PM
The M6T0101 is a tool change call for a lathe not a mill.

(;-) TP
Title: Re: tool offsets when writing your own gcode
Post by: derekbpcnc on April 29, 2011, 03:13:41 AM
The M6T0101 is a tool change call for a lathe not a mill.

(;-) TP

All the way back to post no.#4

The tool numbering stratergy will have to be well controlled if you use multiple tools with the same tool number but different offset numbers.
I dont think I would do it that way, as it's an accident waiting to happen, and for me I'd not have to wait long :-)

Maybe better set up the auto tool length measuring macro - at the start of your job, put in the tools for that particular job, let the machine measure the TLO's and then run the job.

ATB
Derek
Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 29, 2011, 05:15:21 AM
The M6T0101 is a tool change call for a lathe not a mill.

(;-) TP

Ah i see, i'd never have thought of that.

The more you get into gcode the more you notice the seperation between the lathe and mill.
Title: Re: tool offsets when writing your own gcode
Post by: angel tech on April 29, 2011, 05:19:52 AM
I noticed you went down the lathe route in that post, but with my limited knowledge it never occured to me it was based solely on the lathe...doh.

To avoid confusion all tools would have been numbered with tool number and offset number