3040T/touchoff-z-to-bead.ngc
2025-07-08 11:11:35 +02:00

40 lines
1.9 KiB
Plaintext

o<touchoff-z-to-Bead> sub
#<_TravelZ> = 0 ( machine Z coordinate for travelling, typically near max Z to avoid ever hitting the work )
#<_ProbeX> = 9.5 ( machine X coordinate of switch/touch-off plate )
#<_ProbeY> = 24.5 ( machine Y coordinate of switch/touch-off plate )
#<_ProbeFastZ> = -20 ( machine Z coord to move to before starting probe, longest tool should not touch switch at this Z )
#<_ProbeMinZ> = -70 ( machine Z coord to stop probe, shortest tool must touch switch at this Z, must be > min Z )
#<_ProbeRetract> = 0.5 ( small distance to retract before approaching switch/touch-off plate second time )
#<_ProbeFastFeed> = 3000 ( feed rate for moving to _ProbeFastZ )
#<_ProbeFeed1> = 750 ( feed rate for touching switch/touch-off plate first time )
#<_ProbeFeed2> = 3 ( feed rate for touching switch/touch-off plate second time )
#<_ProbeToBeadZ> = 13.1
m73
G30.1 ( save current position in #5181-#5183... )
G49 ( clear tool length compensation )
G90 ( use absolute positioning here )
G94 ( use feedrate in units/min )
G40 ( turn cutter radius compensation off here )
G54 (use coordinate system 1)
M49 (disable spindle speed and feed rate override controls)
G53 G0 Z[#<_TravelZ>] ( go to high travel level on Z )
G53 G0 X[#<_ProbeX>] Y[#<_ProbeY>] ( to probe switch )
G53 G1 F[#<_ProbeFastFeed>] Z[#<_ProbeFastZ>] ( move tool closer to switch -- we shouldn't hit it )
G54 G1 F[#<_ProbeFeed1>] G91 ( use relative positioning )
G38.2 Z[#<_ProbeMinZ> - #<_ProbeFastZ>] F[#<_ProbeFeed1>] ( trip switch slowly )
G4 P0.1
G0 Z[#<_ProbeRetract>] ( go up slightly )
G38.2 Z[#<_ProbeRetract>*-1.25] F[#<_ProbeFeed2>] ( trip switch very slowly )
G90 ( use absolute positioning )
G10 L20 p0 z[#<_ProbeToBeadZ>]
(DEBUG, #5063)
G53 G0 Z[#<_TravelZ>] ( return to safe level )
G53 G0 X[#5181] Y[#5182]
G53 G0 Z[#5183]
M48 (enable spindle speed and feed rate override controls)
o<touchoff-z-to-Bead> endsub
M2