From e6758c4338e79d05617f5052aee6dd3d095146f9 Mon Sep 17 00:00:00 2001 From: dpslwk Date: Fri, 1 Dec 2023 02:15:46 +0000 Subject: [PATCH 1/5] Add G90 to `go_to_zero.ngc` fixes #91 --- configs/atc_sim/macros_sim_inch/go_to_zero.ngc | 1 + configs/atc_sim/macros_sim_metric/go_to_zero.ngc | 1 + configs/probe_basic/subroutines/go_to_zero.ngc | 1 + configs/probe_basic_lathe/subroutines/go_to_zero.ngc | 1 + 4 files changed, 4 insertions(+) diff --git a/configs/atc_sim/macros_sim_inch/go_to_zero.ngc b/configs/atc_sim/macros_sim_inch/go_to_zero.ngc index 2cca0563..58d9e336 100644 --- a/configs/atc_sim/macros_sim_inch/go_to_zero.ngc +++ b/configs/atc_sim/macros_sim_inch/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +G90 o100 if [#5422 LT 0] G0 Z0 G0 X0 Y0 diff --git a/configs/atc_sim/macros_sim_metric/go_to_zero.ngc b/configs/atc_sim/macros_sim_metric/go_to_zero.ngc index 2cca0563..58d9e336 100644 --- a/configs/atc_sim/macros_sim_metric/go_to_zero.ngc +++ b/configs/atc_sim/macros_sim_metric/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +G90 o100 if [#5422 LT 0] G0 Z0 G0 X0 Y0 diff --git a/configs/probe_basic/subroutines/go_to_zero.ngc b/configs/probe_basic/subroutines/go_to_zero.ngc index 2cca0563..58d9e336 100644 --- a/configs/probe_basic/subroutines/go_to_zero.ngc +++ b/configs/probe_basic/subroutines/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +G90 o100 if [#5422 LT 0] G0 Z0 G0 X0 Y0 diff --git a/configs/probe_basic_lathe/subroutines/go_to_zero.ngc b/configs/probe_basic_lathe/subroutines/go_to_zero.ngc index f908c8e9..3bb49c2b 100644 --- a/configs/probe_basic_lathe/subroutines/go_to_zero.ngc +++ b/configs/probe_basic_lathe/subroutines/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +G90 o100 if [#5422 LT 0] G0 Z0 G0 X0 From 769df0100133898fff23a8bcc307ae838d9fb882 Mon Sep 17 00:00:00 2001 From: dpslwk Date: Fri, 1 Dec 2023 02:17:33 +0000 Subject: [PATCH 2/5] Add M73 to `go_to_g30`, `go_to_home` & `go_to_zero` fixes #92 --- configs/atc_sim/macros_sim_inch/go_to_g30.ngc | 1 + configs/atc_sim/macros_sim_inch/go_to_home.ngc | 1 + configs/atc_sim/macros_sim_inch/go_to_zero.ngc | 1 + configs/atc_sim/macros_sim_metric/go_to_g30.ngc | 1 + configs/atc_sim/macros_sim_metric/go_to_home.ngc | 1 + configs/atc_sim/macros_sim_metric/go_to_zero.ngc | 1 + configs/probe_basic/subroutines/go_to_g30.ngc | 1 + configs/probe_basic/subroutines/go_to_home.ngc | 1 + configs/probe_basic/subroutines/go_to_zero.ngc | 1 + configs/probe_basic_lathe/subroutines/go_to_g30.ngc | 1 + configs/probe_basic_lathe/subroutines/go_to_home.ngc | 1 + configs/probe_basic_lathe/subroutines/go_to_zero.ngc | 1 + 12 files changed, 12 insertions(+) diff --git a/configs/atc_sim/macros_sim_inch/go_to_g30.ngc b/configs/atc_sim/macros_sim_inch/go_to_g30.ngc index e73d0fea..71956e07 100644 --- a/configs/atc_sim/macros_sim_inch/go_to_g30.ngc +++ b/configs/atc_sim/macros_sim_inch/go_to_g30.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G53 G0 Z0 G30 diff --git a/configs/atc_sim/macros_sim_inch/go_to_home.ngc b/configs/atc_sim/macros_sim_inch/go_to_home.ngc index b12796ca..62d10af7 100644 --- a/configs/atc_sim/macros_sim_inch/go_to_home.ngc +++ b/configs/atc_sim/macros_sim_inch/go_to_home.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G53 G0 Z0 G53 G0 X0 Y0 diff --git a/configs/atc_sim/macros_sim_inch/go_to_zero.ngc b/configs/atc_sim/macros_sim_inch/go_to_zero.ngc index 58d9e336..dbb91808 100644 --- a/configs/atc_sim/macros_sim_inch/go_to_zero.ngc +++ b/configs/atc_sim/macros_sim_inch/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 o100 if [#5422 LT 0] G0 Z0 diff --git a/configs/atc_sim/macros_sim_metric/go_to_g30.ngc b/configs/atc_sim/macros_sim_metric/go_to_g30.ngc index e73d0fea..71956e07 100644 --- a/configs/atc_sim/macros_sim_metric/go_to_g30.ngc +++ b/configs/atc_sim/macros_sim_metric/go_to_g30.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G53 G0 Z0 G30 diff --git a/configs/atc_sim/macros_sim_metric/go_to_home.ngc b/configs/atc_sim/macros_sim_metric/go_to_home.ngc index b12796ca..62d10af7 100644 --- a/configs/atc_sim/macros_sim_metric/go_to_home.ngc +++ b/configs/atc_sim/macros_sim_metric/go_to_home.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G53 G0 Z0 G53 G0 X0 Y0 diff --git a/configs/atc_sim/macros_sim_metric/go_to_zero.ngc b/configs/atc_sim/macros_sim_metric/go_to_zero.ngc index 58d9e336..dbb91808 100644 --- a/configs/atc_sim/macros_sim_metric/go_to_zero.ngc +++ b/configs/atc_sim/macros_sim_metric/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 o100 if [#5422 LT 0] G0 Z0 diff --git a/configs/probe_basic/subroutines/go_to_g30.ngc b/configs/probe_basic/subroutines/go_to_g30.ngc index e73d0fea..71956e07 100644 --- a/configs/probe_basic/subroutines/go_to_g30.ngc +++ b/configs/probe_basic/subroutines/go_to_g30.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G53 G0 Z0 G30 diff --git a/configs/probe_basic/subroutines/go_to_home.ngc b/configs/probe_basic/subroutines/go_to_home.ngc index b12796ca..62d10af7 100644 --- a/configs/probe_basic/subroutines/go_to_home.ngc +++ b/configs/probe_basic/subroutines/go_to_home.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G53 G0 Z0 G53 G0 X0 Y0 diff --git a/configs/probe_basic/subroutines/go_to_zero.ngc b/configs/probe_basic/subroutines/go_to_zero.ngc index 58d9e336..dbb91808 100644 --- a/configs/probe_basic/subroutines/go_to_zero.ngc +++ b/configs/probe_basic/subroutines/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 o100 if [#5422 LT 0] G0 Z0 diff --git a/configs/probe_basic_lathe/subroutines/go_to_g30.ngc b/configs/probe_basic_lathe/subroutines/go_to_g30.ngc index b41118e6..ddd19428 100644 --- a/configs/probe_basic_lathe/subroutines/go_to_g30.ngc +++ b/configs/probe_basic_lathe/subroutines/go_to_g30.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G30 diff --git a/configs/probe_basic_lathe/subroutines/go_to_home.ngc b/configs/probe_basic_lathe/subroutines/go_to_home.ngc index e319f192..7e8e1181 100644 --- a/configs/probe_basic_lathe/subroutines/go_to_home.ngc +++ b/configs/probe_basic_lathe/subroutines/go_to_home.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 G53 G0 Z0 G53 G0 X0 diff --git a/configs/probe_basic_lathe/subroutines/go_to_zero.ngc b/configs/probe_basic_lathe/subroutines/go_to_zero.ngc index 3bb49c2b..8b871330 100644 --- a/configs/probe_basic_lathe/subroutines/go_to_zero.ngc +++ b/configs/probe_basic_lathe/subroutines/go_to_zero.ngc @@ -1,5 +1,6 @@ o sub +M73 G90 o100 if [#5422 LT 0] G0 Z0 From efb676db85d55ee38ca55b9f49a69ea6cbcdcbe3 Mon Sep 17 00:00:00 2001 From: dpslwk Date: Fri, 1 Dec 2023 03:06:39 +0000 Subject: [PATCH 3/5] Subroutine: style tweaks and comments `#` based on ini --- configs/atc_sim/macros_sim_inch/extendatc.ngc | 8 +++++++- .../macros_sim_inch/load_spindle_safety.ngc | 2 +- .../macros_sim_inch/load_spindle_safety_2.ngc | 2 +- configs/atc_sim/macros_sim_inch/m21.ngc | 2 +- configs/atc_sim/macros_sim_inch/m22.ngc | 2 +- configs/atc_sim/macros_sim_inch/m25.ngc | 1 + .../macros_sim_inch/move_head_above_carousel.ngc | 2 +- .../move_tool_to_carousel_height.ngc | 2 +- .../probe_top_right_edge_angle.ngc | 14 +++++++------- .../atc_sim/macros_sim_inch/tool_touch_off.ngc | 2 ++ configs/atc_sim/macros_sim_metric/extendatc.ngc | 8 +++++++- .../macros_sim_metric/load_spindle_safety.ngc | 2 +- .../macros_sim_metric/load_spindle_safety_2.ngc | 2 +- configs/atc_sim/macros_sim_metric/m13.ngc | 2 +- configs/atc_sim/macros_sim_metric/m21.ngc | 2 +- configs/atc_sim/macros_sim_metric/m22.ngc | 2 +- configs/atc_sim/macros_sim_metric/m25.ngc | 1 + .../move_head_above_carousel.ngc | 2 +- .../move_tool_to_carousel_height.ngc | 2 +- .../probe_top_right_edge_angle.ngc | 14 +++++++------- .../atc_sim/macros_sim_metric/tool_touch_off.ngc | 2 ++ configs/probe_basic/subroutines/extendatc.ngc | 8 +++++++- .../subroutines/load_spindle_safety.ngc | 2 +- .../subroutines/load_spindle_safety_2.ngc | 2 +- configs/probe_basic/subroutines/m13.ngc | 2 +- configs/probe_basic/subroutines/m21.ngc | 2 +- configs/probe_basic/subroutines/m22.ngc | 2 +- configs/probe_basic/subroutines/m25.ngc | 1 + .../subroutines/move_head_above_carousel.ngc | 2 +- .../subroutines/move_tool_to_carousel_height.ngc | 2 +- .../subroutines/probe_top_right_edge_angle.ngc | 14 +++++++------- .../probe_basic/subroutines/tool_touch_off.ngc | 2 ++ .../probe_basic_lathe/subroutines/extendatc.ngc | 8 +++++++- .../probe_basic_lathe/subroutines/go_to_g30.ngc | 1 + .../probe_basic_lathe/subroutines/go_to_home.ngc | 1 + .../probe_basic_lathe/subroutines/go_to_zero.ngc | 1 + configs/probe_basic_lathe/subroutines/m13.ngc | 2 +- configs/probe_basic_lathe/subroutines/m21.ngc | 2 +- configs/probe_basic_lathe/subroutines/m22.ngc | 2 +- configs/probe_basic_lathe/subroutines/m25.ngc | 1 + .../subroutines/m6_tool_call_main_panel.ngc | 1 + .../subroutines/m6_tool_call_touch_panel.ngc | 4 ++-- .../subroutines/move_head_above_carousel.ngc | 2 +- .../subroutines/move_tool_to_carousel_height.ngc | 2 +- .../probe_corner_x_minus_edge_angle.ngc | 1 + .../probe_corner_x_plus_edge_angle.ngc | 1 + .../probe_corner_y_minus_edge_angle.ngc | 1 + .../probe_corner_y_plus_edge_angle.ngc | 1 + .../subroutines/probe_top_back_edge_angle.ngc | 1 + .../subroutines/probe_top_front_edge_angle.ngc | 1 + .../subroutines/probe_top_left_edge_angle.ngc | 1 + .../subroutines/probe_top_right_edge_angle.ngc | 15 ++++++++------- .../subroutines/set_g30_position.ngc | 1 + .../subroutines/tool_touch_off.ngc | 2 ++ 54 files changed, 108 insertions(+), 59 deletions(-) diff --git a/configs/atc_sim/macros_sim_inch/extendatc.ngc b/configs/atc_sim/macros_sim_inch/extendatc.ngc index cd959dc3..a2108075 100644 --- a/configs/atc_sim/macros_sim_inch/extendatc.ngc +++ b/configs/atc_sim/macros_sim_inch/extendatc.ngc @@ -1,6 +1,12 @@ o sub -G0 G53 Z0 +; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) +; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) + +# = -3.9000 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] + +G0 G53 Z# ; move z to clear height M65 P1 ; Turn off carousel home solenoid M64 P0 ; Move Carousel OUT diff --git a/configs/atc_sim/macros_sim_inch/load_spindle_safety.ngc b/configs/atc_sim/macros_sim_inch/load_spindle_safety.ngc index 880db87b..7d8ce49d 100644 --- a/configs/atc_sim/macros_sim_inch/load_spindle_safety.ngc +++ b/configs/atc_sim/macros_sim_inch/load_spindle_safety.ngc @@ -12,7 +12,7 @@ o sub (PRINT, o) -# = #1 +# = #1 ; this is the value form the ATC tab # = #2 # = #3 # = #4 diff --git a/configs/atc_sim/macros_sim_inch/load_spindle_safety_2.ngc b/configs/atc_sim/macros_sim_inch/load_spindle_safety_2.ngc index 7729aa8d..185bc388 100644 --- a/configs/atc_sim/macros_sim_inch/load_spindle_safety_2.ngc +++ b/configs/atc_sim/macros_sim_inch/load_spindle_safety_2.ngc @@ -12,7 +12,7 @@ o sub (PRINT, o) -# = #1 +# = #1 ; this is the value form the TOOL tab # = #2 # = #3 # = #4 diff --git a/configs/atc_sim/macros_sim_inch/m21.ngc b/configs/atc_sim/macros_sim_inch/m21.ngc index 06cebfb0..24de1233 100644 --- a/configs/atc_sim/macros_sim_inch/m21.ngc +++ b/configs/atc_sim/macros_sim_inch/m21.ngc @@ -8,7 +8,7 @@ o sub (PRINT, o) # = -3.9000 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/atc_sim/macros_sim_inch/m22.ngc b/configs/atc_sim/macros_sim_inch/m22.ngc index 602443fe..2fc326c7 100644 --- a/configs/atc_sim/macros_sim_inch/m22.ngc +++ b/configs/atc_sim/macros_sim_inch/m22.ngc @@ -7,7 +7,7 @@ o sub (PRINT, o) # = -3.9000 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] ;M19 R0 Q2 M24 diff --git a/configs/atc_sim/macros_sim_inch/m25.ngc b/configs/atc_sim/macros_sim_inch/m25.ngc index 37d8437c..dc55c0f5 100644 --- a/configs/atc_sim/macros_sim_inch/m25.ngc +++ b/configs/atc_sim/macros_sim_inch/m25.ngc @@ -2,6 +2,7 @@ o sub (PRINT, o) M64 P0 ; Move Carousel out + M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid diff --git a/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc b/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc index 0b0dbccd..5ece7c2d 100644 --- a/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc +++ b/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc @@ -4,7 +4,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; move z to clear height diff --git a/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc b/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc index f0484685..5bc24192 100644 --- a/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc +++ b/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc @@ -3,7 +3,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; rapid move to above the tool change height diff --git a/configs/atc_sim/macros_sim_inch/probe_top_right_edge_angle.ngc b/configs/atc_sim/macros_sim_inch/probe_top_right_edge_angle.ngc index dff3ada9..4ebbb38c 100644 --- a/configs/atc_sim/macros_sim_inch/probe_top_right_edge_angle.ngc +++ b/configs/atc_sim/macros_sim_inch/probe_top_right_edge_angle.ngc @@ -7,7 +7,7 @@ (step off width distance and within max z distance) (ensure all settings have been set properly according to help diagrams) -o sub +o sub (uses NGCGUI style arg spec) (number after "=" in comment is default value) @@ -37,7 +37,7 @@ o sub (Probe Tool Safety Check) o100 if [#5400 NE #] (MSG, Specified probe tool # not in spindle, aborting) - o return + o return o100 endif (Probe Diameter) @@ -68,7 +68,7 @@ o sub (value returned safety check, aborts if no value returned) o110 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o110 endif (edge width move to edge second probing point) @@ -84,7 +84,7 @@ o sub (value returned safety check, aborts if no value returned) o120 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o120 endif # = [# - #] @@ -109,16 +109,16 @@ o sub o130 if [# EQ 0 AND # EQ 0] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] - o return + o return o130 endif (probe mode rules for WCO, Rotation and probe position measuring only) o140 if [# EQ 0 AND # EQ 1] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] R[#] - o return + o return o140 endif -o endsub +o endsub M2 (end program) diff --git a/configs/atc_sim/macros_sim_inch/tool_touch_off.ngc b/configs/atc_sim/macros_sim_inch/tool_touch_off.ngc index ad3d0eb1..33f10b14 100644 --- a/configs/atc_sim/macros_sim_inch/tool_touch_off.ngc +++ b/configs/atc_sim/macros_sim_inch/tool_touch_off.ngc @@ -1,5 +1,7 @@ o sub +; NOTE this routine used G59.3, and this needs to be set to 0,0,0 for everything to work correctly + # = #1 (set from probe screen fast probe feed rate) # = #2 (set from probe screen slow probe feedrate) # = #3 (max z distance the tool travels before erroring out if not contact is made) diff --git a/configs/atc_sim/macros_sim_metric/extendatc.ngc b/configs/atc_sim/macros_sim_metric/extendatc.ngc index cd959dc3..a2108075 100644 --- a/configs/atc_sim/macros_sim_metric/extendatc.ngc +++ b/configs/atc_sim/macros_sim_metric/extendatc.ngc @@ -1,6 +1,12 @@ o sub -G0 G53 Z0 +; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) +; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) + +# = -3.9000 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] + +G0 G53 Z# ; move z to clear height M65 P1 ; Turn off carousel home solenoid M64 P0 ; Move Carousel OUT diff --git a/configs/atc_sim/macros_sim_metric/load_spindle_safety.ngc b/configs/atc_sim/macros_sim_metric/load_spindle_safety.ngc index 880db87b..7d8ce49d 100644 --- a/configs/atc_sim/macros_sim_metric/load_spindle_safety.ngc +++ b/configs/atc_sim/macros_sim_metric/load_spindle_safety.ngc @@ -12,7 +12,7 @@ o sub (PRINT, o) -# = #1 +# = #1 ; this is the value form the ATC tab # = #2 # = #3 # = #4 diff --git a/configs/atc_sim/macros_sim_metric/load_spindle_safety_2.ngc b/configs/atc_sim/macros_sim_metric/load_spindle_safety_2.ngc index 7729aa8d..185bc388 100644 --- a/configs/atc_sim/macros_sim_metric/load_spindle_safety_2.ngc +++ b/configs/atc_sim/macros_sim_metric/load_spindle_safety_2.ngc @@ -12,7 +12,7 @@ o sub (PRINT, o) -# = #1 +# = #1 ; this is the value form the TOOL tab # = #2 # = #3 # = #4 diff --git a/configs/atc_sim/macros_sim_metric/m13.ngc b/configs/atc_sim/macros_sim_metric/m13.ngc index 59f21e01..06da95e4 100644 --- a/configs/atc_sim/macros_sim_metric/m13.ngc +++ b/configs/atc_sim/macros_sim_metric/m13.ngc @@ -9,7 +9,7 @@ o sub (DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}]) M64 P3 ; Move Motor FWD -M66 P3 L1 Q20 ; wait for rising edge on rotation index +M66 P3 L1 Q20 ; wait for rising edge on home index o100 if [#5399 LT 0] M65 P3 ; stop motor (abort, failed to home carousel) diff --git a/configs/atc_sim/macros_sim_metric/m21.ngc b/configs/atc_sim/macros_sim_metric/m21.ngc index 06cebfb0..24de1233 100644 --- a/configs/atc_sim/macros_sim_metric/m21.ngc +++ b/configs/atc_sim/macros_sim_metric/m21.ngc @@ -8,7 +8,7 @@ o sub (PRINT, o) # = -3.9000 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/atc_sim/macros_sim_metric/m22.ngc b/configs/atc_sim/macros_sim_metric/m22.ngc index 602443fe..2fc326c7 100644 --- a/configs/atc_sim/macros_sim_metric/m22.ngc +++ b/configs/atc_sim/macros_sim_metric/m22.ngc @@ -7,7 +7,7 @@ o sub (PRINT, o) # = -3.9000 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] ;M19 R0 Q2 M24 diff --git a/configs/atc_sim/macros_sim_metric/m25.ngc b/configs/atc_sim/macros_sim_metric/m25.ngc index 37d8437c..dc55c0f5 100644 --- a/configs/atc_sim/macros_sim_metric/m25.ngc +++ b/configs/atc_sim/macros_sim_metric/m25.ngc @@ -2,6 +2,7 @@ o sub (PRINT, o) M64 P0 ; Move Carousel out + M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid diff --git a/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc b/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc index 0b0dbccd..5ece7c2d 100644 --- a/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc +++ b/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc @@ -4,7 +4,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; move z to clear height diff --git a/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc b/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc index f0484685..5bc24192 100644 --- a/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc +++ b/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc @@ -3,7 +3,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; rapid move to above the tool change height diff --git a/configs/atc_sim/macros_sim_metric/probe_top_right_edge_angle.ngc b/configs/atc_sim/macros_sim_metric/probe_top_right_edge_angle.ngc index dff3ada9..4ebbb38c 100644 --- a/configs/atc_sim/macros_sim_metric/probe_top_right_edge_angle.ngc +++ b/configs/atc_sim/macros_sim_metric/probe_top_right_edge_angle.ngc @@ -7,7 +7,7 @@ (step off width distance and within max z distance) (ensure all settings have been set properly according to help diagrams) -o sub +o sub (uses NGCGUI style arg spec) (number after "=" in comment is default value) @@ -37,7 +37,7 @@ o sub (Probe Tool Safety Check) o100 if [#5400 NE #] (MSG, Specified probe tool # not in spindle, aborting) - o return + o return o100 endif (Probe Diameter) @@ -68,7 +68,7 @@ o sub (value returned safety check, aborts if no value returned) o110 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o110 endif (edge width move to edge second probing point) @@ -84,7 +84,7 @@ o sub (value returned safety check, aborts if no value returned) o120 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o120 endif # = [# - #] @@ -109,16 +109,16 @@ o sub o130 if [# EQ 0 AND # EQ 0] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] - o return + o return o130 endif (probe mode rules for WCO, Rotation and probe position measuring only) o140 if [# EQ 0 AND # EQ 1] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] R[#] - o return + o return o140 endif -o endsub +o endsub M2 (end program) diff --git a/configs/atc_sim/macros_sim_metric/tool_touch_off.ngc b/configs/atc_sim/macros_sim_metric/tool_touch_off.ngc index ad3d0eb1..33f10b14 100644 --- a/configs/atc_sim/macros_sim_metric/tool_touch_off.ngc +++ b/configs/atc_sim/macros_sim_metric/tool_touch_off.ngc @@ -1,5 +1,7 @@ o sub +; NOTE this routine used G59.3, and this needs to be set to 0,0,0 for everything to work correctly + # = #1 (set from probe screen fast probe feed rate) # = #2 (set from probe screen slow probe feedrate) # = #3 (max z distance the tool travels before erroring out if not contact is made) diff --git a/configs/probe_basic/subroutines/extendatc.ngc b/configs/probe_basic/subroutines/extendatc.ngc index cd959dc3..a2108075 100644 --- a/configs/probe_basic/subroutines/extendatc.ngc +++ b/configs/probe_basic/subroutines/extendatc.ngc @@ -1,6 +1,12 @@ o sub -G0 G53 Z0 +; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) +; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) + +# = -3.9000 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] + +G0 G53 Z# ; move z to clear height M65 P1 ; Turn off carousel home solenoid M64 P0 ; Move Carousel OUT diff --git a/configs/probe_basic/subroutines/load_spindle_safety.ngc b/configs/probe_basic/subroutines/load_spindle_safety.ngc index 880db87b..7d8ce49d 100644 --- a/configs/probe_basic/subroutines/load_spindle_safety.ngc +++ b/configs/probe_basic/subroutines/load_spindle_safety.ngc @@ -12,7 +12,7 @@ o sub (PRINT, o) -# = #1 +# = #1 ; this is the value form the ATC tab # = #2 # = #3 # = #4 diff --git a/configs/probe_basic/subroutines/load_spindle_safety_2.ngc b/configs/probe_basic/subroutines/load_spindle_safety_2.ngc index 7729aa8d..185bc388 100644 --- a/configs/probe_basic/subroutines/load_spindle_safety_2.ngc +++ b/configs/probe_basic/subroutines/load_spindle_safety_2.ngc @@ -12,7 +12,7 @@ o sub (PRINT, o) -# = #1 +# = #1 ; this is the value form the TOOL tab # = #2 # = #3 # = #4 diff --git a/configs/probe_basic/subroutines/m13.ngc b/configs/probe_basic/subroutines/m13.ngc index 59f21e01..06da95e4 100644 --- a/configs/probe_basic/subroutines/m13.ngc +++ b/configs/probe_basic/subroutines/m13.ngc @@ -9,7 +9,7 @@ o sub (DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}]) M64 P3 ; Move Motor FWD -M66 P3 L1 Q20 ; wait for rising edge on rotation index +M66 P3 L1 Q20 ; wait for rising edge on home index o100 if [#5399 LT 0] M65 P3 ; stop motor (abort, failed to home carousel) diff --git a/configs/probe_basic/subroutines/m21.ngc b/configs/probe_basic/subroutines/m21.ngc index ab73da6a..2d6ca4fc 100644 --- a/configs/probe_basic/subroutines/m21.ngc +++ b/configs/probe_basic/subroutines/m21.ngc @@ -8,7 +8,7 @@ o sub (PRINT, o) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/probe_basic/subroutines/m22.ngc b/configs/probe_basic/subroutines/m22.ngc index df91c460..96931cab 100644 --- a/configs/probe_basic/subroutines/m22.ngc +++ b/configs/probe_basic/subroutines/m22.ngc @@ -7,7 +7,7 @@ o sub (PRINT, o) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] ;M19 R0 Q2 M24 diff --git a/configs/probe_basic/subroutines/m25.ngc b/configs/probe_basic/subroutines/m25.ngc index 37d8437c..dc55c0f5 100644 --- a/configs/probe_basic/subroutines/m25.ngc +++ b/configs/probe_basic/subroutines/m25.ngc @@ -2,6 +2,7 @@ o sub (PRINT, o) M64 P0 ; Move Carousel out + M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid diff --git a/configs/probe_basic/subroutines/move_head_above_carousel.ngc b/configs/probe_basic/subroutines/move_head_above_carousel.ngc index 0b0dbccd..5ece7c2d 100644 --- a/configs/probe_basic/subroutines/move_head_above_carousel.ngc +++ b/configs/probe_basic/subroutines/move_head_above_carousel.ngc @@ -4,7 +4,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; move z to clear height diff --git a/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc b/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc index f0484685..5bc24192 100644 --- a/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc +++ b/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc @@ -3,7 +3,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; rapid move to above the tool change height diff --git a/configs/probe_basic/subroutines/probe_top_right_edge_angle.ngc b/configs/probe_basic/subroutines/probe_top_right_edge_angle.ngc index dff3ada9..4ebbb38c 100644 --- a/configs/probe_basic/subroutines/probe_top_right_edge_angle.ngc +++ b/configs/probe_basic/subroutines/probe_top_right_edge_angle.ngc @@ -7,7 +7,7 @@ (step off width distance and within max z distance) (ensure all settings have been set properly according to help diagrams) -o sub +o sub (uses NGCGUI style arg spec) (number after "=" in comment is default value) @@ -37,7 +37,7 @@ o sub (Probe Tool Safety Check) o100 if [#5400 NE #] (MSG, Specified probe tool # not in spindle, aborting) - o return + o return o100 endif (Probe Diameter) @@ -68,7 +68,7 @@ o sub (value returned safety check, aborts if no value returned) o110 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o110 endif (edge width move to edge second probing point) @@ -84,7 +84,7 @@ o sub (value returned safety check, aborts if no value returned) o120 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o120 endif # = [# - #] @@ -109,16 +109,16 @@ o sub o130 if [# EQ 0 AND # EQ 0] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] - o return + o return o130 endif (probe mode rules for WCO, Rotation and probe position measuring only) o140 if [# EQ 0 AND # EQ 1] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] R[#] - o return + o return o140 endif -o endsub +o endsub M2 (end program) diff --git a/configs/probe_basic/subroutines/tool_touch_off.ngc b/configs/probe_basic/subroutines/tool_touch_off.ngc index ad3d0eb1..33f10b14 100644 --- a/configs/probe_basic/subroutines/tool_touch_off.ngc +++ b/configs/probe_basic/subroutines/tool_touch_off.ngc @@ -1,5 +1,7 @@ o sub +; NOTE this routine used G59.3, and this needs to be set to 0,0,0 for everything to work correctly + # = #1 (set from probe screen fast probe feed rate) # = #2 (set from probe screen slow probe feedrate) # = #3 (max z distance the tool travels before erroring out if not contact is made) diff --git a/configs/probe_basic_lathe/subroutines/extendatc.ngc b/configs/probe_basic_lathe/subroutines/extendatc.ngc index cd959dc3..a2108075 100644 --- a/configs/probe_basic_lathe/subroutines/extendatc.ngc +++ b/configs/probe_basic_lathe/subroutines/extendatc.ngc @@ -1,6 +1,12 @@ o sub -G0 G53 Z0 +; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) +; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) + +# = -3.9000 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] + +G0 G53 Z# ; move z to clear height M65 P1 ; Turn off carousel home solenoid M64 P0 ; Move Carousel OUT diff --git a/configs/probe_basic_lathe/subroutines/go_to_g30.ngc b/configs/probe_basic_lathe/subroutines/go_to_g30.ngc index ddd19428..ec2e73af 100644 --- a/configs/probe_basic_lathe/subroutines/go_to_g30.ngc +++ b/configs/probe_basic_lathe/subroutines/go_to_g30.ngc @@ -1,4 +1,5 @@ o sub +; Lathe specific version M73 G90 diff --git a/configs/probe_basic_lathe/subroutines/go_to_home.ngc b/configs/probe_basic_lathe/subroutines/go_to_home.ngc index 7e8e1181..eaf717c8 100644 --- a/configs/probe_basic_lathe/subroutines/go_to_home.ngc +++ b/configs/probe_basic_lathe/subroutines/go_to_home.ngc @@ -1,4 +1,5 @@ o sub +; Lathe specific version M73 G90 diff --git a/configs/probe_basic_lathe/subroutines/go_to_zero.ngc b/configs/probe_basic_lathe/subroutines/go_to_zero.ngc index 8b871330..12730c4e 100644 --- a/configs/probe_basic_lathe/subroutines/go_to_zero.ngc +++ b/configs/probe_basic_lathe/subroutines/go_to_zero.ngc @@ -1,4 +1,5 @@ o sub +; Lathe specific version M73 G90 diff --git a/configs/probe_basic_lathe/subroutines/m13.ngc b/configs/probe_basic_lathe/subroutines/m13.ngc index 59f21e01..06da95e4 100644 --- a/configs/probe_basic_lathe/subroutines/m13.ngc +++ b/configs/probe_basic_lathe/subroutines/m13.ngc @@ -9,7 +9,7 @@ o sub (DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}]) M64 P3 ; Move Motor FWD -M66 P3 L1 Q20 ; wait for rising edge on rotation index +M66 P3 L1 Q20 ; wait for rising edge on home index o100 if [#5399 LT 0] M65 P3 ; stop motor (abort, failed to home carousel) diff --git a/configs/probe_basic_lathe/subroutines/m21.ngc b/configs/probe_basic_lathe/subroutines/m21.ngc index 06cebfb0..24de1233 100644 --- a/configs/probe_basic_lathe/subroutines/m21.ngc +++ b/configs/probe_basic_lathe/subroutines/m21.ngc @@ -8,7 +8,7 @@ o sub (PRINT, o) # = -3.9000 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/probe_basic_lathe/subroutines/m22.ngc b/configs/probe_basic_lathe/subroutines/m22.ngc index 602443fe..2fc326c7 100644 --- a/configs/probe_basic_lathe/subroutines/m22.ngc +++ b/configs/probe_basic_lathe/subroutines/m22.ngc @@ -7,7 +7,7 @@ o sub (PRINT, o) # = -3.9000 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] ;M19 R0 Q2 M24 diff --git a/configs/probe_basic_lathe/subroutines/m25.ngc b/configs/probe_basic_lathe/subroutines/m25.ngc index 37d8437c..dc55c0f5 100644 --- a/configs/probe_basic_lathe/subroutines/m25.ngc +++ b/configs/probe_basic_lathe/subroutines/m25.ngc @@ -2,6 +2,7 @@ o sub (PRINT, o) M64 P0 ; Move Carousel out + M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid diff --git a/configs/probe_basic_lathe/subroutines/m6_tool_call_main_panel.ngc b/configs/probe_basic_lathe/subroutines/m6_tool_call_main_panel.ngc index f8195b9f..79cf2c2e 100644 --- a/configs/probe_basic_lathe/subroutines/m6_tool_call_main_panel.ngc +++ b/configs/probe_basic_lathe/subroutines/m6_tool_call_main_panel.ngc @@ -5,6 +5,7 @@ (m6 tool call with g43 offset applied) o sub +; Lathe specific version # = #1 # = #2 diff --git a/configs/probe_basic_lathe/subroutines/m6_tool_call_touch_panel.ngc b/configs/probe_basic_lathe/subroutines/m6_tool_call_touch_panel.ngc index c018a536..17e9185d 100644 --- a/configs/probe_basic_lathe/subroutines/m6_tool_call_touch_panel.ngc +++ b/configs/probe_basic_lathe/subroutines/m6_tool_call_touch_panel.ngc @@ -4,7 +4,7 @@ (m6 tool call with g43 offset applied) -o sub +o sub # = #1 # = #2 @@ -19,7 +19,7 @@ o100 if [# EQ 1] G90 G53 G0 Z# G53 G0 X# - o return + o return o100 endif T# M6 g43 diff --git a/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc b/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc index 0b0dbccd..5ece7c2d 100644 --- a/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc +++ b/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc @@ -4,7 +4,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; move z to clear height diff --git a/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc b/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc index f0484685..5bc24192 100644 --- a/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc +++ b/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc @@ -3,7 +3,7 @@ o sub ; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) # = -3.1900 -# = 0 +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G0 G53 Z# ; rapid move to above the tool change height diff --git a/configs/probe_basic_lathe/subroutines/probe_corner_x_minus_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_corner_x_minus_edge_angle.ngc index cf028d25..62dc04aa 100644 --- a/configs/probe_basic_lathe/subroutines/probe_corner_x_minus_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_corner_x_minus_edge_angle.ngc @@ -8,6 +8,7 @@ (ensure all settings have been set properly according to help diagrams) o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) diff --git a/configs/probe_basic_lathe/subroutines/probe_corner_x_plus_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_corner_x_plus_edge_angle.ngc index 155f3c09..d004c6d3 100644 --- a/configs/probe_basic_lathe/subroutines/probe_corner_x_plus_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_corner_x_plus_edge_angle.ngc @@ -8,6 +8,7 @@ (ensure all settings have been set properly according to help diagrams) o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) diff --git a/configs/probe_basic_lathe/subroutines/probe_corner_y_minus_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_corner_y_minus_edge_angle.ngc index 8c0f29ef..a6de578e 100644 --- a/configs/probe_basic_lathe/subroutines/probe_corner_y_minus_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_corner_y_minus_edge_angle.ngc @@ -8,6 +8,7 @@ (ensure all settings have been set properly according to help diagrams) o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) diff --git a/configs/probe_basic_lathe/subroutines/probe_corner_y_plus_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_corner_y_plus_edge_angle.ngc index a9eb5d69..8afd338c 100644 --- a/configs/probe_basic_lathe/subroutines/probe_corner_y_plus_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_corner_y_plus_edge_angle.ngc @@ -8,6 +8,7 @@ (ensure all settings have been set properly according to help diagrams) o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) diff --git a/configs/probe_basic_lathe/subroutines/probe_top_back_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_top_back_edge_angle.ngc index 5faf5f4c..d7dc60c5 100644 --- a/configs/probe_basic_lathe/subroutines/probe_top_back_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_top_back_edge_angle.ngc @@ -8,6 +8,7 @@ (ensure all settings have been set properly according to help diagrams) o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) diff --git a/configs/probe_basic_lathe/subroutines/probe_top_front_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_top_front_edge_angle.ngc index 68f65cac..d6a5f9b2 100644 --- a/configs/probe_basic_lathe/subroutines/probe_top_front_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_top_front_edge_angle.ngc @@ -8,6 +8,7 @@ (ensure all settings have been set properly according to help diagrams) o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) diff --git a/configs/probe_basic_lathe/subroutines/probe_top_left_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_top_left_edge_angle.ngc index 26fa4121..97ce2bcf 100644 --- a/configs/probe_basic_lathe/subroutines/probe_top_left_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_top_left_edge_angle.ngc @@ -8,6 +8,7 @@ (ensure all settings have been set properly according to help diagrams) o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) diff --git a/configs/probe_basic_lathe/subroutines/probe_top_right_edge_angle.ngc b/configs/probe_basic_lathe/subroutines/probe_top_right_edge_angle.ngc index ad3aef0a..f602ded3 100644 --- a/configs/probe_basic_lathe/subroutines/probe_top_right_edge_angle.ngc +++ b/configs/probe_basic_lathe/subroutines/probe_top_right_edge_angle.ngc @@ -7,7 +7,8 @@ (step off width distance and within max z distance) (ensure all settings have been set properly according to help diagrams) -o sub +o sub +; Lathe specific version (uses NGCGUI style arg spec) (number after "=" in comment is default value) @@ -38,7 +39,7 @@ o sub (Probe Tool Safety Check) o100 if [#5400 NE #] (MSG, Specified probe tool # not in spindle, aborting) - o return + o return o100 endif (Probe Diameter) @@ -69,7 +70,7 @@ o sub (value returned safety check, aborts if no value returned) o110 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o110 endif (edge width move to edge second probing point) @@ -85,7 +86,7 @@ o sub (value returned safety check, aborts if no value returned) o120 if [# EQ 1 AND #<_value_returned> NE 1] (MSG, Missing X Sub returned edge parameter, aborting) - o return + o return o120 endif # = [# - #] @@ -110,16 +111,16 @@ o sub o130 if [# EQ 0 AND # EQ 0] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] - o return + o return o130 endif (probe mode rules for WCO, Rotation and probe position measuring only) o140 if [# EQ 0 AND # EQ 1] (Record Zero in selected axes and WCO) G10 L2 P#5220 X[# + #] Y[#] R[# + #] - o return + o return o140 endif -o endsub +o endsub M2 (end program) diff --git a/configs/probe_basic_lathe/subroutines/set_g30_position.ngc b/configs/probe_basic_lathe/subroutines/set_g30_position.ngc index 4fe8eea7..8af0bcec 100644 --- a/configs/probe_basic_lathe/subroutines/set_g30_position.ngc +++ b/configs/probe_basic_lathe/subroutines/set_g30_position.ngc @@ -1,4 +1,5 @@ o sub +; Lathe specific version o100 if [1 EQ 1] (G30.1 records the tool touch off position in the var file) diff --git a/configs/probe_basic_lathe/subroutines/tool_touch_off.ngc b/configs/probe_basic_lathe/subroutines/tool_touch_off.ngc index ad3d0eb1..33f10b14 100644 --- a/configs/probe_basic_lathe/subroutines/tool_touch_off.ngc +++ b/configs/probe_basic_lathe/subroutines/tool_touch_off.ngc @@ -1,5 +1,7 @@ o sub +; NOTE this routine used G59.3, and this needs to be set to 0,0,0 for everything to work correctly + # = #1 (set from probe screen fast probe feed rate) # = #2 (set from probe screen slow probe feedrate) # = #3 (max z distance the tool travels before erroring out if not contact is made) From ecd6d4fd821d4ef8fbe8b171778e3ddd386e2e73 Mon Sep 17 00:00:00 2001 From: dpslwk Date: Fri, 1 Dec 2023 11:38:00 +0000 Subject: [PATCH 4/5] ATC sub: use Z heights from INI settings if available --- configs/atc_sim/macros_sim_inch/extendatc.ngc | 10 ++++++++-- configs/atc_sim/macros_sim_inch/m21.ngc | 10 ++++++++-- configs/atc_sim/macros_sim_inch/m22.ngc | 10 ++++++++-- .../macros_sim_inch/move_head_above_carousel.ngc | 12 +++++++++--- .../move_tool_to_carousel_height.ngc | 12 +++++++++--- configs/atc_sim/macros_sim_metric/extendatc.ngc | 10 ++++++++-- configs/atc_sim/macros_sim_metric/m21.ngc | 10 ++++++++-- configs/atc_sim/macros_sim_metric/m22.ngc | 10 ++++++++-- .../macros_sim_metric/move_head_above_carousel.ngc | 12 +++++++++--- .../move_tool_to_carousel_height.ngc | 12 +++++++++--- configs/atc_sim/vmc_index.ini | 4 ++++ configs/atc_sim/vmc_index_inch.ini | 4 ++++ configs/atc_sim/vmc_index_metric.ini | 4 ++++ configs/probe_basic/probe_basic.ini | 4 ++++ configs/probe_basic/subroutines/extendatc.ngc | 10 ++++++++-- configs/probe_basic/subroutines/m21.ngc | 10 ++++++++-- configs/probe_basic/subroutines/m22.ngc | 10 ++++++++-- .../subroutines/move_head_above_carousel.ngc | 10 ++++++++-- .../subroutines/move_tool_to_carousel_height.ngc | 10 ++++++++-- configs/probe_basic_lathe/subroutines/extendatc.ngc | 10 ++++++++-- configs/probe_basic_lathe/subroutines/m21.ngc | 10 ++++++++-- configs/probe_basic_lathe/subroutines/m22.ngc | 10 ++++++++-- .../subroutines/move_head_above_carousel.ngc | 13 ++++++++++--- .../subroutines/move_tool_to_carousel_height.ngc | 12 +++++++++--- 24 files changed, 183 insertions(+), 46 deletions(-) diff --git a/configs/atc_sim/macros_sim_inch/extendatc.ngc b/configs/atc_sim/macros_sim_inch/extendatc.ngc index a2108075..b16d6413 100644 --- a/configs/atc_sim/macros_sim_inch/extendatc.ngc +++ b/configs/atc_sim/macros_sim_inch/extendatc.ngc @@ -1,10 +1,16 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; move z to clear height diff --git a/configs/atc_sim/macros_sim_inch/m21.ngc b/configs/atc_sim/macros_sim_inch/m21.ngc index 24de1233..9bffddd1 100644 --- a/configs/atc_sim/macros_sim_inch/m21.ngc +++ b/configs/atc_sim/macros_sim_inch/m21.ngc @@ -3,12 +3,18 @@ o sub ; Move Carousel to the tool change position - OUT ; then unload any tool in the spindle into the current pocket ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/atc_sim/macros_sim_inch/m22.ngc b/configs/atc_sim/macros_sim_inch/m22.ngc index 2fc326c7..825713fa 100644 --- a/configs/atc_sim/macros_sim_inch/m22.ngc +++ b/configs/atc_sim/macros_sim_inch/m22.ngc @@ -2,12 +2,18 @@ o sub ; Move Carousel to the home position - IN ; after loading any tool in the current pocket to the spindle -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif ;M19 R0 Q2 M24 diff --git a/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc b/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc index 5ece7c2d..8e3834a1 100644 --- a/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc +++ b/configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc @@ -1,10 +1,16 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -# = -3.1900 +# = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; move z to clear height diff --git a/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc b/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc index 5bc24192..77215115 100644 --- a/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc +++ b/configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc @@ -1,9 +1,15 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -# = -3.1900 +# = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; rapid move to above the tool change height diff --git a/configs/atc_sim/macros_sim_metric/extendatc.ngc b/configs/atc_sim/macros_sim_metric/extendatc.ngc index a2108075..b16d6413 100644 --- a/configs/atc_sim/macros_sim_metric/extendatc.ngc +++ b/configs/atc_sim/macros_sim_metric/extendatc.ngc @@ -1,10 +1,16 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; move z to clear height diff --git a/configs/atc_sim/macros_sim_metric/m21.ngc b/configs/atc_sim/macros_sim_metric/m21.ngc index 24de1233..9bffddd1 100644 --- a/configs/atc_sim/macros_sim_metric/m21.ngc +++ b/configs/atc_sim/macros_sim_metric/m21.ngc @@ -3,12 +3,18 @@ o sub ; Move Carousel to the tool change position - OUT ; then unload any tool in the spindle into the current pocket ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/atc_sim/macros_sim_metric/m22.ngc b/configs/atc_sim/macros_sim_metric/m22.ngc index 2fc326c7..825713fa 100644 --- a/configs/atc_sim/macros_sim_metric/m22.ngc +++ b/configs/atc_sim/macros_sim_metric/m22.ngc @@ -2,12 +2,18 @@ o sub ; Move Carousel to the home position - IN ; after loading any tool in the current pocket to the spindle -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif ;M19 R0 Q2 M24 diff --git a/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc b/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc index 5ece7c2d..8e3834a1 100644 --- a/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc +++ b/configs/atc_sim/macros_sim_metric/move_head_above_carousel.ngc @@ -1,10 +1,16 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -# = -3.1900 +# = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; move z to clear height diff --git a/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc b/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc index 5bc24192..77215115 100644 --- a/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc +++ b/configs/atc_sim/macros_sim_metric/move_tool_to_carousel_height.ngc @@ -1,9 +1,15 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -# = -3.1900 +# = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; rapid move to above the tool change height diff --git a/configs/atc_sim/vmc_index.ini b/configs/atc_sim/vmc_index.ini index db0714c5..16ca4dcd 100644 --- a/configs/atc_sim/vmc_index.ini +++ b/configs/atc_sim/vmc_index.ini @@ -41,6 +41,10 @@ PATH_APPEND = ./python/python-stdglue/ [ATC] # Carousel image available for 8, 10, 12, 14, 16, 18, 20, 21, 24 POCKETS = 12 +# The Z height you spindle needs to be at to clamp/unclamp a tool form the ATC +Z_TOOL_CHANGE_HEIGHT = -3.9000 +# The Z clearance height you spindle needs to be at to safely clear the ATC +Z_TOOL_CLEARANCE_HEIGHT = -0.1 [RS274NGC] PROGRAM_PREFIX = ~/linuxcnc/nc_files diff --git a/configs/atc_sim/vmc_index_inch.ini b/configs/atc_sim/vmc_index_inch.ini index 843a4e0d..64adec3e 100644 --- a/configs/atc_sim/vmc_index_inch.ini +++ b/configs/atc_sim/vmc_index_inch.ini @@ -43,6 +43,10 @@ PATH_APPEND = ./python/python-stdglue/ [ATC] # Carousel image available for 8, 10, 12, 14, 16, 18, 20, 21, 24 POCKETS = 12 +# The Z height you spindle needs to be at to clamp/unclamp a tool form the ATC +Z_TOOL_CHANGE_HEIGHT = -3.9000 +# The Z clearance height you spindle needs to be at to safely clear the ATC +Z_TOOL_CLEARANCE_HEIGHT = -0.1 STEP_TIME = 500 [RS274NGC] diff --git a/configs/atc_sim/vmc_index_metric.ini b/configs/atc_sim/vmc_index_metric.ini index a4001cf2..9b6661b3 100644 --- a/configs/atc_sim/vmc_index_metric.ini +++ b/configs/atc_sim/vmc_index_metric.ini @@ -43,6 +43,10 @@ PATH_APPEND = ./python/python-stdglue/ [ATC] # Carousel image available for 8, 10, 12, 14, 16, 18, 20, 21, 24 POCKETS = 12 +# The Z height you spindle needs to be at to clamp/unclamp a tool form the ATC +Z_TOOL_CHANGE_HEIGHT = -3.9000 +# The Z clearance height you spindle needs to be at to safely clear the ATC +Z_TOOL_CLEARANCE_HEIGHT = -0.1 [RS274NGC] RS274NGC_STARTUP_CODE = F10 S300 G21 G17 G40 G49 G54 G64 P0.001 G80 G90 G91.1 G92.1 G94 G97 G98 diff --git a/configs/probe_basic/probe_basic.ini b/configs/probe_basic/probe_basic.ini index 1f3f9f42..8c399e6c 100644 --- a/configs/probe_basic/probe_basic.ini +++ b/configs/probe_basic/probe_basic.ini @@ -51,6 +51,10 @@ PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image [ATC] # Carousel image available for 8, 10, 12, 14, 16, 18, 20, 21, 24 POCKETS = 12 +# The Z height you spindle needs to be at to clamp/unclamp a tool form the ATC +Z_TOOL_CHANGE_HEIGHT = -3.1900 +# The Z clearance height you spindle needs to be at to safely clear the ATC +Z_TOOL_CLEARANCE_HEIGHT = -0.1 STEP_TIME = 500 [RS274NGC] diff --git a/configs/probe_basic/subroutines/extendatc.ngc b/configs/probe_basic/subroutines/extendatc.ngc index a2108075..b16d6413 100644 --- a/configs/probe_basic/subroutines/extendatc.ngc +++ b/configs/probe_basic/subroutines/extendatc.ngc @@ -1,10 +1,16 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; move z to clear height diff --git a/configs/probe_basic/subroutines/m21.ngc b/configs/probe_basic/subroutines/m21.ngc index 2d6ca4fc..17152078 100644 --- a/configs/probe_basic/subroutines/m21.ngc +++ b/configs/probe_basic/subroutines/m21.ngc @@ -3,12 +3,18 @@ o sub ; Move Carousel to the tool change position - OUT ; then unload any tool in the spindle into the current pocket ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.1900 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/probe_basic/subroutines/m22.ngc b/configs/probe_basic/subroutines/m22.ngc index 96931cab..3150f732 100644 --- a/configs/probe_basic/subroutines/m22.ngc +++ b/configs/probe_basic/subroutines/m22.ngc @@ -2,12 +2,18 @@ o sub ; Move Carousel to the home position - IN ; after loading any tool in the current pocket to the spindle -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.1900 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif ;M19 R0 Q2 M24 diff --git a/configs/probe_basic/subroutines/move_head_above_carousel.ngc b/configs/probe_basic/subroutines/move_head_above_carousel.ngc index 5ece7c2d..5c2fd1cd 100644 --- a/configs/probe_basic/subroutines/move_head_above_carousel.ngc +++ b/configs/probe_basic/subroutines/move_head_above_carousel.ngc @@ -1,10 +1,16 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) # = -3.1900 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; move z to clear height diff --git a/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc b/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc index 5bc24192..c07eb35b 100644 --- a/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc +++ b/configs/probe_basic/subroutines/move_tool_to_carousel_height.ngc @@ -1,9 +1,15 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) # = -3.1900 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; rapid move to above the tool change height diff --git a/configs/probe_basic_lathe/subroutines/extendatc.ngc b/configs/probe_basic_lathe/subroutines/extendatc.ngc index a2108075..b16d6413 100644 --- a/configs/probe_basic_lathe/subroutines/extendatc.ngc +++ b/configs/probe_basic_lathe/subroutines/extendatc.ngc @@ -1,10 +1,16 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; move z to clear height diff --git a/configs/probe_basic_lathe/subroutines/m21.ngc b/configs/probe_basic_lathe/subroutines/m21.ngc index 24de1233..9bffddd1 100644 --- a/configs/probe_basic_lathe/subroutines/m21.ngc +++ b/configs/probe_basic_lathe/subroutines/m21.ngc @@ -3,12 +3,18 @@ o sub ; Move Carousel to the tool change position - OUT ; then unload any tool in the spindle into the current pocket ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif M65 P1 ; switch off carousel in solenoid M66 P1 L3 Q1 diff --git a/configs/probe_basic_lathe/subroutines/m22.ngc b/configs/probe_basic_lathe/subroutines/m22.ngc index 2fc326c7..825713fa 100644 --- a/configs/probe_basic_lathe/subroutines/m22.ngc +++ b/configs/probe_basic_lathe/subroutines/m22.ngc @@ -2,12 +2,18 @@ o sub ; Move Carousel to the home position - IN ; after loading any tool in the current pocket to the spindle -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) (PRINT, o) # = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif ;M19 R0 Q2 M24 diff --git a/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc b/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc index 5ece7c2d..65e68cdf 100644 --- a/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc +++ b/configs/probe_basic_lathe/subroutines/move_head_above_carousel.ngc @@ -1,10 +1,17 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -# = -3.1900 +# = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif + G0 G53 Z# ; move z to clear height diff --git a/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc b/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc index 5bc24192..77215115 100644 --- a/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc +++ b/configs/probe_basic_lathe/subroutines/move_tool_to_carousel_height.ngc @@ -1,9 +1,15 @@ o sub -; # is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs) -; # is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs) +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -# = -3.1900 +# = -3.9000 +o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o101 endif # = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o102 endif G0 G53 Z# ; rapid move to above the tool change height From 3193d36a3d7484a5f5ada22f757c3519340f0d96 Mon Sep 17 00:00:00 2001 From: dpslwk Date: Fri, 1 Dec 2023 12:37:13 +0000 Subject: [PATCH 5/5] Subroutines: improve abort messages, especially 'tool not in carousel' --- configs/atc_sim/macros_sim_inch/clamptool.ngc | 2 +- configs/atc_sim/macros_sim_inch/extendatc.ngc | 2 +- configs/atc_sim/macros_sim_inch/m10.ngc | 5 ++- configs/atc_sim/macros_sim_inch/m11.ngc | 5 ++- configs/atc_sim/macros_sim_inch/m12.ngc | 5 ++- configs/atc_sim/macros_sim_inch/m13.ngc | 5 ++- configs/atc_sim/macros_sim_inch/m21.ngc | 5 ++- configs/atc_sim/macros_sim_inch/m22.ngc | 7 ++-- configs/atc_sim/macros_sim_inch/m24.ngc | 1 + configs/atc_sim/macros_sim_inch/m25.ngc | 3 +- .../atc_sim/macros_sim_inch/retractatc.ngc | 2 +- .../atc_sim/macros_sim_inch/toolchange.ngc | 41 +++++++++++++++---- .../atc_sim/macros_sim_inch/unclamptool.ngc | 2 +- .../atc_sim/macros_sim_metric/clamptool.ngc | 2 +- .../atc_sim/macros_sim_metric/extendatc.ngc | 2 +- configs/atc_sim/macros_sim_metric/m10.ngc | 5 ++- configs/atc_sim/macros_sim_metric/m11.ngc | 5 ++- configs/atc_sim/macros_sim_metric/m12.ngc | 5 ++- configs/atc_sim/macros_sim_metric/m13.ngc | 5 ++- configs/atc_sim/macros_sim_metric/m21.ngc | 5 ++- configs/atc_sim/macros_sim_metric/m22.ngc | 7 ++-- configs/atc_sim/macros_sim_metric/m24.ngc | 1 + configs/atc_sim/macros_sim_metric/m25.ngc | 3 +- .../atc_sim/macros_sim_metric/retractatc.ngc | 2 +- .../atc_sim/macros_sim_metric/toolchange.ngc | 41 +++++++++++++++---- .../atc_sim/macros_sim_metric/unclamptool.ngc | 2 +- configs/probe_basic/subroutines/clamptool.ngc | 2 +- configs/probe_basic/subroutines/extendatc.ngc | 2 +- configs/probe_basic/subroutines/m10.ngc | 5 ++- configs/probe_basic/subroutines/m11.ngc | 5 ++- configs/probe_basic/subroutines/m12.ngc | 5 ++- configs/probe_basic/subroutines/m13.ngc | 5 ++- configs/probe_basic/subroutines/m21.ngc | 5 ++- configs/probe_basic/subroutines/m22.ngc | 7 ++-- configs/probe_basic/subroutines/m24.ngc | 3 +- configs/probe_basic/subroutines/m25.ngc | 3 +- .../probe_basic/subroutines/retractatc.ngc | 2 +- .../probe_basic/subroutines/toolchange.ngc | 41 +++++++++++++++---- .../probe_basic/subroutines/unclamptool.ngc | 2 +- .../subroutines/clamptool.ngc | 2 +- .../subroutines/extendatc.ngc | 2 +- configs/probe_basic_lathe/subroutines/m10.ngc | 5 ++- configs/probe_basic_lathe/subroutines/m11.ngc | 5 ++- configs/probe_basic_lathe/subroutines/m12.ngc | 5 ++- configs/probe_basic_lathe/subroutines/m13.ngc | 5 ++- configs/probe_basic_lathe/subroutines/m21.ngc | 5 ++- configs/probe_basic_lathe/subroutines/m22.ngc | 7 ++-- configs/probe_basic_lathe/subroutines/m24.ngc | 3 +- configs/probe_basic_lathe/subroutines/m25.ngc | 3 +- .../subroutines/retractatc.ngc | 2 +- .../subroutines/toolchange.ngc | 41 +++++++++++++++---- .../subroutines/unclamptool.ngc | 2 +- 52 files changed, 234 insertions(+), 110 deletions(-) diff --git a/configs/atc_sim/macros_sim_inch/clamptool.ngc b/configs/atc_sim/macros_sim_inch/clamptool.ngc index a167d778..8b1a7b1b 100644 --- a/configs/atc_sim/macros_sim_inch/clamptool.ngc +++ b/configs/atc_sim/macros_sim_inch/clamptool.ngc @@ -4,7 +4,7 @@ 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1] diff --git a/configs/atc_sim/macros_sim_inch/extendatc.ngc b/configs/atc_sim/macros_sim_inch/extendatc.ngc index b16d6413..95828367 100644 --- a/configs/atc_sim/macros_sim_inch/extendatc.ngc +++ b/configs/atc_sim/macros_sim_inch/extendatc.ngc @@ -20,7 +20,7 @@ M64 P0 ; Move Carousel OUT M66 P1 L3 Q5 ; check for carousel out position sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif o endsub [1] diff --git a/configs/atc_sim/macros_sim_inch/m10.ngc b/configs/atc_sim/macros_sim_inch/m10.ngc index c02e0788..2562672e 100644 --- a/configs/atc_sim/macros_sim_inch/m10.ngc +++ b/configs/atc_sim/macros_sim_inch/m10.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] M13 @@ -17,7 +17,7 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] o101 endif # = [#3990 - #

] -(PRINT, o P#

, steps=#) +(PRINT, o P#

, steps=#) o110 if [# GT [# / 2]] #=[# - #] o110 endif @@ -31,6 +31,7 @@ o130 elseif [# LT 0] M11 P[#] o130 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/m11.ngc b/configs/atc_sim/macros_sim_inch/m11.ngc index 096f578b..3db74563 100644 --- a/configs/atc_sim/macros_sim_inch/m11.ngc +++ b/configs/atc_sim/macros_sim_inch/m11.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P4 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990+2] MOD #]-1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P4 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/m12.ngc b/configs/atc_sim/macros_sim_inch/m12.ngc index c1d4c3ca..34f2d6f3 100644 --- a/configs/atc_sim/macros_sim_inch/m12.ngc +++ b/configs/atc_sim/macros_sim_inch/m12.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P3 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990-2] MOD #]+1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P3 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/m13.ngc b/configs/atc_sim/macros_sim_inch/m13.ngc index 06da95e4..ede03334 100644 --- a/configs/atc_sim/macros_sim_inch/m13.ngc +++ b/configs/atc_sim/macros_sim_inch/m13.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o) +(PRINT, o) (DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}]) @@ -12,7 +12,7 @@ M64 P3 ; Move Motor FWD M66 P3 L1 Q20 ; wait for rising edge on home index o100 if [#5399 LT 0] M65 P3 ; stop motor - (abort, failed to home carousel) + (abort, Failed to home carousel) o100 endif #3990 = 1 @@ -36,6 +36,7 @@ o120 endwhile M61 Q#3991 G43 H#3991 #5210 = 0 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/m21.ngc b/configs/atc_sim/macros_sim_inch/m21.ngc index 9bffddd1..2ec9daea 100644 --- a/configs/atc_sim/macros_sim_inch/m21.ngc +++ b/configs/atc_sim/macros_sim_inch/m21.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.9000 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -29,7 +29,7 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif M24 ; activate drawbar, release the tool @@ -39,6 +39,7 @@ G0 G53 Z# ; move z to clear height #3991 = 0; save fact there is now no tool in the spindle +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/m22.ngc b/configs/atc_sim/macros_sim_inch/m22.ngc index 825713fa..2e87c9a5 100644 --- a/configs/atc_sim/macros_sim_inch/m22.ngc +++ b/configs/atc_sim/macros_sim_inch/m22.ngc @@ -4,7 +4,7 @@ o sub ; after loading any tool in the current pocket to the spindle ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.9000 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -24,18 +24,19 @@ M65 P2 ; release the drawbar to clamp the tool M5 M66 P5 L3 Q1 ; check the tool clamped sensor o100 if [#5399 LT 0] - (abort, failed to reclamp tool) + (abort, Failed to reclamp tool) o100 endif M65 P0 ; Move Carousel home M66 P0 L3 Q4 ; check carousel in position sensor o110 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o110 endif ;M65 P1 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/m24.ngc b/configs/atc_sim/macros_sim_inch/m24.ngc index 484fc11b..37454968 100644 --- a/configs/atc_sim/macros_sim_inch/m24.ngc +++ b/configs/atc_sim/macros_sim_inch/m24.ngc @@ -8,6 +8,7 @@ o100 if [#5399 LT 0] (abort, failed to release tool) ; abort if the sensor does not activate in 3 seconds o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/m25.ngc b/configs/atc_sim/macros_sim_inch/m25.ngc index dc55c0f5..a1a7ac98 100644 --- a/configs/atc_sim/macros_sim_inch/m25.ngc +++ b/configs/atc_sim/macros_sim_inch/m25.ngc @@ -6,9 +6,10 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/retractatc.ngc b/configs/atc_sim/macros_sim_inch/retractatc.ngc index 43c31da6..f9d400fe 100644 --- a/configs/atc_sim/macros_sim_inch/retractatc.ngc +++ b/configs/atc_sim/macros_sim_inch/retractatc.ngc @@ -6,7 +6,7 @@ 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o100 endif M65 P1 diff --git a/configs/atc_sim/macros_sim_inch/toolchange.ngc b/configs/atc_sim/macros_sim_inch/toolchange.ngc index de63b409..21d39094 100644 --- a/configs/atc_sim/macros_sim_inch/toolchange.ngc +++ b/configs/atc_sim/macros_sim_inch/toolchange.ngc @@ -6,8 +6,10 @@ o sub ; 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 ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o selected_tool: #, tool_in_spindle: #, selected_pocket: #, current_pocket: #, task: #<_task>) o100 if [#<_task> EQ 0] (DEBUG, Task is null) @@ -20,28 +22,46 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] # = #<_ini[atc]pockets> o101 endif +# = -3.9000 +o102 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o102 endif +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o103 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o103 endif + ; assign the programmable coolant parameters # = #1 (=0) # = #2 (=0) # = #3 (=0) # = #4 (=0) -; assign the variables passed by M6 to some parameters +; assign the variables passed by M6 change_prolog to some parameters #100 = # #110 = # #120 = # +#121 = # +; NOTE: +; The legacy names *selected_pocket* and *current_pocket* actually reference +; a sequential tooldata index for tool items loaded from a tool +; table ([EMCIO]TOOL_TABLE) or via a tooldata database ([EMCIO]DB_PROGRAM) -o110 if [#100 EQ #110] ; checks if tool in the spindle is same as requested +o110 if [# EQ #] ; checks if tool in the spindle is same as requested o endsub [1] M2 o110 endif +o111 if [#3991 NE #] + (PRINT, o tool_in_spindle does not match 3991) +o111 endif + # = 0 ; assigns 0 to the next pocket for a later check if the tool is found in the carousel # = 0 #130 = # ; assign test parameter the number of pockets in the carousel o120 do - o121 if [#[4000 + #130] EQ #100] ; checks all pockets to see if it contains tool number requested as the new tool + o121 if [#[4000 + #130] EQ #] ; checks all pockets to see if it contains tool number requested as the new tool # = #130 ; if tool is found in pocket, assigns the next pocket o121 endif o122 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. @@ -50,7 +70,7 @@ o120 do #130 = [#130 - 1] o120 while [#130 GT 0] o130 if [# EQ 0] ; if tool is not found, aborts and sends a message - (abort, tool not in carousel) + (abort, Tool T%d# not found in carousel) o130 endif ; now we know which pocket the next tool is sitting in @@ -59,7 +79,7 @@ o130 endif o140 if [# GT 0] ; checks if there is a valid tool in the spindle o141 if [# EQ 0] ; If there is a tool in the spindle, checks if there is an open pocket - (abort, carousel is full, cant put away tool in into carousel) + (abort, Carousel is full, cant put away tool T# in into carousel) o141 endif M10 P[#] ; move carousel to an open pocket M21 ; puts the tool in spindle away into the open pocket @@ -67,10 +87,12 @@ o140 if [# GT 0] ; checks if there is a valid tool in the spind #140 = # #[4000 + #140] = # ; save tool number in pocket #3991 = 0 ; empty tool in the spindle + M61 Q0 + G49 o140 endif G90 -G0 G53 Z0 +G0 G53 Z# ; move z to clear height o150 if [# GT 0] ; selected tool is not tool0 M10 P# ; set the carousel to move to the right pocket for the selected tool @@ -79,7 +101,7 @@ o150 if [# GT 0] ; selected tool is not tool0 M66 P1 L3 Q5 ; check carousel out position sensor o151 if [#5399 LT 0] M65 P0 ; turn off the solenoid to send atc to tool change - (abort, failed to send carousel home) ; abort if the sensor does not activate in 5 seconds + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o151 endif M65 P0 @@ -95,7 +117,7 @@ o150 else M66 P0 L3 Q4 ; check carousel in position sensor o152 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o152 endif M65 P1 o150 endif @@ -112,6 +134,7 @@ o170 if [# EQ 1] o call [#][#][#][#] o170 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_inch/unclamptool.ngc b/configs/atc_sim/macros_sim_inch/unclamptool.ngc index 1bf17ec5..ac9c3798 100644 --- a/configs/atc_sim/macros_sim_inch/unclamptool.ngc +++ b/configs/atc_sim/macros_sim_inch/unclamptool.ngc @@ -4,7 +4,7 @@ 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1] diff --git a/configs/atc_sim/macros_sim_metric/clamptool.ngc b/configs/atc_sim/macros_sim_metric/clamptool.ngc index a167d778..8b1a7b1b 100644 --- a/configs/atc_sim/macros_sim_metric/clamptool.ngc +++ b/configs/atc_sim/macros_sim_metric/clamptool.ngc @@ -4,7 +4,7 @@ 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1] diff --git a/configs/atc_sim/macros_sim_metric/extendatc.ngc b/configs/atc_sim/macros_sim_metric/extendatc.ngc index b16d6413..95828367 100644 --- a/configs/atc_sim/macros_sim_metric/extendatc.ngc +++ b/configs/atc_sim/macros_sim_metric/extendatc.ngc @@ -20,7 +20,7 @@ M64 P0 ; Move Carousel OUT M66 P1 L3 Q5 ; check for carousel out position sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif o endsub [1] diff --git a/configs/atc_sim/macros_sim_metric/m10.ngc b/configs/atc_sim/macros_sim_metric/m10.ngc index c02e0788..2562672e 100644 --- a/configs/atc_sim/macros_sim_metric/m10.ngc +++ b/configs/atc_sim/macros_sim_metric/m10.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] M13 @@ -17,7 +17,7 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] o101 endif # = [#3990 - #

] -(PRINT, o P#

, steps=#) +(PRINT, o P#

, steps=#) o110 if [# GT [# / 2]] #=[# - #] o110 endif @@ -31,6 +31,7 @@ o130 elseif [# LT 0] M11 P[#] o130 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/m11.ngc b/configs/atc_sim/macros_sim_metric/m11.ngc index 096f578b..3db74563 100644 --- a/configs/atc_sim/macros_sim_metric/m11.ngc +++ b/configs/atc_sim/macros_sim_metric/m11.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P4 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990+2] MOD #]-1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P4 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/m12.ngc b/configs/atc_sim/macros_sim_metric/m12.ngc index c1d4c3ca..34f2d6f3 100644 --- a/configs/atc_sim/macros_sim_metric/m12.ngc +++ b/configs/atc_sim/macros_sim_metric/m12.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P3 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990-2] MOD #]+1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P3 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/m13.ngc b/configs/atc_sim/macros_sim_metric/m13.ngc index 06da95e4..ede03334 100644 --- a/configs/atc_sim/macros_sim_metric/m13.ngc +++ b/configs/atc_sim/macros_sim_metric/m13.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o) +(PRINT, o) (DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}]) @@ -12,7 +12,7 @@ M64 P3 ; Move Motor FWD M66 P3 L1 Q20 ; wait for rising edge on home index o100 if [#5399 LT 0] M65 P3 ; stop motor - (abort, failed to home carousel) + (abort, Failed to home carousel) o100 endif #3990 = 1 @@ -36,6 +36,7 @@ o120 endwhile M61 Q#3991 G43 H#3991 #5210 = 0 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/m21.ngc b/configs/atc_sim/macros_sim_metric/m21.ngc index 9bffddd1..2ec9daea 100644 --- a/configs/atc_sim/macros_sim_metric/m21.ngc +++ b/configs/atc_sim/macros_sim_metric/m21.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.9000 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -29,7 +29,7 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif M24 ; activate drawbar, release the tool @@ -39,6 +39,7 @@ G0 G53 Z# ; move z to clear height #3991 = 0; save fact there is now no tool in the spindle +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/m22.ngc b/configs/atc_sim/macros_sim_metric/m22.ngc index 825713fa..2e87c9a5 100644 --- a/configs/atc_sim/macros_sim_metric/m22.ngc +++ b/configs/atc_sim/macros_sim_metric/m22.ngc @@ -4,7 +4,7 @@ o sub ; after loading any tool in the current pocket to the spindle ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.9000 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -24,18 +24,19 @@ M65 P2 ; release the drawbar to clamp the tool M5 M66 P5 L3 Q1 ; check the tool clamped sensor o100 if [#5399 LT 0] - (abort, failed to reclamp tool) + (abort, Failed to reclamp tool) o100 endif M65 P0 ; Move Carousel home M66 P0 L3 Q4 ; check carousel in position sensor o110 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o110 endif ;M65 P1 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/m24.ngc b/configs/atc_sim/macros_sim_metric/m24.ngc index 484fc11b..37454968 100644 --- a/configs/atc_sim/macros_sim_metric/m24.ngc +++ b/configs/atc_sim/macros_sim_metric/m24.ngc @@ -8,6 +8,7 @@ o100 if [#5399 LT 0] (abort, failed to release tool) ; abort if the sensor does not activate in 3 seconds o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/m25.ngc b/configs/atc_sim/macros_sim_metric/m25.ngc index dc55c0f5..a1a7ac98 100644 --- a/configs/atc_sim/macros_sim_metric/m25.ngc +++ b/configs/atc_sim/macros_sim_metric/m25.ngc @@ -6,9 +6,10 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/retractatc.ngc b/configs/atc_sim/macros_sim_metric/retractatc.ngc index 43c31da6..f9d400fe 100644 --- a/configs/atc_sim/macros_sim_metric/retractatc.ngc +++ b/configs/atc_sim/macros_sim_metric/retractatc.ngc @@ -6,7 +6,7 @@ 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o100 endif M65 P1 diff --git a/configs/atc_sim/macros_sim_metric/toolchange.ngc b/configs/atc_sim/macros_sim_metric/toolchange.ngc index de63b409..21d39094 100644 --- a/configs/atc_sim/macros_sim_metric/toolchange.ngc +++ b/configs/atc_sim/macros_sim_metric/toolchange.ngc @@ -6,8 +6,10 @@ o sub ; 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 ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o selected_tool: #, tool_in_spindle: #, selected_pocket: #, current_pocket: #, task: #<_task>) o100 if [#<_task> EQ 0] (DEBUG, Task is null) @@ -20,28 +22,46 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] # = #<_ini[atc]pockets> o101 endif +# = -3.9000 +o102 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o102 endif +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o103 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o103 endif + ; assign the programmable coolant parameters # = #1 (=0) # = #2 (=0) # = #3 (=0) # = #4 (=0) -; assign the variables passed by M6 to some parameters +; assign the variables passed by M6 change_prolog to some parameters #100 = # #110 = # #120 = # +#121 = # +; NOTE: +; The legacy names *selected_pocket* and *current_pocket* actually reference +; a sequential tooldata index for tool items loaded from a tool +; table ([EMCIO]TOOL_TABLE) or via a tooldata database ([EMCIO]DB_PROGRAM) -o110 if [#100 EQ #110] ; checks if tool in the spindle is same as requested +o110 if [# EQ #] ; checks if tool in the spindle is same as requested o endsub [1] M2 o110 endif +o111 if [#3991 NE #] + (PRINT, o tool_in_spindle does not match 3991) +o111 endif + # = 0 ; assigns 0 to the next pocket for a later check if the tool is found in the carousel # = 0 #130 = # ; assign test parameter the number of pockets in the carousel o120 do - o121 if [#[4000 + #130] EQ #100] ; checks all pockets to see if it contains tool number requested as the new tool + o121 if [#[4000 + #130] EQ #] ; checks all pockets to see if it contains tool number requested as the new tool # = #130 ; if tool is found in pocket, assigns the next pocket o121 endif o122 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. @@ -50,7 +70,7 @@ o120 do #130 = [#130 - 1] o120 while [#130 GT 0] o130 if [# EQ 0] ; if tool is not found, aborts and sends a message - (abort, tool not in carousel) + (abort, Tool T%d# not found in carousel) o130 endif ; now we know which pocket the next tool is sitting in @@ -59,7 +79,7 @@ o130 endif o140 if [# GT 0] ; checks if there is a valid tool in the spindle o141 if [# EQ 0] ; If there is a tool in the spindle, checks if there is an open pocket - (abort, carousel is full, cant put away tool in into carousel) + (abort, Carousel is full, cant put away tool T# in into carousel) o141 endif M10 P[#] ; move carousel to an open pocket M21 ; puts the tool in spindle away into the open pocket @@ -67,10 +87,12 @@ o140 if [# GT 0] ; checks if there is a valid tool in the spind #140 = # #[4000 + #140] = # ; save tool number in pocket #3991 = 0 ; empty tool in the spindle + M61 Q0 + G49 o140 endif G90 -G0 G53 Z0 +G0 G53 Z# ; move z to clear height o150 if [# GT 0] ; selected tool is not tool0 M10 P# ; set the carousel to move to the right pocket for the selected tool @@ -79,7 +101,7 @@ o150 if [# GT 0] ; selected tool is not tool0 M66 P1 L3 Q5 ; check carousel out position sensor o151 if [#5399 LT 0] M65 P0 ; turn off the solenoid to send atc to tool change - (abort, failed to send carousel home) ; abort if the sensor does not activate in 5 seconds + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o151 endif M65 P0 @@ -95,7 +117,7 @@ o150 else M66 P0 L3 Q4 ; check carousel in position sensor o152 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o152 endif M65 P1 o150 endif @@ -112,6 +134,7 @@ o170 if [# EQ 1] o call [#][#][#][#] o170 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/atc_sim/macros_sim_metric/unclamptool.ngc b/configs/atc_sim/macros_sim_metric/unclamptool.ngc index 1bf17ec5..ac9c3798 100644 --- a/configs/atc_sim/macros_sim_metric/unclamptool.ngc +++ b/configs/atc_sim/macros_sim_metric/unclamptool.ngc @@ -4,7 +4,7 @@ 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1] diff --git a/configs/probe_basic/subroutines/clamptool.ngc b/configs/probe_basic/subroutines/clamptool.ngc index 3d1a69ab..abc300bb 100644 --- a/configs/probe_basic/subroutines/clamptool.ngc +++ b/configs/probe_basic/subroutines/clamptool.ngc @@ -4,7 +4,7 @@ M65 P2 ; clamp the tool M66 P5 L3 Q1 ; 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1] diff --git a/configs/probe_basic/subroutines/extendatc.ngc b/configs/probe_basic/subroutines/extendatc.ngc index b16d6413..95828367 100644 --- a/configs/probe_basic/subroutines/extendatc.ngc +++ b/configs/probe_basic/subroutines/extendatc.ngc @@ -20,7 +20,7 @@ M64 P0 ; Move Carousel OUT M66 P1 L3 Q5 ; check for carousel out position sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif o endsub [1] diff --git a/configs/probe_basic/subroutines/m10.ngc b/configs/probe_basic/subroutines/m10.ngc index c02e0788..2562672e 100644 --- a/configs/probe_basic/subroutines/m10.ngc +++ b/configs/probe_basic/subroutines/m10.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] M13 @@ -17,7 +17,7 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] o101 endif # = [#3990 - #

] -(PRINT, o P#

, steps=#) +(PRINT, o P#

, steps=#) o110 if [# GT [# / 2]] #=[# - #] o110 endif @@ -31,6 +31,7 @@ o130 elseif [# LT 0] M11 P[#] o130 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/m11.ngc b/configs/probe_basic/subroutines/m11.ngc index 096f578b..3db74563 100644 --- a/configs/probe_basic/subroutines/m11.ngc +++ b/configs/probe_basic/subroutines/m11.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P4 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990+2] MOD #]-1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P4 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/m12.ngc b/configs/probe_basic/subroutines/m12.ngc index c1d4c3ca..34f2d6f3 100644 --- a/configs/probe_basic/subroutines/m12.ngc +++ b/configs/probe_basic/subroutines/m12.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P3 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990-2] MOD #]+1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P3 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/m13.ngc b/configs/probe_basic/subroutines/m13.ngc index 06da95e4..ede03334 100644 --- a/configs/probe_basic/subroutines/m13.ngc +++ b/configs/probe_basic/subroutines/m13.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o) +(PRINT, o) (DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}]) @@ -12,7 +12,7 @@ M64 P3 ; Move Motor FWD M66 P3 L1 Q20 ; wait for rising edge on home index o100 if [#5399 LT 0] M65 P3 ; stop motor - (abort, failed to home carousel) + (abort, Failed to home carousel) o100 endif #3990 = 1 @@ -36,6 +36,7 @@ o120 endwhile M61 Q#3991 G43 H#3991 #5210 = 0 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/m21.ngc b/configs/probe_basic/subroutines/m21.ngc index 17152078..72481562 100644 --- a/configs/probe_basic/subroutines/m21.ngc +++ b/configs/probe_basic/subroutines/m21.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.1900 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -29,7 +29,7 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif M24 ; activate drawbar, release the tool @@ -39,6 +39,7 @@ G0 G53 Z# ; move z to clear height #3991 = 0; save fact there is now no tool in the spindle +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/m22.ngc b/configs/probe_basic/subroutines/m22.ngc index 3150f732..2de79912 100644 --- a/configs/probe_basic/subroutines/m22.ngc +++ b/configs/probe_basic/subroutines/m22.ngc @@ -4,7 +4,7 @@ o sub ; after loading any tool in the current pocket to the spindle ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.1900 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -24,18 +24,19 @@ M65 P2 ; release the drawbar to clamp the tool M5 M66 P5 L3 Q1 ; check the tool clamped sensor o100 if [#5399 LT 0] - (abort, failed to reclamp tool) + (abort, Failed to reclamp tool) o100 endif M65 P0 ; Move Carousel home M66 P0 L3 Q4 ; check carousel in position sensor o110 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o110 endif ;M65 P1 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/m24.ngc b/configs/probe_basic/subroutines/m24.ngc index 263b5278..37454968 100644 --- a/configs/probe_basic/subroutines/m24.ngc +++ b/configs/probe_basic/subroutines/m24.ngc @@ -2,12 +2,13 @@ o sub (PRINT, o) M64 P2 ; unclamp the tool -M66 P2 L3 Q3 ; check the unclamped tool sensor +M66 P2 L3 Q2 ; check the unclamped tool sensor o100 if [#5399 LT 0] M65 P2 ; turn off the drawbar (abort, failed to release tool) ; abort if the sensor does not activate in 3 seconds o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/m25.ngc b/configs/probe_basic/subroutines/m25.ngc index dc55c0f5..a1a7ac98 100644 --- a/configs/probe_basic/subroutines/m25.ngc +++ b/configs/probe_basic/subroutines/m25.ngc @@ -6,9 +6,10 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/retractatc.ngc b/configs/probe_basic/subroutines/retractatc.ngc index 717324b9..4219ca38 100644 --- a/configs/probe_basic/subroutines/retractatc.ngc +++ b/configs/probe_basic/subroutines/retractatc.ngc @@ -6,7 +6,7 @@ M64 P1 ; Move Carousel IN M66 P0 L3 Q4 ; 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o100 endif M65 P1 diff --git a/configs/probe_basic/subroutines/toolchange.ngc b/configs/probe_basic/subroutines/toolchange.ngc index de63b409..b8cfb5ef 100644 --- a/configs/probe_basic/subroutines/toolchange.ngc +++ b/configs/probe_basic/subroutines/toolchange.ngc @@ -6,8 +6,10 @@ o sub ; 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 ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o selected_tool: #, tool_in_spindle: #, selected_pocket: #, current_pocket: #, task: #<_task>) o100 if [#<_task> EQ 0] (DEBUG, Task is null) @@ -20,28 +22,46 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] # = #<_ini[atc]pockets> o101 endif +# = -3.1900 +o102 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o102 endif +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o103 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o103 endif + ; assign the programmable coolant parameters # = #1 (=0) # = #2 (=0) # = #3 (=0) # = #4 (=0) -; assign the variables passed by M6 to some parameters +; assign the variables passed by M6 change_prolog to some parameters #100 = # #110 = # #120 = # +#121 = # +; NOTE: +; The legacy names *selected_pocket* and *current_pocket* actually reference +; a sequential tooldata index for tool items loaded from a tool +; table ([EMCIO]TOOL_TABLE) or via a tooldata database ([EMCIO]DB_PROGRAM) -o110 if [#100 EQ #110] ; checks if tool in the spindle is same as requested +o110 if [# EQ #] ; checks if tool in the spindle is same as requested o endsub [1] M2 o110 endif +o111 if [#3991 NE #] + (PRINT, o tool_in_spindle does not match 3991) +o111 endif + # = 0 ; assigns 0 to the next pocket for a later check if the tool is found in the carousel # = 0 #130 = # ; assign test parameter the number of pockets in the carousel o120 do - o121 if [#[4000 + #130] EQ #100] ; checks all pockets to see if it contains tool number requested as the new tool + o121 if [#[4000 + #130] EQ #] ; checks all pockets to see if it contains tool number requested as the new tool # = #130 ; if tool is found in pocket, assigns the next pocket o121 endif o122 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. @@ -50,7 +70,7 @@ o120 do #130 = [#130 - 1] o120 while [#130 GT 0] o130 if [# EQ 0] ; if tool is not found, aborts and sends a message - (abort, tool not in carousel) + (abort, Tool T%d# not found in carousel) o130 endif ; now we know which pocket the next tool is sitting in @@ -59,7 +79,7 @@ o130 endif o140 if [# GT 0] ; checks if there is a valid tool in the spindle o141 if [# EQ 0] ; If there is a tool in the spindle, checks if there is an open pocket - (abort, carousel is full, cant put away tool in into carousel) + (abort, Carousel is full, cant put away tool T# in into carousel) o141 endif M10 P[#] ; move carousel to an open pocket M21 ; puts the tool in spindle away into the open pocket @@ -67,10 +87,12 @@ o140 if [# GT 0] ; checks if there is a valid tool in the spind #140 = # #[4000 + #140] = # ; save tool number in pocket #3991 = 0 ; empty tool in the spindle + M61 Q0 + G49 o140 endif G90 -G0 G53 Z0 +G0 G53 Z# ; move z to clear height o150 if [# GT 0] ; selected tool is not tool0 M10 P# ; set the carousel to move to the right pocket for the selected tool @@ -79,7 +101,7 @@ o150 if [# GT 0] ; selected tool is not tool0 M66 P1 L3 Q5 ; check carousel out position sensor o151 if [#5399 LT 0] M65 P0 ; turn off the solenoid to send atc to tool change - (abort, failed to send carousel home) ; abort if the sensor does not activate in 5 seconds + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o151 endif M65 P0 @@ -95,7 +117,7 @@ o150 else M66 P0 L3 Q4 ; check carousel in position sensor o152 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o152 endif M65 P1 o150 endif @@ -112,6 +134,7 @@ o170 if [# EQ 1] o call [#][#][#][#] o170 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic/subroutines/unclamptool.ngc b/configs/probe_basic/subroutines/unclamptool.ngc index 1bf17ec5..ac9c3798 100644 --- a/configs/probe_basic/subroutines/unclamptool.ngc +++ b/configs/probe_basic/subroutines/unclamptool.ngc @@ -4,7 +4,7 @@ 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1] diff --git a/configs/probe_basic_lathe/subroutines/clamptool.ngc b/configs/probe_basic_lathe/subroutines/clamptool.ngc index a167d778..8b1a7b1b 100644 --- a/configs/probe_basic_lathe/subroutines/clamptool.ngc +++ b/configs/probe_basic_lathe/subroutines/clamptool.ngc @@ -4,7 +4,7 @@ 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1] diff --git a/configs/probe_basic_lathe/subroutines/extendatc.ngc b/configs/probe_basic_lathe/subroutines/extendatc.ngc index b16d6413..95828367 100644 --- a/configs/probe_basic_lathe/subroutines/extendatc.ngc +++ b/configs/probe_basic_lathe/subroutines/extendatc.ngc @@ -20,7 +20,7 @@ M64 P0 ; Move Carousel OUT M66 P1 L3 Q5 ; check for carousel out position sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif o endsub [1] diff --git a/configs/probe_basic_lathe/subroutines/m10.ngc b/configs/probe_basic_lathe/subroutines/m10.ngc index c02e0788..2562672e 100644 --- a/configs/probe_basic_lathe/subroutines/m10.ngc +++ b/configs/probe_basic_lathe/subroutines/m10.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] M13 @@ -17,7 +17,7 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] o101 endif # = [#3990 - #

] -(PRINT, o P#

, steps=#) +(PRINT, o P#

, steps=#) o110 if [# GT [# / 2]] #=[# - #] o110 endif @@ -31,6 +31,7 @@ o130 elseif [# LT 0] M11 P[#] o130 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/m11.ngc b/configs/probe_basic_lathe/subroutines/m11.ngc index 096f578b..3db74563 100644 --- a/configs/probe_basic_lathe/subroutines/m11.ngc +++ b/configs/probe_basic_lathe/subroutines/m11.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P4 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990+2] MOD #]-1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P4 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/m12.ngc b/configs/probe_basic_lathe/subroutines/m12.ngc index c1d4c3ca..34f2d6f3 100644 --- a/configs/probe_basic_lathe/subroutines/m12.ngc +++ b/configs/probe_basic_lathe/subroutines/m12.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o P#

) +(PRINT, o P#

) o100 if [#3989 NE 1] (PRINT, atc not homed, homing) @@ -34,7 +34,7 @@ o120 do M66 P4 L1 Q3 ; wait for rising edge on rotation index o130 if [#5399 LT 0] M65 P3 ; Stop atc motor - (abort, failed to get rotation index) + (abort, Failed to get rotation index) o130 endif #3990 = [[[#3990-2] MOD #]+1] ; Pocket is no.1-# # = [#-1] @@ -44,6 +44,7 @@ M65 P3 ; Stop motor #<_my_current_pocket> = #3990 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/m13.ngc b/configs/probe_basic_lathe/subroutines/m13.ngc index 06da95e4..ede03334 100644 --- a/configs/probe_basic_lathe/subroutines/m13.ngc +++ b/configs/probe_basic_lathe/subroutines/m13.ngc @@ -4,7 +4,7 @@ o sub ; Parameter #3989 is used to track if the carousel is homed (M13) (volatile) ; Parameter #3990 is used to track the current tool pocket (persistently) ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> -(PRINT, o) +(PRINT, o) (DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}]) @@ -12,7 +12,7 @@ M64 P3 ; Move Motor FWD M66 P3 L1 Q20 ; wait for rising edge on home index o100 if [#5399 LT 0] M65 P3 ; stop motor - (abort, failed to home carousel) + (abort, Failed to home carousel) o100 endif #3990 = 1 @@ -36,6 +36,7 @@ o120 endwhile M61 Q#3991 G43 H#3991 #5210 = 0 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/m21.ngc b/configs/probe_basic_lathe/subroutines/m21.ngc index 9bffddd1..2ec9daea 100644 --- a/configs/probe_basic_lathe/subroutines/m21.ngc +++ b/configs/probe_basic_lathe/subroutines/m21.ngc @@ -5,7 +5,7 @@ o sub ; Parameter #3991 is used to track the current tool loaded it in the spindle (persistently) ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.9000 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -29,7 +29,7 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif M24 ; activate drawbar, release the tool @@ -39,6 +39,7 @@ G0 G53 Z# ; move z to clear height #3991 = 0; save fact there is now no tool in the spindle +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/m22.ngc b/configs/probe_basic_lathe/subroutines/m22.ngc index 825713fa..2e87c9a5 100644 --- a/configs/probe_basic_lathe/subroutines/m22.ngc +++ b/configs/probe_basic_lathe/subroutines/m22.ngc @@ -4,7 +4,7 @@ o sub ; after loading any tool in the current pocket to the spindle ; # 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) ; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o) # = -3.9000 o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]] @@ -24,18 +24,19 @@ M65 P2 ; release the drawbar to clamp the tool M5 M66 P5 L3 Q1 ; check the tool clamped sensor o100 if [#5399 LT 0] - (abort, failed to reclamp tool) + (abort, Failed to reclamp tool) o100 endif M65 P0 ; Move Carousel home M66 P0 L3 Q4 ; check carousel in position sensor o110 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o110 endif ;M65 P1 +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/m24.ngc b/configs/probe_basic_lathe/subroutines/m24.ngc index 263b5278..37454968 100644 --- a/configs/probe_basic_lathe/subroutines/m24.ngc +++ b/configs/probe_basic_lathe/subroutines/m24.ngc @@ -2,12 +2,13 @@ o sub (PRINT, o) M64 P2 ; unclamp the tool -M66 P2 L3 Q3 ; check the unclamped tool sensor +M66 P2 L3 Q2 ; check the unclamped tool sensor o100 if [#5399 LT 0] M65 P2 ; turn off the drawbar (abort, failed to release tool) ; abort if the sensor does not activate in 3 seconds o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/m25.ngc b/configs/probe_basic_lathe/subroutines/m25.ngc index dc55c0f5..a1a7ac98 100644 --- a/configs/probe_basic_lathe/subroutines/m25.ngc +++ b/configs/probe_basic_lathe/subroutines/m25.ngc @@ -6,9 +6,10 @@ M64 P0 ; Move Carousel out M66 P1 L3 Q5 ; check for carousel out sensor o100 if [#5399 LT 0] M65 P0 ; switch off atc out solenoid - (abort, atc not in position) + (abort, ATC not in position) o100 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/retractatc.ngc b/configs/probe_basic_lathe/subroutines/retractatc.ngc index 43c31da6..f9d400fe 100644 --- a/configs/probe_basic_lathe/subroutines/retractatc.ngc +++ b/configs/probe_basic_lathe/subroutines/retractatc.ngc @@ -6,7 +6,7 @@ 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o100 endif M65 P1 diff --git a/configs/probe_basic_lathe/subroutines/toolchange.ngc b/configs/probe_basic_lathe/subroutines/toolchange.ngc index de63b409..21d39094 100644 --- a/configs/probe_basic_lathe/subroutines/toolchange.ngc +++ b/configs/probe_basic_lathe/subroutines/toolchange.ngc @@ -6,8 +6,10 @@ o sub ; 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 ; #: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets> +; # 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) +; # is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT) -(PRINT, o) +(PRINT, o selected_tool: #, tool_in_spindle: #, selected_pocket: #, current_pocket: #, task: #<_task>) o100 if [#<_task> EQ 0] (DEBUG, Task is null) @@ -20,28 +22,46 @@ o101 if [EXISTS[#<_ini[atc]pockets>]] # = #<_ini[atc]pockets> o101 endif +# = -3.9000 +o102 if [EXISTS[#<_ini[atc]z_tool_change_height>]] + # = #<_ini[atc]z_tool_change_height> +o102 endif +# = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1] +o103 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]] + # = #<_ini[atc]z_tool_clearance_height> +o103 endif + ; assign the programmable coolant parameters # = #1 (=0) # = #2 (=0) # = #3 (=0) # = #4 (=0) -; assign the variables passed by M6 to some parameters +; assign the variables passed by M6 change_prolog to some parameters #100 = # #110 = # #120 = # +#121 = # +; NOTE: +; The legacy names *selected_pocket* and *current_pocket* actually reference +; a sequential tooldata index for tool items loaded from a tool +; table ([EMCIO]TOOL_TABLE) or via a tooldata database ([EMCIO]DB_PROGRAM) -o110 if [#100 EQ #110] ; checks if tool in the spindle is same as requested +o110 if [# EQ #] ; checks if tool in the spindle is same as requested o endsub [1] M2 o110 endif +o111 if [#3991 NE #] + (PRINT, o tool_in_spindle does not match 3991) +o111 endif + # = 0 ; assigns 0 to the next pocket for a later check if the tool is found in the carousel # = 0 #130 = # ; assign test parameter the number of pockets in the carousel o120 do - o121 if [#[4000 + #130] EQ #100] ; checks all pockets to see if it contains tool number requested as the new tool + o121 if [#[4000 + #130] EQ #] ; checks all pockets to see if it contains tool number requested as the new tool # = #130 ; if tool is found in pocket, assigns the next pocket o121 endif o122 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. @@ -50,7 +70,7 @@ o120 do #130 = [#130 - 1] o120 while [#130 GT 0] o130 if [# EQ 0] ; if tool is not found, aborts and sends a message - (abort, tool not in carousel) + (abort, Tool T%d# not found in carousel) o130 endif ; now we know which pocket the next tool is sitting in @@ -59,7 +79,7 @@ o130 endif o140 if [# GT 0] ; checks if there is a valid tool in the spindle o141 if [# EQ 0] ; If there is a tool in the spindle, checks if there is an open pocket - (abort, carousel is full, cant put away tool in into carousel) + (abort, Carousel is full, cant put away tool T# in into carousel) o141 endif M10 P[#] ; move carousel to an open pocket M21 ; puts the tool in spindle away into the open pocket @@ -67,10 +87,12 @@ o140 if [# GT 0] ; checks if there is a valid tool in the spind #140 = # #[4000 + #140] = # ; save tool number in pocket #3991 = 0 ; empty tool in the spindle + M61 Q0 + G49 o140 endif G90 -G0 G53 Z0 +G0 G53 Z# ; move z to clear height o150 if [# GT 0] ; selected tool is not tool0 M10 P# ; set the carousel to move to the right pocket for the selected tool @@ -79,7 +101,7 @@ o150 if [# GT 0] ; selected tool is not tool0 M66 P1 L3 Q5 ; check carousel out position sensor o151 if [#5399 LT 0] M65 P0 ; turn off the solenoid to send atc to tool change - (abort, failed to send carousel home) ; abort if the sensor does not activate in 5 seconds + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o151 endif M65 P0 @@ -95,7 +117,7 @@ o150 else M66 P0 L3 Q4 ; check carousel in position sensor o152 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 + (abort, Failed to send carousel home) ; abort if the sensor does not activate in 5 seconds o152 endif M65 P1 o150 endif @@ -112,6 +134,7 @@ o170 if [# EQ 1] o call [#][#][#][#] o170 endif +(PRINT, o endsub) o endsub [1] M2 diff --git a/configs/probe_basic_lathe/subroutines/unclamptool.ngc b/configs/probe_basic_lathe/subroutines/unclamptool.ngc index 1bf17ec5..ac9c3798 100644 --- a/configs/probe_basic_lathe/subroutines/unclamptool.ngc +++ b/configs/probe_basic_lathe/subroutines/unclamptool.ngc @@ -4,7 +4,7 @@ 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 + (abort, Failed to release tool) ; abort if the sensor does not activate in 2 seconds o100 endif o endsub [1]