background image

PD42-1270 TMCL

Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02

4 / 91

1

Features

The PD42-1270 is a single axis controller/driver PANdrive™ for 2-phase bipolar stepper motors with state

of the art feature set. It is highly integrated, offers a convenient handling and can be used in many

decentralized applications. The PANdrive™ has been designed for coil currents up to 1A RMS and 24V

DC supply voltage. Three digital inputs can be configured as home and endstop switches or incremental

encoder inputs. With its high energy efficiency from TRINAMIC’s coolStep™ technology cost for power

consumption is kept down. The TMCL firmware allows for both standalone and direct mode operation.

Main characteristics

• Motion controller & stepper motor driver:

Hardware motion profile calculation in real-time

On the fly alteration of motion parameters (e.g. position, velocity, acceleration)

High performance microcontroller for overall system control and communication protocol

handling

Up to 256 microsteps per full step

High-efficient operation, low power dissipation

Dynamic current control

Integrated protection

stallGuard2™ feature for stall detection

coolStep™ feature for reduced power consumption and heat dissipation

stealthChop™ feature for quiet operation and smooth motion

dcStep™ feature for load dependent speed control

• Interfaces

CAN

Low-active enable pin

Three I/O modes:

* Incremental Encoder and Home Switch

* Home and Endstop Switches

* One analog and two digital inputs

Software

TMCL: remote controlled operation alone or during step/direction mode. PC-based application develop-

ment software TMCL-IDE available for free.

Electrical data

• Supply voltage: +6V and +24V nominal.

• Motor current: up to 1A RMS / 1.41A peak (programmable).

Please see also the separate Hardware Manual.

©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany

Terms of delivery and rights to technical change reserved.
Download newest version at

www.trinamic.com

Read entire documentation.

Содержание PD42-1270 TMCL

Страница 1: ...e the motor Features Single Axis Stepper motor control Supply voltage 24V DC TMCL Motion Contoller CAN dcStep Integrated sixPoint ramp motion controller stealthChop silent PWM mode spreadCycle smart m...

Страница 2: ...SGP Set Global Parameter 23 3 6 6 GGP Get Global Parameter 24 3 6 7 STGP Store Global Parameter 25 3 6 8 RSGP Restore Global Parameter 26 3 6 9 RFS Reference Search 27 3 6 10 GIO Get Input 29 3 6 11...

Страница 3: ...s and Structure 81 8 1 Initialization 81 8 2 Main Loop 81 8 3 Using Symbolic Constants 81 8 4 Using Variables 82 8 5 Using Subroutines 83 8 6 Combining Direct Mode and Standalone Mode 83 9 Figures Ind...

Страница 4: ...eration High performance microcontroller for overall system control and communication protocol handling Up to 256 microsteps per full step High e cient operation low power dissipation Dynamic current...

Страница 5: ...omatic current scaling based on the load measurement via stallGuard2 adapting the required current to the load Energy consumption can be reduced by as much as 75 coolStep allows substantial energy sav...

Страница 6: ...r the module while the TMCL IDE is running on your PC The module will be recognized by the TMCL IDE and necessary driver registrations in Windows will automatically done by the TMCL IDE 2 2 Using the...

Страница 7: ...6 microsteps 0 8 4 RWE 141 Microstep Interpolation Interpolation of the current microstep resolution to 256 microsteps 0 No interpolation 1 Interpolation to 256 microsteps 0 1 1 RWE 179 VSense Sense r...

Страница 8: ...Download from the TMCL menu in the TMCL creator to donwload the program to the module 3 Click the Run icon or choose Run from the TMCL menu in the TMCL creator to run the program on the module Also tr...

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

Страница 10: ...es including the module address byte using 8 bit addition Here are two examples which show how to do this Checksum calculation in C 1 unsigned char i Checksum unsigned char Command 9 3 Set the Command...

Страница 11: ...eply Note When using CAN interface the reply does not contain an address byte and a checksum byte With CAN the CAN ID is used as the reply address and the checksum is not needed because the CAN bus us...

Страница 12: ...e EEPROM and afterwards it will run on the module The TMCL IDE contains an editor and the TMCL assembler where the commands can be entered using their mnemonic format They will be assembled automatica...

Страница 13: ...ut mod ule speci c settings e g communica tion settings or TMCL user variables STGP 11 parameter bank number Store global parameter TMCL user variables only RSGP 12 parameter bank number Restore globa...

Страница 14: ...set independently for each axis whereas global parameters control the behavior of the module itself These commands can also be used in direct mode and in standalone mode Parameter Commands Mnemonic C...

Страница 15: ...hey could also be used in direct mode it does not make much sense to do so Calculation Commands Mnemonic Command number Meaning CALC 19 Calculate using the accumulator and a constant value CALCX 33 Ca...

Страница 16: ...a TMCL program is running on the module standalone mode a host can still send commands like GAP and GGP to the module e g to query the actual position of the motor without affecting the ow of the TMCL...

Страница 17: ...section 4 Internal function The speci ed value is written to the axis parameter speci ed by the parameter number Related commands GAP AAP Mnemonic SAP parameter number axis value Binary representatio...

Страница 18: ...can be used together with this command please refer to section 4 Internal function The speci ed value gets copied to the accumulator Related commands SAP AAP Mnemonic GAP parameter number axis Binary...

Страница 19: ...ction The axis parameter speci ed by the type and bank number will be stored in the EEPROM Related commands SAP AAP GAP RSAP Mnemonic STAP parameter number bank Binary Representation Instruction Type...

Страница 20: ...The axis parameter speci ed by the type and bank number will be restored from the EEPROM Related commands SAP AAP GAP RSAP Mnemonic RSAP parameter number bank Binary Representation Instruction Type M...

Страница 21: ...th parameters and values which can be used together with this command please refer to section 5 Internal function The speci ed value will be copied to the global parameter speci ed by the type and ban...

Страница 22: ...mmand please refer to section 5 Internal function The global parameter speci ed by the type and bank number will be copied to the accumulator register Related commands SGP AGP Mnemonic GGP parameter n...

Страница 23: ...ther with this command please refer to dection 5 2 Internal function The global parameter speci ed by the type and bank number will be stored in the EEPROM Related commands SGP AGP GGP RSGP Mnemonic S...

Страница 24: ...he global parameter speci ed by the type and bank number will be restored from the EEPROM Related commands SGP AGP GGP STGP Mnemonic RSGP parameter number bank Binary Representation Instruction Type M...

Страница 25: ...algorithm to meet your needs please see chapter 4 Internal function The internal reference search state machine is started or stoped or its state is queried Related commands SAP GAP WAIT Mnemonic RFS...

Страница 26: ...Target address 01h Instruction number 0Dh Type 00h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 0Eh 2017 TRINAMIC Motion Control GmbH Co KG Hamburg Germ...

Страница 27: ...r The actual status of a digital output line can also be read Internal function The state of the i o line speci ed by the type parameter and the bank parameter is read Related commands SIO Mnemonic GI...

Страница 28: ...1 REFL_ENCA Reference Left Switch Encoder A Input GIO 1 0 0 1 2 REFR_ENCB Reference Right Switch Encoder B Input GIO 2 0 0 1 3 Enable TMC5130 Enable Pin GIO 3 0 0 1 4 DIAG0 TMC5130 Diag 0 Output GIO...

Страница 29: ...monic CALC operation operand Binary representation Binary Representation Instruction Type Motor Bank Value 19 0 ADD add to accumulator 0 don t care operand 1 SUB subtract from accumulator 2 MUL multip...

Страница 30: ...e 2 FFh Value Byte 1 ECh Value Byte 0 78h Checksum 78h Reply Status no error value 5000 Field Value Host address 02h Target address 01h Status 64h Instruction 13h Value Byte 3 FFh Value Byte 2 FFh Val...

Страница 31: ...mmands JC GAP GGP GIO CALC CALCX Mnemonic COMP operand Binary Representation Instruction Type Motor Bank Value 20 0 don t care 0 don t care operand Example Jump to the address given by the label when...

Страница 32: ...AIT CLE Mnemonic JC condition label Binary Representation Instruction Type Motor Bank Value 21 0 ZE zero 0 don t care jump address 1 NZ not zero 2 EQ equal 3 NE not equal 4 GT greater 5 GE greater equ...

Страница 33: ...s 10 Field Value Target address 01h Instruction number 15h Type 05h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 0Ah Checksum 25h 2017 TRINAMIC Motion Control GmbH Co...

Страница 34: ...2 0 don t care 0 don t care jump address Example An in nite loop in TMCL 1 Loop MVP ABS 0 51200 3 WAIT POS 0 0 MVP ABS 0 0 5 WAIT POS 0 0 JA Loop Binary form of the JA Loop command when the label Loop...

Страница 35: ...Binary Representation Instruction Type Motor Bank Value 23 0 don t care 0 don t care subroutine address Example Call a subroutine Loop 2 MVP ABS 0 10000 CSUB SubW Save program counter and jump to labe...

Страница 36: ...tack is empty Related commands CSUB Mnemonic RSUB Binary Representation Instruction Type Motor Bank Value 24 0 don t care 0 don t care 0 don t care Example Please see the CSUB example section 3 6 15 B...

Страница 37: ...pecial case for the ticks parameter When this parameter is set to 1 the contents of the accumulator register will be taken for this value So for example WAIT TICKS 0 1 will wait as long as speci ed by...

Страница 38: ...0 0 Binary Form of WAIT POS 0 0 Field Value Target address 01h Instruction number 1Bh Type 01h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 1Dh 2017 TRIN...

Страница 39: ...e stopped Related commands none Mnemonic STOP Binary Representation Instruction Type Motor Bank Value 28 0 don t care 0 don t care 0 don t care Example Mnemonic STOP Binary Form of STOP Field Value Ta...

Страница 40: ...te number motor number position 0 20 0 231 231 1 Example Set coordinate 1 of motor 0 to 1000 Mnemonic SCO 1 0 1000 Binary Form of SCO 1 0 1000 Field Value Target address 01h Instruction number 1Eh Typ...

Страница 41: ...M only Internal function the desired value is read out of the internal coordinate array copied to the accumulator register and in direct mode returned in the value eld of the reply Related commands SC...

Страница 42: ...sing the following special forms of the GCO command GCO 0 255 0 copies all coordinates except coordinate number 0 from the EEPROM to the RAM GCO coordinate number 255 0 copies the coordinate selected...

Страница 43: ...of the selected motor is copied to selected coordinate array entry Related commands SCO GCO ACO MVP COORD Mnemonic CCO coordinate number motor number Binary Representation Instruction Type Motor Bank...

Страница 44: ...ed to selected coordinate array entry Related commands SCO GCO CO MVP COORD Mnemonic ACO coordinate number motor number Binary Representation Instruction Type Motor Bank Value 39 coordinate number mot...

Страница 45: ...Bank Value 33 0 ADD add X register to accumulator 0 don t care 0 don t care 1 SUB subtract X register from accumulator 2 MUL multiply accumulator by X register 3 DIV divide accumulator by X register 4...

Страница 46: ...Target address 01h Instruction number 21h Type 02h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 24h 2017 TRINAMIC Motion Control GmbH Co KG Hamburg Germ...

Страница 47: ...GIO GCO CALC CALCX Mnemonic AAP parameter number motor number Binary Representation Instruction Type Motor Bank Value 34 see chapter 4 0 value Reply in Direct Mode Status Value 100 OK don t care Exam...

Страница 48: ...d with this com mand please see section 5 Related commands AAP SGP GGP SAP GAP GIO Mnemonic AGP parameter number bank number Binary Representation Instruction Type Motor Bank Value 35 parameter number...

Страница 49: ...arm ag EDV clear the deviation ag EPO clear the position error ag Related commands JC WAIT Mnemonic CLE ags Binary Representation Instruction Type Motor Bank Value 36 0 ALL all ags 0 don t care 0 don...

Страница 50: ...Target address 01h Instruction number 24h Type 01h Motor Bank 00h Value Byte 3 00h Value Byte 2 00h Value Byte 1 00h Value Byte 0 00h Checksum 26h 2017 TRINAMIC Motion Control GmbH Co KG Hamburg Germa...

Страница 51: ...act the sales department of Trinamic Motion Control GmbH Co KG if you need a customized TMCL rmware Related commands none Mnemonic UF0 UF7 Binary Representation Instruction Type Motor Bank Value 64 71...

Страница 52: ...one would like to have a position reached message The value eld contains a bit mask where every bit stands for one motor For one motor modules like the PD42 1270 it only makes sense to have bit 0 set...

Страница 53: ...ecksum depends also on motor bit mask Additional Reply after Motor has reached Target Position Field Value Target address 01h Host address 02h Status 80h 128 Command 8Ah 138 Value Byte 3 00h Value Byt...

Страница 54: ...ype Value 128 stop application stop a running TMCL application 0 don t care 0 don t care 129 run application start or continue TMCL program execution 0 from current address 0 don t care 1 from speci c...

Страница 55: ...g format special reply or binary format 0 string format 1 binary format 0 don t care 137 restore factory settings Reset all settings in the EEPROM to their factory defaults This command does not send...

Страница 56: ...motor 4999999 4999999 pps 0 R 4 Maximum speed The maximum speed used for posi tioning ramps 0 4999999 pps 51200 RWE 5 Maximum acceleration Maximum acceleration in positioning ramps Acceleration and de...

Страница 57: ...o 0 turns off the rst acceleration deceleration phase maximum acceleration axis parameter 5 and maximum deceleration axis parameter 17 are used only 0 1000000 pps 2 RW 17 Maximum Deceleration Maximum...

Страница 58: ...op mode always uses the deceleration ramp settings DMAX V1 D1 VSTOP and TZEROWAIT for stop ping the motor 0 Hard stop 1 Soft stop 0 1 0 RW 27 High speed chopper mode Switch to other chopper mode when...

Страница 59: ...2 Freely usable debugging value 2147483648 2147483647 0 RW 153 debug value 3 Freely usable debugging value 2147483648 2147483647 0 RW 154 debug value 4 Freely usable debugging value 2147483648 214748...

Страница 60: ...ng please note that this value is an offset to the hysteresis end value For classic const off time chopper mode this parameter will set return the sine wave offset 0 8 0 RW 167 Chopper off time The of...

Страница 61: ...enable Enables the stallGuard2 lter for more precision of the movement If set reduces the measurement fre quency to one measurement per four fullsteps In most cases it is expedient to set the ltered m...

Страница 62: ...phase motor in order to avoid the occurrence of a beat especially at low velocities 0 chopper sync func tion chopSync off 1 15 chopper synchronization 0 15 0 RW 186 PWM threshold speed The stealthCho...

Страница 63: ...op switch from both sides 5 Search home switch in negative direction reverse the direction when left stop switch reached 6 Search home switch in positive di rection reverse the direction when right st...

Страница 64: ...ion error These error ags are cleared automat ically when this parameter has been read out or when a motion command has been executed 0 3 0 R 208 Drive Status Flags TMC5130 ags of register DRVSTA TUS...

Страница 65: ...e Units of velocity and acceleration de celeration settings 0 internal units of TMC5130 1 pps for velocity and pps s for ac celeration 0 1 1 RW Table 11 All PD42 1270 Axis 0 Parameters 2017 TRINAMIC M...

Страница 66: ...hanging these parameters and use the appropriate func tions of the TMCL IDE to do it in an interactive way Meaning of the Letters in the Access Column Access type Command Description R GGP Parameter r...

Страница 67: ...ates stored 0 1 0 RWA 85 Zero User Variables 0 user variables are restored 1 user variables are not restored 0 1 0 RWA 128 Application status Actual TMCL application status 0 stop 1 run 2 step 3 reset...

Страница 68: ...an be stored in the EEPROM Table 14 Meaning of the Letters in the Access Column User Variables in Bank 2 Number Global Parameter Description Range Units Access 0 55 user variables 0 55 TMCL user varia...

Страница 69: ...nput 3 Table 16 Pin Functionalities of PD42 1270 Speci c Modes In Mode Reference the three digital inputs correspond to reference switches Home Left Endstop and Rigth Endstop for GPI 1 2 and 3 respect...

Страница 70: ...direction setting the reference point to the center of the two switching points The speed used for this calibration is de ned by axis parameter 195 Axis parameter 193 de nes the reference search mode...

Страница 71: ...set axis parameter 193 to 66 to search the left end switch rst and then use the right end switch as the zero point left limit end stop switch L R right limit end stop switch start stop reference searc...

Страница 72: ...et axis parameter 193 to 68 to search the right end switch instead left limit end stop switch L R stop reference search speed axis parameter 194 reference switch speed axis parameter 195 start Figure...

Страница 73: ...e switch input L R right limit end stop switch reference search speed axis parameter 194 reference switch speed axis parameter 195 start stop home switch Figure 8 Reference search Mode 6 7 1 7 Mode 7...

Страница 74: ...mainly for use with a circular axis The exact middle of the switch will be found and used as the zero point Figure 10 illustrates this Add 128 to the mode number i e set axis parameter 193 to 132 to r...

Страница 75: ...This corresponds to a load angle of 90 between the magnetic eld of the stator and magnets in the rotor This also is the most energy e cient point of operation for the motor Stall detection means that...

Страница 76: ...s to be con gured using parameters I169 and I171 In this chapter only basic axis parameters are mentioned which concern coolStep and stallGuard2 The complete list of axis parameters in chapter 4 conta...

Страница 77: ...urements per decrement Scaling 0 3 32 8 2 1 0 slow decrement 3 fast decrement I171 smartEnergy current up step Sets the current increment step The current becomes incremented for each measured stallGu...

Страница 78: ...ne has to know the fullstep resolution of the motor full steps per round and the microstep resolution setting of the module axis parameter 140 default setting is 256 microsteps per full step So to con...

Страница 79: ...grams look like this 1 Initialization SAP 4 0 50000 define maximum positioning speed 3 SAP 5 0 10000 define maximum acceleration 5 MainLoop do something in this example just running between two positi...

Страница 80: ...ROM back to the user variable Global parameter 85 controls if user variables will be restored from the EEPROM automatically on startup default setting or not user variables will then be initialized wi...

Страница 81: ...an then change the value of a user variable using a direct mode SGP command which is regularly polled by the TMCL program e g in its main loop and so the TMCL program can react on such changes Vice ve...

Страница 82: ...n or a run command with address 1 to call the second function or a run command with address 2 to call the third function You can see the addresses of the TMCL labels that are needed for the run comman...

Страница 83: ...4 Reference search Mode 2 73 5 Reference search Mode 3 74 6 Reference search Mode 4 74 7 Reference search Mode 5 75 8 Reference search Mode 6 75 9 Reference search Mode 7 76 10 Reference search Mode...

Страница 84: ...7 11 All PD42 1270 Axis 0 Parameters 67 12 Meaning of the Letters in the Access Column 68 13 All Global Parameters of the PD42 1270 Module in Bank 0 69 14 Meaning of the Letters in the Access Column 7...

Страница 85: ...e in the document All trademarks and brand names used are property of their respective owners 11 4 Target User The documentation provided here is for programmers and engineers only who are equipped wi...

Страница 86: ...c written consent TRINAMIC products are not designed nor intended for use in military or aerospace applications or environ ments or in automotive applications unless speci cally designated for such u...

Страница 87: ...cription V0 8 2016 JUL 12 BS Exported from xml V0 9 2016 SEP 26 BS First complete version V1 00 2016 NOV 18 BS Final version with changes from Fw V1 0 Table 19 Document Revision 2017 TRINAMIC Motion C...

Отзывы: