Stepper motor driver

From RepRap
Revision as of 01:30, 25 May 2013 by DavidCary (talk | contribs) (will I regret putting all the chips into one big table?)
Jump to: navigation, search

Driving stepper motors

To make a stepper motor work, you need to use

  1. a stepper driver chip or
  2. a microcontroller and, optionally, one or two full h-bridge chips

Stepper Driver

These chips keep the power that drives the motors separate from the power that is on the arduino. The arduino can't provide enough juice to power the stepper motors directly. This is why you have to use separate chips to sort of act as valves that control how the motor spins.

Another benefit that stepper driver chips provide, is that they provide fractional steps. This helps smooth out the motion of the stepper motor. Without fractional steps, stepper motors can have a tendency to vibrate or resonate at certain RPMs.


Microcontroller-based Stepper Drivers

Microcontroller based steppers drivers can achieve very high rotation speeds in stepper motors. Using a microcontroller, it is possible to have extreme control over exactly how each individual coil is energized inside the motor. This is absolutely necessary to obtain high speeds because as speed increases, timing of the coils firing must be perfectly in sync. Quoting from Dr. Iguana:

If you've ever pushed someone on a swing, you know that a small, well timed push can cause that person to swing higher and higher. Miss a push or two by even a small amount and the 'power transfer' is significantly less. This is the situation in stepper motors at high speeds. If you don't match the pushes or steps to the actual state of the motor it will run poorly.

In order to handle current higher than what the microprocessor can allow, the controller needs to use full H-bridge chips.

Normally, an H-bridge is used for controlling a plain old DC-motor but in this case, the h-bridge chips are used for exactly controlling the amount of electricity that goes to each individual coil on the stepper motor. Thus, for bipolar stepper motors, it needs 2 chips per motor.

Open Source Stepper Drivers

AVRSTMD

The AVRSTMD is an open source microcontroller-based stepper driver. It uses an atmega48 processor and two National Semiconductor LMD18245T current limited h-bridge chips.

Dr. Iguana

The Dr. Iguana stepper driver is based on a dsPic33 microcontroller and two L298N H-Bridge chips. It can achieve speeds up to 800 RPM. A very good source of information about microcontroller stepper drivers can be found on his website here along with all the schematics, gerber files, source code and BOM for the stepper driver.

Dr. Iguana. "A Better DIY Stepper Motor Driver". A series of pages (and a video) that give some tips for high-speed stepper motor driver design.

RepRap Stepper Motor Driver v1.x

  • obsolete*

Cache-2950488044 8ba115bd24 m.jpg

The first generation of RepRap stepper motor drivers. (Note: These boards were used in the generation 2 collection of electronics.) Uses the L297/L298 stepper motor driver combo. Half-stepping. Handles up to 2A. All through hole. A nice, solid driver. It uses some old technology, so it's not as fancy as the newer stepper drivers, but it gets the job done. Read the documentation page here

RepRap Stepper Motor Driver v2.x

  • obsolete*

Cache-3218206144 6461b3e2c0 m.jpg

The second generation of RepRap stepper motor drivers. (Note: These boards were used in the generation 3 collection of electronics but could be retrograded to generation 2.)

Uses the Allegro A3982 chip which does a bunch of nice things and makes the board much simpler. It also drops the price by $10 compared to the v1.x series. It can handle up to 2A, and does half-stepping. The only downside is that it's SMT, which can be a bit scary for people. It's all large SMT parts, so it's pretty simple to solder, especially with the solder paste / hotplate method. Read the documentation page here.

The PSMD Triple Axis Stepper Driver has all the same connectors and is a pin-compatible alternative to the RepRap Stepper Motor Driver v2.x.








Stepper drivers vs stepper controllers

To run a stepper motor, two things are normally required: a controller to create step and direction signals (at ±5 V normally) and a driver circuit which can generate the necessary current to drive the motor. In some cases, a very small stepper may be driven directly from the controller, or the controller and driver circuits may be combined on to one board.

The stepper controller drives 3 wires -- traditionally labeled "step", "dir", "GND" -- which carry motion information to the stepper driver. (Often these 3 lines are opto-isolated at the front end of a stepper driver). The stepper controller is typically a pure digital logic device, and requires relatively little power.

The stepper driver connects to the 4 thick wires of the stepper motor. It contains the big power transistors, and requires a thick power cable to a DC power supply, because all the power to drive the motors runs through it.

PWM and Stepper Drivers

The vast majority of stepper drivers are connected to some controller with a 3 wire interface: the controller pulses the STEP pin to move the motor one step(*), the controller sets the DIR pin to choose whether a step is a clockwise step or a counterclockwise step, and a common GND pin.

From Wikipedia:[[1]]: Pulse-width modulation (PWM) is a very efficient way of providing intermediate amounts of electrical power between fully on and fully off. A simple power switch with a typical power source provides full power only, when switched on. PWM is a comparatively recent technique, made practical by modern electronic power switches.

Stepper drivers normally work by chopping up a supply voltage using an embedded PWM chip. These chips do require minor support circuitry (which is the primary thing you pay for when you buy a stepper driver). The PWM chips themselves usually have a unit price below 10 USD, depending mostly on their rated current. A chopping driver, aka a current limiting driver, keeps the motor working and the current in the motor at a safe level, even when driving a "3V" motor from a "24V" power supply. All chips listed here have "thermal shutdown".

(*) Many chips also have built-in microstepping. When microstepping is enabled, each pulse on the STEP pin moves the motor one microstep.

Stepper driver chips

Here's a list of stepper driver chips (newest first):

Some example chips include:

Chip Verified? Max current Comments
? ?
THB7128
Suggested for the Gen7T electronics.
Toshiba TB6560AHQ
Used in the Gen7T electronics plus the open source stepper driver for open source ecology.
Allegro A4988 (QFN)
Used in Pololu stepper driver boards and the G3D driver. Same as A4983 but offers overcurrent protection.
Allegro A4983 (QFN)
Used in Pololu stepper driver boards. Discontinued product. Replaced by equivalent A4988.
Allegro A3992 (DIL or TSSOP)
Used in Gen L Electronics
Allegro A3982
Improved over v1.2 in v2.2
also used in stepper motor driver v2.3
Allegro A3979
Abandoned due to tiny size in v2.1
Allegro A3977
Abandoned in stepper motor driver v2.0
Allegro A3967
Used in Easy Driver boards sold on sparkfun
Not sure if they can be used in repraps but they're good for experimenting
Texas Instruments DRV8811
Used in generation 6 electronics
This is probably why the FiveD firmware was modified
L297/L298 combo
Last stepper motor driver to use this was v1.2
L298 used in Valkyrie Redux

There's a nice comparison table and review of microstepping driver ICs at "Bipolar microstepping motor driver roundup" (via "Alternative stepper motor driver?" ).


L293D Yes 0.6 A Multiples can be stacked on top of each other to divide up amperage. No current limiting.
A3967 No 0.75 A Slightly underpowered, at only 750 mA/phase
[A4983] Yes 2 A Can get very warm, active cooling is needed
[A4988] Yes 2 A Identical and pin compatible to A4983, but also pullup on M1 and motor short circuit protection
[Allegro 3977] No 2.5 A
[TB6560] No 2.5 - 3 A
ST L6470 No 3 A
DRV8825 No 3 A



Stepper drivers

Sourcing stepper motor drivers can be a bit difficult. The RepRap V2.3 stepper drivers are very hard to purchase pre-assembled. Builders with just a little bit of skill can source parts and assemble the controllers. Those without skills or materials to assemble the boards can buy generic stepper drivers. In Europe it will usually be more cost-effective to get pre-assembled boards than it will be to buy parts and perform a DIY assembly.

Alternative sources for stepper drivers

Manufacturer Verified? Location Max current Microstepping Comments
Stepper Motor Driver 2.3 (A3982) Yes US 2 A 1/2 Listed for comparison.
EasyDriver (A3967) Yes US 0.75 A 1/8 Slightly underpowered compared to other drivers, at only 750 mA/phase. bothacker uses EasyDriver[2], and reports that it has plenty sufficient power for Mendel. Recommended.
Pololu stepper driver board Yes US 2 A 1/16 Can get very warm; active fan cooling or passive small heatsink is needed above ~0.5 A. Recommended.
... ay.com/autohec 4 Axis Stepper Motor Driver Controller (A3977) Yes US 2.5 A 1/8 4 stepper drivers on a single board.
DIY CNC No GB 2.5 A 1/8 Can drive 1 stepper; discount when buying several.
Arduino Motor Shield No US 0.6 A ? Requires Arduino as controller. Can drive 2 servos, 4 DC, or 2 (bipolar or unipolar) steppers. Website notes that you can increase the max current by piggy-backing (soldering a chip onto a chip) another L293D chip on top of the first (and another one on top of that)
... ay.com/?_from=R40&_trksid=p3907.m38.l1313&_nkw=4+axis+TB6560&_sacat=See-All-Categories TB6560AHQ based No GB/PRC 1.5 - 3 A 1, 1/2, 1/8, 1/16 Can drive 3 to 5 steppers depending on model; read more.
Stepper Driver 2.3 Clone by kymberlyaandrus Yes US 2 A 1/2 Same schematic but physically smaller than the original version. The trim pot doesn't have a start/end point so adjusting the current can be more difficult than other boards. The terminal blocks are nice because they don't require making special connectors.
Gecko Drive Yes US 3.5 A 1/10 (only) Can drive 4 steppers
Nanotec SMC11 Yes GER 1.4 A 1/16 with cooling until 2.5 A
LiniStepper by Roman Black no US 3 A 1/18 and "stepless" Open Source: Circuit Diagram, PCB (Board) Layout, and PIC Software all available.
Tri Duino Stepper ??? ??? ??? ??? Open Source
A3979breakout ??? ??? ??? ??? ???
grblshield No US 2.5 1/8 3 axis controller plugs onto Arduino Uno or similar

PMinMo stepper motor driver comparison.






Mid-Band Resonance Compensation

Gecko drivers have a feature called mid-band resonance compensation which keeps stepper motors from stalling due to resonance issues that can occur when the motor is turning in the range of 5-15 RPMs. This can be very useful when controlling the steppers on a Tiag mill, for example. However, the stepper motors in a Mendel never run anywhere near that range, so mid-band resonance compensation provides no benefit to a Mendel build.

Troubleshooting

Pololu Modules

  • Stepper Motor is "jittering"
    • The Pololu modules shut down when they're too hot. Ensure proper cooling.
  • Stepper motor draws too many amps
    • Pololu modules have a small SMD potentiometer for adjusting the current. Connect one stepper at a time and adjust the amperage until you're satisfied with the setting.
    • Adjust so the steppers can still hold the torque but don't get too hot. Personally, I go near the amperage specified per coil.


stepper motor driver

You do not need a "controller" to drive a stepper motor. All you need is a couple of transistors.

I've been driving these things just fine using an opto-isolator and a power transistor hooked up directly to my printer port since way back in 1986, and it still works today.

Personally - I think the idea of using a stepper driver is really silly. You don't need 2 computers and two sets of everything just to energize coils in sequneces! Worse - the fact that you've stuck another gadget between your computer and the stepper means that you've doubled the complexity of your computer code, and halved the useful info you can get back all at once. Yes - it's 400% sillier to use a driver, than to simply drive it direct from your PC!

One major thing lacking from drivers, is the PCs ability to measure the current the stepper is drawing. Without the driver, it's a simple matter to let the PC get this extra bit of info, and then your code can calculate the force that your steppers are experiencing - so you could for example detect a stall, or make them go faster when they're under less load, etc etc.

-- anonymous

Just my 2 cents: You have no idea of the physics behind a motor and whats going on inside a stepper driver. Of course you are able to make a motor turn by just using some transistors and portpins. But if you want to get high performace out of it, this is the wrong way. And the complexity of your software won't increase when using a driver with a simple step and direction interface. So what's the problem?

Regards Thorsten Ostermann

The anonymous poster is be right -- driving steppers using an opto-isolator and a few transistors plugged into a Centronics style printer port works fine -- and is the most common way of using EMC including EMCRepRap. Alas, it's getting harder and harder to find a computer with such a port. Those of us without such a port are forced to use unnecessarily complicated arrangements. --DavidCary 18:22, 28 September 2012 (UTC)

split

This stepper motor page is getting a bit long.

I suggest splitting along the lines of

  • information about stepper motors themselves stay at stepper motor

--DavidCary 02:58, 30 March 2013 (UTC)

Further reading

  • stepper motor
  • Alternative electronics has some design considerations for people designing stepper motor controllers and other reprap electronics.
  • The Open Circuits wiki "motor driver" article has a long list of open-source stepper motor drivers, and related information.
  • The Reprapped Development Board (RDB) series of pages -- in particular, RDB STP and RDB-STP-001-G-DIY -- has some ideas about making motor drivers that are optimized for DIY, for flexibility and for upgrade-ability.