584,866 active members*
4,975 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Tormach Personal CNC Mill > Need help with Macro for checking tool length before tool change
Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2011
    Posts
    135

    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

  2. #2
    Join Date
    Nov 2013
    Posts
    402

    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.

  3. #3
    Join Date
    Aug 2011
    Posts
    135

    Re: Need help with Macro for checking tool length before tool change

    Quote Originally Posted by RussMachine View Post
    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

  4. #4
    Join Date
    Jun 2008
    Posts
    1082

    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.

  5. #5
    Join Date
    Feb 2006
    Posts
    7063

    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.

  6. #6
    Join Date
    Aug 2011
    Posts
    135

    Re: Need help with Macro for checking tool length before tool change

    Quote Originally Posted by Hirudin View Post
    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

  7. #7
    Join Date
    Aug 2011
    Posts
    135

    Re: Need help with Macro for checking tool length before tool change

    Quote Originally Posted by SCzEngrgGroup View Post
    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

  8. #8
    Join Date
    Feb 2006
    Posts
    7063

    Re: Need help with Macro for checking tool length before tool change

    Quote Originally Posted by mioduz View Post
    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.

  9. #9
    Join Date
    Jun 2008
    Posts
    1082

    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.

  10. #10
    Join Date
    Aug 2011
    Posts
    135

    Re: Need help with Macro for checking tool length before tool change

    Quote Originally Posted by Hirudin View Post
    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.

  11. #11
    Join Date
    Mar 2003
    Posts
    35538

    Re: Need help with Macro for checking tool length before tool change

    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.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  12. #12
    Join Date
    Jun 2008
    Posts
    1082

    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 View Post
    ...
    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***

Similar Threads

  1. Tool length offset reduction macro (Sinumeric 840D)
    By McMaster in forum SIEMENS -> Sinumerik 802D/808D/810D/828D/840D
    Replies: 2
    Last Post: 02-19-2024, 09:34 AM
  2. tool change and measure tool lenght, macro?
    By Charon in forum Mach Wizards, Macros, & Addons
    Replies: 3
    Last Post: 03-20-2012, 06:56 PM
  3. macro variable for mazatrol tool length
    By kendo in forum Mazak, Mitsubishi, Mazatrol
    Replies: 9
    Last Post: 08-24-2011, 05:13 PM
  4. makino automatic tool length presetter macro
    By PETE1968 in forum Uncategorised MetalWorking Machines
    Replies: 0
    Last Post: 12-08-2010, 09:30 PM
  5. Replies: 0
    Last Post: 02-14-2010, 07:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •