<?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>Zyphht! Robot World</title>
	<atom:link href="http://jerrylparker.com/Robot/Blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://jerrylparker.com/Robot/Blog</link>
	<description>Robot Builder Tips and Tricks</description>
	<lastBuildDate>Fri, 29 Oct 2010 15:35:56 +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>More Arduino code.</title>
		<link>http://jerrylparker.com/Robot/Blog/?p=26</link>
		<comments>http://jerrylparker.com/Robot/Blog/?p=26#comments</comments>
		<pubDate>Fri, 29 Oct 2010 15:35:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jerrylparker.com/Robot/Blog/?p=26</guid>
		<description><![CDATA[Arduino Motor Control program]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really getting to like this arduino..</p>
<p>Want to control a motor? Read a temperature sensor? Know where you are in the world?  Build a robot? Open/Close a door? buld a Christmas display worthy of a CNN segment?</p>
<p>Grab an arduino, spend something like 10 minutes in research and go build it. It is an amazing little tinker-toy.</p>
<p>I&#8217;m working on a little autonomous &#8216;bot that will have as it&#8217;s brain, an arduino Duelimanove. It will be mobile, tracked, contain a 7 seperate sensors, 3 motors, a built in video screen, a camera, and wireless internet connectivity. All based on a single, $29.00, processor that can be programmed with very little programming skill.</p>
<p>Think about that for a minute&#8230; As a guy that worked with Basic Stamps for years, controlling 7 separate sensors on one tiny little pic is&#8230;.. well, it&#8217;s pretty cool, in a geeky way. Add motors, wireless, cameras, motors, etc., and you are in a realm where you needed (at best) a full-blown laptop a couple of years ago.</p>
<p>Now, couple that with open-source development and the ability to simply go online to find code examples for your needs, and you are opening the world of robotics, controllers, animatronics and anything else you can imagine to anyone with an internet connection and the ability to read. I&#8217;m completely geeked-out to see what comes of this little controller in the next several years!</p>
<p>OK &#8211; off of the soapbox; lets look at a little sample code: (controlling a motorized platform)</p>
<p><em>One thing to note: The ArduMoto controller comes in two versions, one that uses Pin 10 and one that uses Pin 3. The earlier version (uses Pin 10)  interferes with servos (which also need pin 10) and may need a modification if you intend to use servos with it. (I&#8217;ll actually discuss this mod in my next post) In the case of this application, I don&#8217;t need any servos, so pin 10 is fine as is.</em></p>
<p>The following code allows you to drive two seperate motors, controlling speed and direction, which will allow you to drive a bot base in any direction.</p>
<p>/*<br />
v.2.0 Jerry Parker<br />
piggy back the ArduMoto on top of the Arduino.</p>
<p>Connect a power supply to the Power connector. and hook up a dc motor to pins<br />
1 and 2, and pins 3 and 4 on the OUTPUT of the ArduMoto. No other conenctions are necessary</p>
<p>Enter 1,2,3,4,5,6,7,8,9 for Speed setting (1 = LOW, 5=MED, 9=HIGH)<br />
then enter motor Control Character<br />
Q-W-E          Forward Left &#8211; Forward &#8211; Forward Right<br />
A-S-D          Rotate Left &#8211; ALL STOP &#8211; Rotate Right<br />
Z-X-C          Reverse Left &#8211; Reverse &#8211; Reverse Right<br />
*/</p>
<p>// defines for ArduMoto<br />
#define MotorAPin 10<br />
#define MotorBPin 11<br />
#define MotorADirection 12<br />
#define MotorBDirection 13</p>
<p>// variables needed by the sketch<br />
int Command;            // raw user input<br />
int MotorSpeed = 0; //set speed to LOW<br />
//use the following setting to balance your motor speed when turning (drifting) left or right</p>
<p>float InsideMotorSpeedAdjust = .5;</p>
<p>void setup()<br />
{<br />
// motor pins must be outputs<br />
pinMode(MotorAPin, OUTPUT);<br />
pinMode(MotorBPin, OUTPUT);<br />
pinMode(MotorADirection, OUTPUT);<br />
pinMode(MotorBDirection, OUTPUT);<br />
Serial.begin(9600);   //Start serial console<br />
HelpMenu();              // and display the menu<br />
}</p>
<p>void loop(){<br />
// wait for serial input<br />
Command = 0;<br />
if (Serial.available() &gt; 0) {  //Wait for Serial port to come ready<br />
Command = Serial.read();   //read incoming byte<br />
// Read a character from the serial port, and act accordingly.<br />
// Characters read in this way come in as ints, and need to be converted to their ascii equivalent.<br />
// there is a great Arduino character chart here:<br />
// http://www.arduino.cc/en/Reference/ASCIIchart<br />
if (Command == 63) {      // entered &#8220;?&#8221;, show menu<br />
HelpMenu();<br />
}<br />
if (Command == 49) {      // entered 1; SPEED 10%<br />
MotorSpeed=25;<br />
}<br />
if (Command == 50) {      // entered 2; Speed 20%<br />
MotorSpeed=51;<br />
}<br />
if (Command == 51) {      // entered 3; Speed 30%<br />
MotorSpeed=76;<br />
}<br />
if (Command == 52) {      // entered 4; Speed 40%<br />
MotorSpeed=102;<br />
}<br />
if (Command == 53) {      // entered 5; Speed 50%<br />
MotorSpeed=127;<br />
}<br />
if (Command == 54) {      // entered 6; Speed 60%<br />
MotorSpeed=153;<br />
}<br />
if (Command == 55) {      // entered 7; Speed 70%<br />
MotorSpeed=178;<br />
}<br />
if (Command == 56) {      // entered 8; Speed 80%<br />
MotorSpeed=204;<br />
}<br />
if (Command == 57) {      // entered 9; Speed 90%<br />
MotorSpeed=229;<br />
}<br />
if (Command == 48) {      // entered 0; Speed 100%<br />
MotorSpeed=255;<br />
}<br />
// Following are the MOVE commands<br />
if (Command == 83) {      // entered S; Stop All<br />
ProcessCommand(0);<br />
}<br />
if (Command == 81) {      // entered Q; Left Forward<br />
ProcessCommand(1);<br />
}<br />
if (Command == 87) {      // entered W; Forward<br />
ProcessCommand(2);<br />
}<br />
if (Command == 69) {      // entered E; Forward RIGHT<br />
ProcessCommand(3);<br />
}<br />
if (Command == 65) {      // entered A; Rotate Left<br />
ProcessCommand(4);<br />
}<br />
if (Command == 68) {      // entered D; Rotate Right<br />
ProcessCommand(5);<br />
}<br />
if (Command == 90) {      // entered Z; Reverse Left<br />
ProcessCommand(6);<br />
}<br />
if (Command == 88) {      // entered X; Reverse<br />
ProcessCommand(7);<br />
}<br />
if (Command == 67) {      // entered C; Reverse Right<br />
ProcessCommand(8);<br />
}<br />
}<br />
}</p>
<p>// process a command string<br />
void ProcessCommand(int Command) {<br />
Serial.print(&#8220;Speed: &#8220;);<br />
Serial.println(MotorSpeed);<br />
// check commands<br />
switch(Command) {<br />
case 0:<br />
//all stop<br />
Serial.println(&#8220;All Stop&#8221;);<br />
analogWrite(MotorAPin, 0);<br />
analogWrite(MotorBPin, 0);<br />
break;<br />
case 1:<br />
Serial.println(&#8220;FORWARD LEFT&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed));<br />
digitalWrite(MotorADirection, LOW);<br />
analogWrite(MotorBPin, (MotorSpeed*InsideMotorSpeedAdjust));<br />
digitalWrite(MotorBDirection, HIGH);<br />
break;<br />
case 2:<br />
Serial.println(&#8220;FORWARD&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed));<br />
digitalWrite(MotorADirection, LOW);<br />
analogWrite(MotorBPin, (MotorSpeed));<br />
digitalWrite(MotorBDirection, HIGH);<br />
break;<br />
case 3:<br />
Serial.println(&#8220;FORWARD RIGHT&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed*InsideMotorSpeedAdjust));<br />
digitalWrite(MotorADirection, LOW);<br />
analogWrite(MotorBPin, (MotorSpeed));<br />
digitalWrite(MotorBDirection, HIGH);<br />
break;<br />
case 4:<br />
Serial.println(&#8220;Rotate LEFT&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed));<br />
digitalWrite(MotorADirection, LOW);<br />
analogWrite(MotorBPin, (MotorSpeed));<br />
digitalWrite(MotorBDirection, LOW);<br />
break;<br />
case 5:<br />
Serial.println(&#8220;Rotate RIGHT&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed));<br />
digitalWrite(MotorADirection, HIGH);<br />
analogWrite(MotorBPin, (MotorSpeed));<br />
digitalWrite(MotorBDirection, HIGH);<br />
break;<br />
case 6:<br />
Serial.println(&#8220;REVERSE LEFT&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed));<br />
digitalWrite(MotorADirection, HIGH);<br />
analogWrite(MotorBPin, (MotorSpeed*InsideMotorSpeedAdjust));<br />
digitalWrite(MotorBDirection, LOW);<br />
break;<br />
case 7:<br />
Serial.println(&#8220;REVERSE&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed));<br />
digitalWrite(MotorADirection, HIGH);<br />
analogWrite(MotorBPin, (MotorSpeed));<br />
digitalWrite(MotorBDirection, LOW);<br />
break;<br />
case 8:<br />
Serial.println(&#8220;REVERSE RIGHT&#8221;);<br />
analogWrite(MotorAPin, (MotorSpeed*InsideMotorSpeedAdjust));<br />
digitalWrite(MotorADirection, HIGH);<br />
analogWrite(MotorBPin, (MotorSpeed));<br />
digitalWrite(MotorBDirection, LOW);<br />
break;<br />
}<br />
}</p>
<p>void HelpMenu() {<br />
Serial.println(&#8220;Arduino MINI_BOT Robot Controller V2.0 by Jerry Parker&#8221;);<br />
Serial.println(&#8220;Menu. Enter letter to execute&#8221;);<br />
Serial.println(&#8220;? &#8211; Help Menu&#8221;);<br />
Serial.println(&#8220;&#8212;-Motor Commands&#8212;-&#8221;);<br />
Serial.println(&#8220;1-0 &#8211; Motor Speed in percent (0=100)&#8221;);<br />
Serial.println(&#8220;Q-W-E &#8211; Forward LEft &#8211; Forward &#8211; Forward Right&#8221;);<br />
Serial.println(&#8220;A-S-D &#8211; Rotate Left &#8211; STOP &#8211; Rotate Right&#8221;);<br />
Serial.println(&#8220;Z-X-C &#8211; Rev Left &#8211; Reverse &#8211; Rev Right&#8221;);<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://jerrylparker.com/Robot/Blog/?feed=rss2&amp;p=26</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new robot Project!</title>
		<link>http://jerrylparker.com/Robot/Blog/?p=25</link>
		<comments>http://jerrylparker.com/Robot/Blog/?p=25#comments</comments>
		<pubDate>Wed, 20 Oct 2010 17:05:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jerrylparker.com/Robot/Blog/?p=25</guid>
		<description><![CDATA[I&#8217;ve teamed up with Zagros Robotics (www.zagrosrobotics.com) to create a new robot application on the Arduino Platform. Check out their bbs for more info @ www.zagrosrobotics.com/bbs 
I&#8217;ll be posting bits and pieces of the work here, as this platform is built, so check back for source code and assembly tips and the like!
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve teamed up with Zagros Robotics (www.zagrosrobotics.com) to create a new robot application on the Arduino Platform. Check out their bbs for more info @ www.zagrosrobotics.com/bbs </p>
<p>I&#8217;ll be posting bits and pieces of the work here, as this platform is built, so check back for source code and assembly tips and the like!</p>
]]></content:encoded>
			<wfw:commentRss>http://jerrylparker.com/Robot/Blog/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Arduino vs Basic Stamp</title>
		<link>http://jerrylparker.com/Robot/Blog/?p=11</link>
		<comments>http://jerrylparker.com/Robot/Blog/?p=11#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:00:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Basic Stamp]]></category>
		<category><![CDATA[Compare]]></category>
		<category><![CDATA[Servo Controller]]></category>

		<guid isPermaLink="false">http://jerrylparker.com/Robot/Blog/?p=11</guid>
		<description><![CDATA[Ok &#8211; I admit it, I&#8217;m a bit late to this Arduino thing. I&#8217;ve been using Parallax Basic Stamps for years to do little projects. It&#8217;s been an invaluable tool. I&#8217;ve built controllers of all sorts using it, from sensor controllers to LED sequencers to, well, everything in between. The basic stamp is quite a [...]]]></description>
			<content:encoded><![CDATA[<p>Ok &#8211; I admit it, I&#8217;m a bit late to this Arduino thing. I&#8217;ve been using Parallax Basic Stamps for years to do little projects. It&#8217;s been an invaluable tool. I&#8217;ve built controllers of all sorts using it, from sensor controllers to LED sequencers to, well, everything in between. The basic stamp is quite a little controller. So, I was a little slow to pick up the Arduino. It was like my favorite sneakers. Comfortable, well suited to me. I didn&#8217;t need the learning curve associated with the Arduino, because I could do all the stuff it did using stamps.</p>
<p>Well, Move Over, Stamp-Boy&#8230;.. There&#8217;s a new kid in town.</p>
<p>I picked up a couple Arduinos (25 bucks&#8230; Are you kidding me?), and decided to bite the bullet and see what all the fuss was about. I had built a sonar ranger using a servo and an SRF08 ranging sensor using the stamp, so I thought I&#8217;d spend some time duplicating it on the Arduino.</p>
<p>To illustrate the differences, lets look at a servo move program on the stamp:</p>
<blockquote><p>#SELECT $STAMP<br />
#CASE BS2, BS2E, BS2PE<br />
T1200       CON     813<br />
T2400       CON     396<br />
T9600       CON     84<br />
T19K2       CON     32<br />
T38K4       CON     6<br />
#CASE BS2SX, BS2P<br />
T1200       CON     2063<br />
T2400       CON     1021<br />
T9600       CON     240<br />
T19K2       CON     110<br />
T38K4       CON     45<br />
#CASE BS2PX<br />
T1200       CON     3313<br />
T2400       CON     1646<br />
T9600       CON     396<br />
T19K2       CON     188<br />
T38K4       CON     84<br />
#ENDSELECT<br />
Inverted        CON     $4000<br />
Open            CON     $8000<br />
Baud            CON     T9600 + Inverted<br />
&#8216; Above is a standard Basic Stamp Header,<br />
&#8216; I use these in all code, allows use across all stamp models<br />
PanServo      PIN    14<br />
TiltServo      PIN     15<br />
LOW             PanServo<br />
LOW             TiltServo<br />
&#8216;Move Servo&#8217;s all the way to one extreme</p>
<p>FOR T = 1 1 to 100<br />
  FOR i = 0 to 20<br />
    PULSEOUT TiltServo, 300<br />
    PULSEOUT PanServo, 300<br />
    PAUSE 18<br />
  NEXT<br />
  PAUSE 1000    &#8216;wait one second<br />
  &#8216;Move to other extreme<br />
  FOR i = 0 to 20<br />
    PULSEOUT TiltServo, 1200<br />
    PULSEOUT PanServo, 1200<br />
    PAUSE 18<br />
  NEXT<br />
NEXT</p></blockquote>
<p>Phew&#8230;. That&#8217;s a mouthful, but it&#8217;s not so bad when you look at it.. Basically, the code is initilaized, then simply using the PULSEOUT command to send a sting of pulses to move the servo to the desired position. I&#8217;m not going to pick this code apart here, it&#8217;s pretty well commented and you should follow it pretty easily. It&#8217;s not pretty, or elegant, but it works, and it shows you what you need to do.</p>
<p>Now lets contrast that to the Arduino.</p>
<blockquote><p>#include &lt;Servo.h&gt;</p>
<p>Servo panServo;   // create servo object to control Pan Servo<br />
Servo tiltServo;  // create servo object to control Tilt servo<br />
void setup {<br />
Wire.begin();         // setup IC2 serial Interface for other sensors<br />
panServo.attach(8);   // attached pan servo to pin 8<br />
tiltServo.attach(9);  // attached tilt servo to pin 9<br />
}<br />
void loop {<br />
panServo.write(0);<br />
tiltServo.write(0);<br />
delay (1000);<br />
panServo.write(180);<br />
tiltServo.write(180);<br />
delay(1000);<br />
}</p></blockquote>
<p>Quite a difference in code, but both do the same thing; simply move servos from one position extreme to the other. Two things strike me with the Arduino Code set:It&#8217;s simpler to read, and it&#8217;s shorter. To be fair, a LOT of work is done on the include file Servo.H, but programming is very simple. Move a servo to a position (in degrees) between 1 and 180. On the Stamp, you have to actually determine the PWM timing (note the positional statements 300 and 1200). These correspond to the pulse widths. I find it much easier to say &#8220;Servo, Move to 45 degrees&#8221; then to have to figure out the math to determine that I want to send a string of pulses created by the PULSEOUT (750) command. In fact, I never actually *do* the math. I always use trial and error, or simply incrementally move the servo by changing the value of the PULSEOUT command in code. There are lots of references out there to help you determine the actual values of the PULSEOUT argument, google it and you&#8217;ll see them.<br />
For me, however, I&#8217;m converting 100% of my servo needs to Arduino.<br />
Not just for servos, either. Check Back&#8230;.I&#8217;ll post a whole block of code up here where you can see how ONE Arduino is controlling Pan/Tilt, Ranging, Compass, GPS, and a slew of other stuff, too!</p>
]]></content:encoded>
			<wfw:commentRss>http://jerrylparker.com/Robot/Blog/?feed=rss2&amp;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to the new Blog</title>
		<link>http://jerrylparker.com/Robot/Blog/?p=8</link>
		<comments>http://jerrylparker.com/Robot/Blog/?p=8#comments</comments>
		<pubDate>Wed, 10 Mar 2010 23:38:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jerrylparker.com/Robot/Blog/?p=8</guid>
		<description><![CDATA[Hi Everyone.
Managing all the information about the bits-n-pieces of Zyphht Construction was getting to be downright unruly, so I&#8217;ve decided to switch to this format instead.
Here you&#8217;ll find general discussions on code, devices, systems, subsystems, parts, pains, triumphs, and just about anything else I think you might like to read about. I&#8217;ve done a lot [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Everyone.</p>
<p>Managing all the information about the bits-n-pieces of Zyphht Construction was getting to be downright unruly, so I&#8217;ve decided to switch to this format instead.</p>
<p>Here you&#8217;ll find general discussions on code, devices, systems, subsystems, parts, pains, triumphs, and just about anything else I think you might like to read about. I&#8217;ve done a lot of work on Zyphht, and an interested in sharing with you all so that you might share with me some of your ideas.</p>
<p>To Date, I&#8217;ve added to Zyphht:</p>
<ul>
<li>remote control from the web &#8211; you can view live video, pan and tilt the camera, and even drive Zyphht around the place exploring. (as long as I have the main drive enabled)</li>
<li>Sensors, including Compass, GPS, Sonar (x3), Light Sensor, accelerometer and tilt sensors</li>
<li>Arduno (2 of them) &#8211; Man, I like these, I&#8217;ll share the reasons why in another post, but for now &#8211; go get one!!!!</li>
<li>a rudimentary arm (this is VERY rudimantary)</li>
</ul>
<p>Things still to do:</p>
<ul>
<li>Update the web page to give better feedback from the platform</li>
<li>Build an entirely new software package giving realtime control</li>
<li>built the sub-bot (more on this later)</li>
<li>More work on the Arduino control software</li>
<li>replace the HC11 system with yet another arduino</li>
<li>build the robot chassis from aluminum stock</li>
<li>implement more visual functions, such as mappng and nagivating through a room</li>
<li>and more!</li>
</ul>
<p>Zyphht is an experimental platform, so things change. features and functions that are up today could be completely removed tomorrow, and replaced with something entrely different.</p>
<p>If you are interested in the remote control page, look <a title="Remote Control" href="http://70.90.186.22" target="_blank">here</a>. I&#8217;ll require registration, but I won&#8217;t use your for anything other than to track your behavior with the &#8216;bot, and to enable/disable any abusers. Zyphht tells me when you connect, so please be respectful.</p>
]]></content:encoded>
			<wfw:commentRss>http://jerrylparker.com/Robot/Blog/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

