Non-random ATC, gmoccapy & tool pockets numbers

More
30 Mar 2020 09:09 - 30 Mar 2020 09:09 #162083 by andypugh
I assume that #5190 is a variable you have added yourself in the persistent range?

Are you using a remap? Are you using the stdglue routines?

github.com/LinuxCNC/linuxcnc/blob/master...dglue/stdglue.py#L92

This line says a lot :-/
self.params["current_pocket"] = self.current_pocket # this is probably nonsense

That remap is the source of the non-global parameters. It is probably worth studying that in the context of the behaviour you want, and possibly adding a named parameter of your own. As it is Python any changes should take effect immediately.
Last edit: 30 Mar 2020 09:09 by andypugh.

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

More
30 Mar 2020 09:58 #162088 by GuiHue
Hi again,

yes, I am using an M6 remap.

I am also using stdglue routines in an older version from a previous probe_screen_v2 install. This may or may not include changes from an old version by Norbert (gmoccapy). I need to confirm this/ test the version you have linked.

The line you have referenced is all too well known to me. From my point of view, this applies to the following line self.params["selected_pocket"] = self.selected_pocket as well.

That remap is the source of the non-global parameters. It is probably worth studying that in the context of the behaviour you want, and possibly adding a named parameter of your own. As it is Python any changes should take effect immediately.


If I find the time I will investigate this, however, this is uncharted waters for me. Not sure where to start. My current understand is, that iocontrol handles this information somewhere in the background. To get this into a named parameter that is correct, I need to somehow use the change_prolog function to access the iocontrol.0.tool-prep-pocket and store it in an alternative variable. At this point I am already puzzled by the line:
self.params["tool_in_spindle"] = self.current_tool
since I am wondering how this information "current_tool" was put into "self" in the first place.

Looking at: linuxcnc.org/docs/2.7/html/hal/halmodule.html I assume that I would make use of the passthrough example and connect the pins in a hal file as follows
net somesignalname passthrough.in iocontrol.0.tool-prep-pocket
?

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

More
30 Mar 2020 10:25 - 30 Mar 2020 10:25 #162092 by andypugh
halmodule is no help here, that can only interface with HAL and can not alter or create G-code parameters.

I am not clear if you are using a T-remap or just an M6-remap.

There is some interesting code in the T-remap.

I think what you might want is to add something like this to change_prolog
(status, oldpocket) = self.find_tool_pocket(self.current_tool)
if status == INTERP_OK:
    self.params["old_pocket"] = oldpocket
else:
     self.params["old_pocket"] = -1

Have you tried experimenting with iocontrol,v2 ?
I have never found the changes documented.
But:
linuxcnc.org/docs/2.7/html/config/ini-co....html#_emcio_section
EMCIO = iov2
is the magic incantation, I think.
Last edit: 30 Mar 2020 10:25 by andypugh.

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

More
30 Mar 2020 11:17 - 30 Mar 2020 12:02 #162099 by GuiHue
Thanks again, I'll look into it.

It is an M6 Remap. - sorry, for me this was somehow totally obvious;).

I have found this:
wiki.linuxcnc.org/cgi-bin/wiki.pl?ToolchangerProtocolProposal
Last edit: 30 Mar 2020 12:02 by GuiHue.

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

More
30 Mar 2020 22:44 #162175 by andypugh
I think some of that might have gone in, but the developer who wrote that had a falling-out with other LinuxCNC devs and stopped working on LinuxCNC. It isn't clear how far through that work he got.

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

More
31 Mar 2020 21:00 - 31 Mar 2020 21:04 #162296 by GuiHue
Dear Andy,

I had a look at your ideas today:

1) Using an M66 to query the iocontrol.0.tool-prep-pocket using s32_2_float and motion.analog-in-00

This works very well and deals with both TxM6 in line or Tx M6 in separate lines. This will be the way forward to get the ATC going

2) stdglue as located in Master
Works fine without issues in my existing setup, doesn't change anything about the current_pocket and selected_pocket issues

3) Your sample lines of python
I managed to introduce them into the M6 part. The behavior of current_pocket remains the same.

4) EMCIO iov2
I have not tried this yet. Benefits and information appear to be limited. I might look into it in the future. For the time being, I am almost done with the M6 remap and am looking forward to a working rack change.
Last edit: 31 Mar 2020 21:04 by GuiHue.

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

More
31 Mar 2020 21:19 #162301 by andypugh

GuiHue wrote: 3) Your sample lines of python
I managed to introduce them into the M6 part. The behavior of current_pocket remains the same.


It will, however <old_pocket> should now give you the information you want.

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

More
08 Apr 2020 08:02 #163168 by GuiHue
I have managed to make to a workaround using a numbered variable to store the old pocket and obtain the new pocket using iocontrol.0.tool-prep-pocket and M66. I was unsure and not convinced if I can trust old_Pocket and have thus changed it for the little helper with the numbered variable. The finalized macro can be found here:
github.com/GuiHue/myfenjalinuxcnc/blob/c...cros/rack_change.ngc

It still has some quirks due to the specifics of my valve setup. Changes to T0 produce awkward results, but that is something I can take care of in due time. I am currently very happy, that it works and have completed the first jobs will full ATC. Thanks again for the advice.

A video of the whole thing in action can be found here:

(German language only at this time - sorry)

In other news: I come across rene-dev the other day in a different community and have tested his 2.8-pocket-fix branch which appears to be working and will hopefully be included in the 2.8 release.
The following user(s) said Thank You: akb1212, Mara2000

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

Time to create page: 0.102 seconds
Powered by Kunena Forum