Newer
Older
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
60
61
62
;drill
O<drill> sub
#<ccomp> = #<_ccomp>
#<metric> = #<_metric>
#<absolute> = #<_absolute>
#<feed> = #<_feed>
#<coord_system> = #<_coord_system>
#<lathe_diameter_mode> = #<_lathe_diameter_mode>
#<ijk_absolute_mode> = #<_ijk_absolute_mode>
G7 ; diameter mode
G90 ; Absolute Distance
; #1 drill diameter
; #2 ydepth
; #3 speed
; #4 feed/rpm
; #5 tool number
; #6 peck amount
; #7 retract amount
; #8 coolant
O10 if [#8 EQ 1]
M8
O10 endif
#9 = #<_y> (starting Y)
;M6 T#5 G43
O100 if [#5 NE #<_current_tool>]
(MSG, ERROR : Set tool before use macro)
O<restore> call [#<metric>] [#<absolute>] [#<feed>] [#<ccomp>] [#<coord_system>] [#<lathe_diameter_mode>] [#<ijk_absolute_mode>]
O100 return [-2] ; indicate failure to epilog
O100 endif
#7 = [[1000 * #3] / [3.1415 * #1]] ; metric mode RPM
G97 S#7 ; Constant RPM mode
M3 ;Start Spindle
G95 F#4 ; Feed-Per-Rev Mode
G4 P1 ; Wait to reach speed
(debug, Drilling dia #1 depth #2 asked-speed #3 feed/rpm #4 tool #5 peck dist #6 calculated-rpm #7 start-Y #9)
(MSG, ERROR : TODO must retract the X axis to home position)
; G0 X0 ; TODO must retract the X axis to home position
;G0 Y#9
G98
G83 Y#2 R#9 Q#6
G80
;G0 Y#9
M5
M9
; restore g20/21, g90/g91, feed
O<restore> call [#<metric>] [#<absolute>] [#<feed>] [#<ccomp>] [#<coord_system>] [#<lathe_diameter_mode>] [#<ijk_absolute_mode>]
O<drill> endsub
M2
%