TMCM 1630 TMCL Firmware Manual Rev2.04
TMCM-1630_TMCL_Firmware_Manual_Rev2.04
User Manual: Pdf
Open the PDF directly: View PDF .
Page Count: 56
Download | |
Open PDF In Browser | View PDF |
MODULE FOR BLDC MOTORS MODULE Firmware Version V2.08 TMCL™ FIRMWARE MANUAL + + TMCM-1630 1-Axis BLDC Controller / Driver 10A / 48V RS232 / CAN or RS485 / USB + TRINAMIC Motion Control GmbH & Co. KG Hamburg, Germany www.trinamic.com + TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) Table of Contents 1 2 3 Features ........................................................................................................................................................................... 4 Overview ......................................................................................................................................................................... 5 Putting the TMCM-1630 into Operation .................................................................................................................. 6 3.1 Starting up ............................................................................................................................................................. 6 3.2 Operating the Module in Direct Mode ........................................................................................................... 8 4 TMCL and TMCL-IDE.................................................................................................................................................... 10 4.1 Binary Command Format ................................................................................................................................ 10 4.2 Reply Format ....................................................................................................................................................... 11 4.2.1 Status Codes ................................................................................................................................................. 11 4.3 Standalone Applications .................................................................................................................................. 12 4.4 Testing with a Simple TMCL Program ......................................................................................................... 12 4.5 TMCL Command Overview .............................................................................................................................. 13 4.5.1 Motion Commands ...................................................................................................................................... 13 4.5.2 Parameter Commands ................................................................................................................................ 13 4.5.3 Control Commands ..................................................................................................................................... 13 4.5.4 I/O Port Commands .................................................................................................................................... 13 4.5.5 Calculation Commands .............................................................................................................................. 14 4.6 Commands ........................................................................................................................................................... 15 4.6.1 ROR (rotate right)......................................................................................................................................... 15 4.6.2 ROL (rotate left) ............................................................................................................................................ 16 4.6.3 MST (motor stop) ......................................................................................................................................... 17 4.6.4 MVP (move to position) ............................................................................................................................. 18 4.6.5 SAP (set axis parameter) ........................................................................................................................... 19 4.6.6 GAP (get axis parameter) ........................................................................................................................... 20 4.6.7 STAP (store axis parameter) ..................................................................................................................... 21 4.6.8 RSAP (restore axis parameter) ................................................................................................................. 22 4.6.9 SGP (set global parameter) ....................................................................................................................... 23 4.6.10 GGP (get global parameter) ...................................................................................................................... 24 4.6.11 STGP (store global parameter) ................................................................................................................. 24 4.6.12 RSGP (restore global parameter) ............................................................................................................. 25 4.6.13 SIO (set output) and GIO (get input / output) ................................................................................... 26 4.6.14 CALC (calculate) ............................................................................................................................................ 28 4.6.15 COMP (compare) ........................................................................................................................................... 29 4.6.16 JC (jump conditional).................................................................................................................................. 30 4.6.17 JA (jump always).......................................................................................................................................... 31 4.6.18 CSUB (call subroutine) ................................................................................................................................ 32 4.6.19 WAIT (wait for an event to occur) ......................................................................................................... 33 4.6.20 STOP (stop TMCL program execution) ................................................................................................... 34 4.6.21 CALCX (calculate using the X register) .................................................................................................. 35 4.6.22 AAP (accumulator to axis parameter) .................................................................................................... 36 4.6.23 AGP (accumulator to global parameter) ............................................................................................... 37 4.6.24 Customer Specific TMCL Command Extension (user functions 0… 7) ........................................... 37 4.6.25 Command 136 – Get Firmware Version ................................................................................................ 38 5 Axis Parameter Overview (SAP, GAP, STAP, RSAP, AAP) ................................................................................. 39 5.1 Axis Parameter Sorted by Functionality ...................................................................................................... 43 6 Global Parameter Overview (SGP, GGP, STGP, RSGP) ....................................................................................... 47 6.1 Bank 0 ................................................................................................................................................................... 47 6.2 Bank 2 ................................................................................................................................................................... 48 7 Motor Regulation ........................................................................................................................................................ 49 7.1 Structure of the Cascaded Motor Regulation Modes............................................................................... 49 7.2 Current Regulation ............................................................................................................................................ 50 7.3 Velocity Regulation ........................................................................................................................................... 51 7.4 Velocity Ramp Generator ................................................................................................................................. 52 7.5 Position Regulation ........................................................................................................................................... 52 8 Temperature Calculation........................................................................................................................................... 54 9 I²t Monitoring .............................................................................................................................................................. 54 10 Life Support Policy ..................................................................................................................................................... 55 www.trinamic.com 2 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 11 Revision History .......................................................................................................................................................... 56 11.1 Firmware Revision ............................................................................................................................................. 56 11.2 Document Revision ........................................................................................................................................... 56 12 References..................................................................................................................................................................... 56 www.trinamic.com 3 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4 1 Features The TMCM-1630 is a highly integrated single axis BLDC servo controller module with several interface-options. The highly integrated module (size: 50mm x 92.5 mm) has been designed in order to be plugged onto a baseboard. It integrates velocity and position control and offers hall sensor and incremental encoder (a/b/n) inputs. The module can be used in standalone operation or remote controlled. Applications Demanding single and multi-axis BLDC motor solutions Electrical data Supply voltage: +24V DC or +48V DC nominal (+12… +55V DC max.) Motor current: up to 10A RMS (programmable) peak Integrated motion controller High performance ARM Cortex™-M3 microcontroller for system control and communication protocol handling Integrated motor driver High performance integrated pre-driver (TMC603A) High-efficient operation, low power dissipation (MOSFETs with low RDS(ON)) Dynamic current control Integrated protection On the fly alteration of motion parameters (e.g. position, velocity, acceleration) Interfaces Two standard assembly options: RS232 and CAN (2.0B up to 1Mbit/s) RS485 and USB 2 analogue and 2 digital inputs 3 open drain outputs Motor type Block commutated 3 phase BLDC motors with optional hall sensors / optional encoder Motor power from a few Watts to nearly 500W Motor velocity up to 100,000 RPM (electrical field) Common supply voltages of 12V DC, 24V DC, 36V DC and 48V DC supported Coil current up to 10A peak Software TMCL standalone operation or remote controlled operation TMCL program memory (non volatile) for up to 2048 TMCL commands TMCL PC-based application development software TMCL-IDE and TMCL-BLDC available for free Other Two double-row 2.54mm connectors ROHS compliant Size: 50x92.5mm² Please see separate TMCM-1630 Hardware Manual for additional information www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 5 2 Overview The software running on the microprocessor of the TMCM-1630 consists of two parts, a boot loader and the firmware itself. Whereas the boot loader is installed during production and testing at TRINAMIC and remains untouched throughout the whole lifetime, the firmware can be updated by the user. New versions can be downloaded free of charge from the TRINAMIC website (http://www.trinamic.com). The firmware is related to the standard TMCL firmware [TMCL] with regard to protocol and commands. The module is based on the ARM Cortex-M3 microcontroller and the high performance pre-driver TMC603 and supports the standard TMCL with a special range of values. The new FOC firmware V2.02 is field oriented control software for brushless DC applications. It is developed for high-performance motor applications which can operate smoothly over the full velocity range, can generate full torque at zero speed and is capable of fast acceleration and deceleration. This saves energy and quiets rotating machinery. www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 6 3 Putting the TMCM-1630 into Operation Here you can find basic information for putting your module into operation. The text contains a simple example for a TMCL program and a short description of operating the module in direct mode. THINGS YOU NEED: TMCM-1630 Interface suitable to your TMCM-1630 with cables Nominal supply voltage +24V DC or +48V DC for your module Encoder optional BLDC motor TMCL-IDE program and PC PRECAUTIONS - Do not mix up connections or short-circuit pins. Avoid bounding I/O wires with motor power wires as this may cause noise picked up from the motor supply. The power supply has to be buffered by a capacitor. Otherwise the module will be damaged! Do not exceed the maximum power supply of 55V DC. Do not connect or disconnect the motor while powered! Start with power supply OFF! 3.1 Starting up The following figure shows how the connectors have to be used. Velocity 26 Hall2 25 Hall1 GND 24 Hall3 23 +5V 6 Tacho 22 GND 21 GND 8 LED_Temp 20 GND 19 GND +5V 18 GND 17 GND 1 +5V 3 Torque 4 5 Dir_IN 7 Stop_IN 2 LED_Curlim 10 11 GND 12 GND 16 +VM 15 +VM 13 Enc_A+ 14 Enc_A- 14 +VM 13 +VM 9 15 Enc_B+ 16 Enc_B- 12 U 11 U 17 Enc_N+ 18 Enc_N- 10 U 9 U V 7 V 19 CANL/USBD- 20 RXD/485- 8 21 CANH/USBD+ 22 TXD/485+ 6 V 5 V 23 USB_+VB 24 n.c. 4 W 3 W 25 GND 26 GND 2 W 1 W Figure 3.1: Connectors of the TMCM-1630 Domain I/Os, interfaces, encoder Power, motor www.trinamic.com Connector type TSM-113-03-L-DV-K-A, 2x13 poles, double row, 2.54mm pitch, SMD vertical, Samtec TSM-113-03-L-DV-K-A, 2x13 poles, double row, 2.54mm pitch, SMD vertical, Samtec Mating connector type SSW, SSQ, SSM, BSW, ESW, ESQ, BCS, SLW, CES, HLE , IDSS and IDSD series, Samtec SSW, SSQ, SSM, BSW, ESW, ESQ, BCS, SLW, CES, HLE , IDSS and IDSD series, Samtec TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 1. 7 Connect the motor, power supply and hall sensors Since the two connectors of the TMCM-1630 are similar be careful not to connect the module turned around. When powered up this damage the as module. Be sure to place the connectors exactly to 1. Connect the motor and would the power supply follows: their opponents. A deviation of only one pin row can damage the module also. Start with power supply OFF! Pin Label 1 3 5 7 9 11 13 15 W W V V U U VM VM 17 GND 19 GND 21 GND 23 +5V 25 HALL1 2. Description Pin Motor coil W Motor coil W Motor coil V Motor coil V Motor coil U Motor coil U Module driver supply voltage Module driver supply voltage Module ground (power supply and signal ground) Module ground (power supply and signal ground) Module ground (power supply and signal ground) +5V output (100mA max.) for encoder and/or hall sensor supply Hall sensor 1 signal input 2 4 6 8 10 12 14 16 Label W W V V U U VM VM 18 GND 20 GND 22 GND Description Motor coil W Motor coil W Motor coil V Motor coil V Motor coil U Motor coil U Module driver supply voltage Module driver supply voltage Module ground (power supply and signal ground) Module ground (power supply and signal ground) Module ground (power supply and signal ground) 24 HALL3 Hall sensor 3 signal input 26 HALL2 Hall sensor 2 signal input Connect the interface, IOs and the encoder as follows: Since the two connectors of the TMCM-1630 are similar be careful not to connect the module turned around. When powered up this would damage the module. Be sure to place the connectors exactly to their opponents. A deviation of only one pin row can damage the module also. Pin 1 Label +5V 3 Torque 5 Dir_IN 7 Stop_IN 9 LED-Curlim 11 13 15 GND Enc_A+ Enc_B+ www.trinamic.com Description Pin 5V analog reference as used by the internal DAC. Max. load 0.5mA 2 Velocity 4 GND Module ground (power supply and signal ground) 6 Tacho This pin outputs a tacho impulse, i.e. toggles on each hall sensor change LED-Temp 5V TTL output: Toggling with 3Hz when temperature prewarning threshold is exceeded, high when module shut down due to overtemperature Used for max. motor current / torque control in standalone operation by supplying external 010V signal 5V TTL input. Tie to GND to inverse motor direction, leave open or tie to 5V otherwise. Emergency stop. Tie this pin to GND to stop the motor (same as the Motor OFF switch on PCB). The motor can be restarted via the interface, or by cycling the power supply High, when module goes into current limiting mode GND reference Encoder A+ channel Encoder B+ channel 8 Label 10 +5V 12 GND 14 Enc_A16 Enc_B- Description Used for velocity control in standalone operation by supplying external 0 - 10V signal 5V output as reference for external purpose GND reference Encoder A- channel Encoder B- channel TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 17 19 21 23 25 Enc_N+ Encoder N+ channel CAN low / CANL/USBDUSB D- bus line CAN high / CANH/USBD+ USB D+ bus line Use to detect availability of USB_+VB attached host system (e.g. PC) GND GND reference 18 Enc_NRXD/ 20 485TXD/ 22 485+ 8 Encoder N- channel RXD signal for RS232 / inverting signal for RS485 TXD signal for RS232 / non inverting signal for RS485 24 n.c. 26 GND GND reference 3. Switch ON the power supply The power LED is ON now. If this does not occur, switch power OFF and check your connections as well as the power supply. 4. Start the TMCL-IDE software development environment The TMCL-IDE is available on the TechLibCD and on www.trinamic.com. Installing the TMCL-IDE Make sure the COM port 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. Choose Type. The TMCL-IDE shows you which Port the module uses. Click OK. Figure 3.2: Setup menu Figure 3.3: Connection tab of TMCL-IDE 3.2 Operating the Module in Direct Mode 1. Start TMCL Direct Mode. Direct Mode 2. 3. If the communication is established the TMCM-1630 is automatically detected. If the module is not detected, please check all points above (cables, interface, power supply, COM port, baud rate). Issue a command by choosing instruction, type (if necessary), motor, and value and click execute to send it to the module. www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) Figure 3.4: TMCL direct mode window - Examples: ROR rotate right, motor 0, value 500 -> Click Execute. The first motor is rotating now. MST motor stop, motor 0 -> Click Execute. The first motor stops now. www.trinamic.com 9 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 10 4 TMCL and TMCL-IDE The TMCM-1630 module supports TMCL direct mode (binary commands) and standalone TMCL program execution. You can store up to 2048 TMCL instructions on it. In direct mode the TMCL communication over USB, CAN, RS232, and RS485 follows a strict master/slave relationship. That is, a host computer (e.g. PC/PLC) acting as the interface bus master will send a command to the module. The TMCL interpreter on it will then interpret this command, do the initialization of the motion controller, read inputs and write outputs or whatever is necessary according to the specified command. As soon as this step has been done, the module will send a reply back over the interface to the bus master. The master should not transfer the next command till then. Normally, the module will just switch to transmission and occupy the bus for a reply, 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 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 host computer or can be stored on the TMCM-1630 to form programs that run standalone on the module. For this purpose there are not only motion 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 used to send commands from the host to a module in direct mode. The mnemonic format is used for easy usage of the commands when developing standalone TMCL applications with the TMCL-IDE (IDE means Integrated Development Environment). There is also a set of configuration variables for the axis and for global parameters which allow individual configuration of nearly every function of a module. This manual gives a detailed description of all TMCL commands and their usage. 4.1 Binary Command Format When commands are sent from a host to a module, the binary format has to be used. Every command consists of a one-byte command field, a one-byte type field, a one-byte motor/bank field and a four-byte value field. So the binary representation of a command always has seven bytes. When a command is to be sent via RS232, USB or RS485 interface, it has to be enclosed by an address byte at the beginning and a checksum byte at the end. In this case it consists of nine bytes. The binary command format for RS232/RS485/USB is structured as follows: Bytes 1 1 1 1 4 1 - Meaning Module address Command number Type number Motor or Bank number Value (MSB first!) Checksum 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! www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 11 Checksum calculation As mentioned above, the checksum is calculated by adding up all bytes (including the module address byte) using 8-bit addition. Here is an example for the calculation: - in C: unsigned char i, Checksum; unsigned char Command[9]; //Set the “Command” array to the desired command Checksum = Command[0]; for(i=1; i<8; i++) Checksum+=Command[i]; Command[8]=Checksum; //insert checksum as last byte of the command //Now, send the command back to the module 4.2 Reply Format Every time a command has been sent to a module, the module sends a reply. The reply format for RS232/RS485/USB is structured as follows: Bytes 1 1 1 1 4 1 - Meaning Reply address Module address Status (e.g. 100 means no error) Command number Value (MSB first!) Checksum The checksum is calculated by adding up 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.1 Status Codes The reply contains a status code. The status code can have one of the following values: Code 100 101 1 2 3 4 5 6 Meaning Successfully executed, no error Command loaded into TMCL program EEPROM Wrong checksum Invalid command Wrong type Invalid value Configuration EEPROM locked Command not available www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 12 4.3 Standalone Applications The module is equipped with an EEPROM for storing TMCL applications. You can use the TMCL-IDE for developing standalone TMCL applications. You can load your program down into the EEPROM and then it will run on the module. The TMCL-IDE contains an editor and a TMCL assembler where the commands can be entered using their mnemonic format. They will be assembled automatically into their binary representations. Afterwards this code can be downloaded into the module to be executed there. 4.4 Testing with a Simple TMCL Program Open the file test2.tmc of the TMCL-IDE. The following source code appears on the screen: //A simple example for using TMCL and TMCL-IDE Loop: ROL 0, 4000 WAIT TICKS, 0, 2000 ROR 0, 4000 WAIT TICKS, 0, 2000 JA Loop //rotate left with 4000 rev/min //rotate right with 4000 rev/min Assemble Stop Download Run Figure 4.1: Assemble, download, stop, and run icons of TMCL-IDE 1. 2. 3. 4. Click on icon Assemble to convert the example into binary code. Then download the program to the TMCM-1630 module via the icon Download. Press icon Run. The desired program will be executed. Click Stop button to stop the program. For further information about the TMCL-IDE and TMCL programming techniques please refer to the TMCL-IDE User Manual on TRINAMICs website. TRINAMIC offers two software tools for BLDC applications: the TMCM-BLDC and the BLDC tool of the TMCL-IDE. Whereas the TMCM-BLDC is used for testing different configurations in all modes of operation the TMCL-IDE is mainly designed for conceiving programs and firmware updates. New versions of the TMCM-BLDC and the TMCL-IDE can be downloaded free of charge from the TRINAMIC website (http://www.trinamic.com). www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 13 4.5 TMCL Command Overview The following section provides a short overview of the TMCL commands supported by the TMCM-1630. 4.5.1 Motion Commands These commands control the motion of the motor. They are the most important commands and can be used in direct mode or in standalone mode. Mnemonic ROL ROR MVP MST 4.5.2 Command number 2 1 4 3 Meaning Rotate left Rotate right Move to position Motor stop Parameter Commands These commands are used to set, read and store axis parameters or global parameters. Axis parameters 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 SAP GAP STAP RSAP SGP GGP STGP RSGP 4.5.3 Command number 5 6 7 8 9 10 11 12 Meaning Set axis parameter Get axis parameter Store axis parameter into EEPROM Restore axis parameter from EEPROM Set global parameter Get global parameter Store global parameter into EEPROM Restore global parameter from EEPROM 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 for standalone mode only. Mnemonic JA JC COMP CSUB RSUB WAIT STOP 4.5.4 Command number 22 21 20 23 24 27 28 Meaning Jump always Jump conditional Compare accumulator with constant value Call subroutine Return from subroutine Wait for a specified event End of a TMCL program I/O Port Commands These commands control the external I/O ports and can be used in direct mode and in standalone mode. Mnemonic SIO GIO Command number 14 15 www.trinamic.com Meaning Set output Get input TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.5.5 14 Calculation Commands These commands are intended to be used for calculations within TMCL applications in standalone mode, only. For calculating purposes there are an accumulator (or accu or A register) and an X register. When executed in a TMCL program (in standalone 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 doing calculations. It can be loaded from the accumulator. Mnemonic CALC CALCX AAP AGP Command number 19 33 34 35 Meaning Calculate using the accumulator and a constant value Calculate using the accumulator and the X register Copy accumulator to an axis parameter Copy accumulator to a global parameter MIXING STANDALONE PROGRAM EXECUTION AND DIRECT MODE It is possible to use some commands in direct mode while a standalone program is active. When a command which reads out a value is executed (direct mode) the accumulator will not be affected. While a TMCL program is running standalone on the module, a host can still send commands like GAP and GGP to it (e.g. to query the actual position of the motor) without affecting the flow of the TMCL program running standalone on the module. www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 15 4.6 Commands The module specific commands are explained in more detail on the following pages. They are listed according to their command number. 4.6.1 ROR (rotate right) The motor will be instructed to rotate with a specified velocity in right direction (increasing the position counter). Internal function: First, velocity mode is selected. Then, the velocity value is transferred to axis parameter #2 (target velocity). Related commands: ROL, MST, SAP, GAP Mnemonic: ROR 0,Binary representation: COMMAND 1 TYPE don’t care MOT/BANK 0 Reply in direct mode: STATUS 100 – OK COMMAND 1 VALUE don’t care VALUE -200000… +200000 Example: Rotate right, velocity = 350 Mnemonic: ROR 0, 350 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $01 2 Type $00 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $01 7 Operand Byte0 $5e TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.2 16 ROL (rotate left) The motor will be instructed to rotate with a specified velocity (opposite direction compared to ROR, decreasing the position counter). Internal function: First, velocity mode is selected. Then, the velocity value is transferred to axis parameter #2 (target velocity). Related commands: ROR, MST, SAP, GAP Mnemonic: ROL 0, Binary representation: COMMAND 2 TYPE don’t care MOT/BANK 0 Reply in direct mode: STATUS 100 – OK COMMAND 2 VALUE don’t care VALUE -200000… +200000 Example: Rotate left, velocity = 1200 Mnemonic: ROL 0, 1200 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $02 2 Type $00 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $04 7 Operand Byte0 $b0 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.3 17 MST (motor stop) The motor will be instructed to stop. Internal function: The axis parameter target velocity is set to zero. Related commands: ROL, ROR, SAP, GAP Mnemonic: MST 0 Binary representation: COMMAND 3 TYPE don’t care MOT/BANK 0 Reply in direct mode: STATUS 100 – OK COMMAND 3 VALUE don’t care VALUE don’t care Example: Stop motor Mnemonic: MST 0 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $03 2 Type $00 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.4 18 MVP (move to position) The motor will be instructed to move to a specified relative or absolute position. It uses the acceleration/deceleration ramp and the positioning speed programmed into the unit. This command is nonblocking (like all commands). A reply will be sent immediately after command interpretation. Further commands may follow without waiting for the motor reaching its end position. The maximum velocity and acceleration are defined by axis parameters #4 and #11. TWO OPERATION TYPES ARE AVAILABLE: - Moving to an absolute position in the range from -2147483648… +2147483647. 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. Internal function: A new position value is transferred to the axis parameter #0 target position. Related commands: SAP, GAP, and MST Mnemonic: MVP , 0, Binary representation: COMMAND 4 TYPE 0 ABS – absolute MOT/BANK 0 1 REL – relative Reply in direct mode: STATUS 100 – OK VALUE -2147483648… +2147483647 -2147483648… +2147483647 0 COMMAND 4 VALUE don’t care Example MVP ABS: Move motor to (absolute) position 9000 Mnemonic: MVP ABS, 0, 9000 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 1 Instruction Number $04 2 Type $00 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $23 7 Operand Byte0 $28 6 Operand Byte1 $fc 7 Operand Byte0 $18 Example MVP REL: Move motor from current position 1000 steps backward (move relative -1000) Mnemonic: MVP REL, 0, -1000 Binary: Byte Index Function Value (hex) 0 Targetaddress $00 www.trinamic.com 1 Instruction Number $04 2 Type $01 3 Motor/ Bank $00 4 Operand Byte3 $ff 5 Operand Byte2 $ff TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.5 19 SAP (set axis parameter) Most of the motion control parameters of the module can be specified by using the SAP command. The settings will be stored in SRAM and therefore are volatile. Thus, information will be lost after power off. Please use command STAP (store axis parameter) in order to store any setting permanently. Related commands: GAP, STAP, and RSAP Mnemonic: SAP , 0, Binary representation: COMMAND 5 TYPE MOT/BANK 0 Reply in direct mode: STATUS 100 – OK COMMAND 5 VALUE don’t care VALUE A list of all parameters which can be used for the SAP command is shown in section 5. Example: Set the absolute maximum current to 2000mA Mnemonic: SAP 6, 0, 2000 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $05 2 Type $06 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $07 7 Operand Byte0 $D0 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.6 20 GAP (get axis parameter) Most parameters of the TMCM-1630 can be adjusted individually. They can be read out using the GAP command. Related commands: SAP, STAP, and RSAP Mnemonic: GAP , 0 Binary representation: COMMAND 6 TYPE MOT/BANK 0 Reply in direct mode: STATUS 100 – OK COMMAND 6 VALUE don’t care VALUE don’t care A list of all parameters which can be used for the GAP command is shown in section 5. Example: Get the actual position of motor Mnemonic: GAP 1, 0 Binary: Byte Index Function Value (hex) Reply: Byte Index Function Value (hex) 0 Targetaddress $01 Instruction Number $06 $01 0 Hostaddress $00 1 Targetaddress $01 2 Status www.trinamic.com 1 2 Type $64 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 3 Instructio n $06 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $02 7 Operand Byte0 $c7 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.7 21 STAP (store axis parameter) The STAP command stores an axis parameter previously set with a Set Axis Parameter command (SAP) permanently. Most parameters are automatically restored after power up. 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, and GAP Mnemonic: STAP , 0 Binary representation: COMMAND 7 TYPE MOT/BANK 0 VALUE 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 100 – OK COMMAND 7 VALUE don’t care A list of all parameters which can be used for the STAP command is shown in section 5. Example: Store the maximum speed Mnemonic: STAP 4, 0 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 1 2 Instruction Type Number $07 $04 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 Note: The STAP command will not have any effect when the configuration EEPROM is locked. The error code 5 (configuration EEPROM locked) will be returned in this case. www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.8 22 RSAP (restore axis parameter) For all configuration related axis parameters non-volatile memory locations are provided. By default, most parameters are automatically restored after power up. A single parameter that has been changed before can be reset by this instruction also. Internal function: The specified parameter is copied from the configuration EEPROM memory to its RAM location. Related commands: SAP, STAP, and GAP Mnemonic: RSAP , 0 Binary representation: COMMAND 8 TYPE MOT/BANK 0 Reply in direct mode: STATUS 100 – OK COMMAND 8 VALUE don’t care VALUE don’t care A list of all parameters which can be used for the RSAP command is shown in section 5. Example: Restore the maximum current Mnemonic: RSAP 6, 0 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $08 2 Type $06 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 4.6.9 23 SGP (set global parameter) Global parameters are related to the host interface, peripherals or other application specific variables. The different groups of these parameters are organized in banks to allow a larger total number for future products. Currently, bank 0 is used for global parameters and bank 2 is intended for user variables. Related commands: GGP, STGP, RSGP Mnemonic: SGP , , Binary representation: COMMAND 9 TYPE Reply in direct mode: STATUS 100 – OK VALUE don’t care MOT/BANK VALUE A list of all parameters which can be used for the SGP command is shown in section 6. Example: Set variable 0 at bank 2 to 100 Mnemonic: SGP, 0, 2, 100 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $09 2 Type $00 3 Motor/ Bank $02 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $64 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 24 4.6.10 GGP (get global parameter) All global parameters can be read with this function. Related commands: SGP, STGP, RSGP Mnemonic: GGP , Binary representation: COMMAND 10 TYPE Reply in direct mode: STATUS 100 – OK VALUE MOT/BANK VALUE don’t care A list of all parameters which can be used for the GGP command is shown in section 6. Example: Get variable 0 from bank 2 Mnemonic: GGP, 0, 2 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 1 Instruction Number $0a 2 Type $00 3 Motor/ Bank $02 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 4.6.11 STGP (store global parameter) Some global parameters are located in RAM memory, so modifications are lost at power down. This instruction copies a value from its RAM location to the configuration EEPROM and enables permanent storing. Most parameters are automatically restored after power up. Related commands: SGP, GGP, RSGP Mnemonic: STGP , Binary representation: COMMAND 11 TYPE Reply in direct mode: STATUS 100 – OK VALUE don’t care MOT/BANK VALUE don’t care A list of all parameters which can be used for the STGP command is shown in section 6. Example: Copy variable 0 at bank 2 to the configuration EEPROM Mnemonic: STGP, 0, 2 Binary: Byte Index 0 1 2 3 Instruction Type Function TargetMotor/ Number address Bank Value (hex) $01 $0b $00 $02 www.trinamic.com 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 25 4.6.12 RSGP (restore global parameter) This instruction copies a value from the configuration EEPROM to its RAM location and so recovers the permanently stored value of a RAM-located parameter. Most parameters are automatically restored after power up. Related commands: SGP, GGP, STGP Mnemonic: RSGP , Binary representation: COMMAND 12 TYPE Reply in direct mode: STATUS 100 – OK VALUE don’t care MOT/BANK VALUE don’t care A list of all parameters which can be used for the RSGP command is shown in section 6. Example: Copy variable 0 at bank 2 from the configuration EEPROM to the RAM location Mnemonic: RSGP, 0, 2 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $0c 2 Type $00 3 Motor/ Bank $02 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 26 4.6.13 SIO (set output) and GIO (get input / output) The TMCM-1630 provides two commands for dealing with inputs and outputs: - SIO sets the status of the general digital output either to low (0) or to high (1). With GIO the status of all general purpose inputs of the module can be read out. The command reads out a digital or analogue input port. Digital lines will read 0 and 1, while the ADC channel delivers 12 bit in the range of 0… 4095. CORRELATION BETWEEN I/OS AND BANKS Bank Bank 0 Bank 1 Bank 2 Inputs/ Outputs Digital inputs Analogue inputs Digital outputs Description Digital inputs are accessed in bank 0. Analog inputs are accessed in bank 1. The states of the OUT lines (that have been set by SIO commands) can be read back using bank 2. 4.6.13.1 SIO (set output) Bank 2 is used for setting the status of the general digital output either to low (0) or to high (1). Internal function: the passed value is transferred to the specified output line. Related commands: GIO, WAIT Mnemonic: SIO , , Binary representation: INSTRUCTION NO. TYPE 14 Reply structure: STATUS 100 – OK Binary: Byte Index Function Value (hex) MOT/BANK 2 0 Targetaddress $01 VALUE 0/1 VALUE don’t care 1 Instruction Number $0e 2 Type $07 3 Motor/ Bank $02 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $01 4.6.13.2 GIO (get input/output) GIO can be used in direct mode or in standalone mode. GIO IN STANDALONE MODE In standalone mode the requested value is copied to the accumulator (accu) for further processing purposes such as conditioned jumps. GIO IN DIRECT MODE In direct mode the value is output in the value field of the 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 www.trinamic.com TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 27 Mnemonic: GIO , Binary representation: INSTRUCTION NO. 15 TYPE Reply in direct mode: STATUS 100 – OK Binary: Byte Index Function Value (hex) Reply: Byte Index Function Value (hex) MOT/BANK VALUE don’t care VALUE 0 Targetaddress $01 Instruction Number 1 2 Type $0f $00 0 Hostaddress $02 1 Targetaddress $01 2 Status $64 3 Motor/ Bank $01 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $00 7 Operand Byte0 $00 3 Instructio n $0f 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $01 7 Operand Byte0 $2e Hall1 1 +5V 2 Velocity 26 Hall2 25 3 Torque 4 GND 24 Hall3 23 +5V 5 Dir_IN 6 Tacho 22 GND 21 GND 7 Stop_IN 8 LED_Temp 20 GND 19 GND 17 GND 9 LED_Curlim 10 +5V 18 GND 11 GND 12 GND 16 +VM 15 +VM 13 Enc_A+ 14 Enc_A- 14 +VM 13 +VM 15 Enc_B+ 16 Enc_B- 12 U 11 U 17 Enc_N+ 18 Enc_N- 10 U 9 U 19 CANL/USBD- 20 RXD/485- 8 V 7 V 21 CANH/USBD+ 22 TXD/485+ 6 V 5 V 23 USB_+VB 24 n.c. 4 W 3 W 25 GND 26 GND 2 W 1 W Figure 4.2 Connector of TMCM-1630 PROVIDED SIO AND GIO COMMANDS Pin 2 3 - Digital - www.trinamic.com Analog x x x x x x GIO , GIO 0, 1 (velocity) GIO 1, 1 (torque) GIO 2, 1 (Phase A) GIO 3, 1 (Phase B) GIO 4, 1 (Phase C) GIO 5, 1 (VSupply) SIO , , - Value range 0… 4095 0… 4095 0… 4095 0… 4095 0… 4095 0… 4095 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 5 6 7 x x x x - GIO 6, 1 (Temp) GIO 0, 0 (DIR_IN) GIO 0, 2 (tacho) GIO 1, 0 (STOP_IN) 28 SIO 0, 2, - 0… 4095 0/1 0/1 0/1 THE FOLLOWING PROGRAM WILL SHOW THE STATES OF THE INPUT LINES ON THE OUTPUT LINES: Loop: GIO 255, 0 SIO 255, 2,-1 JA Loop 4.6.14 CALC (calculate) A value in the accumulator variable, previously read by a function such as GAP (get axis parameter), can be modified with this instruction. Nine different arithmetic functions can be chosen and one constant operand value must be specified. The result is written back to the accumulator, for further processing like comparisons or data transfer. Related commands: CALCX, COMP, JC, AAP, AGP, GAP, GGP, GIO Mnemonic: CALC , Binary representation: COMMAND 19 0 1 2 3 4 5 6 7 8 9 TYPE ADD – add to accu SUB – subtract from accu MUL – multiply accu by DIV – divide accu by MOD – modulo divide by AND – logical and accu with OR – logical or accu with XOR – logical exor accu with NOT – logical invert accu LOAD – load operand to accu MOT/BANK don’t care VALUE Example: Multiply accu by -5000 Mnemonic: CALC MUL, -5000 Binary: Byte Index Function Value (hex) 0 Targetaddress $01 www.trinamic.com 1 Instruction Number $13 2 Type $02 3 Motor/ Bank $00 4 Operand Byte3 $FF 5 Operand Byte2 $FF 6 Operand Byte1 $EC 7 Operand Byte0 $78 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 29 4.6.15 COMP (compare) The specified number is compared to the value in the accumulator register. The result of the comparison can be used for example by the conditional jump (JC) instruction. This command is intended for use in standalone operation, only. The host address and the reply are required to take the instruction to the TMCL program memory while the TMCL program downloads. It does not make sense to use this command in direct mode. Internal function: The specified value is compared to the internal accumulator, which holds the value of a preceding get or calculate instruction (see GAP/GGP/CALC/CALCX). The internal arithmetic status flags are set according to the comparison result. Related commands: JC (jump conditional), GAP, GGP, CALC, CALCX Mnemonic: COMP Binary representation: COMMAND 20 TYPE don’t care MOT/BANK don’t care VALUE Example: Jump to the address given by the label when the position of the motor #0 is greater or equal to 1000. GAP 1, 0, 0 COMP 1000 JC GE, Label //get axis parameter, type: no. 1 (actual position), motor: 0, value: 0 don’t care //compare actual value to 1000 //jump, type: 5 greater/equal, the label must be defined somewhere else in the program Binary format of the COMP 1000 command: Byte Index 0 1 2 Instruction Function TargetType Number address Value (hex) $01 $14 $00 www.trinamic.com 3 Motor/ Bank $00 4 Operand Byte3 $00 5 Operand Byte2 $00 6 Operand Byte1 $03 7 Operand Byte0 $e8 TMCM-1630 TMCL Firmware V2.08 Manual (Rev. 2.04 / 2017-JULY-10) 30 4.6.16 JC (jump conditional) The JC instruction enables a conditional jump to a fixed address in the TMCL program memory, if the specified condition is met. The conditions refer to the result of a preceding comparison. This function is for standalone operation only. The host address and the reply are required to take the instruction to the TMCL program memory while the TMCL program downloads. It is not possible to use this command in direct mode. Internal function: The TMCL program counter is set to the passed value if the arithmetic status flags are in the appropriate state(s). Related commands: JA, COMP, WAIT Mnemonic: JC ,
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 56 Language : de-DE Tagged PDF : Yes Title : TMCM-1630 Author : Sonja Dwersteg Subject : BLDC controller / driver board Keywords : TMC603, hallFX Creator : Microsoft® Word 2013 Create Date : 2017:07:10 10:08:51+02:00 Modify Date : 2017:07:10 10:08:51+02:00 Producer : Microsoft® Word 2013EXIF Metadata provided by EXIF.tools