{"id":354,"date":"2021-06-21T06:51:15","date_gmt":"2021-06-21T06:51:15","guid":{"rendered":"https:\/\/blog.kekling.com\/?p=354"},"modified":"2021-10-11T17:56:03","modified_gmt":"2021-10-11T17:56:03","slug":"mill-calibration","status":"publish","type":"post","link":"https:\/\/blog.kekling.com\/?p=354","title":{"rendered":"Mill Calibration"},"content":{"rendered":"\n<figure class=\"wp-block-gallery columns-2 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-scaled.jpg\"><img loading=\"lazy\" width=\"813\" height=\"1024\" src=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-813x1024.jpg\" alt=\"\" data-id=\"365\" data-full-url=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-scaled.jpg\" data-link=\"https:\/\/blog.kekling.com\/?attachment_id=365\" class=\"wp-image-365\" srcset=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-813x1024.jpg 813w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-238x300.jpg 238w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-768x967.jpg 768w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-1220x1536.jpg 1220w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-1627x2048.jpg 1627w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/scribe-scaled.jpg 2033w\" sizes=\"(max-width: 813px) 100vw, 813px\" \/><\/a><figcaption class=\"blocks-gallery-item__caption\">Scribing axis position with a caliper<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-scaled.jpg\"><img loading=\"lazy\" width=\"998\" height=\"1024\" src=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-998x1024.jpg\" alt=\"\" data-id=\"372\" data-full-url=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-scaled.jpg\" data-link=\"https:\/\/blog.kekling.com\/?attachment_id=372\" class=\"wp-image-372\" srcset=\"https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-998x1024.jpg 998w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-292x300.jpg 292w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-768x788.jpg 768w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-1497x1536.jpg 1497w, https:\/\/blog.kekling.com\/wp-content\/uploads\/2021\/06\/measure-1996x2048.jpg 1996w\" sizes=\"(max-width: 998px) 100vw, 998px\" \/><\/a><figcaption class=\"blocks-gallery-item__caption\">Measuring the distance between marks<\/figcaption><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>I&#8217;ve had some people ask me about calibrating a mill when using grbl, without knowing the steps\/revolution of the motor, or the lead screw pitch (or bothering to look up and\/or measure them).  It&#8217;s a pretty simple process, but not all interfaces will make it obvious.  Start by moving the mill to a safe position either manually of through whichever control program you use.  I start it roughly centered to be on the safe side.<\/p>\n\n\n\n<p>Then connect to the grbl controller directly via a serial console.  You can use any serial terminal, I like screen.  Don&#8217;t forget to replace \/dev\/ttyUSB0 with your serial port.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>screen \/dev\/ttyUSB0 115200<\/code><\/pre>\n\n\n\n<p>Hit enter a few times if necessary so that grbl returns &#8220;ok&#8221;.  We can now change the variables that control the number of steps generated by grbl per millimeter of movement (steps\/mm).  grbl variables are assigned numbers, you can find the list on the <a href=\"https:\/\/github.com\/grbl\/grbl\/wiki\/Configuring-Grbl-v0.9\">grbl wiki<\/a>.  You can type $$ (two dollar signs) to get grbl to print the current values of the variables.<\/p>\n\n\n\n<p>We&#8217;ll start by calibrating the x axis, so we&#8217;ll set the steps\/mm variable for the x axis ($100) to 10000.  This means that for one millimeter of movement, grbl with output 10000 steps.  We also issue a G92 code to make the current position the 0 for the X axis.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$100=10000\nG92 X0<\/code><\/pre>\n\n\n\n<p>Before moving the machine, make a mark, either with a pen or with a scribe.  I use the blade of my calipers, and make a sharpie mark besides each mark to remember where they are.  (see first picture at the top)<\/p>\n\n\n\n<p>We now move the machine by one 10000 step units (what the grbl currently thinks is 1mm) by issuing the following gcode command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>G1 X1 F100<\/code><\/pre>\n\n\n\n<p>Once the machine has moved, mark the new location as before.  I usually repeat the process again a few times so that I can average the measures at the end<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>G1 X2 F100\nG1 X3 F100\nG1 X4 F100<\/code><\/pre>\n\n\n\n<p>And so on for however many measures you want to take.  We can now measure the movement that resulted from each 10000 steps of the motor.<\/p>\n\n\n\n<p>In this example I got an average of roughly 7.5mm per 10000 steps.  (see second picture at the top) From this we can find the correct value for the number of steps\/mm:<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\frac{10000\\textnormal{ steps}}{7.5\\textnormal{ mm}} = \\frac{x\\textnormal{ steps}}{1\\textnormal{ mm}} \\Rightarrow x \\approx 1333.33<\/pre><\/div>\n\n\n\n<p>And we can tell grbl to use this value from now on:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$100=1333.33<\/code><\/pre>\n\n\n\n<p>The same process can be repeated for each of the other axes, with $101 being the variable for the Y axis steps\/mm and $102 being the variable for the Z axis steps\/mm.<\/p>\n\n\n\n<p>As it turns out all three axis of this mill use the same motors, same direct drive configuration and same lead screws, so the steps\/mm for all three axis are the same.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve had some people ask me about calibrating a mill when using grbl, without knowing the steps\/revolution of the motor, or the lead screw pitch (or&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31,29,20,1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts\/354"}],"collection":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354"}],"version-history":[{"count":14,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":380,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions\/380"}],"wp:attachment":[{"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kekling.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}