{"id":16593,"date":"2021-01-21T09:29:41","date_gmt":"2021-01-21T14:29:41","guid":{"rendered":"https:\/\/scruss.com\/blog\/?p=16593"},"modified":"2021-02-14T11:35:37","modified_gmt":"2021-02-14T16:35:37","slug":"thursday-morning-gravity-wells","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2021\/01\/21\/thursday-morning-gravity-wells\/","title":{"rendered":"Thursday Morning Gravity Wells"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"496\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2021\/01\/osccirc-rotate1.svg\" alt=\"two sets of osculating circles, one in red, the other blue, offset by 180\u00c2\u00b0 to create interference fringes\" class=\"wp-image-16594\"\/><figcaption>made with <a href=\"https:\/\/www.vagrearg.org\/content\/gcmc\">gcmc<\/a> and some fiddling about in Inkscape<\/figcaption><\/figure><\/div>\n\n\n\n<p>Since I have the <a href=\"https:\/\/github.com\/bdring\/midTbot_esp32\">MidTBot ESP32<\/a> plotter running properly, I thought I should look at better ways of generating G-Code than using <a href=\"http:\/\/www.moria.de\/~michael\/bas\/\">BASIC<\/a> and lots of print statements. Ed Nisley \u00e2\u20ac\u201d from whom I&#8217;ve learned a lot \u00e2\u20ac\u201d always seems to be doing <a href=\"https:\/\/softsolder.com\/2021\/01\/20\/homage-tektronix-circuit-computer-laser-printed-scales\/\">interesting things<\/a> using the <a href=\"https:\/\/www.vagrearg.org\/content\/gcmc\">gcmc &#8211; G-Code Meta Compiler<\/a>, and it looks like a useful little language to learn.<\/p>\n\n\n\n<p>Here&#8217;s the code to make at least half of the above:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\n   osculating circles - scruss, 2021-01\n   gcmc version\n\n   Usage with midTbot \/ grbl_esp32:\n\n   gcmc osccirc.gcmc | grep -v '^G64' > osccirc.gcode\n\n   Or for SVG:\n\n   gcmc --svg --svg-no-movelayer --svg-toolwidth=0.25 osccirc.gcmc | sed 's\/stroke:#000000\/stroke:#C80022\/g;' > osccirc.svg\n   \n*\/\ncomment(\"osculating circles - scruss, 2021-01\");\n\n\/* machine constants *\/\nup \t      = &#91;-, -, 5.0mm];\ndown \t      = &#91;-, -, 0.0mm];\npark \t      = &#91;5.0mm, 145.0mm, 5.0mm];\nfeedrate(6000mm);\n\n\/* model parameters *\/\ncentre\t      = &#91;100.0mm, 75.0mm];\nr\t      = 65.0mm;\nlim_r\t      = 3.0mm;\npr\t      = r;\na\t      = 0.0deg;\nda\t      = 6.0deg;\nsc\t      = 0.95;\ncomment(\"centre: \", centre, \"; r: \", r, \"; lim_r: \", lim_r, \"; pr: \", pr, \"; a: \", a, \"; da: \", da, \"; sc: \", sc);\n\n\/* counter \/ sense marker *\/\nn\t      = 0;\n\ngoto(up);\ndo {\n   centre += &#91;(pr-r)*cos(a), (pr-r)*sin(a)];\n   goto(&#91;centre.x - r, centre.y]);\n   goto(down);\n   n++;\n   if (n%2) {\n      circle_cw(centre);\n   }\n   else {\n      circle_ccw(centre);\n   }\n   goto(up);\n   a += 360.0deg + da;\n   a %= 360.0deg;\n   pr = r;\n   r *= sc;\n} while (r >= lim_r);\n\n\/* end *\/\ncomment(n, \" circles\");\ngoto(park);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Since I have the MidTBot ESP32 plotter running properly, I thought I should look at better ways of generating G-Code than using BASIC and lots of print statements. Ed Nisley \u00e2\u20ac\u201d from whom I&#8217;ve learned a lot \u00e2\u20ac\u201d always seems to be doing interesting things using the gcmc &#8211; G-Code Meta Compiler, and it looks [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2],"tags":[2789],"class_list":["post-16593","post","type-post","status-publish","format-standard","hentry","category-goatee-stroking-musing-or-something","tag-plotter"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-4jD","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=16593"}],"version-history":[{"count":1,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16593\/revisions"}],"predecessor-version":[{"id":16595,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16593\/revisions\/16595"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=16593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=16593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=16593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}