Mixed ATC / Manual tool change questions

More
22 Dec 2023 21:14 #288845 by awetmore
I've been building a metal-cutting gantry mill around a Langmuir MR-1 with an ISO30 spindle and drawbar.

As part of my system I've programmed LinuxCNC to support automatic tool changing for tools with an assigned pocket and manual tool changes for tools without an assigned pocket.  Manual tool changing is useful for me on the probe (which needs to be plugged in) and long tools that don't fit my rack.

Right now I'm doing the manual tool changes purely in G-Code and waiting for an input button to be pressed with M66.  However I'd really prefer to use the hal_manualtoolchange component just for manual tools because it gives a nice clear dialog box and details on which tool to load.  Is it reasonable to try and use a binary signal to flip iocontrol.0 on the fly between manual and automatic tool changing?  Or is there anyway to trick hal_manualtoolchange to skip the dialog and wait?  I tried doing the latter by hooking up hal_manualtoolchange.change_button to something already signaled high before I called it, but it looks like that component waits for an edge trigger. 

I'm guessing I'm not the first one to do a mixed-mode changing machine like this, does anyone else have an example configuration?

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

More
22 Dec 2023 21:17 - 22 Dec 2023 21:24 #288846 by awetmore
To partially answer my own question -- I hadn't realized that the hal_manualtoolchange is written in Python and part of the GUI (qtdragon in my case). The best solution might be to modify it for my own needs.

It looks like the hacky but functional solution would be a build a delayed trigger for the change_button HAL pin.  I can trigger another pin from G-Code using M64 prior to the M6, let it delay for a couple of seconds, then have the output be wired to the change_button pin.

I'd still love to see examples of people doing something similar on other machines.
Last edit: 22 Dec 2023 21:24 by awetmore.

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

More
22 Dec 2023 23:00 - 22 Dec 2023 23:01 #288852 by awetmore
This was easier than I expected, just by driving hal_manualtoolchange directly from G-Code and using digital-in/digital-out pins instead of hooking it up to iocontrol.In my postgui HAL file:

net manual-tool-change      hal_manualtoolchange.change     <= motion.digital-out-01
net manual-tool-changed     motion.digital-in-02            <= hal_manualtoolchange.changed
net manual-tool-number      hal_manualtoolchange.number     <= iocontrol.0.tool-prep-number

and in my tool change subroutine:
; this is wired to the hal_manualtoolchange to pop up a dialog
M64 P01 
; digital-in-02 is wired to the completion of the dialog
M66 P2 L3 Q9999

o330 if [#5399 EQ -1]
    (DEBUG, "Timeout waiting for manual tool change")
    o<tool_setter_manual_change> return [-1]
o330 endif 
M65 P01
Last edit: 22 Dec 2023 23:01 by awetmore.

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

More
23 Dec 2023 10:22 #288882 by andypugh
I was just about to suggest what you ended up doing.

It is also possible to name the motion.digital pins through a parameter of motmod, to make the HAL clearer, though G-code doesn't know that you have done this so it's still numbers in the G-code.
This doesn't actually seem to be documented, which is a bit odd. but names_din and names_dout can be used.
github.com/LinuxCNC/linuxcnc/blob/2.9/sr.../motion/motion.c#L62

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

More
23 Dec 2023 16:50 #288929 by awetmore
Thanks, that is useful. In the G-Code I can already use _ini references to get nicer symbolic names. I need to go through and update all of my logic components to use symbolic names too (instead of or2.0 and or2.1).

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

Time to create page: 0.152 seconds
Powered by Kunena Forum