103 lines
1.8 KiB
Plaintext
103 lines
1.8 KiB
Plaintext
; MACROCOMMAND=X,SFM,DOC,Z,Tool Number,Chamfer size,Front Outside,Front Inside,Back Outside,Max RPM
|
|
; MACRODEFAULTS=1,300,.5,1,1,.015,true,false,false,1500
|
|
; MACROSVG=LatheMacro.svg,4
|
|
|
|
; O<chamfer>call [${chamfer.x-f}] [${chamfer.sf-f}] [0.5] [${chamfer.z-f}] [${chamfer.tool-s}] [${chamfer.size-f}] [${chamfer.fo}] [${chamfer.fi}] [${chamfer.bo}]
|
|
|
|
; #1 chamfer x
|
|
; #2 surface speed *
|
|
; #3 doc
|
|
; #4 chamfer z
|
|
; #5 tool number
|
|
; #6 chanfer size
|
|
; #7 front outside switch *
|
|
; #8 front inside switch *
|
|
; #9 back outside switch *
|
|
; #10 Max RPM
|
|
|
|
;chamfer
|
|
|
|
O<chamfer> sub
|
|
|
|
O107 IF [#<_imperial>]
|
|
(MSG, IMPERIAL ON)
|
|
#1 = [#1 * 25.4]; X
|
|
#2 = [#2 * .3048] ; sf/m to m/m
|
|
#3 = [#3 * 25.4]; doc?
|
|
#4 = [#4 * 25.4]; Z
|
|
#6 = [#6 * 25.4]; chanfer size
|
|
O107 ENDIF
|
|
|
|
M73 ; save/restore codes
|
|
|
|
G8 ; Lathe radius Mode
|
|
G18 ; XZ Plane
|
|
G21 ; Metric Units
|
|
G90 ; Absolute Distance
|
|
|
|
|
|
#1 = [#1 / 2] ; because of radius mode
|
|
|
|
#14 = [#<_x>] (starting X)
|
|
#13 = [#<_z>] (starting Z)
|
|
|
|
(MSG, Unpause To start Chamfer Macro)
|
|
m0
|
|
|
|
M6 T#5 G43
|
|
|
|
G96 D#10 S#2 ; Constant Surface Speed Mode
|
|
M3
|
|
g95 F0.1 ; Feed-Per-Rev Mode
|
|
|
|
#20 = 0
|
|
O101 if [#7 GT 0.5] ; front outside
|
|
o100 while [[#20 + #3] lt #6]
|
|
#20 = [#20 + #3]
|
|
g0 x[#1 - #20] z#13
|
|
g1 z#4
|
|
g1 x#1 z[#4 - #20]
|
|
g1 x #14
|
|
g0 z#13
|
|
o100 endwhile
|
|
g0 x#14 z#13
|
|
g0 x[#1 - #6]
|
|
g1 z#4
|
|
g1 x#1 z[#4 - #6]
|
|
g1 x #14
|
|
g0 z#13
|
|
O101 elseif [#8 GT 0.5] ; front inside
|
|
o102 while [[#20 + #3] lt #6]
|
|
#20 = [#20 + #3]
|
|
g0 x[#1 + #20] z#13
|
|
g1 z#4
|
|
g1 x#1 z[#4 - #20]
|
|
g1 x #14
|
|
g0 z#13
|
|
o102 endwhile
|
|
g0 x#14 z#13
|
|
g0 x[#1 + #6]
|
|
g1 z#4
|
|
g1 x#1 z[#4 - #6]
|
|
g1 x #14
|
|
g0 z#13
|
|
O101 elseif [#9 GT 0.5] ; back outside
|
|
o103 while [[#20 + #3] lt #6]
|
|
#20 = [#20 + #3]
|
|
g0 x[#1 - #20] z#13
|
|
g1 z#4
|
|
g1 x#1 z[#4 + #20]
|
|
g1 x #14
|
|
g0 z#13
|
|
o103 endwhile
|
|
g0 x#14 z#13
|
|
g0 x[#1 - #6]
|
|
g1 z#4
|
|
g1 x#1 z[#4 + #6]
|
|
g1 x #14
|
|
g0 z#13
|
|
O101 endif
|
|
G7
|
|
O<chamfer> endsub
|
|
m2
|