Texas Instruments Stellaris User manual

RDK-Stepper-03 Copyright © 2007–2009 Texas Instruments
User’s Manual
Stellaris® Stepper Motor Reference Design
Kit

2November 4, 2009
Copyright
Copyright © 2007–2009 Texas Instruments, Inc. All rights reserved. Stellaris and StellarisWare are registered trademarks of Texas Instruments.
ARM and Thumb are registered trademarks, and Cortex is a trademark of ARM Limited. Other names and brands may be claimed as the property
of others.
Texas Instruments
108 Wild Basin, Suite 350
Austin, TX 78746
Main: +1-512-279-8800
Fax: +1-512-279-8879
http://www.luminarymicro.com

Stellaris® Stepper Motor RDK User’s Manual
November 4, 2009 3
Table of Contents
Chapter 1: Stellaris® Stepper Motor Reference Design Kit Overview.........................................................9
Using the RDK....................................................................................................................................................9
Features..............................................................................................................................................................9
Motor Technology.............................................................................................................................................10
Introduction to Stepper Motors......................................................................................................................10
Chopper Control............................................................................................................................................11
RDK Specifications...........................................................................................................................................12
Electrical .......................................................................................................................................................12
Mechanical....................................................................................................................................................12
Chapter 2: User Interfaces.............................................................................................................................13
On-board User Interface...................................................................................................................................13
Speed Mode..................................................................................................................................................14
Position Mode...............................................................................................................................................14
Graphical User Interface...................................................................................................................................15
File Menu......................................................................................................................................................18
Configuration Window...................................................................................................................................18
Chapter 3: Hardware Description..................................................................................................................21
Block Diagram ..................................................................................................................................................22
Functional Description ......................................................................................................................................22
Microcontroller (Schematic Pages 1-2).........................................................................................................22
Output Power Stage (Schematic Page 3).....................................................................................................23
Control Interfaces (Schematic Page 4).........................................................................................................24
Software............................................................................................................................................................24
Chopper Control............................................................................................................................................24
Parameter Reference....................................................................................................................................26
Serial Protocol ..................................................................................................................................................26
Appendix A: Parameters................................................................................................................................27
Parameter Descriptions ....................................................................................................................................27
Motor Running Configuration........................................................................................................................28
Target Position..........................................................................................................................................28
Maximum Current .....................................................................................................................................28
Target Speed............................................................................................................................................28
Acceleration ..............................................................................................................................................28
Deceleration..............................................................................................................................................29
Motor Drive Configuration.............................................................................................................................29
Winding Resistance ..................................................................................................................................29
PWM Frequency .......................................................................................................................................29
Fixed Rise Time........................................................................................................................................29
Drive Current.............................................................................................................................................30
Holding Current.........................................................................................................................................30
Control Mode ............................................................................................................................................30
Decay Mode..............................................................................................................................................31
Step Mode.................................................................................................................................................31
Off Blanking Time .....................................................................................................................................31

4November 4, 2009
Appendix B: Schematics................................................................................................................................33
Appendix C: PCB Component Locations.....................................................................................................39
Appendix D: Bill of Materials (BOM) .............................................................................................................41

Stellaris® Stepper Motor RDK User’s Manual
November 4, 2009 5
List of Tables
Table 1-1. RDK Motor Specifications .............................................................................................................11
Table 2-1. Description of GUI Main Window Controls....................................................................................16
Table 2-2. Description of Configuration Controls............................................................................................19
Table 3-1. Current Monitoring Circuits............................................................................................................23
Table A-1. Parameter Configuration Summary...............................................................................................27

6November 4, 2009

Stellaris® Stepper Motor RDK User’s Manual
November 4, 2009 7
List of Figures
Figure 1-1. Stepper Motor................................................................................................................................10
Figure 1-2. Stepper Speed-Torque Curve.......................................................................................................11
Figure 2-1. On-board User Interface................................................................................................................13
Figure 2-2. Stepper Main GUI Window............................................................................................................15
Figure 2-3. Configuration Window ..................................................................................................................19
Figure 3-1. Stepper Motor Control RDK Layout...............................................................................................21
Figure 3-2. Block Diagram...............................................................................................................................22
Figure 3-3. Chopper Waveform Generation ....................................................................................................25
Figure 3-4. Current Control Software Flow......................................................................................................25

8November 4, 2009

November 4, 2009 9
Stellaris® Stepper Motor Reference Design Kit
Overview
Stellaris Reference Design Kits (RDKs) from Texas Instruments accelerate product development
by providing ready-to-run hardware, a typical motor, and comprehensive documentation including
hardware design files. Designers without prior motor control experience can successfully
implement a sophisticated motor control system using the Stepper Motor Control RDK (Stepper
RDK).
Using the RDK
The recommended steps for using the RDK are:
Follow the Quickstart Guide included in the kit.
The Quickstart guide will help you get the motor up and running in minutes. It also contains
important safety information that should be read before using the RDK.
Use the RDK GUI software to evaluate and optimize motor performance.
The RDK GUI gives real-time access to more than a dozen operating parameters. Parameters
and data transfer between the RDK control board and PC over a USB cable.
Customize and integrate the hardware and software to suit an end application.
This User's Manual and the Software Reference Manual are two important references for
completing your project. Software can be programmed in the motor control board using either
the RDK GUI software or using a JTAG debug interface (available from leading development
tools vendors).
Features
The Stepper RDK's primary application is driving NEMA17, NEMA23, and NEMA34 stepper
motors rated at up to 80 V at 3 Amps. The Stepper RDK uses software-based chopper control in
order to operate the motor at both high torque and high-step rates. The Stepper RDK has the
following features:
Advanced chopper control of bipolar stepper motors
Flexible platform accelerates integration process
Fast and slow decay modes
Full-Step, Half-Step, Micro-Step, and Wave modes
High step rates up to 10,000 steps/sec (with suitable motor)
Programmable holding current
Integrated USB Virtual COM port
Bootloader for firmware upgrades over serial port
Support for external debugger through standard 20-pin ARM header
CHAPTER 1

Stellaris® Stepper Motor Reference Design Kit Overview
10 November 4, 2009
Motor Technology
Introduction to Stepper Motors
Stepper motors are synchronous DC motors which rotate in precise increments as their coils are
energized. Stepper motors typically have step angles of 0.9°, 1.8°, 7.5°, or 15°. The motor in the
RDK has a step angle of 1.8° for a total of 200 steps per revolution. Figure 1-1 shows a detailed
photo of the NEMA23 stepper motor included in the RDK.
There are several different families of steppers motors, some with and some without permanent
magnets (PM). The most common type in industrial applications is known as a hybrid stepper
motor because it combines attributes from PM and non-PM motor construction.
Figure 1-1. Stepper Motor
The rotor on a hybrid stepper motor typically has 200 teeth made from a suitable magnetic
material and surrounding one or more powerful embedded magnets. As the stator phase is
energized, the opposing pole in the next rotor tooth is attracted, resulting in a single-step.
Note that the torque curve of stepper motors is far from linear (see Figure 1-2). For each step, the
motor develops peak torque when the rotor teeth are offset by one-quarter tooth pitch from the
opposing pole in the energized phase. Also, overall motor torque drops considerably as motor
speed increases. For this reason stepper motor torque is specified as the holding torque, or torque
with no angular motion.
Stator coils
Stator teeth 50 rotor teeth
on each pole
South pole
North pole
Double-stack motor has
2 sets of magnets
Front bearing
Shaft

Stellaris® Stepper Motor RDK User’s Manual
November 4, 2009 11
Figure 1-2. Stepper Speed-Torque Curve
The Stepper RDK operates bipolar stepper motors with two coils—probably the most common
class of stepper motor. Bipolar refers to the fact that the stepping sequence requires coil current to
flow in alternating directions. By comparison, unipolar motors require current in only one direction
and are simpler to drive, but have much lower torque for the same frame size.
Stepper motors are designed for accurate open-loop positioning, and not for high efficiency. As a
result, stepper motors operate at high temperatures. Current to the motor should be adjusted so
that the motor case temperature never exceeds 100°C.
Chopper Control
A stepper motor can be operated at its rated DC voltage, but only low step rates are possible. This
is because the current builds comparatively slowly in the stator coil.
To overcome this, chopper control uses a supply voltage much higher than the motor's rating. This
allows the coil current to increase rapidly to the desired level before the control starts modulating
or chopping the voltage to maintain that level. This allows higher step rates with more torque. A
supply of 5-20 times the motor’s DC voltage is commonly used.
Table 1-1. RDK Motor Specifications
Motor Frame Size NEMA23
Holding Torque 166 oz-in (1.29 Nm)
Rated Current 2.8 A/phase
Coil Resistance 0.75Ω
Step Angle 1.8°

Stellaris® Stepper Motor Reference Design Kit Overview
12 November 4, 2009
RDK Specifications
This reference design meets the following specifications.
Electrical
Supported motor type: Bipolar stepper
Motor current (rated current per coil): 3 Amps
Motor voltage (continuous coil voltage): 1-80 Vdc
Supply Voltage: 9-80 Vdc
Mechanical
PCB size: 4.6" x 2.8" x 0.75” (117 mm x 71 mm x 19 mm)
No heat sink necessary

November 4, 2009 13
User Interfaces
The Stepper RDK firmware provides control of the stepper motor. It makes use of many of the
features of the Stellaris microcontroller to perform the stepping function, reducing the number of
external parts needed. In addition, the stepping firmware can be integrated with the user’s
application, eliminating the need for separate microcontrollers for the stepping and application
functions.
The Stepper RDK firmware generates a stepping sequence as needed to run the motor at the
specified speed. It also computes acceleration and deceleration ramps to smoothly change the
motor speed between stopped and target speed. It switches voltage to the control signals of the
H-bridge in order to drive the correct current to the motor windings at each step in a stepping
sequence.
The Stepper RDK firmware can be controlled in two ways. The simplest way is using the on-board
interface, which allows the user control of the motor speed or position using controls available on
the RDK board. For more complex control, a PC-hosted graphical program is available which not
only allows setting of speed and position, but also a number of other parameters for tuning the
motor operation (see “Graphical User Interface” on page 15).
On-board User Interface
The on-board user interface provides a way for the user to operate the stepper motor using just the
controls provided on the stepper RDK board. The controls that can be used are a potentiometer, a
push button, and two LEDs. See Figure 2-1 for a photo of the on-board controls.
Figure 2-1. On-board User Interface
J T AG/SWD
Connector
PotentiometerUser Button
Mode LED
S
tatus LED
P
ower LED
Reset Button
CHAPTER 2

User Interfaces
14 November 4, 2009
The on-board user interface can operate in two modes: Speed mode and Position mode. In Speed
mode, the motor runs continuously at a speed and direction that can be controlled by the user. In
Position mode, the motor runs to a position controlled by the user. The starting mode is Speed
mode.
The following on-board controls are available:
Reset button: Restarts the stepper RDK software. The software enters Speed mode.
User button: Switches between on-board UI modes, and starts and stops the motor. To change
modes, hold down the user button for five seconds. To start and stop the motor, press and
release the button. If a fault occurs (the status LED is blinking rapidly), press and hold the user
button for five seconds to clear the fault. Doing this will not change modes.
Potentiometer knob: The potentiometer is used to adjust the speed of the motor when Speed
mode is used, and is used to adjust the position of the motor when Position mode is used.
Mode LED: Informs the user which mode is selected by blinking a pattern.
Status LED: Indicates the motor speed by blink rate. Also indicates a fault with rapid blinking.
Speed Mode
Upon entering Speed mode, the mode LED blinks one time. This is the default when the board is
first powered, or after the reset button is pressed. To enter Speed mode from Position mode, press
and hold the user button for five seconds, until the mode LED blinks one time.
In Speed mode, the motor runs at a speed that is controlled by the position of the potentiometer
knob. Upon entering Speed mode, the motor is stopped. To start the motor running, press the user
button. The motor begins running in the forward direction. Forward is designated as clockwise.
Use the user button to start and stop the motor. Each time the button is pressed, the motor either
starts running if it is stopped, or stops if it is already running. Each time the motor starts running, it
runs in the opposite direction from the previous time.
The potentiometer knob is used to change the motor speed. The motor runs at a minimum speed
of 10 steps/second when the knob is turned all the way to the left (counterclockwise), and at a
maximum of about 1000 steps/second when the knob is turned all the way to the right (clockwise).
The status LED blinks at a rate that varies according to the motor speed.
Caution – Do not leave the motor running for long periods of time. If the motor is not attached to
a heat sink, the case can get very hot, especially if a high drive current is used.
Position Mode
Upon entering Position mode, the mode LED blinks twice. To enter Position mode from Speed
mode, press and hold the user button for five seconds, until the mode LED blinks two times.
In Position mode, the motor always runs to a position that is determined by the position of the
potentiometer. When the potentiometer is moved, the motor moves to the new position. The input
from the potentiometer is scaled so that the motor turns one revolution (at 200 steps/revolution) as
the knob is turned from one extreme to the other. The motor turns in the same direction as the
potentiometer knob.
In Position mode, the motor is enabled by default and turns as soon as the knob is turned. If the
button is pressed, then the motor is disabled and does not run when the knob is turned. The motor
can be re-enabled by pressing the user button again.

Stellaris® Stepper Motor RDK User’s Manual
November 4, 2009 15
Graphical User Interface
The stepper motor RDK board can be controlled from a graphical user interface (GUI) program
running on a PC. Using the GUI provides much greater control of the motor than the on-board
interface. Use the GUI to set specific values for position, speed, acceleration, and deceleration, as
well as a number of other parameters to tune the operation of the motor. The GUI program
communicates with the RDK board using a virtual serial port over a USB cable.
Upon starting the GUI program, the on-board interface on the RDK board is disabled, and the knob
and button have no effect.
If the program has not been used before, then a dialog box appears that lets the user select the
COM port to use. Once a COM port is selected, the program remembers the selection and does
not ask again. However, at any time the user can re-open the COM port dialog box by
double-clicking on the COM port indicator on the main panel.
The stepper motor operation is controlled from the main window (see Figure 2-2). The main
window provides user controls for controlling the motor, as well as several indicators to provide
status of the motor operation. Most parameters can only be modified when the motor is stopped,
and are not selectable while the motor is running. Table 2-1 describes the controls in detail.
Figure 2-2. Stepper Main GUI Window
1
2
3
7
6
8
4
5

User Interfaces
16 November 4, 2009
Table 2-1. Description of GUI Main Window Controls
Item No. Name Description
1Speed and Status Area
Target Sets the motor running speed in steps per second. The desired speed
can be typed into the box. If the motor is already running, it changes
speed to match.
Actual Indicates the actual motor running speed in steps per second. This
value is calculated in the RDK firmware, it is not actually an
independent measurement of motor speed.
Status Indicates if the motor is stopped, running, accelerating, or
decelerating.
2Drive Settings Area
Drive Current Sets the value of the current that the motor control function should try
to maintain in the motor winding when the winding is on during the
step sequence.
Accel Sets the rate at which the motor accelerates to the running speed, in
steps/second2. The desired acceleration can be typed into the box.
The new value is used the next time the motor needs to accelerate.
Decel Sets the rate at which the motor decelerates from speed to stopped,
in steps/second2. The desired deceleration can be typed into the box.
The new value is used the next time the motor needs to decelerate.
3Position Area
Target Sets the position of the motor, in steps. The motor position can be set
in two ways: first, by entering a value in the Target Position box; or by
clicking on the position slider and dragging it right or left to the desired
position, and then releasing it. The position control is not available
until the motor has been enabled using the Run button.
Actual Shows the position of the motor, in steps. The position is shown both
in the Actual box, and also on the slider control. There is an indicator
on the upper slider that moves to show the actual motor position.
4Graph Area
Speed Graph This strip chart shows the speed of the motor over time. The entire
graph shows 30 seconds of motor speed history. The graph is signed,
showing the direction as well as the speed of the motor.
Current Graph This strip chart shows the current in the motor windings over time.
The entire graph shows 30 seconds of winding current history. This
graph shows the peak current in the windings, averaged between the
two windings. The current data is only available when Chopper mode
is used. If PWM mode is used, then this strip chart is grayed out.
5Position Slider
Control Move the slider to adjust the motor’s position. The bottom part of the
slider can be dragged with the mouse to set the target position. The
upper part of the slider indicates the actual position.

Stellaris® Stepper Motor RDK User’s Manual
November 4, 2009 17
6GUI Main Window Buttons
Run button Enables the stepper motor for running. The stepper motor must be
enabled before it can be used. The motor does not move immediately
when the Run button is pressed. It only moves after the position
control is used to set a new position.
Stop button Stops the motor. If the motor is running, the motor decelerates to a
stop. Once the Stop button has been clicked, the Run button must be
clicked before the motor will operate again.
Configure button Opens the Configuration window. The Configuration window is
described in more detail in “Configuration Window” on page 18.
7Statistics Area
DC Bus Voltage Shows the voltage supplied to the motor, as measured by the
microcontroller.
Motor Current Shows the peak current of the two windings, averaged together. This
value is sampled when the windings are switched on. The current
during the time when the windings are switched off is not measured,
and that is not reflected in the measurement. The motor current is not
available if PWM mode is used, and the current indicator will be
grayed out.
Processor Usage Indicates the microcontroller CPU load by percentage. Useful for
estimating the loading of different applications and motor control
algorithms.
Temperature Indicates the internal temperature sensor of the microcontroller.
8Special Indicator Area
COM Port Displays the COM port number, and status. If the indicator is shown in
black, and displays a number for the COM port, then the serial port is
opened. If the indicator is shown in red, and displays Err, then no
COM port is opened. The COM port selection dialog box can be
opened by double clicking on the COM port indicator.
Target Displays the status of the target connection. If the Target is shown in
black, and indicates Stepper, then the program is communicating with
the RDK via the USB/serial port. If the indicator is shown in red, then
there was a problem communicating with the target. Communication
with the target can be restarted by double-clicking on the Target
indicator.
Fault Indicates that an overcurrent fault has occurred. Otherwise, the
control is not visible. To clear the fault condition, double-click on the
Fault indicator.
Table 2-1. Description of GUI Main Window Controls (Continued)
Item No. Name Description

User Interfaces
18 November 4, 2009
File Menu
The File menu can be used to help manage the parameters. The following menu items are
available:
Load Parameters from Flash: The adjustable parameters that control the motor operation
may be stored in flash memory in the RDK microcontroller. This menu choice commands the
target to copy the parameters that were found in flash, into the active memory. The parameters
are only loaded from flash if the motor is not running. If the parameters are loaded from flash,
then the values shown on the main and configuration windows change to reflect the new
parameter values.
Save Parameters to Flash: Saves the adjustable motor parameters to the RDK
microcontroller's flash memory. The parameters are only saved when the motor is not running.
If a valid set of parameters have been saved to flash, those are loaded whenever the target is
powered or reset.
Load Parameters from File: The adjustable motor parameters can be loaded from a file that
was previously saved. This menu choice reads the parameters from the file (if available) and
sends them to the target. The parameters are only be loaded if the motor is stopped.
Save Parameters to File: The adjustable motor parameters can be saved to a file. Selecting
this menu choice causes all of the parameters to be read from the RDK board, and stored to a
file. The parameters can only be stored to a file if the motor is not running.
Update Firmware: This menu choice can be used to load new firmware onto the RDK target
board. A file chooser dialog box opens to allow the user to select the firmware binary file to
load to the target. This menu choice can only be used if the motor is not running. Once a file is
chosen, the new firmware file is sent to the RDK, the RDK updates the flash with the new
program, and then restarts.
NOTE: To restore the default parameters that came with your kit, from the File menu, select Load
Parameters from File and load the nema23_default.ini parameter file to the target. Then
select Save Parameters to Flash from the File menu to save the default parameters into
flash memory.
Configuration Window
Use the Configuration window to adjust specific motor parameters. Open the Configuration
window by clicking the Configure button on the main window.
In the Configuration window, change the parameters and click the OK button to send the new
parameters to the target. Click the Cancel button to discard any changes.

Stellaris® Stepper Motor RDK User’s Manual
November 4, 2009 19
Figure 2-3. Configuration Window
Table 2-2. Description of Configuration Controls
Item No. Name Description
1Control Mode
Open-loop PWM In Open-loop PWM control mode, the firmware sets the PWM duty
cycle to a value that corresponds to the desired current. The duty
cycle is calculated based on the winding resistance and the bus
voltage. There is no actual measurement of the winding current. In
PWM mode, the Fixed Rise Time parameter can also be used (see
Fixed Rise Time).
Chopper In Chopper control mode, the microcontroller firmware monitors the
current flowing in the winding, and switches the voltage to the winding
on and off in order to keep the current at the desired value.
Closed-loop PWM In Closed-loop PWM control mode, the firmware sets the PWM duty
cycle based on the measurement of the current flowing in the winding.
If the current is below the desired setting, then the PWM duty cycle
will be set to a large value, and is reduced as the measured current
approaches the desired value.
1
3
24
6
5

User Interfaces
20 November 4, 2009
1
(cont.) Fixed Rise Time This value is used when Open-loop PWM control mode is chosen.
This value controls the amount of time that the winding is left turned
on at the beginning of a step, before PWM is used to control the
current in the winding. This allows the current in the winding to rapidly
rise at the beginning of the step. This value is specified in
microseconds. It should be adjusted with care because if the amount
of time is too long, then the current in the winding may exceed the
rating for the motor.
PWM Frequency This is the frequency used for PWM, when Open-loop or Closed-loop
PWM control mode is chosen.
Chopper Off
Blanking Time This value is used to control how long the chopper leaves the voltage
off, after it turns off the winding when the drive current threshold is
reached. At the end of the blanking time, the winding is turned on
again and the chopper resumes measuring the winding current.
Motor Parameters
2Decay Mode
Slow In Slow Decay mode, during the time that no voltage is applied to the
winding, the low-side switches on the H-bridge are closed. This allows
current to continue to circulate in the winding and decay slowly.
Fast In Fast Decay mode, during the time that no voltage is applied to the
winding, all the switches are open. The current can no longer circulate
and decays quickly.
3Step Mode
Full With full stepping, voltage is always applied to both windings, and a
four-step stepping sequence is used.
Half With half stepping, the voltage is off during part of the stepping
sequence, and an eight half-step stepping sequence is used.
Micro With micro stepping, the whole step is divided into 8 micro-steps. The
current applied to the windings is varied sinusoidally, piecewise at
each micro-step time.
Wave Wave stepping is the same as full stepping, except that voltage is
applied to only one winding at a time.
4 Holding Current This is the amount of current that should be applied to the windings
when the motor is stopped. This increases the holding torque of the
motor. Typically this value should be 0, or a fraction of the drive
current.
5 Winding
Resistance This is the winding resistance of the motor that is used. This value
should be entered by the user if the motor type is changed. This value
is used in order to calculate the correct PWM duty cycle if PWM
control mode is used.
6 Maximum Current Sets a fault current level. If the current rises above this level, the
hardware triggers a fault and places the motor in a safe configuration.
Table 2-2. Description of Configuration Controls (Continued)
Item No. Name Description
Table of contents
Other Texas Instruments Engine manuals