![Trinamic TMCM-170 Скачать руководство пользователя страница 8](http://html1.mh-extra.com/html/trinamic/tmcm-170/tmcm-170_programming-and-reference-manual_1163072008.webp)
TMCM-170 and TMCM-171 MODULE – Reference and Programming Manual
8
Copyright © 2005, TRINAMIC Motion Control GmbH & Co. KG
2 Interface Protocol
The TMCM modules use the TMCL 9 byte protocol. The interface parameters are 9600 baud, 8
bit, 1 stop bit (default values). This is not the case when communicating via the CAN bus as
address and checksum are included in the CAN standard and do not have to be supplied by the
user (default 250kBit/s)
. Please refer to the TMCL manual for a more detailed description of the
TMCL basics. However, the BLDC modules define a different function set, detailed in the following.
2.1 Assignment of the command bytes sent
from the host to the BLDC-module:
Cmd[0]:
Module address (set to one for the RS232 module)
Cmd[1]:
Command byte / Instruction number
Cmd[2]:
"Type" byte (e.g. parameter number)
Cmd[3]:
"Axis" byte (always set to zero for a one axis module)
Cmd[4], Cmd[5], Cmd[6], Cmd[7]:
optional parameter (CMD[4] is the MSB, Cmd[7] is the LSB)
Parameters can have one to four bytes.
Cmd[8]:
Check sum (1 byte sum of the complete datagram)
Do not sent the next command before you have received the reply!
Example:
Rotate right, motor #0, velocity = 350 (refer to 3.1.1 ROR - Rotate Right)
Byte Index
0
1
2
3
4
5
6
7
8
Function
Target-
address
Instruction
Number
Type Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Checksum
Value (hex)
$01 $01 $00
$00
$00 $00 $01 $5e $61
When using CAN bus, the first byte (reply address) and the last byte (checksum) are left out.
2.2 Assignment of the reply bytes sent from
the BLDC-module:
Reply[0]:
Host Address
Reply[1]:
Module Address
Reply[2]:
Status
Reply[3]:
Last command byte which was received by the module
Reply[4],Reply[5],Reply[6],Reply[7]: Value (Reply[4] is the MSB, Reply[7] is the LSB)
All reply values are extended to 32 bit
Reply[8]: Check
sum
Example:
get the actual position of motor #0 (refer to 3.2.2 GAP - TMCL Get Axis Parameters)
Sent:
Byte Index
0
1
2
3
4
5
6
7
8
Function
Target-
address
Instruction
Number
Type Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Checksum
Value (hex)
$01 $06 $01
$00
$00 $00 $00 $00 $08
When using CAN bus, the first byte (reply address) and the last byte (checksum) are left out.
Reply:
Byte Index
0
1
2
3
4
5
6
7
8
Function
Host-
address
Target-
address
Status Instruction Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Checksum
Value (hex)
$02 $01 $64
$06 $00 $00 $02 $c7 $36