/ nc_files / probe / basic_probe / macros / probe_back_right_inside.ngc
probe_back_right_inside.ngc
  1  (author: Chris P)
  2  (version: 0.1)
  3  (date: 04/25/19)
  4  
  5  (Probe back right inside corner for x,y,z 0,0,0 position)
  6  (Start probe position is over back right inside corner of stock)
  7  (inside the step off width square and within max z distance)
  8  (ensure all settings have been set properly according to help diagrams)
  9  
 10  o<probe_back_right_inside> sub
 11  
 12    (uses NGCGUI style arg spec)
 13    (number after "=" in comment is default value)
 14    #<probe_tool_number> = #1    (=99)
 15    #<max_z_distance> = #2       (=0.5000)
 16    #<max_xy_distance> = #3      (=0.5000)
 17    #<xy_clearance> = #4         (=0.1000)
 18    #<z_clearance> = #5          (=0.1000)
 19    #<step_off_width> = #6       (=0.5000)
 20    #<extra_probe_depth> = #7    (=0.0000)
 21    #<probe_slow_fr> = #8        (=0.0)
 22    #<probe_fast_fr> = #9        (=10.0)
 23    #<calibration_offset> = #10  (=0.0000)
 24    #<x_hint> = #11              (=1.0000)
 25    #<y_hint> = #12              (=1.0000)
 26    #<diameter_hint> = #13       (=1.0000)
 27    #<edge_width> = #14          (=0.5000)
 28    #<probe_mode> = #15          (=0)
 29  
 30    (Cancel G92 offsets)
 31    G92.1
 32  
 33    #<workspace_x> = #[5201 + [20 * #5220]]
 34    #<workspace_y> = #[5202 + [20 * #5220]]
 35  
 36    (Probe Tool Safety Check)
 37    o<110> if [#5400 NE #<probe_tool_number>]
 38    (MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
 39     o<probe_back_right_inside> return
 40    o<110> endif
 41  
 42    (Probe Diameter)
 43    #<probe_diameter> = #5410
 44  
 45    (Probing depth from the z probed clearance height, used for z moves)
 46    #<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
 47  
 48    (Probe X Positioning Move, Step Off Width X and Y)
 49    G91
 50    G0 X-[#<step_off_width>] Y-[#<step_off_width>]
 51  
 52    (Probe X Positioning Move, to Probing Depth)
 53    F[#<probe_fast_fr>]
 54    G1 Z-[#<z_probe_stack>]
 55  
 56    G90
 57    (Current X Position including offsets in current program units)
 58    #<x_start> = #5420
 59  
 60    (Call sub "probe_x_plus" to Probe x+ side of Workpiece)
 61    o<probe_x_plus> call [#1][#3][#4][#8][#9][#10]
 62  
 63    #<x_plus_zero_edge> = #<_value>
 64  
 65    (value returned safety check, aborts if no value returned)
 66    o<120> if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
 67      (MSG, Missing X Sub returned edge parameter, aborting)
 68      o<probe_back_right_inside> return
 69    o<120> endif
 70  
 71    (move to X start Position)
 72    G90
 73    G0 X[#<x_start>]
 74  
 75    (Current Y Position including offsets in current program units)
 76    #<y_start> = #5421
 77  
 78    (Call sub "probe_y_plus" to Probe y+ side of Workpiece)
 79    o<probe_y_plus> call [#1][#3][#4][#8][#9][#10]
 80  
 81    #<y_plus_zero_edge> = #<_value>
 82  
 83    (value returned safety check, aborts if no value returned)
 84    o<130> if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
 85      (MSG, Missing Y Sub returned edge parameter, aborting)
 86      o<probe_back_right_inside> return
 87    o<130> endif
 88  
 89    (move to Y start Position)
 90    G90
 91    G0 Y[#<y_start>]
 92  
 93    (Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
 94    G91
 95    G0 Z[#<z_probe_stack>]
 96    G90
 97    G0 X[#<x_plus_zero_edge>] Y[#<y_plus_zero_edge>]
 98  
 99    (probe mode rules for WCO or probe position measuring only)
100    o<140> if [#<probe_mode> EQ 0]
101      (Record Zero in selected axes and WCO)
102      G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
103      G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
104      o<probe_back_right_inside> return
105    o<140> endif
106  
107  o<probe_back_right_inside> endsub
108  
109  M2 (end program)
110