Current Tool-number permanent?

More
25 Jun 2016 09:27 #76638 by andypugh

That does not seem to work either.


What sort of "not work"?
I have managed to make it work by
1) putting a file called "change.ngc" in the nc_files directory. (there are better places, but we can work on that later)
O<change> sub
M6
#4999 = #5400
O<change> endsub
m2
2) putting
REMAP=M6 modalgroup=6 ngc=change
In the [RS274NGC] section of the INI file
3) Adding parameter 4999 to the .var file associated with the config to make it "sticky"

(I tried adding #5400 to the .var file, but that doesn't work. Perhaps it should be made to)

This does only solve the problem if saving the last-loaded tool for next time, the G61 at startup is a separate problem.

But it does not work because cinci.var file is already opened by LinuxCNC so writing is not possible. Is there an example of Python writing variables?


Yes, in fact there is an example in the built-in files that are associated with remapping routines.
github.com/LinuxCNC/linuxcnc/blob/master...glue/stdglue.py#L109
The following user(s) said Thank You: terkaa

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

More
25 Jun 2016 12:27 #76639 by terkaa
Hi,

Ok I went steps through again and yes it does work now. I defined SUBROUTINE_PATH = macros and put change.ngc there. Reading this saved tool number I arranged by:

MDI_COMMAND = M61 Q#4999 in ini
and
net machine_enabled halui.mdi-command-00 in HAL

Tero

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

More
29 Jun 2016 21:19 #76804 by andypugh
This made me start a whole new wiki page:
wiki.linuxcnc.org/cgi-bin/wiki.pl?This_Should_Be_Easier

Hopefully this perfectly reasonable requirement will be easier in the next release.

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

More
30 Jun 2016 04:51 #76820 by terkaa
Hi,

This method also has one problem. I made command M6 T0 to remove current tool from spindle and leave spindle empty. If tool number in .var file is 0 then M61 Q#4999 sets tool number = -1 That is still a problem on my configuration.

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

More
30 Jun 2016 09:55 #76825 by andypugh

If tool number in .var file is 0 then M61 Q#4999 sets tool number = -1 That is still a problem on my configuration.


Do you have RANDOM_TOOCHANGER set to true?

The behaviour is all set here
github.com/LinuxCNC/linuxcnc/blob/2.7/sr.../iotask/ioControl.cc

But note that the last change to this file is
github.com/LinuxCNC/linuxcnc/commit/3218...41704632b7767cb6412f

So it seems that your problem is an actual bug that has been fixed.

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

More
30 Jun 2016 12:06 - 30 Jun 2016 12:06 #76834 by terkaa
Hi,

I did not set this as random, because it is not random. Is this fix valid on 2.7.4?


Tero
Last edit: 30 Jun 2016 12:06 by terkaa.

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

More
30 Jun 2016 13:04 - 30 Jun 2016 13:04 #76835 by andypugh

I did not set this as random, because it is not random.

What you have is correct, I was just checking.

Is this fix valid on 2.7.4?

As far as I can tell, yes. I have had a look at the code and can't quite track down where M61 is acted on. It may be that the fix only works for M6.

The easiest way to be sure may be to modify your system so that instead of:
MDI_COMMAND = M61 Q#4999 in ini

You have
MDI_COMMAND = O<reload_tool> CALL
and then have a reload_tool G-code macro along the lines of
O<reload_tool> SUB
O100 IF [#4999 EQ 0]
M6 T0
O100 ELSE
M61 Q#4999
O100 ENDIF
O<relaod_tool> ENDSUB
M2

Or similar.
Last edit: 30 Jun 2016 13:04 by andypugh.

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

More
30 Jun 2016 14:32 #76844 by Todd Zuercher
I've been watching this from afar with mild interest. I've not set up any Linuxcnc machines with tool changers but, I do have one who is a good candidate for a retrofit with one.

Might it work if you set up the changer as a random, set up a T0 as NO TOOL, then remapping M6 to do two tool changes, exchanging T0 with the tool in the spindle and using it as a place holder to keep the pocket empty?
Kind of like this.
T0 in spindle
command T2 M6 would put T0 in pocket 2
next tool change
T5M6 (remap would do T0M6 to put too 2 back in pocket 2 then T5M6 to pick up tool 5 and put T0 in pocket 5)

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

More
19 Sep 2016 11:32 #80600 by terkaa
Hi,

For some reason this only works randomly. Sometimes after reboot there is correct tool no but mostly there is 0. I will go around this by adding M6 T0 at the end of program so tool pot will be empty when machine is shutdown.


Tero

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

Time to create page: 0.106 seconds
Powered by Kunena Forum