# Knurling w/ threading tool using G33 - Emco 120P

14 Sep 2015 00:14 #62521 by tome
Here is a video of our G33 knurling routine running. Pretty cool. I’m sure we aren’t the first to do this, but since I haven’t seen it before I will pretend like it BTW, this knurl is only about 5 thou deep, deeper ones will follow.

Here is the code:

G8
G53 G0 X0
G53 G0 Z0
M6 T3 G43

#<workpieceDia> = 0.700
#<safeXOffset> = 0.025

#<knurlStartZ> = 0.000
#<knurlLen> = 0.25
#<knurlDepth> = 0.002
#<knurlPerDia> = 28
#<knurlAngle> = 30
#<knurlEndZ> = [#<knurlStartZ> - #<knurlLen>]

#<rpm> = 100

#<pi> = 3.142

; The surface is the circumference of the workpiece
#<workSurface> = [#<pi> * #<workpieceDia>]

; Given a knurl angle, calculate Z feed given <workSurface>
#<feedPerRev> = [TAN[#<knurlAngle>] * #<workSurface>]
#<feedPerMin> = [#<feedPerRev> * #<rpm>]
(debug, feed per revolution: #<feedPerRev>; per min: #<feedPerMin>)

; thread _width_ is equal to distance traveled in one rev, i.e. <feedPerRev>
; Thus, TPI will be 1/<threadWidth>

; To do a n-start thread, we need to start each thread

M3 S#<rpm>

#100 = #<knurlPerDia>
#110 = [[#<knurlPerDia> * #<nStartZOffset>] + #<knurlStartZ> + #<knurlLeadIn>]

G0 Z#110

O100 WHILE [#100 GT 0]
(debug, start Z: #110; feed: #<feedPerRev>)
(calculate the lead in for the knurl AFTER this one)
#105 = #110
#110 = [#110 - #<nStartZOffset>]

;G33 Z#110 K#<feedPerRev>
;G1 Z#<knurlEndZ> F#<feedPerMin>
;G1 Z#105 F#<feedPerMin>
G33 Z#<knurlEndZ> K#<feedPerRev>
G33 Z#105 K#<feedPerRev>
;G0 X#<safeX>
G0 Z#110

#100 = [#100 - 1]
O100 ENDWHILE
The following user(s) said Thank You: phillc54, joekline9, Boogie, sharpshooterser, Dinuka_Shehan

18 Oct 2019 21:43 #148228
Can you post the actual code without tags

18 Oct 2019 22:53 #148231 by cmorley
If you mean 'tags' like this : #<workpieceDia>
Those are variables and make it easy to change the parameters of the program.
They are ugly but necessary

Chris

18 Oct 2019 23:24 #148236
# is not a tag, it is just miss used as one, it is a numbered parameter.