<?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>Cantareus &#187; microcontroller</title>
	<atom:link href="http://cantareus.com/tag/microcontroller/feed/" rel="self" type="application/rss+xml" />
	<link>http://cantareus.com</link>
	<description></description>
	<lastBuildDate>Sat, 06 Mar 2010 07:29:44 +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>Printer to Plotter Conversion</title>
		<link>http://cantareus.com/2010/01/printer-to-plotter-conversion/</link>
		<comments>http://cantareus.com/2010/01/printer-to-plotter-conversion/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 10:17:00 +0000</pubDate>
		<dc:creator>Cantareus</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[plotter]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://cantareus.com/?p=117</guid>
		<description><![CDATA[
This is my latest project. Converting a broken Brother MFC-425CN into a small plotter. I used the paper feed mechanism and the printer head with the optical encoders and stripped everything else out of the printer. There are a lot of gears and stuff that are used for cleaning the print heads and pumping away [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cantareus.com/wp-content/uploads/dscf2159.jpg"><img class="alignnone size-full wp-image-122" title="Plotter" src="http://cantareus.com/wp-content/uploads/dscf2159.jpg" alt="" width="614" height="461" /></a></p>
<p>This is my latest project. Converting a broken Brother MFC-425CN into a small plotter. I used the paper feed mechanism and the printer head with the optical encoders and stripped everything else out of the printer. There are a lot of gears and stuff that are used for cleaning the print heads and pumping away ink. There&#8217;s also a second paper feed for picking up the next sheet of paper from the paper tray these prevent the motor from running the same speed both ways.</p>
<p>The up/down movement of the pen is controlled with a small solenoid. Black tape and copper wire are used to hold everything together. The rubber band is to stop the pen jiggling.</p>
<p><a href="http://cantareus.com/wp-content/uploads/dscf2157.jpg"><img class="alignnone size-medium wp-image-120" title="Pen" src="http://cantareus.com/wp-content/uploads/dscf2157-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>A PIC18F2550 decodes the optical encoders to detect which way they are moving and keeps a track of the absolute position of the head and paper feed. The origin is the position everything is in when the usb plug is inserted. There&#8217;s a IR and photo diode underneath the print head that the printer uses to detect the paper.  I should write a routine to find the position of the corner of the paper and set this to the origin every time a new program is run.</p>
<p>One of the optical encoder was acting up. Based on the PCB from the printer I should have been able to use a pair of 10K pull-ups and put the outputs directly into the microcontroller. I should have measured the voltage at a few points on the original PCB while it was running before I destroyed it. I&#8217;m always too quick to destroy stuff. Another problem with the encoders is quickly decoding the position. When things are moving too quickly the microcontroller can&#8217;t keep up.</p>
<p>Driving the motors is done with a pair of h-bridges I built for a different project. These aren&#8217;t shown in the schematic because they aren&#8217;t very good. I&#8217;m might get a pair of motor driver ICs.</p>
<p><a href="http://cantareus.com/wp-content/uploads/plotter-schematic.png"><img class="alignnone size-large wp-image-118" title="Plotter Schematic" src="http://cantareus.com/wp-content/uploads/plotter-schematic-1024x635.png" alt="" width="614" height="381" /></a></p>
<p>The computer software loads a G-Code file and sends movement commands to the plotter. The plotter sends back it&#8217;s new position at the end of each command. This lets the computer know when it can send the next command. The software uses the RS274NGC G-code interpreter.  This can be downloaded from <a href="http://code.google.com/p/rs274ngc/">http://code.google.com/p/rs274ngc/</a>, it makes using G-Code a lot easier. I wasn&#8217;t sure how to handle the Z-Axis because the solenoid only has two positions, up and down. So it takes positive values as down and negative or zero values as up.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/qUV3xwgfZbU&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/qUV3xwgfZbU&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>There&#8217;s a bit of pixelation in the drawings. It&#8217;s really difficult to keep the speed of the motors constant. If I try to use PWM on them they whine and wont move.</p>
<p><a href="http://cantareus.com/wp-content/uploads/plotterdrawing.jpg"><img class="alignnone size-medium wp-image-123" title="Drawing" src="http://cantareus.com/wp-content/uploads/plotterdrawing-232x300.jpg" alt="" width="232" height="300" /></a></p>
<p>Printers are a great source for parts. This printer had</p>
<ul>
<li>2 DC motors</li>
<li>2 stepper motors</li>
<li>A rotary and a linear optical encoder</li>
<li>~10 photo gap detector thingies</li>
<li>A 350&#215;6mm stainless steel rod</li>
<li>Lots and lots of springs</li>
<li>Nylon gears</li>
<li>2 belts</li>
<li>A 30v DC power supply</li>
<li>A phone keypad that shouldn&#8217;t be two hard to separate from the rest of the electronics</li>
</ul>
<p>All for $1.</p>
<p>I&#8217;ve got another two almost identical Epson printers. I want to use the parts from those to make a simple CNC machine for my next project. Next up for this project though is creating a PCB and tiding everything up.</p>
]]></content:encoded>
			<wfw:commentRss>http://cantareus.com/2010/01/printer-to-plotter-conversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lunchbot II</title>
		<link>http://cantareus.com/2008/10/lunchbot-ii/</link>
		<comments>http://cantareus.com/2008/10/lunchbot-ii/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 23:54:49 +0000</pubDate>
		<dc:creator>Cantareus</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[lunchbot]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://cantareus.wordpress.com/?p=73</guid>
		<description><![CDATA[I made my first microcontroller based robot over the weekend. It is far from finished. But it can drive around randomly. Getting something to move randomly was harder than it should have been. I realised overnight that I don&#8217;t actually need a random number generator if I want it to appear to move randomly. I [...]]]></description>
			<content:encoded><![CDATA[<p>I made my first microcontroller based robot over the weekend. It is far from finished. But it can drive around randomly. Getting something to move randomly was harder than it should have been. I realised overnight that I don&#8217;t actually need a random number generator if I want it to appear to move randomly. I just need to use any function that is chaotic.</p>
<p>The motors are controlled using two h-bridges. I&#8217;ve used BD139 and BD140 transistors. They can handle a continuous current of 1.5A. That will be enough for the toy motors I am using.</p>
<p>A PIC16F505 Microchip microcontroller is the brains behind my robot. It&#8217;s a pretty limited chip. It has room for 1024 12-bit instructions and 72 bytes of RAM. I&#8217;ll replace it once I need some extra functionality. I started writing the code in C but I had lots of problems with it. Certain math functions seem to freeze up and I kept getting confusing errors. So I&#8217;m re-writing it in assembly using <a href="http://gputils.sourceforge.net/">gputils</a>.</p>
<p><a href="http://cantareus.files.wordpress.com/2008/10/dscf1196.jpg"><img class="aligncenter size-large wp-image-77" title="Lunchbot" src="http://cantareus.files.wordpress.com/2008/10/dscf1196.jpg?w=500" alt="" width="500" height="374" /></a></p>
<p>As you can see, there isn&#8217;t much to it. Eight transistors to control two motors with a few diodes and resistors and the microcontroller. The container has lots of room to add a big PCB later. In the top right corner you can see a capacitor with the battery leads connected to it. That&#8217;s the power switch. When I want to turn it on I plug that into the breadboard. It&#8217;s a bit crude, I&#8217;ll probably plug it in the wrong way or in the wrong place and fry everything knowing my luck.</p>
<p>I have a few plans for this little robot in the future. I want to give it more brains than any lunch box should ever have. It&#8217;ll be able to create maps and mark locations of interest. I&#8217;ll attempt to make it appear curious so when it finds something it hasn&#8217;t seen before it will keep going back until it isn&#8217;t new anymore. Hopefully I&#8217;ll make more than one and have them communicate via beeps or flashy lights. Then they can follow each other around and have twice as much fun.</p>
<p>I also want it to be able to recharge itself by homing in on a charging station that sends out a beacon.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" 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/P9dTUph_l8Y" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/P9dTUph_l8Y"></embed></object></p>
<p>I only had a 8-bit &#8220;random&#8221; number generator when I videoed this. So It repeats itself twice in that short time.</p>
]]></content:encoded>
			<wfw:commentRss>http://cantareus.com/2008/10/lunchbot-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
