{"id":1684,"date":"2022-08-15T08:44:30","date_gmt":"2022-08-15T08:44:30","guid":{"rendered":"https:\/\/howiem.org\/wordpress\/?p=1684"},"modified":"2022-08-15T08:44:30","modified_gmt":"2022-08-15T08:44:30","slug":"new-robot","status":"publish","type":"post","link":"https:\/\/howiem.org\/wordpress\/2022\/08\/15\/new-robot\/","title":{"rendered":"New robot!"},"content":{"rendered":"<p>A friend gave me an old industrial robot the other week. Yay! OK, &#8220;robot&#8221; sounds fancy. It&#8217;s a cartesian robot, just a posh name for summat that can move in X, Y and Z directions like a plotter. Tidy looking thing, though:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1700\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.20.58-894x1024.png\" alt=\"\" width=\"894\" height=\"1024\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.20.58-894x1024.png 894w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.20.58-262x300.png 262w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.20.58-768x880.png 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.20.58.png 1000w\" sizes=\"auto, (max-width: 894px) 100vw, 894px\" \/><\/p>\n<p>Even came with a pendant &#8211; a programmer \/ controller to teach it what you want it to do. It&#8217;s completely self-contained, so you can just plug it into the mains, programme it to do some moves, and then it&#8217;ll do those moves happily until you switch it off.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1701\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.23.21-1024x960.png\" alt=\"\" width=\"1024\" height=\"960\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.23.21-1024x960.png 1024w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.23.21-300x281.png 300w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.23.21-768x720.png 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.23.21.png 1173w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>I&#8217;ve got history with these kinda robotics, though. The controller and the logic board are fine for industrial stuff, you can tell it &#8220;move 33mm in the X direction, then move the head down 20mm&#8221; etc, but it doesn&#8217;t handle graceful acceleration, it&#8217;s just moving or not. And I want to be able to control it with a computer, so I can get it to carve circuit boards, sculpture, engrave stuff. So &#8230; it needs some new innards.<\/p>\n<p>Nice thing is that it breaks down pretty easily, once you find the hidden screws holding it together:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1691\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6570-768x1024.jpg\" alt=\"\" width=\"768\" height=\"1024\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6570-768x1024.jpg 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6570-225x300.jpg 225w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6570-1152x1536.jpg 1152w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6570-scaled.jpg 1200w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>OK &#8211; a week or so later, and I have an hour to kill while waiting for a render. So let&#8217;s investigate.<\/p>\n<h4>Motors and motor drivers<\/h4>\n<p>First thing: the motors driving the axes are a bit unusual; they&#8217;re 5-phase Sanyo Denki stepper motors. Fancy.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1690\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6568-1024x768.jpg\" alt=\"\" width=\"1024\" height=\"768\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6568-1024x768.jpg 1024w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6568-300x225.jpg 300w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6568-768x576.jpg 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6568-1536x1152.jpg 1536w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6568-scaled.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Most steppers and stepper drivers (certainly the ones in my junk bin) are 2 or 4 phase, so I&#8217;m hoping there&#8217;ll be separate driver boards inside this thing, or I&#8217;m going to have to source or build some weird drivers.<\/p>\n<p>Thankfully, when I take the top off, I can see 3 obvious drivers inside&#8230;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1698\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6642-768x1024.jpg\" alt=\"\" width=\"768\" height=\"1024\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6642-768x1024.jpg 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6642-225x300.jpg 225w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6642-1152x1536.jpg 1152w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6642-scaled.jpg 1200w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>OK &#8211; so each driver has connections to the PSU, connections to the motor (10 wires) and 6 wires going off to the controller board.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1705\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.05-1024x670.png\" alt=\"\" width=\"1024\" height=\"670\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.05-1024x670.png 1024w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.05-300x196.png 300w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.05-768x503.png 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.05.png 1170w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Need to know what those wires do. One&#8217;ll be GND, but the others..?<\/p>\n<p>I made a quick tap: something I can plug between the control cable and the socket to give me an easier way to probe the wires in-situ. The photo makes it look like half the solder is shorting out, but it&#8217;s a bad photo. I mean, it&#8217;s terrible soldering, too, but not quite as bad as the pic makes it look, honest:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1706\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.16-1024x761.png\" alt=\"\" width=\"1024\" height=\"761\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.16-1024x761.png 1024w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.16-300x223.png 300w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.16-768x571.png 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.49.16.png 1170w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Now I can hook a scope to those pins and see what happens when you use the pendant to make the robot do something:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1708\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.50.13.png\" alt=\"\" width=\"880\" height=\"650\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.50.13.png 880w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.50.13-300x222.png 300w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.50.13-768x567.png 768w\" sizes=\"auto, (max-width: 880px) 100vw, 880px\" \/><\/p>\n<p>I can see broadly which wires do what now. Time to rip out all the controllers and bits and pieces I don&#8217;t need from the robot and replace them with an interface board. This connects to a computer via USB, and has a bunch of input and output connections I can use to control and watch things:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1702\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.28.30-1024x632.png\" alt=\"\" width=\"1024\" height=\"632\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.28.30-1024x632.png 1024w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.28.30-300x185.png 300w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.28.30-768x474.png 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.28.30.png 1424w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>One minor issue: stepper drivers are usually controlled with two inputs, STEP (pulses to make the motor move) and DIR (to choose which direction the step pulses should make the motor move, clockwise or counterclockwise). The stepper drivers in this robot are different; they have two step inputs &#8211; one for each direction, CW and CCW. I&#8217;ve got a number of interface boards I can use to connect a computer to stepper drivers, but none can handle this setup. Not the end of the world; for simplicity and speed I grabbed an Arduino Nano and wrote a tiny program to convert between them. Plug STEP and DIR signals in one side, and get CW and CCW pulses out the other. That&#8217;s it sitting on a huge prototyping board, top left:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1703\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.25.30.png\" alt=\"\" width=\"800\" height=\"527\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.25.30.png 800w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.25.30-300x198.png 300w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/Screenshot-2022-08-15-at-08.25.30-768x506.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>Ended up making a tiny version I could fit neatly, but never got a picture.<\/p>\n<h4>Power<\/h4>\n<p>The robot has a fairly decent PSU in it, providing 24V for the motors, 5V and 12V for other bits and pieces. Most of the outputs are switched off by default, as the robot&#8217;s controller would only switch everything on if it deemed all was good, none of the safety cutouts had been tripped. Now I&#8217;d ripped out the controller, the PSU needed a naughty bypass fitting so it&#8217;d turn on properly. Fancy way of saying &#8220;connect the two end pins on this connector if you want everything to switch on&#8221;:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1688\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6719-768x1024.jpg\" alt=\"\" width=\"768\" height=\"1024\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6719-768x1024.jpg 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6719-225x300.jpg 225w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6719-1152x1536.jpg 1152w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6719-scaled.jpg 1200w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>First run<\/h4>\n<p>OK &#8211; motors now worked, and with a bit of faffing about I got the various sensors hooked up too, so we can tell when an axis is about to hit its end stop. I should be able to get the robot to move, now, but it needed one more thing: a tool. I&#8217;d got an old spindle motor (drill, basically), so I mounted it to a bit of Acetal and stuck it on the robot&#8217;s Z axis. Time to hook it up to a computer and try making it move&#8230; I grabbed an old tablet PC and installed Mach 3 on it (CNC software), connected the USB cable, powered it up, and loaded an old PCB design. After a bit of tweaking of speeds:<\/p>\n<div style=\"width: 1080px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1684-1\" width=\"1080\" height=\"608\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6764.mp4?_=1\" \/><a href=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6764.mp4\">https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6764.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p>Not bad for a first attempt:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1692\" src=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6770-953x1024.jpg\" alt=\"\" width=\"953\" height=\"1024\" srcset=\"https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6770-953x1024.jpg 953w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6770-279x300.jpg 279w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6770-768x825.jpg 768w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6770-1430x1536.jpg 1430w, https:\/\/howiem.org\/wordpress\/wp-content\/uploads\/2022\/08\/IMG_6770-scaled.jpg 1489w\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A friend gave me an old industrial robot the other week. Yay! OK, &#8220;robot&#8221; sounds fancy. It&#8217;s a cartesian robot, just a posh name for summat that can move in&#8230;<\/p>\n","protected":false},"author":2,"featured_media":1711,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":{"0":"post-1684","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-electronics-and-hackery"},"_links":{"self":[{"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/posts\/1684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/comments?post=1684"}],"version-history":[{"count":6,"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/posts\/1684\/revisions"}],"predecessor-version":[{"id":1715,"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/posts\/1684\/revisions\/1715"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/media\/1711"}],"wp:attachment":[{"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/media?parent=1684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/categories?post=1684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howiem.org\/wordpress\/wp-json\/wp\/v2\/tags?post=1684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}