106 lines
2.9 KiB
Plaintext
106 lines
2.9 KiB
Plaintext
(author: Chris P)
|
|
(version: 0.2)
|
|
(date: 06/27/24)
|
|
|
|
(Probe Y Minus direction and set Y 0 in current WCO)
|
|
(Start probe position to the back side edge of stock)
|
|
(inside the max xy distance with the probe tip below the stock top edge)
|
|
(ensure all settings have been set properly according to help diagrams)
|
|
|
|
o<probe_y_minus_wco> sub
|
|
|
|
(uses NGCGUI style arg spec)
|
|
(number after "=" in comment is default value)
|
|
#<probe_tool_number> = #3014 (=99)
|
|
#<probe_slow_fr> = #3015 (=0)
|
|
#<probe_fast_fr> = #3016 (=10.0)
|
|
#<probe_traverse_fr> = #3017 (=50)
|
|
#<max_xy_distance> = #3018 (=0.5000)
|
|
#<xy_clearance> = #3019 (=0.1000)
|
|
#<max_z_distance> = #3020 (=0.5000)
|
|
#<z_clearance> = #3021 (=0.1000)
|
|
#<extra_probe_depth> = #3022 (=0.0000)
|
|
#<step_off_width> = #3023 (=0.5000)
|
|
#<probe_mode> = #3030 (=0)
|
|
#<calibration_offset> = #3032 (=0)
|
|
|
|
(Cancel G92 offsets)
|
|
G92.1
|
|
|
|
(Cancel Feedrate Override)
|
|
M50 P0
|
|
|
|
#<workspace_y> = #[5202 + [20 * #5220]]
|
|
|
|
(Probe Tool Safety Check)
|
|
o100 if [#5400 NE #<probe_tool_number>]
|
|
(DEBUG, Specified probe tool %d#<probe_tool_number> not in spindle, aborting)
|
|
M50 P1
|
|
o<probe_y_minus_wco> return
|
|
o100 endif
|
|
|
|
(Probe Diameter)
|
|
#<probe_diameter> = #5410
|
|
|
|
(Probe Radius)
|
|
#<probe_radius> = [#<probe_diameter> / 2]
|
|
|
|
(Probe Centerline Offset)
|
|
#<probe_center_offset> = [#<probe_radius> - #<calibration_offset>]
|
|
|
|
(Current Y Position including offsets in current program units)
|
|
#<y> = #5421
|
|
|
|
(Initiate Fast Y- Probe)
|
|
G91
|
|
F[#<probe_fast_fr>]
|
|
G38.2 y-[#<max_xy_distance>]
|
|
#<y_minus_probed> = #5062
|
|
|
|
(Probe Error check, #5070 will be 0 if failed)
|
|
o110 if [#5070 EQ 0]
|
|
(back to start point and feed)
|
|
G90
|
|
G1 F[#<probe_traverse_fr>] Y#<y>
|
|
F[#<probe_fast_fr>]
|
|
M50 P1
|
|
o<probe_y_minus_wco> return
|
|
o110 endif
|
|
|
|
(Move to xy_clearance distance for slow probe)
|
|
G90
|
|
G1 F[#<probe_traverse_fr>] Y[#<y_minus_probed> + #<xy_clearance>]
|
|
|
|
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
|
|
o120 if [#<probe_slow_fr> GT 0]
|
|
(Initiate Slow Y- Probe)
|
|
G91
|
|
F[#<probe_slow_fr>]
|
|
G38.2 Y-[#<xy_clearance> * 2]
|
|
#<y_minus_probed> = #5062
|
|
G90
|
|
G1 F[#<probe_traverse_fr>] Y[#<y_minus_probed> + #<xy_clearance>]
|
|
o120 endif
|
|
|
|
#<y_minus_zero_edge> = [#5062 - #<probe_center_offset>]
|
|
|
|
(defines the edge as y_probed_position for DRO reporting)
|
|
#<y_minus_probed_position> = #<y_minus_zero_edge>
|
|
|
|
(output to gui DRO "Y PROBED POSITION")
|
|
#1007 = #<y_minus_probed_position>
|
|
(DEBUG, EVAL[vcp.getWidget{"y_minus_probed_position"}.setValue{#1007}])
|
|
|
|
(probe mode rule for WCO or probe position measuring only)
|
|
o130 if [#<probe_mode> EQ 0]
|
|
(Record Y Zero in selected WCO)
|
|
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
|
|
o130 endif
|
|
|
|
(Reinstate Feedrate Override)
|
|
M50 P1
|
|
|
|
o<probe_y_minus_wco> endsub
|
|
|
|
M2 (end program)
|