<?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>profmason.com &#187; Robotics</title>
	<atom:link href="http://profmason.com/?feed=rss2&#038;cat=5" rel="self" type="application/rss+xml" />
	<link>http://profmason.com</link>
	<description></description>
	<lastBuildDate>Thu, 12 Aug 2010 14:40:51 +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>VEX RC Controller Decoded:</title>
		<link>http://profmason.com/?p=602</link>
		<comments>http://profmason.com/?p=602#comments</comments>
		<pubDate>Tue, 26 Aug 2008 05:47:07 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=602</guid>
		<description><![CDATA[The VEX RC Controller is available directly from VEX or surplus from All Electronics.  (A great provider of discount electronics.)  This is a six channel PPM controller that has the added advantage for microcontroller work that all of the outputs are on a single line.  There is also a spec sheet from All [...]]]></description>
			<content:encoded><![CDATA[<p>The VEX RC Controller is available directly from <a href="http://www.vexrobotics.com/">VEX</a> or surplus from <a href="http://www.allelectronics.com/make-a-store/item/JS-6/6-CHANNEL-TRANSMITTER-AND-RECEIVER/-/1.html">All Electronics</a>.  (A great provider of discount electronics.)  This is a six channel PPM controller that has the added advantage for microcontroller work that all of the outputs are on a single line.  There is also a spec sheet from All Electronics which I will mirror here:<a href="http://profmason.com/wp-content/uploads/2008/08/js-6.pdf">VEX reciever how to</a></p>
<p><a href="http://profmason.com/wp-content/uploads/2008/08/vexrcoutput.jpg"><img class="size-full wp-image-603 alignright" title="vexrcoutput" src="http://profmason.com/wp-content/uploads/2008/08/vexrcoutput.jpg" alt="" width="500" height="327" /></a>Here is an image of the output from the receiver.  NOTE:  The receiver really wants 5 Volts, but I am running it at 3.7 Volts at the moment(a single lithium battery)  It works at 3.7V but has a considerably shorter range.</p>
<p>The nice this about this, is that all of the channels are on a single line.  This makes it very easy to interface with a microprocessor.  A quick review of the PPM format:</p>
<ul>
<li>20 ms total before repeat.</li>
<li>Each channel is sent as a high signal followed by a 1 ms low.  The width of the high signal determines the value sent.  A zeroed channel has a width of 1ms.  A full positive channel is 1.5ms and a full negative channel is 0.5 ms.</li>
<li>On the Vex there are six channel (The six peaks that you see) for a total of about 12ms buffered by approximately 8 ms.</li>
</ul>
<p><a href="http://profmason.com/wp-content/uploads/2008/08/vexreceiver.jpg"><img class="size-medium wp-image-605 alignright" title="vexreceiver" src="http://profmason.com/wp-content/uploads/2008/08/vexreceiver.jpg" alt="" width="160" height="276" /></a>To interface with a microprocessor, simply plug the output of the receiver into your microprocessor. Send 5V to Vdd and Ground to Vss.  Tie the output of the receiver to 5V over about a 10K resistor.  Start measuring pulses on that channel.  If you measure at least a 6ms low(The buffer) start recording pulses. (These are your data pulses.)  Record all six channels and then decode the length of each pulse.</p>
<p>Here is some Arduino code to do just this:</p>
<blockquote><p>#define channumber 6 //How many channels on the radio???<br />
int channel[channumber]; //Channel values<br />
int output[channumber];<br />
int PPMin = 4;</p>
<p>void setup()<br />
{<br />
Serial.begin(9600); //Initialize Serial/<br />
pinMode(PPMin, INPUT); // Pin 4 as input<br />
}</p>
<p>void loop()<br />
{<br />
//waits until synchronize arrives &gt; 6 miliseconds<br />
if(pulseIn(PPMin , HIGH) &gt; 6000); //If pulse &gt; 6 miliseconds, continues<br />
{<br />
for(int i = 1; i &lt;= channumber; i++)  //Read the pulses of the remaining channels<br />
{<br />
channel[i-1]=pulseIn(PPMin, LOW);<br />
}<br />
for(int i = 1; i &lt;= channumber; i++) // Process the input<br />
{<br />
//enter output processing here<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=602</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vexplorer hacking</title>
		<link>http://profmason.com/?p=499</link>
		<comments>http://profmason.com/?p=499#comments</comments>
		<pubDate>Wed, 19 Dec 2007 04:53:33 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=499</guid>
		<description><![CDATA[I finally obtained a vexplorer.  (I hung around ebay for about 3 weeks.)  The day I picked it up Amazon had them for $99 and then $60!  (It seems like the $60 price was a mistake).  It came well packed and I spent about 90 minutes putting the pieces together with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://profmason.com/wp-content/uploads/2007/12/vexplorer.jpg" title="vexplorer.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/vexplorer.jpg" alt="vexplorer.jpg" align="right" height="325" width="464" /></a>I finally obtained a vexplorer.  (I hung around ebay for about 3 weeks.)  The day I picked it up Amazon had them for $99 and then $60!  (It seems like the $60 price was a mistake).  It came well packed and I spent about 90 minutes putting the pieces together with my daughter.</p>
<p>After driving it around for about 10 minutes I decided to test the camera.  The camera works immediately with my 2.4 Ghz Wireless to USB box.  The channels that Vex assigned are non standard 1=4 etc!  However with a bit of fiddling it works.   Unfortunately the camera included on the Vexplorer is about the worst quality I have ever seen.    Terrible low light performance, lots of interference etc.  I have bought inexpensive cameras, but never had a NTSC camera this bad.  Still it should be workable in Roborealm.</p>
<p>Here are some snaps that I took from <a href="http://www.roborealm.com">Roborealm</a>:</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/vexcam.jpg" title="vexcam.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/vexcam.jpg" alt="vexcam.jpg" /></a><a href="http://profmason.com/wp-content/uploads/2007/12/vexcam2.jpg" title="vexcam2.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/vexcam2.jpg" alt="vexcam2.jpg" /></a></p>
<p>Now on to hacking the remote. Here is a picture of the backside of the remote.  There are two structures that have circles in the middle.  These are the backsides of the joysticks.  The large surface mount chip is the microprocessor.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/vexplorer-remote.jpg" title="vexplorer-remote.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/vexplorer-remote.jpg" alt="vexplorer-remote.jpg" /></a></p>
<p>The remote operates at 27 Mhz.  There are four analog channels and two digital channels.  Each pair of analog channels is fed by a very nice joystick which controls a two ~1K pots.    When the joystick is moved, the resistance between the central terminal and one of the outlying terminals decreases.  This is hooked up with a voltage divider network.  The microprocessor uses an ADC to measure this <a href="http://profmason.com/wp-content/uploads/2007/12/elan75p458.JPG" title="elan75p458.JPG"><img src="http://profmason.com/wp-content/uploads/2007/12/elan75p458.JPG" alt="elan75p458.JPG" align="right" /></a>voltage and encode the appropriate signal to transmit.  I removed one of the joysticks and wired into it.  I am not sure what I did (I think I just shorted power to ground) but the remote stopped working for about 20 minutes.  It did eventually recover after I soldered the pot back in (Phew!)    It seems like interfacing to the remote this way will be tricky!</p>
<p>The microprocessor outputs some kind of modulated pulse on one of its PWM outputs.  I left my oscilloscope probes at work, and all I have are a pair of alligator clips soldered to a BNC connector.  Needless to say all I see on the PWM output is noise right now.  When I go into work next, I will bring the probes home so I can look at generating the appropriate PWM output.</p>
<p>The microprocessor on both the transmitter and RX is an ELAN 78P458.  Here is the data sheet for this microprocessor. <a href="http://profmason.com/wp-content/uploads/2007/12/elan78p458.pdf" title="elan78p458.pdf">elan78p458.pdf</a>  Unfortunately, it doesn&#8217;t support rewritable memory, so we can&#8217;t get at the toy that way!</p>
<p>For now I will breadboard up a Picaxe controlling a set of 4 hbridges to drive the robot.  I will use an XBee module to provide serial communication with the PC.   This is an expensive way to do this, but it will work for now.  I would prefer to just use a Picaxe on the transmitter side and use all the vex electronics on the bot.</p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=499</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Converting RC car using on board HBridge</title>
		<link>http://profmason.com/?p=492</link>
		<comments>http://profmason.com/?p=492#comments</comments>
		<pubDate>Wed, 19 Dec 2007 00:39:16 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[PicAXE]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[hbridge]]></category>
		<category><![CDATA[RC cars]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=492</guid>
		<description><![CDATA[I picked up several RC vehicles at the 2nd hand store a week or so ago.  I wrote up the results of the first experiment previously.  This time I picked a vehicle that had differential drive and would thus be ideal for a robotic platform.  Differential drive gives the ability to turn [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://profmason.com/wp-content/uploads/2007/12/rcplatform2.jpg" title="rcplatform2.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/rcplatform2.jpg" alt="rcplatform2.jpg" align="right" /></a>I picked up several RC vehicles at the 2nd hand store a week or so ago.  I wrote up the results of the first experiment previously.  This time I picked a vehicle that had differential drive and would thus be ideal for a robotic platform.  Differential drive gives the ability to turn within the vehicles own footprint which is handy for a robotic platform.  Instead of using my own motor drivers I decided to use the ones built into the RC vehicle.  This vehicle did not come with a remote control, so I couldn&#8217;t do the same hack I did by just hacking into the remote.  I disassembled the vehicle and hooked up power and ground.  I then started probing the different pins of the RC chip with a five volt signal through a 220 Ohm resistor. <a href="http://profmason.com/wp-content/uploads/2007/12/rcboard.jpg" title="rcboard.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/rcboard.jpg" alt="rcboard.jpg" height="188" width="346" /></a></p>
<p>Sure enough there were two pins that controlled each motor.  Now interfacing was dead simple.  De-solder the RC chip.  <a href="http://profmason.com/wp-content/uploads/2007/12/rcchip.jpg" title="rcchip.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/rcchip.jpg" alt="rcchip.jpg" /></a></p>
<p>Solder 4 wires to the holes identified earlier.  (Sorry about the quality of the picture.  You can see where the chip was removed. The wires are potted in hotglue to provide stress relief.  Run those wires to the PicAXE outputs with 4.7 K resistors to limit the current.  Program the PicAXE, add batteries and wallah instant robotic platform!  I did add a piece of expanded PVC as a top platform.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/rcplatform.jpg" title="rcplatform.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/rcplatform.jpg" alt="rcplatform.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=492</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RC Car interface</title>
		<link>http://profmason.com/?p=471</link>
		<comments>http://profmason.com/?p=471#comments</comments>
		<pubDate>Wed, 12 Dec 2007 02:04:06 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[PicAXE]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=471</guid>
		<description><![CDATA[I visited the local second hand store and purchased several RC vehicles.  As usual most of them did not come with the associated remote control.  However as luck had it, I was able to pick up a Tyco/RC car with controller for $3.  This Tyco product was remarkably good quality inside and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://profmason.com/wp-content/uploads/2007/12/rccar.jpg" title="rccar.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/rccar.jpg" title="rccar.jpg" alt="rccar.jpg" align="right" /></a>I visited the local second hand store and purchased several RC vehicles.  As usual most of them did not come with the associated remote control.  However as luck had it, I was able to pick up a Tyco/RC car with controller for $3.  This Tyco product was remarkably good quality inside and out(Compared to many other RC products I have taken apart.)</p>
<p>The car has a dc motor connected to a two speed switchable gear train that drives the rear wheels.  There is basically a solenoid up front that shoves the front wheels hard right or hard left.  There is no ratiometric control on this car.  One final feature is the two curving metal pieces connecting the front of the chassis to the rear.  These not only act as giant bumpers and strengthen the chassis, but one of them acts as the RX antenna.</p>
<p>The remote control operates at 27Mhz and appears to use an amplitude modulation scheme.   I decided to interface the remote control to the PC.</p>
<p>After some false starts here is what works.  There are a set of metallic contacts that the switches on the RC controller make and break.  This controller is not ratiometric, so I just drilled a hole in<a href="http://profmason.com/wp-content/uploads/2007/12/rctransmitter.jpg" title="rctransmitter.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/rctransmitter.jpg" title="rctransmitter.jpg" alt="rctransmitter.jpg" align="right" /></a> the middle of each contact and wired into it.  The middle is tied to ground on the microcontroller board and each of the outside contacts is tied to the output of a ULN2803 darlington array.  The strategy is that the microprocessor will have the darlington array connect each of the contacts to ground.  You need four microprocessor outputs to do this.  (With clever logic you could do it with three outputs, but that would increase the part count.)</p>
<p>Now the microprocessor receives serial commands and interprets those to turn on the appropriate channels on the RC car.  The RC transmitter provides its own power which is isolated from the microprocessor.  (This means that you need to keep batteries in the transmitter.)</p>
<p>The transmitter seems to have a range of about 10 meters.</p>
<p><em>symbol forw = 2<br />
symbol back = 3<br />
symbol right = 4</em><br />
<em> symbol left = 5<br />
setfreq m8</em></p>
<p><em>main:&#8217;Get a value from the terminal<br />
</em></p>
<blockquote><p><em> serin 4,N1200,b0</em><br />
<em> &#8217;serout 0,N1200,(#b0)</em><br />
<em> if b0 = 56 then goforward</em><br />
<em> if b0 = 57 then goforwardright</em><br />
<em> if b0 = 55 then goforwardleft</em><br />
<em> if b0 = 51 then gobackwardright</em><br />
<em> if b0 = 50 then gobackward</em><br />
<em> if b0 = 49 then gobackwardleft</em><br />
<em> if b0 = 53 then gostop</em><br />
<em> low back</em><a href="http://profmason.com/wp-content/uploads/2007/12/rctransmitterinterface.JPG" title="rctransmitterinterface.JPG"><img src="http://profmason.com/wp-content/uploads/2007/12/rctransmitterinterface.JPG" title="rctransmitterinterface.JPG" alt="rctransmitterinterface.JPG" align="right" /></a><br />
<em> low right</em><br />
<em> low left</em><br />
<em> low forw</em></p></blockquote>
<p><em> goto main</em></p>
<p><em>gostop:<br />
</em></p>
<blockquote><p><em> low back</em><br />
<em> low right</em><br />
<em> low left</em><br />
<em> low forw</em></p></blockquote>
<p><em> goto main</em></p>
<p><em>goforward:<br />
</em></p>
<blockquote><p><em> low back</em><br />
<em> low right</em><br />
<em> low left</em><br />
<em> high forw</em></p></blockquote>
<p><em> goto main</em></p>
<p><em>gobackward:<br />
</em></p>
<blockquote><p><em> high back</em><br />
<em> low right</em><br />
<em> low left</em><br />
<em> low forw</em></p></blockquote>
<p><em> goto main</em></p>
<p><em>goforwardright:<br />
</em></p>
<blockquote><p><em> low back</em><br />
<em> high right</em><br />
<em> low left</em><br />
<em> high forw</em></p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/rcpcbfront.jpg" title="rcpcbfront.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/rcpcbfront.jpg" title="rcpcbfront.jpg" alt="rcpcbfront.jpg" align="right" /></a></p></blockquote>
<p><em> goto main</em></p>
<p><em>goforwardleft:<br />
</em></p>
<blockquote><p><em> low back</em><br />
<em> low right</em></p>
<p><em> high left</em><br />
<em> high forw</em></p></blockquote>
<p><em> goto main</em></p>
<p><em>gobackwardleft:<br />
</em></p>
<blockquote><p><em> high back</em><br />
<em> low right</em></p>
<p><em> high left</em><br />
<em> low forw</em></p></blockquote>
<p><em> goto main</em></p>
<p><em>gobackwardright:<br />
</em></p>
<blockquote><p><em> high back</em><br />
<em> low right</em><br />
<em> high left</em></p>
<p><em> low forw</em></p></blockquote>
<p><em> goto main</em></p>
<p>Next a simple <a href="http://www.roborealm.com">Roborealm</a> interface was written to take keyboard commands as input and output the appropriate serial commands.  The car can now be driven from Roborealm. Here is a picture of the picaxe based interface board. The process of making this board deserves a page of its own.</p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=471</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Voice Controlled RoboQuad</title>
		<link>http://profmason.com/?p=464</link>
		<comments>http://profmason.com/?p=464#comments</comments>
		<pubDate>Tue, 04 Dec 2007 08:24:11 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[PicAXE]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=464</guid>
		<description><![CDATA[ 
I adapted the Picaxe based Robosapien Control unit by just changing the IR header from 0011 to 0110.  I finally found a set of Roboquad IR commands at AiboHack.    Later that same day Robert from Robosapien Dance Machine emailed me an even more complete set of codes.    [...]]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/3lZ30apKLuU"></param> <embed src="http://www.youtube.com/v/3lZ30apKLuU" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/roboquad.jpg" title="roboquad.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/roboquad.thumbnail.jpg" title="roboquad.jpg" alt="roboquad.jpg" align="right" /></a>I adapted the <a href="http://profmason.com/?p=448">Picaxe based Robosapien Control unit</a> by just changing the IR header from 0011 to 0110.  I finally found a set of Roboquad IR commands at <a href="http://www.aibohack.com/robosap/ir_codes_quad.htm">AiboHack</a>.    Later that same day Robert from <a href="http://www.robodance.com/">Robosapien Dance Machine</a> emailed me an even more complete set of codes.    <a href="http://profmason.com/wp-content/uploads/2007/12/roboquadircodes.txt" title="roboquadircodes.txt">roboquadircodes.txt</a></p>
<p>I initially got the RoboQuad responding to simple commands and then moved to interfacing it with RoboRealm.  It turns out that the RoboQuad is a lousy platform for computer vision because it jerks around so much.  I mounted a camera on the top of the RoboQuad and spent some unsuccessful time trying to do something useful with it.</p>
<p>Finally I decided to implement voice control for the RoboQuad.   I used the microsoft speech SDK through roborealm to detect voice commands and then on those send IR commands through the PicAXE based IR transmitter to the robot. Right now the RoboQuad only understands Forward, Right, Left, Backward, Stop and Again.   Here is a video of the RoboQuad walking around under voice command.   <a href="http://profmason.com/wp-content/uploads/2007/12/roboquad.MOV" title="roboquad.MOV">roboquad.MOV  </a>It isn&#8217;t quite as smooth as what Robert achieved with his demonstration video, but I suspect that I need to mess with the timing in the speech recognition.  There is about a second delay between recognition and sending out the command.</p>
<p>Here is a first stab at embedding a YouTube video:<br />
<object height="350" width="425"></object><param name="movie" value="http://www.youtube.com/v/D7UYFmMHrNg"></param>  <embed src="http://www.youtube.com/v/D7UYFmMHrNg" type="application/x-shockwave-flash" height="350" width="425"></embed>Here is a video from the camera mounted on the RoboQuad<object height="350" width="425"></object><param name="movie" value="http://www.youtube.com/v/8yhZrUfiyX0"></param><embed src="http://www.youtube.com/v/8yhZrUfiyX0" type="application/x-shockwave-flash" height="350" width="425"></embed>A final video of the Roboquad navigating under voice control using &#8220;smoother&#8221; voice commands<br />
<object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/17qoEXctutU"></param>  <embed src="http://www.youtube.com/v/17qoEXctutU" type="application/x-shockwave-flash" height="350" width="425"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=464</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://profmason.com/wp-content/uploads/2007/12/roboquad.MOV" length="5281252" type="video/quicktime" />
		</item>
		<item>
		<title>USBCar Dream Cheeky driver</title>
		<link>http://profmason.com/?p=460</link>
		<comments>http://profmason.com/?p=460#comments</comments>
		<pubDate>Sun, 02 Dec 2007 05:26:57 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=460</guid>
		<description><![CDATA[Previously I took apart my new Dream Cheeky USB RC car.  Now I want to develop a driver that will allow me to control it from my own software.  I knew that it followed the HID device protocol because USBHID was included in the installation.
If you are new to HID devices, you should [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://profmason.com/wp-content/uploads/2007/12/dreamcheekysoftware.JPG" title="dreamcheekysoftware.JPG"><img src="http://profmason.com/wp-content/uploads/2007/12/dreamcheekysoftware.JPG" title="dreamcheekysoftware.JPG" alt="dreamcheekysoftware.JPG" align="right" /></a>Previously I took apart my new Dream Cheeky USB RC car.  Now I want to develop a driver that will allow me to control it from my own software.  I knew that it followed the HID device protocol because USBHID was included in the installation.</p>
<p>If you are new to HID devices, you should check out <a href="http://www.lvr.com/">Jan Axelson&#8217;s page</a>.  Jan&#8217;s books have been inspirational for me for years!  (Starting with the serial port book years ago)</p>
<p>I started with a program called SimpleHIDwrite which will let me write raw values to a HID device.</p>
<p>On opening SimpleHIDWrite the Dream Cheeky USB car shows up as a device called the &#8220;Rocket Baby&#8221; Pretty funny.</p>
<p>The device returns the following information from a info request:</p>
<p>PID 0A81<br />
VID 0702</p>
<p>When the car is in the charger  and the car is charging the driver returns:</p>
<p>RD 00 05</p>
<p>When the car is fully charged the driver returns:</p>
<p>RD 00 85</p>
<p>When the car is out of the charger the driver returns nothing.</p>
<p>Writing a 01 to the driver causes the car to go forward (That was a surprise!)</p>
<p>Here is a table with the rest of the commands in HEX</p>
<p>$01 Forward</p>
<p>$02  Right</p>
<p>$20 Left</p>
<p>$04 Backward Right</p>
<p>$08 <a href="http://profmason.com/wp-content/uploads/2007/12/usbcar.JPG" title="usbcar.JPG"><img src="http://profmason.com/wp-content/uploads/2007/12/usbcar.JPG" title="usbcar.JPG" alt="usbcar.JPG" align="right" /></a>Backward</p>
<p>$10  Backward Left</p>
<p>$00 STOP!</p>
<p>Thats it!  Now if I can talk the roborealm folks into changing their Dream Cheeky driver to include this I will be set.  Otherwise I will have to start coding&#8230;&#8230;</p>
<p>Ok, so I started coding a little bit.  I downloaded Jan&#8217;s VB6 HID module and got it working with the USB car.  I have to stop working on this or I will be up all night!</p>
<p>So I wrote a simple windows program to control the Car.  It uses Jan Axelson&#8217;s HID module and has a simple mouse interface to drive the car.  There really were other things I should have been doing tonight!  Download the program here!<a href="http://profmason.com/wp-content/uploads/2007/12/usbcar.exe" title="usbcar.exe"> </a><a href="http://profmason.com/wp-content/uploads/2007/12/usbcar.exe" title="usbcar.exe">usbcar.exe</a></p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=460</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dream Cheeky USB car</title>
		<link>http://profmason.com/?p=455</link>
		<comments>http://profmason.com/?p=455#comments</comments>
		<pubDate>Sun, 02 Dec 2007 04:20:54 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=455</guid>
		<description><![CDATA[The Dream Cheeky USB car is a small remote control car that can be controlled from you PC.  Taking apart the transmitter side there is a single chip covered in potting compound and two crystals, one at 12Mhz and the other at 27.2 Mhz.  There is an antenna wrapped around the enclosure, but [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://profmason.com/wp-content/uploads/2007/12/usbcar-transmitter.jpg" title="usbcar-transmitter.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/usbcar-transmitter.jpg" title="usbcar-transmitter.jpg" alt="usbcar-transmitter.jpg" align="right" /></a>The Dream Cheeky USB car is a small remote control car that can be controlled from you PC.  Taking apart the transmitter side there is a single chip covered in potting compound and two crystals, one at 12Mhz and the other at 27.2 Mhz.  There is an antenna wrapped around the enclosure, but this antenna is to short to be an effective 1/4 length antenna for either frequency.    The antenna is about 30 cm long which would correspond to a frequency of 260 Mhz.  Here is a picture of the transmit side.  The potted in chip is on the other side of the board along with a bunch of surface mount resistors.  The first hack was to run the transmit antenna straight up in a drinking straw.   This increased the range of the car out to about 1.4 meters.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/inside-usbcar.jpg" title="inside-usbcar.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/inside-usbcar.jpg" title="inside-usbcar.jpg" alt="inside-usbcar.jpg" align="right" /></a>I then took the car apart.  There are a couple of transistors used to drive the motors. There is a small pot that can adjust the receive frequency.  The steering is done by energizing a small electromagnet that drives the front wheels and there is a small gear motor in the back which drives the rear wheels.  A small battery provides power and is wired to the two contacts in the back for charging. The cars antenna is wound up inside the top of the car.  I unwound its antenna and ran it up a drinking straw.  Now the range increased to about 2.4 meters.  These seem like small changes, but they dramatically effect the performance of the car.</p>
<p>The next task is to figure out how to control the car from some application other then the provided dream cheeky software.  The driver uses the USBHID dll so it should be pretty easy to take over.   There is some amount of documentation on the net about another dream cheeky product &#8220;Dream Cheeky USB missile launcher&#8221; so that might be a starting point for writing software for this device.</p>
<p>Ultimately I would like to control this car from <a href="http://www.roborealm.com" target="_blank">Roborealm</a>.</p>
<p>Here is a short video of the car driving controlled from the computer station several meters away.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/100_1279.MOV" title="100_1279.MOV">USB CAR.MOV</a></p>
<p>Here is a picture of the finished product.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/usbcarantennamod.jpg" title="usbcarantennamod.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/usbcarantennamod.jpg" alt="usbcarantennamod.jpg" /></a></p>
<p>H</p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=455</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://profmason.com/wp-content/uploads/2007/12/100_1279.MOV" length="304950" type="video/quicktime" />
		</item>
		<item>
		<title>Controlling Robosapien from Roborealm</title>
		<link>http://profmason.com/?p=451</link>
		<comments>http://profmason.com/?p=451#comments</comments>
		<pubDate>Wed, 28 Nov 2007 09:26:19 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=451</guid>
		<description><![CDATA[After completing the PicAXE based Robosapien control unit, I wanted to interface it to Roborealm.  Since the PC Robosapien interface I built just takes serial commands and sends out Robosapien IR, it was pretty straight forward to get it working using the serial module at 4800 8N1.   I put together a quick [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://profmason.com/wp-content/uploads/2007/11/robofield.jpg" title="robofield.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/robofield.jpg" title="robofield.jpg" alt="robofield.jpg" align="right" /></a>After completing the PicAXE based <a href="http://profmason.com/?p=448" target="_blank">Robosapien control unit</a>, I wanted to interface it to <a href="http://www.roborealm.com/">Roborealm</a>.  Since the PC Robosapien interface I built just takes serial commands and sends out Robosapien IR, it was pretty straight forward to get it working using the serial module at 4800 8N1.   I put together a quick arena to provide a good surface and background for the Robosapien and started working on implementing the path planning module to design a path based on an overhead camera looking at a series of waypoints, in this case the Robosapiens bowling pins.   The biggest problem right now is that the Robosapien moves around so much from side to side it is difficult to track his orientation relative to the path.</p>
<p>Here is a video of the Robosapien moving under roborealm control.  <a href="http://profmason.com/wp-content/uploads/2007/11/robosapien.avi" title="robosapien.avi">robosapien.avi</a></p>
<p>There is an excellent tutorial on path planning on the <a href="http://www.roborealm.com/tutorial/Path_Planning/slide010.php" target="_blank">Roborealm website</a>.</p>
<p>There is much more work to be done on this.</p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=451</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://profmason.com/wp-content/uploads/2007/11/robosapien.avi" length="4473944" type="video/x-msvideo" />
		</item>
		<item>
		<title>39.2 Khz signal modulated at 1200baud for Robosapien</title>
		<link>http://profmason.com/?p=448</link>
		<comments>http://profmason.com/?p=448#comments</comments>
		<pubDate>Mon, 26 Nov 2007 08:41:03 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[PicAXE]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=448</guid>
		<description><![CDATA[This is a work in progress.  (It now works!)
I setup the pwmout to provide close enough to 39.2 kHz and feed that into an AND gate.  The other input of the AND gate is an output from the picaxe. I send T1200 signals out from the output and into the AND gate which [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://profmason.com/wp-content/uploads/2007/11/irtransmitter.jpg" title="irtransmitter.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/irtransmitter.jpg" title="irtransmitter.jpg" alt="irtransmitter.jpg" align="right" /></a>This is a work in progress.  (It now works!)</p>
<p>I setup the pwmout to provide close enough to 39.2 kHz and feed that into an AND gate.  The other input of the AND gate is an output from the picaxe. I send T1200 signals out from the output and into the AND gate which results in a 39.2 Khz carrier modulated at 1200 baud.   Great so far!</p>
<p>BUT!  The Wowee protocol wants a header that looks like this %11111111 followed by a time spaced pattern where a high is 0001 and a low is 01. If I code up a typical pattern for say &#8220;Walk forward&#8221; or $86 it looks like %11111111,%000101010,%01010001,%00010100</p>
<p>It took me the longest time, but I think I know what isn&#8217;t working.  Looking at the output on a scope there is a single low to high transition between each 8 bit transmission.  This is messing up all my timing.  I assume this is the &#8220;1 stop bit&#8221; in the 8n1.  I don&#8217;t know where to go from here.  Maybe if I sleep on it I will have some ideas in the morning.  Otherwise, I will have to give up on the Picaxe for this project.</p>
<p>UPDATE:</p>
<p>After learning that the V2 protocal is 12 bits long, (From building a receiver and tying it to a scope)  and getting an idea from Hippy on the Picaxe forum the project is now working.  Here is the code</p>
<ul>
<li> &#8216;RoboSapien IR control using picaxe 08M<br />
&#8216;Pass commands at 4800 baud 8N1 from your terminalsetfreq m8&#8242;IR is modulated by channel 1<br />
symbol IR = 1<br />
&#8216;This is a dummy variable to make pulsout work<br />
symbol dum = 4&#8242;These are values to make the timing work<br />
symbol duration = 88<br />
symbol start = 1203<br />
symbol highbit = 560<br />
&#8217;start the pwm module<br />
pwmout 2,50,100<br />
main:<br />
low ir<br />
&#8216;refresh the pwm module<br />
pwmout 2,50,100<br />
pause 50<br />
&#8216;Get a value from the terminal<br />
serin 4,N2400,b0<br />
pause 10&#8242;Init and WAKEUP sequence<br />
high IR<br />
pulsout dum,start<br />
&#8216;RSV2 header is always 0011 0<br />
low IR<br />
pulsout dum,duration<br />
high IR<br />
pulsout dum,duration<br />
&#8216;This bit is low            0<br />
low IR<br />
pulsout dum,duration<br />
high IR<br />
pulsout dum,duration<br />
&#8216;This bit is high           1<br />
low IR<br />
pulsout dum,highbit<br />
high IR<br />
pulsout dum,duration<br />
&#8216;This bit is high           1<br />
low IR<br />
pulsout dum,highbit<br />
high IR<br />
pulsout dum,duration<br />
&#8216;END HEADER</p>
<p>&#8216;logic</p>
<p>if bit7 = 0 then<br />
gosub lowsignal<br />
else<br />
gosub highsignal<br />
endif<br />
if bit6 = 0 then<br />
gosub lowsignal<br />
else<br />
gosub highsignal<br />
endif<br />
if bit5 = 0 then<br />
gosub lowsignal<br />
else<br />
gosub highsignal<br />
endif<br />
if bit4 = 0 then<br />
gosub lowsignal<br />
else<br />
gosub highsignal<br />
endif<br />
if bit3 = 0 then<br />
gosub lowsignal<br />
else<br />
gosub highsignal<br />
endif<br />
if bit2 = 0 then<br />
gosub lowsignal<br />
else<br />
gosub highsignal<br />
endif<br />
if bit1 = 0 then<br />
gosub lowsignal<br />
else<br />
gosub highsignal<br />
endif<br />
if bit0 = 0 then<br />
goto finallowsignal<br />
else<br />
goto finalhighsignal<br />
endif</p>
<p>goto main</p>
<p>highsignal:<br />
&#8216;This bit is high          1<br />
low IR<br />
pulsout dum,highbit<br />
high IR<br />
return</p>
<p>lowsignal:<br />
&#8216;This bit is low           0<br />
low IR<br />
pulsout dum,duration<br />
high IR<br />
return</p>
<p>finalhighsignal:<br />
&#8216;This bit is high          1<br />
low IR<br />
pulsout dum,highbit<br />
high IR<br />
pulsout dum,2<br />
goto main</p>
<p>finallowsignal:<br />
&#8216;This bit is low           0<br />
low IR<br />
pulsout dum,duration<br />
high IR<br />
pulsout dum,2<br />
goto main</li>
</ul>
<p>A quick note on the IR transmitter stage.  I adapted this from the <a href="http://www.robotroom.com/Infrared555.html">robotroom</a>.  He has a nice writeup on using a 555 to drive a IR transmitter.  However, the PicAxe pwmout gives a reasonable alternative.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/irdriver.JPG" title="irdriver.JPG"><img src="http://profmason.com/wp-content/uploads/2007/11/irdriver.JPG" title="irdriver.JPG" alt="irdriver.JPG" align="left" /></a><a href="http://profmason.com/wp-content/uploads/2007/11/dso.jpg" title="dso.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/dso.jpg" title="dso.jpg" alt="dso.jpg" align="right" /></a></p>
<p>Finally just for fun I tried taking pictures of the oscilloscope screen with the digital camera.   This is not of any particular signal, but it works better then I expected!  I remember using a special adapter to take Polaroids of Oscope screens back in the day&#8230;..</p>
<p>Because this project was such a pain, I bought a new scope written about elsewhere.  I love it!  Here is a wowee signal on the new scope.  Where was this a few weeks ago! Note that the 0011 header followed by the device command.  In this case it is 10010000  This corresponds to the master program command (Or the D button on the remote)</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/12/woweeir.jpg" title="woweeir.jpg"><img src="http://profmason.com/wp-content/uploads/2007/12/woweeir.jpg" alt="woweeir.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=448</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Vex Competition 11/22/07 LA Valley College</title>
		<link>http://profmason.com/?p=433</link>
		<comments>http://profmason.com/?p=433#comments</comments>
		<pubDate>Fri, 23 Nov 2007 04:09:54 +0000</pubDate>
		<dc:creator>profmason</dc:creator>
				<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://profmason.com/?p=433</guid>
		<description><![CDATA[The Mt. Sac society of physics students mentored a team to the Small Manufacturers association Vex Robotics competition. Here is a picture of the team:

Not pictured are advisors Ben Chu and Profmason.
The competition is supposed to run five rounds with the best win/loss and point ratio being ranked into the top eight at the end [...]]]></description>
			<content:encoded><![CDATA[<p>The Mt. Sac society of physics students mentored a team to the Small Manufacturers association Vex Robotics competition. Here is a picture of the team:</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/vex1.jpg" title="vex1.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/vex1.jpg" alt="vex1.jpg" /></a><br />
Not pictured are advisors Ben Chu and Profmason.</p>
<p>The competition is supposed to run five rounds with the best win/loss and point ratio being ranked into the top eight at the end of the competition.  This competition had 46 teams!  This meant there were approximately 250 people actively competing!  The large number of competitors made it difficult for the event organizers, but the did a great job of keeping the event moving and organized.</p>
<p>Each round consists of four robots in two teams of two.  The round starts with a twenty second autonomous navigation period, is scored and then there is a two minute remote control period.  Rules for the competition are available here.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/vexround1.jpg" title="vexround1.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/vexround1.jpg" alt="vexround1.jpg" /></a></p>
<p>Here you can seem Team Wacbot with their alliance partners.  Their alliance partners was one of several all girl teams mentored by the Girl Scouts of America.  I can barely wait to sign my daughter up for girl scouts!</p>
<p>Unfortuately, during the autonomous navigation round, WacBot got  caught up on a ring and wasn&#8217;t responding to controls.  It spent the entire round sitting stuck on the ring.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/vexmotorrebuild.jpg" title="vexmotorrebuild.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/vexmotorrebuild.jpg" alt="vexmotorrebuild.jpg" /></a></p>
<p>The students did a terrific job of problem solving and ended up tearing out, rebuilding and reinstalling the stripped motor in less then twenty minutes!  The students decided to make some substantial design changes to the robot to prevent this problem from happening again!</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/vexredsign.jpg" title="vexredsign.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/vexredsign.jpg" alt="vexredsign.jpg" /></a></p>
<p>Unfortunately their chief programmer didn&#8217;t make it to the competition.  (He had been up all night the night before coding the autonomous mode!)  The vex control box with the program installed had stopped responding on two channels.  The students swapped in a different control box, but this lacked the autonomous programming.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/wacbotgood.jpg" title="wacbotgood.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/wacbotgood.jpg" alt="wacbotgood.jpg" /></a></p>
<p>After the modifcations, Wacbot was hot!  With Kevin driving they racked up ring after ring on the high tower, setting the competition record for rings on the high tower!  They triumphed their next two rounds and ended up in 9th place out of a field of 46!</p>
<p>Then they were struck by disaster again.  The arm pivot had been doing such yeoman work hoisting rings that it stripped out in the middle of a match!  The students tore the pivot mechanism apart and rebuilt it.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/armpivot.jpg" title="armpivot.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/armpivot.jpg" alt="armpivot.jpg" /></a></p>
<p>They finished the rebuild and rushed to the competition stand.  Then they found out that the last rounds had been canceled due to time constraints!  The organizers had done their best, but there were so many teams that they couldn&#8217;t run five rounds.</p>
<p>Here is a picture of the winning robot in the individual rankings.</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/1stplacevex.jpg" title="1stplacevex.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/1stplacevex.jpg" alt="1stplacevex.jpg" /></a></p>
<p>Despite being getting zero points the first round and loosing the arm in another round, the team still finished 27 out of a field of 46!</p>
<p>Here is a picture of a championship round to give you a feel for what the competition looks like.  Four robots battling it out!</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/championshiprnd.jpg" title="championshiprnd.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/championshiprnd.jpg" alt="championshiprnd.jpg" /></a></p>
<p>Overall the team did a terrific job, especially of diagnosing problems on the fly and finding appropriate solutions.  This is a great competition and the organizers, Marty and Ralph from the Small Manufacturers Association deserve major Kudos for putting on an event that inspires so much creativity, ingenuity and hard work!</p>
<p><a href="http://profmason.com/wp-content/uploads/2007/11/teamgood.jpg" title="teamgood.jpg"><img src="http://profmason.com/wp-content/uploads/2007/11/teamgood.jpg" alt="teamgood.jpg" /></a></p>
<p>Team WacBot is hoping to get a spot in the finals at Cal State Northridge in December!</p>
]]></content:encoded>
			<wfw:commentRss>http://profmason.com/?feed=rss2&amp;p=433</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
