Trinamic TMCM-6110 Скачать руководство пользователя страница 52

TMCM-6110 TMCL Firmware V1.31 Manual (Rev. 1.09 / 2015-FEB-24) 

52 

 

 
www.trinamic.com 

4.6.24

 

SCO (set coordinate) 

Up to 20 position values (coordinates) can be stored for every axis for use with the MVP COORD command. 
This  command  sets  a  coordinate  to  a  specified  value.  Depending  on  the  global  parameter  84,  the 
coordinates  are  only  stored  in  RAM  or  also  stored  in  the  EEPROM  and  copied  back  on  startup  (with  the 
default setting the coordinates are stored in RAM only). 
 
Please note that the coordinate number 0 is always stored in RAM only.  
 

Internal function:

 the passed value is stored in the internal position array. 

 
Related commands:

 GCO, CCO, MVP 

 

Mnemonic:

 SCO <coordinate number>, <motor>, <position> 

 

Binary representation: 

INSTRUCTION NO. 

TYPE 

MOT/BANK 

VALUE 

30 

<coordinate number> 

0… 20 

<motor> 

0… 5 

<position> 

-2

31

… 2

31

-1 

 
Reply in direct mode: 

STATUS 

VALUE 

100 – OK 

don’t care 

 

Example:  

Set coordinate #1 of motor to 1000 

Mnemonic:

 SCO 1, 0, 1000 

 

Binary: 

Byte Index 

Function 

Target- 

address 

Instruction 

Number 

Type 

Motor/ 

Bank 

Operand 

Byte3 

Operand 

Byte2 

Operand 

Byte1 

Operand 

Byte0 

Value (hex) 

$01 

$1e 

$01 

$00 

$00 

$00 

$03 

$e8 

 
 
Two special functions of this command have been introduced that make it possible to copy all coordinates 
or one selected coordinate to the EEPROM.  
 
These functions can be accessed using the following special forms of the SCO command: 
 
SCO 0, 255, 0  

copies all coordinates (except coordinate number 0) from RAM to 
the EEPROM. 

SCO <coordinate number>, 255, 0  

copies the coordinate selected by <coordinate number> to the 
EEPROM. The coordinate number must be a value between 1 and 
20. 

 

 

Содержание TMCM-6110

Страница 1: ...EPPER MOTORS MODULE TRINAMIC Motion Control GmbH Co KG Hamburg Germany www trinamic com Firmware Version V1 31 TMCL FIRMWARE MANUAL TMCM 6110 6 Axes Stepper Controller Driver 1 1A RMS 24V DC USB CAN R...

Страница 2: ...4 MVP move to position 27 4 6 5 SAP set axis parameter 29 4 6 6 GAP get axis parameter 30 4 6 7 STAP store axis parameter 31 4 6 8 RSAP restore axis parameter 32 4 6 9 SGP set global parameter 33 4 6...

Страница 3: ...3 1 Reference Search Modes Axis Parameter 193 83 5 4 Grouping Motors 86 5 5 Calculation Velocity and Acceleration vs Microstep and Fullstep Frequency 87 5 5 1 Microstep Frequency 87 5 5 2 Fullstep Fr...

Страница 4: ...stall detection coolStep feature for reduced power consumption and heat dissipation Interfaces Up to 8 multi purpose inputs 24V compatible incl 2 dedicated analog inputs Up to 8 multi purpose outputs...

Страница 5: ...ns can be downloaded free of charge from the TRINAMIC website http www trinamic com The firmware of this module is related to the standard TMCL firmware shipped with regard to protocol and commands Co...

Страница 6: ...h will guide you through the steps of connecting the unit and making first movements with the motor 3 1 1 Connecting the Module For first steps you will need a power supply and a communication between...

Страница 7: ...tive supply voltage in case substantial amount of current is withdrawn from these pins for external circuits It is expected that VDIGITAL and VDRIVER are connected to the same power supply output when...

Страница 8: ...as USB is connected VBUS voltage available On board digital core logic mainly processor and EEPROM will be powered via USB in case no other supply is connected This can be used to set parameters down...

Страница 9: ...il B 4 B2 Output Pin 2 of motor coil B A1 A2 B1 B2 Motor 0 5 M Figure 3 2 Motor connection 3 1 1 4 Reference Home Switches Connect the switches with the appropriate connectors see Figure 3 1 if you ne...

Страница 10: ...0 Output Open drain output max 100mA Integrated freewheeling diode 8 OUT_1 Output Open drain output max 100mA Integrated freewheeling diode 9 OUT_2 Output Open drain output max 100mA Integrated freewh...

Страница 11: ...you intend to use is not blocked by another program Open TMCL IDE by clicking TMCL exe Choose Setup and Options and thereafter the Connection tab For RS485 choose COM port and type with the parameter...

Страница 12: ...ly COM port and baud rate Issue a command by choosing Instruction Type if necessary Motor and Value and click Execute to send it to the module Examples ROR rotate right motor 0 value 500 Click Execute...

Страница 13: ...e value Adjust the pulse divisor no 154 if the speed value is very low 50 or above the upper limit See TMC 429 datasheet for calculation of physical units 0 2047 5 Maximum acceleration The limit for a...

Страница 14: ...oad 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...

Страница 15: ...otion control commands but also commands to control the program structure like conditional jumps compare and calculating Every command has a binary representation and a mnemonic The binary format is u...

Страница 16: ...all the other bytes using an 8 bit addition When using CAN bus the first byte reply address and the last byte checksum are left out Do not send the next command before you have received the reply 4 2...

Страница 17: ...parameter 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 se...

Страница 18: ...mode and in standalone mode 4 4 2 3 Control Commands These commands are used to control the program flow loops conditions jumps etc It does not make sense to use them in direct mode They are intended...

Страница 19: ...flow of the TMCL program running on the module 4 4 2 6 Interrupt Commands Interrupt processing has been introduced in the TMCL firmware for ARM based modules Mnemonic Command number Meaning EI 25 Enab...

Страница 20: ...ch axis 3 35 Left stop switch axis 4 36 Right stop switch axis 4 37 Left stop switch axis 5 38 Right stop switch axis 5 39 Input change 0 40 Input change 1 41 Input change 2 42 Input change 3 43 Input...

Страница 21: ...O 0 2 1 switch OUT0 high RETI end of interrupt Out0Off SIO 0 2 0 switch OUT0 low RETI end of interrupt In the example above the interrupt numbers are used directly To make the program better readable...

Страница 22: ...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 retu...

Страница 23: ...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 address...

Страница 24: ...sferred to axis parameter 2 target velocity The module is based on the TMC429 stepper motor controller and the TMC260 power driver This makes possible choosing a velocity between 0 and 2047 Related co...

Страница 25: ...n the TMC429 stepper motor controller and the TMC260 power driver This makes possible choosing a velocity between 0 and 2047 Related commands ROR MST SAP GAP Mnemonic ROL motor velocity Binary represe...

Страница 26: ...ed commands ROL ROR SAP GAP Mnemonic MST motor Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 3 don t care motor 0 5 don t care Reply in direct mode STATUS VALUE 100 OK don t care Example St...

Страница 27: ...ng 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 microsteps...

Страница 28: ...eviously 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 Byte2 Operand Byte1 Operand Byte0...

Страница 29: ...or negative values The parameter is transferred to the correct position in the appropriate device Related commands GAP STAP RSAP AAP Mnemonic SAP parameter number motor value Binary representation INS...

Страница 30: ...ter 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 SAP STAP AAP RSAP Mnemonic GAP par...

Страница 31: ...on 4 2 1 will be returned in this case Internal function an axis parameter value stored in SRAM will be transferred to EEPROM and loaded from EEPORM after next power up Related commands SAP RSAP GAP A...

Страница 32: ...his command please refer to chapter 5 Internal function the specified parameter is copied from the configuration EEPROM memory to its RAM location Relate commands SAP STAP GAP and AAP Mnemonic RSAP pa...

Страница 33: ...les 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 command please refer to...

Страница 34: ...ead 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 Mnemonic GGP parameter n...

Страница 35: ...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...

Страница 36: ...bank 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...

Страница 37: ...reference 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 STATU...

Страница 38: ...output line 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...

Страница 39: ...3 OUT_7 Output Open drain output max 1A Integrated freewheeling diode SETTING THE STATUS OF GENERAL DIGITAL OUTPUTS EITHER TO LOW 0 OR TO HIGH 1 Pin I O Connector I O port Command Range 7 0 OUT_0 SIO...

Страница 40: ...SWITCH CONNECTOR 0 5 Pin Label Description 3 REF_L Input for reference limit switch left 4 REF_R Input for reference limit switch right Using the bitmask of this SIO command the pull up resistors can...

Страница 41: ...e 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 bank number Binary representat...

Страница 42: ...ut 24V compatible 5 IN_2 IN_6 Input Digital input 24V compatible 6 IN_3 IN_7 Input Digital input 24V compatible 7 OUT_0 OUT_4 Output Open drain output max 100mA Integrated freewheeling diode 8 OUT_1 O...

Страница 43: ...2 I O bank 1 Analogue Inputs The ADIN lines can be read back as digital or analogue inputs at the same time The digital states can be accessed in bank 0 4 6 15 3 I O bank 2 States of Digital Outputs T...

Страница 44: ...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...

Страница 45: ...rding 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 compari...

Страница 46: ...Binary representation INSTRUCTION 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...

Страница 47: ...C 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...

Страница 48: ...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...

Страница 49: ...unter is set to the last value of the stack The command will be ignored if the stack is empty Related command CSUB Mnemonic RSUB Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 24 don t care...

Страница 50: ...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...

Страница 51: ...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...

Страница 52: ...inary representation INSTRUCTION NO TYPE MOT BANK VALUE 30 coordinate number 0 20 motor 0 5 position 231 231 1 Reply in direct mode STATUS VALUE 100 OK don t care Example Set coordinate 1 of motor to...

Страница 53: ...ordinate number motor Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 31 coordinate number 0 20 motor 0 5 don t care Reply in direct mode STATUS VALUE 100 OK don t care Example Get motor valu...

Страница 54: ...EEPROM 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...

Страница 55: ...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...

Страница 56: ...UCTION 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 b...

Страница 57: ...n INSTRUCTION NO TYPE MOT BANK VALUE 34 parameter number motor 0 5 don t care Reply in direct mode STATUS VALUE 100 OK don t care For a table with parameters and values which can be used together with...

Страница 58: ...this command please refer to chapter 6 Note that the global parameters in bank 0 are EEPROM only and thus should not be modified automatically by a standalone application Related commands AAP SGP GGP...

Страница 59: ...out flag 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 INSTR...

Страница 60: ...sition reached axis 0 4 Target position reached axis 1 5 Target position reached axis 2 6 Target position reached axis 3 7 Target position reached axis 4 8 Target position reached axis 5 15 stallGuard...

Страница 61: ...ic com Example Define interrupt vector at target position 500 VECT 3 500 Binary format of VECT Byte Index 0 1 2 3 4 5 6 7 Function Target address Instruction Number Type Motor Bank Operand Byte3 Opera...

Страница 62: ...reached axis 1 5 Target position reached axis 2 6 Target position reached axis 3 7 Target position reached axis 4 8 Target position reached axis 5 15 stallGuard axis 0 16 stallGuard axis 1 17 stallGua...

Страница 63: ...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...

Страница 64: ...reached axis 1 5 Target position reached axis 2 6 Target position reached axis 3 7 Target position reached axis 4 8 Target position reached axis 5 15 stallGuard axis 0 16 stallGuard axis 1 17 stallGu...

Страница 65: ...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...

Страница 66: ...aved 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...

Страница 67: ...or 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...

Страница 68: ...get position Mnemonic Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 138 don t care don t care motor bit mask The value field contains a bit mask Every bit stands for one motor bit 0 motor 0...

Страница 69: ...om 4 6 38 BIN return to binary mode This command can only be used in ASCII mode It quits the ASCII mode and returns to binary mode Related Commands none Mnemonic BIN Binary representation This command...

Страница 70: ...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...

Страница 71: ...next position The desired position in position mode see ramp mode no 138 231 231 1 steps RW 1 Actual position The current position of the motor Should only be overwritten for reference point setting 2...

Страница 72: ...of the reference home switch 0 1 R 10 Right limit switch status The logical state of the right limit switch 0 1 R 11 Left limit switch status The logical state of the left limit switch in three switc...

Страница 73: ...auses the execution of 16 times 1 256 microsteps This way a smooth motor movement like in 256 microstep resolution is achieved 0 step interpolation off 1 step interpolation on 0 1 RW 161 Double step e...

Страница 74: ...rtEnergy current down step Sets the number of stallGuard2 readings above the upper threshold necessary for each current decrement of the motor current Number of stallGuard2 measurements per decrement...

Страница 75: ...module or rather use the default value 0 lowest slope 3 fastest slope 0 3 RW 176 slope control low side Determines the slope of the motor driver outputs Set identical to slope control high side 0 3 RW...

Страница 76: ...direction ignore end switches Additional functions Add 128 to a mode value for inverting the home switch polarity can be used with mode 5 8 Add 64 to a mode for exchanging left and right stop switche...

Страница 77: ...1 no chopper event has happened during the last period with constant coil polarity Bit 6 Open load B 1 no chopper event has happened during the last period with constant coil polarity Bit 7 Stand sti...

Страница 78: ...ence point Do not use RFS in this case PARAMETERS NEEDED FOR ADJUSTING THE STALLGUARD2 FEATURE Number Axis Parameter Description 6 Absolute max current CS Current Scale The maximum value is 255 This v...

Страница 79: ...less sensitive and requires more torque to indicate a stall 0 Indifferent value 1 63 less sensitivity 1 64 higher sensitivity 181 Stop on stall Below this speed motor will not be stopped Above this sp...

Страница 80: ...nd SG181 The reduction or increasing of the current in the coolStep area depending on the load has to be configured with parameters I169 and I171 In this chapter only basic axis parameters are mention...

Страница 81: ...mber of stallGuard2 readings above the upper threshold necessary for each current decrement of the motor current Number of stallGuard2 measurements per decrement Scaling 0 3 32 8 2 1 0 slow decrement...

Страница 82: ...ves towards the reference switch at low speed again until it is triggered again It will then move to the middle of the switch between the two positions where the switch has been activated triggered at...

Страница 83: ...the direction when left stop switch reached 6 search home switch in positive direction reverse the direction when right stop switch reached 7 search home switch in negative direction ignore end switch...

Страница 84: ...rch speed axis parameter 194 reference switch speed axis parameter 195 Figure 5 4 Search right stop switch then search left stop switch from both sides left limit end stop switch L R SAP 193 0 4 Searc...

Страница 85: ...tion reverse direction in case right stop switch is hit L R SAP 193 0 7 reference search speed axis parameter 194 reference switch speed axis parameter 195 Search home switch in negative direction ign...

Страница 86: ...nging to any group set the group indices of motor 1 3 and 5 to 1 the group indices of motor 0 and 2 to 2 and the group index of motor 4 to 0 by issuing the following commands SAP 213 1 1 SAP 213 3 1 S...

Страница 87: ...ed Axis parameter 195 referencing switch speed 0 2047 a_max maximum acceleration Axis parameter 5 0 2047 srs microstep resolution microsteps per fullstep 2 srs Axis parameter 140 offers the following...

Страница 88: ...d is given by 29 _ _ 2 max 2 div ramp div pulse a CLK f a This results in acceleration in fullsteps of srs a af 2 af acceleration in fullsteps Example Signal Value fCLK 16 MHz velocity 1000 a_max 1000...

Страница 89: ...tagram high word read only 2 cover datagram position 3 cover datagram length 4 cover datagram contents 5 reference switch states read only 6 TMC429 SMGP register 7 22 driver chain configuration long w...

Страница 90: ...al mode 1 start up in ASCII 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 RS4...

Страница 91: ...ays stored in the EEPROM only 0 or 1 RWE 87 Serial secondary address Second module RS485 target address This is the group or broadcast address of the module Using this address a single command e g ROR...

Страница 92: ...s form the interface between extensions of the firmware written in C and TMCL applications 6 3 Bank 2 Bank 2 contains general purpose 32 bit variables for the use in TMCL applications They are located...

Страница 93: ...igh 2 high low 3 both 0 3 RWE 30 Stop right 1 trigger transition 0 off 1 low high 2 high low 3 both 0 3 RWE 31 Stop left 2 trigger transition 0 off 1 low high 2 high low 3 both 0 3 RWE 32 Stop right 2...

Страница 94: ...g speed SAP 5 0 100 define max acceleration MainLoop do something in this example just running between two positions MVP ABS 0 5000 WAIT POS 0 0 MVP ABS 0 0 WAIT POS 0 0 JA MainLoop end of the main lo...

Страница 95: ...routines The CSUB and RSUB commands provide a mechanism for using subroutines The CSUB command branches to the given label When an RSUB command is executed the control goes back to the command that fo...

Страница 96: ...AIT TICKS 0 700 MST 0 STOP This example provides three very simple TMCL routines They can be called from a host by issuing a run command with address 0 to call the first function or a run command with...

Страница 97: ...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 2011 2014...

Страница 98: ...e inverted 1 20 2012 OKT 04 OK Global parameter 87 secondary address for RS232 RS485 added Reference search the last position before setting the counter to zero can be read out with axis parameter 197...

Страница 99: ...ce Search corrected and updated Several minor additions for clarification 1 09 2015 FEB 24 GE Chapter 5 5 description and default values for axis parameter pulse_div und ramp_div corrected 10 Referenc...

Отзывы: