dodalem probe basic

This commit is contained in:
2025-12-14 18:29:18 +01:00
parent e110bc87e9
commit 4d0e075a44
820 changed files with 223384 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
# Probe Basic ATC Simulator
The stock atc_carousle subroutines are build around the pulse/index tool change,
so the gray-code carousel configs are untested and left as examples
Imperial and Metric version
vmc_index_inch.ini
vmc_index_metric.ini
Metric Machine Size
X 600mm
Y 200mm
Z 400mm
Imperial Machine Size
X 24"
Y 8"
Z 16"
Both machines have the X and Y home in the center of travel.
## Original Vismach Readme
This is a Vismach simulator config intended for testing out tool-changer configurations
The Vismach model combined with the sim_vmc.hal file features three axes
with home and limit switches, a carousel with both gray-code and pulse/index outputs,
a locking bar and a power drawbar.
There are two alternative configs, one demonstrating gray-code carousel coding and the other demonstrating
pulse/index.
Note that the carousel component also supports straight-binary and individual sensors.
The "virtual" VMC is created by the sim_vmc.hal file and defines the following signals
that my be used in the other HAL files
Axis positions
x-pos
y-pos
z-pos
Axis limits
x-pos-lim
x-neg-lim
y-pos-lim
y-neg-llm
z-pos-lim
z-neg-lim
Simulated Spindle
spindle-cmd - set spindle speed in rpm, negative for reverse
spindle-pos - the simulated spindle position (revs)
spindle-vel - the simulated spindle speed out
Toolchanger arm
arm-act - actuate the arm
arm-in - arm in limit switch
arm-out - arm out limit switch
Carousel lock
car-lock - activate the lock
car-locked
car-unlocked - limit switches
Drawbar
tool-release
tool-released
tool-locked
Carousel
car-fwd rotate clockwise
car-rev rotate anticlockwise
bit0
bit1
bit2
bit3
bit4 - Gray-coded carousel position

View File

@@ -0,0 +1,82 @@
# example of a machine specific settings
windows:
mainwindow:
kwargs:
confirm_exit: false
data_plugins:
tooltable:
provider: qtpyvcp.plugins.tool_table:ToolTable
kwargs:
columns: {{ ini.DISPLAY.tool_table_columns }}
offsettable:
provider: qtpyvcp.plugins.offset_table:OffsetTable
kwargs:
columns: {{ ini.DISPLAY.offset_columns }}
settings:
# VTK backplot view settings
backplot.show-grid:
default_value: false
backplot.show-program-bounds:
default_value: false
backplot.show-program-labels:
default_value: false
backplot.show-program-ticks:
default_value: false
backplot.show-machine-bounds:
default_value: false
backplot.show-machine-labels:
default_value: false
backplot.show-machine-ticks:
default_value: false
backplot.perspective-view:
default_value: false
backplot.multitool-colors:
default_value: True
rack-atc-setup.user-param-1:
description: user param label name
default_value: user param 1
persistent: true
rack-atc-setup.user-param-2:
description: user param label name
default_value: user param 2
persistent: true
rack-atc-setup.user-param-3:
description: user param label name
default_value: user param 3
persistent: true
rack-atc-setup.user-param-4:
description: user param label name
default_value: user param 4
persistent: true
rack-atc-setup.user-param-5:
description: user param label name
default_value: user param 5
persistent: true
tool-setter-probe.user-param-name-1:
description: tool setter user param 1
default_value: user param 1
persistent: true
tool-setter-probe.user-param-name-2:
description: tool setter user param 2
default_value: user param 2
persistent: true

View File

@@ -0,0 +1,12 @@
o<clamptool> sub
M65 P2 ; clamp the tool
M66 P5 L3 Q2 ; check the clamped tool sensor
o100 if [#5399 LT 0]
(abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds
o100 endif
o<clamptool> endsub [1]
M2

View File

@@ -0,0 +1,28 @@
o<extendatc> sub
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
#<atc_z_tool_change_height> = -3.9000
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o100 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o110 endif
G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height
M65 P1 ; Turn off carousel home solenoid
M64 P0 ; Move Carousel OUT
M66 P1 L3 Q5 ; check for carousel out position sensor
o120 if [#5399 LT 0]
M65 P0 ; switch off atc out solenoid
(abort, ATC not in position)
o120 endif
o<extendatc> endsub [1]
M2

View File

@@ -0,0 +1,10 @@
o<go_to_g30> sub
M73
G90
G53 G0 Z0
G30
o<go_to_g30> endsub
M2

View File

@@ -0,0 +1,20 @@
o<go_to_home> sub
M73
G90
G53 G0 Z0
G53 G0 X0 Y0
o100 if [EXISTS[#<_ini[traj]axes>]]
#<geometry> = #<_ini[traj]axes>
o100 endif
o110 if [#<geometry> EQ 4]
G53 G0 A0
o110 else if [#<geometry> EQ 5]
G53 G0 A0 C0
o110 endif
o<go_to_home> endsub
M2

View File

@@ -0,0 +1,20 @@
o<go_to_zero> sub
M73
G90
G53 G0 Z0
G0 X0 Y0
o100 if [EXISTS[#<_ini[traj]axes>]]
#<geometry> = #<_ini[traj]axes>
o100 endif
o110 if [#<geometry> EQ 4]
G0 A0
o110 else if [#<geometry> EQ 5]
G0 A0 C0
o110 endif
o<go_to_zero> endsub
M2

View File

@@ -0,0 +1,48 @@
(author: Chris P)
(version: 0.5)
(date: 06/27/24)
(load tool in spindle safety macro)
; This is called form the ATC page
; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently)
; Parameters #4001 to #4024 are used to track which tool is in which pocket (persistently)
; Parameter #4000 is not populated just used in the maths to calculate the above numbers
; #<number_of_pockets>: The number of pockets the ATC platter has, This is user set in the INI file via #<_ini[atc]pockets>
o<load_spindle_safety> sub
(PRINT, o<load_spindle_safety>)
#<load_spindle_tool_number> = #1 ; this is the value form the ATC tab
#<probe_tool_number> = #3014
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o101 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o101 endif
#10 = 0
#11 = 0 ; 1 if tool is already stored in carousel
o110 while [#10 LT #<number_of_pockets>]
#10 = [#10+1]
o120 if [#<load_spindle_tool_number> EQ #[4000 + #10]]
(DEBUG, the tool you are trying to load is already stored in carousel pocket %d#10)
#11 = 1
o120 endif
o110 endwhile
o130 if [#11 EQ 0]
M61 Q#<load_spindle_tool_number> G43 H#<load_spindle_tool_number>
#3991 = #<load_spindle_tool_number>
o130 endif
o140 if [#<load_spindle_tool_number> EQ #<probe_tool_number>]
S0 M5
o140 endif
o<program_coolant> call
o<load_spindle_safety> endsub
M2 (end program)

View File

@@ -0,0 +1,48 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(load tool in spindle safety macro)
; This is called form the Tool page
; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently)
; Parameters #4001 to #4024 are used to track which tool is in which pocket (persistently)
; Parameter #4000 is not populated just used in the maths to calculate the above numbers
; #<number_of_pockets>: The number of pockets the ATC platter has, This is user set in the INI file via #<_ini[atc]pockets>
o<load_spindle_safety_2> sub
(PRINT, o<load_spindle_safety_2>)
#<load_spindle_tool_number_2> = #1 ; this is the value form the TOOL tab
#<probe_tool_number> = #3014
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o101 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o101 endif
#10 = 0
#11 = 0 ; 1 if tool is already stored in carousel
o110 while [#10 LT #<number_of_pockets>]
#10 = [#10+1]
o120 if [#<load_spindle_tool_number_2> EQ #[4000 + #10]]
(DEBUG, the tool you are trying to load is already stored in carousel pocket %d#10)
#11 = 1
o120 endif
o110 endwhile
o130 if [#11 EQ 0]
M61 Q#<load_spindle_tool_number_2> G43 H#<load_spindle_tool_number_2>
#3991 = #<load_spindle_tool_number_2>
o130 endif
o140 if [#<load_spindle_tool_number_2> EQ #<probe_tool_number>]
S0 M5
o140 endif
o<program_coolant> call
o<load_spindle_safety_2> endsub
M2 (end program)

View File

@@ -0,0 +1,39 @@
o<m10> sub
; Move tool carousel best direction to pocket P
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<m10> P#<p>)
o100 if [#3989 NE 1]
M13
o100 endif
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o110 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o110 endif
#<steps> = [#3990 - #<p>]
(PRINT, o<m10> P#<p>, steps=#<steps>)
o120 if [#<steps> GT [#<number_of_pockets> / 2]]
#<steps>=[#<steps> - #<number_of_pockets>]
o120 endif
o130 if [#<steps> LT -[#<number_of_pockets> / 2]]
#<steps>=[#<steps> + #<number_of_pockets>]
o130 endif
o140 if [#<steps> GT 0]
M12 P[#<steps>]
o140 elseif [#<steps> LT 0]
#<steps>=[#<steps> * -1]
M11 P[#<steps>]
o140 endif
(PRINT, o<m10> endsub)
o<m10> endsub [1]
M2

View File

@@ -0,0 +1,50 @@
o<m11> sub
; Move tool carousel CW Parameter P number of steps
; Without parameter one step CW.
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<m11> P#<p>)
o100 if [#3989 NE 1]
(PRINT, atc not homed, homing)
M13
o100 endif
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o110 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o110 endif
o120 if [EXISTS[#<p>]]
#<steps_to_move> = #<p>
o120 else
#<steps_to_move> = 1
(tells the atc widget move 1 step forward)
o120 endif
(tells the atc widget how many steps to move and start moving forward)
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.rotate{#<steps_to_move>, "cw"}])
M64 P4 ; Move atc motor FWD
o130 do
M66 P4 L1 Q3 ; wait for rising edge on rotation index
o131 if [#5399 LT 0]
M65 P4 ; Stop atc motor
(abort, Failed to get rotation index)
o131 endif
#3990 = [[[#3990+2] MOD #<number_of_pockets>]-1] ; Pocket is no.1-#<number_of_pockets>
#<steps_to_move> = [#<steps_to_move>-1]
o130 while [#<steps_to_move> GT 0]
M65 P4 ; Stop motor
#<_my_current_pocket> = #3990
(PRINT, o<m11> endsub)
o<m11> endsub [1]
M2

View File

@@ -0,0 +1,50 @@
o<m12> sub
; Move tool carousel CCW Parameter P number of steps
; Without parameter one step CCW.
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<m12> P#<p>)
o100 if [#3989 NE 1]
(PRINT, atc not homed, homing)
M13
o100 endif
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o110 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o110 endif
o120 if [EXISTS[#<p>]]
#<steps_to_move> = #<p>
o120 else
#<steps_to_move>=1
(tells the atc widget move 1 step reverse)
o120 endif
(tells the atc widget how many steps to move and start moving reverse)
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.rotate{#<steps_to_move>, "ccw"}])
M64 P3 ; Move atc motor REV
o130 do
M66 P4 L1 Q3 ; wait for rising edge on rotation index
o131 if [#5399 LT 0]
M65 P3 ; Stop atc motor
(abort, Failed to get rotation index)
o131 endif
#3990 = [[[#3990-2] MOD #<number_of_pockets>]+1] ; Pocket is no.1-#<number_of_pockets>
#<steps_to_move> = [#<steps_to_move>-1]
o130 while [#<steps_to_move> GT 0]
M65 P3 ; Stop motor
#<_my_current_pocket> = #3990
(PRINT, o<m12> endsub)
o<m12> endsub [1]
M2

View File

@@ -0,0 +1,27 @@
o<m13> sub
; Move tool carousel CW until ATC zero
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<m13>)
#<number_of_pockets> = 12
o110 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o110 endif
#1 = 0
o120 while [#1 LT #<number_of_pockets>]
#1 = [#1+1]
#2 = #[4000+#1]
(DEBUG, EVAL[vcp.getWidget{"rackatc"}.store_tool{#1, #2}])
o120 endwhile
M61 Q#3991 G43 H#3991
(PRINT, o<m13> endsub)
o<m13> endsub [1]
M2

View File

@@ -0,0 +1,88 @@
o<m21> sub
; Use P-word as target pocket (if called as M21 Pn)
#<target_pocket> = #1
; --- Parameter assignments for clarity ---
#<rack_id> = #3979
#<rack_traverse_speed> = #3980
#<rack_z_load_height> = #3981
#<rack_safe_z_height> = #3982
#<rack_pocket_1_x> = #3983
#<rack_pocket_1_y> = #3984
#<rack_pocket_2_x> = #3985
#<rack_pocket_2_y> = #3986
#<pocket_1_x_clearance> = #3987
#<pocket_1_y_clearance> = #3988
; --- Calculate pocket position ---
#<dx> = [#<rack_pocket_2_x> - #<rack_pocket_1_x>]
#<dy> = [#<rack_pocket_2_y> - #<rack_pocket_1_y>]
#<pocket_index> = [#<target_pocket> - 1]
#<pocket_x> = [#<rack_pocket_1_x> + #<pocket_index> * #<dx>]
#<pocket_y> = [#<rack_pocket_1_y> + #<pocket_index> * #<dy>]
; --- Determine clearance position, axis, and direction ---
#<clearance_x> = #<pocket_x>
#<clearance_y> = #<pocket_y>
#<store_axis> = 0
#<store_sign> = 1
o100 if [#<rack_id> EQ 1] ; -Y to +Y, clearance +X, store -X
#<clearance_x> = #<pocket_1_x_clearance>
#<store_axis> = 1
#<store_sign> = -1
o100 elseif [#<rack_id> EQ 2] ; -Y to +Y, clearance -X, store +X
#<clearance_x> = #<pocket_1_x_clearance>
#<store_axis> = 1
#<store_sign> = 1
o100 elseif [#<rack_id> EQ 3] ; +Y to -Y, clearance +X, store -X
#<clearance_x> = #<pocket_1_x_clearance>
#<store_axis> = 1
#<store_sign> = -1
o100 elseif [#<rack_id> EQ 4] ; +Y to -Y, clearance -X, store +X
#<clearance_x> = #<pocket_1_x_clearance>
#<store_axis> = 1
#<store_sign> = 1
o100 elseif [#<rack_id> EQ 5] ; -X to +X, clearance +Y, store -Y
#<clearance_y> = #<pocket_1_y_clearance>
#<store_axis> = 2
#<store_sign> = -1
o100 elseif [#<rack_id> EQ 6] ; -X to +X, clearance -Y, store +Y
#<clearance_y> = #<pocket_1_y_clearance>
#<store_axis> = 2
#<store_sign> = 1
o100 elseif [#<rack_id> EQ 7] ; +X to -X, clearance +Y, store -Y
#<clearance_y> = #<pocket_1_y_clearance>
#<store_axis> = 2
#<store_sign> = -1
o100 elseif [#<rack_id> EQ 8] ; +X to -X, clearance -Y, store +Y
#<clearance_y> = #<pocket_1_y_clearance>
#<store_axis> = 2
#<store_sign> = 1
o100 else
(PRINT, "Error: Invalid rack_id!")
o<m21> return
o100 endif
; --- Motions ---
G90
G0 G53 Z[#<rack_safe_z_height>]
G0 G53 X[#<clearance_x>] Y[#<clearance_y>]
G1 G53 F[#<rack_traverse_speed>] Z[#<rack_z_load_height>]
M19
G4 P1
; Move into pocket - single axis, correct direction
o200 if [#<store_axis> EQ 1]
G1 G53 F[#<rack_traverse_speed>] X[#<pocket_x>]
o200 else
G1 G53 F[#<rack_traverse_speed>] Y[#<pocket_y>]
o200 endif
M24
G0 G53 Z[#<rack_safe_z_height>]
o<m21> endsub
M2

View File

@@ -0,0 +1,88 @@
o<m22> sub
; Use P-word as target pocket (if called as M22 Pn)
#<target_pocket> = #1
; --- Parameter assignments for clarity ---
#<rack_id> = #3979
#<rack_traverse_speed> = #3980
#<rack_z_load_height> = #3981
#<rack_safe_z_height> = #3982
#<rack_pocket_1_x> = #3983
#<rack_pocket_1_y> = #3984
#<rack_pocket_2_x> = #3985
#<rack_pocket_2_y> = #3986
#<pocket_1_x_clearance> = #3987
#<pocket_1_y_clearance> = #3988
; --- Calculate pocket position ---
#<dx> = [#<rack_pocket_2_x> - #<rack_pocket_1_x>]
#<dy> = [#<rack_pocket_2_y> - #<rack_pocket_1_y>]
#<pocket_index> = [#<target_pocket> - 1]
#<pocket_x> = [#<rack_pocket_1_x> + #<pocket_index> * #<dx>]
#<pocket_y> = [#<rack_pocket_1_y> + #<pocket_index> * #<dy>]
; --- Determine clearance position, axis, and direction ---
#<clearance_x> = #<pocket_x>
#<clearance_y> = #<pocket_y>
#<retrieve_axis> = 0
#<retrieve_sign> = 1
o100 if [#<rack_id> EQ 1] ; -Y to +Y, clearance +X, retrieve +X
#<clearance_x> = #<pocket_1_x_clearance>
#<retrieve_axis> = 1
#<retrieve_sign> = 1
o100 elseif [#<rack_id> EQ 2] ; -Y to +Y, clearance -X, retrieve -X
#<clearance_x> = #<pocket_1_x_clearance>
#<retrieve_axis> = 1
#<retrieve_sign> = -1
o100 elseif [#<rack_id> EQ 3] ; +Y to -Y, clearance +X, retrieve +X
#<clearance_x> = #<pocket_1_x_clearance>
#<retrieve_axis> = 1
#<retrieve_sign> = 1
o100 elseif [#<rack_id> EQ 4] ; +Y to -Y, clearance -X, retrieve -X
#<clearance_x> = #<pocket_1_x_clearance>
#<retrieve_axis> = 1
#<retrieve_sign> = -1
o100 elseif [#<rack_id> EQ 5] ; -X to +X, clearance +Y, retrieve +Y
#<clearance_y> = #<pocket_1_y_clearance>
#<retrieve_axis> = 2
#<retrieve_sign> = 1
o100 elseif [#<rack_id> EQ 6] ; -X to +X, clearance -Y, retrieve -Y
#<clearance_y> = #<pocket_1_y_clearance>
#<retrieve_axis> = 2
#<retrieve_sign> = -1
o100 elseif [#<rack_id> EQ 7] ; +X to -X, clearance +Y, retrieve +Y
#<clearance_y> = #<pocket_1_y_clearance>
#<retrieve_axis> = 2
#<retrieve_sign> = 1
o100 elseif [#<rack_id> EQ 8] ; +X to -X, clearance -Y, retrieve -Y
#<clearance_y> = #<pocket_1_y_clearance>
#<retrieve_axis> = 2
#<retrieve_sign> = -1
o100 else
(PRINT, "Error: Invalid rack_id!")
o<m22> return
o100 endif
; --- Motions ---
G90
G0 G53 Z[#<rack_safe_z_height>]
G0 G53 X[#<pocket_x>] Y[#<pocket_y>]
M19 ; spindle orientation
M24 ; unclamp drawbar to receive tool
G1 G53 F[#<rack_traverse_speed>] Z[#<rack_z_load_height>]
M25 ; clamp tool in spindle
; Move tool out of pocket - single axis, correct direction
o200 if [#<retrieve_axis> EQ 1]
G1 G53 F[#<rack_traverse_speed>] X[#<clearance_x>]
o200 else
G1 G53 F[#<rack_traverse_speed>] Y[#<clearance_y>]
o200 endif
G0 G53 Z[#<rack_safe_z_height>]
o<m22> endsub
M2

View File

@@ -0,0 +1,9 @@
o<m24> sub
(PRINT, o<m24>)
M64 P2 ; unclamp release the tool
(PRINT, o<m24> endsub)
o<m24> endsub [1]
M2

View File

@@ -0,0 +1,9 @@
o<m25> sub
(PRINT, o<m25>)
M65 P2 ; clamp grip the tool
(PRINT, o<m25> endsub)
o<m25> endsub [1]
M2

View File

@@ -0,0 +1,25 @@
(author: Chris P)
(version: 0.3)
(date: 06/27/24)
(m6 tool call with g43 offset applied)
o<m6_tool_call_atc_page> sub
#<tool_number_entry_atc_page> = #1
#<probe_tool_number> = #3014
T#<tool_number_entry_atc_page> M6
o100 if [1 EQ 1]
G43 H#<tool_number_entry_atc_page>
o100 endif
o110 if [#<tool_number_entry_atc_page> EQ #<probe_tool_number>]
S0 M5
o110 endif
o<program_coolant> call
o<m6_tool_call_atc_page> endsub
M2 (end program)

View File

@@ -0,0 +1,26 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(m6 tool call with g43 offset applied)
o<m6_tool_call_main_panel> sub
#<tool_number_entry_main_panel> = #1
#<probe_tool_number> = #3014
T#<tool_number_entry_main_panel> M6
o100 if [1 EQ 1]
G43 H#<tool_number_entry_main_panel>
o100 endif
o110 if [#<tool_number_entry_main_panel> EQ #<probe_tool_number>]
S0 M5
o110 endif
o<program_coolant> call
o<m6_tool_call_main_panel> endsub
M2 (end program)

View File

@@ -0,0 +1,26 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(m6 tool call with g43 offset applied)
o<m6_tool_call_tool_page> sub
#<tool_number_entry_tool_page> = #1
#<probe_tool_number> = #3014
T#<tool_number_entry_tool_page> M6
o100 if [1 EQ 1]
G43 H#<tool_number_entry_tool_page>
o100 endif
o110 if [#<tool_number_entry_tool_page> EQ #<probe_tool_number>]
S0 M5
o110 endif
o<program_coolant> call
o<m6_tool_call_tool_page> endsub
M2 (end program)

View File

@@ -0,0 +1,19 @@
o<move_head_above_carousel> sub
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
#<atc_z_tool_change_height> = -3.9000
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o100 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o110 endif
G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height
o<move_head_above_carousel> endsub [1]
M2

View File

@@ -0,0 +1,18 @@
o<move_tool_to_carousel_height> sub
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
#<atc_z_tool_change_height> = -3.9000
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o100 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o110 endif
G0 G53 Z#<atc_z_tool_change_height> ; rapid move to above the tool change height
o<move_tool_to_carousel_height> endsub [1]
M2

View File

@@ -0,0 +1,9 @@
%
o<on_abort> sub
G90
G40
G49
o<on_abort> endsub
%

View File

@@ -0,0 +1,11 @@
o<orientspindle> sub
; Orient the spindle with platter
(PRINT, o<orientspindle>)
M5 M9 ; stop all spindle motion and coolant
M19 R0 Q4 ; orient spindle
M5 ; turn off spindle lock
o<orientspindle> endsub [1]
M2

View File

@@ -0,0 +1,122 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe back left inside corner for x,y,z 0,0,0 position)
(Start probe position is over back left inside corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_back_left_inside_corner> 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_x> = #[5201 + [20 * #5220]]
#<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_back_left_inside_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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, Traverse Workpiece Top at Z Clearance Height plane)
G91
F[#<probe_traverse_fr>]
G38.3 X[#<step_off_width>] Y-[#<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
G90
(Current X Position including offsets in current program units)
#<x_start> = #5420
(Call sub "probe_x_minus_sub" to Probe x- side of Workpiece)
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_minus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_back_left_inside_corner> return
o110 endif
(move to X start Position)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_start>]
(Current Y Position including offsets in current program units)
#<y_start> = #5421
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_back_left_inside_corner> return
o120 endif
(move to Y start Position)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_start>]
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_minus_zero_edge>] Y[#<y_plus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_back_left_inside_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,118 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe back left top corner for x,y,z 0,0,0 position)
(Start probe position is over back left corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_back_left_top_corner> 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_x> = #[5201 + [20 * #5220]]
#<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_back_left_top_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_back_left_top_corner> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
F[#<probe_traverse_fr>]
G38.3 X[#<step_off_width>] Y[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_back_left_top_corner> return
o120 endif
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_plus_zero_edge>] Y[#<y_minus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_back_left_top_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,122 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe back right inside corner for x,y,z 0,0,0 position)
(Start probe position is over back right inside corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_back_right_inside_corner> 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_x> = #[5201 + [20 * #5220]]
#<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_back_right_inside_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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 X and Y)
G91
F[#<probe_traverse_fr>]
G38.3 X-[#<step_off_width>] Y-[#<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
G90
(Current X Position including offsets in current program units)
#<x_start> = #5420
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_back_right_inside_corner> return
o110 endif
(move to X start Position)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_start>]
(Current Y Position including offsets in current program units)
#<y_start> = #5421
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_back_right_inside_corner> return
o120 endif
(move to Y start Position)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_start>]
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_plus_zero_edge>] Y[#<y_plus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_back_right_inside_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,117 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe back right top corner for x,y,z 0,0,0 position)
(Start probe position is over back right corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_back_right_top_corner> 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_x> = #[5201 + [20 * #5220]]
#<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_back_right_top_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_back_right_top_corner> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move)
F[#<probe_traverse_fr>]
G38.3 X-[#<step_off_width>] Y[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_back_right_top_corner> return
o120 endif
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_minus_zero_edge>] Y[#<y_minus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_back_right_top_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,91 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(Probe back top side for y,z 0,0 position)
(Start probe position is over back edge of stock)
(inside the step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<Probe_back_top_side> 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_back_top_side> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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 Y Positioning Move, Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y[#<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_back_top_side> return
o110 endif
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_minus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o120 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
o120 endif
(Reinstate Feedrate Override)
M50 P1
o<Probe_back_top_side> endsub
M2 (end program)

View File

@@ -0,0 +1,8 @@
o<probe_cal_reset> sub
#3032 = 0
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o<probe_cal_reset> endsub
M2 (end program)

View File

@@ -0,0 +1,329 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe calibration offset using defined diam round boss)
(Start probe position is over center of stock in X and Y axis)
(within max z distance, ensure all settings have been)
(set properly according to help diagrams)
o<probe_cal_round_boss> 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)
#<cal_diameter> = #3033 (=0)
#<sq_cal_axis> = #3036 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<workspace_y> = #[5202 + [20 * #5220]]
#<workspace_z> = #[5203 + [20 * #5220]]
(clear current probe calibration offset)
#3032 = 0
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
(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_cal_round_boss> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probe Radius)
#<probe_radius> = [#<probe_diameter> / 2]
(Probe Centerline Offset)
#<probe_center_offset> = [#<probe_radius>]
(remove probe tip diam and cal offset from probed width calculations)
#<probe_diameter_offset> = [#<probe_diameter>]
#<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][#3032]
(Probe X Positioning Move, X hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 X-[#<cal_diameter>/2 + #<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_probed> = #5061
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
G91
F[#<probe_traverse_fr>]
G38.3 X[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
(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
(probed center calulation)
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
#1002 = #<x_center_probed>
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[#<cal_diameter>/2 + #<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
G91
F[#<probe_traverse_fr>]
G38.3 Y[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calulation)
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Move to z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Move to Y Center)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(Probe X Positioning Move, X hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 X-[#<cal_diameter>/2 + #<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_probed> = #5061
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
F[#<probe_traverse_fr>]
G38.3 X[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
(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
(probed center calulation)
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
(calculate X Width Probed)
o110 if [#<x_minus_probed> GT #<x_plus_probed>]
#<x_raw_width> = [#<x_minus_probed> - #<x_plus_probed>]
o110 else
#<x_raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
o110 endif
(Completed probed width calculations)
#<x_probed_width> = [#<x_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}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[#<cal_diameter>/2 + #<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
F[#<probe_traverse_fr>]
G38.3 Y[#<cal_diameter> + #<step_off_width> + #<xy_clearance>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_traverse_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calulation)
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
(calculate Y Width Probed)
o120 if [#<y_minus_probed> GT #<y_plus_probed>]
#<y_raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
o120 else
#<y_raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
o<probe_round_boss> return
o120 endif
(Completed probed width calculations)
#<y_probed_width> = [#<y_raw_width> - #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
#1010 = #<averaged_diam>
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
o130 if [#<cal_diameter> GT #<x_probed_width>]
(calculate calibration error and adjust calibration offset)
#<x_cal_error> = [[#<cal_diameter> - #<x_probed_width>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o130 else
#<x_cal_error> = [[#<x_probed_width> - #<cal_diameter>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o130 endif
o140 if [#<cal_diameter> GT #<y_probed_width>]
(calculate calibration error and adjust calibration offset)
#<y_cal_error> = [[#<cal_diameter> - #<y_probed_width>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o140 else
#<y_cal_error> = [[#<y_probed_width> - #<cal_diameter>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o140 endif
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
o150 if [#<sq_cal_axis> EQ 0]
#3032 = [ABS[#<new_avg_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o150 else if [#<sq_cal_axis> EQ 1]
#3032 = [ABS[#<new_x_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o150 else
#3032 = [ABS[#<new_y_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o150 endif
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
(probe mode rules for WCO or probe position measuring only)
o160 if [#<probe_mode> EQ 0]
(Record XY Zero in selected WCO)
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
o160 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_cal_round_boss> endsub
M2 (end program)

View File

@@ -0,0 +1,223 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe calibration offset using defined diam round pocket)
(Start probe position is over left side edge of pocket 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_cal_round_pocket> 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)
#<cal_diameter> = #3033 (=0)
#<sq_cal_axis> = #3036 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<workspace_y> = #[5202 + [20 * #5220]]
(clear current probe calibration offset)
#3032 = 0
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
(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_cal_round_pocket> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(remove probe tip diam and cal offset from probed width calculations)
#<probe_diameter_offset> = [#<probe_diameter>]
#<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][#3032]
(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-)
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_minus_probed> = #5061
(Call sub "probe_x_plus" to Probe x+)
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3033][#3019][#3032]
#<x_plus_probed> = #5061
(probed center calculation)
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
#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>]
(Call sub "probe_y_plus" to Probe Y+)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3033 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y-)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3033][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Probe Completion Move to Z Clearance Plane, Y Zero)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(Call sub "probe_x_minus" to Probe x-)
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3033 / 2][#3019][#3032]
#<x_minus_probed> = #5061
(Call sub "probe_x_plus" to Probe x+)
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3033][#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}])
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Call sub "probe_y_plus" to Probe Y+)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3033 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y-)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3033][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed diameter calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
#1010 = #<averaged_diam>
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
o110 if [#<cal_diameter> GT #<x_probed_width>]
(calculate calibration error and adjust calibration offset)
#<x_cal_error> = [[#<cal_diameter> - #<x_probed_width>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o110 else
#<x_cal_error> = [[#<x_probed_width> - #<cal_diameter>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o110 endif
o120 if [#<cal_diameter> GT #<y_probed_width>]
(calculate calibration error and adjust calibration offset)
#<y_cal_error> = [[#<cal_diameter> - #<y_probed_width>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o120 else
#<y_cal_error> = [[#<y_probed_width> - #<cal_diameter>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o120 endif
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
o130 if [#<sq_cal_axis> EQ 0]
#3032 = [ABS[#<new_avg_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 else if [#<sq_cal_axis> EQ 1]
#3032 = [ABS[#<new_x_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 else
#3032 = [ABS[#<new_y_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 endif
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
(probe mode rules for WCO or probe position measuring only)
o140 if [#<probe_mode> EQ 0]
(Record Y Zero in selected WCO)
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
o140 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_cal_round_pocket> endsub
M2 (end program)

View File

@@ -0,0 +1,224 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe calibration offset using defined width square boss)
(Start probe position is over center of stock in X and Y axis)
(within max z distance, ensure all settings have been)
(set properly according to help diagrams)
o<probe_cal_square_boss> 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)
#<x_cal_width> = #3034 (=0)
#<y_cal_width> = #3035 (=0)
#<sq_cal_axis> = #3036 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<workspace_y> = #[5202 + [20 * #5220]]
#<workspace_z> = #[5203 + [20 * #5220]]
(clear current probe calibration offset)
#3032 = 0
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
(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_cal_square_boss> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probe Radius)
#<probe_radius> = [#<probe_diameter> / 2]
(Probe Centerline Offset)
#<probe_center_offset> = [#<probe_radius>]
(remove probe tip diam and cal offset from probed width calculations)
#<probe_diameter_offset> = [#<probe_diameter>]
#<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][#3032]
(Probe X Positioning Move, X hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 X-[#<x_cal_width>/2 + #<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_probed> = #5061
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in X, X Hint + Step Off Width at Traverse Speed)
G91
F[#<probe_traverse_fr>]
G38.3 X[#<x_cal_width> + #<step_off_width> + #<xy_clearance>]
(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
(probed center calulation)
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
(calculate X Width Probed)
#<raw_width> = [#<x_minus_probed> - #<x_plus_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}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[#<y_cal_width>/2 + #<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in Y, Y Hint + Step Off Width at traverse Speed)
G91
F[#<probe_traverse_fr>]
G38.3 Y[#<y_cal_width> + #<step_off_width> + #<xy_clearance>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calulation)
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
o110 if [#<x_cal_width> GT #<x_probed_width>]
(calculate calibration error and adjust calibration offset)
#<x_cal_error> = [[#<x_cal_width> - #<x_probed_width>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o110 else
#<x_cal_error> = [[#<x_probed_width> - #<x_cal_width>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o110 endif
o120 if [#<y_cal_width> GT #<y_probed_width>]
(calculate calibration error and adjust calibration offset)
#<y_cal_error> = [[#<y_cal_width> - #<y_probed_width>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o120 else
#<y_cal_error> = [[#<y_probed_width> - #<y_cal_width>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o120 endif
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
o130 if [#<sq_cal_axis> EQ 0]
#3032 = [ABS[#<new_avg_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 else if [#<sq_cal_axis> EQ 1]
#3032 = [ABS[#<new_x_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 else
#3032 = [ABS[#<new_y_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 endif
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
(probe mode rules for WCO or probe position measuring only)
o140 if [#<probe_mode> EQ 0]
(Record XY Zero in selected WCO)
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
o140 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_cal_square_boss> endsub
M2 (end program)

View File

@@ -0,0 +1,178 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe calibration offset using defined width square pocket)
(Start probe position is over left side edge of pocket 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_cal_square_pocket> 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)
#<probe_mode> = #3030 (=0)
#<x_cal_width> = #3034 (=0)
#<y_cal_width> = #3035 (=0)
#<sq_cal_axis> = #3036 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<workspace_y> = #[5202 + [20 * #5220]]
(clear current probe calibration offset)
#3032 = 0
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
(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_cal_square_pocket> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(remove probe tip diam and cal offset from probed width calculations)
#<probe_diameter_offset> = [#<probe_diameter>]
#<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][#3032]
(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 + #3034][#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, Y Zero)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3035 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3035][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
o110 if [#<x_cal_width> GT #<x_probed_width>]
(calculate calibration error and adjust calibration offset)
#<x_cal_error> = [[#<x_cal_width> - #<x_probed_width>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o110 else
#<x_cal_error> = [[#<x_probed_width> - #<x_cal_width>] / 2]
#<new_x_cal_offset> = [#<x_cal_error>]
o110 endif
o120 if [#<y_cal_width> GT #<y_probed_width>]
(calculate calibration error and adjust calibration offset)
#<y_cal_error> = [[#<y_cal_width> - #<y_probed_width>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o120 else
#<y_cal_error> = [[#<y_probed_width> - #<y_cal_width>] / 2]
#<new_y_cal_offset> = [#<y_cal_error>]
o120 endif
#<new_avg_cal_offset> = [[#<new_x_cal_offset> + #<new_y_cal_offset>] / 2]
o130 if [#<sq_cal_axis> EQ 0]
#3032 = [ABS[#<new_avg_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 else if [#<sq_cal_axis> EQ 1]
#3032 = [ABS[#<new_x_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 else
#3032 = [ABS[#<new_y_cal_offset>]]
(DEBUG, EVAL[vcp.getWidget{"calibration_offset_3032"}.setValue{#3032}])
o130 endif
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
(probe mode rules for WCO or probe position measuring only)
o140 if [#<probe_mode> EQ 0]
(Record X Zero in selected WCO)
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
o140 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_cal_square_pocket> endsub
M2 (end program)

View File

@@ -0,0 +1,173 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Corner X minus Edge Angle for x,y,z 0,0,0 position)
(Start probe position is over front right corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_corner_x_minus_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_corner_x_minus_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<z1x> = #5420
#<z1y> = #5421
(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 y-[#<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
#<p1x> = #5420
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p1y> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_x_minus_edge_angle> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
F[#<probe_traverse_fr>]
G38.3 X[#<step_off_width>] Y[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
#<p2y> = #5421
(Call sub "probe_x_minus" to Probe X- side of Workpiece)
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p2x> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_x_minus_edge_angle> return
o120 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 Y[#<edge_width>]
#<p3y> = #5421
(Call sub "probe_x_minus" to Probe X- side of Workpiece)
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p3x> = #<_value>
(value returned safety check, aborts if no value returned)
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_x_minus_edge_angle> return
o130 endif
#<edge_delta> = [#<p2x> - #<p3x>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
#<c1xr> = [#<z1x> + [#<p2x> - #<z1x>] * COS[-#<edge_angle>] - [#<p2y> - #<z1y>] * SIN[-#<edge_angle>]]
#<c1yr> = [#<z1y> + [#<p1x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p1y> - #<z1y>] * COS[-#<edge_angle>]]
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<c1x>] Y[#<c1y>]
(probe mode rules for WCO,Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
o140 endif
(probe mode rules for WCO,Rotation and probe position measuring only)
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
o150 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_corner_x_minus_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,173 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Corner X plus Edge Angle for x,y,z 0,0,0 position)
(Start probe position is over back left corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_corner_x_plus_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_corner_x_plus_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<z1x> = #5420
#<z1y> = #5421
(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 y[#<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
#<p1x> = #5420
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p1y> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_x_plus_edge_angle> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
F[#<probe_traverse_fr>]
G38.3 X-[#<step_off_width>] Y-[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
#<p2y> = #5421
(Call sub "probe_x_plus" to Probe X+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p2x> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_x_plus_edge_angle> return
o120 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 Y-[#<edge_width>]
#<p3y> = #5421
(Call sub "probe_x_plus" to Probe X+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p3x> = #<_value>
(value returned safety check, aborts if no value returned)
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_x_plus_edge_angle> return
o130 endif
#<edge_delta> = [#<p3x> - #<p2x>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
#<c1xr> = [#<z1x> + [#<p2x> - #<z1x>] * COS[-#<edge_angle>] - [#<p2y> - #<z1y>] * SIN[-#<edge_angle>]]
#<c1yr> = [#<z1y> + [#<p1x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p1y> - #<z1y>] * COS[-#<edge_angle>]]
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<c1x>] Y[#<c1y>]
(probe mode rules for WCO,Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
o140 endif
(probe mode rules for WCO,Rotation and probe position measuring only)
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
o150 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_corner_x_plus_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,173 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Corner Y minus Edge Angle for x,y,z 0,0,0 position)
(Start probe position is over back right corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_corner_y_minus_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_corner_y_minus_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<z1x> = #5420
#<z1y> = #5421
(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>]
#<p1y> = #5421
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p1x> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_y_minus_edge_angle> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
F[#<probe_traverse_fr>]
G38.3 X-[#<step_off_width>] Y[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
#<p2x> = #5420
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p2y> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_y_minus_edge_angle> return
o120 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 X-[#<edge_width>]
#<p3x> = #5420
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p3y> = #<_value>
(value returned safety check, aborts if no value returned)
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_y_minus_edge_angle> return
o130 endif
#<edge_delta> = [#<p2y> - #<p3y>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
#<c1xr> = [#<z1x> + [#<p1x> - #<z1x>] * COS[-#<edge_angle>] - [#<p1y> - #<z1y>] * SIN[-#<edge_angle>]]
#<c1yr> = [#<z1y> + [#<p2x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p2y> - #<z1y>] * COS[-#<edge_angle>]]
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<c1x>] Y[#<c1y>]
(probe mode rules for WCO,Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
o140 endif
(probe mode rules for WCO,Rotation and probe position measuring only)
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
o150 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_corner_y_minus_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,173 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Corner Y Plus Edge Angle for x,y,z 0,0,0 position)
(Start probe position is over front left corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_corner_y_plus_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_corner_y_plus_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<z1x> = #5420
#<z1y> = #5421
(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>]
#<p1y> = #5421
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p1x> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_y_plus_edge_angle> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
F[#<probe_traverse_fr>]
G38.3 X[#<step_off_width>] Y-[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
#<p2x> = #5420
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p2y> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_y_plus_edge_angle> return
o120 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 X[#<edge_width>]
#<p3x> = #5420
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<p3y> = #<_value>
(value returned safety check, aborts if no value returned)
o130 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_corner_y_plus_edge_angle> return
o130 endif
#<edge_delta> = [#<p3y> - #<p2y>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
#<c1xr> = [#<z1x> + [#<p1x> - #<z1x>] * COS[-#<edge_angle>] - [#<p1y> - #<z1y>] * SIN[-#<edge_angle>]]
#<c1yr> = [#<z1y> + [#<p2x> - #<z1x>] * SIN[-#<edge_angle>] + [#<p2y> - #<z1y>] * COS[-#<edge_angle>]]
#<c1x> = [#<z1x> + [#<c1xr> - #<z1x>] * COS[#<edge_angle>] - [#<c1yr> - #<z1y>] * SIN[#<edge_angle>]]
#<c1y> = [#<z1y> + [#<c1xr> - #<z1x>] * SIN[#<edge_angle>] + [#<c1yr> - #<z1y>] * COS[#<edge_angle>]]
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<c1x>] Y[#<c1y>]
(probe mode rules for WCO,Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>]
o140 endif
(probe mode rules for WCO,Rotation and probe position measuring only)
o150 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<c1x> + #<workspace_x>] Y[#<c1y> + #<workspace_y>] R[#<edge_angle>]
o150 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_corner_y_plus_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,123 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe front left inside corner for x,y,z 0,0,0 position)
(Start probe position is over front left inside corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_front_left_inside_corner> 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)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_front_left_inside_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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, Traverse Workpiece Top at Z Clearance Height plane)
G91
F[#<probe_traverse_fr>]
G38.3 X[#<step_off_width>] Y[#<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
G90
(Current X Position including offsets in current program units)
#<x_start> = #5420
(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_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_front_left_inside_corner> return
o110 endif
(move to X start Position)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_start>]
(Current Y Position including offsets in current program units)
#<y_start> = #5421
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_front_left_inside_corner> return
o120 endif
(move to Y start Position)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_start>]
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_minus_zero_edge>] Y[#<y_minus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_front_left_inside_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,119 @@
(author: Chris P)
(version: 0.5)
(date: 06/27/24)
(Probe front left top corner for x,y,z 0,0,0 position)
(Start probe position is over front left corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_front_left_top_corner> 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)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_front_left_top_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_front_left_top_corner> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move, Traverse Workpiece at Z Clearance plane)
F[#<probe_traverse_fr>]
G38.3 X[#<step_off_width>] Y-[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_front_left_top_corner> return
o120 endif
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_plus_zero_edge>] Y[#<y_plus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_front_left_top_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,123 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe front right inside corner for x,y,z 0,0,0 position)
(Start probe position is over front right inside corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_front_right_inside_corner> 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)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_front_right_inside_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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 X and Y)
G91
F[#<probe_traverse_fr>]
G38.3 X-[#<step_off_width>] Y[#<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
G90
(Current X Position including offsets in current program units)
#<x_start> = #5420
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_front_right_inside_corner> return
o110 endif
(move to X start Position)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_start>]
(Current Y Position including offsets in current program units)
#<y_start> = #5421
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_front_right_inside_corner> return
o120 endif
(move to Y start Position)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_start>]
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_plus_zero_edge>] Y[#<y_minus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_minus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_front_right_inside_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,120 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe front right top corner for x,y,z 0,0,0 position)
(Start probe position is over front right corner of stock)
(inside the step off width square and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_front_right_top_corner> 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)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_front_right_top_corner> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_front_right_top_corner> return
o110 endif
(Probe Y Positioning Move, up to Z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Probe Y Positioning Move, Traverse Workpiece Top at Z Clearance Height plane)
F[#<probe_traverse_fr>]
G38.3 X-[#<step_off_width>] Y-[#<step_off_width>]
(Probe Y Positioning Move,to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y- side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_front_right_top_corner> return
o120 endif
(Probe Completion Move to Z Clearance Plane, and XY Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_minus_zero_edge>] Y[#<y_plus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_front_right_top_corner> endsub
M2 (end program)

View File

@@ -0,0 +1,92 @@
(author: Chris P)
(version: 0.5)
(date: 06/27/24)
(Probe front top side for y,z 0,0 position)
(Start probe position is over front edge of stock)
(inside the step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<Probe_front_top_side> 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)
#<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_front_top_side> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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 Y Positioning Move, Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[#<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_front_top_side> return
o110 endif
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_plus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o120 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 Y[#<y_plus_zero_edge> + #<workspace_y>]
o120 endif
(Reinstate Feedrate Override)
M50 P1
o<Probe_front_top_side> endsub
M2 (end program)

View File

@@ -0,0 +1,92 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(Probe left top side for x,z 0,0 position)
(Start probe position is over left side edge of stock)
(inside the step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<Probe_left_top_side> 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)
#<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_left_top_side> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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>]
Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_left_top_side> return
o110 endif
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_plus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o120 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
o120 endif
(Reinstate Feedrate Override)
M50 P1
o<Probe_left_top_side> endsub
M2 (end program)

View File

@@ -0,0 +1,185 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Boss in X and Y Axes, find center and z 0 position)
(Start probe position is over center of stock in X and Y axis)
(within max z distance, ensure all settings have been)
(set properly according to help diagrams)
o<probe_rect_boss> 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_boss_pocket> = #3026 (=0)
#<y_hint_boss_pocket> = #3027 (=0)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<workspace_y> = #[5202 + [20 * #5220]]
#<workspace_z> = #[5203 + [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_rect_boss> 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>]
(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, X hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 X-[[#<x_hint_boss_pocket>/2] + #<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_probed> = #5061
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
G91
F[#<probe_traverse_fr>]
G38.3 X[#<x_hint_boss_pocket> + #<step_off_width> + #<xy_clearance>]
(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
(probed center calulation)
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
(calculate X Width Probed)
#<raw_width> = [#<x_minus_probed> - #<x_plus_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}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[[#<y_hint_boss_pocket>/2] + #<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
G91
F[#<probe_traverse_fr>]
G38.3 Y[#<y_hint_boss_pocket> + #<step_off_width> + #<xy_clearance>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calulation)
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
(probe mode rules for WCO or probe position measuring only)
o110 if [#<probe_mode> EQ 0]
(Record XY Zero in selected WCO)
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>] Y[#<y_center_probed> + #<workspace_y>]
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_rect_boss> endsub
M2 (end program)

View File

@@ -0,0 +1,139 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe rect pocket center measure x and widths, find xy center position)
(Start probe position is over left side edge of pocket 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_rect_pocket> 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_boss_pocket> = #3026 (=0)
#<y_hint_boss_pocket> = #3027 (=0)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_rect_pocket> 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 + #3026][#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, Y Zero)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3027 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3027][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_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>] Y[#<y_center_probed> + #<workspace_y>]
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_rect_pocket> endsub
M2 (end program)

View File

@@ -0,0 +1,121 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe rect pocket center measure x and y widths, find xy center position)
(Start probe position is rough center of pocket probe tip below top edge)
(ensure all settings have been set properly according to help diagrams)
o<probe_rect_pocket_center_start> 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_boss_pocket> = #3026 (=0)
#<y_hint_boss_pocket> = #3027 (=0)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_rect_pocket_center_start> 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]]
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3026 / 2][#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 + #3026][#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 X Zero, Y Zero)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3027 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3027][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(probe mode rules for WCO or probe position measuring only)
o110 if [#<probe_mode> EQ 0]
(Record X and Y Zero in selected WCO)
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>] Y[#<y_center_probed> + #<workspace_y>]
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_rect_pocket_center_start> endsub
M2 (end program)

View File

@@ -0,0 +1,129 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Ridge in X Axis to find center and z 0 position)
(Start probe position is over center of stock in the X axis)
(within max z distance, ensure all settings have been)
(set properly according to help diagrams)
o<probe_ridge_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]]
#<workspace_z> = #[5203 + [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_ridge_x> 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>]
(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, X hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 X-[[#<x_hint_ridge_valley>/2] + #<step_off_width>]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_probed> = #5061
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
F[#<probe_traverse_fr>]
G38.3 X[#<x_hint_ridge_valley> + #<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
(probed center calulation)
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
(calculate X Width Probed)
#<raw_width> = [#<x_minus_probed> - #<x_plus_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)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(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_ridge_x> endsub
M2 (end program)

View File

@@ -0,0 +1,129 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Ridge in Y Axis to find center and z 0 position)
(Start probe position is over center of stock in the Y axis)
(within max z distance, ensure all settings have been)
(set properly according to help diagrams)
o<probe_ridge_y> sub
(uses NGCGUI style arg spec)
#<probe_tool_number> = #3014
#<probe_slow_fr> = #3015
#<probe_fast_fr> = #3016
#<probe_traverse_fr> = #3017
#<max_xy_distance> = #3018
#<xy_clearance> = #3019
#<max_z_distance> = #3020
#<z_clearance> = #3021
#<extra_probe_depth> = #3022
#<step_off_width> = #3023
#<edge_width> = #3024
#<x_hint_ridge_valley> = #3028
#<y_hint_ridge_valley> = #3029
#<probe_mode> = #3030
#<calibration_offset> = #3032
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_y> = #[5202 + [20 * #5220]]
#<workspace_z> = #[5203 + [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_ridge_y> 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>]
(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 Y Positioning Move, Y hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[[#<y_hint_ridge_valley>/2] + #<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
F[#<probe_traverse_fr>]
G38.3 Y[#<y_hint_ridge_valley> + #<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calulation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> - #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Probe Completion Move to Z Clearance Plane, and X Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(probe mode rules for WCO or probe position measuring only)
o110 if [#<probe_mode> EQ 0]
(Record Y Zero in selected WCO)
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
(Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero)
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_ridge_y> endsub
M2 (end program)

View File

@@ -0,0 +1,91 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(Probe right top side for x,z 0,0 position)
(Start probe position is over right side edge of stock)
(inside the step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<Probe_right_top_side> 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_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_right_top_side> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<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_zero_edge> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_right_top_side> return
o110 endif
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_minus_zero_edge>]
(probe mode rules for WCO or probe position measuring only)
o120 if [#<probe_mode> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
o120 endif
(Reinstate Feedrate Override)
M50 P1
o<Probe_right_top_side> endsub
M2 (end program)

View File

@@ -0,0 +1,293 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Boss in X and Y Axes, find center, Diam and z 0 position)
(Start probe position is over center of stock in X and Y axis)
(within max z distance, ensure all settings have been)
(set properly according to help diagrams)
o<probe_round_boss> 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)
#<diameter_hint> = #3025 (=0)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<workspace_y> = #[5202 + [20 * #5220]]
#<workspace_z> = #[5203 + [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_round_boss> 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>]
(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, X hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 X-[[#<diameter_hint> / 2] + [#<step_off_width>]]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_probed> = #5061
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
G91
F[#<probe_traverse_fr>]
G38.3 X[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
(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
(probed center calulation)
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
#1002 = #<x_center_probed>
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[[#<diameter_hint> / 2] + [#<step_off_width>]]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
G91
F[#<probe_traverse_fr>]
G38.3 Y[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calulation)
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Move to z clearance plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Move to Y Center)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(Probe X Positioning Move, X hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 X-[[#<diameter_hint> / 2] + [#<step_off_width>]]
(Probe X Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_probed> = #5061
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in X, X Hint + Step Off Width at Rapid Speed)
F[#<probe_traverse_fr>]
G38.3 X[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
(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
(probed center calulation)
#<x_center_probed> = [[#<x_minus_probed> + #<x_plus_probed>] / 2]
(calculate X Width Probed)
o110 if [#<x_minus_probed> GT #<x_plus_probed>]
#<x_raw_width> = [#<x_minus_probed> - #<x_plus_probed>]
o110 else
#<x_raw_width> = [#<x_plus_probed> - #<x_minus_probed>]
o110 endif
(Completed probed width calculations)
#<x_probed_width> = [#<x_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}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Probe Y Positioning Move, Y hint/2 + Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[[#<diameter_hint> / 2] + [#<step_off_width>]]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(first side Probe Completion Move to Z Clearance Plane)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
(Positioning move in Y, Y Hint + Step Off Width at Rapid Speed)
F[#<probe_traverse_fr>]
G38.3 Y[#<diameter_hint> + #<step_off_width> + #<xy_clearance>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calulation)
#<y_center_probed> = [[#<y_minus_probed> + #<y_plus_probed>] / 2]
(calculate Y Width Probed)
o120 if [#<y_minus_probed> GT #<y_plus_probed>]
#<y_raw_width> = [#<y_minus_probed> - #<y_plus_probed>]
o120 else
#<y_raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
o120 endif
(Completed probed width calculations)
#<y_probed_width> = [#<y_raw_width> - #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
#1010 = #<averaged_diam>
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>] Y[#<y_center_probed>]
#<x_zero> = [#<x_center_probed> + #<workspace_x>]
#<y_zero> = [#<y_center_probed> + #<workspace_y>]
(probe mode rules for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record XY Zero in selected WCO)
G10 L2 P#5220 X[#<x_zero>] Y[#<y_zero>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_round_boss> endsub
M2 (end program)

View File

@@ -0,0 +1,184 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe round pocket center measure x and y Diam, find xy center position)
(Start probe position is over left side edge of pocket 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_round_pocket> 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)
#<diameter_hint> = #3025 (=0)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_round_pocket> 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-)
o<probe_x_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_minus_probed> = #5061
(Call sub "probe_x_plus" to Probe x+)
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
#<x_plus_probed> = #5061
(probed center calculation)
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
#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>]
(Call sub "probe_y_plus" to Probe Y+)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y-)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Probe Completion Move to Z Clearance Plane, Y Zero)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(Call sub "probe_x_minus" to Probe x-)
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
#<x_minus_probed> = #5061
(Call sub "probe_x_plus" to Probe x+)
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#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}])
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Call sub "probe_y_plus" to Probe Y+)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y-)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed diameter calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
#1010 = #<averaged_diam>
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_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 Y Zero in selected WCO)
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_round_pocket> endsub
M2 (end program)

View File

@@ -0,0 +1,167 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe round pocket center start measure x and y Diam, find xy center position)
(Start probe position is rough center of pocket a safe distance below top edge)
(no z move will be initiated in this routine. end position is hole center)
(ensure all settings have been set properly according to help diagrams)
o<probe_round_pocket_center_start> 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)
#<diameter_hint> = #3025 (=0)
#<probe_mode> = #3030 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_x> = #[5201 + [20 * #5220]]
#<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_round_pocket_center_start> 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]]
(Call sub "probe_x_minus" to Probe x-)
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
#<x_minus_probed> = #5061
(Call sub "probe_x_plus" to Probe x+)
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
#<x_plus_probed> = #5061
(probed center calculation)
#<x_center_probed> = [[#<x_plus_probed> + #<x_minus_probed>] / 2]
#1002 = #<x_center_probed>
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1002}])
(Probe Completion Move to X Zero)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Call sub "probe_y_plus" to Probe Y+)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y-)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Probe Completion Move to Y Zero)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(Call sub "probe_x_minus" to Probe x-)
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
#<x_minus_probed> = #5061
(Call sub "probe_x_plus" to Probe x+)
o<probe_x_plus> call [#3014][#3015][#3016][3017][#3018 + #3025][#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}])
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(Call sub "probe_y_plus" to Probe Y+)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3025 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus" to Probe Y-)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3025][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed diameter calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
#<averaged_diam> = [[#<x_probed_width> + #<y_probed_width>] / 2]
#1010 = #<averaged_diam>
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(probe mode rules for WCO or probe position measuring only)
o110 if [#<probe_mode> EQ 0]
(Record Y Zero in selected WCO)
G10 L2 P#5220 X[#<x_center_probed> + #<workspace_x>]
G10 L2 P#5220 Y[#<y_center_probed> + #<workspace_y>]
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_round_pocket_center_start> endsub
M2 (end program)

View File

@@ -0,0 +1,77 @@
(author: Chris P)
(version: 0.0)
(date: 12/26/24)
(Probe Spindle Nose in Z Minus direction over tool setter and set Spindle Zero Distance)
(Start probe position is over toolsetter platter within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_spindle_nose> sub
(uses NGCGUI style arg spec)
(number after "=" in comment is default value)
#<probe_fast_fr> = #3004 (=10.0)
#<probe_slow_fr> = #3005 (=0)
#<probe_traverse_fr> = #3006 (=50)
#<max_z_distance> = #3007 (=12.5)
#<retract_distance> = #3009 (=0.1000)
(Cancel G92 offsets)
G92.1
o100 if [2 EQ 2]
G49
o100 endif
#<offset_z> = #5422
(Initial Fast Z- Probe)
G91
F[#<probe_fast_fr>]
G38.2 Z-[#<max_z_distance>]
#<z_minus_probed> = #5063
(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>] Z#<z>
F[#<probe_fast_fr>]
(return from sub)
o<probe_spindle_nose> return
o110 endif
(Move up retract_distance height for slow probe)
G90
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<retract_distance>]
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
o120 if [#<probe_slow_fr> GT 0]
(Initiate Slow Z- Probe)
G91
F[#<probe_slow_fr>]
G38.2 Z-[#<retract_distance> * 2]
#<z_minus_probed> = #5063
G90
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<retract_distance>]
o120 endif
(defines the edge as z_probed_position for DRO reporting)
#<z_minus_probed_position> = #<z_minus_probed>
(output to gui DRO "Z PROBED POSITION")
#1009 = #<z_minus_probed_position>
#3010 = [ABS[#<z_minus_probed_position> - #<offset_z>]]
#<max_z_travel_default> = [#3010 * 1.001]
#3007 = #<max_z_travel_default>
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
(DEBUG, EVAL[vcp.getWidget{"spindle_zero_height_3010"}.setValue{#3010}])
(DEBUG, EVAL[vcp.getWidget{"z_max_travel_3007"}.setValue{#3007}])
G53 G0 Z0.0
o<probe_spindle_nose> endsub
M2 (end program)

View File

@@ -0,0 +1,131 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(Probe back top edge angle for y,z 0,0 position and edge angle)
(Start probe position is over back edge of stock, set edge width,)
(step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_top_back_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<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_top_back_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<x_start_position> = #5420
(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 Y Positioning Move, Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y[#<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_zero_edge_start> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_top_back_edge_angle> return
o110 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 X-[#<edge_width>]
(Call sub "probe_y_minus" to Probe y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_minus_zero_edge_end> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_top_back_edge_angle> return
o120 endif
#<edge_delta> = [#<y_minus_zero_edge_start> - #<y_minus_zero_edge_end>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_start_position>] Y[#<y_minus_zero_edge_start>]
(probe mode rules for WCO, Rotation and probe position measuring only)
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_minus_zero_edge_start> + #<workspace_y>]
o130 endif
(probe mode rules for WCO, Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_minus_zero_edge_start> + #<workspace_y>] R[#<edge_angle>]
o140 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_top_back_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,131 @@
(author: Chris P)
(version: 0.5)
(date: 06/27/24)
(Probe top front edge angle for y,z 0,0 position and edge angle)
(Start probe position is over front edge of stock, set edge width,)
(step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_top_front_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<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_top_front_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<x_start_position> = #5420
(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 Y Positioning Move, Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[#<step_off_width>]
(Probe Y Positioning Move, to Probing Depth)
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_zero_edge_start> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_top_front_edge_angle> return
o110 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 X[#<edge_width>]
(Call sub "probe_y_plus" to Probe y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_zero_edge_end> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing Y Sub returned edge parameter, aborting)
M50 P1
o<probe_top_front_edge_angle> return
o120 endif
#<edge_delta> = [#<y_plus_zero_edge_end> - #<y_plus_zero_edge_start>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_start_position>] Y[#<y_plus_zero_edge_start>]
(probe mode rules for WCO, Rotation and probe position measuring only)
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_plus_zero_edge_start> + #<workspace_y>]
o130 endif
(probe mode rules for WCO, Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_start_position>] Y[#<y_plus_zero_edge_start> + #<workspace_y>] R[#<edge_angle>]
o140 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_top_front_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,131 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(Probe top left edge angle for y,z 0,0 position and edge angle)
(Start probe position is over left edge of stock, set edge width,)
(step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_top_left_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<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_top_left_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<y_start_position> = #5421
(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_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_zero_edge_start> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_top_left_edge_angle> return
o110 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 Y-[#<edge_width>]
(Call sub "probe_x_plus" to Probe x+ side of Workpiece)
o<probe_x_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<x_plus_zero_edge_end> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_top_left_edge_angle> return
o120 endif
#<edge_delta> = [#<x_plus_zero_edge_end> - #<x_plus_zero_edge_start>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_plus_zero_edge_start>] Y[#<y_start_position>]
(probe mode rules for WCO, Rotation and probe position measuring only)
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>]
o130 endif
(probe mode rules for WCO, Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>] R[#<edge_angle>]
o140 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_top_left_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,131 @@
(author: Chris P)
(version: 0.4)
(date: 06/27/24)
(Probe top right edge angle for y,z 0,0 position and edge angle)
(Start probe position is over right edge of stock, set edge width,)
(step off width distance and within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_top_right_edge_angle> 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)
#<probe_mode> = #3030 (=0)
#<wco_rotation> = #3031 (=0)
#<calibration_offset> = #3032 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
(set rotation offset to zero for new probe cycle)
G10 L2 P[#5220] R0
#<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_top_right_edge_angle> return
o100 endif
(Probe Diameter)
#<probe_diameter> = #5410
(Probing depth from the z probed clearance height, used for z moves)
#<z_probe_stack> = [#<z_clearance> + #<probe_diameter> + #<extra_probe_depth>]
#<y_start_position> = #5421
(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_zero_edge_start> = #<_value>
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_top_right_edge_angle> return
o110 endif
(edge width move to edge second probing point)
G91
F[#<probe_fast_fr>]
G38.3 Y[#<edge_width>]
(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_zero_edge_end> = #<_value>
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(DEBUG, Missing X Sub returned edge parameter, aborting)
M50 P1
o<probe_top_right_edge_angle> return
o120 endif
#<edge_delta> = [#<x_minus_zero_edge_start> - #<x_minus_zero_edge_end>]
#<edge_angle> = [ATAN [#<edge_delta>] / [#<edge_width>]]
#1011 = #<edge_delta>
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = #<edge_angle>
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
(Probe Completion Move to Z Clearance Plane, and Y Zero)
G91
F[#<probe_traverse_fr>]
G38.3 Z[#<z_probe_stack>]
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_minus_zero_edge_start>] Y[#<y_start_position>]
(probe mode rules for WCO, Rotation and probe position measuring only)
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>]
o130 endif
(probe mode rules for WCO, Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>] R[#<edge_angle>]
o140 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_top_right_edge_angle> endsub
M2 (end program)

View File

@@ -0,0 +1,109 @@
(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)

View File

@@ -0,0 +1,91 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe valley in x, find X zero valley center position)
(Start probe position is centered between valley walls)
(ensure all settings have been set properly according to help diagrams)
o<probe_valley_x_center_start> 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_center_start> 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]]
(Call sub "probe_x_minus" to Probe x- side of Workpiece)
o<probe_x_minus> call [#3014][#3015][#3016][3017][#3018 + #3028 / 2][#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 X Zero)
G90
F[#<probe_traverse_fr>]
G38.3 X[#<x_center_probed>]
(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_center_start> endsub
M2 (end program)

View File

@@ -0,0 +1,107 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe valley in Y, find Z0, Y0 valley center position)
(Start probe position is over back 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_y> 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_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_valley_y> 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 Y Positioning Move, Step Off Width)
G91
F[#<probe_traverse_fr>]
G38.3 Y-[#<step_off_width>]
F[#<probe_fast_fr>]
G38.3 Z-[#<z_probe_stack>]
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][#3017][#3018][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus_sub" to Probe Y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3029][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Probe Completion Move to Z Clearance Plane, and X Zero)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_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 Y[#<y_center_probed> + #<workspace_y>]
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_valley_y> endsub
M2 (end program)

View File

@@ -0,0 +1,91 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe valley in Y find Y0 valley center position)
(Start probe position is rough center between valley walls)
(ensure all settings have been set properly according to help diagrams)
o<probe_valley_y_center_start> 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_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_valley_y_center_start> 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]]
(Call sub "probe_y_plus" to Probe Y+ side of Workpiece)
o<probe_y_plus> call [#3014][#3015][#3016][3017][#3018 + #3029 / 2][#3019][#3032]
#<y_plus_probed> = #5062
(Call sub "probe_y_minus_sub" to Probe Y- side of Workpiece)
o<probe_y_minus> call [#3014][#3015][#3016][3017][#3018 + #3029][#3019][#3032]
#<y_minus_probed> = #5062
(probed center calculation)
#<y_center_probed> = [[#<y_plus_probed> + #<y_minus_probed>] / 2]
(calculate Y Width Probed)
#<raw_width> = [#<y_plus_probed> - #<y_minus_probed>]
(Completed probed width calculations)
#<y_probed_width> = [#<raw_width> + #<probe_diameter_offset>]
#1003 = #<y_probed_width>
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1003}])
#1004 = #<y_center_probed>
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1004}])
(Probe Completion Move to Z Clearance Plane, and X Zero)
G90
F[#<probe_traverse_fr>]
G38.3 Y[#<y_center_probed>]
(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 Y[#<y_center_probed> + #<workspace_y>]
o110 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_valley_y_center_start> endsub
M2 (end program)

View File

@@ -0,0 +1,85 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe X Minus direction and set X 0 in current WCO)
(Start probe position to the right 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_x_minus> 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_x_minus> 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 X Position including offsets in current program units)
#<x> = #5420
(Initiate Fast X- Probe)
G91
F[#<probe_fast_fr>]
G38.2 X-[#<max_xy_distance>]
#<x_minus_probed> = #5061
(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>] X#<x>
F[#<probe_fast_fr>]
(return from sub)
o<probe_x_minus> return
o110 endif
(Move to xy_clearance distance for slow probe)
G90
G1 F[#<probe_traverse_fr>] X[#<x_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 X- Probe)
G91
F[#<probe_slow_fr>]
G38.2 X-[#<xy_clearance> * 2]
#<x_minus_probed> = #5061
G90
G1 F[#<probe_traverse_fr>] X[#<x_minus_probed> + #<xy_clearance>]
o120 endif
#<x_minus_zero_edge> = [#<x_minus_probed> - #<probe_center_offset>]
(defines the edge as x_probed_position for DRO reporting)
#<x_minus_probed_position> = #<x_minus_zero_edge>
(output to gui DRO "X PROBED POSITION")
#1005 = #<x_minus_probed_position>
(DEBUG, EVAL[vcp.getWidget{"x_minus_probed_position"}.setValue{#1005}])
o<probe_x_minus> endsub [#<x_minus_zero_edge>]
M2 (end program)

View File

@@ -0,0 +1,105 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe X Minus direction and set X 0 in current WCO)
(Start probe position to the right 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_x_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_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_x_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 X Position including offsets in current program units)
#<x> = #5420
(Initiate Fast X- Probe)
G91
F[#<probe_fast_fr>]
G38.2 X-[#<max_xy_distance>]
#<x_minus_probed> = #5061
(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>] X#<x>
F[#<probe_fast_fr>]
M50 P1
o<probe_x_minus_wco> return
o110 endif
(Move to xy_clearance distance for slow probe)
G90
G1 F[#<probe_traverse_fr>] X[#<x_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 X- Probe)
G91
F[#<probe_slow_fr>]
G38.2 X-[#<xy_clearance> * 2]
#<x_minus_probed> = #5061
G90
G1 F[#<probe_traverse_fr>] X[#<x_minus_probed> + #<xy_clearance>]
o120 endif
#<x_minus_zero_edge> = [#<x_minus_probed> - #<probe_center_offset>]
(defines the edge as x_probed_position for DRO reporting)
#<x_minus_probed_position> = #<x_minus_zero_edge>
(output to gui DRO "X PROBED POSITION")
#1005 = #<x_minus_probed_position>
(DEBUG, EVAL[vcp.getWidget{"x_minus_probed_position"}.setValue{#1005}])
(probe mode rule for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record X Zero in selected WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge> + #<workspace_x>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_x_minus_wco> endsub
M2 (end program)

View File

@@ -0,0 +1,85 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe X plus direction and set X 0 in current WCO)
(Start probe position to the left 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_x_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_x_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 X Position including offsets in current program units)
#<x> = #5420
(Initiate Fast X+ Probe)
G91
F[#<probe_fast_fr>]
G38.2 X[#<max_xy_distance>]
#<x_plus_probed> = #5061
(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>] X#<x>
F[#<probe_fast_fr>]
(return from sub)
o<probe_x_plus> return
o110 endif
(Move to xy_clearance distance for slow probe)
G90
G1 F[#<probe_traverse_fr>] X[#<x_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 X+ Probe)
G91
F[#<probe_slow_fr>]
G38.2 X[#<xy_clearance> * 2]
#<x_plus_probed> = #5061
G90
G1 F[#<probe_traverse_fr>] X[#<x_plus_probed> - #<xy_clearance>]
o120 endif
#<x_plus_zero_edge> = [#<x_plus_probed> + #<probe_center_offset>]
(defines the edge as x_probed_position for DRO reporting)
#<x_plus_probed_position> = #<x_plus_zero_edge>
(output to gui DRO "X PROBED POSITION")
#1006 = #<x_plus_probed_position>
(DEBUG, EVAL[vcp.getWidget{"x_plus_probed_position"}.setValue{#1006}])
o<probe_x_plus> endsub [#<x_plus_zero_edge>]
M2 (end program)

View File

@@ -0,0 +1,105 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe X plus direction and set X 0 in current WCO)
(Start probe position to the left 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_x_plus_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_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_x_plus_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 X Position including offsets in current program units)
#<x> = #5420
(Initiate Fast X+ Probe)
G91
F[#<probe_fast_fr>]
G38.2 X[#<max_xy_distance>]
#<x_plus_probed> = #5061
(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>] X#<x>
F[#<probe_fast_fr>]
M50 P1
o<probe_x_plus_wco> return
o110 endif
(Move to xy_clearance distance for slow probe)
G90
G1 F[#<probe_traverse_fr>] X[#<x_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 X+ Probe)
G91
F[#<probe_slow_fr>]
G38.2 X[#<xy_clearance> * 2]
#<x_plus_probed> = #5061
G90
G1 F[#<probe_traverse_fr>] X[#<x_plus_probed> - #<xy_clearance>]
o120 endif
#<x_plus_zero_edge> = [#<x_plus_probed> + #<probe_center_offset>]
(defines the edge as x_probed_position for DRO reporting)
#<x_plus_probed_position> = #<x_plus_zero_edge>
(output to gui DRO "X PROBED POSITION")
#1006 = #<x_plus_probed_position>
(DEBUG, EVAL[vcp.getWidget{"x_plus_probed_position"}.setValue{#1006}])
(probe mode rule for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record X Zero in selected WCO)
G10 L2 P#5220 X[#<x_plus_zero_edge> + #<workspace_x>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_x_plus_wco> endsub
M2 (end program)

View File

@@ -0,0 +1,85 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Y Minus direction to locate edge, end at clearance distance)
(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> 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_minus> 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>]
(return from sub)
o<probe_y_minus> 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}])
o<probe_y_minus> endsub [#<y_minus_zero_edge>]
M2 (end program)

View File

@@ -0,0 +1,105 @@
(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)

View File

@@ -0,0 +1,85 @@
(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)

View File

@@ -0,0 +1,105 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Y plus direction and set Y 0 in current WCO)
(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_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_plus_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_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>]
M50 P1
o<probe_y_plus_wco> 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}])
(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_plus_zero_edge> + #<workspace_y>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_y_plus_wco> endsub
M2 (end program)

View File

@@ -0,0 +1,84 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Z Minus direction and set Z 0 in current WCO)
(Start probe position is over stock within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_z_minus_sub> 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_z_distance> = #5
#<z_clearance> = #6
#<probe_mode> = #7
(Cancel G92 offsets)
G92.1
#<workspace_z> = #[5203 + [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)
o<probe_z_minus_sub> return
o100 endif
(Current Z Position including offsets in current program units)
#<z> = #5422
(Initial Fast Z- Probe)
G91
F[#<probe_fast_fr>]
G38.2 Z-[#<max_z_distance>]
#<z_minus_probed> = #5063
(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>] Z#<z>
F[#<probe_fast_fr>]
(return from sub)
o<probe_z_minus_sub> return
o110 endif
(Move to z_clearance height for slow probe)
G90
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_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 Z- Probe)
G91
F[#<probe_slow_fr>]
G38.2 Z-[#<z_clearance> * 2]
#<z_minus_probed> = #5063
G90
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_clearance>]
o120 endif
(defines the edge as z_probed_position for DRO reporting)
#<z_minus_probed_position> = #<z_minus_probed>
(output to gui DRO "Z PROBED POSITION")
#1009 = #<z_minus_probed_position>
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
#<z_finish_height> = [#<z_minus_probed> + #<z_clearance>]
(probe mode rule for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Z zero in selected WCO)
G10 L2 P#5220 Z[#<z_minus_probed> + #<workspace_z>]
o<probe_z_minus_sub> return
o130 endif
o<probe_z_minus_sub> endsub [#<z_finish_height>]
M2 (end program)

View File

@@ -0,0 +1,91 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Probe Z Minus direction and set Z 0 in current WCO)
(Start probe position is over stock within max z distance)
(ensure all settings have been set properly according to help diagrams)
o<probe_z_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_z_distance> = #3020 (=0.5000)
#<z_clearance> = #3021 (=0.1000)
#<probe_mode> = #3030 (=0)
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
#<workspace_z> = #[5203 + [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_z_minus_wco> return
o100 endif
(Current Z Position including offsets in current program units)
#<z> = #5422
(Initial Fast Z- Probe)
G91
F[#<probe_fast_fr>]
G38.2 Z-[#<max_z_distance>]
#<z_minus_probed> = #5063
(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>] Z#<z>
F[#<probe_fast_fr>]
(return from sub)
M50 P1
o<probe_z_minus_wco> return
o110 endif
(Move to z_clearance height for slow probe)
G90
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_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 Z- Probe)
G91
F[#<probe_slow_fr>]
G38.2 Z-[#<z_clearance> * 2]
#<z_minus_probed> = #5063
G90
G1 F[#<probe_traverse_fr>] Z[#<z_minus_probed> + #<z_clearance>]
o120 endif
(defines the edge as z_probed_position for DRO reporting)
#<z_minus_probed_position> = #<z_minus_probed>
(output to gui DRO "Z PROBED POSITION")
#1009 = #<z_minus_probed_position>
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
#<z_finish_height> = [#<z_minus_probed> + #<z_clearance>]
(probe mode rule for WCO or probe position measuring only)
o130 if [#<probe_mode> EQ 0]
(Record Z zero in selected WCO)
G10 L2 P#5220 Z[#<z_minus_probed> + #<workspace_z>]
o130 endif
(Reinstate Feedrate Override)
M50 P1
o<probe_z_minus_wco> endsub
M2 (end program)

View File

@@ -0,0 +1,45 @@
(author: Chris P)
(version: 0.3)
(date: 06/27/24)
(programmable coolant subroutine for aiming the coolant nozzle)
(settings for setup are displayed on probe basic setting page)
(in the programmable coolant constants container.)
(calculations assume coolant nozzle is located on the right side of the spindle)
o<program_coolant> sub
(PRINT, o<program_coolant>)
#<activate_programmable_coolant> = #3000
#<horizontal_spindle_nozzle_dist> = #3001
#<vertical_spindle_nozzle_dist> = #3002
#<pc_angle_offset> = #3003
o100 if [#<activate_programmable_coolant> EQ 0]
o100 return
o100 endif
#<pc_tool_length> = #5403
#<tool_diameter> = #5410
#<tool_radius_offset_dist> = [#<tool_diameter> / 2]
#<tool_diameter_offset_dist> = [#<horizontal_spindle_nozzle_dist> - #<tool_radius_offset_dist>]
#<tool_tip_position> = [[#<vertical_spindle_nozzle_dist>] + [#<pc_tool_length>]]
#<coolant_abs_angle> = [ATAN[#<tool_tip_position>] / [#<tool_diameter_offset_dist>]]
#<coolant_final_angle> = [[#<coolant_abs_angle>] + [#<pc_angle_offset>]]
#1000 = #<coolant_final_angle>
(DEBUG, EVAL[vcp.getWidget{"coolant_final_angle"}.setValue{#1000}])
M68 E0 Q[#<coolant_final_angle>]
(PRINT, o<program_coolant> endsub)
o<program_coolant> endsub
M2 (end program)

View File

@@ -0,0 +1,139 @@
(author: Chris P, Lcvette)
(version: 0.1)
(date: 02/8/25)
(This sub will write user parameters to the var file and ui widgets)
(Determine ATC Rack Position, Pocket Order, and Clearance Direction)
(Requires Pockets to be aligned parallel with X or Y Axis Travels)
o<rack_id_calc> sub
#<rack_traverse_speed_3980> = #1 (0)
#<rack_z_load_height_3981> = #2 (0)
#<rack_safe_z_height_3982> = #3 (0)
#<rack_pocket_1_x_3983> = #4 (0)
#<rack_pocket_1_y_3984> = #5 (0)
#<rack_pocket_2_x_3985> = #6 (0)
#<rack_pocket_2_y_3986> = #7 (0)
#<pocket_1_x_clearance_3987> = #8 (0)
#<pocket_1_y_clearance_3988> = #9 (0)
#<rack_atc_user_1_3974> = #10 (0)
#<rack_atc_user_2_3975> = #11 (0)
#<rack_atc_user_3_3976> = #12 (0)
#<rack_atc_user_4_3977> = #13 (0)
#<rack_atc_user_5_3978> = #14 (0)
#3974 = #<rack_atc_user_1_3974>
#3975 = #<rack_atc_user_2_3975>
#3976 = #<rack_atc_user_3_3976>
#3977 = #<rack_atc_user_4_3977>
#3978 = #<rack_atc_user_5_3978>
#3980 = #<rack_traverse_speed_3980>
#3981 = #<rack_z_load_height_3981>
#3982 = #<rack_safe_z_height_3982>
#3983 = #<rack_pocket_1_x_3983>
#3984 = #<rack_pocket_1_y_3984>
#3985 = #<rack_pocket_2_x_3985>
#3986 = #<rack_pocket_2_y_3986>
#3987 = #<pocket_1_x_clearance_3987>
#3988 = #<pocket_1_y_clearance_3988>
(Initialize ALL variables first)
#3979 = 0
#<pocket_order> = 0
#<clearance_direction> = 0
#<rack_id> = 0
#<temp> = 0
(Pull ini pocket count and write to ui)
o100 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
#3973 = #<number_of_pockets>
(DEBUG, EVAL[vcp.getWidget{"rack_pocket_count"}.setValue{#3973}])
o100 endif
(Check for duplicate pocket positions)
o110 if [#<rack_pocket_1_x_3983> EQ #<rack_pocket_2_x_3985>]
o111 if [#<rack_pocket_1_y_3984> EQ #<rack_pocket_2_y_3986>]
(PRINT, "Error: Duplicate pocket positions detected!")
#3979 = 0
(DEBUG, EVAL[vcp.getWidget{"atc_rack_id"}.setValue{#3979}])
o<rack_id_calc> return
o111 endif
o110 endif
(Check if row is parallel to the Y-axis)
o120 if [#<rack_pocket_1_x_3983> EQ #<rack_pocket_2_x_3985>]
(PRINT, "Row is parallel to Y-axis")
(Determine pocket order)
o121 if [#<rack_pocket_2_y_3986> GT #<rack_pocket_1_y_3984>]
#<pocket_order> = 1 (-Y to +Y)
o121 else
#<pocket_order> = 2 (+Y to -Y)
o121 endif
(Determine clearance direction - MUST be in X)
o122 if [#<pocket_1_x_clearance_3987> GT #<rack_pocket_1_x_3983>]
#<clearance_direction> = 1 (+X)
o122 elseif [#<pocket_1_x_clearance_3987> LT #<rack_pocket_1_x_3983>]
#<clearance_direction> = 2 (-X)
o122 else
(PRINT, "Error: Clearance direction must be perpendicular to pocket row!")
#3979 = 0
(DEBUG, EVAL[vcp.getWidget{"atc_rack_id"}.setValue{#3979}])
o<rack_id_calc> return
o122 endif
(Assign rack_id - break down calculation steps)
#<temp> = [#<pocket_order> - 1]
#<temp> = [#<temp> * 2]
#<temp> = [#<temp> + #<clearance_direction>]
#<rack_id> = #<temp>
#3979 = #<rack_id>
(DEBUG, EVAL[vcp.getWidget{"atc_rack_id"}.setValue{#3979}])
o<rack_id_calc> return
o120 endif
(Check if row is parallel to the X-axis)
o130 if [#<rack_pocket_1_y_3984> EQ #<rack_pocket_2_y_3986>]
(PRINT, "Row is parallel to X-axis")
(Determine pocket order)
o131 if [#<rack_pocket_2_x_3985> GT #<rack_pocket_1_x_3983>]
#<pocket_order> = 1 (-X to +X)
o131 else
#<pocket_order> = 2 (+X to -X)
o131 endif
(Determine clearance direction - MUST be in Y)
o132 if [#<pocket_1_y_clearance_3988> GT #<rack_pocket_1_y_3984>]
#<clearance_direction> = 1 (+Y)
o132 elseif [#<pocket_1_y_clearance_3988> LT #<rack_pocket_1_y_3984>]
#<clearance_direction> = 2 (-Y)
o132 else
(PRINT, "Error: Clearance direction must be perpendicular to pocket row!")
#3979 = 0
(DEBUG, EVAL[vcp.getWidget{"atc_rack_id"}.setValue{#3979}])
o<rack_id_calc> return
o132 endif
(Assign rack_id - break down calculation steps)
#<temp> = [#<pocket_order> - 1]
#<temp> = [#<temp> * 2]
#<temp> = [#<temp> + #<clearance_direction>]
#<temp> = [#<temp> + 4]
#<rack_id> = #<temp>
#3979 = #<rack_id>
(DEBUG, EVAL[vcp.getWidget{"atc_rack_id"}.setValue{#3979}])
o<rack_id_calc> return
o130 endif
(MSG, "Error: No Conditions Met, Rack ID Not Set")
#3979 = 0
(DEBUG, EVAL[vcp.getWidget{"atc_rack_id"}.setValue{#3979}])
o<rack_id_calc> endsub
M2

View File

@@ -0,0 +1,41 @@
o<reset_all_data> sub
#1001 = 0
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1001}])
#1002 = 0
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1002}])
#1003 = 0
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1003}])
#1004 = 0
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1004}])
#1005 = 0
(DEBUG, EVAL[vcp.getWidget{"x_minus_probed_position"}.setValue{#1005}])
#1006 = 0
(DEBUG, EVAL[vcp.getWidget{"x_plus_probed_position"}.setValue{#1006}])
#1007 = 0
(DEBUG, EVAL[vcp.getWidget{"y_minus_probed_position"}.setValue{#1007}])
#1008 = 0
(DEBUG, EVAL[vcp.getWidget{"y_plus_probed_position"}.setValue{#1008}])
#1009 = 0
(DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}])
#1010 = 0
(DEBUG, EVAL[vcp.getWidget{"averaged_diam"}.setValue{#1010}])
#1011 = 0
(DEBUG, EVAL[vcp.getWidget{"edge_delta"}.setValue{#1011}])
#1012 = 0
(DEBUG, EVAL[vcp.getWidget{"edge_angle"}.setValue{#1012}])
o<reset_all_data> endsub
M2 (end program)

View File

@@ -0,0 +1,15 @@
o<retractatc> sub
M65 P0 ; Turn off carousel out solenoid
M64 P1 ; Move Carousel IN
M66 P0 L3 Q5 ; check carousel in position sensor
o100 if [#5399 LT 0]
M65 P1 ; turn off the solenoid to send atc home
(abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds
o100 endif
M65 P1
o<retractatc> endsub [1]
M2

View File

@@ -0,0 +1,19 @@
o<set_g30_position> sub
o100 if [1 EQ 1]
(G30.1 records the tool touch off position in the var file)
G30.1
o100 endif
#1000 = #5181
(DEBUG, EVAL[vcp.getWidget{"x_tool_change_position"}.setValue{#1000}])
#1001 = #5182
(DEBUG, EVAL[vcp.getWidget{"y_tool_change_position"}.setValue{#1001}])
#1002 = #5183
(DEBUG, EVAL[vcp.getWidget{"z_tool_change_position"}.setValue{#1002}])
o<set_g30_position> endsub
M2

View File

@@ -0,0 +1,16 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(store spindle tool in carousel macro)
o<store_tool_in_carousel> sub
(PRINT, o<store_tool_in_carousel>)
G49
T0 M6
o<store_tool_in_carousel> endsub
M2 (end program)

View File

@@ -0,0 +1,45 @@
o<tool_setter_param_update> sub
#<fast_probe_fr_3004> = #1
#<slow_probe_fr_3005> = #2
#<traverse_fr_3006> = #3
#<z_max_travel_3007> = #4
#<xy_max_travel_3008> = #5
#<retract_distance_3009> = #6
#<spindle_zero_height_3010> = #7
#<tool_diameter_probe_mode_3011> = #8
#<tool_diameter_offset_mode_3012> = #9
#<tool_setter_offset_direction_3013> = #10
#<breakage_tolerance_3037> = #11
#<user_setter_1_3038> = #12
#<user_setter_2_3039> = #13
#3004 = #<fast_probe_fr_3004>
#3005 = #<slow_probe_fr_3005>
#3006 = #<traverse_fr_3006>
#3007 = #<z_max_travel_3007>
#3008 = #<xy_max_travel_3008>
#3009 = #<retract_distance_3009>
#3010 = #<spindle_zero_height_3010>
#3011 = #<tool_diameter_probe_mode_3011>
#3012 = #<tool_diameter_offset_mode_3012>
#3013 = #<tool_setter_offset_direction_3013>
#3037 = #<breakage_tolerance_3037>
#3038 = #<user_setter_1_3038>
#3039 = #<user_setter_2_3039>
o<tool_setter_param_update> endsub [1]
M2

View File

@@ -0,0 +1,101 @@
(author: Chris P, TooTall18)
(version: 0.2)
(date: 06/27/24)
o<tool_touch_off> sub
#<fast_probe_fr> = #3004 (set from probe screen fast probe feed rate)
#<slow_probe_fr> = #3005 (set from probe screen slow probe feedrate)
#<traverse_fr> = #3006 (set from probe screen traverse probe feedrate)
#<z_max_travel> = #3007 (max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = #3008 (max xy distance the tool travels before erroring out if not contact is made)
#<retract_distance> = #3009 (distance the tool retracts after making contact during fast feed mode)
#<spindle_zero_height> = #3010 (G53 distance from home to spindle nose triggering point on touch plate)
#<tool_diameter_probe_mode> = #3011 (activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = #3012 (activates the tool diameter offset position for probe subroutine section)
#<tool_setter_offset_direction> = #3013 (sets tool setter offset direction to move tool)
#<tool_diameter> = #5410 (current tool's diameter used for offseting probe position in x axis)
G92.1 (Cancel G92 offset)
M50 P0
#<tool_touch_x_coords> = #5181
#<tool_touch_y_coords> = #5182
#<tool_touch_z_coords> = #5183
#<tool_radius_offset> = [#<tool_diameter> / 2]
#<left_offset_probing_position> = [#<tool_touch_x_coords> - #<tool_radius_offset>]
#<right_offset_probing_position> = [#<tool_touch_x_coords> + #<tool_radius_offset>]
#<front_offset_probing_position> = [#<tool_touch_y_coords> - #<tool_radius_offset>]
#<back_offset_probing_position> = [#<tool_touch_y_coords> + #<tool_radius_offset>]
o100 if [#<tool_diameter_offset_mode> EQ 1]
o101 if [#<tool_setter_offset_direction> EQ 0]
#<tool_touch_x_coords> = #<left_offset_probing_position>
o101 else if [#<tool_setter_offset_direction> EQ 1]
#<tool_touch_x_coords> = #<right_offset_probing_position>
o101 else if [#<tool_setter_offset_direction> EQ 2]
#<tool_touch_y_coords> = #<front_offset_probing_position>
o101 else if [#<tool_setter_offset_direction> EQ 3]
#<tool_touch_y_coords> = #<back_offset_probing_position>
o101 endif
o100 endif
o110 if [2 EQ 2]
G49
o110 endif
G90 (set absolute coordinates)
G53 G1 F[#<traverse_fr>] Z0 (move to z0 home position)
G53 G1 F[#<traverse_fr>] X#<tool_touch_x_coords> Y#<tool_touch_y_coords>
G53 G1 F[#<traverse_fr>] Z#<tool_touch_z_coords>
#<offset_z> = #5422 ;Stores the offset of the current Z coordinate.
G91
F #<fast_probe_fr>
G38.2 Z-[#<z_max_travel>] (fast tool probe)
#<z_fast_probe> = #5063 (save probe result of fast probe to parameters)
G1 F[#<traverse_fr>] Z[#<retract_distance>] (retract tool retract distance amount)
(Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed)
o120 if [#<slow_probe_fr> GT 0]
(Initiate Slow Z- Probe)
G91
F[#<slow_probe_fr>] (set probe slow feedrate)
G38.2 Z-[#<retract_distance> * 2] (slow tool probe)
#<z_slow_probe> = #5063
G90
G1 F[#<traverse_fr>] Z[#<z_slow_probe> + #<retract_distance>]
o120 endif
o130 if [#5070 EQ 1] (verify probe event was succesful)
#<z_slow_probe> = #5063 (save slow probe result to parameters)
o130 else
(DEBUG,Tool Length Offset Probe Failed)
o130 endif
(Tool Diameter Probe Mode Section, User must define this section as needed)
o140 if [#<tool_diameter_probe_mode> EQ 1]
(DEBUG, Tool Diameter Probing is Not Defined in Subroutine)
o140 endif
o150 if [3 EQ 3]
G49
o150 endif
G90 (set absolute coordinates)
G53 G1 F[#<traverse_fr>] Z0 (Send Spindle to home zero position)
(define new tool length offset parameters)
#<new_tool_length_offset> = [ABS[#<spindle_zero_height> + #5063 - #<offset_z>]]
G10 L1 P #5400 Z [#<new_tool_length_offset>] (5400 = tool number)
T #5400 G43 H #5400 (enable tool length offset)
M50 P1 (reinstate feedrate override)
o<tool_touch_off> endsub
M2 (end program)

View File

@@ -0,0 +1,99 @@
(author: Chris P)
(version: 0.1)
(date: 05/29/25)
o<toolchange> sub
; Parameter #3989 is used to track if the rack is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently)
; Parameters #4001 to #4024 are used to track which tool is in which pocket (persistently)
; Parameter #4000 is not populated just used in the maths to calculate the above numbers
; #<atc_z_tool_change_height> The Z height your spindle needs to be at to clamp/unclamp a tool from the ATC platter (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> The Z clearance height in machine coordinates that your spindle needs to be at to clear the tools during rack rotation (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
(PRINT, o<toolchange> selected_tool: #<selected_tool>, tool_in_spindle: #<tool_in_spindle>, selected_pocket: #<selected_pocket>, current_pocket: #<current_pocket>, task: #<_task>)
o100 if [#<_task> EQ 0]
(DEBUG, Task is null)
o<toolchange> return [999]
o100 endif (this code eliminates tool missing error on load for multiple use tools)
#<number_of_pockets> = #3973
#<atc_z_tool_change_height> = #3981
#<atc_z_tool_clearance_height> = #3982
; assign the variables passed by M6 change_prolog to some parameters
#100 = #<selected_tool>
#110 = #<tool_in_spindle>
#120 = #<selected_pocket>
#121 = #<current_pocket>
o110 if [#<selected_tool> EQ #<tool_in_spindle>] ; checks if tool in the spindle is same as requested
(PRINT, Requested tool already in spindle)
(PRINT, o<toolchange> endsub)
o<toolchange> endsub [1]
M2
o110 endif
o120 if [#3991 NE #<tool_in_spindle>]
(PRINT, o<toolchange> tool_in_spindle does not match 3991)
o120 endif
#<next_pocket> = 0 ; assigns 0 to the next pocket for a later check if the tool is found in the rack
#<open_pocket> = 0
#130 = #<number_of_pockets> ; assign test parameter the number of pockets in the rack
o130 do
o161 if [#[4000 + #130] EQ #<selected_tool>] ; checks all pockets to see if it contains tool number requested as the new tool
#<next_pocket> = #130 ; if tool is found in pocket, assigns the next pocket
o161 endif
o162 if [#[4000 + #130] EQ 0] ; checks if the pocket is empty, last pocket checked will be the lowest empty pocket number, for putting tool in spindle away.
#<open_pocket> = #130
o162 endif
#130 = [#130 - 1]
o130 while [#130 GT 0]
o140 if [#<next_pocket> EQ 0] ; if tool is not found, aborts and sends a message
(abort, Tool T%d#<selected_tool> not found in rack)
o140 endif
; now we know which pocket the next tool is sitting in
; we need to know if we need to put a tool away
; or if there is not tool in the spindle
o150 if [#<tool_in_spindle> GT 0] ; checks if there is a valid tool in the spindle
o151 if [#<open_pocket> EQ 0] ; If there is a tool in the spindle, checks if there is an open pocket
(abort, rack is full, cant store tool T#<tool_in_spindle> in rack)
o151 endif
o<m21> call [#<open_pocket>]; puts the tool in spindle away into the open pocket
(DEBUG, EVAL[vcp.getWidget{"rackatc"}.store_tool{#<open_pocket>, #<tool_in_spindle>}])
#140 = #<open_pocket>
#[4000 + #140] = #<tool_in_spindle> ; save tool number in pocket
#3991 = 0 ; empty tool in the spindle
M61 Q0
G49
o150 endif
o160 if [#<selected_tool> GT 0] ; selected tool is not tool 0
o<m22> call [#<next_pocket>] ; set the spindle to move to the right pocket for the selected tool
(DEBUG, EVAL[vcp.getWidget{"rackatc"}.store_tool{#<next_pocket>, 0}])
#150 = #<next_pocket>
#[4000 + #150] = 0 ; empty the pocket
#3991 = #<selected_tool> ; Set persistent variable to remember tool in spindle after power cycle
o160 else
M25 ; deactive drawbar
o160 endif
M61 Q#<selected_tool>
o170 if [1 EQ 1]
G43 H#<selected_tool>
o170 endif
o<program_coolant> call
(PRINT, o<toolchange> endsub)
o<toolchange> endsub [1]
M2

View File

@@ -0,0 +1,95 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(Measure tool and set Z 0.000 in current WCO for new tool)
o<toolsetter_wco> sub
(uses NGCGUI style arg spec)
(number after "=" in comment is default value)
#<fast_probe_fr> = #3004 (set from probe screen fast probe feed rate)
#<slow_probe_fr> = #3005 (set from probe screen slow probe feedrate)
#<traverse_fr> = #3006 (set from probe screen traverse probe feedrate)
#<z_max_travel> = #3007 (max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = #3008 (max xy distance the tool travels before erroring out if not contact is made)
#<retract_distance> = #3009 (distance the tool retracts after making contact during fast feed mode)
#<spindle_zero_height> = #3010 (G53 distance from home to spindle nose triggering point on touch plate)
#<tool_diameter_probe_mode> = #3011 (activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = #3012 (activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = #5410 (current tool's diameter used for offseting probe position in x axis)
(start with an m6, do all the standard m6 stuff and then touch off -TMC)
M6
(Cancel G92 offsets)
G92.1
(Cancel Feedrate Override)
M50 P0
o100 if [2 EQ 2]
G49
o100 endif
G90 (set absolute coordinates)
G53 G1 F[#<traverse_fr>] Z0 (move to z0 home position)
G53 G1 F[#<traverse_fr>] X#<tool_touch_x_coords> Y#<tool_touch_y_coords>
#<workspace_z> = #[5203 + [20 * #5220]]
(Current Z Position including offsets in current program units)
#<z> = #5422
(Initial Fast Z- Probe)
G91
F[#<probe_fast_fr>]
G38.2 Z-[#<max_z_distance>]
#<z_minus_probed> = #5063
(Probe Error check, #5070 will be 0 if failed)
o110 if [#5070 EQ 0]
(back to start point and feed)
G90
G1 F[#<traverse_fr>] Z#<z>
F[#<probe_fast_fr>]
(return from sub)
M50 P1
o<toolsetter_wco> return
o110 endif
(Move to z_clearance height for slow probe)
G90
G1 F[#<traverse_fr>] Z[#<z_minus_probed> + #<z_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 Z- Probe)
G91
F[#<probe_slow_fr>]
G38.2 Z-[#<z_clearance> * 2]
#<z_minus_probed> = #5063
G90
G1 F[#<traverse_fr>] Z[#<z_minus_probed> + #<z_clearance>]
o120 endif
#<z_finish_height> = [#<z_minus_probed> + #<z_clearance>]
#<new_tool_wco_z> = [#<z_minus_probed> - #<tool_setter_height>]
(Record Z zero in selected WCO)
G10 L2 P#5220 Z[#<new_tool_wco_z> + #<workspace_z>]
(Move to Toolset location)
G53 G1 F[#<traverse_fr>] X#<dust_boot_x_coords> Y#<dust_boot_y_coords>
(pause for dust boot)
M0 (replace the dust boot)
(Reinstate Feedrate Override)
M50 P1
o<toolsetter_wco> endsub
M2 (end program)

View File

@@ -0,0 +1,75 @@
o<touch_probe_param_update> sub
#<probe_tool_number_3014> = #1
#<probe_slow_fr_3015> = #2
#<probe_fast_fr_3016> = #3
#<probe_traverse_fr_3017> = #4
#<max_xy_distance_3018> = #5
#<xy_clearance_3019> = #6
#<max_z_distance_3020> = #7
#<z_clearance_3021> = #8
#<extra_probe_depth_3022> = #9
#<step_off_width_3023> = #10
#<edge_width_3024> = #11
#<diameter_hint_3025> = #12
#<x_hint_boss_pocket_3026> = #13
#<y_hint_boss_pocket_3027> = #14
#<x_hint_ridge_valley_3028> = #15
#<y_hint_ridge_valley_3029> = #16
#<probe_mode_3030> = #17
#<wco_rotation_3031> = #18
#<calibration_offset_3032> = #19
#<cal_diameter_3033> = #20
#<x_cal_width_3034> = #21
#<y_cal_width_3035> = #22
#<sq_cal_axis_3036> = #23
#3014 = #<probe_tool_number_3014>
#3015 = #<probe_slow_fr_3015>
#3016 = #<probe_fast_fr_3016>
#3017 = #<probe_traverse_fr_3017>
#3018 = #<max_xy_distance_3018>
#3019 = #<xy_clearance_3019>
#3020 = #<max_z_distance_3020>
#3021 = #<z_clearance_3021>
#3022 = #<extra_probe_depth_3022>
#3023 = #<step_off_width_3023>
#3024 = #<edge_width_3024>
#3025 = #<diameter_hint_3025>
#3026 = #<x_hint_boss_pocket_3026>
#3027 = #<y_hint_boss_pocket_3027>
#3028 = #<x_hint_ridge_valley_3028>
#3029 = #<y_hint_ridge_valley_3029>
#3030 = #<probe_mode_3030>
#3031 = #<wco_rotation_3031>
#3032 = #<calibration_offset_3032>
#3033 = #<cal_diameter_3033>
#3034 = #<x_cal_width_3034>
#3035 = #<y_cal_width_3035>
#3036 = #<sq_cal_axis_3036>
o<touch_probe_param_update> endsub [1]
M2

View File

@@ -0,0 +1,12 @@
o<unclamptool> sub
M64 P2 ; unclamp the tool
M66 P2 L3 Q2 ; check the unclamped tool sensor
o100 if [#5399 LT 0]
(abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds
o100 endif
o<unclamptool> endsub [1]
M2

View File

@@ -0,0 +1,17 @@
(author: Chris P)
(version: 0.1)
(date: 04/20/24)
(unloads tool in spindle in software)
; This is called form the ATC and tool pages
o<unload_spindle> sub
(PRINT, o<load_spindle_safety>)
M61 Q0
G49
#3991 = 0
o<unload_spindle> endsub
M2 (end program)

View File

@@ -0,0 +1,22 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
o<update_programmable_coolant_params> sub
#<activate_programmable_coolant_3000> = #1
#<horizontal_spindle_nozzle_dist_3001> = #2
#<vertical_spindle_nozzle_dist_3002> = #3
#<pc_angle_offset_3003> = #4
#3000 = #<activate_programmable_coolant_3000>
#3001 = #<horizontal_spindle_nozzle_dist_3001>
#3002 = #<vertical_spindle_nozzle_dist_3002>
#3003 = #<pc_angle_offset_3003>
o<update_programmable_coolant_params> endsub [1]
M2

View File

@@ -0,0 +1,17 @@
o<x_data_reset> sub
#1001 = 0
(DEBUG, EVAL[vcp.getWidget{"x_center_probed"}.setValue{#1001}])
#1002 = 0
(DEBUG, EVAL[vcp.getWidget{"x_probed_width"}.setValue{#1002}])
#1005 = 0
(DEBUG, EVAL[vcp.getWidget{"x_minus_probed_position"}.setValue{#1005}])
#1006 = 0
(DEBUG, EVAL[vcp.getWidget{"x_plus_probed_position"}.setValue{#1006}])
o<x_data_reset> endsub
M2 (end program)

View File

@@ -0,0 +1,17 @@
o<y_data_reset> sub
#1003 = 0
(DEBUG, EVAL[vcp.getWidget{"y_center_probed"}.setValue{#1003}])
#1004 = 0
(DEBUG, EVAL[vcp.getWidget{"y_probed_width"}.setValue{#1004}])
#1007 = 0
(DEBUG, EVAL[vcp.getWidget{"y_minus_probed_position"}.setValue{#1007}])
#1008 = 0
(DEBUG, EVAL[vcp.getWidget{"y_plus_probed_position"}.setValue{#1008}])
o<y_data_reset> endsub
M2 (end program)

View File

@@ -0,0 +1,12 @@
o<clamptool> sub
M65 P2 ; clamp the tool
M66 P5 L3 Q2 ; check the clamped tool sensor
o100 if [#5399 LT 0]
(abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds
o100 endif
o<clamptool> endsub [1]
M2

View File

@@ -0,0 +1,27 @@
o<extendatc> sub
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
#<atc_z_tool_change_height> = -3.9000
o100 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o100 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.01]
o110 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o110 endif
G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height
M65 P1 ; Turn off carousel home solenoid
M64 P0 ; Move Carousel OUT
M66 P1 L3 Q5 ; check for carousel out position sensor
o120 if [#5399 LT 0]
M65 P0 ; switch off atc out solenoid
(abort, ATC not in position)
o120 endif
o<extendatc> endsub [1]
M2

View File

@@ -0,0 +1,10 @@
o<go_to_g30> sub
M73
G90
G53 G0 Z0
G30
o<go_to_g30> endsub
M2

View File

@@ -0,0 +1,20 @@
o<go_to_home> sub
M73
G90
G53 G0 Z0
G53 G0 X0 Y0
o100 if [EXISTS[#<_ini[traj]axes>]]
#<geometry> = #<_ini[traj]axes>
o100 endif
o110 if [#<geometry> EQ 4]
G53 G0 A0
o110 else if [#<geometry> EQ 5]
G53 G0 A0 C0
o110 endif
o<go_to_home> endsub
M2

View File

@@ -0,0 +1,20 @@
o<go_to_zero> sub
M73
G90
G53 G0 Z0
G0 X0 Y0
o100 if [EXISTS[#<_ini[traj]axes>]]
#<geometry> = #<_ini[traj]axes>
o100 endif
o110 if [#<geometry> EQ 4]
G0 A0
o110 else if [#<geometry> EQ 5]
G0 A0 C0
o110 endif
o<go_to_zero> endsub
M2

View File

@@ -0,0 +1,48 @@
(author: Chris P)
(version: 0.5)
(date: 06/27/24)
(load tool in spindle safety macro)
; This is called form the ATC page
; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently)
; Parameters #4001 to #4024 are used to track which tool is in which pocket (persistently)
; Parameter #4000 is not populated just used in the maths to calculate the above numbers
; #<number_of_pockets>: The number of pockets the ATC platter has, This is user set in the INI file via #<_ini[atc]pockets>
o<load_spindle_safety> sub
(PRINT, o<load_spindle_safety>)
#<load_spindle_tool_number> = #1 ; this is the value form the ATC tab
#<probe_tool_number> = #3014
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o101 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o101 endif
#10 = 0
#11 = 0 ; 1 if tool is already stored in carousel
o110 while [#10 LT #<number_of_pockets>]
#10 = [#10+1]
o120 if [#<load_spindle_tool_number> EQ #[4000 + #10]]
(DEBUG, the tool you are trying to load is already stored in carousel pocket %d#10)
#11 = 1
o120 endif
o110 endwhile
o130 if [#11 EQ 0]
M61 Q#<load_spindle_tool_number> G43 H#<load_spindle_tool_number>
#3991 = #<load_spindle_tool_number>
o130 endif
o140 if [#<load_spindle_tool_number> EQ #<probe_tool_number>]
S0 M5
o140 endif
o<program_coolant> call
o<load_spindle_safety> endsub
M2 (end program)

View File

@@ -0,0 +1,48 @@
(author: Chris P)
(version: 0.2)
(date: 06/27/24)
(load tool in spindle safety macro)
; This is called form the Tool page
; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently)
; Parameters #4001 to #4024 are used to track which tool is in which pocket (persistently)
; Parameter #4000 is not populated just used in the maths to calculate the above numbers
; #<number_of_pockets>: The number of pockets the ATC platter has, This is user set in the INI file via #<_ini[atc]pockets>
o<load_spindle_safety_2> sub
(PRINT, o<load_spindle_safety_2>)
#<load_spindle_tool_number_2> = #1 ; this is the value form the TOOL tab
#<probe_tool_number> = #3014
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o101 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o101 endif
#10 = 0
#11 = 0 ; 1 if tool is already stored in carousel
o110 while [#10 LT #<number_of_pockets>]
#10 = [#10+1]
o120 if [#<load_spindle_tool_number_2> EQ #[4000 + #10]]
(DEBUG, the tool you are trying to load is already stored in carousel pocket %d#10)
#11 = 1
o120 endif
o110 endwhile
o130 if [#11 EQ 0]
M61 Q#<load_spindle_tool_number_2> G43 H#<load_spindle_tool_number_2>
#3991 = #<load_spindle_tool_number_2>
o130 endif
o140 if [#<load_spindle_tool_number_2> EQ #<probe_tool_number>]
S0 M5
o140 endif
o<program_coolant> call
o<load_spindle_safety_2> endsub
M2 (end program)

View File

@@ -0,0 +1,39 @@
o<m10> sub
; Move tool carousel best direction to pocket P
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<m10> P#<p>)
o100 if [#3989 NE 1]
M13
o100 endif
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o110 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o110 endif
#<steps> = [#3990 - #<p>]
(PRINT, o<m10> P#<p>, steps=#<steps>)
o120 if [#<steps> GT [#<number_of_pockets> / 2]]
#<steps>=[#<steps> - #<number_of_pockets>]
o120 endif
o130 if [#<steps> LT -[#<number_of_pockets> / 2]]
#<steps>=[#<steps> + #<number_of_pockets>]
o130 endif
o140 if [#<steps> GT 0]
M12 P[#<steps>]
o140 elseif [#<steps> LT 0]
#<steps>=[#<steps> * -1]
M11 P[#<steps>]
o140 endif
(PRINT, o<m10> endsub)
o<m10> endsub [1]
M2

View File

@@ -0,0 +1,50 @@
o<m11> sub
; Move tool carousel CW Parameter P number of steps
; Without parameter one step CW.
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<m11> P#<p>)
o100 if [#3989 NE 1]
(PRINT, atc not homed, homing)
M13
o100 endif
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o110 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o110 endif
o120 if [EXISTS[#<p>]]
#<steps_to_move> = #<p>
o120 else
#<steps_to_move> = 1
(tells the atc widget move 1 step forward)
o120 endif
(tells the atc widget how many steps to move and start moving forward)
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.rotate{#<steps_to_move>, "cw"}])
M64 P4 ; Move atc motor FWD
o130 do
M66 P4 L1 Q3 ; wait for rising edge on rotation index
o131 if [#5399 LT 0]
M65 P4 ; Stop atc motor
(abort, Failed to get rotation index)
o131 endif
#3990 = [[[#3990+2] MOD #<number_of_pockets>]-1] ; Pocket is no.1-#<number_of_pockets>
#<steps_to_move> = [#<steps_to_move>-1]
o130 while [#<steps_to_move> GT 0]
M65 P4 ; Stop motor
#<_my_current_pocket> = #3990
(PRINT, o<m11> endsub)
o<m11> endsub [1]
M2

View File

@@ -0,0 +1,50 @@
o<m12> sub
; Move tool carousel CCW Parameter P number of steps
; Without parameter one step CCW.
; Parameter #3989 is used to track if the carousel is homed (M13) (volatile)
; Parameter #3990 is used to track the current tool pocket (persistently)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<m12> P#<p>)
o100 if [#3989 NE 1]
(PRINT, atc not homed, homing)
M13
o100 endif
; default to a 12 pocket ATC (matching DynATC Widget behaviour), then update based on INI settings
#<number_of_pockets> = 12
o110 if [EXISTS[#<_ini[atc]pockets>]]
#<number_of_pockets> = #<_ini[atc]pockets>
o110 endif
o120 if [EXISTS[#<p>]]
#<steps_to_move> = #<p>
o120 else
#<steps_to_move>=1
(tells the atc widget move 1 step reverse)
o120 endif
(tells the atc widget how many steps to move and start moving reverse)
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.rotate{#<steps_to_move>, "ccw"}])
M64 P3 ; Move atc motor REV
o130 do
M66 P4 L1 Q3 ; wait for rising edge on rotation index
o131 if [#5399 LT 0]
M65 P3 ; Stop atc motor
(abort, Failed to get rotation index)
o131 endif
#3990 = [[[#3990-2] MOD #<number_of_pockets>]+1] ; Pocket is no.1-#<number_of_pockets>
#<steps_to_move> = [#<steps_to_move>-1]
o130 while [#<steps_to_move> GT 0]
M65 P3 ; Stop motor
#<_my_current_pocket> = #3990
(PRINT, o<m12> endsub)
o<m12> endsub [1]
M2

Some files were not shown because too many files have changed in this diff Show More