Skip to content

Sub tweaks #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/atc_sim/macros_sim_inch/clamptool.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -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<clamptool> endsub [1]
Expand Down
16 changes: 14 additions & 2 deletions configs/atc_sim/macros_sim_inch/extendatc.ngc
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
o<extendatc> sub

G0 G53 Z0
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)

#<atc_z_tool_change_height> = -3.9000
o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o101 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1]
o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o102 endif

G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height

M65 P1 ; Turn off carousel home solenoid
M64 P0 ; Move Carousel OUT

M66 P1 L3 Q5 ; check for carousel out position sensor
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<extendatc> endsub [1]
Expand Down
1 change: 1 addition & 0 deletions configs/atc_sim/macros_sim_inch/go_to_g30.ngc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
o<go_to_g30> sub

M73
G90
G53 G0 Z0
G30
Expand Down
1 change: 1 addition & 0 deletions configs/atc_sim/macros_sim_inch/go_to_home.ngc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
o<go_to_home> sub

M73
G90
G53 G0 Z0
G53 G0 X0 Y0
Expand Down
2 changes: 2 additions & 0 deletions configs/atc_sim/macros_sim_inch/go_to_zero.ngc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
o<go_to_zero> sub

M73
G90
o100 if [#5422 LT 0]
G0 Z0
G0 X0 Y0
Expand Down
2 changes: 1 addition & 1 deletion configs/atc_sim/macros_sim_inch/load_spindle_safety.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
o<load_spindle_safety> sub
(PRINT, o<load_spindle_safety>)

#<load_spindle_tool_number> = #1
#<load_spindle_tool_number> = #1 ; this is the value form the ATC tab
#<activate_programmable_coolant> = #2
#<horizontal_spindle_nozzle_dist> = #3
#<vertical_spindle_nozzle_dist> = #4
Expand Down
2 changes: 1 addition & 1 deletion configs/atc_sim/macros_sim_inch/load_spindle_safety_2.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
o<load_spindle_safety_2> sub
(PRINT, o<load_spindle_safety_2>)

#<load_spindle_tool_number_2> = #1
#<load_spindle_tool_number_2> = #1 ; this is the value form the TOOL tab
#<activate_programmable_coolant> = #2
#<horizontal_spindle_nozzle_dist> = #3
#<vertical_spindle_nozzle_dist> = #4
Expand Down
5 changes: 3 additions & 2 deletions configs/atc_sim/macros_sim_inch/m10.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ o<m10> 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)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<M10> P#<p>)
(PRINT, o<m10> P#<p>)

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

#<steps> = [#3990 - #<p>]
(PRINT, o<M10> P#<p>, steps=#<steps>)
(PRINT, o<m10> P#<p>, steps=#<steps>)
o110 if [#<steps> GT [#<number_of_pockets> / 2]]
#<steps>=[#<steps> - #<number_of_pockets>]
o110 endif
Expand All @@ -31,6 +31,7 @@ o130 elseif [#<steps> LT 0]
M11 P[#<steps>]
o130 endif

(PRINT, o<m10> endsub)
o<m10> endsub [1]

M2
5 changes: 3 additions & 2 deletions configs/atc_sim/macros_sim_inch/m11.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ o<m11> 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)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<M11> P#<p>)
(PRINT, o<m11> P#<p>)

o100 if [#3989 NE 1]
(PRINT, atc not homed, homing)
Expand Down Expand Up @@ -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 #<number_of_pockets>]-1] ; Pocket is no.1-#<number_of_pockets>
#<steps_to_move> = [#<steps_to_move>-1]
Expand All @@ -44,6 +44,7 @@ M65 P4 ; Stop motor

#<_my_current_pocket> = #3990

(PRINT, o<m11> endsub)
o<m11> endsub [1]

M2
5 changes: 3 additions & 2 deletions configs/atc_sim/macros_sim_inch/m12.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ o<m12> 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)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<M12> P#<p>)
(PRINT, o<m12> P#<p>)

o100 if [#3989 NE 1]
(PRINT, atc not homed, homing)
Expand Down Expand Up @@ -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 #<number_of_pockets>]+1] ; Pocket is no.1-#<number_of_pockets>
#<steps_to_move> = [#<steps_to_move>-1]
Expand All @@ -44,6 +44,7 @@ M65 P3 ; Stop motor

#<_my_current_pocket> = #3990

(PRINT, o<m12> endsub)
o<m12> endsub [1]

M2
5 changes: 3 additions & 2 deletions configs/atc_sim/macros_sim_inch/m13.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ o<m13> 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)
; #<number_of_pockets>: The number of pockets in the ATC is automaticity pulled from the INI via #<_ini[atc]pockets>
(PRINT, o<M13>)
(PRINT, o<m13>)

(DEBUG, EVAL[vcp.getWidget{"dynatc"}.atc_message{"REFERENCING"}])

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
Expand All @@ -36,6 +36,7 @@ o120 endwhile

M61 Q#3991 G43 H#3991 #5210 = 0

(PRINT, o<m13> endsub)
o<m13> endsub [1]

M2
17 changes: 12 additions & 5 deletions configs/atc_sim/macros_sim_inch/m21.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ o<m21> 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)
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs)
(PRINT, o<M21>)
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
(PRINT, o<m21>)

#<atc_z_tool_change_height> = -3.9000
#<atc_z_tool_clearance_height> = 0
o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o101 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1]
o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o102 endif

M65 P1 ; switch off carousel in solenoid
M66 P1 L3 Q1
Expand All @@ -23,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
Expand All @@ -33,6 +39,7 @@ G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height

#3991 = 0; save fact there is now no tool in the spindle

(PRINT, o<m21> endsub)
o<m21> endsub [1]

M2
19 changes: 13 additions & 6 deletions configs/atc_sim/macros_sim_inch/m22.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ o<m22> sub

; Move Carousel to the home position - IN
; after loading any tool in the current pocket to the spindle
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs)
(PRINT, o<M22>)
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)
(PRINT, o<m22>)

#<atc_z_tool_change_height> = -3.9000
#<atc_z_tool_clearance_height> = 0
o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o101 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1]
o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o102 endif

;M19 R0 Q2
M24
Expand All @@ -18,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<m22> endsub)
o<m22> endsub [1]

M2
1 change: 1 addition & 0 deletions configs/atc_sim/macros_sim_inch/m24.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -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<m24> endsub)
o<m24> endsub [1]

M2
4 changes: 3 additions & 1 deletion configs/atc_sim/macros_sim_inch/m25.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ o<m25> sub
(PRINT, o<m25>)

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<m25> endsub)
o<m25> endsub [1]

M2
14 changes: 10 additions & 4 deletions configs/atc_sim/macros_sim_inch/move_head_above_carousel.ngc
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
o<move_head_above_carousel> sub

; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs)
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)

#<atc_z_tool_change_height> = -3.1900
#<atc_z_tool_clearance_height> = 0
#<atc_z_tool_change_height> = -3.9000
o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o101 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1]
o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o102 endif

G0 G53 Z#<atc_z_tool_clearance_height> ; move z to clear height

Expand Down
14 changes: 10 additions & 4 deletions configs/atc_sim/macros_sim_inch/move_tool_to_carousel_height.ngc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
o<move_tool_to_carousel_height> sub
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (adjust to your needs)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (adjust to your needs)
; #<atc_z_tool_change_height> is the height you spindle needs to be at to clamp/unclamp a tool form the ATC (Set via INI [ATC]Z_TOOL_CHANGE_HEIGHT)
; #<atc_z_tool_clearance_height> is the clearance height you spindle needs to be at to safely clear the ATC (Set via INI [ATC]Z_TOOL_CLEARANCE_HEIGHT)

#<atc_z_tool_change_height> = -3.1900
#<atc_z_tool_clearance_height> = 0
#<atc_z_tool_change_height> = -3.9000
o101 if [EXISTS[#<_ini[atc]z_tool_change_height>]]
#<atc_z_tool_change_height> = #<_ini[atc]z_tool_change_height>
o101 endif
#<atc_z_tool_clearance_height> = [#<_ini[AXIS_Z]MAX_LIMIT>-0.1]
o102 if [EXISTS[#<_ini[atc]z_tool_clearance_height>]]
#<atc_z_tool_clearance_height> = #<_ini[atc]z_tool_clearance_height>
o102 endif

G0 G53 Z#<atc_z_tool_change_height> ; rapid move to above the tool change height

Expand Down
14 changes: 7 additions & 7 deletions configs/atc_sim/macros_sim_inch/probe_top_right_edge_angle.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -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<Probe_top_right_edge_angle> sub
o<probe_top_right_edge_angle> sub

(uses NGCGUI style arg spec)
(number after "=" in comment is default value)
Expand Down Expand Up @@ -37,7 +37,7 @@ o<Probe_top_right_edge_angle> sub
(Probe Tool Safety Check)
o100 if [#5400 NE #<probe_tool_number>]
(MSG, Specified probe tool #<probe_tool_number> not in spindle, aborting)
o<Probe_top_right_edge_angle> return
o<probe_top_right_edge_angle> return
o100 endif

(Probe Diameter)
Expand Down Expand Up @@ -68,7 +68,7 @@ o<Probe_top_right_edge_angle> sub
(value returned safety check, aborts if no value returned)
o110 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(MSG, Missing X Sub returned edge parameter, aborting)
o<Probe_top_right_edge_angle> return
o<probe_top_right_edge_angle> return
o110 endif

(edge width move to edge second probing point)
Expand All @@ -84,7 +84,7 @@ o<Probe_top_right_edge_angle> sub
(value returned safety check, aborts if no value returned)
o120 if [#<probe_mode> EQ 1 AND #<_value_returned> NE 1]
(MSG, Missing X Sub returned edge parameter, aborting)
o<Probe_top_right_edge_angle> return
o<probe_top_right_edge_angle> return
o120 endif

#<edge_delta> = [#<x_minus_zero_edge_start> - #<x_minus_zero_edge_end>]
Expand All @@ -109,16 +109,16 @@ o<Probe_top_right_edge_angle> sub
o130 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 0]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>]
o<Probe_top_right_edge_angle> return
o<probe_top_right_edge_angle> return
o130 endif

(probe mode rules for WCO, Rotation and probe position measuring only)
o140 if [#<probe_mode> EQ 0 AND #<wco_rotation> EQ 1]
(Record Zero in selected axes and WCO)
G10 L2 P#5220 X[#<x_minus_zero_edge_start> + #<workspace_x>] Y[#<y_start_position>] R[#<edge_angle>]
o<Probe_top_right_edge_angle> return
o<probe_top_right_edge_angle> return
o140 endif

o<Probe_top_right_edge_angle> endsub
o<probe_top_right_edge_angle> endsub

M2 (end program)
2 changes: 1 addition & 1 deletion configs/atc_sim/macros_sim_inch/retractatc.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading