/ nc_files / probe / basic_probe / macros / probe_front_left_outside.ngc
probe_front_left_outside.ngc
  1  (author: Chris P)
  2  (version: 0.4)
  3  (date: 04/25/19)
  4  
  5  (Probe front left top corner for x,y,z 0,0,0 position)
  6  (Start probe position is over front left 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_front_left_outside> 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_front_left_outside> 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)
 49    G91
 50    G0 X-[#<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    (Call sub "probe_x_plus" to Probe x+ side of Workpiece)
 57    o<probe_x_plus> call [#1][#3][#4][#8][#9][#10]
 58  
 59    #<x_plus_zero_edge> = #<_value>
 60  
 61    (value returned safety check, aborts if no value returned)
 62    o<120> if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
 63      (MSG, Missing X Sub returned edge parameter, aborting)
 64      o<probe_front_left_outside> return
 65    o<120> endif
 66  
 67    (Probe Y Positioning Move, up to Z clearance plane)
 68    G91
 69    G0 Z[#<z_probe_stack>]
 70  
 71    (Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
 72    G0 X[#<step_off_width>] Y-[#<step_off_width>]
 73  
 74    (Probe Y Positioning Move,to Probing Depth)
 75    F[#<probe_fast_fr>]
 76    G1 Z-[#<z_probe_stack>]
 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_front_left_outside> return
 87    o<130> endif
 88  
 89    (Probe Completion Move to Z Clearance Plane, and XY Zero)
 90    G91
 91    G0 Z[#<z_probe_stack>]
 92    G90
 93    G0 X[#<x_plus_zero_edge>] Y[#<y_plus_zero_edge>]
 94  
 95    (probe mode rules for WCO or probe position measuring only)
 96    o<140> if [#<probe_mode> EQ 0]
 97      (Record Zero in selected axes and WCO)
 98      G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
 99      G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
100      o<probe_front_left_outside> return
101    o<140> endif
102  
103  o<probe_front_left_outside> endsub
104  
105  M2 (end program)
106