<?xml version="1.0"?>
<rss version="2.0.">
  <channel>
    <title>robots.net blog for dwhall</title>
    <link>http://robots.net/person/dwhall/</link>
    <description>robots.net blog for dwhall</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Fri, 8 Aug 2008 18:42:17 GMT</pubDate>
    <item>
      <pubDate>Sat, 17 Nov 2007 15:33:51 GMT</pubDate>
      <title>17 Nov 2007</title>
      <link>http://robots.net/person/dwhall/diary.html?start=8</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=8</guid>
      <description>I need a wireless data connection for my next bot, Argonaut.  &#xD;
I am choosing Zigbee, specifically the Series 2 module from &#xD;
MaxStream (now Digi).  The modules arrived from Digikey, but &#xD;
I'm still waiting on the carrier boards.  I'll detail my work &#xD;
with Zigbee as it progress &lt;a href="http://deanandara.com/Argonaut/Sensors/Zigbee/" &gt;here&lt;/a&gt;&#xD;
.</description>
    </item>
    <item>
      <pubDate>Wed, 1 Aug 2007 18:52:28 GMT</pubDate>
      <title>1 Aug 2007</title>
      <link>http://robots.net/person/dwhall/diary.html?start=7</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=7</guid>
      <description>Instead of the USBasp, me and the &lt;a href="http://&#xD;
www.sharpbots.com/" &gt;SHARP&lt;/a&gt; guys have made our own &#xD;
version of the &lt;a href="http://www.embedded-projects.net/&#xD;
index.php?page_id=165" &gt;UsbProg&lt;/a&gt;.  We call it, oh so &#xD;
cleverly, &lt;a href="http://www.deanandara.com/&#xD;
UsbProgSharp/" &gt;UsbProg-SHARP&lt;/a&gt;.  It works like a charm.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; I also reworked my website so I edit reStructured text &#xD;
files, &#xD;
use a Makefile to build the static pages and rsync to upload &#xD;
to my web host.  I wrote up some &lt;a href="http://&#xD;
www.deanandara.com/ThisWebsite.html" &gt;details on how I did it &#xD;
&lt;/a&gt;.</description>
    </item>
    <item>
      <pubDate>Fri, 8 Jun 2007 19:21:22 GMT</pubDate>
      <title>8 Jun 2007</title>
      <link>http://robots.net/person/dwhall/diary.html?start=6</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=6</guid>
      <description>I designed the &lt;a href="http://deanandara.com/&#xD;
mmb103.html" &gt;MMB103&lt;/a&gt; that I am using for my controller &#xD;
board to have an Atmel-standard 6-pin ISP header as well as &#xD;
a &lt;a href="http://www.lancos.com/siprogsch.html" &gt;PonyProg &#xD;
serial interface&lt;/a&gt;.  I had been using the PonyProg &#xD;
interface with its software on a Win32 system for years.  I &#xD;
lived with the 7 minute programming time (for 128 KiB Flash &#xD;
on the ATmega103).  Even after I switched to a PowerBook in &#xD;
2003, I would always borrow my wife's Dell to burn my chips.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; Well, I finally got fed up with the long waits to test &#xD;
my &#xD;
code.  I got an STK500 from Digikey.  I got the package deal &#xD;
where the STK500 comes with the JTAG ICE MkII.  I connected &#xD;
my Mac to the STK500 via a USB-to-serial adapter.  I set &#xD;
"AVRDUDE_PORT = /dev/tty.KeySerial1" in my Makefile.  I &#xD;
typed "make program" and BOOM!  My programming time went &#xD;
from 7 minutes to less than 20 seconds.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; This is SUCH an improvement in quality-of-robot-&#xD;
programming-&#xD;
life that it was well worth the money.  Next I intend to &#xD;
find something smaller than the STK500 so it is portable.  &#xD;
Hopefully I can also find something that is all-in-one, so I  &#xD;
don't have to use a USB-to-serial converter and can use &#xD;
power from the USB port.&#xD;
&#xD;
&lt;p&gt; &lt;p&gt; &lt;b&gt; Follow up&lt;/b&gt; (2007/06/13): I plan to make my own &#xD;
version of the &lt;a href="http://www.fischl.de/&#xD;
usbasp/" &gt;USBasp&lt;/a&gt; for my portable, USB programmer.  I &#xD;
might even etch the PCB with the help of my club-mates at &lt;a href="http://www.sharpbots.com/" &gt;SHARP&lt;/a&gt;.&#xD;
&#xD;
</description>
    </item>
    <item>
      <pubDate>Sun, 3 Jun 2007 03:07:55 GMT</pubDate>
      <title>3 Jun 2007</title>
      <link>http://robots.net/person/dwhall/diary.html?start=5</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=5</guid>
      <description>&lt;p&gt;I was recreating my encoder measurement set-up on my &#xD;
breadboard, but having significant trouble.  I was just &#xD;
sticking copper wires into the motor ribbon connector.  &#xD;
These wires were shaking loose and not giving good &#xD;
connections.  I swapped-in some 2x and 1x headers and some &#xD;
&lt;a href="http://www.seetron.co" &gt;Connectamundos&lt;/a&gt; and had a &#xD;
much more reliable connection.  However, I still wasn't &#xD;
getting good numbers from my test software.  It took me &#xD;
about 30 minutes to realize I had a floating ground between &#xD;
my MMB103 board and my breadboard.  Once I connect their 2 &#xD;
ground planes, I was back in business.&#xD;
&#xD;
&lt;"&gt;&#xD;
With this better test setup, I am finding that the encoders &#xD;
aren't that reliable.  Supplying a short-duration (0.25 s) &#xD;
low current pulse to the motor and returning both motor &#xD;
leads to Vcc results in erradic counts: often little to no &#xD;
change in the count; sometimes the count is even backwards!  &#xD;
I attribute this to back EMF: the motor is trying to &#xD;
overcome inertia and fight friction.  The magnetic encoders &#xD;
are getting a larger back-current reading.&#xD;
&#xD;
&lt;"&gt;&#xD;
A second source of trouble is when a low "leak" current is &#xD;
supplied to the motor leads.  The output shaft doesn't spin &#xD;
any, but the encoders are counting away almost at the same &#xD;
rate as a full-speed spin.  I can't explain this one.&#xD;
</description>
    </item>
    <item>
      <pubDate>Wed, 30 May 2007 21:49:11 GMT</pubDate>
      <title>30 May 2007</title>
      <link>http://robots.net/person/dwhall/diary.html?start=4</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=4</guid>
      <description>I ordered some &lt;a href="http://www.bgmicro.com/index.asp?&#xD;
PageAction=VIEWPROD&amp;ProdID=12300&amp;HS=1" &gt;motors from BG &#xD;
Micro&lt;/a&gt; at 3pm on Thursday last week.  They arrived two &#xD;
days later at noon via the USPS!  They are small MicroMo &#xD;
motors with Faulhaber gearboxes and, best of all, built-in &#xD;
magnetic quadrature shaft encoders.&#xD;
&#xD;
&lt;p&gt; I made the following measurements on just one of the motors &#xD;
using a crappy DMM:&#xD;
&lt;ul&gt;&#xD;
&lt;li&gt;No load current @ 5 V: 18 mA&#xD;
&lt;li&gt;Stall current @ 5 V: 180 mA&#xD;
&lt;li&gt;Angular vel @ 5 V: 84 RPM&#xD;
&lt;li&gt;Encoder output (low, high):     0.25 V, 4.87 V&#xD;
&lt;/ul&gt;&#xD;
&#xD;
&lt;p&gt; Then today, I connected the encoder output (ChA only for &#xD;
testing) to pin PE4 on my Atmel ATmega103.  I used that &#xD;
input so I could get edge-triggered interrupts.  I wrote an &#xD;
interrupt handler in C that incr/decrements a 16-bit counter &#xD;
variable.  The main program prints the counter variable to &#xD;
an LCD once every second.  Here is the code (minus comments &#xD;
so it all fits):&#xD;
&#xD;
&lt;p&gt; &lt;pre&gt;&#xD;
#include &amp;lt;stdint.h&amp;gt;&#xD;
#include &amp;lt;avr/io.h&amp;gt;&#xD;
#include &amp;lt;avr/interrupt.h&amp;gt;&#xD;
&#xD;
&lt;p&gt; #include "libmmb103.h"&#xD;
&#xD;
&#xD;
&lt;p&gt; volatile int16_t encoderCount;&#xD;
&#xD;
&#xD;
&lt;p&gt; void&#xD;
init(void)&#xD;
{&#xD;
    encoderCount = 0;&#xD;
    DDRE = DDRE &amp;amp; ~(_BV(PE4) | _BV(PE5));&#xD;
    EICR = EICR | _BV(ISC41);&#xD;
    EIMSK = EIMSK | _BV(INT4);&#xD;
    sei();&#xD;
}&#xD;
&#xD;
&#xD;
&lt;p&gt; ISR(INT4_vect)&#xD;
{&#xD;
    uint8_t chBA;&#xD;
&#xD;
&lt;p&gt;     chBA = (PINE &amp;gt;&amp;gt; 4) &amp;amp; (uint8_t)0x03;&#xD;
    if ((chBA == 1) || (chBA == 2))&#xD;
    {&#xD;
        encoderCount++;&#xD;
    }&#xD;
    else&#xD;
    {&#xD;
        encoderCount--;&#xD;
    }&#xD;
&#xD;
&lt;p&gt;     EICR = EICR ^ _BV(ISC40);&#xD;
}&#xD;
&#xD;
&#xD;
&lt;p&gt; int&#xD;
main(void)&#xD;
{&#xD;
    init();&#xD;
    mmb_init(BAUD19200, ADC_CK_DIV_16, PWM_CK_DIV_8, 2);&#xD;
    mmb_lcdPrintStr("EncA:");&#xD;
&#xD;
&lt;p&gt;     for (;;)&#xD;
    {&#xD;
        mmb_lcdSetLine(1);&#xD;
        mmb_lcdPrintHex16((uint16_t)encoderCount);&#xD;
        mmb_sleepms(500);&#xD;
    }&#xD;
}&#xD;
&lt;/pre&gt;</description>
    </item>
    <item>
      <pubDate>Sun, 26 Nov 2006 20:55:49 GMT</pubDate>
      <title>26 Nov 2006</title>
      <link>http://robots.net/person/dwhall/diary.html?start=3</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=3</guid>
      <description>I've done a lot of work on &lt;a href="http://pymite.python-&#xD;
hosting.com/" &gt;PyMite&lt;/a&gt;.  PyMite runs on Atmel AVR and ARM7TDMI &#xD;
processors.</description>
    </item>
    <item>
      <pubDate>Fri, 21 Feb 2003 20:17:06 GMT</pubDate>
      <title>21 Feb 2003</title>
      <link>http://robots.net/person/dwhall/diary.html?start=2</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=2</guid>
      <description>&lt;b&gt;Status:&lt;/b&gt; All robot hardware work is on hold while I 
focus on &lt;b&gt;PyMite&lt;/b&gt;, my flyweight Python interpreter for 
8-bit microcontrollers.  I have a paper accepted at the 
Python Conference: PyCon2003.  I want to develop PyMite as 
much as possible before that time.  Demo programs are 
running and the garbage collector is underway.</description>
    </item>
    <item>
      <pubDate>Mon, 28 Oct 2002 18:46:55 GMT</pubDate>
      <title>28 Oct 2002</title>
      <link>http://robots.net/person/dwhall/diary.html?start=1</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=1</guid>
      <description>&lt;p&gt;&lt;b&gt;Snaggletooth:&lt;/b&gt;
Through experiment, I found that the ADC encoder 
software is unable to sample the encoders fast enough (as a 
background task) to work properly.  It reaches about 0x12 
ticks/sec then reflects and starts giving smaller tick-per-
second values for increasing speed in typical ADC-sample-
aliasing fashion.  A solution involving comparators 
and a hardware interrupts is pending.

&lt;p&gt; &lt;p&gt;In the meantime, I wired up a homebrew ultrasonic 
emitter/detector pair.  The emitter uses an LM386 
amplifier, and is pretty loud, despite being inaudible.  I 
can determine the loudness because it takes my 3"-thick 
Physics book to eliminate crosstalk between the emitter and 
detector in order to get reliable measurements.  Range was 
5 inches min to 3 feet max.  Resolution was nice... about 
0.1" per count.

&lt;p&gt; &lt;p&gt;I also started using Larry Barello's AvrX RTOS for the 
AVR.  I've used it before on another project, but this is 
the first time for Snaggletooth.  The motor control system 
(with velocity measurement) is on a separate task.  For the 
record, &lt;b&gt;AvrX works great!&lt;/b&gt;  Work on the motor control 
system is pending the new digital encoders.</description>
    </item>
    <item>
      <pubDate>Mon, 21 Oct 2002 16:24:35 GMT</pubDate>
      <title>21 Oct 2002</title>
      <link>http://robots.net/person/dwhall/diary.html?start=0</link>
      <guid>http://robots.net/person/dwhall/diary.html?start=0</guid>
      <description>&lt;p&gt;&lt;b&gt;Snaggletooth:&lt;/b&gt;
Shaft encoders are IR reflectance-based sensors mouted 
inside the gearbox of both servo motors.  The sensors read 
black/white marks painted on the penultimate drive gear.  
Encoder ticks come in via ADC.  Wrote software to count 
encoder ticks.

&lt;p&gt; &lt;p&gt;&lt;b&gt;Highlights:&lt;/b&gt;
100% PWM on a slightly discharged battery yields about 24 
ticks per second.  25% PWM yields about 9 tps.

&lt;p&gt; &lt;p&gt;&lt;b&gt;Next:&lt;/b&gt;
Write feedback-based motor speed control routines.
&lt;i&gt;Long term: move to digital encoder sensors.&lt;/i&gt;</description>
    </item>
  </channel>
</rss>
