background image

TMCM-3314 TMCL

Firmware Manual • Firmware Version V1.11 | Document Revision V1.10 • 2019-JAN-25

137 / 144

WAIT POS , Motor0 , 0

17

JA MainLoop

Have a look at the file TMCLParam.tmc provided with the TMCL-IDE. It contains symbolic constants that

define all important parameter numbers.

Using constants for other values makes it easier to change them when they are used more than once in a

program. You can change the definition of the constant and do not have to change all occurrences of it in

your program.

7.4

Using Variables

The user variables can be used if variables are needed in your program. They can store temporary values.

The commands SGP, GGP and AGP as well as STGP and RSGP are used to work with user variables:

• SGP is used to set a variable to a constant value (e.g. during initialization phase).

• GGP is used to read the contents of a user variable and to copy it to the accumulator register for

further usage.

• AGP can be used to copy the contents of the accumulator register to a user variable, e.g. to store the

result of a calculation.

• The STGP command stores the contents of a user varaible in the EEPROM.

• The RSGP command copies the value stored in the EEPROM back to the user variable.

• Global parameter 85 controls if user variables will be restored from the EEPROM automatically on

startup (default setting) or not (user variables will then be initialized with 0 instead).

Please see the following example:

1

MyVariable = 42

// Use a symbolic name for the user variable

3

//( This makes the program better readable and understandable .)

5

SGP MyVariable , 2, 1234

// Initialize the variable with the value 1234

...

7

...

GGP MyVariable , 2

// Copy contents of variable to accumulator register

9

CALC MUL , 2

// Multiply accumulator register with two

AGP MyVariable , 2

// Store contents of accumulator register to variable

11

...

...

Furthermore, these variables can provide a powerful way of communication between a TMCL program

running on a module and a host. The host can change a variable by issuing a direct mode SGP command

(remember that while a TMCL program is running direct mode commands can still be executed, without

interfering with the running program). If the TMCL program polls this variable regularly it can react on

such changes of its contents.

The host can also poll a variable using GGP in direct mode and see if it has been changed by the TMCL

program.

©2019 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany

Terms of delivery and rights to technical change reserved.
Download newest version at

www.trinamic.com

Summary of Contents for TMCM-3314

Page 1: ...tion with a break chopper unit Features 3 Axes Stepper Motor Control TMCL Linear ramps S shaped ramps and SixPoint ramps selectable Closed Loop Encoder Support CoolStep DcStep StallGuard2 StealthChop...

Page 2: ...criptions 22 3 6 1 ROR Rotate Right 22 3 6 2 ROL Rotate Left 23 3 6 3 MST Motor Stop 24 3 6 4 MVP Move to Position 25 3 6 5 SAP Set Axis Parameter 28 3 6 6 GAP Get Axis Parameter 29 3 6 7 SGP Set Glob...

Page 3: ...otate Right using the Accumulator Register 87 3 6 46 MVPXA Move to Position speci ed by Accumulator Register and X Register 88 3 6 47 ROLXA Rotate Left using the Accumulator Register and X Register 90...

Page 4: ...7 4 Using Variables 137 7 5 Using Subroutines 138 7 6 Combining Direct Mode and Standalone Mode 138 7 7 Make the TMCL Program start automatically 139 8 Figures Index 140 9 Tables Index 141 10 Suppleme...

Page 5: ...on Dynamic current control Integrated protection StallGuard2 feature for stall detection CoolStep feature for reduced power consumption and heat dissipation StealthChop feature for quiet operation and...

Page 6: ...d adaptive automatic current scaling based on the load measurement via StallGuard2 adapting the required current to the load Energy consumption can be reduced by as much as 75 CoolStep allows substant...

Page 7: ...B and switch on the power supply for the module while the TMCL IDE is running on your PC The module will be recognized by the TMCL IDE and necessary driver registrations in Windows will automatically...

Page 8: ...low as possible so that the motor can cool down when it is not moving Please see also parameter 214 0 255 RW Table 1 Most important Axis Parameters 2 4 Testing with a simple TMCL Program Now test the...

Page 9: ...hoose Run from the TMCL menu in the TMCL creator to run the program on the module Also try out the debugging functions in the TMCL creator 1 Click on the Bug icon to start the debugger 2 Click the Ani...

Page 10: ...here are more than two nodes connected to a single bus The Trinamic Motion Control Language TMCL provides a set of structured motion control commands Every motion control command can be given by a hos...

Page 11: ...ing up all bytes including the module address byte using 8 bit addition Here are two examples which show how to do this Checksum calculation in C 1 unsigned char i Checksum unsigned char Command 9 3 S...

Page 12: ...received the reply Note When using CAN interface the reply does not contain an address byte and a checksum byte With CAN the CAN ID is used as the reply address and the checksum is not needed because...

Page 13: ...rogram into the EEPROM and afterwards it will run on the module The TMCL IDE contains an editor and the TMCL assembler where the commands can be entered using their mnemonic format They will be assemb...

Page 14: ...l parameter read out mod ule speci c settings e g communica tion settings or TMCL user variables STGP 11 parameter bank number Store global parameter TMCL user variables only RSGP 12 parameter bank nu...

Page 15: ...ble Arithmetical operation between user variable and accumulator CALCAV 42 operation user variable Arithmetical operation between accu mulator and user variable CALCVX 43 operation user variable Arith...

Page 16: ...e motor They are the most important commands and can be used in direct mode or in standalone mode Motion Commands Mnemonic Command number Meaning ROL 2 Rotate left ROR 1 Rotate right MVP 4 Move to pos...

Page 17: ...for standalone mode only Branch Commands Mnemonic Command number Meaning JA 22 Jump always JC 21 Jump conditional COMP 20 Compare accumulator with constant value CSUB 23 Call subroutine RSUB 24 Retur...

Page 18: ...d This means that while a TMCL program is running on the module standalone mode a host can still send commands like GAP and GGP to the module e g to query the actual position of the motor without affe...

Page 19: ...ge 3 255 Global interrupts Table 12 Interrupt Vectors 3 5 6 2 Interrupt Processing When an interrupt occurs and this interrupt is enabled and a valid interrupt vector has been de ned for that interrup...

Page 20: ...T 0 Timer0Irq define the interrupt vector SGP 0 3 1000 configure the interrupt set its period to 1000ms 3 EI 0 enable this interrupt EI 255 globally switch on interrupt processing 5 Main program toggl...

Page 21: ...and the X register CALCXV 44 Calculate using the X register and a user variable CALCV 45 Calculate using a user variable and a direct value MVPA 46 Move to position speci ed by accumulator MVPXA 47 M...

Page 22: ...mode is selected Then the velocity value is transferred to axis parameter 2 target velocity Related commands ROL MST SAP GAP Mnemonic ROR axis velocity Binary Representation Instruction Type Motor Ba...

Page 23: ...elocity Related commands ROR MST SAP GAP Mnemonic ROL axis velocity Binary Representation Instruction Type Motor Bank Value 2 0 0 2 2147483648 2147583647 Reply in Direct Mode Status Value 100 OK don t...

Page 24: ...onic MST axis Binary Representation Instruction Type Motor Bank Value 3 0 0 2 0 Reply in Direct Mode Status Value 100 OK don t care Example Stop motor 0 Mnemonic MST 0 Binary Form of MST 0 Field Value...

Page 25: ...47483648 2147483647 231 231 1 Starting a relative movement by means of an offset to the actual position In this case the new resulting position value must not exceed the above mentioned limits too Mov...

Page 26: ...Move motor 0 from current position 10000 steps backward Mnemonic MVP REL 0 10000 Binary Form of MVP REL 0 10000 Field Value Target address 01h Instruction number 04h Type 01h Motor Bank 00h Value Byte...

Page 27: ...2 Moving multiple motors without interpolation Set bit 7 of the motor parameter Now the bits 0 2 of the motor parameter de ne which motors are to be started Each of these bits stands for one motor Mo...

Page 28: ...arameter speci ed by the parameter number Related commands GAP AAP Mnemonic SAP parameter number axis value Binary representation Binary Representation Instruction Type Motor Bank Value 5 see chapter...

Page 29: ...d values that can be used together with this command please refer to section 4 Internal function The speci ed value gets copied to the accumulator Related commands SAP AAP Mnemonic GAP parameter numbe...

Page 30: ...For a table with parameters and values which can be used together with this command please refer to section 5 Internal function The speci ed value will be copied to the global parameter speci ed by th...

Page 31: ...r with this command please refer to section 5 Internal function The global parameter speci ed by the type and bank number will be copied to the accumulator register Related commands SGP AGP Mnemonic G...

Page 32: ...n be used together with this command please refer to dection 5 3 Internal function The global parameter speci ed by the type and bank number will be stored in the EEPROM Related commands SGP AGP GGP R...

Page 33: ...rnal function The global parameter speci ed by the type and bank number will be restored from the EEPROM Related commands SGP AGP GGP STGP Mnemonic RSGP parameter number bank Binary Representation Ins...

Page 34: ...erence search algorithm to meet your needs please see chapter 4 Internal function The internal reference search state machine is started or stoped or its state is queried Related commands SAP GAP WAIT...

Page 35: ...RT Field Value Target address 01h Instruction number 0Dh Type 00h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 0Eh 2019 TRINAMIC Motion Control GmbH Co K...

Page 36: ...ruction Type Motor Bank Value 14 port number bank number 2 0 1 Reply in Direct Mode Status Value 100 OK 0 don t care Example Set output 0 bank 2 to high Mnemonic SIO 0 2 1 Binary Form of SIO 0 2 1 Fie...

Page 37: ...put lines simulaneously The value x will then be interpreted as a bit vector where each bit represents one of the digital outputs The value x can also be 1 In this case the value will be taken from th...

Page 38: ...the accumulator The actual status of a digital output line can also be read Internal function The state of the i o line speci ed by the type parameter and the bank parameter is read Related commands...

Page 39: ...N0 GIO 0 0 0 1 IN1 GIO 1 0 0 1 IN2 GIO 2 0 0 1 IN3 GIO 3 0 0 1 Special case GIO 255 0 reads all general purpose inputs simulataneously and puts the result into the the accumulator register The result...

Page 40: ...g bank 2 Digital Outputs in Bank 2 Port Command Range OUT0 GIO 0 2 0 1 OUT1 GIO 1 2 0 1 OUT2 GIO 2 2 0 1 OUT3 GIO 3 2 0 1 State of the ENABLE Input To query the state of the ENABLE input use GIO 10 0...

Page 41: ...AP GGP GIO Mnemonic CALC operation operand Binary representation Binary Representation Instruction Type Motor Bank Value 19 0 ADD add to accumulator 0 don t care operand 1 SUB subtract from accumulato...

Page 42: ...FFh Value Byte 2 FFh Value Byte 1 ECh Value Byte 0 78h Checksum 78h Reply Status no error value 5000 Field Value Host address 02h Target address 01h Status 64h Instruction 13h Value Byte 3 FFh Value...

Page 43: ...jump Related commands JC GAP GGP GIO CALC CALCX Mnemonic COMP operand Binary Representation Instruction Type Motor Bank Value 20 0 don t care 0 don t care operand Example Jump to the address given by...

Page 44: ...ands JA COMP WAIT CLE Mnemonic JC condition label Binary Representation Instruction Type Motor Bank Value 21 0 ZE zero 0 don t care jump address 1 NZ not zero 2 EQ equal 3 NE not equal 4 GT greater 5...

Page 45: ...abel at address 10 Field Value Target address 01h Instruction number 15h Type 05h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 0Ah Checksum 25h 2019 TRINAMIC Motion C...

Page 46: ...r Bank Value 22 0 don t care 0 don t care jump address Example An in nite loop in TMCL 1 Loop MVP ABS 0 51200 3 WAIT POS 0 0 MVP ABS 0 0 5 WAIT POS 0 0 JA Loop Binary form of the JA Loop command when...

Page 47: ...ic CSUB label Binary Representation Instruction Type Motor Bank Value 23 0 don t care 0 don t care subroutine address Example Call a subroutine Loop 2 MVP ABS 0 10000 CSUB SubW Save program counter an...

Page 48: ...nored if the stack is empty Related commands CSUB Mnemonic RSUB Binary Representation Instruction Type Motor Bank Value 24 0 don t care 0 don t care 0 don t care Example Please see the CSUB example se...

Page 49: ...ks parameter Special case for the ticks parameter When this parameter is set to 1 the contents of the accumulator register will be taken for this value So for example WAIT TICKS 0 1 will wait as long...

Page 50: ...onic WAIT POS 0 0 Binary Form of WAIT POS 0 0 Field Value Target address 01h Instruction number 1Bh Type 01h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum...

Page 51: ...ne mode will be stopped Related commands none Mnemonic STOP Binary Representation Instruction Type Motor Bank Value 28 0 don t care 0 don t care 0 don t care Example Mnemonic STOP Binary Form of STOP...

Page 52: ...e 30 coordinate number motor number position 0 20 0 2 231 231 1 Example Set coordinate 1 of motor 0 to 1000 Mnemonic SCO 1 0 1000 Binary Form of SCO 1 0 1000 Field Value Target address 01h Instruction...

Page 53: ...stored in RAM only Internal function the desired value is read out of the internal coordinate array copied to the accumulator register and in direct mode returned in the value eld of the reply Relate...

Page 54: ...be accessed using the following special forms of the GCO command GCO 0 255 0 copies all coordinates except coordinate number 0 from the EEPROM to the RAM GCO coordinate number 255 0 copies the coordi...

Page 55: ...ual position of the selected motor is copied to selected coordinate array entry Related commands SCO GCO ACO MVP COORD Mnemonic CCO coordinate number motor number Binary Representation Instruction Typ...

Page 56: ...motor is copied to selected coordinate array entry Related commands SCO GCO CO MVP COORD Mnemonic ACO coordinate number motor number Binary Representation Instruction Type Motor Bank Value 39 coordina...

Page 57: ...on Type Motor Bank Value 33 0 ADD add X register to accumulator 0 don t care 0 don t care 1 SUB subtract X register from accumulator 2 MUL multiply accumulator by X register 3 DIV divide accumulator b...

Page 58: ...UL Field Value Target address 01h Instruction number 21h Type 02h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 24h 2019 TRINAMIC Motion Control GmbH Co K...

Page 59: ...P GAP SGP GGP GIO GCO CALC CALCX Mnemonic AAP parameter number motor number Binary Representation Instruction Type Motor Bank Value 34 see chapter 4 0 2 value Reply in Direct Mode Status Value 100 OK...

Page 60: ...hat can be used with this com mand please see section 5 Related commands AAP SGP GGP SAP GAP GIO Mnemonic AGP parameter number bank number Binary Representation Instruction Type Motor Bank Value 35 pa...

Page 61: ...he external alarm ag EDV clear the deviation ag EPO clear the position error ag Related commands JC WAIT Mnemonic CLE ags Binary Representation Instruction Type Motor Bank Value 36 0 ALL all ags 0 don...

Page 62: ...O Field Value Target address 01h Instruction number 24h Type 01h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 26h 2019 TRINAMIC Motion Control GmbH Co KG...

Page 63: ...Related commands DI VECT RETI Mnemonic EI interrupt number Binary Representation Instruction Type Motor Bank Value 25 interrupt number 0 don t care 0 don t care Reply in Direct Mode Status Value 100 O...

Page 64: ...Related commands EI VECT RETI Mnemonic DI interrupt number Binary Representation Instruction Type Motor Bank Value 26 interrupt number 0 don t care 0 don t care Reply in Direct Mode Status Value 100...

Page 65: ...ended for use in standalone mode only Info Please see table 12 for a list of interrupts that can be used on the TMCM 3314 module Related commands EI DI RETI Mnemonic VECT interrupt number label Binary...

Page 66: ...el is at 50 Field Value Target address 01h Instruction number 25h Type FFh Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 32h Checksum 58h 2019 TRINAMIC Motion Control...

Page 67: ...and program counter are copied back so that normal program ow will continue Related commands EI DI VECT Mnemonic RETI Binary Representation Instruction Type Motor Bank Value 38 interrupt number 0 don...

Page 68: ...ALCXV CALCV Mnemonic CALCVV operation var1 var2 Binary representation Binary Representation Instruction Type Motor Bank Value 40 0 ADD add var2 to var1 0 var1 0 255 var2 0 255 1 SUB subtract var2 from...

Page 69: ...e 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 2Ah Checksum 95h Reply Status no error value 0 Field Value Host address 02h Target address 01h Status 64h Instruction 28h Value Byte 3 00h Value...

Page 70: ...on Type Motor Bank Value 41 0 ADD add accumulator to var 0 var 0 255 0 don t care 1 SUB subtract accumulator from var 2 MUL multiply var with accumulator 3 DIV divide var by accumulator 4 MOD modulo d...

Page 71: ...3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 46h Reply Status no error value 0 Field Value Host address 02h Target address 01h Status 64h Instruction 29h Value Byte 3 00h Value B...

Page 72: ...pe Motor Bank Value 42 0 ADD add var to accumulator 0 var 0 255 0 don t care 1 SUB subtract var from accumulator 2 MUL multiply accumulator with var 3 DIV divide accumulator by var 4 MOD modulo divide...

Page 73: ...3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 47h Reply Status no error value 0 Field Value Host address 02h Target address 01h Status 64h Instruction 2Ah Value Byte 3 00h Value B...

Page 74: ...ype Motor Bank Value 43 0 ADD add X register to var 0 var 0 255 0 don t care 1 SUB subtract X register from var 2 MUL multiply var with X register 3 DIV divide var by X register 4 MOD modulo divide va...

Page 75: ...3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 48h Reply Status no error value 0 Field Value Host address 02h Target address 01h Status 64h Instruction 2Bh Value Byte 3 00h Value B...

Page 76: ...Motor Bank Value 44 0 ADD add var to X register 0 var 0 255 0 don t care 1 SUB subtract var from X register 2 MUL multiply X register with var 3 DIV divide X register by var 4 MOD modulo divide X regi...

Page 77: ...3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 49h Reply Status no error value 0 Field Value Host address 02h Target address 01h Status 64h Instruction 2Ch Value Byte 3 00h Value B...

Page 78: ...CALCVX CALCXV CALCVV Mnemonic CALCV operation var value Binary representation Binary Representation Instruction Type Motor Bank Value 45 0 ADD add value to var 0 var 0 255 value 1 SUB subtract value...

Page 79: ...3 00h Value Byte 2 00h Value Byte 1 13h Value Byte 0 88h Checksum E5h Reply Status no error value 5000 Field Value Host address 02h Target address 01h Status 64h Instruction 2Dh Value Byte 3 00h Valu...

Page 80: ...alue passed to this command Related commands JA CSUB STOP Mnemonic RST label Binary Representation Instruction Type Motor Bank Value 48 0 don t care 0 don t care restart address Example Restart the pr...

Page 81: ...to this command Related commands JC WAIT CSUB Mnemonic DJNZ var label Binary Representation Instruction Type Motor Bank Value 49 user variable 0 255 0 don t care jump address Example A counting loop...

Page 82: ...s also limits nesting of subroutine calls to 8 The command will be ignored if there is no more stack space left Related commands RSUB JC Mnemonic CALL condition label Binary Representation Instruction...

Page 83: ...ed 24 RSUB Binary form of CALL LT RunLeft assuming RunLeft at address 100 Field Value Target address 01h Instruction number 50h Type 06h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 0...

Page 84: ...peci ed by the accumulator register contents Starting a relative movement by means of an offset to the actual position Moving the motor to a previously stored coordinate refer to SCO for details Note...

Page 85: ...0 Field Value Target address 01h Instruction number 2Eh Type 00h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 2Fh 2019 TRINAMIC Motion Control GmbH Co K...

Page 86: ...to axis parameter 2 target velocity Related commands RORA MST SAP GAP Mnemonic ROLA axis Binary Representation Instruction Type Motor Bank Value 50 0 don t care 0 2 0 don t care Reply in Direct Mode S...

Page 87: ...to axis parameter 2 target velocity Related commands ROLA MST SAP GAP Mnemonic ROLA axis Binary Representation Instruction Type Motor Bank Value 51 0 don t care 0 2 0 don t care Reply in Direct Mode S...

Page 88: ...n speci ed by the accumulator register contents Starting a relative movement by means of an offset to the actual position Moving the motor to a previously stored coordinate refer to SCO for details No...

Page 89: ...BS Field Value Target address 01h Instruction number 2Fh Type 00h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 30h 2019 TRINAMIC Motion Control GmbH Co K...

Page 90: ...accumulator is copied to axis parameter 2 target velocity Related commands RORXA MSTX SAP GAP Mnemonic ROLXA Binary Representation Instruction Type Motor Bank Value 52 0 don t care 0 don t care 0 don...

Page 91: ...e accumulator is copied to axis parameter 2 target velocity Related commands ROLXA MSTX SAP GAP Mnemonic RORXA Binary Representation Instruction Type Motor Bank Value 53 0 don t care 0 don t care 0 do...

Page 92: ...RORXA ROLXA Mnemonic MSTX Binary Representation Instruction Type Motor Bank Value 54 0 don t care 0 don t care 0 don t care Reply in Direct Mode Status Value 100 OK don t care Example Stop motor speci...

Page 93: ...eci ed by the parameter number Related commands GAPX AAPX Mnemonic SAPX parameter number value Binary representation Binary Representation Instruction Type Motor Bank Value 16 see chapter 4 don t care...

Page 94: ...value gets copied to the accumulator Related commands SAPX AAPX Mnemonic GAPX parameter number Binary Representation Instruction Type Motor Bank Value 17 see chapter 4 don t care value Reply in Direc...

Page 95: ...hapter 4 don t care don t care Reply in Direct Mode Status Value 100 OK don t care Example Loop over all motors positon them at different speeds SGP 0 2 5 initalize user variable 0 with 5 used as loop...

Page 96: ...Field Value Target address 01h Instruction number 12h Type 00h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 13h 2019 TRINAMIC Motion Control GmbH Co KG...

Page 97: ...pplied to this command will be copied to the user variable speci ed by the X register Related commands AIV GIV Mnemonic SIV Binary Representation Instruction Type Motor Bank Value 55 0 don t care 0 do...

Page 98: ...tion The user variable speci ed by the x register will be copied to the accumulator register Related commands SIV AIV Mnemonic GIV Binary Representation Instruction Type Motor Bank Value 55 0 don t ca...

Page 99: ...nction The accumulator will be copied to the user variable speci ed by the X register Related commands SIV GIV Mnemonic AIV Binary Representation Instruction Type Motor Bank Value 55 0 don t care 0 do...

Page 100: ...mic Please contact the sales department of Trinamic Motion Control GmbH Co KG if you need a customized TMCL rmware Related commands none Mnemonic UF0 UF7 Binary Representation Instruction Type Motor B...

Page 101: ...value eld is a bit vector It shows for which motors one would like to have a position reached message The value eld contains a bit mask where every bit stands for one motor Bit 0 stands for motor 0 bi...

Page 102: ...or bit mask Checksum depends also on motor bit mask Additional Reply after Motor has reached Target Position Field Value Target address 01h Host address 02h Status 80h 128 Command 8Ah 138 Value Byte 3...

Page 103: ...Description Type Value 128 stop application stop a running TMCL application 0 don t care 0 don t care 129 run application start or continue TMCL program execution 0 from current address 0 don t care...

Page 104: ...ary format 0 don t care 137 restore factory settings Reset all settings in the EEPROM to their factory defaults This command does not send a reply 0 don t care set to 1234 255 software reset Restart t...

Page 105: ...ed The maximum speed used for positioning ramps 0 16777215 pps RW 5 Maximum acceleration Maximum acceleration during ramp up 0 2147483647 pps2 RW 6 Maximum current Motor current used when motor is run...

Page 106: ...7 pps2 RW 18 Break velocity For trapezoidal ramps below this velocity the start acceleration axis parameter 16 is used above this velocity the maximum acceleration axis parameter 5 is used 0 16777215...

Page 107: ...his is only needed in rare cases where very steep S shaped ramps are needed In most cases this value can be left at its default setting of 1 The bow values multiplied by this factor must not exceed 46...

Page 108: ...der for D part calculation 0 32767 RW 119 CL correction velocity DV clipping Limit maximum velocity deviation above the maximum velocity 0 2147483647 RW 120 CL upscale delay Delay when increasing moto...

Page 109: ...arget reached ag to be set 0 2147483647 steps RW 136 EncMeanWait Enocder lter related RW 137 EncMeanFilter Encoder lter related RW 138 EncMeanInt Encoder lter related RW 140 Microstep resolution Micro...

Page 110: ...The off time setting controls the minimum chopper frequency An off time within the range of 5 s to 20 s will t Off time setting for constant t Off chopper NCLK 12 32 tOFF Minimum is 64 clocks Setting...

Page 111: ...m mea surement range for readout A lower value gives a higher sensitivity Zero is the starting value A higher value makes StallGuard2 less sensitive and requires more torque to indicate a stall 64 63...

Page 112: ...e Do not set too low Values above 64 recommended 0 255 RW 189 PWM scale Actual PWM amplitude scaler 255 maximum voltage In voltage mode PWM this value allows to detect a motor stall 0 255 R 190 PWM mo...

Page 113: ...8 RW 194 Reference search speed This value speci es the speed for roughly search ing the reference switch 0 16777215 pps RW 195 Reference switch speed This parameter speci es the speed for searching t...

Page 114: ...xt null channel event Bit 8 0 Latch encoder and actual posi tion on N event 1 Also clear encoder counter on N event 0 511 RW 202 Motor full step resolution Full step resolution of the motor Default 20...

Page 115: ...oder counts per round Setting this to a neg ative value reverses the encoder counting direc tion 65535 65535 RW 212 Maximum encoder deviation When the actual position parameter 1 and the encoder posit...

Page 116: ...ion direction of the motor shaft Please note that this will not reverse the encoder counting direction Use axis parameter 210 to reverse the encoder counting direction 0 1 RW Table 15 All Axis Paramet...

Page 117: ...hanging these parameters and use the appropriate func tions of the TMCL IDE to do it in an interactive way Some con gurations of the interface for example baud rates that are not supported by the PC m...

Page 118: ...ommand is received by the mod ule the motor will be stopped Setting this parameter to 0 default turns off the serial heartbeat function 0 65535 RWA 69 CAN bit rate 2 20kBit s 3 50kBit s 4 100kBit s 5...

Page 119: ...be stopped Setting this parameter to 0 default turns off the CAN heartbeat function 0 65535 RWA 83 CAN secondary address Second CAN ID for the module Switched off when set to zero 0 2047 RWA 84 Coordi...

Page 120: ...k 2 contains general purpose 32 bit variables for use in TMCL applications They are located in RAM and the rst 56 variables can also be stored permanently in the EEPROM After booting their values are...

Page 121: ...sition 0 off 1 low high 2 high low 3 both 0 3 RW 30 Stop right 1 trigger transition 0 off 1 low high 2 high low 3 both 0 3 RW 31 Stop left 2 trigger transition 0 off 1 low high 2 high low 3 both 0 3 R...

Page 122: ...irection setting the reference point to the center of the two switching points The speed used for this calibration is de ned by axis parameter 195 Axis parameter 193 de nes the reference search mode t...

Page 123: ...de number i e set axis parameter 193 to 66 to search the left end switch rst and then use the right end switch as the zero point left limit end stop switch L R right limit end stop switch start stop r...

Page 124: ...e number i e set axis parameter 193 to 68 to search the right end switch instead left limit end stop switch L R stop reference search speed axis parameter 194 reference switch speed axis parameter 195...

Page 125: ...rity of the home switch input L R right limit end stop switch reference search speed axis parameter 194 reference switch speed axis parameter 195 start stop home switch Figure 8 Reference Search Mode...

Page 126: ...is recommende mainly for use with a circular axis The exact middle of the switch will be found and used as the zero point Figure 10 illustrates this Add 128 to the mode number i e set axis parameter 1...

Page 127: ...nd executing the reference search in open loop mode and switch to closed loop mode after the reference search has nished successfully The motor can also be stopped automatically when it cannot follow...

Page 128: ...314 is based on Trinamic s closed loop hardware motion controller IC TMC4361 The 2 phase closed loop control of the TMCM 3314 follows a different approach than PID control cascades to consider stepper...

Page 129: ...d the given limit and as a result no step loss will occur Thus the current vector will follow an overpowered load until the load is reduced Figure 12 shows the parameters which limit the load angle Lo...

Page 130: ...e delay which de nes how fast the actual current will be increased or decreased and will follow the red marked graph 6 3 4 Field Weakening With every stepper motor the TMCM 3314 will reach a velocity...

Page 131: ...time If the target trapezoidal ramp cannot be maintained due to high load peaks the TMCM 3314 includes a special position catch up mode to ensure that the position will still be reached in time if po...

Page 132: ...e rotor This also is the most energy e cient point of operation for the motor Stall detection means that the motor will be stopped automatically when the load gets too high This function is con gured...

Page 133: ...urrent in the CoolStep area depending on the load has to be con g ured using parameters I169 and I171 In this chapter only basic axis parameters are mentioned which concern CoolStep and StallGuard2 Th...

Page 134: ...tallGuard2 measure ments per decrement Scaling 0 3 32 8 2 1 0 slow decrement 3 fast decrement I171 smartEnergy current up step Sets the current increment step The current becomes incremented for each...

Page 135: ...er minute rpm one has to know the fullstep resolution of the motor full steps per round and the microstep resolution setting of the module axis parameter 140 default setting is 256 microsteps per full...

Page 136: ...alone TMCL programs look like this 1 Initialization SAP 4 0 50000 define maximum positioning speed 3 SAP 5 0 10000 define maximum acceleration 5 MainLoop do something in this example just running betw...

Page 137: ...red in the EEPROM back to the user variable Global parameter 85 controls if user variables will be restored from the EEPROM automatically on startup default setting or not user variables will then be...

Page 138: ...les The host can then change the value of a user variable using a direct mode SGP command which is regularly polled by the TMCL program e g in its main loop and so the TMCL program can react on such c...

Page 139: ...cally For stand alone operation the module has to start the TMCL program in its memory automatically after power on In order to achieve this switch on the Autostart option of the module This is contro...

Page 140: ...Reference Search Mode 4 124 7 Reference Search Mode 5 125 8 Reference Search Mode 6 125 9 Reference Search Mode 7 126 10 Reference Search Mode 8 126 11 Closed Loop Control Scheme 128 12 Load Angle Con...

Page 141: ...18 12 Interrupt Vectors 19 13 New TMCL Commands 21 14 TMCL Control Commands 104 15 All Axis Parameters of the TMCM 3314 Module 116 16 Meaning of the Letters in the Access Column 117 17 All Global Par...

Page 142: ...for the rst time in the document All trademarks and brand names used are property of their respective owners 10 4 Target User The documentation provided here is for programmers and engineers only who...

Page 143: ...RINAMIC s speci c written consent TRINAMIC products are not designed nor intended for use in military or aerospace applications or environ ments or in automotive applications unless speci cally design...

Page 144: ...itching of stallGuard corrected Axis parameter 3 made read only New axis parameter 35 introduced Spurious changes of home input polarity eliminated Table 22 Firmware Revision 11 2 Document Revision Ve...

Reviews: