<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta name="generator" content="Movable Type 3.2" />

   <link rel="stylesheet" href="styles-site.css" type="text/css" />
   <link rel="alternate" type="application/atom+xml" title="Atom" href="atom.xml" />
   <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="index.xml" />

   <title>Double Down: 5 - Computation Archives</title>
</head>
<body class="layout-one-column">
   <div id="container">
      <div id="container-inner" class="pkg">

         <div id="banner">
            <div id="banner-inner" class="pkg">
               <h1 id="banner-header"><a href="index.html" accesskey="1">Double Down</a></h1>
               <h2 id="banner-description">An automated card-dealer</h2>
            </div>
         </div>

         <div id="pagebody">
            <div id="pagebody-inner" class="pkg">
               <div id="alpha">
                  <div id="alpha-inner" class="pkg">
                     
                     <p class="content-nav">
                        <a href="index.html">Main</a>
                     </p>
                     
                                          <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
    rdf:about="http://doublecounter.com/doubledown/5_computation.html#001080"
    trackback:ping="http://thespork.net/mt-tb.cgi/1080"
    dc:title="Computation"
    dc:identifier="http://doublecounter.com/doubledown/5_computation.html#001080"
    dc:subject="5 - Computation"
    dc:description="Computation was taken care of by our PC/104 stack. This device was a computer on its own and ran all out simulink processes on it. The simulink file is here. There are no embedded matlab functions present anywhere within our..."
    dc:creator="John"
    dc:date="2006-03-16T07:27:07-06:00" />
</rdf:RDF>
-->


                     <h2 class="date-header">March 16, 2006</h2>
                     <a id="a001080"></a>
                     <div class="entry" id="entry-1080">
                        <h3 class="entry-header">Computation</h3>
                        <div class="entry-content">
                           <div class="entry-body">
                              <p>Computation was taken care of by our PC/104 stack.  This device was a computer on its own and ran all out simulink processes on it.  The simulink file is <a href="/team11.mlb">here</a>.  There are no embedded matlab functions present anywhere within our simulink file.</p>

<p><a href="simu_main.html" onclick="window.open('simu_main.html','popup','width=995,height=740,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="simu_main.gif" src="simu_main.gif" width="199" height="148" /></a></p>

<p>The model begins by storing a state variable to keep track of the present dealing positions.  Feeding this into the state machine, it can grab out what dealing positions it wants and create motor control signals from that.  The subsystems within the top level include the state machine, the motor control, and the motor steady test.</p>
                              
                              <p class="entry-footer">
                                 <span class="post-footers">Posted by John Hanauer at 07:27 AM</span> <span class="separator">|</span> <a class="permalink" href="http://doublecounter.com/doubledown/2006_03_computation_1.html">Permalink</a>
                                 
                                 
                              </p>
                           </div>
                        </div>
                     </div>
                                          <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
    rdf:about="http://doublecounter.com/doubledown/5_computation.html#001084"
    trackback:ping="http://thespork.net/mt-tb.cgi/1084"
    dc:title="State Machine"
    dc:identifier="http://doublecounter.com/doubledown/5_computation.html#001084"
    dc:subject="5 - Computation"
    dc:description=" The state machine was implimented using what simulink calls a &quot;multiport switch&quot; as a ROM table. By inputing the present value of the state variable, the program indexed and addressed the current variables it needed to deal the card..."
    dc:creator="John"
    dc:date="2006-03-15T08:35:35-06:00" />
</rdf:RDF>
-->


                     <h2 class="date-header">March 15, 2006</h2>
                     <a id="a001084"></a>
                     <div class="entry" id="entry-1084">
                        <h3 class="entry-header">State Machine</h3>
                        <div class="entry-content">
                           <div class="entry-body">
                              <p><a href="simu_state_machine.html" onclick="window.open('simu_state_machine.html','popup','width=613,height=638,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="simu_state_machine.gif" src="simu_state_machine.gif" width="153" height="160" /></a></p>

<p>The state machine was implimented using what simulink calls a "multiport switch" as a ROM table.  By inputing the present value of the state variable, the program indexed and addressed the current variables it needed to deal the card ot the right position.  The variables it used included Left(0) or Right(1), Card Position (positive or negative integer based on starrtup position being 0), Whether to wait for the PushButton or the Motors to settle, and what the next state would be.</p>
                              
                              <p class="entry-footer">
                                 <span class="post-footers">Posted by John Hanauer at 08:35 AM</span> <span class="separator">|</span> <a class="permalink" href="http://doublecounter.com/doubledown/2006_03_state_machine_1.html">Permalink</a>
                                 
                                 
                              </p>
                           </div>
                        </div>
                     </div>
                                          <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
    rdf:about="http://doublecounter.com/doubledown/5_computation.html#001083"
    trackback:ping="http://thespork.net/mt-tb.cgi/1083"
    dc:title="State Machine"
    dc:identifier="http://doublecounter.com/doubledown/5_computation.html#001083"
    dc:subject="5 - Computation"
    dc:description=""
    dc:creator="John"
    dc:date="2006-03-15T08:34:37-06:00" />
</rdf:RDF>
-->


                     
                     <a id="a001083"></a>
                     <div class="entry" id="entry-1083">
                        <h3 class="entry-header">State Machine</h3>
                        <div class="entry-content">
                           <div class="entry-body">
                              <p><a href="simu_state_machine.html" onclick="window.open('simu_state_machine.html','popup','width=613,height=638,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="simu_state_machine.gif" src="simu_state_machine.gif" width="153" height="160" /></a></p>
                              
                              <p class="entry-footer">
                                 <span class="post-footers">Posted by John Hanauer at 08:34 AM</span> <span class="separator">|</span> <a class="permalink" href="http://doublecounter.com/doubledown/2006_03_state_machine.html">Permalink</a>
                                 
                                 
                              </p>
                           </div>
                        </div>
                     </div>
                                          <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
    rdf:about="http://doublecounter.com/doubledown/5_computation.html#001085"
    trackback:ping="http://thespork.net/mt-tb.cgi/1085"
    dc:title="Motor Control"
    dc:identifier="http://doublecounter.com/doubledown/5_computation.html#001085"
    dc:subject="5 - Computation"
    dc:description=" Using simulink, the motors were controlled via PID compensators. The Kp gain was 100, the Kd gain was 5, and the Ki gain was set to zero...."
    dc:creator="John"
    dc:date="2006-03-14T08:38:37-06:00" />
</rdf:RDF>
-->


                     <h2 class="date-header">March 14, 2006</h2>
                     <a id="a001085"></a>
                     <div class="entry" id="entry-1085">
                        <h3 class="entry-header">Motor Control</h3>
                        <div class="entry-content">
                           <div class="entry-body">
                              <p><a href="simu_motors.html" onclick="window.open('simu_motors.html','popup','width=803,height=325,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="simu_motors.gif" src="simu_motors.gif" width="400" height="260" /></a></p>

<p>Using simulink, the motors were controlled via PID compensators.  The Kp gain was 100, the Kd gain was 5, and the Ki gain was set to zero.</p>
                              
                              <p class="entry-footer">
                                 <span class="post-footers">Posted by John Hanauer at 08:38 AM</span> <span class="separator">|</span> <a class="permalink" href="http://doublecounter.com/doubledown/2006_03_motor_control.html">Permalink</a>
                                 
                                 
                              </p>
                           </div>
                        </div>
                     </div>
                                          <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
    rdf:about="http://doublecounter.com/doubledown/5_computation.html#001086"
    trackback:ping="http://thespork.net/mt-tb.cgi/1086"
    dc:title="Motor Steady Check"
    dc:identifier="http://doublecounter.com/doubledown/5_computation.html#001086"
    dc:subject="5 - Computation"
    dc:description=" The motor steady check would output a true signal if the motor was within a certain error tolerance (set by a constant) for the last half second (also changeable by a constant). It would use an incremental counter multiplied..."
    dc:creator="John"
    dc:date="2006-03-13T08:43:54-06:00" />
</rdf:RDF>
-->


                     <h2 class="date-header">March 13, 2006</h2>
                     <a id="a001086"></a>
                     <div class="entry" id="entry-1086">
                        <h3 class="entry-header">Motor Steady Check</h3>
                        <div class="entry-content">
                           <div class="entry-body">
                              <p><a href="simu_motor_steady.html" onclick="window.open('simu_motor_steady.html','popup','width=838,height=379,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="simu_motor_steady.gif" src="simu_motor_steady.gif" width="420" height="190" /></a></p>

<p>The motor steady check would output a true signal if the motor was within a certain error tolerance (set by a constant) for the last half second (also changeable by a constant).  It would use an incremental counter multiplied by appropriate gains to convert to seconds, but essentially would carry out the following equation:</p>

<p>Counts = (Within_Tolerance*(Not Stable) + Counts)*Within_Tolerance</p>

<p>This way, counts would increment by Within_Tolerance each dt, and since Within_Tolerance only holds zero or one, it would either increment, or become zero, thus multiplying the whole sum by zero and starting over.  Also, but multiplying Within_Tolerance by the opposite of Stable, once the motors did become stable the counter could stop thus preventing overflow.</p>
                              
                              <p class="entry-footer">
                                 <span class="post-footers">Posted by John Hanauer at 08:43 AM</span> <span class="separator">|</span> <a class="permalink" href="http://doublecounter.com/doubledown/2006_03_motor_steady_check.html">Permalink</a>
                                 
                                 
                              </p>
                           </div>
                        </div>
                     </div>
                     
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
</body>
</html>

