(author: Chris P) (version: 0.4) (date: 04/25/19) (Probe top front edge angle for y,z 0,0 position and edge angle) (Start probe position is over front edge of stock, set edge width,) (step off width distance and within max z distance) (ensure all settings have been set properly according to help diagrams) o sub (uses NGCGUI style arg spec) (number after "=" in comment is default value) # = #1 (=99) # = #2 (=0.5000) # = #3 (=0.5000) # = #4 (=0.1000) # = #5 (=0.1000) # = #6 (=0.5000) # = #7 (=0.0000) # = #8 (=0.0) # = #9 (=10.0) # = #10 (=0.0000) # = #11 (=1.0000) # = #12 (=1.0000) # = #13 (=1.0000) # = #14 (=0.5000) # = #15 (=0) # = #16 (=0) (Cancel G92 offsets) G92.1 # = #[5202 + [20 * #5220]] (Probe Tool Safety Check) o<110> if [#5400 NE #] (MSG, Specified probe tool # not in spindle, aborting) o return o<110> endif (Probe Diameter) # = #5410 (Probing depth from the z probed clearance height, used for z moves) # = [# + # + #] # = #5420 (Probe Y Positioning Move, Step Off Width) G91 G0 Y-[#] (Probe Y Positioning Move, to Probing Depth) F[#] G1 Z-[#] (Call sub "probe_y_plus" to Probe y+ side of Workpiece) o call [#1][#3][#4][#8][#9][#10] # = #<_value> (value returned safety check, aborts if no value returned) o<120> if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing Y Sub returned edge parameter, aborting) o return o<120> endif (edge width move to edge second probing point) G91 F[#] G1 X[#] (Call sub "probe_y_plus" to Probe y+ side of Workpiece) o call [#1][#3][#4][#8][#9][#10] # = #<_value> (value returned safety check, aborts if no value returned) o<130> if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing Y Sub returned edge parameter, aborting) o return o<130> endif # = [# - #] # = [ATAN [#] / [#]] M68 E4 Q[#] M68 E3 Q[#] (Probe Completion Move to Z Clearance Plane, and Y Zero) G91 G0 Z[#] G90 G0 X[#] Y[#] (probe mode rules for WCO, Rotation and probe position measuring only) o<140> if [# EQ 0 AND # EQ 0] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[#] Y[# + #] o return o<140> endif (probe mode rules for WCO, Rotation and probe position measuring only) o<150> if [# EQ 0 AND # EQ 1] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[#] Y[# + #] R[#] o return o<150> endif o endsub M2 (end program)