{"id":1215,"date":"2013-05-21T18:17:44","date_gmt":"2013-05-21T22:17:44","guid":{"rendered":"http:\/\/pappp.net\/?p=1215"},"modified":"2014-10-28T21:40:37","modified_gmt":"2014-10-29T01:40:37","slug":"shapeoko-part-6-2","status":"publish","type":"post","link":"https:\/\/pappp.net\/?p=1215","title":{"rendered":"Shapeoko: Part 6"},"content":{"rendered":"<p><a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8-1024x768.jpg\" alt=\"SH7-8\" width=\"640\" height=\"480\" class=\"aligncenter size-large wp-image-1228\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8-300x225.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>I&#8217;ve been working on my Shapeoko in little fits and spurts that individually haven&#8217;t been terribly documentation worthy, but in aggregate are pretty interesting.   Continuing from where I left off in <a href=\"http:\/\/pappp.net\/?p=1165 \">Shapeoko: Part 5<\/a>, I&#8217;ve iterated a bit on belt tensioners, switched to a commercial breakout board, put the spindle under computer control, attached the spindle to the machine, made some tentative test cuts, and added hall-effect endstop\/homing switches to the X and Y axes.<br \/>\n<!--more--><br \/>\n<strong>Breakout<\/strong><\/p>\n<div style = \"text-align:center\">\n<div style=\"display: inline-block; margin-right: 5px\">\n  <a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-1-300x225.jpg\" alt=\"SH7-1\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1221\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-1-300x225.jpg 300w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-1-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-1.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n <\/div>\n<div style=\"display: inline-block\">\n  <a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-2-300x225.jpg\" alt=\"SH7-2\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1222\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-2-300x225.jpg 300w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-2-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-2.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n <\/div>\n<\/div>\n<p>I picked up one of the many, many not terribly distinguished Chinese parallel breakout boards to get away from my sketchy breadboard and hand-soldered breakout cable solution.  I selected <a href=\"http:\/\/www.aliexpress.com\/item\/5-Axis-CNC-Breakout-Board-Interface-Adapter-FOR-Stepper-Motor-Driver-DB25-Cable\/602051943.html\">this one<\/a> from &#8220;Shenzhen Ele Technology Ltd.&#8221; on Aliexpress in particular, which is labelled HY-JKM5, comes with a mini-CD complete with bad documentation for this and a dozen other similar products, and what looked like a couple kilobucks worth of cracked CAD and CAM software for Windows.  After rooting around in the documentation, and looking over <a href=http:\/\/softsolder.com\/2013\/02\/17\/anonymous-5-axis-parallel-port-breakout-board-pinout\/\">this post<\/a> that clarified a bit, (aside: the proprietor of that site apparently has exactly the same hobby projects I do, it makes good reading in general) I eventually figured out all the necessary correspondences.  I has five axes worth of 4-pin headers (Enable,Step, and Direction on pins, plus a ground), four switch inputs, a built-in relay, and connections for an E-Stop, all broken out on to nice reliable easy-to-work-with screw terminals, as well as secondary headers for modular wiring, which I <del datetime=\"2014-10-29T01:39:16+00:00\">believe are XH2.54 connectors<\/del> are definitely not JST XH type connectors, they need a narrower key ridge and smaller overall connector body but the documentation isn&#8217;t forthcoming, and that name may be specific to the vendor I matched image and dimensions with.  I don&#8217;t think that the board is really properly isolated, but it is certainly less sketchy than what I had before. <\/p>\n<p><a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-3.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-3-1024x768.jpg\" alt=\"SH7-3\" width=\"640\" height=\"480\" class=\"aligncenter size-large wp-image-1223\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-3-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-3-300x225.jpg 300w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-3.jpg 1824w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>To clean up the electronics a bit, I screwed standoffs into the appropriate holes of all the pieces, and pinned them into a sheet of styrofoam in roughly the layout I intend to eventually secure them in an enclosure, to reduce tugs and confusion and mess.  Ideally, I&#8217;ll have the machine cut roughly the same layout as is pressed into the Styrofoam into a piece of wood or plastic or some-such to screw down and enclose with the power supplies.  That will happen around the same time I do something about random bits of hookup wire plugged into ribbon connectors and the like.  I&#8217;m slowly building connectors for all the serious uglyness, but it is a very manual process to build out from header strip, harvested molex connectors and such into the harness I need. <\/p>\n<p><strong>Spindle<\/strong><br \/>\nI talked about the spindle on it&#8217;s own in detail in my part 5: the two noteworthy things I have done are attach the spindle to the machine (using the stock Shapeoko kit brackets), and get the spindle under computer control.  <\/p>\n<p>Parport Pin 9 is internally connected to the relay on the breakout board, which I have interrupting the ground side of the spindle\/power supply connection.  Pin 17 (which would be the B axis direction as marked on the breakout) is hooked up to a scaled PWM signal fed into the input of the nearly unmarked speed controller than came with the spindle.  I diddled HAL settings until I had reasonable software speed control of the spindle &#8211; my current .hal and .ini are attached to the bottom of this post. <\/p>\n<p><strong>A Cut!<\/strong><br \/>\n<a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8-1024x768.jpg\" alt=\"SH7-8\" width=\"640\" height=\"480\" class=\"aligncenter size-large wp-image-1228\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-8-300x225.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Once I had the breakout and spindle working, I decided I wanted to try cutting <em>something<\/em>, just to have done it.  I taped a piece of EPS foam to the bed, stuck a 1\/8&#8243; diamond-cut endmill in to the collet, homed the machine by eye, hand wrote a short piece of G-Code for some partial-depth concentric circles, let it cut.  Measuring the cuts, it seems to be working properly in all axes. <\/p>\n<p><strong>Switches<\/strong><br \/>\nRunning the machine with no endstops is sketchy.  Running the machine with a spindle and no endstops is <b>really<\/b> sketchy.  I had a bag of generic microswitches, which I wired up with some telephone cord and tried to install, but I was never happy with the physical layout, and went looking for something else.  To that end, I bought a bag of 50 <a href=\"http:\/\/www.allegromicro.com\/~\/media\/Files\/Datasheets\/A3141-2-3-4-Datasheet.ashx\">A3144<\/a>[-ish, they&#8217;re probably clone\/counterfeit\/etc.] sensors from <a href=\"http:\/\/www.aliexpress.com\/item\/Free-shipping-50PCS-LOT-A3144-A3144E-A3144EUA-44E-Hall-Effect-Sensor\/724308849.html\">this<\/a> aliexpress seller (They have gone up at time of writing: I only paid $7.80\/50).  These are nice little self-contained unipolar <a href=\"\">hall effect<\/a> switches &#8211; they ground their output pin when exposed to a sufficiently large magnetic field, and leave it floating otherwise. No moving parts, tiny packages, and incredibly sturdy (no, really, I&#8217;ve beaten the HELL out of some thermally, mechanically, and electrically &#8211; the only ones that died were due to a mishap with 12V reversed through the power and ground pins).<\/p>\n<p><a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-4.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-4-1024x768.jpg\" alt=\"SH7-4\" width=\"640\" height=\"480\" class=\"aligncenter size-large wp-image-1224\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-4-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-4-300x225.jpg 300w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-4.jpg 1824w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>I cabled up with some normal hookup wire and electrical tape, but that caused problems with the wire being larger and stiffer than the part.  While hunting for better cabling options, I saw <a href=\"http:\/\/notanumber.net\/archives\/66\/upgrading-my-reprap-with-cheap-hall-effect-sensors\">this post<\/a> espousing the wonder of servo cables for hooking up A3144, at which point I discovered that you can buy very <a href=\"http:\/\/www.amazon.com\/gp\/product\/B007XP0NXE\/ref=oh_details_o01_s00_i00?ie=UTF8&#038;psc=1\">inexpensive commercial Y-cables<\/a> for servos that make perfect attachments for the max\/min connections.  The genders don&#8217;t work out as nicely, since the ends of the Y are male, but I&#8217;m not afraid of a little soldering. <\/p>\n<div style = \"text-align:center\">\n<div style=\"display: inline-block; margin-right: 5px\">\n<a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-5.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-5-300x225.jpg\" alt=\"SH7-5\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1225\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-5-300x225.jpg 300w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-5-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-5.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n <\/div>\n<div style=\"display: inline-block\">\n<a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-6.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-6-300x225.jpg\" alt=\"SH7-6\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1226\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-6-300x225.jpg 300w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-6-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-6.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>\n <\/div>\n<\/div>\n<p>I ended up using the jacketed ends of the Y cable as bases for a hot-glue-and-heatshrink protective shroud around each sensor, and simply hot gluing the packages to the X and Y motor plates for attachment.  The trigger magnets (which are just some little rare earth discs I tacked on to an order from DealExtreme years ago) are unobtrusively attached to the ends of the rails with a bit of packing tape, and can be easily adjusted.  The output and ground of each sensor is wired to the breakout board through an adapter made with some .1&#8243; header and hookup wire, with the Vcc connections currently just pulled off to a small breadboard hooked to 5V. <\/p>\n<p><a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-7.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-7-300x225.jpg\" alt=\"SH7-7\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1227\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-7-300x225.jpg 300w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-7-1024x768.jpg 1024w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-7.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Getting the switches working electrically exposed some quirks on the breakout board &#8211; for example, the pulled-up and grounded terminals of the X and Y switches are apparently in opposite order, which wouldn&#8217;t matter with a simple mechanical switch but makes the hall-effects that need a solid ground require some trial-and-error to hook up correctly.  There is a little bit of hal and ini magic to get the homing behavior correct (which resulted in many impressive kerchunks as the carriages hit the end-plates), the settings in the attached files are apparently good.<\/p>\n<p>One of my current puzzles is how to set up switches for Z &#8211; I think if I&#8217;m clever about it I can put a single sensor on the X carriage, a pair of magnets on the Z makerslide, and be good go to, but there are many moving obstructions in the area, and I can&#8217;t figure out where the low stop should be.  Ideally, I suppose it would be easily adjustable for the installed bit length. <\/p>\n<p><strong>Etc.<\/strong><br \/>\n<a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-9.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-9-225x300.jpg\" alt=\"SH7-9\" width=\"225\" height=\"300\" class=\"aligncenter size-medium wp-image-1229\" srcset=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-9-225x300.jpg 225w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-9-768x1024.jpg 768w, https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/SH7-9.jpg 1368w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>I&#8217;m not in love with either of the Y belt anchors I have right now.  One side has the aluminum plates I built as a first try, which are large and hard to establish good tension with (I currently have a wood screw jammed in to the belt loop at one end to adjust the tension), and the U channel + original bracket rigs are less than finished looking.  Still not sure how to do better though, maybe it will be another &#8220;the machine cuts its own improved parts&#8221; situation down the road. <\/p>\n<p>My current LinuxCNC <a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/Shapeoko2.hal\">hal<\/a> and <a href=\"https:\/\/pappp.net\/wp-content\/uploads\/2013\/05\/Shapeoko2.hal.ini\">ini<\/a> files are attached, I had trouble finding good examples for what I wanted to happen, so hopefully these will be useful to others.  These have apparently correct descriptions for homing X and Y with the A3144s, for controlling the spindle, and for general motion, although some things like the soft travel distances and Z homing are bogus or absent. <\/p>\n<p>It is now, essentially, good enough to make &#8220;real things&#8221; &#8211; I just have to get it together to do so. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working on my Shapeoko in little fits and spurts that individually haven&#8217;t been terribly documentation worthy, but in aggregate are pretty interesting. Continuing from where I left off in Shapeoko: Part 5, I&#8217;ve iterated a bit on belt &hellip; <a href=\"https:\/\/pappp.net\/?p=1215\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,37,6,1,10],"tags":[],"class_list":["post-1215","post","type-post","status-publish","format-standard","hentry","category-diy","category-electronics","category-entertainment","category-general","category-objects"],"_links":{"self":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts\/1215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1215"}],"version-history":[{"count":0,"href":"https:\/\/pappp.net\/index.php?rest_route=\/wp\/v2\/posts\/1215\/revisions"}],"wp:attachment":[{"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pappp.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}