Hi LukeH, thanks a lot for your answer.
You were right, I solved changing the line TOOL_CHANGE_POSITION=... for the ini section [TOOL
_CHANGE_POSITION]... and modifying the statement: O200 ELSEIF, now I can place my files.
There was some sort of offset in X and Y that was added after the third tool change, by deleting the G49 after M70 in the M6 file "tool-change.ngc" the problem has gone.
I'd be interested in finding additional optimizations for my machine configuration. Let's see if in these days I can make the video to better illustrate the process of my manual tool change.
M600 remap file:
Code:
O<tool-job-begin> SUB
( Filename: tool-job-begin.ngc )
( LinuxCNC Manual Tool-Change Subroutines for Milling Machines version 1.1: subroutine 2/2 )
( Intended to be run as a remapped M600 command. Used to indicate that the next tool change, M6, is the first tool of a job. )
#<_ToolDidFirst> = 0 ( new job, we haven't yet called <tool-change> for the first time )
(debug, utensile #<_ToolDidFirst>)
G49 ( clear tool height adjustment )
O<tool-job-begin> ENDSUB
M2
Z zero touch plate probe file:
Code:
o<tool-zero>sub
#<_ToolDidFirst> = 0 ( new job, we haven't yet called <tool-change> for the first time )
(DEBUG, utensile riferimento programma #<_ToolDidFirst>)
G49 ( clear tool height adjustment )
M9
M5
G80
G91
G94
G40
G4 P1
G38.2 Z[#<_ini[TOOLSENSOR]ZSEARCH>] F[#<_ini[TOOLSENSOR]PROBEFEED1>]
G0 Z#<_ini[TOOLSENSOR]PROBERETRACT>
G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F#<_ini[TOOLSENSOR]PROBEFEED2>
G4 P0.05
O102 IF [#<_hal[pyvcp.set_all_zero]>]
G10 L20 P1 Z#<_ini[TOOLSENSOR]H>
G10 L20 P2 Z#<_ini[TOOLSENSOR]H>
G10 L20 P3 Z#<_ini[TOOLSENSOR]H>
G10 L20 P4 Z#<_ini[TOOLSENSOR]H>
G10 L20 P5 Z#<_ini[TOOLSENSOR]H>
G10 L20 P6 Z#<_ini[TOOLSENSOR]H>
G10 L20 P7 Z#<_ini[TOOLSENSOR]H>
G10 L20 P8 Z#<_ini[TOOLSENSOR]H>
G10 L20 P9 Z#<_ini[TOOLSENSOR]H>
( MSG, Zero Z > Tutti Work-Offsets )
O102 ELSE
G10 L20 P0 Z#<_ini[TOOLSENSOR]H>
O102 ENDIF
M9
G90
G53 G0 Z-5
o<tool-zero>endsub
M2
M6 remap file:
Code:
O<tool-change> SUB
( see: http://www.linuxcnc.org/index.php/english/forum/10-advanced-configuration/5596-manual-tool-change--tool-lengh-touch-off?start=30#48235 )
#<Tool>=#<_current_tool>
O100 IF [EXISTS[#<_ToolDidFirst>] EQ 0]
#<_ToolDidFirst> = 0
O100 ENDIF
O105 IF [#<_ToolDidFirst> EQ 0]
G49
O105 ENDIF
G49
M6
M70
M9
M5
G90
G94
G40
O200 IF [#<_ToolDidFirst> EQ 0]
G53 G0 Z-5
G53 G0 X#<_ini[TOOLSENSOR]X> Y#<_ini[TOOLSENSOR]Y>
G53 G1 F#<_ini[TOOLSENSOR]PROBEFASTFEED> Z#<_ini[TOOLSENSOR]Z>
G91 G54 G1 F#<_ini[TOOLSENSOR]PROBEFEED1>
G38.2 Z[#<_ini[TOOLSENSOR]ZSEARCH> - #<_ini[TOOLSENSOR]Z>] F#<_ini[TOOLSENSOR]PROBEFEED1>
G0 Z#<_ini[TOOLSENSOR]PROBERETRACT>
G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F#<_ini[TOOLSENSOR]PROBEFEED2>
M9
G90
#<_ToolZRef> = #5063
#<_ToolZLast> = #<_ToolZRef>
G53 G0 Z-5
M72
#<_ToolDidFirst> = 1
O200 ELSEIF [#<_current_tool> EQ #<Tool>]
#<_ToolZLast> = #<_ToolZRef>
G53 G0 Z-5
M72
#<_ToolDidFirst> = 1
O200 ELSE
G53 G0 Z-5
#<ToolDiamMM> = #5410
O102 IF [#<_current_tool> EQ 0 AND #<ToolDiamMM> EQ 0]
G53 G0 Z-5
G30
(MSG, Cambiare la fresa e premere Start )
O102 ELSE
G53 G0 Z-5
G30
(DEBUG, Mettere la fresa #<_current_tool> diametro #<ToolDiamMM>mm, poi premere Start )
O102 ENDIF
M0
G53 G0 X#<_ini[TOOLSENSOR]X> Y[#<_ini[TOOLSENSOR]Y>]
G53 G1 F#<_ini[TOOLSENSOR]PROBEFASTFEED> Z#<_ini[TOOLSENSOR]Z>
G91 G54 G1 F#<_ini[TOOLSENSOR]PROBEFEED1>
G38.2 Z[[#<_ini[TOOLSENSOR]ZSEARCH>] - #<_ini[TOOLSENSOR]Z>] F[#<_ini[TOOLSENSOR]PROBEFEED1>]
G0 Z#<_ini[TOOLSENSOR]PROBERETRACT>
G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F[#<_ini[TOOLSENSOR]PROBEFEED2>]
M9
G90
#<_ToolZ> = #5063
G53 G0 Z-5
#<_ToolZLast> = #<_ToolZ>
M72
G43.1 Z[#<_ToolZ> - #<_ToolZRef>]
#<_ToolDidFirst> = 1
O200 ENDIF
O<tool-change> ENDSUB
M2
Changes in .ini file:
Code:
[RS274NGC]
RS274NGC_STARTUP_CODE = M600
FEATURES =30
REMAP=M6 modalgroup=6 ngc=tool-change
REMAP=M600 modalgroup=6 ngc=tool-job-begin
[TOOLSENSOR]
X = 50
Y = 517
Z = -110
H = 11.25
ZSEARCH = -170
PROBEFASTFEED = 1800
PROBEFEED1 = 250
PROBEFEED2 = 25
PROBERETRACT = 0.5
[PARKING_POSITION]
X = 10
Y = 600
Z = -5
[TOOL_CHANGE_POSITION]
X = 50
Y = 50
Z = -5
[EMCIO]
TOOL_CHANGE_QUILL_UP = 1
Additional macros:
Code:
o <g28> sub
G90 G0 G53 Z-5
G53 G0 X[#<_ini[PARKING_POSITION]X>] Y[#<_ini[PARKING_POSITION]Y>]
G53 G0 Z[#<_ini[PARKING_POSITION]Z>]
G28.1
o <g28> endsub
M2
Code:
o <g30> sub
G90 G53 G0 Z-5
G53 G0 X[#<_ini[TOOL_CHANGE_POSITION]X>] Y[#<_ini[TOOL_CHANGE_POSITION]Y>]
G53 G0 Z[#<_ini[TOOL_CHANGE_POSITION]Z>]
G30.1
o <g30> endsub
M2