% (Code to do a thread at starting at 0,0,0) (Assumes bottom of tool starts at top surface of material) (#1 is centerX #2 is centerY) (#3 is Z depth -- bottom) (#4 is tool diameter) (#5 is thread major diameter) (#6 is feed rate #7 = thread pitch) o3810 sub (#10 is radius of tool center) (#11 = ToolRadius) #11 = [#4/2.0] (#12 = BoreRadius) #12 = [#5/2.0] #10 = [#12 - #11] (#17 = CurZ) (#14 = Z per turn) #14 = [1.000/#7] (cut out to edge) (#15 is X #16 is Y #17 is Z) #15 = 0 #16 = [#10] G0 Z.2 (get clear of the metal) G0 X#1 Y#2 (go to the center) G0 Z[0-#3] (drop to the bottom) G1 F#6 Y[#2+#10] X[#1+0] (Go to edge) G3 J[0-#10] I0 Y[#2+#10] X[#1+0] (Go around the loop) #17 = [0-#3] o3813 while [#17 LT 0] #17 = [#17 + #14] G3 J[0-#10] I0 Y[#2+#10] X[#1+0] Z[#17] (Go one turn) o3813 endwhile G01 X[#1+0] Y[#2+0] (back to the center) #100 = 0 (signal no error) o3810 endsub (#1 is centerX #2 is centerY) (#3 is Z depth -- bottom) (#4 is tool diameter) (#5 is thread major diameter) (#6 is feed rate #7 = thread pitch) g0 z.2 g0 y-1.5 x-3.0 (move to empty place) g0 z0 (Down to the surface) m5 m0 (msg, change to vee threading tool) g0 z.2 g0 x-1.5 y-1.5 (back to the center) g0 z0 (Down to the surface) s2760m3 (Start your engines) o3810 call [-1.5] [-1.5] [1.330][.750] [1.0] [5] [8] (The cap threads) g0z.2 m5 %