Trouble Setting Up Fixed Toolsetter/Probe - SOLVED

More
12 Mar 2020 04:42 #159842 by HueyHQ
I've been trying to figure out the probing routine to reliably set my tool length into the tool table.

I have based it on this post here . But I'm getting strange results that I don't understand.

The subroutine is as follows:
O<tool_length> SUB

G53 G0 G90 Z0.	( move to high z position )

G49				( turn off tool compensation )						
G40				( turn off cutter compensation )
G90				( use absolute mode )

T21 M6

G59.3 G0 G90 X0. Y0.																
G91 G0
G38.2 Z-125 F400    					
G0 Z2.0
G38.2 Z-2.5 F10.0 
G0 Z2.0                      								
#<_ToolZRef> = #5063
    ( PRINT, Tool Z Ref is #<_ToolZRef> )
#<_ToolConv> = [#<_ToolZRef>*-1]
#<_ToolOffset> = [100 - #<_ToolConv>]
    ( PRINT, Calculated Tool Offset is #<_ToolOffset> )
    ( PRINT, Selected tool is 21 )
    ( PRINT,  )
G10 L1 P21 Z#<_ToolOffset>									
G90                                                                            							
G53 G0 Z0 

G43	T21	

O<tool-length> ENDSUB
M2

but when I repeat the sub several times, it alternates between the correct offset and a completely incorrect offset:
 Tool Z Ref is 42.021200 
 Calculated Tool Offset is 142.021200 
 Selected tool is 21.000000 
  
 Tool Z Ref is -185.571200 
 Calculated Tool Offset is -85.571200 
 Selected tool is 21.000000 
  
 Tool Z Ref is 42.033700 
 Calculated Tool Offset is 142.033700 
 Selected tool is 21.000000 
  
 Tool Z Ref is -185.583700 
 Calculated Tool Offset is -85.583700 
 Selected tool is 21.000000 

The correct calculated offset is -85.5712 for this particular tool, but 142.02 is completely wrong.

Disregarding the calculated offset and the selected tool (this works OK), the Tool Z Ref is equal to #5063 (Z probe) result from the G38.2 probe, and it this result that changes each time.

Can anyone let me know why it is doing this? I've spent the best part of a day trying different permutations but can't get it figured out!

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

More
12 Mar 2020 09:01 #159856 by HueyHQ
May be related to G43/G49? As suggested here :

Sometimes G43 is active after toolchange, and maybe your routine uses G49, cancel tollength, so at 2nd try it works correct.

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

More
12 Mar 2020 14:13 #159872 by MaHa
Did you try already to replace '#<_ToolConv> = [#<_ToolZRef>*-1]' by '#<_ToolConv> = ABS[#5063]' ?

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

More
12 Mar 2020 18:35 #159905 by HueyHQ
I did try getting rid of the #<_ToolZRef>, #<_ToolConv>, and #<_ToolOffset> calculations altogether, but it seems to be the probe result #5063 that varies each time.

I think you may be on to something with possible G43 and G49 conflict.

I have a multi-head spindle that runs remapped O-code to actuate the selected tool - maybe I need to put the G49 after the tool select?

I'll try that today. Thanks MaHa.

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

More
12 Mar 2020 19:01 #159910 by HueyHQ
Brilliant, my friend! You hit the nail on the head in your other post - G43/G49 conflict!

Sometimes G43 is active after toolchange, and maybe your routine uses G49, cancel tollength, so at 2nd try it works correct.

My tool change T21 M6 was placed after the G49 command, essentially reinstating the G43 Tool Length Offset as part of the remap.
Simply moving the toolchange (along with G59.3 coordinate move) to the top solved the issue!

Can't believe I worked on this all day yesterday, and just happened to come across your other post last night! I can't thank you enough.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum