forked from cnc-club/linuxcnc-engraving-comp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscan-surface.ngc
52 lines (47 loc) · 1.11 KB
/
scan-surface.ngc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
; Scan surface sub for compensation component
; Usage o<scan-surface> call [#<x0>] [#<y0>] [#<h>] [#<w>] [#<step>] [#<search_feed>] [#<latch_feed>] [#<safe_z>] [#<search_z>]
; All parameters are needed!
;
; Example:
; #<h> = 90
; #<w> = 90
; #<x0> = 110
; #<y0> = 90
; #<step> = 20
; #<search_feed> = 100
; #<latch_feed> = 1
; #<safe_z> = 3
; #<search_z> = -3
;
; o<scan-surface> call [#<x0>] [#<y0>] [#<h>] [#<w>] [#<step>] [#<search_feed>] [#<latch_feed>] [#<safe_z>] [#<search_z>]
;
o<scan-surface> sub
M64 P0 (turn off compensation)
T1 M6 (Install probe)
#<x0> = #1
#<y0> = #2
#<h> = #3
#<w> = #4
#<step> = #5
#<search_feed> = #6
#<latch_feed> = #7
#<safe_z> = #8
#<search_z> = #9
(PROBEOPEN filename.txt)
G0 #<safe_z>
#<y> = #<y0>
o101 while [#<y> LT #<h>+#<y0>]
#<x> = #<x0>
o102 while [#<x> LT #<w>+#<x0>]
G0 X#<x> Y#<y>
F[#<search_feed>]
G38.3 [Z#<search_z>]
F[#<latch_feed>]
G38.5 [Z#<safe_z>]
G0 #<safe_z>
#<x> = [#<x>+#<step>]
o102 endwhile
#<y> = [#<y>+#<step>]
o101 endwhile
(PROBECLOSE)
o<scan-surface> endsub