<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><div style="text-align: left; font-family: Times New Roman,Times,Serif;"><font size="3"><br></font>
                
                

<div id="MessageBodyText" class="ExternalClass"><meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass P
{padding:0px;}
.ExternalClass
{font-size:10pt;font-family:Tahoma;}
</style>


<p style="margin-bottom: 0cm;"><font style="font-size: 10pt;" size="3">Thanks
for all the feedback and suggestions last week regarding my balancing
robot.</font></p>
<p style="margin-bottom: 0cm;"><font size="3"><br></font>
</p>
<p style="margin-bottom: 0cm;"><font style="font-size: 10pt;" size="3">I've
just taken delivery of some very nice Pittman gearhead motors, which
I believe have the same gearbox as some other balancing bots I've
seen on the net. Certainly they ooze quality in a way that my
previous motors did not.</font></p>
<p style="margin-bottom: 0cm;"><font size="3"><br></font>
</p>
<p style="margin-bottom: 0cm;"><font size="3"><a name="SenderData"></a></font>
<font style="font-size: 10pt;" size="3">I'm
also in process of building new h-bridges with LMD18200's with the
intention of configuring them for </font><font style="font-size: 10pt;" size="3">locked
anti-phase PWM as </font><font size="3">Triffid Hunter </font><font style="font-size: 10pt;" size="3">suggested.</font></p>
<p style="margin-bottom: 0cm;"><font size="3"><br></font>
</p>
<pre style="margin-bottom: 0.5cm;"><font style="font-size: 10pt;" size="3">Dpa, would it be possible for you to give me a rough estimate of how much backlash there is in your balancing bots if you grab one of the wheels and twist it each way to take up any slack?</font></pre><p style="margin-bottom: 0cm;">
<font style="font-size: 10pt;" size="3">&gt;&gt;
Watching the new video suggests the frame might be bending.</font></p>
<p style="margin-bottom: 0cm;"><font size="3"><br></font>
</p>
<p style="margin-bottom: 0cm;"><font style="font-size: 10pt;" size="3">Thanks
for pointing this out – I've now stiffened the chassis to eliminate
this.</font></p>
<p style="margin-bottom: 0cm;"><font size="3"><br></font>
</p>
<p style="margin-bottom: 0cm;"><font size="3">I'll
post back when I have some results with the new motors &amp;
H-bridges.</font></p>
<p style="margin-bottom: 0cm;"><font size="3"><br></font>
</p>
<p style="margin-bottom: 0cm;"><font size="3">Thanks
again.</font></p>

<p style="margin-bottom: 0cm;"><font size="3"><br></font>
</p>
<p style="margin-bottom: 0cm;"><font size="3">Luke</font></p></div></div><font size="3"><br style="font-family: Times New Roman,Times,Serif;"><br style="font-family: Times New Roman,Times,Serif;"><br style="font-family: Times New Roman,Times,Serif;"></font><hr style="font-family: Times New Roman,Times,Serif; height: 3px;" id="stopSpelling"><font size="3"><span style="font-family: Times New Roman,Times,Serif;">&gt; From: dpa@io.isem.smu.edu</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; To: dprglist@dprg.org</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Date: Wed, 4 Jul 2007 00:19:44 -0500</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Subject: [DPRG] Balancing robot difficulties</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Howdy,</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Kenneth wrote:</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; &gt; Noted the comment on Harmonic drives. </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; &lt;...&gt;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Great link, thanks.  I'd not understood that the outer</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; gear is *flexible*.  Very interesting.  Where to get</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; such a motor?  </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Luke wrote:</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; &lt;snip&gt;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; I dug back through some code for the nBot balancing</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; robot and found the following comment:</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; ; 28 Jun 03 dpa         Added code to remove backlash</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Hmmm, what do you know?  </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; This was in the header of the assembly code that</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; handles the two quad encoders on the motors.</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; Looks like it tries to ignore the encoder ticks in a</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; sort of dead zone around zero that depends on which</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; direction the motor is going.  It's been awhile since</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; I worked with this code... ;)</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; The encoder is mounted on the motor itself so the</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; interrupt is ignoring counts that happen when the</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; motor changes directions and goes through 0, for 9</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; counts in either direction.</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; The file is HC11 assembly code so I tried to rewrite it</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; in C, as a fragment of the interrupt routine that</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; maintains the counts for the quad encoders mounted on</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; the drive motors.  There are actually two of these,</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; left and right, but only one is shown here:</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; //  measured backlash at the wheels == 9 ticks</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; #define BACKLASH 9</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; // backlash counter</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; int backlash;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; // quad encoder interrupt, maintains encoder count</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; void quadencoder_interrupt()</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;     // ...</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;     // standard quad encoder interrupt stuff</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;     // ...</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;     if (encoder tick direction is forward) {</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;         if (backlash &gt;= BACKLASH) encoder_count++;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;         else backlash++;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;     else { // encoder tick direction is backward</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;         if (backlash &lt;= 0) encoder_count--;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;         else backlash--;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;     }</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt;     // ...</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; }</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; So the wheel encoder count is not incremented/decremented during</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; the time in which the motor is taking up the backlash, as it passes</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; through zero.  This in turn prevents the balance algorithm from</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; reacting to the quick burst of counts as the motor, now unloaded,</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; winds the backlash in the opposite direction.  That looks to the</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; balance algorithm as it the robot has suddenly jerked when it has</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; not.</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; I still think this is a second order tweak that requires getting</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; as much mechanical backlash out of the system as possible first.</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; best regards,</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; dpa</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; _______________________________________________</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; DPRGlist mailing list</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; DPRGlist@dprg.org</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">&gt; http://list.dprg.org/mailman/listinfo/dprglist</span><br style="font-family: Times New Roman,Times,Serif;"></font><br /><hr />Play Movie Mash-up and win  <a href='https://www.moviemashup.co.uk' target='_new'>BIG prizes! </a></body>
</html>