Actions

Touch Probe

From PROBOTIX :: wiki

Probes:

Styli:

Mesh Software:

Probing G-code Routines:


Included with LinuxCNC

LinuxCNC is distributed with gridprobe.ngc and smartprobe.ngc

( gridprobe.ngc                                                         )
( Rectangular Probing                                                   )
(                                                                       )
( This program repeatedly probes in a regular XY grid and writes the    )
( probed location to the file 'probe-results.txt' in the same directory )
( as the .ini file                                                      )

(Configuration section)
G20   (Inches)
F4    (probe speed)

#1=0  (X start)
#2=.25 (X increment)
#3=13 (X count)

#4=0
#5=.25
#6=5 (Y count)

#7=.1 (Z safety)
#8=-.5 (Z probe)
(End configuration section)

(PROBEOPEN probe-results.txt)
#9=0 #10=0
G0Z#7
O1 while [#9 lt #6]
    #10=0
    G0 Y[#4+#5*#9]
    O2 while [#10 lt #3]
        O3 if [[#9/2] - fix[#9/2] eq 0]
            G0X[#1+#2*#10]
        O3 else      
            G0X[#1+#2*[#3-#10-1]]
        O3 endif
        G38.2Z#8
        G0Z#7
        #10=[#10+1]
    O2 endwhile
    #9=[#9+1]
O1 endwhile

(PROBECLOSE)
G0Z#7
G0X#1Y#4
M2


(probe-hole.ngc)
O<probe-hole> sub
G20 F25

#1000=#1 ;max radius

G91 G38.3 Z.00001
#1001=#5061
#1002=#5062

G91 G38.2 X#1000
#1003=#5061
G90 G0 X#1001
G91 G38.2 X[0-#1000]
#1004=#5061
#1001=[[#1003+#1004]/2]
G90 G0 X#1001

G91 G38.2 Y#1000
#1005=#5062
G90 G0 Y#1002
G91 G38.2 Y[0-#1000]
#1006=#5062
#1002=[[#1005+#1006]/2]
G90 G0 Y#1002


G91 G38.2 X#1000
#1003=#5061
G90 G0 X#1001
G91 G38.2 X[0-#1000]
#1004=#5061
#1001=[[#1003+#1004]/2]
G90 G0 X#1001

G91 G38.2 Y#1000
#1005=#5062
G90 G0 Y#1002
G91 G38.2 Y[0-#1000]
#1006=#5062
#1002=[[#1005+#1006]/2]
G90 G0 Y#1002


F0.1

G90 G0 X[#1003-0.005]
G91 G38.2 X0.010
#1003=#5061
G90 G0 X[#1004+0.005]
G91 G38.2 X-0.010
#1004=#5061
#1001=[[#1003+#1004]/2]
G90 G0 X#1001

G90 G0 Y[#1005-0.005]
G91 G38.2 Y0.010
#1005=#5062
G90 G0 Y[#1006+0.005]
G91 G38.2 Y-0.010
#1006=#5062
#1002=[[#1005+#1006]/2]
G90 G0 Y#1002
G91 G1 F1 X[0-#5071] Y[0-#5072]
G90

#1007=[#1003-#1004+[6.0/25.4]]
#1008=[#1005-#1006+[6.0/25.4]]
#1009=[[#1007+#1008]/2]
#1010=[atan[#1002]/[#1001]]
#1011=[sqrt[[#1001*#1001]+[#1002*#1002]]]

(debug,Dia #1009 Ang #1010 Dist #1011)
O<probe-hole> endsub


( smartprobe.ngc                                                        )
( Rectangular Probing                                                   )
(                                                                       )
( This program repeatedly probes in a regular XY grid and writes the    )
( probed location to the file 'probe-results.ngc' in the same directory )
( as the .ini file                                                      )

(Configuration section)
G20   (Inches)
F20    (probe speed)

#1=-1  (X start)
#2=.04 (X increment)
#3=51 (X count)

#4=-1
#5=.04
#6=51 (Y count)

#7=1.1 (Z safety)
#8=-.1 (Z probe)
(End configuration section)

(LOGOPEN,probe-results.ngc)
#9=0 #10=0
G0Z#7
O1 while [#9 lt #6]
    #10=0
    G0 Y[#4+#5*#9]
    O2 while [#10 lt #3]
        O3 if [[#9/2] - fix[#9/2] eq 0]
            #11=[#1+#2*#10]
        O3 else      
            #11=[#1+#2*[#3-#10-1]]
        O3 endif
        (#11 is X target)
        #5070=1
        O4 while [#5070 NE 0]
            G38.5 z#7
            G38.3 x#11
        O4 endwhile

        G38.2Z#8
        (LOG,G1 X#5061 Y#5062 Z#5063)
        #10=[#10+1]
    O2 endwhile
    G0Z#7
    #9=[#9+1]
O1 endwhile

(LOGCLOSE)
G0Z#7
G0X#1Y#4
M2