Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Erichtg on January 20, 2008, 08:35:35 PM

Title: G43 BREAKING TOOLS
Post by: Erichtg on January 20, 2008, 08:35:35 PM
I found this topic investigating some unexpected G43 behavior after "upgrading" from a previous version of Mach3.
I decided to start a new thread....

It appears that "T# M6 G43 T#" does not change the DRO offset as I expect it to.
(I expect it to change the DRO to reflect the height offset value without moving the machine)

G43 SOMETIMES moves the machine Z axis. (I've broken several tools and ruined parts because of this.)
In this "sometimes" mode repeatedly issuing G43 (tested with the MDI) repeatedly moves the machine Z axis.
Sometimes appears to be:
   if current tool <> tool specified in "T# M6 G43 H#"
       Then machine does not move (offset changed in DRO)
   if Current tool = tool specified in "T# M6 G43 H#"
       Then Machine moves Z axis by offset of H

?!?!?

My post always issues the tool change like this:
T# M6 (apparently does nothing except change the Tool # display)
G43 H# (Tool height offset is applied to DRO (or the Machine Z axis is moved) at this command)

But why wasn't this ever a problem before in Mach2 or the previous version of Mach3 (Current 3.00)
The Z axis never moved when a tool offset was issued. See below from UsingMach3Mill
Title: Re: G43 BREAKING TOOLS
Post by: Hood on January 21, 2008, 02:49:38 AM
When you code asks for the same tool as is already in, is it also the same offset that was previously used on that tool or is it a different offset?
Hood
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 21, 2008, 11:48:40 AM
Always the same offset (the offset value of H#).
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 21, 2008, 02:50:58 PM
Hello,
As you may know this is not a simple program and we do the best that we can to make it as safe as possible. But at times tings can get through the cracks... So if you can please post a small bit of code that your Cam system is making and lets see if we can fix the problem. The Standard way to do a toolchange is to have it on two lines...
For example:

M6t5
g43H5

I will see if I can get it to work with your nonstandard code... but there could be technical issues but we will do the best that we can.
thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 21, 2008, 04:52:12 PM
You think the swapped "T# M6" vs "M6 T#" may be the problem?

I appreciate the attention to the issue.

I can also try to change the post to re-order the first line. But modding my CAMWorks post has been "problematic" at times.
It's been stable for a while. I'll submit it for your library once this issue clears up.

(I'll also verify that I've reported the problem exactly--am away from my machine right now)

Is there any situation where applying a tool offset can be expected to move the machine?
I'm working around this for now by only using one tool with offset of 0.0"

Thanks! Erich
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 21, 2008, 04:59:20 PM
Hello Erich,
The Offsets should not move the machine but with all the offsets in Mach3 it is very complex to tell if there are going to be any interactions...

I think the problem is that you are doing an "M6 t#" on the same line as a "G43 H#" You need to have the height offset on the line after the Toolchange code. That should work as you like (I was doing that last night ;) ) I agree that it should not move and I have added it to my list of things to look at.
thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 21, 2008, 05:02:43 PM
Sorry for the confusion. I included the two lines together in the pseudo-code for brevity.
My post always generates the code like this:

T# M6
G43 H#

The troublesome behavior occurs when the "G43 H#" command is issued.

I'll send a real snippet later tonight.
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 21, 2008, 11:31:29 PM
Tested here with everthing on one line and it works as it should... Have you checked to see that you do not have any code in your toolchange macro?

Post some code and that my help to find the problem.
thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 22, 2008, 12:53:25 AM
Ok I've enclosed example code that has the problem (typical of any program)

With T5 offset = -.5
   And if T5 is selected before the program is run (which is common)
  Then the "G43 H05" moves the z axis down 0.5"
  Re-running the program causes same behavior.

  If no tool is already selected then no z motion occurs at "G43 H05"

(Teksoft CAMWorks for MACH2)
(Post: Mach2-2005_0711e by Ted)
(******************************)
(1/8 2 FLUTE HSS EM)
T5 M6
G43 H05
S2200 M3
G54
M8
G90 G0 X6.7602 Y-.5341
G43 Z.05 H05
G83 G98 R.05 Z-.25 Q.25 F5.
X1.9041 Y-2.2257
G80
Z.05 M9
G0 G53 Z0
G28
M30

Looking at the post it's obvious a retract to safe Z before the first XY traverse would be wise.
(I realize the the post is also kinda messy in other ways)
I'd really really like to make the post more safe but It's been 3 years since I  messed with it and the most recent working source is corrupt.

But this hasn't been an issue in the past.

Regardless if I did a safe retract, the current behavior would first plunge the tool down 0.5 and then back up to safe z.
(Wouldn't help if the program started with the tool at 0.25 above the part.)

Erich
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 22, 2008, 10:29:04 AM
Erich,
I have run your program 10 times and I have not seen the problem... Could you check to see what you have in your M6start and M6end macros?

Hood could you please test this on your mill and tell me if you have the same problem?

Thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 22, 2008, 11:56:48 AM
Thanks,

Sure, again, You'll have to wait for later tonight.
I do remember customizing the M6 macros...
Now if I could just remember where they are... (been a while)

Erich
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 22, 2008, 01:27:34 PM
They will be in the Mach3\Macros\ <your profile> folder...

Thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Hood on January 22, 2008, 01:29:28 PM
Sorry Brian, never saw this until now and I am at home :(  Will test it out tomorrow if no one else has.

Hood
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 22, 2008, 11:20:03 PM
M6 Start
  tool = GetSelectedTool()
  SetCurrentTool( tool )

M6end
REM The default script here moves the tool back to m6start if any movement has occured during the tool change..

x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
SafeZ = GetSafeZ()
if  SafeZ  > z then StraightTraverse x, y,SafeZ, a, b, c
 StraightFeed  x, y,  z  , a, b, c
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 22, 2008, 11:24:27 PM
Try this

M6end
REM The default script here moves the tool back to m6start if any movement has occured during the tool change..

x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
'SafeZ = GetSafeZ()
'if  SafeZ  > z then StraightTraverse x, y,SafeZ, a, b, c
'StraightFeed  x, y,  z  , a, b, c
Code("G0X" & x & "Y" & y" & "A" & a )

I don't like the Safe Z and you have it set to a bad number... I would take it out of the tool change and if you would please turn it off .
thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Hood on January 23, 2008, 06:47:52 AM
Brian did the tool change with offsets as Erich stated and it to works fine for me.
Hood
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 23, 2008, 08:35:21 AM
I think we will find that the problem is the toolchange  macro and not mach3...

Thanks hood for the test (Nice to see you made it to work today ;)  )

Thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 24, 2008, 12:12:33 PM
Thanks I haven't had a chance yet to test the modified macro...

I didn't write my M6 macro. I don't know what it does or how it works. I got it from someone in the forums about 4-5 years ago(?) back then when Mach 2 did, in fact, move the tool when a hight offset was applied. I was trying to make mill behavior more safe.

I remember my lament of crashing and broken tools appeared to inspire Art to modify Mach's behavior overnight. The new build worked great and I forgot about what was in the macro. His prompt response made me an advocate.

Now if I could just get over this new hitch...

What are the standard M6 Macros?

How do I do a totally clean uninstall - reinstall?
 
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 24, 2008, 12:33:08 PM
You can use the old macro but you need to have a look at your safe Z settings...

Config / SafeZ

Thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 27, 2008, 04:03:49 PM
Thanks Guys,

The modified M6end macro appears to work great. No Z axis movement at all on tool changes.

I'm curious, what is the default M6end macro that comes with the install?

Erich


Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 27, 2008, 04:07:19 PM
Hmm...

Actually, I've got cryptic "compile error" at the tool change a couple times now.
It doesn't appear to affect much. As upon acknowledging the error dialog the code continues to run without any apparent ill effect.

Erich
Title: Re: G43 BREAKING TOOLS
Post by: Brian Barker on January 27, 2008, 04:57:26 PM
Please post your macro as an attachment (in a zip file) and I will see if I can find an error.. Or if you like you can mail it to me off list..
Thanks
Brian
Title: Re: G43 BREAKING TOOLS
Post by: Erichtg on January 27, 2008, 05:25:24 PM
Sending the macro off-list.