TOOL_CHANGE_QUILL_UP behaviour

More
2 years 5 months ago #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 to join the conversation.

More
2 years 5 months ago #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 to join the conversation.

More
2 years 5 months ago #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 to join the conversation.

More
2 years 5 months ago #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
Code:
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:
Code:
SUBROUTINE_PATH = ../nc_files/:mysubroutines           REMAP = M6  modalgroup=6  ngc=tool_change

Please Log in to join the conversation.

More
2 years 5 months ago #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.

Please Log in to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum