Stepper motor driver

From RepRap
Revision as of 12:32, 22 May 2013 by DavidCary (talk | contribs) (move text about motor driver electronics from stepper motor)
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 Chips

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.

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

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

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.

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 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
  • information about power drivers directly connected to the steppers gets moved to the "Stepper Drivers" section of Alt Select Electronics. Unless you have a better idea?

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


Further reading