{"id":209,"date":"2014-08-19T22:30:29","date_gmt":"2014-08-19T19:30:29","guid":{"rendered":"http:\/\/tulos.tuu.fi\/?p=209"},"modified":"2014-08-19T22:48:54","modified_gmt":"2014-08-19T19:48:54","slug":"g-code-fixing-tool","status":"publish","type":"post","link":"http:\/\/tulos.tuu.fi\/?p=209","title":{"rendered":"G-code fixing tool"},"content":{"rendered":"<p>The plugin for Eagle PCB CAD called <a href=\"http:\/\/www.cuteminds.com\/index.php\/pcb-gcode\">pcb-gcode<\/a>\u00a0is great, don&#8217;t get me wrong. But somehow it wants to start the coordinate system so that the X values are negative. Also it made some strange &#8220;margin&#8221; in Y-axis which makes alignment of the actual PCB to be milled difficult.<\/p>\n<p>So I wrote a tool that can:<\/p>\n<ul>\n<li><span style=\"line-height: 1.714285714; font-size: 1rem;\">automatically translate the axis so that there is no negative values<\/span><\/li>\n<li><span style=\"line-height: 1.714285714; font-size: 1rem;\">automatically detect the actual &#8220;working piece&#8221; (values with negative Z) and use the working area&#8217;s &#8220;zero&#8221; as actual workpath zero. This way you can set the home to zero at the physical location where you want the mill to be started.<\/span><\/li>\n<\/ul>\n<p>See this picture for the original gcode generated by the Eagle ULP:<\/p>\n<p><a href=\"http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.24.07.png\"> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-211\" alt=\"N\u00e4ytt\u00f6kuva 2014-8-19 kello 22.24.07\" src=\"http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.24.07-300x194.png\" width=\"300\" height=\"194\" srcset=\"http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.24.07-300x194.png 300w, http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.24.07-624x404.png 624w, http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.24.07.png 772w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/a><\/p>\n<p>And then gcode my program generated, reloaded back to the software itself (the green cross indicates gcode x+y zero point). The toolhead still visits to negative Y-values at the start but that&#8217;s too difficult to be removed (see the line that goes to bottom right corner):<\/p>\n<p><a href=\"http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.23.18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-212\" alt=\"N\u00e4ytt\u00f6kuva 2014-8-19 kello 22.23.18\" src=\"http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.23.18-300x168.png\" width=\"300\" height=\"168\" srcset=\"http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.23.18-300x168.png 300w, http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.23.18-624x350.png 624w, http:\/\/tulos.tuu.fi\/wp-content\/uploads\/2014\/08\/N\u00e4ytt\u00f6kuva-2014-8-19-kello-22.23.18.png 893w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The plugin for Eagle PCB CAD called pcb-gcode\u00a0is great, don&#8217;t get me wrong. But somehow it wants to start the coordinate system so that the X values are negative. Also it made some strange &#8220;margin&#8221; in Y-axis which makes alignment of the actual PCB to be milled difficult. So I wrote a tool that can: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-yleinen"],"_links":{"self":[{"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=209"}],"version-history":[{"count":10,"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":221,"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions\/221"}],"wp:attachment":[{"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tulos.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}