PDA

View Full Version : Mach3 Tool Change Position



Mad Professor
08-12-2011, 04:23 PM
Good day all.

My jobs are now starting to need a number of tools changes per run.

Each tool change is done manualy, and I have to jog to a point where I can reach or have room to access the spindle.

I would like some help adjusting the Mach3 tool change macro scripts.

Here is the default Mach3 M6 tool change macro scripts.

C:\Mach3\macros\Mach3Mill\M6Start.m1s


tool = GetSelectedTool()
SetCurrentTool( tool )


C:\Mach3\macros\Mach3Mill\M6End.m1s


x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
if(IsSafeZ() = 1) Then
SafeZ = GetSafeZ()
if SafeZ > z then StraightTraverse x, y,SafeZ, a, b, c
StraightFeed x, y, z , a, b, c
else
Code"G00 X" & x & "Y" & y
end if


What I would like to happen when the tool change is called, is for Z to go up to home, Y to goto the center point, and X to goto the front.

What is needed to be added to the Mach3 M6 tool change macro scripts to do this?

Thanks for your time.

Best Regards.

Mad Professor
08-12-2011, 09:26 PM
Is it really as simple as doing this?

C:\Mach3\macros\Mach3Mill\M6Start.m1s


code "G53 Z0"
code "G53 X1000 Y500"
tool = GetSelectedTool()
SetCurrentTool( tool )

Jonathan
08-12-2011, 09:32 PM
Yes, that works. Although be careful where you have the absolute zero position for Z set. If you're not zeroing the Z with a home switch then that position could be anywhere, so I'd be inclined to use G0 instead of G53 in that line and put a suitable clearance, say code "G0 Z10" (depending on how much Z-travel you have). The other method is more robust iff you have a home switch on Z.

Mad Professor
08-12-2011, 09:52 PM
Sorry I should of said that I have photointerrupters on all my home, and limit points.

Mad Professor
01-01-2012, 06:08 PM
I have just updated my "C:\Mach3\macros\Mach3Mill\M6Start.m1s" code so that I will not use the G53 moves if all the axis are not Ref to home 1st.



tool = GetSelectedTool()
If GetOEMLED(807) Or GetOEMLED(808) Or GetOEMLED(809) Then
MsgBox "One or more axis is not Ref to home, you will have to manually jog to tool change"
Else
code "G0 G53 Z0"
While IsMoving()
Wend
code "G0 G53 X1000 Y500"
While IsMoving()
Wend
End If
SetCurrentTool( tool )

bob la londe
15-07-2013, 03:17 AM
Is it really as simple as doing this?

C:\Mach3\macros\Mach3Mill\M6Start.m1s


code "G53 Z0"
code "G53 X1000 Y500"
tool = GetSelectedTool()
SetCurrentTool( tool )


I think this makes more sense where you can set the G28 tool change position in homing and limits. G28 is always machine position, not offset position.



Code "m5"
Code "g28"
Code "m1"
tool = GetSelectedTool()
SetCurrentTool( tool )

Its seems to be pretty simple. Sorry if I dredged up an old thread, but this one got me on the right track, and I thought I had something to add for future solutions.

bob la londe
15-07-2013, 04:55 PM
Here was my final solution:


code "m9"
code "m5"
code "g28"
tool = GetSelectedTool()
SetCurrentTool(tool)
code "g43 h" & tool
code "m1"

It does what I want for a fast easy tool change finally.

It stops the spindle and the coolant pump, goes to a safe tool change location, retrieves the T(x) value, and stores it in the variable "tool". (Tool 1, Tool 2, etc) Then it performs the Gcode G43 H(x) to set the tool offset. All that's left is for me to swap to the correct tool and press start.

There are still a few things I would like to figure out how to do. For one thing I never really found a good resource for the values, commands, language structure, etc for Mach 3 macros. I just pieced them together from bits and pieces found here and there. Another thing I would like to do is figure out how to "park" the machine at the end of a program. Basically raise the spindle to safe Z, center the table, and move it forward to make part removal faster and easier when a program completes. Maybe I'll add a park button to my program screen. I ran across references to that while I was researching M6 macros. Executing a macro from a screen button. Well, that is a task for another day.

bob la londe
15-07-2013, 06:54 PM
Here was my final solution:


code "m9"
code "m5"
code "g28"
tool = GetSelectedTool()
SetCurrentTool(tool)
code "g43 h" & tool
code "m1"

It does what I want for a fast easy tool change finally.

It stops the spindle and the coolant pump, goes to a safe tool change location, retrieves the T(x) value, and stores it in the variable "tool". (Tool 1, Tool 2, etc) Then it performs the Gcode G43 H(x) to set the tool offset. All that's left is for me to swap to the correct tool and press start.

There are still a few things I would like to figure out how to do. For one thing I never really found a good resource for the values, commands, language structure, etc for Mach 3 macros. I just pieced them together from bits and pieces found here and there. Another thing I would like to do is figure out how to "park" the machine at the end of a program. Basically raise the spindle to safe Z, center the table, and move it forward to make part removal faster and easier when a program completes. Maybe I'll add a park button to my program screen. I ran across references to that while I was researching M6 macros. Executing a macro from a screen button. Well, that is a task for another day.

... later.

So much for my simple elegant solution:

I am having some problems getting my mind wrapped around the tool offsets and the tool table. It seems simple, but doesn't seem to work for me. I am abandoning the G43 H(x) stuff for now.

Just going with this for now:

Code "m9"
Code "m5"
Code "g28"
Code "m1"