<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reza's Rants</title>
	<atom:link href="http://reza.net/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://reza.net/wordpress</link>
	<description>Nothing for you to look at, please move along..</description>
	<lastBuildDate>Sun, 10 Jan 2010 11:01:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Twitter Updates for 2010-01-10</title>
		<link>http://reza.net/wordpress/?p=261</link>
		<comments>http://reza.net/wordpress/?p=261#comments</comments>
		<pubDate>Sun, 10 Jan 2010 11:01:00 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=261</guid>
		<description><![CDATA[
now on hold for 10 minutes waiting for #sonicnet &#8212; they should make it up by giving me a free year of service. #
@alderete  brewing beer in the backyard &#8212; stop by if your bored. #

]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>now on hold for 10 minutes waiting for #<a href="http://search.twitter.com/search?q=%23sonicnet" class="aktt_hashtag">sonicnet</a> &#8212; they should make it up by giving me a free year of service. <a href="http://twitter.com/thethereza/statuses/7467369572" class="aktt_tweet_time">#</a></li>
<li>@<a href="http://twitter.com/alderete" class="aktt_username">alderete</a>  brewing beer in the backyard &#8212; stop by if your bored. <a href="http://twitter.com/thethereza/statuses/7582677708" class="aktt_tweet_time">#</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=261</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Updates for 2009-11-29</title>
		<link>http://reza.net/wordpress/?p=260</link>
		<comments>http://reza.net/wordpress/?p=260#comments</comments>
		<pubDate>Sun, 29 Nov 2009 11:01:00 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=260</guid>
		<description><![CDATA[
likes Blade Runner on Boxee. check it out at http://bit.ly/tYFoN #

]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>likes Blade Runner on Boxee. check it out at <a href="http://bit.ly/tYFoN" rel="nofollow">http://bit.ly/tYFoN</a> <a href="http://twitter.com/thethereza/statuses/6105434595">#</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=260</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CNC Success</title>
		<link>http://reza.net/wordpress/?p=255</link>
		<comments>http://reza.net/wordpress/?p=255#comments</comments>
		<pubDate>Sat, 14 Nov 2009 08:43:30 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[cnc]]></category>
		<category><![CDATA[gcode]]></category>
		<category><![CDATA[mill]]></category>
		<category><![CDATA[stepper motor]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=255</guid>
		<description><![CDATA[Success!
I was showing a friend my progress with the code, and he was complaining that the stepper motors were loud, and suggested I turn on fractional stepping. I switched to 1/16th steps, and he was right, the motors sounded much better. Additionally, the Z-axis magically started working! I was also impressed how well my code [...]]]></description>
			<content:encoded><![CDATA[<p>Success!</p>
<p>I was showing a friend my progress with the code, and he was complaining that the stepper motors were loud, and suggested I turn on fractional stepping. I switched to 1/16th steps, and he was right, the motors sounded much better. Additionally, the Z-axis magically started working! I was also impressed how well my code handled high stepping rates &#8212; well, more surprised that it worked without more surprises. So I&#8217;ve passed a big hurdle. I need to test the circle routine (pretty much the only piece of code I&#8217;ve not rewritten from the original code base), do some more tests, and try milling my first PCB!</p>
<p>Here&#8217;s a quick video demonstrating it moving in 3 axis at different rates, 1/16th step.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/0TW-A-WOTdA&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/0TW-A-WOTdA&amp;hl=en_US&amp;fs=1&amp;" allowfullscreen="true"></embed></object></p>
<p>You can browse the latest version of the code here:<a href="http://code.google.com/p/rsteppercontroller/source/browse/"> http://code.google.com/p/rsteppercontroller/source/browse/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=255</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Stepper Motor Controller Update</title>
		<link>http://reza.net/wordpress/?p=253</link>
		<comments>http://reza.net/wordpress/?p=253#comments</comments>
		<pubDate>Fri, 13 Nov 2009 09:45:15 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[gcode]]></category>
		<category><![CDATA[stepper motor controller]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=253</guid>
		<description><![CDATA[It&#8217;s a step forward, two steps back. I burnt out one of the channels running some preliminary tests, and I just got the replacement board in from Pololu.com. Spent longer than I wanted trying to hook it up (note to self: don&#8217;t use such low gague wire). But I was still seeing more jitter in [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a step forward, two steps back. I burnt out one of the channels running some preliminary tests, and I just got the replacement board in from Pololu.com. Spent longer than I wanted trying to hook it up (note to self: don&#8217;t use such low gague wire). But I was still seeing more jitter in the clocking than I wanted. I tried a few different configurations, and finally came up with an approach that seems to work well, and exhibits a jitter equal to the resolution of the micros() call (4uS). In this approach, it computes the time when the next step happens, figures out which channel needs to step next, then waits for that time in a tight loop:</p>
<pre>
// start move
while (xaxis-&gt;delta_steps || yaxis-&gt;delta_steps || zaxis-&gt;delta_steps) {
        a = nextEvent();
        while (micros() &lt; (starttime + a-&gt;nextEvent) ); //wait till next action is required
        if (can_move(a)) {
                _STEP_PORT |= a-&gt;direct_step_pin;
                //need to wait 1uS
                __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
                __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
                _STEP_PORT &amp;= ~a-&gt;direct_step_pin;
        }
        if (--a-&gt;delta_steps) {
                a-&gt;nextEvent += a-&gt;timePerStep;
        } else {
                a-&gt;nextEvent = 0xFFFFFFFF;
        }
}
</pre>
<p>The latest version of the code is checked into SVN on google code.</p>
<p>So anyhow, I get everything working nicely only to find that the Z-axis controller is also fried &#8212; these guys are way too sensitive. Need to order yet another board.</p>
<p>Reza</p>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=253</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stepper Motor Controller Code Update</title>
		<link>http://reza.net/wordpress/?p=249</link>
		<comments>http://reza.net/wordpress/?p=249#comments</comments>
		<pubDate>Thu, 15 Oct 2009 09:30:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[stepper motor]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=249</guid>
		<description><![CDATA[Just a quick update, I&#8217;ve added support for limit switches in the firmware.  Enable them by specifying the associated pin, and if it&#8217;s active high or active low.   The preferred method is active low otherwise you need to add your own pulldown resistor if it&#8217;s active high.
// specify min-max sense pins or 0 [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick update, I&#8217;ve added support for limit switches in the firmware.  Enable them by specifying the associated pin, and if it&#8217;s active high or active low.   The preferred method is active low otherwise you need to add your own pulldown resistor if it&#8217;s active high.</p>
<pre>// specify min-max sense pins or 0 if not used
// specify if the pin is to to detect a switch closing when
// the signal is high using the syntax
// #define MIN_X 12 | ACTIVE_HIGH
// or to sense a low signal (preferred!!!)
// #define MIN_Y 13 | ACTIVE_LOW
// active low is preferred as it will cause the AVR to use it's internal pullups to
// avoid bounce on the line.  If you want active_high, then you must add external pulldowns
// to avoid false signals.
#define ACTIVE_HIGH _BV(7)
#define ACTIVE_LOW  _BV(6)
#define MIN_X 0
#define MAX_X 0
#define MIN_Y 0
#define MAX_Y 0
#define MIN_Z 0
#define MAX_Z 0</pre>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=249</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Stepper Motor Controller Update</title>
		<link>http://reza.net/wordpress/?p=246</link>
		<comments>http://reza.net/wordpress/?p=246#comments</comments>
		<pubDate>Mon, 05 Oct 2009 08:09:42 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[gcode]]></category>
		<category><![CDATA[motor]]></category>
		<category><![CDATA[stepper]]></category>
		<category><![CDATA[temporal]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=246</guid>
		<description><![CDATA[I&#8217;ve recently posted about my new stepper motor controller. Well, I was unhappy with the implementation used in the RepRap project, and what started as a code cleanup has turned into a near full rewrite. I&#8217;m fairly happy with the code now and finished my preliminary testing. I based my original version of the re-written [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently <a href="http://reza.net/wordpress/?p=245">posted</a> about my new stepper motor controller. Well, I was unhappy with the implementation used in the RepRap project, and what started as a code cleanup has turned into a near full rewrite. I&#8217;m fairly happy with the code now and finished my preliminary testing. I based my original version of the re-written code turned out to be a variant of Bresenham&#8217;s <span style="FONT-FAMILY: 'Times New Roman'; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">algorithm</span> (though I found this out after I had written the code). The algorythm would determine the axis which required the most travel, step that axis, then add the required travel from one of the other axis to an error term for that axis. When the error term was equal to or greater than one, it would step that axis and subtract one from the error term. This resulted in stepping synchronized with the major axis timebase. Looking at the output of the stepper motor driver, this pattern emerged.</p>
<p><a href="http://reza.net/wordpress/wp-content/ftp/steppring_rates.jpg" rel="lightbox" title="steppring rates.jpg"><img src="http://reza.net/wordpress/wp-content/ftp/zrtn_001p793b6a64_tn.jpg" style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" height="184" width="500" alt="steppring rates.jpg" border="0"/></a></p>
<p>Here the G-Code command was &#8220;G1 X3 Y2 Z1&#8243; &#8212; and indeed the ratio of steps is 3:2:1, but notice that the Y-steps are required to align with the X-Steps (master axis because it moves the furthest), but because 3 is not divisible by 2, it skips every third step. This motion is bad for the stepper motor, and it can cause all sorts of problems.</p>
<blockquote><p>It is *extremely* important the steps be evenly spaced, unless you&#8217;ll be content with slow, unreliable operation. Jitter in the step pulse train will limit your top speed, as it *will* cause the stepper to stall. -Ray L.</p>
</blockquote>
<p>So I spent some time thinking about it, and came to the conclusion that the Bresenham&#8217;s Algorithm only makes sense if you are dealing with a pixelated output (its main purpose is for fast rendering of lines on computer screens). I realized that I needed was a temporal based one, and came up with something. I still need to do a literature search to see if someone has come up with it yet (would be surprising if no one has) but this is basically what I came up with.</p>
<ol>
<li>Determine the number of steps per axis</li>
<li>Determine the distance of travel for the command, and based on the feedrate, compute the duration of the command.</li>
<li>Compute the time between steps (TBS) for each axis (duration / steps)</li>
<li>Start the main loop.</li>
<li style="list-style: none">
<ol>
<li>If the time elapsed is equal to 1/2 the TBS, then step that particular axis.</li>
<li>Wait 1/2 TBS, then go to step 5.</li>
</ol>
</li>
</ol>
<p>I prototyped this in python, and came up with</p>
<pre>
maxtime = 100.0; #duration of motion in microseconds
steps = 41.0;  #number of y steps
timePERstep = maxtime/steps; #time per step
y=0;
stepped = 0;
oldTimeIntoSlice = 0;
for time in range(0,int(maxtime)):
        timeIntoSlice = (time%timePERstep);
        if (timeIntoSlice &lt; oldTimeIntoSlice):
                stepped = 0;
        oldTimeIntoSlice = timeIntoSlice
        if (timeIntoSlice &gt;= 0.5*timePERstep) and (stepped == 0):
                        #print 'step'
                        stepped = 1;
                        y = y + 1;
        print '%d,%d' % (time,y)
</pre>
<p>Which generated this sort of a stepping profile. Notice that the steps are pretty <span style="FONT-FAMILY: 'Times New Roman'; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">evenly</span> spread out..</p>
<p><a href="http://reza.net/wordpress/wp-content/ftp/temporal.jpg" rel="lightbox" title="temporal.jpg"><img src="http://reza.net/wordpress/wp-content/ftp/zrtn_002n22d3fb58_tn.jpg" style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" height="295" width="397" alt="temporal.jpg" border="0"/></a></p>
<p>After rewriting the arduino code, I tried the same test (with G1 X1 Y2 Z3 this time) and got much better results</p>
<p><a href="http://reza.net/wordpress/wp-content/ftp/temporal_stepping.jpg" rel="lightbox" title="temporal stepping.jpg"><img src="http://reza.net/wordpress/wp-content/ftp/zrtn_003n5f714be_tn.jpg" style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" height="105" width="500" alt="temporal stepping.jpg" border="0"/></a></p>
<p>Notice how everything is nicely spread out. Looking at the timestamps, the maximum step jitter is about 150uS. The next step is to hook this up to some stepper motors and see what it does.</p>
<p>I&#8217;ve also released the code for the arduino <a href="http://code.google.com/p/rsteppercontroller/">here</a> in case it might be of help to anyone. I&#8217;m thinking of making a daughter board for the arduino with the stepper controller ICs on it in order to simplify deployment for others &#8212; if there is interest.</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=246</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Arduino-Based Stepper Motor Controller</title>
		<link>http://reza.net/wordpress/?p=245</link>
		<comments>http://reza.net/wordpress/?p=245#comments</comments>
		<pubDate>Thu, 24 Sep 2009 19:40:03 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[A4983]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[motor]]></category>
		<category><![CDATA[stepper]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=245</guid>
		<description><![CDATA[

Decided to drop my PCB and use some prebuilt modules from pololu. Doing the math, this turned out to be the cheapest option (3x$13 vs. $50 for the PCB plus another $30-$50 to populate). The pololu modules use Allegro&#8217;s A4983 intgrated h-bridge drivers rated at up to 2A &#8211; which amazes me given the size [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://reza.net/wordpress/wp-content/ftp/P1030113.JPG" rel="lightbox" title="P1030113.JPG"><img src="http://reza.net/wordpress/wp-content/ftp/zrtn_001n60e99417_tn.jpg" style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; DISPLAY: inline; MARGIN-LEFT: auto; BORDER-TOP: #000000 2px solid; MARGIN-RIGHT: auto; BORDER-RIGHT: #000000 2px solid" height="281" width="500" alt="P1030113.JPG" border="0"/></a></p>
<p><a href="http://reza.net/wordpress/wp-content/ftp/P1030118.JPG" rel="lightbox" title="P1030118.JPG"><img src="http://reza.net/wordpress/wp-content/ftp/zrtn_002n1349b792_tn.jpg" style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" height="281" width="500" alt="P1030118.JPG" border="0"/></a></p>
<p>Decided to drop my <a href="http://reza.net/wordpress/?p=230">PCB</a> and use some prebuilt <a href="http://www.pololu.com/catalog/product/1201">modules from pololu</a>. Doing the math, this turned out to be the cheapest option (3x$13 vs. $50 for the PCB plus another $30-$50 to populate). The pololu modules use Allegro&#8217;s A4983 intgrated h-bridge drivers rated at up to 2A &#8211; which amazes me given the size of the ICs. I&#8217;m a bit worried but I suspect that they&#8217;ve already been tested. I&#8217;m going to power it with a +/- 15V 3A supply I have, and use the <a href="http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter">g-code parser from the reprap project</a>.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=245</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A little bit steampunk</title>
		<link>http://reza.net/wordpress/?p=244</link>
		<comments>http://reza.net/wordpress/?p=244#comments</comments>
		<pubDate>Wed, 23 Sep 2009 01:43:58 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[heatsink]]></category>
		<category><![CDATA[peltier]]></category>
		<category><![CDATA[steampunk]]></category>
		<category><![CDATA[tubes]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=244</guid>
		<description><![CDATA[
Anyone want to guess what I&#8217;m building now?
]]></description>
			<content:encoded><![CDATA[<p><img src="http://reza.net/wordpress/wp-content/ftp/zrtn_003p723affb9_tn.jpg" style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" height="500" width="281" alt="P1030110_Medium.JPG" border="0"/></p>
<p>Anyone want to guess what I&#8217;m building now?</p>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=244</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mood Rock</title>
		<link>http://reza.net/wordpress/?p=233</link>
		<comments>http://reza.net/wordpress/?p=233#comments</comments>
		<pubDate>Sat, 19 Sep 2009 08:48:13 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[lighting]]></category>
		<category><![CDATA[rock]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=233</guid>
		<description><![CDATA[I was in an art store and came across a neat looking alabaster rock.

And for some reason, I thought it would be cool to stick some lights in it, which started yet another project. I started out by building a circuit on the cheap using some components I had lying around.


I thought it would be [...]]]></description>
			<content:encoded><![CDATA[<p>I was in an art store and came across a neat looking alabaster rock.</p>
<p><a title="P1030107.JPG" rel="lightbox" href="http://reza.net/wordpress/wp-content/ftp/P1030107.JPG"><img style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; DISPLAY: inline; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" src="http://reza.net/wordpress/wp-content/ftp/zrtn_001pcbc48cc_tn.jpg" border="0" alt="P1030107.JPG" width="400" height="213" /></a></p>
<p>And for some reason, I thought it would be cool to stick some lights in it, which started yet another project. I started out by building a circuit on the cheap using some components I had lying around.</p>
<p><a title="P1030059.JPG" rel="lightbox" href="http://reza.net/wordpress/wp-content/ftp/P1030059.JPG"><img style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" src="http://reza.net/wordpress/wp-content/ftp/zrtn_002p74452733_tn.jpg" border="0" alt="P1030059.JPG" width="400" height="225" /></a></p>
<p><a title="P1030060.JPG" rel="lightbox" href="http://reza.net/wordpress/wp-content/ftp/P1030060.JPG"><img style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" src="http://reza.net/wordpress/wp-content/ftp/zrtn_003p232684b1_tn.jpg" border="0" alt="P1030060.JPG" width="400" height="225" /></a></p>
<p>I thought it would be cool to control the color from the PC, so I decided to check out the <a href="http://www.obdev.at/products/vusb/index.html">AVR-USB</a> project. The cool thing about AVR-USB is that it handles the USB protocol in firmware alone and doesn&#8217;t require any additional ICs. I had a number of hickups &#8211; the biggest one being that as soon as a USB packet was received, the SPI on the AVR would stop working. After many hours of not being able to figure out the culprit, I resorted to bit-bang SPI and everything started working. The lights are <a href="http://macetech.com/store/index.php?main_page=product_info&amp;cPath=1&amp;products_id=1">shiftbrites</a> from macetech. The cable is an ISP programming interface for the AVR. Component count is fairly low &#8211; a crystal, a bypass cap, a supply cap, two USB termination resistors and a pullup resistor.</p>
<p>I used a masonry bit to drill a lot of holes in the bottom of the rock, then used a hammer and chisel to finish enlarging the space. The board just barley fits in there.</p>
<p><a title="P1030062.JPG" rel="lightbox" href="http://reza.net/wordpress/wp-content/ftp/P1030062.JPG"><img style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" src="http://reza.net/wordpress/wp-content/ftp/zrtn_004p1d51b9a2_tn.jpg" border="0" alt="P1030062.JPG" width="400" height="225" /></a></p>
<p>And the effects were pretty cool..</p>
<p><a title="P1030066.JPG" rel="lightbox" href="http://reza.net/wordpress/wp-content/ftp/P1030066.JPG"><img style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" src="http://reza.net/wordpress/wp-content/ftp/zrtn_007p246a5754_tn.jpg" border="0" alt="P1030066.JPG" width="400" height="225" /></a></p>
<p><a title="P1030065.JPG" rel="lightbox" href="http://reza.net/wordpress/wp-content/ftp/P1030065.JPG"><img style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" src="http://reza.net/wordpress/wp-content/ftp/zrtn_006p55ae0749_tn.jpg" border="0" alt="P1030065.JPG" width="400" height="225" /></a></p>
<p>The communication is via a modified hidtool.c application (an example shipped with AVR-USB) which transmits a 4 byte payload which is then shifted onto the LEDs. For completeness, I wrote a small application in perl to act as a webserver and handle requests &#8211; forwarding valid requests to the hidtool application. And I also put together a nice color picker front end which uses AJAX to update the color on the fly. So as you move the color picker, the rock changes color accordingly. I put together a video of everything working together here :</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/aUOcE_a_99c&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/aUOcE_a_99c&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0x006699&amp;color2=0x54abd6" allowfullscreen="true"></embed></object></p>
<p>There is a small amount of lag, which is to be expected &#8212; the chain of operations is&#8230;</p>
<ol>
<li>open web app, and pick a color</li>
<li>color picker uses AJAX to send requests to a server running on my desktop</li>
<li>server forks hidtool.exe with the color arguments</li>
<li>hidtool then connects to the USB device (rock) and transmits the new color strings.</li>
</ol>
<p>This chain of events is repeated every time the color changes &#8211; this happens as the cursor is being moved around thus it can generate quite a few requests. To improve throughput, I would need to merge the C app into the perl app, or visa-vera.</p>
<p>I&#8217;ve gone ahead and put the application online <a href="http://rezasf.mine.nu/rock.html">here</a> so go ahead and set your mood color which will be displayed on my rock.</p>
<h1>Live Feed</h1>
<p>This image is updated every 5 seconds.  Or go <a href="http://reza.net/misc/moodrock/webcam.html">here</a>.</p>
<p><img class="alignnone" title="Live feed - updated every 5 seconds" src="http://reza.net/misc/moodrock/Webcam.jpg" alt="" width="512" height="384" /></p>
<h1>Resources</h1>
<ul>
<li> <a href="http://reza.net/misc/moodrock/webapp.zip">Web Application</a> &#8211; change the AXAJ target by modifying js/layout.js</li>
<li> <a href="http://reza.net/misc/moodrock/moodrock.zip">Firmware &amp; Command Line Tool</a></li>
<li> <a href="http://reza.net/misc/moodrock/set.pl.txt">Perl WebServer</a></li>
<li> <a href="http://reza.net/misc/moodrock/moodrock.pdf">Schematic</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=233</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nixie Tubes</title>
		<link>http://reza.net/wordpress/?p=232</link>
		<comments>http://reza.net/wordpress/?p=232#comments</comments>
		<pubDate>Tue, 15 Sep 2009 02:19:36 +0000</pubDate>
		<dc:creator>reza</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[nixie]]></category>

		<guid isPermaLink="false">http://reza.net/wordpress/?p=232</guid>
		<description><![CDATA[
My nixie tubes arrived today from Russia. Trying to decide what to make with them. Any ideas? The one on the left displays numerals, and the one on the right is bar graph. I have 10 of each. I was thinking of perhaps a 10 channel spectral analyzer for my stereo with the bar graphs. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://reza.net/wordpress/wp-content/ftp/nixie0001.jpg" rel="lightbox" title="nixie0001.jpg"><img src="http://reza.net/wordpress/wp-content/ftp/zrtn_001p8095028_tn.jpg" style="BORDER-BOTTOM: #000000 2px solid; BORDER-LEFT: #000000 2px solid; DISPLAY: inline; FLOAT: left; BORDER-TOP: #000000 2px solid; BORDER-RIGHT: #000000 2px solid" height="600" width="314" alt="nixie0001.jpg" border="0"/></a></p>
<p>My nixie tubes arrived today from Russia. Trying to decide what to make with them. Any ideas? The one on the left displays numerals, and the one on the right is bar graph. I have 10 of each. I was thinking of perhaps a 10 channel spectral analyzer for my stereo with the bar graphs. A lot of people make clocks with the tubes on the left, but that seems almost a bit too generic.</p>
]]></content:encoded>
			<wfw:commentRss>http://reza.net/wordpress/?feed=rss2&amp;p=232</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
