584,814 active members*
5,382 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Tormach Personal CNC Mill > Tormach PathPilot™ > what code for a tool change to eliminate the user confirmation pop up
Page 1 of 2 12
Results 1 to 20 of 21
  1. #1
    Join Date
    Apr 2010
    Posts
    60

    what code for a tool change to eliminate the user confirmation pop up

    I am trying to configure a 4 tool wine rack type tool holder and use subroutines for tool changes & the I/O module to control the power drawbar.
    I've got all the hardware installed and finishing up the tool rack when I realized I do not know how to enter the command for a tool change to make the subroutine to load a tool. I am pretty sure I have the code I need to park a tool once I get my tool positions set, and after skimming the PP manual & a G-code command summary I see I can change the tool in Pathpilot with something like " M6 T1 G43 " but of course that brings a confirmation box for the user to click before PP resumes, I need to to continue automatically without user input.

    Is there some way to do that in the code ?


    While typing this I thought maybe I should be looking at the Linux CNC manual possibly for the answer, but that is probably over my head, but I saw something that made me think it might have to edit a .hal or something to get this to work.
    This is the clip where I saw the reference to hal_manualtoolchange , I'd like to do it without having to edit PP if Possible.

    if anyone can help me out to understand this better I would Appreciate it

    TIA

  2. #2
    Join Date
    Nov 2012
    Posts
    591

    Re: what code for a tool change to eliminate the user confirmation pop up

    You need to set both T1 and H1 with the G43.
    Also, the idea is that "M6 is the macro to make the tool changer "go"" which means that you can edit the code for that macro to not pop up the dialog box.

    The tormach_mill directory contains something like:
    Code:
    REMAP=M6 modalgroup=6 prolog=zbotatc_M6_prolog ngc=m400
    which means that it will run the file "m400.ngc"

    The m400.ngc file contains this code fairly early on:

    Code:
    o<mode_check> if [#<_mode> EQ -1.0]   (manual changes -  nothing for ATC here to do)
    You can either change that file, or you can change the REMAP config to run another file.
    I'd probably take out the line starting with M100 and ending before M61.
    (I also don't understand why it calls M61 twice... but best to keep that in unless you're adventurous :-)

    M100, in turn, is a Python script in tomach_mill/nc_subs, which actually shows the dialog.

    Unfortunately you'll have to re-edit these changes each time you update PathPilot to a new version.

  3. #3
    Join Date
    Jan 2016
    Posts
    386

    Re: what code for a tool change to eliminate the user confirmation pop up

    You may find the answer in this video. He made a wine rack tool changer for his Tormach as well.


  4. #4
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    Steve303, yea I am basically coping Jason's concept from that vid. Ive emailed him again about it too. The video doesn't explain or show the subroutine for loading a tool only parking a tool, he mentions he received from help from Clifford. I reached out to both of them that is an important part .

  5. #5
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    Jwatte,
    Thank You ! I'm sure that is what I needed if I understand you correctly I should edit "m400.ngc" to stop the dialog box from popping up. How do I stop that ?

  6. #6
    Join Date
    Dec 2008
    Posts
    740

    Re: what code for a tool change to eliminate the user confirmation pop up

    Quote Originally Posted by Dozer56 View Post
    Jwatte,
    Thank You ! I'm sure that is what I needed if I understand you correctly I should edit "m400.ngc" to stop the dialog box from popping up. How do I stop that ?
    Just commenting out the last 2 lines of M100 will suppress the dialog but, an this is a BIG BUT it will ALWAYS suppress the dialog. This means that if you run a program with a normal manual tool change it will just apply the offsets of the new tool and keep running with the old tool. I don't think this is a particularly good idea. To get this running properly, and safely, you probably need to do some additional programming.
    Step

  7. #7
    Join Date
    Nov 2012
    Posts
    591

    Re: what code for a tool change to eliminate the user confirmation pop up

    If you want a single line of code that changes the tool without involving the ATC or the pop-up dialog, you can also have your post processor emit this for tool changes:

    (example for tool 22):
    Code:
    T22 H22 G43
    M61 Q22
    I believe this will set the tool number/diameter and height offset, and then tell the underlying LinuxCNC about the change so it updates all its internal state/UI appropriately.
    You should try this manually with the spindle stopped first, though!

    Separately: This will not stop or re-start the spindle, or move to the appropriate position to load the "wine bottle" tool; you'll have to solve that on your own. This just updates the mills idea of what tool is loaded.

  8. #8
    Join Date
    Dec 2008
    Posts
    740

    Re: what code for a tool change to eliminate the user confirmation pop up

    If you check Jason's video at around 6:10 you'll see he also loads tool 16 with M61 Q16 G43 H16

    Attachment 423638

    This is definitely a better method than suppressing the dialog in a standard macro.
    Step

    Edit: I've only tried this on a test machine. As jwatte says, test it out very carefully.

  9. #9
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    I was just looking at the description for M61 wondering if that would work, I am green on G-code but this is starting to make a little sense to me. I have been trying different things in the virtual PathPilot without success but that seems to work entered it this way in the MDI line.
    T2 H2 G43
    M61 Q2

    I inserted that in a small file and that did change the tool between passes without error in Virtual Pathpilot. I think that is what I need in the subroutines for the 4 tools, with the other code for positions and commands to stop spindle, coolant etc.

    Thank you !
    I appreciate the help

  10. #10
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    Turbostep THANK YOU, I saw that but I didn't understand it, but I do now.

    Thank you, this is simple and should be what I need, is it OK to do it one line like he has it ? or does it even matter ?

  11. #11
    Join Date
    Jan 2016
    Posts
    386

    Re: what code for a tool change to eliminate the user confirmation pop up

    Quote Originally Posted by Dozer56 View Post
    Turbostep THANK YOU, I saw that but I didn't understand it, but I do now.

    Thank you, this is simple and should be what I need, is it OK to do it one line like he has it ? or does it even matter ?
    Did you post a video of your wine rack atc on youtube or is this someone else? Can you post your subroutine for others who might find this useful?



    Steve

  12. #12
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    Yes that is my video, I posted another one also where I am cutting a few tool forks for spares. trying to show how much machining area this takes up. I had it set up to run 4 pieces at once but 9" was too much and had to only do 3 with 8" stock.

    I am glad I did this, I had some unanswered questions about the others I saw and was able to get the answers I needed and learned a lot along the way.
    Now having done it I would warn anyone who wants to copy or do something similar that this is really not practical at all, the center of my tools are .1" from extreme X+ and I still loose more than 5" of X work area due to the tool rack being able to make contact with the head of the mill. it takes manual edits to the G-code file for each tool and if you are like me and not very familiar with writing G-code mistakes can be made very easily, luckily I did not crash and did learn what I needed to make the adjustments in the files to run successfully. I don't do multiple parts much but maybe if I did it would be worth the trouble.
    The subroutines & tool changes can be added in Fusion using manual NC function, " o<100> call " etc.. and the code to tell pathpilot the tool has changed " M61 Qxx G43 Hxx " is added after a new tool is loaded. and the M6 tool change lines generated by Fusion 360 have to be deleted or the machine will pause and wait for user input. I forgot to turn off the M01 break in Pathpilot in that video so it paused anyway but now I know....


    This is how I load a tool in the spindle (you would have to edit it to your specific application)
    Code:
    (LOAD TOOL SLOT 1)
    o<100> sub	(subroutine Call)
    G30
    M05 		(spindle off)
    G49 		(cancel Tool Offset)
    G59.1 		(Atc rack WCS)
    M64 P0		(Open PDB)
    G0 Y0 F35	(tool 1 Y Position)
    G0 X-2.2 	(rest position X)
    G1 Z1.75 F25	(Spindle clear Z height)
    G1 X0 F35 	(Move X to home)
    G1 Z0 F25	(Tool fork Z height)
    M65 P0		(Close PDB )
    G04 P1		(pause 1 sec)
    G1 X-2.2 F30	(rest position X)
    G30
    G54
    o<100> endsub	(end subroutine)
    This is what I did to park a tool (you would have to edit it to your specific application)
    Code:
    (PARK TOOL 1)
    o<101> sub	(subroutine Call)
    G59.1 		(Atc rack WCS)
    M05 		(spindle off)
    G49 		(cancel Tool Offset)
    G1 Z0 F35	(Tool fork Z height)
    G0 Y0 F35	(tool 1 Y Position)
    G0 X-2.2 	(rest position X)
    G01 X0 F35 	(Move X tool to home)
    M64 P0		(Open PDB )
    G04 P1		(pause 1 sec)
    G1 Z1.75 F25	(Raise spindle above tools)
    G0 X-2.2	(rest position X)
    o<101> endsub	(end subroutine)
    I probably have a lot of redundant code in these but was trying to be safe and not break something. & I do not know that this is the correct way for these to be done, knowing very little about g- code programming, but they did work for me

    I was having a small problem, PathPilot showed it was not switching back to G54 in the tool path window when I loaded my file, but easily corrected to manually add G54 where needed, I may have that sorted now where I added it to the end of the tool loading routine but hadn't tested it .

    I feel like this whole thing is dangerous, basically I've mounted a fixed obstacle in the middle of the table & work area and try to machine around it without crashing, after doing it I don't feel like it is worth the trouble and I am still amazed by the whole CNC process when I machine something so I will probably be standing there watching the machine run anyway but if I had 500 parts to run it might be different.

    It was a good project glad I did it and learned so much about G-code and learned Ive got al lot more to learn.

  13. #13
    Join Date
    Jan 2016
    Posts
    386

    Re: what code for a tool change to eliminate the user confirmation pop up

    Thanks for posting your macros. Have you seen this video? He moves the winerack out of the way when milling.


  14. #14
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    I had not seen that one. I had thought about something l similar to that, it would be very simple and inexpensive to add the air cylinder and code to actuate it, but the way I was thinking the enclosure was not giving enough space to get the tools completely out of the way.

  15. #15
    Join Date
    Nov 2012
    Posts
    591

    Re: what code for a tool change to eliminate the user confirmation pop up

    He moves the winerack out of the way when milling
    OK, THAT is slick :-)
    Looks like he's using BT30 for better holding, too.

  16. #16
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    yea, pretty cool, I guess it's a automate or Smithy CNC . here's one he's got a hood on the tools too, very nice job.
    https://www.youtube.com/watch?v=4VhG0HjY4Tw

  17. #17
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    I really should have abandoned this project long ago, but I had to see it through. This is what I ended up with, it works well and doesn’t take any machining space.
    I’ve tested it a few times and it works really well. I haven’t had a failure or crash with it so far though I know it’s bound to happen one day. I’ve raised the feed on tool changes a little since making this video but to be safe it still takes about 30 sec’s chip to chip when changing tools.
    I think this will be useful in the future and only cost me about $200 and some time. I had a lot of fun doing it and learned a lot..

    I appreciate the help guys, got me pointed in the right direction and helped me learn the code I needed to make this work.

    https://youtu.be/01oW5inlX-A

  18. #18
    Join Date
    Apr 2013
    Posts
    1788

    Re: what code for a tool change to eliminate the user confirmation pop up

    It is hard to see in the video but why do you need two pneumatic cylinders to move the wine rack?

  19. #19
    Join Date
    Apr 2010
    Posts
    60

    Re: what code for a tool change to eliminate the user confirmation pop up

    It is 2 pneumatic cylinders, but only 1 is hooked to air , the 2nd cylinder is filled with oil and a needle valve acting like a dampener to control movement. Without it, even at low air pressure, it slammed in and out and actually would throw the tools out of the rack. I need to get little bit of air left in it bleed out and maybe even some lighter weight oil in it to speed it up a little and stop the jerk it has when retracting.

  20. #20
    Join Date
    Apr 2013
    Posts
    1788

    Re: what code for a tool change to eliminate the user confirmation pop up

    I was considering using a commercial damper but that sounds like a good and inexpensive solution. Thanks for the idea!

Page 1 of 2 12

Similar Threads

  1. Copy and change tool offset using user task
    By ProToZyKo in forum Okuma
    Replies: 18
    Last Post: 03-28-2019, 12:34 PM
  2. TOOL CHANGE G-CODE
    By tdoz in forum G-Code Programing
    Replies: 1
    Last Post: 01-18-2016, 03:17 PM
  3. How to program User confirmation to continue?
    By AssassinXCV in forum G-Code Programing
    Replies: 4
    Last Post: 04-27-2012, 06:03 PM
  4. Replies: 1
    Last Post: 02-21-2012, 09:58 AM
  5. How to fix tool in Random Tool Change using Code?
    By CholPeter in forum G-Code Programing
    Replies: 1
    Last Post: 07-05-2011, 07:40 PM

Tags for this Thread

Posting Permissions

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