Need help with Macro for checking tool length before tool change
Posted this in the Mach 3 Macro Forum as well.
Please forgive me my knowledge of macros is Extremly limited. This may already have been made, or may need to be written. If someone could please point me in the correct direction.
I have a tormach PCNC 1100. I am considering ordering the Tormach Tool changer. My dilema is IF I break a tool in my first operation, I will crash 3-4 other tools afterward, certainly destroying the tools, possibly the parts as well. This is absolutly not an option as the parts I am working on are expensive to replace.
I am interested in integrating a macro to use with the ATC as well as tormach (or aftermarket) tool setter. IDEALLY I would like the machine to check the length of every tool at the end of each operation. And compare this to the length stored previously. If the tool is shorter (or longer) by some specified amount (say .015) then hold untill operator confirms.
I would love to have the tool setter retractable so it doesnt take up any space on my table, but for now I think it will be fine on the table in the corner.
Please let me know where to go from here.
Thanks
Chris
Re: Need help with Macro for checking tool length before tool change
Are you saying that all of your follow-up tools are dependent on Tool #1 doing it's job?
If Tool #1 snaps off, then T2, T3, T4 will all crash into the part as well?
If so, then after Tool #1, I would put an M998, followed by an M00 to stop the program.
Visually inspect that Tool #1 is still there, and has made the cut.
As for your tools 'Changing length', I don't think you need to worry about that.
Torque them down tight, and they most likely aren't going to change.
Re: Need help with Macro for checking tool length before tool change
Quote:
Originally Posted by
RussMachine
Are you saying that all of your follow-up tools are dependent on Tool #1 doing it's job?
If Tool #1 snaps off, then T2, T3, T4 will all crash into the part as well?
If so, then after Tool #1, I would put an M998, followed by an M00 to stop the program.
Visually inspect that Tool #1 is still there, and has made the cut.
As for your tools 'Changing length', I don't think you need to worry about that.
Torque them down tight, and they most likely aren't going to change.
Having the machine pause for a visual inspection pretty much eliminates the point of the tool changer. I want the machine to run without with my direct supervision. I want the machine to check tool length to see if the previous tool has broken. If it has then hold
Sent from my VS980 4G using Tapatalk
Re: Need help with Macro for checking tool length before tool change
This sounds like a good idea to me. If I had an ATC (and an automatic tool length setter) I would very much want to implement a similar macro. I wish I could offer more advice on the subject, but this whole area is pretty foreign to me. Perhaps this post will help get the ball rolling a little more...
So, it seems like this would actually be pretty simple. You'll want to add your new macro to the "M6 end" file (sorry, I've forgotten the exact file name) in the Mach3 installation folder. The macro simply needs to...
1. raise the head
2. move the table to the location of the tool setter
3. lower the head (I assume by using a G31 move) down onto the tool setter
4. then compare the Z DRO value against "0"
If the new Z value is very close to "0" the macro should allow the M6 tool change to continue, otherwise it should pause the program and throw an error message. Unless someone else beats me too it, I'll try to write a test macro when I get on my desktop computer.
Re: Need help with Macro for checking tool length before tool change
I'm a little confused as to why there is so much concern about tool breakage. Other than the first time you run new code, you should not be breaking tools often enough to be worth worrying about. I can't even remember the last time I broke a tool when doing a production run - it happens only on first prototypes. Rather than complicating, and slowing, the whole process (and, BTW, adding many new and different failure modes along the way), get your g-code properly under control, and you really shouldn't have to worry about this problem. Even low-rate events like toolchanger faults should be much more common than tool breakage.
Regards,
Ray L.
Re: Need help with Macro for checking tool length before tool change
Quote:
Originally Posted by
Hirudin
This sounds like a good idea to me. If I had an ATC (and an automatic tool length setter) I would very much want to implement a similar macro. I wish I could offer more advice on the subject, but this whole area is pretty foreign to me. Perhaps this post will help get the ball rolling a little more...
So, it seems like this would actually be pretty simple. You'll want to add your new macro to the "M6 end" file (sorry, I've forgotten the exact file name) in the Mach3 installation folder. The macro simply needs to...
1. raise the head
2. move the table to the location of the tool setter
3. lower the head (I assume by using a G31 move) down onto the tool setter
4. then compare the Z DRO value against "0"
If the new Z value is very close to "0" the macro should allow the M6 tool change to continue, otherwise it should pause the program and throw an error message. Unless someone else beats me too it, I'll try to write a test macro when I get on my desktop computer.
That is exactly correct. I think asking the tormach to hold a .000 tolerance on tool length is going to be a lofty task. Really any variance over say. 010 should trigger the alarm flag. But that is something that will have to be played with. I'm really surprised that this doesn't exist yet. Seams like something most everyone would want to use if using an atc
Sent from my VS980 4G using Tapatalk
Re: Need help with Macro for checking tool length before tool change
Quote:
Originally Posted by
SCzEngrgGroup
I'm a little confused as to why there is so much concern about tool breakage. Other than the first time you run new code, you should not be breaking tools often enough to be worth worrying about. I can't even remember the last time I broke a tool when doing a production run - it happens only on first prototypes. Rather than complicating, and slowing, the whole process (and, BTW, adding many new and different failure modes along the way), get your g-code properly under control, and you really shouldn't have to worry about this problem. Even low-rate events like toolchanger faults should be much more common than tool breakage.
Regards,
Ray L.
I have my code set, good feeds and speeds. But in this particular operation I use a stubby 1/8" end mill. And its worn out by about 30-40 pieces. It doesn't really give much warning being so small, it doesn't really squeal or anything. Just wears, dulls, and snaps. If it breaks my chamfer mill will crash since the radius in the corners is to large. Yes for the cost of a 1/8" end mill I could just be safe and machine 25 parts and then replace it but if the technology is available to do this without any substantial cost why not use it.
Sent from my VS980 4G using Tapatalk
Re: Need help with Macro for checking tool length before tool change
Quote:
Originally Posted by
mioduz
I have my code set, good feeds and speeds. But in this particular operation I use a stubby 1/8" end mill. And its worn out by about 30-40 pieces. It doesn't really give much warning being so small, it doesn't really squeal or anything. Just wears, dulls, and snaps. If it breaks my chamfer mill will crash since the radius in the corners is to large. Yes for the cost of a 1/8" end mill I could just be safe and machine 25 parts and then replace it but if the technology is available to do this without any substantial cost why not use it.
Sent from my VS980 4G using Tapatalk
But odds are you're getting bad parts long before it snaps. The first thing to break is almost always the corners, which will give you bad dimensions, bad surface finish, etc. Besides, unless you're cutting something uber-hard, the tool should not wear out that fast. I've got 1/8" endmills I've used for the better part of a year.
As I indicated, you'll find introducing probing to "test" that will introduce a whole new set of potential problems, not least due to the fact that probing in Mach3 has never been 100% reliable. Personally, I would pre-emptively replace the tool - its the safest, cheapest, simplest approach, and is pretty much guaranteed to have the highest long-term success rate, with by far the least effort.
Regards,
Ray L.
Re: Need help with Macro for checking tool length before tool change
Yeah, it would suck to break a tool while trying to make sure it wasn't broken.
What do the "big boys" do? I've seen videos where machines automatically check tool length and diameter, but maybe those videos were produced by companies trying to sell tool-setters.
Of course, this would be useful in a non-production environment as well. I generally trust the code that my CAM program spits out, but I am still usually not willing to leave my machine running unattended for long periods. I imagine this unwillingness would be multiplied if I had an ATC. It would be nice to load up an NC file and walk away with the confidence that the machine will stop itself if something catastrophic goes wrong.
A dedicated video camera might be a good companion to this setup.
Re: Need help with Macro for checking tool length before tool change
Quote:
Originally Posted by
Hirudin
Yeah, it would suck to break a tool while trying to make sure it wasn't broken.
What do the "big boys" do? I've seen videos where machines automatically check tool length and diameter, but maybe those videos were produced by companies trying to sell tool-setters.
Of course, this would be useful in a non-production environment as well. I generally trust the code that my CAM program spits out, but I am still usually not willing to leave my machine running unattended for long periods. I imagine this unwillingness would be multiplied if I had an ATC. It would be nice to load up an NC file and walk away with the confidence that the machine will stop itself if something catastrophic goes wrong.
A dedicated video camera might be a good companion to this setup.
I know Haas Mini mill has the capability to check tool width and Length before and after each operation.
Re: Need help with Macro for checking tool length before tool change
Quote:
Please let me know where to go from here.
Start with the auto zero macros that many router users are using, and look at the sample ATC macro and tutorial video at the machsupport website.
Contrary to Ray's experience, there are thousands of Mach3 router users reliably probing for tool length.
Re: Need help with Macro for checking tool length before tool change
OK, here's something that might help a little... Sorry I didn't get to it yesterday. Also, there's a line (marked with "**********") that will almost surely not work correctly. I'd fix it myself, but it would seem that I'm pretty rusty at scripting for Mach3. :/
Quote:
Originally Posted by
Hirudin
...
1. raise the head
2. move the table to the location of the tool setter
3. lower the head (I assume by using a G31 move) down onto the tool setter
4. then compare the Z DRO value against "0"
...
Add this to M6End.m1s
Code:
// Step 1...
Code "G0 G53 Z0" // should raise the head up to machine Z0 (you might want to use "-0.25" or something similar)
// Step 2...
Code "G0 G53 X0 Y0" // should move the table to machine X0Y0 (you'd want to replace these coordinates with the coordinates of the toolsetter)
// Step 3...
If GetOEMLED (825) <> 0 Then // Checks to see if the probe is already activated
Message "Probe is activated. Correct and try again."
Stop // Stops the script if the probe is activated *** -> Code "M0" <- might be a better command to use here ***
Else
FeedBefore = GetOEMDRO(818) // The current feedrate, before the script begins
SearchDist = GetOEMDRO(1012) // The distance you'd like the machine to move down to find the toolsetter. I use a custom DRO but you can replace the variable with a number
FeedSlow = GetOEMDRO(1015) // The feed-rate at which to move toward the probe. I use a custom DRO but you can replace the variable with a number
Code "G31 Z-"&SearchDist &"F"&FeedSlow
While IsMoving()
Sleep 100
Wend
End If
// Step 4...
If GetOEMDRO(802) <> GetVar(2002) Then // ********** this line needs to be fixed **********
Message "Tool length has changed."
Stop // Stops the script if the lengths don't match *** -> Code "M0" <- might be a better command to use here ***
End If
Code "F"&FeedBefore // Restores the feed-rate back to the beginning value
// *** Hopefully the normal ATC script will begin here***