Have the following rows in a .ngc file run then pressing a button: o<touch-off-tool> sub
;#1 = 60 ; [ps_searchvel] search speed ;#2 = 10 ; [probe.ps_probe_max] search distance #3 = 6.5 ; [ps_probe_latch] probe distance #4 = 60 ; [probe.ps_probevel] probe velocity #5 = 120 ; [TOOLSENSOR]RAPID_SPEED] rapid speed #6 = 5 ; Clear distance after probe (preamble) M70 ; Save Modal State G17 G21 G40 G49 G59.3 G80 G90 G94 ; Cancel tool length compensation is important M64 P5 ; Select tool setter M64 P6 ; Turn on => select edge detector or tool setter G10L2P0 Z0 ; Zero coordinate system #<Z>=#<_Z> ; save start Z position G21 ; G20 use inch, G21 use mm for length units G91 ; Incremental distance mode F #4 ; Feed rate probe velocity G38.3 Z[-#3] ; Probe towards work piece stop on contact G38.2 signal error, G38.3 no error signal O113 if [#5070 EQ 0] ; Timeout? G90 ; Absolute distance mode M65 P6 ; Turn off => set probe input to false M72 ; Restore modal state M66 P4 L3 Q.1 ; Must wait otherwise not turned off, wait for not supposed to happen tool-released = false L3=>wait for high, must be here? (abort, Probe failed to make contact) ; Show error message O113 endif M65 P6 ; Turn off => set probe input to false (print, probe Z=#5063) G90 ; Absolute distance mode G10 L1 P#5400 Z#5063 ; G10 L2 set tool table, P tool number, Z length negative to measure opposite direction, #5400 = #<_current_tool> G90 ; Absolute distance mode, needed otherwise jog have problem!!! incremental ; Running in MDI mode and jog work afterwards but only sometimes if pressing the button from manual mode? G1 Z#<Z> F#5 ; Move back to start start point with rapid speed M72 ; Restore modal state o<touch-off-tool> endsub M2 Use the same file to measure probe length. P5 and P6 is to select if input should come from edge detector or tool setter. Parameter #3 probe distance I have set to a distance slightly shorter than spring length on tool setter in case it fail to detect contact. Tried to drill and thread a hole to connect tool setter top plate to digital input. Hardened steel so the drill did not even scratch it. Ended using a hose clamp. Nicklas Karlsson tor 2025-03-13 klockan 10:52 -0700 skrev John Dammeyer: > I'm back to trying to get my head around tool probing and tool length > sensing. > Say I have this in the psng_manual_change.ngc file. > > #<touch_result> = #5063 > #<setterheight> = #<_ini[TOOLSENSOR]SETTER_HEIGHT> > #<workheight> = #<_ini[PROBE_SCREEN]WORK_HEIGHT> > #<blockheight> = #<_hal[probe.blockheight]> > > ; Put new tool length into tool table. > G10 L1 P#<tool> Z[#<workheight> - #<setterheight> + #<touch_result>] > > From the MDI command line or from one of the AXIS menu items can I examine > these values? > I do know that for example that: > #<_ini[TOOLSENSOR]SETTER_HEIGHT> > > > Is loaded from the ini file > [TOOLSENSOR] > # Absolute distance of top of tool sensor when light comes on. Amount table > moves up. > SETTER_HEIGHT = 3.673 > > But after the statement > > #<setterheight> = #<_ini[TOOLSENSOR]SETTER_HEIGHT> > > Is there an interactive way of examining #<setterheight> or any of the > other parameters? > > I can add debugging statements to the .ngc G-Code file but I was wondering > about something interactive or table based? > > (debug, Tool Length = #<workheight> - #<setterheight> + #<touch_result>) > > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users