{"id":274,"date":"2025-12-17T01:11:49","date_gmt":"2025-12-16T23:11:49","guid":{"rendered":"https:\/\/www.robertksiazek.com\/?p=274"},"modified":"2025-12-17T15:10:54","modified_gmt":"2025-12-17T13:10:54","slug":"simple-external-thread-milling","status":"publish","type":"post","link":"https:\/\/www.robertksiazek.com\/index.php\/2025\/12\/17\/simple-external-thread-milling\/","title":{"rendered":"Simple External Thread Milling"},"content":{"rendered":"\n<p>This code is shared for educational purposes only. Use it at your own risk \u2014 you are fully responsible for any results.<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:0.7rem\"><code>( ------------------------------------- )\n(                                       )\n(    SIMPLE EXTERNAL THREAD MILLING     )\n(   More CNC programs on my website     )\n(         RobertKsiazek.com             )\n(                                       )\n( --------------------------------------)\n\n(PARAMETERS)\nXX = 0 (X BOSS POSITION)\nYY = 0 (Y BOSS POSITION)\nZZ = 0 (Z START POSITION)\nXSAF = 25 (SAFE X POSITION)\nZSAF = 2 (SAFE Z POSITION)\nSFEE = 1000 (LEAD IN FEED)\nFEED = 1000 (CUTTING FEED SPEED)\nVC1 = 20.75 (START MILLING THREAD AT X POSITION)\nVC2 = 3 (THREAD PITCH)\nVC3 = 10 (REPEAT PITCH)\nVC8 = 0 (COUNTER)\n( --------------------------------------)\n\n(MACHINE SETUP)\nG15 H3 (WORK ZERO NUMBER 3)\nG11 X XX Y YY\nG17\nG90\nT1 M6\nG56 HA\nZ9999\n( --------------------------------------)\n\n(MACHINE START)\nS5000 M3\nM8 (COOLANT ON)\nX XSAF Y0\nZ ZSAF\n( --------------------------------------)\n\n(THREAD MILLING)\nZ ZZ (GO TO START Z POSITION)\nVC8 = 0 (RESET COUNTER)\n( --------------------------------------)\n\n(MAIN LOOP)\nN100 (TOP -&gt; DOWN)\nVC8 = VC8 + 1 (COUNTER UPDATE)\nG1 X VC1 F SFEE (FEED IN)\nVC4 = VRCOZ - VMOFZ - VZOFZ&#91;VACOD] - VTOFH&#91;VATOL] (CURRENT Z POSITION)\nVC5 = VC4 - VC3 (CALCULATE TARGET Z POSITION)\nG1 X VC1 Y0 Z VC% I -VC1 J0 F FEED (FULL ONE THREAD PASS)\nIF &#91;VC8 LT VC6] N100 (LOOP)\n( --------------------------------------)\n\n(PROGRAM END)\nN9999\nG1 X XSAF F FEED (BACK OFF)\nG10\nM5\nG0 Z9999\nM2\nM30\n( --------------------------------------)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This code is shared for educational purposes only. Use it at your own risk \u2014 you are fully responsible for any results.<\/p>\n","protected":false},"author":1,"featured_media":275,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[40,41,39],"class_list":["post-274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-okuma","tag-genos","tag-m560-v-e","tag-okuma"],"_links":{"self":[{"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/posts\/274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/comments?post=274"}],"version-history":[{"count":4,"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/posts\/274\/revisions"}],"predecessor-version":[{"id":325,"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/posts\/274\/revisions\/325"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/media\/275"}],"wp:attachment":[{"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/media?parent=274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/categories?post=274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.robertksiazek.com\/index.php\/wp-json\/wp\/v2\/tags?post=274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}