make drawing machine part 3
Welcome to the third project of the Make It Last Build Series, sponsored by Microchip and Energizer.
The goal for this week is to prototype the driver circuit for the two stepper motors. Check out the Build Series landing page for full info, prize details, and the rundown on the first two builds in the series. Cheers, back to top Driving Motors A pin on a microcontroller can source enough current to power an LED, but not much else. It is best to think of the voltage at the pin as logical high or logical low signals, not as voltages that can provide current to a circuit. For a load larger than an LED (i.e. 20mA or so), we will need a driver circuit to provide power to that load. The Drawbot’s stepper motors will draw significantly more than 20mA each! Depending on the application, the driver can be as simple as a transistor or a MOSFET. In this project, we will need to drive two steppers, which can be done simply with eight transistors. A better solution for an inductive load (i.e. a motor) is an H-bridge. Let’s review all of the parts needed this week:
Before we get into the details of the driver circuit, let’s look at how a stepper motor works. back to top A Little About Stepper Motors A stepper motor is a type of electric motor driven by a ring of electromagnets around a geared iron shaft. The electromagnets are alternately energized, pulling the next gear on the shaft into place. The order in which the magnet windings are energized to make the motor rotate continuously is shown in the illustration above. Stepper motors come in two flavors: unipolar and bipolar. Bipolar motors have four wires and unipolar motors have six (and can also be used as bipolar motors by ignoring two of them). The main considerations when selecting a motor are:
The motor I selected for the Drawbot is a 400-step unipolar motor (which we will use as a bipolar motor) that draws 900mA at 5V. This choice sacrifices current efficiency for very high resolution (number of steps) at an affordable price ($20). For more about stepper motors, see Tom Igoe’s page, which also has sample code for Arduino and the Basic Stamp. back to top Build the Stepper Motor Driver We’ll be using an H-bridge circuit from Tom Igoe’s page (mentioned above) that allows us to use only two control lines per motor by adding a couple of transistors to flip the logic. Moving the motor in one direction is as easy as pulling the two control lines high or low in the proper sequence. The motor can be moved in reverse by reversing the sequence: Step 1: C1 = LOW, C2 = HIGH Step 2: C1 = HIGH, C2 = HIGH Step 3: C1 = HIGH, C2 = LOW Step 4: C1 = LOW, C2 = LOW Follow the schematic shown and build the circuit for one stepper driver on a breadboard (using parts from the parts list above). Don’t take apart the controller we made in last week’s project step! back to top Next Steps Next week we’ll hook up the controller and start writing some code. Over the next week, I’ll post more photos and instructions on building the stepper motor driver circuit in the Forum. back to top Microchip Discount Code Want to pick up a PIC programmer or development kit? As part of this series, Microchip is offering a 20% discount on the following development tools: * PICkit 3 If you’ve been thinking about getting started with PIC programming, this could be a great opportunity to get a good deal on a programmer. To request a discount code, send an email to makeitlast@makezine.com. |