<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><div style="text-align: left;">
<p style="margin-bottom: 0cm;">Hello,</p>

<p style="margin-bottom: 0cm;">A while back I came across Trevor
Blackwell's DIY segway efforts, and through his site David Anderson's
nbot., and I was immediately gripped by the urge to build my own
balancing robot. But I've run into some difficulties, and I'm hoping someone reading this will be able to help...<br></p>

<p style="margin-bottom: 0cm;">My initial prototype consisted of a
sheet of wood with a potentiometer-based tilt sensor. Two Futaba
servos modified for continuous rotation and bolted on provided
movement, and variable speed was achieved by PWMing the servos close
to their null value. Surprisingly (in hindsight) I was able to
quickly get this set up balancing pretty successfully. But the
limited speed of the servos meant it couldn't recover from anything
more than a gentle disturbance - me prodding it - and driving speed
was very low. So the next step was to upgrade to more powerful DC
motors. Currently I'm using two Tamiya gearbox motors, which
according to the specs do ~200 rpm unloaded at 7.2 V (I'm giving them
~8V). These are powered through two Bob Blick designed H-bridges
(<a href="http://www.bobblick.com/techref/projects/hbridge/hbridge.html">www.bobblick.com/techref/projects/hbridge/hbridge.html</a>),
which are PWMed from my microprocessor, a pic16f877A running at
20Mhz. Motor speed is detected using two Hamamatsu encoders (using
the setup described at
<a href="http://www.geology.smu.edu/%7Edpa-www/robo/Encoder/pitt_html/encoders.html">www.geology.smu.edu/~dpa-www/robo/Encoder/pitt_html/encoders.html</a>),
and controlled by a PD loop using code also modeled after David
Anderson's. 
</p>

<p style="margin-bottom: 0cm;">So what's the problem? Although it does
balance, it does so in quite an agitated fashion, making small but
rapid oscillations around the balancing point. And it has great
difficulty in recovering from outside disturbances (me pushing it).
This is in great contrast to the my first servo-based robot, which
balanced very convincingly, within the speed limitations of the
servos.</p>

<p style="margin-bottom: 0cm;">Here's Flash movie of the original
servo robot: <a href="http://www.allthatjazzagency.co.uk/robot/18-04-06_2312.swf">www.allthatjazzagency.co.uk/robot/18-04-06_2312.swf</a>
(Sorry, it was shot in portrait on my mobile, so you'll have to turn
you head to view it)</p>

<p style="margin-bottom: 0cm;">And here's the new robot:
www.allthatjazzagency.co.uk/robot/balance.swf</p>

<p style="margin-bottom: 0cm;">I've also got a plot of the motor
controller behaviour here: allthatjazzagency.co.uk/robot/motorcontrollerplot.gif</p>

<p style="margin-bottom: 0cm;">I've got a few ideas about where the
problem(s) lie, but I don't know which is the real culprit. And I've
got about as far as I can in addressing the individual problems.
Anyway, here are my ideas:</p>

<ol><li><p style="margin-bottom: 0cm;">Backlash in the
        gearbox/transmission. When unpowered the motor shaft is free to
        rotate 2 or 3 degrees. This is really noticeable if I hold one of
        the wheels stationary while moving the robot to and fro. This is
        also the most apparent difference between the current and the old
        version, where the servos exhibited almost no backlash (a fraction
        of a degree at most). Are the motors I'm using simply inappropriate
        to the task, or is there a means of overcoming the backlash?</p>
        </li><li><p style="margin-bottom: 0cm;">Some short-coming of my motor
        control. From the graphs I've plotted of requested versus actual
        motor speed it seems to me that this is working reasonably well, but
        I don't really have a basis for comparison, so it may be that this
        is a contributing factor. The Blick H-bridges are in 'floating' as
        opposed to 'locked rotor' mode — I don't know the difference
        between these modes in practical terms, or whether it's relevant.
        Incidentally, both the motor control and balance PD loops are
        running at 40Hz. 
        </p>
        </li><li><p style="margin-bottom: 0cm;">Poorly calibrated PD loop: I'd
        guess this isn't the explanation, simply because I've spent a lot of
        time playing with my proportional and derivative constants, and it
        the robot's balancing behaviour never gets beyond what I've
        described. Furthermore I found it quite easy to get the PD loop for
        the servo based robot to produce balancing behaviour. Oh yes, it's a PD loop not a PID loop.<br></p>
</li></ol>

<p style="margin-bottom: 0cm;">I'd really appreciate any input or
advice into how to proceed. If anyone want any more info about any
aspect of the setup please let me know.</p>

<p style="margin-bottom: 0cm;">Thanks in advance.</p>

<p style="margin-bottom: 0cm;">Luke Steele</p>
</div><br /><hr />Play Movie Mash-up and win  <a href='https://www.moviemashup.co.uk' target='_new'>BIG prizes! </a></body>
</html>