-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy paththreading.ngc
59 lines (47 loc) · 1.02 KB
/
threading.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
53
54
55
56
57
58
59
;threading
O<threading> sub
G7 ; Lathe Diameter Mode
G18 ; XZ Plane
G21 ; Metric Units
G90 ; Absolute Distance
M6 T#3 G43
#14 = [#<_x> * 2] (starting X)
#13 = #<_z> (starting Z)
G96 D200 S#2 ; Constant Surface Speed Mode
M3
g95 F0.25 ; Feed-Per-Rev Mode
O90 IF [#8 GT 0.5]
M8
O90 ENDIF
g4p1 ; Wait to reach speed
;Threading
O51 IF [#6 GT 0.5]
#<OD> = [#1]
#<ID> = [#1 - 1.3 * #4]
;g1X [#<ID> - 1] ;thread truncation
;g0 Z #13
;g1 X #<ID>
;g1 Z #5
G0 X[#<ID> - 1]
g0 Z #13
#3 = [#4 * 1.3]
(debug, INTERNAL Threading thread dia-#1 start-#13 finish-#5 Pitch-#4 Depth-#3)
g1X [#<ID> - 1]
g76 p#4 z#5 i1 j0.2 k#3 h3 r1.5 q29.5 e0 l0
O51 ELSE
#<OD> = [#1 - 0.108 * #4]
#<ID> = [#1 - 1.0825 * #4]
(debug, EXTERNAL Threading OD = #<OD> ID = #<ID>)
#3 = [#4 * 1.0825]
g1X [#<OD> + 1] ;final thread truncation
g0 z#13
g1 X #<OD>
g1 Z #5
G0 X[#<OD> +1]
G0 Z #13
g76 p#4 z#5 i-1 j0.2 k#3 h3 r1.5 q29.5 e0 l0
O51 ENDIF
G0 Z #13
m5 M9
O<threading> endsub
M2