Trinamic TMCM-171 HARDWARE MANUAL

TMCM-171 module
Hardware Manual
BLDC servo motor controller 20A/48V
with RS485 and CAN interface
Trinamic Motion Control GmbH & Co. KG
D – 20357 Hamburg, Germany
http://www.trinamic.com
Sternstraße 67
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 2
Contents
1 Features...........................................................................................................................................................................4
2 Life support policy .......................................................................................................................................................5
3 Electrical Description ...................................................................................................................................................6
3.1 Pinning...................................................................................................................................................................6
3.1.1 Power supply ............................................................................................................................................. 6
3.1.2 Motor ............................................................................................................................................................ 6
3.1.3 CAN and RS485 ..........................................................................................................................................6
3.1.4 Step / Dir.....................................................................................................................................................7
3.1.5 Encoder, Hall, Temperature....................................................................................................................7
3.1.6 I / O ..............................................................................................................................................................8
3.1.7 Programming connector.........................................................................................................................8
3.2 Jumper “Select Opto In”....................................................................................................................................8
3.3 Application circuit ...............................................................................................................................................9
3.4 Dimensions .........................................................................................................................................................10
3.5 Connectors...........................................................................................................................................................11
4 Operational / Limiting Ratings ...............................................................................................................................12
4.1 Power supply requirements...........................................................................................................................14
4.2 Bus Interface.......................................................................................................................................................14
4.2.1 Terminating the RS485 network.........................................................................................................14
5 Functional description...............................................................................................................................................15
5.1 Setting the basic values for operation (using the demonstration application).............................15
5.2 Start up for encoder based commutation .................................................................................................15
5.3 Encoder setting ..................................................................................................................................................16
5.4 Hall sensor only operation w/o encoder ...................................................................................................17
5.5 Stop switch .........................................................................................................................................................17
5.6 General Functions (explore using the Windows based demo software).........................................17
5.7 Temperature, Current and Voltage monitoring functions.....................................................................17
5.8 Programmable motor current limit..............................................................................................................18
6 Revision History ..........................................................................................................................................................19
6.1 Documentation Revision .................................................................................................................................19
6.2 Firmware Revision ............................................................................................................................................19
7 References.....................................................................................................................................................................19
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 3
List of Figures
Figure 3.1: Pinning of TMCM-171 ......................................................................................................................................6
Figure 3.2: Application circuit ............................................................................................................................................ 9
Figure 3.3: Circuit board dimensions.............................................................................................................................10
Figure 3.4: Housing dimensions .....................................................................................................................................11
List of Tables
Table 1.1: Order codes .........................................................................................................................................................4
Table 3.1: Pinning of power supply connector ............................................................................................................ 6
Table 3.2: Pinning of motor connector........................................................................................................................... 6
Table 3.3: Pinning of CAN and RS485 connector ......................................................................................................... 6
Table 3.4: Pinning of step / dir connector.....................................................................................................................7
Table 3.5: Pinning of Encoder, Hall, Temperature connector ...................................................................................7
Table 3.6: Pinning of I / O connector.............................................................................................................................. 8
Table 3.7: Programming connector (to be used by Trinamic only)........................................................................8
Table 3.8: Connectors.........................................................................................................................................................11
Table 4.1: Operational ratings..........................................................................................................................................13
Table 5.1: Temperature, Current and Voltage monitoring functions (LEDs) ......................................................17
Table 6.1: Documentation Revisions..............................................................................................................................19
Table 6.2: Firmware Revision...........................................................................................................................................19
Table 7.1: References..........................................................................................................................................................19
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 4
1 Features
The TMCM-171 is a controller / driver module for high performance servo drives based on brushless DC motors. It gives a high resolution like a stepper motor coupled with the high dynamic, high velocity and high reliability of a BLDC drive. The motors and switches can be connected easily with screw terminals. A build-in ramp generator allows parameterized smooth positioning. The TMCM-171 supports BLDC motors with nearly any number of poles and incremental encoders with nearly any resolution.
The TMCM-171 integrates a position regulator and a ramp generator, to allow for velocity modes.
The module can be remote controlled via a CAN or RS485 interface. Additionally the TMCM-171 is equipped with a step direction interface. Stand alone operation is also possible.
Its integration into the TRINAMIC family of motor control modules makes it easy to choose either a stepper motor or a BLDC motor or any combination for an application.
Applications
Replacement of servo drive by high reliability / low cost BLDC drive
Fast and precise positioning
Smooth very low to very high constant / variable velocity drives
Very high velocity stability drives
Motor / Encoder type
Sine (or block) commutated BLDC motors with encoder and with / without additional hall sensors
Hall sensor based motors can be operated without encoder
Motor power from a few watts to 800W
Motor velocity up to 100,000 RPM (electrical field)
Incremental encoder (2 channel with option for N-channel) with resolution from 256 to 30000 /
motor rotation (opt. per electrical field rotation)
12V to 48V nominal motor voltage
RMS motor current up to 20A (sine commutation)
Highlights
High-efficiency operation, low power-dissipation
Motor RMS current measurement in sine commutation mode
Very fast response time leads to dynamic motor behavior
CAN interface and RS485 integrated
Step direction interface
Stand alone capability
Typical Supply voltage 14V – 48V
Integrated Protection: Reverse polarity and overload / overtemperature / overvoltage
Supports the TRINAMIC TMCL protocol and the TMCL software environment for parameterizing and
for update
Integrated 1024 entry 10 bit motor sine commutation table
External (stop) switch or encoder N channel can be used for absolute position reference
Different start up modes for automatic commutation calibration
Order code Description
TMCM-171 BLDC servo module
Table 1.1: Order codes
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 5
2 Life support policy
TRINAMIC Motion Control GmbH & Co. KG does not authorize or warrant any of its products for use in life support systems, without the specific written consent of TRINAMIC Motion Control GmbH & Co. KG.
Life support systems are equipment intended to support or sustain life, 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 2007
Information given in this data sheet is believed to be accurate and reliable. However no responsibility is assumed for the consequences of its use nor for any infringement of patents or other rights of third parties, which may result form its use.
Specifications subject to change without notice.
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 6
3 Electrical Description
3.1 Pinning
Pin1
CAN and
RS485
Pin1
Step / Dir
Pin1
I / O
1
1
1
2
2
2
Pin1
Pin1
Pin1
Pin1
Programming
Figure 3.1: Pinning of TMCM-171
3.1.1 Power supply
Pin Name Function
1 U+ Positive power supply voltage 2 GND GND, power
Pin1
Pin1
Pin1
Pin1
4
2
3
Pin1
Power supply
Motor
Encoder, Hall,
1
Temperature
Pin1
Table 3.1: Pinning of power supply connector
3.1.2 Motor
Pin Name Function
1 U 2 V 3 W
BLDC motor coil connection
Table 3.2: Pinning of motor connector
3.1.3 CAN and RS485
Connector 1 (screw) and 2 (JST)
Pin Name Function
1 CANH CAN high signal 2 CANL CAN low signal 3 GND GND 4 RS485 + Non inverting rs485 signal 5 RS485 - Inverting RS485 signal
Table 3.3: Pinning of CAN and RS485 connector
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 7
3.1.4 Step / Dir
Connector 1 (screw) Connector 2 (JST)
Pin Name Function Pin Name Function
1 Step +
2 Step -
3 Dir +
4 Dir -
-- -- -- 5 D - inverted direction input
Opto-decoupled non inverted step input Opto-decoupled inverted step input Opto-decoupled non inverted direction input Opto-decoupled inverted direction input
Table 3.4: Pinning of step / dir connector
1 S + non inverted step input
2 S - inverted step input
3 GND GND
4 D + non inverted direction input
3.1.5 Encoder, Hall, Temperature1
Pin Name Function Pin Name Function
Connector 1 (screw) Connector 3 (JST 1x8)
1 +5V 5V supply for encoder 1 +5V 5V supply for encoder 2 GND GND 2 GND GND 3 E I Encoder indexer 3 E I Non inverted encoder indexer 4 E A Encoder channel A 4 E I - Inverted encoder indexer 5 E B Encoder channel B 5 E A Non inverted encoder channel A 6 +5V 5V supply for hall sensors 6 E A - Inverted encoder channel A 7 GND GND 7 E B Non inverted encoder channel B 8 H1 Hall sensor signal 1 8 E B - Inverted encoder channel B
9 H2 Hall sensor signal 2 10 H3 Hall sensor signal 3 1 +5V 5V supply for hall sensors 11 +5V 5V supply (reference) 2 GND GND 12 TEMP Temperature input 3 H1 Hall sensor signal 1
Connector 2 (JST 2x3 pin)2
1 5 H3 Hall sensor signal 3
Close to use differential encoder ( B ) of connector 3. Leave open otherwise.
2
3 7 +5V +5V
Close to use differential encoder ( A ) of connector 3. Leave open otherwise.
4
5 -- -- --
Close to use differential encoder ( I ) of connector 3. Leave open otherwise.
6
4 H2 Hall sensor signal 2
6 GND GND
8 TEMP Temperature input
-- -- --
Connector 4 (JST 1x8)
Table 3.5: Pinning of Encoder, Hall, Temperature connector
1
Signals with identical names are electrically identical.
2
This connector serves as three jumpers to enable or disable the differential encoder of connector 3. The inputs “E I”, “E A” and “E B” of connector 1 or 3 are for single ended encoders, if the jumpers of connector 2 are open.
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 8
3.1.6 I / O
Connector 1 (screw) and 2 (JST)
Pin Name Function
1 +5V Constant +5V output 2 GND GND 3 OUT1 Digital output 1 4 OUT2 Digital output 2 5 AIN3 Analog input 3, 0-5V (free usage in TMCL) 6 AIN2 Analog input 2, 0-5V (free usage in TMCL) 7 GND GND 8 DIRIN Analog input 0, 0-5V (free usage in TMCL), has 10k pull up resistor to +5V 9
10 /STOP Reference switch input
The analog inputs can also be used as digital inputs. Threshold is ½ of maximum input voltage.
AIN1
Analog input 1 0-10V (free usage in TMCL or special function for stand alone operation)
Table 3.6: Pinning of I / O connector
3.1.7 Programming connector
Pin Name Function Pin Name Function
1,3,4 Not connected 6 GND GND
2 /MCLR To be used by Trinamic only 7 PGD To be used by Trinamic only 5 PGC To be used by Trinamic only 8 +5V Constant +5V output
Table 3.7: Programming connector (to be used by Trinamic only)
3.2 Jumper “Select Opto In”
An open jumper deactivates the opto-decoupled step / direction inputs at the screw terminal and activates inputs at the JST connector. Closing the jumper the screw terminal gets active and JST connector inactive.
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 9
3.3 Application circuit
The schematic shows a typical application circuit using CAN bus interface. Optionally the unit allows connection of motor hall sensors and encoder I- (N-)channel as well as further digital / analog pins and different interface options.
System's CAN bus
48V system
power
+
-
supply
keep distance
short for CAN
optional
capacitor if > 2m
4700µ, 63V
VS
GND
GND
CANL
CANH
TMCM-171
Encoder
E A
E B
E I
Termination
resistor at bus end
GND
/STOP
U
I/OInterface
V
W
GND
+5V
110R
Reference
Sw.
BLDC-
Motor
Mech. Axis
optional overvoltage
suppressor:
high power zener /
zener transistor
circuit
Encoder
Place unit near
encoder / motor
Figure 3.2: Application circuit
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 10
3.4 Dimensions
Height 31mm, hole diameter is 4.2mm
135,00
130,00
102,00
67,50
33,00
5,00
All dimensions are in millimeter
Figure 3.3: Circuit board dimensions
5,00
47,50
18,00
89,00
76,00
94,00
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 11
Figure 3.4: Housing dimensions
3.5 Connectors
Name N0. On TMCM-171
Power supply - RIA type 320, RM5, 2 pin RIA type 349, RM5, 2 pin www.riaconnect.com Motor - RIA type 320, RM5, 3 pin RIA type 349, RM5, 3 pin www.riaconnect.com
CAN, RS485
Step / Dir
Encoder, Hall, Temperature
I / O
1 RIA type 183, RM3.5, 5 pin RIA type 169,RM3.5, 5 pin www.riaconnect.com 2 JST B5B-PH-K, RM2 www.farnell.com 1 RIA type 183, RM3.5, 4 pin RIA type 169,RM3.5, 4 pin www.riaconnect.com 2 JST B5B-PH-K, RM2 www.farnell.com 1 RIA type 183, RM3.5, 12 pin RIA type 169,RM3.5, 12 pin www.riaconnect.com 2 2x3 industry standard Jumper RM2.54 3 JST B8B-PH-K, RM2 www.farnell.com 4 JST B8B-PH-K, RM2 www.farnell.com 1 RIA type 183, RM3.5, 10 pin RIA type 169,RM3.5, 10 pin www.riaconnect.com 2 JST B10B-PH-K, RM2 www.farnell.com
Table 3.8: Connectors
Mate
Site
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 12
4 Operational / Limiting Ratings
The operational ratings show the intended / the characteristic range for the values and should be used as design values. An operation within the limiting values is possible, but shall not be used for extended periods, because the unit life time may be shortened. In no case shall the limiting values be exceeded.
Symbol Parameter Min Typ Max Unit
VS Power supply voltage for operation 12.5 14 - 48 52 V
V
Maximum power supply voltage (for surge) 60 V
SMAX
V
Under voltage switch off trip point 9.5 10 10.5 V
SLOOFF
V
Under voltage switch on trip point 10.5 12 12.5 V
SON
V
VSD
SOFF
Over voltage switch off trip point (Feature can be switched off, then V
limit applies)
SMAX
Power supply voltage for module operation with motor disabled
Power supply current
IS
* maximum rating due to connector limitations when using screw terminal connectors
PID
I
I
I
I
f
CHOP
V5
MCB
MCS
MPB
MPS
Module idle power consumption without encoder / hall sensor
5 Volt (+-4%) output external load (encoder plus hall sensors plus other load)
Continuous Motor RMS current in block commutation mode (module surface at maximum 85°C)
Continuous Motor RMS current in sine commutation mode (module surface at maximum 85°C)
Short time Motor current in acceleration periods
It is not recommended to set motor current above I
!
MC
Short time Motor current in acceleration periods
It is not recommended to set motor current above I
!
MC
Chopper frequency 20 kHz
52 55 58 V
7 8 9.5 V
0.04 (P
Motor
+3..10W)
/ V
S
I
MOT
or
16A*
2.4 W
0 200 mA
16 A
20 A
20 A
24 A
A
T
VI
Motor output slope (U, V, W) 100 ns
SL
Logic input voltage on digital inputs, encoder and hall
-0.3 V
sensor inputs
CC
0.3
+
V
IIH Pull-up resistor current for hall inputs 50 250 400 µA
IIE Pull-up resistor current for encoder inputs (1kOhm) 5 mA
IO
Logic output current on digital outputs (open drain output with integrated 1k pullup resistor to +5V)
2 A
VO Output voltage on digital outputs with external load 55 V
V
Analog input voltage on input 1 -24 0 – 10 24 V
IA1
V
Analog input voltage on input 0, 2, 3 -24 0 – 5 24 V
IA023
EV Exactness of voltage measurement -5 +5 %
EC
Exactness of current measurement (the measured coil current value might not correspond to the RMS current,
-10 +10 %
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 13
but is repeatable within the given exactness)
f
Encoder count rate (signals 50% duty cycle) 13.3 MHz
ENC
t
Step pulse length on (opto coupler on time) 0.7 µs
STEPON
t
Step pulse length off (opto coupler off time) 2.0 µs
STEPOFF
t
Direction valid setup time before next step 0 µs
DIRSETUP
f
ZEROCROSS
Zero crossing step frequency (also defines Direction hold time after Step impulse)
1 kHz
TO Environment temperature operating -25 +85 °C
T
board
Temperature of the PCB, as measured by the integrated sensor.
<105 115 °C
Table 4.1: Operational ratings
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 14
4.1 Power supply requirements
The power supply should be designed in a way, that it supplies the nominal motor voltage at the desired maximum motor power. In no case shall the supply value exceed the upper / lower voltage limit. The BLDC motor unit uses a chopper principle, i.e. the power supply to the motor is pulsed at a frequency of 20kHz. To ensure reliable operation of the unit, the power supply has to have a sufficient output capacitor and the supply cables should have a low resistance, so that the chopper operation does not lead to an increased power supply ripple directly at the unit. Power supply ripple due to the chopper operation should be kept at a maximum of a few 100mV.
Therefore we recommend to
a) keep power supply cables as short as possible b) use large diameter for power supply cables c) if the distance to the power supply is large (i.e. more than 2-3m), use a robust 4700µF or
larger additional filtering capacitor located near to the motor driver unit.
An effect the power supply has to cope with, is, that the motor can feed back substantial current into the power supply whenever it is actively braked! While this generally is a positive effect (because it saves energy), precautions have to be taken, to limit the supply voltage to within the operational limits. The TMCM-171 contains an overvoltage protection circuit, which disables braking whenever the upper supply voltage limit is exceeded. This automatic function may lead to an unwanted behavior, i.e. overshooting the target position, and thus can be disabled. Disabling the overvoltage protection should only be done, provided that the user takes additional precautions to limit the voltage:
It is recommended to use
a) a large capacitor on the power supply lines able to store substantial part of feed back energy b) a zener / suppressor diode circuitry, limiting the power supply voltage to a maximum of 52-
60V
4.2 Bus Interface
The TMCM-171 can be operated via CAN or RS485 in the same way. CAN bus and RS485 require a termination resistor at both ends of the cable (but not at every unit).
4.2.1 Terminating the RS485 network
For RS485 in addition to the termination resistor a termination network is required, which forces an “inactive” level to the line, when no driver is on. Typically, use a 1K resistor to + 5V for RS485+ line and a 1K resistor to GND for the RS485- line at some point of the network.
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 15
5 Functional description
5.1 Setting the basic values for operation (using the
demonstration application)
The TMCM-171 can use nearly any BLDC motor and encoder type. However, care has to be taken to correctly set the motor pole count (default: 8) and encoder resolution (default: 4096) and direction (default: Encoder gives same direction as motor) before trying to operate the motor! If a hall sensor is used, please check if the hall sensor polarity is to be reversed (try operating the motor in block commutation mode, first). Also choose a fitting initialization mode (2 is most universal) and set the corresponding parameters (please see chapter on start up). The motor behavior afterwards may still give unsatisfactory results: The next step is to tune the PID parameters. For these basic settings, the Windows based demonstration application can be used. It requires connection to the CAN or the RS485 interface. As a first step use the TMCL-IDE to set the parameter “Telegram pause time” to a value of about 20. Further basic settings are required for motor start up (see next chapter).
To avoid motor operation or damage, before the unit is completely parameterized, use a
Hint:
supply voltage of only 8V! This disables the motor.
5.2 Start up for encoder based commutation
The TMCM-171 uses an incremental encoder for motor commutation. Incremental means, that the encoder does not give an absolute position reference. Thus, the unit needs an internal start up procedure, which determines the encoder position with respect to the actual pole motor orientation.
The TMCM-170 provides basically two modes for encoder initialization:
Mode 0 uses additional motor hall sensors for the start up phase. Therefore, the motor can not do a
precise positioning until it has done at least one electrical rotation. This can be perceived by a somehow rough behavior on the first positioning run. We recommend using this mode, when the motor has hall sensors and mode 1 does not give reliable results. However, the motor hall sensors typically are not as precise, as this would be desired for sine commutation. To accomplish with the hall sensor error and hysteresis, you can set the corresponding parameters “Init Sine Block Offset CW” and CCW.
Mode 1 drives the motor field into a known position and then evaluates the encoder position.
While this is a very precise scheme, it is susceptible to external force applied to the rotor: The rotor is not to be blocked in any direction. Additionally external mechanical torque applied to the axis should be kept low. To use this mode, it is important to set the “Sine Initialization Current A” as high as possible (within the 20A limit). Default value is 10A. You can set Sine Initialization Current B to a somewhat lower value (at least ½ of Current A) to give optimum results. The best setting has do be determined for a given motor. To allow for minimum motor movement upon initialization, this mode also checks the hall sensor positions.
Mode 2 is the same as mode 1, but does not check if the motor has hall sensors.
Mode 3 is the most precise and reliable initialization mode: It uses the encoder N-channel for
initialization. To first find the N-channel reference position, the motor is turned by up to one rotation, until the N-channel is found positive. The velocity and direction can be specified using the parameter “Sine Init Velocity”. After finding the reference position, the “Actual Commutation Offset” gives the angular relationship between motor and encoder.
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 16
Therefore this parameter has to be stored correctly in EEPROM before power on! Do not enable this mode, before the parameter has been set correctly. Mode 4 helps for the very first initialization of this mode.
Mode 4 helps to do a first initialization and tuning of mode 3. It searches for the N-channel
reference point first, and then does a mode 2 initialization to determine the correct setting for the “Actual Commutation Offset”. The encoder N-channel polarity has to be high active for this mode (the actual setting of the encoder null polarity has no influence in this mode), and, additionally, you have to specify the polarity of the encoder A- and B-channel upon N­channel activity using the setting “Encoder Null Polarity”, bits 1 and 2. The correct setting of this depends on the encoder. If the N-channel referencing fails, the motor does two full rotations and then stops. Try again with reversing the “Encoder Null Polarity”. After successfully initializing the “Actual Commutation Offset”, you can try moving the motor and tune the offset, if desired. Then store the offset and switch to mode 3. If any encoder errors are flagged during operation of the motor, retry with a modified setting for A- and B­channel polarity.
Attention:
The quality of the initialization phase result can be checked by rotating the motor left and right at the maximum velocity (use a velocity setting slightly higher than the motor can follow). Maximum velocity for left and right direction shall not differ by more than a few percent. Also make some checks if results are reproducible. Whenever changing one of these parameters, re-power the unit to restart initialization phase!
Initialization modes 1 to 4 apply a high current to the motor for a few seconds. Be sure
to parameterize the initialization current correctly (i.e. not more than 2* the maximum rated motor current) before first powering on the unit.
5.3 Encoder setting
The N-channel (index channel) of the encoder is not required for motor operation, but it is very good for motor initialization, because it gives an absolute and exact reference point. So, the motor initialization modes 3 and 4 use the N-channel for motor initialization. Behavior of the N-channel signal is very dependent on the encoder type and has to be taken into account for the setting of the TMCM171 encoder interface. Please refer to the following figure for correct setting of the Encoder Null Polarity flag. A wrong setting may either hinder the module from initializing the sine mode, or might lead to the Encoder Error flag being set, in spite of correct encoder function.
Set Encoder Null
Polarity to
binary 011
Enc-A
Enc-B
10
0
Enc-N
(index)
CW turn CCW turn CW turn CCW turn
zero event
Set Encoder Null
Polarity to
binary 001
0
zero event
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 17
5.4 Hall sensor only operation w/o encoder
The module can be used without an encoder. In this case, set the encoder resolution parameter (SGP
250) to the hall sensor resolution, i.e. 3 times the number of motor poles. Example: For a 4 pole motor set the encoder resolution to 12. To avoid oscillations in positioning mode, the algorithm in this mode stops regulation, as soon as the target distance is below the setting as determined by “MVP target reached distance”. Adapt this setting to your needs. Switch the module to hall sensor based commutation permanently in order to skip encoder initialization procedure in this configuration. Please be aware, that the hall sensor resolution is very low, when compared to an encoder, and thus, the PID regulator parameterization values have to be set much higher than the default setting. Without encoder, the velocity measurement is not available. You may want to set a lower value than the default for the “PWM Hysteresis” setting to get a softer response upon target reaching.
5.5 Stop switch
For positioning applications, typically some kind of global initialization is required. This can either be done via a central unit operating the motor via its bus interface, or a reference switch can be connected to the stop input (pull down to 0V at reference point). The position counter can be automatically cleared when this point is reached. Be careful not to apply a voltage different from GND to this digital input!
5.6 General Functions (explore using the Windows based
demo software)
The TMCM-171 module can either be remote controlled via the PC demonstration software or a user specific program. The function of the stand alone mode can be modified by the user by writing initialization values to the on-board EEPROM, e.g. a maximum rotation velocity, motor current limit and rotation direction. For more detailed software information refer to the TMCM-170 Module –
Reference and Programming Manual (see 7: References).
5.7 Temperature, Current and Voltage monitoring functions
Name LED / Output Action Meaning
PWR Power On At least +5V power supply
The current limit LED blinks upon under voltage switch off
Motor PWM is reduced due to exceeding the set motor current limit or overvoltage threshold is exceeded
The power stage on the module has exceeded a critical temperature of 85°C. (Pre-warning)
The power stage on the module has exceeded a critical temperature of 115°C. The motor becomes switched off, until temperature falls below 105°C. The measurement is correct to about +/-10°C
CL
TEMP
Current Limit Blink
Current Limit On / Flicker
Temperature
Warning
Temperature
Warning
Blink
On
Table 5.1: Temperature, Current and Voltage monitoring functions (LEDs)
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 18
5.8 Programmable motor current limit
The motor current limiting function is meant as a function for torque limiting, and for protection of motor, power supply and mechanical load.
Whenever the pre-programmed motor current is exceeded in a chopper cycle, the TMCM-171 calculates a reduced PWM value for the next chopper cycle. New values are calculated 1000 times a second. The response time of the current regulation can be set using the parameter “current regulation loop delay”:
A value of zero means, that in every 1kHz period, the current correction calculation is directly executed and the resulting PWM value is taken. A higher current loop delay acts like a filter for the current. The higher the delay value, the slower the current loop response time. A value of 10 (default) leads to a current regulation response time of about 10 ms for an 1/e response. On the mechanical side, a higher value simulates a higher dynamic mass of the motor.
The actual current regulation time may differ, depending on the PID settings.
Attention:
The unit has a short circuit protection circuit, which limits coil current to about 40A.
There is a number of aspects when using the current limiting function:
The current measurement is done at a point of the chopper cycle, where just one coil is switched
The current measurement can not detect currents below about 200-300mA. If the current limit is
The current limiting function is not meant as a protection against a hard short circuit.
The performance of the current limiting depends on the motor and on the commutation mode.
Operation of the current limiter and the PID regulator may result in instable behavior, if the
If the motor is blocked and the ramp generator is not stopped, the motor will speed up and try
Please refer to the programming manual for the required current settings.
Please be careful, when programming a high value into the current regulation loop delay
register: The motor current could reach a very high peak value upon mechanical blocking of the motor. The same goes for the motor current limit value: do not set higher than 16A if you are not sure about this. Please remark, that the current measurement gives different results in block and in sine commutation mode, due to the different driving scheme.
However, this function should not be relied on in normal operating conditions.
on. When using sine commutation, the effective motor current is calculated from a measurement of all three coils.
set to a too low value, the motor may operate spuriously or become continuously switched off.
The current limit should be programmed to a value high enough, in order to achieve good positioning and acceleration performance.
motor gets into a resonance area. Try adapting the current regulation loop delay parameter.
to catch up with the ramp generator position after removal of the blocking. To control this effect, you can set the parameter “Clear Target Distance” in order to stop the ramp generator, when the deviation between the positions become to large. The effect of this may look somehow weird if the user does not expect it.
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCM-171 Manual (V0.92 / Nov 7th, 2007) 19
6 Revision History
6.1 Documentation Revision
Version Date Author Description
0.90 22-Aug-07 HC Preliminary version
0.91 18-Okt-07 Dw div. tech data
0.92 07-Nov-07 Dw div. tech data + picture of module
Table 6.1: Documentation Revisions
6.2 Firmware Revision
Version Comment Description
0.90 Initial Version Attention: Use Documentation V0.90 or later for connector pinning!!!
0.92 First release Added encoder N-channel initialization
0.93 Added encoder N-channel for automatic correction and encoder error
flag
0.94 Allows specifying of CHA and CHB polarity for nulling of encoder –
uses higher bits of Encoder Null Polarity
1.00 Release 1.0 Added operation mode with hall sensors only.
1.01 Corrected RS485 behavior
1.02 Added stand alone mode feature
1.03 Fixed RS485 delay problem (master had to wait for timeout time before
sending new command), when multiple units share a bus
1.06 First version with Step-/Direction and with TMCL stand alone feature
Table 6.2: Firmware Revision
7 References
[TMCL] TMCL Manual, www.trinamic.com TMCM–17X Programming Reference and Programming Manual for TMCM-170 and TMCM-171,
www.trinamic.com
Table 7.1: References
Copyright © 2007, TRINAMIC Motion Control GmbH & Co. KG
TMCL
Reference and Programming
Manual
Version: 2.22
May 15th, 2008
Trinamic Motion Control GmbH & Co. KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
TMCL Reference Manual 2
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
Version
Date
Author
Comment
2.11
22-Dec-04
OK
Corrections for SCO/GCO/CCO, Code protection feature
2.12
21-Feb-05
OK
ASCII interface included
2.13
22-Mar-05
OK
Minor error corrections
2.14
3-Jun-05
OK
New features of TMCL V3.23 included
2.15
11-Nov-05
OK
TMCM-109 and TMCM-111 added
2.16
20-Dec-05
OK
Features of version TMCL V3.26 and V3.27 included
2.17
22-Jun-06
OK
Error with CCO command corrected
2.18
20-Nov-06
OK
GAP/GGP/GIO/SIO command descriptions extended
2.20
23-Aug-07
OK
Command 138 added, Chapter 8 added
2.21
5-Dec-07
OK
TMCL Debugger added
2.22
5-Jun-08
OK
MVP COORD with TMCM-61x and TMCM-34x added
Version
Contents
1 Introduction ................................................................................................................................................................... 5
2 Basic TMCL Concepts ................................................................................................................................................... 6
2.1 Binary command format ................................................................................................................................... 6
2.1.1 Checksum calculation .............................................................................................................................. 6
2.2 The reply format .................................................................................................................................................. 7
2.2.1 Status codes ............................................................................................................................................... 7
2.3 Stand-alone applications ................................................................................................................................... 7
2.4 TMCL command overview ................................................................................................................................. 7
2.4.1 Motion commands ................................................................................................................................... 7
2.4.2 Parameter commands.............................................................................................................................. 8
2.4.3 I/O port commands .................................................................................................................................. 8
2.4.4 Control commands ................................................................................................................................... 8
2.4.5 Calculation commands ............................................................................................................................ 9
2.5 The ASCII interface ............................................................................................................................................. 9
2.5.1 Format of the command line ................................................................................................................ 9
2.5.2 Format of a reply ...................................................................................................................................... 9
2.5.3 Commands that can be used in ASCII mode ................................................................................ 10
2.5.4 Configuring the ASCII interface ......................................................................................................... 10
3 TMCL Command Dictionary ...................................................................................................................................... 11
3.1 ROR – Rotate Right ........................................................................................................................................... 12
3.2 ROL – Rotate Left ............................................................................................................................................... 13
3.3 MST – Motor Stop ............................................................................................................................................. 14
3.4 MVP – Move to Position .................................................................................................................................. 15
3.5 SAP – Set Axis Parameter ............................................................................................................................... 17
3.6 GAP – Get Axis Parameter .............................................................................................................................. 18
3.7 STAP – Store Axis Parameter ......................................................................................................................... 19
3.8 RSAP – Restore Axis Parameter ..................................................................................................................... 20
3.9 SGP – Set Global Parameter ........................................................................................................................... 21
3.10 GGP – Get Global Parameter .......................................................................................................................... 22
3.11 STGP – Store Global Parameter ..................................................................................................................... 23
3.12 RSGP – Restore Global Parameter ................................................................................................................ 24
3.13 RFS – Reference Search ................................................................................................................................... 25
3.14 SIO – Set Output ............................................................................................................................................... 26
3.15 GIO – Get Input / Output ................................................................................................................................ 28
TMCL Reference Manual 3
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
3.16 CALC – Calculate ................................................................................................................................................ 30
3.17 COMP – Compare ............................................................................................................................................... 31
3.18 JC – Jump Conditional ..................................................................................................................................... 32
3.19 JA – Jump Always.............................................................................................................................................. 33
3.20 CSUB – Call Subroutine ................................................................................................................................... 34
3.21 RSUB – Return from Subroutine ................................................................................................................... 35
3.22 WAIT – Wait for an event to occur ............................................................................................................. 36
3.23 STOP – Stop TMCL program execution ....................................................................................................... 38
3.24 SAC – SPI Bus Access....................................................................................................................................... 39
3.25 SCO – Set Coordinate ....................................................................................................................................... 40
3.26 GCO – Get Coordinate ...................................................................................................................................... 41
3.27 CCO – Capture Coordinate .............................................................................................................................. 42
3.28 CALCX – Calculate using the X register ...................................................................................................... 43
3.29 AAP – Accumulator to Axis Parameter ........................................................................................................ 44
3.30 AGP – Accumulator to Global Parameter ................................................................................................... 45
3.31 CLE – Clear Error Flags ..................................................................................................................................... 46
3.32 User definable commands (UF0..UF7) .......................................................................................................... 47
3.33 Request target position reached event ...................................................................................................... 48
3.34 BIN – Return to Binary Mode ........................................................................................................................ 49
3.35 TMCL Control Functions ................................................................................................................................... 50
4 Axis Parameters .......................................................................................................................................................... 52
4.1 Basic axis parameters (all TMCL stepper motor modules except the TMCM-100 module and the Monopack
2) ............................................................................................................................................................................ 52
4.2 Advanced axis parameters (all TMCL stepper motor modules except the TMCM-100) .................. 53
4.3 Axis parameters on the TMCM-100 and on the Monopack 2................................................................ 56
5 Global Parameters ...................................................................................................................................................... 59
5.1 Bank 0 ................................................................................................................................................................... 59
5.2 Bank 1 ................................................................................................................................................................... 62
5.3 Bank 2 ................................................................................................................................................................... 63
6 Hints and Tips ............................................................................................................................................................. 64
6.1 Reference search with TMCM-3xx / 10x / 11x / 61x modules ................................................................ 64
6.2 Reference search with TMCM-100 modules ............................................................................................... 65
6.3 Using an incremental encoder with TMCM-100 modules ...................................................................... 65
6.3.1 Setting the resolution ........................................................................................................................... 65
6.3.2 Deviation detection ................................................................................................................................ 66
6.3.3 Position correction ................................................................................................................................. 66
6.4 Stall Detection (TMCL Version 3.06 or higher) .......................................................................................... 66
6.5 Fixing microstep errors (TMCL V3.13 or higher) ....................................................................................... 67
6.6 Using the RS485 interface ............................................................................................................................... 67
7 The TMCL IDE ............................................................................................................................................................... 68
7.1 Installation .......................................................................................................................................................... 68
7.2 Getting started ................................................................................................................................................... 69
7.3 The integrated editor ....................................................................................................................................... 69
7.4 The “File” menu ................................................................................................................................................. 69
7.4.1 New ............................................................................................................................................................. 69
7.4.2 Open ........................................................................................................................................................... 69
7.4.3 Save, Save as ........................................................................................................................................... 69
7.4.4 Save all ...................................................................................................................................................... 69
7.4.5 Close ........................................................................................................................................................... 69
7.4.6 Exit .............................................................................................................................................................. 69
7.5 The “TMCL” menu .............................................................................................................................................. 69
7.5.1 Basics.......................................................................................................................................................... 69
7.5.2 Direct mode .............................................................................................................................................. 70
7.5.3 Assemble a TMCL program .................................................................................................................. 70
7.5.4 Downloading the program .................................................................................................................. 71
TMCL Reference Manual 4
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
7.5.5 The “Main file” function ........................................................................................................................ 71
7.5.6 The “Start” function ............................................................................................................................... 71
7.5.7 The “Stop” function ................................................................................................................................ 71
7.5.8 The “Continue” function ....................................................................................................................... 71
7.5.9 Disassembling a TMCL program ......................................................................................................... 71
7.6 The “Setup” menu ............................................................................................................................................. 72
7.6.1 Options ...................................................................................................................................................... 72
7.6.2 Configure ................................................................................................................................................... 73
7.6.3 Search ......................................................................................................................................................... 76
7.6.4 Install OS .................................................................................................................................................. 76
7.6.5 StallGuard adjusting tool ..................................................................................................................... 77
7.6.6 StallGuard profiler .................................................................................................................................. 77
7.6.7 Parameter calculation tool ................................................................................................................... 78
7.7 The TMCL debugger .......................................................................................................................................... 79
7.7.1 Starting the debugger ........................................................................................................................... 79
7.7.2 Breakpoints ............................................................................................................................................... 79
7.7.3 The “Run / Continue” function............................................................................................................ 79
7.7.4 The “Pause” function ............................................................................................................................. 80
7.7.5 The “Step” function ................................................................................................................................ 80
7.7.6 The “Animate” function ........................................................................................................................ 80
7.7.7 The “Stop / Reset” function ................................................................................................................. 80
7.7.8 The “Direct Mode” function in the debugger ................................................................................. 80
7.8 The syntax of TMCL in the TMCL assembler .............................................................................................. 80
7.8.1 Assembler directives .............................................................................................................................. 80
7.8.2 Symbolic constants ................................................................................................................................ 81
7.8.3 Constant expressions ............................................................................................................................. 81
7.8.4 Labels ......................................................................................................................................................... 82
7.8.5 Comments ................................................................................................................................................. 82
7.8.6 TMCL Commands ..................................................................................................................................... 82
8 TMCL Programming Techniques ............................................................................................................................. 84
8.1 General structure of a TMCL program ......................................................................................................... 84
8.1.1 Initialization ............................................................................................................................................. 84
8.1.2 Main loop .................................................................................................................................................. 84
8.2 Using symbolic constants ............................................................................................................................... 84
8.3 Using variables................................................................................................................................................... 85
8.4 Using subroutines ............................................................................................................................................. 85
8.5 Mixing direct mode and stand alone mode .............................................................................................. 85
Copyright 2003 - 2008 by Trinamic Motion Control GmbH & Co KG, Germany All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Information given in this book is believed to be accurate and reliable. However no responsibility is assumed for the consequences of its use or for any infringement of patents or other rights of third parties which may result from its use. Specifications are subject to change without notice.
TMCL Reference Manual 5
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
1 Introduction
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 in an EEPROM on the TMCM module to form programs that run stand alone on a 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). So, TMCL forms a powerful language that can either be used to control a module directly from a host (direct mode) or to program applications that run on a stand-alone module (program mode or stand-alone mode). 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, whereas the mnemonic format is used for easy usage of the commands when developing stand-alone TMCL applications using the TMCL IDE (IDE means “Integrated Development Environment”). There is also a set of configuration variables for every 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. It also describes how to use the TMCL IDE.
TMCL Reference Manual 6
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
Bytes
Meaning
1
Module address
1
Command number
1
Type number
1
Motor or Bank number
4
Value (MSB first!)
1
Checksum
2 Basic TMCL Concepts
2.1 Binary command format
Every command has a mnemonic and a binary representation. 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 or RS485 interface, it has to be enclosed by an address byte at the beginning and a checksum byte at the end. So it then consists of nine bytes. This is not the case when communicating via the CAN bus as address and checksum are included in the CAN standard in do not have to be supplied by the user. When using a module with IIC interface the first byte (address byte) is left out because IIC has its own addressing scheme. So for IIC the telegram consists of eight bytes, starting with the command byte. So the binary command format when using RS232 or RS485 is as follows:
The checksum is calculated by adding up all the other bytes using an 8-bit addition. When using CAN bus, just leave out the first byte (module address) and the last byte (checksum). When using IIC, leave out the first byte.
2.1.1 Checksum calculation
As mentioned above, the checksum is calculated by adding up all bytes (including the module address byte) using 8-bit addition. Here are two examples to show how to do this:
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 it to the module
in Delphi:
var i, Checksum: byte; Command: array[0..8] of byte;
//Set the “Command” array to the desired command
//Calculate the Checksum: Checksum:=Command[0]; for i:=1 to 7 do Checksum:=Checksum+Command[i]; Command[8]:=Checksum; //Now, send the “Command” array (9 bytes) to the module
TMCL Reference Manual 7
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
Bytes
Meaning
1
Reply address
1
Module address
1
Status (e.g. 100 means “no error”)
1
Command number
4
Value (MSB first!)
1
Checksum
Code
Meaning
100
Successfully executed, no error
101
Command loaded into TMCL program EEPROM
1
Wrong checksum
2
Invalid command
3
Wrong type
4
Invalid value
5
Configuration EEPROM locked
6
Command not available
2.2 The reply format
Every time a command has been sent to a module, the module sends a reply. When using RS232 or RS485 the format of the reply is as follows:
The checksum is also 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. When using IIC bus the first byte (reply address) is left out. Do not send the next command before you have received the reply!
2.2.1 Status codes
The reply contains a status code. This status code can have one of the following values:
2.3 Stand-alone applications
When the module which is used is equipped with an EEPROM to store TMCL applications, the TMCL-IDE can be used to develop stand-alone TMCL applications that can be downloaded into the EEPROM of the module and then
run on the module. The TMCL IDE contains an editor and a “TMCL assembler” where the commands can be entered
using their mnemonic format and then assembled to their binary representations. This code can then be downloaded into the module to be executed there. The TMCL IDE is described in detail in chapter 7 of this manual.
2.4 TMCL command overview
In this section an overview of the TMCL commands is given. All commands are described in detail in chapter 3. Some TMCL programming techniques are given in chapter 8.
2.4.1 Motion commands
These commands control the motion of the motors. They are the most important commands and can be used in direct mode or in stand-alone mode.
TMCL Reference Manual 8
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
Mnemonic
Command number
Meaning
ROL
2
Rotate left
ROR
1
Rotate right
MVP
4
Move to position
MST
3
Motor stop
RFS
13
Reference search
SCO
30
Store coordinate
CCO
32
Capture coordinate
GCO
31
Get coordinate
Mnemonic
Command number
Meaning
SAP
5
Set axis parameter
GAP
6
Get axis parameter
STAP
7
Store axis parameter into EEPROM
RSAP
8
Restore axis parameter from EEPROM
SGP
9
Set global parameter
GGP
10
Get global parameter
STGP
11
Store global parameter into EEPROM
RSGP
12
Restore global parameter from EEPROM
Mnemonic
Command number
Meaning
SIO
14
Set output
GIO
15
Get input
SAC
29
Access to external SPI device
Mnemonic
Command number
Meaning
JA
22
Jump always
JC
21
Jump conditional
COMP
20
Compare accumulator with constant value
CLE
36
Clear error flags
CSUB
23
Call subroutine
RSUB
24
Return from subroutine
WAIT
27
Wait for a specified event
STOP
28
End of a TMCL program
2.4.2 Parameter commands
These commands are used to set, read and store axis parameters or global parameters. Axis parameters can be set independently for every axis, whereas global parameters control the behaviour of the module itself. These commands can also be used in direct mode and in stand-alone mode.
2.4.3 I/O port commands
These commands control the external I/O ports and can be used in direct mode and in stand-alone mode.
2.4.4 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 stand-alone mode only.
TMCL Reference Manual 9
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
Mnemonic
Command number
Meaning
CALC
19
Calculate using the accumulator and a constant value
CALCX
33
Calculate using the accumulator and the X register
AAP
34
Copy accumulator to an axis parameter
AGP
35
Copy accumulator to a global parameter
2.4.5 Calculation commands
These commands are intended to be used for calculations within TMCL applications. Although they could also be used in direct mode it does not make much sense to do so.
For calculating purposes there is an accumulator (or accu or A register) 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 doing calculations. It can be loaded from the accumulator. When a command that reads a value is executed in direct mode the accumulator will not be affected. This means that while a TMCL program is running on the module (stand-alone mode), a host can still send commands like GAP, GGP or GIO to the module (e.g. to query the actual position of the motor) without affecting the flow of the TMCL program running on the module.
2.5 The ASCII interface
Since TMCL V3.21 there is also an ASCII interface that can be used to communicate with the module and to send some commands as text strings. The ASCII command line interface is entered by sending the binary command 139 (enter ASCII mode). The commands are then entered as in the TMCL IDE, but not all commands can be entered in ASCII mode. Only those commands that can be used in direct mode can also be entered in ASCII mode.
To leave the ASCII mode and re-enter the binary mode enter the command “BIN”.
2.5.1 Format of the command line
As the first character, the address character has to be sent. The address character is “A” when the module address is 1, “B” for modules with address 2 and so on. After the address character there may be spaces (but this is not
necessary). Then, send the command with its parameters. At the end of a command line a <CR> character has to be sent. Here are some examples for valid command lines:
AMVP ABS, 1, 50000 A MVP ABS, 1, 50000 AROL 2, 500 A MST 1 ABIN
These command would all 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 return to binary mode.
2.5.2 Format of a reply
After executing the command the module sends back a reply in ASCII format. This reply consists of:
the address character of the host (host address that can be set in the module) the address character of the module the status code as a decimal number the return value of the command as a decimal number a <CR> character
TMCL Reference Manual 10
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
So, after sending AGAP 0, 1 the reply would be BA 100 –5000 if the actual position of axis 1 is –5000, the host address is set to 2 and the module address is 1. The value “100” is the status code 100 that means “command successfully executed”.
2.5.3 Commands that can be used in ASCII mode
The following commands can be used in ASCII mode: ROL, ROR, MST, MVP, SAP, GAP, STAP, RSAP, SGP, GGP, STGP, RSGP, RFS, SIO, GIO, SAC, SCO, GCO, CCO, UF0, UF1, UF2, UF3, UF4, UF5, UF6, UF7.
There are also special commands that are only available in ASCII mode:
BIN: This command quits ASCII mode and returns to binary TMCL mode. RUN: This command can be used to start a TMCL program in memory. STOP: Stops a running TMCL application.
2.5.4 Configuring the ASCII interface
The module can be configured so that it starts up either in binary mode or in ASCII mode. Global parameter 67 is used for this purpose (please see also chapter 5.1). Bit 0 determines the startup mode: if this bit is set, the module starts up in ASCII mode, else it will start up in binary mode (default). 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 addressed. Character can also be erased using the backspace character (press the backspace key in a terminal program). When bit 4 is set and bit 5 is clear the characters that are entered are not echoed back immediately but the entire line will be echoed back after the <CR> character has been sent. When bit 5 is set and bit 4 is clear there will be no echo, only the reply will be sent. This may be useful in RS485 systems.
TMCL Reference Manual 11
Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D – 20357 Hamburg, Germany
http://www.trinamic.com
3 TMCL Command Dictionary
This chapter describes all TMCL commands. The commands are sorted by their command numbers. For every command the mnemonic with its syntax and the binary representation are given. Ranges for the parameters are also given. They sometimes differ between the types of the modules. If this is the case, value ranges are given for every module. Last but not least some examples are given at the end of every command description. In the examples for the binary representation always RS232/RS485 communication (9 byte) format is used with module address 1 and host address 2. When using CAN bus communication just leave out the first and the last byte (as mentioned in chapter
2.1).
Loading...
+ 104 hidden pages