{"id":352,"date":"2014-10-08T14:13:35","date_gmt":"2014-10-08T04:13:35","guid":{"rendered":"https:\/\/mindbleach.com\/words\/?p=352"},"modified":"2019-03-02T04:21:48","modified_gmt":"2019-03-02T04:21:48","slug":"mechanical-logic","status":"publish","type":"post","link":"https:\/\/mindbleach.com\/words\/2014\/10\/08\/mechanical-logic\/","title":{"rendered":"Springless Reversible Mechanical Logic"},"content":{"rendered":"<p>Logic gates! The building blocks of computing as we know it. What if we ditch the electrons?<\/p>\n<p>I want some mechanical logic for an upcoming project, so I did some research&#8230;<\/p>\n<h1>Research<\/h1>\n<p>There are several examples of mechanical logic out there on the internet:<\/p>\n<table>\n<thead>\n<tr>\n<th>Website<\/th>\n<th>Comments<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"http:\/\/keshavsaharia.com\/2011\/05\/29\/lego-logic\/\" target=\"_blank\" rel=\"noopener\">Keshav Saharia&#8217;s Lego Logic<\/a><\/td>\n<td>Push-pull, needs a spring return.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/randomwraith.com\/logic.html\" target=\"_blank\" rel=\"noopener\">Randomwraith&#8217;s Lego Logic<\/a><\/td>\n<td>Push-pull with internal rotating elements, reversible.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/mechalogic.wordpress.com\/2013\/01\/26\/build-18-lego-gates\/\" target=\"_blank\" rel=\"noopener\">Mechalogic&#8217;s Logic Elements<\/a><\/td>\n<td>Push-pull, AND &amp; NOT reversible, OR needs a spring return.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/xiaoji-chen.com\/blog\/2010\/the-linkage-computer\/\" target=\"_blank\" rel=\"noopener\">Xiaoji Chen&#8217;s Linkage Computer<\/a><\/td>\n<td>Rotating logic, reversible, some mechanical issues with parallelogram weakness.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/spillerrec.dk\/2012\/05\/xor-gate\/\" target=\"_blank\" rel=\"noopener\">Spillerrec&#8217;s Lego Logic Gates<\/a><\/td>\n<td>Push-pull, very compact, needs a spring return.<br \/>\nHe identifies the problem with needing springs, but doesn&#8217;t have a fix. Mentions how AND\/OR gates can be reversed to become OR\/AND gates.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/www.thingiverse.com\/thing:81221\" target=\"_blank\" rel=\"noopener\">Zeroumus&#8217;s AND Gate<\/a><\/td>\n<td>Push-pull, needs a spring return.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/hmongjob.com\/SU02YlhqaTVTUWc5\" target=\"_blank\" rel=\"noopener\">KNEX XOR Gate<\/a><\/td>\n<td>Push-pull, needs a spring return.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/www.niklasroy.com\/images\/mrnand.gif\">Carolin Liebl and Lisa Hopf&#8217;s NAND Gate<\/a><\/td>\n<td>Push-pull, reversible, complex.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>There are many more ideas out there, even <a href=\"http:\/\/www.64digits.com\/users\/index.php?userid=Cesque&amp;cmd=comments&amp;id=267350\" target=\"_blank\" rel=\"noopener\">water pipe logic<\/a>, and of course the early mechanical computers <a href=\"http:\/\/en.wikipedia.org\/wiki\/Digi-Comp_I\" target=\"_blank\" rel=\"noopener\">Digi-Comp I<\/a> and <a href=\"http:\/\/en.wikipedia.org\/wiki\/Digi-Comp_II\" target=\"_blank\" rel=\"noopener\">Digi-Comp II<\/a>.<\/p>\n<p>For my project, I have the following requirements;<\/p>\n<ul>\n<li>Push-pull logic<\/li>\n<li>Output movement range must equal input movement range<\/li>\n<li>No springs\/elastic bands, and no forces for inputs to overcome<\/li>\n<li>No gears!<\/li>\n<li>Easily chain-able, and simple enough to implement a score of them.<\/li>\n<\/ul>\n<p>This disqualifies most of the designs I found, particularly the &#8216;no springs&#8217; requirement.<\/p>\n<h1>AND Gate<\/h1>\n<p>Mechalogic&#8217;s AND gate design uses an elastic band, but doesn&#8217;t appear to need it, so it serves as a good starting point:<\/p>\n<p><a href=\"http:\/\/connorbrem.com\/images\/mech-logic-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-357\" src=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/mech-logic-21.png\" alt=\"Mechalogic 2-input AND Gate\" width=\"500\" height=\"333\" srcset=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/mech-logic-21.png 500w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/mech-logic-21-300x199.png 300w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/mech-logic-21-450x300.png 450w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>It&#8217;s time consuming to tweak parameters in the physical world, so I wrote a small simulation: (click to see in action)<\/p>\n<p><a href=\"https:\/\/mrtrick.github.io\/logic_gates\/and.html\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-353 size-full\" src=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/and.png\" alt=\"2-Input AND Gate\" width=\"502\" height=\"502\" srcset=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/and.png 502w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/and-150x150.png 150w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/and-300x300.png 300w\" sizes=\"(max-width: 502px) 100vw, 502px\" \/><\/a><\/p>\n<p>Success! Meets all the requirements, and only needs three parts.<\/p>\n<p>The geometry is important &#8211; the ratio will determine the output&#8217;s position when only one of the inputs is asserted, according to;<\/p>\n<ul>\n<li>distance between the inputs (red),<\/li>\n<li>length of the input links (green),<\/li>\n<li>length of the output link (teal)<\/li>\n<li>input displacement<\/li>\n<\/ul>\n<p>Now, can an OR gate be designed with the same success?<\/p>\n<h1>OR Gate<\/h1>\n<p>Most OR gates look like this; the output (on the left of this picture) has a flat plate, and either input will push the flat forward. Unfortunately the design needs that elastic band to return the output to zero.<a href=\"http:\/\/mechalogic.files.wordpress.com\/2013\/01\/photo-jan-26-2-57-46-pm.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-358\" src=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/photo-jan-26-2-57-46-pm1-1024x764.jpg\" alt=\"photo-jan-26-2-57-46-pm[1]\" width=\"584\" height=\"435\" srcset=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/photo-jan-26-2-57-46-pm1-1024x764.jpg 1024w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/photo-jan-26-2-57-46-pm1-300x224.jpg 300w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/photo-jan-26-2-57-46-pm1-401x300.jpg 401w\" sizes=\"(max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>Inspired by some earlier attempts to couple an AND and a backwards OR gate together, I tried flipping the AND gate around; (click to see in action)<\/p>\n<p><a href=\"https:\/\/mrtrick.github.io\/logic_gates\/or.html\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-353 size-full\" src=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/or.png\" alt=\"2-Input OR Gate\" width=\"502\" height=\"502\" \/><\/a><\/p>\n<p>Success! Oddly enough, an OR gate <strong>is just an AND gate connected up backwards<\/strong>.<br \/>\nEven the linkage lengths are the same!<br \/>\nBest of all, the OR gate is reversible like the AND gate &#8211; no springs and no force required.<\/p>\n<h1>AND Then?<\/h1>\n<p>As the graphs show, output displacement equals input displacement, so these designs should be chainable. Let&#8217;s have a look; (click to see in action)<\/p>\n<p><a href=\"https:\/\/mrtrick.github.io\/logic_gates\/and3.html\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-353 size-full\" src=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/and3.png\" alt=\"3-Input AND Gate\" width=\"1002\" height=\"502\" \/><\/a><\/p>\n<p><a href=\"https:\/\/mrtrick.github.io\/logic_gates\/or3.html\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-353 size-full\" src=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/or3.png\" alt=\"3-Input OR Gate\" width=\"1002\" height=\"502\" \/><\/a><\/p>\n<p>Success!<\/p>\n<p>Now I just have to build something complex with them&#8230;<\/p>\n<hr \/>\n<p>All the simulations are viewable <a href=\"https:\/\/mrtrick.github.io\/logic_gates\/\">here<\/a>.<br \/>\nThe code they&#8217;re written with is available on GitHub;<br \/>\n<a href=\"https:\/\/github.com\/MrTrick\/logic_gates\">https:\/\/github.com\/MrTrick\/logic_gates<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Logic gates! The building blocks of computing as we know it. What if we ditch the electrons? I want some mechanical logic for an upcoming project, so I did some research&#8230; Research There are several examples of mechanical logic out &hellip; <a href=\"https:\/\/mindbleach.com\/words\/2014\/10\/08\/mechanical-logic\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12,11],"tags":[62,61,63,65,64],"class_list":["post-352","post","type-post","status-publish","format-standard","hentry","category-craft","category-electronics","category-programming","tag-and-gate","tag-mechanical-logic","tag-or-gate","tag-processing","tag-processing-js"],"_links":{"self":[{"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/posts\/352"}],"collection":[{"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/comments?post=352"}],"version-history":[{"count":4,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/posts\/352\/revisions"}],"predecessor-version":[{"id":573,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/posts\/352\/revisions\/573"}],"wp:attachment":[{"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/media?parent=352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/categories?post=352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/tags?post=352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}