86 lines
2.3 KiB
Plaintext
86 lines
2.3 KiB
Plaintext
(author: Chris P)
|
|
(version: 0.2)
|
|
(date: 06/27/24)
|
|
|
|
(Probe Y plus direction to locate edge, end at clearance distance)
|
|
(Start probe position to the front 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_plus> sub
|
|
|
|
(uses NGCGUI style arg spec)
|
|
(number after "=" in comment is default value)
|
|
#<probe_tool_number> = #1
|
|
#<probe_slow_fr> = #2
|
|
#<probe_fast_fr> = #3
|
|
#<probe_traverse_fr> = #4
|
|
#<max_xy_distance> = #5
|
|
#<xy_clearance> = #6
|
|
#<calibration_offset> = #7
|
|
|
|
(Cancel G92 offsets)
|
|
G92.1
|
|
|
|
(Probe Tool Safety Check)
|
|
o100 if [#5400 NE #<probe_tool_number>]
|
|
(DEBUG, Specified probe tool %d#<probe_tool_number> not in spindle, aborting)
|
|
o<probe_y_plus> 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_plus_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>]
|
|
(return from sub)
|
|
o<probe_y_plus> return
|
|
o110 endif
|
|
|
|
(Move to xy_clearance distance for slow probe)
|
|
G90
|
|
G1 F[#<probe_traverse_fr>] Y[#<y_plus_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_plus_probed> = #5062
|
|
G90
|
|
G1 F[#<probe_traverse_fr>] Y[#<y_plus_probed> - #<xy_clearance>]
|
|
o120 endif
|
|
|
|
#<y_plus_zero_edge> = [#5062 + #<probe_center_offset>]
|
|
|
|
(defines the edge as y_probed_position for DRO reporting)
|
|
#<y_plus_probed_position> = #<y_plus_zero_edge>
|
|
|
|
(output to gui DRO "Y PROBED POSITION")
|
|
#1008 = #<y_plus_probed_position>
|
|
(DEBUG, EVAL[vcp.getWidget{"y_plus_probed_position"}.setValue{#1008}])
|
|
|
|
o<probe_y_plus> endsub [#<y_plus_zero_edge>]
|
|
|
|
M2 (end program)
|