<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">>>
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 &
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;">> 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;">> To: dprglist@dprg.org</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> Subject: [DPRG] Balancing robot difficulties</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> Howdy,</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> Kenneth wrote:</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> > 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;">> <...></span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> such a motor? </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> Luke wrote:</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> <snip></span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> ; 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> Hmmm, what do you know? </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> 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;">> I worked with this code... ;)</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> 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;">> counts in either direction.</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> 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;">> 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;">> 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> // 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> #define BACKLASH 9</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> // backlash counter</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> int backlash;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> // 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> void quadencoder_interrupt()</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> // ...</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> // standard quad encoder interrupt stuff</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> // ...</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> if (backlash >= BACKLASH) encoder_count++;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> else backlash++;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> if (backlash <= 0) encoder_count--;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> else backlash--;</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> }</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> // ...</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> }</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> 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;">> 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;">> 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;">> 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;">> not.</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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;">> 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;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> best regards,</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> dpa</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> </span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> _______________________________________________</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> DPRGlist mailing list</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> DPRGlist@dprg.org</span><br style="font-family: Times New Roman,Times,Serif;"><span style="font-family: Times New Roman,Times,Serif;">> 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>