MODULE FOR
STEPPER MOTORS
MODULE
Firmware Version V4.45
TMCL™ FIRMWARE MANUAL
+
TMCM-351
3-Axis Stepper Controller / Driver 2.8
A
/ 24
V
SPI, RS232, RS485, CAN, and USB Encoder Interface
Страница 1: ...MODULE FOR STEPPER MOTORS MODULE Firmware Version V4 45 TMCL FIRMWARE MANUAL TMCM 351 3 Axis Stepper Controller Driver 2 8 A 24 V SPI RS232 RS485 CAN and USB Encoder Interface...
Страница 2: ...r stop 24 4 6 4 MVP move to position 25 4 6 5 SAP set axis parameter 27 4 6 6 GAP get axis parameter 28 4 6 7 STAP store axis parameter 29 4 6 8 RSAP restore axis parameter 30 4 6 9 SGP set global par...
Страница 3: ...ed Event 65 4 6 39 BIN return to binary mode 65 4 6 40 TMCL Control Functions 66 5 Axis Parameters 67 6 Global Parameters 71 6 1 Bank 0 71 6 2 Bank 1 74 6 3 Bank 2 74 6 4 Bank 3 75 7 Hints and Tips 76...
Страница 4: ...power outputs all open collector 1 shutdown input enable disable driver stage in hardware 4 dedicated analogue inputs programmable 3 3V 10V input range SPI 1 connector with three chip select signals...
Страница 5: ...Avoid bounding I O wires with motor power wires as this may cause noise picked up from the motor supply Do not exceed the maximum power supply of 28 5V DC Start with power supply OFF 2 1 Starting up 1...
Страница 6: ...B to pin 10 1 2 9 10 Pin Label Pin Label 1 GND 2 GND 3 Encoder_0 1 2_N 4 Encoder_0 1 2_N 5 Encoder_0 1 2_A 6 Encoder_0 1 2_A 7 5V output 8 5V output 9 Encoder_0 1 2_B 10 Encoder_0 1 2_B GND B A N 5V...
Страница 7: ...ED for power should glow now This indicates that the on board 5V supply is available If this does not occur switch power OFF and check your connections as well as the power supply 6 Start the TMCL IDE...
Страница 8: ...3 Press icon Run The desired program will be executed 4 Click Stop button to stop the program A simple example for using TMCL and TMCL IDE ROL 0 500 Rotate motor 0 with speed 500 WAIT TICKS 0 500 MST...
Страница 9: ...ration SAP 212 0 250 use automatic deviation check to stop motor when it is obstructed Loop MVP ABS 0 128000 Rotate 10 revolutions CSUB WaitUntilRunning Wait until the motor is running CSUB WaitUntilS...
Страница 10: ...e is not detected please check all points above cables interface power supply COM port baud rate 3 Issue a command by choosing instruction type if necessary motor and value and click Execute to send i...
Страница 11: ...eply otherwise it will stay in receive mode It will not send any data over the interface without receiving a command first This way any collision on the bus will be avoided when there are more than tw...
Страница 12: ...or i 1 i 8 i Checksum Command i Command 8 Checksum insert checksum as last byte of the command Now send it to the module in Delphi var i Checksum byte Command array 0 8 of byte Set the Command array t...
Страница 13: ...n EEPROM locked 6 Command not available 4 3 Standalone Applications The module is equipped with a TMCL memory for storing TMCL applications You can use TMCL IDE for developing standalone TMCL applicat...
Страница 14: ...ameter bank number Store global parameter TMCL user variables only RSGP 12 parameter bank number Restore global parameter TMCL user variable only RFS 13 START STOP STATUS motor number Reference search...
Страница 15: ...arameters can be set independently for the axis whereas global parameters control the behavior of the module itself These commands can also be used in direct mode and in standalone mode Mnemonic Comma...
Страница 16: ...r and an X register When executed in a TMCL program in stand alone mode all TMCL commands that read a value store the result in the accumulator The X register can be used as an additional memory when...
Страница 17: ...gram will be continued 4 4 2 7 3 Interrupt Vectors The following table shows all interrupt vectors for the three motors that can be used Interrupt number Interrupt type 0 Timer 0 1 Timer 1 2 Timer 2 3...
Страница 18: ...sing a WAIT command for the delay Loop SIO 3 2 1 WAIT TICKS 0 50 SIO 3 2 0 WAIT TICKS 0 50 JA Loop Here is the interrupt handling routine Timer0Irq GIO 0 2 check if OUT0 is high JC NZ Out0Off jump if...
Страница 19: ...download mode target command execution is stopped and all following commands are transferred to the TMCL memory don t care don t care starting address of the application 133 quit download mode target...
Страница 20: ...2 500 A MST 1 ABIN These command lines would address the module with address 1 To address e g module 3 use address character C instead of A The last command line shown above will make the module retur...
Страница 21: ...Bit 4 and Bit 5 determine how the characters that are entered are echoed back Normally both bits are set to zero In this case every character that is entered is echoed back when the module is addresse...
Страница 22: ...ferred to axis parameter 0 target velocity The module is based on the TMC429 stepper motor controller and the TMC249 power driver This makes possible choosing a velocity between 0 and 2047 Related com...
Страница 23: ...the TMC429 stepper motor controller and the TMC249 power driver This makes possible choosing a velocity between 0 and 2047 Related commands ROR MST SAP GAP Mnemonic ROL motor velocity Binary represen...
Страница 24: ...ed commands ROL ROR SAP GAP Mnemonic MST motor Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 3 don t care motor 0 2 don t care Reply in direct mode STATUS VALUE 100 OK don t care Example St...
Страница 25: ...oo Moving the motor to a previously stored coordinate refer to SCO for details Please note that the distance between the actual position and the new one should not be more than 2 147 483 647 231 1 mic...
Страница 26: ...mic com Example Move motor 0 to previously stored coordinate 8 Mnemonic MVP COORD 0 8 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target address Instruction Number Type Motor Bank Operand Byte3 Operand...
Страница 27: ...nds GAP STAP RSAP AAP Mnemonic SAP parameter number motor value Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 5 parameter number motor 0 2 value Reply in direct mode STATUS VALUE 100 OK don...
Страница 28: ...d adding leading zeros or ones for negative values Related commands SAP STAP AAP RSAP Mnemonic GAP parameter number motor Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 6 parameter number mo...
Страница 29: ...ALUE 7 parameter number motor 0 2 don t care the value operand of this function has no effect Instead the currently used value e g selected by SAP is saved Reply in direct mode STATUS VALUE 100 OK don...
Страница 30: ...on EEPROM memory to its RAM location Relate commands SAP STAP GAP and AAP Mnemonic RSAP parameter number motor Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 8 parameter number motor 0 2 don...
Страница 31: ...The TMCL user variables will not be stored in the EEPROM automatically but this can be done by using STGP commands For a table with parameters and bank numbers which can be used together with this co...
Страница 32: ...on the parameter is read out of the correct position in the appropriate device The parameter format is converted adding leading zeros or ones for negative values Related commands SGP STGP RSGP AGP Mne...
Страница 33: ...umbers which can be used together with this command please refer to chapter 6 Internal function the specified parameter is copied from its RAM location to the configuration EEPROM Related commands SGP...
Страница 34: ...ank numbers which can be used together with this command please refer to chapter 6 Internal function The specified parameter is copied from the configuration EEPROM memory to its RAM location Relate c...
Страница 35: ...rence search can be checked Internal function the reference search is implemented as a state machine so interaction is possible during execution Related commands WAIT Mnemonic RFS START STOP STATUS mo...
Страница 36: ...his purpose Related commands GIO WAIT Mnemonic SIO port number bank number value Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 14 port number bank number 2 value 0 1 Reply structure STATUS...
Страница 37: ...E ANALOGUE INPUT It is possible to adjust the analogue input with the following commands SIO 8 0 0 for 3 3V input range SIO 8 0 1 for 10V input range COMMAND FOR SWITCHING THE PULL UP RESISTORS FOR AD...
Страница 38: ...e reply without affecting the accumulator The actual status of a digital output line can also be read Internal function The specified line is read Related commands SIO WAIT Mnemonic GIO port number ba...
Страница 39: ...l values only READING ALL DIGITAL INPUTS WITH ONE GIO COMMAND Set the type parameter to 255 and the bank parameter to 0 In this case the status of all digital input lines will be read to the lower eig...
Страница 40: ...the OUT lines that have been set by SIO commands can be read back using bank 2 1 2 20 19 Connector 3 Pin I O port Command Comment Range 1 AIN_0 GIO 0 1 Connector 1 0 1023 3 AIN_1 GIO 1 1 Connector 1 0...
Страница 41: ...ION NO TYPE operation MOT BANK VALUE 19 0 ADD add to accu 1 SUB subtract from accu 2 MUL multiply accu by 3 DIV divide accu by 4 MOD modulo divide by 5 AND logical and accu with 6 OR logical or accu w...
Страница 42: ...ding to the comparison result Related commands JC jump conditional GAP GGP GIO CALC CALCX Mnemonic COMP value Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 20 don t care don t care comparis...
Страница 43: ...STRUCTION NO TYPE condition MOT BANK VALUE 21 0 ZE zero 1 NZ not zero 2 EQ equal 3 NE not equal 4 GT greater 5 GE greater equal 6 LT lower 7 LE lower equal 8 ETO time out error 9 EAL external alarm 12...
Страница 44: ...WAIT CSUB Mnemonic JA Label Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 22 don t care don t care jump address Example An infinite loop in TMCL Loop MVP ABS 0 10000 WAIT POS 0 0 MVP ABS 0...
Страница 45: ...will be ignored if there is no more stack space left Related commands RSUB JA Mnemonic CSUB Label Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 23 don t care don t care subroutine address E...
Страница 46: ...t care Binary format of RSUB Byte Index 0 1 2 3 4 5 6 7 Function Target address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Value hex 01 18 00 00 00 00 0...
Страница 47: ...earch of the motor specified by the motor field has been reached An optional timeout value 0 for no timeout must be specified by the ticks parameter The timeout flag ETO will be set after a timeout li...
Страница 48: ...uld be placed at the end of every standalone TMCL program It is not to be used in direct mode Internal function TMCL instruction fetching is stopped Related commands none Mnemonic STOP Binary represen...
Страница 49: ...to be sent When bit 7 of the bus number is set this value is ignored and the contents of the accumulator are sent instead Please note that in the TMCL IDE always all three values have to be specified...
Страница 50: ...inary representation INSTRUCTION NO TYPE MOT BANK VALUE 30 coordinate number 0 20 motor 0 2 position 231 231 1 Reply in direct mode STATUS VALUE 100 OK don t care Example Set coordinate 1 of motor to...
Страница 51: ...rdinate number motor Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 31 coordinate number 0 20 motor 0 2 don t care Reply in direct mode STATUS VALUE 100 OK don t care Example Get motor value...
Страница 52: ...EPROM Note that the coordinate number 0 is always stored in RAM only Internal function the selected 24 bit position values are written to the 20 by 3 bytes wide coordinate array Related commands SCO G...
Страница 53: ...M only For Information about storing coordinates refer to the SCO command Internal function the actual value of the accumulator is stored in the internal position array Related commands GCO CCO MVP CO...
Страница 54: ...CTION NO TYPE operation MOT BANK VALUE 33 0 ADD add X register to accu 1 SUB subtract X register from accu 2 MUL multiply accu by X register 3 DIV divide accu by X register 4 MOD modulo divide accu by...
Страница 55: ...lated commands AGP SAP GAP SGP GGP GIO GCO CALC CALCX Mnemonic AAP parameter number motor Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 34 parameter number motor 0 2 don t care Reply in dir...
Страница 56: ...odified automatically by a standalone application For a table with parameters and bank numbers which can be used together with this command please refer to chapter 6 Related commands AAP SGP GGP SAP G...
Страница 57: ...EAL clear the external alarm flag EDV clear the deviation flag EPO clear the position error flag Related commands JC Mnemonic CLE flags where flags ALL ETO EDV EPO Binary representation INSTRUCTION NO...
Страница 58: ...1 Timer 1 2 Timer 2 3 Target position reached 0 4 Target position reached 1 5 Target position reached 2 15 stallGuard axis 0 16 stallGuard axis 1 17 stallGuard axis 2 21 Deviation 0 22 Deviation 1 23...
Страница 59: ...ABLE SHOWS ALL INTERRUPT VECTORS THAT CAN BE USED Interrupt number Interrupt type 0 Timer 0 1 Timer 1 2 Timer 2 3 Target position reached 0 4 Target position reached 1 5 Target position reached 2 15 s...
Страница 60: ...t address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Value hex 01 19 FF 00 00 00 00 00 Enable interrupt when target position reached EI 3 Binary format...
Страница 61: ...TABLE SHOWS ALL INTERRUPT VECTORS THAT CAN BE USED Interrupt number Interrupt type 0 Timer 0 1 Timer 1 2 Timer 2 3 Target position reached 0 4 Target position reached 1 5 Target position reached 2 15...
Страница 62: ...t address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Value hex 01 1A FF 00 00 00 00 00 Disable interrupt when target position reached DI 3 Binary format...
Страница 63: ...ved registers A register X register flags are copied back Normal program execution continues Related commands EI DI VECT Mnemonic RETI Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 38 don t...
Страница 64: ...r a customer specific programming Internal function Call user specific functions implemented in C by TRINAMIC Related commands none Mnemonic UF0 UF7 parameter number Binary representation INSTRUCTION...
Страница 65: ...The value field contains a bit mask where every bit stands for one motor bit 0 motor 0 bit 1 motor 1 bit 2 motor 2 Reply in direct mode right after execution of this command Byte Index 0 1 2 3 4 5 6...
Страница 66: ...Motor Bank and Value are ignored 137 don t care Reset to factory defaults Reset all settings stored in the EEPROM to their factory defaults This command does not send back a reply Value must be 1234...
Страница 67: ...this parameter is set by hardware to the maximum speed during acceleration and to zero during deceleration and rest 2047 RW 3 Actual speed The current rotation speed 2047 RW 4 Maximum positioning spe...
Страница 68: ...witch in three switch mode 0 1 R 12 Right limit switch disable If set deactivates the stop function of the right switch 0 1 RWE 13 Left limit switch disable Deactivates the stop function of the left s...
Страница 69: ...switch is hit 0 1 RWE 153 Ramp divisor The exponent of the scaling factor for the ramp generator should be de incremented carefully in steps of one 0 13 RWE 154 Pulse divisor The exponent of the scali...
Страница 70: ...perature warning Bit 7 Overtemperature 0 255 R 209 Encoder position The value of an encoder register can be read out or written encoder steps RW 210 Encoder prescaler Prescaler for the encoder See cha...
Страница 71: ...high word read only 2 cover datagram position 3 cover datagram length 4 cover datagram contents 5 reference switch states read only 6 TMC428 429 SMGP register 7 22 driver chain configuration long word...
Страница 72: ...CII mode Bits 4 and 5 00 Echo back each character 01 Echo back complete command 10 Do not send echo only send command reply RWE 68 Serial heartbeat Serial heartbeat for the RS232 RS485 interface If th...
Страница 73: ...ays stored in the EEPROM only 0 or 1 RWE 85 Do not store user variables 0 user variables are restored default 1 user variables are not restored 0 1 RWE 87 Serial secondary address Second module target...
Страница 74: ...rpose 32 bit variables for the use in TMCL applications They are located in RAM and can be stored to EEPROM After booting their values are automatically restored to the RAM Up to 56 user variables are...
Страница 75: ...rupts ms 32 bit unsigned ms RWE 27 Stop left 0 trigger transition 0 off 1 low high 2 high low 3 both 0 3 RWE 28 Stop right 0 trigger transition 0 off 1 low high 2 high low 3 both 0 3 RWE 29 Stop left...
Страница 76: ...speed is identical to the maximum positioning speed axis parameter 4 unless reduced by axis parameter 194 After hitting the reference switch the motor slowly moves right until the switch is released...
Страница 77: ...400 3200 6 25 SAP 210 M0 3200 10000 68672 6 4 SAP 210 M0 68672 10240 4096 8 SAP 210 M0 4096 12800 6400 12 5 SAP 210 M0 6400 20000 71808 12 8 SAP 210 M0 71808 20480 8192 16 SAP 210 M0 8192 25600 78432...
Страница 78: ...step errors may occur with some motors as the minimum motor current that can be reached is slightly higher than zero depending on the inductivity resistance and supply voltage of the motor This can be...
Страница 79: ...and whose failure to perform when properly used in accordance with instructions provided can be reasonably expected to result in personal injury or death TRINAMIC Motion Control GmbH Co KG 2009 2014...
Страница 80: ...39 2012 APR 26 OK TMCL firmware updates for other modules 4 40 2012 JUN 15 OK TMCL firmware updates for other modules 4 41 2012 SEP 21 OK Global parameter 87 secondary address for RS232 RS485 added R...