Trinamic TMC5031-EVAL User Manual

EVALUATION FOR ICs EVALUATION BOARD
TRINAMIC Motion Control GmbH & Co. KG Hamburg, Germany
Firmware Version V1.00
TMC5031-EVAL EVALUATION BOARD MANUAL
+ +
+ +
UNIQUE FEATURES:
Evaluation Board for TMC5031 Motor Controller / Driver for Two Phase Stepper Motors Up to 2x 0.7A RMS/ +5.5V… 16V DC USB, RS232, and SPI 2x Ref. Switch Input per Axis
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 2
www.trinamic.com
TABLE OF CONTENTS
1 Features ........................................................................................................................................................................... 3
2 Order Codes ................................................................................................................................................................... 4
3 Hardware ........................................................................................................................................................................ 5
3.1 Mechanical and Electrical Interfacing ............................................................................................................ 5
3.1.1 Size of TM5031-EVAL and Mounting Holes ............................................................................................ 5
3.1.2 Overview of Connectors .............................................................................................................................. 6
3.1.3 Push Buttons: Reference Switches of Motor 2 ..................................................................................... 9
3.1.4 LEDs ................................................................................................................................................................... 9
4 Operational Ratings ................................................................................................................................................... 10
5 Getting Started – How to Connect the Board ................................................................................................... 11
5.1 Installing the Virtual Com Port for USB Interface ................................................................................... 12
6 Evaluation Software .................................................................................................................................................. 13
6.1 Starting the Evaluation Software.................................................................................................................. 13
6.2 Main Dialogues .................................................................................................................................................. 14
6.2.1 The Jog Tab ................................................................................................................................................... 14
6.2.2 The Ramp Generator Tab .......................................................................................................................... 14
6.3 Basic Functions .................................................................................................................................................. 15
6.3.1 Load / Save / Export Settings .................................................................................................................. 15
6.3.2 Options Menu ............................................................................................................................................... 15
6.3.3 Get Firmware Version ................................................................................................................................ 15
6.3.4 Reset to Factory Defaults .......................................................................................................................... 15
6.4 Special Dialogues .............................................................................................................................................. 16
6.4.1 Motor Current Settings Dialogue ............................................................................................................ 16
6.4.2 Ramp Generator Features Dialogue ....................................................................................................... 17
6.4.3 coolStep Dialogue ....................................................................................................................................... 21
6.4.4 Chopper Configuration Dialogue ............................................................................................................ 22
6.4.5 Driver Status Information ......................................................................................................................... 24
6.4.6 Microstep Wave Dialogue ......................................................................................................................... 25
6.4.7 Global Configuration Dialogue ................................................................................................................ 28
6.4.8 All Registers Dialogue ................................................................................................................................ 29
7 Life Support Policy ..................................................................................................................................................... 30
8 Revision History .......................................................................................................................................................... 31
8.1 Firmware Revision ............................................................................................................................................ 31
8.2 Document Revision ........................................................................................................................................... 31
9 References .................................................................................................................................................................... 31
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 3
www.trinamic.com
1 Features
The TMC5031 evaluation board is designed for evaluating all features of the TMC5031 controller/driver IC. The STM32F ARM Cortex-M3 microcontroller is used to control the TMC5031. The FLASH memory of the microcontroller contains a program which configures the controller/driver chip and controls the communication with the PC via the USB interface and the RS232 interface.
MAIN CHARACTERISTICS
Integrated motion controller
- Motion profile calculation in real-time
- On the fly alteration of motor parameters (e.g. position, velocity, acceleration)
Integrated motor driver for two motors
- Up to 256 microsteps per full step
- High-efficient operation, low power dissipation
- Dynamic current control
- stallGuard2 feature for stall detection
- coolStep feature for reduced power consumption and heat dissipation
- spreadCycle chopper or classic chopper
Electrical data
- Motor current: up to 2x 0.7A RMS nominal motor current
- Supply voltage: +5.5V… +16V DC operating voltage
Interfaces
- RS232
- USB (type B)
- Native SPI™ of the TMC5031
- 2x reference switch inputs per axis
- Access to all signals of the TMC5031
Motor type
- Two phase bipolar stepper motors
Safety features
- Overcurrent
- Short to GND
- Undervoltage protection
- Integrated diagnostics
Software
- PC demonstration software allowing access to all registers
- Graphical view of position counter and motor velocity
- Special tools for stallGuard2, coolStep, and chopper adjustments
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 4
www.trinamic.com
TRINAMICS UNIQUE FEATURES
stallGuard2 stallGuard2 is a high-precision sensorless load measurement using the back EMF on the
coils. It can be used for stall detection as well as other uses at loads below those which stall the motor. The stallGuard2 measurement value changes linearly over a wide range of load, velocity, and current settings. At maximum motor load, the value goes to zero or near to zero. This is the most energy-efficient point of operation for the motor.
Load [Nm]
stallGuard2
Initial stallGuard2 (SG) value: 100%
Max. load
stallGuard2 (SG) value: 0 Maximum load reached. Motor close to stall.
Motor stalls
Figure 1.1 stallGuard2 load measurement SG as a function of load
coolStep coolStep is a load-adaptive automatic current scaling based on the load measurement
via stallGuard2 adapting the required current to the load. Energy consumption can be reduced by as much as 75%. coolStep allows substantial energy savings, especially for motors which see varying loads or operate at a high duty cycle. Because a stepper motor application needs to work with a torque reserve of 30% to 50%, even a constant­load application allows significant energy savings because coolStep automatically enables torque reserve when required. Reducing power consumption keeps the system cooler, increases motor life, and allows reducing cost.
0
0,1
0,2
0,3
0,4
0,5
0,6
0,7
0,8
0,9
0 50 100 150 200 250 300 350
Efficiency
Velocity [RPM]
Efficiency with coolStep
Efficiency with 50% torque reserve
Figure 1.2 Energy efficiency example with coolStep
2 Order Codes
Order code
Description
Size of unit [mm3]
TMC5031-EVAL
Evaluation board for TMC5031 two phase motor controller/driver
85 x 55 x 13.5
Table 2.1 Order codes
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 5
www.trinamic.com
3 Hardware
3.1 Mechanical and Electrical Interfacing
3.1.1 Size of TM5031-EVAL and Mounting Holes
The board dimensions are 85mm x 55mm. Maximum component height (above PCB level) without mating connectors is 13.5mm. There are four mounting holes suitable for M3 screws.
85
55
4
4
Figure 3.1 TMC5031-EVAL dimensions
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 6
www.trinamic.com
3.1.2 Overview of Connectors
1
USB
RS232
Power 1
Power 2
Ref. Switches
Motor 1
Motor 2
SPI retrofit option
1
1
1
1
1
Figure 3.2 Connectors of TMC5031-EVAL
CONNECTORS OF TMC5031-EVAL
Label (Key)
Connector type
Mating connector type
Power 1 (X15)
Switchcraft Power Jack header RAPC722X
Switchcraft two-conductor Power Jack, e.g. S760K
Power 2 (X3)
RIA 330-02, 2 pol., 5mm pitch, shrouded header
RIA 349-2, screw type terminal block, pluggable, centerline 5 mm / 0.197 inches, wire entry parallel to plug direction
Motor 1 (X2) Motot 2 (X1)
RIA 182-04, 4 pol., 3.5mm pitch, header
RIA 169-04, screw type terminal block, pluggable, centerline 3.5 mm / 0.138 inches, wire entry parallel to plug direction
Reference switches (X3)
RIA 182-06, 6 pol., 3.5mm pitch, header
RIA 169-06, screw type terminal block, pluggable, centerline 3.5 mm / 0.138 inches, wire entry parallel to plug direction
USB (X11)
Mini USB, type B, 4 pol., female
Mini USB, type B, 4 pol., male
RS232 (X12)
RIA 182-03, 3 pol., 3.5mm pitch, header
RIA 169-03, screw type terminal block, pluggable, centerline 3.5 mm / 0.138 inches, wire entry parallel to plug direction
Table 3.1 Connectors
3.1.2.1 Power Jack Connector (1)
This jack connector fits for commercially available power supply units for e.g. 12V DC.
Pin
Label
Description
1
GND
Power supply and signal ground
2
GND
Power supply and signal ground
3
+UB
Supply voltage: +5.5V… 18V DC
Table 3.2 Power connector 1
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 7
www.trinamic.com
3.1.2.2 RIA Power Connector (2)
Pin
Label
Description
1
GND
Power supply and signal ground
2
+VCC
Operational voltage: +5.518V DC
Table 3.3 Power connector 2
3.1.2.3 Motor Connector Axis 1
Pin
Label
Description
1
O1A1
Motor coil A
2
O1A2
Motor coil A
3
O1B1
Motor coil B
4
O1B2
Motor coil B
Table 3.4 Connector for Step/Dir signals
3.1.2.4 Motor Connector Axis 2
Per default firmware setting, the direction of motor 2 is reversed to compensate for reversed pinning of the motor connector. The following table shows the real pin assignment on the evaluation board without reversing the motor direction.
Pin
Label
Description
1
O2B2
Motor coil B
2
O2B1
Motor coil B
3
O2A2
Motor coil A
4
O2A1
Motor coil A
Table 3.5 Connector for Step/Dir signals
3.1.2.5 USB Connector
Pin
Label
Description
1
+5V
+5V supply from host
2
USB-
Differential USB bus
3
USB+
Differential USB bus
4
GND
System and module ground
Table 3.6 USB connector
3.1.2.6 RS232 Connector
Pin
Label
Description
1
GND
RS232 signal and system ground
2
TXD
Transmitted data line
3
RXD
Received data line
Table 3.7 RS232 connector
3.1.2.7 Reference Switch Connector
Pin
Label
Description
1
GND
System and module ground
2
REF_R1
Right reference switch axis 1
3
REF_L1
Left reference switch axis 1
4
REF_R2
Right reference switch axis 2
5
REF_L2
Left reference switch axis 2
6
+5V
+5V output
Table 3.8 Reference Switch connector
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 8
www.trinamic.com
3.1.2.8 SPI and Interrupts (Measurement Points and Retrofit Option)
The SPI connector is not assembled, but can be retrofitted in case an external microcontroller should be used. Typically, these pins are used for measurements concerning SPI interface and interrupts (INT and PP).
Figure 3.3 Example for SPI connector assembly (header 2x5)
Pin
Label
Description
1
GND
System and module ground
2
GND
System and module ground
3
CLK
CLK input
4
PP
Tristate position compare output for motor 1 of the TMC5031
5
CS
Chip select input of SPI interface
6
INT
Tristate interrupt output based on ramp generator flags 4, 5, 6 & 7.
7
SCK
Serial clock input of SPI interface
8
SPI_MISO
Serial data input
9
DRV_ENN
Enable (not) input for drivers (tie to GND). Switches off all motor outputs (set high for disable).
10
SPI_MOSI
Serial data output
Table 3.9 SPI and interrupt signals for measurements or connection of external device
3.1.2.8.1 Connecting an External Microcontroller
To enable communication via SPI for connecting an external microcontroller, it is necessary to first solder a 0Ω resistor on the board. A 3V3 supply (VCCIO) for the external microcontroller is available.
Solder 0Ω resistor here.
Figure 3.4 Retrofit option: SPI
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 9
www.trinamic.com
3.1.3 Push Buttons: Reference Switches of Motor 2
The TMC5031-EVAL offers two push buttons for the reference switches of motor 2. As long as a button is pushed the related reference switch of motor 2 is active.
Note that the ramp generator features dialogue of the evaluation software includes a switch mode tab which shows the status of switches. The flags can be polled continuously.
REF_L2 REF_R2
Figure 3.5 Push buttons
Label
Description
REF L M2
This button is connected to pin 26 (REF_L2) of the TMC5031.
REF R M2
This button is connected to pin 25 (REF_R2) of the TMC5031.
Table 3.10 Push buttons
3.1.4 LEDs
The TMC5031-EVAL has three LEDs. Two of them indicate the normal operation of the board: the green LED1 glows to show that the +5V supply is available. LED2 flashes constantly to indicate the 16MHz heartbeat of the board. LED3 does not have a specific function and can be used customer specific.
LED2 LED3
LED1
Figure 3.6 LEDs
LEDS OF TMC5031-EVAL
Label
Color
Description
LED1
green
Glows, if +5V is available.
LED2
red
Heartbeat of the module. Flashes constantly per default.
LED3
red
Can be used customer specific.
Table 3.11 LEDs
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 10
www.trinamic.com
4 Operational Ratings
The operational ratings shown below should be used as design values. The maximum power supply current depends on the used motors and the supply voltage.
Do not exceed the maximum values during operation! Otherwise the driver will be damaged!
Symbol
Parameter
Min
Typ
Max
Unit
VCC
Power supply voltage for operation
-0.5
12
18
V
VCCIO
Digital power supply (for external microcontroller)
3.3 V +5V
Output of internal switch regulator
5 5.1
V
I
SUPPLY
Power supply current
0.2… 0.7
1.1
A
T
ENV
Environment temperature at rated current (no forced cooling required)
20°C °C
Table 4.1 General operational ratings of the module
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 11
www.trinamic.com
5 Getting Started – How to Connect the Board
YOU NEED
- Evaluation board with stepper motor (e.g.
QSH4218)
- USB interface or RS232 interface
- Nominal supply voltage +12V DC (+5.5+16V DC)
- TMC50xx-EVAL software and PC
- Cables for interface, motor, and power
PRECAUTIONS
- Do not mix up connections or short-circuit pins.
- Avoid bounding I/O wires with motor wires.
- Do not exceed the maximum power supply of
+18V DC!
- Do not connect or disconnect the motor while
powered!
- START WITH POWER SUPPLY OFF!
1
1
1
1
1
Motor 2 Motor 1
USBRS232
Power 2Power 1 Ref. Switches
SPI, Interrupts
Stepper
Motor
1
Power supply
Pin 1 GND Pin 2 +5V… 16V DC
or use power jack connector
Serial USB
interface
RS232 Pin 1 GND Pin 2 TXD Pin 3 RXD
Figure 5.1 Getting started
STARTING UP
1. USB interface: the evaluation board software TMC50xx-EVAL is designed to guide you through the
installation of a virtual com port for the USB interface. Refer to chapter 5.1 for further information. RS232 interface: connect RS232 interface to interface converter and afterwards to your PC or connect it directly to your PC, if the RS232 interface is provided.
2. Connect one or two motors to the specific connectors.
3. Connect the power supply of module.
4. Turn power ON. The red LED for heartbeat flashes and the green LED for power glows. The motor
is powered but in standstill now. If this does not occur, turn power OFF and check your
connections and power supply!
5. Download and open the file TMC50xx-EVAL. Now you can start examinations. Note: if you are using
the USB interface, the software will do the installation of the virtual comport configuration file now.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 12
www.trinamic.com
5.1 Installing the Virtual Com Port for USB Interface
1. Start the TMC50xx-EVAL.exe application with a double click.
2. First, you will be asked, which module you like to connect. Choose the TMC5031-EVAL.
3. Then, a hint will appear on the screen. If the module is not already connected, plug it, power it
on, and click OK.
4. Now, the software will search and install the configuration file.
Figure 5.3 Install USB driver
5. You will be asked if you really like to install the unknown file. Answer yes to install it.
6. As soon as the installation of the virtual com port is completed, start your tests.
In case this does not work, install the file using the system control of your PC.
Figure 5.2 Hint related to device driver installation
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 13
www.trinamic.com
6 Evaluation Software
The evaluation software TMC50xx-EVAL.exe is intended for customers who design own PCBs with the TMC5031. In order to understand the settings, the TMC5031 datasheet needs to be referenced. The software is designed for adjusting and testing all settings of the TMC5031 by allowing direct register access. Optimized settings can be stored and exported.
6.1 Starting the Evaluation Software
- Download the file TMC50xx-EVAL.exe from our website www.trinamic.com. The software is a PC
application running under Windows XP, Vista, Windows 7, and Windows 8 (Windows 3.x is not supported).
- Double-click the file TMC50xx-EVAL.exe.
- If you are testing just one module type, click Remember me. This way, the software will skip
this part of the program next time.
- Choose your module type.
- Plug the evaluation board, if it is not connected yet.
Figure 6.1 Choose module
- Click Connection to connect your board. Now, you can start your tests.
Figure 6.2 Connect module
Figure 6.3 Jog tab
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 14
www.trinamic.com
6.2 Main Dialogues
The evaluation software offers two main dialogues: the jog dialogue and the ramp generator dialogue on the next tab. Both dialogues offer separate data input fields for motor 1 and motor 2.
6.2.1 The Jog Tab
Use the rotary control switches with the left key or the small wheel of your computer mouse. Thus, velocity and acceleration for each motor can be set and/or changed. Both values increase/decrease according to a logarithmic function.
There are five keys for each motor. The keys with just one arrow are push-buttons. A motor moves as long as one of these is pressed (using the left mouse key). Acceleration and deceleration will always be adequate to your settings (or default settings), which can be read out using the all registers dialogue.
Rotate left constantly
Stop
Rotate left if pressed
Rotate right if pressed
Rotate right constantly
Figure 6.4 Jog tab keys for moving a motor
6.2.2 The Ramp Generator Tab
The design of the ramp generator tab correlates to the jog tab. Ramp generator settings for each motor can be done independently from the other motor. With this, comparisons of different settings are quite easy. The two motors can be driven simultaneously using the buttons for both below the diagram. All values can be calibrated on the fly while a drive is still active.
Figure 6.5 Ramp generator tab
A complete set of ramp generator values can be copied to the input data area of the other motor by clicking the buttons with two arrows. Afterwards the value sets can be adjusted individually for each motor.
Copy to motor 2
Copy to motor 1
Figure 6.6 Copy value set
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 15
www.trinamic.com
6.3 Basic Functions
6.3.1 Load / Save / Export Settings
Module settings can be loaded, saved, and exported. Click File on top menu and choose the desired action. Note that it is not possible to store settings permanently on the board.
Figure 6.7 Load / save / export settings.
6.3.2 Options Menu
There are two special options related to the handling of this software tool:
- If you choose Extra Style, the software surface will be colored differently.
- Remember Module can be set, if you are always working with the same module. If you intend
to test another IC evaluation board, it is necessary to remove the remember module command!
Table 6.1 Options menu
6.3.3 Get Firmware Version
To read out the firmware version, click Help on top menu and afterwards About. Now, the TMC50xx­EVAL software shows the version number and the build-ID.
Figure 6.8 Firmware Version
6.3.4 Reset to Factory Defaults
Each time, the evaluation board is powered off and on again it will be reset to factory defaults.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 16
www.trinamic.com
6.4 Special Dialogues
Click view on top menu or the specific fields on the left side of the main window to open up dialogues for special settings. Note that dcStep and encoder are not provided by the TMC5031.
THE FOLLOWING SPECIAL DIALOGUES ARE PROVIDED:
- Motor current settings
- Ramp generator features
- coolStep
- Chopper
- Motor driver
- Microstep waves
- Global configuration
- All registers
Figure 6.9 View dialogues
6.4.1 Motor Current Settings Dialogue
This dialogue makes the evaluation of the TMC5031 more comfortable. Motor current settings can be tried out by using rotary control switches.
Figure 6.10 Motor current settings
NOTE
Exact values can be read out and changed using the all registers dialogue.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 17
www.trinamic.com
6.4.2 Ramp Generator Features Dialogue
This dialogue offers two tabs: the ramp status tab and the switch mode tab. These tabs correlate with each other.
6.4.2.1 Ramp Status Tab
Ramp status flags can be polled continuously or on demand. This status tab is designed to read out the RAMP_STAT register of the TMC5031 Blue marked flags are set.
If you use the push buttons for the reference switches of motor 2 on the evaluation board, the status can be read out here.
0X35, 0X55: RAMP_STAT RAMP AND REFERENCE SWITCH STATUS REGISTER OF TMC5031
R/W
Bit
Name
Comment
R
13
status_sg
1: Signals an active stallGuard2 input from the coolStep driver, if enabled.
Hint: When polling this flag, stall events may be missed – activate sg_stop to be sure not to miss the stall event.
R+C
12
second_move
1: Signals that the automatic ramp requires moving back in the opposite direction, e.g. due to on-the-fly parameter change (Flag is cleared upon reading)
R
11
t_zerowait_ active
1: Signals, that T_ZEROWAIT is active after a motor stop. During this time, the motor is in standstill.
R
10
vzero
1: Signals, that the actual velocity is 0.
R 9 position_
reached
1: Signals, that the target position is reached. This flag becomes set while X_ACTUAL and X_TARGET match.
R 8 velocity_
reached
1: Signals, that the target velocity is reached. This flag becomes set while V_ACTUAL and VMAX match.
R+C
7
event_pos_ reached
1: Signals, that the target position has been reached (pos_reached becoming active). This bit is ORed to the interrupt output signal. (Flag is cleared upon reading)
R+C
6
event_stop_ sg
1: Signals an active StallGuard2 stop event. (Flag is cleared upon reading) This bit is ORed to the interrupt output signal.
R 5 event_stop_r
Signals an active stop right condition due to stop switch. This bit is ORed to the interrupt output signal.
Figure 6.11 Ramp and reference switch status flags
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 18
www.trinamic.com
0X35, 0X55: RAMP_STAT RAMP AND REFERENCE SWITCH STATUS REGISTER OF TMC5031
R/W
Bit
Name
Comment
4
event_stop_l
1: Signals an active stop left condition due to stop switch. This bit is ORed to the interrupt output signal.
R+C
3
status_latch_r
1: Latch right ready (enable position latching using SWITCH_MODE settings latch_r_active or latch_r_inactive) This bit is ORed to the interrupt output signal. (Flag is cleared upon reading)
2
status_latch_l
1: Latch left ready (enable position latching using SWITCH_MODE settings latch_l_active or latch_l_inactive) This bit is ORed to the interrupt output signal. (Flag is cleared upon reading)
R
1
status_stop_r
Reference switch right status (1=active)
0
status_stop_l
Reference switch left status (1=active)
Table 6.2 RAMP_STAT register
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 19
www.trinamic.com
6.4.2.2 Switch Mode Tab
With this tab, the SW_MODE register of the TMC5031 can be adjusted. Just tick the desired function to set it.
0X34, 0X54: SW_MODE REFERENCE SWITCH AND STALLGUARD2 EVENT CONFIGURATION REGISTER
Bit
Name
Comment
11
en_softstop
0: Hard stop 1: Soft stop
The soft stop mode always uses the deceleration ramp settings DMAX, V1, D1, VSTOP and TZEROWAIT for stopping the motor. A stop occurs when the velocity sign matches the reference switch position (REFL for negative velocities, REFR for positive velocities) and the respective switch stop function is enabled. A hard stop also uses TZEROWAIT before the motor becomes released.
Attention: Do not use soft stop in combination with stallGuard2.
10
sg_stop
1: Enable stop by stallGuard2. Disable to release motor after stop event.
Attention: Do not enable during motor spin-up, wait until the motor velocity exceeds a certain value, where stallGuard2 delivers a stable result.
9 - Reserved, set to 0
8
latch_r_inactive
1: Activates latching of the position to XLATCH upon an inactive going edge on the right reference switch input REFR.
7
latch_r_active
1: Activates latching of the position to XLATCH upon an active going edge on the right reference switch input REFR.
Hint: Activate latch_r_active to detect any spurious stop event by reading status_latch_r.
6
latch_l_inactive
1: Activates latching of the position to XLATCH upon an inactive going edge on the left reference switch input REFL.
5
latch_l_active
1: Activates latching of the position to XLATCH upon an active going edge on the left reference switch input REFL.
Hint: Activate latch_l_active to detect any spurious stop event by reading status_latch_l.
4
swap_lr
1: Swap the left and the right reference switch input
Figure 6.12 SW_MODE register
NOTE
If stallGuard stop is active and the motor stalls, deactivate the stallGuard event before going on with your tests. Otherwise the motor will not rotate. For a further stallGuard test activate the stallGuard event again.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 20
www.trinamic.com
0X34, 0X54: SW_MODE REFERENCE SWITCH AND STALLGUARD2 EVENT CONFIGURATION REGISTER
Bit
Name
Comment
3
pol_stop_r
Sets the polarity of the right reference switch input (0=neg., 1=pos.)
2
pol_stop_l
Sets the polarity of the left reference switch input (0=neg., 1=pos.)
1
stop_r_enable
1: Enables automatic motor stop during active right reference switch input
Hint: The motor restarts in case the stop switch becomes released.
0
stop_l_enable
1: Enables automatic motor stop during active left reference switch input
Hint: The motor restarts in case the stop switch becomes released.
Table 6.3 SW_MODE register
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 21
www.trinamic.com
6.4.3 coolStep Dialogue
This dialogue is designed for adjusting coolStep. The coolStep current is shown in red and the stallGuard2 load in blue. The coolStep current value increases/decreases adequate to the measured load on the axis. Energy savings can be optimized. The input data area fields for the two motors are related to the COOLCONF register of the TMC5031.
Figure 6.13 coolStep dialogue
0X6D, 0X7D: COOLCONF SMART ENERGY CONTROL COOLSTEP AND STALLGUARD2
Bit
Name
Function
Comment
24
sfilt stallGuard2 filter
enable
0
Standard mode, high time resolution for stallGuard2
1
Filtered mode, stallGuard2 signal updated for each four fullsteps only to compensate for motor pole tolerances
22
sgt6
stallGuard2 threshold value
This signed value controls stallGuard2 level for stall output and sets the optimum measurement range for readout. A lower value gives a higher sensitivity. Zero is the starting value working with most motors.
-64 to +63: A higher value makes stallGuard2 less sensitive and requires more torque to indicate a stall.
21
sgt5
20
sgt4
19
sgt3
18
sgt2
17
sgt1
16
sgt0
15
seimin
minimum current for smart current control
0: 1/2 of current setting (IRUN) 1: 1/4 of current setting (IRUN)
14
sedn1
current down step speed
%00: For each 32 stallGuard2 values decrease by one %01: For each 8 stallGuard2 values decrease by one %10: For each 2 stallGuard2 values decrease by one %11: For each stallGuard2 value decrease by one
13
sedn0
11
semax3
stallGuard2 hysteresis value for smart current control
If the stallGuard2 result is equal to or above (SEMIN+SEMAX+1)*32, the motor current becomes decreased to save energy. %0000 … %1111: 0 … 15
10
semax2
9
semax1
8
semax0
6
seup1
current up step width
Current increment steps per measured stallGuard2 value %00 … %11: 1, 2, 4, 8
5
seup0
3
semin3
minimum stallGuard2 value for smart current control and smart current enable
If the stallGuard2 result falls below SEMIN*32, the motor current becomes increased to reduce motor load angle. %0000: smart current control coolStep off %0001 … %1111: 1 … 15
2
semin2
1
semin1
0
semin0
Table 6.4 Abridgement of COOLCONF register
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 22
www.trinamic.com
6.4.4 Chopper Configuration Dialogue
This dialogue has two tabs, one for motor 1 and the other one for motor 2. First, it is necessary to specify the chopper mode: spreadCycle or Classic.
Figure 6.14 Choose chopper mode
spreadCycle (standard mode) and classic chopper (constant off time with fast decay time) have to be configured differently:
- For spreadCycle configuration the hysteresis has to be defined by setting a start value (HSTRT)
and an end value (HEND).
- The classic chopper needs a fast decay time setting (TFD) and a specified offset (OFFSET).
Parameters with more than one bit have value fields; parameters with just one bit can be set by ticking them. Please refer to the chopper configuration register below for detailed information.
Figure 6.15 Chopper configuration dialogue (spreadCycle or classic)
0X6C, 0X7C: CHOPCONF CHOPPER CONFIGURATION
Bit
Name
Function
Comment
30
diss2g
short to GND protection disable
0: Short to GND protection is on 1: Short to GND protection is disabled
23
sync3
SYNC PWM synchronization clock
This register allows synchronization of the chopper for both phases of a two phase motor in order to avoid the occurrence of a beat, especially at low motor velocities. It is automatically switched off above VHIGH. %0000: Chopper sync function chopSync off %0001 … %1111: Synchronization with f
SYNC
= f
CLK
/(sync*64) Hint: Set TOFF to a low value, so that the chopper cycle is ended, before the next sync clock pulse occurs. Set for the double desired chopper frequency for chm=0, for the desired base chopper frequency for chm=1.
22
sync2
21
sync1
20
sync0
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 23
www.trinamic.com
0X6C, 0X7C: CHOPCONF CHOPPER CONFIGURATION
Bit
Name
Function
Comment
19
vhighchm
high velocity chopper mode
This bit enables switching to chm=1 and fd=0, when VHIGH is exceeded. This way, a higher velocity can be achieved. Can be combined with vhighfs=1. If set, the TOFF setting automatically becomes doubled during high velocity operation in order to avoid doubling of the chopper frequency.
18
vhighfs
high velocity fullstep selection
This bit enables switching to fullstep, when VHIGH is exceeded. Switching takes place only at 45° position. The fullstep target current uses the current value from the microstep table at the 45° position.
17
vsense
sense resistor voltage based current scaling
0: Low sensitivity, high sense resistor voltage 1: High sensitivity, low sense resistor voltage
16
tbl1
TBL blank time select
%00 … %11: Set comparator blank time to 16, 24, 36 or 54 clocks Hint: %10 is recommended for most applications
15
tbl0
14
chm
chopper mode
0
Standard mode (spreadCycle)
1
Constant off time with fast decay time. Fast decay time is also terminated when the negative nominal current is reached. Fast decay is after on time.
13
rndtf
random TOFF time
0
Chopper off time is fixed as set by TOFF
1
Random mode, TOFF is random modulated by
d
NCLK
= -12 … +3 clocks.
12
disfdcc
fast decay mode
chm=1: disfdcc=1 disables current comparator usage for termi­nation of the fast decay cycle
11
fd3
TFD [3]
chm=1: MSB of fast decay time setting TFD
10
hend3
HEND
hysteresis low value OFFSET sine wave offset
chm=0
%0000 … %1111: Hysteresis is -3, -2, -1, 0, 1, …, 12 (1/512 of this setting adds to current setting) This is the hysteresis value which becomes used for the hysteresis chopper.
9
hend2
8
hend1
7
hend0 chm=1
%0000 … %1111: Offset is -3, -2, -1, 0, 1, …, 12 This is the sine wave offset and 1/512 of the value becomes added to the absolute value of each sine wave entry.
6
hstrt2
HSTRT
hysteresis start value added to HEND
chm=0
%000 … %111: Add 1, 2, …, 8 to hysteresis low value HEND
(1/512 of this setting adds to current setting) Attention: Effective HEND+HSTRT ≤ 16. Hint: Hysteresis decrement is done each 16 clocks
5
hstrt1
4
hstrt0
TFD [2..0]
fast decay time setting
chm=1
Fast decay time setting (MSB: fd3): %0000 … %1111: Fast decay time setting TFD with NCLK= 32*HSTRT (%0000: slow decay only)
3
toff3
TOFF off time
and driver enable
Off time setting controls duration of slow decay phase NCLK= 12 + 32*TOFF %0000: Driver disable, all bridges off %0001: 1 – use only with TBL ≥ 2 %0010 … %1111: 2 … 15
2
toff2
1
toff1
0
toff0
Table 6.5 Abridgement of CHOPCONF register
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 24
www.trinamic.com
6.4.5 Driver Status Information
This dialogue shows all driver error flags of the two motor drivers. The flags are related to the DRV_STATUS register. Blue marked flags are set.
0X6F, 0X7F: DRV_STATUS STALLGUARD2 VALUE AND DRIVER ERROR FLAGS
Bit
Name
Function
Comment
31
stst
standstill indicator
This flag indicates motor stand still.
30
olb
open load indicator phase B
1: Open load detected on phase A or B Hint: This is just an informative flag. The driver takes no action upon it. False detection may occur in fast motion and standstill. Check during slow motion, only.
29
ola
open load indicator phase A
28
s2gb
short to ground indicator phase B
1: Short to GND detected on phase A or B The driver becomes disabled. The flags stay active, until the driver is disabled by software or by the ENN input.
27
s2ga
short to ground indicator phase A
26
otpw
overtemperature pre­warning flag
1: Overtemperature pre-warning threshold is exceeded. The overtemperature pre-warning flag is common for both drivers.
25
ot
overtemperature flag
1: Overtemperature limit has been reached. Drivers become disabled until otpw is also cleared due to cooling down of the IC. The overtemperature flag is common for both drivers.
15
fsactive
full step active indicator
1: Indicates that the driver has switched to fullstep as defined by chopper mode settings and velocity thresholds.
Table 6.6 Abridgement of DRV_STATUS register
Figure 6.16 Motor driver error flags
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 25
www.trinamic.com
6.4.6 Microstep Wave Dialogue
The microstep wave dialogue has two tabs, one for motor 1 and the other one for motor 2. Each motor driver of the TMC5031 provides a programmable look-up table for storing the microstep current wave. Per default, the tables are pre-programmed with a sine wave, which is a good starting point for most stepper motors. Reprogramming the table to a motor specific wave allows improved microstepping. In order to minimize required memory and the amount of data to be programmed, only a quarter of the wave becomes stored. The internal microstep table maps the microstep wave from 0° to 90°. It becomes symmetrically extended to 360°.
The microstep wave dialogue for each motor has four input fields (a1, a3, a5, and a7) for amplitude settings. These values are used for the microstep wave calculation. All amplitude values normally should meet the condition a1 ›› a3 ›› a5 ›› a7 within the range 0.00… 1.00. The microstep wave calculation is done via Fourier synthesis.
Please refer to the MOTOR DRIVER REGISTER of the TMC5031 datasheet.
Figure 6.17 Microstep wave dialogue with sin wave (default setting)
The formula in the expression evaluator can be changed to optimize motor performance. Have a look at the following examples, please.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 26
www.trinamic.com
EXAMPLE 1: TRIANGULAR MICROSTEP CURVE
For a triangular curve, enter the following formula into the expression evaluator:



Figure 6.18 Triangular curve
EXAMPLE 2: MICROSTEP WAVE WITH LINEAR SCALED SINE WAVE AMPLITUDE
For a wave with linear scaled sine wave amplitude the following formula may fit:
󰇧󰇡


󰇢    󰇡 󰇡


󰇢 󰇢󰇨
Figure 6.19 Example for microstep wave with linear scaled sine wave amplitude
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 27
www.trinamic.com
MOTOR DRIVER REGISTER SET (MOTOR 1: 0X60…0X6F, MOTOR 2: 0X70…0X7F)
R/W
Addr
n
Register
Description / bit names
Range [Unit]
W
0x60 0x70
32
MSLUT1[0] MSLUT2[0]
microstep table entries 0…31
Each bit gives the difference between microstep x and x+1 when combined with the corresponding MSLUTSEL W bits: 0: W= %00: -1 %01: +0 %10: +1 %11: +2 1: W= %00: +0 %01: +1 %10: +2 %11: +3 This is the differential coding for the first quarter of a wave. Start values for CUR_A and
CUR_B are stored for MSCNT position 0 in START_SIN and START_SIN90_120. ofs31, ofs30, …, ofs01, ofs00
ofs255, ofs254, …, ofs225, ofs224
32x 0 or 1
reset default= sine wave table
W
0x61
0x67 0x71
0x77
7 x
32
MSLUT1[1...7] MSLUT2[1...7]
microstep table entries 32…255
7x 32x 0 or 1
reset default= sine wave table
W
0x68 0x78
32
MSLUTSEL1 MSLUTSEL2
This register defines four segments within each quarter MSLUT wave. Four 2 bit entries determine the meaning of a 0 and a 1 bit in the corresponding segment of MSLUT.
See separate table in TMC5031 datasheet.
0<X1<X2<X3 reset default= sine wave table
W
0x69 0x79
8 + 8 MSLUTSTART
bit 7… 0: START_SIN bit 23… 16: START_SIN90_120
START_SIN gives the absolute current at microstep table entry 0. START_SIN90_120 gives the absolute current for microstep table entry at positions 256.
Start values are transferred to the microstep registers CUR_A and CUR_B, whenever the reference position MSCNT=0 is passed.
START_SIN reset default =0
START_SIN90_1 20 reset default =247
Table 6.7 Abridgement of motor driver register set
Please refer to the TMC5031 datasheet for detailed information about microstep table registers.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 28
www.trinamic.com
6.4.7 Global Configuration Dialogue
This dialogue shows global status flags on the front tab and global settings on the rear tab. These flags and settings are related to the GENERAL CONFIGURATION REGISTERS of the TMC5031. Flags can be pulled continuously or on demand. Blue marked flags are set.
Note that the direction of motor 2 is reversed per default. This way, both motors rotate in the same direction. In hardware, motor 2 is connected mirror-inverted.
Figure 6.20 Global status tab and global settings tab
GENERAL CONFIGURATION REGISTERS (0X00…0X1F)
R/W
Addr
n
Register
Description / bit names
RW
0x00
11
GCONF
Bit
GCONF – Global configuration flags
3
poscmp_enable 0: Outputs INT and PP are tristated. 1: Position compare pulse (PP) and interrupt output
(INT) are available
Attention: do not leave the ouputs floating in tristate condition, provide an external pull-up or set this bit 1.
8
shaft1
1: Inverse motor 1 direction
9
shaft2
1: Inverse motor 2 direction
10
lock_gconf 1: GCONF is locked against further write access.
R+C
0x01
4
GSTAT
Bit
GSTAT Global status flags
0
reset
1: Indicates that the IC has been reset since the last
read access to GSTAT.
1
drv_err1 1: Indicates, that driver 1 has been shut down due
to an error since the last read access.
2
drv_err2 1: Indicates, that driver 2 has been shut down due
to an error since the last read access.
3
uv_cp 1: Indicates an undervoltage on the charge pump.
The driver is disabled in this case.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 29
www.trinamic.com
GENERAL CONFIGURATION REGISTERS (0X00…0X1F)
R/W
Addr
n
Register
Description / bit names
W
0x05
32
X_COMPARE
Position comparison register for motor 1 position strobe. Activate poscmp_enable to get position pulse on output PP.
XACTUAL = X_COMPARE:
- Output PP becomes high. It returns to a low state, if
the positions mismatch.
Table 6.8 Abridgement of general configuration registers
6.4.8 All Registers Dialogue
This dialogue shows all registers, which can be set and/or read out with the TMC50xx-EVAL software tool. Addresses, register names and actual values can be read. New values can be written in the specific data input fields. To copy an actual value into a new value field just double-click the actual value. New values can be changed on the fly while the motor is still rotating.
Figure 6.21 All registers dialogue
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 30
www.trinamic.com
7 Life Support Policy
TRINAMIC Motion Control GmbH & Co. KG does not authorize or warrant any of its products for use in life support systems, without the specific written consent of TRINAMIC Motion Control GmbH & Co. KG.
Life support systems are equipment intended to support or sustain life, and whose failure to perform, when properly used in accordance with instructions provided, can be reasonably expected to result in personal injury or death.
© TRINAMIC Motion Control GmbH & Co. KG 2013
Information given in this data sheet is believed to be accurate and reliable. However neither responsibility is assumed for the consequences of its use nor for any infringement of patents or other rights of third parties, which may result from its use.
Specifications are subject to change without notice.
All trademarks used are property of their respective owners.
TMC5031-EVAL Manual / Firmware V1.00 (Rev. 1.01 / 2013-MAR-26) 31
www.trinamic.com
8 Revision History
8.1 Firmware Revision
Version
Date
Author
Description
1.0
2013-JAN-23
OK, MJ
Initial version
Table 8.1: Firmware revision
8.2 Document Revision
Version
Date
Author
SD Sonja Dwersteg
Description
1.00
2013-FEB-22
SD
Initial version
1.01
2013-MAR-26
SD
- Information about the installation of a virtual com
port for USB interface updated (chapter 5 and chapter 5.1).
- Photo of the module new.
Table 8.2 Document revision
9 References
[TMC5031] TMC5031 Datasheet (please refer to http://www.trinamic.com)
Loading...