Remap M6 with "toolchange with length-probe"

More
29 Oct 2012 00:31 #25954 by h_munktell
Hello,

I'm quite new to this, but I'm trying to setup my machine with the "toolchange with length-probe" from sim/remap. Run into a few problems. Linuxcnc is on 2.6.0-pre0-3255-gce55978. Fixed a physical probe and it works. Made a simple program:
( Made using CamBam - http://www.cambam.co.uk )
( Untitled 10/20/2012 9:09:54 PM )
( T1 : 3.175 )
( T2 : 3.175 )
G21 G90 G64 G40
G0 Z3.0
( T1 : 3.175 )
T1 M6
( Profile1 )
G17
M3 S1000
G0 X35.5875 Y19.0
G1 F300.0 Z0.0
G3 F600.0 X10.7063 Y33.3652 I-16.5875 J0.0
G3 Y4.6348 I8.2938 J-14.3652
G3 X35.5875 Y19.0 I8.2938 J14.3652
( Profile2 )
G0 Z3.0
( T2 : 3.175 )
T2 M6
g43.1 z[#5063-#1000] (set new tool offset)
M3 S1000
G0 X35.5875 Y19.0
G1 F300.0 Z0.0
G3 F600.0 X10.7063 Y33.3652 I-16.5875 J0.0
G3 Y4.6348 I8.2938 J-14.3652
G3 X35.5875 Y19.0 I8.2938 J14.3652
G0 Z3.0
M5
M30

Workflow is:
1. Home machine
2. Touchoff all axes to workpiece in G54
3. Start program.

Problem with the original manual_change.ngc is that the M73 when exiting the sub reverts the tool length offset (G43) to the state before the sub was executed, effectivly canceling out the tool length offset calculated in the sub for anything other than the reference tool.

Fixed this by changing to M70 in the beginning of the sub, and M72 in the end of the sub. But after M72, I added the g43.1 z[#5063-#1000] . This works good with the above program.

Problem now is that after the first run of the program, I want to change tool, touchoff on workpiece and run it a second time. This time there is problem with the offsets, Z0 after the sub is not on workpiece. I suspect it's because after the first run of the program G43.1 is still in use, and I touch off with this, then sub changes g43.1 and messes up my Z0 somehow. If I MDI a G43 before touching off Z inbetween programs, everything is working. But I do not want to do this G43 manually before touch off every time, sometime I will forget it, be sure about it....

Any ideas on how to solve this I would appreciate.

Best regards
Henrik

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

More
29 Oct 2012 01:48 #25962 by BigJohnT
Do you have to load a tool then touch off the Z?

Just a SWAG but it seems you need to set the tool table with G10 L11 in a sub to touch off on the fly in a subroutine... IIRC I do something like this on my lathe to set a new tool on the turret.

John

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

More
29 Oct 2012 06:58 #25971 by andypugh

Problem with the original manual_change.ngc is that the M73 when exiting the sub reverts the tool length offset (G43) to the state before the sub was executed, effectivly canceling out the tool length offset calculated in the sub for anything other than the reference tool.

I think that the original application of that demo was for a machine with no repeatable tool-length, and the idea is that the machine re-probes on every tool change.
If you want the tool length to be persistent then you need to store the length to the tool table using G10 (which has a number of options which I can't recall, but are documented)

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

More
11 Dec 2012 05:41 #27540 by h_munktell
Thanks for the replies, been a while, and now I have got the time to work on this and found a solution. The problem was that G49 was still in use when the probing started. And that screwed up things. I added just before the probing:
; We need to cancel dynamic tool length offset before we probe. Save Z, G49 and restore Z to current coordinate system:
#1001=#5422
G49
G10 L20 P[#5220] Z[#1001]

And now it works :) If it is a good solution I do not know, but works for me right now. But I think it would be great if there was a named parameter for the dynamic tool length offset.

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

More
11 Dec 2012 23:25 #27586 by mhaberler

Problem with the original manual_change.ngc is that the M73 when exiting the sub reverts the tool length offset (G43) to the state before the sub was executed, effectivly canceling out the tool length offset calculated in the sub for anything other than the reference tool.

I think that the original application of that demo was for a machine with no repeatable tool-length, and the idea is that the machine re-probes on every tool change.
If you want the tool length to be persistent then you need to store the length to the tool table using G10 (which has a number of options which I can't recall, but are documented)


well I rather think the demo was written by somebody who didnt proper check results :sick:
-m
The following user(s) said Thank You: bevins

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

More
12 Dec 2012 03:59 #27599 by h_munktell

well I rather think the demo was written by somebody who didnt proper check results :sick:
-m


Well' I'm glad "somebody" did not, have learnt a great deal of linuxcnc because this :cheer: Keep up the good work!

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

Time to create page: 0.318 seconds
Powered by Kunena Forum