Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
2
3
4
5
Contents
Introduction .................................................................................................................. 2
Full Step vs Microstep ...................................................................................................... 3
Application Block Diagram ................................................................................................. 5
Schematics ................................................................................................................... 9
PCB Layout ................................................................................................................. 13
List of Figures
6
7
8
9
10
11
12
13
................................................................................................ 5
..................................................................... 7
Current Magnitude, Phase, and Decay Relationship ................................................................... 8
Interrupt Service Routine Flowcharts ..................................................................................... 9
MSP430 Microcontroller with JTAG Programming Port and Test Points Schematic ............................. 10
Input Power and Regulation Schematic ................................................................................ 11
DRV8828/29 Power Stage Schematic .................................................................................. 12
Top Layer Image .......................................................................................................... 13
Bottom Layer Image....................................................................................................... 13
PCB Silkscreen ............................................................................................................ 14
Introduction
www.ti.com
Introduction
Bipolar stepper motor applications are often designed to be driven at full steps. However, it is well-known
that when each step is divided into multiple, smaller steps (referred to as microsteps), better motion quality
can be observed. The application of microstepping to most stepper applications allows for additional
application improvements, such as:
Better torque response
Less vibration
Less resonance incidence
Any stepper motor can be microstepped. TIs DRV8811 and DRV8821 motor controller devices allow
users to apply microstepping waveforms to bipolar stepper motors with up to 8 degrees of microstepping.
The complementary DRV8824 and DRV8825 each offer extended microstepping ranges of 16 and 32
degrees, respectively.
In Application Report SLVA416 (available for download at www.ti.com), we discussed how to interface an
MSP430F1612 microcontroller to a single DRV8812 or dual DRV8828/29/40 devices in order to obtain
additional degrees of microstepping (up to 256 degrees) and multiple waveform shapes. This configuration
is the most flexible option, and allows up to 5 A per phase, up to 4096 degrees of microstepping, and any
number of waveform shapes that we can store within the 55 kB of flash ROM.
This implementation is very flexible and advantageous for applications that require the type of flexibility
described. But what options are available if the application requires only up to 32 degrees of
microstepping and a simple sine waveform?
The DRV8828/29/40 devices each include an internal, 5-bit digital-to-analog converter (DAC). As a result,
there is no need to use advanced techniques through large and convoluted look-up tables within a
microcontroller, or to have the added expense of a rather large microcontroller unit. All we must do is to
incrementally step through the 5-bit values that generate a sine wave current control envelope, and
microstepping has been achieved.
In this report, we describe an easy-to-follow procedure to achieve a simple but robust 32 degrees of
microstepping drive with the use of a microcontroller such as the MSP430F2112, in combination with a
pair of DRV8828/29/40 devices.
www.ti.com
2.1
VBB
AAH
BAH
ABH
BBH
AAH
B
Bipolar
A
B
AAL
BAL
ABL
AAL
BAH
ABL
BAL
ABH
BBL
BBH
BBL
2.2
The Microstep
If full steps are all that the application requires, then the configuration presented Figure 1 is the optimal
solution. However, many applications can certainly benefit from dividing full steps into smaller steps.
Figure 2 shows two full steps on the top and one way to divide each full step into eight smaller steps. It is
an industry-standard practice to use a sine waveform shape, which is why the DRV8828/29/40 internal
5-bit DAC was optimized for each corresponding combination to resemble the indicated waveform.
One Step
One Step
Eight Microsteps
Eight Microsteps
www.ti.com
The idea behind microsteps is to make the current that flows through the winding a fraction of either the
Full On current in one direction or the Full On current in the opposite direction. This approach allows for
the rotor to be pushed/pulled in increments rather than with full force. At the same time, this technique
allows for the rotor to stop in between the positions allocated for full steps. As a result, specific positioning
obtains further resolution.
Because the DRV8828/29/40 each have the capability to regulate winding current, and that current is
directly proportional to the 5-bit combination present on the I[4:0] bits, it is possible to embed the
prospective sine waveform at the current side. Figure 3 shows the result of embedding the waveform into
the winding current.
One
Step
Phase A
1
Phase B
Internal
VREF A
2
Internal
VREF B
Current A
Current B
www.ti.com
Ix[4:0]
Five GPIOs
OUTA+
USM0
Enable
USM1
Phase
DRV8828/
8829
OUTA-
Decay
nSLEEP
STEP
VREF
DIR
MSP430F21
Ix[4:0]
Index Reset
Five GPIOs
OUTB+
Enable
Phase
Decay
DRV8828/
8829
OUTB-
nSLEEP
VREF
Enable
nSLEEP
VREF
www.ti.com
Note that the VREF analog signal is not shown here, but considered as part of this solution. The VREF
analog signal can be supplied externally or through the use of an MSP430 timer output fed through an RC
filter in order to a generate a cost-effective DAC output.
Inputs such as STEP, DIR, USMx, and IndexReset are sampled by a series of interrupt service routines
(ISRs). Whenever a respective rising or falling edge is detected, the ISR computes the next step and
generates the respective output combination.
3.1
3.2
Firmware Variables
A series of variables will hold the states and the values required to generate the microstepping as detailed
in the balance of this report.
SineWave[128]: A 128-byte long look-up table containing all the information necessary to generate
magnitude, sign, and current recirculation mode to be used during the generation of the 32 degrees of
microstepping sine waveform.
MSCounter: A continuously-increasing byte that is used as an index to the SineWave[128] look-up
table.
MSDirection: A boolean value used to determine whether the motor should be rotating while following
the clockwise or counter-clockwise convention.
MSIncrement: An integer added to the MSCounter and used to move through the look-up table in
single or larger increments as denoted by the User Mode bits USMx.
32 degrees of microstepping are obtained when all the values in the logic table are used. In order to
obtain fewer degrees of microstepping, fewer corresponding values are fetched from the table. In this
form, the increment is used to select look-up table values that are one address location apart for 32
degrees of microstepping, two address locations apart for 16 degrees of microstepping, four address
locations apart for 8 degrees of microstepping, and eight address locations apart for quad stepping.
When MSIncrement is modified, as when any of the USMx bits change, the MSCounter must be
normalized to the proper increment range in order to avoid waveform deformation. For example, while
employing a quad stepping method, the look-up table values retrieved are from the address locations 0, 8,
16, 24, and so on. However, if the MSCounter is any value between 0 and 8, for example, adding
MSIncrement = 8 to the current MSCounter causes the retrieval of invalid look-up table addresses.
To normalize the MSCounter according to the selected degrees of microstepping, a mask clears the least
significant bits. For example, if quad stepping is selected, bits 0 to 2 in the MSCounter would be cleared,
while bits 0 to 1 would be cleared for 8 degrees of microstepping, and bit 0 would be cleared for 16
degrees of microstepping. There is no need to perform any normalization when 32 degrees of
microstepping are selected because all the values in the look-up table are allowed.
www.ti.com
3.3
b6
b5
b4
b3
b2
b1
b0
Not used
DECAY
PHASE
I4
I3
I2
I1
I0
Figure 5 shows how the hardware pinout on the microcontroller has been coded so that PORT 2 is
connected to stepper PHASE A, whereas PORT 3 is connected to stepper PHASE B. Therefore, all we
must do is to retrieve the value from the look-up table in memory and feed it to the respective Port Output
Register (PxOUT).
Not Used
b7
Byte 0
Value A
Index
32
S
Value B
b6
DECAY
b5
PHASE
b4
I4
b3
I3
b2
I2
b1
I1
b0
I0
DRV8828/29
POUT2
Not Used
b7
b6
DECAY
b5
PHASE
b4
I4
b3
I3
b2
I2
b1
Byte 127
b0
POUT3
I1
I0
DRV8828/29
3.4
www.ti.com
Quadrant 2
Quadrant 3
Quadrant 4
Ix Increases
Ix Decreases
Ix Increases
Ix Decreases
Phase
Decay
Schematics
www.ti.com
If fast decay mode results in operation that is too noisy, then mixed decay mode could be employed. For
this mode, the respective DECAY pins could be configured as inputs during the respective quadrants,
rendering them high impedance. This condition is the 3-state polarity at which the DRV8828/29/40 DECAY
inputs are signaled to re-circulate current in Mixed Decay Mode.
3.5
Sample STEP
Sample DIR
No
No
Step?
Yes
Is DIR CW?
Yes
Increment Index
Increment = -32
Increment = 32
PORT2 =
Sinewave[Index]
PORT3 =
Sinewave[Index + Increment]
Schematics
Figure 8 through Figure 10 show the schematics for the recommended design solution.
Schematics
www.ti.com
V3p3
U3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
TEST
0.1uF
PHASE_A
C11
USM1
DECAY_A
RST
PHASEA_I0
PHASEA_I1
PHASEA_I2
PHASEB_I0
PHASEB_I1
PHASEB_I2
PHASEB_I3
GND
TST/SBW
DVCC
P2.5
DVSS
P2.7 /XOUT
P2.6 /XIN
RST
P2.0
P2.1
P2.2
P3.0
P3.1
P3.2
P3.3
TDO
TDI
TMS
TCK
P1.3
P1.2
P1.1
P1.0
P2.4
P2.3
P3.7
P3.6
P3.5
P3.4
P1P7
P1P6
P1P5
P1P4
IndexReset
DIR
STEP
USM0
PHASEA_I4
PHASEA_I3
28
27
26
25
24
23
22
21
20
19
18
17
16
15
DECAY_B
PHASE_B
PHASEB_I4
R10
5.1K
MVREF
C15
0.01uF
MSP430F2132
V3p3
GND
J3
P1P7
JP4
1
3
5
7
9
11
13
R3 P1P6
3.3K P1P5
P1P4
RST
2
4
6
8
10
12
14
1
2
3
TEST
PWR Select
MCU RESET
JTAG
S1
GND
nSLEEP
ENABLE
DECAY_B
PHASE_B
PHASEB_I0
PHASEB_I1
PHASEB_I2
PHASEB_I3
PHASEB_I4
DECAY_A
PHASE_A
PHASEA_I0
PHASEA_I1
PHASEA_I2
PHASEA_I3
PHASEA_I4
TP3
TP4
TP5
TP6
TP7
TP8
TP9
TP10
TP11
TP12
TP13
TP14
TP15
TP16
TP17
TP18
GND
PHASEA_I4
PHASEA_I3
PHASEA_I2
PHASEA_I1
PHASEA_I0
PHASE_A
DECAY_A
PHASEB_I4
PHASEB_I3
PHASEB_I2
PHASEB_I1
PHASEB_I0
PHASE_B
DECAY_B
ENABLE
nSLEEP
Figure 8. MSP430 Microcontroller with JTAG Programming Port and Test Points Schematic
10
Schematics
www.ti.com
VM
J4
R4 3.3K
V3p3
USM1
USM1
D1
C12
C13
0.1uF
100uF
VM
VM
1
2
JP1
V3p3
J5
USM0
USM0
nSLEEP
VM
TP1
V3p3
nSLEEP
3
JP3
Header 10
VM
U4
1
1
V3p3
R5
C14
R6
3.3K
61.9K
2
3
4
10 uF
IndexReset
R7
39K
IN
FB
NC
NC
NC
GND
EN
8
7
6
5
TPS79801
GND
TP2
1
S2
Index Reset
OUT
GND
JP2
ENABLE
STEP
DIR
IndexReset
USM1
USM0
nSLEEP
XVREF
1
2
3
4
5
6
7
8
9
10
GND
CPGCOM Connector
GND
J6
XVREF
ENABLE
IndexReset
USM0 SLEEP
GVDD
1
SDA
3
SCLK OSI
5
MISO
7
ADC0
9
ADC2 DC3
11
DAC0 AC1
13
TMR0 MR1
15
TMR2 MR3
17
GPIO0 PIO1
19
GPIO2 PIO3
21
GPIO4 PIO5
23
GPIO6 PIO7
25
GVCC
27
GVCC
29
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
GND
SCL
M
SS
ADC1
A
D
T
T
G
G
G
G
GND
GND
STEP
DIR
USM1
n
Header 15X2
GND
11
Schematics
www.ti.com
V3P3OUT
VM
V3p3
0.1uF
0.01uF
C2
AOUT+
ISENA
AOUTAOUTISENA
AOUT+
R8
0.3
VREF
C5
CP1
CP2
VCP
VMA
OUT1
ISENA
OUT2
OUT2
ISENB
OUT1
VMB
AVREF
BVREF
GND
GND
I4
I3
I2
I1
I0
NC
EN
PH
DECAY
nFAULT
nSLEEP
nRESET
V3P3OUT
28
27
26
25
24
23
22
21
20
19
18
17
16
15
PHASEA_I4
PHASEA_I3
PHASEA_I2
PHASEA_I1
PHASEA_I0
ENABLE
PHASE_A
DECAY_A
R1
3.3K
PVREF
GND
nSLEEP
JP5
V3P3OUT
C3
.47uF
MVREF REF
PVREF
XVREF
1
2
3
4
5
6
C4
R2
5K
U1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
GND
C1
Header 3X2A
TL1
DRV88xx
DRV8829 uStep 32
Demo
VM
V3p3
0.1uF
0.01uF
C7
BOUT+
ISENB
BOUTBOUTISENB
BOUT+
R9
0.3
VREF
C10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
CP1
CP2
VCP
VMA
OUT1
ISENA
OUT2
OUT2
ISENB
OUT1
VMB
AVREF
BVREF
GND
GND
I4
I3
I2
I1
I0
NC
EN
PH
DECAY
nFAULT
nSLEEP
nRESET
V3P3OUT
28
27
26
25
24
23
22
21
20
19
18
17
16
15
PHASEB_I4
PHASEB_I3
PHASEB_I2
PHASEB_I1
PHASEB_I0
ENABLE
PHASE_B
DECAY_B
R11
3.3K
nSLEEP
V3P3OUT
C8
.47uF
C9
U2
GND
C6
DRV88xx
J1
AOUT+
AOUTBOUT+
BOUT-
1
2
3
4
Header 4
J2
1
2
3
4
Header 4
12
PCB Layout
www.ti.com
PCB Layout
Figure 11 through Figure 13 illustrate the recommend printed circuit board layout for this solution.
13
PCB Layout
www.ti.com
14
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,
and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should
obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are
sold subject to TIs terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TIs standard
warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where
mandated by government requirements, testing of all parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right,
or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a
warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual
property of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied
by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive
business practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional
restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all
express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not
responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonably
be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governing
such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and
acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their products
and any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may be
provided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in
such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are
specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military
specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at
the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are
designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designated
products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products
Applications
Amplifiers
amplifier.ti.com
Audio
www.ti.com/audio
Data Converters
dataconverter.ti.com
Automotive
www.ti.com/automotive
DLP Products
www.dlp.com
Communications and
Telecom
www.ti.com/communications
DSP
dsp.ti.com
Computers and
Peripherals
www.ti.com/computers
www.ti.com/clocks
Consumer Electronics
www.ti.com/consumer-apps
Interface
interface.ti.com
Energy
www.ti.com/energy
Logic
logic.ti.com
Industrial
www.ti.com/industrial
Power Mgmt
power.ti.com
Medical
www.ti.com/medical
Microcontrollers
microcontroller.ti.com
Security
www.ti.com/security
RFID
www.ti-rfid.com
www.ti.com/space-avionics-defense
www.ti.com/video
Wireless
www.ti.com/wireless-apps
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright 2010, Texas Instruments Incorporated