110 lines
3.2 KiB
Plaintext
110 lines
3.2 KiB
Plaintext
(author: Chris P)
|
|
(version: 0.2)
|
|
(date: 06/27/24)
|
|
|
|
(Probe valley in x, find Z0, X0 valley center position)
|
|
(Start probe position is over left side edge of valley wall)
|
|
(inside the step off width distance and within max z distance)
|
|
(ensure all settings have been set properly according to help diagrams)
|
|
|
|
o<probe_valley_x> 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)
|
|
#<edge_width> = #3024 (=0.5000)
|
|
#<x_hint_ridge_valley> = #3028 (=0)
|
|
#<y_hint_ridge_valley> = #3029 (=0)
|
|
#<probe_mode> = #3030 (=0)
|
|
#<calibration_offset> = #3032 (=0)
|
|
|
|
(Cancel G92 offsets)
|
|
G92.1
|
|
|
|
(Cancel Feedrate Override)
|
|
M50 P0
|
|
|
|
#<workspace_x> = #[5201 + [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_valley_x> return
|
|
o100 endif
|
|
|
|
(Probe Diameter)
|
|
#<probe_diameter> = #5410
|
|
|
|
(remove probe tip diam and cal offset from probed width calculations)
|
|
#<probe_diameter_offset> = [#<probe_diameter> - [#<calibration_offset> * 2]]
|
|
|
|
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
|
|
|
|
(Call sub "probe_z_minus_sub" to Probe top of Workpiece)
|
|
o<probe_z_minus_sub> call [#3014][#3015][#3016][#3017][#3020][#3021][#3030]
|
|
|
|
(Probe X Positioning Move, Step Off Width)
|
|
G91
|
|
F[#<probe_traverse_fr>]
|
|
G38.3 X[#<step_off_width>]
|
|
|
|
(Probe X Positioning Move, to Probing Depth)
|
|
F[#<probe_fast_fr>]
|
|
G38.3 Z-[#<z_probe_stack>]
|
|
|
|
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
|
|
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
|
|
|
|
#<x_minus_probed> = #5061
|
|
|
|
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
|
|
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3028][#3019][#3032]
|
|
|
|
#<x_plus_probed> = #5061
|
|
|
|
(probed center calculation)
|
|
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
|
|
|
|
(calculate X Width Probed)
|
|
#<raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
|
|
|
|
(Completed probed width calculations)
|
|
#<x_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
|
|
|
|
#1001 = #<x_probed_width>
|
|
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1001}])
|
|
|
|
#1002 = #<x_center_probed>
|
|
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
|
|
|
|
(Probe Completion Move to Z Clearance Plane, and X Zero)
|
|
G90
|
|
F[#<probe_traverse_fr>]
|
|
G38.3 X[#<x_center_probed>]
|
|
G91
|
|
F[#<probe_traverse_fr>]
|
|
G38.3 Z[#<z_probe_stack>]
|
|
|
|
(probe mode rules for WCO or probe position measuring only)
|
|
o110 if [#<probe_mode> EQ 0]
|
|
(Record X Zero in selected WCO)
|
|
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
|
|
o110 endif
|
|
|
|
(Reinstate Feedrate Override)
|
|
M50 P1
|
|
|
|
o<probe_valley_x> endsub
|
|
|
|
M2 (end program)
|