Skip to content

Commit e828646

Browse files
committed
added tool touch off subroutine and parameters entries to probe basic
1 parent db06884 commit e828646

File tree

81 files changed

+1343
-7521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1343
-7521
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
o<tool_touch_off> sub
2+
3+
#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
4+
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
5+
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
6+
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
7+
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
8+
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
9+
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
10+
11+
G92.1 (Cancel G92 offset)
12+
13+
#<workspace_z> = #[5203 + [20 * #5220]]
14+
15+
G49 (cancel tlo)
16+
17+
G53 G0 Z0
18+
G30
19+
20+
G91
21+
F #<fast_probe_fr>
22+
G38.2 Z-[#<z_max_travel>] (fast probe)
23+
#<z_fast_probe> = #5063
24+
G0 Z[#<retract_distance>]
25+
26+
F #<slow_probe_fr>
27+
G38.2 Z-[#<retract_distance> * 2] (slow probe)
28+
29+
o110 if [#5070] (probing succesful)
30+
#<z_slow_probe> = #5063 (save result)
31+
o110 else
32+
(print,Tool Length Offset Probe Failed)
33+
o110 endif
34+
35+
G0 Z[#<retract_distance>]
36+
37+
(Tool Diameter Probe Mode Section, User must define this section as needed)
38+
o<120> if [#<tool_diameter_probe_mode> EQ 1]
39+
(print, Tool Diameter Probing is Not Defined in Subroutine)
40+
o<120> endif
41+
42+
G90
43+
G53 G0 Z0 (Send Spindle to home zero position)
44+
45+
#<new_tool_length_offset> = [ABS[#<spindle_zero_height> + #<z_slow_probe>]]
46+
47+
G10 L1 P #5400 Z [#<new_tool_length_offset>] (5400 = tool number)
48+
G43 (enable tool length offset)
49+
50+
o<tool_touch_off> endsub
51+
52+
M2 (end program)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
o<tool_touch_off> sub
2+
3+
#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
4+
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
5+
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
6+
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
7+
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
8+
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
9+
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
10+
11+
G92.1 (Cancel G92 offset)
12+
13+
#<workspace_z> = #[5203 + [20 * #5220]]
14+
15+
G49 (cancel tlo)
16+
17+
G53 G0 Z0
18+
G30
19+
20+
G91
21+
F #<fast_probe_fr>
22+
G38.2 Z-[#<z_max_travel>] (fast probe)
23+
#<z_fast_probe> = #5063
24+
G0 Z[#<retract_distance>]
25+
26+
F #<slow_probe_fr>
27+
G38.2 Z-[#<retract_distance> * 2] (slow probe)
28+
29+
o110 if [#5070] (probing succesful)
30+
#<z_slow_probe> = #5063 (save result)
31+
o110 else
32+
(print,Tool Length Offset Probe Failed)
33+
o110 endif
34+
35+
G0 Z[#<retract_distance>]
36+
37+
(Tool Diameter Probe Mode Section, User must define this section as needed)
38+
o<120> if [#<tool_diameter_probe_mode> EQ 1]
39+
(print, Tool Diameter Probing is Not Defined in Subroutine)
40+
o<120> endif
41+
42+
G90
43+
G53 G0 Z0 (Send Spindle to home zero position)
44+
45+
#<new_tool_length_offset> = [ABS[#<spindle_zero_height> + #<z_slow_probe>]]
46+
47+
G10 L1 P #5400 Z [#<new_tool_length_offset>] (5400 = tool number)
48+
G43 (enable tool length offset)
49+
50+
o<tool_touch_off> endsub
51+
52+
M2 (end program)
Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,52 @@
1-
21
o<tool_touch_off> sub
3-
;(debug, in change tool_in_spindle=#<tool_in_spindle> my_current_pocket=#<my_current_pocket>)
4-
;(debug, selected_tool=#<selected_tool> selected_pocket=#<selected_pocket>)
52

6-
;otherwise after the M6 this information is gone!
7-
#<tool> = #<selected_tool>
8-
#<pocket> = #<selected_pocket>
3+
#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
4+
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
5+
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
6+
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
7+
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
8+
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
9+
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
910

10-
; we must execute this only in the milltask interpreter
11-
; or preview will break, so test for '#<_task>' which is 1 for
12-
; the milltask interpreter and 0 in the UI's
13-
O100 if [#<_task> EQ 0]
14-
(debug, Task ist Null)
15-
O100 return [999]
16-
O100 endif
11+
G92.1 (Cancel G92 offset)
1712

18-
;first go up
19-
G53 G0 Z0
20-
; then move to change position
21-
G30
13+
#<workspace_z> = #[5203 + [20 * #5220]]
2214

23-
; cancel tool offset
24-
G49
15+
G49 (cancel tlo)
2516

26-
; using the code being remapped here means 'use builtin behaviour'
27-
M6
28-
29-
O200 if [#<_hal[gmoccapy.toolmeasurement]> EQ 0]
30-
O200 return [3] ; indicate no tool measurement
31-
O200 endif
17+
G53 G0 Z0
18+
G30
3219

33-
G53 G0 X[#<_ini[TOOLSENSOR]X>] Y[#<_ini[TOOLSENSOR]Y>]
34-
G53 G0 Z[#<_ini[TOOLSENSOR]Z>]
20+
G91
21+
F #<fast_probe_fr>
22+
G38.2 Z-[#<z_max_travel>] (fast probe)
23+
#<z_fast_probe> = #5063
24+
G0 Z[#<retract_distance>]
3525

36-
O300 if [#<_hal[gmoccapy.searchvel]> LE 0]
37-
O300 return [-1] ; indicate searchvel <= 0
38-
O300 endif
26+
F #<slow_probe_fr>
27+
G38.2 Z-[#<retract_distance> * 2] (slow probe)
3928

40-
O400 if [#<_hal[gmoccapy.probevel]> LE 0]
41-
O400 return [-2] ; indicate probevel <= 0
42-
O400 endif
29+
o110 if [#5070] (probing succesful)
30+
#<z_slow_probe> = #5063 (save result)
31+
o110 else
32+
(print,Tool Length Offset Probe Failed)
33+
o110 endif
4334

44-
F #<_hal[gmoccapy.searchvel]>
45-
G91
46-
G38.2 Z #<_ini[TOOLSENSOR]MAXPROBE>
47-
G0 Z2
48-
; This is commented out only for sim.
49-
;F #<_hal[gmoccapy.probevel]>
50-
;G38.2 Z-4
35+
G0 Z[#<retract_distance>]
5136

52-
O500 if [#5070 EQ 0]
53-
G90
54-
O500 return [-3] ; indicate probe contact failure to epilog
55-
O500 endif
37+
(Tool Diameter Probe Mode Section, User must define this section as needed)
38+
o<120> if [#<tool_diameter_probe_mode> EQ 1]
39+
(print, Tool Diameter Probing is Not Defined in Subroutine)
40+
o<120> endif
5641

5742
G90
58-
G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]
59-
60-
#<touch_result> = #5063
61-
#<probeheight> = #<_hal[gmoccapy.probeheight]>
62-
#<blockheight> = #<_hal[gmoccapy.blockheight]>
43+
G53 G0 Z0 (Send Spindle to home zero position)
6344

64-
;(DEBUG, #<touch_result> #<probeheight> #<blockheight>)
45+
#<new_tool_length_offset> = [ABS[#<spindle_zero_height> + #<z_slow_probe>]]
6546

66-
G10 L1 P#<tool> Z[#<touch_result> - #<_hal[gmoccapy.probeheight]> + #<_hal[gmoccapy.blockheight]>]
67-
G43
47+
G10 L1 P #5400 Z [#<new_tool_length_offset>] (5400 = tool number)
48+
G43 (enable tool length offset)
6849

69-
;G10 L1 P#<tool> Z#<touch_result>
70-
;G10 L2 P0 Z[#<workpieceheight> + #<probeheight> + #<touch_result>]
50+
o<tool_touch_off> endsub
7151

72-
; signal success be returning a value > 0:
73-
o<tool_touch_off> endsub [1]
52+
M2 (end program)

config/probe_basic/tool.tbl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
;Tool Pocket X Offset Y Offset Z Offset Diameter Remark
2-
T1 P1 X0.0 Y0.0 Z2.5 D0.25 ; test tool 1
3-
T2 P2 X0.0 Y0.0 Z1.5 D0.375 ; test tool 2
4-
T99 P3 X0.0 Y0.0 Z1.0 D0.125 ; TOUCH probe
1+
T1 P1 D0.250000 ; test tool 1
2+
T2 P2 D0.375000 Z+6.902098 ; test tool 2
3+
T99 P3 D0.125000 Z+1.000000 ; TOUCH probe

config/xyzab _vertical/subroutines/change.ngc

Lines changed: 0 additions & 75 deletions
This file was deleted.

config/xyzab _vertical/subroutines/clamptool.ngc

Lines changed: 0 additions & 12 deletions
This file was deleted.

config/xyzab _vertical/subroutines/extendatc.ngc

Lines changed: 0 additions & 14 deletions
This file was deleted.

config/xyzab _vertical/subroutines/go_to_g30.ngc

Lines changed: 0 additions & 7 deletions
This file was deleted.

config/xyzab _vertical/subroutines/go_to_home.ngc

Lines changed: 0 additions & 9 deletions
This file was deleted.

config/xyzab _vertical/subroutines/go_to_position.ngc

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)