/ nc_files / probe / basic_probe / macros / probe_front_outside.ngc
probe_front_outside.ngc
 1  (author: Chris P)
 2  (version: 0.4)
 3  (date: 04/25/19)
 4  
 5  (Probe front top side for y,z 0,0 position)
 6  (Start probe position is over front edge of stock)
 7  (inside the step off width distance and within max z distance)
 8  (ensure all settings have been set properly according to help diagrams)
 9  
10  o<probe_front_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_y> = #[5202 + [20 * #5220]]
34  
35      (Probe Tool Safety Check)
36    o<110> if [#5400 NE #<probe_tool_number>]
37    (MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
38     o<Probe_front_outside> return
39    o<110> endif
40  
41    (Probe Diameter)
42    #<probe_diameter> = #5410
43  
44    (Probing depth from the z probed clearance height, used for z moves)
45    #<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
46  
47    (Probe Y Positioning Move, Step Off Width)
48    G91
49    G0 Y-[#<step_off_width>]
50  
51    (Probe Y Positioning Move, to Probing Depth)
52    F[#<probe_fast_fr>]
53    G1 Z-[#<z_probe_stack>]
54  
55    (Call sub "probe_y_plus" to Probe y+ side of Workpiece)
56    o<probe_y_plus> call [#1][#3][#4][#8][#9][#10]
57  
58    #<y_plus_zero_edge> = #<_value>
59  
60    (value returned safety check, aborts if no value returned)
61    o<120> if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
62      (MSG, Missing Y Sub returned edge parameter, aborting)
63      o<probe_front_outside> return
64    o<120> endif
65  
66    (Probe Completion Move to Z Clearance Plane, and Y Zero)
67    G91
68    G0 Z[#<z_probe_stack>]
69    G90
70    G0 Y[#<y_plus_zero_edge>]
71  
72    (probe mode rules for WCO or probe position measuring only)
73    o<130> if [#<probe_mode> EQ 0]
74      (Record Zero in selected axes and WCO)
75      G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
76      o<probe_front_outside> return
77    o<130> endif
78  
79  o<probe_front_outside> endsub
80  
81  M2 (end program)
82