<?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"
	>

<channel>
	<title>Cavalcade of Mammals</title>
	<atom:link href="http://elegans.uky.edu/blog/wp-rss2.php" rel="self" type="application/rss+xml" />
	<link>http://elegans.uky.edu/blog</link>
	<description></description>
	<pubDate>Sun, 22 Nov 2009 23:36:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>End the US occupation of Afghanistan today</title>
		<link>http://elegans.uky.edu/blog/?p=176</link>
		<comments>http://elegans.uky.edu/blog/?p=176#comments</comments>
		<pubDate>Sun, 22 Nov 2009 23:36:52 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=176</guid>
		<description><![CDATA[At the beginning of October, it was reported that eight US soldiers were killed in Nuristan province in Afghanistan.  Hearing it at the time, I thought nothing in Nuristan can be worth the life of an American soldier, yet eight of them fought and died there.  Afghanistan is literally half way around the [...]]]></description>
			<content:encoded><![CDATA[<p>At the beginning of October, it was reported that eight US soldiers were killed in Nuristan province in Afghanistan.  Hearing it at the time, I thought nothing in Nuristan can be worth the life of an American soldier, yet eight of them fought and died there.  Afghanistan is literally half way around the world from the US, and Nuristan is the middle of nowhere even for Afghanistan.  The US has occupied Afghanistan for eight years already and the current plan is for an ongoing, pointless occupation for at least another five or ten years.  President Obama is even considering pouring more US troops into the country, a truly feckless plan.</p>
<p>Then this November the US installed ruler of Afghanistan, &#8216;President&#8217; Karzai, finished stealing the national election and declared himself President.  It was also reported that his brother runs a big piece of the heroin trade and has immunity from US anti-drug efforts because he works for the CIA.  Why are US soldiers fighting and dying to support the Karzai family dictatorship?</p>
<p>What is the US doing in Afghanistan?  The few thousand Al Qaeda fighters that were in Afghanistan in 2001 were killed by the US or fled to Pakistan.  Even the Taliban fighters in Afghanistan don&#8217;t want them back.</p>
<p>Nothing is accomplished by continuing the US occupation of Afghanistan.  It&#8217;s costing the US the lives of our soldiers and $100-200 billion a year.  End the US occupation today!</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=176</wfw:commentRss>
		</item>
		<item>
		<title>PIC servo pot controlled</title>
		<link>http://elegans.uky.edu/blog/?p=175</link>
		<comments>http://elegans.uky.edu/blog/?p=175#comments</comments>
		<pubDate>Sat, 21 Nov 2009 19:04:30 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[hobbies]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=175</guid>
		<description><![CDATA[Third PIC program, this one moves a hobby servo motor using a 10k&#8486; pot.  The pot is read using the A/D converter function on the PIC.  The four high bits of the value are used to control the servo to sixteen positions over its range.  Two more bits could easily be added [...]]]></description>
			<content:encoded><![CDATA[<p>Third PIC program, this one moves a hobby servo motor using a 10k&#8486; pot.  The pot is read using the A/D converter function on the PIC.  The four high bits of the value are used to control the servo to sixteen positions over its range.  Two more bits could easily be added to give finer control.</p>
<p>It has a light that flips on/off with each jump of the servo, another light that is always on and a third that switches the servo on/off.</p>
<p>PIC12F683 servo motor movie:</p>
<p> <object width='480' height='360' id='flvPlayer'><param name='allowFullScreen' value='true'></param><param name='movie' value='player.swf?movie=pics/PIC12F683_servo2.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage='><embed src='player.swf?movie=pics/PIC12F683_servo2.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage=' width='480' height='360' allowFullScreen='true' type='application/x-shockwave-flash'></embed></param>
</object></p>
<p>Here are the code files: <a href="pics/p12_servo2.asm">p12_servo2.asm</a> and <a href="pics/p12_servo2.hex">p12_servo2.hex</a>.</p>
<p>It is wired as shown in the video.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=175</wfw:commentRss>
		</item>
		<item>
		<title>Putting video clips on my blog</title>
		<link>http://elegans.uky.edu/blog/?p=174</link>
		<comments>http://elegans.uky.edu/blog/?p=174#comments</comments>
		<pubDate>Fri, 20 Nov 2009 02:43:25 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[Computers]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=174</guid>
		<description><![CDATA[Putting video clips on my blog was a bit harder than I expected.  I first tried converting the .MOV files the camera writes into .avi files using ffmegX and posting them using &#60;embed&#62; tag code.  The files showed up great on my Mac but not at all on a Windows computer.
Flash format files, [...]]]></description>
			<content:encoded><![CDATA[<p>Putting video clips on my blog was a bit harder than I expected.  I first tried converting the .MOV files the camera writes into .avi files using ffmegX and posting them using &lt;embed&gt; tag code.  The files showed up great on my Mac but not at all on a Windows computer.</p>
<p>Flash format files, .flv, are the easiest cross-platform way to post video clips.  Flash does require that the site supply a Flash player.  There are many Flash players available.  I tried <a href="http://www.osflv.com/">OS FLV</a> and it worked nicely.  </p>
<p>To edit video files I used <a href="http://fixounet.free.fr/avidemux/">avidemux</a>, then <a href="http://www.ffmpegx.com/">ffmegX</a> to convert them to .flv, and I put them on the site using the &#8216;noscript&#8217; &lt;embed&gt; code suggested by OS FLV with the OS FLV player.swf.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=174</wfw:commentRss>
		</item>
		<item>
		<title>PIC servo control</title>
		<link>http://elegans.uky.edu/blog/?p=173</link>
		<comments>http://elegans.uky.edu/blog/?p=173#comments</comments>
		<pubDate>Thu, 19 Nov 2009 16:32:31 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[hobbies]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=173</guid>
		<description><![CDATA[Second PIC program, this one moves a hobby servo motor to one of two positions.  The switch needs to be pulled up with a resistor.
It has one light that is always on and a second that switches on/off when the servo moves.
PIC12F683 servo motor movie:
 

Here are the code files: p12_servo1.asm and p12_servo1.hex.
Assembly of [...]]]></description>
			<content:encoded><![CDATA[<p>Second PIC program, this one moves a hobby servo motor to one of two positions.  The switch needs to be pulled up with a resistor.</p>
<p>It has one light that is always on and a second that switches on/off when the servo moves.</p>
<p>PIC12F683 servo motor movie:</p>
<p> <object width='480' height='360' id='flvPlayer'><param name='allowFullScreen' value='true'></param><param name='movie' value='player.swf?movie=pics/PIC12F683_servo1.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage='><embed src='player.swf?movie=pics/PIC12F683_servo1.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage=' width='480' height='360' allowFullScreen='true' type='application/x-shockwave-flash'></embed></param>
</object></p>
<p>Here are the code files: <a href="pics/p12_servo1.asm">p12_servo1.asm</a> and <a href="pics/p12_servo1.hex">p12_servo1.hex</a>.</p>
<p>Assembly of the .asm to a .hex:<br />
>gpasm p12_servo1.asm</p>
<p>Write it to the PIC12 using:<br />
wine &#8220;C:\\Program Files\\PICPgm\\WinPICPgm.exe&#8221;</p>
<p>It is wired as shown in the video.</p>
<p>The servo timing is off from what I calculated.  A calculated 1ms to 2ms gave about 60 degrees of movement, what&#8217;s shown is 0.75 to 1.25 ms pulses every 20 ms.  I haven&#8217;t measured the pulse lengths with a scope.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=173</wfw:commentRss>
		</item>
		<item>
		<title>PIC first light!</title>
		<link>http://elegans.uky.edu/blog/?p=172</link>
		<comments>http://elegans.uky.edu/blog/?p=172#comments</comments>
		<pubDate>Wed, 18 Nov 2009 03:35:20 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[hobbies]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=172</guid>
		<description><![CDATA[Got my first PIC microprocessor program running on a PIC12F683.
It has one light that is always on and a second that switches on/off.
PIC12F683 LED lighting movie:
 

The assembler code:

----------------------------------------------------------------------------
;************************************
;written by: Jim Lund
;date: 11-09
;version: 1.00
;for PIC: PIC12F683
;Memory: 2048=800h, RAM 128, EEPROM 256
;clock frequency:
;************************************
; PROGRAM FUNCTION: Light one LED
;
;************************************

        list [...]]]></description>
			<content:encoded><![CDATA[<p>Got my first PIC microprocessor program running on a PIC12F683.</p>
<p>It has one light that is always on and a second that switches on/off.</p>
<p>PIC12F683 LED lighting movie:<br />
 <object width='480' height='360' id='flvPlayer'><param name='allowFullScreen' value='true'></param><param name='movie' value='player.swf?movie=pics/PIC12F683_LED.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage='><embed src='player.swf?movie=pics/PIC12F683_LED.flv&#038;bgcolor=0x051615&#038;fgcolor=0x13ABEC&#038;volume=80&#038;autoload=on&#038;autorewind=on&#038;clickurl=&#038;clicktarget=_self&#038;postimage=' width='480' height='360' allowFullScreen='true' type='application/x-shockwave-flash'></embed></param>
</object></p>
<p>The assembler code:</p>
<pre>
----------------------------------------------------------------------------
;************************************
;written by: Jim Lund
;date: 11-09
;version: 1.00
;for PIC: PIC12F683
;Memory: 2048=800h, RAM 128, EEPROM 256
;clock frequency:
;************************************
; PROGRAM FUNCTION: Light one LED
;
;************************************

        list      P = PIC12F683

        include  &#47;usr&#47;local&#47;share&#47;gputils&#47;header&#47;p12f683.inc

        __config _MCLRE_OFF &amp; _INTRC_OSC_NOCLKOUT &amp; _CP_OFF &amp; _WDT_OFF

        errorlevel -302

;------------------------
;Declarations:
        org     0x000
        goto    Start

;-----------------------
;Subroutines:

Init

        clrf    STATUS;
        clrf    GPIO ; resets input/output ports

        bsf     STATUS,RP0 ;Bank 1
        ;movlw  b'00000000'
        ;movwf  OSCTUNE

        bcf     STATUS,RP0 ;Bank 0
        movlw   b'00000111'     ;comparator off
        movwf   CMCON0  ;digital IO
        bsf     STATUS,RP0 ;Bank 1
        clrf    ANSEL   ; digital IO

        movlw   b'001111'      ; sets up which GPIO pins are inputs and which
        movwf   TRISIO          ; are outputs

        movlw   b'00000111'      ; option bits
        movwf   OPTION_REG
        bcf     STATUS,RP0 ;Bank 0
        retlw   0
;-------------------------
;Program Start:
Start
        call   Init
Main
        bsf     GPIO, 4  ; turns on LED

        btfss   GPIO, 0 ;test pin 7, next if pin is 0
        goto LEDoff
        bsf     GPIO, 5 ; turns on LED
        goto Main

LEDoff  bcf     GPIO, 5 ; turns off LED
        goto Main

        END
----------------------------------------------------------------------------
</pre>
<p>Assembly of the .asm to a .hex:<br />
>gpasm p12_led.asm</p>
<p>Write it to the PIC12 using:<br />
wine &#8220;C:\\Program Files\\PICPgm\\WinPICPgm.exe&#8221;</p>
<p>and wire it up as shown in the video!</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=172</wfw:commentRss>
		</item>
		<item>
		<title>Hobby molecular biology</title>
		<link>http://elegans.uky.edu/blog/?p=171</link>
		<comments>http://elegans.uky.edu/blog/?p=171#comments</comments>
		<pubDate>Mon, 16 Nov 2009 22:19:24 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[Science]]></category>

		<category><![CDATA[ideas]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=171</guid>
		<description><![CDATA[What would be required to set up an inexpensive system for hobbyists to experiment with biology?  Consider PCR for example.  PCR requires heat stable polymerase, primers, nucleotides, buffer.
The DNA polymerase is easy to purify from E. coli carrying the plasmid.  Grow bacteria containing plasmid expressing Taq DNA polymerase, boil, spin down denatured [...]]]></description>
			<content:encoded><![CDATA[<p>What would be required to set up an inexpensive system for hobbyists to experiment with biology?  Consider PCR for example.  PCR requires heat stable polymerase, primers, nucleotides, buffer.</p>
<p>The DNA polymerase is easy to purify from <em>E. coli</em> carrying the plasmid.  Grow bacteria containing plasmid expressing <em>Taq</em> DNA polymerase, boil, spin down denatured proteins, and you are left with the DNA polymerase. </p>
<p>Primers can be bought inexpensively&#8211;$0.35 per base, a pair of 18-mers cost less than the shipping.  Though they are inexpensive only if one set gets used repeatedly.</p>
<p>The cost of buffer (NaCl, MgCl<sub>2</sub>, Tris) is negligible.</p>
<p>Nucleotides are expensive up front, $150 for a set of dNTPs (dATP, dCTP, dGTP, dTTP), but this works out to about $0.06 per 50 ul PCR reaction.</p>
<p>Can nucleotides be prepared by a hobbyist?  Nucleotides are easy to obtain-DNA is a major constituent of cells and is easy to purify.  DNA + DNAase = dAMP, dCMP, dGMP, and dTMP.  How can the trinucleotides be regenerated?</p>
<p>One route is to do it enzymatically using<br />
polyphosphate:AMP phosphotransferase (PPT) and adenylate kinase (AdK) with polyphosphate (polyP) as the energy source (<a href="pics/am002045.pdf">Resnick and Zehnder, 2000</a>).  It is not clear how the trinucleotide product would be separated and purified.  Presumably different enzyme pairs could be used to regenerate the other dNTPs from the monophosphates.</p>
<p>These other enzymes could be cloned in <em>E. coli</em> expression vectors and purified either by tagging them with His<sub>6</sub> and using a Ni or Co resin.  Or by cloning heat-stable isoforms from one of the extremophiles and using a one-step boiling purification like that used for <em>Taq</em> polymerase.</p>
<p><strong>Update:</strong>  Bochkov et al., 2006 describe a method of preparing dNTPs from digested DNA.  DNA is digested with DNAase and Nuclease S<sub>1</sub>.  DNAase chews DNA into show oligonucleotides and the nuclease breaks them down to single dNMPs.</p>
<p>Then a crude extract of <em>E. coli</em> is prepared that contains the kinases to convert dNMPs to dNTPs along with the acetokinase.  The kinases use ATP.  ATP must be regenerated, and this is done using acetokinase with acetyl phosphate ($30/g) as an energy source.  Combined dNMPs were converted to dNTPs with at least 86% regeneration and separated from reactants by chromatography on a Dowex 1×2 anion exchanger.  The conversion was followed by thin-layer chromatography.</p>
<p>For PCR it may be possible to use </p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=171</wfw:commentRss>
		</item>
		<item>
		<title>Water on the moon!</title>
		<link>http://elegans.uky.edu/blog/?p=170</link>
		<comments>http://elegans.uky.edu/blog/?p=170#comments</comments>
		<pubDate>Mon, 16 Nov 2009 15:19:17 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[Estimation]]></category>

		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=170</guid>
		<description><![CDATA[Last October, NASA&#8217;s LCROSS mission slammed a spent rocket booster then the LCROSS spacecraft itself into the moon.  No debris plume was seen from Earth, but observations from LCROSS of the booster hitting indicate the presence of water on the moon.  How much water?  Most news accounts don&#8217;t say, but the Science [...]]]></description>
			<content:encoded><![CDATA[<p>Last October, NASA&#8217;s LCROSS mission slammed a spent rocket booster then the LCROSS spacecraft itself into the moon.  No debris plume was seen from Earth, but observations from LCROSS of the booster hitting indicate the presence of water on the moon.  How much water?  Most news accounts don&#8217;t say, but the <a href="http://sciencenow.sciencemag.org/cgi/content/full/2009/1113/1"><em>Science</em> magazine article</a> does.</p>
<p>100 kilograms of water was detected from an impact that created a crater estimated to be 20 m wide and 3 meters deep.  So 100 kg water in about 500 m<sup>3</sup> of regolith = 0.1 g/kg. (Googled a reference giving 2.3 to 2.6 g/cm<sup>3</sup> as lunar regolith density).  </p>
<p>The article gives a higher estimate for water, 0.1% to 10%, higher than my crude 0.01% estimate.  Which is great&#8211;enough water to extract easily and live off.  Best news for space exploration in thirty years!</p>
<p><img src="pics/LCROSS_11-09.jpg" alt="LCROSS impact plume" /><br />
(Credit: NASA)</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=170</wfw:commentRss>
		</item>
		<item>
		<title>Evolution of the glucocorticoid receptor</title>
		<link>http://elegans.uky.edu/blog/?p=168</link>
		<comments>http://elegans.uky.edu/blog/?p=168#comments</comments>
		<pubDate>Wed, 21 Oct 2009 20:04:21 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[Science]]></category>

		<category><![CDATA[pseudoscience]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=168</guid>
		<description><![CDATA[Interesting letter about the evolution of the glucocorticoid receptor from Joe Thornton, a biologist at the University of Oregon.  Thornton&#8217;s lab has figured out some of the details on how this receptor evolved.  Thornton&#8217;s writing this because creationist Behe is passing off a mangled version of his work as evidence for &#8216;intelligent design&#8217;.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Interesting <a href="http://blogs.discovermagazine.com/loom/2009/10/15/the-blind-locksmith-continued-an-update-from-joe-thornton/">letter about the evolution of the glucocorticoid receptor</a> from Joe Thornton, a biologist at the University of Oregon.  Thornton&#8217;s lab has figured out some of the details on how this receptor evolved.  Thornton&#8217;s writing this because creationist Behe is passing off a mangled version of his work as evidence for &#8216;intelligent design&#8217;.</p>
<p>The first <a href="http://blogs.discovermagazine.com/loom/2006/04/06/the-blind-locksmith/">Discover magazine blog post</a> gives a good overview of what Thornton&#8217;s lab learned about the  glucocorticoid receptor.</p>
<p><img src="pics/94_2_GRHOW_1_V1.jpg" alt="GR receptor pathway" /></p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=168</wfw:commentRss>
		</item>
		<item>
		<title>Stepper motor controller</title>
		<link>http://elegans.uky.edu/blog/?p=167</link>
		<comments>http://elegans.uky.edu/blog/?p=167#comments</comments>
		<pubDate>Sun, 18 Oct 2009 21:56:49 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[hobbies]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=167</guid>
		<description><![CDATA[Stepper motors are easier to control than servos, but they typically produce lower power.  A number of people have built stepper motor run CNC projects, so for small or mid-size CNC control they work.
I have three bipolar stepper motors, but seven 6-wire unipolar steppers plus other unipolar steppers with other wire counts so it [...]]]></description>
			<content:encoded><![CDATA[<p>Stepper motors are easier to control than servos, but they typically produce lower power.  A number of people have built stepper motor run CNC projects, so for small or mid-size CNC control they work.</p>
<p>I have three bipolar stepper motors, but seven 6-wire unipolar steppers plus other unipolar steppers with other wire counts so it makes sense to design a unipolar stepper controller.</p>
<p>A unipolar stepper has three coils all of which get driven in the same direction by PWM signals amplified and isolated by a driver circuit.  Because the drive current is always in the same direction an H-bridge is not required, rather a simpler driver can be used.  </p>
<p>The simplest way to drive the stepper is to activate each coil in turn slowly enough that the motor has time to move a step before the next step is given.  A smoother and more power efficient method called microstepping uses PWM to transition gradually from one step to the next (<a href="pics/00907a.pdf">Microchip App Note</a>).  This requires four signals from the PIC to the driver.  The PIC18F4&#215;31 chips can output 8 PWM signals and so could drive two motors.</p>
<p>An intelligent driver with integrated stepping like the Allegro <a href="pics/970701.pdf">SLA7070MR</a> ($7) at only requires a direction and step signal.  A <a href="http://microchip.com">PIC16F88</a> has 16 IO lines, enough to drive 4+ unipolar steppers, and PIC18 or PIC30 can run 4+ unipolar steppers plus has PWM lines to drive additional hobby servos.  The PIC18 can have a USB interface and so could run a CNC by itself.  </p>
<p>A more robust stepper controller interfaced to an SLA70xx driver would have a RESET pin, a common one running to all the drivers, and M<sub>0</sub> line monitoring the each stepper, and shared M<sub>1</sub> and M<sub>2</sub> lines running to all the drivers, so three common lines, and three per driver, so fifteen for four motors.  Then figure each axis would have a pair of end stop switches, so four input lines for those, and one input line for a big STOP button.  So altogether 20 IO lines for four axis control.</p>
<p>Two IO lines are required for USB.  The <a href="pics/41303E.pdf">PIC18F46K20</a> ($3), a 40-pin DIP, has 36 IO lines, four of which can be PWM and several A/D input lines.  This PIC could run four axes and have separate lines for USB, in circuit programming, and still have lines available to run PWM hobby servos, input temperature, etc.</p>
<p>Some CNC setups have centering switches, so that could be useful.  Other CNC systems use the axis end stop switch to find their initial position.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=167</wfw:commentRss>
		</item>
		<item>
		<title>Stepper and servo motor control</title>
		<link>http://elegans.uky.edu/blog/?p=166</link>
		<comments>http://elegans.uky.edu/blog/?p=166#comments</comments>
		<pubDate>Thu, 15 Oct 2009 19:07:18 +0000</pubDate>
		<dc:creator>jiml</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Journalism]]></category>

		<category><![CDATA[hobbies]]></category>

		<guid isPermaLink="false">http://elegans.uky.edu/blog/?p=166</guid>
		<description><![CDATA[So I have a box of motors scavenged from old electronic equipment.  The first step was figuring out what I have. 
I have four identical Pittman servo motors with attached optical encoders.  They have two leads for motor control and four leads for the encoders, Vc, Gnd, quadrature A &#038; B signals.  [...]]]></description>
			<content:encoded><![CDATA[<p>So I have a box of motors scavenged from old electronic equipment.  The first step was figuring out what I have. </p>
<p>I have four identical Pittman servo motors with attached optical encoders.  They have two leads for motor control and four leads for the encoders, Vc, Gnd, quadrature A &#038; B signals.  So these motors need a sophisticated servo driver that can do PID (Proportional, Integral, Derivative) control.  Basically the controller senses motor movement and direction by counting encoder tick marks and then juices the motor in the desired direction using a PWM (Pulse Width Modulation) applied driver voltage.</p>
<p>It&#8217;s common to run the these servos with <a href="pics/39616C.pdf">PIC18 chips </a> ($4.50).  They have a built in quadrature encoder reader and can be programed to do PID.  </p>
<p>Then the low power PWN signal gets run through a power driver like the <a href="pics/L298.pdf">L298</a> ($2.60).  Here&#8217;s a well-documented <a href="http://www.dprg.org/projects/1998-04a/">L298 project</a>. The L298 can driver two servo motors.  A LMD18200 H-bridge ($12.50) is another power driver option, used in the <a href="http://www.jrkerr.com/boards.html">Jeffery Kerr boards</a>.  Here&#8217;s a <a href="http://www.seattlerobotics.org/encoder/200205/PIDmc.html">project</a> using a PIC16 and the LMD18200 driver.  The <a href="pics/A3953SLB-Allegro.pdf">Allegro A3953</a> is another driver option.</p>
<p>Typically one PIC16 or PIC18 would control each servo motor.  The recent <a href="pics/DSPIC33FJ12GP201-I-SO-Microchip.pdf ">dsPIC33</a> chips ($3.00) have dual encoders and should be able to run two servos.  These chips came out in 2008 so I haven&#8217;t found any projects on the web describing dual servo projects.</p>
<p>The PIC18 and dsPIC33s are available as DIPs or as SMDs.  They can interface to a computer through USB and so can be controlled directly, though connecting them to a programmable controller, a PIC, a BASIC stamp, an Arduino, etc is more common.</p>
<p>Hobby servos are much easier to drive and a single PIC18 can drive several, six to eight depending on the chip variation.  Typically a hobby servo would not need a driver as the PWM is its control signal.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegans.uky.edu/blog/?feed=rss2&amp;p=166</wfw:commentRss>
		</item>
	</channel>
</rss>
