{"id":14738,"date":"2016-09-19T10:00:00","date_gmt":"2016-09-19T17:00:00","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=14738"},"modified":"2016-09-19T11:42:41","modified_gmt":"2016-09-19T18:42:41","slug":"holy-carp-the-pmod-step-is-really-useful","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/holy-carp-the-pmod-step-is-really-useful\/","title":{"rendered":"Holy Carp, the Pmod STEP is Really Useful!"},"content":{"rendered":"<p>Have you ever used an H-bridge? Oh boy&#8230; let me tell you about H-bridges&#8230;<\/p>\n<p>This is an H-bridge:<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-15633\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/07\/Generic-H-bridge_schem-600x495.jpg\" alt=\"Generic H-bridge_schem\" width=\"600\" height=\"495\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/07\/Generic-H-bridge_schem-600x495.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/07\/Generic-H-bridge_schem-768x634.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/07\/Generic-H-bridge_schem-800x660.jpg 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/07\/Generic-H-bridge_schem.jpg 927w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>It&#8217;s a circuit commonly used for controlling motors, and frustrating newbies. Don&#8217;t get me wrong, it&#8217;s a fantastic circuit if you want to be able to run a motor both forwards and backwards.\u00a0Bringing\u00a0Signal 1 high, Signal 2 low, and enable high will make the motor spin one way, while bringing Signal 1 low and Signal 2 high will make it spin the reverse. What could be simpler?<\/p>\n<p>But here&#8217;s the catch.<\/p>\n<p>If somehow you forget to drop enable\u00a0before switching between Signal 1 and Signal 2, or don&#8217;t give the transistors enough time to fully close, you can get a short across Signal 1 and Signal 2&#8217;s transistors&#8230; which will burn them out and kill your H-bridge.\u00a0<span style=\"font-size: 14px; line-height: 1.857;\">I&#8217;ve made H-bridges glow like LEDs\u00a0this way, so I&#8217;ve since learned to be\u00a0<em>very paranoid<\/em> about them.<\/span><\/p>\n<p>But now there&#8217;s an\u00a0alternative way to control your motors!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2834\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/09\/PmodSTEP.png\" alt=\"Digilent's PmodSTEP to drive a stepper motor.\" width=\"600\" height=\"422\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/09\/PmodSTEP.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/09\/PmodSTEP-225x158.png 225w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Meet the<a href=\"https:\/\/digilent.com\/shop\/pmodstep-stepper-motor-driver\/\"> Pmod STEP<\/a>! This handy little board was designed for stepper motors, and it&#8217;s been featured prominently in <a href=\"https:\/\/digilent.com\/blog\/pmod-monthly-the-claw-game\/\">Kaitlyn&#8217;s FPGA claw game project<\/a>.\u00a0This board is seriously a delight to use. It&#8217;s simple, functional,\u00a0<em>and you don&#8217;t have to worry about shorting it out by sending the wrong signals!<\/em><\/p>\n<p>Here&#8217;s why:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-14746\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Pmod-STEP-Internal_schem-439x600.png\" alt=\"Pmod STEP Internal_schem\" width=\"439\" height=\"600\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Pmod-STEP-Internal_schem-439x600.png 439w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Pmod-STEP-Internal_schem.png 540w\" sizes=\"auto, (max-width: 439px) 100vw, 439px\" \/><\/p>\n<p>This schematic isn&#8217;t\u00a0<em>literally<\/em> what is inside the Pmod STEP, but it&#8217;s convenient to think of the board as a series of 2-way switches.<\/p>\n<p>By default, each switch is connected to ground. If I flip Switch 1, I bring that output high, which runs through the stepper and drains through Switch 2. To reverse the flow, all I need do is flip Switch 2 instead of Switch 1.<\/p>\n<p>Because I have no connections that run straight to ground, I can toggle each of these switches into any configuration I want, and it&#8217;ll never short out!<\/p>\n<p>That&#8217;s just conceptual. Here&#8217;s what&#8217;s really inside the chip:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-16788 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/09\/Buffer-Wiring-Diagram-edited-600x417.png\" alt=\"Pmod STEP Wiring Diagram\" width=\"600\" height=\"417\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/09\/Buffer-Wiring-Diagram-edited-600x417.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/09\/Buffer-Wiring-Diagram-edited-768x534.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/09\/Buffer-Wiring-Diagram-edited-800x556.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/09\/Buffer-Wiring-Diagram-edited.png 834w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>This is the block diagram for the ST 293DD motor driver IC that runs the <a href=\"https:\/\/digilent.com\/shop\/pmodstep-stepper-motor-driver\/\">Pmod STEP. <\/a>Each of those triangles are called a &#8220;buffer&#8221;, and that&#8217;s what&#8217;s acting like\u00a0the switches in the previous diagram. There are about a billion<strong>*<\/strong> different ways to make a buffer so I can&#8217;t tell you exactly how they&#8217;re wired. But for our purposes it is enough to know that\u00a0when you apply a high voltage to the IN signal of one of these buffers, it toggles the respective OUT pin from low to high voltage as well.<\/p>\n<p>You might be confused about those enable pins. What are they doing there? Well normally if you brought those pins low, it would disconnect the buffer entirely. That way instead of connecting to either high voltage or ground it doesn&#8217;t connect to anything, and acts like a disconnected wire. It would be like if you held one of those switches from before in a middle position, so it didn&#8217;t connect to either high or ground. In the Pmod STEP, however, the enable pins are both hard wired to high voltage so all these buffers are enabled all the time.<\/p>\n<p>The practical upside of all of this is a very simple way to run motors. Toggle input 1, output 1 goes high. If a motor is connected to one pin that&#8217;s high, and one that&#8217;s low, it&#8217;ll run that direction. Switch which pins are high and which are low, and the motor changes direction. That&#8217;s all there is to it! No fussing with enable pins, and\u00a0<em>no worrying about shorts!<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-14749\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Title-600x450.jpg\" alt=\"Identifying Stepper Wiring with the PmodSTEP\" width=\"600\" height=\"450\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Title-600x450.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Title-768x576.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Title-800x600.jpg 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/06\/Title.jpg 960w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>I had the\u00a0pleasure of <a href=\"http:\/\/www.instructables.com\/id\/Identifying-Stepper-Wiring-With-the-Pmod-STEP\/\">using the Pmod STEP to identify the wiring of a stepper<\/a> we had lying around. I wasn&#8217;t sure which wires were what coils, or what order I needed to use them in order to get the motor to turn.<\/p>\n<p>Because the stepper I was using was a bi-polar stepper, I needed to be able to reverse the polarity of its coils. If I had used an H-bridge to do this, I would have constantly been worrying about shorting something out. Instead by using the Pmod STEP, I was able to play with this board without risk!<\/p>\n<p>The<a href=\"https:\/\/digilent.com\/shop\/pmodstep-stepper-motor-driver\/\"> Pmod STEP<\/a> is pretty wonderful, and I highly recommend you check it out if you want an easy and hassle free way to add any sort of motor to your projects. Steppers or otherwise.<\/p>\n<p>*The &#8220;billion&#8221; figure may have\u00a0been slightly exaggerated.<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-14738 jlk' data-task='like' data-post_id='14738' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-14738 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-14738 jlk' data-task='unlike' data-post_id='14738' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-14738 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-14738 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Jay illustrates some applications for the Pmod STEP.<\/p>\n","protected":false},"author":21,"featured_media":16788,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[38],"tags":[],"ppma_author":[4472],"class_list":["post-14738","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-expansion-modules"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/09\/Buffer-Wiring-Diagram-edited.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4472,"user_id":21,"is_guest":0,"slug":"jayweeks","display_name":"Jay Weeks","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/c9032c373b20f91ecd2c2ebd3b378c3da3e5f6e50cf0d516941ba1dafaf29b73?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/14738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=14738"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/14738\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/16788"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=14738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=14738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=14738"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=14738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}