Category: QtPyVCP
Thank you for the ideas. I didn't want to take the approach of needing to know a precise Z height of tool setter, because it feels cumbersome to me, however beneficial it may be. And I got away with that:) So, attached is the code of my take on the manual tool change macro. It works on my machine flawlessly and I think it's rather elegant solution. The procedure is noted in the macro itself and here's excerpt of the documentation:
(#####################################################################################)
( )
( Documentation )
( )
( This macro is for measuring and setting tool offset after manual change of the tool )
( in non-ATC spindles. It ensures (via G43), that the tip of the tool will be at the )
( same Z-height after change. It uses a touch tool setter in known XY position. The Z )
( position of the tool setter doesn't have to be known, nor precise. It only has to )
( be the same throughout the session. )
( )
( The macro fits the settings in Probing -> Tool Setter dialog in Probe Basic )
( It is meant to be used as M6 Remap: )
( )
( [RS274NGC] )
( SUBROUTINE_PATH = subroutines )
( REMAP=M6 modalgroup=6 ngc=modorinc-tool-change )
( )
( At the begining of a job, load the probing tool to the spindle. The tool could be )
( a sharp rod or anything that allows you to mark a WCS origin. The tool has to be in )
( tool table and has to have a number specified in #<probing_tool_number>, e.g. 999. )
( Load the tool with M6 T999 command or via the UI. )
( The spindle will go to a location, where it is easy to load the tool, by default )
( G53 [X0,Y0,Z0]. If the currently loaded tool is not #999, a built-in dialog will )
( appear, telling you to load the tool into spindle and press button to continue. )
( After loading, the spindle travels to tool setter's X,Y position in Z0 height. )
( When it is above the tool setter, a current position stored in #5422 is remembered. )
( Then it goes down to a Z height from which the probing starts. From there, it )
( initiates faster touch of the tool setter. If correct, it goes up a little bit and )
( repeats the touch with slower feedrate. If the second touch is correct a current )
( position stored in #5063 is remembered. )
( )
( The difference between the two offsets is an absolute distance between the tool tip )
( in Z0 and the tool setter. This value, measured with a probing tool is stored in )
( variable denoted by #<probing_tool_address>. )
( After successful touch-off of the probing tool, you can continue to mark the WCS )
( origin with it. Then start the program. The offset of the probing tool is set to 0 )
( and all subsequent tool changes will set the offset of the new tool based on the )
( difference of tool tip height of the probing tool. )
( The offsets are stored into tool table via G10 L1 and activated by G43. )
( )
(#####################################################################################)