Non-random ATC, gmoccapy & tool pockets numbers

More
09 Oct 2019 20:45 #147596 by dm17ry
i'm configuring the ATC on a Mazak VQC15 which is a 16-position geneva wheel driven chain with tools being put in/out by the spindle moves. it was mostly straight-forward, but i have never worked with an ATC before so have some doubts.

my M6 routine assumes pockets 1..16 are in the ATC magazine and pockets >16 for manually loaded tools. my idea was to try to keep most of the tools in the table and just change pockets in the table for ones i need for the program.

but in the current non-random toolchanger implementation the pocket number column in the tool table is ignored and the row number is used as a pocket number instead. but neither the tool edit GUI nor gmoccapy displays this row number. both can sort the table by "pocket" column, but you still have be careful not to miss any sequential pocket number. which is a bit odd, imho...

i was thinking about patching the loadToolTable() function to honor the P column and return an error if there are any duplicates but not sure if i'm missing something... do i?

2 andypugh: i also had to modify the carousel.comp in a couple of places:
a. incremented the position read from the binary position feedback inputs by one, so that "0000" means 1 and "1111" means 16. otherwise it wouldn't move to to position 0.
b. changed "pocket-number" and "current-position" type from signed to float to directly connect them to motion.analog-in/out and read/set from g-code.

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

More
10 Oct 2019 12:43 #147633 by pl7i92
if there is no tool in the pocket the toolchange does complete with no tool loaded but with the table settings to the tool
so just load manuell the tool by pressing the buttons on the control panel and it there for use
if there are indicators that a real tool needs to be you need a manuell tool change setup to the ATC

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

More
18 Oct 2019 12:52 #148189 by andypugh
Which version of LinuxCNC are you using? The iocontrol.0.tool-prep-pocket pin should give the P-number, not the index.
This was (supposedly) fixed back in 2014
github.com/LinuxCNC/linuxcnc/commit/3133...89072b107882cae36403

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

More
18 Oct 2019 19:00 #148216 by dm17ry
aha, thanks, i see. i'm using 2.8, but i don't use iocontrol pins. instead in change.ngc i use
#<_current_pocket> / #<_selected_pocket>
vars which are coming directly from interp._setup.selected_pocket and are indexes to the tool table

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

More
18 Oct 2019 21:34 #148226 by andypugh
This might work with a toolchange (or might not)

What do you see in #<_hal[iocontrol.0.tool-prep-pocket]> ?
You might need to activate the feature:
linuxcnc.org/docs/2.8/html/remap/remap.h...i_file_configuration
(Which reminds me, making that default to on was on my list)
The following user(s) said Thank You: GuiHue

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

More
27 Mar 2020 08:54 #161695 by GuiHue
Dear Andy,

thanks for this useful little bit of advice. It has helped me in my endeavor to get a rack style tool change going.

However, while iocontrol.0.tool-prep-pocket refers to the correct pocket of the new tool indicated by T##, it does not allow me to get a reference on the pocket to which the #<tool_in_spindle> should be returned to.
Is there a hack or work around to get that information regardless?

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

More
28 Mar 2020 14:05 #161807 by andypugh

Is there a hack or work around to get that information regardless?


The named parameters docs contain:

#<_current_tool> - Return number of the current tool in spindle. Same as #5400.

#<_current_pocket> - Return pocket number of the current tool.

#<_selected_tool> - Return number of the selected tool post a T code. Default -1.

#<_selected_pocket> - Return number of the selected pocket post a T code. Default -1 (no pocket selected).

( linuxcnc.org/docs/2.7/html/gcode/overview.html#gcode:parameters )

I think that until the M6 is actioned #<_current_pocket> should tell you where to put the tool away?

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

More
29 Mar 2020 20:37 #162020 by GuiHue
Hi,
I am aware of those parameters, both in their regular, as well as the global (_) form. However, _current_pocket and _selected_pocket contain nonsense (i.e. the line number in the tool table).
#<_hal[iocontrol.0.tool-prep-pocket]> returns the correct selected pocket.

See Screenshot with tool.tbl, gmoccapy, rempa macro and terminal output.



There is one more thing that i have noticed.
If I enter the following lines in MDI:
T12
M6
Everything is fine and #<_hal[iocontrol.0.tool-prep-pocket]> in ngc macro will work as expected.

If I enter a combined command, e.g.:
T12M6
Then #<_hal[iocontrol.0.tool-prep-pocket]> returns 0.
Regular M6 Remap works fine.
Is this a known issue?

Version: most recent master
Attachments:

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

More
29 Mar 2020 21:11 #162024 by andypugh
Access to the hal pins from G-code comes with significant caveats. It can only reliably be used for getting values that apply at the point that the program starts.
It will sometimes give the right answer during a program, mostly after a queue-buster such as a tool change.

If the HAL pin is the reliable source then the dependable way to get it is to net that pin to a G-code analogue input and read it with M66.
(I would be the first to admit that this seems needlessly convoluted)


Which version of LinuxCNC are you using? I did actually think that this problem with the parameters had been fixed.

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

More
30 Mar 2020 06:00 #162063 by GuiHue
Hi Andy,

as always: Thank you for posting new ideas (M66). Somehow that did not occur to me... I agree, it is convoluted, but currently, I am working with "It ain't stupid if it works".

I am using version 2.9 and am regularly updating through sudo apt-get update after having added the 2.9 buildbot to the sources. Last update was about two days ago.

I think I remember (bit fuzzy there) to have checked _current_pocker/ _selected_pcoker before I went down the atc spindle rabbit hole. I guess that was successful, otherwise I would not have bothered. However, I am not sure anymore and, as can been from the screenshot above, cannot replicate the result from back then.

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

Time to create page: 0.183 seconds
Powered by Kunena Forum