Part Number Hot Search : 
CY7C4255 554FBX AD679AD MUR16 ZS310L AP450BN C143ZC NMH4812D
Product Description
Full Text Search
 

To Download TMC4331A Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  motion controller for stepper motors integrated circuits ? short spec ? tmc4331 a datasheet tmc4331 a document revision 1 .0 0 ? 2016 - nov - 1 0 s hort spec the s - ramp and sixpoint? ramp motion controller for stepper motors is opt imized for high velocities , allowing on - the - fly changes. tmc4331 a offers spi and step/dir interfaces . features ? spi interfaces for c with easy - to - use protocol . ? spi interfaces for spi motor stepper drivers . ? integrated chopsync? and dcstep? support . ? internal ramp generator generating s - shaped ramps or sixpoint? ramps supporting on - the - fly changes . ? c ontrolled pwm output . ? reference switch handling . ? hardware and v irtual stop switches . ? extensive support of tmc stepper motor drivers . ? electronic gearing support. applications ? textile, sewing machines ? cctv, security ? printers, scanners ? atm, cash recycler ? office automation ? pos ? factory automation ? lab automation ? pumps and valves ? heliostat controller s ? cnc machines ? robotics block diagram: tmc4331 a interfaces & features figure 2 : block diagram ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entire documentati on; especially the supplemental directives in c hapter 18 ( p age 172 ). figure 1 : sample image tmc4331 a *marking details are explained on page 171 . t m c 4 3 3 1 s p i t o m a s t e r s t a t u s f l a g s i n t e r r u p t c o n t r o l l e r r e f . s w i t c h p r o c e s s i n g d r i v e r i n t e r f a c e : s p i / s t e p / d i r r e f . s w i t c h e s s - r a m p g e n e r a t o r i n c l . t r a p e z o i d , r e c t a n g l e , 4 b o w s s p i s t e p / d i r t i m e r u n i t p o w e r - o n r e s e t s t e p s e q u e n c e r c u r r e n t r e g u l a t i o n d c s t e p s t a r t s p i t o c i n t r / t r t o c c l k
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 2 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? short spec ? functional scope of tmc4331 a tmc4331 a is a miniaturized high - performance motion controller for stepper motor drivers, particularly designed for fast and jerk - limited motion profile applications wit h a wide range of ramp profiles. the s - shaped or sixpoint? velocity profile, and open - loop features offer many configuration options to suit the users specifications, as presented below: s - shaped ramp profiles are jerk - free. seven ramp segments form the s - shaped ramp that can be optimally adapted to suit the users requireme nts. high torque with high velocities can be reached by calibrating the bows of the ramp, as explained in this user manual . figure 3 : s - shaped velocity profile i more information on ramp configurations and other velocity profile s, e.g. sixpoint? ramps, are provided in chapter 6 (p age 24 ). a typical h ardware setup for open - loop operation with enhanced modifications, by use of external stop switches with the tmc26x motor stepper driver is shown below. home switches with different configurations are also supported . figure 4 : open - loop hardware set - up with tmc26x supporting external stop switches a typical hardware setup for dcstep operation with a tmc2 130 stepper motor driver is shown in the diagram below. this feature is also available for tmc26x stepper motor drivers. figure 5 : hardware set - up for open - loop operation with tmc2130 order codes order code description size tmc4331 a - la motion controller with dcstep features, qfn 32 4 x 4 mm 2 table 1 : tmc4331 a order codes s - shaped velocity profile reference switch support open - loop operation with dcstep? feature v ( t ) t v m a x c s p i s p i t m c 4 3 3 1 m o t i o n c o n t r o l l e r h i g h l e v e l i n t e r f a c e t m c 2 6 x m o t o r d r i v e r m + 5 v s t o p s w i t c h e s s t e p / d i r c t m c 2 1 3 0 m o t o r d r i v e r h i g h l e v e l i n t e r f a c e m t m c 4 3 3 1 m o t i o n c o n t r o l l e r s p i s p i d c s t e p ? s i g n a l s s / d
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 3 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? t a bl e o f c o n t e n t s TMC4331A datasheet ................................ ................................ ................................ .... 1 short spec ................................ ................................ ................................ ..................... 1 features ................................ ................................ ................................ ........................... 1 applications ................................ ................................ ................................ ..................... 1 block diagram: t mc4331a interfaces & features ................................ ........................... 1 functional scope of TMC4331A ................................ ................................ ........................ 2 order codes ................................ ................................ ................................ ..................... 2 table of contents ................................ ................................ ................................ ....... 3 main manual ................................ ................................ ................................ ................. 8 1. pinning and design - in process information ................................ .............................. 8 pin assignment: top view ................................ ................................ ................................ .... 8 pin description ................................ ................................ ................................ .................... 9 system overview ................................ ................................ ................................ ............... 10 2. application circuits ................................ ................................ ................................ .. 11 TMC4331A standard connection: vcc=3.3v ................................ ................................ ....... 11 TMC4331A with tmc26x stepper connection ................................ ................................ ....... 11 TMC4331A with tmc248 stepper driver ................................ ................................ .............. 12 TMC4331A with tmc2130 stepper driver ................................ ................................ ............ 12 3. spi interfacing ................................ ................................ ................................ ........ 13 spi d atagram structure ................................ ................................ ................................ ..... 13 spi timing description ................................ ................................ ................................ ....... 16 4. input filtering ................................ ................................ ................................ .......... 17 input filtering examples ................................ ................................ ................................ ..... 19 5. status flags and events ................................ ................................ ........................... 20 status event description ................................ ................................ ................................ .... 21 spi status bit transfer ................................ ................................ ................................ ....... 22 generation of interrupts ................................ ................................ ................................ ..... 22 connection of multiple intr pins ................................ ................................ ........................ 23 6. ramp configurations for different motion profiles ................................ .................. 24 step/dir output configuration ................................ ................................ ............................ 2 5 step/dir output configuration steps ................................ ................................ ................... 25 stpout: changing polarity ................................ ................................ ............................... 25 altering the internal motion direction ................................ ................................ .................. 26 configuration details for operation modes and motion profiles ................................ ............. 27 starting point: choose operation mode ................................ ................................ ............... 28 stop during motion ................................ ................................ ................................ ............ 28 motion profile configuration ................................ ................................ ............................... 29 no ramp motion profile ................................ ................................ ................................ ...... 30 trapezoidal 4 - point ramp without break point ................................ ................................ ..... 31 trapezoidal ramp with break point ................................ ................................ .................... 31 position mode combined with trapezoidal ramps ................................ ................................ 32
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 4 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? configuration of s - shaped ramps ................................ ................................ ....................... 33 changing ramp parameters during s - shaped motion or switching from velocity to positiong mode 34 configuration of s - shaped ramp with astart and dfinal ................................ .................. 34 s - shaped mode and positioning: fast motion ................................ ................................ ....... 35 start velocity vstart and stop velo city vstop ................................ ................................ .. 36 s - shaped ramps with start and stop velocity ................................ ................................ ...... 40 combined use of vstart and astart for s - shaped ramps ................................ ............... 41 sixpoint ramps ................................ ................................ ................................ .................. 42 u - t urn behavior ................................ ................................ ................................ ................ 43 continuous velocity motion profile for s - shaped ramps ................................ ...................... 44 internal ramp generator units ................................ ................................ ........................... 45 clock frequency ................................ ................................ ................................ ................ 45 velocity value units ................................ ................................ ................................ ........... 45 acceleration value units ................................ ................................ ................................ ..... 45 bow value units ................................ ................................ ................................ ................ 46 overview of minimum and maximum values: ................................ ................................ ....... 46 7. external step control and electronic gearing ................................ .......................... 47 description of electronic gearing ................................ ................................ ........................ 48 indirect external control ................................ ................................ ................................ .... 48 switching from external to internal control ................................ ................................ ......... 49 8. reference switches ................................ ................................ ................................ . 50 hardware switch support ................................ ................................ ................................ ... 51 stop slope configuration for hard or linear stop slopes ................................ ...................... 51 how active stops are indicated and reset to free motion ................................ ..................... 52 how to latch internal p osition on switch events ................................ ................................ .. 52 virtual stop switches ................................ ................................ ................................ ......... 53 enabling virtual stop switches ................................ ................................ ............................ 53 virtual stop slope configuration ................................ ................................ ......................... 53 how active virtual stops are indicated and reset to free motion ................................ ........... 54 home reference configuration ................................ ................................ ........................... 55 home event selection ................................ ................................ ................................ ........ 55 home_ref monitoring ................................ ................................ ................................ ....... 56 homing with stopl or stopr ................................ ................................ ............................ 56 target reached / position comparison ................................ ................................ ................ 57 connecting several target - reached pins ................................ ................................ .............. 57 use of target_reached output ................................ ................................ ...................... 58 position comparison of internal values ................................ ................................ ............... 58 repetitive and circular motion ................................ ................................ ............................ 59 repetitive motion to xtarget ................................ ................................ ............................ 59 activating circular motion ................................ ................................ ................................ ... 59 uneven or noninteger microsteps per revolution ................................ ................................ . 60 release of the revolution counter ................................ ................................ ...................... 61 blocking zones ................................ ................................ ................................ .................. 61 activating blocking zones during circular motion ................................ ................................ . 61 circular motion with and without blocking zone ................................ ................................ ... 62 9. ramp timing and synchronization ................................ ................................ .......... 63 basic synchronization settings ................................ ................................ ............................ 64
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 5 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? start signal trigger selection ................................ ................................ ............................. 64 user - specified impact configuration of timing proce dure ................................ ..................... 64 delay definition between trigger and internally generated start signal ................................ . 65 active start pin output configuration ................................ ................................ ............... 65 ramp timing examples ................................ ................................ ................................ ...... 66 shadow register settings ................................ ................................ ................................ ... 69 shadow register configuration options ................................ ................................ ............... 70 delayed shadow transfer ................................ ................................ ................................ ... 74 pipelining internal parameters ................................ ................................ ............................ 75 configuration and activation of target pipeline ................................ ................................ .... 75 using the pipeline for different internal registers ................................ ................................ . 76 pipeline mapping overview ................................ ................................ ................................ . 77 cyclic pipelining ................................ ................................ ................................ ................. 78 pipeline examples ................................ ................................ ................................ .............. 78 masterless synchronization of several motion controllers via start pin ................................ 80 10. serial data output ................................ ................................ ................................ ... 81 getting started with tmc motor drivers ................................ ................................ .............. 82 sine wave lookup tables ................................ ................................ ................................ ... 83 actual current values output ................................ ................................ ............................. 84 how to program the internal mslut ................................ ................................ ................... 84 setup of mslut segments ................................ ................................ ................................ . 85 current waves start values ................................ ................................ ................................ 86 default mslut ................................ ................................ ................................ .................. 86 explanatory notes for base wave inclinations ................................ ................................ ..... 87 spi output interface configuration parameters ................................ ................................ ... 89 pins dedicated to spi output communication ................................ ................................ ...... 89 setup of spi output timing configura tion ................................ ................................ ........... 89 current diagrams ................................ ................................ ................................ .............. 90 change of microstep resolution ................................ ................................ .......................... 90 cover datagrams communication between c and driver ................................ .................... 90 sending cover datagrams ................................ ................................ ................................ .. 91 configuring automatic generation of cover datagrams ................................ ........................ 92 overview: tmc motor driver connections ................................ ................................ ............ 93 tmc stepper motor driver settings ................................ ................................ ..................... 93 tmc motor driver response datagram and status bits ................................ ......................... 94 events and interrupts based on motor driver status bits ................................ ...................... 94 stall detection and stop - on - stall ................................ ................................ ......................... 95 tmc23x, tmc24x stepper motor driver ................................ ................................ ............... 96 tmc23x setup ................................ ................................ ................................ ................... 96 tmc24x setup ................................ ................................ ................................ ................... 96 tmc23x/24x status bits ................................ ................................ ................................ ..... 97 automatic fullstep switchover for tmc23x/24x ................................ ................................ .... 97 mixed decay configuration for tmc2 3x/24x ................................ ................................ ........ 98 chopsync configuration for tmc23x/24x stepper drivers ................................ ..................... 98 doubling chopsync frequency during standstill ................................ ................................ ... 98 using tmc24x stallguard characteristics ................................ ................................ ............. 99 tmc26x stepper motor driver ................................ ................................ ............................ 100 tmc26x setup (spi mode) ................................ ................................ ............................... 100 tmc26x setup (s/d mode) ................................ ................................ ................................ 100
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 6 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? sending cover datagrams to tmc26x ................................ ................................ ................ 101 automatic continuous streaming of cover datagrams for tmc26x ................................ ....... 101 tmc26x spi mode: automatic fullstep switchover ................................ ............................. 102 tmc26x s/d mode: automatic fullstep switchover ................................ .............................. 102 tmc 26x s/d mode: change of current scaling parameter ................................ .................. 103 tmc26x status bits ................................ ................................ ................................ ........... 103 tmc2 6x status response ................................ ................................ ................................ .. 103 tmc389 stepper motor driver ................................ ................................ ........................... 104 tmc2130 stepper motor driver ................................ ................................ .......................... 105 set - up tmc2130 support (spi mode) ................................ ................................ ................. 105 set - up tmc2130 support (s/d mode) ................................ ................................ ................ 105 sending cover datagrams to tmc2130 ................................ ................................ .............. 106 automatic continuous streaming of cover datagrams for tmc213 0 ................................ ..... 10 6 tmc2130 spi mode: automatic fullstep switchover ................................ ............................ 107 tmc2130 s/d mode: automatic fullstep switchover ................................ ............................ 107 tmc 2130 s/d mode: changing current scaling parameter ................................ .................. 107 tmc2130 status response ................................ ................................ ................................ 108 connecting non - tmc stepper motor driver or spi - dac at spi output interface .................... 109 connecting a spi - dac ................................ ................................ ................................ ....... 110 dac data transfer ................................ ................................ ................................ ............ 110 changing spi output protocol for spi - dac ................................ ................................ ......... 110 dac address values ................................ ................................ ................................ .......... 111 dac data values ................................ ................................ ................................ .............. 111 11. current scaling ................................ ................................ ................................ ...... 113 hold current scaling ................................ ................................ ................................ ......... 114 freewheeling ................................ ................................ ................................ .................... 114 current scaling during motion ................................ ................................ ........................... 115 drive scaling ................................ ................................ ................................ .................... 115 alternative drive scaling ................................ ................................ ................................ ... 115 boost current ................................ ................................ ................................ ................... 116 scale mode transition process control ................................ ................................ ............... 117 current scaling examples ................................ ................................ ................................ .. 119 12. controlled pwm output ................................ ................................ ......................... 121 pwm output generation and scaling possibilities ................................ ................................ 122 pwm scale example ................................ ................................ ................................ .......... 123 pwm output generation for tmc23x/24x ................................ ................................ ........... 124 switching between spi and voltage pwm modes ................................ ................................ 125 13. dcstep support for tmc26x or tmc2130 ................................ ............................... 126 enabling dcstep for tmc26x stepper motor drivers ................................ ............................ 128 setup: minimum dcstep velocity ................................ ................................ ........................ 129 enabling dcstep for tmc2130 stepper motor drivers ................................ .......................... 131 14. reset and clock gating ................................ ................................ .......................... 132 power - on - reset ................................ ................................ ................................ ............... 132 manual software reset ................................ ................................ ................................ ..... 132 reset indication ................................ ................................ ................................ ............... 132 activating clock gating manually ................................ ................................ ....................... 133 clock gating wake - up ................................ ................................ ................................ ....... 133
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 7 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? automatic clock gating procedure ................................ ................................ ..................... 134 technical specifications ................................ ................................ ...................... 135 15. complete register and switches list ................................ ................................ ..... 135 general configuration register general_conf 0x00 ................................ ......................... 135 refe rence switch configuration register reference_conf 0x01 ................................ ....... 138 start switch configuration register start_conf 0x02 ................................ ....................... 141 input filter configuration register input_filt_conf 0x03 ................................ ................ 143 spi output configuration register spi_out_conf 0x04 ................................ ..................... 144 current scaling configuration register current_conf 0x05 ................................ ............. 147 current scale values regis ter scale_values 0x06 ................................ ............................ 148 motor driver settings register step_conf 0x0a ................................ ................................ 148 event selection registers 0x0b..0x0d ................................ ................................ ................ 149 status event register (0x0e) ................................ ................................ ............................. 150 status flag register (0x0f) ................................ ................................ ............................... 151 configuration registers ................................ ................................ ................................ ..... 152 ramp genera tor registers ................................ ................................ ................................ . 154 external clock frequency register ................................ ................................ ..................... 158 target and compare registers ................................ ................................ .......................... 158 pipeline registers ................................ ................................ ................................ ............. 159 shadow register ................................ ................................ ................................ ............... 159 reset and clock gating register ................................ ................................ ........................ 160 dcstep registers ................................ ................................ ................................ ............... 160 transfer registers ................................ ................................ ................................ ............ 161 miscellaneous registers ................................ ................................ ................................ ..... 161 sinlut registers ................................ ................................ ................................ .............. 162 tmc version register ................................ ................................ ................................ ........ 163 16. absolute maximum ratings ................................ ................................ ................... 164 17. electrical characteristics ................................ ................................ ........................ 165 power dissipation ................................ ................................ ................................ ............. 165 general io timing parameters ................................ ................................ ........................... 166 layout examples ................................ ................................ ................................ .............. 167 internal cirucit diagram for layout example ................................ ................................ ....... 167 top layer: assembly side ................................ ................................ ................................ . 168 inner layer (gnd) ................................ ................................ ................................ ............ 168 inner layer (supply vs) ................................ ................................ ................................ .... 169 package dimensions ................................ ................................ ................................ ......... 170 package material information ................................ ................................ ............................ 171 marking details provided on single chip ................................ ................................ ............. 171 appendices ................................ ................................ ................................ ................ 172 18. supplemental directives ................................ ................................ ........................ 172 esd - device instructions ................................ ................................ ................................ ........... 172 19. tables index ................................ ................................ ................................ .......... 174 20. figures index ................................ ................................ ................................ ......... 176 21. revision history ................................ ................................ ................................ ..... 178
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 8 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? m a i n ma n u a l 1. pinning and design - i n process information in this chapter you are provided with a list of all pin names and a functional description of each. pin assignment: top view figure 6 : package outline: pin assignments top view t m c 4 3 3 1 q f n 3 2 4 m m x 4 m m 0 . 4 p i t c h 1 2 3 4 5 6 7 8 2 2 2 3 1 7 1 8 1 9 2 0 2 1 1 6 9 1 0 1 1 1 2 1 3 1 4 1 5 2 8 2 7 2 6 2 5 3 1 3 0 2 9 2 4 3 2 c l k _ e x t g n d v d d 1 v 8 v c c t e s t _ m o d e i n t r t a r g e t _ r e a c h e d s t d b y _ c l k s t o p l h o m e _ r e f g n d v d d 1 v 8 s t o p r s t p i n d i r i n s t a r t s c k d r v s d i d r v v c c g n d s d o d r v s t p o u t _ p w m a d i r o u t _ p w m b n s c s d r v n s c s i n s c k i n v c c g n d s d i i n s d o i n m p 2 m p 1
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 9 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? pin description pin names and descriptions pin number type function supply pins gnd 5, 12 , 19 , 3 0 gnd digital ground pin for ios and digital circuitry . vcc 4, 20 , 3 1 vcc digital power supply for ios and digital circuitry (3.3v 5v) . vdd1v8 13 , 29 vdd connection of internal generated core voltage of 1.8v . clk_ext 32 i clock input to provide a clock with the frequency fclk for all internal operations. test_mode 28 i test mode input. tie to low for normal operation. interface pins for c nscsin 1 i low active chip selects input of spi interface to c . sckin 2 i serial clock for spi interface to c . sdiin 3 i serial data input of spi interface to c . sdoin 6 o serial data output of spi interface to c (z if nscsin=1) . intr 27 o interrupt output, programmable pd/pu for wired - and/or . target_reached 25 o target reached output, programmable pd/pu for wired - and/or . reference pins stopl 9 i (pd) left stop switch. external signal to stop a ramp. if not connected, internal pull - down resistor is active. home_ref 10 i (pd) home reference signal input. external signal for reference search. if not connected, internal pull - down resistor is active. stopr 11 i (pd) right stop switch. external signal to stop a ramp. if not connected, internal pull - down resistor is active. stpin 14 i (pd) step input for external step control. if not connected, internal pull - down resistor is active. dirin 15 i (pd) direction input for external step control. if not connected, internal pull - down resistor is active. start 16 io start signal input/output . s/d output pins stpout pwma daca 18 o step output. first pwm signal (sine). first dac output signal (sine). dirout pwmb dacb 17 o direction output. second pwm signal (cosine). second dac output signal (cosine). ? ? continued on next page !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 10 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? pin names and descriptions pin number type function interface pins for stepper motor drivers nscsdrv pwmb 24 o low active chip selects output of spi interface to motor driver. second pwm signal (cosine) to connect with phb (tmc23x/24x). sckdrv mdbn 23 o serial clock output of spi interface to motor driver. mdbn output signal for mdbn pin of tmc23x/24x. sdodrv pwma 21 io serial data output of spi interface to motor driver. first pwm signal (sine) to connect with pha (tmc23x/24x). sdidrv err 22 i (pd) serial data input of spi interface to motor driver. error input signal to err pin of tmc23x/24x. if not connected, internal pull - down resistor is active. mp1 7 i (pd) dc_in as external dcstep input control signal. if not connected, internal pull - down resistor is active. mp2 8 io dcstep_enable as dcstep output control signal . spe_out as output signal, connect to spe pin of tmc23x/24x. stdby_clk 26 o standby signal or internal clk output or chopsync output. table 2 : pin names and descriptions system overview figure 7 : system overview s p i r e s n s c s i n s c k i n s d i i n s d o i n h o s t c p u s p i i n t e r f a c e r e g i s t e r b l o c k s t o p l s t o p r v s t e p / d i r o u t p u t i d i r o u t s t p o u t n s t d b y _ o u t o i n t r h o m e _ r e f s c a n t e s t i t e s t _ m o d e i s d o d r v s c k d r v s d i d r v n s c s d r v s p i d a t a g r a m g e n e r a t o r c l k - o u t c h o p s y n c c l k s t a r t c l k _ e x t o i i o o o s p i o u t p u t i i i r e f e r e n c e p r o c e s s i n g o o i s t a r t / s t o p / r e f e r e n c e s w i t c h e s r a m p s t a t u s i n t e r n a l p o s i o p o s c o u n t e r p w m u n i t s c a l e u n i t p w m a ( s i n e ) p w m b ( c o s i n e ) p w m o u t p u t g n d ( 4 x ) v d d 5 ( 3 x ) o r o r i o v d d 1 v 8 ( 2 x ) t a r g e t r e g i s t e r ( s ) t i m e r u n i t s t a t u s f l a g s + e v e n t s i n t e r r u p t c o n t r o l p a r a m e t e r s f r o m / f o r a l l u n i t s o t a r g e t _ r e a c h e d p o r p u l s e g e n i n t e r n a l ( c o ) s i n e l u t i n t e r n a l s t e p c h o p s y n c u n i t a c t u a l c o - / s i n e v a l u e s p w m o r d a c e n c r y p t e d c o - / s i n e v o l t a g e v a l u e s s t d b y s i g n a l o r s c a l e d c u r r e n t v a l u e s c o v e r r e g d r v t y p e f s d a c a ( s i n e ) d a c b ( c o s i n e ) d a c o u t p u t o r d a c u n i t r a m p - g e n e r a t o r s - r a m p s w i t h 4 b o w s , t r a p e z o i d , r e c t a n g l e , . . .
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 11 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 2. application circuits i n this chapter application circuit examples are provided that show how external components can be connected. figure 8 : tmc4331 a connection: vcc=3.3v figure 9 : tmc4331 a with tmc26x stepper driver in spi mode or s/d mode tmc4331 a standard c onnection: vcc=3.3v tmc4331 a with tmc26x stepper c onnection t m c 4 3 3 1 s c k d r v s d o d r v s d i d r v n s c s d r v s d i i n n s c s i n s c k i n s d o i n s p i c o n t r o l i n t e r f a c e t o m i c r o c o n t r o l l e r s p i o u t p u t i n t e r f a c e t o m o t o r d r i v e r s t p o u t _ p w m a d i r p o u t _ p w m b s t e p / d i r i n t e r f a c e t o m o t o r d r i v e r h o m e s t o p l s t o p r r e f e r e n c e s w i t c h e s c l k _ e x t g n d + 3 . 3 v s t a r t s t a r t s i g n a l i n p u t o r o u t p u t i n t r i n t e r r u p t o u t p u t e x t . c l o c k t a r g e t _ r e a c h e d t a r g e t r e a c h e d o u t p u t 1 0 0 n f 1 0 0 n f 1 0 0 n f s t d b y _ c l k s t a n d b y c l o c k o u t p u t v c c t e s t _ m o d e v d d 1 v 8 v d d 1 v 8 t m c 4 3 3 1 c s c k m o s i m i s o s s s c k i n s d o i n c l k c l k _ e x t n s c s i n s d i i n m n s c s d r v s d o d r v s c k d r v s d i d r v s t e p d i r c s n s c k s d i s d o t m c 2 6 x s t p o u t _ p w m a d i r p o u t _ p w m b s g _ t s t m p 1
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 12 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? figure 10 : tmc4331 a with tmc248 stepper driver in spi m ode figure 11 : tmc4331 a with tmc21 30 stepper driver in spi mode or s/d m ode tmc4331 a with tmc248 stepper d river tmc4331 a with tmc21 30 stepper d river t m c 4 3 3 1 c s c k m o s i m i s o s s s c k i n s d o i n c l k c l k _ e x t n s c s i n s d i i n s d o c s n s d i s c k t m c 2 4 8 m n s c s d r v s d o d r v s c k d r v s d i d r v s t d b y _ c l k o u t p u t f o r c h o p s y n c o s c 1 5 k 6 8 0 p f t m c 4 3 3 1 c s c k m o s i m i s o s s s c k i n s d o i n c l k c l k _ e x t n s c s i n s d i i n m n s c s d r v s d o d r v s c k d r v s d i d r v s t e p d i r c s n _ c f g 3 s c k _ c f g 2 s d i _ c f g 1 s d o _ c f g 0 t m c 2 1 3 0 s t p o u t _ p w m a d i r p o u t _ p w m b d c o m p 1 d c e n _ c f g 4 m p 2
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 13 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 3. spi interfacing tmc4331 a uses 40 - bit spi datagrams for communication with a microcontroller. the bit - serial interface is synchronous to a bus clock. for every bit sent from the bus master to the bus slave, another bit is sent simultaneously from the slave to the master. in the following chapter information is provided about the spi control interface, spi datagram structure and spi transaction process. spi input control interface pins pin name type remarks nscsin input chip select of spi - c interface (low active) sckin input serial clock of spi - c interface sdiin input serial data input of spi - c interface sdoin output serial data output of spi - c interface ta ble 3 : spi input control interface pins ? microcontrollers that are equipped with hardware spi are typically able to communicate using integer multiples of 8 bit. ? the nscsin line of the tmc4331 a has to stay active (low) for the complete duration of the datagram transmission. ? each datagram that is sent to tmc4331 a is c omposed of an address byte followed by four data bytes. this allows direct 32 - bit data word communicati on with the register set of tmc4331 a . each regist er is accessed via 32 data bits; even if it uses less than 32 data bits. i each register is specified by a one - byte address: for read access the most significant bit of the address byte is 0. for write access the most signific ant bit of the address byte is 1. note: ? some registers are write o nly r egisters. most registers can be read also ; and there are also some read only registers. figure 12 : tmc4331 a spi datagram structure spi d atagram s tructure tmc4331 a spi datagram structure msb (transmitted first) 40 bits lsb (transmitted last) 39 ... 0 ? 8 - bit address ? 8 - bit spi status ? ? 32 - bit data 39 ... 32 31 ... 0 ? to tmc4331 : rw + 7 - bit address ? from tmc4331 : 8 - bit spi status 8 - bit data 8 - bit data 8 - bit data 8 - bit data 39 / 38 ... 32 31 ... 24 23 ... 16 15 ... 8 7 ... 0 w 38...32 31...28 27...24 23...20 19...16 15...12 11...8 7...4 3...0 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 14 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? r ead and write selecti on is controlled by the msb of the address byte (bit 39 of the spi datagram). this bit is 0 for read access and 1 for write access. consequently, the bit named w is a write_notread control bit. the active high write bit is the msb of the address b yte. consequently, 0x80 must be added to the address for a write access. the spi interface always delivers data back to the master, independent of the w rite bit w . difference between read and write access if then t he previous access was a read access. the data transferred back is the data read from the address which was transmitted with the previous datagram . t he previous access was a write access t he data read back mirrors the previously received write data. figure 13 : difference between read and write access conclusion: consequently , the difference between a read and a write access is that the read access does not transfer data to the addressed register bu t it transfers the address only; and its 32 data bits are dummies. note : ? please note that the following read delivers back data read from the address transmitted in the preceding read cycle. the data is latched immediately after the read request. a read access request datagram uses dummy write data. read data is transferred back to the master with the subsequent read or write access. i reading multiple registers can be done in a pipelined fashion. data that is delivered is lat ched immediately after the initia ted d ata transfer. for r ead access to register xactual with the address 0 x21, the address byte must be set to 0x21 in the access preceding the read access. for write access to register vactual , the address byte must be set to 0x80 + 0x22 = 0xa2. for read access, the data bit can have any value, e.g., 0. read and write access examples action data sent to tmc data received from tmc read xactual ? 0x2100000000 ? 0xss 1) & unused data read xactual ? 0x2100000000 ? 0xss & xactual write vactual := 0x00abcdef ? 0xa200abcdef ? 0xss & xactual write vactual := 0x00123456 ? 0xa200123456 ? 0xss00abcdef table 4 : read and write access examples 1 ) ss is a placeholder for the status bits spi_status . read/write selection principles and p rocess areas of special concern use of dummy write data ! read and write access e xamples
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 15 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? all data is right - aligned. some registers represent unsigned (positive) values; others represent integer values (signed) as twos complement numbers. some registers consist of switches that are represented as bits or bit vectors. the spi transaction process is as follows: ? the slave is enabled for spi transaction by a transition to low level on the chip select input nscsin. ? bit transfer is synchronous to the bus clock sckin, with the slave latching the data from sdiin on the rising edge of sckin and driving data to sdoin following the falling edge. ? the most significant bit is sent first. i a minimum of 40 sckin clock cycles is required for a bus transaction with tmc4331 a . t ake the following aspects into consideration : ? whenever data is read from or written to the tmc4331 a , the first eight bits that are delivered back co ntain the spi status spi_status that consist s of eight user - selected event bits. the selection of these bits are explained in chapter 5.2. ( page 22 ) . ? if less than 40 clock cycles are transmitted, the transfer is not valid; even for read access. however, sending only eight clock cycles can be useful to obtain the spi status because it sends the status information back first. ? if more than 40 clocks cycles are transmitted, the additional bits shifted into sdiin are shifted out on sdoin after a 40 - clock delay through an internal shif t register. this can be used for daisy chaining multiple chips. ? nscsin must be low during the whole bus transaction . when nscsin goes high, the contents of the internal shift register are latched into the internal control register and recognized as a command from the master to t he slave. if more than 40 bits are sent, only the last 40 bits received - before the rising edge of nscsin - are recognized as the command. figure 14 : spi timing datagram data a lig n ment spi t ransaction p rocess areas of special concern system behavior specifics ! n s c s i n s c k i n s d i i n s d o i n t c c t c c t c l t c h b i t 3 9 b i t 3 8 b i t 0 b i t 3 9 b i t 3 8 b i t 0 t d o t z c t d u t d h t c h
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 16 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi timing description the spi interface is synchronized to the internal system clock, which limits spi bus clock sckin to a quarter of the system clock frequency. the signal processing of spi inputs is supported with internal schmitt trigger, but not with rc elements. note: ? in order t o avoid gli tches at the inputs of the spi interface between c and tmc4331 a , external rc elements have to be provided. figure 14 shows the timing param eters of an spi bus transaction, and the table below specifies the parameter values. spi interface timing spi interface timing a c characteristics : external c lock period: t clk parameter symbol conditions min type max unit sckin valid before or after change of nscsin t cc 10 ns nscsin high time t csh min . time is for syn chronous clk with sckin high one t ch before scsin high only . t clk >2 t clk +10 ns sckin low time t cl min . time is for syn chronous clk only . t clk >t clk +10 ns sckin high time t ch min . time is for syn chronous clk only . t clk >t clk +10 ns sckin frequency using external clock (example: f clk = 16 mhz) f sck a ssumes synchronous clk . f clk / 4 (4 ) mhz sdiin setup time before rising edge of sckin t du 10 ns sdiin hold time after rising edge of sckin t dh 10 ns data out valid time after falling sckin clock edge t do n o capacitive load on sdoin . t filt +5 ns table 5 : spi interface t iming i t clk = 1 / f clk
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 17 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 4. input filtering input signals can be noisy due to long cables and circuit paths. to prevent jamming, every input pin provides a schmitt trigger. additionally, several signals are passed through a digital filter. particular input pins are separated into three filtering groups. each group can be programmed individually according to its filter characteristics. in this chapter informed on the digital filtering feature of tmc4331 a is provided; and how to separately set up the digital filter for input pins. input filtering groups pin names type remarks stpin dirin inputs step/dir interface inputs. stopl home_ref stopr inputs reference input pins. start input start input pin . table 6 : input filtering groups (assigned pins ) register names register names register address remarks input_filt_conf 0x03 rw filter configuration for all four input groups . table 7 : input filtering (assigned register) every filtering group can be configured separately with regard to input sample rate and digital filter length. the following groups exist: ? step/dir input pins. ? reference input p ins . ? start input p in . input filter assignment
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 18 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? input sample rate = f clk 1/2 sr where: sr (extended with a particular name extension) is in [0 7]. i this means that the next input value is considered after 2 sr clock cycles . i the filter length filt_l can be set within the range [0 7]. i the filter length filt_l specifies the number of sampled bits that must have the same voltage level to set a new input bit voltage level. input sample r ate (sr) sample rate c onfiguration sample rate configuration sr v alue sample r ate 0 f clk 1 f clk /2 2 f clk /4 3 f clk /8 4 f clk /16 5 f clk /32 6 f clk /64 7 f clk /128 table 8 : sample rate configuration digital filter l ength ( filt_l ) configuration of d igital filter l ength filt_l value filter l ength 0 no filtering . 1 2 equal bits . 2 3 equal bits . 3 4 equal bits . 4 5 equal bits . 5 6 equal bits . 6 7 equal bits . 7 8 equal bits . table 9 : configuration of digital filter length digital filter length configuration table
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 19 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? input f iltering e xamples the following three examples depict input pin filtering of three different input filtering groups. i after passing schmitt t rigger , voltage le vels are c ompared to internal signals, which are processed by the motion controller. i the sample points are depicted as green dashed lines. in this example every second clock cycle is sampled . two sample d input bits must be equal to receive a valid input voltage. figure 15 : reference input pins: sr_ref = 1, filt_l_ref = 1 this example shows the start input pattern at e ver y fourth clock cycle: figure 16 : start input pin: sr_s = 2, filt_l_s = 0 this example shows every clock cycle bit. eight sampled input bit s must be equal to receive a valid input voltage. figure 17 : s/d input p ins: sr_ sd_ in = 0, filt_l_ sd _in = 7 example 1: reference input pins example 2 : start input pin example 3: s/d input pins c l k h o m e i n t e r n a l h o m e s i g n a l s t o p l i n t e r n a l l e f t s t o p s i g n a l c l k s t a r t i n t e r n a l s t a r t i n p u t s i g n a l s t a r t i n t e r n a l s t a r t i n p u t s i g n a l c l k s t p i n i n t e r n a l s t p i n i n p u t s i g n a l d i r i n i n t e r n a l d i r i n s i g n a l
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 20 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 5. status flags and events tmc4331 a provides a range of over 2 0 status flag s and status events in order to obtain short information on the internal status or motor driver status. these flags and events can be read out from dedicated registers. in the following chapter , you are informed about the generation of interrupts based on status events. s tatus events ca n also be assigned to the first eight spi status bit s, which are sent within each spi datagram. pin names: status events pin n ames type remarks intr output interrupt output to indicate status events . table 10 : pins names: status events register names: status flags and events register n ame register a ddress remarks general_conf 0x00 rw bits: 15, 29, 30 . status_flags 0x0f r s tatus flags of tmc4331 a and the connected tmc motor driver chip . events 0x0e r+c w e vents triggered by altered tmc4331 a status bits . spi_status_selection 0x0b rw selection of 8 out of 32 events for spi status bits . event_clear_conf 0x0c rw exceptions for cleared event bits . intr_conf 0x0d rw selection of events for intr output . table 11 :register names: status flags and events
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 21 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? status event d escription status events are based on status bits. if the status bits change, related events are triggered from inactive to active level. resetting even ts back to inactive must be done manually. status bits and status events are associated in different ways: ? stat us flags reflect the as - is - condition, whereas s tatus events indicate that the dedicated information has changed since the last read request of the events register. several status events are associated with one status bit. ? some status events show the status transition of one or more status bits out of a status bit group. the motor driver flags, e.g., trigger only one motor driver event motor_ev in case one of the selected motor driver status flags becomes active. ? in case a flag consists of more than one bit, the number of associated events that can be triggered corresponds to the valid combinations. the vel_state flag, e.g., has two bit but three associated velocity state events (b00/b01/b10). such an event is triggered if the associated combination switches from inactive to active. note: ? s ome events have no equivalence in the status_flags register 0x0f (e.g., cover_done which indicates new dat a from the motor driver chip). the events register 0x0e is automatically cleared after reading the register ; subsequent to an spi datagram request. events are important for i nterrupt g eneration and spi stat us monitoring . note: ? it is recommended t o clear events register 0x0e by read request before regular operation . r ecognition of a s tatus event can fail; in case it is trigg ered right before or during events register 0x0e becomes cleared . in order to prevent ev ents from being cleared, assign event_clear_conf register 0x0c according to the particular event in the events register : action: ? set related event_clear_conf register bit position to 1. result: the relate d event is not cleared when events register is read out. in order to clear these events, do the following, if necessary: action: ? set related events register 0x0e bit position to 1 . result: the related event i s cleared by writing to the events register. association of status bits automatic c leara nce of events areas of special concern how to avoid lack of i nformation !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 22 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi status bit transfer up to eight events can be selected for permanent spi status report. consequently, these events are always tr ansferred at the most significant transfer bits within each tmc4331 a spi response. in order to select an event for the spi status bits , assign the spi_status_selection register 0x0 b according to the particular event in the events register : action: ? set the related spi_status_selection register bit position to 1. result: the related event is transferred with every spi datagram response as spi _ status . note: ? the bit positions are sorted according to the event bit positions in the events register 0x0e. in case more than eight events are selected , the first eight bits (starting from index 0 = lsb) are forwarded as spi_status. generation of i nterrupts similar to event_clear_conf register and spi_sta tus_selection re gister, events can be selected for forward ing via intr output. the selected events are ored to one signal which means that intr output switches active as soon as one of the selected events triggers . in order to select an event for the intr output pin, assign the intr_conf register 0x0d according to the particular event in the events register: action: ? set the related intr_conf register bit position to 1. result: the related event is forwarded at the intr output. if more than one event is requested, intr becomes active as soon as one of the selected events is active. per default, the intr output is low active. in order to change the intr polarity to high active, do the followin g: action: ? set intr_pol = 1 ( general_conf register 0x00 ) . result: intr is high active. a ssign an event to a status bit g enerate interrupts intr o utput p olarity
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 23 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? connection of m ultiple intr p ins intr pin can be configured for a shared interrupt signal line of several tmc4331 a interrupt signals to the microcontroller. in order to make use of a wired - or or wired - and behavior, the below described actions must be taken : action: ? step 1: set intr_tr_pu_pd_en = 1 ( general_conf register 0x00 ) . option 1: wired - or action : ? step 2 : set intr_as_wired_and = 0 ( general_conf register 0x00). result: t he intr pin works efficiently as wired - or (default configuration) . i in case intr pin is inactive, the pin drive has a weak inactive polarity output. if one of the connected pins is activated, the whole line is set to active polarity. option 2 : wired - and action: ? step 2 : set intr_as_wired_and = 1 of the general_conf register 0x00. result : in case no interrupt is active, the intr pin has a strong inactive polarity output. during the active s tate, the pin drive has a weak active polarity output. consequently , the whole signal line is activated in case all pins are forwarding the active polarity. c onnect ing several interrupt pins
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 24 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 6. ramp configuration s for different motion profiles step generation is one of the main tasks of a stepper motor motion controller. the internal ramp generator of tmc4331 a provides several step generation configurations with different motion profiles. they can be confi gured in combination with the velocity or positioning mode. pin names : ramp generat or pin n ames type remarks stpout_pwma output step output signal . dirout_pwmb output direction output signal . table 12 : pin names: ramp generator register names : ramp generator register n ame register a ddress remarks general_conf 0x00 rw ramp generator affecting bits 5: 0 . stp_length_add 0x10 rw additional step length in clock cycles; 16 bits . dir_setup_time additional time in clock cycles when no steps will occur after a direction change; 16 bits . rampmode 0x20 rw requested motion profile and operation mode ; 3 bits . xactual 0x21 rw current internal microstep position; signed; 32 bits . vactual 0x22 r current step velocity; 24 bits; signed; no decimals . aactual 0x23 r current step acceleration; 24 bits; signed; no decimals . vmax 0x24 rw maximum permitted or target velocity; signed; 32 bits= 24+8 (24 bits integer part, 8 bits decimal places) . vstart 0x25 rw velocity at ramp start; unsigned; 31 bits=23+8 . vstop 0x26 rw velocity at ramp end; unsigned; 31 bits=23+8 . vbreak 0x27 rw at this velocity value, the ac eleration /deceleration will change during trapezoidal ramps; unsigned; 31 bits=23+8 . amax 0x28 rw maximum permitted or target acceleration; unsigned; 24 bits=22+2 (22 bits integer part, 2 bits decimal places) . dmax 0x29 rw maximum permitted or target deceleration; unsigned; 24 bits=22+2 . astart 0x2a rw acceleration at ramp start or below vbreak; unsigned; 24 bits=22+2 . dfinal 0x2b rw deceleration at ramp end or below vbreak; unsigned; 24 bits=22+2 . bow1 0x2d rw first bow value of a complete velocity ramp; unsigned; 24 bits=24+0 (24 bits integer part, no decimal places) . bow2 0x2e rw second bow value of a complete velocity ramp; unsigned; 24bits=24+0 . bow3 0x2f rw third bow value of a complete velocity ramp; unsigned; 24 bits=24+0 . bow4 0x30 rw fourth bow value of a complete velocity ramp; unsigned; 24 bits=24+0 . clk_freq 0x31 rw external clock frequency f clk ; unsigned; 25 bits . xtarget 0x37 rw target position; signed; 32 bits . table 13 : register names: ramp generator
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 25 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? step/dir output configuration this section focus es on the description of the step/dir output configuration. step/dir output signals can be configured for the driver circuit. if step signals must be longer than one clock cycle, do as follows: action: ? set proper stp _ length _ add register 0x10 (bit 15:0 ). result: the resulting step length is equal to stp _ length _ add +1 clock cycles. this is how the step length is assigned within a range of up to 1 - up - to - 2 16 clock cycles. action: ? set proper dir _ setup _ time register 0x10 (bit 31:16). result: the delay period between dirout and stpout voltage level transitions last dir _ setup _ time clock cycles. no steps are sent via stpout for dir _ setup _ time clock cycles after a level change at dirout . principle: dirout does not change the level: ? d uring active step pulse signal ? for ( stp_length_add +1 ) clock cycles after the step signal returns t o inactive level stpout characteristics can be set differently, as follows: per default, the step output is high active because a rising edge at stpout indicates a step. in order to change the polarity, do as follows: action: ? s et step_inactive_pol = 1 (bit 3 of general_conf register 0x00). result: each falling edge indicates a step. in order to prompt a step at ev ery level change, do as follows: action: ? s et toggle_step =1 (bit4 of general_conf register 0x00). result : every level change indicates a step. per default, voltage level 1 at dirout indicates a negative step direction. dirout characteristics can be set differently, as shown below. in order to change polarity, do as follows: action: ? set pol_dir_out =0 ( bit 5 of general_conf register 0x00). result: a high v oltage level a t dirout indicates a positive step direction. note: ? dirout is based on the internal step position mscnt and is therefore based on the internal sinlut, see 10.2. , page 83 . step/dir output c onfiguration steps stpout: changing polarity how to p rompt level change with every step dirout: changing the polarity
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 26 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? altering the internal motion direction per default, a positive internal velocity vactual result s in a forward motion through internal sinlut . consequently , if vactual < 0, the sinlut values are developed backwards. in order to alter the default setting of the internal motion direction , do as follows: action : ? set reverse_motor_dir =1 (bit 28 of general_conf register 0x00). result: a positive internal velocity for vactual result s in a backward motion through the internal sinlut. how to change motion direction
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 27 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? configuration details for operation modes and motion profiles this section provides information on the two available operation modes (velocity m ode and positioning mode), and on t he four possible motion profiles (no ramp, trapezoidal ramp including sixpoint? ramp , and s - shaped r amp). diffe rent combinations are possible . each one of them has specific advantages. the choice of configuration d epends on the u sers design specification to best suit his design needs. with proper configuration, the internal ramp generator of the tmc4331 a is ab le to generate various ramps with the related step outputs for stpout . in order to configure the internal ramp generator successfully C i.e. to make it f it as best as possible with your specific u se case C information about the sco pe of each possible combination is provided in the table below and on the following pages. ramp generator configuration options o peration mode motion profile rampmode(2:0) description velocity mode no ramp b000 follows vmax request only . trapezoidal ramp b001 follows vmax request and considers acceleration and deceleration values. sixpoint ramp b001 follows vmax request and considers acceleration / deceleration values and start and stop velocity values. s - shaped ramp b010 follows vmax request and considers maximum acceleration / deceleration values and adapts these values with 4 different bow values. positioning mode no ramp b100 follows xtarget and vmax requests only . trapezoidal ramp b101 follows xtarget request and a maximum velocity vmax request and considers acceleration and deceleration values. sixpoint ramp b101 follows xtarget request and a maximum velocity vmax request and considers acceleration / deceleration values and start and stop velocity values. s - shaped ramp b110 follows xtarget request and a maximum velocity vmax request and considers maximum acceleration / deceleration values and adapts these values with 4 different bow values. table 14 : overview of general and basic ramp configuration options description of internal ramp generator
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 28 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? starting point: choose operation mode two operation modes are available: velocity mode and positioning mode. before setting any parameters: first select: ? o peration mode and ? m ot ion profile it is not advisable to change operation mode nor motion profile during motion. the rampmode register provides a choice of two operation modes. either velocity mode or positioning mode can be chosen. in order to use the velocity mode, do as follows: action: ? set rampmode (2) =0 ( rampmode register 0x20) . result: velocity mode is selected. the target velocity vmax is reac hed with the selected motion profile. in order to make us e of the positioning mode, do as follows: action: ? set rampmode (2)=1 ( rampmode register 0x20) . result: positioning mode is selected. vmax is the maximum velocity value of this motion profile that is based on the condition that the ramp stops at target position xtarget . note: ? the sign of vmax is not relevant during positioning. the direction of the steps depends on xactual , xtarget , and the current ramp motion profile status. note: ? do not exceed vmax f clk ? pulses for positioning mode. in order to stop the motion during positioning, do as follows: action: ? set v max = 0 (register 0x24). result: the velocity ramp directs to vactual = 0, using the actual ramp param e ters . i motion is proceeded with vmax 0. ! before you begin operation mode: velocity mode operation mode: positioning mode stop during motion
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 29 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? three basic motion profiles are provided. each one of them has a different vel ocity value de velopment during the drive. see table below. for configuration of the motion profiles, do as follows: action: ? use the bits 1 and 0 of the rampmode register 0x20. result: as specifie d in the table belo w. you can choose different configuration options from the list below: ? no r amp motion profile ? trapezoidal r amp motion profile (including sixpoint ramp) ? s - shaped r amp motion profiles tmc4331 a motion profile rampmode (1:0) motion profile function b b01 usage of start and stop velocity values. (see section 6.5. , p age 42 ) b table 15 : description of tmc4331 a motion profiles motion profile configuration
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 30 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? figure 18 : no ramp motion profile in order to make use of the no r amp motion profile, which is rectangular, do as follows: action: ? set rampmode (1:0) =b00 (register 0x20). ? set proper v max register 0x24. result : the internal velocity vactual is immediately set to vmax . combining positioning mode with the no r amp motion profile determines that the ramp holds vmax until xtarget is reached. the motion direction depends on xtarget . in order to make use of the no r amp motion profile in combination with the p ositioning mode , do as follows: action: ? set rampmode (2:0) =b100. ? set proper v max register 0x24. ? set proper xtarget register 0x37. result: vactual is set instantly to 0 in case the target position is reached. note: ? do not exceed vmax f clk / 4 pulses for positioning mode. n o ramp motion profile positioning mode combined with no ramp motion profile v ( t ) t v m a x
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 31 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in order to make use of a t rapezoidal 4 - point r amp motion profile without break velocity, do as follows: action: ? set rampmode (1:0) =b01 (register 0x20). ? set vbreak =0 (register 0x27). ? set proper amax register 0x28 and dmax register 0x29. ? set proper v max register 0x24. result: the internal velocity vactual is changed successively to vmax with a linear ramp. only amax and dmax define the acceleration/deceleration slopes. note: ? amax determines the rising slope from absolute low to absolute high velocities, whereas dmax determines the falling slope from absolute high to absolute low velocities. ? acceleration slope and deceleration slopes have only one acceleration and deceleration value each. figure 19 : trapezoidal ramp without break point figure 20 : trapezoidal r amp with break p oint in order to make use of a t rapezoidal r amp motion profile with break velocity, do as follows: action: ? set rampmode (1:0)=b01 (register 0x20). ? set proper vbreak register 0x27. ? set proper amax register 0x28 and dmax register 0x29. ? set proper astart register 0x2a and d final register 0x2b. ? set proper v max register 0x24. result: the internal velocity vactual is changed successively to vmax with a linear ramp. in addition to amax and dmax , astart and dfinal define the acceleration or deceleration slopes (se e figure above) . notes: ? amax and astart determines the rising slope from absolute low to absolute high velocities. ? dmax and dfinal dete rmines the falling slope from absolute high to absolute low velocities. ? the acceleration/deceleration factor alters at vbreak. astart and dfinal are valid below vbreak, whereas amax and dmax are valid beyond vbreak. trapezoidal 4 - p oint r amp without break point trapezoidal ramp with break point v ( t ) t v m a x a 1 a 2 a 3 v ( t ) t v m a x v b r e a k a 1 a 2 a 3 l a 1 l a 3
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 32 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? m otion direction depends on xtarget . in order to use a 4 - point or sixpoint ramps during positioning mode, do as follows: action: ? set rampmode (2:0) =b101 (register 0x20). ? set tra pezoidal ramp type accordingly, as explained above. ? set proper xtarget register 0x37. result: the ramp finishes exactly at the target position xtarget by keeping | vactual | = vmax as long as possible. aactual assignments app ly both for 4 - point and sixpoint ramps. the acceleration/deceleration factor aactual register depends on the current ramp phase and the velocity that needs to be reached. the related sign assignment for different ramp phases is given in the following table: position mode combined with trapezoida l ramps aactual assignments for trapezoidal r amps aactual assignments for trapezoidal ramps ramp phase: a 1l a 1 a 2 a 3 a 3l v>0: aactual = astart amax 0 ? ? ? ? table 16 : trapezoidal r amps: aactual a ssignme nts during m otion
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 33 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in order to make use of s - shaped ramp s , do as follows: action: ? set rampmode (1:0)=b10 (register 0x20) . ? set proper bow1 bow4 registers 0x2c0x30 . ? set proper amax register 0x28 and dmax register 0x29. ? set astart = 0 (register 0x2a) . ? set dfinal = 0 (regis ter 0x2b) . ? set proper v max register 0x24. result: the internal velocity vactual is changed successively to vmax with s - s haped ramps. the acceleration/deceleration values are altered on the basis of the bow values. figure 21 : s - shaped ramp without initial and final acceleration/deceleration values rising slope (absolute lower velocities to absolute higher velocities): ? bow1 determines the value which increases the absolute acceler ation value. ? bow2 determines the value which decreases the absolute acceleration value. ? amax determines the maximum acceleration value. falling slope (absolute higher velocities to absolute lower velocities): ? bow3 determines the value which increases the absolute deceleration value. ? bow4 determines the value which decreases the absolute deceleration value. ? dmax determines the maximum absolute deceleration value. ? ? description is continued on n ext page . configuration of s - s haped r amps definition of rising slope for s - shaped ramps definition of falling slope for s - shaped ramps v ( t ) t v m a x b 1 b 1 2 b 2 3 b 3 4 b 3 b 4 b 2 a s t a r t = 0 d f i n a l = 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 34 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? changing ramp parameters 1 and/or operation mode durin g motion is not advised. however, if this is necessary, the following applies: avoid unintended system behavior during positioning mode! ramp parameter value changes during ramp progress can lead to: ? a temporary overshooting of xtarget or mechanical stop positions. ? a temporary overshooting of vactual beyond vmax because the bows b1, b2, b3, and b4 are maintained during the ramp progress . this will ensure smooth operation during positioning mode. 1 exceptions are xtarget and vmax. these parameters can be changed during motion. however, if it is necessary to change ramp parameters for s - shaped ramps during motion or to swi t ch from velocity to positioning mode , do as follows: action: ? set or set again proper bow 3 registers 0x2f , regardless of wether the value changes or not. i set this parameter after all other parameters have been set. result: internal ramp calculations are reset through which the velocity ramp operates at safe mode. during this mode, the target velocity is set to 0. in case the internal ramp calculations are up - to - date, the ramp, which is configured by the actual ramp parameters, is continued. in order to configure s - shaped ramp s with starting and finishing values for acceleration or deceleration , do as follows: action: ? set rampmode (1:0)=b10 (register 0x20). ? set s - shaped ramp as explained above ( bow1 bow4 , amax , dmax ) . ? set proper astart register 0x2a. ? set proper dfinal register 0x2b. ? set proper v max register 0x24. result: the internal velocity vactual is changed successively to vmax with s - shaped ramps. figure 22 : s - shaped ramp with initial and final acceleration/deceleration v alues ? ? description is c ontinued on next page . notice changing ramp parameters during s - shaped motion or switching from velocity to positiong mode configuration of s - shap ed r amp with astart and dfinal v ( t ) t v m a x b 1 b 1 2 b 2 3 b 3 4 b 3 b 4 b 2 a s t a r t > 0 d f i n a l > 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 35 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? ? t he acceleration/d eceleration values are altered , based on the bow values. ? the start phase and the end phase of an s - shaped ramp is accelerated/decelerated by astart and dfinal . ? the ramp starts with astart and stops with dfinal . ? dfinal becomes valid when aactual reaches the chosen dfinal value. i the parameter d final is not considered during positioning mode. aactual assignments and current bow value selection for s - shaped ramps. the acceleration/deceleration factor depends on the current ramp phase and alters every 64 clock cycles during the bow phases b1, b2, b3, and b4. details a re provided in the table below: rampmode (2:0) =b110 ? the ramp finishes exactly on target position ; keeping | vactual | = vmax as long as possible until the ramp falls to reach xtarget exactly. ? it is possible that the phases b12, b23, and b34 are left out due to given values. therefore, the highest speed performance is possible due to a maximum speed positioning ramp. ? the fastes t possible slopes are always performed if the phases b12 and/or b34 are not reached during a rising and/or falling s - shaped slope. ? the ramp maintains the maximum velocity vmax as long as possible in positioning mode until the falling slope finishes the ra mp to reach xtarget exactly. the result is the fastest possible positioning ramp in matters of time . definitions for s - shaped ramps aactual assignments for s - shaped r amps s - shaped r amps : assignments for aactual and internal bow v alue ra mp phase: b 1 b 12 b 2 b 23 b 3 b 34 b 4 v>0: aactual = astart ? amax amax amax ? 0 0 0 ? - dmax - dmax - dmax ? - dfinal bow actual = bow1 0 - bow2 0 - bow3 0 bow4 v<0: aactual = - astart ? - amax - amax - amax ? 0 0 0 ? dmax dmax dmax ? dfinal bow actual = - bow1 0 bow2 0 bow3 0 - bow4 table 17 : parameter assignments for s - shaped r amps s - shaped mode and p ositioning : fast m otion
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 36 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? s tart v elocity vstart and stop v elocity vstop s - shaped and trapezoidal velocity ramps can be configured with unsigned start and stop velocity values: v st art , or vstop . per default, vstart and vstop are set to 0. the sign is selected automatically , depending on the current ramp stat us and the target velocity, or target position. this section explains how to set up the respective values correctly. s - shaped and t rapezoidal velocity ramps can be started with an initial velocity value , if you set the vstart value higher than zero (see figure below). in order to use trapezoidal ramps with an initial start velocity, do as follows: action: ? set rampmode (1:0)=b01 (register 0x20). ? set trapezoidal ramp type a ccordingly, as explained before. ? set proper vstart > 0 (register 0x25). ? set vstop = 0 (register 0x26). result: the trapezoidal ra mp starts with initial velocity. note : ? the initial acceleration value is amax if vbreak < vstart, otherwise the starting acceleration value is astart. figure 23 : trapezoidal r a mp with initial v elocity if trapezoidal ramp with initial velocity vstart is selected: avoid unintended system behavior during positioning mode! ? use vstart without setting vstop > vstart only in positioning mode if there is enough distance between the current position xact ual and the target position xtarget . this will ensure smooth operation during positioning mode. ? ? turn p age for information on how to configure s - shaped ramps with initial start velocity. starting r amps with i nitial v elocity notice v ( t ) t v m a x v b r e a k a 1 a 2 a 3 l a 1 l a 3 v s t a r t
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 37 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in order to use s - shaped ramps with initial start velocity, do as follows: action: ? set rampmode (1:0)=b10 (register 0x20). ? set s - shaped ramp type accordingly, as explained before. ? set proper vstart > 0 (register 0x25). ? set vstop = 0 (register 0x26). result: t he s - shaped ramp starts with initial velocity. principle: ? the initial acceleration value is equal to amax. the parameter astart is not considered. consequently, ramp phase b1 is not performed. figure 24 : s - shaped ramp wi th i nitial start v elocity if s - shaped ramp with initial velocity vstart is selected: avoid unintended system behavior during positioning mode! ? keep in mind that the s - shaped character of the curve is maintained. because amax is the start acceleration value, the ramp will always execute phase b2 which could result in positioning overshoots. ? use vstart only in positioning mode if there is enough distance between the current position xactual and the target position xtarget . th is will ensure smooth operation during positioning mode. ? ? turn p age for information on how to configure finishing ramps with stop velocity. s - shape d ramps with initial s tart v elocity notice v ( t ) t v m a x b 1 b 1 2 b 2 3 b 3 4 b 3 b 4 b 2 v s t a r t
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 38 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? s - shaped and trapezoidal velocity ramps can be finished with a st op velocity value if you set vstop value higher than zero (see f igure below). in order to configure t rapezo idal ramps with stop velocity, do as follows: action: ? set rampmode (1:0)=b 01 (register 0x20). ? set tra pezoidal ramp type accordingly, as explained before. ? set vstart = 0 (register 0x25). ? set proper vstop > 0 (register 0x26). result: th e trapezoidal ramp stops with defined velocity. figure 20: trapezoidal ramp with stop v elocity if trapezoidal ramps are selected ( vbreak > 0): avoid unintended system behavior during positioning mode! ? set vbreak > vstop . ? set vstart < vstop . this will ensure smooth operation during positioning mode. ? ? turn p age for configuration information on s - shaped ramps with stop velocity. finishing ramps with s top v elocity n otice v ( t ) t v m a x v b r e a k a 1 a 2 a 3 l a 1 l a 3 v s t o p
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 39 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in order to use s - sh aped ramps with stop velocity, do as follows: action: ? set rampmode (1:0)=b10 (register 0x20). ? s et s - shaped ramp type accordingly, as explained before. ? set vstart = 0 (register 0x25). ? set proper vsto p > 0 (register 0x26). result: the s - shaped ram p finishes with stop velocity . note: ? the final deceleration value is equal to dmax. the parameter dfinal is not considered. consequently, ramp phase b4 is not performed. figure 25 : s - shaped ramp with stop velocity interaction of vstart , vstop , vactual and vmax : ? vstop can be used in positioning mode , if the target position is reached. in velocity mode, vstop is also used if vactual 0 and the target velocity vmax is assigned to 0. ? vstart and vstop are not only used to start or end a velocity ramp. if the velocity direction alters due to register assignments while a velocity ramp is in progress, the velocity values develop according to the current velocity ramp type , using vstart or vstop . ? the unsigned values vstart and vstop are valid for both velocity directions. ? every register value change is assigned immediately. ? ? turn p age for information on how to configure s - shaped ramps with start and stop velocity. s - shaped ramps with stop v elocity v ( t ) t v m a x b 1 b 1 2 b 2 3 b 3 4 b 3 b 4 b 2 v s t o p
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 40 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? s - shaped ramps can be configured with a combination of vstart and vstop . it is possible to include both processes in one s - shaped ramp to decrease the time between start and stop of the ramp. in order to use s - shaped ramps with a combination of start and stop velocity, do as follows: action: ? set rampmode (1:0)=b10. ? set s - shaped ramp type accordingly, as explained before, but with bow2 bow4. ? set proper vstart > 0 (register 0x25). ? set prope r vstop > 0 (register 0x26). result : the s - shaped ramp starts with in itial velocity and stops with defined velocity. figure 26 : s - shaped ramp with start and stop v elocity if s - shaped ramp with initial velocity vstart and stop velocity vstop is selected: avoid unintended system behavior during positioning mode! ? keep in mind that the s - shaped character of the curve is maintained. because amax is the start acceleration value, the ramp will always execute phase b2, which could result in positioning overshoots. ? use vstart in positioning mode, if there is enough distance between the current position xactual and the target position xtarget . this will ensure smooth operation during positioning mode. ? ? turn p age for information on how to use vstart and astart for s - shaped ramps. s - shaped ramps with start and stop v elocity notice v ( t ) t v m a x b 1 b 1 2 b 2 3 b 3 4 b 3 b 4 b 2 v s t o p v s t a r t
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 41 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? for some s - sha ped ramp applications it can be useful to start with a defined velocity value ( vsta rt > 0); but not with the maximum acceleration value amax . in order to start with a defined velocity value, do as follows: action: ? set rampmode (1:0) =b10 (register 0x20). ? set s - shaped ramp type accordingly, as explained before. ? set proper vstart > 0 (register 0x25). ? set proper vstop > 0 (register 0x26). ? set use_astart_and_vstart = 1 (bit0 of the general_conf register 0x00). result : the following speci al ramp types can be generated in this way, as shown below. i section b1 is passed through although vstart is used. using vstart and starting acceleration of 0 for s - shaped ramps using vstart and starting acceleration , which is smaller than amax for s - shaped ramps figure 27 : s - shaped r amps with combined vstart and a start p arameters if s - shaped ramp with vstart , astart , and vstop is selected: avoid unintended system behavior during positioning mode! ? keep in mind that the s - shaped character of the curve is maintained. because astart is the start acceleration value, the ra mp will always execute phase b2, which could result in positioning overshoots. ? use vstart and astart > 0 without setting vstop > vstart only in positioning mode, if there is enough distance between the current positi on xactual and the target position xtarget . this will ensure smooth operation during positioning mode. combined u se of vstart and astart for s - shaped ramps notice v ( t ) v m a x b 1 b 1 2 b 2 3 b 3 4 b 3 b 4 b 2 v s t o p v s t a r t a s t a r t = 0 v ( t ) t v m a x b 1 b 1 2 b 2 3 b 3 4 b 3 b 4 b 2 v s t o p v s t a r t a s t a r t > 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 42 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? sixpoint r amps sixpoint ramps are t rapezoidal ramp s with initial an d stop velocity values that also make use of two acceleration and two deceleration values . sixpoint r amps are t rapezoidal velocity ramps that can be configured with a combination of vstart and vstop . in order to use trapezoidal ramps with a combination of start and stop velocity, do as follows: action: ? set rampmode (1:0)=b01 (register 0x20). ? set a trapezoidal ramp type appropriately as explained in section 6.3.6 , page 31 . ? set proper vstart > 0 (register 0x25). ? set proper vstop > 0 (register 0x26). ? set proper vbreak > 0 (register 0x27) . result: the sixpoint ramp starts with an initial velocity and stops with a defined velocity. figure 28 : six point ramp: trapezoidal ramp with start and stop v elocity if a sixpoint ramp is used : avoid unintended system behavior during positioning mode! ? set vbreak > vstop . ? set vstart < vstop . this will ensure smooth operation during positioning mode. configuration of sixpoint ramp s diagram of sixpoint ramp notice v ( t ) t v m a x v b r e a k a 1 a 2 a 3 l a 1 l a 3 v s t o p v s t a r t
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 43 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? u - turn behavior the process that is triggered when motion direction changes during motion, is described below, and applies to all ramp types. in case the motion direction is changed during motion in velocity mode (by direct assignment of vmax ) or in positioning mode (d ue to xtarget reassignment), the following process is triggered: 1. motion is directed to vactual = 0. i if vstop is used ( 0) , motion terminates at vstop . 2. a standstill phase of tzerowait clock cycles (register 0x7b) occurs. i it is recommended to assign t zerowait > 0, if vstop and/or a trapezoidal ramp type are used, because motor os cil l ations can occur that must peter out. 3. motion continues to the actual xtarget (positioning mode), or to the newly assigned vmax (velocity mode). i if vstart is used ( 0) , motion begins with vstart if tzerowait > 0. after reaching vstop , tzerowait clock cycles are waited until motion continues to peter out motor oscillations. figure 29 : example for u - tur n b ehavior of sixpoint ramp ? ? turn page for information on u - turn for s - shaped ramps. u - turn behavior example: u - turn for sixpoint ramps v ( t ) t v m a x v b r e a k v s t o p v s t a r t - v m a x - v b r e a k - v s t o p - v s t a r t t z e r o w a i t
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 44 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? when vactual = 0 is reached , motion immediately continue s . in most s - shaped ramp applications that do not u se vstop , a standstill phase is not required. if astart > 0 and/or dfinal > 0, these parameters are also used during u - turn. figure 30 : example for u - tur n b ehavior of s - shaped ramp there is one exception to the above explained u - turn process: in case bow2 equals bow4 , the s - shaped ramp is not stopped at vactual = 0. while passing vactual = 0, motion acceleration does not equal 0. thus, the fastest possible u - turn behavior for this ramp is creat ed. in the figure below, this velocity ramp behavior is depicted as bold black line, whereas the velocity ramp behavior of the process explained above is depicted gray line: figure 31 : direct transition via vactual=0 for s - shaped ramps example: u - turn for s - shaped ramps continuous velocity motion p rofile for s - shaped ramps v ( t ) t - v m a x - v m a x t z e r o w a i t = 0 v ( t ) t - v m a x - v m a x b o w 2 = b o w 4 !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 45 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? internal ramp generator units this section provides information about the arithm etical units of the ramp parameters. all parameter units are real arithmetical units. therefore, it is necessary to set the clk_freq register 0x31 to proper [hz] value, which is defined by the external clock frequency f clk . any value between f clk = 4.2 mhz and 32 mhz can be selected . default configuration is 16 mhz . velocity values are always defined as pulses per second [pps]. vactual is given as a 32 - bit signed value with no decimal places. the unsigned velocity values vstart , vstop , and vbreak consist of 23 dig its and 8 decimal places. vmax is a signed value with 24 digits and 8 decimal places. the maximum velocity vmax is restricted as follows: velocity mode: | vmax | ? puls e f clk positioning mode: | vmax | ? puls e f clk note: ? i n case vactual exceeds this limit incorrect step pulses at stpout output occur and/or positioning is not executed properly. furthermore, vmax have to be the highest nominal value of all velocity values: | vmax | > max( vstart;vstop;vbreak ) the unsigned values amax , dmax , astart , dfinal , and dstop consist of 22 digits and 2 decimal places. aactual shows a 32 - bit non decimal signed value. acceleration and deceleration units are defined per default as pulses per second2 [pps2]. if higher acceleration/d eceleration values are required for short and steep ramps, do as follows: action: ? set direct_acc_val_en =1 ( general_conf register 0x00) . result: the parameters are defined as velocity value change per clock cycle with 24 - bit unsigned decimal places (msb =2 - 14 ). the values are calculated as follows: amax [pps 2 ] = amax / 2 37 f clk 2 dmax [pps 2 ] = dmax / 2 37 f clk 2 astart [pps 2 ] = astart / 2 37 f clk 2 dfinal [pps 2 ] = dfinal / 2 37 f clk 2 dstop [pps 2 ] = dstop / 2 37 f clk 2 the maximum acceleration or deceleration values are as follows: max ( amax;dmax;astart;dfinal ; dstop) [pps2] vmax f clk / 1024 in case direct_acc_val_en = 1, the maximum value is also limited to: max (amax;dmax;astart;dfinal ; dstop) 2 20 ? ? continued on next page . clock frequency velocity value units acceleration value units
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 46 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? bow values bow1bow4 : bow values are unsigned 24 - bit values without decimal places. they are defined per default as pulses per second3 [pps3]. in case higher bow values are required for short and steep ramps , do as follows: action: ? set direct_bow_val_en =1 ( general_conf register 0x00) result: the parameters are defined as acceleration value change per clock cycle with 24 - bit unsigned decimal places with the msb defined as 2 - 29 . the particular bow values bow1 , bow2 , bow3 , bow4 are calculated as follows: bowx [pps 3 ] = b owx / 2 53 f clk 3 the maximum bow values are as follows: max (bow14) [pps3] max (amax;dmax) [pps2] f clk / 1024 in case direct_bow_val_en = 1, the maximum value is also limited to: max (bow14) 2 20 overview of minimum and maximum values : minimum and maximum values ( frequency mode and in general ) value classes velocity acceleration bow clock affected registers vmax, vstart, vstop, vbreak amax, dmax, astart, dfinal bow1, bow2, bow3, bow4 clk_freq (f clk ) minimum n ominal v alue 3.906 mpps 0.25 mpps 2 1 m pps 3 4.194 mhz maximum n ominal v alue 8.388 m pps 4.194 m pps 2 16.777 m pps 3 3 2 mhz maximum related value velocity mode: ? pulse f clk vmax f clk / 1024 max( amax;dmax ) f clk / 1024 positioning mode: ? pulse f clk | vmax | > max( vstart ; vstop ; vbreak ) table 18 : minimum and maximum values if real world u nits are selected minimum and maximum values for steep slopes ( direct mode, example with f clk =16mhz) value classes acceleration ( direct_acc_val_en =1) bow ( direct_bow_val_en =1) affected registers amax, dmax, astart, dfinal, dstop bow1, bow2, bow3, bow4 calculation a[pps2] = ( ? 37 f clk 2 bow[pps3] = ( ?a 53 f clk 3 minimum nominal value ~1.86 kpps2 ~454.75 kpps3 maximum nominal value ~ 1.95 g pps2 ~476.837 g pps 3 maximum related value vmax 15625 hz max( amax;dmax ) 15625 hz table 19 : minimum and maximum values for steep s lopes for f clk =16mhz bow value units
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 47 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 7. external step control and electr onic gearing steps can also be g enerated by external steps that are manipulated internally by an electronic gearing process . in the following chapter, steps generation by external control and electronic gearing is presented. pins for e xternal step control pin n ames type remarks stpin in put step input signal . dirin in put direction in put signal . table 20 : pins used for external step c ontrol registers used for external step control register n ame register a ddress remarks general_conf 0x00 rw b its 9:6, 26 . gear_ratio 0x 12 rw electronic gearing factor; signed; 32 bits =8+24 (8 - bit digits, 24 - bit decimal places) . table 21 : register s used for external step c ontrol in order to synchronize with other motion controllers , tmc4331 a offers a step direction input interface at the stpin and dirin input pins . i three options are available. i n case one of these options is selected, the internal step generator is disabled. option 1: high active external steps action: ? set sdin_mode = b01 ( general_conf register 0x00). result: as soon as the stpin input signal switches to high state the control unit recognizes an external step. option 2: low active external steps action: ? set sdin_mode = b10 ( general_conf register 0x00). result: as soon as the stpin input signal switches to low state the control unit recognizes an external step. option 3: toggling e xternal steps action: ? set sdin_mode = b11 ( general_conf register 0x00). r esult: as soon as the stpin input signal switches to low or high state the control unit recognizes an external step. ? ? continued on next page. enabling external step c ontrol
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 48 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? dirin polarity can be assigned. per default, the negative direction is indicated by dir i n = 0. in order to change this polarity: action: ? set pol_dir_in = 1 ( general_conf register 0x00). result: a negative input direction is assigned by dirin = 1. if an external step is not congruent with an internal step, the gear_ratio register 0x12 must be set accordingly. this signed parameter consists of eight bit digits and 24 bits decimal places. with every external step the assigned gear_ratio value is adde d to an internal accumulation register. as soon as an overflow occur s , an internal step is generated and the remainder will be kept for the next external step. a ny absolute gearing value between 2 - 24 and 127 is possible. note: ? gearing ratios beyond 1 are more reasonable for the spi output . t he internal sinlutable is used that generates multiple steps one afte r another without interpolation, if the accumulation register value is above 1. in contrast to a burst of steps at the stpout pin, the spi output will only forward the new position in the inner sinlut where only some values have been skipped if | gear_ratio |>1 . ? a negative gearing factor gear_ratio < 0 inverts the interpretation of the input direction which is determined by dirin and pol_dir_in . it is possible to use the internal ramp generator in combination with the external s/d interface. in this case, the external step impulses transferred via stpin and dirin cannot influence the internal xactual counter directly. instead, the xtarget register is altered by 1 or - 1 with every gear_ratio accumulation register overflow. note: ? whether xtarget is increased or decreased is determined similarly to t he direct electronic gearing control . the accumulati on register overflow direction indicates the target alteration. respectively, the accumulation direction is determined by the gear_ratio sign, by pol_dir_in, and by dirin. ? consecutive input step s must occur with a distance of minimum 64 clock cycles. i this feature allows a synchronized motion of different positioning ramps for different tmc4331 a chips with differently configured ramps . in order to s elect indirect external control, do as follows: action: ? set sdin_mode b00 according to the required ext ernal control option. ? set sd_indirect_control = 1 ( general_conf register 0x00). result: as soon as an external st ep is generated, xtarget is increased or decreased, a ccording to the accumulation direction. selecting the input direction p olarity description of electronic gearing i ndirect external control
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 49 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in some cases, it is useful to switch from external to internal ramp generation during motion . tmc4331 a supports a smooth transfer from direct external control to an internal ramp . the only parameter you need to know and apply is the current velocity when the switching occurs. in more detail, this means that when the external control is switched off, vstart takes over the defin ition of the actual velocity value . the ramp direction is then selected automatically. the time step of the last internal step is also taken into account in order to provide a smooth transition from external to internal ramp control. in order to select automatic switching fro m external to internal control, d o as follows: precondition (external direct con trol is active): action: ? set sdin_mode b00 ( general_conf register 0x00). ? set sd_indirect_control = 0 ( general_conf register 0x00). ? set astart = 0 (register 0x2a). proceed with: action: ? set automatic_direct_sdin_switch_off = 1 ( general_conf register 0x00) once before switching to internal control . ? continually adapt vstart register 0x25 according to the actual velocity of the tmc4331 a that must be calculated in the c. ? if switching must be pr ompted , s et sdin_mode = b00. result: the internal ramp velocity is s tarted with the value of vstart , and the direction is set automatically on the basis of the external steps that have occurred before. in order to also support a smooth s - shaped ramp transition - when the external step control is switched off - the starting acceleration value c an also be set separately at astart register 0x2a. i in contrast to the automatic direction assignment, t he sign o f astart must be set manually. in order to s elect automatic switching from external to internal control with a starting acceleration value , do as follows : precondition (extern al direct control is active): action: ? set sdin_mode b00 ( general_conf register 0x00). ? set sd_indirect_control = 0 ( general_conf register 0x00). proceed with: action: ? set automatic_direct_sdin_switch_off = 1 once before switching to internal control. ? continually adapt vstart register 0x25 according to the actual velocity of the tmc4331 a that must be calculated in the c. ? continually adapt a start according to the actual acceleration (unsigned value) of the tmc4331 a tha t must be calculated in the c. ? continually s et astart (31) = 0 or 1 according to the acceleration directi on. ? if switching must be prompted , set sdin_mode = b00 . result: the internal ramp velocity is started with the value of vstart , and the direction is set automatically on the basis of the external steps that have occurred before. the internal acceleration value is set to : + astart if astart (31) = 0 or C astart if astart (31) = 1. switching from external to internal c ontrol smooth s witching for s - shaped r amps
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 50 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 8. reference s witches the reference input signals of the tmc4331 a function partly as s afety feature s. the tmc4331 a provides a range of reference switch settings that can be co nfigured for many different applications. the tmc4331 a offers two hardware switches (stopl, stopr) and two additional virtual stop switches ( virt_stop_left , virt_stop_right ). a home reference switch home_ref is also available. pins used for reference switches pin n ames type remarks stopl input left reference switch . stopr input right reference switch . home_ref input home switch . target_reached output reference switch to indicate xactual = xtarget . table 22 : pins used for reference s witches dedicated registers for reference switches register n ame register a ddress remarks reference_conf 0x01 rw configuration of interaction with reference pins . home_safety_margin 0x1e rw region of uncertainty around x_home . dstop 0x2c rw deceleration value if stop switches stopl / stopr or virtual stops are used with soft stop ramps . the deceleration value allows for an automatic linear stop ramp . pos_comp 0x32 rw free configurable compare position; signed ; 32 bits . virt_stop_left 0x33 rw virtual left stop that triggers a stop event at xactual table 23 : dedicated registers for reference s witches
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 51 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? hardware switch s upport the tmc4331 a offers two hardware switches that can be configured according to your design. the hardware provides a left and a right stop in order to stop the drive immediately in case one of them is triggered. therefore, pin 12 and pin 14 of the motion controller must be used. note: ? both sw itches must be enabled b efore motion occurs. in order to enable stopl correctly, do as follows: action: ? determine the active polarity voltage of stopl and set pol_stop_left ( reference_conf register 0x01) accordingly. ? set stop_left_en =1 ( reference_conf register 0x01). result: the current velocity ramp stops in case the stopl voltage level matches pol_stop_left and vactual < 0. in order to enable stopr correctly, do as follows: action: ? determine the active polarity voltage of stopr and set pol_stop_righ t ( reference_conf register 0x01) accordingly. ? set stop_righ t_en =1 ( reference_conf register 0x01). result: the current vel ocity ramp stops in case stopr vol tage level matches pol_stop_ rig h t and vactual > 0. the stop slope can be configured for hard or linear stop slopes. per default, hard stops are selected. if hard stops are required, do as follows: option 1: hard stop slopes action: ? set soft_stop_en =0 ( reference_conf register 0x01). result: if one of the stop switches is active and e nabled, the velocity ramp is set immediately to vactual = 0. option 2: linear sto p slopes if linear stop ramps are required: action: ? set proper dstop > max( dmax ; dfinal ) (register 0x2c). ? set soft_stop_en =1 ( reference_conf register 0x01). result: if one of the stop switches is active and ena bled, the velocity ramp is stopped with a linear deceleration slope until vactual = 0 is reached . in this case the deceleration factor is determined by dstop . vstop is not considered during the stop deceleration slope. stopl and stopr stop s lope conf iguration for hard or l inear stop slopes
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 52 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? w hen a enabled stop switch becomes act ive the related status flag is set i n the status flags register 0x0f. the flag remains active as long as the stop switch remains active. the particular event is also released in the events register 0x0e, which remains active until the even t bit is reset manually. when vactual = 0 is reached after the stop event no motion toward this particular direction is possible. in order to move into the locked direction, the following is required: precondition 1: the particular stop switch is not active anymore . and/or precondition 2: the stop switch is disabled ( stop_left /right _en = 0) . action: ? set back the active event by reading out or writing to the events register 0x0e. i see further inf ormation about clearing events provided in s ection 5.1. , page 21 . result: the active stop event is reset to free motion into the locked direction. it is possible to select f our different events to store the current internal position xactual in the register x_latch . the table below show which transition of the reference signal leads to the x_latch transfe r. for each transition process the specified reference configurations in the ref erence _conf register 0x01 must be set accordingly. if you need to change the direct ions of the reference switches, do as follows: action: ? set invert_stop_direction = 1 ( reference_conf register 0x01) . result: stopl is now the right reference switch and stopr is now the left reference switch . consequently , all configuration parameters for stopl become valid for stopr and vice versa. how active s t ops are indicated and reset to free m otion how to latch internal p osition on switch e vents reference c onfiguration pol_stop_left =0 pol_stop_left =1 pol_stop_right =0 pol_stop_right =1 latch_x_on_inactive_l=1 stopl=0 ? 1 stopl=1 ? 0 --- --- latch_x_on_active_l=1 stopl=1 ? 0 stopl=0 ? 1 --- --- latch_x_on_inactive_r=1 --- --- stopr=0 ? 1 stopr = 1 ? 0 latch_x_on_active_r=1 --- --- stopr=1 ? 0 stopr = 0 ? 1 table 24 : reference configuration and corresponding transition of particular reference s witch interchange the reference s witches without physical r econnection
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 53 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? virtual stop switches tmc4331 a provid es additional virtual limits; which trigger stop slopes in case the specific virtual stop switch microstep position is reached. virtual stop positions are assigned using the virtual_stop_left register 0x33 and virtual_stop_right register 0x34. in this sect ion, configuration details for virtual stop switches are provided for various design - in purposes. note: ? virtual stop switches must be enabled in the same manner as nonvirtual reference switches. hitting a virtual limit switch - by receiving the assigned position - triggers the same process as hitting stopl or stopr. in order to enable left virtual stop correctly, do as follows: action: ? set virtual_stop_left register 0x33 a ccording to left stop position. ? set virtual_left_limit_en =1 ( reference_conf register 0x01). result: the actual velocity ramp stops in case xactual virt_stop_left . the ramp is stopped according to the selected ramp type. in order to enable right virtual stop correctly, do as follows: action: ? set virtual_stop_ righ t register 0x34 a ccording to right stop position. ? set virtual_ right _limit_en =1 ( reference_conf register 0x01). result: the actual velocity ramp stops in case xactual virt_stop_right . the ramp is stopped according to the selected ramp type. the virtual stop slope can also be configured for hard or linear stop slopes. if virtual hard stops are required, do as follows: action: ? set virt_stop_mode = b01 ( reference_conf register 0x01). result: if one of the virtual stop switches is active and enabled, the velocity ramp will be set immediately to vactual = 0. if virtual linear stop ramps are required, do as follows: action: ? set proper dstop > max( dmax ; dfinal ) (regist er 0x2c). ? set virt_stop_mode = b 1 0 ( reference_conf register 0x01) . result: if one of the virtual stop switches is active and enabled, the velocity ramp is stopped with a linear deceleration slope until vactual = 0 is reached. in this case the deceleration factor is determined by dstop . vstop is not considered during the stop deceleration slope. ? ? continued on next page . enabling v irtual stop s witches virtual stop s lop e configuration
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 54 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? at the same time when a n enabled vir tual stop switch becomes active the related status flag is activated in the status flags register 0x0f. the flag remains active as long as the stop switch remains active. the particular event is also released in the events register 0x0e, which remains active until the event is reset manually. when vactual = 0 is reached after the stop event no motion in the particular direction is possible. in order to move into the locked direction, the following is required: precondition 1: the particular stop switch is not active anymore because the actual position does not exceed the specified limit. and/or precondition 2: v irtual stop switch is disabled ( virtual_left /right _limit_en = 0) . action: ? set back active event by reading out or writing to the events register 0x0e. i see further information about clearing events provided in s ection 5.1. , page 21 . result: the active virtual stop event bit is reset to free motion into the direction th at was locked beforehand. i invert_stop_direction has no influence on virtual_stop_left and virtual_stop_right . how active v irtual s t ops are indicated and reset to free m otion
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 55 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? home reference configuration i n this section home reference switch handling is explained with information about home tracking modes, possible home event configurations and home event monitoring. for monitoring, the switch reference input home_ref is provided. perfor m the following to ini ti ate the homing process: action: ? a ssign a ramp according to your needs for the homing process. ? enable the home tracking mode with start_home_tracking = 1 ( reference_conf register 0x01). ? set the correct home_event ( reference_conf r egister 0x01) for the home_ref input pin (see table below ) . ? start the ramp towards the home switch home_ref. result: ? when the next home event is recognized by tmc4331 a , xactual is latched to x_home . ? at the same time, the start_home_tracking switch is disabled automatically in case xlatch_done event is cleared. ? the xlatch_done event is released in the events register 0x0e. this event can be used for an interrupt routine for the homing process in order to avoid polling. i x_home can be overwritt en manually. eight different home events are possible. i h ome events are related to the voltage levels of the home_ref input pin: switch reference i nput home_ref home event s election home event selection table home_event description x_home (direction: negative / positi ve) b b b b b b b b table 25 : overview of d ifferent home_event settings h o m e _ r e f 0 1 h o m e _ r e f 0 1 h o m e _ r e f 0 1 h o m e _ r e f 0 1 h o m e _ r e f 0 1 h o m e _ r e f 0 1 h o m e _ r e f 0 1 h o m e _ r e f 0 1
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 56 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? an error flag home_error_f is permanently evaluated. this error flag indicates whether the current voltage level of the home_ref reference input is valid in regard to x_home and the selected home_event. in order to avoid false error flags ( home_error_f ) because of mechanical inaccuracies, it is possible to setup an uncertainty home range around x_home . in this range, the error flag is not evaluated. if you want to de fine an uncertainty area around x_home , do as follows: action: ? set home_safety_margin register 0x1e a cco rding to the required range [ustep] . result: the homing uncertainties C related to the special application environment C are considered for the ongoing motion. the error flag is not evaluated in the following range: x_home ? home_safety_margin xactual x_home + home_safety_margin note: ? it is recommended to assign to a higher range value for home_safety_margin in which the home_ref level is ac tive for the home_events b0110, b0010, b0100, b1001, b1011, and b1101. it avoids false positive home_error_flags. ? the following examples illustrate the points at which the error flag is release C based on the selected home_even t C here for home_event = b0011 (*), b1100 (**), b0110 (***), b0010 (***), b0100 (***), b1001 (****), b1011 (****), and b1101 (****). figure 32 : home_ref m onitoring and home_error_flag stopl and stopr inputs can also be used as home_ref inputs. option 1: stopl is t he home switch action: ? se t stop_left_is_home = 1 ( reference_conf register 0x01 ) . result: the stop event at stopl only occurs when the home range is crossed after stopl becomes active . the home range is given by x_home and home_safety_margin . option 2: stopr is home switch action: ? se t stop_right_is_home = 1 ( reference_conf register 0x01 ) . result: the stop event at stopr only occurs when the home region is crossed after stopr becomes active . the home region is given by x_home and home_safety_margin . home_ref m onitoring defining a home r ange around home_ref homing with stopl or stopr h o m e _ e r r o r _ f l a g * * * h o m e _ r e f x _ h o m e h o m e _ s a f e t y _ m a r g i n h o m e _ e r r o r _ f l a g * h o m e _ e r r o r _ f l a g * * h o m e _ e r r o r _ f l a g * * * * x _ h o m e h o m e _ s a f e t y _ m a r g i n h o m e _ e r r o r _ f l a g * * * h o m e _ r e f h o m e _ e r r o r _ f l a g * h o m e _ e r r o r _ f l a g * * h o m e _ e r r o r _ f l a g * * * *
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 57 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? target reached / position comparison in this section , target_reached output pin configuration options are explained, as well as different ways how to comp are di fferent values internally. target_reached output pin forward s the target_reached_f lag. as soon as xactual equals xtarget , target_reached is active. per default, the target_reached pin is high active. to change the target_reached output polarity, do the following: action: ? set invert_pol_target_reached = 1 (bit16 of the general_conf register 0x00). result: target_r e ached pin is low active. target_reached pin s c an also be configured for a s hared signal line in the same way as several intr pin s c an configured for one interrupt signal transfer C see section 5.4. ( p age 23 ). to use a wired - or or wired - and behavior, the below described order of action must be executed: action: ? step 1: set intr_tr_pu_pd_en = 1 ( general_conf register 0x00 ). option 1: wired - or action : ? step 2 : set tr_as_wired_and = 0 ( general_conf register 0x00). result: the target_reached pin works efficiently as wired - or (default configuration). i in case target_reached pin is inactive, the pin drive has a weak inactive polarity output. during active state, the output is driven strongly. consequently, i f one of the connected pins is activated, the whole line is set to active polarity. option 2: wired - and action: ? step 2 : set tr_as_wired_and = 1 ( general_conf register 0x00 ) . result : as long as the target position is not reached , the target_reached pin has a strong inactive polarity output. during active state, the pin drive has a weak active polarity output. consequently, the whole signal line is activated if all connected pins are forwarding the active polarity. target reached output p in connecting several target - reached p ins
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 58 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? use of target_reached output per default, target_reached pin forwards the target_reached_f lag that signifies xactual = xtarget . the pin can also be used to forward two other flags: velo city_reached_f lag, pos_comp_reached_f lag. note: ? only one option can be selected . the target_reached output pin configuration switch is available at reference _conf re gister 0x01. the available optons are as follows: target_reached output pin configuration if pos_comp_output equals then target_reached forwards b00 target_reached_f lag b01 velocity_reached_f lag b11 pos_comp_reached_f lag table 26 : target_reached output pin configuration position c omparison of i nternal v alues tmc4331 a provides several ways of comparing internal values . the position compar ison process is permanently active and associated with one flag and one event. a positive comparison result can be forwarded through the intr pin using the pos_comp_reached event as interrupt source or by using the target_reached pin as explained before . how to compare the internal position with an arbitrar y value: action: ? select a comparison value in the pos_comp register 0x32. ? select pos_comp_source = 0 ( reference_conf register 0x01) . result : xactual is compared with pos_comp . when pos_comp equals xactual the pos_comp_reached_f lag becomes set and the pos_comp_reached event becomes released. in addition to comparing xactual with pos_comp , it is also possible to conduct a compar ison of one of both parameters with x_home or x_latch . tmc4331 a also allows comparison of the revolut ion counter rev_cnt against pos_comp . o nl y the selected combination generate s the pos_comp_reached_ f lag and the corresponding event. th erefore, select modified_pos_compare in the reference_conf register 0x01 as outlined in the table below: comparison selection grid modified_pos_compare pos_comp_reached_flag is based on 00 xactual vs. pos_comp 01 xactual vs. x_home 10 xactual vs . x_latch 11 rev_cnt vs. pos_comp table 27 : comparison selection grid to generate pos_comp_reached_flag three options for target_reache d basic c ompari son s ettings comparison selection grid settings alert !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 59 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? repetitive and circular motion tmc4331 a also provides options for auto - repetitive or auto - circular motion . in this section configuration options are explained. per default, reaching xtarget in positioning mode finishes a positioning ramp. in order to continuously repeat the specified ramp , do as follows: pre condition: ? set rampmode (2) = 1 (positioning mode is active). ? configure a velocity ramp according to your requirements. action: ? set clr_pos_at_target =1 ( reference_conf register 0x01). result: after xtarget is reached ( target_reached_f lag is active) , xactual is set to 0. as long as xtarget is not 0, the ramp restarts in order to reach xtarget again. this leads to repetitious positioning ramps from 0 towards xtarget . note: ? it is possible to change xtarget during repetitive motion . the reset of xactual to 0 is always executed when xactual equals xtarget. if circular motion profiles are necessary for your application , tmc4331 a offers a position limitation range of xactual with an automatic overflow processing. as soon as xactual reaches one of the two position range limits (positive / negative), the value of xactual is set automatically to the value of the opposite range limit. in order t o activate circular motion, do as follows: precondition: if you want to activate circular motion , xactual must be located within the defined range . proceed with: action: ? s et x_range 0 (regis ter 0x36, only writing access!). ? s et c ircular_mot ion = 1 ( reference_conf register 0x01) . result: the positioning range of xactual is limited to: ? x_range xactual < x_range . when xactual reaches the most positive position ( x_range C 1) and the motion proceed s in positive direction; the next xactual value is set to ? x_range . the same applies to proceeding in negative direction; where ( x_range C 1) is the position after ? x_range . i during po sitioning mode, the motion direction will be dependent on the shortest path to the target position xtarget . for example, if xactual = 200, x_range = 300 and xtarget = ? 200, the positioning ramp will find its way across the overflow position (299 ? ? 300) (see f igure a ) in table 28 ( p age 62 ) . repetitive m otion to xtarget activating c ircular m otion
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 60 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? due to definition of the limitation range , one revolution only consist s of an even number of microsteps. tmc4331 a provides an option to overcome this limitation. ? some applications demand different requirements because a revoluti on consists of an uneven or non integer number of microsteps . ? tmc4331 a allows a high adjustment range of microsteps by using: circular_dec register 0x7c. this value represents one digit and 31 decimal places as extension for the number of microsteps per one revolution. ? a revolution is completed at overflow position. with every completed revolution the circular_dec value is added to an internal accumulation register. i n case this register has an overflow , xactual remain s at its overflow position for one step. ? on average, this leads to the following microsteps per revolution: microsteps/rev = (2 x_range ) + circular_dec / 2 3 1 . one revolution consists of 6 01 microsteps. a definition of x_range = 3 00 will only provide : 6 00 microsteps per revolution ( ? 300 xactual 299). w hereas x_range = 3 01 will result in : 6 02 microsteps per revolution ( ? 3 01 xactual 3 00) . b y setting: circular_dec = 0x80000000 (= 2 31 / 2 31 = 1) . a n overflow is generated at the decimals accumulation register with every revolution . therefore, xactual prolongs the step at the overflow position for one step every time position overflow is overstepped . this result s in a microstep count of 6 01 per revolution. one revolution consists of 6 00.5 microsteps. by setting : circular_dec = 0x40000000 (= 2 30 / 2 31 = 0.5). every second revolution an overflow is produced at the decimals accumulation r egister. this leads to a microstep count of 6 00 every second revolution and 6 01 for the other half of the revolutions. on average, this leads to 6 00.5 microsteps per revolution. one revo lution consists of 6 01.25 microsteps. by setting: circular_dec = 0xa0000000 (= (2 31 + 2 29 ) / 2 31 = 1.25) . with e very revolution an overflow is produced at the decimals accumulation register. furthermore, at every fourth revolut ion an additional overflow occur s, which leads to another prolonged step. this leads to a microstep count of 6 01 for three of four revolutions and 6 02 for every fourth revolution. on average, this results in 6 01.25 microsteps per revolution. uneven or non inte ger microsteps per revolution example 1 : uneven number of microsteps per r evolution example 2 : non integer number of microsteps per r evolution example 3 : non integer and uneven number of microsteps per r evolution
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 61 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? by overstepping the position overflow , the internal rev_cnt register is increased by one revolution as soon as xactual oversteps from ( x_range C 1) to - x_range or is decreased by one revolution as soon as xactual oversteps in the opposite direction. the information about the number of revolutions can be obtained by reading out register 0x36 , which by default is the x_latch register (read only). in order to gain information on the number of revolutions: action: ? set circular_cnt_as_xlatch = 1 ( general _conf register 0x00). result: r egister 0x36 cease to display the x_latch value . instead, the revolution counter rev_cnt can be read out at this register address. note: ? as soon as circular motion is inactive ( circular_m otion =0), rev_cnt is reset to 0. blocking zones during circular motion, virtual stops can be used to set blocking zones . positions inside these blocking zones are not dedicated for motion. in order to activate the blocking zone , do as follows: precondition: c ircular motion is activated ( circular_motion = 0) and properly assigned ( x_range 0). proceed with: action: ? set virtual_stop_left register 0x33 as left limit for the blocking zone. ? set virtual_stop_right register 0x34 as right limit for the blocking zone. ? enable both virtual limits as explained in section 8.2.1 ( p age 53 ) . result: t he blocking zone reaches from virtual_stop_left to virtual_stop_right . durin g positioning, the path from xactual to xtarget does not lead through the blocking zone ; which can result in a longer path compared to the direct path through the blocking zone (see f igure b1 in table 28 (page 62 ) . however, the selected virtual stop deceleration ramp is initiated as soon as one of th e limits is reached. this can result from the velocity mode or if the target xtarget is located in the blocking zone. ? ? continued on next page . release of t he revolution c ount er activating blocking zones during circular m otion
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 62 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? the f ollowing positions are located within the blocking zone: xactual virt_stop_left and / or xactual virt_stop_right note: ? i n case virtual_stop_left < virtual_stop_right , one of these conditions must be met in order to be located inside the blocking zone. ? i n case virtual_stop_left > virtual_stop_right , both conditions must be met in order to be located inside the blocking zone. the table below shows circular motion ( x_range = 300). the green arrow depicts the path which is chosen for positioning. t he shortest path selection is shown in f igure a and the consideration of blocking zones are shown in f igures b1 and b2. circular motion with (b1, b2) and without (a) blocking z one a b1 b2 table 28 : circular motion (x_range = 300) when xactual is located inside the blocking zone, it is possible to move out without redefining the blocking zone. in order t o get out of the blocking zone, do the following: action: ? activate positioning mode: rampmode (2) = 1 . ? configure velocity ramp according to your needs. ? c lear virtual stop events by reading out events register 0x0e . ? s et regular target position xtarget outside of the blocking zone. result: tmc4331 a i nitiate s a ram p with the shortest way to the target xtarget . blocking zone d efinition circular motion with and without blocking z one moving out of the blocking z one 0 2 9 9 - 3 0 0 2 0 0 - 2 0 0 l o n g p a t h s h o r t p a t h 0 2 9 9 - 3 0 0 2 0 0 - 2 0 0 l o n g p a t h ( b u t f r e e ) s h o r t p a t h ( b u t b l o c k e d ) v s t o p l = - 2 9 0 v s t o p r = 2 2 0 0 2 9 9 - 3 0 0 2 0 0 - 2 0 0 l o n g p a t h ( a n d b l o c k e d ) s h o r t p a t h v s t o p l = 1 4 0 v s t o p r = 7 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 63 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 9. ramp timing and synchronization tmc4331 a provides various options to initiate a new ramp . by default , every external register change is assigned immediately to the internal registers via an spi input. with a p roper start configuration , ramp sequences can be programmed without any interv ention in between. three levels of ramp start co mplexity are available. p redefined ramp starts are available, which are independent of spi data transfer that are explained in the subsequent section 9.1. ( p age 64 ) . two optional features can be configured that can either be used individually or combined, which are as follows: a complete shadow motion register set can be loaded in to the actual motion registers in order to start the next ramp with an altered motion profile. different tar get positions can be predefined, which are then activated successively. this pipel ine can be configured as cyclic; and/or it can also be utilized to sequence different parameters. also, another start state busy can be assigned in order to synchronize several motion controllers for one single start event without a master. synchronization o pportunities shadow register s et target p o sition p ipeline masterless s ynchronization dedicated ramp timing pins pin n ames type remarks start input and o utput external start input to get a start signal or external start output to indicate an internal start event. table 29 : dedicated ramp timing p ins dedicated ramp timing registers register n ame register a ddress remarks start_conf 0x02 rw the configuration register of the synchronization unit . start_out_add 0x11 rw additional active output length of external start signal . start_delay 0x13 rw delay time between start trigger s and start signal . x_pipe0 7 0x380x3f sh_reg012 0x400x4c table 30 : dedicated ramp timing r egisters
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 64 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? basic s ynchronization settings usually, a ramp can be initiated internally or externally. note that a start trigger is not the start signal itself but the transition slope to the active start state. after a defined delay , the internal start signal is generated. f or ramp start configuration , consider the following steps: action: ? choose internal or external start trigger(s). ? set the triggers according to the table below. i all triggers can be used separately or in combination. start trigger configuration table trigger_events = start_conf (8:5) result b0000 no start signal will be generated or processed further. bxxx0 set trigger_events (0) = 0 for internal start trigger s only. the internally generated start signal is forwarded to the start pin that is assigned as output . bxxx1 set trigger_events (0) = 1 for an external start trigger. t he start pin is assigned as input . for start input take filter settings into consideration. see c hapter 4 , p age 17 . bxx1x target_reached event is assigned as start signal trigger for the ramp timer . b x1xx velocity_reached event is assigned as start signal trigger for the ramp timer . b1xxx poscomp_reached event is assigned as start signal trigger for the ramp timer . table 31 : start trigger c onfiguration per default, every spi datagram is processed immediately. by selecting one of the following enable switches, the a ssignment of spi requests to registers xtarget , vmax , ramp_mode , and gear_ratio is uncoupled from the spi transfer. t he value assignment is only processed after an internally generated start signal. in order to influence the impact of the start sign al on internal parameter assign ments , do the following : action: ? c hoose between the following options as shown in the table below. start enable switch configuration table (all switches can be used separately or in combination.) s tart_en = start_conf ( 4:0 ) result bxxxx1 xtarget is altered only after an internally generated start signal. bxxx1x vmax is altered only after an internally generated start signal. bxx1xx rampmode is altered only after an internally generated start signal. bx1xxx gear_ratio is altered only after an internally generated start signal. b1xxxx shadow register is assigned as active ramp parameters after an internally generated start signal. this is explained in more detail in section 9.2. ( p age 69 ) . table 32 : start e nable s witch c onfiguration start signal trigger s election user - specified impact configuration of timing p rocedure
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 65 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? per default, the trigger is closely followed by the internal start signal. in order to delay the generation of the internal start signal , do the following: action: ? set start_ delay register 0x13 according to your specification. result: when a start trigger is recognized, the internal start signal is generated after start_ delay clock cycles. per default, an external trigger is also delayed for the internal start signal generation. in order t o immediately prompt an external start, trigger to an int ernally generated start signal (regardless of a defined delay) , do the following: action: ? set immediate_start_in = 1 ( start_conf register 0x02). result: when a n external start trigger is recognized, the internal start signal is generated immediately , even if the internal start triggers have already initiated a timing process with an active delay. the start pin can be used either as input or as output pin. however, the active voltage level polarity of the start pin can be selected with one configuration switch in the start_conf register 0x02. per default, the voltage level transition from high to low triggers a start signal (start is an input), or start output indicates an active start event by switching from high to low level. in order to invert active start polarity , do as follows: action: ? set pol_start_signal = 1 ( start_conf register 0x02). result: the start pin is high active. the voltage level transition from low to high triggers a start signal (start is an input), or start output indicates an active start event by switching from low to high level . per default, the active output voltage level of the start pin last s one clock cycle. in order to extend this time span, do the follo wing: condition: ? start pin is assigned as output: t rigger_events (0) = 1. action: ? set start_out_add register 0x11 according to your specification. result: t he active voltage level last s ( start_out_add + 1 ) clock cycles. delay definition between t r igger and internally generated start s ignal prioritizing external in put start p in p olarity active start p in output c onfiguration
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 66 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? the following three examples depict spi datagrams, internal and external signal levels, corresponding velocity ramps, and additional explanations. spi data is transferred internally at the end of each datagram. in this example , t he velocity value change is executed immediately. ? the new xtarget value is assigned after target_reached has been set and start_delay has elapsed. ? a new ramp does not start at the end of the second ramp because no new xtarget value is ass igned. ? start is an output. ? i nternal start signal forwards with a step length of ( start_out_add + 1) clock cycles. this is how external devices c an be synchronized: parameter settings timing e xample 1 parameter setting rampmode b 101 start_en b 0 00 01 trigger_events b 0010 start_delay >0 start_out_add >0 pol_start_signal 1 table 33 : parameter settings timing e xample 1 figure 33 : ramp timing e xample 1 ramp timing e xamples ramp timing e xample 1 process description s p i x t a r g e t = 2 0 0 0 v m a x = 2 0 0 0 v ( t ) 2 0 0 0 1 0 0 0 t a r g e t _ r e a c h e d v m a x _ r e a c h e d i n t e r n a l s t a r t s i g n a l s t a r t i n t e r n a l s t a r t t i m e r t s t a r t _ d e l a y s t a r t _ d e l a y s t a r t _ o u t _ a d d s t a r t _ o u t _ a d d t r i g g e r e v e n t t r i g g e r e v e n t x a c t u a l = 1 8 0 0 x a c t u a l = 2 0 0 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 67 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in this example, t he velocity value and the ramp mode value change is executed after the first start signal. ? t he new ramp mode becomes posi tioning mode with s - shaped ramps. ? t he ramp then stops at target position xtarget because of the ramp m ode change . ? a further xtarget change s tarts the ramp again . ? the ramp is initiated as soon as the start delay is completed, which was triggered by the first target_reached event. ? the active start output signal lasts only one clock cycle. parameter settings timing e xample 2 parameter setting rampmode b 001 ? b110 start_en b00 111 trigger_events b 0110 start_delay >0 start_out_add 0 pol_start_signal 0 table 34 : parameter settings timing e xample 2 figure 34 : ramp timing e xample 2 ramp timing e xample 2 process description s p i v ( t ) 2 0 0 0 1 0 0 0 t a r g e t _ r e a c h e d v m a x _ r e a c h e d i n t e r n a l s t a r t s i g n a l s t a r t i n t e r n a l s t a r t t i m e r t s t a r t _ d e l a y t r i g g e r e v e n t r a m p m o d e = 1 1 0 v m a x = 1 0 0 0 x t a r g e t = 2 0 0 0 x t a r g e t = 2 0 0 0 t r i g g e r e v e n t t r i g g e r e v e n t v m a x = 2 2 5 0 s t a r t _ d e l a y x a c t u a l = 2 0 0 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 68 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in this example external start signal triggers are prioritized by making use of s tart_delay > 0 and simultaneously setting immediate_start_in to 1. ? when xactual equals poscomp the start timer is activated and the external star t signal in between is ignored. ? the second start event is triggered by an external start signal. the poscomp_reached event is ignored. the third start timer process is disrupt ed by the external start signal, which is forced to be executed immediately due to the setting of : immediate_start_in = 1. parameter s ett ings timing e xample 3 parameter setting rampmode b 000 start_en b00 010 trigger_events b 1001 immediate_start_in 0 ? 1 start_delay >0 pol_start_signal 1 table 35 : parameter settings timing e xample 3 figure 35 : ramp timing e xample 3 ramp timing e xample 3 process description s p i v m a x = - 1 0 0 0 v ( t ) 1 0 0 0 p o s c o m p _ r e a c h e d i n t e r n a l s t a r t s i g n a l s t a r t i n t e r n a l s t a r t t i m e r t s t a r t _ d e l a y t r i g g e r e v e n t x a c t u a l = p o s c o m p - 1 0 0 0 v m a x = 1 0 0 0 s t a r t _ d e l a y t r i g g e r e v e n t v m a x = 2 5 0 v m a x = - 2 5 0 i m m e d i a t e _ s t a r t _ i n = 1 i g n o r e d t r i g g e r e v e n t d u e t o o n g o i n g s t a r t t i m e r t r i g g e r e v e n t t r i g g e r e v e n t x a c t u a l = p o s c o m p i g n o r e d t r i g g e r e v e n t d u e t o o n g o i n g s t a r t t i m e r
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 69 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? shadow register set tings some applications require a complete new ramp parameter set for a specific ramp situation / point in time. tmc4331 a pro vides up to 14 shadow registers, which are loaded into the corresp onding ramp parameter registers after an int ernal start signal is generated. in order to enable shadow register s , do as follows: action ? set start_en (4) = 1 and select one or more trigger_events ( start _conf register 0x02) , see section 9.1.2 (p age 64 ). result: with every successive internal start signal the shado w registers are loaded into the corresponding active ramp register. it is also possible to write back the current motion profile into the shadow motion registers to swap ramp mo tion profiles continually. in order to enabl e cyclic shadow registers, do as follows: action ? set start_en (4) = 1 and select one or more trigger_events ( start _conf register 0x02) , see section 9.1.2 ( p age 64 ). ? set cyclic_shadow_regs = 1 ( start _conf register 0x02) . result: with every successive internal start signal the shadow registers are loaded into the corresponding active ramp register, whe reas the active motion profile is loaded into the shadow registers. ? ? continued on next page . enabling shadow r egisters enabling cyclic shadow r egisters
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 70 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? four different optional shadow r egister assignment s are available to match the shadow register set according to your selected ramp type. the available options are described on the next pages. i please note that the only difference between the configuration of shadow option 3 and 4 is that vstart is exchange d by vstop for the transfer of the shadow registers. if the whole ramp register is needed to set in a single level stack , do as follows: action: ? s et shadow_option = b 00 ( start _conf register 0x02) . ? set start_en (4) = 1 and select one or more trigger_events ( start _conf register 0x02) action: ? default config: set cyclic_shadow_regs = 0 ( start _conf register 0x02) ? optional config: set cyclic_shadow_regs = 1 ( start _conf register 0x02) result: every relevant motion parameter is altered at the next internal start signal by the correspondi ng shadow register parameter. in case cyclic shadow registers are used, the shadow register set is altered by the current motion profile set. figure 36 : single - level shadow register option to replace complete ramp motion p rofile. i gree n arrows show default settings i b lue arrows show optional settings. in case an s - shaped ramp type is selected and operation mode is switched from velocity to positioning mode (triggered by shadow register transfer) , sh_reg10 must not be equal to bow3 ; to ensure safe operation mode switching. ? ? on the following pages more options are explained. pleae turn page. shadow re gister configuration o ptions o ption 1: shadow default c onfiguration areas of special concern ! 2 0 r a m p m o d e 2 4 v m a x 2 5 v s t a r t 2 6 v s t o p 2 7 v b r e a k 2 8 a m a x 2 9 d m a x 2 a a s t a r t 2 b d f i n a l 2 d b o w 1 2 e b o w 2 2 f b o w 3 3 0 b o w 4 4 c s h _ r e g 1 2 4 0 s h _ r e g 0 4 6 s h _ r e g 6 4 7 s h _ r e g 7 4 5 s h _ r e g 5 4 1 s h _ r e g 1 4 2 s h _ r e g 2 4 3 s h _ r e g 3 4 4 s h _ r e g 4 4 8 s h _ r e g 8 4 9 s h _ r e g 9 4 a s h _ r e g 1 0 4 b s h _ r e g 1 1 x x x x x x r e g i s t e r a d d r e s s r e g i s t e r n a m e c y c l i c _ s h a d o w _ r e g = 0 c a p t i o n c y c l i c _ s h a d o w _ r e g = 1 2 0 r a m p m o d e 2 4 v m a x 2 5 v s t a r t 2 6 v s t o p 2 7 v b r e a k 2 8 a m a x 2 9 d m a x 2 a a s t a r t 2 b d f i n a l 2 d b o w 1 2 e b o w 2 2 f b o w 3 3 0 b o w 4 4 c 4 0 4 6 4 7 4 5 4 1 4 2 4 3 4 4 4 8 4 9 4 a 4 b s h _ r e g 1 2 s h _ r e g 0 s h _ r e g 6 s h _ r e g 7 s h _ r e g 5 s h _ r e g 1 s h _ r e g 2 s h _ r e g 3 s h _ r e g 4 s h _ r e g 8 s h _ r e g 9 s h _ r e g 1 0 s h _ r e g 1 1
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 71 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in case s - shaped ramps are configured, a double - stage shadow register set can be used. seven relevant motion parameter s for s - shaped ramps are affected when the shadow registers become active. in order to use a double - stage shadow register pipeline for s - shaped ramps, do as follows: action: ? set shadow_option = b01 ( start _conf register 0x02). ? set start_en (4) = 1 and select one or more trigger_events ( start _conf register 0x02) . action: ? default configuration: set cyclic_shadow_regs = 0 ( start _conf register 0x02) . ? optional configuration: set cyclic_shadow_regs = 1 ( start _conf register 0x02) result: seven motion para m eters ( vmax , amax , dmax , bow1 ... 4 ) are altered at the next internal start signal b y the corresponding shadow register parameters ( sh_reg0 ... 6 ). simultaneously , these shadow register s are exchanged with the parameters of the second shadow stage ( sh_reg713 ). in case cyclic shadow registers are used, the second shadow register set ( sh_reg 713 ) is altered by the current motion profile set , e.g. 0x28 ( amax ) is written back to 0x48 ( sh_reg8 ). the other ramp registers remain unaltered. figure 37 : double - stage shadow register option 1, suitable for s - shaped r amps. i gree n arrows show default settings i b lue arrows show optional settings. ? ? description is c ontinued on next page . o p tion 2 : double - stage shadow r egis ter set for s - shaped r amps 4 0 4 6 4 5 4 1 4 2 4 3 4 4 x x x x x x r e g i s t e r a d d r e s s r e g i s t e r n a m e s t a r t _ e n ( 4 ) = 1 c a p t i o n c y c l i c _ s h a d o w _ r e g = 1 s h _ r e g 0 s h _ r e g 6 s h _ r e g 5 s h _ r e g 1 s h _ r e g 2 s h _ r e g 3 s h _ r e g 4 2 0 r a m p m o d e 2 4 v m a x 2 5 v s t a r t 2 6 v s t o p 2 7 v b r e a k 2 8 a m a x 2 9 d m a x 2 a a s t a r t 2 b d f i n a l 2 d b o w 1 2 e b o w 2 2 f b o w 3 3 0 b o w 4 4 7 4 8 4 9 4 a 4 b s h _ r e g 1 2 s h _ r e g 7 s h _ r e g 8 s h _ r e g 9 s h _ r e g 1 0 s h _ r e g 1 1 4 c s h _ r e g 1 3 4 d
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 72 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in case trapezoidal ramps are configured, a double - stage shadow register set can be used. seven relevant motion parameter s for trapezoidal ramps are affected when the shadow registers become active. in order to use a double - stage shadow register pipeline for trapezoidal ramps, do as follows: action: ? set shadow_option = b10 ( start _conf register 0x02). ? set start_en (4) = 1 and select one or more trigger_events ( start _conf register 0x02) action: ? default configuration: set cyclic_shadow_regs = 0 ( start_conf register 0x02) . ? optional configuration: set cyclic_shadow_regs = 1 ( start_conf register 0x02 ) . result: seven motion para m eters ( vmax , amax , dmax, astart, dfinal, vbreak , and vstart ) are altered at the next internal start signal by the corresponding shadow register parameters ( sh_reg0 ... 6 ). simultaneously, these shadow registers are exchanged with the parameters of the second shadow stage ( sh_reg713 ). if cyclic shadow registers are used, the second shadow register set ( sh_reg713 ) is altered by the current motion profile set , e.g. 0x27 ( vbreak ) is written back to 0x4c ( sh_reg 12 ). the other ramp registers remain unaltered. figure 38 : double - stage shadow register option 2, suitable for trapezoidal r amps. i green arrows show default settings. i blue a r r ow s show optional settings. ? ? description is c ontinued on next page . o ption 3: double - stage shadow register set for trapezoidal r amps ( vstart ) 4 0 4 6 4 5 4 1 4 2 4 3 4 4 x x x x x x r e g i s t e r a d d r e s s r e g i s t e r n a m e s t a r t _ e n ( 4 ) = 1 c a p t i o n c y c l i c _ s h a d o w _ r e g = 1 s h _ r e g 0 s h _ r e g 6 s h _ r e g 5 s h _ r e g 1 s h _ r e g 2 s h _ r e g 3 s h _ r e g 4 2 0 r a m p m o d e 2 4 v m a x 2 5 v s t a r t 2 6 v s t o p 2 7 v b r e a k 2 8 a m a x 2 9 d m a x 2 a a s t a r t 2 b d f i n a l 2 d b o w 1 2 e b o w 2 2 f b o w 3 3 0 b o w 4 4 7 4 8 4 9 4 a 4 b s h _ r e g 1 2 s h _ r e g 7 s h _ r e g 8 s h _ r e g 9 s h _ r e g 1 0 s h _ r e g 1 1 4 c s h _ r e g 1 3 4 d
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 73 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in case trapezoidal ramps are configured, a double - stage shadow register set can be used. seven relevant motion parameter s for trapezoidal ramp s are affected when the shadow registers become active. in order to use a double - stage shadow register pipeline for trapezoidal ramps, do as follows: action: ? set shadow_option = b10 ( start _conf register 0x02). ? set start_en (4) = 1 and select one or more trigger_events ( start _conf register 0x02) action: ? default configuration: set cyclic_shadow_regs = 0 ( start _conf register 0x02) . ? optional configuration: set cyclic_shadow_regs = 1 ( start _conf register 0x02) result: seven motion para m eters ( vmax , amax , dm ax, astart, dfinal, vbreak , and vstop ) are altered at the next internal start signal by the corresponding shadow register parameters ( sh_reg0 ... 6 ). simultaneously, these shadow registers are exchanged with the parameters of the second shadow stage ( sh_reg7 13 ). if cyclic shadow registers are used, the second shadow register set ( sh_reg713 ) is altered by the current motion profile set, e.g. 0x26 ( vstop ) is written back to 0x4d ( sh_reg 13 ). the other ramp registers remain unaltered. figure 39 : double - stage shadow register o ption 3 , suitable for trapezoidal r amps i green arrows show default settings. i blue arrow s show optional settings. ? ? turn page to see areas of special concern pertaining to this section. option 4 : double - stage s hadow register set for trapezoidal r amps ( vstop ) 4 0 4 6 4 5 4 1 4 2 4 3 4 4 x x x x x x r e g i s t e r a d d r e s s r e g i s t e r n a m e s t a r t _ e n ( 4 ) = 1 c a p t i o n c y c l i c _ s h a d o w _ r e g = 1 s h _ r e g 0 s h _ r e g 6 s h _ r e g 5 s h _ r e g 1 s h _ r e g 2 s h _ r e g 3 s h _ r e g 4 2 0 r a m p m o d e 2 4 v m a x 2 5 v s t a r t 2 6 v s t o p 2 7 v b r e a k 2 8 a m a x 2 9 d m a x 2 a a s t a r t 2 b d f i n a l 2 d b o w 1 2 e b o w 2 2 f b o w 3 3 0 b o w 4 4 7 4 8 4 9 4 a 4 b s h _ r e g 1 2 s h _ r e g 7 s h _ r e g 8 s h _ r e g 9 s h _ r e g 1 0 s h _ r e g 1 1 4 c s h _ r e g 1 3 4 d
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 74 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? the value s of ramp parameters , which are not selected by one of the four shadow options stay as originally configured , until the register is c hanged through an spi write request . also, the last stage of the shadow register pipeline retain s the valu es until they are overwritten by an spi write request if no cyclic shadow registers are selected. up to 15 internal start signals c an be skipped before the shadow register transfer is executed. in order to skip a defined number of internal start signals for the shadow transfer, do as follows: action: ? set shadow_option according to your specification. ? set start_en (4) = 1 and select one or more trigger_events ( start _conf register 0x02) ? optional configuration: set cyclic_shadow_regs = 1. ? set shadow_miss_cnt 0 ( start _conf register 0x02) according to the number of consecutive internal start signals that you specify to be ignored . result: the shadow register transfer is not executed with every internal start si gnal. instead, the specified num ber of start signals is ignored until the shadow transfer is executed through the ( shadow_miss_cnt +1) th start signal. the following f igure shows an example of how to make use of shadow_miss_cnt , in which the shadow register transfer is illustrated by an internal signal sh_reg_transfer. the signal miss counter current_miss_cnt can be re a d out at register address start_conf (23:20): figure 40 : shadow_ miss_cnt parameter for se veral i nternal s ta rt s ignals internal c alculation s to transfer the requested shadow bow values into internal structures require at most (320 / f clk ) [sec]. before any shadow register transfer is prompted, it is necessary t o wait for the completion of all internal calculation s for the shadow bow parameters. in order to make this better understood the following example is provided for a double - stage shadow pipeline for s - shaped ramps: precondition: shadow register transfer is activated ( start_en (1) = 1 and one or more trigger_events are selected) for s - shaped ramps ( shadow_option = b01) action ? set sh_reg0 , sh_reg1 , sh_reg2 (shadow register for vmax , amax , dmax ) . ? set sh_reg3 , sh_reg4 , sh_reg5 , sh_reg6 (shadow register for b ow1 4 ) . ? ensure that no shadow register transfer occurs during the next 320 / f clk [s] . result: shadow register transfer can be initiated after this time span. ! areas of special concern delayed shadow t ransfer areas of special concern ! s p i s h a d o w _ m i s s _ c n t = 0 i n t e r n a l s t a r t s i g n a l s h a d o w _ m i s s _ c n t = 5 s h a d o w _ m i s s _ c n t = 2 1 2 3 4 5 0 1 2 0 1 2 0 1 0 c u r r e n t _ m i s s _ c n t s h _ r e g _ t r a n s f e r
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 75 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? pipelin ing internal p arameters tmc4331 a provides a target pipeline for sequencing subordinate targets in order to easily arrange a complex target structure. the different target values must be assigned to the x_pipe0 7 register . if the target pipeline is enabled, a new assig nment cycle is initiated as soon as an internal start signal is gen erated; moving the values , as described , simultaneously : process description: ? a new xtarget value is assigned that takes over the value of x_pipe0 . ? every x_pipe n register takes over the value of its successor: x_pipe n = x_pipe n+ 1 in order to activate the target pipeline, do as follows: action: ? set pipeline_en = b0001 ( start_conf register 0x02) . result: the above mentioned process description is executed with every new internal start signal prompting. it is also possible to reassign the value of xtarget to one (or more) of the pipeline registers x _pipe07 . thereby, a cyclic target pipeline is created. in order to enab le a cyclic target pipeline, do as follows: action: ? set pipeline_en = b0001 ( start_conf register 0x02) . ? set xpipe_rewrite_reg in relation to the pipeline register where xtarget have to written back (e.g. xpipe_rewrite_reg = b00010000). result: the abov e mentioned process description is executed with every new internal start signal prompting , and xtarget is written back to the selected x_pipex register (e.g. xpipe_rewrite_reg = 0x10 ? xtarget is written back to x_pipe4 ) . the processes and actions describ ed on the previous p age , are depicted in the following f igure. the a ssignment cycle that is initiated when an internal start signal occurs is depicted. figure 41 : target pipeline with configuration o ptions confi guration and a ctivation of target p ipeline configuration of a c yclic target p ipeline 3 7 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 x t a r g e t x _ p i p e 0 x p i p e _ r e w r i t e _ r e g ( 0 ) = ' 1 ' x x x x x x r e g i s t e r a d d r e s s r e g i s t e r n a m e c a p t i o n p i p e l i n e _ e n = b 0 0 0 1 p i p e l i n e _ e n = b 0 0 0 1 x _ p i p e _ r e w r i t e _ r e g 0 x p i p e _ r e w r i t e _ r e g ( 1 ) = ' 1 ' x p i p e _ r e w r i t e _ r e g ( 2 ) = ' 1 ' x p i p e _ r e w r i t e _ r e g ( 3 ) = ' 1 ' x p i p e _ r e w r i t e _ r e g ( 4 ) = ' 1 ' x p i p e _ r e w r i t e _ r e g ( 5 ) = ' 1 ' x p i p e _ r e w r i t e _ r e g ( 6 ) = ' 1 ' x p i p e _ r e w r i t e _ r e g ( 7 ) = ' 1 '
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 76 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? the tmc4331 a pipeline (registers 0x380x3f) can be configured so that it s plit s up into maximal four segments . these segments can be used to feed the following internal parameters: ? xtarget register 0x37 . ? pos_comp register 0x32 . ? gear_ratio register 0x12 . ? general_conf 0x00 . consequently, these definite parameter value change s ca n be of importance concerning a continuous ramp motion and/or for reduced overhead synchronizing of several motion controllers. the pos_comp value c an be used to initiate a start signal generation during motion. therefore, it c an be useful to pipeline this parameter in order to avoid dependence on spi transfer speed. for instance, if the distance between two pos_comp values is very clo se and the current velocity is high enough that it miss es the second value before the spi transfer is finished, it is advisable to change pos_comp immediately after the start signal. the same is true for the gear_ratio parameter, which defines the step r esponse on incoming step impulses. some applications require very quick gear factor alteration of the slave controller . note that when the s tart signal is prompted directly, an immediate change c an be very useful in stead of altering the parameter by an spi transfer. likewise, it c an ( but must not ) be essential to change general configuration parameters at a defined point in time. a suitable application is a clearly defined transfer from a direct external control ( sd_in_mode = b01) to an internal ramp ( sd_ in_mode = b00) or vice versa because in this case the master/slave relationship is interchanged. the following pipeline options are available , which can be adjusted accordingly : pipeline activation o ptions pipeline_en (3: 0 ) description bx b bx b table 36 : pipeline activation o ptions using the pipeline for different i nternal registers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 77 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? t he pipeline_en parameter offers an open configuration for 16 different combinations of the pipeline segregation . as a result , the number of pipelines range from 0 to 4 . this also h as an impact on the pipeline depth . the possible options are as follows: e ight stage s , four stage s , three stage s and two stage s. in the pipeline mapping table below, the arrangement and depth of the pipeline is allocated according to the pipeline setup. the final register destination of pipeline registers are also depicted i n order to illustrate from which pipeline registers ( x_pipe07 ) the final target registers ( xtarget , pos_comp , gear_ratio , general_conf ) are fed. for example, if pos_comp and gear_ratio are chosen as parameters that are to be fed by the pipeline, two 4 - st age pipelines are created . when an internal start signal is generated, pos_comp assumes the value of x_pipe0 , whereas x_pipe4 feeds the gear_ratio register. but if pos_comp , gear_ratio and xtarget are selected as parameter destinations, two 3 - stage pipelines and one double - stage pipeline are created. when an internal start signal is generated, xtarget assumes the value of x_pipe0 , pos_comp assumes the value of x_pipe3 , whereas x_pipe6 feeds the gear_ratio regist er. more examples are described in detail on the following p age s - explaining some of the possible configurations and refer encing examples - listed in the table below. pipeline m apping ex. pipeline_en (3: 0 ) arrangement final transfer register for ? pipeline_en(3) gear_ratio ? pipeline_en(2) pos_comp ? pipeline_en( 1 ) xtarget ? pipeline_en(0) - b0000 - b0001 a b0010 b b0100 - b1000 c b0011 - b0101 - b1001 - b0110 - b1010 d b1100 f b0111 - b1011 e b1101 - b1110 g/h b1111 table 37 : pipeline mapping for different pipeline c onfigurations pipeline mapping o verview pipeline mapping t able
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 78 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? for all of the above shown configuration examples, it is possible to write back the current values of the selected registers ( xtarget , pos_comp , gear_ratio and/or general_conf ) to any of the pipeline registers of their assigned pipeline in order to generate cyclic pipelines. by selecting proper xpipe_rewrite_reg , the value that is written back to the pipeline register is selected automat ically to fit the selected pipeline mapping. below, several pipeline mapping examples with the corresponding configuration are shown . example a : cyclic pipeline for pos_comp , which has eight pipeline stages . example b: cyclic pipeline for gear_ratio , which has six pipeline stages . a b figure 42 : pipeline e xample a figure 43 : pipeline e xample b example c : cyclic pipeline s for xtarget and pos_comp , which ha ve four pipeline stages each . example d : cyclic pipeline s for gear_ratio , which has three pipeline stage s and general_conf , which ha s two pipeline stages . c d figure 44 : pipeline e xample c figure 45 : pipeline e xample d ? ? continued on next page. cyclic pipelining pipeline e xamples e xamples a+b: u sing one p ipeline examples c+d: u sing two p ipelines 3 2 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 p o s _ c o m p x _ p i p e 0 p i p l i n e _ e n = b 0 0 1 0 x p i p e _ r e w r i t e _ r e g = b 1 0 0 0 0 0 0 0 1 2 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 g e a r _ r a t i o x _ p i p e 0 x _ p i p e _ r e w r i t e _ r e g ( 7 ) = b 0 0 1 0 0 0 0 0 p i p l i n e _ e n = b 0 1 0 0 x p i p e _ r e w r i t e _ r e g = b 0 0 1 0 0 0 0 0 3 2 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 p o s _ c o m p x _ p i p e 0 3 7 x t a r g e t p i p l i n e _ e n = b 0 0 1 1 x p i p e _ r e w r i t e _ r e g = b 1 0 0 0 1 0 0 0 1 0 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 g e n e r a l _ c o n f x _ p i p e 0 p i p l i n e _ e n = b 1 1 0 0 x p i p e _ r e w r i t e _ r e g = b 0 0 1 0 0 1 0 0 1 2 g e a r _ r a t i o
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 79 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? example e: cyclic pipelines for xtarget and gear_ratio , which have three pipeline stages each and general_conf , which has two pipeline stages. example f: two cyclic pipelines for xtarget and gear_ratio , which have two pipeline stages each and a non cyclic pipeline for gear_ratio , which has three pipeline stage s. e f figure 46 : pipeline e xample e figure 47 : pipeline e xample f example g: cyclic pipelines for xtarget , pos_comp , gear_ratio and general_conf , which have two pipeline stages each. example h: four non cyclic pipelines for xtarget , pos_comp , gear_ratio and general_conf , which have two pipeline stages each. g h figure 48 : pipeline e xample g figure 49 : pipeline e xample h examples e+f: using three p ipelines examples g+h: using four p ipelines 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 x _ p i p e 0 3 7 x t a r g e t p i p l i n e _ e n = b 1 1 0 1 x p i p e _ r e w r i t e _ r e g = b 1 0 1 0 0 1 0 0 1 0 g e n e r a l _ c o n f 1 2 g e a r _ r a t i o 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 x _ p i p e 0 3 7 x t a r g e t p i p l i n e _ e n = b 0 1 1 1 x p i p e _ r e w r i t e _ r e g = b 1 0 0 0 0 0 1 0 1 2 g e a r _ r a t i o 3 2 p o s _ c o m p 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 x _ p i p e 0 3 7 x t a r g e t p i p l i n e _ e n = b 1 1 1 1 x p i p e _ r e w r i t e _ r e g = b 1 0 1 0 1 0 1 0 1 0 g e n e r a l _ c o n f 1 2 g e a r _ r a t i o 3 2 p o s _ c o m p 3 8 3 9 x _ p i p e 1 3 a x _ p i p e 2 3 b x _ p i p e 3 3 c x _ p i p e 4 3 d x _ p i p e 5 3 e x _ p i p e 6 3 f x _ p i p e 7 x _ p i p e 0 3 7 x t a r g e t p i p l i n e _ e n = b 1 1 1 1 x p i p e _ r e w r i t e _ r e g = b 0 0 0 0 0 0 0 0 1 0 g e n e r a l _ c o n f 1 2 g e a r _ r a t i o 3 2 p o s _ c o m p
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 80 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? masterless synchronization of several motion c ontrollers via start p in start pin can also be assigned as tristate input in order to synchronize several microcontroller masterless. in this cas e start is assigned as tristate. a busy state is enabled. during this busy state, start is set as output with a strong ly driven inactive polarity. if the internal start signal is generated C after the internal start timer is e xpired C start pin is assigned as input. additionally, a weak output signal is forwarded at start. during this phase, the active start polarity is emit ted . i n case the signal at start input is set to active polari ty , because all members of the signal line are ready, start output remains active (strong driving strength) for start_out_add clock cycles. then, busy state is active ag ain until the next start signal occurs. in order to activate tristate start pin , do as follows: action: ? set busy_en = 1 ( start_conf register 0x02) . result: the above mentioned process description is executed. i n case start pin is connected with start pins of other tmc4331 a devices, it is recommend that a series resistor (e.g. 220 ) is connected betwee n the devices to limit the short circuit current flowing that can flow during the configuration phase when different voltage levels at the start pins of the different devices can occur . note: ? avoid that short circuits last too long. activation of the tristate start p in start pin c onnection
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 81 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 10. serial data output tmc4331 a provides an spi interface for initialization and configuration of the motor driver ( in addition to the step/dir output) before and during motor motion. i t is possible to control tmc stepper drivers during spi motor drive. the spi interface is used for the following tasks: ? tmc4331 a integrates an adjustable cover register for c onfiguration purposes in orde r to adjust tmc motor driver chips and thir d parties chips easily. ? the integrated microste p sine w ave l ook up table ( mslut ) gen erates two current values that represent sine and cosine values. ? these t wo current values can be transferred to a tmc motor driver chip at a time, in order to energize the motor coils. this occurs within each spi datagram. a series of c urrent values is transferred to move the motor. values of the mslut are adjusted using velocity ramp dependent scale values that align the maximum amplitude current values to the requirements of certain velocity slopes. pin names for spi motor drive pin n ames type remarks nscsdrv output chip select output to motor driver, low active . sckdrv output serial clock output to motor driver . sdodrv inout as output serial data output to motor driver . sdidrv input serial data input from motor driver . stdby_clk output clock output, standby output , or chopsync clock output . table 38 : pin names for spi motor d rive register names for spi output registers register n ame register a ddress remarks general_conf 0x00 rw affect switches: bit 14 : 13 , bit19, bit20 , bit28 . reference_conf 0x01 rw affect switches: bit26, bit 27 , bit 30 . spiout_conf 0x04 rw configuration register for spi output communication . step_conf 0x0a rw microsteps per fullstep, fullstep s per revolution, and motor status bit event selection . dac_addr 0x1d rw spi addresses/commands which are put in front of the dac values: coila: dac_addr (15 : 0) , coilb: d ac_addr ( 31:16 ) spi_switch_vel 0x1f rw velocity at which automatic cover datagram are sent . chopsync_div chopper clock divider (bit 11 : 0) . fs_vel 0x60 w velocity at which fullstep drive are enabled . cover_low 0x6c w lower 32 bit s of the cover register (c to motor driver) . cover_high 0x6d w upper 32 bit s of the cover register (c to motor driver) . cover_drv_low 0x6e r lower 32 bit s of the cover response register (motor driver to c) . cover_drv_high 0x6f r upper 32 bit s of the cover response register (motor driver to c) . current_conf 0x05 rw current scaling configuration . scale_values 0x06 rw current scaling values . stdby_delay 0x15 rw delay time after standby mode is valid . spi interface configur ation
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 82 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? register names for spi output registers register n ame register a ddress remarks freewheel_delay 0x16 rw delay time after freewheeling is valid . vdrv_scale_limit 0x17 rw velocity setting for changing the drive scale value. up_scale_delay 0x18 rw increment delay to a higher scaling value; 24 bit s. hold_scale_delay 0x19 rw decrement delay to the hold scaling value; 24 bit s. drv_scale_delay 0x1a rw decrement delay to the drive scaling value . boost_time 0x1b rw delay time after ramp start when boost scaling is valid . scale_param 0x7c r actual current scaling parameter; 8 bit s. currenta currentb 0x7a r actual current values of the mslut : sin (coil a) and sin90_120 (coil b); 9 bit for each. currenta_spi currentb_spi 0x7b r actual scaled current values of the mslut : sin (coil a) and sin90_120 (coil b); 9 bits for each. mslut registers 0x707 8 w mslut values definitions . mscnt 0x79 r actual microstep position of the mslut . start_sin start_sin90_120 dac_offset 0x7e rw sine start value of the mslut (bit 7 : 0) . cosine start value of the mslut (bit 23 : 16) . offset value for dac output values (bit 31 : 24) . table 39 : dedicated spi output r egisters getting s tarted with tmc m otor d rivers in this chapter information is provided about how to easily start up a connected tmc motor driver . in order to start up a connected tmc motor stepper driver, proper setup of spiout_conf regi ster 0x04 is important . tmc4331 a offers presets for current transfer and automatic configuration routines if the correct tmc driver is selected. status bits of tmc motor drivers are also transmitted to the status register of the motion controller. tmc4331 a provides a programmable look up table for storin g the current wave. per default, the tables are preprogrammed with a sine wave, which is a good starting point for most stepper motors. setting up spiout_conf correctly
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 83 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? sine wave look up tables tmc4331 a provides a programmable look up table (lut) for storin g the current wave. rep rogramming the table from its predefined values to a motor - specific wave allows improved motor - reliant microstepping, particularly w hen using low - cost motors. tmc4631 - la provides a default configuration of the internal mic rostep table mslut. in case internal mslut is used, proceed with sectio n 10.3. ( p age 89 ) in order to setup a well - defined serial data connection to the stepper motor driver. the following explanations that are provided in this sec tion only address engineers who use their own mic rostep table definition. the internal microstep wave table maps the microstep wave from 0 to 90 for 256 micro s teps . it becomes automatically and symmetrically extended to 360 that consequently comprises 1024 microste ps . as a result, the microstep counter mscnt ranges from 0 to 1023 . o n ly a quarter of the wave is stored because th is minimize s required memory and the amount of programmable data . therefore, only 256 bits ( ofs 00 to ofs 255) are required to store the quarter wave. these bits are mapped to eig ht 32 - bit registers mslut [0] (register 0x70) to mslut [7] (register 0x77). when reading out the table the 10 - bit microstep counter mscnt addresses the fully extended wave table. the mslut is an incremental table. this means that a certain order and succession is predefined at every next step based on the value before, using up to four flexible programmable segments within the quarter wave. the microstep limits of the four segments are contr oll ed by the position registers x1, x2, and x3. within these segments the next value of the mslut is calculated by adding the base wave inclination wx - 1 (if ofs =0) or its successor wx (if ofs =1). because four segments are programmable, four base wave incl inations are available as basic increment value: 0, 1 , 2, or 3 . thereby , even a negative w ave inclination can be realized. this is shown in the next f igure where the values in last quarter segments are decreased or remain constant with every step towards mscnt = 255. figure 50 : lut programming e xample settings alert ! programming sine wave look up tables sine wave t able s tructure m s c n t y 2 5 6 2 5 6 2 4 8 - 2 4 8 5 1 2 7 6 8 0 0 x 1 x 3 x 2 w 0 : + 2 / + 3 w 1 : + 1 / + 2 w 2 : + 0 / + 1 w 3 : - 1 / + 0 l u t s t o r e s e n t r i e s 0 t o 2 5 5 2 5 5 s t a r t _ s i n s t a r t _ s i n 9 0 _ 1 2 0
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 84 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? actual current values output when the microstep sequencer advances within the microstep table (mslut) , it calculates the actu al current values for the motor coils with each microstep, and stores them to the register 0x7a , which comprises the values of both waves currenta and currentb . however , the incremental coding requires an abs olute initialization C especially when the microstep table becomes modified. therefore, currenta and currentb become re - initialized with the start values whenever mscnt passes zero. as mentioned above , the mslut can be adapted to the motor requirements. in order to understand the nature of incremental coding of the microstep table, the characteristics of the microstep wave must be understood, as described in the list below: charac teristics of a 2 - phase motor microstep table: ? in principle, it is a reverse characteristic of the motor pole behavior. ? it is a polished wave to provide a smooth motor behavior. there are no jumps within the wave. ? the phase shift between both phases is exactly 90, beca use this is the optimum angle of the poles inside the motor. ? the zero transition is at 0. the curve is symmetrical within each quadrant (like a sine wave). ? the slope of the wave is normally positive, but due to torque variations it can also be (slightly) negative. ? but it must not be strictly monotonic as shown in the figure above. considering these facts, it becomes clear that the wave table can be compressed. the incremental coding applied to the tmc4331 a uses a format that reduces the required informa tion - per entry of the 8 - bit by a 2 56 - entry wave table - to slightly more than a single bit. how to p rogram the i nternal mslut the principle of incremental encoding only stores the difference between the act ual and the next table entry. in order to attain an absolute start value, the first entry is directly stored in start_sin . also, for ease - of - use, the first entry of the shifted table for the second motor phase is stored in start_sin_90_120 . based on these start valu es , every next table entry is calculated by adding an increment inc to the former value. this increment is the base wave inclination value wx whenever its corresponding ofs bit is 1 or wx C 1 if ofs = 0: inc = wx + (ofs C 1). the base wave inclination can be set to fou r different values (0, 1, 2, 3), because it consists of two bit s . because the wave inclination do es not change dramatically , tmc4331 a provides four wave inclination segments with the base wave inclinations (w0, w1, w2, and w3) and the segment bord ers (0, x1, x2, x3, and 255), as shown in the left quarter of the mslut diagram in figure 48 , p age 83 . wave inclination characteristics wave inclination segment base wave inclination segment r anges 0 w0 0 x1 1 w1 x1 x2 2 w2 x2 x3 3 w3 x3 255 table 40 : wave inclination characteristics of internal mslut actual current calculations characteristics of a 2 - phase stepper motor microstep t able principle of incremental encoding
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 85 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? setup of mslut s egments all base wave inclination values (each consists of two bits) as well as the border values (each consists of eight bit) between the segments are a djustable . they are assigned by mslutsel register 0x78. in order to change the base wave inclination values and the segment borders, do as follows: action: ? define the segment borders x1, x 2, and x3 and the base wave inclination values w0w3 according to the requirements ? set register mslutsel (31:24) = x3 . ? set register mslutsel (23:16) = x2 . ? set register mslutsel (15:8) = x1 . ? set register mslutsel (7:6) = w3 . ? set register mslutsel (5:4) = w2 . ? set register mslutsel (3:2) = w1 . ? set register mslutsel (1:0) = w0 . result: the segments and the base wave inclination values of the internal mslut are changed. note : ? it is not mandatory to define four segments. for instance, if only two segments are required, set x2 and x3 to 255. then, w0 is valid for segment 0 between mscnt = 0 and mscnt = x1, and w1 is valid between mscnt = x1 and mscnt = 255 (segment 1). in order to change the ofs bits, do as follows: action: ? set mslut [0] register 0x70 = ofs 31 ofs 00 . ? set mslut [1] register 0x71 = ofs 63 ofs 32 . ? set mslut [2] reg ister 0x72 = ofs 95 ofs 64 . ? set mslut [3] register 0x73 = ofs 127 ofs 96 . ? set mslut [4] register 0x74 = ofs 159 ofs 128 . ? set mslut [5] register 0x75 = ofs 191 ofs 160 . ? set mslut [6] register 0x76 = ofs 223 ofs 192 . ? set mslut [7] register 0x77 = ofs 255 ofs 224 . result: the ofs bits of the internal mslut are changed. when modifying the wave: s pecial care has to be applied in order to ensure a smooth and symmetrical zero transition when ever the quarter wave becomes expanded to a f ull wave. when adjusting the range: the maximum resulting swing of the wave should be adjusted to a range of ? 248 to 248, in order to achieve the best possible resolution while at the same time leaving headroom for a hysteresis based chopper to add an offset. base wave inclination and border values ! areas of special concern zero crossing
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 86 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? current waves start values as both waves are shifted by 90 for two - phase stepper motors, the sine wave starts at 0 when mscnt = 0. by comparison, the cosine wave begins at 90 when mscnt = 256. a t this starting points the current values are currenta = 0 for the sine wave and currentb = 247 for the cosine wave. in contrast to the starting microstep positions that are fixed, these starting current values can be redefined if the default start values do not fit for the actual mslut. in order to change the starting current values of the mslut, do as follows: action: ? define the start values start_sin and start_sin90_120 according to the requirements. ? set register 0x7e (7:0) = start_sin ? set register 0x7e (23:16) = start_sin90_120 result: the starting values f or both waves are adapted to mslut. default mslut the default sine wave table in tmc drivers uses one segment with a base inclination of 2 and one segme nt with a base incl ination of 1 ( see default value of the mslutsel register 0x78 = 0xffff8056). the segment border x1 is located at mscnt = 128. the base wave inclination s are w0 = b10 (=2) and w1 = b01 (=1). as a result, between mscnt = 0 and 128, the increment value inc is either 1 (if ofs = 0) or 2 (if ofs = 1). and b etween mscnt = 128 and 255, the increment value inc is either 0 (if ofs = 0) or 1 (if ofs = 1). this reflects the stronger rise in the first segment of the mslut in contrast to the second segment. the maximum value is start_sin90_120 = 247. s tarting current v alues of mslut configuration base wave inclinations
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 87 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? explanatory notes for base wave inclinations in the following example four segments are defined. each segment has a different base wave incli nation to illustrate each possible entry : segment 0: w0 = 3 which means that the increment value is +2 or +3. segment 1: w0 = 2 which means that the increment value is +1 or +2. segment 2: w0 = 1 which means that the increment value is 0 or +1. segment 3: w0 = 0 which means that the increment value is ? 1 or 0 . i in addition to the mslut curve (black line), which is defined by the given ofs bits, all four segments show upper limit s (red line); in case all ofs bits in the particular segments are set to 1 . i th e green line shows the lower limit in case all ofs bits in the particular segments are set to 0. figure 51 : mslut curve with all possible base wave inclinations (highest inclination first) in order to set up a standard sine wave table for the mslut, the following co n si derations have to be taken into account: precon siderations: ? the microstep table for the sta ndard sine wave begins with eight entries (0 to 7) {0, 1, 3, 4, 6, 7, 9, 10 } etc. ? the maximum difference between two values in this section is +2, whereas the minimum difference is +1. ? while advancing according to the table, the very first time the difference between two mslut values is lower than +1 is between position 153 and position 154. both entries are identical. ? the start value is 0 for the sine wave . ? the calculated value for position 256 ( i.e. start of cosine wave) is 247. ? ? description is c ontinued on next page . definition of segments 0,1,2,3 standard sine wave setup considerations prior to setup of mslut y 2 5 6 0 + 2 / + 3 + 1 / + 2 + 0 / + 1 - 1 / + 0 2 5 5 x 1 x 2 x 3 s e g m e n t u p p e r l i m i t s s e g m e n t l o w e r l i m i t s 0 s e g m e n t i n c l i n a t i o n w
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 88 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in order to set up the standard sine wave table, proceed as follows: action: ? set a starting value start_sin = 0 matching sine wave entry 0. ? set a base wave inclination range of w0 = b10 = 2 to skip between +1 / +2 , valid from 0 to x1. ? calculate the differences between every entry : {+1, +2, +1, +2, +1, +2, +1,} . ? set the microstep table entries ofs xx to 0 for the lower value (+1); 1 for the higher value (+2). thus, the first seven microstep table entries ofs 00 to ofs 06 are: {0, 1, 0, 1, 0, 1, 0 } ? the base wave inclination must be lowered at position 153, at very latest. use the next base wave inclination range 1 with w1 = b01 = 1 to skip between +0 and +1. ? set x1 = 153 in order to switch to the next inclination range. from here on , an offset ofs xx of 0 means add nothing; 1 means add +1. ? set start_sin90_120 = 247 , which is equal to the value at position 256. ? only two of four wave segments with different base wave inclinations are used. t he remaining wave inclination ranges w2 and w3 sh ould be set to the same value as w1; and x2 and x3 c an be set to 255. thereby , only two wave inclination segments are effective. result: a standard sine wave is defined as mslut. the following table shows an extract of this curve. overview of the microstep behavior example microstep number 0 1 2 3 4 5 6 7 153 154 255 desired table entry 0 1 3 4 6 7 9 10 200 200 247 difference to next entry 1 2 1 2 1 2 1 0 0 required segment inclination +2 +2 +2 +2 +2 +2 +2 +1 +1 of s bit entry 0 1 0 1 0 1 0 0 0 table 41 : overview of the microstep behavior example standard sin e wave setup
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 89 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi output interface configuration parameters tmc4331 a provides an spi output interface. in the next section, the configuration of the interface parameters is explained in detail. the table below lists the pins that are dedicated to spi output communication: spi output communication p in s pin description nscsdrv lo w active chip select signal . sckdrv spi output clock . sdodrv mosi C o utput pin to transfer the datagram to the motor driver. sdidrv miso C input pin which receives the response from the motor driver. the response is sampled during the data transfer to the motor driver. table 42 : spi output communication pins because tmc4331 a represents the master of spi co mmunication to the motor driver C which is the slave C i t is mandatory to set up the timing configuration for the spi output. tmc4331 a provides an spi clock , which is generated at the sckdrv output pin. i n order to configure the timing of the spi clock, set up spiout_conf register 0x04 a s follows: action: ? set the number of internal clock cycles the serial clock should stay low at spi_out_low_time = spiout_conf (23:20). ? set the number of internal clock cycles the serial clock should stay high at spi_out_ high _time = spiout_conf (27:24). ? also, an spi_out_block_time = spiout_conf (31:28) can be se t for a minimum time period during which no new datagram is sent afte r the last spi output datagram. result: spi output communication scheme is set. during the inactive phase between to spi datagr ams - which is at least spi_o ut_block_time clock cycles long - the sckdrv and nscsdrv pins remain at high output voltage level. the timing of the spi output communication is illustrated in the following figure. figure 52 : spi o utput datagram t iming pins dedicated to spi o utput c ommunication set up of spi output timing configuration n s c s d r v _ s c l k s c k d r v _ n s d o s d o d r v _ s c l k s d i d r v _ n s c l k b i t c d l - 1 b i t c d l - 2 b i t 0 b i t 3 9 b i t 3 8 b i t 0 s p i _ o u t _ l o w _ t i m e / f c l k s p i _ o u t _ b l o c k _ t i m e / f c l k s p i _ o u t _ h i g h _ t i m e / f c l k s a m p l e p o i n t s
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 90 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? the minimum time period for all three parameters is 2 / f clk . if an spi output parameter is set to 0, it is altered to 2 clock cycles internally. a maximum time period of 15/ f clk can be set for all three parameters. thus, spi clock frequency f spi_c lk covers the following range: f clk / 30 f spi_clk f clk / 2. basicall y, spi output communication serves as automatic current datagram transfer to the connected motor driver. tmc4331 a uses the internal microstep lookup table (mslut) in order to provide actual current motor driver data . ? with every step that is initialized by the ramp generator the ms cnt value is increased or decreased, dependent on ramp direction. ? the mscnt register 0x79 (readable value) contains the current microstep position of the sine value. ? accordingly, the current values currenta (0x7a) and currentb (0x7b) are altered. ? in cas e the output configuration of tmc4331 a allows for automatic current transfer an updated current value leads to a new datagram transfer. ? thereby , the motor driver always receives the latest data. the le ngth for current datagrams can be set automatically an d tmc4331 a converts new values into the selected datagram format, usually divided in amplitude and polarity bit for tmc motor drivers. by altering the microstep resolution from 256 ( mstep_per_fs = b0000) to a lower value, an internal step results in more than one mslut step. for instance, if the microstep resolution is set to 64 ( mstep_per_fs = b0010), mscnt is either increased or decreased by 4 per each internal step. accordingly, the passage through the mslut skips thre e current values per each internal step to match the new microstep resolution. in addition to automatic current datagram transfer, the microcontroller can communicate directly with the motor driver through tmc4331 a by using cover datagrams. this communication channel can be us eful for conf iguration purposes because no additional spi communication channel between microcontroller and motor driver is necessary. up to 64 bits can be assigned for one cover datagram. th is 64 - bit spi cover re gister is separated into two 32 - bit registers - cover_high register 0x6d and cover_low register 0x6c . the cover_high register i s only required if more than 32 bits must be sen t once. how many bits are sent within one cover datagram is defined by the cover datagram length cover_data_length . in order to define the cover datagram length, do as follows: action: ? set the number of cover datagr am bits at cover_data_length = spiout_conf (19:13). result: the cover datagram length is set to cover_data_length bits. if this parameter is set higher than 64, the cover register data length is still maximum 64 bits . i for tmc motor drivers it is possible to s et cover_data_length = 0. in this case, the cover data length is selected automatically, dependent on the chosen motor driver. more details are provided on the subsequent p age s. minimum and m aximum t ime p eriod current diagrams process description change of microstep resolution cover datagrams communic a tion between c and driver how to defin e cover datagram le ngth
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 91 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? the lsb (last significant bit) of the whole cover datagram register is located at cover_low (0). as long as cover_data_length < 33, only cover_low or parts of this register are required for cover data transfer. if more than 32 bits are necessary, the complete cover_low and (parts of) the cover_high register are required for spi cover data transfer. note : ? every spi communication starts with the most significant bit (msb ). option 1: cover_data _length < 33 bits in order to send a cover datagram - that is smaller than 33 bits - do as follows: action: ? set cover_ low ( cover_ data_length - 1:0) register 0x6c = cover_data. result: after a valid register request to cover_low , spi output is sent out cover_data_length bits of cover_low register. option 2: cover_data _length > 32 bits in orde r to send a cover datagram - that consists of more than 32 bits - do as follows: action: ? split cover data into two segments: ? cover_data_low = cover_data(31:0). ? cover_data_high = cover_data >> 32. ? cover_data _high = cover_data(31:0). ? set cover_ high ( cover_ data_length ? 32:0) register 0x6d = cover_data_high . ? set cover_ low register 0x6c = cover_data_low . result: after a valid register request to cover_low , spi output is sent out cover_data_length bits that c omprises register values of cover_high and cover_low . the cover register and the datagra m struct ure are illustrated in the figure below: figure 53 : cover data register c omposition (cdl C cover_data_length ) ? ? continued on next page . sending cover datagrams cover datagrams with 3 3 bits and more b i t 6 3 b i t 6 2 b i t 3 3 b i t 3 2 . . . b i t 3 1 b i t 3 0 b i t 1 b i t 0 . . . b i t 3 1 b i t 3 0 b i t 1 b i t 0 . . . c o v e r _ h i g h c o v e r _ l o w c o v e r r e g i s t e r b i t 3 1 b i t 3 0 b i t 1 b i t 0 . . . m s b i f c d l = 6 3 m s b i f c d l = 3 0 ( c o v e r _ h i g h n o t r e q u i r e d )
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 92 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? because the transfer of a cover datagram is usually accompanied by a data transfer from the motor driver, the response is stored in registers; and is thus available for the microcontroller. cover_drv_high register 0x6 f and cover_drv_low reg ister 0x6e form this cover response register that can also comprise up to 64 bits. similar to cover_low and cover_high , the motor driver response is divided in the registers cover_drv_low and cover_drv_high . the composition of the response cover register and also the positioning of the msb follow the same structure. at the end of a successful data transmission, the event cover_done becomes set. this indicates t hat the cover register data is sent to the motor driver and that t he received response is stored in the cover_drv_high register 0x6f and cover_drv_low register 0x6 e . in certain s etups, it can be useful to automatically send ramp velocity - dependent cover datagrams , e.g. to change chopper settings duri ng motion . note: ? this feature is only available if the cover datagram length do es not exceed 32 bits. in order to activate ramp velocity - dependent automatic cover data transfer , do as follows: action: ? define the trigger velocity when ever an automatic cover datagram transfer is initiated. ? set spi_switch_vel register 0x1d to this absolute velocity [pps]. ? set cover_low register 0x6c to the cover_data, which is valid for l ower velocity values . ? set cover_ high register 0x6d to the cover_data , which is valid for higher velocity values. ? set automatic_cover = 1 ( reference_conf register 0x01) . result: whenever the absolute internal ramp velocity | vactual | passes the spi_switch_ vel value, the particular cover data is sent to the motor driver, cover_low is sent i n case | vactual | < spi_switch_vel , cover_high is sent in case | vactual | spi_switch_vel . receiving r espo nses to cover d atagrams cover_done e vent configuring automatic generation of cover d atagrams
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 93 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? overview : tmc motor driver connections as mentioned before , tmc4331 a is able to set the cover register length automatically in case a tmc motor driver is connected. also, several additional automatic features for the spi communication are available by selecting tmc motor drivers. tmc stepper motor driver settings the spi and step/dir communication schemes are available for the following product lines that are explained in greater detail further below: ? tmc236, tmc239 ? tmc246, tmc248, tmc249 ? tmc260, tm c261, tmc262, tmc2660 ? tmc389 ? tmc21 30 in order to enable an operating spi output setting for a connected tmc stepper motor driver, proceed as follows: action: ? set spi_out_low_time , spi_out_ high _time , and spi_out_block _time according to the tmc motor driver specification, as explained before. ? s et cover_data_length = 0 (bit19:13 of spiout_conf register 0x04) . ? set spi_output_format = spi_out_conf (3:0) according to the connected spi mot or drive r as seen below in the table below. result: the communication scheme is now prepared for the connected tmc motor driver with all available features. tmc s tepper motor driver options tmc motor d river spi_output_format = spi_out_conf ( 3 : 0 ) c over re gister datagram l ength cover_data_lentgh =0 automatic current datagram t ransfer cover register d atagram t ransfer spi output off b0000 b ? ? b ? ? b b ? ? b b ? ? table 43 : tmc stepper motor driver options available spi and step/dir ? c ommunication s chemes for tmc motors how to enable spi output settings for tmc stepper motor drivers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 94 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? when a tmc motor driver receives a current datagram or a cover datagram that is transmitted via spi output of tmc4331 a , status data is sent back to the tmc4331 a controller immediately. the response is stored in the cover_drv_low 0x6e and cover_drv_high 0x6f registers, just like all other cover requests . the type and sequence o f the status bits that are sent back ar e dependent on the selected mot or driver. a detailed list for every motor driver is prese nted in the next sections, in which the motor driver communication speci fics for every driver family are explained separately. t he mapping of the availabl e status bits to the tmc4331 a status register is similar for each and eve ry tmc stepper motor driver . the last eight bit s C status (31:24) C are e qual to the transferred motor status bits. a detailed overview is given in the register c hapter 15.11. (p age 151 ). tmc4331 a also provides one ev ent at events (30) that is connected with the motor driver status bits . here, any of the motor driver status bits can function as the base for this event. in order to activate a motor driver status bit for the motor event events (30), do as follows: action: ? selected one or more of the motor driver status fo r the motor event by assigning mstatus_selection = step_conf (2 3:16) register 0x0a accordingly. result: in case one of the selected motor status bits is activated (wired - o r) , the motor event switch events (30) generates an event. in order to generate an interrupt for this motor event, configure the intr output accordingly, as explained in section 5.3. ( p age 22 ) . tmc motor driver response datagram and status bits events and interrupts based on motor driver status bits
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 95 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? stall detection and stop - on - stall tmc stepper motor driver chips with stallguard and stallguard2 can detect stall and overload conditions based on the motors back - emf without the need of a position sensor. the stall detection status is returned via spi. for more information, refer to the appnote parameterization of stall guard2 & coolstep that is available online at www.trinamic.com . except for tmc23x and tmc24x , which forward three load detection bits , the motor stall status is represented by one status bit. tmc4331 a is abl e to stop the internal ramp as soon as a stall is recognized. because stall bit activation can occur unwanted during motion with a low velocity, it is also possible to s et up a velocity threshold for the stop - on - s tall beh avior. in order to activate a stop - on - s tall for the internal velocity ramp, do as follows: action: ? set vstall_limit register 0x67 [pps] according to minimum absolute velocity value for a correct stall recognition. ? set stop_on_stall = 1 (bit26 of reference_conf register 0x01) . ? set drive_after _stall = 0 (bit27 of reference_conf register 0x01) . result: the internal ramp velocity is set immediately to 0 when ever a stall is detected and the following is true: | vactual | > vstall _ limit . then, the stop_on_stall event is also generated. i t he status bit stall guard that is directly mappe d from the motor stepper driver, which is listed in status (24). this flag is always activated as soon as the motor driver generates the stall guard status bit. i the active_stall status bit = status (11) is activated as soon as a stall is detected and | vactual | > vstall_limit . in order to activate the internal velocity ramp after a stop - on - stall, do as follows: action: ? read out the events register 0x0e to unlock the event stop_on_stall . ? set drive_after _stall = 1 (bit27 of r eference_conf register 0x01) . result: the internal ramp velocity is no longer blocked by the stop - on - stall event. i in order to activate the stop - on - stall behavior again, reset drive_after _stall again manually to 0. stallguard and stallguard2 f unctionality representation of the motor stall status internal velocity ramp stop - on - stall a ctivation internal velocity ramp activation after stop - on - stall
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 96 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc23x, tmc24x s tepper motor d river in this chapter specific information pertaining to the se t up of tmc23x and tmc24x is provided. tmc4331 a provides the following features in order to support the tmc23x motor stepper driver family well : ? aut omatic mixed decay chopper mod e ? chopsync ? automatic switchover between microstep and fullstep operation ? controlled pwm signal generation and automatic switchover between spi and pwm mode ; see section 12.2. ( p age 124 ). in the following section, the features are explained in greater detail. i for further information, please refer to the manual of the particular stepper driver motor. in orde r to activate the spi data transfer and spi feature set for a connected tmc23x stepper motor driver, do as follows: action: ? set spi_output_format = b1000 ( spi_out_conf register 0x04) . ? set cover_data_length = 0 ( spi_out_conf register 0x04) . result: tmc23x is selected as connected stepper motor driver. in order to activate the spi data transfer and feature set for a connected tmc24x stepper motor driver, do as follows: action: ? set spi_output_format = b100 1 ( spi_out_conf register 0x04) . ? set cover_data_length = 0 ( spi_out_conf register 0x04) . result: tmc24x is selected as connected stepper motor driver. i in addition to the tmc23x features mentioned above, the tmc24x stepper driver family provides three stallguard bits a s load measurement indicator. therefore, the tmc24x stepper family is supported by the tmc4331 a for the following: ? stall detection and ? stop - on - stall behavior ? ? turn to next page for more information. tmc 23x/ 24x s upport tmc23x setup tmc24x setup
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 97 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc4331 a maps the following status bits of tmc23x/24x stepper drivers C which are transferred with each spi datagram C to the status register 0x0f: tmc4331 a only forward new current data ( currenta_spi and currentb_spi at register 0x7b) for tmc23x/tmc24x in case the uppe r five bits of one of the two 9 - bit current values changes; because tmc23x and tmc24x current data consist of four bit current values and one polarity bit for each coil. consequently, a lteration s of the internal m icrostep resolution only apply i n case the new microstep resolution is lower than 16 bit s . because spi current data is transmitted, automatic switchover from microsteps to fullsteps and vice versa is only depend ent on the internal ramp velocity. i n order to activate automatic switchover between microstep and fullstep operation , do as follows: action: ? set fs_vel register 0x60 according to the velocity [pps ] at which the switchover must happen . ? s et fs_en = 1 (bit19 of general_conf register 0x00) . result: now, current values are switched to fullstep values in case | vactual | fs_vel . a sw itchback from fullsteps to steps is executed in case | vactual | < fs_vel . the status bit fs_active is set active as long as fullstep mode is enabled and activated. ? ? turn to next page for more information. tmc23x/24x status b its status register mapping for tmc23x/24x status bit @ tmc4331 a status flag @tmc23x/24x description status (24) uv undervoltage flag. status (25) ot over temperature flag. status (26) otpw temperature prewarning flag. status (27) oca overcurrent flag for bridge a. status (28) ocb overcurrent flag for bridge b. status (29) ola open load flag for bridge a. status (30) olb open load flag for bridge b. status (31) ochs overcurrent high side flag. table 44 : mapping of tmc23x/24x status flags tmc23x/24x m icrosteps automatic fullstep switchover for tmc23x / 24x
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 98 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc4331 a supports the mixed decay feature for the tmc23x/24x chopper in spi_out_conf register 0x04. in order to configure mixed decay bits for tmc23x/24x, do as follows: action: ? set mixed_decay = b00 if mixed decay must always be deactivated. ? set mixed_decay = b01 if mixed dec ay must be activated for each coil during the falling ramp of the sine cur ve until reaching value 0. ? set mixed_decay = b10 if mixed decay must always be activated, except during standstill. ? set mixed_decay = b11 if mixed decay must always be activated. result: the mixed decay bits for tmc23x/24x stepper motor drivers are set according to the configuration and the internal mslut values. i please refer to the tmc23x/tmc24x datasheets to get more information about the configuration of mixed decay bits. tmc4331 a forwards the internal clock at the output pin stdby_clk. this pin can also be used to provide an external clock for the tmc23x/24x stepper motor driver. this external clock generator automatically generates clock cycles that are modified by the c h opsync f eature if tmc23x/24x is confi gured as connected motor driver. using c hopsync enhance s the motor drive for fast and smooth operation. in order to enable the c hopsync clock via the stdby_clk pin, do as follows: action: ? set chopsync_div register 0x1f to ge nerate an external clock frequency f osc according to the following equation: f osc = f clk / chop_sync_div . ? set stdby_clk_pin_assignment = b10 ( general_conf register 0x00). result: stdby_clk generates an external clock with the selected frequency f osc tha t automatically provides the c hopsync feature. i r ecommended minimum external frequency f osc : two times higher than audible range. because chopper noise is of more concern during standstill than during motion, tmc4331 a provides an option to automatically double the chopsync frequency during standby. if seleceted, a chopsync frequency within the audible range can be selected. if doubl ed, chopsync frequency operates outside audible range. in order to enable automatic chopsync frequency doubling , do as follows: action: ? activate any of the above mentioned mixed_decay options. ? set double_freq_at_stdby = 1 (spi_out_conf register 0x0 4 ). result: chopsync frequency is doubled during standby because chopsync_div is halfed. mixed decay configuration for tmc23x/24x chopsync configuration for tmc23x/24x stepper drivers doubling chopsync frequency during standstill
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 99 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc24x forwards stallguard values = { ld2&ld1&ld0 } instead of one stallguard 2 status bit. these bits represent an unsigned value between 0 and 7. the lower the value is the higher the mechanical load is. tmc4331 a can generate a one - bit internal stall signal by analyzing the stallguard values. in order to set up the stall load lim it for automatic stall recognition, do as follows: action: ? set proper stall_load_limit (bit10:8 of spiout_conf register 0x04) . result: whenever {ld2&ld1&ld0} stall_load_limit a stall is indicated. this feature also allows use of the stop - on - stall feature C already explained in section 10.4.4 , page 95 C because this a lso a pplies to other tmc motor stepper drivers . additionally, a standby datag ram can be sent automatically when a stop - on - stall is executed. in order to activate this behavior, do as follows: action: ? set vstall_limit register 0x67 [pps ] according to minimum absolute velocity value for a correct stall recognition. ? set stop_on_stall = 1 (bit26 of reference_conf register 0x01) . ? set drive_after_stall = 0 (bit27 of reference_conf register 0x01) . ? set stdby_on_stall_for_24x = 1 (bit6 of spiout_conf register 0x04). result: whenev er a stal l is calculated by comparing stall_load_limit to the response of tmc24x , while at the same time the absolute value of vactual exceeds vstall_limit , the internal ramp velocity is st opped immediately. addi tionally, both current values are then set to 0 whereu pon a s tandby mode for the tmc24x stepper motor driver is generated that switches off all power driver outputs and clears the error flags. i to return from stop - on - stall, drive_after_stall must be set manually, as stated further in section 10.4.4 ( p age 95 ) . in order to exchange the uv status bit in the status register 0x0f with the calculated stallguard bit, do as follows : action: ? set stall_flag_instead_of_uv_en = 1(bit10:8 of spiout_conf register 0x04). result: status (24) shows the calculated stallguard bit by comparing stall_load_limit with the received response datagram of tmc24x. connection of stdby_clk output pin of tmc4331 a and osc input pin of tmc23x/24x 1 risk of burns! avoid overheating and damage of the tmc23x/24x stepper driver and damage of the connected motor! ? you must use a low pass filter between stdby_clk output of tmc4331 a and the osc input pin of tmc23x/24x. ? you must keep the external clock frequency of the tmc23x/24x stepper motor driver below 50 khz (to prevent overheating). this will ensure smooth and safe operation. 1 per default (i.e. after power on and reset), stdby_clk forwards the internal clock that is too high for the tmc23x/24x. see figure 10 , ( page 12 ) that provides a properly connected sample hardware setup. using tmc24x stall g uard c haracteristics notice
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 100 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc26x stepper motor d river tmc4331 a provides the following features in order to support the tmc26x motor stepper driver family well : ? spi mode that sets up current values directly . ? s/d mode in which the tmc26x processes s/d outputs of tmc433 1 a . ? automatic switchover between microstep and fullstep operation for both modes . ? stall detection and stop - on - stall behavior for both modes . ? s/d mode only: t ransfer of automatic scaling values from tmc4331 a to tmc26x . ? s/d mode only: t ransfer of auto - genera ted polling dat agrams sent by tmc4331 a for reception of status data and microstep position from tmc26x . in the following section, the features are explained in greater detail. i for more information, please refer to the manual of the connected stepper driver motor. in order to activate the spi data transfer mode and feature set for a connected tmc2 6 x stepper motor driver, do as follows: action: ? set spi_output_format = b10 1 0 ( spi_out_conf register 0x04) . ? set cover_data_length = 0 ( spi_out_conf register 0x04) . result: tmc26 x in spi mode is selected as connected stepper motor driver. cover datagrams and current datagrams are sent via spi output pins. i n order to activate the s/d mode and f eature set for a connected tmc26 x stepper motor driver, do as follows: action: ? connect spi output pins and s/d outputs to the tmc26x stepper motor driver . ? set spi_output_format = b101 1 ( spi_out_conf register 0x04) . ? set cover_data_length = 0 ( spi_out_conf register 0x04) . ? set dir_setup_time and stp_length_add (register 0x10) according to the hardware setup . ? set proper poll_block_ exp (bit11 :8 of spiout_conf register 0x04) . result: tmc2 6 x in s/d mode is selected as connected stepper motor driver . spi output pins transfer only cover datagram and automatic configuration datagrams because motion is generated by processing the stp out /dir out output signals of tmc4331 a . the next polling datagram is sent 2^ poll_block_ exp spi_block_time clock cycles a fter the last polling datagram. i a high microstep frequency requires a short spi datagram polling time. ? ? continued on next page . tmc26x s tepper motor d river s upport tmc26x setup (spi mode) tmc26x setup (s/d mode)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 101 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? based on the tmc26x settings - that were explained above - tmc4331 a now sends 20 - bit datagrams automatically. in order to send cover datagrams to tmc26x motor stepper drivers, do as follows: action: ? set cover_low (19:0) to the register values that need to be transferred. result: a cover datagram is sent to the conn ected driver. cover _ done is set after data transfer. the response of tmc26x is stored in cover _ drv _ low (19:0). in case the tmc26x driver operates in spi mode, cover_done is also set when a current datagram is transferred. in order to enable cover_done on ly for cover datagrams, do as follows: action: ? set cover_done_only_for_covers = 1 (bit12 of spi_out_conf register 0x04 ). result: cover_done event is only set if a cover datagram is sent, not for current datagrams. it is a common approach that the microcontroller continuously re write s regist er values for tmc26x to respond to possible voltage drop s at the vs pin of tmc26x, which C if the y occur C prompt an internal register reset, by design. tmc4331 a provides an option to continuously rewrite the five co nfiguration registers of tmc26x, which take off workload from the microcontroller. in order to activate automatic continuous streaming of tmc26x cover datagrams , do as follows: action: ? set auto repeat_ cover_en = 1 (bit 7 of spi_out _conf register 0x04 ) . result: in case cover datagrams are sent to tmc26x while auto repeat _cover_en = 1, tmc4331 a transfers a cover datagram every 2 20 clock cycle. every time another register is addressed, the c over datagrams are retransferred one after the other in consecutive order; i.e. round - robin style. i however, the transfer rate remains at one datagram per 2 20 clock cycles. note: ? when tmc26x is operating in spi mode, current datagrams are also repeated, if the value does not change; within one transfer interval cycle. ? in case a tmc26x register is rewritten manually by cover datagrams, this last register value is, by definition, repeated. ? automatic register changes executed by tmc4331 a C e.g. automatic s caling value transfers C are considered as well for repeated cover datagrams. sending cover datagrams to tmc26x automatic continuous streaming of co ver d atagrams f or tmc26x
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 102 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? because spi c urrent data is transmitted, automatic switchover from microsteps to fullsteps and vice versa entirely depends on internal ramp velocity. in order to activate automatic switchover between microstep and fullstep operation, do as follows: action: ? set fs_vel register 0x60 according to the absolute velocity [pps] at which the switchover should happen . ? set fs_en = 1 (bit19 of general_conf register 0x00) . result: now, current values are switched to fullstep values, in case | vactual | fs_vel . a switchback from fullsteps to steps is executed, in case | vactual | < fs_vel . the status bit fs_active is set acti ve as long as fullstep mode is enabled and activated. in s/d mode, switchover from microsteps to fullsteps and vice versa is not only dependent on internal ramp velocity but also on the microstep position of the tmc26x mslut ; b ecause switchi ng to a lower resolution must be executed carefully to catch the cor rect microstep position. p roper setting of read selection bits for tmc26x stepper drivers tmc4331 a is required to execute switcho ver automatically . in order to activate automatic switchover between microstep and fullstep operation in tmc26x s/d mode , do as follows: precondition: m andatory tmc26x configuration must b e executed via cover datagrams : ? set rdsel 1 = 0 and rdsel0 = 0 @t mc26x . action: ? set disable_polling = 0 (bit6 of spi_out_conf register 0x04) . ? set fs_vel register 0x60 according to the absolute switching velocity [pps ] . ? set fs_en = 1 (bit19 of general_conf register 0x00) . ? set fs_sdout = 0 (bit20 of general_conf register 0x00) . result: the step resolution of tmc26x is set to fullsteps, in case | vactual | fs_vel . a switchback from fullsteps to steps is executed in case | vactual | < fs_vel . fs_active is set active as long as fullstep mode is enabled and activ ated. pre settings of the tmc26x drvctrl register C that is executed before hand via cover datagrams C are consid ered whenever the particular register is overwritten with a new ly assigned microstep resolution. ? ? turn page for information on changing current scaling parameters for tmc26x in s / d mode . tmc26x spi m ode: automatic fullstep switch over tmc26x s/d m ode: automatic fullstep switchover
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 103 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi mode - supported tmc26x drivers are automatically scaled by means of current datagrams. in order to automatically scale the current of a connect ed tmc26x motor stepper driver in s/d mode, tm c 43 3 1 a sends auto - generated cover datagrams by altering directly the cs value of the tmc26x sgcsconf register. tmc4331 a provides features that change the current scaling automatically, which are explained in c hapter 11 , p age 113 . in order to activate automatic current scaling for a connected tmc26x in s/d mode, do as follows: action: ? set scale_val_transfer_en = 1 (bit5 of spi_out_conf register 0x04) . ? set the scale value register 0x06 and scale configuration register 0x05 accordi ng to your requirements (see c hapter 11 , p age 113 ). result: if the current scaling is adapted internally, tmc4331 a automatic ally sends cover datagrams to tmc26x that change the cs bit directly. p re settings of the tmc26x sgcsconf register C that are executed before hand via cover datagrams C become considered whenever the particular register is overwritten with a newly assigned current scaling value. note: ? please consider that the cs value consists of 5 bits only. therefore, the scaling values in register 0x06 must be adapted to 5 - bit val ues as well. tmc4331 a maps the following status bits of tmc26x stepper drivers C which are transferred with in ea ch spi response C to the status register 0x0f: status register m apping for tmc2 6 x status b it @ tmc4331 a status f lag @tmc26 x description status (24) sg s tallguard2 ? table 45 : mapping of tmc2 6 x status f lags i if polling is not disabled, status data from tmc26x is also available in s/d mode. the drv_status register of tmc26x is always sent in response to any transferred datagram of tmc4331 a . in order to store the drv_status response of tmc26x , do as f ollows: action: ? set disbale_polling = 0 (bit 5 of spi_out_conf register 0x0 4 ) . result: tmc4331 a stores the value of this response in polling_status register 0x6c which then can be read out. tmc 26x s/d mode: chang e of current scaling p arameter tmc26x s tatus b its tmc26x status response
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 104 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc389 stepper motor d river if a tmc389 is connected to the spi output and a microstep resolution of 256 is set, a 3 - phase stepper output for coil b can be generated. all features of tmc26x stepper motor drivers in spi mode are also available for tmc389. in order to activate the spi data transfer mode and feature set - for a connected tmc 389 3 - phase stepper motor driver - do as follows: action: ? set spi_output_format = b1010 ( spi_out_conf register 0x04) . ? set th ree_phase_stepper_en = 1 ( spi_out_conf regi ster 0x04) . ? set cover_data_length = 0 ( spi_out_conf register 0x04) . result: now, the currentb and currentb_spi values are shifted by 120 towards currenta and currenta_spi C in contrast to the 90 shift of the 2 - phas e stepper motors . configuration for the tmc389 3 - - phase stepper driver
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 105 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? t mc2130 s tepper motor d rive r tmc4331 a provides the fo llowing features in order to support the tmc2130 motor stepper driver well : ? spi mode that sets up current values directly. ? s/d mode in which the tmc2130 processes s/d outputs of tmc4331 a . ? automatic swit chover between microstep and fullstep operation for both modes. ? stall detection and stop - on - stall behavior for both modes. ? s/d mode only: transfer of automatic scaling datagrams from tmc4331 a to tmc2130. ? s/d mode only: transfer of auto - generated polling da tagrams sent by tmc4331 a for reception of status data and microstep position from tmc2130. in the following section, the features are explained in greater detail. i for more information, please refer to the manual of the tmc2130 stepper driver motor. in order to activate the spi data transfer mode and feature set - for a connected tmc2130 stepper motor driver - do as follows: action: ? set spi_output_format = b1101 ( spi_out_conf register 0x04) . ? set cover_data_length = 0 ( spi_out_conf register 0x04) . result: tmc2130 in spi mode is selected as connected stepper motor driver. cover datagrams and current datagrams are sent via spi output pins. in order to activate the s/d mode and fe ature set - for a connected tmc2130 stepper motor driver - do as follows: action: ? connect spi output pins and s/d outputs to the tmc2130 stepper motor driver . ? set spi_output_format = b1100 ( spi_out_conf register 0x04) . ? set cover_data_length = 0 ( spi_ou t_conf register 0x04) . ? set dir_setup_time and stp_length_add (register 0x10) according to the hardware setup . ? set proper poll_block_ exp (bit1 1 : 8 of spiout_conf register 0x04). result: tmc2130 in s/d mode is selected as connected stepper motor driver. spi output pins transfer only cover datagram s and automatic configuration datagrams because motion is generated by processing the stpout/dirout output signals of tmc4331 a . the next polling datagram is sent 2^ poll_block_ exp spi_block_time clock cycles after the last polling datagram. i a high microstep frequency requires a short spi datagram polling time. tmc2130 s upport set - up tmc2130 s upport (spi m ode) set - up tmc2130 support (s/d m ode)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 106 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? based upon the tmc2130 - supported settings explained above, the tmc4331 a now sends 4 0 bit datagrams automatically. in order to send cover datagrams to tmc2130 stepper drivers, do as follows: action: ? set cover_high (7 : 0) register 0x6d to address value that need s to be sent . ? set cover_low (31:0) register 0x6c to data values that need s to be sent . result: a cover datagram is sent to the connected driver. cover _ done is set after data transfer. the response of tmc2130 is stored in cover_drv_high (7:0) and cover_drv_low (31:0) . in case the tmc2130 driver operates in spi mode, cover_done is also set w hen a current datagram is transferred. this also applies to polling datagrams, explained in section 10.8.8 , page 108 . in order to enable cover_done only for cover datagrams, do as follows: action: ? set cover_done_only_for_covers = 1 (bit12 of spi_out_conf register 0x04 ). result: cover_done event is only set if a cover datagram is sent, not for current datagram s . it is a common approach that the microcontroller continuously rewrites register values for tmc2130 to respond to poss ible voltage drops at the vs pin of tmc2130, which C if they occur C prompt an internal register reset, by design. tmc4331 a provides an option to continuously rewrite five configuration registers of tmc2 130, which take off workload from the microcontroller . these registers are: gconf 0x00, ihold_irun 0x10, chopconf 0x6c, coolconf 0x6d, and dcctrl 0x6e . in order to activate automatic continuous streaming of tmc2 130 cover datagrams , do as follows: action: ? set auto repeat _cover_en = 1 (bit 7 of spi_out _conf register 0x04 ) . result: in case cover datagrams are sent to tmc2 130 register C that are mentioned above C while auto repeat _cover_en = 1, tmc4331 a transfers a cover datagram every 2 20 clock cycle. every time another register is addressed, the cover datagr ams are retransferred one after the other in consecutive order; i.e. round - robin style. i however, the transfer rate remains at one datagram per 2 20 clock cycles. note: ? when tmc2130 is operating in spi mode, current datagrams are also repeated, if the value does not change; within one transfer interval cycle. ? in case one of the five above mentioned tmc 2130 register is rewritten manually by cover datagrams, this last register value is , by definition, repeated. ? automatic register changes executed by tmc4331 a C e.g. automatic scaling value transfers C are considered as well for repeated cover datagrams. sending cover datagrams to tmc2130 automatic continuous streaming of cover datagrams for tmc2130
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 107 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? because spi current data is transm itted, the automatic switchover from microsteps to fullsteps and vice versa entirely depends on the internal ramp velocity. in order to activate automatic switchover between microstep and fullstep operation, do as follows: action: ? set fs_vel register 0 x60 according to absolute velocity [pps] at which the switchover should happen . ? set fs_en = 1 (bit19 of general_conf register 0x00) . result: now, current values are switched to fullstep values, in case | vactual | fs_vel . a switchback from fullsteps to steps is executed in case | vactual | < fs_vel . the status bit fs_active is set active as long as fullstep mode is enabled and activated. during s/d mode, switchover from microsteps to fullsteps and vice versa is only executed directly by tmc2130. therefore, a fullstep velocity must only be defined in tmc2130. tmc4331 a transfers microsteps whether tmc2130 is operating in fullstep or microstep mode. tmc4331 a provides features that change the current scaling automatically, which is explained in c hapter 11 , p age 113 . stepper motor drivers that are supported by spi current datagrams are a utomatically sc aled via current datagrams. to automatically scale the current of a connected tmc2130 motor stepper driver in s/d mode, tm 43 3 1 a sends auto - generated cover datagrams by altering the cs value of the tmc2130 ihold_irun register. in order to activate automati c current scaling for tmc2130 in s/d mode: action: ? set scale_val_transfer_en = 1 (bit5 of spi_out_conf register 0x04) . ? set scale value register 0x06 and scale configuration register 0x05 according to your requirements (see c hapter 11 , p age 113 ). result: when current scaling is adapt ed internally, tmc4331 a sends cover datagrams to tmc2130 automatically, which change s the cs bit directly. p re settings of the ihold_irun register of the tmc2130 C executed before via cover datagrams C are considered whenever the particular register is ove rwritten with a newly assigned current scaling value. i please consider that the irun and ihold value s consi st of 5 bits only. therefore, scaling values in register 0x06 must also be adapted to 5 - bit values. tmc2130 spi m ode: automatic fullstep switch over tmc2130 s/d m ode: automatic fullstep switchover tmc 2 130 s/d m ode: changing current scaling p arameter
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 108 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc4331 a maps the following status bits of tmc2130 stepper driver s C which are transferred within each spi response C to the status register 0x0f: status register mapping for tmc2 130 status bit @ tmc4331 a status flag @tmc2130 description status (24) sg stallguard2? status flag . status (25) ot over temperature flag . status (26) otpw temperature prewarning flag . status (27) s2ga short - to - ground detection flag for high side mosfet of coil a . status (28) s2gb short - to - ground detection flag for high side mosfet of coil b . status (29) ola open load flag for bridge a . status (30) olb open load flag for bridge b . status (31) stst standstill flag . table 46 : mapping of tmc2130 status f lags i if polling is not disabled ( disable_polling = 0), status data from tmc2130 is also available in s/d mode. tmc4331 a continuously polls five status registers of tmc2130, if not disabled. these regist er are gstat 0x01 , pwm_scale 0x71 , lost_steps 0x73 and drv_ status 0x6f. in order to store the polled register values of tmc2 130 , do as follows: action: ? set disbale_polling = 0 (bit 5 of spi_out_conf register 0x0 4 ) . result: tmc4331 a stores the value of drv_status in polling_status register 0x6c, which then can be read out. the response for polling of gstat, pwm_scale and lost_steps are merged in the polling_reg register 0x6d , which then can also be read out. tmc2130 status b its tmc2130 status response
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 109 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? connecting non - tmc stepper motor driver or spi - dac at spi output interface tmc4331 a also provides configuration data for driver chips of other companies via the cover registers. the following output format settings can be selected: non - tmc data transfer o ptions output f ormats spi_output_format comment spi output off b0000 spi output driver pins are switched off . cover output only b1111 only cover datagrams are sent via the spi output pins . unsigned scaling factor b0100 the actual unsigned current scaling value is provided at the spi output pins . signed current data b0101 both actual signed current values are provided in one datagram at the spi output pins . dac scaling factor b0110 the actual unsigned current scaling value is provided at the spi output pins for a defined dac address . dac absolute values b0011 both actual signed current values are provided in two datagrams at the spi output pins for defined dac addresses , which are absolute values. phase bits are generated at the stpout/dirout interface. phase b it = 0 signifies positive values . dac absolute values b0010 both actual sign ed current values are provided in two datagrams at the spi output pins for defined dac addresses, which are absolute values. phase bits are generated at the stpout/dirout interface. phase bit = 1 signifies positive values. dac adapted values b0001 both a ctual signed current values are provided in two datagrams at the spi output pins for defined dac addresses. these values are mapped to positive values: current value equals minimum value ( - 255) = 0 current value equals 0 = 128 current value equals maximum value (+255) = 255 table 47 : non - tmc data transfer o ptions note: ? please note that the cover_data_length must be set according to the predefined driver chip datagram length. in order to send cover datagrams only , use this option to avoid datagrams that send scaling or current values whenever these internal values are changed. please keep in mind that only the spi protocol is available that is used f or tmc motor stepper driver s. setting spi_output_format = b0100 leads to a transfer of the 8 - bit scaling factor if this value is altered internally : output data( 7 :0) = scale_param (7 :0 ) . the msb 7 is sent first. if more than 8 bits are configured a s cover_data_length , leading zeros are inserted before the msb. setting spi_output_format = b0101 leads to a transfer of both signed current values that consists of 18 bit s and are sent one after the other in one datagram : output data(17:0) = currenta_spi (8:0) & currentb_spi (8:0). the msb (bit17) is sent first. if more than 18 bits are configured as cover_data_length , leading zeros are inserted before the msb. cover output only ! sending u nsigned scaling f actor sending s igned current v alues
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 110 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? connecting a spi - dac connecting a compatible spi - dac to spi output pins, several poss ibilities are available for output configuration: ? output of the internal spi current values . ? output of the internal current scaling value . ? seve ral spi protocols are available . spi - d acs can convert more than one dig ital value, but every value is transmitted in one datagram. because tmc4331 a provides two current values, a datagram transfer from tmc4331 a to a connected spi - dac is split into two datagrams, one for each current value: currenta_spi and currentb_spi . the transmission is initiated as soon as one of both values is changed internally. the data transfer of the second current value currentb_spi is executed automatically whenever the transmission of currenta_spi is completed. if only the scaling factor scale_param needs to be transferred, only one datagram is sent out. per default, the spi protocol follo ws the tmc style: t o initiate a data transfer, the negated chip select signal nscsd rv switches from high to low level. after a while, the serial clock sckdrv switches from high to low level. when the transmission is finished, the serial cloc k swi tches to high level. afterwards, the negated chip sel ect signal switches to high level to fin ish the data transfer . adapt at ions to suit other sp i protocols are also available: i n order to set serial clock to low level - before the negated chi p select switches to low level - do as follows: action: ? set sck_low_before_csn = 1 (bit4 of spiout_conf register 0x04) . re sult: sckdrv is tied low before nscsdrv switches to low level to initiate data transfer . per default, tmc drivers sample master data with the rising edge of the serial master clock. thus, tmc4331 a shifts output data at sdo drv with the falling edge of sckdrv . i f the data must be sampled with the falling edge of the master clock at the drivers side , do as follows: action: ? set new_out_bit_at_rise = 1 (bit 5 of spiout_conf register 0x04) . re sult: t he output data at sdodrv is changed with the rising edge of sckdrv . dac output v alues dac data t ransfer changing spi o utput p rotocol for spi - dac
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 111 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi transmission to a dac transfers an address or a command prior to the value that must be defined . the length of the prefixed command / address can be assigned by setting dac_cmd_length according to specification of the spi - dac. in order to set up the dac communication scheme , do as follows: action: ? set dac_cmd_length (bit11:7 of spi_out_conf register 0x04) according to th e length of the address / command, which is pla ced in front of the values. ? set dac_addr register 0x1d according to your requirements: address/command of the 1 st value: set dac_addr (15:0) = dac_addr_a . address/command of the 2 nd value: set dac_addr (31:16) = dac_addr _b . re sult: dac_addr_a is placed in front of th e first transferred value that can be the current value of coila (= currenta_spi ) or the scaling factor (= scale_param ), whereas dac_addr_b is placed before the second current value currentb_spi . i cover_data_length comprises the whol e datagram length , which is the sum of the address/length dac_cmd_length and the 8 - bit data length. i if the cover register length comprises more bits than the combination of address/command and value, trailing zeros are added at the end. i the command bits consist of the least significant bits of dac_addr_x if the command length is less than 16 bit s long . several opportunities are available for the dac data styl e: ? c urrent values are con verted to absolute values. the p hases of the values are generated at the stpout (coil a) and dirout (coilb) pins. the base line (value equals 0) i s located at 0 (see table 48 , figures b and c ). ? the current values C which range between - 255 and 255 C are mapped to values between 0 and +255: the minimum value of - 255 is an output value of 0, whereas the baseline is set to +128. the maximum value remains at +255. in detail, the value is divided b y two and 128 is added to the quotient ( table 48 , p age 112 , fig. a ). tmc4381 provides an offset to compensa te for a shifted dac baseline. in order to shift the dac baseline, do as follows: action: ? set dac_ offset (bit31:24 of register 0x7e) according to your requirements. re sult: the d igital values are shifted accordingly. table 48 , page 112 , figure d shows absolute dac values. the dac baseline is shifted by 32 steps, whereas table 48 , page 112 , figure e shows mapped dac values , which are shifted by 64 steps. i for the three available absolute values options C including the unsigned scale parameter transfer C the offset represents an unsigned number. i for the mapped values option the offset represents a signed number. to avoid a carry over at the value limits +255 and - 256 when using an dac offset, the mslut values must be scaled down for the spi output values (see table 48 , page 112 , f igures d and e). this can be done by using the current scale feature, as explained in chapter 11 , p age 113 . ? ? continued on next p age . dac address v alues dac data v alues
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 112 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? ava ilable dac options for the spi output i nterface orig inal spi o utput c urves: a mapped dac values: b absolute dac values (positive phase = 0) c absolute dac values (positive phase = 1) d absolute dac values, original mslut values are scaled to ?, dac value offset= 3 2 e mapped dac values, original mslut values are scaled to ?, dac value offset = 64 table 48 : available spi - dac o ption s -256 -128 0 128 256 original spi output values currenta_spi currentb_spi 0 64 128 192 256 mapped dac values dac value a dac value b 0 64 128 192 256 dac values dac value a dac value b 0 64 128 192 256 dac values dac value a dac value b 0 1 phase value coil a stpout 0 1 phase value coil a stpout 0 1 phase value coil b dirout 0 1 phase value coil b dirout 0 64 128 192 256 dac values dac value a dac value b 0 64 128 192 256 mapped dac values dac value a dac value b
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 113 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 11. current scaling the current values of register 0x7a C currenta and c urrentb C of the microstep look up table ( mslut ) represent the maximum 9 - bit signed values, which c an be sent via the spiout output interface. in most sections of the velocity ramp it is not required to drive the motor with the full current amplitude. various possibilities are im plemented that allow adapt ation of a ctual current values of the mslut to the present ramp status. scale parameters are available for boost curr ent, hold current, and drive current. these parameters can be assigned independently in the scale_values register 0x06, and are used automatically for differ ent states of the velocity ramp; if enabled, as described below. prior to describing the various feasible scaling situations, a brief explanation of the scaling calculation is provided. when sca ling is enabled for the present ramp state, the actual c urrent values of the mslu t are multiplied with the mult_scale parameter that is deduced from one of the four scale _ values : mult_scale = (actual_scale_val + 1) / 256 with actual_scale_val = {hold, boost, drv1, drv2}. consequently, t h is mult_scale ranges from 0 to 1: 0 < mult_scale 1. mult_scale is then multiplied with the actual current values currenta and currentb , which are generated by the mslut: currenta_spi = currenta mult_scale (bit8:0 of 0x7b) currentb_spi = currentb mult_scale (bit24:16 of 0x7b) thes e values are transferred via spi output interface. if no current scaling is enabled, the output values currenta _ spi and currentb _ spi are equal to the mslut values currenta and currentb because the scaling valu es are equal to the maximum 255, per default. thu s, scaling will only decrease the original mslut values. also, t he actual scale parameter can assume intermediate value s because tmc4331 a offe rs possibilities to convert smoo thly from one scale value to another. the actual scale parameter scale_param can b e read out at register 0x7c. it has the same range as the four scale _ values . use of tmc 26x and tmc2130 stepper motor drivers in s /d mode : if tmc motor stepper drivers are used in s/d mode, scaling values comprise only 5 bit s because the cs value of tmc26x , and the ihold, irun values of tmc2130 motor stepper drivers are adapted directly. therefore, mult_scale is calculated slightly different ly : mult_scale = (actual_scale_val + 1) / 32 c alculation of the current output v alues description of scaling calculation areas of special concern !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 114 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? during standstill, the cur rent can be scaled down considerably in most application s because the energy demand is lower than during motion. in a dd ition to the scalin g value, the standby delay must be configured. the delay defines the time between ramp stop and sta rt up of hold scaling . whenever the delay is set to 0 , hold sca ling is immediately enabled at the end of the velocity ramp. because m ost applications require waiting for system oscillations after ramp st op, this delay must be set up in most cases. in ord er to set up and enable hold current scaling, do as follows: action: ? set the time frame for stdby_dealy register 0x15 after ramp stop, and before standby phase starts. ? set hold_scale_val = scale _ values (31:24) according to the maximum current during motor standstill. ? set hold_current_scale_en = 1 ( current_conf register 0x05). result: the standby timer is started as soon as vactual reaches 0. after stdby _ delay clock cycles the standby timer expires that activa tes the hold scaling phase. the standby status can be forwarded via stdby_clk output pin. in order to generate an output standby signal, do as follows: action: ? set stdby_clk_pin_assignment (1) = 0 (bit14 of general_conf register 0x00) . ? set stdby_clk_pin_assignment ( 0 ) (bit13 of general_conf register 0x00) according to the active voltage level of the output pin . result: stdby_clk output pin forwards the internally generated standby status. the active output level equals stdby_clk_pin_assignment (0). some applications require a freewheeling behavior after ramp stop. this means that the curre nt values are set to 0. a delay timer can be configured to define the time between standby start and the beginning of f reewheeling. in order to set up and enable freewheeling, do as follows: action: ? set freewheel_delay register 0x16 according to the duration of the time after standby start, so that freewheeling is activated accordingly. ? set freewheeling_en = 1 ( curren t_conf register 0x05). result: the freewheeling timer is started as soon as the standby mode is activated . after completion of freewheel _delay clock cycles , the freewheeling timer expires that activates the freewheeling phase. i just be fore the velocity ramps starts internal scaling is s et to the standby scaling value . this avoids starting the ramp at current values that are equal to 0. hold c urrent s caling standby s tatus fr eewheeling
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 115 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? current scaling during m otion if the current values need to be scaled during motion , several options are available. up to three scaling values can be selected: t wo drive scaling values and one boost scale value. different scale values can be automatically assigned to the various sections of the vel ocity ramp. drive scaling is the preferred direct and mostly unconditional scaling option. if no boost scaling is enabled, the current values are scaled according to the given scale value, independent of the present ramp status. in order to set up and enable only drive current scaling, d o as follows: action: ? set drv1_scale_val = scale _ values (15:8) according to the maximum current during motion. ? set drive_current_scale_en = 1 ( current_conf register 0x05). result: as long as no other mot ion scale options are activated the current values of the mslut are scaled according to drv1_scale_val during motion ( vactual <> 0) . a second drive scale parameter can be assigned in order to differentiate the motion scaling according to the internal ramp vel ocity. in order to set up and enable drive current scaling with two different scaling values, do as follows: action: ? set vdrv_scale_limit regis ter 0x17 [pps] according to switching velocity at which drive scaling will change. ? set drv1_scale_val = scale _ values (15:8) according to maximum current during motion below vdrv_scale_limit . ? set drv 2 _scale_val = scale _ values (23:16) according to maximum current during motion beyond vdrv_scale_limit . ? set drive_current_scale_en = 1 ( current_conf register 0x05). ? set sec_d rive_current_scale_en = 1 ( current_conf register 0x05). result: as long as no boost scaling is activated, the current values of the mslut are scaled according to drv1_scale_val as long as vactual vdrv_scale_limit . whenever vactual > vdrv_scale_limit the current values are scaled according to drv 2 _scale_val . drive s caling alternative drive s caling
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 116 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in certain section s of the velocity ramp it can be useful to boost the current . boost current can be assigne d t emporar i ly either after r amp start or during the whole ac - /de celeration phase. all opt ions can be selected separately, or in combination. i a ll three options use the same scaling value boost_scale_val . option 1: boost scal ing at ramp start in order to set up and enable boost current scaling within a defined time frame directly after the velocity ramp start - up , do as follows: action: ? set boost_time register 0x18 according to the delay period at which boost current scaling is activated after a velocity ramp start. ? set boost _scale_val = scale _ values (7:0) according to the maximum current during the boost phase. ? set boost_current_after_start_en = 1 ( current_conf register 0x05). result: after the velocity ramp start ( vactual = 0 before), boost scaling is activated according to boost _scale_val . the boost timer expires after boost_ time clock cycles. afterwards, any other selected scaling value is used , if active and selected. option 2: boost scal ing on acceleration slop es in order to set up and enable boost current scaling for the acceleration phase of the velocity ramp, do as follows: action: ? set boost _scale_val = scale _ values (7:0) according to the maximum current during the boost phase. ? set boost_current_ on_acc _en = 1 ( current_conf register 0x05). result: as long as the absolute internal velo city | vactual | increases , the boost scaling function is activated accordin g to boost _scale_val . the present ra mp state can be read out by the ramp_state flag . acceleration slopes are indicated by ramp_state = b01. option 3: boost scal ing on deceleration slopes in order to set up and enable boost current scaling for the deceleration phase of the velocity ramp, do as follows: action: ? set boost _scale_val = scale _ values (7:0) according to max imum current during the boost phase. ? set boost_current_ on_dec _en = 1 ( current_conf register 0x05). result: as long as the absolute internal velocity | vactual | decreases, boost scaling is activated according to boost_scale_val . the present ramp state can be read out at the ramp_state fl ag . deceleration slopes are indicated by ramp_state = b10. boost c urrent
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 117 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? scale m ode transition p rocess c ontrol t ransition from one scale value to the next active value can be con fi gured as slight conversion. it is advisable to avoid abrupt scaling alterations, which can cause unwanted oscillati ons and/ or motor stall. three different parameters can b e set to convert to higher or lower current scale values. it is often required to peter out the motion ( by smoothening the transition process from motion scaling to hold scaling) in order to avoid system standstill oscillations. in order to configure a smooth transition from motion current scaling to hold current scaling , do as follows: action: ? set hold_scale_delay register 0x19 according to th e delay period after which the actual scale parameter is decreased by one step towards hold current scale value . result: immediately after the ho ld scaling current is activated , the actual scale parameter is decreased by one step per hold_scale_delay clo ck cycles until scale_param = hold_scale_val . i if hold_scale_delay = 0, the hold current scaling value hold_scale_val is assigned immediately whenever the hold current scaling is activated. to avoid step loss C in case a higher scale value is assigned during motion C the transition from low to h igh current scale values can also be adapted. in order to configure a smooth transition from a lower motion current scaling value to a high er motion current scalin g value , do as follows: action: ? set up _scale_delay register 0x1 8 according to the delay period after which the actual scale parameter is increased by one step towards the higher current scale value. result: whenever a high er current scale value is assi gned in ternally , the actual scale parameter is increased by one step per up _scale_delay clock cycles until the assigned scale parameter is reached . i if up_scale_delay = 0, the higher current scaling value is assigned immediately whenever the corresponding current scaling phase is activated. ? ? description c ontinued on next page . transition to hold current s caling ! transition to higher motion current s caling !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 118 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? to avoid step loss or unwanted os cillations C in case a lower scale v alue is assigned during motion C the transition from high to low current scale values can be adapted also. in order to configure a smooth transition from a higher motion current scaling value to a lower motion current scaling value, do as follows: action: ? set drive_scale_delay regist er 0x1a according to the delay period after which the actual scale parameter is decreased by one step towards the lower current scale value. result: whenever a low er current scale value is assigned internally , the actual scale parameter is decreased by o ne step per drive_scale_delay clock cycles until the assigned scale parameter is reached. i if drive_scale_delay = 0, the lower current scaling value is assigned immediately whenever the corresponding current scaling phase is activated. two examples a re pr ovided on th e following p age s that illustrate how scaling modes can be used. the scale parameter scale_ param is shown in combination with its related scale timers in clock cycles and in combination with the underlying velocity ramp. transition to lower motion current s caling !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 119 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? current scaling examples in this example, the following scale options are enabled : ? standby scaling ? freewheeling ? boost scaling at start ? boost scaling on deceleration ramps ? drive scaling the different scaling stages of the trapezoidal velocity ramp are shown in differe nt colors in the figure a below. figure b shows the internal scale parameter s c ale_param as function of time. t he scale parameter is n ot switched immediately whenever the sca ling situations alters; because delay timers are used. a transition time between the assigned values is generated. four transition phases are shown that are calculated as follows: t start_scale = ( boost_scale_val C hold_scale_val ) up_scale_delay f clk t dn_scale = ( boost_scale_val C drv1_scale_val ) drv_scale_delay f clk t up_scale = ( boost_scale_val C drv1_scale_val ) up_scale_delay f clk t hold_scale = ( drv1_scale_val C hold_scale_val ) hold_scale_delay f clk figure c shows th e different timers that are used : ? t o finis h boost scaling after start. ? to start standby scaling. ? t o start f reewheeling. i the se three d elay values are directly determined by their respective register values 0x1b, 0x15, and 0x16. figure 54 : scaling example 1 scaling mode example 1 v ( t ) t t s c a l e _ p a r a m b o o s t s c a l i n g d r v 1 s c a l i n g s t d b y s c a l i n g f r e e w h e e l i n g t s c a l e t i m e r [ c l k c y c l e s ] b o o s t _ s c a l e _ v a l d r v 1 _ s c a l e _ v a l h o l d _ s c a l e _ v a l s t d b y _ d e l a y f r e e w h e e l _ d e l a y b o o s t _ t i m e t d n _ s c a l e t u p _ s c a l e t d n _ s c a l e t h o l d _ s c a l e t s t a r t _ s c a l e a ) b ) c )
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 120 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in this example, the following scale options are enabled: ? boos t scaling on acceleration ramps ? drive scaling 1 and 2 as long as | vactual | < vdrv_scale_limit , drv1 scaling is active . b oth drive scaling modes are used for the deceleration ramp because boost current is not enabled during deceleration slopes ( b oost_current_on_dec = 0 ) . when ever vactual traverses 0 the ramp_status switches to acceleration ramp, and boost scaling becomes enabled a gain . this is shown in the figure a below . figure b depicts the ac tual scale parameter, which is altered with the formerly specified delay s . in contrast to example 1, t start_scale is changed to the following calculation : t dn_scale = ( boost_scale_val C drv1_scale_val ) drv_sc ale_delay f clk w hereas the other transition phase s depend on whether drv1_scale _val or drv2_scale _val is used either; before or after the transition process. figure 55 : scaling example 2 scaling mode example 2 v ( t ) t t s c a l e _ p a r a m v d r v _ s c a l e _ l i m i t - v d r v _ s c a l e _ l i m i t b o o s t s c a l i n g d r v 1 s c a l i n g d r v 2 s c a l i n g b o o s t _ s c a l e _ v a l d r v 1 _ s c a l e _ v a l d r v 2 _ s c a l e _ v a l
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 121 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 12. controlled pwm output tmc4331 a offers controlled pwm (pulse width modulation) signals at stpout and dirout output pins . these pwm signals can be scaled, depending on the internal velocity. if a tmc23x/24x stepper motor driver is connected and configured properly, the pwm signals are re directed to two spi output interface pins. this avoids rerouting of signal lines at board level if spi mode is switched to pwm mode, or vice versa. in this chapter information is provided on the basic setup o f th e pwm outp ut configuration; and also on tmc23x/ 24x control pwm input support. dedicated pwm output pins pin n ames type remarks stpout_pwma output pwm output for coil a . dirout_pwmb output pwm output for coil b . connected and selected tmc23x/24x stepper motor driver s only: sdodrv output pwm output for coil a . nscsdrv output pwm output for coil b . table 49 : dedicated pwm output pins dedicated pwm output registers register n ame register a ddress remarks general_conf 0x00 rw bit 21: pwm_out_en . curent_conf 0x0 5 rw pwm_scale_en = current_conf (8): pwm scale enable switch pwm_ampl = current_conf (31:16): pwm amplitude at vactual = 0 . pwm_vmax 0x17 rw second assignment to vdrv_scale_limit : velocity at which the pwm scale parameter reaches 1 ( maximum ) . pwm_freq 0x1f rw number of clock cycles that forms one pwm period . table 50 : dedicated pwm output registers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 122 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? pwm output generation and scaling p ossibilities the stpout and dirout output pins generally forward intern al generated microsteps and motion direction. in contrast to that, it is possible to forward the internal mslut value as pwm output signals, which is dependent on the pwm frequency. in order to generate pwm output, do as follows: action: ? set pwm_freq register 0x1f to the number of clock cycles for one pwm cycle. ? set pwm_out_en = 1 ( general_conf register 0x00). result: step/dir output is disabled and pwm signals are forwarded via stpout_pwma and dirout_pwmb. pwm frequency f pwm is calculated by : f pwm = f clk / pwm_fre q if pwm voltage mode is s elected : avoid unintended overheating to prevent motor damage during pwm mode! ? at lower velocity values pwm voltage scaling must be enabled. this will ensure smooth operation during controlled pwm mode. the duty cycle of both signals represent the sine (stpout) and cosine (dirout) values of the mslut. pwm voltage scaling does not work the same way as presented for the s pi current output interface (see chapter 11 , p age 113 ). pwm scaling is adapted linearly, which depends on t he internal ramp velocity. during voltage pwm mode the scaling value at vactual = 0 must be assigned, a nd also the velocity at which full scaling is reached. in order to generate a scaled pwm output, do as follows: action: ? set pwm_ ampl (bit31:16 of register 0x05) as start pwm scaling value. ? set pwm_vmax register 0x17 t o the internal ramp velocity [pps] at which full pwm scaling is reached. ? set pwm_scale = 1 (bit8 of current_conf register 0x05). result: ? pwm_scale is the actual scaling value. ? in case vactual = 0, pwm_scale = ( pwm_ampl + 1) / 2 17 . i whenever the absolute velo city value increases , the scale parameter also increases linear ly until it reaches the maximum of pwm_scale = 0.5 at vactual = pwm_vmax . i the minim um duty cycle is calculated by duty_min = (0.5 C pwm_scale) . i the maxim um duty cycle is calculated by duty_max = (0.5 + pwm_scale) . i these values set the pwm duty cycle limits of any internal ramp velocity. enable pwm output g eneration notice pwm duty cycle scaling
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 123 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? i n the figure b e low, the calculation of minimum/maximum pwm duty cycles with pwm_ampl = 32767 is shown on the left side. resulting duty cycles for different positions in the sine voltage curve are depicted on the right side. calculated delays of minimum/maximum duty cycles are also shown. figure 56 : calculation of pwm duty cycles (pwm_ampl) note: ? if hold current scaling is enabled, see section 11.1. , page 114 , hold_scale_val is used for pwm scaling during standstill. pwm scale e xample p w m _ s c a l e v a c t u a l p w m _ v m a x ( p w m _ a m p l + 1 ) 2 ^ 1 7 0 . 5 t d u t y _ c y c l e p w m _ v m a x p w m _ f r e q f c l k t d u t y _ m a x = ( 0 . 5 + p w m _ s c a l e ) ? p w m _ f r e q / f c l k t d u t y _ m i n = ( 0 . 5 C p w m _ s c a l e ) ? p w m _ f r e q / f c l k v a c t u a l t v o l t a g e ( v ) t t 0 . 5 ? p w m _ f r e q f c l k t i i i i i i i i i i i i
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 124 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? pwm o utput g eneration for tmc23x/24x pwm out put signals can be used for tm c23x/24x stepper motor drivers v oltage pwm mode. tmc4331 a forward s the internal pwm output signals at the corresponding spi output interface pins b ecause the drivers share input and ou tput pins for the spi mode and the voltage pwm mode. this feature enables variable opera tion of the tmc23x/24x in the one or the other mode without rerouting the particular signal lines at board level. in order to generate a pwm output for tmc23x/24x stepper motor drivers , do as follows: action: ? set pwm_freq register 0x1f to the number of clock cycles for one pwm cycle. ? set spi_output_format = b1000 (tmc23x) or spi_output_format = b1001 (tmc24x) . ? set pwm_out_en = 1 ( general_conf register 0x00). ? set spi_switch_vel register 0x1d to 0 . result: ? s pi output interface is disabled, controlled pwm output for tmc23x/24x is enabled. ? sdodrv output pin forwards pwm pha signal. ? nscsdrv output pin forwards pwm phb signal. ? mp2 i s set to low voltage level that disables tmc23x/24x spi mode. ? sdodrv analyses the error flags that are forward via sdo output pin of tmc23x/24x. these error flags indicate overcurrent on any bridge or the overtemperature flag. therefore, these three status bits of tmc4 331 a are altered according to the err flag. ? sckdrv is set to high voltage level to set mdbn of tmc23x/24x to high voltage level. note: ? only the five pins mentioned above are set accordingly by tmc4331 a . ? please be aware that all other pins of tmc23x/24x m ust be set according to your requirements, especially ann/mdan = high voltage level, and ina resp. inb according to the current limit. i for correct hardware setup information refer to tmc23x/24x manual s . figure 57 : tmc4331 a connected with tmc23x/24x operating in spi mode or pwm mode controlled pwm si gnals for tmc23x/24x tmc4331 a with tmc2 3x/24x stepper d river t m c 4 3 3 1 c s c k m o s i m i s o s s s c k i n s d o i n c l k c l k _ e x t n s c s i n s d i i n s d o / e r r c s n / p h b s d i / p h a s c k / m d b n t m c 2 3 x / 2 4 x m n s c s d r v s d o d r v s c k d r v s d i d r v s t d b y _ c l k o u t p u t f o r c h o p s y n c o s c 1 5 k 6 8 0 p f s p e m p 2 a n n / m d a n v c c i o
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 125 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? t he hardware setup scenario, as shown on the previous page , also allows switching between spi and voltage pwm mode. it is advisable to enable or disable th e voltage pwm mode during stand still of the internal ramp. in order to disable voltage pwm mode for tmc23x/24x, do as follows: action: ? set pwm_out_en = 0 ( general_conf register 0x00). result: spi output in terface is enabled and controlled pwm output for tmc23x/24x is disabled. mp2 C that must be connected with spe@tmc23x/24x C is set to high voltage level, which enables tmc23x/24x spi mode. however, it is also possible to switch between both modes during motion. because the internal mslut is used either as voltage specification or as current specification , microstep loss can occur wh enever the mode is switched in case the swi tching velocity i s passed by. i in order to overcome this, issue a microstep offset during pwm mode can be assigned. in order to set up a tmc23x/24x configuration that switches between spi and pwm voltage mode , do as follows: action: ? set pwm_freq register 0x1f to the number of clock cycles for one pwm cycle. ? set pwm_out_en = 1 ( general_conf register 0x00) . ? set spi_output_format = b1000 (tmc23x) or spi_output_format = b1001 (tmc24x) . ? set spi_switch_vel register 0x1d to a value [pps] at which the mode change should happen . ? set ms_offset register 0x79 (only write access ) to a value between 0 and 255 . result: whenever the internal velocity | vactual |< spi_switch_vel , voltage pwm mode is activated automatically. whenever | vactual | spi_switch_vel , spi mode is activated automatically. during pwm mode the internal mslut value is modified by ms_offset ; in order to shift the resulting voltage curve of the motor coils. observing the motor coil currents w ith current probes is the best method for determining the required ms_offset : ? triggering the spe signal will gain the switching point. ? at this p oint the current curves show a crack if no offset is assigned. this could lead to step loss. i the offset can attenuate this crack to overcome this step loss. switching between spi and voltage pwm m odes determining ms_offset
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 126 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 13. dcstep s upport for tmc26x or tmc2130 dcstep is an automatic commutation mode for stepper motor drivers. it allows to run the stepper with its nominal velocity , which is generated by the internal ramp gene rator for as long as it can cope with the motor load. in case the motor becomes overloaded, it slows down to a lower velo city at which the motor can still drive the load. this avoids that the stepper motor stall s, and en ables the stepper motor to drive heavy loads as fast as possible. its higher torque - available at lower velocity C in combination with dynamic torq ue ( from its flywheel mass ) compensates mechanical torque peaks without feedback. dedicated dcstep pins pin n ame pin t ype remarks mp1 input dcstep input signal . mp2 inout as output dcstep output signal . table 51 : dedicated dcstep pins dedicated dcstep registers register n ame register a ddress remarks general_conf 0x00 rw bit22 : 21: dc_step_mode . dc_vel 0x60 w velocity at which dcstep starts (fullstep); 24 bit . dc_time 0x61(7:0) w upper pwm on time limit for internal dcstep calculation . dc_sg 0x61(15:8) w maximum pwm on time for step loss detection (multiplied by 16!) . dc_blktime 0x61(31:16) w dcstep bl ank time after fullstep release. dc_lsptm 0x62 w dcstep low speed timer; 32 bit . table 52 : dedicated dcstep registers ? ? turn p age for more information on how dcstep increases the usable motor torque.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 127 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? in a classical application, the operation area is limited by the maximum torque required at maximum application velocity. a safety margin of up to 50% torque is requ ired, in order to compensate unforeseen load peaks, torque loss due to resonance , a nd aging of mecha nical components. dcstep makes it possible to use the available motor torque to its fullest. even higher short - time dynamic loads can be over come by using motor and application flywheel mass without the danger of causing a motor stall. wit h dcstep , the nominal application load can be extended to a higher torque, which is only limited by the safety margin near the holding torque area (which is the highest torque the motor can provide). additionally, maximum application velocity can be increa sed up to conditional maxi m um motor velocity. figure 5 8 : dcstep extended application operation area ? ? turn page for more information about enabling dcstep fortmc26x stepper motor drivers . dcstep increases usable motor t orque c l a s s i c o p e r a t i o n a r e a w i t h s a f e t y m a r g i n t o r q u e v e l o c i t y [ r p m ] d c s t e p o p e r a t i o n - n o s t e p l o s s c a n o c c u r a d d i t i o n a l f l y w h e e l m a s s t o r q u e r e s e r v e m i c r o s t e p o p e r a t i o n 0 m n o m 1 m m a x d c _ v e l v m a x m n o m : n o m i n a l t o r q u e r e q u i r e d b y a p p l i c a t i o n m m a x : m o t o r p u l l - o u t t o r q u e a t v = 0 a p p l i c a t i o n a r e a m a x . m o t o r t o r q u e s a f e t y m a r g i n d c s t e p e x t e n d e d s a f e t y m a r g i n : c l a s s i c a l a p p l i c a t i o n o p e r a t i o n a r e a i s l i m i t e d b y a c e r t a i n p e r c e n t a g e o f m o t o r p u l l - o u t t o r q u e m n o m 2
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 128 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? if c onnected to tmc26x drivers, tmc4331 a must generate the dcstep signal internally; d espite pa rticular motor settings dcstep requires only very few settings, which could be t unneled via spi through tmc4331 a . dcstep directly feeds moto r motion back to the ramp generator so that it become s seamlessly i ntegrated into the motion ramp; even if the motor becomes overloaded with respect to the target velocity. in order t o set up the hardware correctly the sg_tst output pin of tmc26x must be conn ected to the mp1 input pin of tmc4331 a ; and the tst_mode pin of tmc26x must be connect ed to vccio. i please also refer to the corresponding tmc26x manual s for the correct motor driver settings. in order to set up a tmc2 6 x dcstep configuration, do as follows: precondition: tmc26x motor driver setup: ? set chm = 1 (constant toff - chopper) . ? set hstrt = 0 (slow decay only) . ? set sgto = 1 and sgt1 = 1 (on_state_xy as test signal output) . ? set tst = 1 (test mode on) . action: ? set spi_o utput_format = b1011 or b1010 (automatic tmc26x setting) ? set the upper pwm time dc_time slightly higher than the driver effective blank time tbl (register 0x61) . ? set dc_blktime [clock cycles] when no comparison should happen after a fullstep release (register 0x61). ? set dc_sg [clock cycles 16] as pwm on - time for step loss detection (0x61) . ? set dcstep_mode = b01 ( general_conf register 0x00) . result: the internal dcstep at mp1 input signal approve s further step generation in case the input step s ignals are smaller than the dc_time step length in clock cycles. note: ? even though dcstep is able to decelerate the motor during overload, stalls can occur due to certain negative influences, such as: the motor may stall and lose steps, e.g. because deceleration drops below obligational minimum velocity. in order to safely detect a step loss and avoid restarting of the motor, the stop on stall can be enabled (see s ection 10.4.4 , p age 95 ). concerning dcstep operation with tmc26x: the stall bit from the driver status is substituted by the dcstep stall det ection bit. therefore, the first step at mp1 input directly after a step release is checked against the dc_sg value, which is the maximum pwm on - time. i n case the signal step length is smaller t han dc_sg , a stall has occurred. dc_blktime specifies the number of clock cycl es after a fullstep release in case nothing must be compared; because fragmented steps could occur at mp1. the fir st step after release that is checked is the first step after blank time. the switc h to fullstep drive is performed automa ticall y, as explained in section 10.6.5 and 10.6.6 , p age 102 ) . enabling dcstep for tmc26x stepper motor d rivers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 129 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? dcstep requires a minimum operation velocity dc_vel [pps]. dc_vel must be set to the lowest operating velocity at which dcstep provides a reliable detection of motor operation. i n case an overload appears, an internal dcstep signal is generated that pauses internal step generation. because dcstep operates the motor in fullstep mode, a min imum fullstep frequency f fs can be assigned. therefore, a dcstep low speed timer must be as signed to achieve the following minimum fullstep frequency : f fs = f clk / dc_lsptm . in o rder to set up a minimum dcstep velocity, do as follows: action: ? set the low speed timer dc_lsptm register 0x62, as explained above. ? set dc_vel register 0x60 as threshold velocity value [pps] at which dcstep is activated . result: whenever the internal velocity | vactual | > dc_ve l , dcstep is activated , i f enabled . figure 59 : velocity profile with impact through overload situation ? ? turn page for important information about the chopper settings for microstep and fullstep/dcstep mode. setup: m inimum dcstep v elocity v ( t ) t d c s t e p a c t i v e d c _ v e l 0 v b r e a k v m a x a m a x d m a x d f i n a l a s t a r t n o m i n a l r a m p p r o f i l e r a m p p r o f i l e w i t h t o r q u e o v e r l o a d a n d s a m e t a r g e t p o s i t i o n o v e r l o a d
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 130 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? different chop per settings for microstep and ful lstep/ dcstep mode of tmc26x stepper driver can be transfer red automatically during motion. switching between dcstep mode and microstep mode often requires different chopper settings for tmc26x stepper motor drivers. it is possible to automatically transfer cover datagrams to tmc 26x (see s ection 10.3.7 , p age 92 ) . thereby, it is possible to switch the chopper settings of tmc26x rapidly, shortly before reaching the dcstep velocity. note: ? it is recommended to use this feature because dcstep requires constant off - time chopper settings ; whereas driving with steps and a spreadcycle chopper provides better driving characteristics. in o rder to set up a tmc2 6x dcstep configuration, do as follows: action: ? set the spi_switch_vel register 0x 1d value a li ttle bit smaller than the dc_vel register 0x60 value. ? fill in the cover_low 0x6c register the chopper settings for spreadcycle chopper below the dc_vel. ? fill in the cover_high 0x6d register the chopper settings for a constant off - time chopper during dcstep operation (fullstep mode) . ? set automatic_cover = 1 ( reference_conf register 0x01). result: in case dcstep mode is not activated C because | vactual | < dc_vel C the spreadcycle chopper mode is activated, which is best suited for microstep operation. in case dcstep is activated, the more suited constant off - time chopper mode for fullstep operation is activated. ? ? turn page for more information on enabling dcstep for tmc2130 stepper motor driver. areas of special concern !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 131 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? dcstep operation with tmc2130 is similar to a hand shake procedure: the mp1 input must be connected to the dco output pin of tmc2130, wh ereas mp2 must be connected to the dcen input pin of tmc2130. in order to set up a tmc2 130 dcstep configuration, do as follows: the m andatory tmc2130 con figuration must be executed with cover datagrams, as follows: i please ref er to the tmc2130 manual for correct setting s pertaining to the tmc2130 chopconf and dcctrl registers. action: ? set spi_out put_format = b 110 1 or b11 0 0 (automatic tmc2130 setting) ? set dcstep_mode = b01 ( general_conf register 0x00) . result: in case vactual dc_vel , mp2 output is set to high voltage level to indicate that dcstep can be activated . tmc2130 will wait for the next fulls tep position to switch to dcstep operation. the dcstep signal is provided by the tmc21 30 at dco output pin. tmc4331 a is continually providi ng microsteps even though d cstep is enabled and activated. t mc2130 auto - generates the dcstep behavior int ernally. because dcstep operates the motor in fullstep mode, a minimum fullstep frequency f fs can b e assigned. therefore, a dcstep low speed timer must be assigned to achieve the following minimum fullstep frequen cy : f fs = f clk / dc_lsptm . in o rder to set up a minimum dcstep fullstep frequency, do as follows: action: ? set dc_lsptm register 0x62. result: after dc_lsptm clock cycles expires C without lift ing the internal dcstep signal C a step is enforced when dcstep is enabled. enabling dcstep for tmc2130 stepper motor d rivers se t up minimum dcstep / f ullstep f requency
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 132 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 14. reset and clock gating in addition to the automatic power - on - reset procedure , tmc4331 a provides a software reset option. if not in operation, clock gating can be used to reduce power consumption. reset and clock pins pin names types remarks stpin input high active wake - up signal. clk_ext input connected external clock signal. table 53 : dedicated reset and clock pins reset and clock gating registers register name register address remarks general_conf 0x00 rw bit 18:17 clk_gating_delay 0x14 rw dela time before clock gating is enabled. clk_gating_reg reset _reg 0x 4f rw bit ( 2:0 ) : trigger for clock gating. bit ( 31:8 ) : trigger for sw - reset. table 54 : dedicated reset and clock gating registers a hardware reset is only provided during the power - up cycle, no dedicated hardware pin is available for the reset procedure. p ower - on - r eset is executed automatically. all registers of TMC4331A are reset to default values. in order to reset tmc4331 a without switching the power supply , do as follows: action: ? set reset _reg = 0x5253 54 (bits31:8 of register 0x4f). result: tmc4331 a registers are reset to default values. rst_ev = events(31) is set as indicator signifying that one of the possible reset conditions was triggered. power - on - reset manual software reset reset indication
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 133 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? clock gating must be enabled before activation. in addition, the delay between activation and the ac tive clock gating phase can be configured. in order to activate clock gating manually, do as follows: precondition: vel_state_f = 00 i ndicating that vactu al = 0. action: ? set clk_gating_en = 1 (bit17 of general_conf register 0x00). ? set proper clk_gat ing_delay register 0x14. ? set clk_gating_reg = 0x7 (bit2:0 of register 0x4f). result: when writing to clk_gating_reg , this activates the clk_gating_delay counter, which specifies the delay between clock gating trigger and activation in [number of cycles]. when the counter reaches 0, clock gating is activated. see figure below. note : ? in case clk_gating_reg = 0, clock gating is ex ecuted immediately after activating the clk_gating_reg register . see figure below. in order to conduct clock gating wake - up, do as follows: action: ? set stpin input pin to high voltage level. result: clock - gating is terminated. see figure below. if spi datagram transfers from microcontroller to tmc4331 a prompt wake - up, do as follows: action: ? set clk_gating_delay = 0xffffffff (register 0x14). ? set clk_gating_reg = 0x0 (bit2:0 of register 0x4f). ? set clk_gating_reg = 0x7 (bit2:0 of register 0x4f). ? set clk_gating_en = 0 (bit17 of general_conf register 0x00). result: clock - gating is terminated. figure 60 : manual clock gating activation and wake - u p activating clock gating manually clock gating wake - up e x t e r n a l c l k s i g n a l i n t e r n a l c l k s i g n a l c l k _ g a t i n g _ r e g = 1 1 1 c l k _ g a t i n g _ d e l a y = 5 c l k _ g a t i n g _ r e g = 1 1 1 s p i i n p u t s c l o c k g a t i n g d e l a y t i m e r s t p i n i n p u t s i g n a l
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 134 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? it is possible to use tmc4331 a standby phase to automatically activate clock gating. i for further information about stdby timer, see sect ion 11.1. , page 114 . in order to activate automatic clock gating, do as follows: action: ? set the time frame for stdby_dealy register 0x15 after ramp stop, and before standby phase starts. ? set hold_current_scale_en = 1 ( current_conf register 0x05). ? set clk_gating_en = 1 (bit17 of general_conf register 0x00). ? set proper clk_gating_delay register 0x14. ? set clk_gating_ stdby_ en = 1 (bit17 of general_conf register 0x00). result: after standby phase activation, activation of clock gating counter follows. when the counter reaches 0, clock gating is activated . in addition, the start signal generation, presented in chapter 9 , page 63 , can be used for an automated wake - up. an example is given in the figure below. the chart below shows the target_reached (=tr) signal, which signifies ramp stop at which vactual reaches 0. when vactual = 0, the following process occurs: 1. the start delay timer signifies the time frame between ramp stop and next ramp start. 2. when the standby delay timer expires, the standby phase is activated. 3. when the standby phase is activated, the clock gating delay timer is started. 4. aft er the clock gating delay timer expires, clock gating is activated. 5. shortly before the start delay timer expires, clock gating is disabled, which occurs so that the next ramp is started with proper assigned registers. figure 61 : automatic clock gating activation and wake - up automatic clock gating procedure i n t e r n a l c l k s i g n a l s t a r t _ d e l a y e x t e r n a l c l k s i g n a l s t d b y _ d e l a y c l k _ g a t i n g _ d e l a y c l o c k g a t i n g d e l a y t i m e r s t d b y d e l a y t i m e r s t a r t d e l a y t i m e r t r
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 135 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? t e c h n i c a l s p e c i f i c a t i o n s 15. complete register and switches list general configuration register general_conf 0x00 general_conf 0x00 (default value: 0x00006020) r/w bit val remarks rw 0 use_astart_and_vstart (only valid for s - shaped ramps) 0 sets aactual = amax or C amax at ramp start and i n the case of vstart 0 . 1 sets aactual = astart or C astart at ramp start and i n the case o f vstart 0 . 1 direct_acc_val_en 0 a cceleration values are divided by clk_freq . 1 a cceleration values are set directly as steps per clock cycle . 2 direct_bow_val_en 0 b ow values are calculated due to division by clk_freq . 1 b ow values are set directly as steps per clock cycle . 3 step_inactive_pol 0 stpout = 1 indicates an active step . 1 stpout = 0 indicates an active step . 4 toggle_step 0 o nly stpout transitions from inactive to active polarity indicate steps . 1 e very level change of stpout indicates a step . 5 pol_dir_out 0 dirout = 0 indicates negative direction . 1 dirout = 1 indicates negative direction . 7:6 sdin_mode 0 i nternal step control (internal ramp generator will be used) 1 e xternal step control via stpin / dirin interface with high active steps at stpin 2 e xternal step control via stpin / dirin interface with low active steps at stpin 3 e xternal step control via stpin / dirin interface with toggling steps at stpin 8 pol_dir_in 0 dirin = 0 indicates negative direction . 1 dirin = 1 indicates negative direction . 9 sd_indirect_control 0 stpin/dirin input signals will manipulate internal steps at xactual directly . 1 stpin/dirin input signals will manipulate xtarget register value, the internal ramp generator is used. 12:10 reserved. set to 0 x0 . ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 136 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? general_conf 0x00 (default value: 0x00006020) r/w bit val remarks rw 14:13 stdby_clk_pin_assignment 0 standby signal becomes forwarded with an active low level at stdby_clk output. 1 standby signal becomes forwarded with an active high level at stdby_clk output. 2 stdby_clk passes chopsync clock (tmc23x, tmc24x stepper motor drivers only) . 3 internal clock is forwarded to stdby_clk output pin . 15 intr_pol 0 intr=0 indicates an active interrupt . 1 intr=1 indicates an active interrupt . 16 invert_pol_target_reached 0 target_reached signal is set to 1 to indicate a target reached event . 1 target_reached signal is set to 0 to indicate a target reached event . 17 clk_gating_en 0 clock gating is disabled. 1 internal clock gating is enabled. 18 clk_gating_stdby_en 0 no clock gating during standby phase. 1 intenal clock gating during standby phase is enabled. 19 fs_en 0 fullstep switchover is disabled . 1 spi output forwards fullsteps, if | vactual | > fs_vel . 20 fs_sdout 0 no fullstep switchover for step/dir output is enabled. 1 fullsteps are for warded via step/dir output also if fullstep operation is active. 22:21 dcstep_mode 0 dcstep is disabled . 1 dcstep signal generation will be selected automatically 2 dcstep with external step_ready signal generation ( tmc2130 ) . 3 dcstep with internal step_ready signal generation (tmc26x) . i tmc26x config: use const_toff - chopper (chm = 1); slow decay only (hstrrt = 0); tst = 1 and sgt0=sgt1=1 (on_state_xy) . 23 pwm_out_en 0 pwm output is disabled . step/dir output is enabled at stpout/dirout. 1 stpout/dirout output pins are used as pwm output (pwma/pwmb). 25:24 reserved. set to 0x0. ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 137 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? general_conf 0x00 (default value: 0x00006020) r/w bit val remarks rw 26 automatic_direct_sdin_switch_off 0 vactual =0 & aactual =0 after switching off direct external step control. 1 vactual = vstart and aactual = astart after switching off direct external step control. 27 circular_cnt_as_xlatch 0 the register value of x_latch is forwarded at register 0x36 . 1 the register value of rev_cnt (#internal revolutions) is forwarded at register 0x36. 28 reverse_motor_dir 0 the d irection of the internal sinlut is regular ly used. 1 the d irection of internal sinlut is reversed 29 intr_tr_pu_pd_en 0 i ntr and target_reached are outputs with strongly driven output values.. 1 intr and target_reached are used as outputs with gated pull - up and/or pull - down functionality . 30 intr_as_wired_and 0 intr output function is used as w ired - o r in the case of intr_tr_pu_pd_en = 1. 1 intr ou tput function is used as wired - a nd . in the case of intr_tr_pu_pd_en = 1. 31 tr_as_wired_and 0 target_reached output function is used as w ired - o r in the case of intr_tr_pu_pd_en = 1. 1 target_reached output function is used as w ired - and in the case of intr_tr_pu_pd_en = 1. table 55 : general configuration 0x00
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 138 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? reference switch configuration register reference_conf 0x01 reference_conf 0x01 (default value: 0x00000000) r/w bit val remarks rw 0 stop_left_en 0 stopl signal processing disabled. 1 stopl signal processing enabled. 1 stop_right_en 0 stopr signal processing disabled. 1 stopr signal processing enabled. 2 pol_stop_left 0 stopl input signal is low active. 1 stopl input signal is high active. 3 pol_stop_right 0 stopr input signal is low active. 1 stopr input signal is high active. 4 invert_stop_direction 0 stopl/stopr stops motor in negative/positive direction. 1 stopl/stopr stops motor in positive/negative direction. 5 soft_stop_en 0 hard stop enabled. vactual is immediately set to 0 on any external stop event. 1 soft stop enabled. a linear velocity ramp is used for decreasing vactual to v = 0. 6 virtual_left_limit_en 0 position limit virt_stop_left disabled. 1 position limit virt_stop_left enabled. 7 virtual_right_limit_en 0 position limit virt_stop_right disabled. 1 position limit virt_stop_right enabled. 9:8 virt_stop_mode 0 r eserved . 1 hard stop: vactual is set to 0 on a virtual stop event. 2 soft stop is enabled with linear velocity ramp (from vactual to v = 0). 3 r eserved . 10 latch_x_on_inactive_l 0 no latch of xactual if stopl becomes inactive. 1 x_latch = xactual is stored in the case stopl becomes inactive. 11 latch_x_on_active_l 0 no latch of xactual if stopl becomes active. 1 x_latch = xactual is stored in the case stopl becomes active. ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 139 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? reference_conf 0x01 (default value: 0x00000000) r/w bit val remarks rw 12 latch_x_on_inactive_r 0 no latch of xactual if stopr becomes inactive. 1 x_latch = xactual is stored in the case stopl becomes inactive. 13 latch_x_on_active_r 0 no latch of xactual if stopr becomes active. 1 x_latch = xactual is stored in the case stopl becomes active. 14 stop_left_is_home 0 stopl input signal is not also the home position. 1 stopl input signal is also the home position. 15 stop_right_is_home 0 stopr input signal is not lso the home position. 1 stopr input signal is also the home position. 19:16 home_event 2 home_ref = 1 indicates an active home event x_home is located at the rising edge of the active range. 3 home_ref = 0 indicates negative region/position from the home position. 4 home_ref = 1 indicates an active home event x_home is located at the falling edge of the active range. 6 home_ref = 1 indicates an active home event x_home is located in the middle of the active range. 9 home_ref = 0 indicates an active home event x_home is located in the middle of the active range. 11 home_ref = 0 indicates an active home event x_home is located at the rising edge of the active range. 12 home_ref = 1 indicates negative region/position from the home position. 13 home_ref = 0 indicates an active home event x_home is located at the falling edge of the active range. 20 start_home_tracking 0 no storage to x_home by passing home position. 1 storage of xactual as x_home at next regular home event. an xlatch_done event is released. in case the event is cleared, start_home_tracking is reset automatically. 21 clr_pos_at_target 0 ramp stops at xtarget if positioning mode is active. 1 set xactual = 0 after xtarget has been reached. th e next ramp starts immediately. 22 circular_movement_en 0 r ange of xactual is not limited : - 2 31 xactual 2 31 - 1 1 r ange of xactual is limited by x_range : - x_range xactual x_range - 1 ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 140 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? reference_conf 0x01 (default value: 0x00000000) r/w bit val remarks rw 24:23 pos_comp_output 0 target_reached is set active on target_reached_f lag . 1 target_reached is set active on velocity _reache d_f lag. 3 target_reached triggers on poscomp_reache d_f lag. 25 reserved. set to 0. 26 stop_on_stall 0 spi and s/d output interface remain active in case of an stall event. 1 spi and s/d output interface stops motion in case of an stall event (hard stop). 27 drv_after_stall 0 no further motion in case of an active stop - on - stall event. 1 motion is possible in case of an active stop - on - stall event and after the stop - on - stall event is reset. 29:28 modified_pos_compare: pos_comp_reached_f / event is based on comparison between xactual and 0 pos_comp 1 x_home 2 x_latch 3 rev_cnt 30 automatic_cover 0 spi output interface will not transfer automatically any cover datagram . 1 spi output interface send s automatically cover datagrams when vactual crosses spi_switch_vel . 31 reserved. set to 0. table 56 : reference switch configuration 0x01
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 141 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? start switch configuration register start_conf 0x02 start_conf 0x02 (default value: 0x00000000) r/w bit val remarks rw 4:0 start_en xxxx1 alteration of xtarget value requires distinct start signal. xxx1x alteration of vmax value requires distinct start signal. xx1xx alteration of rampmode value requires distinct start signal. x1xxx alteration of gear_ratio value requires distinct start signal. 1xxxx shadow register feature set is enabled. 8:5 trigger_events 0000 timing feature set is disabled because start signal generation is disabled. xxx0 start pin is assigned as output. xxx1 external start signal is enabled as timer trigger. start pin is assigned as input. xx1x target_reached event is assigned as start signal trigger. x1xx velocity_reached event is assigned as start signal trigger. 1xxx poscomp_reached event is assigned as start signal trigger. 9 pol_start_signal 0 start pin is low active (input resp. output). 1 start pin is high active (input resp. output). 10 immediate_start_in 0 active start input signal starts internal start timer. 1 active start input signal is executed immediately. 11 busy_state_en 0 start pin is only assigned as input or output. 1 busy start state is enabled. start pin is assigned as input with a weakly driven active start polarity or as output with a strongly driven inactive start polarity. 15:12 pipeline_en 0000 no pipelining is active. xxx1 x_target is considered for pipelining. xx1x pos_comp is considered for pipelining. x1xx gear_ratio is considered for pipelining. 1xxx general_conf is considered for pipelining. 17:16 shadow_option 0 single - level shadow registers for 13 relevant ramp parameters. 1 double - stage shadow registers for s - shaped ramps. 2 double - stage shadow registers for trapezoidal ramps (excl. vstop ). 3 double - stage shadow registers for trapezoidal ramps (excl. vst art ). ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 142 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? start_conf 0x02 (default value: 0x00000000) r/w bit val remarks rw 18 cyclic_shadow_regs 0 current ramp parameters are not written back to the shadow register. 1 current ramp parameters are written back to the appropriate shadow register. 19 reserved. set to 0. 23:20 shadow_miss_cnt u number of unused start internal start signals between two consecutive shadow register transfers. 31:24 xpipe_rewrite_reg current assigned pipeline registers C start_conf (15:12) C are written back to x_pipex in the case of an internal start signal generation and if assigned in this register with a 1: xpipe_rewrite_reg (0) ? x_pipe0 xpipe_rewrite_reg (1) ? x_pipe1 xpipe_rewrite_reg (2) ? x_pipe2 xpipe_rewrite_reg (3) ? x_pipe3 xpipe_rewrite_reg (4) ? x_pipe4 xpip e_rewrite_reg (5) ? x_pipe5 xpipe_rewrite_reg (6) ? x_pipe6 xpipe_rewrite_reg (7) ? x_pipe7 ex.: start_conf (15:12) = b0011. start_conf (31:24) = b01000010. if an internal start signal is generated, the value of x_target is written back to x_pipe1 , whereas the value of pos_comp is written back to x_pipe6 . table 57 : start switch configuration start_conf 0x02
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 143 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? input filter configuration register input_filt_conf 0x03 input_filt_conf 0x03 (default value: 0x00000000) r/w bit val remarks rw 2:0 sr_ sd _in u input sample rate = f clk / 2 sr_ sd _in for the following pins: stpin, dirin 3 reserved. set to 0. 6:4 filt_ l _ sd _in u filter length for the se pins: stpin, dirin . number of sample input bits that must have equal voltage levels to provide a valid input bit. 3 reserved . set to 0. 10:8 sr_ref u input sample rate = f clk / 2 re f for the following pins: stopl, home_ref, stopl 11 reserved. set to 0. 14:12 filt_l_ ref u filter length for the following pins: stopl, home_ref, stopl. number of sample input bits that must have equal voltage levels to provide a valid input bit. 15 reserved. set to 0. 18:16 sr_s u input sample rate = f clk / 2 s for the start pin. 19 reserved. set to 0. 22:20 filt_l_s u filter length for the start pin. number of sample input bits that must have equal voltage levels to provide a valid input bit. 31: 23 reserved. set to 0 x00 . table 58 : input filter configuration register input_filt_conf 0x03
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 144 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi output configuration register spi_out_conf 0x04 spi_out_conf 0x04 (default value: 0x00000000) r/w bit val remarks rw 3:0 spi_output_format 0 spi output interface is off . 1 spi output interface is connected with a spi - dac . spi output values are mapped to full amplitude: current=0 ? vcc/2 current= - max ? 0 current=max ? vcc 2 spi output interface is connected with a spi - dac . spi output values are absolute values . phase of coila is forwarded via stpout , whereas phase of coilb is for warded via dirout. phase bit = 0:positive value. 3 spi output interface is connected with a spi - dac . spi output values are absolute values . phase of coila is forwarded via stpout , whereas phase of coilb is for warded via dirout. phase bit = 0: negative value. 4 the actual unsigned scaling factor is forwarded via spi output interface. 5 both actual signed current values currenta and currentb are forwarded in one datagram via spi output interface. 6 spi output interface is connected with a spi - dac . the actual unsigned scaling factor is merged with dac_addr_a value to an output datagram. 8 spi output interface is connected with a tmc23x stepper motor driver. 9 spi output interface is connected with a tmc24x stepper motor driver. 10 spi output interface is connected with a tmc26x/389 stepper motor driver. configuration and current data are transferred to the stepper motor driver. 11 spi output interface is connected with a tmc26x stepper motor driver. only configuration data is transferred to the stepper motor driver. s/d output interface provides steps. 12 spi output interface is connected with a tmc2130 stepper motor driver. only configuration data is transferred to the stepper motor driver. s/d output interface provides steps. 13 spi output interface is connected with a tmc2 130 stepper motor driver. configuration and current data are transferred to t he stepper motor driver. 15 only cover datagrams are transferred via spi output interface. 19:13 cover_data_length u number of bits for the complete datagram length. maximum value = 64 set to 0 in case a tmc stepper motor driver is selected. the datagram length is then selected automatically. 23:20 spi_out_low_time u number of clock cycles the spi output clock remains at low level. 27:24 spi_out_high_time u number of clock cycles the spi output clock remains at high level. 31:28 spi_out_block_time u number of clock cycles the nscsdrv output remains high (inactive) after a spi output transmission. ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 145 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi_out_conf 0x04 (default value: 0x00000000) r/w bit val remarks rw 5:4 mixed_decay (tmc23x/24x only) 0 both mixed decay bits are always off. 1 mixed decay bits are on during falling ramps until reaching a current value of 0. 2 mixed decay bits are always on, except during standstill. 3 mixed decay bits are always on. 6 stdby_on_stall_for_24x (tmc24x only) 0 no standby datagram is sent. 1 in case of a stop - on - stall event, a standby datagram is sent to the tmc24x. 7 stall_flag_instead_of_uv_en (tmc24x only) 0 undervoltage flag of tmc24x is mapped at status (24). 1 calculated stall status of tmc24x is forwarded at status (24). 10:8 stall_load_limit (tmc24x only) u a stall is detected if the stall limit value stall_load_limit is higher than the combination of the load bits (ld2&ld1&ld0). 11 pwm_phase_shft_en (tmc24x only) 0 no phase shift during pwm mode. 1 during pwm mode, the internal sinlut microstep position mscnt is shifted to ms_offset microsteps. consequently, the sine/cosine values have a phase shift of ( ms_offset / 1024 ? 360) 12 double_freq_at_stdby (tmc23x/24x only) 0 chopsync frequency remains stable during standby. 1 chop_sync_div is halfed during standby. 4 three_phase_stepper_en (tmc389 only) 0 a 2 - phase stepper motor driver is connected to the spi output (tmc26x). 1 a 3 - phase stepper motor driver is connected to the spi output (tmc389). 5 scale_val_transfer_en (tmc26x/2130 in sd mode only) 0 no transfer of scale values. 1 transmission of current scale values to the appropriate driver registers. 6 disable_polling (tmc26x/2130 in sd mode only) 0 permanent transfer of polling datagrams to check driver status. 1 no transfer of polling datagrams. 7 autorepeat_cover_en (tmc26x/2130 only) 0 no automatic continuous streaming of cover datagrams. 1 enabling of automatic continuous streaming of cover datagrams. 11:8 poll_block_ exp (tmc26x in sd mode only , tmc2130 only ) u multiplier for calculating the time interval between two consecutive polling datagrams: t poll = 2^ poll_block_ exp ? spi_out_block_time / f clk 12 cover_done_only_for_cover (tmc26x/2130 only) 0 cover_done event is set for every datagram that is sent to the motor driver. 1 cover_done event is only set for cover datagrams sent to the motor driver. ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 146 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? spi_out_conf 0x04 (default value: 0x00000000) r/w bit val remarks rw 4 sck_low_before_csn (no tmc driver) 0 nscsdrv is tied low before sckdrv to initiate a new data transfer. 1 sckdrv is tied low before nscsdrv to initiate a new data transfer. 5 new_out_bit_at_rise (no tmc driver) 0 new value bit at sdodrv is assigned at falling edge of sckdrv . 1 new value bit at sdodrv is assigned at rising edge of sckdrv . 11:7 dac_cmd_length (spi - dac only) u number of bits for command address. 12 reserved. set to 0. table 59 : spi output configuration register spi_out_conf 0x0 4
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 147 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? current scaling configuration register current_conf 0x05 c urrent_conf 0x05 (default: 0x00000000) r/w bit val remarks rw 0 hold_current_scale_en 0 no hold current scaling during standstill phase. 1 hold current scaling during standstill phase. 1 drive_current_scale_en 0 no drive current scaling during motion. 1 drive current scaling during motion. 2 boost_current_on_acc_en 0 no boost current scaling for deceleration ramps. 1 boost current scaling if ramp_state = b 0 1 (acceleration slopes). 3 boost_current_on_dec_en 0 no boost current scaling for deceleration ramps. 1 boost current scaling if ramp_state = b10 (deceleration slopes). 4 boost_current_after_start_en 0 no boost current at ramp start. 1 temporary boost current if vactual = 0 and new ramp starts. 5 sec_drive_current_scale_en 0 one drive current value for the whole motion ramp . 1 second drive current scaling for vactual > vdrv_scale_limit . 6 freewheeling_en 0 no freewheeling. 1 freewheeling after standby phase. 7 reserved. set to 0. 8 pwm_scale_en 0 pwm scaling is disabled. 1 pwm scaling is enabled. 15: 9 reserved. set to 0x00. 31:16 pwm_ampl u pwm amplitude during voltage pwm mode at vactual = 0. i maximum duty cycle = (0.5 + ( pwm_ampl + 1) / 2 17 ) minimum duty cycle = (0.5 C ( pwm_ampl + 1) / 2 17 ) pwm_ampl = 2 16 C 1 at vactual = pwm_vmax . table 60 : current scale configuration (0x05)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 148 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? current scale values register scale_values 0x06 scale_values 0x06 (default: 0xffffffff) r/w bit val scaling value name remarks rw 7:0 u boost_scale_val open - loop boost scaling value. 15:8 u drv1_scale_val open - loop first drive scaling value. 23:16 u drv2_scale_val open - loop second drive scaling value. 31:24 u hold_scale_val open - loop standby scaling value. table 61 : current scale values (0x06) note: ? boost_scale_val, drv1/drv2_scale_val, hold_scale_val . ? rea l scaling value = (x+1) / 32 if spi_output_format = b1011 or b1100 . ? = (x+1) / 256 any other spi_output_format setting . motor driver settings register step_conf 0x0a step _conf 0x0a (default: 0x 00fb0c80 ) r/w bit val remarks rw 3:0 mstep_per_fs (default: 0x 0 ) 0 h ighest micros teps resolution: 256 micros teps per fullstep. i when using a step/dir driver, it must be capable of a 256 resolution via step/dir input for best performance (but lower resolution step/dir drivers can be used as well). 1 128 micros teps per fullstep. 2 64 micros teps per fullstep. 3 32 micros teps per fullstep. 4 16 micros teps per fullstep. 5 8 micros teps per fullstep. 6 4 micros teps per fullstep. 7 halfsteps: 2 micros teps per fullstep. 8 full steps (maximum possible setting) 15:4 fs_per_rev (default: 0x 0c8 ) u fullsteps per motor axis revolution 23:16 mstatus_selection (default: 0x fb ) selection of motor driver status bits for spi response datagrams: ored with motor driver status register set (7 :0): if set here and a particular flag is set from the motor stepper driver , an event will be generated at events (30) 31:24 reserved. set to 0x00. table 62 : motor driver settings (0x0a)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 149 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? event selection registers 0x0b..0x0d event selection registers r/w addr bit remarks rw 0x0b spi_status_selection (default: 0x82029805) 31:0 events selection for spi datagrams: event bits of events register 0x0e that are selected (=1) in this register are forwarded to the eight status bits that are transferred with every spi datagram (first eight bits from lsb are significant!). 0x0c event_clear_conf ( default: 0x00000000) 31:0 event protection configuration: event bits of events register 0x0e that are selected in this register (=1) are not cleared during the read out process of events register 0x0e. 0x0d intr_conf ( default: 0x00000000) 31:0 event selection for intr output: all event bits of events register 0x0e that are selected here (=1) are ored wi th interrupt event register set: if any of the selected events is active, an interrupt at intr is generated. table 63 : event selection regsiters 0x0b0x0d
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 150 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? status event register (0x0e) status event register events 0x0e r/w bit description r+c w 0 target_reached has been triggered. 1 pos_comp_reached has been triggered. 2 vel_reached has been triggered. 3 vel_state = b00 has been triggered ( vactual = 0). 4 vel_state = b01 has been triggered ( vactual > 0). 5 vel_state = b10 has been triggered ( vactual < 0). 6 ramp_state = b00 has been triggered ( aactual = 0, vactual is constant). 7 ramp_state = b01 has been triggered (| vactual | increases). 8 ramp_state = b10 has been triggered (| vactual | increases). 9 max_phase_trap : trapezoidal ramp has re ached its limit speed using maximum values for amax or dmax ( | vactual | > vbreak ; vbreak 0). 10 reserved. 11 stopl has been triggered. motion in negative direction is not executed until this event is cleared and (stopl is not active any more or stop_left_en is set to 0). 12 stopr has been triggered. motion in positive direction is not executed until this event is cleared and (stopr is not a ctive any more or stop_right_en is set to 0). 13 vstopl_active: vstopl has been activated. no further motion in negative direction until this event is cleared and (a new value is chosen for vstopl or virtual_left_limit_en is set to 0). 14 vstopr_active: vstopr has been activated. no further motion in positive direction until this event is cleared and (a new value is chosen for vstopr or virtual_right_limit_en is set to 0). 15 home_error: unmatched home_ref polarity and home is outside of safety margin. 16 xlatch_done indicates if x_latch was rewritten or homing process has been completed. 17 fs_active : fullstep motion has been activated. 24: 18 reserved . 25 cover_done: spi datagram was sent to the motor driver. 28: 26 reserved. 29 stop_on_stall: motor stall detected. motor ramp has stopped. 30 motor_ev: one of the selected tmc motor driver flags was triggered. 31 rst_ev : reset was triggered. table 64 : status e vent register events (0x0e)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 151 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? status flag register (0x0f) status fl ag register status 0x0f r/w bit description r 0 target_reached_f is set high if xactual = xtarget 1 pos_comp_reached_f is set high if xactual = pos_comp 2 vel_reached_f is set high if vactual = | vmax | 4:3 vel_state_f : current velocity state: 0 ? vactual = 0; 1 ? vactual > 0; 2 ? vactual < 0 6:5 ramp_state_f : current ramp state: 0 ? aactual = 0; 1 ? aactual increases (acceleration); 2 ? aactual decreases (deceleration) 7 stopl_active_f : left stop switch is active. 8 stopr_active_f : right stop switch is active. 9 vstopl_active_f : left virtual stop switch is active. 10 vstopr_active_f : right virtual stop switch is active. 11 active_stall_f : motor stall is detected and vactual > vstall_limit . 12 home_error_f : home_ref input signal level is not equal to expected home level. 13 fs_active_f : fullstep operation is active. 23: 1 4 reserved. 24 tmc26x / tmc2130 only: sg : stallguard2 status optional for tmc24x only: calculated stallguard status. tmc23x / tmc24x only: uv_sf : undervoltage flag. 25 all tmc motor drivers : ot : overtemperature shutdown . 26 all tmc motor drivers : otpw : overtempe rature warning . 27 tmc26x / tmc2130 only: s2ga : short to gro und detection bit for high side mosfet of coil a. tmc23x / tmc24x only: oca : overcurrent bridge a . 28 tmc26x / tmc2130 only: s2gb : short to ground detection bit for high side mosfet of coil b. tmc23x / tmc24x only: ocb : overcurrent bridge b . 29 all tmc motor drivers : ola : open load indicator of coil a. 30 all tmc motor drivers : olb : open load indicator of coil b. 31 tmc26x / tmc2130 only: stst : standstill indicator . tmc23x / tmc24x only: ochs : overcurrent high side. table 65 : status flag register status (0x0f)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 152 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? configu ration registers various configuration registers r/w addr bit val description rw 0x10 15:0 stp_length_add (default: 0x0000) u additional length [# clock cycles] for active step polarity to indicate an active output step at stpout. 31:16 dir_setup_time (default: 0x0000) u delay [# clock cycles] between dirout and stpout voltage level changes. 0x11 31:0 start_out_add (default:0x00000000) u additional length [# clock cycles] for active start signal. active start signal length = 1+start_out_add 0x12 31:0 gear_ratio (default:0x01000000) s constant value that is added to the internal position counter by an active step at stpin. value representation: 8 digits and 24 decimal places. 0x13 31:0 start_delay (default:0x00000000) u delay time [# clock cycles] between start trigger and internal start signal release. 0x14 31:0 clk_gating_delay (default:0x00000000) u delay time [# clock cycles] between clock gating trigger and clock gating start. 0x15 31:0 stdby_delay (default:0x00000000) u delay time [# clock cycles] between ramp stop and activating standby phase. 0x16 31:0 freewheel_delay (default:0x00000000) u delay time [# clock cycles] between initialization of active standby phase and freewheeling initialization. 0x17 23:0 vdrv_scale_limit (default:0x00000000) (voltage pwm mode is not active) u drive scaling separator: drv2_scale_val is active in case vactual > vdrv _ scale_limit drv1_scale_val is active in case vactual vdrv _ scale_limit pwm_vmax (default:0x00000000) (voltage pwm is enabled) u pwm velocity value at which maximal scale parameter value 1.0 is reached. 0x18 23:0 up_scale_delay (default:0x000000) u increment delay [# clock cycles]. the value defines the clock cycles, which are used to increase the current scale value for one step towards higher values. 0x19 23:0 hold_scale_delay (default:0x000000) u decrement delay [# clock cycles] to decrease the actual scale value by one step towards hold current. 0x1a 23:0 drv_scale_delay (default:0x000000) u decrement delay [# clock cycles], which signifies current scale value decrease by one step towards lower value. 0x1b 31:0 boost_time (default:0x00000000) u time [# clk cycles] after a ramp start when boost scaling is active. ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 153 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? various configuration registers r/w addr bit val description rw 0x1d 15:0 dac_addr_a (default:0x0000) u fixed command/address , which is sent via spi output before sending currenta_spi values. 31:16 dac_addr_b (default: 0x0000) u fixed command/address, which is sent via spi output before sending current currentb_spi values. 0x1e 15:0 home_safety_margin (default: 0x0000) u home_ref polarity can be invalid within x_home home_safety_margin , which is not flagged as error. 0x1f 15:0 pwm_freq (default: 0x0280) (voltage pwm is enabled) u number of clock cycles for one pwm period. 11:0 chopsync_div (default: 0x0280) ( chopsync for tmc23x/24x is enabled) u chopper clock divider that defines the chopper frequency f osc : f osc = f clk / chopsync_div with 96 chopsync_div 818 table 66 : various configuration registers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 154 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? ramp generator registers ramp generator registers r/w addr bit val description rw 0x20 rampmode (default:0x0) 2 operation mode: 1 positioning mode : xtarget is superior target of velocity ramp. 0 velocitiy mode : vmax is superior target of velocity ramp. 1:0 motion profile: 0 no ramp : vactual follows only vmax (rectangle velocity shape). 1 trapezoidal ramp (incl. sixpoint ramp) : c onsideration of acceleration and deceleration values for generating vactual without adapting the acceleration values. 2 s - shaped ramp: c onsideration of all ramp values (incl. bow values) for generating vactual . rw 0x21 31:0 xactual (default: 0x00000000) s actual internal motor position [pulses]: C 2 31 xactual 2 31 C 1 r 0x22 31:0 vactual (default: 0x00000000) s actual ramp generator velocity [pulses per second]: 1 pps | vactual | clk_freq ? pulses (f clk = 16 mhz ? 8 mpps) r 0x23 31:0 aactual (default: 0x00000000) s actual acceleration/deceleration value [pulses per sec 2 ]: - 2 31 pps2 aactual 2 31 C 1 1 pps2 | aactual | rw 0x24 31:0 vmax (default: 0x00000000) s maximum ramp generator velocity in positioning mode or target ramp generator velocity in velocity mode and no ramp motion profile . value representation: 23 digits and 8 decimal places consider maximum values, represented in section 6.7.5 , page 46 rw 0x25 30:0 vstart (default: 0x00000000) u absolute start velocity in positioning mode and velocity mode in case vstart is used: no first bow phase b 1 for s - shaped ramps vstart in p ositioning mode : in case vactual = 0 and xtarget xactual : no acceleration phase for vactual = 0 ? vstart. vstart in velocity mode : in case vactual = 0 and vactual vmax : no acceleration phase for vactual = 0 ? vstart . value representation: 23 digits and 8 decimal places. consider maximum values, represented in section 6.7.5 , page 46 ? ? continued on next page .
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 155 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? ramp generator registers r/w addr bit val description rw 0x26 30:0 vstop ( default: 0x00000000) u absolute stop velocity in positioning mode and velocity mode. in case vstop is used: no last bow phase b 4 for s - shaped ramps. in case vstop is very small and positioning mode is used, it is possible that the ramp is finished with a constant vactual = vstop until xtarget is reached . vstop in positioning mode : in case vactual vstop and xtarget = xactual : vactual is immediately set to 0. vstop in v elocity mode : in case vactual vstop and vmax = 0: vactual is immediately set to 0. value representation: 23 digits and 8 decimal places. consider maximum values, represented in section 6.7.5 , page 46 0x27 30:0 vbreak ( default: 0x00000000) u absolute break velocity in positioning mode and in velocity mode, this only applies for trapezoidal ramp motion profiles. i n case vbreak = 0: pure linear ramps are generated with amax / dmax only. in case | vactual | < vbreak : | aactual | = astart or dfinal in case | vactual | vbreak : | aactual | = amax or dmax always set vbreak > vstop ! if vbreak 0. value representation: 23 digits and 8 decimal places. consider maximum values, represented in section 6.7.5 , page 46 0x28 23:0 amax ( default: 0x000000) u s - shaped ramp motion profile : maximum acceleration value. trapezoidal ramp motion profile : acceleration value in case | vactual | vbreak or in case vbreak = 0. value representation: frequency mode : [pulses per sec 2 ] 22 digits and 2 decimal places: 250 mpps 2 amax 4 mpps 2 direct mode: [ ?v per clk cycle ] a[?v per clk_cycle]= amax / 2 37 amax [pps 2 ] = amax / 2 37 ? f clk 2 consider maximum values, represented in section 6.7.5 , page 46 0x29 23:0 dmax ( default: 0x000000) u s - shaped ramp motion profile : maximum de celeration value. trapezoidal ramp motion profile : de celeration value if | vactual | vbreak or if vbreak = 0. value representation: frequency mode : [pulses per sec 2 ] 22 digits and 2 decimal places: 250 mpps 2 dmax 4 mpps 2 direct mode: [ ?v per clk cycle ] d [?v per clk_cycle]= d max / 2 37 d max [pps 2 ] = d max / 2 37 ? f clk 2 consider maximum values, represented in section 6.7.5 , page 46 ? ? continued on next page.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 156 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? ramp generator registers r/w addr bit val description rw 0x2a 23:0 astart (default: 0x000000) u s - shaped ramp motion profile : start acceleration value. trapezoidal ramp motion profile : acceleration value in case | vactual | < vbreak . acceleration value a fter switching from external to internal step control. value representation: frequency mode : [pulses per sec 2 ] 22 digits and 2 decimal places: 250 mpps 2 astart 4 mpps 2 direct mode: [ ?v per clk cycle ] a[?v per clk_cycle]= astart / 2 37 astart [pps 2 ] = astart / 2 37 ? f clk 2 consider maximum values, represented in section 6.7.5 , page 46 31 sign of aactual after switching from external to internal step control. 0x2b 23:0 dfinal (default: 0x000000) u s - shaped ramp motion profile : s top deceleration value, which is not used during positioning mode. trapezoidal ramp motion profile : de celeration value in case | vactual | < vbreak . value representation: frequency mode : [pulses per sec 2 ] 22 digits and 2 decimal places: 250 mpps 2 dfinal 4 mpps 2 direct mode: [ ?v per clk cycle ] d [?v per clk_cycle]= dfinal / 2 37 dfinal [pps 2 ] = dfinal / 2 37 ? f clk 2 consider maximum values, represented in section 6.7.5 , page 46 0x2c 23 dstop (default: 0x000000) u deceleration value for an automatic linear stop ramp to vactual = 0. dstop is used with activated external stop switches (stopl or stopr) if soft_stop_enable is set to 1; or with activated virtual stop switches and virt_stop_mode is set to 2 . value representation: frequency mode : [pulses per sec 2 ] 22 digits and 2 decimal places: 250 mpps 2 dstop 4 mpps 2 direct mode: [ ?v per clk cycle ] d [?v per clk_cycle]= dstop / 2 37 dstop [pps 2 ] = dstop / 2 37 ? f clk 2 consider maximum values, represented in section 6.7.5 , page 46 ? ? continued on next page !
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 157 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? ramp generator registers r/w addr bit val description rw 0x2d 23 :0 bow1 (default: 0x000000) u bow value 1 (first bow b 1 of the acceleration ramp) . value representation: frequency mode : [pulses per sec 3 ] 2 4 digits and 0 decimal places: 1 pps 3 bow1 16 mpps 3 direct mode: [ ? a per clk cycle ] bow[a v per clk_cycle]= bow1 / 2 53 bow1 [pps 3 ] = bow1 / 2 53 ? f clk 3 consider maximum values, represented in section 6.7.5 , page 46 0x2e 23:0 bow2 (default: 0x000000) u bow value 2 (second bow b2 of the acceleration ram p) . value representation: frequency mode : [pulses per sec 3 ] 2 4 digits and 0 decimal places: 1 pps 3 bow2 16 mpps 3 direct mode: [ ? a per clk cycle ] bow[a v per clk_cycle]= bow2 / 2 53 bow2 [pps 3 ] = bow2 / 2 53 ? f clk 3 consider maximum values, represented in section 6.7.5 , page 46 0x2f 23:0 bow3 (default: 0x000000) u bow value 3 (first b ow b3 of the deceleration ramp). value representation: frequency mode : [pulses per sec 3 ] 2 4 digits and 0 decimal places: 1 pps 3 bow3 16 mpps 3 direct mode: [ ? a per clk cycle ] bow[a v per clk_cycle]= bow3 / 2 53 bow3 [pps 3 ] = bow3 / 2 53 ? f clk 3 consider maximum values, represented in section 6.7.5 , page 46 0x30 23:0 bow 4 (default: 0x0000 0 0) u bow value 4 (second bow b4 of the deceleration ramp) . value representation: frequency mode : [pulses per sec 3 ] 2 4 digits and 0 decimal places: 1 pps 3 bow4 16 mpps 3 direct mode: [ ? a per clk cycle ] bow[a v per clk_cycle]= bow4 / 2 53 bow4 [pps 3 ] = bow4 / 2 53 ? f clk 3 consider maximum values, represented in section 6.7.5 , page 46 table 67 : ramp generator registers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 158 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? external clock frequency register external clock frequency register r/w addr bit val description rw 0x31 24:0 clk_freq (default: 0x0f42400) u external clock frequency value f clk [hz] with 4.2 mhz f clk 3 2 mhz table 68 : external clock frequency register target and compare registers target and compare registers r/w addr bit val description rw 0x3 2 31 :0 pos_comp (default: 0x0 00000 00) s compare position. rw 0x33 31:0 virt_stop_left (default: 0x00000000) s virtual left stop position. rw 0x34 31:0 virt_stop_right (default: 0x00000000) s virtual right stop position. rw 0x35 31:0 x_home (default: 0x00000000) s actual home position. r 0x36 31:0 x_latch (default: 0x00000000) ( if circular_cnt_as_xlatch = 0 ) s storage position for certain triggers. rev_cnt (default: 0x00000000) ( if circular_cnt_as_xlatch = 1 ) s number of revolutions during circular motion . w 30:0 x_range (default: 0x00000000) u limitation for x_actual during circular motion: - x_range x_actual x_range - 1 rw 0x37 31:0 x_target (default: 0x00000000) u target motor position in positioning mode. set all other motion profile parameters before! table 69 : target and compare registers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 1 59 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? pipeline registers shadow register pipeline register r/w addr bit val description rw 0x38 31:0 s x_pipe0 (default: 0x0 00000 00) : 1 st pipeline register. 0x39 31:0 s x_pipe1 (default: 0x00000000): 2 nd pipeline register. 0x3a 31:0 s x_p ipe2 (default: 0x00000000) : 3 rd pipeline register. 0x3b 31:0 s x_p ipe3 (default: 0x00000000): 4 th pipeline register. 0x3c 31:0 s x_p ipe4 (default: 0x00000000): 5 th pipeline register. 0x3d 31:0 s x_p ipe5 (default: 0x00000000): 6 th pipeline register. 0x3e 31:0 s x_p ipe6 (default: 0x00000000): 7 th pipeline register. 0x3f 31:0 s x_p ipe7 (default: 0x00000000): 8 th pipeline register. table 70 : pipe line register s shadow register r/w addr bit val description rw 0x40 31:0 s sh_reg0 (default: 0x00000000) : 1 st shadow register. 0x41 31:0 u sh_reg1 (default: 0x00000000) : 2 nd shadow register. 0x42 31:0 u sh_reg2 (default: 0x00000000) : 3 rd shadow register. 0x43 31:0 u sh_reg3 (default: 0x00000000) : 4 th shadow register. 0x44 31:0 u sh_reg4 (default: 0x00000000) : 5 th shadow register. 0x45 31:0 u sh_reg5 (default: 0x00000000) : 6 th shadow register. 0x46 31:0 u sh_reg6 (default: 0x00000000) : 7 th shadow register. 0x47 31:0 s/u sh_reg7 (default: 0x00000000) : 8 th shadow register. 0x48 31:0 u sh_reg8 (default: 0x00000000) : 9 th shadow register. 0x49 31:0 u sh_reg9 (default: 0x00000000) : 10 th shadow register. 0x4a 31:0 u sh_reg10 (default: 0x00000000) : 11 th shadow register. 0x4b 31:0 u sh_reg11 (default: 0x00000000) : 12 th shadow register. 0x4c 31:0 u sh_reg12 (default: 0x00000000) : 13 th shadow register. 0x4d 31:0 u sh_reg13 (default: 0x00000000) : 14 th shadow register. table 71 : shadow register s
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 160 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? reset and clock gating register dcstep registers micellaneous registers r/ w addr bit val description w 0x60 23 : 0 fs_ve l ( default: 0x000000) (open - loop operation) u minimum fullstep velocity [pps]. in case | vactual | > fs_vel fullstep operation is active, if enabled. dc_vel ( default: 0x000000) (dcstep only ) u minimum dcstep velocity [pps]. in case| vactual | > dc _vel dcstep is active, if enabled. 0x61 7:0 dc_time (default:0x00) (tmc26x only and dcstep only ) u upper p wm on - time limit for commutation. i set slightly above effective blank time tbl of the driver. 15:8 dc_sg (default:0x0000) (tmc26x and dcstep only ) u maximum pwm on - time [# clock cycles ? 16] for step loss detection. if a loss is detected (step length of first regular step after blank time of the dcstep input signal is below dc_sg ), a stall event will be released. 31:16 dc_blktime (default:0x0000) (tmc26x and dcstep only ) u blank time [# clock cycles] after fullstep release when no signal comparison should happen. 0x62 31:0 dc_lsptm (default:0x00ffffff) (dcstep only ) u dcstep low speed timer [# clock cycles] table 73 : dcstep registers reset and clock gating register r/w a ddr bit val description rw 0x4 f 2 : 0 clk_gating_reg (default: 0x0) 0 clock gating is not activated. 7 clock gating is activated. 31 : 8 reset_reg (default: 0x000000) 0 no reset is activated. 0x525354 internal reset is activated. table 72 : reset and clock gating register
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 161 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? transfer registers transfer registers r/ w addr bit val description w 0x6c 31:0 cover_low (default:0x00000000) - lower configuration bits of spi orders that can be sent from tmc4331 a to the motor drivers via spi output. automatic cover data transfer ( automatic_cover = 1): value in cover_low are sent in case | vactual | crosses spi_switch_vel downwards. set cover_data_length 32. in case cover_data_length = 0, no tmc2130 must be selected. r polling_status (default:0x00000000) ( tmc26x / tmc2130 only) - drv_status response of tmc26x / tmc2130 w 0x6d 31:0 cover_high (default:0x00000000) - upper configuration bits of spi orders that can be sent from tmc4331 a to the motor drivers via spi output. automatic cover data transfer ( automatic_cover = 1): value in cover_low are sent if | vactual | crosses spi_switch_vel upwards. set cover_data_length 32. in case cover_data_length = 0, no tmc2130 must be selected. r polling_reg (default:0x00000000) ( tmc2130 only) 19:0 - lost_steps response of tmc2130 27:20 - pwm_scale response of tmc2130 31:28 - gstat response of tmc2130 r 0x6e 31:0 cover_drv_low (default:0x00000000) - lower configuration bits of spi response received from the motor driver connected to the spi output. r 0x6f 31:0 cover_drv_high (default:0x00000000) - upper configuration bits of spi response received from the motor driver connected to the spi output. table 74 : transfer registers miscellaneous registers micellaneous registers r/ w addr bit val description w 0x67 23 : 0 vstall_limit ( default: 0x000 000 00) u stop on stall velocity limit [pps] : only above this limit an active stall leads to a stop on stall , if enabled. w 0x7c 31:0 circular_dec ( default: 0x000) u decimal places for circular motion if one revolution is not exactly mapped to an even number of steps per revolution. value representation: 1 digit and 31 decimal places. table 75 : miscellaneous registers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 162 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? sinlut registers sinlut registers r/ w addr bit val description w 0x70 31:0 mslut[0] ( default: 0xaaaab554) 0x71 mslut[1] ( default: 0x4a9554aa) 0x72 mslut[2] ( default: 0x24492929) 0x73 mslut[3] ( default: 0x10104222) 0x74 mslut[4] ( default: 0xfbffffff) 0x75 mslut[5] ( default: 0xb5bb777d) 0x76 mslut[6] ( default: 0x49295556) 0x 77 mslut[7] ( default: 0x00404222) - each bit defines the difference between consecutive values in the microstep look - up table mslut (in combination with mslutsel ). w 0x78 31:0 mslutsel ( default: 0x ffff8056) - definition of the four segments within each quarter mslut wave. r 0x79 9:0 mscnt ( default: 0x000) u actual step position of the sine value. w msoffset ( default: 0x000) (tmc23x/24x only) u microstep offset for pwm mode. r 0x7a 8:0 currenta ( default: 0x000) s actual current value of coila (sine values). 24:16 currentb ( default: 0x0 f7 ) s actual current value of coilb (sine90_120 values). r 0x7b 8:0 currenta_spi ( default: 0x000) s actual scaled curre nt value of coila (sine values) that are sent to the driver. 24:16 currentb_spi ( default: 0x0 f7 ) s actual scaled current value of coilb (sine90_1 20 values); sent to motor driver. w 31:0 tzerowait ( default: 0x 00000 000) u standstill phase after reaching vactual = 0. r 0x7c 8:0 scale_param ( default: 0x000) u actual used scale parameter. w 0x7e 7:0 start_sin ( default: 0x00) u start value for sine waveform . 31:16 start_sin90_120 ( default: 0xf7) u start value for cosine waveform . 31:24 dac_offset ( default: 0x00) u offset ( absolute sine and cosine dac values ). s offset (mapped dac values ). table 76 : sinlut registers
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 163 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? tmc version register vers ion register r/ w addr bit val description r 0x7f 15:0 version no ( default: 0x0002 ) u tmc4331 version number. table 77 : ver sion register
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 164 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 16. absolute maximum ratings the maximum ratings may not be exceeded under any circumstances. operating the circuit at or near more than one maximum rating at a time for extended periods shall be avoided by application design. maximum ratings: 3.3v supply parameter (vcc = 3.3v nominal ? test_mode = 0v) symbol min max unit supply voltage v cc 3.0 3.6 v input voltage io v in ? table 78 : maximum ratings: 3.3v supply maximum ratings: 5.0v supply parameter (vcc = 5v nominal ? test_mode = 0 v) symbol min max unit supply voltage v cc 4.8 5.2 v input voltage io v in ? table 79 : maximum ratings: 5 . 0 v supply maximum ratings: temperature parameter symbol min max unit temperature t ? table 80 : maximum ratings: temperature
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 165 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 17. electrical characteristics dc characteristics contain the spread of values guaranteed within the specified supply voltage range unless otherwise specified. typical values represent the average value of all parts measured at +25c. temperature variation also causes stray to some values. a device with typical values will not leave min/max range within the full temperature range. dc characteristics parameter symbol conditions min typ max unit extended temperature range t com ? dd 1.8 v nominal io voltage v dd 3.3 / 5.0 v nominal input voltage v in 0.0 3.3 / 5.0 v input voltage low level v inl v dd = 3.3v / 5v ? inh v dd = 3.3v / 5v 2.3 / 3.5 3.6 / 5.2 v input with pull - down v in = v dd 5 30 110 a input with pull - up v in = 0v ? ? ? in = 0v ? in = v dd ? outl v dd = 3.3v / 5v 0.4 v output voltage high level v outh v dd = 3.3v / 5v 2.64 / 4.0 v output driver strength i out_drv v dd = 3.3v / 5v 4.0 ma table 8 1 : dc characteristics power dissipation power dissipation parameter symbol conditions min typ max unit static power dissipation pd stat all inputs at vdd or gnd v dd = 3.3v / 5v 1. 1 / 1. 7 mw dynamic power dissipation pd dyn all inputs at vdd or gnd f clk variable v dd = 3.3v / 5v 2. 7 / 4 . 0 mw / mhz total power dissipation pd f clk = 16 mhz v dd = 3.3v / 5v 44.3 / 6 5.7 mw table 82 : power dissipation
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 166 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? general io timing parameters general io timing parameters parameter symbol conditions min typ max unit operation frequency f clk f clk = 1 / t clk 4.2 1 ) 16 30 mhz clock period t clk rising edge to rising edge 33.5 62.5 ns clock time low 16.5 ns clock time high 16.5 ns clk input signal rise time t rise_in 20 % to 80 % 20 ns clk input signal fall time t fall_in 80 % to 20 % 20 ns output signal rise time t rise_out 20 % to 80 % load 32 pf 3.5 ns output signal fall time t fall_out 80 % to 20 % l oad 32 pf 3.5 ns setup time for spi input signals in synchronous design t su relative to rising clk edge 5 ns hold time t hd relative to rising clk edge 5 ns table 83 : general io timing parameters 1) the lower limit for f clk refers to the limits of the internal unit conversion to physical units. the chip will also operate at lower frequencies.
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 167 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? layout examples internal cirucit diagram for layout example figure 62 : internal circuit diagram for layo ut example
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 168 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? figure 63 : top layer: assembly side figure 64 : inner layer (gnd) top layer: assembly side inner layer (gnd)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 169 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? figure 65 : inner layer (supply vs) inner layer (supply vs)
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 170 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? p ackage dimensions package dimensions parameter ref min nom max t otal thickness a 0.8 0.85 0.9 s tand off a1 0 0.035 0.05 m old thickness a2 - 0.65 0.67 l ead frame thickness a3 0.203 ref l ead width b 0.15 0.2 0.25 b ody size x d 4 bsc b ody size y e 4 bsc l ead pitch e 0.4 bsc e xposed die pad size x j 2.5 2.6 2.7 e xposed die pad size y k 2 .5 2.6 2.7 l ead length l 0.35 0.4 0.45 l1 0.332 0.382 0.432 p ackage edge tolerance aaa 0.1 m old flatness bbb 0.1 c oplanarity ccc 0.08 l ead offset ddd 0.1 e xposed pad offset eee 0.1 table 84 : package dimensions figure 66 : package dimensional drawings
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 171 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? package material information please refer to the associated document tmc43xx package material information , v1.00 for information about available package dimensions and the various tray and reel package options. this document informs you about outside dimensions per tray and/reel and the number of ics per tray/reel. it also provid es information about available packaging units and their weight, as well as box dimension and weight details for outer packaging. the document is available for download on the tmc4331 a product page at www.trinamic.com . i should you require a custom - made component packaging solution or a different outer packaging solution, or have questions pertaining to the component packaging choice, please contact our customer service. note: ? our trays and reels are jedec - compliant. marking details provided on single chip the marking on each single chip shows: ? trinamic emblem. ? product code. ? date code. ? l ocation of the copyright holder, which is trinamic in hamburg, germany. ? lot number. figure 67 : marking details on chip 1 1 the image provided is not an accurate rendition of the original product but only serves as illustration. ? ? ? ? ?
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 172 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? a p p e n d i c e s 18. supplemental directives esd - device instructions this product is an esd - sensitive cmos device. it is sensitive to electrostatic discharge. ? provide effective grounding to protect personnel and machines. ? en sure work is performed in a non static environment. ? use personal esd control footwear and esd wrist strap s , if necessary. failure to do so can result in defects, damages and decreased reliability. the producer of the product tmc4331 a is trinamic gmbh & co. kg in hamburg, g ermany; hereafter referred to as trinamic. trinamic is the supplier; and in this function provides the product and the production documentation to its customers . trinamic owns the content of this user manual in its entirety, including but not li mited to pictures, logos, trademarks, and resources. ? copyright 2015 trinamic?. all rights reserved. electronically published by trinamic?, germany. all trademarks used are property of their respective owners. redistributions of source or derived forma t (for example, portable document format or hypertext markup language) must retain the above copyright notice, and the complete datasheet user manual documentation of this product including associated application notes; and a reference to other available p roduct - related documentation. trademark designations and symbols used in this documentation indicate that a product or feature is owned and registered as trademark and,'or patent either by trinamic or by ather manufacturers, whose produ cts are used or referred to in combination with trinamlc's products and tri namlc's product documentation. this documentation is a n oncommercial publication that seeks to provide concise scientific and technical user information t o the target user. thus, we only enter trademark designations and symbols in the short spec of the documentation that introduces the product at a quick glance. we also enter the trademark designation 'symbol when the prod uct or feature name occurs for the first time in the document. all tradema rks used are property of their respective owners. the documentation provided here, is for programmers and engineers only, who are equipped with the necessary skills and have been trained to work with this type of product. the target user knows how to responsibly make use of this product without causing harm to himself or others, and without causing damage to systems or devices, in which the user incorporates the product. 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 suppor t 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. information given in this document is believed to be accurate and reliable. how ever, no responsibility is assumed for the consequences of its use nor for any infringement producer information copyright trademark designations and symbols target user disclaimer: life support systems
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 173 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? of patents or other rights of third parties which may result from its use. specifications are subject to change without notice. the data s pecified in this user manual is intended solely for the purpose of product description. no representations or warranties, either express or implied, of merchantability, fitness for a particular purpose or of any other nature are made hereunder with respect to information/specification or the products to which information refers and no guarantee with respect to compliance to the intended use is given. in particular, this also applies to the stated possible applications or areas of applications of the produ ct. trinamic products are not designed for and must not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death (safety - critical applications) without tri namics specific written consent. trinamic products are not designed nor intended for use in military or aerospace applications or environments or in automotive applications unless specifically designated for such use by trinamic. trinamic conveys no pate nt, copyright, mask work right or other trade mark right to this product. trinamic assumes no liability for any patent and/or other trade mark rights of a third party resulting from processing or handling of the product and/or any other use of the product. this document datasheet user manual contains the user information for the target user . the short spec forms the preface of the document and is aimed at providing a general product overview. the main manual contains detailed product information pertaining to functions, and configuration settings. it contains all other pages of this document. this product documentation is related and/or associ ated with additional tool kits, firmware and other items, as provided on the product p age at: www.trinamic.com . disclaimer: intend ed u se product d ocumen tation d etails collateral d ocuments & tools
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 174 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 19. t ables index table 1: TMC4331A order codes ................................ ................................ ................................ ............. 2 table 2: pin names and descriptions ................................ ................................ ................................ ...... 10 table 3: spi input control interface pins ................................ ................................ ................................ 13 table 4: read and write access examples ................................ ................................ .............................. 14 table 5: spi interface timing ................................ ................................ ................................ ................ 16 table 6: input filtering groups (assigned pins) ................................ ................................ ....................... 17 table 7: input filtering (assigned register) ................................ ................................ ............................ 17 table 8: sample rate configuration ................................ ................................ ................................ ....... 18 table 9: configuration of digital filter length ................................ ................................ ......................... 18 table 10: pins names: status events ................................ ................................ ................................ ...... 20 table 11:register names: status flags and events ................................ ................................ ................. 20 table 12: pin names: ramp generator ................................ ................................ ................................ ... 24 table 13: register names: ramp generator ................................ ................................ ........................... 24 table 14: overview of general and basic ramp configura tion options ................................ ..................... 27 table 15: description of TMC4331A motion profiles ................................ ................................ ................. 29 table 16: trapezoidal ramps: aactual assignments during motion ................................ ........................ 32 table 17: parameter assignments for s - shaped ramps ................................ ................................ ........... 35 table 18: minimum and maximum values if real world units are selected ................................ ................ 46 table 19: minimum and maximum values for steep slopes for f clk =16mhz ................................ .............. 46 table 20: pins used for external step control ................................ ................................ ......................... 47 table 21: registers used for external step control ................................ ................................ .................. 47 table 22: pins used for reference switches ................................ ................................ ............................ 50 table 23: dedicated registers for reference switches ................................ ................................ ............. 50 table 24: reference configuration and corresponding transition of particular reference switch ................ 52 table 25: overview of different home_event settings ................................ ................................ .............. 55 table 26: target_reached output pin configuration ................................ ................................ ........... 58 table 27: comparison selection grid to generate pos_comp_reached_flag ................................ .......... 58 table 28: circular motion (x_range = 300) ................................ ................................ ........................... 62 table 29: dedicated ramp timing pins ................................ ................................ ................................ ... 63 table 30: dedicated ramp timing registers ................................ ................................ ........................... 63 table 31: start trigger configuration ................................ ................................ ................................ ..... 64 table 32: start enable switch configuration ................................ ................................ ........................... 64 table 33: parameter settings timing example 1 ................................ ................................ ..................... 66 table 34: parameter settings timing example 2 ................................ ................................ ..................... 67 table 35: parameter settings timing example 3 ................................ ................................ ..................... 68 table 36: pipeline activation options ................................ ................................ ................................ ...... 76 table 37: pipeline mapping for different pipeline configurations ................................ ............................... 77 table 38: pin names for spi motor drive ................................ ................................ ................................ 81 table 39: dedicated spi output registers ................................ ................................ .............................. 82 table 40: wave inclination characteristics of internal mslut ................................ ................................ .. 84 table 41: overview of the microstep behavior example ................................ ................................ ........... 88 table 42: spi output communication pins ................................ ................................ .............................. 89 table 43: tmc stepper motor driver options ................................ ................................ .......................... 93 table 44: mapping of tmc23x/24x status flags ................................ ................................ ...................... 97 table 45: mapping of tmc26x status flags ................................ ................................ ........................... 103 table 46: mapping of tmc2130 status flags ................................ ................................ ......................... 108 table 47: non - tmc data transfer options ................................ ................................ ............................ 109 table 48: available spi - dac options ................................ ................................ ................................ .... 112 table 49: dedicated pwm output pins ................................ ................................ ................................ . 121 table 50: dedicated pwm output registers ................................ ................................ .......................... 121 table 51: dedicated dcstep pins ................................ ................................ ................................ .......... 126 table 52: dedicated dcstep registers ................................ ................................ ................................ ... 126 table 53: dedicated reset and clock pins ................................ ................................ ............................. 132 table 54: dedicated reset and clock gating registers ................................ ................................ .......... 132 table 55: general configuration 0x00 ................................ ................................ ................................ .. 137 table 56: reference switch configuration 0x01 ................................ ................................ .................... 140 table 57: start switch configuration start_conf 0x02 ................................ ................................ ....... 142
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 175 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? table 58: input filter configuration register input_filt_conf 0x03 ................................ ................... 143 table 59: sp i output configuration register spi_out_conf 0x04 ................................ ........................ 146 table 60: current scale configuration (0x05) ................................ ................................ ........................ 147 table 61: current scale values (0x06) ................................ ................................ ................................ .. 148 table 62: motor driver settings (0x0a) ................................ ................................ ................................ . 148 table 63: event selection regsiters 0x0b0x0d ................................ ................................ ................... 149 table 64: status event register events (0x0e) ................................ ................................ .................... 150 table 65: status flag register status (0x0f) ................................ ................................ ...................... 151 table 66: various configuration registers ................................ ................................ ............................. 153 table 67: ramp generator registers ................................ ................................ ................................ .... 157 table 68: external clock frequency register ................................ ................................ ......................... 158 table 69: target and compare registers ................................ ................................ .............................. 158 table 70: pipeline registers ................................ ................................ ................................ ................. 159 table 71: shadow registers ................................ ................................ ................................ ................. 159 table 72: reset and clock gating register ................................ ................................ ............................ 160 table 73: dcstep registers ................................ ................................ ................................ .................. 160 table 74: transfer registers ................................ ................................ ................................ ................ 161 table 75: miscellaneous registers ................................ ................................ ................................ ........ 161 table 76: sinlut registers ................................ ................................ ................................ .................. 162 table 77: version register ................................ ................................ ................................ ................... 163 table 78: maximum ratings: 3.3v supply ................................ ................................ ............................. 164 table 79: maximum ratings: 5.0v supply ................................ ................................ ............................. 164 table 80: maximum ratings: temperature ................................ ................................ ........................... 164 table 81: dc characteristics ................................ ................................ ................................ ................ 165 table 82: power dissipation ................................ ................................ ................................ ................. 165 table 83: general io timing parameters ................................ ................................ .............................. 166 table 84: package dimensions ................................ ................................ ................................ ............. 170 table 85: document revision history ................................ ................................ ................................ ... 178
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 1 76 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 20. figures index figure 1: sample image TMC4331A ................................ ................................ ................................ ......... 1 figure 2: block diagram ................................ ................................ ................................ .......................... 1 figure 3: s - shaped velocity profile ................................ ................................ ................................ ........... 2 figure 4: open - loop hardware set - up with tmc26x supporting external stop switches .............................. 2 figure 5: hardware set - up for open - loop operation with tmc2130 ................................ ............................ 2 figure 6: package outline: pin assignments top view ................................ ................................ ............... 8 figure 7: system overview ................................ ................................ ................................ .................... 10 fi gure 8: TMC4331A connection: vcc=3.3v ................................ ................................ ........................... 1 1 figure 9: TMC4331A with tmc26x stepper driver in spi mode or s/d mode ................................ ............. 11 figure 10: TMC4331A with tmc248 stepper driver in spi mode ................................ ............................... 12 figure 11: TMC4331A with tmc2130 stepper driver in spi mode or s/d mode ................................ ......... 12 figure 12: TMC4331A spi datagram structure ................................ ................................ ........................ 13 figure 13: difference between read and write access ................................ ................................ ............ 14 figure 14: spi timing datagram ................................ ................................ ................................ ............ 15 figure 15: reference input pins: sr_ref = 1, filt_l_ref = 1 ................................ ............................... 19 figure 16: start input pin: sr_s = 2, filt_l_s = 0 ................................ ................................ ............. 19 figure 17: s/d input pins: sr_sd_in = 0, f ilt_l_sd_in = 7 ................................ ................................ . 19 figure 18: no ramp motion profile ................................ ................................ ................................ ......... 30 figure 19: trapezoidal ramp without break point ................................ ................................ ................... 31 figure 20: trapezoidal r amp with break point ................................ ................................ ........................ 31 figure 21: s - shaped ramp without initial and final acceleration/deceleration values ................................ . 33 figure 22: s - shaped ramp with initial and final acceleration/deceleration values ................................ ...... 34 figure 23: trapezoidal ramp with initial velocity ................................ ................................ ..................... 36 figure 24: s - shaped ramp with initial start velocity ................................ ................................ ................ 37 figure 25: s - shaped ramp with stop velocity ................................ ................................ ......................... 39 figure 26: s - shaped ramp with start and stop velocity ................................ ................................ ........... 40 figure 27: s - shaped ramps with combined vstart and astart parameters ................................ ........... 41 figure 28: sixpoint ramp: trapez oidal ramp with start and stop velocity ................................ ................ 42 figure 29: example for u - turn behavior of sixpoint ramp ................................ ................................ ....... 43 figure 30: example for u - turn behavior of s - shaped ramp ................................ ................................ ..... 44 figure 31: direct transition via vactual=0 for s - shaped ramps ................................ ............................. 44 figure 32: home_ref monitoring and home_error_flag ................................ ................................ .... 56 figure 33: ramp timing example 1 ................................ ................................ ................................ ........ 66 figure 34: ramp timing example 2 ................................ ................................ ................................ ........ 67 figure 35: ramp timing example 3 ................................ ................................ ................................ ........ 68 figure 36: single - level shadow register option to replace comp lete ramp motion profile. ......................... 70 figure 37: double - stage shadow register option 1, suitable for s - shaped ramps. ................................ ... 71 figure 38: double - stage shadow register option 2, suitable for trapezoidal ramps. ................................ 72 figure 39: double - stage shadow register option 3, suitable for trapezoidal ramps ................................ . 73 figure 40: shadow_miss_cnt parameter for several internal start signals ................................ ............ 74 figure 41: target pipeline with configuration options ................................ ................................ ............. 75 figure 42: pipeline example a ................................ ................................ ................................ ................ 78 figure 43: pipeline example b ................................ ................................ ................................ ................ 78 figure 44: pipeline example c ................................ ................................ ................................ ................ 78 figure 45: pipeline example d ................................ ................................ ................................ ............... 78 figure 46: pipeline example e ................................ ................................ ................................ ................ 79 figure 47: pipeline example f ................................ ................................ ................................ ................ 79 figure 48: pipeline example g ................................ ................................ ................................ ............... 79 figure 49: pipeline example h ................................ ................................ ................................ ............... 79 figure 50: lut programming example ................................ ................................ ................................ .... 83 figure 51: mslut curve with all possible base wave inclinations (highest inclination first) ....................... 87 figure 52: spi output datagram timing ................................ ................................ ................................ . 89 figure 53: cover data register composition (cdl C cover_data_length) ................................ ........... 91 figure 54: scaling example 1 ................................ ................................ ................................ ............... 119 figure 55: scaling example 2 ................................ ................................ ................................ ............... 120 figure 56: calculation of pwm duty cycles (pwm_ampl) ................................ ................................ ...... 123 figure 57: TMC4331A connected with tmc23x/24x operating in spi mode or pwm mode ........................ 124
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 177 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? figure 58: dcstep extended application operation area ................................ ................................ ......... 127 figure 59: velocity profile with impact through overload situation ................................ ......................... 129 figure 60: manual clock gating activation and wake - up ................................ ................................ ....... 133 figure 61: automatic clock gatin g activation and wake - up ................................ ................................ ... 134 figure 62: internal circuit diagram for layout example ................................ ................................ ......... 167 figure 63: top layer: assembly side ................................ ................................ ................................ .... 168 figure 64: inner layer (gnd) ................................ ................................ ................................ .............. 168 figure 65: inner layer (supply vs) ................................ ................................ ................................ ...... 169 figure 66: package dimensional drawings ................................ ................................ ............................ 170 figure 67: marking details on chip 1 ................................ ................................ ................................ ...... 171
tmc 4331a datasheet | document revision 1.00 ? 2016 - nov - 1 0 178 / 178 ? 2015 trinamic motion control gmbh & co. kg, hamburg, germany terms of delivery and rights to technical change reserved. download newest version at: www.trinamic.com . read entir e documentation; especially the supplemental directives on page 172 . ? main manual ? 21. revision history document revision history version date author description 1 .00 201 6 - nov - 09 hs first complete version. table 85 : document revision history


▲Up To Search▲   

 
Price & Availability of TMC4331A

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X