TOOL_CHANGE_QUILL_UP behaviour

More
13 May 2024 10:25 #300499 by Unlogic
I'm using the TOOL_CHANGE_QUILL_UP setting in the INI file to make the Z-axis go to the top during tool changes which works great.

However I've noticed that if the G-code calls for a tool change but the correct tool is already in the spindle the Z-axis still goes to the top and the down again (without any user interaction) before proceeding with the program.

On a machine like mine with 550mm of Z-axis travel and relatively slow travel speeds this leads to quite a bit of waiting for the Z-axis to do it's "up and down ceremony" each time I restart the program using the same tool as the last time.

Would it be possible to add a check in the implementation of the TOOL_CHANGE_QUILL_UP function to skip the quill up movement if the correct tool is already loaded?

I'm sure that there are a lot of variables and uses cases involved here that I'm not aware of as LinuxCNC rookie so I thought I'd post this here instead of creating an issue on GitHub.

Please Log in or Create an account to join the conversation.

More
13 May 2024 11:37 #300506 by Aciera
For a DIY fix you could make a custom remap M6 and check if

iocontrol.0.tool-number = iocontrol.0.tool-prep-number

and only if this is false call the built in M6 to execute the actual toolchange.

Please Log in or Create an account to join the conversation.

More
13 May 2024 12:01 #300510 by Unlogic

For a DIY fix you could make a custom remap M6 and check if

iocontrol.0.tool-number = iocontrol.0.tool-prep-number

and only if this is false call the built in M6 to execute the actual toolchange.
 

Thanks for such a quick reply.

I'm still a rookie when it comes to LinuxCNC so a "custom remap M6" is something I'll have to read up on how to do because I haven't gotten that far into the depths of the G-code universe yet .

Please Log in or Create an account to join the conversation.

More
13 May 2024 12:47 #300516 by Aciera
Try this:
1. create a subfolder in your config folder named 'mysubroutines'
2. create a file 'tool_change.ngc' with the contents below and save to the 'mysubroutines' folder
o<tool_change> sub
 M66  E0 L0  ; force synch so the hal pins are up to date
 o100 if [#<_task> GT 0]     ; Only do this in actual program execution and MDI                 
    o101 if [[#<_hal[iocontrol.0.tool-prep-number]> EQ #<_hal[iocontrol.0.tool-number]>]]
        (debug,Requested tool already in spindle)
    o101 else
         M6
    o101 endif
 o100 endif
o<tool_change> endsub
M2

3. in the [RS274NGC] secton of your ini file add the 'mysubroutines' folder to the SUBROUTINE_PATH using a colon :  Note the '../nc_files' in the example below may not be what you have in your path  Also add the custom REMAP line:
SUBROUTINE_PATH = ../nc_files/:mysubroutines
          REMAP = M6  modalgroup=6  ngc=tool_change
The following user(s) said Thank You: tommylight, Unlogic

Please Log in or Create an account to join the conversation.

More
14 May 2024 07:44 #300558 by Unlogic
Big thanks Aciera!

That code worked on the first time. It sure would have taken me a while to figure out that snippet.

My Probe Basic config already had a SUBROUTINE_PATH set in the INI file and the folder it pointed too already contained a similarly named toolchange.ngc. So I named the new file custom_tool_change.ngc instead and renamed the sub statement inside the file to o<custom_tool_change> to avoid any potential conflicts.

This is going to save a lot of time on my manual tool change machine.

I'll have to buy you a beer for this on the next LinuxCNC meething/gathering.
The following user(s) said Thank You: tommylight, Aciera

Please Log in or Create an account to join the conversation.

Time to create page: 0.094 seconds
Powered by Kunena Forum