<?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>Andrew Burks &#187; H-Bridge</title>
	<atom:link href="http://blog.andrewburks.com/tag/h-bridge/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.andrewburks.com</link>
	<description>Personal Experiences with Technical Projects</description>
	<lastBuildDate>Fri, 25 Feb 2011 19:38:57 +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>Stepper Motor Driver &#8211; NAND Gates</title>
		<link>http://blog.andrewburks.com/2010/07/stepper-motor-driver-nand-gates/</link>
		<comments>http://blog.andrewburks.com/2010/07/stepper-motor-driver-nand-gates/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 04:03:12 +0000</pubDate>
		<dc:creator>aburks</dc:creator>
				<category><![CDATA[RobOrchestra]]></category>
		<category><![CDATA[Robotics Club]]></category>
		<category><![CDATA[Vibratron]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[H-Bridge]]></category>
		<category><![CDATA[Half-Stepping]]></category>
		<category><![CDATA[Integrated Circuit]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[NAND]]></category>
		<category><![CDATA[Stepper Driver]]></category>
		<category><![CDATA[Stepper Motor]]></category>

		<guid isPermaLink="false">http://blog.andrewburks.com/?p=77</guid>
		<description><![CDATA[The Problem
I still need to find a cost effective way of turning a bipolar stepper motor on and off using just one pin.  I want to have the ability to use a powered brake, and I want to be able to use half-stepping control of the motor for smoother rotation.
Half-stepping gives the motor higher resolution, [...]]]></description>
			<content:encoded><![CDATA[<h2>The Problem</h2>
<p>I still need to find a cost effective way of turning a bipolar stepper motor on and off using just one pin.  I want to have the ability to use a powered brake, and I want to be able to use <a href="http://en.wikipedia.org/wiki/Stepper_motor#Half_stepping">half-stepping</a> control of the motor for smoother rotation.</p>
<p>Half-stepping gives the motor higher resolution, which is good for my application because one full step cycle is enough to move a single ball through.  The 4-stage process from before turns into an 8-stage process when you change to half-stepping.</p>
<p>t=0  A=1  B=0  C=0  D=0</p>
<p>t=1  A=1  B=1  C=0  D=0</p>
<p>t=2  A=0  B=1  C=0  D=0</p>
<p>t=3  A=0  B=1  C=1  D=0</p>
<p>t=4  A=0  B=0  C=1  D=0</p>
<p>t=5  A=0  B=0  C=1  D=1</p>
<p>t=6  A=0  B=0  C=0  D=1</p>
<p>t=7  A=1  B=0  C=0  D=1</p>
<p>t=8=0</p>
<h2>The Solution</h2>
<p>I noticed that in half stepping (and full stepping) if you view the logic for each of the four wires as a wave, they are always 90 degrees out of phase and have a specific shape.  I wanted to create four unique signal lines, one for each of the four wave patterns, and transmit this signal to each of the 30 stepper controllers.  At each controller, I should be able to choose either some default value (like a powered or unpowered brake) or let the motor run off the signal.</p>
<p>Because my focus was centered on the powered brake, my initial idea was to take my on-off line at each motor and perform a <a href="http://en.wikipedia.org/wiki/AND_Gate">logical AND</a> with three of the four waves and a <a href="http://en.wikipedia.org/wiki/OR_Gate">logical OR</a> with the other wave.  The OR would drive its input high while the AND would drive its inputs low.  This solved my problem, but unfortunately I couldn&#8217;t find a chip with an AND and an OR circuit on it.</p>
<p><a href="http://en.wikipedia.org/wiki/NAND_logic">You can build any logic gate</a> with a combination of <a href="http://en.wikipedia.org/wiki/NAND_gate">NAND</a> or <a href="http://en.wikipedia.org/wiki/NOR_gate">NOR</a> gates.  It takes two NAND gates to build an AND gate, and three NAND gates to build an OR gate (and vice-versa when building from NOR gates).  They sell IC&#8217;s with 4 NAND gates in them, so I really wanted to find a way to do my OR operation with only 2 NAND gates.</p>
<p>Eventually I realized that if I negated the signal wave coming from the Arduino (by using 1 NAND as an inverter) and then performed a NAND operation with the wave signal and the on-off signal I got the exact output I wanted!  of course, if I had just used an AND on each of the four inputs, I would have an unpowered brake and less of a headache.</p>
<p>I made this circuit on a protoboard, and tested it with both full and half stepping.  It worked like a charm.  The next step is to see if half-stepping combined with a smaller diameter wheel will be able to push balls along without jamming.  Here is the protoboard layout:</p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-NAND-Circuit-Top.jpg"><img class="alignnone size-medium wp-image-87" title="Stepper NAND Circuit - Top" src="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-NAND-Circuit-Top-300x225.jpg" alt="" width="300" height="225" /></a></p>
<h2>Pros</h2>
<p>This setup allows for full and half stepping.  It costs less than the shift register design, about $2 per unit (only $0.75 from the two NAND ICs).  Each of the four inputs is completely isolated from the others, so the wiring is simpler (which makes the PCB layout easier).</p>
<h2>Cons</h2>
<p>There are now 4 common signal wires instead of just one.  These 4 wires will need to be jumped from board to board, potentially requiring some sort of transistor to keep the voltage from dropping as it moves across the boards.</p>
<h2>More Photos</h2>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-NAND-Circuit-Setup.jpg"><img class="alignnone size-medium wp-image-88" title="Stepper NAND Circuit - Setup" src="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-NAND-Circuit-Setup-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-NAND-Circuit-Detail.jpg"><img class="alignnone size-medium wp-image-89" title="Stepper NAND Circuit - Detail" src="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-NAND-Circuit-Detail-300x225.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrewburks.com/2010/07/stepper-motor-driver-nand-gates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stepper Motor Driver &#8211; Shift Register</title>
		<link>http://blog.andrewburks.com/2010/07/stepper-motor-driver-shift-register/</link>
		<comments>http://blog.andrewburks.com/2010/07/stepper-motor-driver-shift-register/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 03:37:30 +0000</pubDate>
		<dc:creator>aburks</dc:creator>
				<category><![CDATA[RobOrchestra]]></category>
		<category><![CDATA[Robotics Club]]></category>
		<category><![CDATA[Vibratron]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Circuit]]></category>
		<category><![CDATA[Flip-Flop]]></category>
		<category><![CDATA[H-Bridge]]></category>
		<category><![CDATA[Integrated Circuit]]></category>
		<category><![CDATA[Motor Driver]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[Shift Register]]></category>
		<category><![CDATA[Stepper Motor]]></category>

		<guid isPermaLink="false">http://blog.andrewburks.com/?p=73</guid>
		<description><![CDATA[The Problem
I need to be able to turn 30 identical stepper motors on and off individually.  I can only afford to have one unique wire going to each stepper unit because I only have ~40 digital outputs to work with.  I can afford to have a few common outputs that are jumped from board to [...]]]></description>
			<content:encoded><![CDATA[<h2>The Problem</h2>
<p>I need to be able to turn 30 identical stepper motors on and off individually.  I can only afford to have one unique wire going to each stepper unit because I only have ~40 digital outputs to work with.  I can afford to have a few common outputs that are jumped from board to board.  basically I need to turn four inputs that go in a pattern into one input.</p>
<p>The four lines on the motor driver (H-Bridge) basically take turns going high when I want the motor to turn.  When I want it to stand still, only one of the lines should be high.  This is called &#8220;wave driving&#8221; a stepper motor.  Here is what happens when a bipolar stepper motor is wave driven.</p>
<p>t=0:  A=1  B=0  C=0  D=0</p>
<p>t=1:  A=0  B=1  C=0  D=0</p>
<p>t=2:  A=0  B=0  C=1  D=0</p>
<p>t=3:  A=0  B=0  C=0  D=1</p>
<p>t=4=0</p>
<h2>The Solution</h2>
<p>A Serial in Parallel out (SIPO) <a href="http://en.wikipedia.org/wiki/Shift_register#Serial-in.2C_parallel-out_.28SIPO.29">Shift Register</a> does basically exactly what I&#8217;m looking for.  If I have one common clock (a line that goes high every 1/4 step) and connect the 4th output to the data input, then the four parallel outputs will shift through my 4 states like a champ.  The only catch is that I need to seed the circuit with the initial &#8220;1&#8243; so that the &#8220;1&#8243; can move along the shift register.</p>
<p>Luckily, because a shift register is just 4 <a href="http://en.wikipedia.org/wiki/Flip-flop_(electronics)#RS_.28Reset-Set.29_flip-flop">flip-flops</a> lined up in a row, I could build my own shift register out of flip flops, and access the set/reset abilities of the individual flip-flops.  So in the final setup, I had a single clock coming from the Arduino (pulsing at 100ms intervals) which controlled the speed of the motor, and a &#8220;stop&#8221; pin coming from the Arduino to control whether or not the motor was turning.</p>
<p>The &#8220;stop&#8221; pin was tied to the reset pin on the first flip-flop and the set pins on the other 3.  This means that when the &#8220;stop&#8221; pin was driven low, it would force the shift register into the &#8220;1-0-0-0&#8243; state, and when it was released the &#8220;1&#8243; would shift sequentially at the speed of the clock to drive the motor.  Here is a view of the protoboard layout (the center IC is the motor driver, and the other two each contain two flip-flops):</p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Top.jpg"><img class="alignnone size-medium wp-image-81" title="Stepper Shift Circuit - Top" src="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Top-300x225.jpg" alt="" width="300" height="225" /></a></p>
<h2>Pros</h2>
<p>This is a huge improvement over controlling all 120 lines individually.  An Arduino mega can easily output a single clock and 30 control lines.  The cost of each circuit is about $4 in parts (three <a href="http://media.digikey.com/photos/Fairchild%20Semi%20Photos/261-20-DIP.jpg">Integrated Circuits</a>, or ICs), more if you PCB it.  It works, and it lets you do a powered brake as well.</p>
<h2>Cons</h2>
<p>The two IC&#8217;s with flip-flops are about $2.50 0f the total parts cost.  For this price ($2.50&#215;30=$75) it would technically be cheaper to buy some other board that can take serial from the Arduino and control the 120 outputs.  Also, the wiring is a bit complex and uninsulated because each flip-flop&#8217;s output feeds into the next one&#8217;s input.</p>
<h2>More Photos</h2>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Detail.jpg"><img class="alignnone size-medium wp-image-82" title="Stepper Shift Circuit - Detail" src="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Detail-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Arduino.jpg"><img class="alignnone size-medium wp-image-83" title="Stepper Shift Circuit - Arduino" src="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Arduino-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Iso.jpg"><img class="alignnone size-medium wp-image-84" title="Stepper Shift Circuit - Iso" src="http://blog.andrewburks.com/wp-content/uploads/2010/07/Stepper-Shift-Circuit-Iso-300x225.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrewburks.com/2010/07/stepper-motor-driver-shift-register/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vibraphone Ball Dispensing Testing</title>
		<link>http://blog.andrewburks.com/2010/06/vibraphone-ball-dispensing-testing/</link>
		<comments>http://blog.andrewburks.com/2010/06/vibraphone-ball-dispensing-testing/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 03:46:13 +0000</pubDate>
		<dc:creator>aburks</dc:creator>
				<category><![CDATA[RobOrchestra]]></category>
		<category><![CDATA[Robotics Club]]></category>
		<category><![CDATA[Vibratron]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[H-Bridge]]></category>
		<category><![CDATA[Motor]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Stepper Motor]]></category>

		<guid isPermaLink="false">http://blog.andrewburks.com/?p=62</guid>
		<description><![CDATA[General Concept
With the current direction for the Vibraphone design, the notes are played by dropping a steel ball onto the keys.  There are several ways to actuate the balls, but considering the cycle times we want to achieve and the cost of each device (since we need 30 total) using a small motor and a [...]]]></description>
			<content:encoded><![CDATA[<h2>General Concept</h2>
<p>With the current direction for the Vibraphone design, the notes are played by dropping a steel ball onto the keys.  There are several ways to actuate the balls, but considering the cycle times we want to achieve and the cost of each device (since we need 30 total) using a small motor and a wheel to push balls off of a queue and into free-fall seemed like the best idea.</p>
<p>The club has a few sets of tiny motors that have been donated, and each set has as least 30 motors of that kind.  The two sets we investigated are the tiny DC motors from the handheld fans, and some tiny bipolar stepper motors.</p>
<p>There are two trains of though for what to put at the end of the motor.  One possibility is to put a circle with a squishy perimeter on the motor, and use friction to pull balls through the mechanism one at a time.  Another concept is to cut ball-sized notches into the perimeter of a plastic circle, acting like a sprocket on a row of queued balls.</p>
<p>We have tested both concepts on the fan motor, and they each have their advantages and disadvantages.  After testing them both on the stepper motor in a more controlled way, we should have a better sense for which type of wheel will work best for us.</p>
<p>Here is a photo of the notched wheel<a href="http://www.mikeornstein.com" target="_blank"> Mike Ornstein</a> and I milled in the roboclub CNC mill the other night.  The notches fit the balls great, but a consistent problem we had with the fan motor was that balls would jam if they tried to fill an empty queue.</p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Indexed-Wheel.jpg"><img class="alignnone size-medium wp-image-63" title="Preliminary Indexed Wheel" src="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Indexed-Wheel-300x225.jpg" alt="" width="300" height="225" /></a></p>
<h2>Fan Motor</h2>
<p>The fan motor is easy to control.  If you put a voltage difference between the two wires, it will spin.  If you give it a low voltage (1V) it will spin fast.  If you give it a higher voltage (3V) it will spin VERY fast.</p>
<p>From my observations, there just didn&#8217;t seem to be enough torque on the motor to handle the balls we were giving it.  Also, when testing with the notched wheel, the fan seemed to lack all braking ability.  Obviously with a friction wheel instead of a notched wheel the motor will be able to resist back pressure, so I look forward to seeing how that performs once we get a nicer friction wheel made (Plastic circle with a notch for an O-ring).</p>
<h2>Stepper Motor</h2>
<p>The club has a box of 150 tiny <a href="http://en.wikipedia.org/wiki/Stepper_motor" target="_blank">stepper motors</a> with 4 wires coming out of each of them.  Starting the process knowing absolutely nothing about steppers, I eventually determined that our stepers were Bipolar Stepper Motors.  Basically, there are two pairs of wires and I need to follow a cycle of powering and releasing the pairs in different directions in a certain order so I can get the motor to &#8217;step&#8217; 1/48th of a rotation.</p>
<p>By using an <a href="http://en.wikipedia.org/wiki/H-bridge" target="_blank">H-Bridge</a> configuration on each pair of wires, I could independently control the direction of the current in the wires with digital logic.  20 lines of C++ and an Arduino later, I had a great test rid that let me step the motor at whatever speed I wanted!</p>
<p>I was very pleased with the initial performance of the stepper motor.  There seemed to be a lot of torque behind the motor, despite its size.  The biggest advantage in my eyes though was the powered braking.  By setting only one set of wires in only one direction and leaving it there, the motor was in a powered lock.  This should help with the back pressure issue we were facing on the fan with the notched wheel.</p>
<p>Here are some photos of my final Arduino/H-bridge setup.  I was very happy because both the circuit and the program worked on the first try!  That never happens!</p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Stepper-Setup-Iso.jpg"><img class="alignnone size-medium wp-image-66" title="Preliminary Stepper Setup - Iso" src="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Stepper-Setup-Iso-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Stepper-Setup-Top.jpg"><img class="alignnone size-medium wp-image-67" title="Preliminary Stepper Setup - Top" src="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Stepper-Setup-Top-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Stepper-Setup-Front.jpg"><img class="alignnone size-medium wp-image-68" title="Preliminary Stepper Setup - Front" src="http://blog.andrewburks.com/wp-content/uploads/2010/06/Preliminary-Stepper-Setup-Front-300x225.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrewburks.com/2010/06/vibraphone-ball-dispensing-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

