Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
www.animatics.com
TM
DEVELOPER’S GUIDE FOR
CLASS 5 AND LATER SMARTMOTORS WITH COMBITRONIC™ TECHNOLOGY
DESCRIBES THE COMMANDS AND PROGRAMMING FOR CLASS 5 AND LATER SMARTMOTORS
FULLY INTEGRATED SERVO MOTORS
Rev. O, January 2021
Copyright Notice©2001–2021 Moog Inc.
Moog Animatics SmartMotor™ Developer's Guide, Rev. O, PN: SC80100003-002.
This manual, as well as the software described in it, is furnished under license and may be used orcopied only in accordance with the terms of such license. The content of this manual is furnished forinformational use only, is subject to change without notice and should not be construed as acommitment by Moog Inc., Animatics. Moog Inc., Animatics assumes no responsibility or liability forany errors or inaccuracies that may appear herein.
Except as permitted by such license, no part of this publication may be reproduced, stored in aretrieval system or transmitted, in any form or by any means, electronic, mechanical, recording, orotherwise, without the prior written permission of Moog Inc., Animatics.
The programs and code samples in this manual are provided for example purposes only. It is theuser's responsibility to decide if a particular code sample or program applies to the application beingdeveloped and to adjust the values to fit that application.
Moog Animatics and the Moog Animatics logo, SmartMotor and the SmartMotor logo, Combitronic andthe Combitronic logo, and SMI are all trademarks of Moog Inc., Animatics. Other trademarks are theproperty of their respective owners.
Please let us know if you find any errors or omissions in this manual so that we can improve it forfuture readers. Such notifications should contain the words "Developer's Guide" in the subject line andbe sent by e-mail to: [email protected]. Thank you in advance for your contribution.
Contact Us:
Americas - WestMoog Animatics2581 Leghorn StreetMountain View, CA 94043USA
Americas - EastMoog Animatics1995 NC Hwy 141Murphy, NC 28906USA
Tel: 1 650-960-4215 Tel: 1 828-837-5115Fax: 1 540-557-6509
Support: 1 888-356-0357
Website: www.animatics.com
Email: [email protected]
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 3 of 948
Table Of Contents
Introduction 27Overview 28
Combitronic Support 28
Combitronic with the DS2020 Combitronic System 29
Communication Lockup Wizard 30
Safety Information 30
Safety Symbols 30
Other Safety Considerations 30
Motor Sizing 31
Environmental Considerations 31
Machine Safety 31
Documentation and Training 32
Additional Equipment and Considerations 32
Safety Information Resources 32
Additional Documents 34
Related Guides 34
Other Documents 34
Additional Resources 35
Part 1: Programming the SmartMotor 36Beginning Programming 45
Setting the Motor Firmware Version 46
Setting the Default Firmware Version 46
Checking the Default Firmware Version 47
Opening the SMI Window (Program Editor) 47
Understanding the Program Requirements 48
Creating a "Hello World" Program 49
Entering the Program in the SMI Editor 49
Adding Comments to the Code 50
Checking the Program Syntax 50
Saving the Program 50
Downloading a Program to the SmartMotor 50
Syntax Checking, Compiling and Downloading the Program 51
Additional Notes on Downloaded Programs 51
Running a Downloaded Program 52
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 4 of 948
Using the Program Download Window 53
Using the Terminal Window and Run Program Button 53
Using the RUN Command in the Terminal Window 53
Creating a Simple Motion Program 54
SMI Software Features 55
Introduction 56
Menu Bar 57
Toolbar 57
Configuration Window 59
Terminal Window 62
Initiating Motion from the Terminal Window 64
Information Window 64
Program Editor 65
Motor View 67
SMI Trace Functions 68
Monitor Window 71
Serial Data Analyzer 73
Chart View 74
Chart View Example 75
Macros (Keyboard Shortcuts or Hotkeys) 78
Tuner 80
SMI Options 84
SMI Help 85
Context-Sensitive Help Using F1 85
Context-Sensitive Help Using the Mouse 85
Help Buttons 85
Hover Help 85
Table of Contents 85
Projects 86
SmartMotor Playground 87
Opening the SmartMotor Playground 88
Moving the Motor 89
Communication Details 91
Introduction 93
Connecting to a Host 94
Daisy Chaining Multiple D-Style SmartMotors over RS-232 95
ADDR=formula 97
SLEEP, SLEEP1 97
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 5 of 948
WAKE, WAKE1 97
ECHO, ECHO1 98
ECHO_OFF, ECHO_OFF1 98
Serial Commands 99
OCHN(type,channel,parity,bit rate,stop bits,data bits,mode,timeout) 99
CCHN(type,channel) 100
BAUDrate, BAUD(channel)=formula 100
PRINT(), PRINT1() 100
SILENT, SILENT1 101
TALK, TALK1 101
a=CHN(channel) 101
a=ADDR 101
Communicating over RS-485 102
Using Data Mode 102
CAN Communications 105
CADDR=formula 105
CBAUD=formula 105
=CAN, =CAN(arg) 105
CANCTL(function,value) 105
SDORD(...) 106
SDOWR(...) 106
NMT 107
RB(2,4), x=B(2,4) 107
Exceptions to NMT, SDORD and SDOWR Commands 107
I/O Device CAN Bus Master 108
Combitronic Communications 109
Combitronic Features 110
Other Combitronic Benefits 110
Program Loops with Combitronic 110
Global Combitronic Transmissions 111
Simplify Machine Support 111
Combitronic with RS-232 Interface 111
Combitronic with the DS2020 Combitronic System 112
Other CAN Protocols 114
CANopen - CAN Bus Protocol 114
DeviceNet - CAN Bus Protocol 114
I²C Communications (D-Style Motors) 114
OCHN(IIC,1,N,baud,1,8,D) 116
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 6 of 948
CCHN(IIC,1) 116
PRINT1(arg1,arg2, … ,arg_n) 116
RGETCHR1, Var=GETCHR1 116
RLEN1, Var=LEN1 116
Motion Details 117
Introduction 118
Motion Command Quick Reference 119
Basic Motion Commands 120
Target Commands 120
PT=formula 120
PRT=formula 121
ADT=formula 121
AT=formula 121
DT=formula 121
VT=formula 121
Motion Mode Commands 122
MP 122
MV 122
MT 122
Torque Commands 123
TS=formula 123
T=formula 123
Brake Commands 123
BRKRLS 123
BRKENG 123
BRKSRV 124
BRKTRJ 124
Brake Command Examples 124
EOBK(IO) 125
MTB 126
Index Capture Commands 126
DS2020 Combitronic System Index Capture 127
Other Motion Commands 128
G 128
S 128
X 128
O=formula 128
OSH=formula 129
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 7 of 948
OFF 129
SCALEA(m,d), SCALEP(m,d), SCALEV(m,d) 129
Commutation Modes 130
MDT 130
MDE 130
MDS 130
MDC 131
MDB 131
MINV(0), MINV(1) 131
Modes of Operation 132
Torque Mode 132
Torque Mode Example 132
Dynamically Change from Velocity Mode to Torque Mode 132
Velocity Mode 133
Constant Velocity Example 133
Change Commanded Speed and Acceleration 133
Absolute (Position) Mode 134
Absolute Move Example 134
Two Moves with Delay Example 134
Change Speed and Acceleration Example 134
Shift Point of Origin Example 135
Relative Position Mode 135
Relative Mode Example 135
Follow Mode with Ratio (Electronic Gearing) 136
Electronic Gearing and Camming over CANopen 136
Electronic Gearing Commands 136
SRC(enc_src) 137
MFR 137
MSR 137
MF0 137
MS0 137
MFMUL=formula, MFDIV=formula 137
MFA(distance[,m/s]) 138
MFD(distance[,m/s]) 138
MFSLEW(distance[,m/s]) 138
Follow Internal Clock Source Example 138
Follow Incoming Encoder Signal With Ramps Example 139
Electronic Line Shaft 140
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 8 of 948
ENCD(in_out) 141
Spooling and Winding Overview 142
Relative Position, Auto-Traverse Spool Winding 142
MFSDC(distance,mode) 143
Dedicated, Absolute Position, Winding Traverse Commands 145
MFSDC(distance,2) 146
MFLTP=formula 146
MFHTP=formula 146
MFCTP(arg1,arg2) 146
MFL(distance[,m/s]) 147
MFH(distance[,m/s]) 147
ECS(counts) 147
Single Trajectory Example Program 148
Chevron Wrap Example 149
Other Traverse Mode Notes 151
Traverse Mode Status Bits 152
Cam Mode (Electronic Camming) 152
Electronic Camming Details 155
Understanding the Inputs 155
Should I choose Source Counts or Intermediate Counts? 156
Should I choose Variable or Fixed cam? 156
Electronic Camming Notes and Best Practices 158
Examples 160
Electronic Gearing and Camming over CANopen 160
Electronic Camming Commands 161
CTE(table) 161
CTA(points,seglen[,location]) 161
CTW(pos[,seglen][,user]) 161
MCE(arg) 162
MCW(table,point) 162
RCP 162
RCTT 163
MC 163
MCMUL=formula 163
MCDIV=formula 163
O(arg)=formula 163
OSH(arg)=formula 163
Cam Example Program 164
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 9 of 948
Mode Switch Example 167
Position Counters 169
Modulo Position 170
Modulo Position Commands 170
Dual Trajectories 171
Commands That Read Trajectory Information 173
Dual Trajectory Example Program 174
Synchronized Motion 175
Synchronized-Target Commands 175
PTS(), PRTS() 175
VTS=formula 176
ADTS=formula, ATS=formula, DTS=formula 176
PTSS(), PRTSS() 176
A Note About PTS and PTSS 177
Other Synchronized-Motion Commands 178
GS 178
TSWAIT 178
Program Flow Details 180
Introduction 181
Flow Commands 181
RUN 181
RUN? 182
GOTO#, GOTO(label), C# 182
GOSUB#, GOSUB(label), RETURN 183
IF, ENDIF 183
ELSE, ELSEIF 184
WHILE, LOOP 184
SWITCH, CASE, DEFAULT, BREAK, ENDS 185
TWAIT 185
WAIT=formula 186
STACK 186
END 186
Program Flow Examples 188
IF, ELSEIF, ELSE, ENDIF Examples 188
WHILE, LOOP Examples 188
GOTO(), GOSUB() Examples 189
SWITCH, CASE, BREAK, ENDS Examples 190
Interrupt Programming 191
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 10 of 948
ITR(), ITRE, ITRD, EITR(), DITR(), RETURNI 191
TMR(timer,time) 193
Variables and Math 194
Introduction 195
Variable Commands 195
EPTR=formula 195
VST(variable,number) 195
VLD(variable,number) 196
Math Expressions 196
Math Operations 196
Logical Operations 196
Integer Operations 196
Floating Point Functions 196
Math Operation Details and Examples 197
Array Variables 197
Array Variable Examples 198
Error and Fault Handling Details 199
Motion and Motor Faults 200
Overview 200
Drive Stage Indications and Faults 200
Fault Bits 200
Error Handling 201
Example Fault-Handler Code 201
PAUSE 202
RESUME 202
Limits and Fault Handling 203
Position Error Limits 203
dE/dt Limits 203
Velocity Limits 204
Hardware Limits 204
Software Limits 204
Fault Handling 205
Monitoring the SmartMotor Status 206
System Status 209
Introduction 210
Retrieving and Manipulating Status Words/Bits 210
System and Motor Status Bits 210
Reset Error Flags 213
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 11 of 948
System Status Examples 213
Timer Status Bits 214
Interrupt Status Bits 214
I/O Status 215
User Status Bits 215
Multiple Trajectory Support Status Bits 216
Cam Status Bits 217
Interpolation Status Bits 218
Motion Mode Status 218
RMODE, RMODE(arg) 218
I/O Control Details 219
I/O Port Hardware 220
I/O Connections Example (D-Style Motors) 221
I/O Voltage Spikes 221
Discrete Input and Output Commands 222
Discrete Input Commands 222
Discrete Output Commands 222
Output Condition and Fault Status Commands 223
Output Condition Commands 223
Output Fault Status Reports 223
General-Use Input Configuration 224
Multiple I/O Functions Example 224
Analog Functions of I/O Ports 226
5 Volt Push-Pull I/O Analog Functions (Class 5 D-Style Motors) 226
24 Volt I/O Analog Functions (Class 5 D-Style AD1 Option Motors, Class 5 M-Style Motors) 226
24 Volt I/O Analog Functions (Class 6 M-Style Motors) 226
Special Functions of I/O Ports 228
Class 5 D-Style Motors: Special Functions of I/O Ports 229
I/O Ports 0 and 1 – External Encoder Function Commands 229
I/O Ports 2 and 3 – Travel Limit Inputs 229
I/O Ports 4 and 5 – Communications 229
I/O Port 6 – Go Command, Encoder Index Capture Input 230
Class 5 M-Style Motors: Special Functions of I/O Ports 231
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes 231
I/O Ports 2 and 3 – Travel Limit Inputs 231
I/O Port 5 – Encoder Index Capture Input 231
I/O Port 6 – Go Command 232
Class 6 M-Style Motors: Special Functions of I/O Ports 233
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 12 of 948
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes 233
I/O Ports 2 and 3 – Travel Limit Inputs 233
I/O Port 4 and 5 – Encoder Index Capture Input 233
I/O Port 6 – Go Command 234
I/O Brake Output Commands 234
I²C Expansion (D-Style Motors) 234
Tuning and PID Control 235
Introduction 236
Tuning and PID Control on the DS2020 Combitronic System 236
Understanding the PID Control 236
Tuning the PID Control 237
Using F 238
Setting KP 238
Setting KD 238
Setting KI and KL 239
Setting EL=formula 239
Other PID Tuning Parameters 239
KG=formula 240
KV=formula 240
KA=formula 240
Current Limit Control 241
AMPS=formula 241
Part 2: SmartMotor Command Reference 242(Single Space Character) 243
a...z 244
aa...zz 244
aaa...zzz 244
Ra...Rz 244
Raa...Rzz 244
Raaa...Rzzz 244
ab[index]=formula 247
Rab[index] 247
ABS(value) 250
RABS(value) 250
AC 251
RAC 251
ACOS(value) 254
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 13 of 948
RACOS(value) 254
ADDR=formula 256
RADDR 256
ADT=formula 258
ADTS=formula 260
af[index]=formula 262
Raf[index] 262
Ai(arg) 265
Aij(arg) 267
Aj(arg) 269
Aji(arg) 271
al[index]=formula 273
Ral[index] 273
AMPS=formula 276
RAMPS 276
ASIN(value) 279
RASIN(value) 279
AT=formula 281
RAT 281
ATAN(value) 284
RATAN(value) 284
ATOF(index) 286
RATOF(index) 286
ATS=formula 287
aw[index]=formula 289
Raw[index] 289
B(word,bit) 292
RB(word,bit) 292
Ba 296
RBa 296
BAUD(channel)=formula 298
RBAUD(channel) 298
Be 300
RBe 300
Bh 302
RBh 302
Bi(enc) 304
RBi(enc); supports the DS2020 Combitronic system over RS-232 only 304
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 14 of 948
Bj(enc) 307
RBj(enc) 307
Bk 310
RBk 310
Bl 311
RBl 311
Bls 313
RBls 313
Bm 315
RBm 315
Bms 317
RBms 317
Bo 319
RBo 319
Bp 320
RBp 320
Bps 322
RBps 322
Br 324
RBr 324
BREAK 326
BRKENG 328
BRKRLS 330
BRKSRV 332
BRKTRJ 334
Brs 336
RBrs 336
Bs 338
RBs 338
Bt 340
RBt 340
Bv 342
RBv 342
Bw 344
RBw 344
Bx(enc) 346
RBx(enc) 346
C{number} 348
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 15 of 948
CADDR=formula 350
RCADDR 350
CAN, CAN(arg) 352
RCAN, RCAN(arg) 352
CANCTL(function,value) 354
CASE formula 355
CBAUD=formula 358
RCBAUD 358
CCHN(type,channel) 360
CHN(channel) 361
RCHN(channel) 361
CLK=formula 363
RCLK 363
COMCTL(function,value) 364
COS(value) 366
RCOS(value) 366
CP 368
RCP 368
CTA(points,seglen[,location]) 370
CTE(table) 372
CTR(enc) 374
RCTR(enc) 374
CTT 376
RCTT 376
CTW(pos[,seglen][,user]) 377
DEA 380
RDEA 380
DEFAULT 382
DEL=formula 384
RDEL 384
DELM(arg) 386
DFS(value) 387
RDFS(value) 387
DITR(int) 388
DT=formula 390
RDT 390
DTS=formula 393
EA 395
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 16 of 948
REA 395
ECHO 397
ECHO0 399
ECHO1 400
ECHO_OFF 401
ECHO_OFF0 402
ECHO_OFF1 403
ECS(counts) 404
EIGN(...) 406
EILN 409
EILP 411
EIRE 413
EIRI 415
EISM(x) 417
EITR(int) 418
EL=formula 420
REL 420
ELSE 422
ELSEIF formula 424
ENC0 426
ENC1 427
ENCCTL(function,value) 429
ENCD(in_out) 431
END 433
ENDIF 435
ENDS 437
EOBK(IO) 439
EOFT(IO) 441
EOIDX(number) 443
EPTR=formula 444
REPTR 444
ERRC 445
RERRC 445
ERRW 447
RERRW 447
ETH(arg) 449
RETH(arg) 449
ETHCTL(function,value) 450
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 17 of 948
F 451
FAUSTS(x) 453
FD=expression 455
FABS(value) 457
RFABS(value) 457
FSA(cause,action) 459
FSAD(n,m) 461
FSQRT(value) 463
RFSQRT(value) 463
FW 465
RFW 465
G 467
GETCHR 470
RGETCHR 470
GETCHR1 472
RGETCHR1 472
GOSUB(label) 474
GOTO(label) 476
GROUP(function,value) 478
GS 481
HEX(index) 483
RHEX(index) 483
I(enc) 485
RI(enc); supports the DS2020 Combitronic system over RS-232 only 485
IDENT=formula 487
RIDENT 487
IF formula 489
IN(...) 492
RIN(...) 492
INA(...) 495
RINA(...) 495
IPCTL(function,"string") 498
ITR(Int#,StatusWord,Bit#,BitState,Label#) 500
ITRD 503
ITRE 505
J(enc) 507
RJ(enc) 507
KA=formula 509
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 18 of 948
RKA 509
KD=formula 511
RKD 511
KG=formula 513
RKG 513
KI=formula 515
RKI 515
KII=formula 517
RKII 517
KL=formula 518
RKL 518
KP=formula 520
RKP 520
KPI=formula 522
RKPI 522
KS=formula 523
RKS 523
KV=formula 525
RKV 525
LEN 527
RLEN 527
LEN1 528
RLEN1 528
LFS(value) 530
RLFS(value) 530
LOAD 531
LOCKP 534
LOOP 536
MC 538
MCDIV=formula 540
RMCDIV 540
MCE(arg) 541
MCMUL=formula 543
RMCMUL 543
MCW(table,point) 545
MDB 547
MDC 549
MDE 551
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 19 of 948
MDH 553
MDHV 555
MDS 557
MDT 559
MF0 561
MFA(distance[,m/s]) 563
MFCTP(arg1,arg2) 566
MFD(distance[,m/s]) 568
MFDIV=formula 571
MFH(distance[,m/s]) 573
MFHTP=formula 575
MFL(distance[,m/s]) 577
MFLTP=formula 579
MFMUL=formula 581
MFR 583
MFSDC(distance,mode) 586
MFSLEW(distance[,m/s]) 588
MINV(arg) 590
MODE 592
RMODE 592
MP 595
MS0 598
MSR 600
MT 602
MTB 604
MV 606
NMT 608
N/A 608
O=formula, O(trj#)=formula 610
OC(...) 612
ROC(...) 612
OCHN(...) 614
OF(...) 616
ROF(...) 616
OFF 618
OR(value) 620
OS(...) 622
OSH=formula, OSH(trj#)=formula 624
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 20 of 948
OUT(...)=formula 626
PA 628
RPA 628
PAUSE 630
PC, PC(axis) 632
RPC, RPC(axis) 632
PI 635
RPI 635
PID# 636
PMA 639
RPMA 639
PML=formula 641
RPML 641
PMT=formula 643
RPMT 643
PRA 645
RPRA 645
PRC 648
RPRC 648
PRINT(...) 651
PRINT0(...) 655
PRINT1(...) 659
PRINT8(...) 662
PRT=formula 665
RPRT 665
PRTS(...) 667
PRTSS(...) 669
PT=formula 671
RPT 671
PTS(...) 673
PTSD 676
RPTSD 676
PTSS(...) 677
PTST 679
RPTST 679
RANDOM=formula 680
RRANDOM 680
RCKS 682
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 21 of 948
RES 683
RRES 683
RESUME 685
RETURN 687
RETURNI 689
RSP 691
RSP1 693
RSP5 694
RUN 695
RUN? 697
S (as command) 699
SADDR# 701
SAMP 703
RSAMP 703
SCALEA(m,d) 705
SCALEP(m,d) 707
SCALEV(m,d) 709
SDORD(...) 711
RSDORD 711
SDOWR(...) 713
SILENT 715
SILENT1 717
SIN(value) 719
RSIN(value) 719
SLD 721
SLE 723
SLEEP 725
SLEEP1 727
SLM(mode) 729
RSLM 729
SLN=formula 731
RSLN 731
SLP=formula 733
RSLP 733
SNAME("string") 735
SP2 736
RSP2 736
SP6 737
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 22 of 948
RSP6 737
SQRT(value) 738
RSQRT(value) 738
SRC(enc_src) 740
STACK 742
STDOUT=formula 745
SWITCH formula 747
T=formula 750
RT 750
TALK 752
TALK1 754
TAN(value) 756
RTAN(value) 756
TEMP, TEMP(arg) 758
RTEMP, RTEMP(arg) 758
TH=formula 760
RTH 760
TMR(timer,time) 763
RTMR(timer) 763
TRQ 765
RTRQ 765
TS=formula 767
RTS 767
TSWAIT 769
TWAIT(gen#) 770
UIA 772
RUIA 772
UJA 774
RUJA 774
UO(...)=formula 776
UP 778
UPLOAD 780
UR(...) 782
US(...) 784
USB(arg) 786
RUSB 786
VA 788
RVA 788
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 23 of 948
VAC(arg) 791
VC 796
RVC 796
VL=formula 799
RVL 799
VLD(variable,number) 801
VST(variable,number) 805
VT=formula 809
RVT 809
VTS=formula 812
W(word) 814
RW(word) 814
WAIT=formula 816
WAKE 818
WAKE1 820
WHILE formula 822
X 825
Z 827
Z(word,bit) 829
Za 831
Ze 832
Zh 833
Zl 834
Zls 835
Zr 836
Zrs 837
Zs 838
ZS 839
Zv 841
Zw 842
Part 3: Example SmartMotor Programs 843Move Back and Forth 844
Move Back and Forth with Watch 844
Home Against a Hard Stop (Basic) 845
Home Against a Hard Stop (Advanced) 845
Home Against a Hard Stop (Two Motors) 846
Home to Index Using Different Modes 848
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 24 of 948
Maintain Velocity During Analog Drift 849
Long-Term Storage of Variables 850
Find Errors and Print Them 850
Change Speed on Digital Input 851
Pulse Output on a Given Position 851
Stop Motion if Voltage Drops 852
Camming - Variable Cam Example 853
Camming - Fixed Cam with Input Variables 854
Camming - Demo XY Circle 856
Chevron Traverse & Takeup 858
CAN Bus - Timed SDO Poll 860
CAN Bus - I/O Block with PDO Poll 861
CAN Bus - Time Sync Follow Encoder 864
Text Replacement in an SMI Program 872
Appendix 874Motion Command Quick Reference 876
Array Variable Memory Map 878
ASCII Character Set 880
Binary Data 881
Commands Affected by SCALE 884
Command Error Codes 887
Decoding the Error 887
Finding the Error Source 888
Glossary 889
Math Operators 896
Moment of Inertia 897
Matching Motor to Load 897
Improving the Moment of Inertia Ratio 897
RCAN, RCHN and RMODE Status 898
RCAN Status Decoder 898
RCHN Status Decoder 898
Clearing Serial Port Errors 898
RMODE Status Decoder 899
Mode Status Example 899
Scale Factor Calculation 900
Sample Rates 900
PID Sample Rate Command 900
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 25 of 948
Encoder Resolution and the RES Parameter 900
Native Velocity and Acceleration Units 901
Velocity Calculations 901
Acceleration Calculations 901
Status Words - SmartMotor 902
Status Word: 0 Primary Fault/Status Indicator 902
Status Word: 1 Index Registration and Software Travel Limits 903
Status Word: 2 Communications, Program and Memory 903
Status Word: 3 PID State, Brake, Move Generation Indicators 904
Status Word: 4 Interrupt Timers 904
Status Word: 5 Interrupt Status Indicators 905
Status Word: 6 Drive Modes 905
Status Word 7: Multiple Trajectory Support 906
Status Word 8: Cam Support 907
Status Word 9: SD Card Information 907
Status Word 10: RxPDO Arrival Notification 907
Status Word 12: User Bits Word 0 908
Status Word 13: User Bits Word 1 908
Status Word: 16 On Board Local I/O Status: D-Style Motor 909
Status Word: 16 On Board Local I/O Status: M-Style Class 5 Motor 909
Status Word: 16 On Board Local I/O Status: Class 6 Motor 910
Status Word: 17 Expanded I/O Status: D-Style AD1 Motor 910
Fault and Status Words - DS2020 Combitronic System 911
Fault Words 911
Fault Tables 911
Fault Word 0 912
Fault Word 1 912
Fault Word 2 913
Status Words 913
Status Word 0: Primary Fault/Status Indicator 913
Status Word 1: Current CiA DS402 State 914
Status Word 2: Control and Hardware Faults 914
Status Word 3: Position/Velocity sensor and Brake Feedback Faults 914
Status Word 4: Communication Faults 915
Status Word 5: Software and Memory Faults 915
Status Word 6: I/O States 916
Torque Curves 917
Understanding Torque Curves 917
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 26 of 948
Peak Torque 917
Continuous Torque 917
Ambient Temperature Effects on Torque Curves and Motor Response: 918
Supply Voltage Effects on Torque Curves and Motor Response: 918
Example 1: Rotary Application 919
Example 2: Linear Application 919
Dyno Test Data vs. the Derated Torque Curve 919
Proper Sizing and Loading of the SmartMotor 920
SmartMotor Troubleshooting 922
Troubleshooting - First Steps 922
Commands Listed Alphabetically 925
Commands Listed by Function 933Communications Control 934
Data Conversion 935
EEPROM (Nonvolatile Memory) 935
I/O Control 935
Math Function 936
Motion Control 936
Program Access 939
Program Execution and Flow Control 939
Reset Commands 940
System 940
Variables 941
Commands for Combitronic 942
Commands for DS2020 Combitronic 946
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 27 of 948
IntroductionThis chapter provides introductory reference material.
Overview 28
Combitronic Support 28
Communication Lockup Wizard 30
Safety Information 30
Additional Documents 34
Additional Resources 35
Introduction
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 28 of 948
OverviewThe SmartMotor™ Developer's Guide is designed to be used by system developers and programmerswhen developing applications for the SmartMotor. Before using the SmartMotor™ Developer's Guide, itis strongly recommended that you first read the SmartMotor™ Installation & Startup Guide for yourSmartMotor, which describes how to install and start up the SmartMotor, and test initialcommunications with the motor. After that, use this guide to learn about advanced SmartMotorfeatures, how to develop SmartMotor applications, and the details of each command.
Part One of this guide provides information on basic to advanced programming, along with relatedinformation on key SMI software features, communications, motion control, program flow control, errorand fault handling, and more.
Part Two of this guide lists all the SmartMotor commands in alphabetical order. Each command isdescribed in detail. Code snippets and examples are provided where applicable. These are shown in aCourier font. Comments are included and separated with a single quotation mark as they would be inyour own programs.
NOTE: The programs and code samples in this manual are provided for example purposes only. It isthe user's responsibility to decide if a particular code sample or program applies to theapplication being developed and to adjust the values to fit that application.
Also, where appropriate, a Related Commands section is included, which is located at the end of thecommand page. It is designed to guide you to other commands that offer similar functionality, andensure you are aware of every programming option the SmartMotor provides to address your specificapplication requirements.
Part Three of this guide provides a library of useful example SmartMotor programs. These can be usedas "how to" examples for using a particular SmartMotor feature or solving a particular applicationproblem, or as starting points for your application.
NOTE: The programs and code samples in this manual are provided for example purposes only. It isthe user's responsibility to decide if a particular code sample or program applies to theapplication being developed and to adjust the values to fit that application.
The Appendix of this guide contains additional topics such as an array map, ASCII character set,command error codes, and other information that is useful to have handy during applicationdevelopment.
A quick-reference command list is also included at the end of this guide.
Combitronic SupportNOTE: For the Class 6 SmartMotor, Combitronic communication is currently available only on -EIPoption motors. For details, see the Class 6 SmartMotor™ EtherNet/IP Guide.
A large number of the commands provide Combitronic™ support. Combitronic is a protocol thatoperates over a standard "CAN" (Controller Area Network) interface. It may coexist with eitherCANopen or DeviceNet protocols at the same time. Unlike these common protocols, however,Combitronic requires no single dedicated master to operate. Each Integrated Servo connected to thesame network communicates on an equal footing, sharing all information, and therefore, sharing allprocessing resources. For more details on Combitronic features, see Combitronic Communications onpage 109, and also see the overview on the Moog Animatics website at:https://www.animatics.com/support/combitronic.html.
For applicable commands, a table row titled "COMBITRONIC:" provides the Combitronic commandsyntax for addressing a specific SmartMotor in the network. Those commands also display theCombitronic logo ( ) at the top of their reference pages.
Introduction: Overview
https://www.animatics.com/support/combitronic.html
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 29 of 948
Combitronic Logo Location
COMBITRONIC: Table Row
Combitronic with the DS2020 Combitronic SystemThe Moog Animatics DS2020 Combitronic system is a cabinet mount servo drive connected to a MoogCompact Dynamic brushless servo motor. Compared to the smaller 17 to 34 frame SmartMotorproducts, the DS2020 Combitronic system provides access to a higher torque motor-drivecombination, with torque range and power inputs to include AC mains voltages and motors above 1KW. However, similar to other SmartMotor products, the DS2020 Combitronic system has thecapability of responding to Combitronic commands.
The DS2020 Combitronic system is not fully programmable but is connected as a slave to aSmartMotor master. The DS2020 Combitronic system has a CAN address, which you can set throughSMI along with baud rates as you would with any SmartMotor. It is then commanded by theSmartMotor through Combitronic communications using standard Combitronic syntax, e.g.,ADT:3=1234, where "3" is the CAN address of the DS2020 Combitronic system.
The DS2020 Combitronic system supports a subset of the full AniBasic command set. Supportedcommands are primarily Combitronic type, but there are a few others, also. The DS2020 Combitronicsystem supported commands are flagged with "; supports the DS2020 Combitronic system" text onthe command's APPLICATION line or READ/REPORT line.
NOTE: DS2020 support requires: SmartMotor ver 5.0.4.55 (D-series), 5.98.4.55 (M-series); DS2020ver ds2020_sa_1.0.0_combican or later.
For a list of DS2020 Combitronic system supported commands, see Commands for DS2020Combitronic on page 946
For details on the DS2020 Combitronic system installation and startup, see the DS2020 CombitronicInstallation and Startup Guide.
Introduction: Combitronic with the DS2020 Combitronic System
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 30 of 948
Communication Lockup WizardImproper use of some commands, like Z and OCHN, can lock you out of the motor and prevent furthercommunication. If you are unable to communicate with the SmartMotor, you may be able to recovercommunications using the Communication Lockup Wizard, which is on the SMI softwareCommunications menu (see the following figure). This tool sends an "E" character to the motor atstartup, which prevents the motor from running its program. For more details on the CommunicationLockup Wizard, see the SMI software online help, which is accessed by pressing the F1 key orselecting Help from the SMI software main menu.
Communication Menu - Communication Lockup Wizard
Safety InformationThis section describes the safety symbols and other safety information.
Safety SymbolsThe manual may use one or more of the following safety symbols:
WARNING: This symbol indicates a potentially nonlethal mechanical hazard,where failure to follow the instructions could result in serious injury to theoperator or major damage to the equipment.
CAUTION: This symbol indicates a potentially minor hazard, where failure tofollow the instructions could result in slight injury to the operator or minor damageto the equipment.
NOTE: Notes are used to emphasize non-safety concepts or related information.
Other Safety ConsiderationsThe Moog Animatics SmartMotors are supplied as components that are intended for use in anautomated machine or system. As such, it is beyond the scope of this manual to attempt to cover allthe safety standards and considerations that are part of the overall machine/system design andmanufacturing safety. Therefore, the following information is intended to be used only as a generalguideline for the machine/system designer.
It is the responsibility of the machine/system designer to perform a thorough "Risk Assessment" andto ensure that the machine/system and its safeguards comply with the safety standards specified bythe governing authority (for example, ISO, OSHA, UL, etc.) for the locale where the machine is beinginstalled and operated. For more details, see Machine Safety on page 31.
Introduction: Communication Lockup Wizard
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 31 of 948
Motor Sizing
It is the responsibility of the machine/system designer to select SmartMotors that are properly sizedfor the specific application. Undersized motors may: perform poorly, cause excessive downtime orcause unsafe operating conditions by not being able to handle the loads placed on them. The SystemBest Practices document, which is available on the Moog Animatics website, contains information andequations that can be used for selecting the appropriate motor for the application.
Replacement motors must have the same specifications and firmware version used in the approvedand validated system. Specification changes or firmware upgrades require the approval of the systemdesigner and may require another Risk Assessment.
Environmental Considerations
It is the responsibility of the machine/system designer to evaluate the intended operating environmentfor dust, high-humidity or presence of water (for example, a food-processing environment that requireswater or steam wash down of equipment), corrosives or chemicals that may come in contact with themachine, etc. Moog Animatics manufactures specialized IP-rated motors for operating in extremeconditions. For details, see the Moog Animatics Product Catalog.
Machine Safety
In order to protect personnel from any safety hazards in the machine or system, the machine/systembuilder must perform a "Risk Assessment", which is often based on the ISO 13849 standard. Thedesign/implementation of barriers, emergency stop (E-stop) mechanisms and other safeguards will bedriven by the Risk Assessment and the safety standards specified by the governing authority (forexample, ISO, OSHA, UL, etc.) for the locale where the machine is being installed and operated. Themethodology and details of such an assessment are beyond the scope of this manual. However, thereare various sources of Risk Assessment information available in print and on the internet.
NOTE: The following list is an example of items that would be evaluated when performing the RiskAssessment. Additional items may be required. The safeguards must ensure the safety of allpersonnel who may come in contact with or be in the vicinity of the machine.
In general, the machine/system safeguards must:
l Provide a barrier to prevent unauthorized entry or access to the machine or system. The barriermust be designed so that personnel cannot reach into any identified danger zones.
l Position the control panel so that it is outside the barrier area but located for an unrestrictedview of the moving mechanism. The control panel must include an E-stop mechanism. Buttonsthat start the machine must be protected from accidental activation.
l Provide E-stop mechanisms located at the control panel and at other points around theperimeter of the barrier that will stop all machine movement when tripped.
l Provide appropriate sensors and interlocks on gates or other points of entry into the protectedzone that will stop all machine movement when tripped.
l Ensure that if a portable control/programming device is supplied (for example, a hand-heldoperator/programmer pendant), the device is equipped with an E-stop mechanism.
NOTE: A portable operation/programming device requires many additional system designconsiderations and safeguards beyond those listed in this section. For details, see thesafety standards specified by the governing authority (for example, ISO, OSHA, UL, etc.) forthe locale where the machine is being installed and operated.
l Prevent contact with moving mechanisms (for example, arms, gears, belts, pulleys, tooling, etc.).
Introduction: Motor Sizing
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 32 of 948
l Prevent contact with a part that is thrown from the machine tooling or other part-handlingequipment.
l Prevent contact with any electrical, hydraulic, pneumatic, thermal, chemical or other hazardsthat may be present at the machine.
l Prevent unauthorized access to wiring and power-supply cabinets, electrical boxes, etc.
l Provide a proper control system, program logic and error checking to ensure the safety of allpersonnel and equipment (for example, to prevent a run-away condition). The control systemmust be designed so that it does not automatically restart the machine/system after a powerfailure.
l Prevent unauthorized access or changes to the control system or software.
Documentation and Training
It is the responsibility of the machine/system designer to provide documentation on safety, operation,maintenance and programming, along with training for all machine operators, maintenance technicians,programmers, and other personnel who may have access to the machine. This documentation mustinclude proper lockout/tagout procedures for maintenance and programming operations.
It is the responsibility of the operating company to ensure that:
l All operators, maintenance technicians, programmers and other personnel are tested andqualified before acquiring access to the machine or system.
l The above personnel perform their assigned functions in a responsible and safe manner tocomply with the procedures in the supplied documentation and the company safety practices.
l The equipment is maintained as described in the documentation and training supplied by themachine/system designer.
Additional Equipment and Considerations
The Risk Assessment and the operating company's standard safety policies will dictate the need foradditional equipment. In general, it is the responsibility of the operating company to ensure that:
l Unauthorized access to the machine is prevented at all times.
l The personnel are supplied with the proper equipment for the environment and their jobfunctions, which may include: safety glasses, hearing protection, safety footwear, smocks oraprons, gloves, hard hats and other protective gear.
l The work area is equipped with proper safety equipment such as first aid equipment, firesuppression equipment, emergency eye wash and full-body wash stations, etc.
l There are no modifications made to the machine or system without proper engineeringevaluation for design, safety, reliability, etc., and a Risk Assessment.
Safety Information ResourcesAdditional SmartMotor safety information can be found on the Moog Animatics website; open thetopic "Controls - Notes and Cautions" located at:
https://www.animatics.com/support/downloads/knowledgebase/controls---notes-and-cautions.html
OSHA standards information can be found at:
https://www.osha.gov/law-regs.html
Introduction: Documentation and Training
https://www.animatics.com/support/downloads/knowledgebase/controls---notes-and-cautions.htmlhttps://www.osha.gov/law-regs.html
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 33 of 948
ANSI-RIA robotic safety information can be found at:
http://www.robotics.org/robotic-content.cfm/Robotics/Safety-Compliance/id/23
UL standards information can be found at:
http://ulstandards.ul.com/standards-catalog/
ISO standards information can be found at:
http://www.iso.org/iso/home/standards.htm
EU standards information can be found at:
http://ec.europa.eu/growth/single-market/european-standards/harmonised-standards/index_en.htm
Introduction: Safety Information Resources
http://www.robotics.org/robotic-content.cfm/Robotics/Safety-Compliance/id/23http://ulstandards.ul.com/standards-catalog/http://www.iso.org/iso/home/standards.htmhttp://ec.europa.eu/growth/single-market/european-standards/harmonised-standards/index_en.htm
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 34 of 948
Additional DocumentsThe Moog Animatics website contains additional documents that are related to the information in thismanual. Please refer to the following list.
Related Guidesl Moog Animatics SmartMotor™ Installation & Startup Guides
http://www.animatics.com/install-guides
l SmartMotor™ System Best Practices
http://www.animatics.com/system-best-practices-application-note
Other Documentsl SmartMotor™ Certifications
https://www.animatics.com/certifications.html
l SmartMotor Developer's Worksheet(interactive tools to assist developer: Scale Factor Calculator, Status Words, CAN Port Status,Serial Port Status, RMODE Decoder and Syntax Error Codes)
https://www.animatics.com/support/downloads.knowledgebase.html
l Moog Animatics Product Catalog
http://www.animatics.com/support/moog-animatics-catalog.html
Introduction: Additional Documents
http://www.animatics.com/install-guideshttp://www.animatics.com/system-best-practices-application-notehttps://www.animatics.com/certifications.htmlhttps://www.animatics.com/support/downloads.knowledgebase.htmlhttp://www.animatics.com/support/moog-animatics-catalog.html
Introduction
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 35 of 948
Additional ResourcesThe Moog Animatics website contains useful resources such as product information, documentation,product support and more. Please refer to the following addresses:
l General company information:
http://www.animatics.com
l Product information:
http://www.animatics.com/products.html
l Product support (Downloads, How To videos, Forums, Knowledge Base, and FAQs):
http://www.animatics.com/support.html
l Contact information, distributor locator tool, inquiries:
https://www.animatics.com/contact-us.html
l Application ideas (including videos and sample programs):
http://www.animatics.com/applications.html
Introduction: Additional Resources
http://www.animatics.com/http://www.animatics.com/products.htmlhttp://www.animatics.com/support.htmlhttps://www.animatics.com/contact-us.htmlhttp://www.animatics.com/applications.html
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 36 of 948
Part 1: Programming the SmartMotor
Part 1 of this guide provides information on programming, SMI software features, communications,variables, error and fault handling, I/O control, and other details required for system and applicationdevelopment.
Beginning Programming 45
Setting the Motor Firmware Version 46
Setting the Default Firmware Version 46
Checking the Default Firmware Version 47
Opening the SMI Window (Program Editor) 47
Understanding the Program Requirements 48
Creating a "Hello World" Program 49
Entering the Program in the SMI Editor 49
Adding Comments to the Code 50
Checking the Program Syntax 50
Saving the Program 50
Downloading a Program to the SmartMotor 50
Syntax Checking, Compiling and Downloading the Program 51
Additional Notes on Downloaded Programs 51
Running a Downloaded Program 52
Using the Program Download Window 53
Using the Terminal Window and Run Program Button 53
Using the RUN Command in the Terminal Window 53
Creating a Simple Motion Program 54
SMI Software Features 55
Introduction 56
Menu Bar 57
Toolbar 57
Configuration Window 59
Terminal Window 62
Initiating Motion from the Terminal Window 64
Information Window 64
Program Editor 65
Motor View 67
SMI Trace Functions 68
Monitor Window 71
Serial Data Analyzer 73
Chart View 74
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 37 of 948
Chart View Example 75
Macros (Keyboard Shortcuts or Hotkeys) 78
Tuner 80
SMI Options 84
SMI Help 85
Context-Sensitive Help Using F1 85
Context-Sensitive Help Using the Mouse 85
Help Buttons 85
Hover Help 85
Table of Contents 85
Projects 86
SmartMotor Playground 87
Opening the SmartMotor Playground 88
Moving the Motor 89
Communication Details 91
Introduction 93
Connecting to a Host 94
Daisy Chaining Multiple D-Style SmartMotors over RS-232 95
ADDR=formula 97
SLEEP, SLEEP1 97
WAKE, WAKE1 97
ECHO, ECHO1 98
ECHO_OFF, ECHO_OFF1 98
Serial Commands 99
OCHN(type,channel,parity,bit rate,stop bits,data bits,mode,timeout) 99
CCHN(type,channel) 100
BAUDrate, BAUD(channel)=formula 100
PRINT(), PRINT1() 100
SILENT, SILENT1 101
TALK, TALK1 101
a=CHN(channel) 101
a=ADDR 101
Communicating over RS-485 102
Using Data Mode 102
CAN Communications 105
CADDR=formula 105
CBAUD=formula 105
=CAN, =CAN(arg) 105
CANCTL(function,value) 105
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 38 of 948
SDORD(...) 106
SDOWR(...) 106
NMT 107
RB(2,4), x=B(2,4) 107
Exceptions to NMT, SDORD and SDOWR Commands 107
I/O Device CAN Bus Master 108
Combitronic Communications 109
Combitronic Features 110
Other Combitronic Benefits 110
Program Loops with Combitronic 110
Global Combitronic Transmissions 111
Simplify Machine Support 111
Combitronic with RS-232 Interface 111
Combitronic with the DS2020 Combitronic System 112
Other CAN Protocols 114
CANopen - CAN Bus Protocol 114
DeviceNet - CAN Bus Protocol 114
I²C Communications (D-Style Motors) 114
OCHN(IIC,1,N,baud,1,8,D) 116
CCHN(IIC,1) 116
PRINT1(arg1,arg2, … ,arg_n) 116
RGETCHR1, Var=GETCHR1 116
RLEN1, Var=LEN1 116
Motion Details 117
Introduction 118
Motion Command Quick Reference 119
Basic Motion Commands 120
Target Commands 120
PT=formula 120
PRT=formula 121
ADT=formula 121
AT=formula 121
DT=formula 121
VT=formula 121
Motion Mode Commands 122
MP 122
MV 122
MT 122
Torque Commands 123
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 39 of 948
TS=formula 123
T=formula 123
Brake Commands 123
BRKRLS 123
BRKENG 123
BRKSRV 124
BRKTRJ 124
Brake Command Examples 124
EOBK(IO) 125
MTB 126
Index Capture Commands 126
DS2020 Combitronic System Index Capture 127
Other Motion Commands 128
G 128
S 128
X 128
O=formula 128
OSH=formula 129
OFF 129
SCALEA(m,d), SCALEP(m,d), SCALEV(m,d) 129
Commutation Modes 130
MDT 130
MDE 130
MDS 130
MDC 131
MDB 131
MINV(0), MINV(1) 131
Modes of Operation 132
Torque Mode 132
Torque Mode Example 132
Dynamically Change from Velocity Mode to Torque Mode 132
Velocity Mode 133
Constant Velocity Example 133
Change Commanded Speed and Acceleration 133
Absolute (Position) Mode 134
Absolute Move Example 134
Two Moves with Delay Example 134
Change Speed and Acceleration Example 134
Shift Point of Origin Example 135
Relative Position Mode 135
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 40 of 948
Relative Mode Example 135
Follow Mode with Ratio (Electronic Gearing) 136
Electronic Gearing and Camming over CANopen 136
Electronic Gearing Commands 136
SRC(enc_src) 137
MFR 137
MSR 137
MF0 137
MS0 137
MFMUL=formula, MFDIV=formula 137
MFA(distance[,m/s]) 138
MFD(distance[,m/s]) 138
MFSLEW(distance[,m/s]) 138
Follow Internal Clock Source Example 138
Follow Incoming Encoder Signal With Ramps Example 139
Electronic Line Shaft 140
ENCD(in_out) 141
Spooling and Winding Overview 142
Relative Position, Auto-Traverse Spool Winding 142
MFSDC(distance,mode) 143
Dedicated, Absolute Position, Winding Traverse Commands 145
MFSDC(distance,2) 146
MFLTP=formula 146
MFHTP=formula 146
MFCTP(arg1,arg2) 146
MFL(distance[,m/s]) 147
MFH(distance[,m/s]) 147
ECS(counts) 147
Single Trajectory Example Program 148
Chevron Wrap Example 149
Other Traverse Mode Notes 151
Traverse Mode Status Bits 152
Cam Mode (Electronic Camming) 152
Electronic Camming Details 155
Understanding the Inputs 155
Should I choose Source Counts or Intermediate Counts? 156
Should I choose Variable or Fixed cam? 156
Electronic Camming Notes and Best Practices 158
Examples 160
Electronic Gearing and Camming over CANopen 160
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 41 of 948
Electronic Camming Commands 161
CTE(table) 161
CTA(points,seglen[,location]) 161
CTW(pos[,seglen][,user]) 161
MCE(arg) 162
MCW(table,point) 162
RCP 162
RCTT 163
MC 163
MCMUL=formula 163
MCDIV=formula 163
O(arg)=formula 163
OSH(arg)=formula 163
Cam Example Program 164
Mode Switch Example 167
Position Counters 169
Modulo Position 170
Modulo Position Commands 170
Dual Trajectories 171
Commands That Read Trajectory Information 173
Dual Trajectory Example Program 174
Synchronized Motion 175
Synchronized-Target Commands 175
PTS(), PRTS() 175
VTS=formula 176
ADTS=formula, ATS=formula, DTS=formula 176
PTSS(), PRTSS() 176
A Note About PTS and PTSS 177
Other Synchronized-Motion Commands 178
GS 178
TSWAIT 178
Program Flow Details 180
Introduction 181
Flow Commands 181
RUN 181
RUN? 182
GOTO#, GOTO(label), C# 182
GOSUB#, GOSUB(label), RETURN 183
IF, ENDIF 183
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 42 of 948
ELSE, ELSEIF 184
WHILE, LOOP 184
SWITCH, CASE, DEFAULT, BREAK, ENDS 185
TWAIT 185
WAIT=formula 186
STACK 186
END 186
Program Flow Examples 188
IF, ELSEIF, ELSE, ENDIF Examples 188
WHILE, LOOP Examples 188
GOTO(), GOSUB() Examples 189
SWITCH, CASE, BREAK, ENDS Examples 190
Interrupt Programming 191
ITR(), ITRE, ITRD, EITR(), DITR(), RETURNI 191
TMR(timer,time) 193
Variables and Math 194
Introduction 195
Variable Commands 195
EPTR=formula 195
VST(variable,number) 195
VLD(variable,number) 196
Math Expressions 196
Math Operations 196
Logical Operations 196
Integer Operations 196
Floating Point Functions 196
Math Operation Details and Examples 197
Array Variables 197
Array Variable Examples 198
Error and Fault Handling Details 199
Motion and Motor Faults 200
Overview 200
Drive Stage Indications and Faults 200
Fault Bits 200
Error Handling 201
Example Fault-Handler Code 201
PAUSE 202
RESUME 202
Limits and Fault Handling 203
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 43 of 948
Position Error Limits 203
dE/dt Limits 203
Velocity Limits 204
Hardware Limits 204
Software Limits 204
Fault Handling 205
Monitoring the SmartMotor Status 206
System Status 209
Introduction 210
Retrieving and Manipulating Status Words/Bits 210
System and Motor Status Bits 210
Reset Error Flags 213
System Status Examples 213
Timer Status Bits 214
Interrupt Status Bits 214
I/O Status 215
User Status Bits 215
Multiple Trajectory Support Status Bits 216
Cam Status Bits 217
Interpolation Status Bits 218
Motion Mode Status 218
RMODE, RMODE(arg) 218
I/O Control Details 219
I/O Port Hardware 220
I/O Connections Example (D-Style Motors) 221
I/O Voltage Spikes 221
Discrete Input and Output Commands 222
Discrete Input Commands 222
Discrete Output Commands 222
Output Condition and Fault Status Commands 223
Output Condition Commands 223
Output Fault Status Reports 223
General-Use Input Configuration 224
Multiple I/O Functions Example 224
Analog Functions of I/O Ports 226
5 Volt Push-Pull I/O Analog Functions (Class 5 D-Style Motors) 226
24 Volt I/O Analog Functions (Class 5 D-Style AD1 Option Motors, Class 5 M-Style Motors) 226
24 Volt I/O Analog Functions (Class 6 M-Style Motors) 226
Special Functions of I/O Ports 228
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 44 of 948
Class 5 D-Style Motors: Special Functions of I/O Ports 229
I/O Ports 0 and 1 – External Encoder Function Commands 229
I/O Ports 2 and 3 – Travel Limit Inputs 229
I/O Ports 4 and 5 – Communications 229
I/O Port 6 – Go Command, Encoder Index Capture Input 230
Class 5 M-Style Motors: Special Functions of I/O Ports 231
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes 231
I/O Ports 2 and 3 – Travel Limit Inputs 231
I/O Port 5 – Encoder Index Capture Input 231
I/O Port 6 – Go Command 232
Class 6 M-Style Motors: Special Functions of I/O Ports 233
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes 233
I/O Ports 2 and 3 – Travel Limit Inputs 233
I/O Port 4 and 5 – Encoder Index Capture Input 233
I/O Port 6 – Go Command 234
I/O Brake Output Commands 234
I²C Expansion (D-Style Motors) 234
Tuning and PID Control 235
Introduction 236
Tuning and PID Control on the DS2020 Combitronic System 236
Understanding the PID Control 236
Tuning the PID Control 237
Using F 238
Setting KP 238
Setting KD 238
Setting KI and KL 239
Setting EL=formula 239
Other PID Tuning Parameters 239
KG=formula 240
KV=formula 240
KA=formula 240
Current Limit Control 241
AMPS=formula 241
Part 1: Programming the SmartMotor
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 45 of 948
Beginning ProgrammingThis chapter provides information on beginning programming with the SmartMotor. It introduces you tousing the SMI™ Program Editor, understanding program requirements, creating a program, downloadingthe program and then running it in the SmartMotor. It concludes with a sample for creating your firstmotion program.
Setting the Motor Firmware Version 46
Setting the Default Firmware Version 46
Checking the Default Firmware Version 47
Opening the SMI Window (Program Editor) 47
Understanding the Program Requirements 48
Creating a "Hello World" Program 49
Entering the Program in the SMI Editor 49
Adding Comments to the Code 50
Checking the Program Syntax 50
Saving the Program 50
Downloading a Program to the SmartMotor 50
Syntax Checking, Compiling and Downloading the Program 51
Additional Notes on Downloaded Programs 51
Running a Downloaded Program 52
Using the Program Download Window 53
Using the Terminal Window and Run Program Button 53
Using the RUN Command in the Terminal Window 53
Creating a Simple Motion Program 54
Part 1: Programming: Beginning Programming
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 46 of 948
Setting the Motor Firmware VersionNOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
When programming the SmartMotor, it is important that the SMI software compiler's firmware versionsetting matches the firmware version of the connected SmartMotor.
CAUTION: The compiler's firmware version must match the firmware version ofthe connected motor. If it does not match, the SMI software may not catch syntaxerrors and may download incompatible code to the SmartMotor.
This procedure assumes that:
l The SmartMotor is connected to the computer. For details, see Connecting the System in theSmartMotor Installation & Startup Guide for your motor.
l The SmartMotor is connected to a power source. (Certain models of SmartMotors requireseparate control and drive power.) For details, see Understanding the Power Requirements inthe SmartMotor Installation & Startup Guide for your motor.
l The SMI software has been installed and is running on the computer. For details, see Installingthe SMI Software in the SmartMotor Installation & Startup Guide for your motor.
Setting the Default Firmware Version
To set the default firmware version, from the SMI software main menu, select:
Compile > Compiler default firmware version
Setting the Compiler’s Default Firmware Version
Part 1: Programming: Setting the Motor Firmware Version
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 47 of 948
From the list, select the firmware version that most closely matches the firmware version of theconnected SmartMotor, as shown in the previous figure. After the default firmware version has beenselected, the list closes.
Checking the Default Firmware Version
To check the default firmware version, from the SMI software main menu, select:
Compile > Compiler default firmware version
On the list, locate the blue dot to the left of the firmware version number. The dot indicates thecurrently-selected default firmware version.
Opening the SMI Window (Program Editor)NOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
In addition to taking commands over the serial interface, the SmartMotor can run programs. The SMIwindow is used to write and edit user programs for the SmartMotor(s). After the program has beenwritten, it can be checked and then downloaded to the desired SmartMotor(s).
The SMI window is typically closed (default setting) when the SMI software is opened. To open thewindow, click the New button ( ) on the toolbar, or select:
File > New
SMI Window
After the SMI window opens, you can type your program directly into the editor, or you can copy andpaste existing code from any text-based software such as Windows Notepad.
NOTE: Some word-processing software, such as Microsoft Word, has an option for "smart quotes",which use angled single (ˊ) and double (˝) quotation marks . The angled quotation marks are not
Part 1: Programming: Checking the Default Firmware Version
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 48 of 948
recognized by the SMI editor. Therefore, any "smart quotes" option must be disabled beforecopying and pasting the program code.
Understanding the Program RequirementsSmartMotors use a simple form of code called "AniBasic", which is similar to the BASIC programminglanguage. Various commands include means to create continuous loops, jump to different locations ongiven conditions and perform general math functions.
Note the following AniBasic program requirements:
l The code is case sensitive:
l All commands begin with or use all UPPER CASE letters.
l All variables are preassigned and must use lower case.
l Command names are reserved and cannot be used as variables.
l A space is a programming element.
l Comments require an apostrophe or ASCII character 39 (') between the commands and thecomment text.
NOTE: When copying and pasting code from another text editor, make sure that your texteditor is not inserting "smart quotes" (angled single or double quotation marks). These arenot the same as ASCII characters 39 (') and 34 ("), and the SMI program editor doesn'trecognize them.
l Each program must contain at least one occurrence of the END statement.
l Each subroutine call must have a label with a RETURN statement somewhere below it.
l Each Interrupt subroutine must end with the RETURNI statement.
l The default syntax colors for the SMI editor are: commands (blue), program flow controls (pink),and comments (green). All other program text is shown in black. You can change the syntaxcolors through the Editor tab in the Options window. For details on the Options window, seeSMI Options on page 84.
l There is no syntax checking performed until you do one of the following:
l From the main menu, select Compile > Scan file for errors
l Select the Scan File for Errors button on the toolbar
l Press Ctrl+F7
l As in BASIC, you can use the PRINT command to print to the screen, as shown in the "HelloWorld" example. For details, see Creating a "Hello World" Program on page 49.
Part 1: Programming: Understanding the Program Requirements
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 49 of 948
l When the SmartMotor power is turned on, there is a 500 ms "pause" before any program orcommand is processed:
l For all industrial networks, every node (or motor) must immediately send out a "Who amI?" info data packet when power is turned on, which tells the network host who it'stalking to. This is a requirement for all industrial communications protocols (likeCANopen, DeviceNet and PROFIBUS).
l The stored program does not execute until the 500 ms pause expires. Any serialcommands sent during that time are buffered and then accepted after that pause expires.Because incoming commands take priority over the internal program, any bufferedcommands are executed before the internal program begins.
l Commands coming in over the network have priority over the program running within theSmartMotor. For example, while a program is running, you could issue a GOSUB command fromthe terminal and send the program off to run the specified subroutine. When the subroutine isdone, the program would resume at the point where the GOSUB command was issued.
l The RUN? command can be used at the beginning of a program to prevent it from automaticallyrunning when the SmartMotor power is turned on, as shown in the "Hello World" example. Fordetails, see Creating a "Hello World" Program on page 49.
l The SmartMotor will not execute any code past the RUN? line until it receives a RUNcommand through the serial port.
l Using the serial port, the motor can be commanded to run subroutines even if the storedprogram is not running.
Creating a "Hello World" ProgramThis procedure describes how to create and save a simple "Hello World" program.
NOTE: When copying and pasting code from another text editor, make sure that your text editor isnot inserting "smart quotes" (angled single or double quotation marks). These are not the same asASCII characters 39 (') and 34 ("), and the SMI program editor doesn't recognize them.
Entering the Program in the SMI Editor
To create the program, type the following code into the SMI software program editor:
RUN?PRINT("Hello World",#13)END
NOTE: The program will not run when the SmartMotor power is turned on (because of the RUN?command on the first line).
When you run this program, it outputs the following text to the Terminal window:
Hello World
To run this program, you must download it to the SmartMotor and then enter the RUN command in theTerminal window. For more details on downloading the program, see Downloading a Program to theSmartMotor on page 50. For more details on running the downloaded program, see Running aDownloaded Program on page 52.
Part 1: Programming: Creating a "Hello World" Program
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 50 of 948
Adding Comments to the Code
You can add comments to the code by inserting a single quotation mark (') between the commands andyour comment text.
NOTE: Comments do not get sent to the SmartMotor.
RUN? 'The program stops here until it receives a RUN commandPRINT("Hello World",#13) '#13 is a carriage returnEND 'The required END command
Checking the Program Syntax
You can syntax check the program by doing one of the following:
l From the main menu, select Compile > Scan file for errors
l Select the Scan File for Errors button on the toolbar
l Press Ctrl+F7
If errors are found, correct them and re-check the syntax.
The program will also be syntax checked as part of the download procedure. For details, seeDownloading a Program to the SmartMotor on page 50.
Saving the Program
After entering the program, you can save it as follows:
1. From the main menu, select: File > Save As, or click the Save button ( ) on the toolbar. TheSave As window opens.
2. Select a drive/folder on your PC or use the default location.
3. Assign a name, such as "HelloWorld.sms".
4. Click Save to write the program to the specified location and close the window.
If you attempt to syntax check or compile and download an unsaved program, the SMI softwareautomatically opens the Save As window, which requires you to save the program before continuing.
Downloading a Program to the SmartMotorNOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
After you've created a program, it must be downloaded to the SmartMotor. This section explains howto syntax check and download the program.
NOTE: Comments do not get sent to the SmartMotor.
Part 1: Programming: Adding Comments to the Code
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 51 of 948
Syntax Checking, Compiling and Downloading the Program
The program can be syntax checked, compiled and transmitted to the SmartMotor in one operation.
To compile the program and then transmit it to the SmartMotor:
NOTE: SMI transmits the compiled version of the program to the SmartMotor.
1. Click the Compile and Download Program button ( ) on the toolbar or press the F5 key. TheSelect Motor window opens, which is used to specify which motor(s) will receive the program.
2. Select the desired motor(s) from the list. The SMI software compiles the program during thisstep and also checks for errors. If errors are found, make the necessary corrections and tryagain.
3. Click OK to close the window and transmit the program. A progress bar shows the status of thetransmission.
Because the SmartMotor's EEPROM (long-term memory) is slow to write, the terminal software usestwo-way communications to regulate the download of a new program.
Additional Notes on Downloaded Programs
Keep the following items in mind regarding programs that have been downloaded to the SmartMotor:
l After the program has been downloaded into the SmartMotor, it remains there until replaced.
l The downloaded program executes every time power is applied to the motor.
l There is a 500 ms timeout before the motor will accept commands on the serial port. Anycommands sent during that time are buffered and then accepted once the 500 mstimeout expires. Because incoming commands take priority over the internal program,buffered commands run before the internal program begins.
l If you do not want the program to execute every time power is applied, you must add aRUN? command as the first line/command of the program. For an example, see Creating a"Hello World" Program on page 49.
l To get a program to operate continuously, write a loop. For details, see Program FlowDetails on page 180.
l A program cannot be erased; it can only be replaced. To effectively replace a program withnothing, download a program with only one command: END.
Remember that all programs, even "empty" ones, must contain at least one END command. Formore details on program requirements, see Understanding the Program Requirements on page48.
Part 1: Programming: Syntax Checking, Compiling and Downloading the Program
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 52 of 948
Running a Downloaded Program
WARNING: The larger SmartMotors can shake, move quickly and exert great force.Therefore, proper motor restraints must be used, and safety precautions must beconsidered in the workcell design (see Other Safety Considerations on page 30).
NOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
After the program has downloaded to the SmartMotor, the Program Download window opens, whichcontains options relating to running the program.
Program Download Window
Run will run the program immediately. Reset will clear all user variables and run the program as if itwere power cycled. Close will close the window without running the newly-downloaded program.
"Check to disable this message" will prevent the window from being shown after a program isdownloaded to the SmartMotor. Select that option if you always want to run the program using theTerminal window and the Run Program in Selected Motor button ( ), which is on the SMI softwaretoolbar.
Part 1: Programming: Running a Downloaded Program
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 53 of 948
Using the Program Download Window
(Refer to the previous figure.)
To run the program on all motors:
1. Select the All Motors on this channel option.
2. Click Run.
To run the program on just the selected motor:
1. Deselect the All Motors on this channel option.
2. Click Run.
Using the Terminal Window and Run Program Button
To run the program using the Terminal window and the Run Program button:
1. Use the motor selector in the Terminal window (see the following figure) to select the motor—itmust be the same motor that received the program.
2. Click the Run Program in Selected Motor button ( ) to run the program in the selected motor.
Selected Motor and Run Program Button
Using the RUN Command in the Terminal Window
To run the program using commands in the Terminal window, do one of the following:
l Type RUN in the text box and click Send or press Enter
l Type RUN directly on the terminal screen (blue) area and click Send or press Enter.
RUN Command in the Terminal Window
Part 1: Programming: Using the Program Download Window
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 54 of 948
Creating a Simple Motion Program
WARNING: The larger SmartMotors can shake, move quickly and exert great force.Therefore, proper motor restraints must be used, and safety precautions must beconsidered in the workcell design (see Other Safety Considerations on page 30).
Enter the following motion program in the SMI editing window. Pay close attention to spaces andcapitalization.
As described previously, it’s only necessary to enter text on the left side of the single quote, as thetext from the single quotation mark to the right end of the line is a comment and for information only.That said, it is always good programming practice to create well-commented code. Nothing is morefrustrating than trying to debug or decipher code that is sparsely commented.
NOTE: Comments do not get sent to the SmartMotor.
EIGN(2) 'Disable left limitEIGN(3) 'Disable right limitZS 'Reset errorsADT=100 'Set target accel/decelVT=1000000 'Set target velocityPT=100000 'Set target positionG 'Go, starts the moveTWAIT 'Wait for move to completePT=0 'Set buffered move back to homeG 'Start motionEND 'End program
After entering the program code, you can download it to the motor and then run it. For details ondownloading the program, see Downloading a Program to the SmartMotor on page 50. For details onrunning the downloaded program, see Running a Downloaded Program on page 52.
Part 1: Programming: Creating a Simple Motion Program
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 55 of 948
SMI Software FeaturesThis chapter provides information on SMI software features.
Introduction 56
Menu Bar 57
Toolbar 57
Configuration Window 59
Terminal Window 62
Initiating Motion from the Terminal Window 64
Information Window 64
Program Editor 65
Motor View 67
SMI Trace Functions 68
Monitor Window 71
Serial Data Analyzer 73
Chart View 74
Chart View Example 75
Macros (Keyboard Shortcuts or Hotkeys) 78
Tuner 80
SMI Options 84
SMI Help 85
Context-Sensitive Help Using F1 85
Context-Sensitive Help Using the Mouse 85
Help Buttons 85
Hover Help 85
Table of Contents 85
Projects 86
SmartMotor Playground 87
Opening the SmartMotor Playground 88
Moving the Motor 89
Part 1: Programming: SMI Software Features
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 56 of 948
IntroductionNOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
The SMI software interface provides access to a variety of tools that are used to communicate with,program and monitor the SmartMotor.
The SMI software also provides limited support for the DS2020 Combitronic system. The followingtools/features are supported:
l Tools menu items:
l Macro
l Motor View
l Chart View
l Configuration tree right-click menu items:
l Motor View
l Set Motor Address
l Configure DS2020
The SMI software interface can be accessed from the Windows Desktop icon or from the WindowsStart menu. For details, see Accessing the SMI Software Interface in the SmartMotor Installation &Startup Guide for your motor.
Menu bar
Toolbar
Con!gurationwindow
Terminalwindow
Informationwindow
Programeditor
Main Features of the SMI Software
Part 1: Programming: Introduction
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 57 of 948
NOTE: Depending on your version of SMI software, your screens may look slightly different thanthose shown.
The primary software features are briefly described in the following sections. In addition to thisinformation, there are detailed descriptions of all SMI software features in the software's online help,which can be accessed from the software's Help menu or by pressing the F1 key.
Menu BarNOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
The SMI software menu bar provides access to all SMI software features, which are grouped byfunctional area.
The Menu Bar
NOTE: Frequently-used features are also available from the SMI software's Toolbar. For details,see Toolbar on page 57.
Each functional area is described in the following table.
Menu DescriptionFile Access standard file commands (New, Open, Close, etc.).
Edit Edit an SMI program (Cut, Copy, Paste, etc.). Note that an SMI Program Editorwindow must be open to use these features.
View Show or hide windows or items in the SMI software interface (Toolbar, Statusbar, Terminal window, etc.).
Communication Control communications with motors (Settings, Detect Motors, Upload Program,Communication Setup Wizard, etc.).
CompileScan a program for errors and compile SMX or project files (Scan for errors,Compile Downloadable SMX file, Compile and Transmit SMX file, Compile Pro-ject, etc.).
Tools Access SmartMotor tools, monitoring features and options (Macro, Tuner, MotorView, Monitor View, Options, etc.)
Window Control the appearance of the SMI software windows (Cascade, Tile Hori-zontally/Vertically, Arrange Icons, etc.).
Help Access online help features of the SMI software (Contents, Index, SmartMotorProgrammer's Guide, etc.).
Each menu item is described in detail in the SMI software's online help file, which can be accessedfrom the Help menu or by pressing the F1 key.
ToolbarNOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
Part 1: Programming: Menu Bar
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 58 of 948
The SMI software toolbar provides quick access to the SMI software's frequently-used features. Eachitem is represented by an icon, as shown in the following figure.
The Toolbar
NOTE: The entire set of SMI software features can be accessed from the menu bar. For details, seeMenu Bar on page 57.
Each icon is described in the following table.
Icon MenuCommand Description
New Create a new document.
Open Open an existing document.
Save Save the active document.
Save All Save the Project and all open documents.
Cut Cut the selection and put it on the Clipboard.
Copy Copy the selection and put it on the Clipboard.
Paste Insert Clipboard contents.
Configuration Show or hide the Configuration window.
Terminal Show or hide the Terminal window.
Information Show or hide the Information window.Serial Data Ana-lyzer Show or hide the Serial Data Analyzer ("sniffer").
Find Motors Detect all available motors connected to the defined serial ports ofthe computer.
Detect Motors Detect motors connected to the currently-selected port in the Ter-minal window.Compile and Down-load Project
Compile and download all user programs defined in the project totheir associated motors.
Compile and Trans-mit SMX File
Compile and download the program in the active view to its asso-ciated motor.
Scan for errors Scan the program in the active view.
Upload Program Upload the program in a motor to an SMI file.
Run Program Send a RUN command to the selected motor in the Terminal window.
Stop Running Pro-gram
Send an END command to the selected motor in the Terminal win-dow.
Part 1: Programming: Toolbar
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 59 of 948
Icon MenuCommand Description
Stop all Motors Send an END and then an S command to all motors.
Decelerate allMotors to a Stop Send an END and then an X command to all motors.
SmartMotor Play-ground
Opens the SmartMotor Playground, where you can monitor and jog asingle motor in Position, Velocity and Torque modes.
Context Help Opens the context help for the selected item.
Each item is described in detail in the SMI software's online help file, which can be accessed from theHelp menu or by pressing the F1 key.
Configuration WindowNOTE: In addition to the software information in this section, there is context-sensitive helpavailable within the SMI software interface, which is accessed by pressing the F1 key or selectingHelp from the SMI software main menu.
The Configuration window shows the current configuration and allows access to specific ports andmotors. The Configuration window is essential to keeping multiple SmartMotor systems organized,especially in the context of developing multiple programs and debugging their operation.
The Configuration window is typically visible when the SMI software opens. If the window has beenclosed, you can open it from the SMI software main menu by selecting:
View > Configuration
NOTE: When the window is visible, the menu item will have a check mark next to it.
Part 1: Programming: Configuration Window
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 60 of 948
Configuration Window
The Configuration window is essential to keeping multiple SmartMotor systems organized.
To use the Configuration window:
l Click Find Motors to analyze your system, or
Right-click on an available port to display a menu, and select either "detect motors" or "addressmotors" to find motors attached to that port.
Part 1: Programming: Configuration Window
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 61 of 948
l You can double-click on any port to view its properties, as shown in the following figure.
Port Properties Window
l You can also double-click on any motor to open the Motor View tool for that motor, as shown inthe following figure.
Motor View Window
Part 1: Programming: Configuration Window
Pa
rt 1
: Pro
gra
mm
ing
Moog Animatics SmartMotor™ Developer's Guide, Rev. O
Page 62 of 948
l By right-clicking the motor, you