Hello Guest it is April 20, 2024, 12:40:43 AM

Author Topic: Auto tool length with manual tool change  (Read 14699 times)

0 Members and 1 Guest are viewing this topic.

Auto tool length with manual tool change
« on: April 03, 2016, 08:49:15 PM »
ok so first off thanks for all the help so far even if I just joined I have been reading and looking through here for a while.

anyway to the point.
I have a Taig cnc mill and I got it with an Auto tool setter or so Deepgroove1 calls it. pretty much from what I have learned it's a 5 way switch. My machine doesn't currently have home switches (next project after I get this figured out. What I'm trying to do is get the machine to auto set the tool length after I do a manual tool change. But the script I came up with seams to give me a compiling error every time. Originally I started with a script I found online to use the auto tool zero button on the mach3 program run tab it worked but it resets Z zero for the work offset rather than setting the tools length in the register. which is not what I wanted and with that macro I had to place the tool setter on the work piece I want to mount it to my table and give it a location Say (g59p200) any way heres where I got the first macro  https://drive.google.com/file/d/0B2hPzRSbcroXSU9veTVwUjhfbjQ/edit so over time I came up with a complete from scratch macro and can't get it to work either. I was giving it it's own Mcode 901 and then I just add it to my normal gcode.

So here's what I'm wanting the macro to do.
     be assigned it's own M code (currently 901)
     Not affect the work offset
     Set the tool length in the register for the requested tool#
     Pause to give time to change the tool (ideal would be a message box where the ok button would allow the macro to move forward)
     Once tool is measured continue with the program without any more input from me.

I'm attaching my own macro in txt document file form. I wrote it on notepad as I read that word and all cause problems.
any help would greatly be appreciated. In the end I want this to work but I would also like to know where I went wrong so I could change it later if I change my setup. I really I really want to add home switches and I have everything Just wanted to use the auto tool setter with everything I make on this mill.



     
Re: Auto tool length with manual tool change
« Reply #1 on: April 05, 2016, 09:49:06 AM »
If there is already a thread or thread on this please feel free to post links as I have been looking I just might have missed them.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Auto tool length with manual tool change
« Reply #2 on: April 05, 2016, 12:39:44 PM »
Use the M6 Start and M6End macros.
M6 start runs when you get to an M6 in the g-code, and at the end of M6 Start, it will stop and wait for you to change tools. After changing tools,, clicking Cycle Start will run M6End. After M6 End finishes, g-code execution will resume.

You need to configure toolchanges in General Config to Stop Spindle, Wait for Cycle Start.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Auto tool length with manual tool change
« Reply #3 on: April 05, 2016, 01:22:22 PM »
Thank you for the reply.

I already have it set to stop on tool Change. I honestly hadn't thought about edifying the m06 to be the auto tool length measure and set. I guess I think of it for the atc... Lol I guess I could easily switch that and it would save the extra steps but then I still have the error in my Marco somewhere and I just can figure out where or what I'm doing wrong but this is my first macro ever. I just tried looking one up and when I didn't find one that fit my exact needs I tried to edit them and still not right so I started reading and learning all I could and then I wrote the one I uploaded. I'll try a new edit of it tonight when I get home using m06 start and end and see how that goes.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Auto tool length with manual tool change
« Reply #4 on: April 05, 2016, 01:29:59 PM »
Your first While IsMoving is missing the Wend.

This line

Code "G00 G31 z" &zmove"F4"

should be

Code "G00 G31 z" & zmove & "F4"

Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Auto tool length with manual tool change
« Reply #5 on: April 05, 2016, 01:47:54 PM »
Once again thanks for the quick reply.

Go figure I looked at that line 100 times and missed that does the rest like it will work to set the tool length?  I'm thinking I not getting something in it correct.  I originally had it so a zero for the g59p200 was at the point where the tool length setter was .001" above the activation point but when I started reading along through other codes I was not sure if the macro would know to start moving where I started it at which was g59p200 x0y0z4... In my case the mill has 6" of travel and later when I get the home switch mounts made I'm hoping to have it go from a home but I don't know how to do the line of code so mach3 would know how to figure tool length.

Maybe I'm wrong but if I had it at z zero or a home and told,it to set tool length to where it touched the tool setter wouldn't that make it think the tool was the length of the z travel down to that point? 

I'm also thinking that would rather have it double touch the tool setter once at a higher feed rate the slower to be more accurate. The first time would be to save the time it takes to go down the say 4 inches before the tool comes close to the setter and at 4ipm that's a full minute extra for no real reason.  Which is why currently I have it at 4 inches above because the first item I'm hoping to really use it on needs to use my drill chuck as the drill bit doesn't fit any of my collets.
Re: Auto tool length with manual tool change
« Reply #6 on: April 05, 2016, 02:01:51 PM »
I also see where the code posted above I must have edited it once already as I had g58p200x0y0z0 the same as g59p199x0y0z4.

The p199 is where the z0 is at the point where the collet is one step above turning on the digitize led.

I thought that by doing this the z fro reading would then be the correct tool length but I was not sure if the macro would work without the dooembutton(1010) line.

And if I do the m06start and end edit you suggested I could do this in two full macros making it honestly simpler no need for the machmsg. Just position the spindle above the setter and wait until I hit the green button again. I honestly had the machmsg in there so I could turn off the stop on m06 option but I like the idea of doing it with the factory stop on m06 option, because later on I do want to try building a full atc.
Re: Auto tool length with manual tool change
« Reply #7 on: April 05, 2016, 08:35:01 PM »
ok I'm working on testing now and it looks like I'm missing a setting somewhere because any time I either go in to edit button script or anything if Mach3 moves the machine at all I no longer can do anything without hitting reset. it's like I have it set to lockout all axis controls or something.
Re: Auto tool length with manual tool change
« Reply #8 on: April 05, 2016, 08:48:27 PM »
now mach is saying the dostopspin() is an error I don't understand why.
Re: Auto tool length with manual tool change
« Reply #9 on: April 05, 2016, 09:29:04 PM »
ok well it looks like I'm more over my head than I though or something. Nothing seams to be working correctly.I'm going to step away for the rest of the night start again fresh in the morning.