{"id":361,"date":"2014-10-13T13:59:18","date_gmt":"2014-10-13T03:59:18","guid":{"rendered":"https:\/\/mindbleach.com\/words\/?p=361"},"modified":"2014-10-14T18:24:29","modified_gmt":"2014-10-14T08:24:29","slug":"logic_gate_linkages","status":"publish","type":"post","link":"https:\/\/mindbleach.com\/words\/2014\/10\/13\/logic_gate_linkages\/","title":{"rendered":"Logic Gate Linkage Calculations"},"content":{"rendered":"<p>In my <a title=\"Springless Reversible Mechanical Logic\" href=\"https:\/\/mindbleach.com\/words\/mechanical-logic\/\">previous post<\/a>, I simulated some mechanical logic gates using a novel 3-bar linkage.<br \/>\nThe dimensions of the linkage are critical to achieving correct operation;<\/p>\n<blockquote><p>Inputs \\(\\{ false\\ false \\}\\), \\(\\{ false\\ true \\}\\), \\(\\{ true\\ false \\}\\) must all produce the same output position.<\/p><\/blockquote>\n<p>For the simulations, an empirical approach was used. (fiddle with the values until it looks right)<\/p>\n<p>This time, I&#8217;m going to attempt to find the <strong>exact<\/strong> values to use for a given stroke, separation distance and output position.<\/p>\n<p><a href=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/analysis.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-423\" src=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/analysis.png\" alt=\"analysis\" width=\"474\" height=\"402\" srcset=\"https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/analysis.png 474w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/analysis-300x254.png 300w, https:\/\/mindbleach.com\/words\/wp-content\/uploads\/2014\/10\/analysis-353x300.png 353w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><br \/>\nHere, you can see the linkage layout for \\(\\{ false\\ false \\}\\) and \\(\\{ true\\ false \\}\\)<\/p>\n<h1>Mathematics<\/h1>\n<p>Ahead lurks tough mathematics (which may be unsuitable for liberal-arts majors)<br \/>\nIf it&#8217;s hard to read, then sorry! It was hard to write!<\/p>\n<h2>Parameters<\/h2>\n<ul>\n<li>\\(2 sep\\) Separation between inputs<\/li>\n<li>\\(2 str\\) Stroke length \\(false \\to true\\)<\/li>\n<li>\\(d_i\\) Input link length<\/li>\n<li>\\(d_o\\) Output link length<\/li>\n<\/ul>\n<h2>Geometry<\/h2>\n<ul>\n<li>\\(A(x_a, y_a) = A(0, sep)\\) is the input position when \\(A_{state}=false\\)<\/li>\n<li>\\(A'(x_a&#8217;, y_a&#8217;) = A'(2*str, sep)\\) is the input position when \\(A_{state}=true\\)<\/li>\n<li>\\(B(x_b, y_b) = B(0,-sep)\\) is the input position (The system is symmetric, \\(B&#8217;\\) does not need to be tested.)<\/li>\n<li>\\(M(x_m, y_m)\\) is the middle position when \\(A_{state}=false\\)<\/li>\n<li>\\(M'(x_m&#8217;, y_m&#8217;)\\) is the middle position when \\(A_{state}=true\\)<\/li>\n<li>\\(O(x_o, y_o)\\) is the output position. (\\(O \\equiv O&#8217;\\) for the gate to function correctly.<\/li>\n<\/ul>\n<h2>Solving<\/h2>\n<h3>Finding \\(M\\):<\/h3>\n\\(<br \/>\nM(x_m, y_m) = M( \\sqrt{d_i^2 &#8211; sep^2}, 0)\\\\<br \/>\n\\)\n<h3>Finding \\(O\\):<\/h3>\n\\(<br \/>\n\\begin{align}<br \/>\nO(x_o, y_o) &amp;= O( x_m + d_o, 0 )\\\\<br \/>\n&amp; = O( \\sqrt{d_i^2 &#8211; sep^2} + d_o, 0)<br \/>\n\\end{align}<br \/>\n\\)\n<h3>Finding \\(M&#8217;\\):<\/h3>\n<ul>\n<li>\\(C'(x_c&#8217;, y_c&#8217;)\\) is the midpoint of \\(BA&#8217;\\)<\/li>\n<li>\\(b\\) is the length of the line \\(BC&#8217;\\)<\/li>\n<li>\\(h\\) is the length of the line \\(C&#8217;M&#8217;\\)<\/li>\n<\/ul>\n\\(<br \/>\n\\begin{align}<br \/>\nx_c&#8217; &amp;= (x_a&#8217; + x_b)\/2 \\\\ &amp;= str\\\\<br \/>\ny_c&#8217; &amp;= (y_a&#8217; + y_b)\/2 \\\\ &amp;= 0\\\\<br \/>\nb &amp;= \\sqrt{ sep^2 + str^2 }\\\\<br \/>\nh &amp;= \\sqrt{ d_i^2 &#8211; b^2 } &amp;&amp; Because BC&#8217; \\bot C&#8217;M&#8217;\\\\<br \/>\n&amp;= \\sqrt{ d_i^2 &#8211; sep^2 &#8211; str^2 }\\\\<br \/>\n\\end{align}\\\\<br \/>\n\\)\n<p>Using this, we can calculate M&#8217;:<br \/>\n\\(<br \/>\n\\begin{align}<br \/>\n\\frac{h}{b} &amp;= \\frac{\\sqrt{ d_i^2 &#8211; sep^2 &#8211; str^2 }}{\\sqrt{ sep^2 + str^2 }} \\\\<br \/>\n&amp;= \\sqrt{\\frac{ d_i^2 &#8211; sep^2 &#8211; str^2 }{ sep^2 + str^2 }} \\\\<br \/>\n&amp;= \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1}\\\\<br \/>\n\\\\<br \/>\nx_m&#8217; &amp;= x_c&#8217;\\ &#8211; ( y_c&#8217; &#8211; y_b)\\frac{h}{b}\\\\<br \/>\n&amp;= str &#8211; \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1}<br \/>\n\\\\<br \/>\ny_m&#8217; &amp;= y_c&#8217; + ( x_c&#8217; &#8211; x_b)\\frac{h}{b}\\\\<br \/>\n&amp;= str \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1}<br \/>\n\\end{align}\\\\<br \/>\n\\)<\/p>\n<h3>Finding \\(O&#8217;\\):<\/h3>\n\\(<br \/>\n\\begin{align}<br \/>\nx_o&#8217; &amp;= x_m&#8217; + \\sqrt{ d_o^2 &#8211; y_m&#8217;^2 }\\\\<br \/>\n&amp;= ( str &#8211; \\sqrt{\\frac{ d_i^2 }{sep^2 + str^2} &#8211; 1}) + \\sqrt{ d_o^2 &#8211; ( str \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1} )^2 }\\\\<br \/>\n&amp;= str &#8211; \\sqrt{\\frac{ d_i^2 }{sep^2 + str^2} &#8211; 1} + \\sqrt{ d_o^2 &#8211; str^2 (\\frac{d_i^2}{sep^2 + str^2} &#8211; 1) }\\\\<br \/>\ny_o&#8217; &amp;= 0<br \/>\n\\end{align} \\\\<br \/>\n\\)\n<h2>And then:<\/h2>\n<p>Now that \\(O\\) and \\(O&#8217;\\) are found, and we know \\(O \\equiv O&#8217;\\)&#8230;<\/p>\n<h3>Finding the \\(x_o&#8217;\\) equation in terms of \\(d_o^2\\):<\/h3>\n\\(<br \/>\n\\begin{align}<br \/>\nx_o&#8217; &amp;= x_m&#8217; + \\sqrt{ d_o^2 &#8211; y_m&#8217;^2 }\\\\<br \/>\nd_o^2 &#8211; y_m&#8217;^2 &amp;= (x_o&#8217; &#8211; x_m&#8217;)^2 \\\\<br \/>\nd_o^2 &#8211; str^2 (\\frac{d_i^2}{sep^2 + str^2} &#8211; 1) &amp;= (x_o&#8217; &#8211; str + \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1})^2 \\\\<br \/>\nd_o^2 &amp;= \\left( x_o&#8217; &#8211; str + \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1} \\right)^2 + str^2 (\\frac{d_i^2}{sep^2 + str^2} &#8211; 1) \\\\<br \/>\n\\end{align}<br \/>\n\\)\n<h3>Substituting back into the \\(x_o\\) equation:<\/h3>\n<p>\\(<br \/>\n\\begin{align}<br \/>\nx_o &amp;= \\sqrt{d_i^2 &#8211; sep^2} + d_o \\\\<br \/>\nx_o &#8211; \\sqrt{d_i^2 &#8211; sep^2} &amp;= d_o \\\\<br \/>\n( x_o &#8211; \\sqrt{d_i^2 &#8211; sep^2} )^2 &amp;= d_o^2 \\\\<br \/>\n( x_o &#8211; \\sqrt{d_i^2 &#8211; sep^2} )^2 &amp;= \\left( x_o&#8217; &#8211; str + \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1} \\right)^2 + str^2 (\\frac{d_i^2}{sep^2 + str^2} &#8211; 1)<br \/>\n\\end{align}<br \/>\n\\)<br \/>\nUgly, but workable?<\/p>\n<h1>Example:<\/h1>\n<ul>\n<li>\\(sep = 50\\) Separation between inputs \\(100 mm\\)<\/li>\n<li>\\(str = 20\\) Stroke length \\(false \\to true: 40 mm\\)<\/li>\n<li>\\(d_i = ?\\) Input link length<\/li>\n<li>\\(d_o = ?\\) Output link length<\/li>\n<li>\\(x_o = x_o&#8217; = 70\\) Desired output position<\/li>\n<\/ul>\n<p>\\(<br \/>\n\\begin{align}<br \/>\n( x_o &#8211; \\sqrt{d_i^2 &#8211; sep^2} )^2 &amp;= \\left( x_o&#8217; &#8211; str + \\sqrt{\\frac{d_i^2}{sep^2 + str^2} &#8211; 1} \\right)^2 + str^2 (\\frac{d_i^2}{sep^2 + str^2} &#8211; 1) \\\\<br \/>\n( 70 &#8211; \\sqrt{d_i^2 &#8211; 50^2} )^2 &amp;= \\left( 70 &#8211; 20 + \\sqrt{\\frac{d_i^2}{50^2 + 20^2} &#8211; 1} \\right)^2 + 20^2 (\\frac{d_i^2}{50^2 + 20^2} &#8211; 1) \\\\<br \/>\n\\end{align} \\\\<br \/>\n\\)<br \/>\nPushed through Wolfram Alpha&#8230;<br \/>\n\\(<br \/>\n\\begin{align} \\\\<br \/>\nd_i &amp;= \\sqrt{2900} \\\\<br \/>\n&amp;= 53.852\\\\<br \/>\n\\text{and}\\\\<br \/>\nd_o &amp;= x_o &#8211; \\sqrt{d_i^2 &#8211; sep^2} \\\\<br \/>\n&amp;= 70 &#8211; \\sqrt{ 2900 &#8211; 2500 } \\\\<br \/>\n&amp;= 50<br \/>\n\\end{align}<br \/>\n\\)<\/p>\n<h1>Summary:<\/h1>\n<p>Phew!<\/p>\n<p>Thusly, one can calculate the input and output linkage lengths for any logic gate.<br \/>\nThese dimensions will work for an OR gate too, as the linkages are just reversed.<\/p>\n<p>It&#8217;s irksome that I couldn&#8217;t work out a symbolic solution for the last equations, especially since \\(d_i\\) in the example came out to such a neat value. <\/p>\n<p>I might revisit this further in the future, and it&#8217;ll definitely come in handy when building something with these gates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post, I simulated some mechanical logic gates using a novel 3-bar linkage. The dimensions of the linkage are critical to achieving correct operation; Inputs , , must all produce the same output position. For the simulations, an &hellip; <a href=\"https:\/\/mindbleach.com\/words\/2014\/10\/13\/logic_gate_linkages\/\">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":[4,12,11,1],"tags":[68,67,66,61],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-diy","category-electronics","category-programming","category-uncategorized","tag-linkage","tag-logic-gate","tag-maths","tag-mechanical-logic"],"_links":{"self":[{"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/posts\/361"}],"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=361"}],"version-history":[{"count":11,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":383,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/posts\/361\/revisions\/383"}],"wp:attachment":[{"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mindbleach.com\/words\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}