; cornerll3 ; Rick G May 15, 2011 ; Edit Feb 18, 2012 ; UNTESTED CONCEPT edit for your use before trying ; for using probe to find corner and top of work and set this position as X0 Y0 Z0 ; the idea is to make new set ups on a mill faster and more accurate with the use of a probe ; long version with many comments, MSGs, pauses, etc most moves with G38.n to protect probe and alert operator ; use to set X0Y0 as rear left corner of vise or lower left corner of workpiece ; set Z0 as top of vise or work at X Y location specified ; starts by probing Y edge then searches by search increment in negative direction for end of target along Y axis till it finds end or search maximum ; after finding end of target probes X edge ; uses G92 to set X and Y axis at probe position minus radius of probe plus correction ; travel to Xcord Ycord to set Z ; uses G92 to set Z at probe position plus correction ; many moves are done with G91 Incremental mode, but on error or completion set back to G90 Absolute mode o sub # = #1 (=10 Fast prb) # = #2 (=5 Slow prb) # = #3 (=.50 Prb dis) # = #4 (=.050 Prb ret) # = #5 (=.117 Prb Diam) # = #6 (=.25 X Pcord) # = #7 (=.25 Y Pcord) # = #8 (=0.00 X cor) # = #9 (=0.00 Y cor) # = #10 (=0.00 Z cor) # = #11 (=1.00 Y Smax) # = #12 (=.125 Y S inc) # = #13 (=0.00 X fin) # = #14 (=0.00 Y fin) # = #15 (=.125 Z fin) # = #16 (=.250 Z Safe) # = #17 (=.05 pause) G40 (Cancel cutter radius compensation) G49 (Cancel tool length offset) G91 (Incremental mode) G38.3 F#1 Y#3 (first Y probe) G4 P#17 (pause) O102 IF [#5070 gt 0] (first Y move OK) G38.5 F#1 Y-.010 (retract till probe clears) G4 P#17 G38.3 F#1 Y[0 - #4] (retract to set up for slow probe) G4 P#17 O103 IF [#5070 gt 0] (MSG, Probe not complete unexpected Y hit on retract) G90 M2 O103 ENDIF G38.3 F#2 Y[#4 +.020] (slow final Y probe) G4 P#17 O105 IF [#5070 lt 1] (MSG, Probe not complete Y missed slow probe) G90 M2 O105 ENDIF G92 Y[0-[[#5 / 2] + #9]] (set Y to 0 - 1/2 of probe diameter plus correction) (MSG, Probe Y complete and set) G38.5 F10 Y-.010 (move Y off target) G4 P#17 G38.3 F#1 Y[0 - #4] (retract Y) G4 P#17 O104 IF [#5070 gt 0] (MSG, Probe not complete unexpected Y hit on retract) G90 M2 O104 ENDIF ; Y WORKED OK ; MOVE X UP TO LOOK FOR END OF VISE G38.3 F#1 X[0 - #12] G4 P#17 O108 IF [#5070 gt 0] (MSG, Probe not complete unexpected X hit) G90 M2 O108 ENDIF O110 WHILE [#11 gt 0] G38.3 F#1 Y[#4 + #5] G4 P#17 O112 IF [#5070 gt 0] ; Y hit G38.5 F#1 Y-.010 G4 P#17 G38.3 F#1 Y[0 - #4] ; back off Y G4 P#17 O114 IF [#5070 gt 0] (MSG, Probe not complete unexpected Y hit on retract2) G90 M2 O114 ENDIF #11 = [#11 - #12] O115 If [#11 lt 0] (MSG, Probe not complete X search limit reached) G90 M2 O115 ENDIF G38.3 F#1 X[0 - #12] ; move X up G4 P#17 O116 IF [#5070 gt 0] ;IF X hits (MSG, Probe not complete unexpected X hit) G90 M2 O116 ENDIF O112 ELSE #11 = -1 O112 ENDIF ;found end of target O110 ENDWHILE ;ready to probe X G38.3 F#1 X#12 G4 P#17 O120 IF [#5070 gt 0] G38.5 F#1 X-.010 G4 P#17 G38.3 F#1 X[0 - #4] G4 P#17 O119 IF [#5070 gt 0] (MSG, Probe not complete unexpected X hit on retract) G90 M2 O119 ENDIF G38.3 F#2 X[#4 + .020] (slow final X probe) G4 P#17 O121 IF [#5070 lt 1] (MSG, Probe not complete X missed) G90 M2 O121 ENDIF ;set X G92 X[0-[[#5 / 2] + #8]] (set X to 0 - 1/2 of probe diameter plus correction) (MSG, Probe X complete and set) G38.5 F#1 X-.010 (move X off target) G4 P#17 G38.3 F#1 X[0 - #4] (retract X) G4 P#17 O123 IF [#5070 gt 0] (MSG, Probe not complete unexpected X hit on retract 2) G90 M2 O123 ENDIF O120 ELSE (MSG, Probe not complete X failed) G90 M2 O120 ENDIF (X PROBE) ;now go to the X Y position to set Z G38.3 F#1 Z#16 G4 P#17 O124 IF [#5070 gt 0] (MSG, Probe not complete unexpected Z hit on retract) G90 M2 O124 ENDIF ;go to x position G90 G38.3 F#1 X#6 G91 G4 P#17 O122 IF [#5070 gt 0] (MSG, Probe not complete unexpected X hit before Z) G90 M2 O122 ENDIF ;go to y position G90 G38.3 F#1 Y#7 G91 G4 P#17 O125 IF [#5070 gt 0] (MSG, Probe not complete unexpected Y hit before Z) G90 M2 O125 ENDIF ;set z G38.3 F#1 Z[0 - #3] G4 P#17 O126 IF [#5070 lt 1] (MSG, Probe not complete Z missed) G90 M2 O126 ENDIF G38.5 F#1 Z.010 (move Z off target) G4 P#17 G38.3 F#1 Z#4 G4 P#17 O129 IF [#5070 gt 0] ;IF z hits on retract (MSG, Probe not complete Z hit on retract) G90 M2 O129 ENDIF G38.3 F#2 Z[0-[#4 +.020]] (slow final Z probe) G4 P#17 O128 IF [#5070 lt 1] (MSG, Probe not complete Z missed slow pass) G90 M2 O128 ENDIF G92 Z[0 + #10] (set Z to 0 plus correction) (MSG, Probe Z complete and set) G4 P#17 G38.5 F#1 Z.010 G4 P#17 G38.3 F#1 Z#4 O130 IF [#5070 gt 0] ;IF z hits on retract (MSG, Probe not complete Z failed to clear target) G90 M2 O130 ENDIF O102 ELSE (MSG, Probe not complete Y failed) G90 M2 O102 ENDIF (Y PROBE) G90 (Absolute mode) G38.3 F#1 Z#16 G38.3 F#1 X#13 G38.3 F#1 Y#14 G38.3 F#1 Z#15 (MSG, Probe sequence complete) ;M30 o endsub