Sie sind auf Seite 1von 79

All About Stepper Motors

Created by Bill Earl

Last updated on 2015-09-29 06:19:01 PM EDT

Guide Contents
Guide Contents
What is a Stepper Motor?
A 4-phase unipolar motor.

Types of Steppers
Motor Size
Step Count
Gearing
Shaft Style
Wiring
Coils and Phases
Unipolar vs. Bipolar

6
6
7
8
9
10
11
12

5-Wire Motor
6-Wire Motor
8-Wire Motor

12
13
13

Driving a Stepper
Simple Unipolar Driver
Simple Dual H-Bridge Driver
Adafruit Motor Shield V2
Advanced CNC Controllers
Matching the Driver to the Stepper
Know the Driver Specifications
Know the Motor Specifications
Obey the Law!
Running Above the Law?
Chopper Drives

15
16
17
18
19
21
22
22
23
23
24

FAQ
Resources

Adafruit Industries

2
3

26
28

https://learn.adafruit.com/all-about-stepper-motors

Page 2 of 28

What is a Stepper Motor?

Stepper motors are DC motors that move in discrete steps. They have multiple coils that are
organized in groups called "phases". By energizing each phase in sequence, the motor will rotate,
one step at a time.
With a computer controlled stepping you can achieve very precise positioning and/or speed control.
For this reason, stepper motors are the motor of choice for many precision motion control
applications.
Stepper motors come in many different sizes and styles and electrical characteristics. This guide
details what you need to know to pick the right motor for the job.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 3 of 28

A 4-phase unipolar motor.


Animation from Wikimedia Commons
What are stepper motors good for?
Positioning Since steppers move in precise repeatable steps, they excel in applications
requiring precise positioning such as 3D printers, CNC, Camera platforms and X,Y
Plotters. Some disk drives also use stepper motors to position the read/write head.
Speed Control Precise increments of movement also allow for excellent control of
rotational speed for process automation and robotics.
Low Speed Torque - Normal DC motors don't have very much torque at low speeds. A
Stepper motor has maximum torque at low speeds, so they are a good choice for
applications requiring low speed with high precision.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 4 of 28

What are their limitations?


Low Efficiency Unlike DC motors, stepper motor current consumption is independent of
load. They draw the most current when they are doing no work at all. Because of this, they
tend to run hot.
Limited High Speed Torque - In general, stepper motors have less torque at high
speeds than at low speeds. Some steppers are optimized for better high-speed
performance, but they need to be paired with an appropriate driver to achieve that
performance.
No Feedback Unlike servo motors, most steppers do not have integral feedback for
position. Although great precision can be achieved running open loop. Limit switches or
home detectors are typically required for safety and/or to establish a reference position.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 5 of 28

Types of Steppers
There are a wide variety of stepper types, some of which require very specialized drivers. For our
purposes, we will focus on stepper motors that can be driven with commonly available drivers.
These are: Permanent Magnet or Hybrid steppers, either 2-phase bipolar, or 4-phase unipolar.

Motor Size
One of the first things to consider is the work that the motor has to do. As you might expect, larger
motors are capable of delivering more power. Stepper motors come in sizes ranging from smaller
than a peanut to big NEMA 57 monsters.
Most motors have torque ratings. This is what you need to look at to decide if the motor has the
strength to do what you want.
NEMA 17 is a common size used in 3D printers and smaller CNC mills. Smaller motors find
applications in many robotic and animatronic applications. The larger NEMA frames are common in
CNC machines and industrial applications.
The NEMA numbers define standard faceplate dimensions for mounting the motor. They do not
define the other characteristics of a motor. Two different NEMA 17 motors may have entirely
different electrical or mechanical specifications and are not necessarily interchangeable.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 6 of 28

Step Count
The next thing to consider is the positioning resolution you require. The number of steps per
revolution ranges from 4 to 400. Commonly available step counts are 24, 48 and 200.
Resolution is often expressed as degrees per step. A 1.8 motor is the same as a 200
step/revolution motor.
The trade-off for high resolution is speed and torque. High step count motors top-out at lower RPMs
than similar size. And the higher step-rates needed to turn these motors results in lower torque than
a similar size low-step-count motor at similar speeds.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 7 of 28

Gearing
Another way to achieve high positioning resolution is with gearing. A 32:1 gear-train applied to the
output of an 8-steps/revolution motor will result in a 512 step motor.
A gear train will also increase the torque of the motor. Some tiny geared steppers are capable of
impressive torque. But the tradeoff of course is speed. Geared stepper motors are generally limited
to low RPM applications.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 8 of 28

Shaft Style
Another thing to consider is how the motor will interface with the rest of the drive system. Motors are
available with a number of shaft styles:
Round or "D" Shaft: These are available in a variety of standard diameters and there are
many pulleys, gears and shaft couplers designed to fit. "D" shafts have one flattened side to
help prevent slippage. These are desirable when high torques are involved.
Geared shaft: Some shafts have gear teeth milled right into them. These are typically
designed to mate with modular gear trains.
Lead-Screw Shaft: Motors with lead-screw shafts are used to build linear actuators.
Miniature versions of these can be found as head positioners in many disk drives.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 9 of 28

Wiring
Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 10 of 28

There are many variations in stepper motor wiring. For our purposes, we will focus on steppers that
can be driven with commonly available drivers. These are Permanent Magnet or Hybrid steppers
wired as 2-phase bipolar, or 4-phase unipolar.

Coils and Phases


A stepper motor may have any number of coils. But these are connected in groups called "phases".
All the coils in a phase are energized together.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 11 of 28

Unipolar vs. Bipolar


Unipolar drivers, always energize the phases in the same way. One lead, the "common" lead, will
always be negative. The other lead will always be positive. Unipolar drivers can be implemented
with simple transistor circuitry. The disadvantage is that there is less available torque because only
half of the coils can be energized at a time.
Bipolar drivers use H-bridge circuitry to actually reverse the current flow through the phases. By
energizing the phases with alternating the polarity, all the coils can be put to work turning the motor.
A two phase bipolar motor has 2 groups of coils. A 4 phase unipolar motor has 4. A 2-phase bipolar
motor will have 4 wires - 2 for each phase. Some motors come with flexible wiring that allows you to
run the motor as either bipolar or unipolar.

5-Wire Motor

This style is common in smaller unipolar motors. All


of the common coil wires are tied together
internally abd brought out as a 5th wire. This motor
can only be driven as a unipolar motor.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 12 of 28

6-Wire Motor

This motor only joins the common wires of 2 paired


phases. These two wires can be joined to create a
5-wire unipolar motor.
Or you just can ignore them and treat it like a
bipolar motor!

8-Wire Motor

The 8-wire unipolar is the most versatile motor of


all. It can be driven in several ways:
4-phase unipolar - All the common wires
are connected together - just like a 5-wire
motor.
2-phase series bipolar - The phases are
connected in series - just like a 6-wire motor.
2-phase parallel bipolar - The phases are
connected in parallel. This results in half the
resistance and inductance - but requires
twice the current to drive. The advantage of
this wiring is higher torque and top speed.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 13 of 28

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 14 of 28

Driving a Stepper
Step in time, step in time
Come on, mateys, step in time
Step in time
Step in time, step in time
Step in time, step in time
Never need a reason, never need a rhyme
We step in time, we step in time
"Step In Time"
Robert B. Sherman and Richard M. Sherman

Driving a stepper motor is a bit more complicated than driving a regular brushed DC motor. Stepper
motors require a stepper controller to energize the phases in a timely sequence to make the motor
turn.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 15 of 28

Simple Unipolar Driver


The simplest type of driver can be built with a handful of transistors. These are simply switched on
and off in sequence to energize the phases and step the motor. Unipolar drivers are relatively
inexpensive to build, but only work with unipolar motors. There is an excellent tutorial on how to
build one at the Arduino site.

Unipolar Stepper Drive Tutorial


http://adafru.it/doa

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 16 of 28

Simple Dual H-Bridge Driver


Driving a bipolar motor requires 2 full H-bridges so it can reverse the current to the phases. Hbridges can be tricky to build from scratch. But there are plenty of H-bridge chips available to
simplify the task.
The L293D is one of the most popular and economical chips. These can be found at the heart of
most first-generation motor shields, including the incredibly popular V1 Adafruit Motor Shield.
There is an excellent tutorial on using a bare L293D with an Arduino in the Adafruit Learning
System:

Lesson 16 - Stepper Motors


http://adafru.it/dob

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 17 of 28

Adafruit Motor Shield V2


The Adafruit Motor Shield V2 is a big step up from the basic L293D based controllers. The V2 shield
uses two TB6612 MOSFET drivers. Compared to the L293D, the TB6612 offers twice the current
capacity and much lower voltage drops to drive your steppers more efficiently.
With 2 driver chips and 4 full H-bridges total, each shield can drive up to two stepper motors. The
driver chips are interfaced via a dedicated PWM driver chip with an I2C interface. This frees up lots
of GPIO pins for other uses, and makes the shield stackable too. You can stack up to 32 of them to
control 64 motors with just 2 IO pins!
Compete details of this driver can be found in the Learning system.

Adafruit Motor Shield V2 Guide


http://adafru.it/doc

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 18 of 28

Advanced CNC Controllers


The gShield and TinyG CNC controller boards take you one step closer to industrial level stepper
performance. These boards feature constant-current "chopper" drivers that can be tuned to deliver
maximum torque and speed from your motors.
The TinyG CNC features an on-board G-code interpreter and 4 motor outputs making this a
complete embedded solution for a small to medium sized 4-axis CNC machine.
As you might expect, these advanced, high-performance boards are more complex to work with and
are recommended for experienced users.
Details on these boards and their operation can be found in the TinyG Wiki and the Synthetos
Forums.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 19 of 28

Synthetos Forums
http://adafru.it/dod

Tiny G Wiki
http://adafru.it/doe

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 20 of 28

Matching the Driver to the Stepper

Now we come to the most important part: making sure that your motor and driver are compatible.
Mismatched motors and drivers can result in disappointing performance. Or worse: damage to the
motor and/or controller.
If you choose unwisely, you might meet this guy:

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 21 of 28

Know the Driver Specifications


The two most important parameters in the driver specificatons are:
Voltage - The maximum voltage that the driver can supply to the motor.
Continuous Current - The maximum current that the driver can supply to the motor.

"Peak" current ratings are not applicable to stepper motors. Always go by the "continuous"
current rating.

Know the Motor Specifications


You will also need to know the electrical specifications for the motor. There are 2 critical
parameters:
Amps per phase - This is the maximum current that the motor windings can handle without
overheating.
Resistance per phase - This is the resistance of each phase.
A Voltage rating is often stated. It is usually calculated from the two above - but not always. It is
Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 22 of 28

better to calculate yourself from the above parameters using Ohm's Law.

Obey the Law!


Stepper motor phases are inductors, so they will resist rapid changes in current flow. But at the end
of each step or when not moving, they behave like a purely resistive load and will behave according
to Ohm's Law (http://adafru.it/ikA).
Standing still is also when a stepper motor draws the most current. So Ohm's Law allows us to use
the motor specifications to calculate the current requirements of the driver.
Voltage = Current x Resistance
or
Current = Voltage / Resistance

These formulas should be strictly applied for all "constant voltage" stepper controllers. This
includes both V1 and V2 Motor Shields from Adafruit, and virtually all other L293D based
controllers.

But some motors have very low coil resistance. Strictly following those formulas, the drive voltage
will be less than 5v and performance will not be good. This type of motor is not a good match for a
constant-voltage driver. These steppers require a more specialized controller.

Running Above the Law?


It is not possible to cheat Ohm's Law. If you try, you will have to answer to the Blue Smoke Monster.
However, there are some other laws at work here. The expertise at the law firm of Lenz, Faraday
and Ohm can help you to increase the performance of your motor.
The stepper coils create a magnetic field when they are energized. According to Faraday's
Law (http://adafru.it/ikB), the changing magnetic field induces a current in the coil. And according to

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 23 of 28

Lenz's Law (http://adafru.it/ikC), that current will be in the reverse direction of the current creating
the field. This reverse current is known as "Back Electromotive Force" or "Back EMF".
This Back EMF increases the "impedance" or effective resistance of the coil. So Ohm's
Law (http://adafru.it/ikD) still applies - but to this impedance, not to the simple phase resistance.
This impedance limits the current flow through the coil at the beginning of each step.

Chopper Drives
A Chopper or "Constant Current" drive compensates for the back EMF by driving the motor with a
higher voltage. It is not unusual to drive stepper motors at several times their rated voltage using a
chopper drive.
To keep things safe at these higher voltages, the chopper drive also monitors the current being
delivered to the motor and "chops" it before it exceeds a pre-set level.
By starting at a higher voltage, the chopper drive is able to deliver more current to the coils at the
start of the step, increasing the available torque. In addition to adding torque at slower speeds, this
also allows for higher top-speeds.
Selecting a chopper driver and configuring it for a specific motor requires a good understanding of
both the motor and the controller.
Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 24 of 28

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 25 of 28

FAQ
Will this motor work with my shield?
You need to know the motor specifications as well as the controller specification. Once you have
that information, check the "Matching the Driver to the Stepper" page to see if they are
compatible.
It's a NEMA 17, so it should work, right?
NEMA frame-size standards only define the dimensions of the mounting faceplate. To figure out
if it is compatible, you need to know the electrical specifications of the motor.
What if there are no motor specifications?
See Jason on reverse engineering the stepper wire pinouts (http://adafru.it/aOI). That will tell you
the phase resistance. For phase current, you can estimate based on motors of similar design
and similar phase resistance.
When in doubt, it is always better to err on the safe side and use a lower current!
What size motor do I need for my project?
Most motors have torque (http://adafru.it/doj) specifications - usually in inch/ounces or
newton/centimeters. One inch/ounce means that the motor can exert a force of one ounce at
one inch from the center of the shaft. For example, it could hold up one ounce using a 2"
diameter pulley.
When calculating the torque required for your project, be sure to allow extra torque required for
acceleration (http://adafru.it/dok) and to overcome friction. It takes more torque to lift a mass
from a dead stop than it does to simply hold it up.
If your project requires a lot of torque and not much speed, consider a geared stepper.
How do I connect my motor to the Motor Shield?
For motors purchased from Adafruit, there are wiring instructions listed in the product
descriptions.
For other motors, check the motors spec sheet if available.
If you don't have a spec sheet, check Jason on reverse engineering the stepper wire
pinouts (http://adafru.it/aOI).
Will this power supply work with my motor?
First make sure it does not exceed the voltage rating for the motor or the controller.* You can
usually run a motor at a lower voltage, although you will get less torque.
Next, check the current rating. Most stepping modes energize two phases at a time, so the
Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 26 of 28

current rating should be at least twice the current per phase for your motor.
* This applies to constant voltage drivers. For chopper drive controllers, check the instructions for
your controller.

Adafruit Industries

https://learn.adafruit.com/all-about-stepper-motors

Page 27 of 28

Resources
There is a lot of excellent information on the web about stepper motors. Here are some of our
favorite links:
Wikipedia (http://adafru.it/aOF)Stepper Motor Page (http://adafru.it/aOF)
RepRap Stepper Motor Page (http://adafru.it/dol)
Jones on Stepper Motors (http://adafru.it/aOH)
Jason on reverse engineering the stepper wire pinouts (http://adafru.it/aOI)

Adafruit Industries

Last Updated: 2015-09-29 06:19:01 PM EDT

Page 28 of 28

AN907
Stepping Motors Fundamentals
Author:

Reston Condit
Microchip Technology Inc.
Dr. Douglas W. Jones
University of Iowa

INTRODUCTION
Stepping motors fill a unique niche in the motor control
world. These motors are commonly used in measurement and control applications. Sample applications
include ink jet printers, CNC machines and volumetric
pumps. Several features common to all stepper motors
make them ideally suited for these types of
applications. These features are as follows:
1.

2.

3.

4.
5.

Brushless Stepper motors are brushless. The


commutator and brushes of conventional
motors are some of the most failure-prone
components, and they create electrical arcs that
are undesirable or dangerous in some
environments.
Load Independent Stepper motors will turn at
a set speed regardless of load as long as the
load does not exceed the torque rating for the
motor.
Open Loop Positioning Stepper motors
move in quantified increments or steps. As long
as the motor runs within its torque specification,
the position of the shaft is known at all times
without the need for a feedback mechanism.
Holding Torque Stepper motors are able to
hold the shaft stationary.
Excellent response to start-up, stopping and
reverse.

The following sections discuss the most common types


of stepper motors, what circuitry is needed to drive
these motors, and how to control stepping motors with
a microcontroller.

TYPES OF STEPPING MOTORS


There are three basic types of stepping motors:
permanent magnet, variable reluctance and hybrid.
This application note covers all three types. Permanent
magnet motors have a magnetized rotor, while variable
reluctance motors have toothed soft-iron rotors. Hybrid
stepping motors combine aspects of both permanent
magnet and variable reluctance technology.
The stator, or stationary part of the stepping motor
holds multiple windings. The arrangement of these
windings is the primary factor that distinguishes
different types of stepping motors from an electrical
point of view. From the electrical and control system
perspective, variable reluctance motors are distant
from the other types. Both permanent magnet and
hybrid motors may be wound using either unipolar
windings, bipolar windings or bifilar windings. Each of
these is described in the sections below.

Variable Reluctance Motors


Variable Reluctance Motors (also called variable
switched reluctance motors) have three to five
windings connected to a common terminal. Figure 1
shows the cross section of a three winding, 30 degree
per step variable reluctance motor. The rotor in this
motor has four teeth and the stator has six poles, with
each winding wrapped around opposing poles. The
rotor teeth marked X are attracted to winding 1 when it
is energized. This attraction is caused by the magnetic
flux path generated around the coil and the rotor. The
rotor experiences a torque and moves the rotor in line
with the energized coils, minimizing the flux path. The
motor moves clockwise when winding 1 is turned off
and winding 2 in energized. The rotor teeth marked Y
are attracted to winding 2. This results in 30 degrees of
clockwise motion as Y lines up with winding 2.
Continuous clockwise motion is achieved by sequentially energizing and de-energizing windings around the
stator. The following control sequence will spin the
motor depicted in Figure 1 clockwise for 12 steps or
one revolution.

EXAMPLE 1:
Winding 1:

1001001001001

Winding 2:

0100100100100

Winding 3:

0010010010010
time

2004 Microchip Technology Inc.

DS00907A-page 1

AN907
Figure 1 illustrates the most basic variable reluctance
stepping motor. In practice, these motors typically have
more winding poles and teeth for smaller step angles.
The number of poles can be made greater by adding
windings, for example, moving to 4 or 5 windings, but
for small step angles, the usual solution is to use
toothed pole pieces working against a toothed rotor.
Variable reluctance motors using this approach are
available with step angles close to one degree.

FIGURE 1:

FIGURE 2:

UNIPOLAR STEPPER
MOTOR

VARIABLE RELUCTANCE
STEPPER MOTOR
The difference between a permanent magnet stepping
motor and a hybrid stepping motor lies in how the multipole rotor and multi-pole stator are constructed. These
differences will be discussed later.

EXAMPLE 2:
Winding 1a: 100010001000
Winding 1b: 001000100010

Unipolar Motors

Winding 2a: 010001000100

Unipolar stepping motors are composed of two


windings, each with a center tap. The center taps are
either brought outside the motor as two separate wires
(as shown in Figure 2) or connected to each other
internally and brought outside the motor as one wire.
As a result, unipolar motors have 5 or 6 wires. Regardless of the number of wires, unipolar motors are driven
in the same way. The center tap wire(s) is tied to a
power supply and the ends of the coils are alternately
grounded.

Winding 2b: 000100010001

Unipolar stepping motors, like all permanent magnet


and hybrid motors, operate differently from variable
reluctance motors. Rather than operating by minimizing the length of the flux path between the stator poles
and the rotor teeth, where the direction of current flow
through the stator windings is irrelevant, these motors
operate by attracting the north or south poles of the
permanently magnetized rotor to the stator poles.
Thus, in these motors, the direction of the current
through the stator windings determines which rotor
poles will be attracted to which stator poles. Current
direction in unipolar motors is dependent on which half
of a winding is energized. Physically, the halves of the
windings are wound parallel to one another. Therefore,
one winding acts as either a north or south pole
depending on which half is powered.

time

Note:

Only half of each winding is energized at a


time in the above sequence. As above, the
following sequence will spin the motor
clockwise 12 steps or one revolution.

EXAMPLE 3:
Winding 1a: 110011001100
Winding 1b: 001100110011
Winding 2a: 011001100110
Winding 2b: 100110011001
time

Figure 2 shows the cross section of a 30 degree per


step unipolar motor. Motor winding number 1 is
distributed between the top and bottom stator poles,
while motor winding number 2 is distributed between
the left and right motor poles. The rotor is a permanent
magnet with six poles, three north and three south, as
shown in Figure 2.

DS00907A-page 2

2004 Microchip Technology Inc.

AN907
Unlike in the first sequence described, two winding
halves are energized at one time in the second
sequence. This gives the motor more torque, but also
increases the power usage by the motor. Each of the
above sequences describes single stepping or
stepping the motor in its rated step size (in this case 30
degrees). Combining these two sequences allows for
half stepping the motor. The combined sequence is
shown in Example 4 (24 steps per revolution).

FIGURE 3:

BIPOLAR STEPPER MOTOR

EXAMPLE 4:
Winding 1a: 11000001110000011100000111
Winding 1b: 00011100000111000001110000
Winding 2a: 01110000011100000111000001
Winding 2b: 00000111000001110000011100
time
This method moves the motor in steps that are half its
rated step size. It is important to note that the torque
generated by the motor during this sequence is not
constant, as alternating steps have one and two halves
of a winding energized respectively.
Figure 2 illustrates the most basic unipolar motor. For
higher angular resolutions, the rotor must have more
poles. Permanent magnet rotors with 100 poles have
been made, and this pole count is commonly achieved
for hybrid rotors, using toothed end-caps on a simple
bipolar permanent magnet. When the rotor has a high
pole count, the stator poles are always toothed so that
each stator winding works against a large number of
rotor poles.

Figure 3 illustrates a 30 degree per step bipolar motor.


Motor winding 1 is distributed between the top and
bottom stator poles, while motor winding 2 is distributed
between the left and right stator poles. The rotor is a
permanent magnet with 6 poles, 3 south and 3 north
arranged around its circumference.
Like a unipolar motor, bipolar motors can be single
stepped with two different control sequences. Using +
and - to indicate the polarity of the power applied to
each motor terminal and 0 to indicate no power is
applied, these sequences are shown in Example 5 for
one revolutions or 12 steps. The first sequence minimizes power consumption by energizing only one winding at a time, while the second sequence maximizes
torque by energizing both windings at a time.

EXAMPLE 5:
Terminal 1a:

+ 0 -

Terminal 1b:

Terminal 2a:

0 + 0

Terminal 2b:

Terminal 1a:

+ + -

Terminal 1b:

- + + -

Terminal 2a:

+ +

Terminal 2b:

+ + -

0 + 0

- 0 + 0

0 + 0

0 + 0

- 0 + 0 -

0 + 0

0 + 0
-

0 +

time >

Bipolar Motors
Bipolar stepping motors are composed of two windings
and have four wires. Unlike unipolar motors, bipolar
motors have no center taps. The advantage to not
having center taps is that current runs through an entire
winding at a time instead of just half of the winding. As
a result, bipolar motors produce more torque than
unipolar motors of the same size. The draw back of
bipolar motors, compared to unipolar motors, is that
more complex control circuitry is required by bipolar
motors.

0 + 0

0 + 0

- + + -

- + + -

+ +

- + +
-

+ +

+ +

+ +
-

time >

Current flow in the winding of a bipolar motor is


bidirectional. This requires changing the polarity of
each end of the windings. As shown in Figure 3,
current will flow from left to right in winding 1 when 1a
is positive and 1b is negative. Current will flow in the
opposite direction when the polarity on each end is
swapped. A control circuit, known as an H-bridge, is
used to change the polarity on the ends of one winding. Every bipolar motor has two windings, therefore,
two H-bridge control circuits are needed for each
motor. The H-bridge is discussed in more detail in the
Basic Control Circuits section.

2004 Microchip Technology Inc.

DS00907A-page 3

AN907
Combining these two sequences into one sequence
will half step the motor so that it moves in 15 degree
increments. The sequence for half stepping the motor
is shown in Example 6 for one revolution or 24 steps.

FIGURE 4:

BIFILAR STEPPER MOTOR

EXAMPLE 6:
Terminal 1a:

+ + 0 - - - 0 + + + 0 - - - 0 + + + 0 - - - 0 +

Terminal 1b:

- - 0 + + + 0 - - - 0 + + + 0 - - - 0 + + + 0 -

Terminal 2a:

0 + + + 0 - - - 0 + + + 0 - - - 0 + + + 0 - - -

Terminal 2b:

0 - - - 0 + + + 0 - - - 0 + + + 0 - - - 0 + + +

time >

Note:

The torque generated by the motor during


this sequence is not constant as alternating steps have one and two windings
energized respectively.

Bifilar Motors
The term bifilar literally means two threaded. Motors
with bifilar windings are identical in rotor and stator to
bipolar motors with one exception each winding is
made up of two wires wound parallel to each other. As
a result, common bifilar motors have eight wires
instead of the four wires of a comparable bipolar motor.
Bifilar motors are driven as either bipolar or unipolar
motors. To use a bifilar motor as a unipolar motor, the
two wires of each winding are connected in series and
the point of connection is used as a center-tap. Winding
1 in Figure 4 shows the unipolar winding connection
configuration. To use a bifilar motor as a bipolar motor,
the two wires of each winding are connected in either
parallel or series. Winding 2 in Figure 4 shows the
parallel connection configuration. A parallel connection
allows for high current operation, while a series
connection allows for high voltage operation.

Interestingly, unipolar motors are wound using bifilar


windings so that the external connection, which serves
as a center tap, is actually connected as shown for
winding 1 in Figure 4. As a result, unipolar motors may
be used as a bipolar motor at the rated voltage and half
the rated current specified for the motor. This statement
is based on the temperature and power constraints of a
motor.

Hybrid Motors
Hybrid motors share the operating principles of both
permanent magnet and variable reluctance stepping
motors. The rotor for a hybrid stepping motor is multitoothed, like the variable reluctance motor, and
contains an axially magnetized concentric magnet
around its shaft (see Figure 5). The teeth on the rotor
provide a path which helps guide the magnetic flux to
preferred locations in the air gap. The magnetic
concentric magnet increases the detent, holding and
dynamic torque characteristics of the motor when
compared with both the variable reluctance and
permanent magnet types.
In terms of stepping the motor, hybrid motors are driven
like unipolar and bipolar motors. Refer to the previous
sections Unipolar Motors and Bipolar Motors
for a description of how to make a hybrid motor turn.

FIGURE 5:

DS00907A-page 4

HYBRID STEPPING MOTOR

2004 Microchip Technology Inc.

AN907
CHOOSING A MOTOR

Unipolar Versus Bipolar

There are several factors to take into consideration


when choosing a stepping motor for an application.
Some of these factors are what type of motor to use,
the torque requirements of the system, the complexity
of the controller, as well as the physical characteristics
of the motor. The following paragraphs discuss these
considerations.

Permanent magnet and hybrid stepping motors are


available with either unipolar, bipolar or bifilar windings;
the latter can be used in either unipolar or bipolar
configurations. The choice between using a unipolar or
bipolar drive system rests on issues of drive simplicity
and power to weight ratio.

Variable Reluctance Versus Permanent


Magnet or Hybrid
Variable Reluctance Motors (VRM) benefit from the
simplicity of their design. These motors do not require
complex permanent magnet rotors, so are generally
more robust than permanent magnet motors.
With all motors, torque falls with increased motor
speed, but the drop in torque with speed is less
pronounced with variable reluctance motors. With
appropriate motor design, speeds in excess of 10,000
steps per second are feasible with variable reluctance
motors, while few permanent magnet and hybrid
motors offer useful torque at 5000 steps per second
and most are confined to speeds below 1000 steps per
second.
The low torque drop-off with speed of variable
reluctance motors allows use of these motors, without
gearboxes, in applications where other motors require
gearing. For example, some newer washing machines
use variable reluctance motors to drive the drum, thus
allowing direct drive for both the slow oscillating wash
cycle and the fast spin cycle.
Variable reluctance motors do have a drawback. With
sinusoidal exciting currents, permanent magnet and
hybrid motors are very quiet. In contrast, variable
reluctance motors are generally noisy, no matter what
drive waveform is used. As a result, permanent magnet
or hybrid motors are generally preferred where noise or
vibration are issues.
Unlike variable reluctance motors, permanent magnet
and hybrid motors cog when they are turned by hand
while not powered. This is because the permanent
magnets in these motors attract the stator poles even
when there is no power. This magnetic detent or
residual holding torque is desirable in some
applications, but if smooth coasting is required, it can
be a source of problems.
With appropriate control systems, both permanent
magnet and hybrid motors can be microstepped,
allowing positioning to a fraction of a step, and allowing
smooth, jerk-free moves from one step to the next.
Microstepping is not generally applicable to variable
reluctance motors. These motors are typically run in
full-step increments. Complex current limiting control is
required to achieve high speeds with variable
reluctance motors.

2004 Microchip Technology Inc.

Bipolar motors have approximately 30% more torque


than an equivalent unipolar motor of the same volume.
The reason for this is that only one half of a winding is
energized at any given time in a unipolar motor. A
bipolar motor utilizes the whole of a winding when
energized.
The higher torque generated by a bipolar motor does
not come without a price. Bipolar motors require more
complex control circuitry than unipolar motors (see
Basic Control Circuits). This will have an impact on
the cost of an application.
If in doubt, a unipolar motor or bifilar motor are good
choices. These motors can be configured as a unipolar
or bipolar motor and the application tested with the
motors operating in either mode.

Hybrid Versus Permanent Magnet


In selecting between hybrid and permanent magnet
motors, the two primary issues are cost and resolution.
The same drive electronics and wiring options
generally apply to both motor types.
Permanent magnet motors are, without question, some
of the least expensive motors made. They are sometimes described as can-stack motors because the
stator is constructed as a stack of two windings
enclosed in metal stampings that resemble tin cans
and are almost as inexpensive to manufacture. In
comparison, hybrid and variable reluctance motors are
made using stacked laminations with motor windings
that are significantly more difficult to wind.
Permanent magnet motors are generally made with
step sizes from 30 degrees to 3.6 degrees. The
challenge of magnetizing a permanent magnet rotor
with more than 50 poles is such that smaller step sizes
are rare! In contrast, it is easy to cut finely spaced teeth
on the end caps of a permanent magnet motor rotor, so
permanent magnet motors with step sizes of 1.8
degrees are very common, and smaller step sizes are
widely available. It is noteworthy that, while most
variable reluctance motors have fairly coarse step
sizes, such motors can also be made with very small
step sizes.
Hybrid motors suffer some of the vibration problems of
variable reluctance motors, but they are not as severe.
They generally can step at rates higher than permanent
magnet motors, although very few of them offer useful
torque above 5000 steps per second.

DS00907A-page 5

AN907
Functional Characteristics
Even when the type of motor is determined, there are
still several decisions to be made before selecting one
particular motor. Torque, operating environment,
longevity, physical size, step size, maximum RPM
these are some of the factors that will influence which
motor is chosen.

STEP SIZE
One of the most crucial decisions to make is the step
size of the motor. This will be determined by the
resolution necessary for a particular application. The
most common step sizes for PM motors are 7.5 and 3.6
degrees. This corresponds to 48 and 100 steps per
revolution respectively. Hybrid motors typically have
step sizes ranging from 3.6 degrees (100 steps per
revolution) to 0.9 degrees (400 steps per revolution).
Some stepping motors are sold with gear reductions
which provide smaller step angles than are possible
with even the finest stepping motors. Gear reductions
also increase the available torque, but because torque
falls with stepping rate, they decrease the maximum
rotational speed.

The dynamic torques, pull-in and pull-out, are a


function of step rate. These torques are important for
determining whether or not a stepping motor will slip
when operating in a particular application. A slip
refers to the motor not moving when it should or moving
when it should not (overrunning a stop). In either case,
the result is the controller will no longer know the
position of the motor. Open loop positioning fails in this
case. The motor must be adequately sized to prevent
this from happening or a closed loop feedback system
employed.
The pull-in torque offered by a stepping motor depends
strongly on the moment of inertia of any load rigidly
attached to the motor. This makes this torque figure
somewhat problematic because the moment of inertia
of the rig used to measure this torque is rarely stated in
manufacturers data sheets and is rarely equal to the
moment of inertia of the load actually driven in the
application.
Most manufacturers provide torque curves in their data
sheets. Figure 6 shows an example of a torque curve
for a stepping motor.

For linear movement, many stepper motors are


coupled to a lead screw by a nut (these motors are also
known as linear actuators). Even coarse steps with this
arrangement translate to very fine movements of the
lead screw because of the gear reduction inherent to
this mechanism.

TORQUE
Torque is a critical consideration when choosing a
stepping motor. Stepper motors have different types of
rated torque. These are:
Holding torque The torque required to rotate the
motors shaft while the windings are energized.
Pull-in torque The torque against which a motor
can accelerate from a standing start without
missing any steps, when driven at a constant
stepping rate.
Pull-out torque The load a motor can move
when at operating speed.
Detent torque The torque required to rotate the
motors shaft while the windings are not
energized.
Stepping motor manufacturers will specify several or all
of these torques in their data sheets for their motors.

DS00907A-page 6

2004 Microchip Technology Inc.

AN907
FIGURE 6:

TORQUE VS. SPEED


35

Torque (N-m)

30
25
20

PULL-OUT

15

PULL-IN

10
5
0
0

500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Speed (Steps Per Second)

LONGEVITY
Another factor to consider when choosing a motor is
the longevity of the motor. Some of the questions asked
should be:
How long does the motor need to work properly?
What environmental hazards will the motor be
subjected to?
What heat will the motor operate at?
Is the motors operation continuous or
intermittent?
Stepper motors by their very nature are more robust
than other types of motors because they do not have
brushes that will wear out over time. Typically, other
components in a particular system will wear out long
before the motor ever will. However, all stepper motors
are not created equal and even the best motors will fail
if the proper considerations are not made. The
following are some design guidelines that influence
motor longevity:
Ball bearings vs bronze bushings Ball bearings
last longer than bronze bushings and do not
generate as much heat, but they cost more.
Motors that run near their rated torque will not last
as long as those that do not. Motors should be
chosen so that they will run at 40-60% of their
torque rating.
Protect the motor from harsh environments.
Exposure, humidity, harsh chemicals, dirt and
debris will all take their toll on a motor.
Ensure adequate cooling. Motors generate heat
and this must be dissipated. For motors that
include an integral heat sink, ensure adequate
circulation of cooling air. Other motors are
designed to be cooled by conduction to the
chassis on which the motor is mounted. Hybrid
motors that sue rare-earth magnets are
particularly heat sensitive.

2004 Microchip Technology Inc.

Finally, motors should be driven properly. This


means special care should be taken to ensure the
current rating of the windings are not exceeded.
This will be discussed in depth in the Current
Limiting section.

BASIC CONTROL CIRCUITS


This section will show the basic circuits needed to drive
the various types of stepping motors. These circuits will
be expanded on later in the Current Limiting
section to include current limiting considerations.

Variable Reluctance
Variable reluctance motors have multiple windings,
typically three to five, which are all tied together at one
end. The windings are turned on one at a time in a
particular sequence to turn the motor.
Figure 7 shows the basic circuit for driving a variable
reluctance motor. Note the diodes across the windings.
As with all inductive loads, as voltage is switched on
across a winding, the current in the winding begins
ramping up. When the switching MOSFET for the
winding is turned off a voltage spike is produced that
can damage the transistor. The diode protects the
MOSFET from the voltage spike assuming the diode is
adequately sized.

DS00907A-page 7

AN907
FIGURE 7:

VARIABLE RELUCTANCE MOTOR CONTROL CIRCUIT.


VSUPPLY

To
Controller

Unipolar
The basic control circuit for a unipolar motor, shown in
Figure 8, is similar to that for a variable reluctance
motor. Note the extra diodes across each of the
MOSFETs. These are necessary because the inductor
is center tapped in unipolar motors. When one end of
the motor winding is pulled down, the other end will rise
and visa versa. These diodes prevent the voltage from
falling below ground across the MOSFETs.

FIGURE 8:

Some MOSFETs have integral diodes that allow


reverse current to flow unimpeded, regardless of the
gate voltage. If such transistors are used, and if these
integral diodes have sufficient current carrying capacity
to carry the full motor current, the lower diodes shown
in Figure 8 can be omitted. All of the diodes must have
switching speeds comparable to the speed of the
transistors.

UNIPOLAR MOTOR CONTROL CIRCUIT


VSUPPLY

To
Controller

To
Controller
B

DS00907A-page 8

2004 Microchip Technology Inc.

AN907
Bipolar
The basic circuit for driving the windings of a bipolar
motor is the H-bridge, shown in Figure 9. An H-bridge
can be configured to allow current to flow in either
direction across a winding. Referring to Figure 9,
current will flow from left to right in Winding 1 when
MOSFETs Q1 and Q4 are turned on while Q2 and Q3
are off. Current will flow from right to left when Q2 and
Q3 are on while Q1 and Q4 are off.
Note:

Transistors Q2 and Q4 are N-channel


MOSFETs and therefore require a positive
bias on turn-on. Q1 and Q3 are P-channel
MOSFETs, requiring a negative bias to
turn-on. An alternate H-bridge design
uses identical MOSFETs for all 4 transistors, and uses charge-pump and level
shifting circuitry to drive the gates of the
upper transistors shown in Figure 9.

FIGURE 9:

H-bridges have one inherent danger that should be


mentioned. Under no circumstances should the
transistors on the same side of the bridge be switched
on at the same time. This will cause a short which will
damage the control circuit. Special care should be
made to switch all MOSFETs off before turning the next
set of MOSFETs on.
The diodes in parallel with each of the MOSFETs
protect the MOSFETs from voltage spikes caused by
switching the inductor. These diodes must be
adequately sized in order to prevent damage to the
MOSFET or diode itself.
As pointed out for unipolar motors, some MOSFETs
have integral diodes; in fact, these are shown in the
schematic representation for MOSFETs used in
Figure 9; if these are able to conduct the full motor
current, the additional diodes shown in the figure can
be omitted.

BIPOLAR MOTOR CONTROL CIRCUIT


VSUPPLY

Q5

Q7

To Controller

Q2

Winding 1

B1

C1
D1

2004 Microchip Technology Inc.

Q4

Q6

Winding 2

Q8

A2

B2

To Controller

Q3

Q1
A1

C2
D2

DS00907A-page 9

AN907
MICROSTEPPING

In order to understand the fundamentals of microstepping, its necessary to look at the torque exerted by a
stepper motor as it turns. Figure 10 shows a graph of
torque verses rotor position for an ideal two-winding
stepper motor. Note the sinusoidal shape of the waveforms; in real motors, these waveforms will only be
approximately sinusoidal, and the sum of the torques
from the two windings will not be the perfect arithmetic
sum of the torques with just one or the other winding
powered.

Single stepping a motor results in jerky movements of


the motor, especially at lower speeds. Microstepping is
used to achieve increased step resolution and
smoother transitions between steps. In most applications, microstepping increases system performance
while limiting noise and resonance problems.
Microstepping works on the principle of gradually
transferring current from one winding to another. This is
achieved by pulse-width modulating the voltage across
the windings of a motor. The duty cycle of the signal
charging one winding is decreased as the duty cycle of
the signal charging the next winding is increased.

FIGURE 10:

TORQUE VS. ANGULAR POSITION FOR AN IDEAL TWO WINDING MOTOR

Holding Torque

1st Winding
2nd Winding
+3S

Combined
Windings

+6S

Angular Position

The desired motion of a stepper motor is linear. This


means the steps should be equal in size with no noticeable acceleration or deceleration of the shaft as the
motor turns. Good microstepping implementations
strive to get as near to this linear motion as possible.
The torque curve for one winding of the ideal two
winding stepping motor in Figure 10 can be expressed
mathematically by the following equation:

EQUATION 1:
T1 = Hsin(((/2)/S))
where T1 = torque of the first winding
H = holding torque
S = step angle, in radians

= shaft angle, in radians

DS00907A-page 10

The torque of the second winding is expressed by the


following equation.

EQUATION 2:
T2 = Hcos(((/2)/S))
A technique referred to as sine-cosine microstepping
adjusts the current in each winding so the net torque is
constant. In an ideal motor, the torque produced by
each winding is proportional to the current in that
winding, and the torques add linearly. Saturation and
fringe-field effects make real motors non-ideal, but in
practice, they are close enough that we can ignore
these nonlinearities. As a result, if we want to hold the
motor rotor at the angle , we can do so by setting the
currents through the motor windings to the values given
in Equation 3 and Equation 4.

2004 Microchip Technology Inc.

AN907
EQUATION 3:

again. The second winding then remains energized


while the first winding undergoes the polarity reversal.
Like the sine-cosine microstepping method, smooth
movement of the motor is achieved with this method by
changing the current in the windings in a sinusoidal
fashion. Figure 11 shows the way the current in each
winding is altered as the shaft turns.

I1 = IMAX cos(((/2)/S)/)

EQUATION 4:
I2 = IMAX sin(((/2)/S)/)
These equations assume that the current in the
windings will not exceed IMAX. The next section will talk
about current limiting considerations.
A second way to implement microstepping maximizes
torque in a bipolar stepping motor, though the torque is
not constant while the motor turns. In this method, one
winding is energized while the current flow in the other
winding is ramped down, reversed and then ramped up

BIPOLAR MICROSTEPPING FROM MAXIMUM TORQUE

Current

FIGURE 11:

1st Winding
+3S

+6S

+9S
2nd Winding

Angular Position (S = rated step size)

2004 Microchip Technology Inc.

DS00907A-page 11

AN907
In an ideal motor, microstepping can be used to achieve
arbitrarily fine angular resolution, but in practice friction
and departures from the ideal sinusoidal torque versus
shaft angle curve make this impractical. In practice, it is
rarely worthwhile to subdivide each motor step into
more than 32 microsteps, and even this is generous!
Using 32 microsteps per step, we can step in
increments of 0.23 degrees using an inexpensive
permanent magnet motor with 7.5 degrees per step.
We could achieve the same resolution using 1:32
reduction gearing, but this introduces backlash and it
reduces the maximum speed. Compared to microstepping, gearing has the benefit of increasing the torque
and position-holding stiffness of the motor.

Microstepping Limitations
The previous discussion assumed an ideal two winding
stepping motor. There are several factors that affect the
linearity of microstepping in real motors. The first
limitation is static friction in the system. Figure 10
shows a graph of torque verses position of the motor
shaft. Figure 12 shows this same graph (for one
winding) with the dotted lines representing the effect
static friction has on the system. Redrawing the graph
in Figure 12 to show only the available torque for a
single winding results in the graph shown in Figure 13.
Note the resulting dead zone between the zones of
available torque. Also note that the magnitude of torque
overall is less than the ideal case.

It is impractical to calculate the sine or cosine of the


duty cycle for the PWM signal supplying a winding
because the time to process the calculation and code
space needed. Its more practical to have a sine lookup table with the values for the duty cycle. In practice,
only one look-up table is needed because cosine is just
an offset of sine. The look-up table pointers corresponding to each winding just need to be offset by 90
degrees.

Holding Torque

FIGURE 12:

STATIC FRICTION IMPOSED ON TORQUE VS ANGULAR POSITION

+1S

+2S

+3S

+4S

+5S

+6S

+7S

+8S

+7S

+8S

Angular Position

Holding Torque

FIGURE 13:

MOTOR TORQUE MINUS STATIC FRICTION

+1S

+2S

+3S

+4S

+5S

+6S

Angular Position

DS00907A-page 12

2004 Microchip Technology Inc.

AN907
The dead zone has an impact on microstepping
because it limits the angular resolution of the stepping
motor. It also makes it impossible to produce perfectly
smooth transitions between steps.
Another limitation to microstepping is the fact that the
torque verses position curve is not perfectly sinusoidal
for real motors. The toothed shape of the rotor and
other physical characteristics of the motor contribute to
this. Figure 14 shows a plot of actual position vs.
expected position for a typical motor.

FIGURE 14:

REAL VS ACTUAL ROTOR


POSITION

CURRENT LIMITING
Stepping motors are often run at voltages higher than
their rated voltage. Although this is not necessarily the
case for very small stepper motors, high torque stepper
motors need to run at higher voltages in order for the
motor to reach its full potential. Increasing the voltage
supplied to a motor increases the rate at which current
rises in the windings of the motor. The more responsive
current in the windings, the greater the torque and
speed characteristics of the motor. This section will
explain why performance is boosted and what role
current limiting plays in this process.

Stepper Motor Winding Model


In order to understand why running stepper motors at
high voltage is beneficial to motor performance, it is
necessary to look at the behavior of current in the
windings of a stepping motor. A winding can be
modeled as the inductive-resistive circuit shown in
Figure 15.

FIGURE 15:

RESISTIVE-INDUCTIVE
WINDING MODEL
t = t1
R

V +The digital nature of the motor drive circuitry poses two


additional limits on the accuracy of microstepping. If
current levels through the motor windings are produced
from digital data, either by using analog-to-digital
converters or by measuring the current using digital-toanalog converters, the precision of these conversions
introduces problems. In addition, if the currents through
the motor windings are set by pulse-width modulation,
once the stepping rate comes anywhere near the pulse
rate used for current control, the precision of the
current control system becomes almost meaningless.

Motor/Winding
L

There are three components to this model: the supply


voltage, the resistance of the winding (R) and the
inductance of the winding (L).
Figure 16 shows how current behaves over time when
the supply voltage is applied.

FIGURE 16:
Current

WINDING CURRENT VS
TIME
dI (t = 0) = V
L
dt
IMAX = V
R

IMAX

Time
t = t1

2004 Microchip Technology Inc.

dI (t = t ) = V
1
L
dt

DS00907A-page 13

AN907
The current rises exponentially until IMAX is reached.
Current as a function of time is given by:

EQUATION 5:
I(t) = (V/R) (1 - e-t R/L)
The instantaneous rate that current rises when voltage
is first applied is given by:

EQUATION 6:
dI/dt(t = 0) = V/L
Ohms law governs the maximum current level.

In-series Resistance
The first way to increase the supply voltage without
exceeding IMAX is to connect a power resistor in series
with each winding of the motor. Figure 17 shows this
circuit. In the circuit shown, the magnitude of the supply
voltage is tripled (2V). This requires that a power
resistor equivalent to two times the internal resistance
of the winding (R) be added. This brings the total
resistance of the circuit to 2R. Notice the resistance
and voltage are increased proportionally so that
Equation 3 is still satisfied and IMAX is unchanged (i.e.,
IMAX = 2V/2R = V/R).

FIGURE 17:

WINDING MODEL WITH


ADDITIONAL RESISTANCE

EQUATION 7:

IMAX = V/R

EQUATION 8:
I(T) = (V/R) E-(T-T1) R/L
The instantaneous rate that the current drops when
voltage is removed is given by:

EQUATION 9:
dI/dt = -V/L
These equations show that current rises and falls for a
given winding as a function of the supply voltage and
the internal resistance of the winding. It is important to
understand this relation when applying a higher than
specified voltage to a stepping motor. The reason it is
important is that the current in the windings of a
stepping motor must never exceed the maximum
specified current (IMAX)(1). Running a motor at high
voltage but not taking into consideration current
limitations can be very detrimental to motor life, the
driver circuitry, and the well being of people who come
in contact with the motor (the motor gets really hot!).

Note 1: IMAX is a specification found in the


stepper motor manufacturers data sheet.

V +-

V +-

Figure 18 shows how current rise time is affected by


increasing the supply voltage and resistance. The rise
time is improved, therefore, the performance of motor
is improved. However, in order to achieve this performance boost, the efficiency of the system has dropped
significantly with the introduction of a power resistor.
The power resistor limits current in a less than efficient
manner by burning it off as heat. Depending on the
magnitude of the voltage supply increase, the power
resistor may be extremely large and expensive. For
battery controlled operation, the run time of the system
is significantly reduced by the power wasted in the
power resistor.

FIGURE 18:

Current

The current in the winding will remain at IMAX until the


supply voltage is switched off. Referring to Figure 16,
the current drops exponentially when the voltage
supply is removed. Current, as a function of time, drops
according to:

CURRENT VS TIME

IMAX = V = 2V
R
2R

2
1

Time

Referring to Equation 5 and Equation 6, the rate that


current rises in a winding is increased by using a higher
supply voltage. Equation 7, however, shows that IMAX
is also affected by increasing the supply voltage. So
how can the rise time be improved without the current
exceeding IMAX? The simplest way is to add resistance
in series with the motor.

DS00907A-page 14

2004 Microchip Technology Inc.

AN907
Another drawback of using a power resistor is that it
does not optimize the rise time of the current in a
winding. Referring to Equation 5 again, increasing
resistance has an adverse affect on the rise time.
Though increasing the voltage supply and resistance
proportionally produces a better rise time than not
increasing either, it would be ideal to increase the
supply voltage without adding resistance in series with
the winding. So how can the supply voltage be
increased without the addition of resistance and the
current still not rise above the motors rated IMAX? The
answer is to use two supply voltages.

FIGURE 20:

Two Power Supplies

Note that using two voltage supplies yields the best


results. The current rises rapidly and then remains at
IMAX when supply voltage is switched. This method
also has the added benefit of being power efficient
compared to adding a in-series resistor. One drawback
to the two voltage supply method, however, is that
using two separate supplies is often impractical in most
applications. Rarely are two voltage supplies available
for a given application and using two supplies is far less
cost effective than using just one. So how can one
voltage supply be used to accomplish this task? The
solution is the use of chopper control.

Applying a high voltage to the winding until IMAX is


reached and then dropping the voltage to a level that
will maintain IMAX is the most efficient way to improve
the performance of a stepping motor. One way to do
this involves the use of two power supplies. Figure 19
shows what this circuit might look like.

FIGURE 19:

TWO SUPPLY VOLTAGES

V +V +-

Current

2V
R

IMAX = V
R
2

Time

Chopper Control
V +-

The circuit requires a way to switch from one power


supply to the other. The time at which power is
switched from one supply to the other can be controlled
by either a closed loop or an open loop system. In the
case of an open loop system, Equation 5 is used to
calculate the length of time that the high voltage is
applied to the winding before switching to the low
voltage supply. For closed loop control, a small current
sensing resistor provides feedback to the controller and
the voltage is switched when IMAX is reached. This will
be talked about more in the next section (chopping
circuits) and is applicable to using two power supplies.
Figure 20 shows how the current behaves for the three
situations discussed thus far:
1.
2.
3.

CURRENT VS TIME

Using the rated voltage


Using high voltage with a power resistor
Using high voltage during the rise time of the
current to IMAX and then switching to the rated
voltage

2004 Microchip Technology Inc.

Chopper control is a way to limit the current in the


winding of a stepping motor when using a high voltage
supply (a voltage higher than a motors rated voltage).
This method is very suitable when using a microcontroller for stepping motor control because limited
additional microcontroller resources are required. The
basic idea behind chopper control is to use a high
voltage source to bring the current in the winding of a
stepping motor up to IMAX very quickly. When IMAX is
reached the voltage is chopped or switched off. A
pulse-width modulated waveform is used to create an
average voltage and an average current equal to the
nominal voltage and current for the winding. The duty
cycle of this PWM waveform is shown in the following
relation:

EQUATION 10:
D = VNOMINAL/VSUPPLY
Where VNOMINAL = IMAX/r
A comparison of current and the voltage applied to the
winding over time is shown Figure 21.

DS00907A-page 15

AN907
FIGURE 21:

CURRENT AND SUPPLY


VOLTAGE COMPARISON
FOR CHOPPER CONTROL

When VSENSE rises above VCONTROL, the voltage


across the winding is switched off. The passive components connected to the comparator provide hysteresis
so that the voltage is not reapplied until:

Winding Current

VSENSE = VCONTROL - Vx, where Vx is a small voltage.


IMAX

Time

Hysteresis is necessary to prevent limiting the


frequency with which the comparator and MOSFETs
chop the supply voltage. Both thermal switching losses
in the MOSFETs and radio frequency dissipation from
the entire circuit rise with chopping frequency, so this
frequency should generally be held in the audio range
but well above the maximum expected stepping rate.

Current Limiting For Microstepping

There are many different ways to implement chopper


control using a microcontroller. The following circuit
illustrates a hardware-based design. More discussion
about chopper control as it relates to microcontrollers
will be covered in the next section (Microcontroller
Control of a Stepping Motor.)

With reference to Figure 22, microstepping could be


implemented by deriving VCONTROL from the output of
a digital-to-analog converter in the controller; some
motor driver chips even include 3-bit internal DACs
along with the comparator and final-stage drive
circuitry.

Supply Voltage
As Figure 21 indicates, the voltage supply is switched
on until IMAX is reached. Thereafter, the voltage is
modulated to limit the current in the winding to IMAX.

Current limiting is an integral part of microstepping.


Microstepping varies the current sinusoidually between
0 and IMAX, rather than bringing the current up to IMAX
as quickly as possible. Microstepping can be combined
with the high voltage supply current limiting techniques
talked about in this section in order to improve the
responsiveness of a motor when microstepping. When
microstepping at a high voltage, the duty cycle of waveforms modulating each of the windings must be limited
so that the current in the windings never exceeds IMAX.
For instance, if a 5V stepping motor is being driven by
a 10V peak-to-peak waveform, the duty cycle of the
waveform should never exceed 50%.

Time

Figure 22 shows what one possible chopper circuit


looks for in a bipolar motor. The way this circuit works
is that the voltage across the current sense resistor
(RSENSE) is compared to a control voltage (VCONTROL)
which is predetermined according to:

EQUATION 11:
VCONTROL = RSENSE IMAX
In practice, the sense resistor should be as small as
possible while still allowing VCONTROL to be easily
measurable. Values of VCONTROL between 0.6 volts
(one silicon diode drop) and 5 volts are common, and
sense resistances on the other of 1/2 or 1 ohm are
common. Generally, the voltage across RSENSE should
not exceed 10% of the supply voltage! For very high
current motors, current sensing using Hall-effect
sensors and other advanced technologies can greatly
reduce losses from current sensing.

DS00907A-page 16

2004 Microchip Technology Inc.

AN907
FIGURE 22:

CHOPPER CIRCUIT
VSUPPLY

To Control A

B To Controller

RSENSE
Comparator
VCONTROL

Understanding Motor Specifications

High torque stepping motors are a different story all


together. These motors have very small internal
resistances and run at high currents. An example of a
high performance motor would be a motor with the
specifications shown in Table 1. The statement of
holding torque in Table 1 is typical of many motor
manufacturers, using kilograms as a measure of force.
This must be converted to dyne-centimeters or newtonmeters before doing any physical calculations.

Low performance stepper motors are purposefully built


with a high internal resistance so that they can be run
on a typical voltage source, usually 5V to 12V. These
motors do not produce much torque for their size, nor
do they spin very fast. They can be run without current
limiting considerations as long as they are driven at
their rated voltage. However, higher motor performance (speed and torque) can be achieved by running
these motors at higher voltages.

TABLE 1:

HIGH PERFORMANCE STEPPING MOTOR SPECIFICATION

Step
Angle

Voltage

Current

Resistance

Inductance

Holding
Torque

Rotor
Inertia

Number
of Leads

Deg

A/Phase

Ohm/Phase

mH/Phase

kg-cm

g-cm2

LEAD

kg

1.8

1.8

4.5

0.4

0.96

16

570

1.4

2004 Microchip Technology Inc.

Weight

DS00907A-page 17

AN907
Notice the voltage specification 1.8V. Running the
motor at this voltage will yield terrible performance in
terms of speed and torque. High performance
stepping motors are intended to be driven at higher
voltages with current limiting considerations.
As discussed earlier, motor windings have some
internal resistance (R). This resistance is a function of
wire diameter, the number of turns and the resistivity of
the winding material. This resistance is ultimately what
determines the maximum current that a winding should
be subjected to. The power loss of a winding is given
by:

EQUATION 12:
PLOSS = R IMAX2
The maximum current allowed in a motor winding must
not overheat the motor, it must not drive the magnetic
circuits into saturation and it must not produce motor
fields that are sufficient to demagnetize the motor rotor.
In a well designed permanent magnet motor, when
both motor windings are run at IMAX and the motor is
properly mounted and ventilated, it will be very close to
both its thermal and magnetic limits. This is why it is so
critical that the drive circuitry should never permit
currents exceeding IMAX.
The voltage specification given on motor data sheets is
simply the maximum voltage across a motor winding
that will produce a current equal to IMAX given the
internal resistance of the winding. As stated earlier,
IMAX is the critical specification for a motor that should
not be exceeded. The voltage specification for a motor
is simply the voltage that will produce a current equal to
IMAX given the internal resistance of the winding.
Equation 7 shows this relation. Referring to Table 1,
multiplying current per phase by the ohms per phase
results in the rated voltage.

BASIC MICROCONTROLLER
STEPPING MOTOR CONTROL
This section discusses using PIC microcontrollers for
stepper motor control. There are several peripherals
available on Microchip parts that make controlling a
stepping motor more precise. Any PIC microcontroller
can be used to control a stepper motor. However,
depending on the complexity of the control desired (i.e.,
microstepping and current limiting), it can be very
advantageous to choose a microcontroller with select
peripherals that will take care of most of the stepper
motor overhead.

DS00907A-page 18

Capture Compare PWM module


The Capture Compare PWM (CCP) module is available
on many PIC microcontrollers. This peripheral is useful
in stepping motor applications for its pulse-width
modulation capabilities. In PWM mode, the CCP
module will provide a PWM waveform on the CCP1 pin.
The 10-bit duty cycle of the waveform is set by the
CCPR1L and CCP1CON registers. Frequency is
determined by the Timer2 prescaler value, the PR2
register and the clock speed of the device.
The CCP module is very useful when microstepping.
Figure 23 shows a circuit in which the PIC16F73 is
interfaced to a unipolar motor. The PIC16F73 has two
CCP modules. This implementation allows for sinecosine microstepping in which two windings are
modulated simultaneously (refer to the microstepping
section for a definition).
In this example, CCP1 modulates the voltage across
alternating sides of winding 1 based on the input from
pin RB1. Winding 2 is configured in the same manner
using CCP2 and pin RB2.

Note:

The PWM waveform is inverted from one


side of the winding to the other.

If the circuit in Figure 23 is used with VSUPPLY equal to


VNOMINAL for the motor, duty cycles for the choppers
can be run from 0 to 100% for microstepping. If the
VSUPPLY is above VNOMINAL, the maximum duty cycle
for each chopper must be reduced proportionally.

ENHANCED CCP PWM MODULE


The Enhanced Capture Compare module available on
many PIC microcontrollers offers the same functionality
as the CCP module, plus several additional features.
The enhanced PWM mode has full-bridge and halfbridge support, programmable dead band delay and
auto shutdown. Full-bridge mode is useful for implementing microstepping control for a bipolar motor.
Figure 24 shows how the output pins of one ECCP
module can be multiplexed to the windings of a bipolar
motor using added external AND-invert logic gates.
The microstepping technique used here is high-torque
microstepping in which the voltage applied to only one
winding is modulated at any given time (see the
Microstepping Section for a definition of high-torque
microstepping).
The TC4469 dual H-bridge shown in Figure 24 is a
logic-input CMOS quad driver developed by Microchip.
This IC is a MOSFET driver but can be used to drive
small stepper motors that require very little current
(under 200 mA). The output stage of each gate on the
TC4469 is a half-bridge.

2004 Microchip Technology Inc.

AN907
FIGURE 23:

UNIPOLAR MICRO STEPPING


VSUPPLY

Winding2

Winding1

CCP1 13
VDD
20 VDD RB1 22
8 VSS CCP2 12
19 VSS RB2 23

PIC16F73

FIGURE 24:

BIPOLAR MICROSTEPPING USING THE ECCP MODULE

VDD

RC3 7
1
VDD RA1 5
14 VSS
8
RC7
6
RB1

VDD

1 1A
2 1B
3 2A
4 2B
5 3A
6 3B

PIC16F684

8 4A
9 4B

14
VDD
1Y 13
2Y 12
3Y 11
4Y 10
GND
7 TC4469

2004 Microchip Technology Inc.

Winding2

U2
U1

Winding1

VSUPPLY

DS00907A-page 19

AN907
COMPARATORS

REFERENCES

The current limiting section discussed how comparators can be used in chopper circuits. Several PIC
microcontrollers have on-chip comparators that can be
used to accomplish this task. The comparators can be
used to chop the input directly in hardware or can
generate a software interrupt in the microcontroller
indicating IMAX has been reached. When an interrupt is
generated, the PIC microcontroller can modulate the
voltage across the winding so that the average voltage
equals the nominal voltage for the phases of the
stepping motor. This functionality can be accomplished
by a CCP or ECCP module.

Stepping Motor Tutorial by Dr. Douglas W. Jones


(http://www.cs.uiowa.edu/~jones/step/#introduction),
Copyright 1995

A/D CONVERTERS
The same functionality just discussed can also be
accomplished by feeding the output of the sense resistor into a PIC A/D converter by way of an operational
amplifier. The way this works is the A/D converter is
read continually by the microcontroller. When the value
generated by the A/D converter indicates IMAX is
reached, the microcontroller will modulate the voltage
across the winding so that Vnominal is maintained.

Note:

Stepper Motor Tutorial by Rustie Laidman


(http://209.41.165.153/stepper/), Copyright 2000
Article: The Rise of VSR Motor, Greg Paula,
Mechanical Engineering Magazine; Copyright 1998 by
The American Society of Mechanical Engineers
Drive Circuit Basics, Industrial Circuits Application
Notes, (http://library.solarbotics.net/pdflib/pdf/drive.pdf)
AN822, Stepper Motor Microstepping with PIC18C452,
Microchip Technology Inc.
The Handbook of Small Electric Motors, Yeadon and
Yeadon, Eds, McGraw Hill, 2001
HTTP://www.cs.uiowa.edu/~jones/step/
Shinano Kenshi Corporation, (http://www.shinano.com/
stepper.htm)

In practice, the comparator implementation uses less processor resources than


the ADC implementation. The comparator
implementation also yields a faster
response.

CONCLUSION
Stepper motors are ideally suited for measurement and
control applications. The step resolution and
performance of these motors can be improved through
a technique called microstepping. Stepping motor performance can also be improved by driving these motors
at a voltage greater than what they are rated for. If
higher voltage is used to boost performance, then
current limiting considerations must be taken into
account.
PIC microcontrollers are able to drive all the different
types of stepping motors: variable reluctance,
permanent magnet and hybrid. Single-stepping, halfstepping, microstepping and current limiting are all
stepper motor drive techniques that are well within the
utility of PIC microcontrollers. The CCP, ECCP and
comparator modules available in Microchips microcontroller line allow for the implementation of the more
advanced stepping motor control techniques, namely
microsteppng and current limiting. In summary, PIC
microcontrollers are an ideal choice for stepping motor
control.

DS00907A-page 20

2004 Microchip Technology Inc.

Note the following details of the code protection feature on Microchip devices:

Microchip products meet the specification contained in their particular Microchip Data Sheet.

Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.

There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip's Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.

Microchip is willing to work with the customer who is concerned about the integrity of their code.

Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.

Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.

Information contained in this publication regarding device


applications and the like is intended through suggestion only
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
No representation or warranty is given and no liability is
assumed by Microchip Technology Incorporated with respect
to the accuracy or use of such information, or infringement of
patents or other intellectual property rights arising from such
use or otherwise. Use of Microchips products as critical
components in life support systems is not authorized except
with express written approval by Microchip. No licenses are
conveyed, implicitly or otherwise, under any intellectual
property rights.

Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart and rfPIC are registered
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
AmpLab, FilterLab, microID, MXDEV, MXLAB, PICMASTER,
SEEVAL, SmartShunt and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Application Maestro, dsPICDEM, dsPICDEM.net,
dsPICworks, ECAN, ECONOMONITOR, FanSense,
FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP,
ICEPIC, Migratable Memory, MPASM, MPLIB, MPLINK,
MPSIM, PICkit, PICDEM, PICDEM.net, PICtail, PowerCal,
PowerInfo, PowerMate, PowerTool, rfLAB, Select Mode,
SmartSensor, SmartTel and Total Endurance are trademarks
of Microchip Technology Incorporated in the U.S.A. and other
countries.
Serialized Quick Turn Programming (SQTP) is a service mark
of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
2004, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.

Microchip received ISO/TS-16949:2002 quality system certification for


its worldwide headquarters, design and wafer fabrication facilities in
Chandler and Tempe, Arizona and Mountain View, California in October
2003. The Companys quality system processes and procedures are for
its PICmicro 8-bit MCUs, KEELOQ code hopping devices, Serial
EEPROMs, microperipherals, nonvolatile memory and analog
products. In addition, Microchips quality system for the design and
manufacture of development systems is ISO 9001:2000 certified.

2004 Microchip Technology Inc.

DS00907A-page 21

WORLDWIDE SALES AND SERVICE


AMERICAS

China - Beijing

Korea

Corporate Office

Unit 706B
Wan Tai Bei Hai Bldg.
No. 6 Chaoyangmen Bei Str.
Beijing, 100027, China
Tel: 86-10-85282100
Fax: 86-10-85282104

168-1, Youngbo Bldg. 3 Floor


Samsung-Dong, Kangnam-Ku
Seoul, Korea 135-882
Tel: 82-2-554-7200 Fax: 82-2-558-5932 or
82-2-558-5934

China - Chengdu

200 Middle Road


#07-02 Prime Centre
Singapore, 188980
Tel: 65-6334-8870 Fax: 65-6334-8850

2355 West Chandler Blvd.


Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support: 480-792-7627
Web Address: http://www.microchip.com
3780 Mansell Road, Suite 130
Alpharetta, GA 30022
Tel: 770-640-0034
Fax: 770-640-0307

Rm. 2401-2402, 24th Floor,


Ming Xing Financial Tower
No. 88 TIDU Street
Chengdu 610016, China
Tel: 86-28-86766200
Fax: 86-28-86766599

Boston

China - Fuzhou

2 Lan Drive, Suite 120


Westford, MA 01886
Tel: 978-692-3848
Fax: 978-692-3821

Unit 28F, World Trade Plaza


No. 71 Wusi Road
Fuzhou 350001, China
Tel: 86-591-7503506
Fax: 86-591-7503521

Atlanta

Chicago
333 Pierce Road, Suite 180
Itasca, IL 60143
Tel: 630-285-0071
Fax: 630-285-0075

Dallas
4570 Westgrove Drive, Suite 160
Addison, TX 75001
Tel: 972-818-7423
Fax: 972-818-2924

Detroit
Tri-Atria Office Building
32255 Northwestern Highway, Suite 190
Farmington Hills, MI 48334
Tel: 248-538-2250
Fax: 248-538-2260

Kokomo
2767 S. Albright Road
Kokomo, IN 46902
Tel: 765-864-8360
Fax: 765-864-8387

Los Angeles
18201 Von Karman, Suite 1090
Irvine, CA 92612
Tel: 949-263-1888
Fax: 949-263-1338

San Jose
1300 Terra Bella Avenue
Mountain View, CA 94043
Tel: 650-215-1444
Fax: 650-961-0286

Toronto
6285 Northam Drive, Suite 108
Mississauga, Ontario L4V 1X5, Canada
Tel: 905-673-0699
Fax: 905-673-6509

ASIA/PACIFIC
Australia
Suite 22, 41 Rawson Street
Epping 2121, NSW
Australia
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755

China - Hong Kong SAR


Unit 901-6, Tower 2, Metroplaza
223 Hing Fong Road
Kwai Fong, N.T., Hong Kong
Tel: 852-2401-1200
Fax: 852-2401-3431

Singapore

Taiwan
Kaohsiung Branch
30F - 1 No. 8
Min Chuan 2nd Road
Kaohsiung 806, Taiwan
Tel: 886-7-536-4818
Fax: 886-7-536-4803

Taiwan
Taiwan Branch
11F-3, No. 207
Tung Hua North Road
Taipei, 105, Taiwan
Tel: 886-2-2717-7175 Fax: 886-2-2545-0139

EUROPE

China - Shanghai

Austria

Room 701, Bldg. B


Far East International Plaza
No. 317 Xian Xia Road
Shanghai, 200051
Tel: 86-21-6275-5700
Fax: 86-21-6275-5060

Durisolstrasse 2
A-4600 Wels
Austria
Tel: 43-7242-2244-399
Fax: 43-7242-2244-393

Denmark

China - Shenzhen

Regus Business Centre


Lautrup hoj 1-3
Ballerup DK-2750 Denmark
Tel: 45-4420-9895 Fax: 45-4420-9910

Rm. 1812, 18/F, Building A, United Plaza


No. 5022 Binhe Road, Futian District
Shenzhen 518033, China
Tel: 86-755-82901380
Fax: 86-755-8295-1393

China - Shunde
Room 401, Hongjian Building, No. 2
Fengxiangnan Road, Ronggui Town, Shunde
District, Foshan City, Guangdong 528303, China
Tel: 86-757-28395507 Fax: 86-757-28395571

China - Qingdao
Rm. B505A, Fullhope Plaza,
No. 12 Hong Kong Central Rd.
Qingdao 266071, China
Tel: 86-532-5027355 Fax: 86-532-5027205

India
Divyasree Chambers
1 Floor, Wing A (A3/A4)
No. 11, OShaugnessey Road
Bangalore, 560 025, India
Tel: 91-80-2290061 Fax: 91-80-2290062

Japan
Benex S-1 6F
3-18-20, Shinyokohama
Kohoku-Ku, Yokohama-shi
Kanagawa, 222-0033, Japan
Tel: 81-45-471- 6166 Fax: 81-45-471-6122

France
Parc dActivite du Moulin de Massy
43 Rue du Saule Trapu
Batiment A - ler Etage
91300 Massy, France
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79

Germany
Steinheilstrasse 10
D-85737 Ismaning, Germany
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44

Italy
Via Quasimodo, 12
20025 Legnano (MI)
Milan, Italy
Tel: 39-0331-742611
Fax: 39-0331-466781

Netherlands
P. A. De Biesbosch 14
NL-5152 SC Drunen, Netherlands
Tel: 31-416-690399
Fax: 31-416-690340

United Kingdom
505 Eskdale Road
Winnersh Triangle
Wokingham
Berkshire, England RG41 5TU
Tel: 44-118-921-5869
Fax: 44-118-921-5820
01/26/04

DS00907A-page 22

2004 Microchip Technology Inc.

Freescale Semiconductor
Application Note

AN2974
Rev. 1, 06/2005

Quick Start for Beginners to


Drive a Stepper Motor
by: Matthew Grant
16-Bit Automotive Applications
Microcontroller Division

Introduction
This application note is for novices who want a general quick-start guide showing how to control a stepper
motor. Because stepper motors can be used in a variety of ways and are driven by a variety of devices,
there is a great deal of information available about how these motors work and how to use them. To
reduce confusion, the focus of this application note is on stepper motors that can be driven by
microcontrollers. This document includes basic information needed to get started quickly, and includes a
practical example that is simple and easy to implement.

What is a Stepper Motor?


A stepper motor is an electrically powered motor that creates rotation from electrical current driven into
the motor. Physically, stepper motors can be large but are often small enough to be driven by current on
the order of milliampere. Current pulses are applied to the motor, and this generates discrete rotation of
the motor shaft. This is unlike a DC motor that exhibits continuous rotation. Although it is possible to drive
a stepper motor in a manner where it has near continuous rotation, doing so requires more finesse of the
input waveform that drives the stepper motor. Figure 1 illustrates some basic differences in stepper and
DC motor rotation.

Freescale Semiconductor, Inc., 2005. All rights reserved.

Types of Stepper Motors


DISCRETE ROTATION

STEPPER MOTOR

HCS12
MICROCONTROLLER
CONTROL

1a)

CONTINUOUS ROTATION
DC MOTOR

HCS12
MICROCONTROLLER
CONTROL

1b)

Figure 1. Stepper vs. DC Motor Rotation

Types of Stepper Motors


There are a variety of stepper motors available, but most of them can be separated into two groups:

Permanent-magnet (PM) stepper motor This kind of motor creates rotation by using the
forces between a permanent magnet and an electromagnet created by electrical current. An
interesting characteristic of this motor is that even when it is not powered, the motor exhibits some
magnetic resistance to turning.

Variable-reluctance (VR) stepper motor Unlike the PM stepper motor, the VR stepper motor
does not have a permanent-magnet and creates rotation entirely with electromagnetic forces. This
motor does not exhibit magnetic resistance to turning when the motor is not powered.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


2

Freescale Semiconductor

What is Inside?

What is Inside?
Generally, a stepper motor consists of a stator, a rotor with a shaft, and coil windings. The stator is a
surrounding casing that remains stationary and is part of the motor housing, while the rotor is a central
shaft within the motor that actually spins during use. The characteristics of these components and how
they are arranged determines whether the stepper motor is a PM or VR stepper motor. Figure 2 and
Figure 3 show an example of these internal components.

PERMANENT MAGNET STEPPER MOTOR

SIGNAL B

CURRENT
i
+
S
N

SIGNAL A
COIL
WINDING

ROTOR SHAFT
COMING OUT OF
PAGE
PERMANENT MAGNET
DISK WITH TWO POLES

DIRECTION OF
MAGNETIC FIELD

METAL CORE USED


TO HELP CHANNEL
THE MAGNETIC FIELD

Figure 2. Permanent Magnet (PM) Stepper Motor

Taking a closer look, the rotor in PM stepper motors is actually a permanent-magnet. In some cases, the
permanent magnet is in the shape of a disk surrounding the rotor shaft. One arrangement is a magnetic
disk which consists of north and south magnetic poles interlaced together. The number of poles on the
magnetic disk varies from motor to motor. Some simple PM stepper motors such as the one in Figure 2
only have two poles on the disk, while others may have many poles. The stator usually has two or more
coil windings, with each winding around a soft metallic core.
When electrical current flows through the coil windings, a magnetic field is generated within the coil. The
metallic core is placed within the coil windings to help channel the electromagnetic field perpendicular to
the outer perimeter of the magnetic disk.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


Freescale Semiconductor

What is Inside?

Depending upon the polarity of the electromagnetic field generated in the coil (north pole, out of the coil,
or south pole, into the coil) and the closest permanent magnetic field on the disk, an attraction or repulsion
force will exist. This causes the rotor to spin in a direction that allows an opposite pole on the perimeter
of the magnetic disk to align itself with the electromagnetic field generated by the coil. When the nearest
opposite pole on the disk aligns itself with the electromagnetic field generated by the coil, the rotor will
come to a stop and remain fixed in this alignment as long as the electromagnetic field from the coil is not
changed.
VR stepper motors work in a very similar fashion. Figure 3 shows some of the physical details that
characterize its operation. In a VR stepper motor, the surrounding coils that are physically located
opposite of each other are energized to create opposite magnetic fields. For example, in Figure 3a), coil
C produces a south-pole magnetic field, and coil C produces a north-pole magnetic field. The magnetic
fields produced by the coils pass through the air gap and through the metallic rotor. Because the magnetic
fields attract each other, the metallic rotor spins in a direction that brings the nearest edges (2 and 4) of
the rotor as close as possible to the pair of energized coils (C and C). Like the PM stepper rotor, the VR
stepper rotor will remain aligned to the coils as long as coils C and C are energized and the magnetic
fields are not changed. To move to the next state and continue this rotation, coils C and C must be deenergized, while coils A and A must be oppositely energized to attract rotor edges 1 and 3 respectively.
The same process occurs with coils B and B to attract rotor edges 2 and 4 respectively, and so on.
Figure 3 shows how the rotor spins as the coils are energized and de-energized. This is an example of a
3-phase VR motor.

VARIABLE RELUCTANCE STEPPER MOTOR

1
4

3b)

4
3

2
C
3a)

3c)

Figure 3. How the Variable Reluctance (VR) Rotor Spins

From the examples discussed earlier, we can see that if the electromagnetic fields in both the PM and VR
stepper motors are turned on, off, and reversed in the proper sequence, the rotor can be turned in a
specific direction. Each time an electromagnetic field combination is changed, the rotor may turn a fixed
number of degrees. As these state changes in electromagnetic fields take place more rapidly, on the order
of milliseconds, the rotor can rotate faster, smoother, and sometimes more quietly. Because of the
mechanical limitations of the system, the rotor can only rotate effectively up to certain speeds.
An external device, such as an HCS12 microcontroller (or, MCU), is very good for controlling the
electromagnetic sequences by directing the flow of current through the coil windings. To do this, software
can be written and loaded into an HCS12 MCU.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


4

Freescale Semiconductor

Waveforms that can Drive a Stepper Motor

Waveforms that can Drive a Stepper Motor


Stepper motors have input pins or contacts that allow current from a supply source (in this application
note, a microcontroller) into the coil windings of the motor. Pulsed waveforms in the correct pattern can
be used to create the electromagnetic fields needed to drive the motor. Depending on the design and
characteristics of the stepper motor and the motor performance desired, some waveforms work better
than others. Although there are a few options to choose from when selecting a waveform to drive a twophase PM stepper motor, such as full-stepping or micro-stepping, this application note focuses on one
called half-stepping. A graph of the waveform is given in Figure 4.
In Figure 4a), four signals are shown. These signals can be produced by a dedicated stepper driver or a
microcontroller. Each signal (a, a, b, b) is applied to a coil terminal. Because each coil has two terminals,
two signals must work together to drive a single coil. If we consider terminal a as a positive reference,
then the combination of signals a and a cause the coil to see an effective signal A, shown in Figure 4b).
Likewise, signal B in Figure 4b) is produced by combining signals b and b from Figure 4a).
It is worth noting that the individual waveforms (a, a, b, b) directly from the microcontroller pins to the coil
terminals only vary from 0 V to +5 V. However, the effective signal (A, B) applied to the coil varies from
5 V to +5 V, and has positive and negative duty cycles. Two of these effective waveforms shown in
Figure 4b), 90 degrees out of phase can be used to drive the PM stepper motor. Both waveforms are
applied to the motor simultaneously. Each transition in one of the waveforms corresponds to a state
change (movement) in the motor. Altogether, Figure 4a) and b) show eight different states for halfstepping. A step by step description of how these particular waveforms work together to move the motor
shaft follows.
When coil signal A is positive and coil signal B is zero, current flows into coil A through terminal a and out
of terminal a. This generates a north-pole electromagnetic field toward the magnetic disk, which repels
the nearest north-pole section on the disk and attracts the nearest south-pole section. These forces cause
the motor to rotate in a direction that will align opposite poles. Coil B is not energized.

NOTE
The orientation of the rotor prior to energizing a single coil may be
unknown. It is possible that, for example, the rotor could be positioned, as
shown in Figure 7c), when attempting to align itself, as in Figure 7a).
Figure 7c) is the worst case starting position for the desired alignment,
shown in Figure 7a). It is even possible that initially the rotor may not turn
because the magnetic forces of the coil could be equally divided over
pushing and pulling the north and south pole of the PM disk. If this happens,
then moving to the next sequential step by energizing both coils should help
jolt the rotor free.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


Freescale Semiconductor

Waveforms that can Drive a Stepper Motor

+5V

0V
PORT PIN
SIGNAL a

+5V

COIL
SIGNAL
A

time

PORT PIN 0 V
SIGNAL a

time

+5V

COIL
SIGNAL
B

0V
PORT PIN
SIGNAL b

+5V

4a)

0V
PORT PIN
SIGNAL b

time

time
6

DIFFERENT STATES WITH DISCRETE TRANSITIONS

+5V
0V
COIL SIGNAL A

time

5V
+5V
0V
COIL SIGNAL B

time

5V
4b)

Figure 4. Discrete Transitions

While coil signal A is positively energized, the next transition occurs in coil signal B. Coil signal B rises
and positively energizes coil B, creating its own electromagnetic field. Electric current flows into terminal
b and out of terminal b. The north-pole of both coils now share an attraction for the south-pole of the disk,
causing the disk to realign (rotate) itself between shared attractions. The same action takes place with
the south-pole of the coils and north-pole of the PM disk.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


6

Freescale Semiconductor

Waveforms that can Drive a Stepper Motor

For the next transition, coil signal A falls to zero, leaving the signal in coil B to dominate the alignment of
the PM disk.
In summary, coils A and B take turns controlling the PM disk. Before one coil releases full control of the
disk, it shares control of the disk with the other coil. This temporary sharing creates a half-step in the
transition of control from one coil to the next (half-stepping) and allows smaller, discrete turns to be taken
by the motor. Although stepper motors are often used for their ability to make discrete movements, they
can also be used for smooth movements. In an ideal case, the waveforms that would allow the smallest
incremental change would actually be sinusoidal to ensure the smoothest transition between full steps.
In such a case, the distinction between states and specific steps become blurred. This implementation
may be well suited for applications that seek to reduce or eliminate the discrete movement of the motor,
which also reduces noise and vibration. This technique is often referred to as microstepping. Although the
digital waveforms in this example are not sinusoidal, their similarities to a sinusoidal waveform can still
be noted by comparing Figure 4 and Figure 5. A series of electromagnet changes over the period of both
signals continue to work together in this fashion to rotate the PM disk.

DIFFERENT STATES WITH SMOOTH TRANSITIONS


6

+5V
COIL SIGNAL A
0
Smooth state transitions
produce smooth rotor
movement for stepper
motors.

time

5V

+5V
COIL SIGNAL B
0
time
5V

Figure 5. Smooth Transitions

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


Freescale Semiconductor

How to Use an HCS12 Microcontroller to Drive the PM Stepper Motor

How to Use an HCS12 Microcontroller to Drive the PM Stepper Motor


HCS12 microcontrollers are good devices for driving stepper motors because they are fast, compatible
with the discrete movements of steppers, and can be easily programmed to work with steppers of different
types. Some examples of use are precision movements, multi-axis control, sophisticated velocity
profiling, and increased fault tolerance. In some instances, a microcontroller can provide multiple
solutions in a single system because of their ability to be programmed to communicate with other systems
while controlling a stepper motor. This is especially advantageous over a dedicated stepper driver that is
more difficult to modify and not likely to have full communication capabilities. Microcontrollers can also
generate the waveforms needed to produce movement in a stepper motor. Because the desired
performance of a stepper motor may vary, the algorithm used by a microcontroller to drive a stepper motor
is likely to vary as well. Some of these algorithms can become involved and require intimate
understanding of the motor, in addition to very organized use of the microcontroller resources. To soften
the approach for beginners, this section gives a general description of how to use the port pins on an
HCS12 microcontroller to create basic, step-like movement in a PM stepper motor. To proceed, some
general assumptions about the motor and microcontroller have to be made.
The stepper motor is assumed to be a 4-pin, two-phase PM stepper motor with two poles on the PM disk.
An internal diagram of what such a motor might look like is shown in Figure 2. The input voltage of the
motor is assumed to be about 5 V, with a typical current somewhere between 120 milliampere. A motor
of this size could weigh a few ounces and be 35 centimeters wide. This is one of the simpler types of
motors and will be the subject of example for the remainder of the application note.
To control the four pins of the motor, the microcontroller needs four output pins capable of driving and
sinking somewhere between 120 milliampere out of each pin. Port pins on an HCS12 microcontroller
are suitable for this effort.
Most microcontrollers have registers that can be used to control logic levels of an I/O or port pin. We can
select four control bits from any HCS12 I/O register that is available. Let it be assumed that there is a
register called register U, and the port corresponding to this register is called port U. For simplicity, we
can use the lower nibble of register U, U[3:0], to control port U pins U0, U1, U2, and U3 of the
microcontroller. Pins U3 and U2 can be used to control the current in coil B, and pins U1 and U0 can be
used to control the current in coil A. A connection should be made from pins U3 and U2 to the contacts
of coil B. A connection should also be made from pins U1 and U0 to the contacts of coil A. Current that
flows out of the U3 pin will flow into U2, and vice versa. The same condition applies to pins U1 and U0.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


8

Freescale Semiconductor

How to Use an HCS12 Microcontroller to Drive the PM Stepper Motor

HCS12 OUTPUT PORT REGISTER


LOWER NIBBLE USED TO
CONTROL STEPPER MOTOR

3
0

2
0

a a
1 0
1 0

STEPPER MOTOR
a

Figure 6. Using an HCS12 MCU to Control the Stepper Motor

With an appropriate algorithm, we can use pins U[3:0] of the HCS12 to produce the waveforms needed
to drive a stepper motor. The general flow of the algorithm can be similar to the flow of a state machine,
which is to set the bits in register U to a particular state or configuration, wait a discrete amount of time,
and set the bits in register U to the next state. For each change in the microcontroller register state, a
change is produced in the waveform that causes the motor to rotate a fixed amount. The period of time
required between register states will vary depending upon the motor and the performance desired, but is
usually on the order of milliseconds. If the delay between changes to the microcontroller register states
is too short, the motor will not physically be able to move fast enough to keep up with the register state
changes. A delay that is too long could create a motor response with noticeably rigid movements and
choppy noises with each step. However, for the purpose of this application note, it may be helpful to have
a long delay between register states because it allows easy observation of the motor response and
movement due to microcontroller register changes.
An easy way to begin driving the motor is to focus on getting the motor to move a single step at a time,
in the direction desired instead of many steps at once. Tracing through an algorithm with a software
debugger, if a debugger is available, is a way of slowing the algorithm down so the response of the motor
can be observed. After motor movement has been achieved, direction reversal can be accomplished by
switching the microcontroller connections to one of the motor coils.
Figure 7 illustrates example microcontroller register contents from state 0 to state 3, It also shows the
matching PM stepper motor configuration that might occur in that state. Figure 7 also corresponds with
the graph in Figure 4 and the drawing in Figure 6.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


Freescale Semiconductor

How to Use an HCS12 Microcontroller to Drive the PM Stepper Motor

STATE 1
5

b
3
0

b
2
0

a a
1 0
1 0

PORT REGISTER CONTENTS

STATE 2
5

b
3
1

b
2
0

STATE 3
5

b
2
0

b
3
1

a a
1 0
0 0

PORT REGISTER CONTENTS

b
2
0

b
3
1

a a
1 0
0 1

7b)

COIL SIGNAL B
b +
b
a

+
N

COIL
SIGNAL A

PORT REGISTER CONTENTS

COIL SIGNAL B
b +
b
i

7a)

COIL SIGNAL B
b +
b
i

COIL
SIGNAL A

a a
1 0
1 0

PORT REGISTER CONTENTS

COIL SIGNAL B
b +
b
a

COIL
SIGNAL A

COIL
SIGNAL A

7c)

7d)

STATE 0

Figure 7. HCS12 MCU Register Contents from State 0 to State 3

Below is an example of a program that performs half-stepping and can be used to drive a stepper motor.
The code turns the motor a number of steps (100 half-steps) in one direction, and then turns the motor
back the same number of steps in the opposite direction. One of the advantages of the code below is that
it can be easily modified to keep track of a motors position. It also has the advantage of having the port
states stored in sequential order in an array. Simply cycling through the states sequentially and placing
the state values on port pins will cause a stepper motor to move. This is written in C.
#define NUM_OF_STATES 8 //There are 8 different states in this particular example.
#define DELAY_MAX 2000 //The maximum # of counts used to create a time delay.
void main(void)
{
/*******************CREATE VARIABLES*******************/
int i; //Used in a for loop
//This array actually contains the state values that will be placed on Port U.
//State #0 corresponds to a value of 0x06, state #1 corresponds to a value of 0x02, etc.
char state_array[NUM_OF_STATES] = {0x06, 0x02, 0x0A, 0x08, 0x09, 0x01, 0x05, 0x04};
int steps_to_move; //The # of rotational steps the motor will make.
char next_state;
//Used to select the next state to put in register U.
/********************SET UP PORT U********************/
DDRU = 0xFF;
//Writing 0xFF to DDRU sets all bits of Port U to act as output.
PTU = 0;
//Init Port U by writing a value of zero to Port U.
/******************************************************/
steps_to_move = 100; //Set the # of steps to move. An arbitrary positive # can be used.
next_state = 0;

//Init next_state to state 0. next_state can start from any state


//within the range of possible states in this example, 0-7.

PTU = state_array[next_state];

//Init Port U to the starting state. In this example,


//since only 4 pins are needed to control the motor, only
//the lower nibble of Port U is being used. This line
//selects state 0 and places the corresponding value
//(0x06) in the lower nibble of Port U.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


10

Freescale Semiconductor

How to Use an HCS12 Microcontroller to Drive the PM Stepper Motor


for(i = 0; i < DELAY_MAX; i++)
{
//Wait here for a while.
}
while (steps_to_move > 0)
{
if (next_state > (NUM_OF_STATES - 1))

//If next_state is greater than the highest


//available state, 7, then cycle back to 0

{
next_state = 0;
}
PTU = state_array[next_state]; //Place new value in Port U. Rotation may be observed
for(i = 0; i < DELAY_MAX; i++)
{
//Wait here for a while.
}
next_state++;
//Increment next_state. Cycling though the states causes rotation
//in one direction. Decrementing states causes opposite rotation.
steps_to_move--;

//Subtract 1 from the total # of steps remaining to be moved.

}
//The following code rotates the motor back in the opposite direction.
steps_to_move = 100;
while (steps_to_move > 0)
{
if (next_state < 0)
{
next_state = (NUM_OF_STATES - 1);
}
PTU = state_array[next_state];
for(i = 0; i < DELAY_MAX; i++)
{
//Wait here for a while.
next_state--;

steps_to_move--;
}
} //End of Main

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


Freescale Semiconductor

11

How are Stepper Motors Used?

How are Stepper Motors Used?


Stepper motors have found their way into many different areas of control systems. The wide popularity of
these motors can be attributed in part to the various ways the motor can be driven and because of its
compatibility with digital systems. In particular, stepper motors are ideal for control systems that require
discrete, easily repeatable movements at moderate to low frequencies. Steppers are most commonly
used in open-loop position control applications. Figure 8 below shows an example block diagram of a
system with microcontroller, stepper motor, and feedback. In the case of stepper motors, the feedback is
not always needed but can still be provided for precision assistance. In contrast, DC motors need
feedback because they have a harder time making precision movements and require a circuit that can
compensate for the risk of drifting or overshooting a target position. The feedback circuitry for the position
of a motor is likely to be more complicated for dc motors than for stepper motors. Stepper motors have
worked well in factories and assembly environments, in applications such as robotic arms and precision
assembly controls. They can be found in printers, disk drives, toys, cars, and a host of other applications
and products.

MOTOR CONTROL BLOCK DIAGRAM


POSITION

WITH FEEDBACK

DETECTION
(FEEDBACK)

MICROCONTROLLER
OR
MOTOR DRIVER

MOTOR

ROTOR
OR
GEAR

OTHER
SYSTEM

Figure 8. Example System with an MCU, Stepper Motor, and Feedback

Efficient Motor Control with an HCS12 Microcontroller


Actual control of a stepper motor in real applications is not trivial. Often, the motor is a single component
within a system of other devices that must all work in unison for successful operation. A microcontroller
responsible for driving the motor can also handle other tasks or service other devices within the system,
but writing linear software to handle complex motor control can leave little bandwidth for the
microcontroller to tend to other matters. In the simple example code given, the microcontroller wastes
much of its computing power stuck in a delay loop before performing any other meaningful task. More
efficient use of the microcontroller can be obtained by using an HCS12 with a motor control module. The
interrupt capability of the motor control module allows the microcontroller to run sequentially through
software until the motor needs to be serviced. After a motor interrupt occurs, software can make quick
register adjustments to characteristics like polarity, period length, and duty cycle, before returning to
normal flow. For more details about applications like motor control and HCS12 microcontrollers, refer to
http://www.freescale.com.
Quick Start for Beginners to Drive a Stepper Motor, Rev. 1
12

Freescale Semiconductor

Efficient Motor Control with an HCS12 Microcontroller

This page intentionally left blank.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


Freescale Semiconductor

13

Efficient Motor Control with an HCS12 Microcontroller

This page intentionally left blank.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


14

Freescale Semiconductor

Efficient Motor Control with an HCS12 Microcontroller

This page intentionally left blank.

Quick Start for Beginners to Drive a Stepper Motor, Rev. 1


Freescale Semiconductor

15

How to Reach Us:


Home Page:
www.freescale.com
E-mail:
support@freescale.com
USA/Europe or Locations Not Listed:
Freescale Semiconductor
Technical Information Center, CH370
1300 N. Alma School Road
Chandler, Arizona 85224
+1-800-521-6274 or +1-480-768-2130
support@freescale.com
Europe, Middle East, and Africa:
Freescale Halbleiter Deutschland GmbH
Technical Information Center
Schatzbogen 7
81829 Muenchen, Germany
+44 1296 380 456 (English)
+46 8 52200080 (English)
+49 89 92103 559 (German)
+33 1 69 35 48 48 (French)
support@freescale.com
Japan:
Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku,
Tokyo 153-0064
Japan
0120 191014 or +81 3 5437 9125
support.japan@freescale.com
Asia/Pacific:
Freescale Semiconductor Hong Kong Ltd.
Technical Information Center
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
+800 2666 8080
support.asia@freescale.com
For Literature Requests Only:
Freescale Semiconductor Literature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-441-2447 or 303-675-2140
Fax: 303-675-2150
LDCForFreescaleSemiconductor@hibbertgroup.com

AN2974
Rev. 1, 06/2005

Information in this document is provided solely to enable system and software


implementers to use Freescale Semiconductor products. There are no express or
implied copyright licenses granted hereunder to design or fabricate any integrated
circuits or integrated circuits based on the information in this document.
Freescale Semiconductor reserves the right to make changes without further notice to
any products herein. Freescale Semiconductor makes no warranty, representation or
guarantee regarding the suitability of its products for any particular purpose, nor does
Freescale Semiconductor assume any liability arising out of the application or use of any
product or circuit, and specifically disclaims any and all liability, including without
limitation consequential or incidental damages. Typical parameters that may be
provided in Freescale Semiconductor data sheets and/or specifications can and do vary
in different applications and actual performance may vary over time. All operating
parameters, including Typicals, must be validated for each customer application by
customers technical experts. Freescale Semiconductor does not convey any license
under its patent rights nor the rights of others. Freescale Semiconductor products are
not designed, intended, or authorized for use as components in systems intended for
surgical implant into the body, or other applications intended to support or sustain life,
or for any other application in which the failure of the Freescale Semiconductor product
could create a situation where personal injury or death may occur. Should Buyer
purchase or use Freescale Semiconductor products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and
its officers, employees, subsidiaries, affiliates, and distributors harmless against all
claims, costs, damages, and expenses, and reasonable attorney fees arising out of,
directly or indirectly, any claim of personal injury or death associated with such
unintended or unauthorized use, even if such claim alleges that Freescale
Semiconductor was negligent regarding the design or manufacture of the part.
Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
All other product or service names are the property of their respective owners.
Freescale Semiconductor, Inc. 2005. All rights reserved.

Industrial Circuit Application Note

Stepper motor and driver selection


Stepper motors are used in many different
types of applications this makes it difficult
to recommend a general step-by-step design
flow chart. The design process is more an
iterative process, involving experience, calculation and experimentation. The purpose
of this application note is to show how
system performance is affected by motor and
driver selection. Some popular motors and
drivers are dealt with, as well as the importance of the gearing between the motor
and the load.

Limits to system
performance
Torque and output power
The output torque and power from a
stepper motor are functions of the
motor size, motor heat sinking, working duty cycle, motor winding, and
the type of driver used. In applications with low damping, the usable
torque from the stepper motor can be
drastically reduced by resonances.

In data sheets for stepper motors,


the pull-in and pull-out torque are
given, as functions of stepping rate,
for different types of motor and driver
combinations. The pull-in torque
curve shows the maximum friction
torque with which, the motor can
start, at different stepping rates,
without losing any step. In an actual
application, this curve has to be
modified to account for the load
inertia.
The pull-out curve is of more interest, because it shows the total available torque when the motor runs at
constant speed at a given frequency.
In an application, this torque is used
for overcoming the load fiction torque
and for accelerating the load and
motor inertia.
One problem when selecting the
right motor type and size is the big
influence that the driver has on the
output torque and power. The
difference in output torque, power,
and system efficiency for a 7.5-degree

Pull-out torque [mNm]


80

57mm PM stepper is illustrated in


figure 1. In both cases the winding
and driver combination have been
designed to drive the maximum
current through the winding at stand
still without exceeding the maximum
7-watt power dissipation for this type
of motor.
From the chart, we see that the
output power of the motor can be
increased by a factor of six, through
the use of a bipolar constant current
driver, compared to the basic unipolar
L/R-driver. The increased output
power is a function of both the
increased over-all pull-out torque and
the increased stepping frequency
range.
As we can see from the figure, the
maximum output power is available
at relatively high stepping rates,
compared to the maximum pull-in
frequency, for this type of motor
(approximately 150 to 400Hz, for
zero-load inertia, depending on driver
circuit). This fact, which is true for

Output power [W]


6

70

4.8W

60

4,5

50
3

40
30

1,5

20
10
0.8W

0
0

500

1000
1500
Full-step stepping rate [Hz]

Torque PBL3770:
Torque L/R

2000

0
2500

Output Power PBL3770:


Output Power L/R

Figure 1. Pull-out torque and output power for a 57 mm PM stepper driven by a unipolar L/R-driver and a PBL 3770A bipolar
constant current driver.

Pull-out torque [mNm]


Output power [W]
Efficiency [%]
6
80
70
60
50

Motor is no-load
unstable for
stepping rates
above 325Hz.

4.5
3

40
30

1.5

20
10
0

0.8W
0
0
500
1000
1500
Full-step stepping rate [Hz]
Pull-out Torque
Efficiency
Output Power

Figure 2. Performance curves for a 100


ohm unipolar 57 mm PM-motor driven
by a 20V L/R constant voltage driver.

most stepper applications, shows that,


to be able to get a high-performance
stepper motor system, we have to use
ramping up/down when we start and
stop the motor and load. The use of
ramping opens up stepper motors for
power output applications, and does
not limit the usage of steppers to lowperforming low-output power system.
Damping and resonances
In applications with low system
damping, the available output torque
and power can be drastically reduced
by resonance. Resonances in stepper
motor systems can arise at low-, mid-,
and high stepping rates. As a rule,
constant current drivers have the most
problems with resonances in the lowfrequency region. These resonances
can often be eliminated by using halfstepping or microstepping. Constant
voltage drivers normally have problems
with resonances at medium and/or
high frequencies. At these frequencies, neither half- nor microstepping
can reduce the resonances. This limits
the usage of this type of drivers at
medium and high frequencies to
driving high-damping loads.
Damping also depends on the
motor typePM-motors have higher
damping than hybrids, due to slide

bearing friction and magnetic losses.


Some driver and motor combinations have such low damping, at
certain stepping rates, that they do
not run without a high-damping load.
This condition is known as no-load
instability.
Resolution and positioning accuracy
The resolution of a stepper motor
system is affected by several factors
the stepper motor full-step length,
the selected driver mode (full-step,
half-step or microstepping), and the
gear rate. This means that there are
several different combinations which
can be used to get the desired resolution. Because of this, the resolution
problem of a stepper design can
normally be dealt with after the
motor size and driver type have been
established.
Design time
Even though customization of step
motors is possible, it requires both
engineering time and time for manufacturing stepper motor samples.
Using a more-flexible driver circuit,
like the chopper constant current
driver can make it possible to select a
standard motor with no performance
loss.

Table 1. Unipolar constant voltage driver attributes


Features
Low electronic component cost.

Drawbacks
Lowest motor output power.

For small motors very low cost


transistor arrays can be used.

Maximum power dissipation at


stand still.

Low electrical noise level.

Higher motor cost and larger size


for the same output power as from
other drives.
Driver transistors have to withstand
twice the maximum supply voltage.
Windings must be designed for the
used supply voltage.
Regulated power supply normally
required.
Holding torque depends on supply
voltage and motor temperature.
Large torque ripple when driven in
half-step mode.

Applications
Low speed and low power applications were the motor mainly is
used to produce a torque.
Normally only used with small size
motors.

Cost
In high-volume applications, the major
cost is the hardwareincluding
power supply, driver, wiring, motor,
and gearing. In this case, the engineering cost is less important. In many
applications, it is possible to lower the
total system cost and increase the
performance by using a more-complex
driver (with a slightly higher cost) and
less-costly motor and power supply.
In low- and medium-volume applications, the engineering cost becomes
a larger part of the total cost. In this
case the flexibility and high integration of a constant current driver can
help save engineering time and cost.
Dynamic characteristics
In applications were the stepper must
move from one position to another
then stop in the shortest possible
time, the settling time becomes a very
important factor. If the system is
designed properly, the settling time
can be kept to a minimumif not,
the settling time can easily require
several hundred milliseconds.
To get good dynamic behavior in
an open loop system, it is important
to have the correct gear rate and
precise control of the motor running
and holding torque. With welldesigned gearing, it is possible to
handle variations in both load inertia
and friction.

Performance of drivers
In the following section, the performance of some commonly-used driver
configurations are compared when
they drive a 57mm 7.5-degree PMstepper motor. Driving voltage/
currents are selected so the stand-still
motor losses are kept at maximum
rated 7 W. The performance curves
show the pull-out torque, output
power (at the motor shaft), and the
system efficiency. Efficiency is defined
as the mechanical output power from
the motor divided by the input power
to the driver. For each driver, features
and drawbacks are also listed.
Unipolar constant voltage
This is the classic low-end driver. It
offers the lowest price for the driver
electronicsonly four transistors are
used. To drive small-sized motors, a
transistor array of ULN 2003 or
similar type can be used. For midsized motors, power darlington
transistors, or transistor arrays can be
used. In figure 2, the performance of
this type of driver is shown. A motor
winding with 100 ohm phase
resistance has been selected. This
gives good control of winding current
and low losses in power transistors.
With this driver, the motor has
problems with no-load instabilities at
stepping rates above 325Hz.

Pull-out torque [mNm]


Output power [W]
Efficiency [%]
80
6
Motor is no-load
70
unstable for
4.5
60
stepping rates
50
above 400Hz.
40
3
30
1.5

20
10
0

1.7W
0

0
500
1000 1500
Full-step stepping rate [Hz]
Pull-out Torque
Efficiency
Output Power

Figure 3. Performance curves for a 100


ohm unipolar 57mm PM-motor driven by
a 40V L/2R constant-voltage driver
(2 100ohm external series resistors).

Table 2. Unipolar L/NR constant voltage driver attributes


Features
Low component cost
Low electrical noise level.

Drawbacks
Low or very low efficiency. Lower
efficiency the higher Rext/R ratio.

Applications
Low and medium speed and low
power applications.

Problems with heat dissipation


from the series resistors.
Maximum power dissipation at
stand still increase by the L/nR
ratio compared to the normal L/R
driver.
Large torque ripple in half step
mode.
Holding torque depends on supply
voltage and winding temperature.

Pull-out torque [mNm]


Output power [W]
Efficiency [%]
80
6
Motor is no-load
70
unstable for
stepping rates from 4.5
60
525 to 850Hz.
50
40

2.5W

30
1.5

20
10
0

0
500
1000
1500
Full-step stepping rate [Hz]
Pull-out torque
Efficiency
Output Power

Figure 4. Performance curves for a 100


ohm unipolar 57mm PM-motor driven by
a 40/20V Bi-level constant-voltage driver
(High-voltage-on time = 4ms).

Unipolar L/nR constant voltage


This driver is similar to the unipolar
constant voltage but has external
series resistors in series with the
motor windings. This driver can be
configured with different L/R ratios.
L/2R means that the total resistance is
equal to two times the motors
internal resistance. A higher L/R-ratio
increases high-stepping-rate output
torque, but reduces the system efficiency. Figure 3 shows the performance
of this driver in the L/2R-mode,
driving the same 100 ohm unipolar
motor.
Compared to the L/R-driver we
now gain higher output torque and
power. The maximum output power
has doubled, but the peak system efficiency has decreased.
This drive also shows the no-load
instability, here for stepping rates

above 400Hz. This limits the applications, at high frequencies, to


driving high-damping loads or to
operating in ramp up/down applications, were the motor does not run at
constant speed. It is possible to ramp
through unstable frequencies, and use
the full pull-out torque (with normal
safety margin) if the motor only runs
a limited number of steps in the
unstable range.
Unipolar timed Bi-level
This driver uses two voltage levels to
increase motor utilization. At every
step taken, the voltage across the
winding is raised, for a short time, to
a higher level compared to the
nominal voltage used at stand still.
During the remaining time, the
nominal voltage is used. This driver
can also be configured in the run/

Table 3. Unipolar timed bi-level driver attributes


Features

Drawbacks

Applications

Medium electronic component


cost

Timing circuit or extra CPU overhead needed to control high voltage


on time.

Low to medium speed and low to


medium power applications.

Medium electrical noice level.

6 power transistors needed


compared to 4 for the standard and
L/nR unipolar drives.
If large high to low driving voltage
ratio is used the control off holding
torque and step accuracy becomes
difficult as a result of variations in
winding currents.
Holding torque depends on
winding temperature and supply
voltage.

Table 4. Unipolar constant current driver attributes


Features
.
Nearly the same high speed torque
as bipolar chopper drive
Uses 6 power transistors
compared to 8 for bipolar
constant current.
Half stepping without torque
ripple possible.

Drawbacks
Only 70% of holding and low speed
torque compared to bipolar constant
current.
Power transistors have to withstand
twice the maximum supply voltage.
Winding leakage inductance have
to be considered when snubbing
circuit is designed.
6 lead wires add cost and space for
motor connectors and flexible
cables.

Applications
High speed and medium power
applications.

stop bi-level mode, were the high


voltage is used while the motor is
stepped and the low voltage is used at
stand still. This driver can also be
combined with L/nR-series resistors
to give higher flexibility in selecting
stand-by holding torque. Ericssons
PBD 3517 is a fully-integrated, bilevel driver intended for use with
small-sized motors. In figure 4, the
performance of the L/2R driver is
shown while driving the same 100ohm unipolar PM stepper. The torque
curve for a given motor is a function
of both the high-voltage level and the
high-voltage-on time. In this example
the high voltage is 40V (2 times the
nominal voltage) and the high voltage
on time is 4ms. Compared to the
original L/R-driver, the maximum
output power is three times higher.
Compared to the L/nR-driver, the

efficiency is higherand is not decreased by losses in series resistors as


the ratio Uhigh/Unom is increased. This
driver also has problems with no-load
instability, but in this case only the
mid frequencies are affected. If used
in a ramp up/down application, this
does not cause any problems, if the
constant speed is selected in the stable
area above 850Hz.
Unipolar constant current
This driver gives the best performance
of the unipolar drivesbut it is lower
than for the bipolar chopper driver.
The efficiency is reduced as a result of
higher resistive losses caused by using
only half of the windings at a time.
At higher frequencies, power losses
caused by leakage inductance and
snubbing circuits also appear.

Pull-out torque [mNm]


Output power [W]
Efficiency [%]
80

6
4.8W

70
60

4.5

50
40

30
20

1.5

10
0

0
0
2500
1250
Full-step stepping rate [Hz]
Pull-out Torque
Efficiency
Output Power

Figure 5. Performance curves for a 3.75


ohm bipolar 57mm PM-motor driven by
PBL 3770A constant-current driver
(Chopper voltage 20V, winding current
960mA).

Table 5. Bipolar constant current driver attributes


Features

Drawbacks

Applications

Maximum motor utilisation and


high efficiency.

8 power transistors needed to drive


a motor.

Maximum torque at low and high


stepping rates.

Problems with electrical noise and


interference can occur.

For small and medium size motors


highly integrated drivers are
available.

Low losses stand bye mode


possible.

Power losses in current sensing


resistors.

High speed and high power


applications.

8-lead motors can be configured


for 3 different operating currents.
No snubbing circuits required and
current turn off can be selected for
fast (return to power supply) or
slow.
Highly integrated drivers available, second sourced drives also
available.

Table 6. Bipolar constant current microstepping driver attributes


Features
Same as for the bipolar constant
current, plus:

Drawbacks
Same as for the bipolar constant
current, plus:

Resonance free movement on low


step rates.

Higher cost for the current control


electronics than for normal bipolar
drive.

Increased stop position resolution.

Applications
For small and medium size motors
highly integrated drivers are
available.
High speed and high power
applications.
Applications were increased
resolution is required.
Applications were resonance free
low speed characteristics is needed.

Bipolar constant current


The highest output power and motor
utilization for a given motor is
achieved with the bipolar constant
current driver. DC-losses is kept at a
minimum due to maximum utilization of the copper in the winding and
no power losses from leakage inductance and snubbing circuits since
every winding only consists of one
part.
In figure 5, the performance for
this type of driver is shown driving
the same type 57mm PM-motor. Here
a motor with a constant-currentadapted winding resistance of 3.75
ohms has been selected. The winding
current is selected to give the same
resistive losses in the winding at stand
still as for the unipolar drives tested
above. From the chart, we can see the
increase of output power, maximum
stepping rate, and system efficiency.
Due to the better utilization of the
winding, the holding torque is also
raised.
The no-load instabilities in the
mid- and high-stepping rate regions
are no longer present. This increases
the flexibility in selecting constantspeed running frequencies. However,
a resonance at 100Hz is present. In a
ramp up/down application, this does
not cause any problems as long as this
frequency is not used as constant
speed frequency.
During the last 10 years, progress
in IC-technology has made it possible
to develop fully-integrated bipolar
constant-current drivers, making this
type of driver cost-effective for
driving small- and medium-sized
motors.
Bipolar constant current microstepping
This is an improved version of the
basic full- and half- stepping bipolar
constant-current driver. Here, the
winding currents form a sine/cosine
pair. This greatly improves lowfrequency stepping by eliminating
overshot movements, ringing, and
resonances. Performance at mediumand high-stepping rates are close to
that of full- and half-stepping.
This driver uses the same power
stage as the bipolar constant-current

driver, but extra electronics for


setting the sine/cosine current levels
are used. Microstepping can be used
with different microstep lengths. A
shorter step length than 132 of a fullstep normally does not make any
further improvement in the motors
motion. With most microstepping
controllers, is it also possible to run
the normal full- and half-step modes.
Microstepping can also increase
motor resolution and step accuracy.

General driver aspects


Power supply design
For all drivers of constant-voltage
type, regulated power supplies are
normally required. This means that
the over-all system efficiency will
decrease further, compared to the
values shown in the figures above, due
to losses in the power supply. This
will increase transformer cost and
heating problems. If unregulated
supplies are used, large variations of
holding and running torques occurs,
thus making stop-time minimizing
more difficult or impossible. An
unregulated power supply for a
constant voltage driver also affects the
motor power dissipation making good
motor utilization impossible.
For a constant-current driver, it is
normally possible to use an unregulated supply voltage. The motor
current, and thereby also holding
torque and power dissipation, is
controlled by the driver itself. The
pull-out torque at high stepping rates
is affected by the supply voltage but
at low step rates, its influence is
small.
It is difficult to calculate the power
consumption for a particular application. The best way to get this
information is to make a prototype
and measure the driver input current
under different driving conditions.
Remember that the power
consumption depends on input
voltage, current levels (if constant
current mode), load, motor
temperature, duty cycle and so on.

Snubbing and current turn off circuits


To assure trouble-free functioning of
all unipolar drives, especially when
larger size motors are used, the
winding and current turn-off circuit
has to be properly-designed.
It is important that a unipolar
winding is bifilar woundthis means
the two wires that build up the coil
on each motor pole are wounded in
parallel. This way, the leakage inductance is kept to a minimum, even
though the energy stored in the
winding has to be taken care of (or
moved to the other winding half)
when the current is turned off. This is
done by a current-turn-off circuit or a
snubbing circuit. If the current-turnoff circuit works on the principle of
current commutation from one
winding half to the other, the energy
stored in the leakage inductance is
handled by a snubbing circuit.
In the case of bipolar drive, separate
snubbering circuits are never needed,
since the windings only consist of one
part each and no leakage inductance
can occur. The current-turn-off circuit
is of four diodes in opposition to the
four power transistors in the Hbridge.
Hysteresis losses in motors
With some low-inductance motors,
chopper-type drivers can generate
increased iron losses, caused by the
winding current ripple. To minimize
this problem, use a high chopping
frequency and do not use a lower inductance than needed to get maximum-required step rateit is also
possible to use a lower chopping
voltage. In most applications, the
hysteresis loss related to the chopping
current ripple is low compared to the
hysteresis loss related to the stepping
current changes. If chopping current
ripple is kept at or below 10% of the
nominal current, this normally
doesnt cause a problem.
Interference problems
For all chopper-type drives, the increased risk of different interference
problems has to be considered. Separate and wide grounding lines, as
well as physical separation from sen-

sitive electronics on the PCB, can help


to avoid interference. Stepper lead
wires should also be separated from
sensitive signal wires to reduce
capacitive and inductive coupling. In a
chopper application the capacitive
coupling of the chopped voltage (this
is a square wave signal with the
amplitude equal to the supply voltage
and the frequency equal to the
chopping frequency) present at the
motor lead wires can cause serious
problems if not handled.

Performance of motors
The maximum output torque and
power from a stepper motor is limited
by the power losses of the motor. For
low stepping rates, most of the losses
are related to resistive losses in the
motor winding. At higher stepping
rates the hysteresis and eddy-current
losses become the major ones.
Especially for low-cost tin-can PMsteppers, these losses can be high
because of the absence of laminations
and the use of low performing
magnetic materials of the stator and
rotor flow path.
From the above driver comparisons,
we can see that the maximum torque,
efficiency, and output power from a
given motor is achieved with the bipolar chopper driver. We will now
examine the performance of some
commonly-used stepper motor types
when they are driven with a bipolar
chopper drive.
A drop in performance, similar that
of the 57mm PM-motor used above,
can be expected when other types of
drivers are used.
57mm PM motor
PM-motors are a cost-effective alternative in many low- and mediumperforming applications. The motors
uses slide bearings and a simple
mechanical design to keep cost low.
Compared to hybrid motors, the life
expectancy is shorter, step accuracy
and efficiency is lower. The slide
bearing can also cause problems if a
belt drive is applied directly to the
motor shaft.

is plotted as a function of the


stepping frequency. This motor is
rated at 7 watts maximum power
dissipation. The chart shows the
power dissipation of the motor and
driver together. At low step rates
about a 3W-loss in the two PBL
3770A circuits can be expected, as
well as an additional 1W in the
current sensing resistors and approximately 1W in the external diodes. At
higher stepping rates, the driver losses
decrease as the winding current decreases and the switching stops. At
low step rates this gives a 7-watt loss
in the motor. At higher step rates, the
total loss decreases indicating the
ability to get a higher output power
without exceeding the maximum

The 57mm PM-motor is. for instance, suitable to use as paper feed
and carriage drive motor in mediumperformance matrix or daisy printers
and in typewriters. Other applications
are fax machines, sewing machines,
valve controls, and plotters.
Other popular PM-motor sizes are
35mm and 42mm. 20mm, 25mm and
63mm motors are also common PM
motor sizes. The 20mm motor is popular as a head driver in 312" floppydisk drive applications. Commonlyavailable full-step angles are 7.5 and
15 degrees but others are also available (9, 11.25, and 18 degrees, for
examples).
In figure 6, the performance of this
motor is shown again. The power loss

Pull-out torque [mNm]


Efficiency [%]

120

Output power [W]


Power losses [W]

12W

12

100

10

80

AA
A
A
A
A
A
A
AA
A
A
A
A
AAAA
A

60

4.8W

40

37%

20
0

500

1000

1500

Full-step stepping rate [Hz]


Efficiency
Output Power

Pull-out Torque

0
2500

2000

Power losses

Figure 6. Performance curves for a 3.75 ohm bipolar 57 mm PM-motor driven by PBL
3770A constant-current driver. Power losses in motor and driver are also shown
(Chopper voltage 20 V, winding current 960 mA).

Pull-out torque [mNm]


Efficiency [%]

Output power [W]


Power losses [W]

120

12

100

10

80
60
40
20
0

AA
AA
A
A
A
AA
A
A
A
A
AA
A
A
A
AA
AA
AA
A
8

7.3W

65%

4
2

1000

2000

3000

4000

0
5000

Full-step stepping rate [Hz]

Pull-out Torque

Efficiency

Output Power

Power losses

Figure 7. Performance curves for a 25 ohm bipolar 42 mm square hybrid stepper driven
by PBL3770A constant-current driver (Chopper voltage 40V, winding current 280mA)

allowed motor losses of 7W. If a lower


duty cycle or better heat sinking is
applied to this motor a peak output
power of at least 10W can be
achieved.
PM-motors have one advantage
over hybrid motors, they have a
higher internal damping and offer, in
some applications, a more-noise-free
operation than the hybrid motors.
42mm square motor
This motor is normally manufactures
with 3.6-, 1.8- and 0.9-degree step
angle. Step accuracy is 3% to 7%
of a full-step. The motor uses ballbearings to maintain the very small
air-gap required for high efficiency.
This type of stepper motor is available from many manufacturers at a
reasonable price, but the price is
higher than the PM-motors. The

main feature of this type of motor,


compared to the 57mm PM-motor, is
higher efficiency and step accuracy. In
many applications, the ball-bearings
offer higher life expectancy and make
the design of the gearing and
mechanics easier. This type of stepper
became very popular some years ago
as head driver for 514" floppy and
hard disk drives. It is suitable as a
carriage driver for printers and
plotters, and for driving the print
wheel in typewriters and daisy wheel
printers. It is also a competitor to the
small-sized PM-motors, if the application requires higher efficiency or
ball-bearings
Figure 7 shows the performance of
a 25-ohm bipolar 3.6-degree 42mm
square motor driven by a constantcurrent driver. The current level is
selected to give 4W resistive losses at

Pull-out torque [mNm]


Efficiency [%]

160
140
120
100
80
60
40
20
0
0

Output power [W]


Power losses [W]

31W

32
28
24
20
16
12
8
4
0
5000

AA
A
A
AA
A
A
A
A
AA
A
A
A
AA
AAAA
A
AA
A
66%

1000

65%

2000

3000

4000

Full-step stepping rate [Hz]

Pull-out torque

Efficiency

Output Power

Power losses

Figure 8. Performance curves for a 2.8 ohm bipolar 57 mm hybrid stepper (length 42mm)
driven by PBL 3770A constant-current driver (Chopper voltage 40V, winding current
75mA).
Holding torque [mNm]
450
Hybrid holding torque
Hybrid DC-losses
PM holding torque
300
PM DC-losses
150
0
0

DC-losses [W]
18

12

284mNm

84mNm

200

400

600

800 1000 1200


Winding current

1400

1600

1800

Figure 9. Holding torque and DC-loss as functions of winding currents for a 57mm PM
motor and for a 57mm hybrid motor.

stand still. This motor type is rated


for 4 to 6W losses depending on
manufacturer. Compared to the
57mm PM motor in figure 6, nearly
doubled system efficiency is the most
interesting difference. From the power
losses curve, we see that at higher
stepping rates the losses decrease.
This indicates that an even-higher
high-frequency performance can be
achieved with a higher chopping
voltage or with a lower-inductance
winding.
57mm (size 23) hybrid motor
This type of hybrid stepper motor is
normally available with a 1.8- and
0.9-degree step angle and in a number
of different lengths from 40mm to
100mm. This motor is more expensive than the two other types described above. On the other hand, a
much higher torque and output power
is available.
The performance of this motor type
is plotted in figure 10. A motor with
5-degree step angle, 2.8-ohm bipolar
winding and with 42mm length has
been selected. This is the smallest
motor size of this class. The 5-degrees
step angle is interesting when high
shaft speed is more important than
high holding torque.
The diagram shows the same highefficiency as for the 42mm square
motor, but four-times-higher output
power. A maximum of over 30W is
achieved in the area of 3000 to
3500Hz. At high step rates, the
power losses of the motor is approx.
12W (including driver 16W). This is
acceptable with normal cooling of the
motor and 100% duty cycle. At low
step rates, the losses decrease and at
standstill the losses are only 3W. This
shows the ability to increase the
motor current to get even higher
output torque and power at low step
rates. On the other hand, decreasing
the low frequency torque can be a way
of decreasing noise levels and vibrations in applications where the load
friction torque consumes a larger part
of the motor torque than the load
inertia.
This motor is suitable for paper
handling and carriage driving in high-

performance printers and plotters, or


industrial motion control. The 5degree stepper, with per-formance
shown in figure 8, is suit-able for
driving the print mechanism of laser
printers. PBL3770A is a suit-able
driver for this size of stepper motor.
Power losses and holding torque
The limiting factor in high-performance stepper motor designs is the
stepper power dissipation.
Stepper motor manufacturers often
specify the stepper motor windings by
the maximum-allowed power disipation at stand still. This gives the
nominal winding voltage and current
levels. In an application, the optimum
performance often is achieved at
different voltage and current levels. In
figure 9, the holding torques of the
57mm PM and 57mm hybrid motors,
described above, are plotted as functions of the the 2-phase-on current, as
are the resistive power losses in the
windings.
From the diagram, we can see that
for the PM-motor, the holding torque
curve shows a knee at 600mAindicating that magnetic saturation starts
to occur at this current level, even
though the resistive losses in the
winding is only 3W, compared to the
specified 7W. This indicates that
using the specified current level of
960mA does not give the optimum
performance on low stepping rates.
Figure 10 shows the affect on
motor and drivier performance when
the winding current is decreased to
480mA. (50% of the value used in
figure 6.) Comparing figure 6 and 10
shows the improved low-frequency
performance. Low-speed losses are
decreased to less than 50% and lowspeed torque only dropps to 80%. In
the high-stepping-rate region, only a
small loss in torque apears. In figure
13 another combination of driving
current and voltage is used to increase
the output power to 5.5W with the
same maximum losses as in figure 6.
Now the losses occur where they are
more motivated at the stepping rate
where the maximum output power
appears.
For the hybrid motor, we see that
the winding currents can be increased

beyond the maximum rating without


causing too much saturation effect. In
figure 8, the torque from this motor
shows a relativly-flat torque characteristic for stepping rates below 3kHz.
This is a result of the 750mA current
level not using the full low-speed
capabilities of this motor. Increased
current will raise the output torque at
low speeds and make the region with
maximum output power wider (towards low frequencies), but it will
only increase the peak output power
marginally.

Designing a system
Analyzing the load
When designing a stepper motor system, the first question to ask is What

are the characteristics of the load?


Too often, this question is given too
little consideration. To get the best
performance, it is important to do an
analysis before selecting motor and
driver and before designing the
transmission and mechanical system.
Friction or inertia loads
If the system will have high dynamic
performance, (high acceleration/
retardation), then most of the output
torque from the motor will be used to
accelerate the systems inertia. To get
the maximum performance from this
type of system, the gear rate should
normally be designed so that the load
inertia seen by the motor is close to
the motor internal inertia. The load
inertia seen by the motor is:

Pull-out torque [mNm]


Efficiency [%]

Output power [W]


Power losses [W]

12

120
100

10

8.4W

80

AA
AAA
A
A
A
A
A
A
A
A
AA
AA A
AAA
A

60

4.3W

40

34%

20
0
0

500

1000

1500

0
2500

2000

Full-step stepping rate [Hz]

Pull-out Torque

Efficiency

Output Power

Power losses

Figure 10. Performance curves for a 3.75ohm bipolar 57mm PM-motor driven by
PBL3770A constant-current driver. (Chopper voltage 20V, winding current 480mA).

Pull-out torque [mNm]


Efficiency [%]

Output power [W]


Power losses [W]

12.1W

120

12

100
80
60
40
20

10

AA
AA
AA
AA
AAAA
AAAA
AAAAA
AAA
AA AA
AAA
A

0
0

5.5W

6
4

34%

500

1000

1500

2000

2500

Full-step stepping rate [Hz]

Pull-out Torque

Efficiency

Output Power

Power losses

Figure 11. Performance curves for a 3.75ohm bipolar 57mm PM-motor driven by
PBL3770A constant-current driver. (Chopper voltage 25V, winding current 600mA).

Jlm = Jl Gr2 where:


Jl = load inertia without gearing

However, in some applications, an


increased inertia can be used to move
a resonance to a lower frequency.

Gr = the gear rate.


A friction torque is reduced by the
factor 1Gr by a gear mechanism.
Friction torque/load power consumption
To select the right motor size and
driver type, it is necessary to calculate
or measure the load friction torque.
For most type of loads, this is fairly
constant at different speeds, which
makes measuring easy. If the system
involves a linear motion, a spring
scale can be usedand for a rotating
system, a torque watch can be used.
From the measured force or torque,
and information about the maximum
speed of the motion, the maximumneeded load power can be calculated:
P[W] =v[m/s] F[N]
for linear systems and
P[W] = [radians/s] T[Nm]
for rotating systems.
Another way of estimating the load
power consumption is to replace the
motor or motor and gearbox with a
DC-motor with known current-totorque function and drive the motor
at the desired speed while measuring
the current consumption. If this
technique is used, it is possible to
measure the power consumption at
different speeds.
Damping
As noted earlier, the usable torque
from a stepper motor can decrease at
certain stepping rates due to resonances. At which step rates, and to
what extent, this torque reduction
appears depends on the application
damping and inertia. The damping of
the driver also influence the torque
reduction.
Resonances at low stepping rates
can normally be reduced by lowering
driver current and voltage levels, or
by selecting half- or microstepping
mode drivers. At medium step rates
the constant-current drivers normally
have the least problems with resonances, but here the characteristics of
the load have large impact.
Low system inertia normally creates
fewer problems with resonances.

10

Selecting concept
After analyzing the load, we know the
output power needed, the maximum
and minimum stepping rates, and the
resolution needed.
Depending on the importance of
the different demands and the ability
to fulfill them, the designer has a
range of options in combining motor
gearing and driver in a system.
The design is normally an iterative
process, with calculation and experimentation. If highest-performance or
lowest-cost for a given performance is
essential, it is a good idea to compare
a few different combinations of motor
driver and gearing.
A higher-step-rate driver and a
smaller motor, together with a
suitable gearing, often gives better
performance in efficiency and
output powerthan a large motor
driving the load directly.

Motor selection
Output power
This is the most important design
criteria in getting the best price/
performance of a stepper motor
system. Compare the power requirements of the load with the data given
above, or with the data in the manufacturers data sheet. If the manufacturers data sheet is used be aware
of the big differences in performance
of the stepper motors due to different
drivers. Also remember that measuring stepper motor pull-out and pullin torque is tricky. The measurement
is easily influenced by inertia and
resonances in the measuring system,
and the inertia and damping of the
application is normally different. As a
result, the pull-out curves in the data
sheet are not always valid for an actual
application.
Mechanical aspects
The physical dimension and weight of
the motor are important criteria when
a motor is selected. Often the choice
of a smaller motor can make a

compact mechanical design easier. A


smaller motor can also, if the motor is
in a moving part of the mechanism,
make the design of the motion system
easier.
In applications where long life expectancy is needed, motors with ball
bearings are required. Hybrid motors
use ball-bearings as a standard (to
maintain the narrow air-gap), but
small-sized PM motors usually use
slide bearings. PM motors, with ball
bearing as an option, are supplied by
some manufacturersbut the additional cost for this is rather high.
If the motor drives a belt gearing or
a belt transmission directly, ball
bearings are strongly recommended.
This ensures proper lifetime and reduces torque loss due to bearing
friction caused by the belt tension.
Cost
The motor cost depends on motor
type and size. Winding type and
resistance do not affect the cost. As a
rule, hybrid motors are more expensive than PM-motors. The motor cost
normally increases with motor size.
Another factor that influences the
motor cost is the production volumes
of a certain motor and the number of
manufacturers of that motor. This
means that many times a popular
type and size motor is the best choice
even if the motor output power is a
little higher than required.
Customizing the motor
In medium- and high-volume applications, it is possible to customize the
motor. Most manufacturers offers
customization on the following items.
Shaft

Single- or double-sided
Length
Pinions

Winding Resistance
Inductance
Rotor

Type of magnets
hybrid air-gap distance

Lead wires Length


Connector
From some manufacturers, other
parameters such as shaft diameter,
bearing types, mounting flange can be

customized but this is normally applicable only in high-volume applications.

Driver design
Selecting driver type
The performance curves at the beginning show the effect of the driver on
the system. If only low stepping rates
are used and the use of gearing is not
a solution, the unipolar L/R-driver
offers the lowest cost for the electronics for a given output torque.
As demand for output power from
the stepper increases, more-effective
drivers offer the best price performance ratio. The best motor utilization is achieved with the bipolar
constant current driver and this driver
is the obvious choice for all highpower applications.
For applications in the low- and
medium-power range, several alternatives exists. If system efficiency is
important, then the bipolar constant
current driver is the best choice. This
driver offers higher flexibility in
selecting the motor winding, since
both the chopper voltage and the
current in the winding can be
changed to get the desired pull-out
torque curve from the motor. Powersupply design gets easier and powersupply losses decrease since regulated
supply normally is not needed for
constant current drivers.
If minimum cost for the driver
electronics is the most important
design criteria, rather than the over
all system performance, then the
different unipolar driver can be the
best choice.

Pull-out torque [mNm]


Efficiency [%]

Output power [W]


Power losses [W]

120

12

100

10

80
60
40
20
0
0

AAAAAAAAA
AA
A
A A

3.8W

36%

500

1000

1500

2000

2
0

2500

Equivalent full-step stepping rate [Hz]

Pull-out Torque

Efficiency

Output Power

Power losses

Figure 12. Performance curves for a 3.75ohm bipolar 57mm PM-motor driven by
PBL3770A constant-current driver. (Half-step mode fast current decay. Chopper voltage
20V, 2-phase-on current 480mA).

Pull-out torque [mNm]


120
Pull-out 40V
Pull-out 30V

100
80

Output power [W]


12
Output 40V
10
Output 30V
8

7.3W

60
5.3W

40

4
2

20
0
0

0
1000

2000
3000
Full-step stepping rate [Hz]

4000

5000

Figure 13. Performance as a function of chopper voltage for a 25ohm bipolar 42mm
square hybrid stepper driven by PBL3770A constant-current driver (Chopper
voltage 40/30V, winding current 280mA).

Power losses [W]


12

Pull-out torque [mNm]


120

Pull-out 280mA
Pull-out 200mA
Losses 280mA
Losses 200mA

100
80

Selecting driver mode


FULL-STEP MODE: This is the basic
stepper driving mode, it offers the
simplest control electronics and it is
recommended for high- and mediumfrequency operation. At these frequencies, the inertia of the motor and the
load smooth out the torque, resulting
in less vibration and noise compared
to low-speed operation.

7.1W

10
8

60

40

20

0
0

1000

2000
3000
Full-step stepping rate [Hz]

4000

5000

Figure 14. Performance as a function of winding current for a 25ohm bipolar 42mm
square hybrid stepper driven by PBL3770A constant-current driver (Chopper voltage
40V, winding current 280/200mA).

11

HALF-STEP MODE:

Half stepping with


140% 1-phase-on current gives
smoother movement at low step rates
compared to full stepping and can be
used to lower resonances at low
speeds. Half stepping also doubles the
system resolution. Observe that for
most steppers, the step accuracy specification only is valid for 2-phase-on
positions. The accuracy is lower and
the stop-position hysteresis is larger
for 1-phase-on positions.
Figure 12 shows the effects on performance of the 57mm PM-motor
when half stepping is applied to this
motor. Compared to to full stepping
(reffer to figure 10 for the same
driving conditions), a slightly-higher
torque at low speed and a small decrease at higher step rates. The main
advantage is the lowered noise and
vibrations at low stepping rates. If
maximum performance at both low
and high step rates is essential, a
switch to full-step mode can be done
at a suitable frequency. Change the
stepping mode this way will also
lowers CPU-time requirement (step
rate reduced by 50% at high speeds) if
the system use a microprocessor as
control unit.
MICROSTEPPING: The smoothest movements at low frequencies is achieved
with microstepping. Higher resolution is also offered. If resonance-free
movement at low step rates is important, the microstepping driver is the
best choice. Microstepping can also be
used to increase stop position accuracy
beyond the normal motor limits.

Designing the winding


For a constant current chopper type
driver the winding design depends on
the desired output power, maximum
operation frequency, and chopper
voltage. A simplified design method,
which in most cases when high
output power is important, gives a
good results is described below.
EMF selection
A good design criteria for winding
design is the EMF (electromotive

12

force) of the winding The optimum


motor performance efficiency and output power is achieved close to the step
frequency where the EMF peak value
is equal to the driving voltage (chopper voltage in the case of constant
current drive). As an example, the
42mm square motor, with performance as shown in figure 7, has an EMF
constant of 20mV/Hz (full-step
frequency) With a 40-volt chopping
voltage, this gives a optimum stepping rate of 2kHz. From figure 7, we
see that at 2kHz both the efficiency
and the output power are at their
maximum values. To design a winding for 20 volts, with a maximum
output at the same stepping rate, a
winding with 10mV/Hz EMF
constant should be used. This winding
will have half the number of turns and
thus 14 of the resistance and inductance of the original winding. To get
the same holding torque and lowfrequency performance the winding
current has to be raised to twice the
original value.
It is not possible to increase the
optimum stepping rate for a motor to
very high values since then hysteris
loss and rotor leakage inductance will
decrease the efficiency.
The EMF constant for a motor is
measured by conecting the motor
winding to an osciloscope and rotating
the rotor at a constant speed (by means
of a DC-motor for instance) and
measuring the peak value and the
frequency of the generated signal. The
generated frequency corresponds to a
four-times-higher full-stepping rate.
From this the EMF constant can be
calculated.
Figure 13 shows the affect on the
torque and output power of the 42mm
hybrid motor when the chopping
voltage is decreased. From the figure,
we can see that the optimum
operating frequency moves from
approximatly 2kHz to 1.5kHz when
the chopping voltage is decreased
from 40 to 30 volts. Using the EMFrule we get the same result:
20mV/Hz 1.5kHz = 30 Volts.

Selecting the current level


In a constant-current driver the
driver-current level mainly affects the
torque at the low frequencies.
Depending on the load torque demand (friction and inertia) as a function of stepping rate, it is often a
good idea to reduce the current level
to get a more-flat torque characteristics from the motor. This normally
decrease resonances and power losses
and allows a lower-rated driver
circuit.
In Figure 14, the effect of decreased
winding current is shownfrom the
curve we can see that only the low
and medium frequencies are affected
by the lower current. Power losses at
low step rates have also decreased.
The peak output power, however, is
not affected as the torque at 2kHz is
not decreased.

Summing up
The unipolar L/R-driver offers the
lowest cost for the electronics for a
given output torque, if the step rate is
low.
As demand for output power from
the stepper increases, more effective
drivers offers the best price performance ratio. The best motor utilization is achieved with the bipolar
constant current driver and this driver
is the obvious choice for all highpower applications.

Das könnte Ihnen auch gefallen